summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--avmedia/source/framework/makefile.mk1
-rw-r--r--avmedia/source/quicktime/avmediaQuickTime.map8
-rw-r--r--avmedia/source/quicktime/makefile.mk2
-rw-r--r--basic/inc/basic/sberrors.hxx3
-rw-r--r--basic/inc/basic/sbmod.hxx15
-rw-r--r--basic/inc/basic/sbobjmod.hxx113
-rw-r--r--basic/inc/basic/sbstar.hxx5
-rw-r--r--basic/inc/basic/sbuno.hxx2
-rw-r--r--basic/inc/basic/sbx.hxx2
-rw-r--r--basic/inc/basic/sbxdef.hxx4
-rw-r--r--basic/inc/basic/sbxvar.hxx11
-rw-r--r--basic/inc/pch/precompiled_basic.hxx2
-rwxr-xr-x[-rw-r--r--]basic/prj/build.lst4
-rw-r--r--basic/source/app/basic.src4
-rw-r--r--basic/source/basmgr/basmgr.cxx68
-rw-r--r--basic/source/classes/disas.cxx3
-rw-r--r--basic/source/classes/errobject.cxx225
-rw-r--r--basic/source/classes/eventatt.cxx117
-rw-r--r--basic/source/classes/makefile.mk18
-rwxr-xr-x[-rw-r--r--]basic/source/classes/sb.cxx166
-rw-r--r--basic/source/classes/sb.src4
-rw-r--r--basic/source/classes/sbunoobj.cxx342
-rw-r--r--basic/source/classes/sbxmod.cxx496
-rw-r--r--basic/source/comp/codegen.cxx11
-rw-r--r--basic/source/comp/dim.cxx75
-rw-r--r--basic/source/comp/exprgen.cxx6
-rw-r--r--basic/source/comp/exprnode.cxx14
-rw-r--r--basic/source/comp/exprtree.cxx72
-rw-r--r--basic/source/comp/io.cxx37
-rw-r--r--basic/source/comp/parser.cxx75
-rw-r--r--basic/source/comp/symtbl.cxx2
-rw-r--r--basic/source/comp/token.cxx58
-rw-r--r--basic/source/inc/codegen.hxx1
-rw-r--r--basic/source/inc/dlgcont.hxx9
-rw-r--r--basic/source/inc/errobject.hxx52
-rw-r--r--basic/source/inc/expr.hxx20
-rw-r--r--basic/source/inc/image.hxx1
-rw-r--r--basic/source/inc/namecont.hxx40
-rw-r--r--basic/source/inc/opcodes.hxx1
-rw-r--r--basic/source/inc/parser.hxx3
-rw-r--r--basic/source/inc/runtime.hxx12
-rw-r--r--basic/source/inc/sbintern.hxx3
-rw-r--r--basic/source/inc/scriptcont.hxx26
-rw-r--r--basic/source/inc/symtbl.hxx6
-rw-r--r--basic/source/inc/token.hxx20
-rw-r--r--basic/source/runtime/dllmgr.cxx1157
-rw-r--r--basic/source/runtime/dllmgr.hxx71
-rw-r--r--basic/source/runtime/makefile.mk24
-rw-r--r--basic/source/runtime/methods.cxx100
-rw-r--r--basic/source/runtime/methods1.cxx26
-rw-r--r--basic/source/runtime/os2.asm103
-rw-r--r--basic/source/runtime/props.cxx18
-rw-r--r--basic/source/runtime/rtlproto.hxx1
-rwxr-xr-x[-rw-r--r--]basic/source/runtime/runtime.cxx106
-rw-r--r--basic/source/runtime/stdobj.cxx9
-rw-r--r--basic/source/runtime/step0.cxx48
-rw-r--r--basic/source/runtime/step1.cxx16
-rw-r--r--basic/source/runtime/step2.cxx32
-rw-r--r--basic/source/runtime/win.asm80
-rw-r--r--basic/source/runtime/wnt-mingw.s98
-rw-r--r--basic/source/runtime/wnt.asm100
-rw-r--r--basic/source/sbx/format.src2
-rw-r--r--basic/source/sbx/sbxscan.cxx2
-rw-r--r--basic/source/sbx/sbxvar.cxx57
-rw-r--r--basic/source/uno/dlgcont.cxx11
-rw-r--r--basic/source/uno/namecont.cxx150
-rw-r--r--basic/source/uno/scriptcont.cxx183
-rw-r--r--basic/util/makefile.mk1
-rw-r--r--configmgr/prj/build.lst1
-rw-r--r--configmgr/prj/d.lst11
-rw-r--r--configmgr/qa/unit/makefile.mk2
-rw-r--r--configmgr/qa/unoapi/Test.java50
-rw-r--r--configmgr/qa/unoapi/makefile.mk20
-rw-r--r--configmgr/source/README1
-rw-r--r--configmgr/source/access.cxx16
-rw-r--r--configmgr/source/components.cxx90
-rw-r--r--configmgr/source/components.hxx23
-rw-r--r--configmgr/source/data.cxx14
-rw-r--r--configmgr/source/data.hxx5
-rw-r--r--configmgr/source/groupnode.cxx12
-rw-r--r--configmgr/source/groupnode.hxx4
-rw-r--r--configmgr/source/localizedpropertynode.cxx2
-rw-r--r--configmgr/source/localizedpropertynode.hxx2
-rw-r--r--configmgr/source/localizedvaluenode.cxx2
-rw-r--r--configmgr/source/localizedvaluenode.hxx2
-rw-r--r--configmgr/source/makefile.mk5
-rw-r--r--configmgr/source/node.hxx2
-rw-r--r--configmgr/source/nodemap.cxx2
-rw-r--r--configmgr/source/partial.cxx137
-rw-r--r--configmgr/source/partial.hxx71
-rw-r--r--configmgr/source/propertynode.cxx2
-rw-r--r--configmgr/source/propertynode.hxx2
-rw-r--r--configmgr/source/rootaccess.cxx11
-rw-r--r--configmgr/source/rootaccess.hxx2
-rw-r--r--configmgr/source/services.cxx17
-rw-r--r--configmgr/source/setnode.cxx11
-rw-r--r--configmgr/source/setnode.hxx4
-rw-r--r--configmgr/source/update.cxx154
-rw-r--r--configmgr/source/update.hxx59
-rw-r--r--configmgr/source/valueparser.cxx22
-rw-r--r--configmgr/source/valueparser.hxx4
-rw-r--r--configmgr/source/writemodfile.cxx70
-rw-r--r--configmgr/source/xcdparser.cxx4
-rw-r--r--configmgr/source/xcdparser.hxx4
-rw-r--r--configmgr/source/xcsparser.cxx95
-rw-r--r--configmgr/source/xcsparser.hxx4
-rw-r--r--configmgr/source/xcuparser.cxx310
-rw-r--r--configmgr/source/xcuparser.hxx27
-rw-r--r--connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk7
-rw-r--r--connectivity/inc/connectivity/PColumn.hxx32
-rw-r--r--connectivity/inc/connectivity/SQLStatementHelper.hxx54
-rw-r--r--connectivity/inc/connectivity/TTableHelper.hxx3
-rw-r--r--connectivity/inc/connectivity/dbtools.hxx38
-rw-r--r--connectivity/inc/connectivity/sdbcx/VColumn.hxx1
-rw-r--r--connectivity/inc/connectivity/sqliterator.hxx8
-rw-r--r--connectivity/inc/connectivity/sqlnode.hxx5
-rw-r--r--connectivity/prj/build.lst2
-rw-r--r--connectivity/qa/connectivity/tools/CRMDatabase.java2
-rw-r--r--connectivity/qa/connectivity/tools/makefile.mk3
-rw-r--r--connectivity/qa/drivers/dbase/test.properties1
-rw-r--r--connectivity/source/commontools/DateConversion.cxx58
-rwxr-xr-xconnectivity/source/commontools/DriversConfig.cxx36
-rw-r--r--connectivity/source/commontools/TColumnsHelper.cxx27
-rw-r--r--connectivity/source/commontools/TTableHelper.cxx5
-rw-r--r--connectivity/source/commontools/dbtools.cxx46
-rw-r--r--connectivity/source/commontools/dbtools2.cxx58
-rw-r--r--connectivity/source/commontools/propertyids.cxx2
-rw-r--r--connectivity/source/cpool/dbpool.map8
-rw-r--r--connectivity/source/cpool/makefile.mk2
-rw-r--r--connectivity/source/dbtools/dbt.map8
-rw-r--r--connectivity/source/drivers/adabas/BColumns.cxx1
-rw-r--r--connectivity/source/drivers/adabas/adabas.map8
-rwxr-xr-xconnectivity/source/drivers/adabas/adabas.xcu5
-rw-r--r--connectivity/source/drivers/adabas/makefile.mk2
-rw-r--r--connectivity/source/drivers/ado/AColumn.cxx7
-rwxr-xr-xconnectivity/source/drivers/ado/ado.xcu10
-rw-r--r--connectivity/source/drivers/calc/CTable.cxx11
-rw-r--r--connectivity/source/drivers/calc/calc.map8
-rw-r--r--connectivity/source/drivers/calc/makefile.mk2
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx2
-rw-r--r--connectivity/source/drivers/dbase/dbase.map10
-rwxr-xr-xconnectivity/source/drivers/dbase/dbase.xcu5
-rw-r--r--connectivity/source/drivers/dbase/makefile.mk2
-rw-r--r--connectivity/source/drivers/evoab/evoab.map8
-rw-r--r--connectivity/source/drivers/evoab/makefile.mk2
-rw-r--r--connectivity/source/drivers/evoab2/NColumns.cxx1
-rw-r--r--connectivity/source/drivers/evoab2/NStatement.cxx7
-rw-r--r--connectivity/source/drivers/evoab2/evoab2.map8
-rw-r--r--connectivity/source/drivers/evoab2/makefile.mk2
-rw-r--r--connectivity/source/drivers/file/FColumns.cxx1
-rw-r--r--connectivity/source/drivers/file/FPreparedStatement.cxx1
-rw-r--r--connectivity/source/drivers/file/fcomp.cxx37
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx2
-rw-r--r--connectivity/source/drivers/flat/flat.map8
-rw-r--r--connectivity/source/drivers/flat/makefile.mk2
-rwxr-xr-xconnectivity/source/drivers/hsqldb/hsqldb.xcu5
-rw-r--r--connectivity/source/drivers/jdbc/jdbc.map8
-rwxr-xr-xconnectivity/source/drivers/jdbc/jdbc.xcu5
-rw-r--r--connectivity/source/drivers/jdbc/makefile.mk2
-rw-r--r--connectivity/source/drivers/kab/KColumns.cxx1
-rw-r--r--connectivity/source/drivers/kab/KStatement.cxx11
-rw-r--r--connectivity/source/drivers/kab/kab.map8
-rw-r--r--connectivity/source/drivers/kab/kabdrv.map2
-rw-r--r--connectivity/source/drivers/kab/makefile.mk2
-rwxr-xr-xconnectivity/source/drivers/macab/MacabColumns.cxx1
-rwxr-xr-xconnectivity/source/drivers/macab/MacabConnection.cxx3
-rwxr-xr-xconnectivity/source/drivers/macab/MacabServices.cxx6
-rwxr-xr-xconnectivity/source/drivers/macab/MacabStatement.cxx11
-rwxr-xr-xconnectivity/source/drivers/macab/macab.map8
-rwxr-xr-xconnectivity/source/drivers/macab/macab.xcu2
-rwxr-xr-xconnectivity/source/drivers/macab/macabdrv.map6
-rwxr-xr-xconnectivity/source/drivers/macab/makefile.mk4
-rw-r--r--connectivity/source/drivers/mozab/MColumns.cxx1
-rw-r--r--connectivity/source/drivers/mozab/MPreparedStatement.cxx1
-rw-r--r--connectivity/source/drivers/mozab/MResultSet.cxx21
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/makefile.mk2
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/mozbootstrap.map8
-rw-r--r--connectivity/source/drivers/mozab/makefile.mk2
-rw-r--r--connectivity/source/drivers/mozab/mozab.map8
-rw-r--r--connectivity/source/drivers/mozab/mozabdrv.map2
-rw-r--r--connectivity/source/drivers/mysql/YTable.cxx10
-rw-r--r--connectivity/source/drivers/mysql/YTables.cxx14
-rw-r--r--connectivity/source/drivers/mysql/makefile.mk2
-rw-r--r--connectivity/source/drivers/mysql/mysql.map8
-rwxr-xr-xconnectivity/source/drivers/mysql/mysql.xcu25
-rw-r--r--connectivity/source/drivers/odbc/makefile.mk2
-rw-r--r--connectivity/source/drivers/odbc/odbc.map8
-rw-r--r--connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx2
-rw-r--r--connectivity/source/drivers/odbcbase/OResultSet.cxx2
-rw-r--r--connectivity/source/drivers/odbcbase/OTools.cxx1
-rw-r--r--connectivity/source/inc/mysql/YTables.hxx7
-rw-r--r--connectivity/source/inc/propertyids.hxx2
-rw-r--r--connectivity/source/manager/makefile.mk2
-rw-r--r--connectivity/source/manager/sdbc.map8
-rw-r--r--connectivity/source/parse/PColumn.cxx70
-rw-r--r--connectivity/source/parse/sqlbison.y1152
-rw-r--r--connectivity/source/parse/sqlflex.l539
-rw-r--r--connectivity/source/parse/sqliterator.cxx136
-rw-r--r--connectivity/source/parse/sqlnode.cxx55
-rw-r--r--connectivity/source/sdbcx/VColumn.cxx4
-rw-r--r--connectivity/source/sdbcx/VIndexColumn.cxx1
-rw-r--r--connectivity/source/sdbcx/VKeyColumn.cxx1
-rw-r--r--desktop/inc/app.hxx5
-rw-r--r--desktop/inc/deployment.hrc1
-rw-r--r--desktop/prj/build.lst5
-rw-r--r--desktop/qa/deployment_misc/makefile.mk1
-rw-r--r--desktop/scripts/soffice.sh13
-rw-r--r--desktop/scripts/unopkg.sh4
-rw-r--r--desktop/source/app/app.cxx91
-rw-r--r--desktop/source/app/appfirststart.cxx4
-rw-r--r--desktop/source/app/appinit.cxx5
-rwxr-xr-x[-rw-r--r--]desktop/source/app/check_ext_deps.cxx305
-rw-r--r--desktop/source/app/cmdlineargs.cxx13
-rw-r--r--desktop/source/app/cmdlineargs.hxx2
-rw-r--r--desktop/source/app/copyright_ascii_ooo.c8
-rw-r--r--desktop/source/app/copyright_ascii_sun.c14
-rw-r--r--desktop/source/app/desktop.src2
-rw-r--r--desktop/source/app/makefile.mk14
-rw-r--r--desktop/source/app/version.map2
-rw-r--r--desktop/source/deployment/deployment.map8
-rw-r--r--desktop/source/deployment/dp_services.cxx19
-rw-r--r--desktop/source/deployment/dp_xml.cxx209
-rw-r--r--desktop/source/deployment/gui/dp_gui.h9
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/gui/dp_gui.hrc5
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/gui/dp_gui_dialog.src20
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/gui/dp_gui_dialog2.cxx190
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/gui/dp_gui_dialog2.hxx40
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.src12
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx203
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx13
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.cxx111
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.hxx28
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/gui/dp_gui_service.cxx10
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/gui/dp_gui_theextmgr.cxx179
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/gui/dp_gui_theextmgr.hxx22
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedata.hxx40
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.cxx403
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.hxx25
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.src12
-rw-r--r--desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx50
-rw-r--r--desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx6
-rw-r--r--desktop/source/deployment/gui/license_dialog.cxx11
-rw-r--r--desktop/source/deployment/gui/license_dialog.hxx1
-rw-r--r--desktop/source/deployment/gui/makefile.mk3
-rw-r--r--desktop/source/deployment/inc/dp_descriptioninfoset.hxx23
-rw-r--r--desktop/source/deployment/inc/dp_misc.h33
-rw-r--r--desktop/source/deployment/inc/dp_ucb.h7
-rwxr-xr-xdesktop/source/deployment/inc/dp_update.hxx147
-rw-r--r--desktop/source/deployment/inc/dp_version.hxx7
-rw-r--r--desktop/source/deployment/inc/dp_xml.h104
-rw-r--r--desktop/source/deployment/makefile.mk6
-rw-r--r--desktop/source/deployment/manager/dp_activepackages.cxx28
-rw-r--r--desktop/source/deployment/manager/dp_activepackages.hxx19
-rw-r--r--desktop/source/deployment/manager/dp_commandenvironments.cxx286
-rw-r--r--desktop/source/deployment/manager/dp_commandenvironments.hxx160
-rw-r--r--desktop/source/deployment/manager/dp_extensionmanager.cxx1361
-rw-r--r--desktop/source/deployment/manager/dp_extensionmanager.hxx307
-rw-r--r--desktop/source/deployment/manager/dp_informationprovider.cxx380
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx927
-rw-r--r--desktop/source/deployment/manager/dp_manager.h69
-rw-r--r--desktop/source/deployment/manager/dp_manager.hrc2
-rw-r--r--desktop/source/deployment/manager/dp_manager.src4
-rw-r--r--desktop/source/deployment/manager/dp_managerfac.cxx4
-rw-r--r--desktop/source/deployment/manager/dp_properties.cxx169
-rw-r--r--desktop/source/deployment/manager/dp_properties.hxx81
-rw-r--r--desktop/source/deployment/manager/makefile.mk5
-rw-r--r--desktop/source/deployment/migration/dp_migration.cxx251
-rw-r--r--desktop/source/deployment/misc/dp_dependencies.cxx16
-rw-r--r--desktop/source/deployment/misc/dp_descriptioninfoset.cxx256
-rw-r--r--desktop/source/deployment/misc/dp_misc.cxx177
-rw-r--r--desktop/source/deployment/misc/dp_platform.cxx15
-rw-r--r--desktop/source/deployment/misc/dp_ucb.cxx46
-rwxr-xr-xdesktop/source/deployment/misc/dp_update.cxx397
-rw-r--r--desktop/source/deployment/misc/dp_version.cxx6
-rw-r--r--desktop/source/deployment/misc/makefile.mk6
-rw-r--r--desktop/source/deployment/registry/component/dp_compbackenddb.cxx156
-rw-r--r--desktop/source/deployment/registry/component/dp_compbackenddb.hxx120
-rw-r--r--desktop/source/deployment/registry/component/dp_component.cxx540
-rw-r--r--desktop/source/deployment/registry/component/makefile.mk3
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configuration.cxx275
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx186
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx96
-rw-r--r--desktop/source/deployment/registry/configuration/makefile.mk3
-rw-r--r--desktop/source/deployment/registry/dp_backend.cxx274
-rw-r--r--desktop/source/deployment/registry/dp_backenddb.cxx649
-rw-r--r--desktop/source/deployment/registry/dp_registry.cxx53
-rw-r--r--desktop/source/deployment/registry/executable/dp_executable.cxx94
-rw-r--r--desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx84
-rw-r--r--desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx79
-rw-r--r--desktop/source/deployment/registry/executable/makefile.mk3
-rw-r--r--desktop/source/deployment/registry/help/dp_help.cxx318
-rw-r--r--desktop/source/deployment/registry/help/dp_helpbackenddb.cxx178
-rw-r--r--desktop/source/deployment/registry/help/dp_helpbackenddb.hxx92
-rw-r--r--desktop/source/deployment/registry/help/makefile.mk3
-rw-r--r--desktop/source/deployment/registry/inc/dp_backend.h105
-rw-r--r--desktop/source/deployment/registry/inc/dp_backenddb.hxx170
-rw-r--r--desktop/source/deployment/registry/makefile.mk3
-rw-r--r--desktop/source/deployment/registry/package/dp_description.cxx205
-rw-r--r--desktop/source/deployment/registry/package/dp_description.hxx125
-rw-r--r--desktop/source/deployment/registry/package/dp_extbackenddb.cxx135
-rw-r--r--desktop/source/deployment/registry/package/dp_extbackenddb.hxx96
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx607
-rw-r--r--desktop/source/deployment/registry/package/makefile.mk2
-rw-r--r--desktop/source/deployment/registry/script/dp_script.cxx304
-rw-r--r--desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx88
-rw-r--r--desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx76
-rw-r--r--desktop/source/deployment/registry/script/makefile.mk3
-rw-r--r--desktop/source/deployment/registry/sfwk/dp_sfwk.cxx24
-rw-r--r--desktop/source/deployment/unopkg/unopkg.src7
-rw-r--r--desktop/source/inc/exithelper.hxx6
-rwxr-xr-x[-rw-r--r--]desktop/source/migration/migration.cxx808
-rw-r--r--desktop/source/migration/migration_impl.hxx127
-rw-r--r--desktop/source/migration/pages.cxx16
-rw-r--r--desktop/source/migration/pages.hxx8
-rw-r--r--desktop/source/migration/services/cexports.cxx12
-rwxr-xr-xdesktop/source/migration/services/extensionmigration.cxx540
-rwxr-xr-xdesktop/source/migration/services/extensionmigration.hxx130
-rw-r--r--desktop/source/migration/services/makefile.mk4
-rw-r--r--desktop/source/migration/services/migrationoo2.map8
-rwxr-xr-xdesktop/source/migration/services/oo3extensionmigration.cxx88
-rwxr-xr-xdesktop/source/migration/services/oo3extensionmigration.hxx12
-rw-r--r--desktop/source/migration/wizard.cxx9
-rw-r--r--desktop/source/migration/wizard.hxx3
-rw-r--r--desktop/source/offacc/acceptor.cxx6
-rw-r--r--desktop/source/offacc/acceptor.hxx1
-rw-r--r--desktop/source/offacc/exports.map10
-rw-r--r--desktop/source/offacc/makefile.mk2
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_app.cxx254
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx57
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_misc.cxx42
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_shared.h10
-rw-r--r--desktop/source/pkgchk/unopkg/version.map2
-rw-r--r--desktop/source/so_comp/exports.map10
-rw-r--r--desktop/source/so_comp/makefile.mk2
-rw-r--r--desktop/source/splash/exports.map10
-rw-r--r--desktop/source/splash/makefile.mk2
-rw-r--r--desktop/source/splash/splash.cxx27
-rw-r--r--desktop/source/splash/splash.hxx1
-rw-r--r--desktop/test/deployment/boxt/Addons.xcu50
-rw-r--r--desktop/test/deployment/boxt/ProtocolHandler.xcu (renamed from configmgr/inc/configmgr/update.hxx)41
-rw-r--r--desktop/test/deployment/boxt/boxt.cxx235
-rw-r--r--desktop/test/deployment/boxt/description.xml39
-rw-r--r--desktop/test/deployment/boxt/makefile.mk70
-rw-r--r--desktop/test/deployment/boxt/manifest.xml37
-rwxr-xr-xdesktop/unx/source/officeloader/officeloader.cxx2
-rw-r--r--desktop/util/makefile.mk73
-rw-r--r--desktop/util/ooverinfo.rc4
-rw-r--r--desktop/util/ooverinfo2.rc2
-rw-r--r--desktop/util/verinfo.rc4
-rw-r--r--desktop/win32/source/applauncher/makefile.mk2
-rw-r--r--desktop/win32/source/applauncher/ooo/makefile.mk2
-rw-r--r--desktop/win32/source/officeloader/officeloader.cxx11
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx45
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx14
-rw-r--r--drawinglayer/prj/d.lst2
-rw-r--r--drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx20
-rw-r--r--drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx7
-rw-r--r--drawinglayer/source/primitive2d/metafileprimitive2d.cxx243
-rw-r--r--drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx6
-rw-r--r--drawinglayer/source/processor2d/vclhelpergradient.cxx16
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx32
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx53
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx2
-rw-r--r--drawinglayer/source/processor3d/defaultprocessor3d.cxx10
-rw-r--r--drawinglayer/source/processor3d/shadow3dextractor.cxx76
-rw-r--r--drawinglayer/source/processor3d/zbufferprocessor3d.cxx2
-rw-r--r--drawinglayer/source/texture/texture.cxx130
-rw-r--r--drawinglayer/source/texture/texture3d.cxx2
-rw-r--r--editeng/inc/editeng/editeng.hxx3
-rw-r--r--editeng/inc/editeng/editview.hxx4
-rw-r--r--editeng/inc/editeng/outliner.hxx8
-rw-r--r--editeng/inc/editeng/splwrap.hxx1
-rw-r--r--editeng/inc/editeng/svxacorr.hxx4
-rw-r--r--editeng/source/accessibility/AccessibleEditableTextPara.cxx20
-rw-r--r--editeng/source/editeng/editdbg.cxx2
-rw-r--r--editeng/source/editeng/editeng.cxx19
-rw-r--r--editeng/source/editeng/editview.cxx82
-rw-r--r--editeng/source/editeng/edtspell.cxx12
-rw-r--r--editeng/source/editeng/edtspell.hxx8
-rw-r--r--editeng/source/editeng/eehtml.cxx21
-rw-r--r--editeng/source/editeng/eehtml.hxx1
-rw-r--r--editeng/source/editeng/impedit.cxx13
-rw-r--r--editeng/source/editeng/impedit.hxx5
-rw-r--r--editeng/source/editeng/impedit2.cxx24
-rw-r--r--editeng/source/editeng/impedit3.cxx2
-rw-r--r--editeng/source/editeng/impedit4.cxx72
-rw-r--r--editeng/source/misc/svxacorr.cxx47
-rw-r--r--editeng/source/outliner/outlin2.cxx4
-rw-r--r--editeng/source/outliner/outlvw.cxx66
-rw-r--r--editeng/source/uno/unotext.cxx13
-rw-r--r--embeddedobj/source/inc/oleembobj.hxx2
-rw-r--r--embeddedobj/source/msole/oleembed.cxx105
-rw-r--r--embeddedobj/source/msole/olemisc.cxx3
-rw-r--r--eventattacher/source/exports.map10
-rw-r--r--eventattacher/source/makefile.mk2
-rw-r--r--fileaccess/source/exports.map10
-rw-r--r--fileaccess/source/makefile.mk2
-rw-r--r--formula/inc/formula/compiler.hrc8
-rw-r--r--formula/inc/formula/errorcodes.hxx8
-rw-r--r--formula/inc/formula/opcode.hxx4
-rw-r--r--formula/source/core/api/FormulaCompiler.cxx4
-rw-r--r--formula/util/for.map8
-rw-r--r--formula/util/forui.map8
-rw-r--r--formula/util/makefile.mk1
-rw-r--r--fpicker/source/aqua/FilterHelper.cxx11
-rw-r--r--fpicker/source/aqua/NSURL_OOoAdditions.hxx13
-rw-r--r--fpicker/source/aqua/NSURL_OOoAdditions.mm30
-rw-r--r--fpicker/source/aqua/exports.map8
-rw-r--r--fpicker/source/aqua/makefile.mk2
-rw-r--r--fpicker/source/aqua/resourceprovider.cxx2
-rw-r--r--fpicker/source/generic/exports.map8
-rw-r--r--fpicker/source/generic/makefile.mk2
-rw-r--r--fpicker/source/office/OfficeFilePicker.src2
-rw-r--r--fpicker/source/office/exports.map8
-rw-r--r--fpicker/source/office/iodlg.cxx5
-rw-r--r--fpicker/source/office/iodlg.hrc2
-rw-r--r--fpicker/source/office/iodlg.src2
-rw-r--r--fpicker/source/office/iodlgimp.cxx5
-rw-r--r--fpicker/source/office/makefile.mk2
-rw-r--r--fpicker/source/unx/gnome/SalGtkFilePicker.cxx83
-rw-r--r--fpicker/source/unx/gnome/SalGtkFolderPicker.cxx16
-rw-r--r--fpicker/source/unx/gnome/SalGtkPicker.cxx21
-rw-r--r--fpicker/source/unx/gnome/SalGtkPicker.hxx7
-rw-r--r--fpicker/source/unx/gnome/exports.map8
-rw-r--r--fpicker/source/unx/gnome/makefile.mk2
-rw-r--r--fpicker/source/unx/gnome/resourceprovider.cxx4
-rw-r--r--fpicker/source/unx/kde4/KDE4FilePicker.cxx2
-rw-r--r--fpicker/source/win32/filepicker/FPentry.cxx4
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx50
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx4
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx2
-rw-r--r--fpicker/source/win32/misc/resourceprovider.cxx2
-rw-r--r--framework/Library_fwi.mk10
-rw-r--r--framework/Library_fwk.mk1
-rw-r--r--framework/Library_fwl.mk39
-rw-r--r--framework/Package_uiconfig.mk1
-rw-r--r--framework/inc/classes/menumanager.hxx3
-rw-r--r--framework/inc/classes/resource.hrc1
-rw-r--r--framework/inc/classes/xmlnamespaces.hxx65
-rw-r--r--framework/inc/filterflags.h172
-rw-r--r--framework/inc/framework.hrc25
-rw-r--r--framework/inc/framework/imageproducer.hxx4
-rw-r--r--framework/inc/framework/sfxhelperfunctions.hxx5
-rw-r--r--framework/inc/helper/mischelper.hxx57
-rw-r--r--framework/inc/helper/popupmenucontrollerbase.hxx150
-rw-r--r--framework/inc/helper/uiconfigelementwrapperbase.hxx3
-rw-r--r--framework/inc/helper/uielementwrapperbase.hxx3
-rw-r--r--framework/inc/properties.h8
-rw-r--r--framework/inc/queries.h1
-rw-r--r--framework/inc/threadhelp/fairrwlock.hxx1
-rw-r--r--framework/inc/threadhelp/transactionmanager.hxx1
-rw-r--r--framework/inc/uielement/controlmenucontroller.hxx7
-rw-r--r--framework/inc/uielement/fontmenucontroller.hxx7
-rw-r--r--framework/inc/uielement/fontsizemenucontroller.hxx7
-rw-r--r--framework/inc/uielement/headermenucontroller.hxx7
-rw-r--r--framework/inc/uielement/langselectionmenucontroller.hxx10
-rw-r--r--framework/inc/uielement/langselectionstatusbarcontroller.hxx17
-rw-r--r--framework/inc/uielement/macrosmenucontroller.hxx7
-rw-r--r--framework/inc/uielement/newmenucontroller.hxx7
-rw-r--r--framework/inc/uielement/objectmenucontroller.hxx7
-rw-r--r--framework/inc/uielement/popupmenucontroller.hxx80
-rw-r--r--framework/inc/uielement/recentfilesmenucontroller.hxx7
-rw-r--r--framework/inc/uielement/toolbarmanager.hxx17
-rw-r--r--framework/inc/uielement/toolbarsmenucontroller.hxx7
-rw-r--r--framework/inc/uielement/uicommanddescription.hxx2
-rw-r--r--framework/inc/uielement/uielementtypenames.hxx1
-rw-r--r--framework/inc/xml/toolboxlayoutdocumenthandler.hxx59
-rw-r--r--framework/prj/d.lst3
-rw-r--r--framework/qa/unoapi/Test.java51
-rwxr-xr-xframework/qa/unoapi/knownissues.xcl3
-rwxr-xr-xframework/qa/unoapi/makefile.mk33
-rw-r--r--framework/source/classes/menumanager.cxx2
-rw-r--r--framework/source/classes/resource.src7
-rw-r--r--framework/source/constant/filter.cxx119
-rw-r--r--framework/source/constant/makefile.mk3
-rw-r--r--framework/source/fwe/classes/sfxhelperfunctions.cxx23
-rw-r--r--framework/source/fwe/helper/imageproducer.cxx2
-rw-r--r--framework/source/fwe/helper/uiconfigelementwrapperbase.cxx20
-rw-r--r--framework/source/fwe/helper/uielementwrapperbase.cxx17
-rw-r--r--framework/source/fwe/xml/menudocumenthandler.cxx14
-rw-r--r--framework/source/fwe/xml/toolboxconfiguration.cxx1
-rw-r--r--framework/source/fwi/helper/mischelper.cxx114
-rw-r--r--framework/source/fwi/helper/popupmenucontrollerbase.cxx429
-rw-r--r--framework/source/fwi/threadhelp/transactionmanager.cxx36
-rw-r--r--framework/source/fwi/uielement/rootitemcontainer.cxx1
-rw-r--r--framework/source/helper/makefile.mk35
-rw-r--r--framework/source/inc/constant/filter.hxx126
-rw-r--r--framework/source/interaction/quietinteraction.cxx16
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx8
-rw-r--r--framework/source/loadenv/loadenv.cxx13
-rw-r--r--framework/source/register/registertemp.cxx5
-rw-r--r--framework/source/services/backingwindow.cxx384
-rw-r--r--framework/source/services/backingwindow.hxx42
-rw-r--r--framework/source/services/frame.cxx3
-rw-r--r--framework/source/services/fwk_services.src94
-rw-r--r--framework/source/services/pathsettings.cxx1
-rw-r--r--framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx6
-rw-r--r--framework/source/uiconfiguration/uiconfigurationmanager.cxx3
-rw-r--r--framework/source/uielement/comboboxtoolbarcontroller.cxx1
-rw-r--r--framework/source/uielement/controlmenucontroller.cxx18
-rw-r--r--framework/source/uielement/dropdownboxtoolbarcontroller.cxx1
-rw-r--r--framework/source/uielement/edittoolbarcontroller.cxx1
-rw-r--r--framework/source/uielement/fontmenucontroller.cxx17
-rw-r--r--framework/source/uielement/fontsizemenucontroller.cxx18
-rw-r--r--framework/source/uielement/headermenucontroller.cxx19
-rw-r--r--framework/source/uielement/imagebuttontoolbarcontroller.cxx1
-rw-r--r--framework/source/uielement/langselectionmenucontroller.cxx228
-rw-r--r--framework/source/uielement/langselectionstatusbarcontroller.cxx279
-rw-r--r--framework/source/uielement/macrosmenucontroller.cxx10
-rw-r--r--framework/source/uielement/makefile.mk1
-rw-r--r--framework/source/uielement/menubarmanager.cxx11
-rw-r--r--framework/source/uielement/newmenucontroller.cxx13
-rw-r--r--framework/source/uielement/objectmenucontroller.cxx7
-rw-r--r--framework/source/uielement/popupmenucontroller.cxx248
-rw-r--r--framework/source/uielement/progressbarwrapper.cxx1
-rw-r--r--framework/source/uielement/recentfilesmenucontroller.cxx44
-rw-r--r--framework/source/uielement/spinfieldtoolbarcontroller.cxx1
-rw-r--r--framework/source/uielement/statusbarmanager.cxx1
-rw-r--r--framework/source/uielement/togglebuttontoolbarcontroller.cxx1
-rw-r--r--framework/source/uielement/toolbarmanager.cxx324
-rw-r--r--framework/source/uielement/toolbarsmenucontroller.cxx24
-rw-r--r--framework/source/uielement/toolbarwrapper.cxx1
-rw-r--r--framework/source/uielement/uicommanddescription.cxx4
-rw-r--r--framework/source/xml/makefile.mk16
-rw-r--r--framework/uiconfig/startmodule/accelerator/en-GB/default.xml28
-rw-r--r--framework/uiconfig/startmodule/accelerator/en-US/default.xml28
-rw-r--r--framework/util/exports.map10
-rw-r--r--framework/util/makefile.mk5
-rw-r--r--idl/util/svidl.hdb25
-rw-r--r--linguistic/prj/build.lst1
-rw-r--r--linguistic/qa/unoapi/Test.java51
-rw-r--r--linguistic/qa/unoapi/makefile.mk30
-rw-r--r--linguistic/source/convdiclist.cxx38
-rw-r--r--linguistic/source/dicimp.cxx48
-rw-r--r--linguistic/source/dlistimp.cxx7
-rw-r--r--linguistic/source/staticmb.cxx29
-rw-r--r--linguistic/workben/lex.map8
-rw-r--r--linguistic/workben/makefile.mk2
-rw-r--r--officecfg/prj/build.lst1
-rw-r--r--officecfg/registry/component-update.dtd5
-rwxr-xr-xofficecfg/registry/data/org/openoffice/Office/Accelerators.xcu116
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Common.xcu7
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Impress.xcu10
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Paths.xcu8
-rw-r--r--officecfg/registry/data/org/openoffice/Office/ProtocolHandler.xcu5
-rw-r--r--officecfg/registry/data/org/openoffice/Office/SFX.xcu42
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu15
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu20
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/ChartWindowState.xcu84
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu145
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu4056
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu38
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/Factories.xcu38
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu259
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu1609
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu4
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu75
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu20
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/WriterWebWindowState.xcu20
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu20
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/XFormsWindowState.xcu20
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Writer.xcu2
-rw-r--r--officecfg/registry/data/org/openoffice/Office/makefile.mk1
-rwxr-xr-xofficecfg/registry/data/org/openoffice/Setup.xcu173
-rw-r--r--officecfg/registry/data/org/openoffice/VCL.xcu73
-rw-r--r--officecfg/registry/data/org/openoffice/ucb/Configuration.xcu11
-rw-r--r--officecfg/registry/schema/oo-ldap-attr-map.properties1
-rw-r--r--officecfg/registry/schema/oo-org-map.properties1
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Calc.xcs6
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs20
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Impress.xcs2794
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Linguistic.xcs27
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Math.xcs2
-rwxr-xr-xofficecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs2
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/UI/Commands.xcs1
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/UI/WindowState.xcs15
-rw-r--r--officecfg/registry/schema/org/openoffice/Setup.xcs21
-rw-r--r--officecfg/util/alllang.xsl6
-rw-r--r--officecfg/util/makefile.mk2
-rw-r--r--oovbaapi/genconstidl/makefile.mk5
-rw-r--r--oovbaapi/ooo/vba/XApplicationBase.idl8
-rw-r--r--oovbaapi/ooo/vba/XCollection.idl1
-rw-r--r--oovbaapi/ooo/vba/XCommandBarControl.idl1
-rw-r--r--oovbaapi/ooo/vba/XDocumentBase.idl3
-rwxr-xr-xoovbaapi/ooo/vba/XVBAAppService.idl72
-rwxr-xr-xoovbaapi/ooo/vba/XVBADocService.idl72
-rw-r--r--oovbaapi/ooo/vba/constants/makefile.mk6
-rwxr-xr-xoovbaapi/ooo/vba/excel/SheetObject.idl131
-rwxr-xr-xoovbaapi/ooo/vba/excel/SheetObjects.idl150
-rw-r--r--oovbaapi/ooo/vba/excel/XApplication.idl23
-rw-r--r--oovbaapi/ooo/vba/excel/XComment.idl13
-rw-r--r--oovbaapi/ooo/vba/excel/XHyperlink.idl27
-rwxr-xr-xoovbaapi/ooo/vba/excel/XHyperlinks.idl70
-rw-r--r--oovbaapi/ooo/vba/excel/XPane.idl7
-rw-r--r--oovbaapi/ooo/vba/excel/XRange.idl3
-rw-r--r--oovbaapi/ooo/vba/excel/XWindow.idl10
-rw-r--r--oovbaapi/ooo/vba/excel/XWorksheet.idl26
-rw-r--r--oovbaapi/ooo/vba/excel/makefile.mk8
-rw-r--r--oovbaapi/ooo/vba/makefile.mk11
-rw-r--r--oovbaapi/ooo/vba/msforms/XControl.idl6
-rw-r--r--oovbaapi/ooo/vba/msforms/XControls.idl7
-rw-r--r--oovbaapi/ooo/vba/msforms/makefile.mk5
-rw-r--r--oovbaapi/prj/d.lst14
-rw-r--r--oovbaapi/util/makefile.mk5
-rw-r--r--[-rwxr-xr-x]readlicense_oo/docs/readme.xsl379
-rwxr-xr-xreadlicense_oo/docs/readme/readme.xrm831
-rw-r--r--readlicense_oo/source/license/license_en-US.html6
-rw-r--r--readlicense_oo/source/license/license_en-US.rtf645
-rw-r--r--readlicense_oo/source/license/license_en-US.txt4
-rwxr-xr-xreadlicense_oo/util/makefile.pmk7
-rw-r--r--scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java31
-rwxr-xr-xscripting/java/com/sun/star/script/framework/provider/ScriptProvider.java18
-rw-r--r--scripting/java/org/openoffice/netbeans/modules/office/filesystem/Bundle.properties1
-rw-r--r--scripting/java/org/openoffice/netbeans/modules/office/loader/Bundle.properties1
-rw-r--r--scripting/java/org/openoffice/netbeans/modules/office/options/Bundle.properties1
-rw-r--r--scripting/java/org/openoffice/netbeans/modules/office/resources/Bundle.properties1
-rw-r--r--scripting/java/org/openoffice/netbeans/modules/office/wizard/Bundle.properties1
-rwxr-xr-x[-rw-r--r--]scripting/prj/build.lst2
-rw-r--r--scripting/source/basprov/basprov.map9
-rw-r--r--scripting/source/basprov/makefile.mk2
-rw-r--r--scripting/source/dlgprov/dlgevtatt.cxx40
-rw-r--r--scripting/source/dlgprov/dlgevtatt.hxx5
-rw-r--r--scripting/source/dlgprov/dlgprov.cxx31
-rw-r--r--scripting/source/dlgprov/dlgprov.map9
-rw-r--r--scripting/source/dlgprov/makefile.mk3
-rw-r--r--scripting/source/provider/ActiveMSPList.cxx7
-rw-r--r--scripting/source/provider/ActiveMSPList.hxx1
-rw-r--r--scripting/source/pyprov/mailmerge.py120
-rw-r--r--scripting/source/stringresource/makefile.mk2
-rw-r--r--scripting/source/stringresource/stringresource.map9
-rw-r--r--scripting/source/vbaevents/eventhelper.cxx13
-rw-r--r--scripting/source/vbaevents/makefile.mk2
-rw-r--r--scripting/source/vbaevents/vbaevents.map9
-rw-r--r--sfx2/Library_sfx2.mk7
-rw-r--r--sfx2/inc/pch/precompiled_sfx2.hxx2
-rw-r--r--sfx2/inc/sfx2/Metadatable.hxx4
-rw-r--r--sfx2/inc/sfx2/app.hxx6
-rw-r--r--sfx2/inc/sfx2/basmgr.hxx3
-rwxr-xr-x[-rw-r--r--]sfx2/inc/sfx2/brokenpackageint.hxx0
-rw-r--r--sfx2/inc/sfx2/childwin.hxx42
-rw-r--r--sfx2/inc/sfx2/docfac.hxx1
-rw-r--r--sfx2/inc/sfx2/docfile.hxx2
-rw-r--r--sfx2/inc/sfx2/docfilt.hxx23
-rw-r--r--sfx2/inc/sfx2/filedlghelper.hxx24
-rw-r--r--sfx2/inc/sfx2/htmlmode.hxx68
-rw-r--r--sfx2/inc/sfx2/imagemgr.hxx2
-rw-r--r--sfx2/inc/sfx2/mnumgr.hxx22
-rw-r--r--sfx2/inc/sfx2/module.hxx2
-rwxr-xr-x[-rw-r--r--]sfx2/inc/sfx2/objsh.hxx25
-rwxr-xr-x[-rw-r--r--]sfx2/inc/sfx2/securitypage.hxx (renamed from svx/source/svdraw/svdoimp.cxx)35
-rwxr-xr-x[-rw-r--r--]sfx2/inc/sfx2/sfx.hrc5
-rw-r--r--sfx2/inc/sfx2/sfxsids.hrc34
-rw-r--r--sfx2/inc/sfx2/taskpane.hxx245
-rw-r--r--sfx2/inc/sfx2/tbxctrl.hxx1
-rw-r--r--sfx2/inc/sfx2/titledockwin.hxx162
-rw-r--r--sfx2/inc/sfx2/viewfrm.hxx66
-rw-r--r--sfx2/inc/sfx2/viewsh.hxx7
-rw-r--r--sfx2/prj/build.lst2
-rw-r--r--sfx2/qa/complex/DocumentMetadataAccessTest.java125
-rw-r--r--sfx2/qa/complex/docinfo/makefile.mk2
-rw-r--r--sfx2/qa/cppunit/makefile.mk74
-rw-r--r--sfx2/qa/cppunit/test_metadatable.cxx280
-rw-r--r--sfx2/qa/cppunit/version.map (renamed from desktop/source/deployment/migration/makefile.mk)21
-rw-r--r--sfx2/qa/unoapi/Test.java51
-rw-r--r--sfx2/qa/unoapi/makefile.mk30
-rw-r--r--sfx2/qa/unoapi/sfx.sce2
-rw-r--r--sfx2/sdi/frmslots.sdi5
-rwxr-xr-x[-rw-r--r--]sfx2/sdi/sfx.sdi81
-rw-r--r--sfx2/source/appl/app.cxx1
-rw-r--r--sfx2/source/appl/appdata.cxx5
-rw-r--r--sfx2/source/appl/appinit.cxx2
-rw-r--r--sfx2/source/appl/appmain.cxx3
-rw-r--r--sfx2/source/appl/appquit.cxx50
-rw-r--r--sfx2/source/appl/appreg.cxx1
-rw-r--r--sfx2/source/appl/appserv.cxx63
-rwxr-xr-x[-rw-r--r--]sfx2/source/appl/appuno.cxx0
-rw-r--r--sfx2/source/appl/imagemgr.cxx2
-rw-r--r--sfx2/source/appl/imestatuswindow.cxx6
-rw-r--r--sfx2/source/appl/imestatuswindow.hxx7
-rw-r--r--sfx2/source/appl/module.cxx13
-rw-r--r--sfx2/source/appl/sfxhelp.cxx15
-rw-r--r--sfx2/source/appl/shutdownicon.cxx23
-rw-r--r--sfx2/source/appl/shutdownicon.hxx1
-rw-r--r--sfx2/source/appl/shutdowniconw32.cxx50
-rw-r--r--sfx2/source/appl/workwin.cxx107
-rw-r--r--sfx2/source/bastyp/progress.cxx2
-rw-r--r--sfx2/source/bastyp/sfxhtml.cxx4
-rw-r--r--sfx2/source/control/unoctitm.cxx2
-rw-r--r--sfx2/source/dialog/about.cxx98
-rw-r--r--sfx2/source/dialog/dialog.hrc31
-rw-r--r--sfx2/source/dialog/dialog.src157
-rwxr-xr-x[-rw-r--r--]sfx2/source/dialog/dinfdlg.cxx19
-rwxr-xr-x[-rw-r--r--]sfx2/source/dialog/dinfdlg.src11
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx115
-rw-r--r--sfx2/source/dialog/filedlgimpl.hxx2
-rwxr-xr-x[-rw-r--r--]sfx2/source/dialog/makefile.mk13
-rwxr-xr-xsfx2/source/dialog/securitypage.cxx523
-rwxr-xr-x[-rw-r--r--]sfx2/source/dialog/securitypage.hrc (renamed from svx/source/engine3d/viewpt3d.cxx)28
-rwxr-xr-xsfx2/source/dialog/securitypage.src174
-rw-r--r--sfx2/source/dialog/taskpane.cxx1283
-rw-r--r--sfx2/source/dialog/taskpane.src (renamed from xmloff/source/core/xmlkywd.cxx)27
-rw-r--r--sfx2/source/dialog/titledockwin.cxx364
-rw-r--r--sfx2/source/dialog/titledockwin.src (renamed from svx/source/svdraw/svdcrtmt.hxx)15
-rw-r--r--sfx2/source/doc/Metadatable.cxx230
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx37
-rw-r--r--sfx2/source/doc/commitlistener.hxx57
-rw-r--r--sfx2/source/doc/docfac.cxx129
-rw-r--r--sfx2/source/doc/docfile.cxx56
-rw-r--r--sfx2/source/doc/docfilt.cxx14
-rw-r--r--sfx2/source/doc/guisaveas.cxx170
-rw-r--r--sfx2/source/doc/makefile.mk8
-rw-r--r--sfx2/source/doc/objcont.cxx48
-rwxr-xr-x[-rw-r--r--]sfx2/source/doc/objmisc.cxx39
-rw-r--r--sfx2/source/doc/objstor.cxx53
-rwxr-xr-x[-rw-r--r--]sfx2/source/doc/objxtor.cxx42
-rw-r--r--sfx2/source/doc/opostponedtruncationstream.cxx491
-rw-r--r--sfx2/source/doc/opostponedtruncationstream.hxx122
-rwxr-xr-xsfx2/source/doc/printhelper.cxx20
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx28
-rw-r--r--sfx2/source/doc/syspath.cxx48
-rw-r--r--sfx2/source/doc/syspath.hxx (renamed from configmgr/inc/configmgr/detail/configmgrdllapi.hxx)23
-rw-r--r--sfx2/source/doc/syspathw32.cxx83
-rw-r--r--sfx2/source/inc/appdata.hxx3
-rwxr-xr-x[-rw-r--r--]sfx2/source/inc/helpid.hrc14
-rw-r--r--sfx2/source/inc/objshimp.hxx4
-rw-r--r--sfx2/source/inc/sfxlocal.hrc12
-rw-r--r--sfx2/source/inc/workwin.hxx1
-rw-r--r--sfx2/source/menu/makefile.mk5
-rw-r--r--sfx2/source/menu/menu.hrc4
-rw-r--r--sfx2/source/menu/menu.src15
-rw-r--r--sfx2/source/menu/mnumgr.cxx120
-rw-r--r--sfx2/source/menu/thessubmenu.cxx274
-rw-r--r--sfx2/source/menu/thessubmenu.hxx107
-rw-r--r--sfx2/source/view/impviewframe.hxx4
-rw-r--r--sfx2/source/view/ipclient.cxx8
-rw-r--r--sfx2/source/view/view.hxx27
-rw-r--r--sfx2/source/view/viewfrm.cxx359
-rw-r--r--sfx2/source/view/viewimp.hxx26
-rw-r--r--sfx2/source/view/viewprn.cxx55
-rw-r--r--sfx2/util/hidother.src3
-rw-r--r--sfx2/win/res/expdesk.icobin4990 -> 0 bytes
-rw-r--r--sfx2/win/res/expexp.icobin2758 -> 0 bytes
-rw-r--r--sfx2/win/res/expfld.icobin2758 -> 0 bytes
-rw-r--r--sfx2/win/res/expftp.icobin2758 -> 0 bytes
-rw-r--r--sfx2/win/res/exptrash.icobin2758 -> 0 bytes
-rw-r--r--sfx2/win/res/expwork.icobin2758 -> 0 bytes
-rw-r--r--sfx2/win/res/frameset.icobin2758 -> 0 bytes
-rw-r--r--sfx2/win/res/search.icobin2758 -> 0 bytes
-rw-r--r--sfx2/workben/custompanel/CalcWindowState.xcu21
-rw-r--r--sfx2/workben/custompanel/DrawWindowState.xcu21
-rw-r--r--sfx2/workben/custompanel/Factories.xcu21
-rw-r--r--sfx2/workben/custompanel/ImpressWindowState.xcu21
-rw-r--r--sfx2/workben/custompanel/WriterWindowState.xcu35
-rw-r--r--sfx2/workben/custompanel/ctp_factory.cxx167
-rw-r--r--sfx2/workben/custompanel/ctp_factory.hxx83
-rw-r--r--sfx2/workben/custompanel/ctp_panel.cxx270
-rw-r--r--sfx2/workben/custompanel/ctp_panel.hxx124
-rw-r--r--sfx2/workben/custompanel/ctp_services.cxx92
-rw-r--r--sfx2/workben/custompanel/delzip0
-rw-r--r--sfx2/workben/custompanel/description.xml16
-rw-r--r--sfx2/workben/custompanel/makefile.mk120
-rw-r--r--sfx2/workben/custompanel/manifest.xml18
-rw-r--r--sfx2/workben/custompanel/panel.pngbin0 -> 202 bytes
-rwxr-xr-xshell/qa/makefile.mk2
-rw-r--r--shell/source/backends/gconfbe/gconfaccess.cxx1
-rw-r--r--shell/source/backends/kdebe/makefile.mk2
-rw-r--r--shell/source/backends/localebe/exports.map10
-rw-r--r--shell/source/backends/localebe/makefile.mk2
-rw-r--r--shell/source/backends/macbe/exports.map10
-rw-r--r--shell/source/backends/macbe/makefile.mk2
-rw-r--r--shell/source/backends/wininetbe/exports.map10
-rw-r--r--shell/source/backends/wininetbe/makefile.mk2
-rw-r--r--shell/source/cmdmail/exports.map10
-rw-r--r--shell/source/cmdmail/makefile.mk2
-rw-r--r--shell/source/tools/lngconvex/lngconvex.cxx3
-rw-r--r--shell/source/unix/exec/exports.map10
-rw-r--r--shell/source/unix/exec/makefile.mk2
-rw-r--r--shell/source/unix/misc/gnome-open-url.sh4
-rwxr-xr-xshell/source/unix/misc/open-url.sh54
-rw-r--r--shell/source/unix/sysshell/recently_used_file.cxx3
-rwxr-xr-xshell/source/unix/sysshell/recfile.map2
-rw-r--r--shell/source/win32/shlxthandler/makefile.mk7
-rw-r--r--svx/inc/extrusiondepthdialog.hxx (renamed from sfx2/source/dialog/sfxurl.cxx)43
-rw-r--r--svx/inc/globlmn_tmpl.hrc31
-rw-r--r--svx/inc/helpid.hrc3
-rw-r--r--svx/inc/svx/EnhancedCustomShape2d.hxx12
-rw-r--r--svx/inc/svx/SpellDialogChildWindow.hxx8
-rw-r--r--svx/inc/svx/extrusioncolorcontrol.hxx (renamed from svx/source/svdraw/svdscrol.cxx)31
-rw-r--r--svx/inc/svx/extrusioncontrols.hxx390
-rw-r--r--svx/inc/svx/fmshell.hxx22
-rw-r--r--svx/inc/svx/fmtools.hxx1
-rw-r--r--svx/inc/svx/fontworkgallery.hxx139
-rw-r--r--svx/inc/svx/gridctrl.hxx16
-rw-r--r--svx/inc/svx/htmlmode.hxx23
-rw-r--r--svx/inc/svx/sdr/overlay/overlaybitmapex.hxx5
-rw-r--r--svx/inc/svx/sdrmasterpagedescriptor.hxx2
-rw-r--r--svx/inc/svx/sdrobjectfilter.hxx58
-rw-r--r--svx/inc/svx/svddef.hxx3
-rw-r--r--svx/inc/svx/svdhdl.hxx14
-rw-r--r--svx/inc/svx/svdmrkv.hxx1
-rw-r--r--svx/inc/svx/svdobj.hxx19
-rw-r--r--svx/inc/svx/svdograf.hxx2
-rw-r--r--svx/inc/svx/svdomedia.hxx2
-rw-r--r--svx/inc/svx/svdotable.hxx1
-rw-r--r--svx/inc/svx/svdpage.hxx1
-rw-r--r--svx/inc/svx/svdstr.hrc2
-rwxr-xr-x[-rw-r--r--]svx/inc/svx/svxids.hrc53
-rw-r--r--svx/inc/svx/sxopitm.hxx6
-rw-r--r--svx/inc/svx/unoshprp.hxx3
-rw-r--r--svx/inc/tbunocontroller.hxx1
-rw-r--r--svx/inc/tbunosearchcontrollers.hxx282
-rw-r--r--svx/prj/build.lst4
-rw-r--r--svx/qa/unoapi/Test.java51
-rw-r--r--svx/qa/unoapi/knownissues.xcl8
-rw-r--r--svx/qa/unoapi/makefile.mk30
-rw-r--r--svx/qa/unoapi/svx.sce12
-rw-r--r--svx/sdi/fmslots.sdi2
-rw-r--r--svx/sdi/svx.sdi81
-rw-r--r--svx/source/core/coreservices.cxx183
-rw-r--r--svx/source/core/makefile.mk47
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx240
-rw-r--r--svx/source/dialog/docrecovery.src4
-rw-r--r--svx/source/dialog/hdft.cxx2
-rw-r--r--svx/source/dialog/makefile.mk2
-rw-r--r--svx/source/dialog/srchdlg.cxx14
-rw-r--r--svx/source/dialog/svxruler.cxx40
-rw-r--r--svx/source/engine3d/makefile.mk8
-rw-r--r--svx/source/engine3d/scene3d.cxx14
-rw-r--r--svx/source/engine3d/view3d.cxx170
-rw-r--r--svx/source/engine3d/volume3d.cxx32
-rw-r--r--svx/source/fmcomp/dbaexchange.cxx57
-rw-r--r--svx/source/fmcomp/fmgridcl.cxx21
-rw-r--r--svx/source/fmcomp/gridcell.cxx109
-rw-r--r--svx/source/fmcomp/gridctrl.cxx47
-rw-r--r--svx/source/form/datanavi.cxx9
-rw-r--r--svx/source/form/fmshell.cxx101
-rw-r--r--svx/source/form/fmshimp.cxx135
-rw-r--r--svx/source/form/fmtextcontrolshell.cxx2
-rw-r--r--svx/source/form/fmtools.cxx2
-rw-r--r--svx/source/form/fmundo.cxx47
-rw-r--r--svx/source/form/fmview.cxx4
-rw-r--r--svx/source/form/fmvwimp.cxx101
-rw-r--r--svx/source/form/formcontrolfactory.cxx8
-rw-r--r--svx/source/form/navigatortree.cxx2
-rw-r--r--svx/source/form/tabwin.cxx58
-rw-r--r--svx/source/inc/fmprop.hrc1
-rw-r--r--svx/source/inc/fmshimp.hxx11
-rw-r--r--svx/source/inc/fmvwimp.hxx5
-rw-r--r--svx/source/inc/gridcell.hxx3
-rw-r--r--svx/source/intro/iso.src2
-rw-r--r--svx/source/intro/makefile.mk4
-rw-r--r--svx/source/intro/ooo.src4
-rw-r--r--svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx27
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrpage.cxx16
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofgroup.cxx69
-rwxr-xr-xsvx/source/sdr/contact/viewobjectcontactofsdrobj.cxx13
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx26
-rw-r--r--svx/source/sdr/overlay/overlaybitmapex.cxx15
-rw-r--r--svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx8
-rw-r--r--svx/source/sdr/properties/attributeproperties.cxx32
-rw-r--r--svx/source/smarttags/SmartTagMgr.cxx11
-rw-r--r--svx/source/src/errtxt.src2
-rw-r--r--svx/source/svdraw/makefile.mk2
-rw-r--r--svx/source/svdraw/sdrhittesthelper.cxx2
-rw-r--r--svx/source/svdraw/sdrmasterpagedescriptor.cxx12
-rw-r--r--svx/source/svdraw/svdattr.cxx2
-rw-r--r--svx/source/svdraw/svdedtv.cxx6
-rw-r--r--svx/source/svdraw/svdedtv1.cxx4
-rw-r--r--svx/source/svdraw/svdedtv2.cxx11
-rw-r--r--svx/source/svdraw/svdedxv.cxx2
-rw-r--r--svx/source/svdraw/svdfmtf.cxx63
-rw-r--r--svx/source/svdraw/svdhdl.cxx19
-rw-r--r--svx/source/svdraw/svdmrkv.cxx44
-rw-r--r--svx/source/svdraw/svdoashp.cxx5
-rw-r--r--svx/source/svdraw/svdobj.cxx57
-rw-r--r--svx/source/svdraw/svdocirc.cxx5
-rw-r--r--svx/source/svdraw/svdoedge.cxx43
-rw-r--r--svx/source/svdraw/svdograf.cxx2
-rw-r--r--svx/source/svdraw/svdomedia.cxx49
-rw-r--r--svx/source/svdraw/svdoole2.cxx44
-rw-r--r--svx/source/svdraw/svdotext.cxx1
-rw-r--r--svx/source/svdraw/svdotextpathdecomposition.cxx104
-rw-r--r--svx/source/svdraw/svdoutl.cxx5
-rw-r--r--svx/source/svdraw/svdpage.cxx52
-rw-r--r--svx/source/svdraw/svdpagv.cxx6
-rw-r--r--svx/source/svdraw/svdscrol.hxx31
-rw-r--r--svx/source/svdraw/svdstr.src5
-rw-r--r--svx/source/svdraw/svdview.cxx4
-rw-r--r--svx/source/table/svdotable.cxx10
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.cxx1156
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.hxx260
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.src19
-rw-r--r--svx/source/tbxctrls/fontworkgallery.cxx665
-rw-r--r--svx/source/tbxctrls/fontworkgallery.src12
-rw-r--r--svx/source/tbxctrls/makefile.mk4
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx867
-rw-r--r--svx/source/tbxctrls/toolbarmenu.cxx1029
-rw-r--r--svx/source/tbxctrls/toolbarmenu.hxx90
-rw-r--r--svx/source/toolbars/extrusionbar.cxx3
-rw-r--r--svx/source/unodialogs/textconversiondlgs/export.map8
-rw-r--r--svx/source/unodialogs/textconversiondlgs/makefile.mk2
-rw-r--r--svx/source/unodraw/unoctabl.cxx62
-rw-r--r--svx/source/unodraw/unopage.cxx8
-rw-r--r--svx/source/unodraw/unoprov.cxx1
-rw-r--r--svx/source/unodraw/unoshap4.cxx12
-rw-r--r--svx/source/unodraw/unoshape.cxx102
-rw-r--r--svx/uiconfig/accelerator/default.xml5
-rw-r--r--svx/uiconfig/accelerator/en-US/default.xml29
-rw-r--r--svx/uiconfig/accelerator/es/default.xml29
-rw-r--r--svx/util/makefile.mk4
-rw-r--r--svx/workben/msview/msview.cxx2
-rw-r--r--sysui/desktop/freedesktop/freedesktop-menus.spec2
-rw-r--r--sysui/desktop/icons/hicolor/128x128/apps/startcenter.pngbin11073 -> 15601 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/hicolor/16x16/apps/printeradmin.pngbin963 -> 4259 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/apps/startcenter.pngbin1043 -> 893 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/hicolor/32x32/apps/printeradmin.pngbin2534 -> 5595 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/apps/startcenter.pngbin2375 -> 2429 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/hicolor/48x48/apps/printeradmin.pngbin4058 -> 7337 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/apps/startcenter.pngbin3615 -> 4184 bytes
-rw-r--r--sysui/desktop/icons/makefile.mk2
-rwxr-xr-xsysui/desktop/icons/ooo3_open.icobin0 -> 295606 bytes
-rwxr-xr-xsysui/desktop/icons/so9_open.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/macosx/Info.plist4
-rw-r--r--sysui/desktop/macosx/makefile.mk8
-rw-r--r--sysui/desktop/mandriva/mandriva-menus.spec2
-rw-r--r--sysui/desktop/menus/base.desktop1
-rw-r--r--sysui/desktop/menus/calc.desktop1
-rw-r--r--sysui/desktop/menus/draw.desktop1
-rw-r--r--sysui/desktop/menus/impress.desktop1
-rw-r--r--sysui/desktop/menus/math.desktop1
-rw-r--r--sysui/desktop/menus/startcenter.desktop2
-rw-r--r--sysui/desktop/menus/writer.desktop1
-rw-r--r--sysui/desktop/mimetypes/extension.desktop2
-rw-r--r--sysui/desktop/redhat/redhat-menus.spec2
-rw-r--r--sysui/desktop/share/launcher_comment.ulf2
-rw-r--r--sysui/desktop/slackware/makefile.mk6
-rw-r--r--sysui/desktop/suse/suse-menus.spec2
-rw-r--r--ucb/prj/build.lst4
-rw-r--r--ucb/qa/unoapi/Test.java51
-rw-r--r--ucb/qa/unoapi/makefile.mk30
-rw-r--r--ucb/source/cacher/exports.map8
-rw-r--r--ucb/source/cacher/makefile.mk2
-rw-r--r--ucb/source/core/exports.map8
-rw-r--r--ucb/source/core/makefile.mk2
-rw-r--r--ucb/source/core/ucb.cxx414
-rw-r--r--ucb/source/core/ucb.hxx39
-rw-r--r--ucb/source/sorter/exports.map8
-rw-r--r--ucb/source/sorter/makefile.mk2
-rw-r--r--ucb/source/ucp/expand/makefile.mk2
-rw-r--r--ucb/source/ucp/expand/ucpexpand1.uno.map8
-rw-r--r--ucb/source/ucp/ext/makefile.mk65
-rw-r--r--ucb/source/ucp/ext/ucpext_content.cxx672
-rw-r--r--ucb/source/ucp/ext/ucpext_content.hxx154
-rw-r--r--ucb/source/ucp/ext/ucpext_datasupplier.cxx375
-rw-r--r--ucb/source/ucp/ext/ucpext_datasupplier.hxx86
-rw-r--r--ucb/source/ucp/ext/ucpext_provider.cxx208
-rw-r--r--ucb/source/ucp/ext/ucpext_provider.hxx68
-rw-r--r--ucb/source/ucp/ext/ucpext_resultset.cxx99
-rw-r--r--ucb/source/ucp/ext/ucpext_resultset.hxx66
-rw-r--r--ucb/source/ucp/ext/ucpext_services.cxx93
-rw-r--r--ucb/source/ucp/file/exports.map8
-rw-r--r--ucb/source/ucp/file/makefile.mk2
-rw-r--r--ucb/source/ucp/file/shell.cxx8
-rw-r--r--ucb/source/ucp/ftp/makefile.mk2
-rw-r--r--ucb/source/ucp/ftp/ucpftp.map8
-rw-r--r--ucb/source/ucp/gio/exports.map8
-rw-r--r--ucb/source/ucp/gio/makefile.mk2
-rw-r--r--ucb/source/ucp/gvfs/exports.map8
-rw-r--r--ucb/source/ucp/gvfs/makefile.mk2
-rw-r--r--ucb/source/ucp/hierarchy/makefile.mk2
-rw-r--r--ucb/source/ucp/hierarchy/ucphier.map8
-rw-r--r--ucb/source/ucp/odma/exports.map8
-rw-r--r--ucb/source/ucp/odma/makefile.mk2
-rw-r--r--ucb/source/ucp/package/exports.map8
-rw-r--r--ucb/source/ucp/package/makefile.mk2
-rw-r--r--ucb/source/ucp/tdoc/exports.map8
-rw-r--r--ucb/source/ucp/tdoc/makefile.mk2
-rw-r--r--ucb/source/ucp/webdav/DAVAuthListener.hxx3
-rw-r--r--ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx1
-rw-r--r--ucb/source/ucp/webdav/DAVResourceAccess.cxx4
-rw-r--r--ucb/source/ucp/webdav/NeonSession.cxx21
-rw-r--r--ucb/source/ucp/webdav/exports.map8
-rw-r--r--ucb/source/ucp/webdav/makefile.mk2
-rw-r--r--uui/prj/build.lst2
-rwxr-xr-x[-rw-r--r--]uui/source/iahndl-authentication.cxx389
-rw-r--r--uui/source/iahndl-errorhandler.cxx2
-rw-r--r--uui/source/iahndl.cxx24
-rw-r--r--uui/source/iahndl.hxx3
-rwxr-xr-x[-rw-r--r--]uui/source/ids.hrc265
-rwxr-xr-x[-rw-r--r--]uui/source/logindlg.cxx164
-rwxr-xr-x[-rw-r--r--]uui/source/logindlg.hrc30
-rwxr-xr-x[-rw-r--r--]uui/source/logindlg.hxx50
-rwxr-xr-x[-rw-r--r--]uui/source/logindlg.src188
-rwxr-xr-x[-rw-r--r--]uui/source/loginerr.hxx141
-rw-r--r--uui/source/passwordcontainer.cxx13
-rwxr-xr-x[-rw-r--r--]uui/source/passworddlg.cxx30
-rwxr-xr-x[-rw-r--r--]uui/source/passworddlg.hxx2
-rwxr-xr-x[-rw-r--r--]uui/source/passworddlg.src28
-rwxr-xr-x[-rw-r--r--]uui/source/passworderrs.src9
-rw-r--r--uui/util/exports.map10
-rw-r--r--uui/util/makefile.mk2
-rw-r--r--vbahelper/inc/vbahelper/msvbahelper.hxx55
-rw-r--r--vbahelper/inc/vbahelper/vbaaccesshelper.hxx79
-rw-r--r--vbahelper/inc/vbahelper/vbaapplicationbase.hxx11
-rw-r--r--vbahelper/inc/vbahelper/vbacollectionimpl.hxx92
-rw-r--r--vbahelper/inc/vbahelper/vbadocumentbase.hxx3
-rw-r--r--vbahelper/inc/vbahelper/vbafontbase.hxx9
-rw-r--r--vbahelper/inc/vbahelper/vbahelper.hxx34
-rw-r--r--vbahelper/inc/vbahelper/vbahelperinterface.hxx53
-rw-r--r--vbahelper/prj/d.lst1
-rw-r--r--vbahelper/source/msforms/makefile.mk6
-rw-r--r--vbahelper/source/msforms/vbacontrol.cxx38
-rw-r--r--vbahelper/source/msforms/vbacontrol.hxx8
-rw-r--r--vbahelper/source/msforms/vbacontrols.cxx182
-rw-r--r--vbahelper/source/msforms/vbacontrols.hxx7
-rwxr-xr-xvbahelper/source/msforms/vbasystemaxcontrol.cxx101
-rwxr-xr-xvbahelper/source/msforms/vbasystemaxcontrol.hxx58
-rw-r--r--vbahelper/source/vbahelper/makefile.mk7
-rw-r--r--vbahelper/source/vbahelper/msvbahelper.cxx381
-rw-r--r--vbahelper/source/vbahelper/vbaapplicationbase.cxx295
-rw-r--r--vbahelper/source/vbahelper/vbacommandbar.cxx82
-rw-r--r--vbahelper/source/vbahelper/vbacommandbar.hxx34
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrol.cxx18
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrol.hxx2
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrols.cxx78
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrols.hxx20
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarhelper.cxx25
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarhelper.hxx4
-rw-r--r--vbahelper/source/vbahelper/vbacommandbars.cxx72
-rw-r--r--vbahelper/source/vbahelper/vbacommandbars.hxx2
-rw-r--r--vbahelper/source/vbahelper/vbadocumentbase.cxx40
-rw-r--r--vbahelper/source/vbahelper/vbafontbase.cxx85
-rw-r--r--vbahelper/source/vbahelper/vbaglobalbase.cxx1
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx380
-rw-r--r--vbahelper/util/makefile.mk7
-rw-r--r--vbahelper/util/msforms.map9
-rw-r--r--xmlhelp/prj/d.lst4
-rw-r--r--xmlhelp/source/com/sun/star/help/makefile.mk4
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx181
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.hxx19
-rw-r--r--xmlhelp/source/cxxhelp/provider/urlparameter.cxx10
-rw-r--r--xmlhelp/source/cxxhelp/provider/urlparameter.hxx3
-rw-r--r--xmlhelp/source/treeview/makefile.mk2
-rw-r--r--xmlhelp/source/treeview/tvhlp.map9
-rw-r--r--xmlhelp/source/treeview/tvread.cxx47
-rw-r--r--xmlhelp/source/treeview/tvread.hxx9
-rw-r--r--xmlhelp/util/exports.map8
-rw-r--r--xmlhelp/util/makefile.mk2
-rw-r--r--xmloff/Library_xo.mk1
-rw-r--r--xmloff/inc/RDFaExportHelper.hxx2
-rw-r--r--xmloff/inc/RDFaImportHelper.hxx24
-rw-r--r--xmloff/inc/SchXMLExport.hxx2
-rw-r--r--xmloff/inc/SchXMLImport.hxx2
-rw-r--r--xmloff/inc/xmloff/SchXMLExportHelper.hxx179
-rw-r--r--xmloff/inc/xmloff/XMLEventExport.hxx8
-rw-r--r--xmloff/inc/xmloff/shapeexport.hxx11
-rw-r--r--xmloff/inc/xmloff/txtimp.hxx390
-rw-r--r--xmloff/inc/xmloff/xmlexp.hxx6
-rw-r--r--xmloff/inc/xmloff/xmlimp.hxx7
-rw-r--r--xmloff/inc/xmloff/xmlnmspe.hxx4
-rw-r--r--xmloff/inc/xmloff/xmltoken.hxx12
-rw-r--r--xmloff/qa/unoapi/Test.java51
-rw-r--r--xmloff/qa/unoapi/knownissues.xcl11
-rw-r--r--xmloff/qa/unoapi/makefile.mk30
-rw-r--r--xmloff/qa/unoapi/xmloff.sce28
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx377
-rw-r--r--xmloff/source/chart/SchXMLImport.cxx4
-rw-r--r--xmloff/source/chart/SchXMLParagraphContext.cxx18
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.cxx213
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.hxx60
-rw-r--r--xmloff/source/chart/SchXMLSeries2Context.cxx225
-rw-r--r--xmloff/source/chart/SchXMLTableContext.cxx12
-rw-r--r--xmloff/source/chart/SchXMLTools.cxx93
-rw-r--r--xmloff/source/chart/SchXMLTools.hxx6
-rw-r--r--xmloff/source/core/RDFaExportHelper.cxx61
-rw-r--r--xmloff/source/core/RDFaImportHelper.cxx98
-rw-r--r--xmloff/source/core/makefile.mk7
-rw-r--r--xmloff/source/core/xmlexp.cxx41
-rw-r--r--xmloff/source/core/xmlimp.cxx27
-rw-r--r--xmloff/source/core/xmltoken.cxx11
-rw-r--r--xmloff/source/draw/XMLReplacementImageContext.cxx1
-rw-r--r--xmloff/source/draw/animationexport.cxx22
-rw-r--r--xmloff/source/draw/animationimport.cxx34
-rw-r--r--xmloff/source/draw/sdpropls.cxx3
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx13
-rw-r--r--xmloff/source/draw/sdxmlimp.cxx4
-rw-r--r--xmloff/source/draw/sdxmlimp_impl.hxx3
-rw-r--r--xmloff/source/draw/shapeexport.cxx94
-rw-r--r--xmloff/source/draw/shapeexport2.cxx27
-rw-r--r--xmloff/source/draw/shapeexport4.cxx6
-rw-r--r--xmloff/source/draw/ximpbody.cxx23
-rw-r--r--xmloff/source/draw/ximppage.cxx3
-rw-r--r--xmloff/source/draw/ximpshap.cxx117
-rw-r--r--xmloff/source/draw/ximpshap.hxx3
-rw-r--r--xmloff/source/forms/elementexport.cxx13
-rw-r--r--xmloff/source/forms/elementimport.cxx15
-rw-r--r--xmloff/source/forms/formattributes.cxx2
-rw-r--r--xmloff/source/forms/propertyexport.cxx6
-rw-r--r--xmloff/source/forms/propertyexport.hxx8
-rw-r--r--xmloff/source/forms/propertyimport.cxx2
-rw-r--r--xmloff/source/forms/valueproperties.cxx2
-rw-r--r--xmloff/source/meta/xmlmetae.cxx4
-rw-r--r--xmloff/source/script/XMLEventExport.cxx25
-rw-r--r--xmloff/source/script/XMLScriptExportHandler.cxx3
-rw-r--r--xmloff/source/style/WordWrapPropertyHdl.cxx1
-rw-r--r--xmloff/source/style/XMLClipPropertyHandler.cxx3
-rw-r--r--xmloff/source/style/XMLFontAutoStylePool.cxx3
-rw-r--r--xmloff/source/style/XMLFontStylesContext.cxx15
-rw-r--r--xmloff/source/style/XMLRectangleMembersHandler.cxx5
-rw-r--r--xmloff/source/style/adjushdl.cxx4
-rw-r--r--xmloff/source/style/backhdl.cxx4
-rw-r--r--xmloff/source/style/bordrhdl.cxx4
-rw-r--r--xmloff/source/style/breakhdl.cxx4
-rw-r--r--xmloff/source/style/cdouthdl.cxx6
-rw-r--r--xmloff/source/style/chrhghdl.cxx4
-rw-r--r--xmloff/source/style/chrlohdl.cxx4
-rw-r--r--xmloff/source/style/csmaphdl.cxx6
-rw-r--r--xmloff/source/style/escphdl.cxx4
-rw-r--r--xmloff/source/style/fonthdl.cxx5
-rw-r--r--xmloff/source/style/fonthdl.hxx6
-rw-r--r--xmloff/source/style/lspachdl.cxx4
-rw-r--r--xmloff/source/style/postuhdl.cxx4
-rw-r--r--xmloff/source/style/prhdlfac.cxx5
-rw-r--r--xmloff/source/style/styleexp.cxx1
-rw-r--r--xmloff/source/style/undlihdl.cxx6
-rw-r--r--xmloff/source/style/xmlimppr.cxx1
-rw-r--r--xmloff/source/style/xmlnume.cxx26
-rw-r--r--xmloff/source/style/xmlnumfi.cxx2
-rw-r--r--xmloff/source/style/xmlnumi.cxx32
-rw-r--r--xmloff/source/table/XMLTableExport.cxx10
-rw-r--r--xmloff/source/text/XMLChangedRegionImportContext.cxx13
-rw-r--r--xmloff/source/text/XMLIndexTOCContext.cxx38
-rw-r--r--xmloff/source/text/XMLIndexTOCContext.hxx3
-rw-r--r--xmloff/source/text/XMLPropertyBackpatcher.cxx61
-rw-r--r--xmloff/source/text/XMLRedlineExport.cxx2
-rw-r--r--xmloff/source/text/XMLSectionExport.cxx192
-rw-r--r--xmloff/source/text/XMLSectionImportContext.cxx6
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx30
-rw-r--r--xmloff/source/text/XMLTextListBlockContext.cxx10
-rw-r--r--xmloff/source/text/XMLTextListItemContext.cxx4
-rw-r--r--xmloff/source/text/XMLTextMarkImportContext.cxx55
-rw-r--r--xmloff/source/text/txtfldi.cxx81
-rw-r--r--xmloff/source/text/txtimp.cxx1247
-rw-r--r--xmloff/source/text/txtlists.cxx5
-rw-r--r--xmloff/source/text/txtparae.cxx14
-rw-r--r--xmloff/source/text/txtparai.cxx17
-rw-r--r--xmloff/source/text/txtparai.hxx1
-rw-r--r--xmloff/source/transform/makefile.mk2
-rw-r--r--xmloff/source/transform/xof.map8
-rw-r--r--xmloff/util/makefile.mk11
-rw-r--r--xmlscript/inc/xmlscript/xmlmod_imexp.hxx1
-rw-r--r--xmlscript/source/xmldlg_imexp/exp_share.hxx2
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx4
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_export.cxx4
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx3
-rw-r--r--xmlscript/source/xmlmod_imexp/xmlmod_export.cxx3
-rw-r--r--xmlscript/source/xmlmod_imexp/xmlmod_import.cxx7
1157 files changed, 45547 insertions, 24209 deletions
diff --git a/avmedia/source/framework/makefile.mk b/avmedia/source/framework/makefile.mk
index 34669d3e9f8a..4185f3cbfc49 100644
--- a/avmedia/source/framework/makefile.mk
+++ b/avmedia/source/framework/makefile.mk
@@ -50,6 +50,7 @@ SLOFILES= \
$(SLO)$/soundhandler.obj
EXCEPTIONSFILES = \
+ $(SLO)$/mediatoolbox.obj \
$(SLO)$/soundhandler.obj
# --- Targets ----------------------------------
diff --git a/avmedia/source/quicktime/avmediaQuickTime.map b/avmedia/source/quicktime/avmediaQuickTime.map
deleted file mode 100644
index bf1fbe0696c8..000000000000
--- a/avmedia/source/quicktime/avmediaQuickTime.map
+++ /dev/null
@@ -1,8 +0,0 @@
-LEXPS_1_0 {
- global:
- component_getFactory;
- component_getImplementationEnvironment;
- component_writeInfo;
- local:
- *;
-};
diff --git a/avmedia/source/quicktime/makefile.mk b/avmedia/source/quicktime/makefile.mk
index 088f3b5d0ef3..f3c9f244f357 100644
--- a/avmedia/source/quicktime/makefile.mk
+++ b/avmedia/source/quicktime/makefile.mk
@@ -73,7 +73,7 @@ SHL1LIBS=$(SLB)$/$(TARGET).lib
SHL1IMPLIB=i$(TARGET)
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Targets ------------------------------------------------------
diff --git a/basic/inc/basic/sberrors.hxx b/basic/inc/basic/sberrors.hxx
index c21b3b0237b8..c34176e0bde7 100644
--- a/basic/inc/basic/sberrors.hxx
+++ b/basic/inc/basic/sberrors.hxx
@@ -287,6 +287,8 @@ typedef ULONG SbError;
#define ERRCODE_BASIC_LOOP_NOT_INIT ((LAST_SBX_ERROR_ID+109UL) | ERRCODE_AREA_SBX | \
ERRCODE_CLASS_COMPILER) // For loop not initialized
+#define ERRCODE_BASIC_COMPAT ((LAST_SBX_ERROR_ID+103UL)| ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME)
+
// Map old codes to new codes
#define SbERR_SYNTAX ERRCODE_BASIC_SYNTAX
#define SbERR_NO_GOSUB ERRCODE_BASIC_NO_GOSUB
@@ -410,6 +412,7 @@ typedef ULONG SbError;
#define SbERR_PROG_TOO_LARGE ERRCODE_BASIC_PROG_TOO_LARGE
#define SbERR_NO_STRINGS_ARRAYS ERRCODE_BASIC_NO_STRINGS_ARRAYS
#define SbERR_BASIC_EXCEPTION ERRCODE_BASIC_EXCEPTION
+#define SbERR_BASIC_COMPAT ERRCODE_BASIC_COMPAT
#define SbERR_BASIC_ARRAY_FIX ERRCODE_BASIC_ARRAY_FIX
#define SbERR_BASIC_STRING_OVERFLOW ERRCODE_BASIC_STRING_OVERFLOW
#define SbERR_BASIC_EXPR_TOO_COMPLEX ERRCODE_BASIC_EXPR_TOO_COMPLEX
diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx
index d73c9780b1bb..cf888adf9dcf 100644
--- a/basic/inc/basic/sbmod.hxx
+++ b/basic/inc/basic/sbmod.hxx
@@ -31,9 +31,7 @@
#include <basic/sbdef.hxx>
#include <basic/sbxobj.hxx>
#include <basic/sbxdef.hxx>
-#ifndef _RTL_USTRING_HXX
#include <rtl/ustring.hxx>
-#endif
class SbMethod;
class SbProperty;
@@ -42,6 +40,7 @@ class SbiBreakpoints;
class SbiImage;
class SbProcedureProperty;
class SbIfaceMapperMethod;
+class SbClassModuleObject;
struct SbClassData;
class SbModuleImpl;
@@ -63,6 +62,10 @@ protected:
SbiImage* pImage; // the Image
SbiBreakpoints* pBreaks; // Breakpoints
SbClassData* pClassData;
+ BOOL mbVBACompat;
+ INT32 mnType;
+ SbxObjectRef pDocObject; // an impl object ( used by Document Modules )
+ bool bIsProxyModule;
void StartDefinitions();
SbMethod* GetMethod( const String&, SbxDataType );
@@ -87,7 +90,7 @@ protected:
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICMOD,2);
TYPEINFO();
- SbModule( const String& );
+ SbModule( const String&, BOOL bCompat = FALSE );
virtual void SetParent( SbxObject* );
virtual void Clear();
@@ -123,6 +126,12 @@ public:
BOOL LoadBinaryData( SvStream& );
BOOL ExceedsLegacyModuleSize();
void fixUpMethodStart( bool bCvtToLegacy, SbiImage* pImg = NULL ) const;
+ BOOL IsVBACompat() const;
+ void SetVBACompat( BOOL bCompat );
+ INT32 GetModuleType() { return mnType; }
+ void SetModuleType( INT32 nType ) { mnType = nType; }
+ bool GetIsProxyModule() { return bIsProxyModule; }
+ bool createCOMWrapperForIface( ::com::sun::star::uno::Any& o_rRetAny, SbClassModuleObject* pProxyClassModuleObject );
};
#ifndef __SB_SBMODULEREF_HXX
diff --git a/basic/inc/basic/sbobjmod.hxx b/basic/inc/basic/sbobjmod.hxx
new file mode 100644
index 000000000000..3d638a475f9a
--- /dev/null
+++ b/basic/inc/basic/sbobjmod.hxx
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbobjmod.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: $ $Date: 2007/08/27 16:31:39 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SB_OBJMOD_HXX
+#define _SB_OBJMOD_HXX
+
+#include <basic/sbmod.hxx>
+#include <basic/sbstar.hxx>
+#include <com/sun/star/script/ModuleInfo.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/awt/XDialog.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+
+namespace css = ::com::sun::star;
+
+// Basic-Module for excel object.
+
+class SbObjModule : public SbModule
+{
+ SbObjModule( const SbObjModule& );
+ SbObjModule();
+public:
+ TYPEINFO();
+ SbObjModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVbaCompatible );
+ virtual SbxVariable* Find( const XubString& rName, SbxClassType t );
+ using SbxValue::GetObject;
+ SbxVariable* GetObject();
+ void SetUnoObject( const com::sun::star::uno::Any& aObj )throw ( com::sun::star::uno::RuntimeException ) ;
+};
+
+class SbUserFormModule : public SbObjModule
+{
+ com::sun::star::script::ModuleInfo m_mInfo;
+ css::uno::Reference<css::lang::XEventListener> m_DialogListener;
+ css::uno::Reference<css::awt::XDialog> m_xDialog;
+ css::uno::Reference<css::frame::XModel> m_xModel;
+ String sFormName;
+ bool mbInit;
+ SbUserFormModule( const SbUserFormModule& );
+ SbUserFormModule();
+
+//protected:
+ virtual void InitObject();
+public:
+ TYPEINFO();
+ SbUserFormModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat );
+ virtual SbxVariable* Find( const XubString& rName, SbxClassType t );
+ void ResetApiObj();
+ void Unload();
+ void load();
+ void triggerMethod( const String& );
+ void triggerMethod( const String&, css::uno::Sequence< css::uno::Any >& );
+ void triggerActivateEvent();
+ void triggerDeActivateEvent();
+ void triggerInitializeEvent();
+ void triggerTerminateEvent();
+
+ class SbUserFormModuleInstance* CreateInstance();
+};
+
+class SbUserFormModuleInstance : public SbUserFormModule
+{
+ SbUserFormModule* m_pParentModule;
+
+public:
+ SbUserFormModuleInstance( SbUserFormModule* pParentModule, const String& rName,
+ const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat );
+
+ virtual BOOL IsClass( const String& ) const;
+ virtual SbxVariable* Find( const XubString& rName, SbxClassType t );
+};
+
+
+#ifndef __SB_SBOBJMODULEREF_HXX
+#define __SB_SBOBJMODULEREF_HXX
+
+SV_DECL_IMPL_REF(SbObjModule);
+
+#endif
+#endif
+
diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx
index bdc4aa011cc9..a234dc206ec7 100644
--- a/basic/inc/basic/sbstar.hxx
+++ b/basic/inc/basic/sbstar.hxx
@@ -37,6 +37,7 @@
#include <basic/sbdef.hxx>
#include <basic/sberrors.hxx>
+#include <com/sun/star/script/ModuleInfo.hpp>
class SbModule; // completed module
class SbiInstance; // runtime instance
@@ -69,6 +70,7 @@ class StarBASIC : public SbxObject
BOOL bNoRtl; // if TRUE: do not search RTL
BOOL bBreak; // if TRUE: Break, otherwise Step
BOOL bDocBasic;
+ BOOL bVBAEnabled;
BasicLibInfo* pLibInfo; // Info block for basic manager
SbLanguageMode eLanguageMode; // LanguageMode of the basic object
BOOL bQuit;
@@ -117,6 +119,7 @@ public:
// Compiler-Interface
SbModule* MakeModule( const String& rName, const String& rSrc );
SbModule* MakeModule32( const String& rName, const ::rtl::OUString& rSrc );
+ SbModule* MakeModule32( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, const ::rtl::OUString& rSrc );
BOOL Compile( SbModule* );
BOOL Disassemble( SbModule*, String& rText );
static void Stop();
@@ -189,6 +192,8 @@ public:
( const String& rName, USHORT& rStatus );
static SbMethod* GetActiveMethod( USHORT nLevel = 0 );
static SbModule* GetActiveModule();
+ void SetVBAEnabled( BOOL bEnabled );
+ BOOL isVBAEnabled();
// #60175 TRUE: SFX-Resource is not displayed on basic errors
static void StaticSuppressSfxResource( BOOL bSuppress );
diff --git a/basic/inc/basic/sbuno.hxx b/basic/inc/basic/sbuno.hxx
index 68e2c6ab8778..d816d424313b 100644
--- a/basic/inc/basic/sbuno.hxx
+++ b/basic/inc/basic/sbuno.hxx
@@ -41,5 +41,7 @@ void createAllObjectProperties( SbxObject* pObj );
::com::sun::star::uno::Any sbxToUnoValue( SbxVariable* pVar );
+void unoToSbxValue( SbxVariable* pVar, const ::com::sun::star::uno::Any& aValue );
+
#endif
diff --git a/basic/inc/basic/sbx.hxx b/basic/inc/basic/sbx.hxx
index 1254716c84e6..2eb194708739 100644
--- a/basic/inc/basic/sbx.hxx
+++ b/basic/inc/basic/sbx.hxx
@@ -171,8 +171,8 @@ class SbxArray : public SbxBase
{
// #100883 Method to set method directly to parameter array
friend class SbMethod;
- friend class SbTypeFactory;
friend class SbClassModuleObject;
+ friend SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj );
void PutDirect( SbxVariable* pVar, UINT32 nIdx );
SbxArrayImpl* mpSbxArrayImpl; // Impl data
diff --git a/basic/inc/basic/sbxdef.hxx b/basic/inc/basic/sbxdef.hxx
index 8206fa2b1667..89322be776f9 100644
--- a/basic/inc/basic/sbxdef.hxx
+++ b/basic/inc/basic/sbxdef.hxx
@@ -105,6 +105,9 @@ enum SbxDataType {
SbxUSERn = 2047 // last user defined data type
};
+const UINT32 SBX_TYPE_WITH_EVENTS_FLAG = 0x10000;
+const UINT32 SBX_FIXED_LEN_STRING_FLAG = 0x10000; // same value as above as no conflict possible
+
#endif
#ifndef _SBX_OPERATOR
@@ -313,6 +316,7 @@ enum SbxError { // Ergebnis einer Rechenoperation/Konversion
#define SBX_NO_BROADCAST 0x2000 // No broadcast on Get/Put
#define SBX_REFERENCE 0x4000 // Parameter is Reference (DLL-call)
#define SBX_NO_MODIFY 0x8000 // SetModified is suppressed
+#define SBX_WITH_EVENTS 0x0080 // Same value as unused SBX_HIDDEN
// Broadcaster-IDs:
#define SBX_HINT_DYING SFX_HINT_DYING
diff --git a/basic/inc/basic/sbxvar.hxx b/basic/inc/basic/sbxvar.hxx
index 715d8c46f0f3..4d9d19b52a59 100644
--- a/basic/inc/basic/sbxvar.hxx
+++ b/basic/inc/basic/sbxvar.hxx
@@ -230,8 +230,6 @@ class SbxValueImpl;
class SbxValue : public SbxBase
{
- friend class SbiDllMgr; // BASIC-Runtime must access aData
-
SbxValueImpl* mpSbxValueImplImpl; // Impl data
// #55226 Transport additional infos
@@ -289,6 +287,8 @@ public:
const SbxValues& GetValues_Impl() const { return aData; }
virtual BOOL Put( const SbxValues& );
+ inline SbxValues * data() { return &aData; }
+
SbxINT64 GetCurrency() const;
SbxINT64 GetLong64() const;
SbxUINT64 GetULong64() const;
@@ -447,6 +447,9 @@ class SbxVariable : public SbxValue
String maName; // Name, if available
SbxArrayRef mpPar; // Parameter-Array, if set
USHORT nHash; // Hash-ID for search
+
+ SbxVariableImpl* getImpl( void );
+
protected:
SbxInfoRef pInfo; // Probably called information
sal_uIntPtr nUserData; // User data for Call()
@@ -492,6 +495,10 @@ public:
inline SbxObject* GetParent() { return pParent; }
virtual void SetParent( SbxObject* );
+ const String& GetDeclareClassName( void );
+ void SetDeclareClassName( const String& );
+ void SetComListener( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xComListener );
+
static USHORT MakeHashCode( const String& rName );
};
diff --git a/basic/inc/pch/precompiled_basic.hxx b/basic/inc/pch/precompiled_basic.hxx
index cab46edc0185..e8f9e004ca6a 100644
--- a/basic/inc/pch/precompiled_basic.hxx
+++ b/basic/inc/pch/precompiled_basic.hxx
@@ -187,7 +187,7 @@
#include "svtools/svmedit.hxx"
#include "svl/svstdarr.hxx"
#include "svtools/svtdata.hxx"
-#include "svl/svtools.hrc"
+#include "svtools/svtools.hrc"
#include "svtools/svtreebx.hxx"
#include "unotools/syslocale.hxx"
#include "svtools/taskbar.hxx"
diff --git a/basic/prj/build.lst b/basic/prj/build.lst
index 994901580c86..c00a3d8412d3 100644..100755
--- a/basic/prj/build.lst
+++ b/basic/prj/build.lst
@@ -1,11 +1,11 @@
-sb basic : l10n offuh svtools xmlscript framework NULL
+sb basic : l10n offuh oovbaapi svtools xmlscript framework salhelper NULL
sb basic usr1 - all sb_mkout NULL
sb basic\inc nmake - all sb_inc NULL
sb basic\source\app nmake - all sb_app sb_class sb_inc NULL
sb basic\source\basmgr nmake - all sb_mgr sb_inc NULL
sb basic\source\classes nmake - all sb_class sb_inc NULL
sb basic\source\comp nmake - all sb_comp sb_inc NULL
-sb basic\source\runtime nmake - all sb_rt sb_inc NULL
+sb basic\source\runtime nmake - all sb_rt sb_inc sb_class NULL
sb basic\source\sample nmake - all sb_samp sb_inc NULL
sb basic\source\sbx nmake - all sb_sbx sb_inc NULL
sb basic\source\uno nmake - all sb_uno sb_inc NULL
diff --git a/basic/source/app/basic.src b/basic/source/app/basic.src
index fe7bcff7f6b3..0713fd859f56 100644
--- a/basic/source/app/basic.src
+++ b/basic/source/app/basic.src
@@ -87,7 +87,7 @@ ModalDialog IDD_ABOUT_DIALOG {
FixedText {
Pos = MAP_APPFONT( 40, 60 );
Size = MAP_APPFONT( 110, 10 );
- TEXT = "®1995 Sun Microsystems, Inc.";
+ TEXT = "®1995-2010 Oracle";
CENTER = TRUE;
};
};
@@ -127,7 +127,7 @@ ModalDialog IDD_TT_ABOUT_DIALOG {
Pos = MAP_APPFONT( 5, 40 );
Size = MAP_APPFONT( 110, 10 );
CENTER = TRUE;
- TEXT[ en-US ] = "©1995-2005 Sun Microsystems, Inc.";
+ TEXT[ en-US ] = "©1995-2010 Oracle";
};
OKButton RID_OK {
Pos = MAP_APPFONT( 40, 60 );
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index da792f269fc9..b76a2b5e249e 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -41,6 +41,7 @@
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
#include <basic/sbmod.hxx>
+#include <basic/sbobjmod.hxx>
#include <basic/sbuno.hxx>
#include <basic/basmgr.hxx>
@@ -65,6 +66,9 @@
#include <com/sun/star/script/XStarBasicDialogInfo.hpp>
#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 <cppuhelper/implbase1.hxx>
@@ -97,20 +101,13 @@ typedef WeakImplHelper1< XStarBasicAccess > StarBasicAccessHelper;
// + BOOL bReference
static const char* szStdLibName = "Standard";
-static const char* szBasicStorage = "StarBASIC";
+static const char szBasicStorage[] = "StarBASIC";
static const char* szOldManagerStream = "BasicManager";
-static const char* szManagerStream = "BasicManager2";
+static const char szManagerStream[] = "BasicManager2";
static const char* szImbedded = "LIBIMBEDDED";
static const char* szCryptingKey = "CryptedBasic";
static const char* szScriptLanguage = "StarBasic";
-static const String BasicStreamName( String::CreateFromAscii(szBasicStorage) );
-static const String ManagerStreamName( String::CreateFromAscii(szManagerStream) );
-
-
-#define DEFINE_CONST_UNICODE(CONSTASCII) UniString(RTL_CONSTASCII_USTRINGPARAM(CONSTASCII))
-
-
TYPEINIT1( BasicManager, SfxBroadcaster );
DBG_NAME( BasicManager );
@@ -243,7 +240,15 @@ void BasMgrContainerListenerImpl::addLibraryModulesImpl( BasicManager* pMgr,
Any aElement = xLibNameAccess->getByName( aModuleName );
::rtl::OUString aMod;
aElement >>= aMod;
- pLib->MakeModule32( aModuleName, aMod );
+ Reference< XVBAModuleInfo > xVBAModuleInfo( xLibNameAccess, UNO_QUERY );
+ if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( aModuleName ) )
+ {
+ ModuleInfo mInfo = xVBAModuleInfo->getModuleInfo( aModuleName );
+ OSL_TRACE("#addLibraryModulesImpl - aMod");
+ pLib->MakeModule32( aModuleName, mInfo, aMod );
+ }
+ else
+ pLib->MakeModule32( aModuleName, aMod );
}
}
@@ -277,11 +282,16 @@ void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const ContainerEvent
{
Reference< XLibraryContainer > xScriptCont( Event.Source, UNO_QUERY );
insertLibraryImpl( xScriptCont, mpMgr, Event.Element, aName );
+ StarBASIC* pLib = mpMgr->GetLib( aName );
+ if ( pLib )
+ {
+ Reference<XVBACompat> xVBACompat( xScriptCont, UNO_QUERY );
+ if ( xVBACompat.is() )
+ pLib->SetVBAEnabled( xVBACompat->getVBACompatModeOn() );
+ }
}
else
{
- ::rtl::OUString aMod;
- Event.Element >>= aMod;
StarBASIC* pLib = mpMgr->GetLib( maLibName );
DBG_ASSERT( pLib, "BasMgrContainerListenerImpl::elementInserted: Unknown lib!");
@@ -290,7 +300,16 @@ void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const ContainerEvent
SbModule* pMod = pLib->FindModule( aName );
if( !pMod )
{
- pLib->MakeModule32( aName, aMod );
+ ::rtl::OUString aMod;
+ Event.Element >>= aMod;
+ Reference< XVBAModuleInfo > xVBAModuleInfo( Event.Source, UNO_QUERY );
+ if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( aName ) )
+ {
+ ModuleInfo mInfo = xVBAModuleInfo->getModuleInfo( aName );
+ pLib->MakeModule32( aName, mInfo, aMod );
+ }
+ else
+ pLib->MakeModule32( aName, aMod );
pLib->SetModified( FALSE );
}
}
@@ -319,10 +338,11 @@ void SAL_CALL BasMgrContainerListenerImpl::elementReplaced( const ContainerEvent
SbModule* pMod = pLib->FindModule( aName );
::rtl::OUString aMod;
Event.Element >>= aMod;
+
if( pMod )
- pMod->SetSource32( aMod );
+ pMod->SetSource32( aMod );
else
- pLib->MakeModule32( aName, aMod );
+ pLib->MakeModule32( aName, aMod );
pLib->SetModified( FALSE );
}
@@ -666,7 +686,7 @@ BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBA
// DBG_ASSERT(aStorageName.Len() != 0, "Bad storage name");
// If there is no Manager Stream, no further actions are necessary
- if ( rStorage.IsStream( ManagerStreamName ) )
+ if ( rStorage.IsStream( String(RTL_CONSTASCII_USTRINGPARAM(szManagerStream)) ) )
{
LoadBasicManager( rStorage, rBaseURL );
// StdLib contains Parent:
@@ -707,12 +727,12 @@ BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBA
// #91626 Save all stream data to save it unmodified if basic isn't modified
// in an 6.0+ office. So also the old basic dialogs can be saved.
SotStorageStreamRef xManagerStream = rStorage.OpenSotStream
- ( ManagerStreamName, eStreamReadMode );
+ ( String(RTL_CONSTASCII_USTRINGPARAM(szManagerStream)), eStreamReadMode );
mpImpl->mpManagerStream = new SvMemoryStream();
*static_cast<SvStream*>(&xManagerStream) >> *mpImpl->mpManagerStream;
SotStorageRef xBasicStorage = rStorage.OpenSotStorage
- ( BasicStreamName, eStorageReadMode, FALSE );
+ ( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)), eStorageReadMode, FALSE );
if( xBasicStorage.Is() && !xBasicStorage->GetError() )
{
USHORT nLibs = GetLibCount();
@@ -921,7 +941,7 @@ void BasicManager::LoadBasicManager( SotStorage& rStorage, const String& rBaseUR
// StreamMode eStreamMode = STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE;
SotStorageStreamRef xManagerStream = rStorage.OpenSotStream
- ( ManagerStreamName, eStreamReadMode );
+ ( String(RTL_CONSTASCII_USTRINGPARAM(szManagerStream)), eStreamReadMode );
String aStorName( rStorage.GetName() );
// #i13114 removed, DBG_ASSERT( aStorName.Len(), "No Storage Name!" );
@@ -1169,7 +1189,7 @@ BOOL BasicManager::ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurStorag
xStorage = new SotStorage( FALSE, aStorageName, eStorageReadMode );
SotStorageRef xBasicStorage = xStorage->OpenSotStorage
- ( BasicStreamName, eStorageReadMode, FALSE );
+ ( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)), eStorageReadMode, FALSE );
if ( !xBasicStorage.Is() || xBasicStorage->GetError() )
{
@@ -1422,10 +1442,10 @@ BOOL BasicManager::RemoveLib( USHORT nLib, BOOL bDelBasicFromStorage )
else
xStorage = new SotStorage( FALSE, pLibInfo->GetStorageName() );
- if ( xStorage->IsStorage( BasicStreamName ) )
+ if ( xStorage->IsStorage( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)) ) )
{
SotStorageRef xBasicStorage = xStorage->OpenSotStorage
- ( BasicStreamName, STREAM_STD_READWRITE, FALSE );
+ ( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)), STREAM_STD_READWRITE, FALSE );
if ( !xBasicStorage.Is() || xBasicStorage->GetError() )
{
@@ -1445,7 +1465,7 @@ BOOL BasicManager::RemoveLib( USHORT nLib, BOOL bDelBasicFromStorage )
if ( !aInfoList.Count() )
{
xBasicStorage.Clear();
- xStorage->Remove( BasicStreamName );
+ xStorage->Remove( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)) );
xStorage->Commit();
// If no further Streams or SubStorages available,
// delete the Storage, too.
@@ -1769,7 +1789,7 @@ bool BasicManager::GetGlobalUNOConstant( const sal_Char* _pAsciiName, ::com::sun
{
bool bRes = false;
StarBASIC* pStandardLib = GetStdLib();
- OSL_PRECOND( pStandardLib, "BasicManager::SetGlobalUNOConstant: no lib to insert into!" );
+ OSL_PRECOND( pStandardLib, "BasicManager::GetGlobalUNOConstant: no lib to read from!" );
if ( pStandardLib )
bRes = pStandardLib->GetUNOConstant( _pAsciiName, aOut );
return bRes;
diff --git a/basic/source/classes/disas.cxx b/basic/source/classes/disas.cxx
index 36e88b6353e8..7317005d74fe 100644
--- a/basic/source/classes/disas.cxx
+++ b/basic/source/classes/disas.cxx
@@ -89,7 +89,8 @@ static const char* pOp1[] = {
"INITFOREACH",
"VBASET",
"ERASE_CLEAR",
- "ARRAYACCESS"
+ "ARRAYACCESS",
+ "BYVAL"
};
static const char* pOp2[] = {
diff --git a/basic/source/classes/errobject.cxx b/basic/source/classes/errobject.cxx
new file mode 100644
index 000000000000..0ec0454e2bb5
--- /dev/null
+++ b/basic/source/classes/errobject.cxx
@@ -0,0 +1,225 @@
+/*************************************************************************
+*
+* 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_basic.hxx"
+#include "errobject.hxx"
+
+#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/script/XDefaultProperty.hpp>
+#include "sbintern.hxx"
+#include "runtime.hxx"
+
+using namespace ::com::sun::star;
+using namespace ::ooo;
+
+typedef ::cppu::WeakImplHelper2< vba::XErrObject, script::XDefaultProperty > ErrObjectImpl_BASE;
+
+class ErrObject : public ErrObjectImpl_BASE
+{
+ rtl::OUString m_sHelpFile;
+ rtl::OUString m_sSource;
+ rtl::OUString m_sDescription;
+ sal_Int32 m_nNumber;
+ sal_Int32 m_nHelpContext;
+
+public:
+ ErrObject();
+ ~ErrObject();
+ // Attributes
+ virtual ::sal_Int32 SAL_CALL getNumber() throw (uno::RuntimeException);
+ virtual void SAL_CALL setNumber( ::sal_Int32 _number ) throw (uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getHelpContext() throw (uno::RuntimeException);
+ virtual void SAL_CALL setHelpContext( ::sal_Int32 _helpcontext ) throw (uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getHelpFile() throw (uno::RuntimeException);
+ virtual void SAL_CALL setHelpFile( const ::rtl::OUString& _helpfile ) throw (uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getDescription() throw (uno::RuntimeException);
+ virtual void SAL_CALL setDescription( const ::rtl::OUString& _description ) throw (uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getSource() throw (uno::RuntimeException);
+ virtual void SAL_CALL setSource( const ::rtl::OUString& _source ) throw (uno::RuntimeException);
+
+ // Methods
+ virtual void SAL_CALL Clear( ) throw (uno::RuntimeException);
+ virtual void SAL_CALL Raise( const uno::Any& Number, const uno::Any& Source, const uno::Any& Description, const uno::Any& HelpFile, const uno::Any& HelpContext ) throw (uno::RuntimeException);
+ // XDefaultProperty
+ virtual ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (uno::RuntimeException);
+
+ // Helper method
+ void setData( const uno::Any& Number, const uno::Any& Source, const uno::Any& Description,
+ const uno::Any& HelpFile, const uno::Any& HelpContext ) throw (uno::RuntimeException);
+};
+
+
+ErrObject::~ErrObject()
+{
+}
+
+ErrObject::ErrObject() : m_nNumber(0), m_nHelpContext(0)
+{
+}
+
+sal_Int32 SAL_CALL
+ErrObject::getNumber() throw (uno::RuntimeException)
+{
+ return m_nNumber;
+}
+
+void SAL_CALL
+ErrObject::setNumber( ::sal_Int32 _number ) throw (uno::RuntimeException)
+{
+ pINST->setErrorVB( _number, String() );
+ ::rtl::OUString _description = pINST->GetErrorMsg();
+ setData( uno::makeAny( _number ), uno::Any(), uno::makeAny( _description ), uno::Any(), uno::Any() );
+}
+
+::sal_Int32 SAL_CALL
+ErrObject::getHelpContext() throw (uno::RuntimeException)
+{
+ return m_nHelpContext;
+}
+void SAL_CALL
+ErrObject::setHelpContext( ::sal_Int32 _helpcontext ) throw (uno::RuntimeException)
+{
+ m_nHelpContext = _helpcontext;
+}
+
+::rtl::OUString SAL_CALL
+ErrObject::getHelpFile() throw (uno::RuntimeException)
+{
+ return m_sHelpFile;
+}
+
+void SAL_CALL
+ErrObject::setHelpFile( const ::rtl::OUString& _helpfile ) throw (uno::RuntimeException)
+{
+ m_sHelpFile = _helpfile;
+}
+
+::rtl::OUString SAL_CALL
+ErrObject::getDescription() throw (uno::RuntimeException)
+{
+ return m_sDescription;
+}
+
+void SAL_CALL
+ErrObject::setDescription( const ::rtl::OUString& _description ) throw (uno::RuntimeException)
+{
+ m_sDescription = _description;
+}
+
+::rtl::OUString SAL_CALL
+ErrObject::getSource() throw (uno::RuntimeException)
+{
+ return m_sSource;
+}
+
+void SAL_CALL
+ErrObject::setSource( const ::rtl::OUString& _source ) throw (uno::RuntimeException)
+{
+ m_sSource = _source;
+}
+
+// Methods
+void SAL_CALL
+ErrObject::Clear( ) throw (uno::RuntimeException)
+{
+ m_sHelpFile = rtl::OUString();
+ m_sSource = m_sHelpFile;
+ m_sDescription = m_sSource;
+ m_nNumber = 0;
+ m_nHelpContext = 0;
+}
+
+void SAL_CALL
+ErrObject::Raise( const uno::Any& Number, const uno::Any& Source, const uno::Any& Description, const uno::Any& HelpFile, const uno::Any& HelpContext ) throw (uno::RuntimeException)
+{
+ setData( Number, Source, Description, HelpFile, HelpContext );
+ if ( m_nNumber )
+ pINST->ErrorVB( m_nNumber, m_sDescription );
+}
+
+// XDefaultProperty
+::rtl::OUString SAL_CALL
+ErrObject::getDefaultPropertyName( ) throw (uno::RuntimeException)
+{
+ static rtl::OUString sDfltPropName( RTL_CONSTASCII_USTRINGPARAM("Number") );
+ return sDfltPropName;
+}
+
+void ErrObject::setData( const uno::Any& Number, const uno::Any& Source, const uno::Any& Description, const uno::Any& HelpFile, const uno::Any& HelpContext )
+ throw (uno::RuntimeException)
+{
+ if ( !Number.hasValue() )
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Missing Required Paramater"), uno::Reference< uno::XInterface >() );
+ Number >>= m_nNumber;
+ Description >>= m_sDescription;
+ Source >>= m_sSource;
+ HelpFile >>= m_sHelpFile;
+ HelpContext >>= m_nHelpContext;
+}
+
+// SbxErrObject
+SbxErrObject::SbxErrObject( const String& rName, const Any& rUnoObj )
+ : SbUnoObject( rName, rUnoObj )
+ , m_pErrObject( NULL )
+{
+ OSL_TRACE("SbxErrObject::SbxErrObject ctor");
+ rUnoObj >>= m_xErr;
+ if ( m_xErr.is() )
+ {
+ SetDfltProperty( uno::Reference< script::XDefaultProperty >( m_xErr, uno::UNO_QUERY_THROW )->getDefaultPropertyName() ) ;
+ m_pErrObject = static_cast< ErrObject* >( m_xErr.get() );
+ }
+}
+
+SbxErrObject::~SbxErrObject()
+{
+ OSL_TRACE("SbxErrObject::~SbxErrObject dtor");
+}
+
+uno::Reference< vba::XErrObject >
+SbxErrObject::getUnoErrObject()
+{
+ SbxVariable* pVar = getErrObject();
+ SbxErrObject* pGlobErr = static_cast< SbxErrObject* >( pVar );
+ return pGlobErr->m_xErr;
+}
+
+SbxVariableRef
+SbxErrObject::getErrObject()
+{
+ static SbxVariableRef pGlobErr = new SbxErrObject( String( RTL_CONSTASCII_USTRINGPARAM("Err")), uno::makeAny( uno::Reference< vba::XErrObject >( new ErrObject() ) ) );
+ return pGlobErr;
+}
+
+void SbxErrObject::setNumberAndDescription( ::sal_Int32 _number, const ::rtl::OUString& _description )
+ throw (uno::RuntimeException)
+{
+ if( m_pErrObject != NULL )
+ m_pErrObject->setData( uno::makeAny( _number ), uno::Any(), uno::makeAny( _description ), uno::Any(), uno::Any() );
+}
+
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx
index 5c57af5b6ce8..791e9fe5a8c1 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -55,13 +55,17 @@
#include <com/sun/star/awt/XDialogProvider.hpp>
#include <com/sun/star/frame/XModel.hpp>
-
+#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <basic/basicmanagerrepository.hxx>
+#include <basic/basmgr.hxx>
//==================================================================================================
#include <xmlscript/xmldlg_imexp.hxx>
#include <sbunoobj.hxx>
#include <basic/sbstar.hxx>
#include <basic/sbmeth.hxx>
+#include <basic/sbuno.hxx>
#include <runtime.hxx>
#include <sbintern.hxx>
@@ -85,11 +89,6 @@ using namespace ::osl;
-//===================================================================
-void unoToSbxValue( SbxVariable* pVar, const Any& aValue );
-Any sbxToUnoValue( SbxVariable* pVar );
-
-
Reference< frame::XModel > getModelFromBasic( SbxObject* pBasic )
{
OSL_PRECOND( pBasic != NULL, "getModelFromBasic: illegal call!" );
@@ -450,6 +449,43 @@ Any implFindDialogLibForDialog( const Any& rDlgAny, SbxObject* pBasic )
return aRetDlgLibAny;
}
+Any implFindDialogLibForDialogBasic( const Any& aAnyISP, SbxObject* pBasic, StarBASIC*& pFoundBasic )
+{
+ Any aDlgLibAny;
+ // Find dialog library for dialog, direct access is not possible here
+ StarBASIC* pStartedBasic = (StarBASIC*)pBasic;
+ SbxObject* pParentBasic = pStartedBasic ? pStartedBasic->GetParent() : NULL;
+ SbxObject* pParentParentBasic = pParentBasic ? pParentBasic->GetParent() : NULL;
+
+ SbxObject* pSearchBasic1 = NULL;
+ SbxObject* pSearchBasic2 = NULL;
+ if( pParentParentBasic )
+ {
+ pSearchBasic1 = pParentBasic;
+ pSearchBasic2 = pParentParentBasic;
+ }
+ else
+ {
+ pSearchBasic1 = pStartedBasic;
+ pSearchBasic2 = pParentBasic;
+ }
+ if( pSearchBasic1 )
+ {
+ aDlgLibAny = implFindDialogLibForDialog( aAnyISP, pSearchBasic1 );
+
+ if ( aDlgLibAny.hasValue() )
+ pFoundBasic = (StarBASIC*)pSearchBasic1;
+
+ else if( pSearchBasic2 )
+ {
+ aDlgLibAny = implFindDialogLibForDialog( aAnyISP, pSearchBasic2 );
+ if ( aDlgLibAny.hasValue() )
+ pFoundBasic = (StarBASIC*)pSearchBasic2;
+ }
+ }
+ return aDlgLibAny;
+}
+
static ::rtl::OUString aDecorationPropName =
::rtl::OUString::createFromAscii( "Decoration" );
static ::rtl::OUString aTitlePropName =
@@ -529,39 +565,54 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite )
{}
}
- // Find dialog library for dialog, direct access is not possible here
- StarBASIC* pStartedBasic = pINST->GetBasic();
- SbxObject* pParentBasic = pStartedBasic ? pStartedBasic->GetParent() : NULL;
- SbxObject* pParentParentBasic = pParentBasic ? pParentBasic->GetParent() : NULL;
-
- SbxObject* pSearchBasic1 = NULL;
- SbxObject* pSearchBasic2 = NULL;
- if( pParentParentBasic )
+ Any aDlgLibAny;
+ bool bDocDialog = false;
+ StarBASIC* pFoundBasic = NULL;
+ OSL_TRACE("About to try get a hold of ThisComponent");
+ Reference< frame::XModel > xModel = getModelFromBasic( pINST->GetBasic() ) ;
+ aDlgLibAny = implFindDialogLibForDialogBasic( aAnyISP, pINST->GetBasic(), pFoundBasic );
+ // If we found the dialog then it belongs to the Search basic
+ if ( !pFoundBasic )
{
- pSearchBasic1 = pParentBasic;
- pSearchBasic2 = pParentParentBasic;
- }
- else
+ Reference< frame::XDesktop > xDesktop( xMSF->createInstance
+ ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ) ),
+ UNO_QUERY );
+ Reference< container::XEnumeration > xModels;
+ if ( xDesktop.is() )
{
- pSearchBasic1 = pStartedBasic;
- pSearchBasic2 = pParentBasic;
- }
-
- Any aDlgLibAny;
- if( pSearchBasic1 )
+ Reference< container::XEnumerationAccess > xComponents( xDesktop->getComponents(), UNO_QUERY );
+ if ( xComponents.is() )
+ xModels.set( xComponents->createEnumeration(), UNO_QUERY );
+ if ( xModels.is() )
+ {
+ while ( xModels->hasMoreElements() )
+ {
+ Reference< frame::XModel > xNextModel( xModels->nextElement(), UNO_QUERY );
+ if ( xNextModel.is() )
+ {
+ BasicManager* pMgr = basic::BasicManagerRepository::getDocumentBasicManager( xNextModel );
+ if ( pMgr )
+ aDlgLibAny = implFindDialogLibForDialogBasic( aAnyISP, pMgr->GetLib(0), pFoundBasic );
+ if ( aDlgLibAny.hasValue() )
{
- aDlgLibAny = implFindDialogLibForDialog( aAnyISP, pSearchBasic1 );
- if( pSearchBasic2 && aDlgLibAny.getValueType().getTypeClass() == TypeClass_VOID )
- aDlgLibAny = implFindDialogLibForDialog( aAnyISP, pSearchBasic2 );
+ bDocDialog = true;
+ xModel = xNextModel;
+ break;
}
-
-
- OSL_TRACE("About to try get a hold of ThisComponent");
- Reference< frame::XModel > xModel = getModelFromBasic( pStartedBasic ) ;
- Reference< XScriptListener > xScriptListener = new BasicScriptListener_Impl( pStartedBasic, xModel );
+ }
+ }
+ }
+ }
+ }
+ if ( pFoundBasic )
+ bDocDialog = pFoundBasic->IsDocBasic();
+ Reference< XScriptListener > xScriptListener = new BasicScriptListener_Impl( pINST->GetBasic(), xModel );
Sequence< Any > aArgs( 4 );
- aArgs[ 0 ] <<= xModel;
+ if( bDocDialog )
+ aArgs[ 0 ] <<= xModel;
+ else
+ aArgs[ 0 ] <<= uno::Reference< uno::XInterface >();
aArgs[ 1 ] <<= xInput;
aArgs[ 2 ] = aDlgLibAny;
aArgs[ 3 ] <<= xScriptListener;
diff --git a/basic/source/classes/makefile.mk b/basic/source/classes/makefile.mk
index eb5486f02abf..e00ed4674cc1 100644
--- a/basic/source/classes/makefile.mk
+++ b/basic/source/classes/makefile.mk
@@ -37,18 +37,28 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
+ALLTAR .SEQUENTIAL : \
+ $(MISC)$/$(TARGET).don \
+ $(MISC)$/$(TARGET).slo
+
+$(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb
+ +$(CPPUMAKER) -O$(OUT)$/inc -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@
+ echo $@
+
+$(MISC)$/$(TARGET).slo : $(SLOTARGET)
+ echo $@
+
# --- Allgemein -----------------------------------------------------------
-COMMON_SLOFILES= \
+SLOFILES= \
$(SLO)$/sb.obj \
$(SLO)$/sbxmod.obj \
$(SLO)$/image.obj \
$(SLO)$/sbintern.obj \
$(SLO)$/sbunoobj.obj \
$(SLO)$/propacc.obj \
- $(SLO)$/disas.obj
-
-SLOFILES= $(COMMON_SLOFILES) \
+ $(SLO)$/disas.obj \
+ $(SLO)$/errobject.obj \
$(SLO)$/eventatt.obj
OBJFILES= \
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index c5ac53c43092..79c5f78601ea 100644..100755
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -49,11 +49,18 @@
#include "disas.hxx"
#include "runtime.hxx"
#include <basic/sbuno.hxx>
+#include <basic/sbobjmod.hxx>
#include "stdobj.hxx"
#include "filefmt.hxx"
#include "sb.hrc"
#include <basrid.hxx>
#include <vos/mutex.hxx>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include "errobject.hxx"
+
+#include <com/sun/star/script/ModuleType.hpp>
+#include <com/sun/star/script/ModuleInfo.hpp>
+using namespace ::com::sun::star::script;
// #pragma SW_SEGMENT_CLASS( SBASIC, SBASIC_CODE )
@@ -63,6 +70,10 @@ TYPEINIT1(StarBASIC,SbxObject)
#define RTLNAME "@SBRTL"
// i#i68894#
+using com::sun::star::uno::Reference;
+using com::sun::star::uno::Any;
+using com::sun::star::uno::UNO_QUERY;
+using com::sun::star::lang::XMultiServiceFactory;
const static String aThisComponent( RTL_CONSTASCII_USTRINGPARAM("ThisComponent") );
const static String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) );
@@ -70,7 +81,25 @@ const static String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) );
SbxObject* StarBASIC::getVBAGlobals( )
{
if ( !pVBAGlobals )
+ {
+ Any aThisDoc;
+ if ( GetUNOConstant("ThisComponent", aThisDoc) )
+ {
+ Reference< XMultiServiceFactory > xDocFac( aThisDoc, UNO_QUERY );
+ if ( xDocFac.is() )
+ {
+ try
+ {
+ xDocFac->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAGlobals" ) ) );
+ }
+ catch( Exception& )
+ {
+ // Ignore
+ }
+ }
+ }
pVBAGlobals = (SbUnoObject*)Find( aVBAHook , SbxCLASS_DONTCARE );
+ }
return pVBAGlobals;
}
@@ -215,6 +244,7 @@ const SFX_VB_ErrorItem __FAR_DATA SFX_VB_ErrorTab[] =
{ 1004, SbERR_METHOD_FAILED },
{ 1005, SbERR_SETPROP_FAILED },
{ 1006, SbERR_GETPROP_FAILED },
+ { 1007, SbERR_BASIC_COMPAT },
{ 0xFFFF, 0xFFFFFFFFL } // End mark
};
@@ -291,23 +321,52 @@ SbxObject* SbOLEFactory::CreateObject( const String& rClassName )
}
-// Factory class to create user defined objects (type command)
-class SbTypeFactory : public SbxFactory
-{
- SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj );
+//========================================================================
+// SbFormFactory, show user forms by: dim as new <user form name>
+class SbFormFactory : public SbxFactory
+{
public:
virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX );
virtual SbxObject* CreateObject( const String& );
};
-SbxBase* SbTypeFactory::Create( UINT16, UINT32 )
+SbxBase* SbFormFactory::Create( UINT16, UINT32 )
{
// Not supported
return NULL;
}
-SbxObject* SbTypeFactory::cloneTypeObjectImpl( const SbxObject& rTypeObj )
+SbxObject* SbFormFactory::CreateObject( const String& rClassName )
+{
+ static String aLoadMethodName( RTL_CONSTASCII_USTRINGPARAM("load") );
+
+ SbxObject* pRet = NULL;
+ SbModule* pMod = pMOD;
+ if( pMod )
+ {
+ SbxVariable* pVar = pMod->Find( rClassName, SbxCLASS_OBJECT );
+ if( pVar )
+ {
+ SbxBase* pObj = pVar->GetObject();
+ SbUserFormModule* pFormModule = PTR_CAST( SbUserFormModule, pObj );
+
+ if( pFormModule != NULL )
+ {
+ pFormModule->load();
+ SbUserFormModuleInstance* pFormInstance = pFormModule->CreateInstance();
+ pRet = pFormInstance;
+ }
+ }
+ }
+ return pRet;
+}
+
+
+//========================================================================
+// SbTypeFactory
+
+SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj )
{
SbxObject* pRet = new SbxObject( rTypeObj );
pRet->PutObject( pRet );
@@ -322,7 +381,8 @@ SbxObject* SbTypeFactory::cloneTypeObjectImpl( const SbxObject& rTypeObj )
if( pProp )
{
SbxProperty* pNewProp = new SbxProperty( *pProp );
- if( pVar->GetType() & SbxARRAY )
+ SbxDataType eVarType = pVar->GetType();
+ if( eVarType & SbxARRAY )
{
SbxBase* pParObj = pVar->GetObject();
SbxDimArray* pSource = PTR_CAST(SbxDimArray,pParObj);
@@ -349,12 +409,35 @@ SbxObject* SbTypeFactory::cloneTypeObjectImpl( const SbxObject& rTypeObj )
pNewProp->PutObject( pDest );
pNewProp->SetFlags( nSavFlags );
}
+ if( eVarType == SbxOBJECT )
+ {
+ SbxBase* pObjBase = pVar->GetObject();
+ SbxObject* pSrcObj = PTR_CAST(SbxObject,pObjBase);
+ SbxObject* pDestObj = NULL;
+ if( pSrcObj != NULL )
+ pDestObj = cloneTypeObjectImpl( *pSrcObj );
+ pNewProp->PutObject( pDestObj );
+ }
pProps->PutDirect( pNewProp, i );
}
}
return pRet;
}
+// Factory class to create user defined objects (type command)
+class SbTypeFactory : public SbxFactory
+{
+public:
+ virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX );
+ virtual SbxObject* CreateObject( const String& );
+};
+
+SbxBase* SbTypeFactory::Create( UINT16, UINT32 )
+{
+ // Not supported
+ return NULL;
+}
+
SbxObject* SbTypeFactory::CreateObject( const String& rClassName )
{
SbxObject* pRet = NULL;
@@ -485,6 +568,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
}
}
}
+ SetModuleType( ModuleType::CLASS );
}
SbClassModuleObject::~SbClassModuleObject()
@@ -682,6 +766,7 @@ StarBASIC::StarBASIC( StarBASIC* p, BOOL bIsDocBasic )
SetParent( p );
pLibInfo = NULL;
bNoRtl = bBreak = FALSE;
+ bVBAEnabled = FALSE;
pModules = new SbxArray;
if( !GetSbData()->nInst++ )
@@ -696,6 +781,8 @@ StarBASIC::StarBASIC( StarBASIC* p, BOOL bIsDocBasic )
AddFactory( pCLASSFAC );
pOLEFAC = new SbOLEFactory;
AddFactory( pOLEFAC );
+ pFORMFAC = new SbFormFactory;
+ AddFactory( pFORMFAC );
}
pRtl = new SbiStdObject( String( RTL_CONSTASCII_USTRINGPARAM(RTLNAME) ), this );
// Search via StarBasic is always global
@@ -716,15 +803,17 @@ StarBASIC::~StarBASIC()
if( !--GetSbData()->nInst )
{
RemoveFactory( pSBFAC );
- pSBFAC = NULL;
+ delete pSBFAC; pSBFAC = NULL;
RemoveFactory( pUNOFAC );
- pUNOFAC = NULL;
+ delete pUNOFAC; pUNOFAC = NULL;
RemoveFactory( pTYPEFAC );
- pTYPEFAC = NULL;
+ delete pTYPEFAC; pTYPEFAC = NULL;
RemoveFactory( pCLASSFAC );
- pCLASSFAC = NULL;
+ delete pCLASSFAC; pCLASSFAC = NULL;
RemoveFactory( pOLEFAC );
- pOLEFAC = NULL;
+ delete pOLEFAC; pOLEFAC = NULL;
+ RemoveFactory( pFORMFAC );
+ delete pFORMFAC; pFORMFAC = NULL;
#ifdef DBG_UTIL
// There is no need to clean SbiData at program end,
@@ -782,7 +871,34 @@ SbModule* StarBASIC::MakeModule( const String& rName, const String& rSrc )
SbModule* StarBASIC::MakeModule32( const String& rName, const ::rtl::OUString& rSrc )
{
- SbModule* p = new SbModule( rName );
+ ModuleInfo mInfo;
+ mInfo.ModuleType = ModuleType::NORMAL;
+ return MakeModule32( rName, mInfo, rSrc );
+}
+SbModule* StarBASIC::MakeModule32( const String& rName, const ModuleInfo& mInfo, const rtl::OUString& rSrc )
+{
+
+ OSL_TRACE("create module %s type mInfo %d", rtl::OUStringToOString( rName, RTL_TEXTENCODING_UTF8 ).getStr(), mInfo.ModuleType );
+ SbModule* p = NULL;
+ switch ( mInfo.ModuleType )
+ {
+ case ModuleType::DOCUMENT:
+ // In theory we should be able to create Object modules
+ // in ordinary basic ( in vba mode thought these are create
+ // by the application/basic and not by the user )
+ p = new SbObjModule( rName, mInfo, isVBAEnabled() );
+ break;
+ case ModuleType::CLASS:
+ p = new SbModule( rName, isVBAEnabled() );
+ p->SetModuleType( ModuleType::CLASS );
+ break;
+ case ModuleType::FORM:
+ p = new SbUserFormModule( rName, mInfo, isVBAEnabled() );
+ break;
+ default:
+ p = new SbModule( rName, isVBAEnabled() );
+
+ }
p->SetSource32( rSrc );
p->SetParent( this );
pModules->Insert( p, pModules->Count() );
@@ -958,6 +1074,12 @@ SbxVariable* StarBASIC::Find( const String& rName, SbxClassType t )
}
pNamed = p;
}
+ // Only variables qualified by the Module Name e.g. Sheet1.foo
+ // should work for Documant && Class type Modules
+ INT32 nType = p->GetModuleType();
+ if ( nType == ModuleType::DOCUMENT || nType == ModuleType::FORM )
+ continue;
+
// otherwise check if the element is available
// unset GBLSEARCH-Flag (due to Rekursion)
USHORT nGblFlag = p->GetFlags() & SBX_GBLSEARCH;
@@ -1329,6 +1451,7 @@ void StarBASIC::MakeErrorText( SbError nId, const String& aMsg )
}
else
GetSbData()->aErrMsg = String::EmptyString();
+
}
BOOL StarBASIC::CError
@@ -1385,7 +1508,22 @@ BOOL StarBASIC::RTError( SbError code, const String& rMsg, USHORT l, USHORT c1,
// Umsetzung des Codes fuer String-Transport in SFX-Error
if( rMsg.Len() )
- code = (ULONG)*new StringErrorInfo( code, String(rMsg) );
+ {
+ // very confusing, even though MakeErrorText sets up the error text
+ // seems that this is not used ( if rMsg already has content )
+ // In the case of VBA MakeErrorText also formats the error to be alittle more
+ // like vba ( adds an error number etc )
+ if ( SbiRuntime::isVBAEnabled() && ( code == SbERR_BASIC_COMPAT ) )
+ {
+ String aTmp = '\'';
+ aTmp += String::CreateFromInt32( SbxErrObject::getUnoErrObject()->getNumber() );
+ aTmp += String( RTL_CONSTASCII_USTRINGPARAM("\'\n") );
+ aTmp += GetSbData()->aErrMsg.Len() ? GetSbData()->aErrMsg : rMsg;
+ code = (ULONG)*new StringErrorInfo( code, aTmp );
+ }
+ else
+ code = (ULONG)*new StringErrorInfo( code, String(rMsg) );
+ }
SetErrorData( code, l, c1, c2 );
if( GetSbData()->aErrHdl.IsSet() )
diff --git a/basic/source/classes/sb.src b/basic/source/classes/sb.src
index 926da0359d7e..73cc1c3a0b2c 100644
--- a/basic/source/classes/sb.src
+++ b/basic/source/classes/sb.src
@@ -588,6 +588,10 @@ Resource RID_BASIC_START
{
Text [ en-US ] = "For loop not initialized." ;
};
+ String ERRCODE_BASIC_COMPAT & ERRCODE_RES_MASK
+ {
+ Text [ en-US ] = "$(ARG1)" ;
+ };
};
// Hinweis: IDS_SBERR_TERMINATED = IDS_SBERR_START+2000.
String IDS_SBERR_TERMINATED
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 1e278bf583a7..e51a0c09270b 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -49,6 +49,7 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/uno/DeploymentException.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -112,9 +113,9 @@ typedef WeakImplHelper1< XAllListener > BasicAllListenerHelper;
// Identifier fuer die dbg_-Properies als Strings anlegen
-static String ID_DBG_SUPPORTEDINTERFACES( RTL_CONSTASCII_USTRINGPARAM("Dbg_SupportedInterfaces") );
-static String ID_DBG_PROPERTIES( RTL_CONSTASCII_USTRINGPARAM("Dbg_Properties") );
-static String ID_DBG_METHODS( RTL_CONSTASCII_USTRINGPARAM("Dbg_Methods") );
+static char const ID_DBG_SUPPORTEDINTERFACES[] = "Dbg_SupportedInterfaces";
+static char const ID_DBG_PROPERTIES[] = "Dbg_Properties";
+static char const ID_DBG_METHODS[] = "Dbg_Methods";
static ::rtl::OUString aSeqLevelStr( RTL_CONSTASCII_USTRINGPARAM("[]") );
static ::rtl::OUString defaultNameSpace( RTL_CONSTASCII_USTRINGPARAM("ooo.vba") );
@@ -139,16 +140,19 @@ bool SbUnoObject::getDefaultPropName( SbUnoObject* pUnoObj, String& sDfltProp )
SbxVariable* getDefaultProp( SbxVariable* pRef )
{
SbxVariable* pDefaultProp = NULL;
- SbxObject* pObj = PTR_CAST(SbxObject,(SbxVariable*) pRef);
- if ( !pObj )
+ if ( pRef->GetType() == SbxOBJECT )
{
- SbxBase* pObjVarObj = pRef->GetObject();
- pObj = PTR_CAST(SbxObject,pObjVarObj);
- }
- if ( pObj && pObj->ISA(SbUnoObject) )
- {
- SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,(SbxObject*)pObj);
- pDefaultProp = pUnoObj->GetDfltProperty();
+ SbxObject* pObj = PTR_CAST(SbxObject,(SbxVariable*) pRef);
+ if ( !pObj )
+ {
+ SbxBase* pObjVarObj = pRef->GetObject();
+ pObj = PTR_CAST(SbxObject,pObjVarObj);
+ }
+ if ( pObj && pObj->ISA(SbUnoObject) )
+ {
+ SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,(SbxObject*)pObj);
+ pDefaultProp = pUnoObj->GetDfltProperty();
+ }
}
return pDefaultProp;
}
@@ -564,7 +568,7 @@ SbxDataType unoToSbxType( const Reference< XIdlClass >& xIdlClass )
}
return eRetType;
}
-void unoToSbxValue( SbxVariable* pVar, const Any& aValue );
+
static void implSequenceToMultiDimArray( SbxDimArray*& pArray, Sequence< sal_Int32 >& indices, Sequence< sal_Int32 >& sizes, const Any& aValue, sal_Int32& dimension, sal_Bool bIsZeroIndex, Type* pType = NULL )
{
Type aType = aValue.getValueType();
@@ -1071,8 +1075,19 @@ Any sbxToUnoValueImpl( SbxVariable* pVar, bool bBlockConversionToSmallestType =
if( eBaseType == SbxOBJECT )
{
SbxBaseRef xObj = (SbxBase*)pVar->GetObject();
- if( xObj.Is() && xObj->ISA(SbUnoAnyObject) )
- return ((SbUnoAnyObject*)(SbxBase*)xObj)->getValue();
+ if( xObj.Is() )
+ {
+ if( xObj->ISA(SbUnoAnyObject) )
+ return ((SbUnoAnyObject*)(SbxBase*)xObj)->getValue();
+ if( xObj->ISA(SbClassModuleObject) )
+ {
+ Any aRetAny;
+ SbClassModuleObject* pClassModuleObj = (SbClassModuleObject*)(SbxBase*)xObj;
+ SbModule* pClassModule = pClassModuleObj->getClassModule();
+ if( pClassModule->createCOMWrapperForIface( aRetAny, pClassModuleObj ) )
+ return aRetAny;
+ }
+ }
}
Type aType = getUnoTypeForSbxValue( pVar );
@@ -1578,12 +1593,18 @@ String getBasicObjectTypeName( SbxObject* pObj )
bool checkUnoObjectType( SbUnoObject* pUnoObj,
const String& aClass )
{
- bool result = false;
Any aToInspectObj = pUnoObj->getUnoAny();
TypeClass eType = aToInspectObj.getValueType().getTypeClass();
if( eType != TypeClass_INTERFACE )
return false;
const Reference< XInterface > x = *(Reference< XInterface >*)aToInspectObj.getValue();
+
+ // Return true for XInvocation based objects as interface type names don't count then
+ Reference< XInvocation > xInvocation( x, UNO_QUERY );
+ if( xInvocation.is() )
+ return true;
+
+ bool result = false;
Reference< XTypeProvider > xTypeProvider( x, UNO_QUERY );
if( xTypeProvider.is() )
{
@@ -1601,6 +1622,23 @@ bool checkUnoObjectType( SbUnoObject* pUnoObj,
break;
}
::rtl::OUString sClassName = xClass->getName();
+ if ( sClassName.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.bridge.oleautomation.XAutomationObject" ) ) ) )
+ {
+ // there is a hack in the extensions/source/ole/oleobj.cxx to return the typename of the automation object, lets check if it
+ // matches
+ Reference< XInvocation > xInv( aToInspectObj, UNO_QUERY );
+ if ( xInv.is() )
+ {
+ rtl::OUString sTypeName;
+ xInv->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("$GetTypeName") ) ) >>= sTypeName;
+ if ( sTypeName.getLength() == 0 || sTypeName.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IDispatch") ) ) )
+ // can't check type, leave it pass
+ result = true;
+ else
+ result = sTypeName.equals( aClass );
+ }
+ break; // finished checking automation object
+ }
OSL_TRACE("Checking if object implements %s",
OUStringToOString( defaultNameSpace + aClass,
RTL_TEXTENCODING_UTF8 ).getStr() );
@@ -1630,7 +1668,7 @@ String Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj )
String aRet;
if( eType != TypeClass_INTERFACE )
{
- aRet += ID_DBG_SUPPORTEDINTERFACES;
+ aRet.AppendAscii( RTL_CONSTASCII_STRINGPARAM(ID_DBG_SUPPORTEDINTERFACES) );
aRet.AppendAscii( " not available.\n(TypeClass is not TypeClass_INTERFACE)\n" );
}
else
@@ -2653,15 +2691,15 @@ void SbUnoObject::implCreateDbgProperties( void )
Property aProp;
// Id == -1: Implementierte Interfaces gemaess ClassProvider anzeigen
- SbxVariableRef xVarRef = new SbUnoProperty( ID_DBG_SUPPORTEDINTERFACES, SbxSTRING, aProp, -1, false );
+ SbxVariableRef xVarRef = new SbUnoProperty( String(RTL_CONSTASCII_USTRINGPARAM(ID_DBG_SUPPORTEDINTERFACES)), SbxSTRING, aProp, -1, false );
QuickInsert( (SbxVariable*)xVarRef );
// Id == -2: Properties ausgeben
- xVarRef = new SbUnoProperty( ID_DBG_PROPERTIES, SbxSTRING, aProp, -2, false );
+ xVarRef = new SbUnoProperty( String(RTL_CONSTASCII_USTRINGPARAM(ID_DBG_PROPERTIES)), SbxSTRING, aProp, -2, false );
QuickInsert( (SbxVariable*)xVarRef );
// Id == -3: Methoden ausgeben
- xVarRef = new SbUnoProperty( ID_DBG_METHODS, SbxSTRING, aProp, -3, false );
+ xVarRef = new SbUnoProperty( String(RTL_CONSTASCII_USTRINGPARAM(ID_DBG_METHODS)), SbxSTRING, aProp, -3, false );
QuickInsert( (SbxVariable*)xVarRef );
}
@@ -4115,3 +4153,267 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite )
refVar->PutObject( xUnoAnyObject );
}
+//==========================================================================
+
+typedef WeakImplHelper1< XInvocation > ModuleInvocationProxyHelper;
+
+class ModuleInvocationProxy : public ModuleInvocationProxyHelper
+{
+ ::rtl::OUString m_aPrefix;
+ SbxObjectRef m_xScopeObj;
+ bool m_bProxyIsClassModuleObject;
+
+public:
+ ModuleInvocationProxy( const ::rtl::OUString& aPrefix, SbxObjectRef xScopeObj );
+ ~ModuleInvocationProxy()
+ {}
+
+ // XInvocation
+ virtual Reference< XIntrospectionAccess > SAL_CALL getIntrospection() throw();
+ virtual void SAL_CALL setValue( const ::rtl::OUString& rProperty, const Any& rValue )
+ throw( UnknownPropertyException );
+ virtual Any SAL_CALL getValue( const ::rtl::OUString& rProperty )
+ throw( UnknownPropertyException );
+ virtual sal_Bool SAL_CALL hasMethod( const ::rtl::OUString& rName ) throw();
+ virtual sal_Bool SAL_CALL hasProperty( const ::rtl::OUString& rProp ) throw();
+
+ virtual Any SAL_CALL invoke( const ::rtl::OUString& rFunction,
+ const Sequence< Any >& rParams,
+ Sequence< sal_Int16 >& rOutParamIndex,
+ Sequence< Any >& rOutParam )
+ throw( CannotConvertException, InvocationTargetException );
+};
+
+ModuleInvocationProxy::ModuleInvocationProxy( const ::rtl::OUString& aPrefix, SbxObjectRef xScopeObj )
+ : m_aPrefix( aPrefix + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_") ) )
+ , m_xScopeObj( xScopeObj )
+{
+ m_bProxyIsClassModuleObject = xScopeObj.Is() ? xScopeObj->ISA(SbClassModuleObject) : false;
+}
+
+Reference< XIntrospectionAccess > SAL_CALL ModuleInvocationProxy::getIntrospection() throw()
+{
+ return Reference< XIntrospectionAccess >();
+}
+
+void SAL_CALL ModuleInvocationProxy::setValue( const ::rtl::OUString& rProperty, const Any& rValue ) throw( UnknownPropertyException )
+{
+ if( !m_bProxyIsClassModuleObject )
+ throw UnknownPropertyException();
+
+ NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() );
+
+ ::rtl::OUString aPropertyFunctionName( RTL_CONSTASCII_USTRINGPARAM( "Property Set ") );
+ aPropertyFunctionName += m_aPrefix;
+ aPropertyFunctionName += rProperty;
+
+ SbxVariable* p = m_xScopeObj->Find( aPropertyFunctionName, SbxCLASS_METHOD );
+ SbMethod* pMeth = p != NULL ? PTR_CAST(SbMethod,p) : NULL;
+ if( pMeth == NULL )
+ {
+ // TODO: Check vba behavior concernig missing function
+ //StarBASIC::Error( SbERR_NO_METHOD, aFunctionName );
+ throw UnknownPropertyException();
+ }
+
+ // Setup parameter
+ SbxArrayRef xArray = new SbxArray;
+ SbxVariableRef xVar = new SbxVariable( SbxVARIANT );
+ unoToSbxValue( (SbxVariable*)xVar, rValue );
+ xArray->Put( xVar, 1 );
+
+ // Call property method
+ SbxVariableRef xValue = new SbxVariable;
+ pMeth->SetParameters( xArray );
+ pMeth->Call( xValue );
+ //aRet = sbxToUnoValue( xValue );
+ pMeth->SetParameters( NULL );
+
+ // TODO: OutParameter?
+
+ // throw InvocationTargetException();
+
+ //return aRet;
+
+}
+
+Any SAL_CALL ModuleInvocationProxy::getValue( const ::rtl::OUString& rProperty ) throw( UnknownPropertyException )
+{
+ if( !m_bProxyIsClassModuleObject )
+ throw UnknownPropertyException();
+
+ NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() );
+
+ ::rtl::OUString aPropertyFunctionName( RTL_CONSTASCII_USTRINGPARAM( "Property Get ") );
+ aPropertyFunctionName += m_aPrefix;
+ aPropertyFunctionName += rProperty;
+
+ SbxVariable* p = m_xScopeObj->Find( aPropertyFunctionName, SbxCLASS_METHOD );
+ SbMethod* pMeth = p != NULL ? PTR_CAST(SbMethod,p) : NULL;
+ if( pMeth == NULL )
+ {
+ // TODO: Check vba behavior concernig missing function
+ //StarBASIC::Error( SbERR_NO_METHOD, aFunctionName );
+ throw UnknownPropertyException();
+ }
+
+ // Call method
+ SbxVariableRef xValue = new SbxVariable;
+ pMeth->Call( xValue );
+ Any aRet = sbxToUnoValue( xValue );
+ return aRet;
+}
+
+sal_Bool SAL_CALL ModuleInvocationProxy::hasMethod( const ::rtl::OUString& ) throw()
+{
+ return sal_False;
+}
+
+sal_Bool SAL_CALL ModuleInvocationProxy::hasProperty( const ::rtl::OUString& ) throw()
+{
+ return sal_False;
+}
+
+Any SAL_CALL ModuleInvocationProxy::invoke( const ::rtl::OUString& rFunction,
+ const Sequence< Any >& rParams,
+ Sequence< sal_Int16 >&,
+ Sequence< Any >& )
+ throw( CannotConvertException, InvocationTargetException )
+{
+ NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() );
+
+ Any aRet;
+ if( !m_xScopeObj.Is() )
+ return aRet;
+
+ ::rtl::OUString aFunctionName = m_aPrefix;
+ aFunctionName += rFunction;
+
+ SbxVariable* p = m_xScopeObj->Find( aFunctionName, SbxCLASS_METHOD );
+ SbMethod* pMeth = p != NULL ? PTR_CAST(SbMethod,p) : NULL;
+ if( pMeth == NULL )
+ {
+ // TODO: Check vba behavior concernig missing function
+ //StarBASIC::Error( SbERR_NO_METHOD, aFunctionName );
+ return aRet;
+ }
+
+ // Setup parameters
+ SbxArrayRef xArray;
+ sal_Int32 nParamCount = rParams.getLength();
+ if( nParamCount )
+ {
+ xArray = new SbxArray;
+ const Any *pArgs = rParams.getConstArray();
+ for( sal_Int32 i = 0 ; i < nParamCount ; i++ )
+ {
+ SbxVariableRef xVar = new SbxVariable( SbxVARIANT );
+ unoToSbxValue( (SbxVariable*)xVar, pArgs[i] );
+ xArray->Put( xVar, sal::static_int_cast< USHORT >(i+1) );
+ }
+ }
+
+ // Call method
+ SbxVariableRef xValue = new SbxVariable;
+ if( xArray.Is() )
+ pMeth->SetParameters( xArray );
+ pMeth->Call( xValue );
+ aRet = sbxToUnoValue( xValue );
+ pMeth->SetParameters( NULL );
+
+ // TODO: OutParameter?
+
+ return aRet;
+}
+
+Reference< XInterface > createComListener( const Any& aControlAny, const ::rtl::OUString& aVBAType,
+ const ::rtl::OUString& aPrefix, SbxObjectRef xScopeObj )
+{
+ Reference< XInterface > xRet;
+
+ Reference< XComponentContext > xContext = getComponentContext_Impl();
+ Reference< XMultiComponentFactory > xServiceMgr( xContext->getServiceManager() );
+
+ Reference< XInvocation > xProxy = new ModuleInvocationProxy( aPrefix, xScopeObj );
+
+ Sequence<Any> args( 3 );
+ args[0] <<= aControlAny;
+ args[1] <<= aVBAType;
+ args[2] <<= xProxy;
+
+ try
+ {
+ xRet = xServiceMgr->createInstanceWithArgumentsAndContext(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.custom.UnoComListener")),
+ args, xContext );
+ }
+ catch( const Exception& )
+ {
+ implHandleAnyException( ::cppu::getCaughtException() );
+ }
+
+ return xRet;
+}
+
+// Handle module implements mechanism for OLE types
+bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pProxyClassModuleObject )
+{
+ // For now: Take first interface that allows to instantiate COM wrapper
+ // TODO: Check if support for multiple interfaces is needed
+
+ Reference< XComponentContext > xContext = getComponentContext_Impl();
+ Reference< XMultiComponentFactory > xServiceMgr( xContext->getServiceManager() );
+ Reference< XSingleServiceFactory > xComImplementsFactory
+ (
+ xServiceMgr->createInstanceWithContext(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.custom.ComImplementsFactory")), xContext ),
+ UNO_QUERY
+ );
+ if( !xComImplementsFactory.is() )
+ return false;
+
+ bool bSuccess = false;
+
+ SbxArray* pModIfaces = pClassData->mxIfaces;
+ USHORT nCount = pModIfaces->Count();
+ for( USHORT i = 0 ; i < nCount ; ++i )
+ {
+ SbxVariable* pVar = pModIfaces->Get( i );
+ ::rtl::OUString aIfaceName = pVar->GetName();
+
+ if( aIfaceName.getLength() != 0 )
+ {
+ ::rtl::OUString aPureIfaceName = aIfaceName;
+ sal_Int32 indexLastDot = aIfaceName.lastIndexOf('.');
+ if ( indexLastDot > -1 )
+ aPureIfaceName = aIfaceName.copy( indexLastDot + 1 );
+
+ Reference< XInvocation > xProxy = new ModuleInvocationProxy( aPureIfaceName, pProxyClassModuleObject );
+
+ Sequence<Any> args( 2 );
+ args[0] <<= aIfaceName;
+ args[1] <<= xProxy;
+
+ Reference< XInterface > xRet;
+ bSuccess = false;
+ try
+ {
+ xRet = xComImplementsFactory->createInstanceWithArguments( args );
+ bSuccess = true;
+ }
+ catch( const Exception& )
+ {
+ implHandleAnyException( ::cppu::getCaughtException() );
+ }
+
+ if( bSuccess )
+ {
+ o_rRetAny <<= xRet;
+ break;
+ }
+ }
+ }
+
+ return bSuccess;
+}
+
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 092ef458041e..1b49a376c9bd 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -52,7 +52,13 @@
#include <basic/basrdll.hxx>
#include <vos/mutex.hxx>
+#include <basic/sbobjmod.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/beans/XPropertySet.hpp>
+using namespace com::sun::star;
// for the bsearch
#ifdef WNT
@@ -72,6 +78,13 @@
#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
+#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/XControl.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/anytostring.hxx>
TYPEINIT1(SbModule,SbxObject)
TYPEINIT1(SbMethod,SbxMethod)
@@ -79,6 +92,8 @@ TYPEINIT1(SbProperty,SbxProperty)
TYPEINIT1(SbProcedureProperty,SbxProperty)
TYPEINIT1(SbJScriptModule,SbModule)
TYPEINIT1(SbJScriptMethod,SbMethod)
+TYPEINIT1(SbObjModule,SbModule)
+TYPEINIT1(SbUserFormModule,SbObjModule)
SV_DECL_VARARR(SbiBreakpoints,USHORT,4,4)
SV_IMPL_VARARR(SbiBreakpoints,USHORT)
@@ -86,6 +101,26 @@ SV_IMPL_VARARR(SbiBreakpoints,USHORT)
SV_IMPL_VARARR(HighlightPortions, HighlightPortion)
+bool getDefaultVBAMode( StarBASIC* pb )
+{
+ bool bResult = false;
+ if ( pb && pb->IsDocBasic() )
+ {
+ uno::Any aDoc;
+ if ( pb->GetUNOConstant( "ThisComponent", aDoc ) )
+ {
+ 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 );
+ if ( xVBAMode.is() )
+ bResult = ( xVBAMode->getVBACompatModeOn() == sal_True );
+ }
+ }
+ }
+ return bResult;
+}
+
class AsyncQuitHandler
{
AsyncQuitHandler() {}
@@ -148,12 +183,18 @@ bool UnlockControllerHack( StarBASIC* pBasic )
// Ein BASIC-Modul hat EXTSEARCH gesetzt, damit die im Modul enthaltenen
// Elemente von anderen Modulen aus gefunden werden koennen.
-SbModule::SbModule( const String& rName )
+SbModule::SbModule( const String& rName, BOOL bVBACompat )
: SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("StarBASICModule") ) ),
- pImage( NULL ), pBreaks( NULL ), pClassData( NULL )
+ pImage( NULL ), pBreaks( NULL ), pClassData( NULL ), mbVBACompat( bVBACompat ), pDocObject( NULL ), bIsProxyModule( false )
{
SetName( rName );
SetFlag( SBX_EXTSEARCH | SBX_GBLSEARCH );
+ SetModuleType( script::ModuleType::NORMAL );
+
+ // #i92642: Set name property to intitial name
+ SbxVariable* pNameProp = pProps->Find( String( RTL_CONSTASCII_USTRINGPARAM("Name") ), SbxCLASS_PROPERTY );
+ if( pNameProp != NULL )
+ pNameProp->PutString( GetName() );
}
SbModule::~SbModule()
@@ -328,7 +369,10 @@ void SbModule::Clear()
SbxVariable* SbModule::Find( const XubString& rName, SbxClassType t )
{
+ // make sure a search in an uninstatiated class module will fail
SbxVariable* pRes = SbxObject::Find( rName, t );
+ if ( bIsProxyModule && !GetSbData()->bRunInit )
+ return NULL;
if( !pRes && pImage )
{
SbiInstance* pInst = pINST;
@@ -413,7 +457,19 @@ void SbModule::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
}
}
else
- SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType );
+ {
+ // #i92642: Special handling for name property to avoid
+ // side effects when using name as variable implicitely
+ bool bForwardToSbxObject = true;
+
+ ULONG nId = pHint->GetId();
+ if( (nId == SBX_HINT_DATAWANTED || nId == SBX_HINT_DATACHANGED) &&
+ pVar->GetName().EqualsIgnoreCaseAscii( "name" ) )
+ bForwardToSbxObject = false;
+
+ if( bForwardToSbxObject )
+ SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType );
+ }
}
}
@@ -427,6 +483,8 @@ void SbModule::SetSource( const String& r )
void SbModule::SetSource32( const ::rtl::OUString& r )
{
+ // Default basic mode to library container mode, but.. allow Option VBASupport 0/1 override
+ SetVBACompat( getDefaultVBAMode( static_cast< StarBASIC*>( GetParent() ) ) );
aOUSource = r;
StartDefinitions();
SbiTokenizer aTok( r );
@@ -457,9 +515,14 @@ void SbModule::SetSource32( const ::rtl::OUString& r )
if( eCurTok == OPTION )
{
eCurTok = aTok.Next();
- if( eCurTok == COMPATIBLE
- || ( ( eCurTok == VBASUPPORT ) && ( aTok.Next() == NUMBER ) && ( aTok.GetDbl()== 1 ) ) )
+ if( eCurTok == COMPATIBLE )
aTok.SetCompatible( true );
+ else if ( ( eCurTok == VBASUPPORT ) && ( aTok.Next() == NUMBER ) )
+ {
+ BOOL bIsVBA = ( aTok.GetDbl()== 1 );
+ SetVBACompat( bIsVBA );
+ aTok.SetCompatible( bIsVBA );
+ }
}
}
eLastTok = eCurTok;
@@ -600,7 +663,15 @@ void ClearUnoObjectsInRTL_Impl( StarBASIC* pBasic )
if( ((StarBASIC*)p) != pBasic )
ClearUnoObjectsInRTL_Impl_Rek( (StarBASIC*)p );
}
+BOOL SbModule::IsVBACompat() const
+{
+ return mbVBACompat;
+}
+void SbModule::SetVBACompat( BOOL bCompat )
+{
+ mbVBACompat = bCompat;
+}
// Ausfuehren eines BASIC-Unterprogramms
USHORT SbModule::Run( SbMethod* pMeth )
{
@@ -695,10 +766,9 @@ USHORT SbModule::Run( SbMethod* pMeth )
if( pRt->pNext )
pRt->pNext->block();
pINST->pRun = pRt;
- if ( SbiRuntime ::isVBAEnabled() )
+ if ( mbVBACompat )
{
pINST->EnableCompatibility( TRUE );
- pRt->SetVBAEnabled( true );
}
while( pRt->Step() ) {}
if( pRt->pNext )
@@ -1483,6 +1553,418 @@ SbJScriptMethod::~SbJScriptMethod()
/////////////////////////////////////////////////////////////////////////
+SbObjModule::SbObjModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVbaCompatible )
+ : SbModule( rName, bIsVbaCompatible )
+{
+ SetModuleType( mInfo.ModuleType );
+ if ( mInfo.ModuleType == script::ModuleType::FORM )
+ {
+ SetClassName( rtl::OUString::createFromAscii( "Form" ) );
+ }
+ else if ( mInfo.ModuleObject.is() )
+ SetUnoObject( uno::makeAny( mInfo.ModuleObject ) );
+}
+void
+SbObjModule::SetUnoObject( const uno::Any& aObj ) throw ( uno::RuntimeException )
+{
+ SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,(SbxVariable*)pDocObject);
+ if ( pUnoObj && pUnoObj->getUnoAny() == aObj ) // object is equal, nothing to do
+ return;
+ pDocObject = new SbUnoObject( GetName(), uno::makeAny( aObj ) );
+
+ com::sun::star::uno::Reference< com::sun::star::lang::XServiceInfo > xServiceInfo( aObj, com::sun::star::uno::UNO_QUERY_THROW );
+ if( xServiceInfo->supportsService( rtl::OUString::createFromAscii( "ooo.vba.excel.Worksheet" ) ) )
+ {
+ SetClassName( rtl::OUString::createFromAscii( "Worksheet" ) );
+ }
+ else if( xServiceInfo->supportsService( rtl::OUString::createFromAscii( "ooo.vba.excel.Workbook" ) ) )
+ {
+ SetClassName( rtl::OUString::createFromAscii( "Workbook" ) );
+ }
+}
+
+SbxVariable*
+SbObjModule::GetObject()
+{
+ return pDocObject;
+}
+SbxVariable*
+SbObjModule::Find( const XubString& rName, SbxClassType t )
+{
+ //OSL_TRACE("SbObjectModule find for %s", rtl::OUStringToOString( rName, RTL_TEXTENCODING_UTF8 ).getStr() );
+ SbxVariable* pVar = NULL;
+ if ( pDocObject)
+ pVar = pDocObject->Find( rName, t );
+ if ( !pVar )
+ pVar = SbModule::Find( rName, t );
+ return pVar;
+}
+
+typedef ::cppu::WeakImplHelper1< awt::XTopWindowListener > EventListener_BASE;
+
+class FormObjEventListenerImpl : public EventListener_BASE
+{
+ SbUserFormModule* mpUserForm;
+ uno::Reference< lang::XComponent > mxComponent;
+ bool mbDisposed;
+ sal_Bool mbOpened;
+ sal_Bool mbActivated;
+ 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 )
+ {
+ if ( mxComponent.is() )
+ {
+ uno::Reference< awt::XTopWindow > xList( mxComponent, uno::UNO_QUERY_THROW );;
+ OSL_TRACE("*********** Registering the listener");
+ xList->addTopWindowListener( this );
+ }
+ }
+
+ ~FormObjEventListenerImpl()
+ {
+ removeListener();
+ }
+ sal_Bool isShowing() { return mbShowing; }
+ void removeListener()
+ {
+ try
+ {
+ if ( mxComponent.is() && !mbDisposed )
+ {
+ uno::Reference< awt::XTopWindow > xList( mxComponent, uno::UNO_QUERY_THROW );;
+ OSL_TRACE("*********** Removing the listener");
+ xList->removeTopWindowListener( this );
+ mxComponent = NULL;
+ }
+ }
+ catch( uno::Exception& ) {}
+ }
+ virtual void SAL_CALL windowOpened( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
+ {
+ if ( mpUserForm )
+ {
+ mbOpened = sal_True;
+ mbShowing = sal_True;
+ if ( mbActivated )
+ {
+ mbOpened = mbActivated = sal_False;
+ mpUserForm->triggerActivateEvent();
+ }
+ }
+ }
+
+ //liuchen 2009-7-21, support Excel VBA Form_QueryClose event
+ virtual void SAL_CALL windowClosing( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
+ {
+#if IN_THE_FUTURE
+ uno::Reference< awt::XDialog > xDialog( e.Source, uno::UNO_QUERY );
+ if ( xDialog.is() )
+ {
+ uno::Reference< awt::XControl > xControl( xDialog, uno::UNO_QUERY );
+ if ( xControl->getPeer().is() )
+ {
+ uno::Reference< document::XVbaMethodParameter > xVbaMethodParameter( xControl->getPeer(), uno::UNO_QUERY );
+ if ( xVbaMethodParameter.is() )
+ {
+ sal_Int8 nCancel = 0;
+ sal_Int8 nCloseMode = 0;
+
+ Sequence< Any > aParams;
+ aParams.realloc(2);
+ aParams[0] <<= nCancel;
+ aParams[1] <<= nCloseMode;
+
+ mpUserForm->triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_QueryClose") ),
+ aParams);
+ xVbaMethodParameter->setVbaMethodParameter( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Cancel")), aParams[0]);
+ return;
+
+ }
+ }
+ }
+
+ mpUserForm->triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_QueryClose") ) );
+#endif
+ }
+ //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 windowActivated( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
+ {
+ if ( mpUserForm )
+ {
+ mbActivated = sal_True;
+ if ( mbOpened )
+ {
+ mbOpened = mbActivated = sal_False;
+ mpUserForm->triggerActivateEvent();
+ }
+ }
+ }
+
+ virtual void SAL_CALL windowDeactivated( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
+ {
+ if ( mpUserForm )
+ mpUserForm->triggerDeActivateEvent();
+ }
+
+
+ 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;
+ if ( mpUserForm )
+ mpUserForm->ResetApiObj();
+ }
+};
+
+SbUserFormModule::SbUserFormModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsCompat )
+ : SbObjModule( rName, mInfo, bIsCompat )
+ , m_mInfo( mInfo )
+ , mbInit( false )
+{
+ m_xModel.set( mInfo.ModuleObject, uno::UNO_QUERY_THROW );
+}
+
+void SbUserFormModule::ResetApiObj()
+{
+ if ( m_xDialog.is() ) // probably someone close the dialog window
+ {
+ triggerTerminateEvent();
+ }
+ pDocObject = NULL;
+ m_xDialog = NULL;
+}
+
+void SbUserFormModule::triggerMethod( const String& aMethodToRun )
+{
+ Sequence< Any > aArguments;
+ triggerMethod( aMethodToRun, aArguments );
+}
+void SbUserFormModule::triggerMethod( const String& aMethodToRun, Sequence< Any >& /*aArguments*/)
+{
+ OSL_TRACE("*** trigger %s ***", rtl::OUStringToOString( aMethodToRun, RTL_TEXTENCODING_UTF8 ).getStr() );
+ // Search method
+ SbxVariable* pMeth = SbObjModule::Find( aMethodToRun, SbxCLASS_METHOD );
+ if( pMeth )
+ {
+#if IN_THE_FUTURE
+ //liuchen 2009-7-21, support Excel VBA UserForm_QueryClose event with parameters
+ if ( aArguments.getLength() > 0 ) // Setup parameters
+ {
+ SbxArrayRef xArray = new SbxArray;
+ xArray->Put( pMeth, 0 ); // Method as parameter 0
+
+ for ( sal_Int32 i = 0; i < aArguments.getLength(); ++i )
+ {
+ SbxVariableRef xSbxVar = new SbxVariable( SbxVARIANT );
+ unoToSbxValue( static_cast< SbxVariable* >( xSbxVar ), aArguments[i] );
+ xArray->Put( xSbxVar, static_cast< USHORT >( i ) + 1 );
+
+ // Enable passing by ref
+ if ( xSbxVar->GetType() != SbxVARIANT )
+ xSbxVar->SetFlag( SBX_FIXED );
+ }
+ pMeth->SetParameters( xArray );
+
+ SbxValues aVals;
+ pMeth->Get( aVals );
+
+ for ( sal_Int32 i = 0; i < aArguments.getLength(); ++i )
+ {
+ aArguments[i] = sbxToUnoValue( xArray->Get( static_cast< USHORT >(i) + 1) );
+ }
+ pMeth->SetParameters( NULL );
+ }
+ else
+//liuchen 2009-7-21
+#endif
+ {
+ SbxValues aVals;
+ pMeth->Get( aVals );
+ }
+ }
+}
+
+void SbUserFormModule::triggerActivateEvent( void )
+{
+ OSL_TRACE("**** entering SbUserFormModule::triggerActivate");
+ triggerMethod( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UserForm_activate") ) );
+ OSL_TRACE("**** leaving SbUserFormModule::triggerActivate");
+}
+
+void SbUserFormModule::triggerDeActivateEvent( void )
+{
+ OSL_TRACE("**** SbUserFormModule::triggerDeActivate");
+ triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_DeActivate") ) );
+}
+
+void SbUserFormModule::triggerInitializeEvent( void )
+
+{
+ if ( mbInit )
+ return;
+ OSL_TRACE("**** SbUserFormModule::triggerInitializeEvent");
+ static String aInitMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Initialize") );
+ triggerMethod( aInitMethodName );
+ mbInit = true;
+}
+
+void SbUserFormModule::triggerTerminateEvent( void )
+{
+ OSL_TRACE("**** SbUserFormModule::triggerTerminateEvent");
+ static String aTermMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Terminate") );
+ triggerMethod( aTermMethodName );
+ mbInit=false;
+}
+
+SbUserFormModuleInstance* SbUserFormModule::CreateInstance()
+{
+ SbUserFormModuleInstance* pInstance = new SbUserFormModuleInstance( this, GetName(), m_mInfo, IsVBACompat() );
+ return pInstance;
+}
+
+SbUserFormModuleInstance::SbUserFormModuleInstance( SbUserFormModule* pParentModule,
+ const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat )
+ : SbUserFormModule( rName, mInfo, bIsVBACompat )
+ , m_pParentModule( pParentModule )
+{
+}
+
+BOOL SbUserFormModuleInstance::IsClass( const XubString& rName ) const
+{
+ BOOL bParentNameMatches = m_pParentModule->GetName().EqualsIgnoreCaseAscii( rName );
+ BOOL bRet = bParentNameMatches || SbxObject::IsClass( rName );
+ return bRet;
+}
+
+SbxVariable* SbUserFormModuleInstance::Find( const XubString& rName, SbxClassType t )
+{
+ SbxVariable* pVar = m_pParentModule->Find( rName, t );
+ return pVar;
+}
+
+
+void SbUserFormModule::load()
+{
+ OSL_TRACE("** load() ");
+ // forces a load
+ if ( !pDocObject )
+ InitObject();
+}
+
+//liuchen 2009-7-21 change to accmordate VBA's beheavior
+void SbUserFormModule::Unload()
+{
+ OSL_TRACE("** Unload() ");
+
+ sal_Int8 nCancel = 0;
+ sal_Int8 nCloseMode = 1;
+
+ Sequence< Any > aParams;
+ aParams.realloc(2);
+ aParams[0] <<= nCancel;
+ aParams[1] <<= nCloseMode;
+
+ triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_QueryClose") ), aParams);
+
+ aParams[0] >>= nCancel;
+ if (nCancel == 1)
+ {
+ return;
+ }
+
+ if ( m_xDialog.is() )
+ {
+ triggerTerminateEvent();
+ }
+ // Search method
+ SbxVariable* pMeth = SbObjModule::Find( String( RTL_CONSTASCII_USTRINGPARAM( "UnloadObject" ) ), SbxCLASS_METHOD );
+ if( pMeth )
+ {
+ OSL_TRACE("Attempting too run the UnloadObjectMethod");
+ m_xDialog = NULL; //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 )
+ {
+ bWaitForDispose = pFormListener->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
+ ResetApiObj();
+ } // else wait for dispose
+ OSL_TRACE("UnloadObject completed ( we hope )");
+ }
+}
+//liuchen
+
+void SbUserFormModule::InitObject()
+{
+ try
+ {
+
+ String aHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) );
+ SbUnoObject* pGlobs = (SbUnoObject*)GetParent()->Find( aHook, SbxCLASS_DONTCARE );
+ if ( m_xModel.is() && pGlobs )
+ {
+
+ uno::Reference< lang::XMultiServiceFactory > xVBAFactory( pGlobs->getUnoAny(), uno::UNO_QUERY_THROW );
+ uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[ 0 ] <<= m_xModel;
+ rtl::OUString sDialogUrl( RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.script:" ) );
+ rtl::OUString sProjectName( RTL_CONSTASCII_USTRINGPARAM("Standard") );
+ if ( this->GetParent()->GetName().Len() )
+ sProjectName = this->GetParent()->GetName();
+ sDialogUrl = sDialogUrl.concat( sProjectName ).concat( rtl::OUString( '.') ).concat( GetName() ).concat( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("?location=document") ) );
+
+ uno::Reference< awt::XDialogProvider > xProvider( xFactory->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.DialogProvider")), aArgs ), uno::UNO_QUERY_THROW );
+ m_xDialog = xProvider->createDialog( sDialogUrl );
+
+ // create vba api object
+ aArgs.realloc( 4 );
+ aArgs[ 0 ] = uno::Any();
+ aArgs[ 1 ] <<= m_xDialog;
+ aArgs[ 2 ] <<= m_xModel;
+ aArgs[ 3 ] <<= rtl::OUString( GetParent()->GetName() );
+ 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();
+ m_DialogListener = new FormObjEventListenerImpl( this, xComponent );
+
+ triggerInitializeEvent();
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+
+}
+
+SbxVariable*
+SbUserFormModule::Find( const XubString& rName, SbxClassType t )
+{
+ if ( !pDocObject && !GetSbData()->bRunInit && pINST )
+ InitObject();
+ return SbObjModule::Find( rName, t );
+}
+/////////////////////////////////////////////////////////////////////////
SbProperty::SbProperty( const String& r, SbxDataType t, SbModule* p )
: SbxProperty( r, t ), pMod( p )
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx
index c7a63b6d7fbb..46f829b382e8 100644
--- a/basic/source/comp/codegen.cxx
+++ b/basic/source/comp/codegen.cxx
@@ -32,6 +32,7 @@
#include "sbcomp.hxx"
#include "image.hxx"
#include <limits>
+#include <com/sun/star/script/ModuleType.hpp>
// nInc ist die Inkrementgroesse der Puffer
@@ -127,12 +128,12 @@ void SbiCodeGen::Save()
// OPTION EXPLICIT-Flag uebernehmen
if( pParser->bExplicit )
p->SetFlag( SBIMG_EXPLICIT );
- if( pParser->IsVBASupportOn() )
- p->SetFlag( SBIMG_VBASUPPORT );
int nIfaceCount = 0;
- if( pParser->bClassModule )
+ if( rMod.mnType == com::sun::star::script::ModuleType::CLASS )
{
+ OSL_TRACE("COdeGen::save() classmodule processing");
+ rMod.bIsProxyModule = true;
p->SetFlag( SBIMG_CLASSMODULE );
pCLASSFAC->AddClassModule( &rMod );
@@ -155,6 +156,10 @@ void SbiCodeGen::Save()
else
{
pCLASSFAC->RemoveClassModule( &rMod );
+ // Only a ClassModule can revert to Normal
+ if ( rMod.mnType == com::sun::star::script::ModuleType::CLASS )
+ rMod.mnType = com::sun::star::script::ModuleType::NORMAL;
+ rMod.bIsProxyModule = false;
}
if( pParser->bText )
p->SetFlag( SBIMG_COMPARETEXT );
diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx
index fb4071bcc2a2..bff3d22dd9b0 100644
--- a/basic/source/comp/dim.cxx
+++ b/basic/source/comp/dim.cxx
@@ -1,4 +1,4 @@
- /*************************************************************************
+/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -30,6 +30,8 @@
#include <basic/sbx.hxx>
#include "sbcomp.hxx"
+SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj );
+
// Deklaration einer Variablen
// Bei Fehlern wird bis zum Komma oder Newline geparst.
// Returnwert: eine neue Instanz, die eingefuegt und dann geloescht wird.
@@ -37,6 +39,12 @@
SbiSymDef* SbiParser::VarDecl( SbiDimList** ppDim, BOOL bStatic, BOOL bConst )
{
+ bool bWithEvents = false;
+ if( Peek() == WITHEVENTS )
+ {
+ Next();
+ bWithEvents = true;
+ }
if( !TestSymbol() ) return NULL;
SbxDataType t = eScanType;
SbiSymDef* pDef = bConst ? new SbiConstDef( aSym ) : new SbiSymDef( aSym );
@@ -47,6 +55,8 @@ SbiSymDef* SbiParser::VarDecl( SbiDimList** ppDim, BOOL bStatic, BOOL bConst )
pDef->SetType( t );
if( bStatic )
pDef->SetStatic();
+ if( bWithEvents )
+ pDef->SetWithEvents();
TypeDecl( *pDef );
if( !ppDim && pDim )
{
@@ -107,8 +117,10 @@ void SbiParser::TypeDecl( SbiSymDef& rDef, BOOL bAsNewAlreadyParsed )
Next();
SbiConstExpression aSize( this );
nSize = aSize.GetShortValue();
- if( nSize < 0 )
+ if( nSize < 0 || (bVBASupportOn && nSize <= 0) )
Error( SbERR_OUT_OF_RANGE );
+ else
+ rDef.SetFixedStringLength( nSize );
}
}
break;
@@ -209,7 +221,7 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic )
// #110004 It can also be a sub/function
if( !bConst && (eCurTok == SUB || eCurTok == FUNCTION || eCurTok == PROPERTY ||
- eCurTok == STATIC || eCurTok == ENUM || eCurTok == DECLARE) )
+ eCurTok == STATIC || eCurTok == ENUM || eCurTok == DECLARE || eCurTok == TYPE) )
{
// Next token is read here, because !bConst
bool bPrivate = ( eFirstTok == PRIVATE );
@@ -244,6 +256,13 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic )
DefDeclare( bPrivate );
return;
}
+ // #i109049
+ else if( eCurTok == TYPE )
+ {
+ Next();
+ DefType( bPrivate );
+ return;
+ }
}
#ifdef SHARED
@@ -349,9 +368,15 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic )
break;
default: eOp2 = _LOCAL;
}
- aGen.Gen(
- eOp2, pDef->GetId(),
- sal::static_int_cast< UINT16 >( pDef->GetType() ) );
+ UINT32 nOpnd2 = sal::static_int_cast< UINT16 >( pDef->GetType() );
+ if( pDef->IsWithEvents() )
+ nOpnd2 |= SBX_TYPE_WITH_EVENTS_FLAG;
+
+ short nFixedStringLength = pDef->GetFixedStringLength();
+ if( nFixedStringLength >= 0 )
+ nOpnd2 |= (SBX_FIXED_LEN_STRING_FLAG + (UINT32(nFixedStringLength) << 17)); // len = all bits above 0x10000
+
+ aGen.Gen( eOp2, pDef->GetId(), nOpnd2 );
}
// Initialisierung fuer selbstdefinierte Datentypen
@@ -473,7 +498,7 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic )
// d.h. pPool muss immer am Schleifen-Ende zurueckgesetzt werden.
// auch bei break
pPool = pOldPool;
- continue; // MyBreak überspingen
+ continue; // MyBreak überspingen
MyBreak:
pPool = pOldPool;
break;
@@ -506,18 +531,7 @@ void SbiParser::Erase()
{
while( !bAbort )
{
- if( !TestSymbol() ) return;
- String aName( aSym );
- SbxDataType eType = eScanType;
- SbiSymDef* pDef = pPool->Find( aName );
- if( !pDef )
- {
- if( bExplicit )
- Error( SbERR_UNDEF_VAR, aName );
- pDef = pPool->AddSym( aName );
- pDef->SetType( eType );
- }
- SbiExpression aExpr( this, *pDef );
+ SbiExpression aExpr( this, SbLVALUE );
aExpr.Gen();
aGen.Gen( _ERASE );
if( !TestComma() ) break;
@@ -576,12 +590,14 @@ void SbiParser::DefType( BOOL bPrivate )
}
if( pElem )
{
- SbxArray *pTypeMembers = pType -> GetProperties();
- if (pTypeMembers -> Find (pElem->GetName(),SbxCLASS_DONTCARE))
+ SbxArray *pTypeMembers = pType->GetProperties();
+ String aElemName = pElem->GetName();
+ if( pTypeMembers->Find( aElemName, SbxCLASS_DONTCARE) )
Error (SbERR_VAR_DEFINED);
else
{
- SbxProperty *pTypeElem = new SbxProperty (pElem->GetName(),pElem->GetType());
+ SbxDataType eElemType = pElem->GetType();
+ SbxProperty *pTypeElem = new SbxProperty( aElemName, eElemType );
if( pDim )
{
SbxDimArray* pArray = new SbxDimArray( pElem->GetType() );
@@ -618,6 +634,21 @@ void SbiParser::DefType( BOOL bPrivate )
pTypeElem->PutObject( pArray );
pTypeElem->SetFlags( nSavFlags );
}
+ // Nested user type?
+ if( eElemType == SbxOBJECT )
+ {
+ USHORT nElemTypeId = pElem->GetTypeId();
+ if( nElemTypeId != 0 )
+ {
+ String aTypeName( aGblStrings.Find( nElemTypeId ) );
+ SbxObject* pTypeObj = static_cast< SbxObject* >( rTypeArray->Find( aTypeName, SbxCLASS_OBJECT ) );
+ if( pTypeObj != NULL )
+ {
+ SbxObject* pCloneObj = cloneTypeObjectImpl( *pTypeObj );
+ pTypeElem->PutObject( pCloneObj );
+ }
+ }
+ }
delete pDim;
pTypeMembers->Insert( pTypeElem, pTypeMembers->Count() );
}
diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx
index 89520832ff67..60869307aecf 100644
--- a/basic/source/comp/exprgen.cxx
+++ b/basic/source/comp/exprgen.cxx
@@ -148,6 +148,10 @@ void SbiExprNode::Gen( RecursiveMode eRecMode )
pLeft->Gen();
pGen->Gen( _TESTCLASS, nTypeStrId );
}
+ else if( IsNew() )
+ {
+ pGen->Gen( _CREATE, 0, nTypeStrId );
+ }
else
{
pLeft->Gen();
@@ -285,6 +289,8 @@ void SbiExpression::Gen( RecursiveMode eRecMode )
// AB: 17.12.1995, Spezialbehandlung fuer WITH
// Wenn pExpr == .-Ausdruck in With, zunaechst Gen fuer Basis-Objekt
pExpr->Gen( eRecMode );
+ if( bByVal )
+ pParser->aGen.Gen( _BYVAL );
if( bBased )
{
USHORT uBase = pParser->nBase;
diff --git a/basic/source/comp/exprnode.cxx b/basic/source/comp/exprnode.cxx
index a77cf32abbaa..d47c86f86ea8 100644
--- a/basic/source/comp/exprnode.cxx
+++ b/basic/source/comp/exprnode.cxx
@@ -100,6 +100,15 @@ SbiExprNode::SbiExprNode( SbiParser* p, SbiExprNode* l, USHORT nId )
nTypeStrId = nId;
}
+// new <type>
+SbiExprNode::SbiExprNode( SbiParser* p, USHORT nId )
+{
+ BaseInit( p );
+
+ eType = SbxOBJECT;
+ eNodeType = SbxNEW;
+ nTypeStrId = nId;
+}
// AB: 17.12.95, Hilfsfunktion fuer Ctor fuer einheitliche Initialisierung
void SbiExprNode::BaseInit( SbiParser* p )
@@ -253,7 +262,8 @@ void SbiExprNode::CollectBits()
void SbiExprNode::FoldConstants()
{
if( IsOperand() || eTok == LIKE ) return;
- pLeft->FoldConstants();
+ if( pLeft )
+ pLeft->FoldConstants();
if( pRight )
{
pRight->FoldConstants();
@@ -431,7 +441,7 @@ void SbiExprNode::FoldConstants()
}
}
}
- else if( pLeft->IsNumber() )
+ else if( pLeft && pLeft->IsNumber() )
{
nVal = pLeft->nVal;
delete pLeft;
diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx
index 2f5c0b967a2e..0cf0d9870378 100644
--- a/basic/source/comp/exprtree.cxx
+++ b/basic/source/comp/exprtree.cxx
@@ -38,7 +38,8 @@
|*
***************************************************************************/
-SbiExpression::SbiExpression( SbiParser* p, SbiExprType t, SbiExprMode eMode )
+SbiExpression::SbiExpression( SbiParser* p, SbiExprType t,
+ SbiExprMode eMode, const KeywordSymbolInfo* pKeywordSymbolInfo )
{
pParser = p;
bError = bByVal = bBased = bBracket = FALSE;
@@ -46,7 +47,7 @@ SbiExpression::SbiExpression( SbiParser* p, SbiExprType t, SbiExprMode eMode )
eCurExpr = t;
m_eMode = eMode;
pNext = NULL;
- pExpr = (t != SbSTDEXPR ) ? Term() : Boolean();
+ pExpr = (t != SbSTDEXPR ) ? Term( pKeywordSymbolInfo ) : Boolean();
if( t != SbSYMBOL )
pExpr->Optimize();
if( t == SbLVALUE && !pExpr->IsLvalue() )
@@ -114,7 +115,7 @@ static BOOL DoParametersFollow( SbiParser* p, SbiExprType eCurExpr, SbiToken eTo
if( !p->WhiteSpace() || eCurExpr != SbSYMBOL )
return FALSE;
if ( eTok == NUMBER || eTok == MINUS || eTok == FIXSTRING
- || eTok == SYMBOL || eTok == COMMA || eTok == DOT || eTok == NOT )
+ || eTok == SYMBOL || eTok == COMMA || eTok == DOT || eTok == NOT || eTok == BYVAL )
{
return TRUE;
}
@@ -177,7 +178,7 @@ static SbiSymDef* AddSym
// Zur Zeit sind sogar Keywords zugelassen (wg. gleichnamiger Dflt-Properties)
-SbiExprNode* SbiExpression::Term( void )
+SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
{
if( pParser->Peek() == DOT )
{
@@ -204,11 +205,11 @@ SbiExprNode* SbiExpression::Term( void )
return pNd;
}
- SbiToken eTok = pParser->Next();
+ SbiToken eTok = (pKeywordSymbolInfo == NULL) ? pParser->Next() : pKeywordSymbolInfo->m_eTok;
// Anfang des Parsings merken
pParser->LockColumn();
- String aSym( pParser->GetSym() );
- SbxDataType eType = pParser->GetType();
+ String aSym( (pKeywordSymbolInfo == NULL) ? pParser->GetSym() : pKeywordSymbolInfo->m_aKeywordSymbol );
+ SbxDataType eType = (pKeywordSymbolInfo == NULL) ? pParser->GetType() : pKeywordSymbolInfo->m_eSbxDataType;
SbiParameters* pPar = NULL;
SbiExprListVector* pvMoreParLcl = NULL;
// Folgen Parameter?
@@ -280,6 +281,12 @@ SbiExprNode* SbiExpression::Term( void )
// AB 31.3.1996: In Parser-Methode ausgelagert
// (wird auch in SbiParser::DefVar() in DIM.CXX benoetigt)
pDef = pParser->CheckRTLForSym( aSym, eType );
+
+ // #i109184: Check if symbol is or later will be defined inside module
+ SbModule& rMod = pParser->aGen.GetModule();
+ SbxArray* pModMethods = rMod.GetMethods();
+ if( pModMethods->Find( aSym, SbxCLASS_DONTCARE ) )
+ pDef = NULL;
}
if( !pDef )
{
@@ -417,13 +424,27 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj )
String aSym( pParser->GetSym() );
SbxDataType eType = pParser->GetType();
SbiParameters* pPar = NULL;
+ SbiExprListVector* pvMoreParLcl = NULL;
eTok = pParser->Peek();
// Parameter?
if( DoParametersFollow( pParser, eCurExpr, eTok ) )
{
- pPar = new SbiParameters( pParser );
+ bool bStandaloneExpression = false;
+ pPar = new SbiParameters( pParser, bStandaloneExpression );
bError |= !pPar->IsValid();
eTok = pParser->Peek();
+
+ // i109624 check for additional sets of parameters
+ while( eTok == LPAREN )
+ {
+ if( pvMoreParLcl == NULL )
+ pvMoreParLcl = new SbiExprListVector();
+ SbiParameters* pAddPar = new SbiParameters( pParser );
+ pvMoreParLcl->push_back( pAddPar );
+ bError |= !pPar->IsValid();
+ eTok = pParser->Peek();
+ }
+
}
BOOL bObj = BOOL( ( eTok == DOT || eTok == EXCLAM ) && !pParser->WhiteSpace() );
if( bObj )
@@ -450,6 +471,7 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj )
SbiExprNode* pNd = new SbiExprNode( pParser, *pDef, eType );
pNd->aVar.pPar = pPar;
+ pNd->aVar.pvMorePar = pvMoreParLcl;
if( bObj )
{
// Falls wir etwas mit Punkt einscannen, muss der
@@ -483,7 +505,7 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj )
// Funktionen
// geklammerte Ausdruecke
-SbiExprNode* SbiExpression::Operand()
+SbiExprNode* SbiExpression::Operand( bool bUsedForTypeOf )
{
SbiExprNode *pRes;
SbiToken eTok;
@@ -494,7 +516,7 @@ SbiExprNode* SbiExpression::Operand()
case SYMBOL:
pRes = Term();
// process something like "IF Not r Is Nothing Then .."
- if( pParser->IsVBASupportOn() && pParser->Peek() == IS )
+ if( !bUsedForTypeOf && pParser->IsVBASupportOn() && pParser->Peek() == IS )
{
eTok = pParser->Next();
pRes = new SbiExprNode( pParser, pRes, eTok, Like() );
@@ -576,7 +598,8 @@ SbiExprNode* SbiExpression::Unary()
case TYPEOF:
{
pParser->Next();
- SbiExprNode* pObjNode = Operand();
+ bool bUsedForTypeOf = true;
+ SbiExprNode* pObjNode = Operand( bUsedForTypeOf );
pParser->TestToken( IS );
String aDummy;
SbiSymDef* pTypeDef = new SbiSymDef( aDummy );
@@ -584,6 +607,15 @@ SbiExprNode* SbiExpression::Unary()
pNd = new SbiExprNode( pParser, pObjNode, pTypeDef->GetTypeId() );
break;
}
+ case NEW:
+ {
+ pParser->Next();
+ String aStr;
+ SbiSymDef* pTypeDef = new SbiSymDef( aStr );
+ pParser->TypeDecl( *pTypeDef, TRUE );
+ pNd = new SbiExprNode( pParser, pTypeDef->GetTypeId() );
+ break;
+ }
default:
pNd = Operand();
}
@@ -938,6 +970,14 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa
// Benannte Argumente: entweder .name= oder name:=
else
{
+ bool bByVal = false;
+ if( eTok == BYVAL )
+ {
+ bByVal = true;
+ pParser->Next();
+ eTok = pParser->Peek();
+ }
+
if( bAssumeExprLParenMode )
{
pExpr = new SbiExpression( pParser, SbSTDEXPR, EXPRMODE_LPAREN_PENDING );
@@ -961,12 +1001,22 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa
{
bBracket = TRUE;
delete pExpr;
+ if( bByVal )
+ pParser->Error( SbERR_LVALUE_EXPECTED );
return;
}
}
else
pExpr = new SbiExpression( pParser );
+ if( bByVal )
+ {
+ if( !pExpr->IsLvalue() )
+ pParser->Error( SbERR_LVALUE_EXPECTED );
+ else
+ pExpr->SetByVal();
+ }
+
//pExpr = bConst ? new SbiConstExpression( pParser )
// : new SbiExpression( pParser );
if( !bAssumeArrayMode )
diff --git a/basic/source/comp/io.cxx b/basic/source/comp/io.cxx
index 1ed551994c92..b211ea0b7b08 100644
--- a/basic/source/comp/io.cxx
+++ b/basic/source/comp/io.cxx
@@ -115,6 +115,30 @@ void SbiParser::Write()
aGen.Gen( _CHAN0 );
}
+
+// #i92642 Handle LINE keyword outside ::Next()
+void SbiParser::Line()
+{
+ // #i92642: Special handling to allow name as symbol
+ if( Peek() == INPUT )
+ {
+ Next();
+ LineInput();
+ }
+ else
+ {
+ aGen.Statement();
+
+ KeywordSymbolInfo aInfo;
+ aInfo.m_aKeywordSymbol = String( RTL_CONSTASCII_USTRINGPARAM( "line" ) );
+ aInfo.m_eSbxDataType = GetType();
+ aInfo.m_eTok = SYMBOL;
+
+ Symbol( &aInfo );
+ }
+}
+
+
// LINE INPUT [prompt], var$
void SbiParser::LineInput()
@@ -288,6 +312,19 @@ void SbiParser::Open()
void SbiParser::Name()
{
+ // #i92642: Special handling to allow name as symbol
+ if( Peek() == EQ )
+ {
+ aGen.Statement();
+
+ KeywordSymbolInfo aInfo;
+ aInfo.m_aKeywordSymbol = String( RTL_CONSTASCII_USTRINGPARAM( "name" ) );
+ aInfo.m_eSbxDataType = GetType();
+ aInfo.m_eTok = SYMBOL;
+
+ Symbol( &aInfo );
+ return;
+ }
SbiExpression aExpr1( this );
TestToken( AS );
SbiExpression aExpr2( this );
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx
index 400e77a94b16..3d7178ae7688 100644
--- a/basic/source/comp/parser.cxx
+++ b/basic/source/comp/parser.cxx
@@ -29,6 +29,7 @@
#include "precompiled_basic.hxx"
#include <basic/sbx.hxx>
#include "sbcomp.hxx"
+#include <com/sun/star/script/ModuleType.hpp>
struct SbiParseStack { // "Stack" fuer Statement-Blocks
SbiParseStack* pNext; // Chain
@@ -82,6 +83,7 @@ static SbiStatement StmntTable [] = {
{ IMPLEMENTS, &SbiParser::Implements, Y, N, }, // IMPLEMENTS
{ INPUT, &SbiParser::Input, N, Y, }, // INPUT
{ LET, &SbiParser::Assign, N, Y, }, // LET
+{ LINE, &SbiParser::Line, N, Y, }, // LINE, -> LINE INPUT (#i92642)
{ LINEINPUT,&SbiParser::LineInput, N, Y, }, // LINE INPUT
{ LOOP, &SbiParser::BadBlock, N, Y, }, // LOOP
{ LSET, &SbiParser::LSet, N, Y, }, // LSET
@@ -140,7 +142,8 @@ SbiParser::SbiParser( StarBASIC* pb, SbModule* pm )
bNewGblDefs =
bSingleLineIf =
bExplicit = FALSE;
- bClassModule = FALSE;
+ bClassModule = ( pm->GetModuleType() == com::sun::star::script::ModuleType::CLASS );
+ OSL_TRACE("Parser - %s, bClassModule %d", rtl::OUStringToOString( pm->GetName(), RTL_TEXTENCODING_UTF8 ).getStr(), bClassModule );
pPool = &aPublics;
for( short i = 0; i < 26; i++ )
eDefTypes[ i ] = SbxVARIANT; // Kein expliziter Defaulttyp
@@ -153,6 +156,10 @@ SbiParser::SbiParser( StarBASIC* pb, SbModule* pm )
rTypeArray = new SbxArray; // Array fuer Benutzerdefinierte Typen
rEnumArray = new SbxArray; // Array for Enum types
+ bVBASupportOn = pm->IsVBACompat();
+ if ( bVBASupportOn )
+ EnableCompatibility();
+
}
@@ -231,7 +238,9 @@ void SbiParser::Exit()
SbiToken eTok = Next();
for( SbiParseStack* p = pStack; p; p = p->pNext )
{
- if( eTok == p->eExitTok )
+ SbiToken eExitTok = p->eExitTok;
+ if( eTok == eExitTok ||
+ (eTok == PROPERTY && (eExitTok == GET || eExitTok == LET) ) ) // #i109051
{
p->nChain = aGen.Gen( _JUMP, p->nChain );
return;
@@ -361,7 +370,10 @@ BOOL SbiParser::Parse()
}
// Ende des Parsings?
- if( eCurTok == eEndTok )
+ if( eCurTok == eEndTok ||
+ ( bVBASupportOn && // #i109075
+ (eCurTok == ENDFUNC || eCurTok == ENDPROPERTY || eCurTok == ENDSUB) &&
+ (eEndTok == ENDFUNC || eEndTok == ENDPROPERTY || eEndTok == ENDSUB) ) )
{
Next();
if( eCurTok != NIL )
@@ -471,10 +483,10 @@ SbiExprNode* SbiParser::GetWithVar()
// Zuweisung oder Subroutine Call
-void SbiParser::Symbol()
+void SbiParser::Symbol( const KeywordSymbolInfo* pKeywordSymbolInfo )
{
SbiExprMode eMode = bVBASupportOn ? EXPRMODE_STANDALONE : EXPRMODE_STANDARD;
- SbiExpression aVar( this, SbSYMBOL, eMode );
+ SbiExpression aVar( this, SbSYMBOL, eMode, pKeywordSymbolInfo );
bool bEQ = ( Peek() == EQ );
if( !bEQ && bVBASupportOn && aVar.IsBracket() )
@@ -698,11 +710,37 @@ void SbiParser::Implements()
return;
}
- if( TestSymbol() )
+ Peek();
+ if( eCurTok != SYMBOL )
{
- String aImplementedIface = GetSym();
- aIfaceVector.push_back( aImplementedIface );
+ Error( SbERR_SYMBOL_EXPECTED );
+ return;
}
+
+ String aImplementedIface = aSym;
+ Next();
+ if( Peek() == DOT )
+ {
+ String aDotStr( '.' );
+ while( Peek() == DOT )
+ {
+ aImplementedIface += aDotStr;
+ Next();
+ SbiToken ePeekTok = Peek();
+ if( ePeekTok == SYMBOL || IsKwd( ePeekTok ) )
+ {
+ Next();
+ aImplementedIface += aSym;
+ }
+ else
+ {
+ Next();
+ Error( SbERR_SYMBOL_EXPECTED );
+ break;
+ }
+ }
+ }
+ aIfaceVector.push_back( aImplementedIface );
}
void SbiParser::EnableCompatibility()
@@ -739,18 +777,23 @@ void SbiParser::Option()
break;
}
case COMPARE:
- switch( Next() )
- {
- case TEXT: bText = TRUE; return;
- case BINARY: bText = FALSE; return;
- default:;
- } // Fall thru!
+ {
+ SbiToken eTok = Next();
+ if( eTok == BINARY )
+ bText = FALSE;
+ else if( eTok == SYMBOL && GetSym().EqualsIgnoreCaseAscii("text") )
+ bText = TRUE;
+ else
+ Error( SbERR_EXPECTED, "Text/Binary" );
+ break;
+ }
case COMPATIBLE:
EnableCompatibility();
break;
case CLASSMODULE:
bClassModule = TRUE;
+ aGen.GetModule().SetModuleType( com::sun::star::script::ModuleType::CLASS );
break;
case VBASUPPORT:
if( Next() == NUMBER )
@@ -760,6 +803,10 @@ void SbiParser::Option()
bVBASupportOn = ( nVal == 1 );
if ( bVBASupportOn )
EnableCompatibility();
+ // if the module setting is different
+ // reset it to what the Option tells us
+ if ( bVBASupportOn != aGen.GetModule().IsVBACompat() )
+ aGen.GetModule().SetVBACompat( bVBASupportOn );
break;
}
}
diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx
index 24f0f890eebb..d6b3dbb878fc 100644
--- a/basic/source/comp/symtbl.cxx
+++ b/basic/source/comp/symtbl.cxx
@@ -300,12 +300,14 @@ SbiSymDef::SbiSymDef( const String& rName ) : aName( rName )
bStatic =
bOpt =
bParamArray =
+ bWithEvents =
bByVal =
bChained =
bGlobal = FALSE;
pIn =
pPool = NULL;
nDefaultId = 0;
+ nFixedStringLength = -1;
}
SbiSymDef::~SbiSymDef()
diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx
index 9fdfef0490b1..8cb3126f03f1 100644
--- a/basic/source/comp/token.cxx
+++ b/basic/source/comp/token.cxx
@@ -185,6 +185,7 @@ static TokenTable aTokTable_Basic [] = { // Token-Tabelle:
{ WEND, "Wend" },
{ WHILE, "While" },
{ WITH, "With" },
+ { WITHEVENTS, "WithEvents" },
{ WRITE, "Write" }, // auch WRITE #
{ XOR, "Xor" },
{ NIL, "" }
@@ -353,6 +354,29 @@ TokenTable aTokTable_Java [] = { // Token-Tabelle:
};
*/
+// #i109076
+TokenLabelInfo::TokenLabelInfo( void )
+{
+ m_pTokenCanBeLabelTab = new bool[VBASUPPORT+1];
+ for( int i = 0 ; i <= VBASUPPORT ; ++i )
+ m_pTokenCanBeLabelTab[i] = false;
+
+ // Token accepted as label by VBA
+ SbiToken eLabelToken[] = { ACCESS, ALIAS, APPEND, BASE, BINARY, CLASSMODULE,
+ COMPARE, COMPATIBLE, DEFERR, _ERROR_, EXPLICIT, LIB, LINE, LPRINT, NAME,
+ TOBJECT, OUTPUT, PROPERTY, RANDOM, READ, STEP, STOP, TEXT, VBASUPPORT, NIL };
+ SbiToken* pTok = eLabelToken;
+ SbiToken eTok;
+ for( pTok = eLabelToken ; (eTok = *pTok) != NIL ; ++pTok )
+ m_pTokenCanBeLabelTab[eTok] = true;
+}
+
+TokenLabelInfo::~TokenLabelInfo()
+{
+ delete[] m_pTokenCanBeLabelTab;
+}
+
+
// Der Konstruktor ermittelt die Laenge der Token-Tabelle.
SbiTokenizer::SbiTokenizer( const ::rtl::OUString& rSrc, StarBASIC* pb )
@@ -371,7 +395,8 @@ SbiTokenizer::SbiTokenizer( const ::rtl::OUString& rSrc, StarBASIC* pb )
}
SbiTokenizer::~SbiTokenizer()
-{}
+{
+}
// Wiederablage (Pushback) eines Tokens. (Bis zu 2 Tokens)
@@ -513,7 +538,8 @@ SbiToken SbiTokenizer::Next()
tp = &pTokTable[ lb + delta ];
StringCompare res = aSym.CompareIgnoreCaseToAscii( tp->s );
// Gefunden?
- if( res == COMPARE_EQUAL ) goto special;
+ if( res == COMPARE_EQUAL )
+ goto special;
// Groesser? Dann untere Haelfte
if( res == COMPARE_LESS )
{
@@ -534,24 +560,14 @@ SbiToken SbiTokenizer::Next()
return eCurTok = SYMBOL;
}
special:
- // LINE INPUT
- if( tp->t == LINE )
- {
- short nC1 = nCol1;
- String aOldSym = aSym;
- eCurTok = Peek();
- if( eCurTok == INPUT )
- {
- Next();
- nCol1 = nC1;
- return eCurTok = LINEINPUT;
- }
- else
- {
- aSym = aOldSym;
- return eCurTok = LINE;
- }
- }
+ // #i92642
+ if( eCurTok != NIL && eCurTok != REM && eCurTok != EOLN && (tp->t == NAME || tp->t == LINE) )
+ return eCurTok = SYMBOL;
+ else if( tp->t == TEXT )
+ return eCurTok = SYMBOL;
+
+ // #i92642: Special LINE token handling -> SbiParser::Line()
+
// END IF, CASE, SUB, DEF, FUNCTION, TYPE, CLASS, WITH
if( tp->t == END )
{
@@ -639,7 +655,7 @@ special:
BOOL SbiTokenizer::MayBeLabel( BOOL bNeedsColon )
{
- if( eCurTok == SYMBOL )
+ if( eCurTok == SYMBOL || m_aTokenLabelInfo.canTokenBeLabel( eCurTok ) )
return bNeedsColon ? DoesColonFollow() : TRUE;
else
return BOOL( eCurTok == NUMBER
diff --git a/basic/source/inc/codegen.hxx b/basic/source/inc/codegen.hxx
index d0a613eabebc..a3fe02227cfd 100644
--- a/basic/source/inc/codegen.hxx
+++ b/basic/source/inc/codegen.hxx
@@ -44,6 +44,7 @@ class SbiCodeGen { // Code-Erzeugung:
public:
SbiCodeGen( SbModule&, SbiParser*, short );
SbiParser* GetParser() { return pParser; }
+ SbModule& GetModule() { return rMod; }
UINT32 Gen( SbiOpcode );
UINT32 Gen( SbiOpcode, UINT32 );
UINT32 Gen( SbiOpcode, UINT32, UINT32 );
diff --git a/basic/source/inc/dlgcont.hxx b/basic/source/inc/dlgcont.hxx
index b0b3334b5031..2c927a8286f4 100644
--- a/basic/source/inc/dlgcont.hxx
+++ b/basic/source/inc/dlgcont.hxx
@@ -54,14 +54,17 @@ class SfxDialogLibraryContainer : public SfxLibraryContainer
virtual bool SAL_CALL isLibraryElementValid( ::com::sun::star::uno::Any aElement ) const;
virtual void SAL_CALL writeLibraryElement
(
- ::com::sun::star::uno::Any aElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer>& xLibrary,
const ::rtl::OUString& aElementName,
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > xOutput
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutput
)
throw(::com::sun::star::uno::Exception);
virtual ::com::sun::star::uno::Any SAL_CALL importLibraryElement
- ( const ::rtl::OUString& aFile,
+ (
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer>& xLibrary,
+ const ::rtl::OUString& aElementName,
+ const ::rtl::OUString& aFile,
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xElementStream );
virtual void SAL_CALL importFromOldStorage( const ::rtl::OUString& aFile );
diff --git a/basic/source/inc/errobject.hxx b/basic/source/inc/errobject.hxx
new file mode 100644
index 000000000000..39e6e319caae
--- /dev/null
+++ b/basic/source/inc/errobject.hxx
@@ -0,0 +1,52 @@
+/*************************************************************************
+*
+* 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 ERROBJECT_HXX
+#define ERROBJECT_HXX
+#include "sbunoobj.hxx"
+#include <ooo/vba/XErrObject.hpp>
+
+
+class SbxErrObject : public SbUnoObject
+{
+ class ErrObject* m_pErrObject;
+ com::sun::star::uno::Reference< ooo::vba::XErrObject > m_xErr;
+
+ SbxErrObject( const String& aName_, const com::sun::star::uno::Any& aUnoObj_ );
+ ~SbxErrObject();
+
+ class ErrObject* getImplErrObject( void )
+ { return m_pErrObject; }
+
+public:
+ static SbxVariableRef getErrObject();
+ static com::sun::star::uno::Reference< ooo::vba::XErrObject > getUnoErrObject();
+
+ void setNumberAndDescription( ::sal_Int32 _number, const ::rtl::OUString& _description )
+ throw (com::sun::star::uno::RuntimeException);
+};
+#endif
diff --git a/basic/source/inc/expr.hxx b/basic/source/inc/expr.hxx
index 8ccbcebe4309..9b8f51d09dea 100644
--- a/basic/source/inc/expr.hxx
+++ b/basic/source/inc/expr.hxx
@@ -52,6 +52,13 @@ struct SbVar { // Variablen-Element:
SbiExprListVector* pvMorePar; // Array of arrays foo(pPar)(avMorePar[0])(avMorePar[1])...
};
+struct KeywordSymbolInfo
+{
+ String m_aKeywordSymbol;
+ SbxDataType m_eSbxDataType;
+ SbiToken m_eTok;
+};
+
enum SbiExprType { // Expression-Typen:
SbSTDEXPR, // normaler Ausdruck
SbLVALUE, // beliebiger lValue
@@ -76,6 +83,7 @@ enum SbiNodeType {
SbxVARVAL, // aVar = Wert
SbxTYPEOF, // TypeOf ObjExpr Is Type
SbxNODE, // Node
+ SbxNEW, // new <type> expression
SbxDUMMY
};
@@ -107,9 +115,11 @@ class SbiExprNode { // Operatoren (und Operanden)
void FoldConstants(); // Constant Folding durchfuehren
void CollectBits(); // Umwandeln von Zahlen in Strings
BOOL IsOperand() // TRUE, wenn Operand
- { return BOOL( eNodeType != SbxNODE && eNodeType != SbxTYPEOF ); }
+ { return BOOL( eNodeType != SbxNODE && eNodeType != SbxTYPEOF && eNodeType != SbxNEW ); }
BOOL IsTypeOf()
{ return BOOL( eNodeType == SbxTYPEOF ); }
+ BOOL IsNew()
+ { return BOOL( eNodeType == SbxNEW ); }
BOOL IsNumber(); // TRUE bei Zahlen
BOOL IsString(); // TRUE bei Strings
BOOL IsLvalue(); // TRUE, falls als Lvalue verwendbar
@@ -122,6 +132,7 @@ public:
SbiExprNode( SbiParser*, const SbiSymDef&, SbxDataType, SbiExprList* = NULL );
SbiExprNode( SbiParser*, SbiExprNode*, SbiToken, SbiExprNode* );
SbiExprNode( SbiParser*, SbiExprNode*, USHORT ); // #120061 TypeOf
+ SbiExprNode( SbiParser*, USHORT ); // new <type>
virtual ~SbiExprNode();
BOOL IsValid() { return BOOL( !bError ); }
@@ -166,9 +177,9 @@ protected:
BOOL bByVal; // TRUE: ByVal-Parameter
BOOL bBracket; // TRUE: Parameter list with brackets
USHORT nParenLevel;
- SbiExprNode* Term();
+ SbiExprNode* Term( const KeywordSymbolInfo* pKeywordSymbolInfo = NULL );
SbiExprNode* ObjTerm( SbiSymDef& );
- SbiExprNode* Operand();
+ SbiExprNode* Operand( bool bUsedForTypeOf = false );
SbiExprNode* Unary();
SbiExprNode* Exp();
SbiExprNode* MulDiv();
@@ -180,7 +191,8 @@ protected:
SbiExprNode* Comp();
SbiExprNode* Boolean();
public:
- SbiExpression( SbiParser*, SbiExprType = SbSTDEXPR, SbiExprMode eMode = EXPRMODE_STANDARD ); // Parsender Ctor
+ SbiExpression( SbiParser*, SbiExprType = SbSTDEXPR,
+ SbiExprMode eMode = EXPRMODE_STANDARD, const KeywordSymbolInfo* pKeywordSymbolInfo = NULL ); // Parsender Ctor
SbiExpression( SbiParser*, const String& );
SbiExpression( SbiParser*, double, SbxDataType = SbxDOUBLE );
SbiExpression( SbiParser*, const SbiSymDef&, SbiExprList* = NULL );
diff --git a/basic/source/inc/image.hxx b/basic/source/inc/image.hxx
index 7347efe288f3..d674b91faf71 100644
--- a/basic/source/inc/image.hxx
+++ b/basic/source/inc/image.hxx
@@ -106,6 +106,5 @@ public:
#define SBIMG_COMPARETEXT 0x0002 // OPTION COMPARE TEXT ist aktiv
#define SBIMG_INITCODE 0x0004 // Init-Code vorhanden
#define SBIMG_CLASSMODULE 0x0008 // OPTION ClassModule is active
-#define SBIMG_VBASUPPORT 0x0020 // OPTION VBASupport is 1
#endif
diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx
index 1f7e77170d44..ac1199f6c233 100644
--- a/basic/source/inc/namecont.hxx
+++ b/basic/source/inc/namecont.hxx
@@ -35,6 +35,7 @@
#include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
#include <com/sun/star/script/XLibraryContainerExport.hpp>
+#include <com/sun/star/script/XLibraryContainer3.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XContainer.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
@@ -57,20 +58,23 @@
#include <com/sun/star/deployment/XPackage.hpp>
#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/compbase6.hxx>
+#include <cppuhelper/compbase8.hxx>
#include <cppuhelper/interfacecontainer.hxx>
+#include <com/sun/star/script/XVBACompat.hpp>
class BasicManager;
namespace basic
{
-typedef ::cppu::WeakComponentImplHelper6<
+typedef ::cppu::WeakComponentImplHelper8<
::com::sun::star::lang::XInitialization,
::com::sun::star::script::XStorageBasedLibraryContainer,
::com::sun::star::script::XLibraryContainerPassword,
::com::sun::star::script::XLibraryContainerExport,
+ ::com::sun::star::script::XLibraryContainer3,
::com::sun::star::container::XContainer,
+ ::com::sun::star::script::XVBACompat,
::com::sun::star::lang::XServiceInfo > LibraryContainerHelper;
typedef ::cppu::WeakImplHelper2< ::com::sun::star::container::XNameContainer,
@@ -216,6 +220,7 @@ public:
class SfxLibraryContainer :public LibraryContainerHelper
,public ::utl::OEventListenerAdapter
{
+ sal_Bool mbVBACompat;
protected:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > mxSFI;
@@ -280,14 +285,17 @@ protected:
virtual bool SAL_CALL isLibraryElementValid( ::com::sun::star::uno::Any aElement ) const = 0;
virtual void SAL_CALL writeLibraryElement
(
- ::com::sun::star::uno::Any aElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer>& xLibrary,
const ::rtl::OUString& aElementName,
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > xOutput
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutput
)
throw(::com::sun::star::uno::Exception) = 0;
virtual ::com::sun::star::uno::Any SAL_CALL importLibraryElement
- ( const ::rtl::OUString& aFile,
+ (
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer>& xLibrary,
+ const ::rtl::OUString& aElementName,
+ const ::rtl::OUString& aFile,
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xElementStream ) = 0;
virtual void SAL_CALL importFromOldStorage( const ::rtl::OUString& aFile ) = 0;
@@ -405,6 +413,12 @@ public:
virtual ::rtl::OUString SAL_CALL getContainerLocationName() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL storeLibraries( ) throw (::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ //Methods XLibraryContainer3
+ virtual ::rtl::OUString SAL_CALL getOriginalLibraryLinkURL( const ::rtl::OUString& Name )
+ throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::uno::RuntimeException);
+
// Methods XLibraryContainer2 (base of XPersistentLibraryContainer)
virtual sal_Bool SAL_CALL isLibraryLink( const ::rtl::OUString& Name )
throw (::com::sun::star::container::NoSuchElementException,
@@ -493,6 +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);
};
class LibraryContainerMethodGuard
@@ -541,6 +558,8 @@ private:
::rtl::OUString maLibInfoFileURL;
::rtl::OUString maStorageURL;
::rtl::OUString maUnexpandedStorageURL;
+ ::rtl::OUString maOrignialStorageURL;
+
sal_Bool mbLink;
sal_Bool mbReadOnly;
sal_Bool mbReadOnlyLink;
@@ -689,6 +708,7 @@ enum IteratorState
{
USER_EXTENSIONS,
SHARED_EXTENSIONS,
+ BUNDLED_EXTENSIONS,
END_REACHED
};
@@ -708,6 +728,8 @@ protected:
implGetNextUserScriptPackage( bool& rbPureDialogLib );
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage >
implGetNextSharedScriptPackage( bool& rbPureDialogLib );
+ com::sun::star::uno::Reference< com::sun::star::deployment::XPackage >
+ implGetNextBundledScriptPackage( bool& rbPureDialogLib );
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext;
@@ -721,8 +743,16 @@ protected:
< com::sun::star::deployment::XPackage > > m_aSharedPackagesSeq;
bool m_bSharedPackagesLoaded;
+ com::sun::star::uno::Sequence< com::sun::star::uno::Reference
+ < com::sun::star::deployment::XPackage > > m_aBundledPackagesSeq;
+ bool m_bBundledPackagesLoaded;
+
+
int m_iUserPackage;
int m_iSharedPackage;
+ int m_iBundledPackage;
+
+
ScriptSubPackageIterator* m_pScriptSubPackageIterator;
diff --git a/basic/source/inc/opcodes.hxx b/basic/source/inc/opcodes.hxx
index 9d909c03c436..ff7eff027f83 100644
--- a/basic/source/inc/opcodes.hxx
+++ b/basic/source/inc/opcodes.hxx
@@ -93,6 +93,7 @@ enum SbiOpcode {
_VBASET, // VBA-like Set
_ERASE_CLEAR, // Erase array and clear variable
_ARRAYACCESS, // Assign parameters to TOS and get value, used for array of arrays
+ _BYVAL, // byref -> byval for lvalue parameter passed in call
SbOP0_END,
// Alle Opcodes mit einem Operanden
diff --git a/basic/source/inc/parser.hxx b/basic/source/inc/parser.hxx
index 3dc8525377a2..1161c4ed259d 100644
--- a/basic/source/inc/parser.hxx
+++ b/basic/source/inc/parser.hxx
@@ -99,7 +99,7 @@ public:
BOOL TestComma(); // Komma oder EOLN?
void TestEoln(); // EOLN?
- void Symbol(); // Let oder Call
+ void Symbol( const KeywordSymbolInfo* pKeywordSymbolInfo = NULL ); // Let oder Call
void ErrorStmnt(); // ERROR n
void NotImp(); // nicht implementiert
void BadBlock(); // LOOP/WEND/NEXT
@@ -119,6 +119,7 @@ public:
void If(); // IF
void Implements(); // IMPLEMENTS
void Input(); // INPUT, INPUT #
+ void Line(); // LINE -> LINE INPUT [#] (#i92642)
void LineInput(); // LINE INPUT, LINE INPUT #
void LSet(); // LSET
void Name(); // NAME .. AS ..
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx
index 4a3f38c51027..6ca69209a752 100644
--- a/basic/source/inc/runtime.hxx
+++ b/basic/source/inc/runtime.hxx
@@ -219,6 +219,8 @@ public:
void Error( SbError ); // trappable Error
void Error( SbError, const String& rMsg ); // trappable Error mit Message
+ void ErrorVB( sal_Int32 nVBNumber, const String& rMsg );
+ void setErrorVB( sal_Int32 nVBNumber, const String& rMsg );
void FatalError( SbError ); // non-trappable Error
void FatalError( SbError, const String& ); // non-trappable Error
void Abort(); // Abbruch mit aktuellem Fehlercode
@@ -405,7 +407,7 @@ class SbiRuntime
void StepPRINTF(), StepWRITE(), StepRENAME(), StepPROMPT();
void StepRESTART(), StepEMPTY(), StepLEAVE();
void StepLSET(), StepRSET(), StepREDIMP_ERASE(), StepERASE_CLEAR();
- void StepARRAYACCESS();
+ void StepARRAYACCESS(), StepBYVAL();
// Alle Opcodes mit einem Operanden
void StepLOADNC( UINT32 ), StepLOADSC( UINT32 ), StepLOADI( UINT32 );
void StepARGN( UINT32 ), StepBASED( UINT32 ), StepPAD( UINT32 );
@@ -414,7 +416,7 @@ class SbiRuntime
void StepGOSUB( UINT32 ), StepRETURN( UINT32 );
void StepTESTFOR( UINT32 ), StepCASETO( UINT32 ), StepERRHDL( UINT32 );
void StepRESUME( UINT32 ), StepSETCLASS( UINT32 ), StepVBASETCLASS( UINT32 ), StepTESTCLASS( UINT32 ), StepLIB( UINT32 );
- bool checkClass_Impl( const SbxVariableRef& refVal, const String& aClass, bool bRaiseErrors );
+ bool checkClass_Impl( const SbxVariableRef& refVal, const String& aClass, bool bRaiseErrors, bool bDefault = true );
void StepCLOSE( UINT32 ), StepPRCHAR( UINT32 ), StepARGTYP( UINT32 );
// Alle Opcodes mit zwei Operanden
void StepRTL( UINT32, UINT32 ), StepPUBLIC( UINT32, UINT32 ), StepPUBLIC_P( UINT32, UINT32 );
@@ -432,8 +434,9 @@ class SbiRuntime
void StepDCREATE_REDIMP(UINT32,UINT32), StepDCREATE_IMPL(UINT32,UINT32);
void StepFIND_CM( UINT32, UINT32 );
void StepFIND_STATIC( UINT32, UINT32 );
+ void implCreateFixedString( SbxVariable* pStrVar, UINT32 nOp2 );
public:
- void SetVBAEnabled( bool bEnabled ) { bVBAEnabled = bEnabled; };
+ void SetVBAEnabled( bool bEnabled );
USHORT GetImageFlag( USHORT n ) const;
USHORT GetBase();
xub_StrLen nLine,nCol1,nCol2; // aktuelle Zeile, Spaltenbereich
@@ -441,10 +444,11 @@ public:
SbiRuntime( SbModule*, SbMethod*, UINT32 );
~SbiRuntime();
- void Error( SbError ); // Fehler setzen, falls != 0
+ void Error( SbError, bool bVBATranslationAlreadyDone = false ); // Fehler setzen, falls != 0
void Error( SbError, const String& ); // Fehler setzen, falls != 0
void FatalError( SbError ); // Fehlerbehandlung=Standard, Fehler setzen
void FatalError( SbError, const String& ); // Fehlerbehandlung=Standard, Fehler setzen
+ static sal_Int32 translateErrorToVba( SbError nError, String& rMsg );
void DumpPCode();
BOOL Step(); // Einzelschritt (ein Opcode)
void Stop() { bRun = FALSE; }
diff --git a/basic/source/inc/sbintern.hxx b/basic/source/inc/sbintern.hxx
index 5896db78ea40..59cfe21d25a8 100644
--- a/basic/source/inc/sbintern.hxx
+++ b/basic/source/inc/sbintern.hxx
@@ -39,6 +39,7 @@ namespace utl
class SbUnoFactory;
class SbTypeFactory;
class SbOLEFactory;
+class SbFormFactory;
class SbiInstance;
class SbModule;
@@ -101,6 +102,7 @@ struct SbiGlobals
SbTypeFactory* pTypeFac; // Factory for user defined types
SbClassFactory* pClassFac; // Factory for user defined classes (based on class modules)
SbOLEFactory* pOLEFac; // Factory for OLE types
+ SbFormFactory* pFormFac; // Factory for user forms
SbModule* pMod; // aktuell aktives Modul
SbModule* pCompMod; // aktuell compiliertes Modul
short nInst; // Anzahl BASICs
@@ -136,6 +138,7 @@ SbiGlobals* GetSbData();
#define pTYPEFAC GetSbData()->pTypeFac
#define pCLASSFAC GetSbData()->pClassFac
#define pOLEFAC GetSbData()->pOLEFac
+#define pFORMFAC GetSbData()->pFormFac
#endif
diff --git a/basic/source/inc/scriptcont.hxx b/basic/source/inc/scriptcont.hxx
index 19b0698d22a9..d184a2d558e2 100644
--- a/basic/source/inc/scriptcont.hxx
+++ b/basic/source/inc/scriptcont.hxx
@@ -30,6 +30,8 @@
#include "namecont.hxx"
#include <basic/basmgr.hxx>
+#include <com/sun/star/script/XVBAModuleInfo.hpp>
+#include <comphelper/uno3.hxx>
class BasicManager;
@@ -51,14 +53,17 @@ class SfxScriptLibraryContainer : public SfxLibraryContainer, public OldBasicPas
virtual bool SAL_CALL isLibraryElementValid( ::com::sun::star::uno::Any aElement ) const;
virtual void SAL_CALL writeLibraryElement
(
- ::com::sun::star::uno::Any aElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer>& xLibrary,
const ::rtl::OUString& aElementName,
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > xOutput
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutput
)
throw(::com::sun::star::uno::Exception);
virtual ::com::sun::star::uno::Any SAL_CALL importLibraryElement
- ( const ::rtl::OUString& aFile,
+ (
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer>& xLibrary,
+ const ::rtl::OUString& aElementName,
+ const ::rtl::OUString& aFile,
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xElementStream );
virtual void SAL_CALL importFromOldStorage( const ::rtl::OUString& aFile );
@@ -134,13 +139,19 @@ 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
+ > SfxScriptLibrary_BASE;
class SfxScriptLibrary : public SfxLibrary
+ , public SfxScriptLibrary_BASE
{
friend class SfxScriptLibraryContainer;
sal_Bool mbLoadedSource;
sal_Bool mbLoadedBinary;
+ ModuleInfoMap mModuleInfos;
// Provide modify state including resources
virtual sal_Bool isModified( void );
@@ -167,6 +178,15 @@ public:
const ::rtl::OUString& aLibInfoFileURL, const ::rtl::OUString& aStorageURL, sal_Bool ReadOnly
);
+ DECLARE_XINTERFACE()
+ DECLARE_XTYPEPROVIDER()
+
+ // XVBAModuleInfo
+ virtual ::com::sun::star::script::ModuleInfo SAL_CALL getModuleInfo( const ::rtl::OUString& ModuleName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasModuleInfo( const ::rtl::OUString& ModuleName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL insertModuleInfo( const ::rtl::OUString& ModuleName, const ::com::sun::star::script::ModuleInfo& ModuleInfo ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeModuleInfo( const ::rtl::OUString& ModuleName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
static bool containsValidModule( const ::com::sun::star::uno::Any& _rElement );
protected:
diff --git a/basic/source/inc/symtbl.hxx b/basic/source/inc/symtbl.hxx
index 03202edba910..9bd8cfd49754 100644
--- a/basic/source/inc/symtbl.hxx
+++ b/basic/source/inc/symtbl.hxx
@@ -132,7 +132,9 @@ protected:
BOOL bAs : 1; // TRUE: Datentyp per AS XXX definiert
BOOL bGlobal : 1; // TRUE: Global-Variable
BOOL bParamArray : 1; // TRUE: ParamArray parameter
+ BOOL bWithEvents : 1; // TRUE: Declared WithEvents
USHORT nDefaultId; // Symbol number of default value
+ short nFixedStringLength; // String length in: Dim foo As String*Length
public:
SbiSymDef( const String& );
virtual ~SbiSymDef();
@@ -156,6 +158,7 @@ public:
BOOL IsDefined() const{ return bChained; }
void SetOptional() { bOpt = TRUE; }
void SetParamArray() { bParamArray = TRUE; }
+ void SetWithEvents() { bWithEvents = TRUE; }
void SetByVal() { bByVal = TRUE; }
void SetStatic( BOOL bAsStatic = TRUE ) { bStatic = bAsStatic; }
void SetNew() { bNew = TRUE; }
@@ -165,11 +168,14 @@ public:
USHORT GetDefaultId( void ) { return nDefaultId; }
BOOL IsOptional() const{ return bOpt; }
BOOL IsParamArray() const{ return bParamArray; }
+ BOOL IsWithEvents() const{ return bWithEvents; }
BOOL IsByVal() const { return bByVal; }
BOOL IsStatic() const { return bStatic; }
BOOL IsNew() const { return bNew; }
BOOL IsDefinedAs() const { return bAs; }
BOOL IsGlobal() const { return bGlobal; }
+ short GetFixedStringLength( void ) const { return nFixedStringLength; }
+ void SetFixedStringLength( short n ) { nFixedStringLength = n; }
SbiSymPool& GetPool();
UINT32 Define(); // Symbol in Code definieren
diff --git a/basic/source/inc/token.hxx b/basic/source/inc/token.hxx
index 3dc1113b57d1..930f68910b78 100644
--- a/basic/source/inc/token.hxx
+++ b/basic/source/inc/token.hxx
@@ -95,7 +95,7 @@ enum SbiToken {
NUMBER=FIRSTEXTRA, FIXSTRING, SYMBOL, _CDECL_, BYVAL, BYREF,
OUTPUT, RANDOM, APPEND, BINARY, ACCESS,
LOCK, READ, PRESERVE, BASE, ANY, LIB, _OPTIONAL_,
- EXPLICIT, COMPATIBLE, CLASSMODULE, PARAMARRAY,
+ EXPLICIT, COMPATIBLE, CLASSMODULE, PARAMARRAY, WITHEVENTS,
// Ab hier kommen JavaScript-Tokens (gleiches enum, damit gleicher Typ)
FIRSTJAVA,
@@ -120,7 +120,25 @@ enum SbiToken {
#undef SbiTokenSHAREDTMPUNDEF
#endif
+// #i109076
+class TokenLabelInfo
+{
+ bool* m_pTokenCanBeLabelTab;
+
+public:
+ TokenLabelInfo( void );
+ TokenLabelInfo( const TokenLabelInfo& rInfo )
+ : m_pTokenCanBeLabelTab( NULL )
+ { (void)rInfo; }
+ ~TokenLabelInfo();
+
+ bool canTokenBeLabel( SbiToken eTok )
+ { return m_pTokenCanBeLabelTab[eTok]; }
+};
+
class SbiTokenizer : public SbiScanner {
+ TokenLabelInfo m_aTokenLabelInfo;
+
protected:
SbiToken eCurTok; // aktuelles Token
SbiToken ePush; // Pushback-Token
diff --git a/basic/source/runtime/dllmgr.cxx b/basic/source/runtime/dllmgr.cxx
index 22014763bb29..bc08a8cb64bc 100644
--- a/basic/source/runtime/dllmgr.cxx
+++ b/basic/source/runtime/dllmgr.cxx
@@ -25,647 +25,714 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_basic.hxx"
+#include "sal/config.h"
-#include <stdlib.h>
-#ifdef OS2
-#define INCL_DOSMODULEMGR
-#include <svpm.h>
-#endif
-
-#if defined( WIN ) || defined( WNT )
-#ifndef _SVWIN_H
-#undef WB_LEFT
-#undef WB_RIGHT
-#include <tools/svwin.h>
-#endif
-#endif
-#include <tools/debug.hxx>
-#include <tools/string.hxx>
-#include <tools/errcode.hxx>
-#include <basic/sbxvar.hxx>
-#include <basic/sbx.hxx>
-
-#if defined(WIN)
-typedef HINSTANCE SbiDllHandle;
-typedef FARPROC SbiDllProc;
-#elif defined(WNT)
-typedef HMODULE SbiDllHandle;
-typedef int(*SbiDllProc)();
-#elif defined(OS2)
-typedef HMODULE SbiDllHandle;
-typedef PFN SbiDllProc;
-#else
-typedef void* SbiDllHandle;
-typedef void* SbiDllProc;
-#endif
+#include <algorithm>
+#include <cstddef>
+#include <list>
+#include <map>
+#include <vector>
-#define _DLLMGR_CXX
-#include "dllmgr.hxx"
-#include <basic/sberrors.hxx>
+#include "basic/sbx.hxx"
+#include "basic/sbxvar.hxx"
+#include "osl/thread.h"
+#include "rtl/ref.hxx"
+#include "rtl/string.hxx"
+#include "rtl/ustring.hxx"
+#include "salhelper/simplereferenceobject.hxx"
+#include "tools/svwin.h"
-#ifndef WINAPI
-#ifdef WNT
-#define WINAPI __far __pascal
-#endif
-#endif
+#undef max
-extern "C" {
-#if defined(INTEL) && (defined(WIN) || defined(WNT))
+#include "dllmgr.hxx"
-extern INT16 WINAPI CallINT( SbiDllProc, char *stack, short nstack);
-extern INT32 WINAPI CallLNG( SbiDllProc, char *stack, short nstack);
-#ifndef WNT
-extern float WINAPI CallSNG( SbiDllProc, char *stack, short nstack);
-#endif
-extern double WINAPI CallDBL( SbiDllProc, char *stack, short nstack);
-extern char* WINAPI CallSTR( SbiDllProc, char *stack, short nstack);
-// extern CallFIX( SbiDllProc, char *stack, short nstack);
+/* Open issues:
-#else
+ Only 32-bit Windows for now.
-INT16 CallINT( SbiDllProc, char *, short ) { return 0; }
-INT32 CallLNG( SbiDllProc, char *, short ) { return 0; }
-float CallSNG( SbiDllProc, char *, short ) { return 0; }
-double CallDBL( SbiDllProc, char *, short) { return 0; }
-char* CallSTR( SbiDllProc, char *, short ) { return 0; }
-#endif
-}
+ Missing support for functions returning structs (see TODO in call()).
-SV_IMPL_OP_PTRARR_SORT(ImplDllArr,ByteStringPtr)
+ Missing support for additional data types (64 bit integers, Any, ...; would
+ trigger OSL_ASSERT(false) in various switches).
-/* mit Optimierung An stuerzt unter Win95 folgendes Makro ab:
-declare Sub MessageBeep Lib "user32" (ByVal long)
-sub main
- MessageBeep( 1 )
-end sub
+ It is assumed that the variables passed into SbiDllMgr::Call to represent
+ the arguments and return value have types that exactly match the Declare
+ statement; it would be better if this code had access to the function
+ signature from the Declare statement, so that it could convert the passed
+ variables accordingly.
*/
-#if defined (WNT) && defined (MSC)
-//#pragma optimize ("", off)
-#endif
-//
-// ***********************************************************************
-//
+#if defined WNT // only 32-bit Windows, actually
-class ImplSbiProc : public ByteString
-{
- SbiDllProc pProc;
- ImplSbiProc();
- ImplSbiProc( const ImplSbiProc& );
-
-public:
- ImplSbiProc( const ByteString& rName, SbiDllProc pFunc )
- : ByteString( rName ) { pProc = pFunc; }
- SbiDllProc GetProc() const { return pProc; }
-};
+extern "C" {
-//
-// ***********************************************************************
-//
+int __stdcall DllMgr_call32(FARPROC, void const * stack, std::size_t size);
+double __stdcall DllMgr_callFp(FARPROC, void const * stack, std::size_t size);
-class ImplSbiDll : public ByteString
-{
- ImplDllArr aProcArr;
- SbiDllHandle hDLL;
+}
- ImplSbiDll( const ImplSbiDll& );
-public:
- ImplSbiDll( const ByteString& rName, SbiDllHandle hHandle )
- : ByteString( rName ) { hDLL = hHandle; }
- ~ImplSbiDll();
- SbiDllHandle GetHandle() const { return hDLL; }
- SbiDllProc GetProc( const ByteString& rName ) const;
- void InsertProc( const ByteString& rName, SbiDllProc pProc );
-};
+namespace {
-ImplSbiDll::~ImplSbiDll()
-{
- USHORT nCount = aProcArr.Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
- {
- ImplSbiProc* pProc = (ImplSbiProc*)aProcArr.GetObject( nCur );
- delete pProc;
- }
+char * address(std::vector< char > & blob) {
+ return blob.empty() ? 0 : &blob[0];
}
-SbiDllProc ImplSbiDll::GetProc( const ByteString& rName ) const
-{
- USHORT nPos;
- BOOL bRet = aProcArr.Seek_Entry( (ByteStringPtr)&rName, &nPos );
- if( bRet )
- {
- ImplSbiProc* pImplProc = (ImplSbiProc*)aProcArr.GetObject(nPos);
- return pImplProc->GetProc();
- }
- return (SbiDllProc)0;
+SbError convert(rtl::OUString const & source, rtl::OString * target) {
+ return
+ source.convertToString(
+ target, osl_getThreadTextEncoding(),
+ (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR |
+ RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))
+ ? ERRCODE_NONE : ERRCODE_BASIC_BAD_ARGUMENT;
+ //TODO: more specific errcode?
}
-void ImplSbiDll::InsertProc( const ByteString& rName, SbiDllProc pProc )
-{
- DBG_ASSERT(aProcArr.Seek_Entry((ByteStringPtr)&rName,0)==0,"InsertProc: Already in table");
- ImplSbiProc* pImplProc = new ImplSbiProc( rName, pProc );
- aProcArr.Insert( (ByteStringPtr)pImplProc );
+SbError convert(char const * source, sal_Int32 length, rtl::OUString * target) {
+ return
+ rtl_convertStringToUString(
+ &target->pData, source, length, osl_getThreadTextEncoding(),
+ (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR |
+ RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR |
+ RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR))
+ ? ERRCODE_NONE : ERRCODE_BASIC_BAD_ARGUMENT;
+ //TODO: more specific errcode?
}
+struct UnmarshalData {
+ UnmarshalData(SbxVariable * theVariable, void * theBuffer):
+ variable(theVariable), buffer(theBuffer) {}
-//
-// ***********************************************************************
-//
+ SbxVariable * variable;
+ void * buffer;
+};
-SbiDllMgr::SbiDllMgr( const SbiDllMgr& )
-{
-}
+struct StringData: public UnmarshalData {
+ StringData(SbxVariable * theVariable, void * theBuffer, bool theSpecial):
+ UnmarshalData(theVariable, theBuffer), special(theSpecial) {}
-SbiDllMgr::SbiDllMgr()
-{
-}
+ bool special;
+};
-SbiDllMgr::~SbiDllMgr()
-{
- USHORT nCount = aDllArr.Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
- {
- ImplSbiDll* pDll = (ImplSbiDll*)aDllArr.GetObject( nCur );
- FreeDllHandle( pDll->GetHandle() );
- delete pDll;
+class MarshalData: private boost::noncopyable {
+public:
+ std::vector< char > * newBlob() {
+ blobs_.push_front(std::vector< char >());
+ return &blobs_.front();
}
-}
-void SbiDllMgr::FreeDll( const ByteString& rDllName )
-{
- USHORT nPos;
- BOOL bRet = aDllArr.Seek_Entry( (ByteStringPtr)&rDllName, &nPos );
- if( bRet )
- {
- ImplSbiDll* pDll = (ImplSbiDll*)aDllArr.GetObject(nPos);
- FreeDllHandle( pDll->GetHandle() );
- delete pDll;
- aDllArr.Remove( nPos, 1 );
- }
-}
+ std::vector< UnmarshalData > unmarshal;
+ std::vector< StringData > unmarshalStrings;
-ImplSbiDll* SbiDllMgr::GetDll( const ByteString& rDllName )
-{
- USHORT nPos;
- ImplSbiDll* pDll = 0;
- BOOL bRet = aDllArr.Seek_Entry( (ByteStringPtr)&rDllName, &nPos );
- if( bRet )
- pDll = (ImplSbiDll*)aDllArr.GetObject(nPos);
- else
- {
- SbiDllHandle hDll = CreateDllHandle( rDllName );
- if( hDll )
- {
- pDll = new ImplSbiDll( rDllName, hDll );
- aDllArr.Insert( (ByteStringPtr)pDll );
- }
- }
- return pDll;
+private:
+ std::list< std::vector< char > > blobs_;
+};
+
+std::size_t align(std::size_t address, std::size_t alignment) {
+ // alignment = 2^k for some k >= 0
+ return (address + (alignment - 1)) & ~(alignment - 1);
}
-SbiDllProc SbiDllMgr::GetProc( ImplSbiDll* pDll, const ByteString& rProcName )
+char * align(
+ std::vector< char > & blob, std::size_t alignment, std::size_t offset,
+ std::size_t add)
{
- DBG_ASSERT(pDll,"GetProc: No dll-ptr");
- SbiDllProc pProc;
- pProc = pDll->GetProc( rProcName );
- if( !pProc )
- {
- pProc = GetProcAddr( pDll->GetHandle(), rProcName );
- if( pProc )
- pDll->InsertProc( rProcName, pProc );
- }
- return pProc;
+ std::vector< char >::size_type n = blob.size();
+ n = align(n - offset, alignment) + offset; //TODO: overflow in align()
+ blob.resize(n + add); //TODO: overflow
+ return address(blob) + n;
}
-
-SbError SbiDllMgr::Call( const char* pProcName, const char* pDllName,
- SbxArray* pArgs, SbxVariable& rResult, BOOL bCDecl )
+template< typename T > void add(
+ std::vector< char > & blob, T const & data, std::size_t alignment,
+ std::size_t offset)
{
- DBG_ASSERT(pProcName&&pDllName,"Call: Bad parms");
- SbError nSbErr = 0;
- ByteString aDllName( pDllName );
- CheckDllName( aDllName );
- ImplSbiDll* pDll = GetDll( aDllName );
- if( pDll )
- {
- SbiDllProc pProc = GetProc( pDll, pProcName );
- if( pProc )
- {
- if( bCDecl )
- nSbErr = CallProcC( pProc, pArgs, rResult );
- else
- nSbErr = CallProc( pProc, pArgs, rResult );
+ *reinterpret_cast< T * >(align(blob, alignment, offset, sizeof (T))) = data;
+}
+
+std::size_t alignment(SbxVariable * variable) {
+ OSL_ASSERT(variable != 0);
+ if ((variable->GetType() & SbxARRAY) == 0) {
+ switch (variable->GetType()) {
+ case SbxINTEGER:
+ return 2;
+ case SbxLONG:
+ case SbxSINGLE:
+ case SbxSTRING:
+ return 4;
+ case SbxDOUBLE:
+ return 8;
+ case SbxOBJECT:
+ {
+ std::size_t n = 1;
+ SbxArray * props = PTR_CAST(SbxObject, variable->GetObject())->
+ GetProperties();
+ for (USHORT i = 0; i < props->Count(); ++i) {
+ n = std::max(n, alignment(props->Get(i)));
+ }
+ return n;
+ }
+ case SbxBOOL:
+ case SbxBYTE:
+ return 1;
+ default:
+ OSL_ASSERT(false);
+ return 1;
+ }
+ } else {
+ SbxDimArray * arr = PTR_CAST(SbxDimArray, variable->GetObject());
+ int dims = arr->GetDims();
+ std::vector< INT32 > low(dims);
+ for (int i = 0; i < dims; ++i) {
+ INT32 up;
+ arr->GetDim32(i + 1, low[i], up);
}
- else
- nSbErr = SbERR_PROC_UNDEFINED;
+ return alignment(arr->Get32(&low[0]));
}
- else
- nSbErr = SbERR_BAD_DLL_LOAD;
- return nSbErr;
}
-// ***********************************************************************
-// ******************* abhaengige Implementationen ***********************
-// ***********************************************************************
+SbError marshal(
+ bool outer, SbxVariable * variable, bool special,
+ std::vector< char > & blob, std::size_t offset, MarshalData & data);
-void SbiDllMgr::CheckDllName( ByteString& rDllName )
+SbError marshalString(
+ SbxVariable * variable, bool special, MarshalData & data, void ** buffer)
{
-#if defined(WIN) || defined(WNT) || defined(OS2)
- if( rDllName.Search('.') == STRING_NOTFOUND )
- rDllName += ".DLL";
-#else
- (void)rDllName;
-#endif
+ OSL_ASSERT(variable != 0 && buffer != 0);
+ rtl::OString str;
+ SbError e = convert(variable->GetString(), &str);
+ if (e != ERRCODE_NONE) {
+ return e;
+ }
+ std::vector< char > * blob = data.newBlob();
+ blob->insert(blob->begin(), str.getStr(), str.getStr() + str.getLength());
+ *buffer = address(*blob);
+ data.unmarshalStrings.push_back(StringData(variable, *buffer, special));
+ return ERRCODE_NONE;
}
-
-SbiDllHandle SbiDllMgr::CreateDllHandle( const ByteString& rDllName )
+SbError marshalStruct(
+ SbxVariable * variable, std::vector< char > & blob, std::size_t offset,
+ MarshalData & data)
{
- (void)rDllName;
-
-#if defined(UNX)
- SbiDllHandle hLib=0;
-#else
- SbiDllHandle hLib;
-#endif
-
-#if defined(WIN)
- hLib = LoadLibrary( (const char*)rDllName );
- if( (ULONG)hLib < 32 )
- hLib = 0;
-
-#elif defined(WNT)
- hLib = LoadLibrary( rDllName.GetBuffer() );
- if( !(ULONG)hLib )
- {
-#ifdef DBG_UTIL
- ULONG nLastErr;
- nLastErr = GetLastError();
-#endif
- hLib = 0;
+ OSL_ASSERT(variable != 0);
+ SbxArray * props = PTR_CAST(SbxObject, variable->GetObject())->
+ GetProperties();
+ for (USHORT i = 0; i < props->Count(); ++i) {
+ SbError e = marshal(false, props->Get(i), false, blob, offset, data);
+ if (e != ERRCODE_NONE) {
+ return e;
+ }
}
-
-#elif defined(OS2)
- char cErr[ 100 ];
- if( DosLoadModule( (PSZ) cErr, 100, (const char*)rDllName.GetBuffer(), &hLib ) )
- hLib = 0;
-#endif
- return hLib;
+ return ERRCODE_NONE;
}
-void SbiDllMgr::FreeDllHandle( SbiDllHandle hLib )
+SbError marshalArray(
+ SbxVariable * variable, std::vector< char > & blob, std::size_t offset,
+ MarshalData & data)
{
-#if defined(WIN) || defined(WNT)
- if( hLib )
- FreeLibrary ((HINSTANCE) hLib);
-#elif defined(OS2)
- if( hLib )
- DosFreeModule( (HMODULE) hLib );
-#else
- (void)hLib;
-#endif
+ OSL_ASSERT(variable != 0);
+ SbxDimArray * arr = PTR_CAST(SbxDimArray, variable->GetObject());
+ int dims = arr->GetDims();
+ std::vector< INT32 > low(dims);
+ std::vector< INT32 > up(dims);
+ for (int i = 0; i < dims; ++i) {
+ arr->GetDim32(i + 1, low[i], up[i]);
+ }
+ for (std::vector< INT32 > idx = low;;) {
+ SbError e = marshal(
+ false, arr->Get32(&idx[0]), false, blob, offset, data);
+ if (e != ERRCODE_NONE) {
+ return e;
+ }
+ int i = dims - 1;
+ while (idx[i] == up[i]) {
+ idx[i] = low[i];
+ if (i == 0) {
+ return ERRCODE_NONE;
+ }
+ --i;
+ }
+ ++idx[i];
+ }
}
-SbiDllProc SbiDllMgr::GetProcAddr(SbiDllHandle hLib, const ByteString& rProcName)
+// 8-aligned structs are only 4-aligned on stack, so alignment of members in
+// such structs must take that into account via "offset"
+SbError marshal(
+ bool outer, SbxVariable * variable, bool special,
+ std::vector< char > & blob, std::size_t offset, MarshalData & data)
{
- char buf1 [128] = "";
- char buf2 [128] = "";
-
- SbiDllProc pProc = 0;
- int nOrd = 0;
-
- // Ordinal?
- if( rProcName.GetBuffer()[0] == '@' )
- nOrd = atoi( rProcName.GetBuffer()+1 );
-
- // Moegliche Parameter weg:
- DBG_ASSERT( sizeof(buf1) > rProcName.Len(),
- "SbiDllMgr::GetProcAddr: buffer to small!" );
- strncpy( buf1, rProcName.GetBuffer(), sizeof(buf1)-1 );
- char *p = strchr( buf1, '#' );
- if( p )
- *p = 0;
-
- DBG_ASSERT( sizeof(buf2) > strlen(buf1) + 1,
- "SbiDllMgr::GetProcAddr: buffer to small!" );
- strncpy( buf2, "_", sizeof(buf2)-1 );
- strncat( buf2, buf1, sizeof(buf2)-1-strlen(buf2) );
-
-#if defined(WIN) || defined(WNT)
- if( nOrd > 0 )
- pProc = (SbiDllProc)GetProcAddress( hLib, (char*)(long) nOrd );
- else
- {
- // 2. mit Parametern:
- pProc = (SbiDllProc)GetProcAddress ( hLib, rProcName.GetBuffer() );
- // 3. nur der Name:
- if (!pProc)
- pProc = (SbiDllProc)GetProcAddress( hLib, buf1 );
- // 4. der Name mit Underline vorweg:
- if( !pProc )
- pProc = (SbiDllProc)GetProcAddress( hLib, buf2 );
+ OSL_ASSERT(variable != 0);
+ if ((variable->GetFlags() & SBX_REFERENCE) == 0) {
+ if ((variable->GetType() & SbxARRAY) == 0) {
+ switch (variable->GetType()) {
+ case SbxINTEGER:
+ add(blob, variable->GetInteger(), outer ? 4 : 2, offset);
+ break;
+ case SbxLONG:
+ add(blob, variable->GetLong(), 4, offset);
+ break;
+ case SbxSINGLE:
+ add(blob, variable->GetSingle(), 4, offset);
+ break;
+ case SbxDOUBLE:
+ add(blob, variable->GetDouble(), outer ? 4 : 8, offset);
+ break;
+ case SbxSTRING:
+ {
+ void * p;
+ SbError e = marshalString(variable, special, data, &p);
+ if (e != ERRCODE_NONE) {
+ return e;
+ }
+ add(blob, p, 4, offset);
+ break;
+ }
+ case SbxOBJECT:
+ {
+ align(blob, outer ? 4 : alignment(variable), offset, 0);
+ SbError e = marshalStruct(variable, blob, offset, data);
+ if (e != ERRCODE_NONE) {
+ return e;
+ }
+ break;
+ }
+ case SbxBOOL:
+ add(blob, variable->GetBool(), outer ? 4 : 1, offset);
+ break;
+ case SbxBYTE:
+ add(blob, variable->GetByte(), outer ? 4 : 1, offset);
+ break;
+ default:
+ OSL_ASSERT(false);
+ break;
+ }
+ } else {
+ SbError e = marshalArray(variable, blob, offset, data);
+ if (e != ERRCODE_NONE) {
+ return e;
+ }
+ }
+ } else {
+ if ((variable->GetType() & SbxARRAY) == 0) {
+ switch (variable->GetType()) {
+ case SbxINTEGER:
+ case SbxLONG:
+ case SbxSINGLE:
+ case SbxDOUBLE:
+ case SbxBOOL:
+ case SbxBYTE:
+ add(blob, variable->data(), 4, offset);
+ break;
+ case SbxSTRING:
+ {
+ std::vector< char > * blob2 = data.newBlob();
+ void * p;
+ SbError e = marshalString(variable, special, data, &p);
+ if (e != ERRCODE_NONE) {
+ return e;
+ }
+ add(*blob2, p, 4, 0);
+ add(blob, address(*blob2), 4, offset);
+ break;
+ }
+ case SbxOBJECT:
+ {
+ std::vector< char > * blob2 = data.newBlob();
+ SbError e = marshalStruct(variable, *blob2, 0, data);
+ if (e != ERRCODE_NONE) {
+ return e;
+ }
+ void * p = address(*blob2);
+ if (outer) {
+ data.unmarshal.push_back(UnmarshalData(variable, p));
+ }
+ add(blob, p, 4, offset);
+ break;
+ }
+ default:
+ OSL_ASSERT(false);
+ break;
+ }
+ } else {
+ std::vector< char > * blob2 = data.newBlob();
+ SbError e = marshalArray(variable, *blob2, 0, data);
+ if (e != ERRCODE_NONE) {
+ return e;
+ }
+ void * p = address(*blob2);
+ if (outer) {
+ data.unmarshal.push_back(UnmarshalData(variable, p));
+ }
+ add(blob, p, 4, offset);
+ }
}
+ return ERRCODE_NONE;
+}
-#elif defined(OS2)
- PSZ pp;
- APIRET rc;
- // 1. Ordinal oder mit Parametern:
- rc = DosQueryProcAddr( hLib, nOrd, pp = (char*)rProcName.GetBuffer(), &pProc );
- // 2. nur der Name:
- if( rc )
- rc = DosQueryProcAddr( hLib, 0, pp = (PSZ)buf1, &pProc );
- // 3. der Name mit Underline vorweg:
- if( rc )
- rc = DosQueryProcAddr( hLib, 0, pp = (PSZ)buf2, &pProc );
- if( rc )
- pProc = NULL;
- else
- {
- // 16-bit oder 32-bit?
- ULONG nInfo = 0;
- if( DosQueryProcType( hLib, nOrd, pp, &nInfo ) )
- nInfo = 0;;
- }
-#else
- (void)hLib;
-#endif
- return pProc;
+template< typename T > T read(void const ** pointer) {
+ T const * p = static_cast< T const * >(*pointer);
+ *pointer = static_cast< void const * >(p + 1);
+ return *p;
}
-SbError SbiDllMgr::CallProc( SbiDllProc pProc, SbxArray* pArgs,
- SbxVariable& rResult )
-{
-// ByteString aStr("Calling DLL at ");
-// aStr += (ULONG)pProc;
-// InfoBox( 0, aStr ).Execute();
- INT16 nInt16; int nInt; INT32 nInt32; double nDouble;
- char* pStr;
-
- USHORT nSize;
- char* pStack = (char*)CreateStack( pArgs, nSize );
- switch( rResult.GetType() )
- {
+void const * unmarshal(SbxVariable * variable, void const * data) {
+ OSL_ASSERT(variable != 0);
+ if ((variable->GetType() & SbxARRAY) == 0) {
+ switch (variable->GetType()) {
case SbxINTEGER:
- nInt16 = CallINT(pProc, pStack, (short)nSize );
- rResult.PutInteger( nInt16 );
- break;
-
- case SbxUINT:
- case SbxUSHORT:
- nInt16 = (INT16)CallINT(pProc, pStack, (short)nSize );
- rResult.PutUShort( (USHORT)nInt16 );
- break;
-
- case SbxERROR:
- nInt16 = (INT16)CallINT(pProc, pStack, (short)nSize );
- rResult.PutErr( (USHORT)nInt16 );
- break;
-
- case SbxINT:
- nInt = CallINT(pProc, pStack, (short)nSize );
- rResult.PutInt( nInt );
+ variable->PutInteger(read< sal_Int16 >(&data));
break;
-
case SbxLONG:
- nInt32 = CallLNG(pProc, pStack, (short)nSize );
- rResult.PutLong( nInt32 );
+ variable->PutLong(read< sal_Int32 >(&data));
break;
-
- case SbxULONG:
- nInt32 = CallINT(pProc, pStack, (short)nSize );
- rResult.PutULong( (ULONG)nInt32 );
- break;
-
-#ifndef WNT
case SbxSINGLE:
- {
- float nSingle = CallSNG(pProc, pStack, (short)nSize );
- rResult.PutSingle( nSingle );
+ variable->PutSingle(read< float >(&data));
break;
- }
-#endif
-
case SbxDOUBLE:
-#ifdef WNT
- case SbxSINGLE:
-#endif
- nDouble = CallDBL(pProc, pStack, (short)nSize );
- rResult.PutDouble( nDouble );
+ variable->PutDouble(read< double >(&data));
break;
-
- case SbxDATE:
- nDouble = CallDBL(pProc, pStack, (short)nSize );
- rResult.PutDate( nDouble );
+ case SbxSTRING:
+ read< char * >(&data); // handled by unmarshalString
break;
-
- case SbxCHAR:
- case SbxBYTE:
+ case SbxOBJECT:
+ {
+ data = reinterpret_cast< void const * >(
+ align(
+ reinterpret_cast< sal_uIntPtr >(data),
+ alignment(variable)));
+ SbxArray * props = PTR_CAST(SbxObject, variable->GetObject())->
+ GetProperties();
+ for (USHORT i = 0; i < props->Count(); ++i) {
+ data = unmarshal(props->Get(i), data);
+ }
+ break;
+ }
case SbxBOOL:
- nInt16 = CallINT(pProc, pStack, (short)nSize );
- rResult.PutByte( (BYTE)nInt16 );
- break;
-
- case SbxSTRING:
- case SbxLPSTR:
- pStr = CallSTR(pProc, pStack, (short)nSize );
- rResult.PutString( String::CreateFromAscii( pStr ) );
+ variable->PutBool(read< sal_Bool >(&data));
break;
-
- case SbxNULL:
- case SbxEMPTY:
- nInt16 = CallINT(pProc, pStack, (short)nSize );
- // Rueckgabe nur zulaessig, wenn variant!
- if( !rResult.IsFixed() )
- rResult.PutInteger( nInt16 );
+ case SbxBYTE:
+ variable->PutByte(read< sal_uInt8 >(&data));
break;
-
- case SbxCURRENCY:
- case SbxOBJECT:
- case SbxDATAOBJECT:
default:
- CallINT(pProc, pStack, (short)nSize );
+ OSL_ASSERT(false);
break;
- }
- delete [] pStack;
-
- if( pArgs )
- {
- // die Laengen aller uebergebenen Strings anpassen
- USHORT nCount = pArgs->Count();
- for( USHORT nCur = 1; nCur < nCount; nCur++ )
- {
- SbxVariable* pVar = pArgs->Get( nCur );
- BOOL bIsString = ( pVar->GetType() == SbxSTRING ) ||
- ( pVar->GetType() == SbxLPSTR );
-
- if( pVar->GetFlags() & SBX_REFERENCE )
- {
- pVar->ResetFlag( SBX_REFERENCE ); // Sbx moechte es so
- if( bIsString )
- {
- ByteString aByteStr( (char*)pVar->GetUserData() );
- String aStr( aByteStr, gsl_getSystemTextEncoding() );
- pVar->PutString( aStr );
+ }
+ } else {
+ SbxDimArray * arr = PTR_CAST(SbxDimArray, variable->GetObject());
+ int dims = arr->GetDims();
+ std::vector< INT32 > low(dims);
+ std::vector< INT32 > up(dims);
+ for (int i = 0; i < dims; ++i) {
+ arr->GetDim32(i + 1, low[i], up[i]);
+ }
+ for (std::vector< INT32 > idx = low;;) {
+ data = unmarshal(arr->Get32(&idx[0]), data);
+ int i = dims - 1;
+ while (idx[i] == up[i]) {
+ idx[i] = low[i];
+ if (i == 0) {
+ goto done;
}
+ --i;
}
- if( bIsString )
- {
- delete (char*)(pVar->GetUserData());
- pVar->SetUserData( 0 );
- }
+ ++idx[i];
}
+ done:;
}
- return 0;
+ return data;
}
-SbError SbiDllMgr::CallProcC( SbiDllProc pProc, SbxArray* pArgs,
- SbxVariable& rResult )
-{
- (void)pProc;
- (void)pArgs;
- (void)rResult;
-
- DBG_ERROR("C calling convention not supported");
- return SbERR_BAD_ARGUMENT;
+SbError unmarshalString(StringData const & data, SbxVariable & result) {
+ rtl::OUString str;
+ if (data.buffer != 0) {
+ char const * p = static_cast< char const * >(data.buffer);
+ sal_Int32 len;
+ if (data.special) {
+ len = static_cast< sal_Int32 >(result.GetULong());
+ if (len < 0) { // i.e., DWORD result >= 2^31
+ return ERRCODE_BASIC_BAD_ARGUMENT;
+ //TODO: more specific errcode?
+ }
+ } else {
+ len = rtl_str_getLength(p);
+ }
+ SbError e = convert(p, len, &str);
+ if (e != ERRCODE_NONE) {
+ return e;
+ }
+ }
+ data.variable->PutString(String(str));
+ return ERRCODE_NONE;
}
-void* SbiDllMgr::CreateStack( SbxArray* pArgs, USHORT& rSize )
+struct ProcData {
+ rtl::OString name;
+ FARPROC proc;
+};
+
+SbError call(
+ rtl::OUString const & dll, ProcData const & proc, SbxArray * arguments,
+ SbxVariable & result)
{
- if( !pArgs )
+ std::vector< char > stack;
+ MarshalData data;
+ // For DWORD GetLogicalDriveStringsA(DWORD nBufferLength, LPSTR lpBuffer)
+ // from kernel32, upon return, filled lpBuffer length is result DWORD, which
+ // requires special handling in unmarshalString; other functions might
+ // require similar treatment, too:
+ bool special =
+ dll.equalsIgnoreAsciiCaseAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("KERNEL32.DLL")) &&
+ (proc.name ==
+ rtl::OString(RTL_CONSTASCII_STRINGPARAM("GetLogicalDriveStringsA")));
+ for (USHORT i = 1; i < (arguments == 0 ? 0 : arguments->Count()); ++i) {
+ SbError e = marshal(
+ true, arguments->Get(i), special && i == 2, stack, stack.size(),
+ data);
+ if (e != ERRCODE_NONE) {
+ return e;
+ }
+ align(stack, 4, 0, 0);
+ }
+ switch (result.GetType()) {
+ case SbxEMPTY:
+ DllMgr_call32(proc.proc, address(stack), stack.size());
+ break;
+ case SbxINTEGER:
+ result.PutInteger(
+ static_cast< sal_Int16 >(
+ DllMgr_call32(proc.proc, address(stack), stack.size())));
+ break;
+ case SbxLONG:
+ result.PutLong(
+ static_cast< sal_Int32 >(
+ DllMgr_call32(proc.proc, address(stack), stack.size())));
+ break;
+ case SbxSINGLE:
+ result.PutSingle(
+ static_cast< float >(
+ DllMgr_callFp(proc.proc, address(stack), stack.size())));
+ break;
+ case SbxDOUBLE:
+ result.PutDouble(
+ DllMgr_callFp(proc.proc, address(stack), stack.size()));
+ break;
+ case SbxSTRING:
+ {
+ char const * s1 = reinterpret_cast< char const * >(
+ DllMgr_call32(proc.proc, address(stack), stack.size()));
+ rtl::OUString s2;
+ SbError e = convert(s1, rtl_str_getLength(s1), &s2);
+ if (e != ERRCODE_NONE) {
+ return e;
+ }
+ result.PutString(String(s2));
+ break;
+ }
+ case SbxOBJECT:
+ //TODO
+ DllMgr_call32(proc.proc, address(stack), stack.size());
+ break;
+ case SbxBOOL:
+ result.PutBool(
+ static_cast< sal_Bool >(
+ DllMgr_call32(proc.proc, address(stack), stack.size())));
+ break;
+ case SbxBYTE:
+ result.PutByte(
+ static_cast< sal_uInt8 >(
+ DllMgr_call32(proc.proc, address(stack), stack.size())));
+ break;
+ default:
+ OSL_ASSERT(false);
+ break;
+ }
+ for (USHORT i = 1; i < (arguments == 0 ? 0 : arguments->Count()); ++i) {
+ arguments->Get(i)->ResetFlag(SBX_REFERENCE);
+ //TODO: skipped for errors?!?
+ }
+ for (std::vector< UnmarshalData >::iterator i(data.unmarshal.begin());
+ i != data.unmarshal.end(); ++i)
{
- rSize = 0;
- return 0;
+ unmarshal(i->variable, i->buffer);
}
- char* pStack = new char[ 2048 ];
- char* pTop = pStack;
- USHORT nCount = pArgs->Count();
- // erstes Element ueberspringen
-#ifndef WIN
- for( USHORT nCur = 1; nCur < nCount; nCur++ )
-#else
- // unter 16-Bit Windows anders rum (OS/2 ?????)
- for( USHORT nCur = nCount-1; nCur >= 1; nCur-- )
-#endif
+ for (std::vector< StringData >::iterator i(data.unmarshalStrings.begin());
+ i != data.unmarshalStrings.end(); ++i)
{
- SbxVariable* pVar = pArgs->Get( nCur );
- // AB 22.1.1996, Referenz
- if( pVar->GetFlags() & SBX_REFERENCE ) // Es ist eine Referenz
- {
- switch( pVar->GetType() )
- {
- case SbxINTEGER:
- case SbxUINT:
- case SbxINT:
- case SbxUSHORT:
- case SbxLONG:
- case SbxULONG:
- case SbxSINGLE:
- case SbxDOUBLE:
- case SbxCHAR:
- case SbxBYTE:
- case SbxBOOL:
- *((void**)pTop) = (void*)&(pVar->aData);
- pTop += sizeof( void* );
- break;
-
- case SbxSTRING:
- case SbxLPSTR:
- {
- USHORT nLen = 256;
- ByteString rStr( pVar->GetString(), gsl_getSystemTextEncoding() );
- if( rStr.Len() > 255 )
- nLen = rStr.Len() + 1;
-
- char* pStr = new char[ nLen ];
- strcpy( pStr, rStr.GetBuffer() ); // #100211# - checked
- // ist nicht so sauber, aber wir sparen ein Pointerarray
- DBG_ASSERT(sizeof(UINT32)>=sizeof(char*),"Gleich krachts im Basic");
- pVar->SetUserData( (sal_uIntPtr)pStr );
- *((const char**)pTop) = pStr;
- pTop += sizeof( char* );
- }
- break;
+ SbError e = unmarshalString(*i, result);
+ if (e != ERRCODE_NONE) {
+ return e;
+ }
+ }
+ return ERRCODE_NONE;
+}
- case SbxNULL:
- case SbxEMPTY:
- case SbxERROR:
- case SbxDATE:
- case SbxCURRENCY:
- case SbxOBJECT:
- case SbxDATAOBJECT:
- default:
- break;
+SbError getProcData(HMODULE handle, rtl::OUString const & name, ProcData * proc)
+{
+ OSL_ASSERT(proc != 0);
+ if (name.getLength() != 0 && name[0] == '@') { //TODO: "@" vs. "#"???
+ sal_Int32 n = name.copy(1).toInt32(); //TODO: handle bad input
+ if (n <= 0 || n > 0xFFFF) {
+ return ERRCODE_BASIC_BAD_ARGUMENT; //TODO: more specific errcode?
+ }
+ FARPROC p = GetProcAddress(handle, reinterpret_cast< LPCSTR >(n));
+ if (p != 0) {
+ proc->name = rtl::OString(RTL_CONSTASCII_STRINGPARAM("#")) +
+ rtl::OString::valueOf(n);
+ proc->proc = p;
+ return ERRCODE_NONE;
+ }
+ } else {
+ rtl::OString name8;
+ SbError e = convert(name, &name8);
+ if (e != ERRCODE_NONE) {
+ return e;
+ }
+ FARPROC p = GetProcAddress(handle, name8.getStr());
+ if (p != 0) {
+ proc->name = name8;
+ proc->proc = p;
+ return ERRCODE_NONE;
+ }
+ sal_Int32 i = name8.indexOf('#');
+ if (i != -1) {
+ name8 = name8.copy(0, i);
+ p = GetProcAddress(handle, name8.getStr());
+ if (p != 0) {
+ proc->name = name8;
+ proc->proc = p;
+ return ERRCODE_NONE;
}
}
- else
- {
- // ByVal
- switch( pVar->GetType() )
- {
- case SbxINTEGER:
- case SbxUINT:
- case SbxINT:
- case SbxUSHORT:
- *((INT16*)pTop) = pVar->GetInteger();
- pTop += sizeof( INT16 );
- break;
+ rtl::OString real(
+ rtl::OString(RTL_CONSTASCII_STRINGPARAM("_")) + name8);
+ p = GetProcAddress(handle, real.getStr());
+ if (p != 0) {
+ proc->name = real;
+ proc->proc = p;
+ return ERRCODE_NONE;
+ }
+ real = name8 + rtl::OString(RTL_CONSTASCII_STRINGPARAM("A"));
+ p = GetProcAddress(handle, real.getStr());
+ if (p != 0) {
+ proc->name = real;
+ proc->proc = p;
+ return ERRCODE_NONE;
+ }
+ }
+ return ERRCODE_BASIC_PROC_UNDEFINED;
+}
- case SbxLONG:
- case SbxULONG:
- *((INT32*)pTop) = pVar->GetLong();
- pTop += sizeof( INT32 );
- break;
+struct Dll: public salhelper::SimpleReferenceObject {
+private:
+ typedef std::map< rtl::OUString, ProcData > Procs;
- case SbxSINGLE:
- *((float*)pTop) = pVar->GetSingle();
- pTop += sizeof( float );
- break;
+ virtual ~Dll();
- case SbxDOUBLE:
- *((double*)pTop) = pVar->GetDouble();
- pTop += sizeof( double );
- break;
+public:
+ Dll(): handle(0) {}
- case SbxSTRING:
- case SbxLPSTR:
- {
- char* pStr = new char[ pVar->GetString().Len() + 1 ];
- ByteString aByteStr( pVar->GetString(), gsl_getSystemTextEncoding() );
- strcpy( pStr, aByteStr.GetBuffer() ); // #100211# - checked
- // ist nicht so sauber, aber wir sparen ein Pointerarray
- DBG_ASSERT(sizeof(UINT32)>=sizeof(char*),"Gleich krachts im Basic");
- pVar->SetUserData( (sal_uIntPtr)pStr );
- *((const char**)pTop) = pStr;
- pTop += sizeof( char* );
- }
- break;
+ SbError getProc(rtl::OUString const & name, ProcData * proc);
- case SbxCHAR:
- case SbxBYTE:
- case SbxBOOL:
- *((BYTE*)pTop) = pVar->GetByte();
- pTop += sizeof( BYTE );
- break;
+ HMODULE handle;
+ Procs procs;
+};
- case SbxNULL:
- case SbxEMPTY:
- case SbxERROR:
- case SbxDATE:
- case SbxCURRENCY:
- case SbxOBJECT:
- case SbxDATAOBJECT:
- default:
- break;
- }
+Dll::~Dll() {
+ if (handle != 0 && !FreeLibrary(handle)) {
+ OSL_TRACE("FreeLibrary(%p) failed with %u", handle, GetLastError());
+ }
+}
+
+SbError Dll::getProc(rtl::OUString const & name, ProcData * proc) {
+ Procs::iterator i(procs.find(name));
+ if (i != procs.end()) {
+ *proc = i->second;
+ return ERRCODE_NONE;
+ }
+ SbError e = getProcData(handle, name, proc);
+ if (e == ERRCODE_NONE) {
+ procs.insert(Procs::value_type(name, *proc));
+ }
+ return e;
+}
+
+rtl::OUString fullDllName(rtl::OUString const & name) {
+ rtl::OUString full(name);
+ if (full.indexOf('.') == -1) {
+ full += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".DLL"));
+ }
+ return full;
+}
+
+}
+
+struct SbiDllMgr::Impl: private boost::noncopyable {
+private:
+ typedef std::map< rtl::OUString, rtl::Reference< Dll > > Dlls;
+
+public:
+ Dll * getDll(rtl::OUString const & name);
+
+ Dlls dlls;
+};
+
+Dll * SbiDllMgr::Impl::getDll(rtl::OUString const & name) {
+ Dlls::iterator i(dlls.find(name));
+ if (i == dlls.end()) {
+ i = dlls.insert(Dlls::value_type(name, new Dll)).first;
+ HMODULE h = LoadLibraryW(name);
+ if (h == 0) {
+ dlls.erase(i);
+ return 0;
}
+ i->second->handle = h;
}
- rSize = (USHORT)((ULONG)pTop - (ULONG)pStack);
- return pStack;
+ return i->second.get();
}
+SbError SbiDllMgr::Call(
+ rtl::OUString const & function, rtl::OUString const & library,
+ SbxArray * arguments, SbxVariable & result, bool cdeclConvention)
+{
+ if (cdeclConvention) {
+ return ERRCODE_BASIC_NOT_IMPLEMENTED;
+ }
+ rtl::OUString dllName(fullDllName(library));
+ Dll * dll = impl_->getDll(dllName);
+ if (dll == 0) {
+ return ERRCODE_BASIC_BAD_DLL_LOAD;
+ }
+ ProcData proc;
+ SbError e = dll->getProc(function, &proc);
+ if (e != ERRCODE_NONE) {
+ return e;
+ }
+ return call(dllName, proc, arguments, result);
+}
+
+void SbiDllMgr::FreeDll(rtl::OUString const & library) {
+ impl_->dlls.erase(library);
+}
+#else
+
+struct SbiDllMgr::Impl {};
+
+SbError SbiDllMgr::Call(
+ rtl::OUString const &, rtl::OUString const &, SbxArray *, SbxVariable &,
+ bool)
+{
+ return ERRCODE_BASIC_NOT_IMPLEMENTED;
+}
+
+void SbiDllMgr::FreeDll(rtl::OUString const &) {}
+
+#endif
+SbiDllMgr::SbiDllMgr(): impl_(new Impl) {}
+SbiDllMgr::~SbiDllMgr() {}
diff --git a/basic/source/runtime/dllmgr.hxx b/basic/source/runtime/dllmgr.hxx
index 2c71a2843c37..fdff8c2849be 100644
--- a/basic/source/runtime/dllmgr.hxx
+++ b/basic/source/runtime/dllmgr.hxx
@@ -25,71 +25,36 @@
*
************************************************************************/
-#ifndef _DLLMGR_HXX
-#define _DLLMGR_HXX
+#ifndef INCLUDED_BASIC_SOURCE_RUNTIME_DLLMGR_HXX
+#define INCLUDED_BASIC_SOURCE_RUNTIME_DLLMGR_HXX
-#define _SVSTDARR_BYTESTRINGSSORT
-#include <svl/svarray.hxx>
-#ifndef _SVSTDARR_HXX //autogen
-#include <svl/svstdarr.hxx>
-#endif
+#include "sal/config.h"
-// !!! nur zum debuggen fuer infoboxes !!!
-//#ifndef _SV_HXX
-//#include <sv.hxx>
-//#endif
+#include <memory>
-//#ifndef _TOOLS_HXX
-//#include <tools.hxx>
-//#endif
-#define _SVSTDARR_STRINGS
-//#ifndef _SVSTDARR_HXX
-//#include <svstdarr.hxx>
-//#endif
-#ifndef _SBERRORS_HXX
-#include <basic/sberrors.hxx>
-#endif
+#include "basic/sberrors.hxx"
+#include "boost/noncopyable.hpp"
+namespace rtl { class OUString; }
class SbxArray;
class SbxVariable;
-class ImplSbiDll;
-class ImplSbiProc;
-
-SV_DECL_PTRARR_SORT(ImplDllArr,ByteStringPtr,5,5)
-
-class SbiDllMgr
-{
- ImplDllArr aDllArr;
-
- SbiDllMgr( const SbiDllMgr& );
+class SbiDllMgr: private boost::noncopyable {
+public:
+ SbiDllMgr();
-#ifdef _DLLMGR_CXX
- ImplSbiDll* GetDll( const ByteString& rDllName );
- SbiDllProc GetProc( ImplSbiDll*, const ByteString& rProcName );
+ ~SbiDllMgr();
- SbiDllHandle CreateDllHandle( const ByteString& rDllName );
- void FreeDllHandle( SbiDllHandle );
- SbiDllProc GetProcAddr( SbiDllHandle, const ByteString& pProcName );
- SbError CallProc( SbiDllProc pProc, SbxArray* pArgs,
- SbxVariable& rResult );
- SbError CallProcC( SbiDllProc pProc, SbxArray* pArgs,
- SbxVariable& rResult );
- void* CreateStack( SbxArray* pArgs, USHORT& rSize );
- void CheckDllName( ByteString& rName );
-#endif
+ SbError Call(
+ rtl::OUString const & function, rtl::OUString const & library,
+ SbxArray * arguments, SbxVariable & result, bool cdeclConvention);
-public:
- SbiDllMgr();
- ~SbiDllMgr();
+ void FreeDll(rtl::OUString const & library);
- SbError Call( const char* pFunc, const char* pDll,
- SbxArray* pArgs, SbxVariable& rResult,
- BOOL bCDecl );
+private:
+ struct Impl;
- void FreeDll( const ByteString& rDllName );
+ std::auto_ptr< Impl > impl_;
};
-
-
#endif
diff --git a/basic/source/runtime/makefile.mk b/basic/source/runtime/makefile.mk
index c0b4bd3bdc10..f2ed11196b28 100644
--- a/basic/source/runtime/makefile.mk
+++ b/basic/source/runtime/makefile.mk
@@ -30,6 +30,8 @@ PRJ=..$/..
PRJNAME=basic
TARGET=runtime
+ENABLE_EXCEPTIONS = TRUE
+
# --- Settings -----------------------------------------------------------
.INCLUDE : settings.mk
@@ -53,37 +55,17 @@ SLOFILES= \
$(SLO)$/ddectrl.obj \
$(SLO)$/dllmgr.obj
-.IF "$(GUI)$(CPU)" == "WINI"
-SLOFILES+= $(SLO)$/win.obj
-.ENDIF
-
.IF "$(GUI)$(COM)$(CPU)" == "WNTMSCI"
SLOFILES+= $(SLO)$/wnt.obj
-.ENDIF
-
-.IF "$(GUI)$(COM)$(CPU)" == "WNTGCCI"
+.ELIF "$(GUI)$(COM)$(CPU)" == "WNTGCCI"
SLOFILES+= $(SLO)$/wnt-mingw.obj
.ENDIF
-.IF "$(GUI)$(CPU)" == "OS2I"
-#FIXME SLOFILES+= $(SLO)$/os2.obj
-.ENDIF
-
-EXCEPTIONSFILES=$(SLO)$/step0.obj \
- $(SLO)$/step2.obj \
- $(SLO)$/methods.obj \
- $(SLO)$/methods1.obj \
- $(SLO)$/iosys.obj \
- $(SLO)$/runtime.obj
-
# --- Targets -------------------------------------------------------------
.INCLUDE : target.mk
$(SLO)$/%.obj: %.s
#kendy: Cut'n'paste from bridges/source/cpp_uno/mingw_intel/makefile.mk
-#cmc: Ideally --noexecstack would be in operations, but with #i51385# pyuno
-#remote bridgeing breaks
-# $(CC) -Wa,--noexecstack -c -o $(SLO)$/$(@:b).o $<
$(CC) -c -o $(SLO)$/$(@:b).obj $<
touch $@
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 9a21e488d4aa..36fbda5c9097 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -61,6 +61,7 @@
#else
#include <osl/file.hxx>
#endif
+#include "errobject.hxx"
#ifdef _USE_UNO
#include <comphelper/processfactory.hxx>
@@ -120,6 +121,8 @@ using namespace com::sun::star::io;
#include <io.h>
#endif
+#include <basic/sbobjmod.hxx>
+
static void FilterWhiteSpace( String& rStr )
{
rStr.EraseAllChars( ' ' );
@@ -205,15 +208,15 @@ String implGetCurDir( void )
}
// TODO: -> SbiGlobals
-static Reference< XSimpleFileAccess3 > getFileAccess( void )
+static com::sun::star::uno::Reference< XSimpleFileAccess3 > getFileAccess( void )
{
- static Reference< XSimpleFileAccess3 > xSFI;
+ static com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI;
if( !xSFI.is() )
{
- Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory();
+ com::sun::star::uno::Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory();
if( xSMgr.is() )
{
- xSFI = Reference< XSimpleFileAccess3 >( xSMgr->createInstance
+ xSFI = com::sun::star::uno::Reference< XSimpleFileAccess3 >( xSMgr->createInstance
( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY );
}
}
@@ -256,6 +259,7 @@ RTLFUNC(Error)
{
String aErrorMsg;
SbError nErr = 0L;
+ INT32 nCode = 0;
if( rPar.Count() == 1 )
{
nErr = StarBASIC::GetErrBasic();
@@ -263,14 +267,34 @@ RTLFUNC(Error)
}
else
{
- INT32 nCode = rPar.Get( 1 )->GetLong();
+ nCode = rPar.Get( 1 )->GetLong();
if( nCode > 65535L )
StarBASIC::Error( SbERR_CONVERSION );
else
nErr = StarBASIC::GetSfxFromVBError( (USHORT)nCode );
}
- pBasic->MakeErrorText( nErr, aErrorMsg );
- rPar.Get( 0 )->PutString( pBasic->GetErrorText() );
+
+ bool bVBA = SbiRuntime::isVBAEnabled();
+ String tmpErrMsg;
+ if( bVBA && aErrorMsg.Len() > 0 )
+ {
+ tmpErrMsg = aErrorMsg;
+ }
+ else
+ {
+ pBasic->MakeErrorText( nErr, aErrorMsg );
+ tmpErrMsg = pBasic->GetErrorText();
+ }
+ // If this rtlfunc 'Error' passed a errcode the same as the active Err Objects's
+ // current err then return the description for the error message if it is set
+ // ( complicated isn't it ? )
+ if ( bVBA && rPar.Count() > 1 )
+ {
+ com::sun::star::uno::Reference< ooo::vba::XErrObject > xErrObj( SbxErrObject::getUnoErrObject() );
+ if ( xErrObj.is() && xErrObj->getNumber() == nCode && xErrObj->getDescription().getLength() )
+ tmpErrMsg = xErrObj->getDescription();
+ }
+ rPar.Get( 0 )->PutString( tmpErrMsg );
}
}
@@ -531,7 +555,7 @@ RTLFUNC(ChDrive) // JSM
// Implementation of StepRENAME with UCB
void implStepRenameUCB( const String& aSource, const String& aDest )
{
- Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
+ com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() )
{
try
@@ -579,7 +603,7 @@ RTLFUNC(FileCopy) // JSM
// <-- UCB
if( hasUno() )
{
- Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
+ com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() )
{
try
@@ -630,7 +654,7 @@ RTLFUNC(Kill) // JSM
// <-- UCB
if( hasUno() )
{
- Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
+ com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() )
{
String aFullPath = getFullPath( aFileSpec );
@@ -677,7 +701,7 @@ RTLFUNC(MkDir) // JSM
// <-- UCB
if( hasUno() )
{
- Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
+ com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() )
{
try
@@ -778,7 +802,7 @@ RTLFUNC(RmDir) // JSM
// <-- UCB
if( hasUno() )
{
- Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
+ com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() )
{
try
@@ -865,7 +889,7 @@ RTLFUNC(FileLen)
// <-- UCB
if( hasUno() )
{
- Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
+ com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() )
{
try
@@ -1613,7 +1637,7 @@ RTLFUNC(StrComp)
::utl::TransliterationWrapper* pTransliterationWrapper = GetSbData()->pTransliterationWrapper;
if( !pTransliterationWrapper )
{
- Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory();
+ com::sun::star::uno::Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory();
pTransliterationWrapper = GetSbData()->pTransliterationWrapper =
new ::utl::TransliterationWrapper( xSMgr,
::com::sun::star::i18n::TransliterationModules_IGNORE_CASE |
@@ -2608,7 +2632,7 @@ RTLFUNC(Dir)
// <-- UCB
if( hasUno() )
{
- Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
+ com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() )
{
if ( nParCount >= 2 )
@@ -2971,7 +2995,7 @@ RTLFUNC(GetAttr)
// <-- UCB
if( hasUno() )
{
- Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
+ com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() )
{
try
@@ -3041,7 +3065,7 @@ RTLFUNC(FileDateTime)
Date aDate;
if( hasUno() )
{
- Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
+ com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() )
{
try
@@ -4006,7 +4030,7 @@ RTLFUNC(StrConv)
String aNewStr( aOldStr );
if( nType != 0 )
{
- Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory();
+ com::sun::star::uno::Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory();
::utl::TransliterationWrapper aTransliterationWrapper( xSMgr,nType );
com::sun::star::uno::Sequence<sal_Int32> aOffsets;
aTransliterationWrapper.loadModuleIfNeeded( nLanguage );
@@ -4106,12 +4130,20 @@ RTLFUNC(Load)
// Diesen Call einfach an das Object weiterreichen
SbxBase* pObj = (SbxObject*)rPar.Get(1)->GetObject();
- if( pObj && pObj->IsA( TYPE( SbxObject ) ) )
+ if ( pObj )
{
- SbxVariable* pVar = ((SbxObject*)pObj)->
- Find( String( RTL_CONSTASCII_USTRINGPARAM("Load") ), SbxCLASS_METHOD );
- if( pVar )
- pVar->GetInteger();
+ if( pObj->IsA( TYPE( SbUserFormModule ) ) )
+ {
+ SbUserFormModule* pFormModule = ( SbUserFormModule* )pObj;
+ pFormModule->load();
+ }
+ else if( pObj->IsA( TYPE( SbxObject ) ) )
+ {
+ SbxVariable* pVar = ((SbxObject*)pObj)->
+ Find( String( RTL_CONSTASCII_USTRINGPARAM("Load") ), SbxCLASS_METHOD );
+ if( pVar )
+ pVar->GetInteger();
+ }
}
}
@@ -4129,12 +4161,20 @@ RTLFUNC(Unload)
// Diesen Call einfach an das Object weitereichen
SbxBase* pObj = (SbxObject*)rPar.Get(1)->GetObject();
- if( pObj && pObj->IsA( TYPE( SbxObject ) ) )
+ if ( pObj )
{
- SbxVariable* pVar = ((SbxObject*)pObj)->
- Find( String( RTL_CONSTASCII_USTRINGPARAM("Unload") ), SbxCLASS_METHOD );
- if( pVar )
- pVar->GetInteger();
+ if( pObj->IsA( TYPE( SbUserFormModule ) ) )
+ {
+ SbUserFormModule* pFormModule = ( SbUserFormModule* )pObj;
+ pFormModule->Unload();
+ }
+ else if( pObj->IsA( TYPE( SbxObject ) ) )
+ {
+ SbxVariable* pVar = ((SbxObject*)pObj)->
+ Find( String( RTL_CONSTASCII_USTRINGPARAM("Unload") ), SbxCLASS_METHOD );
+ if( pVar )
+ pVar->GetInteger();
+ }
}
}
@@ -4318,7 +4358,7 @@ RTLFUNC(SetAttr) // JSM
// <-- UCB
if( hasUno() )
{
- Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
+ com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() )
{
try
@@ -4432,7 +4472,7 @@ RTLFUNC(FileExists)
// <-- UCB
if( hasUno() )
{
- Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
+ com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() )
{
try
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index e0501e5c0d94..8c7da2403705 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -61,6 +61,7 @@
#endif
#include <vcl/jobset.hxx>
+#include <basic/sbobjmod.hxx>
#include "sbintern.hxx"
#include "runtime.hxx"
@@ -522,6 +523,18 @@ RTLFUNC(WaitUntil)
Wait_Impl( true, rPar );
}
+RTLFUNC(DoEvents)
+{
+ (void)pBasic;
+ (void)bWrite;
+ (void)rPar;
+ Timer aTimer;
+ aTimer.SetTimeout( 1 );
+ aTimer.Start();
+ while ( aTimer.IsActive() )
+ Application::Yield();
+}
+
RTLFUNC(GetGUIVersion)
{
(void)pBasic;
@@ -621,8 +634,7 @@ RTLFUNC(FreeLibrary)
if ( rPar.Count() != 2 )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
- ByteString aByteDLLName( rPar.Get(1)->GetString(), gsl_getSystemTextEncoding() );
- pINST->GetDllMgr()->FreeDll( aByteDLLName );
+ pINST->GetDllMgr()->FreeDll( rPar.Get(1)->GetString() );
}
bool IsBaseIndexOne()
{
@@ -2594,14 +2606,16 @@ RTLFUNC(Me)
SbModule* pActiveModule = pINST->GetActiveModule();
SbClassModuleObject* pClassModuleObject = PTR_CAST(SbClassModuleObject,pActiveModule);
+ SbxVariableRef refVar = rPar.Get(0);
if( pClassModuleObject == NULL )
{
- StarBASIC::Error( SbERR_INVALID_USAGE_OBJECT );
+ SbObjModule* pMod = PTR_CAST(SbObjModule,pActiveModule);
+ if ( pMod )
+ refVar->PutObject( pMod );
+ else
+ StarBASIC::Error( SbERR_INVALID_USAGE_OBJECT );
}
else
- {
- SbxVariableRef refVar = rPar.Get(0);
refVar->PutObject( pClassModuleObject );
- }
}
diff --git a/basic/source/runtime/os2.asm b/basic/source/runtime/os2.asm
deleted file mode 100644
index a56f0b74b89e..000000000000
--- a/basic/source/runtime/os2.asm
+++ /dev/null
@@ -1,103 +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.
-;
-;*************************************************************************
-
-; Anmerkungen
-; Direktaufruf von C- und PASCAL-Routinen, OS/2
-;
-; Inhalt:
-; type = CallXXX (far *proc, char *stack, short nstack)
-;
-; Kopie des Basic-Stacks (nstack Bytes) auf den C-Stack
-; und Aufruf der Prozedur.
-
- .386
- .MODEL FLAT
-
- .CODE
-
- PUBLIC CallINT
- PUBLIC CallLNG
- PUBLIC CallSNG
- PUBLIC CallDBL
- PUBLIC CallSTR
- PUBLIC CallFIX
-
- PUBLIC _CallINT
- PUBLIC _CallLNG
- PUBLIC _CallSNG
- PUBLIC _CallDBL
- PUBLIC _CallSTR
- PUBLIC _CallFIX
-
-_CallINT LABEL byte
-_CallLNG LABEL byte
-_CallSNG LABEL byte
-_CallDBL LABEL byte
-_CallSTR LABEL byte
-_CallFIX LABEL byte
-
-CallINT LABEL byte
-CallLNG LABEL byte
-CallSNG LABEL byte
-CallDBL LABEL byte
-CallSTR LABEL byte
-CallFIX PROC
-
-p EQU [EBP+8]
-stk EQU [EBP+12]
-n EQU [EBP+16]
-
- PUSH EBP
- MOV EBP,ESP
- PUSH ESI
- PUSH EDI
- MOV DX,DS
- MOVZX ECX,word ptr [n]
- SUB ESP,ECX
- MOV EDI,ESP
- MOV AX,SS
- MOV ES,AX
- MOV ESI,[stk]
- SHR ECX,1
- CLD
- JCXZ $1
- REP MOVSW ; Stack uebernehmen
-$1: MOV DS,DX
- CALL LARGE [p] ; 32-bit
- MOV ECX,EBP
- SUB ECX,8 ; wegen gepushter Register
- MOV ESP,ECX
- POP EDI
- POP ESI
- POP EBP
-; Bei Borland C++ Calling Convention:
-; RET 12
-; CSet System-Calling Convention
- RET
-CallFIX ENDP
-
- END
diff --git a/basic/source/runtime/props.cxx b/basic/source/runtime/props.cxx
index 9b4b35f551e2..cec74444e7a2 100644
--- a/basic/source/runtime/props.cxx
+++ b/basic/source/runtime/props.cxx
@@ -31,6 +31,7 @@
#include "runtime.hxx"
#include "stdobj.hxx"
#include "rtlproto.hxx"
+#include "errobject.hxx"
// Properties und Methoden legen beim Get (bWrite = FALSE) den Returnwert
@@ -50,14 +51,21 @@ RTLFUNC(Err)
(void)pBasic;
(void)bWrite;
- if( bWrite )
+ if( SbiRuntime::isVBAEnabled() )
{
- INT32 nVal = rPar.Get( 0 )->GetLong();
- if( nVal <= 65535L )
- StarBASIC::Error( StarBASIC::GetSfxFromVBError( (USHORT) nVal ) );
+ rPar.Get( 0 )->PutObject( SbxErrObject::getErrObject() );
}
else
- rPar.Get( 0 )->PutLong( StarBASIC::GetVBErrorCode( StarBASIC::GetErrBasic() ) );
+ {
+ if( bWrite )
+ {
+ INT32 nVal = rPar.Get( 0 )->GetLong();
+ if( nVal <= 65535L )
+ StarBASIC::Error( StarBASIC::GetSfxFromVBError( (USHORT) nVal ) );
+ }
+ else
+ rPar.Get( 0 )->PutLong( StarBASIC::GetVBErrorCode( StarBASIC::GetErrBasic() ) );
+ }
}
RTLFUNC(False)
diff --git a/basic/source/runtime/rtlproto.hxx b/basic/source/runtime/rtlproto.hxx
index 6c90c408cd93..1a1ae4f32283 100644
--- a/basic/source/runtime/rtlproto.hxx
+++ b/basic/source/runtime/rtlproto.hxx
@@ -166,6 +166,7 @@ extern RTLFUNC(RmDir); // JSM
extern RTLFUNC(SendKeys); // JSM
extern RTLFUNC(DimArray);
extern RTLFUNC(Dir);
+extern RTLFUNC(DoEvents);
extern RTLFUNC(Exp);
extern RTLFUNC(FileLen);
extern RTLFUNC(Fix);
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 52aa76e2f2df..c3419adbfdb3 100644..100755
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -43,13 +43,16 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include "sbunoobj.hxx"
+#include "errobject.hxx"
+
+using namespace ::com::sun::star;
bool SbiRuntime::isVBAEnabled()
{
bool result = false;
SbiInstance* pInst = pINST;
if ( pInst && pINST->pRun )
- result = pInst->pRun->GetImageFlag( SBIMG_VBASUPPORT );
+ result = pInst->pRun->bVBAEnabled;
return result;
}
@@ -60,6 +63,24 @@ void StarBASIC::StaticEnableReschedule( BOOL bReschedule )
{
bStaticGlobalEnableReschedule = bReschedule;
}
+void StarBASIC::SetVBAEnabled( BOOL bEnabled )
+{
+ if ( bDocBasic )
+ {
+ bVBAEnabled = bEnabled;
+ }
+}
+
+BOOL StarBASIC::isVBAEnabled()
+{
+ if ( bDocBasic )
+ {
+ if( SbiRuntime::isVBAEnabled() )
+ return TRUE;
+ return bVBAEnabled;
+ }
+ return FALSE;
+}
struct SbiArgvStack { // Argv stack:
@@ -134,6 +155,7 @@ SbiRuntime::pStep0 SbiRuntime::aStep0[] = { // Alle Opcodes ohne Operanden
&SbiRuntime::StepVBASET,// vba-like set statement
&SbiRuntime::StepERASE_CLEAR,// vba-like set statement
&SbiRuntime::StepARRAYACCESS,// access TOS as array
+ &SbiRuntime::StepBYVAL, // access TOS as array
};
SbiRuntime::pStep1 SbiRuntime::aStep1[] = { // Alle Opcodes mit einem Operanden
@@ -422,6 +444,35 @@ void SbiInstance::Error( SbError n, const String& rMsg )
}
}
+void SbiInstance::ErrorVB( sal_Int32 nVBNumber, const String& rMsg )
+{
+ if( !bWatchMode )
+ {
+ SbError n = StarBASIC::GetSfxFromVBError( static_cast< USHORT >( nVBNumber ) );
+ if ( !n )
+ n = nVBNumber; // force orig number, probably should have a specific table of vb ( localized ) errors
+
+ aErrorMsg = rMsg;
+ SbiRuntime::translateErrorToVba( n, aErrorMsg );
+
+ bool bVBATranslationAlreadyDone = true;
+ pRun->Error( SbERR_BASIC_COMPAT, bVBATranslationAlreadyDone );
+ }
+}
+
+void SbiInstance::setErrorVB( sal_Int32 nVBNumber, const String& rMsg )
+{
+ SbError n = StarBASIC::GetSfxFromVBError( static_cast< USHORT >( nVBNumber ) );
+ if( !n )
+ n = nVBNumber; // force orig number, probably should have a specific table of vb ( localized ) errors
+
+ aErrorMsg = rMsg;
+ SbiRuntime::translateErrorToVba( n, aErrorMsg );
+
+ nErr = n;
+}
+
+
void SbiInstance::FatalError( SbError n )
{
pRun->FatalError( n );
@@ -520,6 +571,7 @@ SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, UINT32 nStart )
nForLvl = 0;
nOps = 0;
refExprStk = new SbxArray;
+ SetVBAEnabled( pMod->IsVBACompat() );
#if defined GCC
SetParameters( pe ? pe->GetParameters() : (class SbxArray *)NULL );
#else
@@ -527,7 +579,6 @@ SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, UINT32 nStart )
#endif
pRefSaveList = NULL;
pItemStoreList = NULL;
- bVBAEnabled = isVBAEnabled();
}
SbiRuntime::~SbiRuntime()
@@ -546,6 +597,11 @@ SbiRuntime::~SbiRuntime()
}
}
+void SbiRuntime::SetVBAEnabled(bool bEnabled )
+{
+ bVBAEnabled = bEnabled;
+}
+
// Aufbau der Parameterliste. Alle ByRef-Parameter werden direkt
// uebernommen; von ByVal-Parametern werden Kopien angelegt. Falls
// ein bestimmter Datentyp verlangt wird, wird konvertiert.
@@ -791,10 +847,24 @@ BOOL SbiRuntime::Step()
return bRun;
}
-void SbiRuntime::Error( SbError n )
+void SbiRuntime::Error( SbError n, bool bVBATranslationAlreadyDone )
{
if( n )
+ {
nError = n;
+ if( isVBAEnabled() && !bVBATranslationAlreadyDone )
+ {
+ String aMsg = pInst->GetErrorMsg();
+ sal_Int32 nVBAErrorNumber = translateErrorToVba( nError, aMsg );
+ SbxVariable* pSbxErrObjVar = SbxErrObject::getErrObject();
+ SbxErrObject* pGlobErr = static_cast< SbxErrObject* >( pSbxErrObjVar );
+ if( pGlobErr != NULL )
+ pGlobErr->setNumberAndDescription( nVBAErrorNumber, aMsg );
+
+ pInst->aErrorMsg = aMsg;
+ nError = SbERR_BASIC_COMPAT;
+ }
+ }
}
void SbiRuntime::Error( SbError _errCode, const String& _details )
@@ -826,6 +896,32 @@ void SbiRuntime::FatalError( SbError _errCode, const String& _details )
Error( _errCode, _details );
}
+sal_Int32 SbiRuntime::translateErrorToVba( SbError nError, String& rMsg )
+{
+ // If a message is defined use that ( in preference to
+ // the defined one for the error ) NB #TODO
+ // if there is an error defined it more than likely
+ // is not the one you want ( some are the same though )
+ // we really need a new vba compatible error list
+ if ( !rMsg.Len() )
+ {
+ // TEST, has to be vb here always
+#ifdef DBG_UTIL
+ SbError nTmp = StarBASIC::GetSfxFromVBError( (USHORT)nError );
+ DBG_ASSERT( nTmp, "No VB error!" );
+#endif
+
+ StarBASIC::MakeErrorText( nError, rMsg );
+ rMsg = StarBASIC::GetErrorText();
+ if ( !rMsg.Len() ) // no message for err no, need localized resource here
+ rMsg = String( RTL_CONSTASCII_USTRINGPARAM("Internal Object Error:") );
+ }
+ // no num? most likely then it *is* really a vba err
+ USHORT nVBErrorCode = StarBASIC::GetVBErrorCode( nError );
+ sal_Int32 nVBAErrorNumber = ( nVBErrorCode == 0 ) ? nError : nVBErrorCode;
+ return nVBAErrorNumber;
+}
+
//////////////////////////////////////////////////////////////////////////
//
// Parameter, Locals, Caller
@@ -1136,9 +1232,7 @@ void SbiRuntime::DllCall
SbxVariable* pRes = new SbxVariable( eResType );
SbiDllMgr* pDllMgr = pInst->GetDllMgr();
- ByteString aByteFuncName( aFuncName, gsl_getSystemTextEncoding() );
- ByteString aByteDLLName( aDLLName, gsl_getSystemTextEncoding() );
- SbError nErr = pDllMgr->Call( aByteFuncName.GetBuffer(), aByteDLLName.GetBuffer(), pArgs, *pRes, bCDecl );
+ SbError nErr = pDllMgr->Call( aFuncName, aDLLName, pArgs, *pRes, bCDecl );
if( nErr )
Error( nErr );
PushVar( pRes );
diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx
index c0b4ffa3cd59..60d2e9cf448d 100644
--- a/basic/source/runtime/stdobj.cxx
+++ b/basic/source/runtime/stdobj.cxx
@@ -216,6 +216,7 @@ static Methods aMethods[] = {
{ "Dir", SbxSTRING, 2 | _FUNCTION, RTLNAME(Dir),0 },
{ "FileSpec", SbxSTRING, _OPT, NULL,0 },
{ "attrmask", SbxINTEGER, _OPT, NULL,0 },
+{ "DoEvents", SbxEMPTY, _FUNCTION, RTLNAME(DoEvents),0 },
{ "DumpAllObjects", SbxEMPTY, 2 | _SUB, RTLNAME(DumpAllObjects),0 },
{ "FileSpec", SbxSTRING, 0,NULL,0 },
{ "DumpAll", SbxINTEGER, _OPT, NULL,0 },
@@ -230,7 +231,7 @@ static Methods aMethods[] = {
{ "EOF", SbxBOOL, 1 | _FUNCTION, RTLNAME(EOF),0 },
{ "Channel", SbxINTEGER, 0,NULL,0 },
{ "Erl", SbxLONG, _ROPROP, RTLNAME( Erl ),0 },
-{ "Err", SbxLONG, _RWPROP, RTLNAME( Err ),0 },
+{ "Err", SbxVARIANT, _RWPROP, RTLNAME( Err ),0 },
{ "Error", SbxSTRING, 1 | _FUNCTION, RTLNAME( Error ),0 },
{ "code", SbxLONG, 0,NULL,0 },
{ "Exp", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Exp),0 },
@@ -361,6 +362,8 @@ static Methods aMethods[] = {
{ "Count", SbxLONG, 0,NULL,0 },
{ "Len", SbxLONG, 1 | _FUNCTION, RTLNAME(Len),0 },
{ "StringOrVariant", SbxVARIANT, 0,NULL,0 },
+{ "LenB", SbxLONG, 1 | _FUNCTION, RTLNAME(Len),0 },
+ { "StringOrVariant", SbxVARIANT, 0,NULL,0 },
{ "Load", SbxNULL, 1 | _FUNCTION, RTLNAME(Load),0 },
{ "object", SbxOBJECT, 0,NULL,0 },
{ "LoadPicture", SbxOBJECT, 1 | _FUNCTION, RTLNAME(LoadPicture),0 },
@@ -628,6 +631,10 @@ SbiStdObject::SbiStdObject( const String& r, StarBASIC* pb ) : SbxObject( r )
p += ( p->nArgs & _ARGSMASK ) + 1;
}
+ // #i92642: Remove default properties
+ Remove( XubString( RTL_CONSTASCII_USTRINGPARAM("Name") ), SbxCLASS_DONTCARE );
+ Remove( XubString( RTL_CONSTASCII_USTRINGPARAM("Parent") ), SbxCLASS_DONTCARE );
+
SetParent( pb );
pStdFactory = new SbStdFactory;
diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx
index 33df854a4499..1d9333ff7555 100644
--- a/basic/source/runtime/step0.cxx
+++ b/basic/source/runtime/step0.cxx
@@ -30,6 +30,7 @@
#include <vcl/msgbox.hxx>
#include <tools/fsys.hxx>
+#include "errobject.hxx"
#include "runtime.hxx"
#include "sbintern.hxx"
#include "iosys.hxx"
@@ -42,6 +43,9 @@
#include <vcl/svapp.hxx>
#include <unotools/textsearch.hxx>
+Reference< XInterface > createComListener( const Any& aControlAny, const ::rtl::OUString& aVBAType,
+ const ::rtl::OUString& aPrefix, SbxObjectRef xScopeObj );
+
#include <algorithm>
SbxVariable* getDefaultProp( SbxVariable* pRef );
@@ -514,8 +518,29 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
}
}
+ // Handle withevents
+ BOOL bWithEvents = refVar->IsSet( SBX_WITH_EVENTS );
+ Reference< XInterface > xComListener;
+ if( bWithEvents )
+ {
+ 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 );
+ }
+ }
+
*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
@@ -907,6 +932,19 @@ void SbiRuntime::StepARRAYACCESS()
PushVar( CheckArray( refVar ) );
}
+void SbiRuntime::StepBYVAL()
+{
+ // Copy variable on stack to break call by reference
+ SbxVariableRef pVar = PopVar();
+ SbxDataType t = pVar->GetType();
+
+ SbxVariable* pCopyVar = new SbxVariable( t );
+ pCopyVar->SetFlag( SBX_READWRITE );
+ *pCopyVar = *pVar;
+
+ PushVar( pCopyVar );
+}
+
// Einrichten eines Argvs
// nOp1 bleibt so -> 1. Element ist Returnwert
@@ -1116,6 +1154,7 @@ void SbiRuntime::StepSTDERROR()
pInst->nErr = 0L;
pInst->nErl = 0;
nError = 0L;
+ SbxErrObject::getUnoErrObject()->Clear();
}
void SbiRuntime::StepNOERROR()
@@ -1124,6 +1163,7 @@ void SbiRuntime::StepNOERROR()
pInst->nErr = 0L;
pInst->nErl = 0;
nError = 0L;
+ SbxErrObject::getUnoErrObject()->Clear();
bError = FALSE;
}
@@ -1132,6 +1172,9 @@ void SbiRuntime::StepNOERROR()
void SbiRuntime::StepLEAVE()
{
bRun = FALSE;
+ // If VBA and we are leaving an ErrorHandler then clear the error ( it's been processed )
+ if ( bInError && pError )
+ SbxErrObject::getUnoErrObject()->Clear();
}
void SbiRuntime::StepCHANNEL() // TOS = Kanalnummer
@@ -1265,6 +1308,9 @@ void SbiRuntime::StepERROR()
SbxVariableRef refCode = PopVar();
USHORT n = refCode->GetUShort();
SbError error = StarBASIC::GetSfxFromVBError( n );
- Error( error );
+ if ( bVBAEnabled )
+ pInst->Error( error );
+ else
+ Error( error );
}
diff --git a/basic/source/runtime/step1.cxx b/basic/source/runtime/step1.cxx
index 399257cf6ad3..e23ef864218e 100644
--- a/basic/source/runtime/step1.cxx
+++ b/basic/source/runtime/step1.cxx
@@ -30,11 +30,13 @@
#include <stdlib.h>
#include <rtl/math.hxx>
+#include <basic/sbuno.hxx>
#include "runtime.hxx"
#include "sbintern.hxx"
#include "iosys.hxx"
#include "image.hxx"
#include "sbunoobj.hxx"
+#include "errobject.hxx"
bool checkUnoObjectType( SbUnoObject* refVal,
const String& aClass );
@@ -230,8 +232,6 @@ void SbiRuntime::StepRETURN( UINT32 nOp1 )
// FOR-Variable testen (+Endlabel)
-void unoToSbxValue( SbxVariable* pVar, const Any& aValue );
-
void SbiRuntime::StepTESTFOR( UINT32 nOp1 )
{
if( !pForStk )
@@ -360,6 +360,7 @@ void SbiRuntime::StepERRHDL( UINT32 nOp1 )
pInst->nErr = 0;
pInst->nErl = 0;
nError = 0;
+ SbxErrObject::getUnoErrObject()->Clear();
}
// Resume nach Fehlern (+0=statement, 1=next or Label)
@@ -380,6 +381,8 @@ void SbiRuntime::StepRESUME( UINT32 nOp1 )
}
else
pCode = pErrStmnt;
+ if ( pError ) // current in error handler ( and got a Resume Next statment )
+ SbxErrObject::getUnoErrObject()->Clear();
if( nOp1 > 1 )
StepJUMP( nOp1 );
@@ -450,9 +453,9 @@ bool SbiRuntime::implIsClass( SbxObject* pObj, const String& aClass )
}
bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal,
- const String& aClass, bool bRaiseErrors )
+ const String& aClass, bool bRaiseErrors, bool bDefault )
{
- bool bOk = true;
+ bool bOk = bDefault;
SbxDataType t = refVal->GetType();
if( t == SbxOBJECT )
@@ -486,6 +489,8 @@ bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal,
}
else
{
+ bOk = true;
+
SbClassModuleObject* pClassModuleObject = PTR_CAST(SbClassModuleObject,pObj);
if( pClassModuleObject != NULL )
pClassModuleObject->triggerInitializeEvent();
@@ -529,7 +534,8 @@ void SbiRuntime::StepTESTCLASS( UINT32 nOp1 )
{
SbxVariableRef xObjVal = PopVar();
String aClass( pImg->GetString( static_cast<short>( nOp1 ) ) );
- bool bOk = checkClass_Impl( xObjVal, aClass, false );
+ bool bDefault = !bVBAEnabled;
+ bool bOk = checkClass_Impl( xObjVal, aClass, false, bDefault );
SbxVariable* pRet = new SbxVariable;
pRet->PutBool( bOk );
diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx
index 3a260ad203a3..72ea67dd8db4 100644
--- a/basic/source/runtime/step2.cxx
+++ b/basic/source/runtime/step2.cxx
@@ -1068,9 +1068,17 @@ void SbiRuntime::StepTCREATE( UINT32 nOp1, UINT32 nOp2 )
pCopyObj->SetName( aName );
SbxVariable* pNew = new SbxVariable;
pNew->PutObject( pCopyObj );
+ pNew->SetDeclareClassName( aClass );
PushVar( pNew );
}
+void SbiRuntime::implCreateFixedString( SbxVariable* pStrVar, UINT32 nOp2 )
+{
+ USHORT nCount = static_cast<USHORT>( nOp2 >> 17 ); // len = all bits above 0x10000
+ String aStr;
+ aStr.Fill( nCount, 0 );
+ pStrVar->PutString( aStr );
+}
// Einrichten einer lokalen Variablen (+StringID+Typ)
@@ -1081,9 +1089,15 @@ void SbiRuntime::StepLOCAL( UINT32 nOp1, UINT32 nOp2 )
String aName( pImg->GetString( static_cast<short>( nOp1 ) ) );
if( refLocals->Find( aName, SbxCLASS_DONTCARE ) == NULL )
{
- SbxDataType t = (SbxDataType) nOp2;
+ SbxDataType t = (SbxDataType)(nOp2 & 0xffff);
SbxVariable* p = new SbxVariable( t );
p->SetName( aName );
+ bool bWithEvents = ((t & 0xff) == SbxOBJECT && (nOp2 & SBX_TYPE_WITH_EVENTS_FLAG) != 0);
+ if( bWithEvents )
+ p->SetFlag( SBX_WITH_EVENTS );
+ bool bFixedString = ((t & 0xff) == SbxSTRING && (nOp2 & SBX_FIXED_LEN_STRING_FLAG) != 0);
+ if( bFixedString )
+ implCreateFixedString( p, nOp2 );
refLocals->Put( p, refLocals->Count() );
}
}
@@ -1093,7 +1107,7 @@ void SbiRuntime::StepLOCAL( UINT32 nOp1, UINT32 nOp2 )
void SbiRuntime::StepPUBLIC_Impl( UINT32 nOp1, UINT32 nOp2, bool bUsedForClassModule )
{
String aName( pImg->GetString( static_cast<short>( nOp1 ) ) );
- SbxDataType t = (SbxDataType) nOp2;
+ SbxDataType t = (SbxDataType)(SbxDataType)(nOp2 & 0xffff);;
BOOL bFlag = pMod->IsSet( SBX_NO_MODIFY );
pMod->SetFlag( SBX_NO_MODIFY );
SbxVariableRef p = pMod->Find( aName, SbxCLASS_PROPERTY );
@@ -1109,6 +1123,13 @@ void SbiRuntime::StepPUBLIC_Impl( UINT32 nOp1, UINT32 nOp2, bool bUsedForClassMo
pProp->SetFlag( SBX_DONTSTORE );
// AB: 2.7.1996: HACK wegen 'Referenz kann nicht gesichert werden'
pProp->SetFlag( SBX_NO_MODIFY);
+
+ bool bWithEvents = ((t & 0xff) == SbxOBJECT && (nOp2 & SBX_TYPE_WITH_EVENTS_FLAG) != 0);
+ if( bWithEvents )
+ pProp->SetFlag( SBX_WITH_EVENTS );
+ bool bFixedString = ((t & 0xff) == SbxSTRING && (nOp2 & SBX_FIXED_LEN_STRING_FLAG) != 0);
+ if( bFixedString )
+ implCreateFixedString( p, nOp2 );
}
}
@@ -1122,7 +1143,10 @@ void SbiRuntime::StepPUBLIC_P( UINT32 nOp1, UINT32 nOp2 )
// Creates module variable that isn't reinitialised when
// between invocations ( for VBASupport & document basic only )
if( pMod->pImage->bFirstInit )
- StepPUBLIC( nOp1, nOp2 );
+ {
+ bool bUsedForClassModule = pImg->GetFlag( SBIMG_CLASSMODULE );
+ StepPUBLIC_Impl( nOp1, nOp2, bUsedForClassModule );
+ }
}
// Einrichten einer globalen Variablen (+StringID+Typ)
@@ -1133,7 +1157,7 @@ void SbiRuntime::StepGLOBAL( UINT32 nOp1, UINT32 nOp2 )
StepPUBLIC_Impl( nOp1, nOp2, true );
String aName( pImg->GetString( static_cast<short>( nOp1 ) ) );
- SbxDataType t = (SbxDataType) nOp2;
+ SbxDataType t = (SbxDataType)(SbxDataType)(nOp2 & 0xffff);;
BOOL bFlag = rBasic.IsSet( SBX_NO_MODIFY );
rBasic.SetFlag( SBX_NO_MODIFY );
SbxVariableRef p = rBasic.Find( aName, SbxCLASS_PROPERTY );
diff --git a/basic/source/runtime/win.asm b/basic/source/runtime/win.asm
deleted file mode 100644
index dea597a4ce51..000000000000
--- a/basic/source/runtime/win.asm
+++ /dev/null
@@ -1,80 +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.
-;
-;*************************************************************************
-
-; Anmerkungen
-; Direktaufruf von C- und PASCAL-Routinen, Windows und OS/2
-;
-; Inhalt:
-; type = CallXXX (far *proc, char *stack, short nstack)
-;
-; Kopie des Basic-Stacks (nstack Bytes) auf den C-Stack
-; und Aufruf der Prozedur.
-
- .MODEL LARGE,C
-
- .CODE
-
- PUBLIC CallINT
- PUBLIC CallLNG
- PUBLIC CallSNG
- PUBLIC CallDBL
- PUBLIC CallSTR
- PUBLIC CallFIX
-
-CallINT LABEL byte
-CallLNG LABEL byte
-CallSNG LABEL byte
-CallDBL LABEL byte
-CallSTR LABEL byte
-CallFIX PROC p:PTR,stk:PTR,n:WORD
-
- PUSH SI
- PUSH DI
- MOV DX,DS
- SUB SP,[n]
- MOV DI,SP
- MOV AX,SS
- MOV ES,AX
- LDS SI,[stk]
- MOV CX,[n]
- SHR CX,1
- CLD
- JCXZ $1
- REP MOVSW ; Stack uebernehmen
-$1: MOV DS,DX
- CALL [p] ; Aufruf der Prozedur
- CLI
- MOV SP,BP
- SUB SP,4 ; wegen gepushter Register
- STI
- POP DI
- POP SI
- RET
-
-CallFIX ENDP
-
- END
diff --git a/basic/source/runtime/wnt-mingw.s b/basic/source/runtime/wnt-mingw.s
index 1168804102d0..7868ddd386f0 100644
--- a/basic/source/runtime/wnt-mingw.s
+++ b/basic/source/runtime/wnt-mingw.s
@@ -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
@@ -23,71 +23,31 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
-
-# Anmerkungen
-# Direktaufruf von C- und PASCAL-Routinen, Windows und OS/2
-#
-# Inhalt:
-# type = CallXXX (far *pProc, char *pStack, short nStack)
-#
-# Kopie des Basic-Stacks (nStack Bytes) auf den C-Stack
-# und Aufruf der Prozedur.
-
- .intel_syntax
- #.386
-
-#_TEXT SEGMENT DWORD PUBLIC 'CODE' USE32
-
- #ASSUME CS:_TEXT
-
-.globl _CallINT
-.globl _CallLNG
-.globl _CallDBL
-.globl _CallSTR
-.globl _CallFIX
-
-_CallINT:
-_CallLNG:
-_CallDBL:
-_CallSTR:
-
-_CallFIX: PUSH EBP
- MOV EBP,ESP
- PUSH ESI
- PUSH EDI
-
- PUSH ECX
- PUSH EDX
-
- MOV DX,DS
- MOVZX EAX,WORD PTR [EBP+16] # EAX == nStack
- SUB ESP,EAX # Stack um nStack Bytes vergroessern
- MOV EDI,ESP
- MOV AX,SS
- MOV ES,AX # ES:EDI = Startadresse des fuer
- # Parameter reservierten Stackbereichs
- MOV ESI,[EBP+12] # DS:ESI == pStack
-
- MOVZX ECX,WORD PTR [EBP+16] # ECX == nStack
- SHR ECX,1
- CLD
- JCXZ $1
- REP MOVSW # Stack uebernehmen
-$1: MOV DS,DX
- CALL DWORD PTR [EBP+8] # Aufruf der Prozedur
- # CLI # unter NT nicht erlaubt (privileged instruction)
- MOV ESP,EBP
- SUB ESP,16 # wegen gepushter Register
- # (ESI, EDI)
- # STI
- POP EDX
- POP ECX
- POP EDI
- POP ESI
- POP EBP
- RET 12
-
-#_TEXT ENDS
-
- #END
+#***********************************************************************/
+
+.intel_syntax
+
+.globl _DllMgr_call32
+.globl _DllMgr_callFp
+
+_DllMgr_call32:
+_DllMgr_callFp:
+ push ebp
+ mov ebp, esp
+ push esi
+ push edi
+ mov ecx, [ebp+16]
+ jecxz $1
+ sub esp, ecx
+ mov edi, esp
+ mov esi, [ebp+12]
+ shr ecx, 2
+ rep movsd
+$1: call DWORD PTR [ebp+8]
+ ; for extra safety, do not trust esp after call (in case the Basic Declare
+ ; signature is wrong):
+ mov edi, [ebp-8]
+ mov esi, [ebp-4]
+ mov esp, ebp
+ pop ebp
+ ret 12
diff --git a/basic/source/runtime/wnt.asm b/basic/source/runtime/wnt.asm
index 3824daae964b..2a8710e34243 100644
--- a/basic/source/runtime/wnt.asm
+++ b/basic/source/runtime/wnt.asm
@@ -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
@@ -23,70 +23,34 @@
; <http://www.openoffice.org/license.html>
; for a copy of the LGPLv3 License.
;
-;*************************************************************************
-
-; Anmerkungen
-; Direktaufruf von C- und PASCAL-Routinen, Windows und OS/2
-;
-; Inhalt:
-; type = CallXXX (far *pProc, char *pStack, short nStack)
-;
-; Kopie des Basic-Stacks (nStack Bytes) auf den C-Stack
-; und Aufruf der Prozedur.
-
- .386
-
-_TEXT SEGMENT DWORD PUBLIC 'CODE' USE32
-
- ASSUME CS:_TEXT
-
- PUBLIC _CallINT@12
- PUBLIC _CallLNG@12
- PUBLIC _CallDBL@12
- PUBLIC _CallSTR@12
- PUBLIC _CallFIX@12
-
-_CallINT@12 LABEL byte
-_CallLNG@12 LABEL byte
-_CallDBL@12 LABEL byte
-_CallSTR@12 LABEL byte
-
-_CallFIX@12: PUSH EBP
- MOV EBP,ESP
- PUSH ESI
- PUSH EDI
-
- PUSH ECX
- PUSH EDX
-
- MOV DX,DS
- MOVZX EAX,WORD PTR [EBP+16] ; EAX == nStack
- SUB ESP,EAX ; Stack um nStack Bytes vergroessern
- MOV EDI,ESP
- MOV AX,SS
- MOV ES,AX ; ES:EDI = Startadresse des fuer
- ; Parameter reservierten Stackbereichs
- MOV ESI,[EBP+12] ; DS:ESI == pStack
-
- MOVZX ECX,WORD PTR [EBP+16] ; ECX == nStack
- SHR ECX,1
- CLD
- JCXZ $1
- REP MOVSW ; Stack uebernehmen
-$1: MOV DS,DX
- CALL DWORD PTR [EBP+8] ; Aufruf der Prozedur
- ; CLI ; unter NT nicht erlaubt (privileged instruction)
- MOV ESP,EBP
- SUB ESP,16 ; wegen gepushter Register
- ; (ESI, EDI)
- ; STI
- POP EDX
- POP ECX
- POP EDI
- POP ESI
- POP EBP
- RET 12
-
-_TEXT ENDS
-
- END
+;***********************************************************************/
+
+.386
+
+PUBLIC _DllMgr_call32@12
+PUBLIC _DllMgr_callFp@12
+
+_TEXT SEGMENT
+_DllMgr_call32@12:
+_DllMgr_callFp@12:
+ push ebp
+ mov ebp, esp
+ push esi
+ push edi
+ mov ecx, [ebp+16]
+ jecxz $1
+ sub esp, ecx
+ mov edi, esp
+ mov esi, [ebp+12]
+ shr ecx, 2
+ rep movsd
+$1: call DWORD PTR [ebp+8]
+ ; for extra safety, do not trust esp after call (in case the Basic Declare
+ ; signature is wrong):
+ mov edi, [ebp-8]
+ mov esi, [ebp-4]
+ mov esp, ebp
+ pop ebp
+ ret 12
+_TEXT ENDS
+END
diff --git a/basic/source/sbx/format.src b/basic/source/sbx/format.src
index 8ebe6e93c4bb..7e576134fad5 100644
--- a/basic/source/sbx/format.src
+++ b/basic/source/sbx/format.src
@@ -25,7 +25,7 @@
*
************************************************************************/
-#include "svl/svtools.hrc"
+#include "svtools/svtools.hrc"
String STR_BASICKEY_FORMAT_ON
{
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 6d5d24fcb951..3d45818e6401 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -47,7 +47,7 @@
#include "sbxres.hxx"
#include <basic/sbxbase.hxx>
#include <basic/sbxform.hxx>
-#include <svl/svtools.hrc>
+#include <svtools/svtools.hrc>
#include "basrid.hxx"
#include "runtime.hxx"
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index 9a83fb7ba578..20060f1f7493 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -39,6 +39,9 @@
#include <math.h>
#include <ctype.h>
+#include "com/sun/star/uno/XInterface.hpp"
+using namespace com::sun::star::uno;
+
///////////////////////////// SbxVariable //////////////////////////////
TYPEINIT1(SbxVariable,SbxValue)
@@ -49,10 +52,28 @@ extern UINT32 nVarCreator; // in SBXBASE.CXX, fuer LoadData()
static ULONG nVar = 0;
#endif
+///////////////////////////// SbxVariableImpl ////////////////////////////
+
+class SbxVariableImpl
+{
+ friend class SbxVariable;
+ String m_aDeclareClassName;
+ Reference< XInterface > m_xComListener;
+
+ SbxVariableImpl( void )
+ {}
+ SbxVariableImpl( const SbxVariableImpl& r )
+ : m_aDeclareClassName( r.m_aDeclareClassName )
+ , m_xComListener( r.m_xComListener )
+ {}
+};
+
+
///////////////////////////// Konstruktoren //////////////////////////////
SbxVariable::SbxVariable() : SbxValue()
{
+ mpSbxVariableImpl = NULL;
pCst = NULL;
pParent = NULL;
nUserData = 0;
@@ -66,6 +87,9 @@ SbxVariable::SbxVariable() : SbxValue()
SbxVariable::SbxVariable( const SbxVariable& r )
: SvRefBase( r ), SbxValue( r ), mpPar( r.mpPar ), pInfo( r.pInfo )
{
+ mpSbxVariableImpl = NULL;
+ if( r.mpSbxVariableImpl != NULL )
+ mpSbxVariableImpl = new SbxVariableImpl( *r.mpSbxVariableImpl );
pCst = NULL;
if( r.CanRead() )
{
@@ -91,6 +115,7 @@ SbxVariable::SbxVariable( const SbxVariable& r )
SbxVariable::SbxVariable( SbxDataType t, void* p ) : SbxValue( t, p )
{
+ mpSbxVariableImpl = NULL;
pCst = NULL;
pParent = NULL;
nUserData = 0;
@@ -111,6 +136,7 @@ SbxVariable::~SbxVariable()
maName.AssignAscii( aCellsStr, sizeof( aCellsStr )-1 );
GetSbxData_Impl()->aVars.Remove( this );
#endif
+ delete mpSbxVariableImpl;
delete pCst;
}
@@ -287,6 +313,11 @@ USHORT SbxVariable::MakeHashCode( const XubString& rName )
SbxVariable& SbxVariable::operator=( const SbxVariable& r )
{
SbxValue::operator=( r );
+ delete mpSbxVariableImpl;
+ if( r.mpSbxVariableImpl != NULL )
+ mpSbxVariableImpl = new SbxVariableImpl( *r.mpSbxVariableImpl );
+ else
+ mpSbxVariableImpl = NULL;
return *this;
}
@@ -346,6 +377,32 @@ void SbxVariable::SetParent( SbxObject* p )
pParent = p;
}
+SbxVariableImpl* SbxVariable::getImpl( void )
+{
+ if( mpSbxVariableImpl == NULL )
+ mpSbxVariableImpl = new SbxVariableImpl();
+ return mpSbxVariableImpl;
+}
+
+const String& SbxVariable::GetDeclareClassName( void )
+{
+ SbxVariableImpl* pImpl = getImpl();
+ return pImpl->m_aDeclareClassName;
+}
+
+void SbxVariable::SetDeclareClassName( const String& rDeclareClassName )
+{
+ SbxVariableImpl* pImpl = getImpl();
+ pImpl->m_aDeclareClassName = rDeclareClassName;
+}
+
+void SbxVariable::SetComListener( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xComListener )
+{
+ SbxVariableImpl* pImpl = getImpl();
+ pImpl->m_xComListener = xComListener;
+}
+
+
////////////////////////////// Laden/Speichern /////////////////////////////
BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer )
diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx
index 051b4fa9f077..004b61fbf198 100644
--- a/basic/source/uno/dlgcont.cxx
+++ b/basic/source/uno/dlgcont.cxx
@@ -187,12 +187,13 @@ bool writeOasis2OOoLibraryElement(
void SAL_CALL SfxDialogLibraryContainer::writeLibraryElement
(
- Any aElement,
- const OUString& /*aElementName*/,
- Reference< XOutputStream > xOutput
+ const Reference < XNameContainer >& xLib,
+ const OUString& aElementName,
+ const Reference< XOutputStream >& xOutput
)
throw(Exception)
{
+ Any aElement = xLib->getByName( aElementName );
Reference< XInputStreamProvider > xISP;
aElement >>= xISP;
if( !xISP.is() )
@@ -256,7 +257,9 @@ void SfxDialogLibraryContainer::storeLibrariesToStorage( const uno::Reference< e
Any SAL_CALL SfxDialogLibraryContainer::importLibraryElement
- ( const OUString& aFile, const uno::Reference< io::XInputStream >& xElementStream )
+ ( const Reference < XNameContainer >& /*xLib*/,
+ const OUString& /*aElementName */, const OUString& aFile,
+ const uno::Reference< io::XInputStream >& xElementStream )
{
Any aRetAny;
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 14c84420dad6..e1ad8b6b4308 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -65,7 +65,7 @@
#include <com/sun/star/uno/DeploymentException.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/script/LibraryNotLoadedException.hpp>
-#include "com/sun/star/deployment/thePackageManagerFactory.hpp"
+#include "com/sun/star/deployment/ExtensionManager.hpp"
#include <comphelper/storagehelper.hxx>
#ifndef _RTL_USTRING_HXX_
#include <comphelper/anytostring.hxx>
@@ -73,7 +73,6 @@
#include <cppuhelper/exc_hlp.hxx>
#include <basic/sbmod.hxx>
-
namespace basic
{
@@ -327,6 +326,7 @@ DBG_NAME( SfxLibraryContainer )
// Ctor
SfxLibraryContainer::SfxLibraryContainer( void )
: LibraryContainerHelper( maMutex )
+ , mbVBACompat( sal_False )
, maModifiable( *this, maMutex )
, maNameContainer( getCppuType( (Reference< XNameAccess >*) NULL ) )
, mbOldInfoFormat( sal_False )
@@ -1080,6 +1080,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
OUString aUserSearchStr = OUString::createFromAscii( "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE" );
OUString aSharedSearchStr = OUString::createFromAscii( "vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE" );
+ OUString aBundledSearchStr = OUString::createFromAscii( "vnd.sun.star.expand:$BUNDLED_EXTENSIONS" );
OUString aInstSearchStr = OUString::createFromAscii( "$(INST)" );
Sequence< OUString > aNames = pPrevCont->getElementNames();
@@ -1111,6 +1112,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
bool bCreateLink = true;
if( aStorageURL.indexOf( aUserSearchStr ) != -1 ||
aStorageURL.indexOf( aSharedSearchStr ) != -1 ||
+ aStorageURL.indexOf( aBundledSearchStr ) != -1 ||
aStorageURL.indexOf( aInstSearchStr ) != -1 )
{
bCreateLink = false;
@@ -1369,8 +1371,8 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
OUString aStreamName = aElementName;
aStreamName += String( RTL_CONSTASCII_USTRINGPARAM(".xml") );
- Any aElement = pLib->getByName( aElementName );
- if( !isLibraryElementValid( aElement ) )
+ /*Any aElement = pLib->getByName( aElementName );*/
+ if( !isLibraryElementValid( pLib->getByName( aElementName ) ) )
{
#if OSL_DEBUG_LEVEL > 0
::rtl::OStringBuffer aMessage;
@@ -1406,7 +1408,8 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
xProps->setPropertyValue( aPropName, uno::makeAny( sal_True ) );
Reference< XOutputStream > xOutput = xElementStream->getOutputStream();
- writeLibraryElement( aElement, aElementName, xOutput );
+ Reference< XNameContainer > xLib( pLib );
+ writeLibraryElement( xLib, aElementName, xOutput );
// writeLibraryElement closes the stream
// xOutput->closeOutput();
}
@@ -1458,8 +1461,8 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
aElementInetObj.setExtension( maLibElementFileExtension );
String aElementPath( aElementInetObj.GetMainURL( INetURLObject::NO_DECODE ) );
- Any aElement = pLib->getByName( aElementName );
- if( !isLibraryElementValid( aElement ) )
+ /*Any aElement = pLib->getByName( aElementName );*/
+ if( !isLibraryElementValid( pLib->getByName( aElementName ) ) )
{
#if OSL_DEBUG_LEVEL > 0
::rtl::OStringBuffer aMessage;
@@ -1477,7 +1480,8 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
if( xSFI->exists( aElementPath ) )
xSFI->kill( aElementPath );
Reference< XOutputStream > xOutput = xSFI->openFileWrite( aElementPath );
- writeLibraryElement( aElement, aElementName, xOutput );
+ Reference< XNameContainer > xLib( pLib );
+ writeLibraryElement( xLib, aElementName, xOutput );
xOutput->closeOutput();
}
catch( Exception& )
@@ -2167,6 +2171,7 @@ Reference< XNameAccess > SAL_CALL SfxLibraryContainer::createLibraryLink
SfxLibrary* pNewLib = implCreateLibraryLink( Name, aLibInfoFileURL, aLibDirURL, ReadOnly );
pNewLib->maLibElementFileExtension = maLibElementFileExtension;
pNewLib->maUnexpandedStorageURL = aUnexpandedStorageURL;
+ pNewLib->maOrignialStorageURL = StorageURL;
OUString aInitFileName;
uno::Reference< embed::XStorage > xDummyStor;
@@ -2182,11 +2187,12 @@ Reference< XNameAccess > SAL_CALL SfxLibraryContainer::createLibraryLink
OUString aUserSearchStr = OUString::createFromAscii( "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE" );
OUString aSharedSearchStr = OUString::createFromAscii( "vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE" );
+ OUString aBundledSearchStr = OUString::createFromAscii( "vnd.sun.star.expand:$BUNDLED_EXTENSIONS" );
if( StorageURL.indexOf( aUserSearchStr ) != -1 )
{
pNewLib->mbExtension = sal_True;
}
- else if( StorageURL.indexOf( aSharedSearchStr ) != -1 )
+ else if( StorageURL.indexOf( aSharedSearchStr ) != -1 || StorageURL.indexOf( aBundledSearchStr ) != -1 )
{
pNewLib->mbExtension = sal_True;
pNewLib->mbReadOnly = sal_True;
@@ -2380,7 +2386,9 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name )
aFile = aElementInetObj.GetMainURL( INetURLObject::NO_DECODE );
}
- Any aAny = importLibraryElement( aFile, xInStream );
+ Reference< XNameContainer > xLib( pImplLib );
+ Any aAny = importLibraryElement( xLib, aElementName,
+ aFile, xInStream );
if( pImplLib->hasByName( aElementName ) )
{
if( aAny.hasValue() )
@@ -2785,6 +2793,43 @@ OUString SfxLibraryContainer::expand_url( const OUString& url )
}
}
+
+//XLibraryContainer3
+OUString SAL_CALL SfxLibraryContainer::getOriginalLibraryLinkURL( const OUString& Name )
+ throw (IllegalArgumentException, NoSuchElementException, RuntimeException)
+{
+ LibraryContainerMethodGuard aGuard( *this );
+ SfxLibrary* pImplLib = getImplLib( Name );
+ sal_Bool bLink = pImplLib->mbLink;
+ if( !bLink )
+ throw IllegalArgumentException();
+ OUString aRetStr = pImplLib->maOrignialStorageURL;
+ return aRetStr;
+}
+
+
+::sal_Bool SAL_CALL SfxLibraryContainer::getVBACompatModeOn() throw (RuntimeException)
+{
+ return mbVBACompat;
+}
+
+void SAL_CALL SfxLibraryContainer::setVBACompatModeOn( ::sal_Bool _vbacompatmodeon ) throw (RuntimeException)
+{
+ BasicManager* pBasMgr = getBasicManager();
+ if( pBasMgr )
+ {
+ // get the standard library
+ String aLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
+ if ( pBasMgr->GetName().Len() )
+ aLibName = pBasMgr->GetName();
+
+ StarBASIC* pBasic = pBasMgr->GetLib( aLibName );
+ if( pBasic )
+ pBasic->SetVBAEnabled( _vbacompatmodeon );
+ }
+ mbVBACompat = _vbacompatmodeon;
+}
+
// Methods XServiceInfo
::sal_Bool SAL_CALL SfxLibraryContainer::supportsService( const ::rtl::OUString& _rServiceName )
throw (RuntimeException)
@@ -3075,8 +3120,10 @@ ScriptExtensionIterator::ScriptExtensionIterator( void )
: m_eState( USER_EXTENSIONS )
, m_bUserPackagesLoaded( false )
, m_bSharedPackagesLoaded( false )
+ , m_bBundledPackagesLoaded( false )
, m_iUserPackage( 0 )
, m_iSharedPackage( 0 )
+ , m_iBundledPackage( 0 )
, m_pScriptSubPackageIterator( NULL )
{
Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
@@ -3125,6 +3172,16 @@ rtl::OUString ScriptExtensionIterator::nextBasicOrDialogLibrary( bool& rbPureDia
aRetLib = xScriptPackage->getURL();
break;
}
+ case BUNDLED_EXTENSIONS:
+ {
+ Reference< deployment::XPackage > xScriptPackage =
+ implGetNextBundledScriptPackage( rbPureDialogLib );
+ if( !xScriptPackage.is() )
+ break;
+
+ aRetLib = xScriptPackage->getURL();
+ break;
+ }
case END_REACHED:
VOS_ENSURE( false, "ScriptExtensionIterator::nextBasicOrDialogLibrary(): Invalid case END_REACHED" );
break;
@@ -3295,10 +3352,11 @@ Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextUserScript
{
try
{
- Reference< XPackageManager > xUserManager =
- thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("user") );
- m_aUserPackagesSeq = xUserManager->getDeployedPackages
- ( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
+ Reference< XExtensionManager > xManager =
+ ExtensionManager::get( m_xContext );
+ m_aUserPackagesSeq = xManager->getDeployedExtensions
+ (rtl::OUString::createFromAscii("user"),
+ Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
}
catch( com::sun::star::uno::DeploymentException& )
{
@@ -3348,10 +3406,11 @@ Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextSharedScri
{
try
{
- Reference< XPackageManager > xSharedManager =
- thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("shared") );
- m_aSharedPackagesSeq = xSharedManager->getDeployedPackages
- ( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
+ Reference< XExtensionManager > xSharedManager =
+ ExtensionManager::get( m_xContext );
+ m_aSharedPackagesSeq = xSharedManager->getDeployedExtensions
+ (rtl::OUString::createFromAscii("shared"),
+ Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
}
catch( com::sun::star::uno::DeploymentException& )
{
@@ -3364,7 +3423,7 @@ Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextSharedScri
if( m_iSharedPackage == m_aSharedPackagesSeq.getLength() )
{
- m_eState = END_REACHED;
+ m_eState = BUNDLED_EXTENSIONS;
}
else
{
@@ -3391,4 +3450,57 @@ Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextSharedScri
return xScriptPackage;
}
+Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextBundledScriptPackage
+ ( bool& rbPureDialogLib )
+{
+ Reference< deployment::XPackage > xScriptPackage;
+
+ if( !m_bBundledPackagesLoaded )
+ {
+ try
+ {
+ Reference< XExtensionManager > xManager =
+ ExtensionManager::get( m_xContext );
+ m_aBundledPackagesSeq = xManager->getDeployedExtensions
+ (rtl::OUString::createFromAscii("bundled"),
+ Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
+ }
+ catch( com::sun::star::uno::DeploymentException& )
+ {
+ // Special Office installations may not contain deployment code
+ return xScriptPackage;
+ }
+
+ m_bBundledPackagesLoaded = true;
+ }
+
+ if( m_iBundledPackage == m_aBundledPackagesSeq.getLength() )
+ {
+ m_eState = END_REACHED;
+ }
+ else
+ {
+ if( m_pScriptSubPackageIterator == NULL )
+ {
+ const Reference< deployment::XPackage >* pBundledPackages = m_aBundledPackagesSeq.getConstArray();
+ Reference< deployment::XPackage > xPackage = pBundledPackages[ m_iBundledPackage ];
+ VOS_ENSURE( xPackage.is(), "ScriptExtensionIterator::implGetNextBundledScriptPackage(): Invalid package" );
+ m_pScriptSubPackageIterator = new ScriptSubPackageIterator( xPackage );
+ }
+
+ if( m_pScriptSubPackageIterator != NULL )
+ {
+ xScriptPackage = m_pScriptSubPackageIterator->getNextScriptSubPackage( rbPureDialogLib );
+ if( !xScriptPackage.is() )
+ {
+ delete m_pScriptSubPackageIterator;
+ m_pScriptSubPackageIterator = NULL;
+ m_iBundledPackage++;
+ }
+ }
+ }
+
+ return xScriptPackage;
+}
+
} // namespace basic
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index 88caeac1facf..5a277f5ba778 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -41,6 +41,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
#include <com/sun/star/task/ErrorCodeIOException.hpp>
+#include <com/sun/star/script/ModuleType.hpp>
#include <comphelper/processfactory.hxx>
#ifndef _COMPHELPER_STORAGEHELPER_HXX_
#include <comphelper/storagehelper.hxx>
@@ -60,6 +61,7 @@
#include <svtools/ehdl.hxx>
#include <basic/basmgr.hxx>
#include <basic/sbmod.hxx>
+#include <basic/basicmanagerrepository.hxx>
#include "basic/modsizeexceeded.hxx"
#include <xmlscript/xmlmod_imexp.hxx>
#include <cppuhelper/factory.hxx>
@@ -184,9 +186,9 @@ bool SAL_CALL SfxScriptLibraryContainer::isLibraryElementValid( Any aElement ) c
void SAL_CALL SfxScriptLibraryContainer::writeLibraryElement
(
- Any aElement,
+ const Reference < XNameContainer >& xLib,
const OUString& aElementName,
- Reference< XOutputStream > xOutput
+ const Reference< XOutputStream >& xOutput
)
throw(Exception)
{
@@ -211,13 +213,42 @@ void SAL_CALL SfxScriptLibraryContainer::writeLibraryElement
xmlscript::ModuleDescriptor aMod;
aMod.aName = aElementName;
aMod.aLanguage = maScriptLanguage;
+ Any aElement = xLib->getByName( aElementName );
aElement >>= aMod.aCode;
+
+ Reference < script::XVBAModuleInfo > xModInfo( xLib, UNO_QUERY );
+
+ if( xModInfo.is() && xModInfo->hasModuleInfo( aElementName ) )
+ {
+ script::ModuleInfo aModInfo = xModInfo->getModuleInfo( aElementName );
+ switch( aModInfo.ModuleType )
+ {
+ case ModuleType::NORMAL:
+ aMod.aModuleType = OUString( RTL_CONSTASCII_USTRINGPARAM("normal") );
+ break;
+ case ModuleType::CLASS:
+ aMod.aModuleType = OUString( RTL_CONSTASCII_USTRINGPARAM("class") );
+ break;
+ case ModuleType::FORM:
+ aMod.aModuleType = OUString( RTL_CONSTASCII_USTRINGPARAM("form") );
+ break;
+ case ModuleType::DOCUMENT:
+ aMod.aModuleType = OUString( RTL_CONSTASCII_USTRINGPARAM("document") );
+ break;
+ case ModuleType::UNKNOWN:
+ // nothing
+ break;
+ }
+ }
+
xmlscript::exportScriptModule( xHandler, aMod );
}
Any SAL_CALL SfxScriptLibraryContainer::importLibraryElement
- ( const OUString& aFile, const uno::Reference< io::XInputStream >& xInStream )
+ ( const Reference < XNameContainer >& xLib,
+ const OUString& aElementName, const OUString& aFile,
+ const uno::Reference< io::XInputStream >& xInStream )
{
Any aRetAny;
@@ -279,6 +310,86 @@ Any SAL_CALL SfxScriptLibraryContainer::importLibraryElement
// TODO: Check language
// aMod.aLanguage
// aMod.aName ignored
+ if( aMod.aModuleType.getLength() > 0 )
+ {
+ if( !getVBACompatModeOn() )
+ {
+ setVBACompatModeOn( sal_True );
+
+ Any aGlobs;
+ Sequence< Any > aArgs(1);
+ Reference<frame::XModel > xModel( mxOwnerDocument );
+ aArgs[ 0 ] <<= xModel;
+
+ BasicManager* pBasicMgr = getBasicManager();
+ if( pBasicMgr )
+ {
+ aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.Globals" ) ), aArgs );
+ pBasicMgr->SetGlobalUNOConstant( "VBAGlobals", aGlobs );
+ }
+ pBasicMgr = BasicManagerRepository::getApplicationBasicManager( sal_False );
+ if( pBasicMgr )
+ pBasicMgr->SetGlobalUNOConstant( "ThisExcelDoc", aArgs[0] );
+ }
+
+ script::ModuleInfo aModInfo;
+ aModInfo.ModuleType = ModuleType::UNKNOWN;
+ if( aMod.aModuleType.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("normal") ))
+ {
+ aModInfo.ModuleType = ModuleType::NORMAL;
+ }
+ else if( aMod.aModuleType.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("class") ))
+ {
+ aModInfo.ModuleType = ModuleType::CLASS;
+ }
+ else if( aMod.aModuleType.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("form") ))
+ {
+ aModInfo.ModuleType = ModuleType::FORM;
+ aModInfo.ModuleObject = mxOwnerDocument;
+ }
+ else if( aMod.aModuleType.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("document") ))
+ {
+ aModInfo.ModuleType = ModuleType::DOCUMENT;
+ Reference<frame::XModel > xModel( mxOwnerDocument );
+ Reference< XMultiServiceFactory> xSF( xModel, UNO_QUERY);
+ Reference< container::XNameAccess > xVBACodeNameAccess;
+ if( xSF.is() )
+ {
+ try
+ {
+ xVBACodeNameAccess.set( xSF->createInstance(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "ooo.vba.VBAObjectModuleObjectProvider"))),
+ UNO_QUERY );
+ }
+ catch(uno::Exception&) {}
+ }
+ if( xVBACodeNameAccess.is() )
+ {
+ try
+ {
+ aModInfo.ModuleObject.set( xVBACodeNameAccess->getByName( aElementName), uno::UNO_QUERY );
+ }
+ catch(uno::Exception&)
+ {
+ OSL_TRACE("Failed to get documument object for %s", rtl::OUStringToOString( aElementName, RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
+ }
+ }
+
+ Reference< script::XVBAModuleInfo > xVBAModuleInfo( xLib,
+ UNO_QUERY );
+ if( xVBAModuleInfo.is() )
+ {
+ if( xVBAModuleInfo->hasModuleInfo( aElementName ) )
+ xVBAModuleInfo->removeModuleInfo( aElementName );
+ xVBAModuleInfo->insertModuleInfo( aElementName, aModInfo );
+ }
+ }
return aRetAny;
}
@@ -574,8 +685,8 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib,
if( pLib->mbPasswordVerified || pLib->mbDoc50Password )
{
- Any aElement = pLib->getByName( aElementName );
- if( !isLibraryElementValid( aElement ) )
+ /*Any aElement = pLib->getByName( aElementName );*/
+ if( !isLibraryElementValid( pLib->getByName( aElementName ) ) )
{
#if OSL_DEBUG_LEVEL > 0
::rtl::OStringBuffer aMessage;
@@ -606,7 +717,8 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib,
setStreamKey( xSourceStream, pLib->maPassword );
Reference< XOutputStream > xOutput = xSourceStream->getOutputStream();
- writeLibraryElement( aElement, aElementName, xOutput );
+ Reference< XNameContainer > xLib( pLib );
+ writeLibraryElement( xLib, aElementName, xOutput );
// writeLibraryElement should have the stream already closed
// xOutput->closeOutput();
}
@@ -659,8 +771,8 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib,
aElementInetObj.setExtension( OUString( RTL_CONSTASCII_USTRINGPARAM("pba") ) );
String aElementPath = aElementInetObj.GetMainURL( INetURLObject::NO_DECODE );
- Any aElement = pLib->getByName( aElementName );
- if( !isLibraryElementValid( aElement ) )
+ /*Any aElement = pLib->getByName( aElementName );*/
+ if( !isLibraryElementValid( pLib->getByName( aElementName ) ) )
{
#if OSL_DEBUG_LEVEL > 0
::rtl::OStringBuffer aMessage;
@@ -741,7 +853,8 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib,
xProps->setPropertyValue( aPropName, uno::makeAny( aMime ) );
Reference< XOutputStream > xOut = xSourceStream->getOutputStream();
- writeLibraryElement( aElement, aElementName, xOut );
+ Reference< XNameContainer > xLib( pLib );
+ writeLibraryElement( xLib, aElementName, xOut );
// i50568: sax writer already closes stream
// xOut->closeOutput();
@@ -903,7 +1016,10 @@ sal_Bool SfxScriptLibraryContainer::implLoadPasswordLibrary
if ( !xInStream.is() )
throw io::IOException(); // read access denied, seems to be impossible
- Any aAny = importLibraryElement( aSourceStreamName, xInStream );
+ Reference< XNameContainer > xLib( pLib );
+ Any aAny = importLibraryElement( xLib,
+ aElementName, aSourceStreamName,
+ xInStream );
if( pLib->hasByName( aElementName ) )
{
if( aAny.hasValue() )
@@ -942,7 +1058,7 @@ sal_Bool SfxScriptLibraryContainer::implLoadPasswordLibrary
try {
xElementRootStorage = ::comphelper::OStorageHelper::GetStorageFromURL(
aElementPath,
- embed::ElementModes::READWRITE );
+ embed::ElementModes::READ );
} catch( uno::Exception& )
{
// TODO: error handling
@@ -1006,7 +1122,11 @@ sal_Bool SfxScriptLibraryContainer::implLoadPasswordLibrary
if ( !xInStream.is() )
throw io::IOException(); // read access denied, seems to be impossible
- Any aAny = importLibraryElement( aSourceStreamName, xInStream );
+ Reference< XNameContainer > xLib( pLib );
+ Any aAny = importLibraryElement( xLib,
+ aElementName,
+ aSourceStreamName,
+ xInStream );
if( pLib->hasByName( aElementName ) )
{
if( aAny.hasValue() )
@@ -1166,6 +1286,45 @@ bool SAL_CALL SfxScriptLibrary::isLibraryElementValid( ::com::sun::star::uno::An
return SfxScriptLibrary::containsValidModule( aElement );
}
+IMPLEMENT_FORWARD_XINTERFACE2( SfxScriptLibrary, SfxLibrary, SfxScriptLibrary_BASE );
+IMPLEMENT_FORWARD_XTYPEPROVIDER2( SfxScriptLibrary, SfxLibrary, SfxScriptLibrary_BASE );
+
+script::ModuleInfo SAL_CALL
+SfxScriptLibrary::getModuleInfo( const ::rtl::OUString& ModuleName ) throw (NoSuchElementException, WrappedTargetException, RuntimeException)
+{
+ if ( !hasModuleInfo( ModuleName ) )
+ throw NoSuchElementException();
+ return mModuleInfos[ ModuleName ];
+}
+
+sal_Bool SAL_CALL
+SfxScriptLibrary::hasModuleInfo( const ::rtl::OUString& ModuleName ) throw (RuntimeException)
+{
+ sal_Bool bRes = sal_False;
+ ModuleInfoMap::iterator it = mModuleInfos.find( ModuleName );
+
+ if ( it != mModuleInfos.end() )
+ bRes = sal_True;
+
+ return bRes;
+}
+
+void SAL_CALL SfxScriptLibrary::insertModuleInfo( const ::rtl::OUString& ModuleName, const script::ModuleInfo& ModuleInfo ) throw (IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException)
+{
+ if ( hasModuleInfo( ModuleName ) )
+ throw ElementExistException();
+ mModuleInfos[ ModuleName ] = ModuleInfo;
+}
+
+void SAL_CALL SfxScriptLibrary::removeModuleInfo( const ::rtl::OUString& ModuleName ) throw (NoSuchElementException, WrappedTargetException, RuntimeException)
+{
+ // #FIXME add NoSuchElementException to the spec
+ if ( !hasModuleInfo( ModuleName ) )
+ throw NoSuchElementException();
+ mModuleInfos.erase( mModuleInfos.find( ModuleName ) );
+}
+
+
//============================================================================
} // namespace basic
diff --git a/basic/util/makefile.mk b/basic/util/makefile.mk
index 645c9b6a3ce8..629586f0441c 100644
--- a/basic/util/makefile.mk
+++ b/basic/util/makefile.mk
@@ -59,6 +59,7 @@ SHL1STDLIBS= \
$(VCLLIB) \
$(VOSLIB) \
$(SALLIB) \
+ $(SALHELPERLIB) \
$(COMPHELPERLIB) \
$(UNOTOOLSLIB) \
$(SOTLIB) \
diff --git a/configmgr/prj/build.lst b/configmgr/prj/build.lst
index 2fd4e03fa442..9fcccbc73b4c 100644
--- a/configmgr/prj/build.lst
+++ b/configmgr/prj/build.lst
@@ -1,3 +1,4 @@
cg configmgr : BOOST:boost comphelper cppu cppuhelper offuh sal salhelper stlport 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 a9d91980b213..17ccdbe86a08 100644
--- a/configmgr/prj/d.lst
+++ b/configmgr/prj/d.lst
@@ -1,8 +1,3 @@
-mkdir: %_DEST%\inc%_EXT%\configmgr
-mkdir: %_DEST%\inc%_EXT%\configmgr\detail
-..\%__SRC%\bin\configmgr.dll %_DEST%\bin%_EXT%\configmgr.dll
-..\%__SRC%\lib\iconfigmgr.lib %_DEST%\lib%_EXT%\iconfigmgr.lib
-..\%__SRC%\lib\libconfigmgr.dylib %_DEST%\lib%_EXT%\libconfigmgr.dylib
-..\%__SRC%\lib\libconfigmgr.so %_DEST%\lib%_EXT%\libconfigmgr.so
-..\inc\configmgr\detail\configmgrdllapi.hxx %_DEST%\inc%_EXT%\configmgr\detail\configmgrdllapi.hxx
-..\inc\configmgr\update.hxx %_DEST%\inc%_EXT%\configmgr\update.hxx
+..\%__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
diff --git a/configmgr/qa/unit/makefile.mk b/configmgr/qa/unit/makefile.mk
index 916c40ffedf5..25035d7e9dda 100644
--- a/configmgr/qa/unit/makefile.mk
+++ b/configmgr/qa/unit/makefile.mk
@@ -33,6 +33,8 @@ ENABLE_EXCEPTIONS = TRUE
.INCLUDE: settings.mk
+CFLAGSCXX += $(CPPUNIT_CFLAGS)
+
SLOFILES = $(SLO)/test.obj
SHL1OBJS = $(SLOFILES)
diff --git a/configmgr/qa/unoapi/Test.java b/configmgr/qa/unoapi/Test.java
new file mode 100644
index 000000000000..4d1f5a3c4be7
--- /dev/null
+++ b/configmgr/qa/unoapi/Test.java
@@ -0,0 +1,50 @@
+/*************************************************************************
+* 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.
+************************************************************************/
+
+package org.openoffice.configmgr.qa.unoapi;
+
+import org.openoffice.Runner;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+public final class Test {
+ @org.junit.Before public void setUp() throws Exception {
+ connection.setUp();
+ }
+
+ @org.junit.After public void tearDown()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ connection.tearDown();
+ }
+
+ @org.junit.Test public void test() {
+ assertTrue(
+ Runner.run(
+ "-sce", "module.sce", "-cs", connection.getDescription()));
+ }
+
+ private final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/configmgr/qa/unoapi/makefile.mk b/configmgr/qa/unoapi/makefile.mk
index 5af6b0729660..252e4a0d9af4 100644
--- a/configmgr/qa/unoapi/makefile.mk
+++ b/configmgr/qa/unoapi/makefile.mk
@@ -25,14 +25,26 @@
#
#***********************************************************************/
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
PRJ = ../..
PRJNAME = configmgr
-TARGET = unoapi
+TARGET = qa_unoapi
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/configmgr/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-ALLTAR: TEST
+ALLTAR : javatest
-TEST .PHONY:
- $(SOLARENV)/bin/checkapi -sce module.sce
+.END
diff --git a/configmgr/source/README b/configmgr/source/README
index 6d19a3b78610..b731043d34ed 100644
--- a/configmgr/source/README
+++ b/configmgr/source/README
@@ -76,6 +76,7 @@ update.cxx
data.cxx
lock.cxx
nodemap.cxx
+partial.cxx
path.hxx
type.cxx
Utilities.
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 7af9c1f8d9c0..190db364cdfe 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -1229,7 +1229,19 @@ rtl::OUString Access::getHierarchicalName() throw (css::uno::RuntimeException) {
OSL_ASSERT(thisIs(IS_ANY));
osl::MutexGuard g(lock);
checkLocalizedPropertyAccess();
- return getRelativePathRepresentation();
+ // For backwards compatibility, return an absolute path representation where
+ // available:
+ rtl::OUStringBuffer path;
+ rtl::Reference< RootAccess > root(getRootAccess());
+ if (root.is()) {
+ path.append(root->getAbsolutePathRepresentation());
+ }
+ rtl::OUString rel(getRelativePathRepresentation());
+ if (path.getLength() != 0 && rel.getLength() != 0) {
+ path.append(sal_Unicode('/'));
+ }
+ path.append(rel);
+ return path.makeStringAndClear();
}
rtl::OUString Access::composeHierarchicalName(
@@ -1917,7 +1929,7 @@ css::uno::Reference< css::uno::XInterface > Access::createInstance()
tmplName),
static_cast< cppu::OWeakObject * >(this));
}
- rtl::Reference< Node > node(tmpl->clone());
+ rtl::Reference< Node > node(tmpl->clone(true));
node->setLayer(Data::NO_LAYER);
return static_cast< cppu::OWeakObject * >(
new ChildAccess(components_, getRootAccess(), node));
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 51a1a6547d9b..04e6317c959d 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -46,6 +46,7 @@
#include "osl/diagnose.h"
#include "osl/file.hxx"
#include "rtl/bootstrap.hxx"
+#include "rtl/logfile.h"
#include "rtl/ref.hxx"
#include "rtl/string.h"
#include "rtl/textenc.h"
@@ -58,6 +59,7 @@
#include "modifications.hxx"
#include "node.hxx"
#include "parsemanager.hxx"
+#include "partial.hxx"
#include "rootaccess.hxx"
#include "writemodfile.hxx"
#include "xcdparser.hxx"
@@ -82,26 +84,29 @@ struct UnresolvedListItem {
typedef std::list< UnresolvedListItem > UnresolvedList;
-void parseXcsFile(rtl::OUString const & url, int layer, Data * data,
+void parseXcsFile(
+ rtl::OUString const & url, int layer, Data & data, Partial const * partial,
Modifications * modifications)
SAL_THROW((
css::container::NoSuchElementException, css::uno::RuntimeException))
{
- OSL_ASSERT(modifications == 0); (void) modifications;
+ OSL_ASSERT(partial == 0 && modifications == 0);
+ (void) partial; (void) modifications;
OSL_VERIFY(
rtl::Reference< ParseManager >(
new ParseManager(url, new XcsParser(layer, data)))->parse());
}
void parseXcuFile(
- rtl::OUString const & url, int layer, Data * data,
+ rtl::OUString const & url, int layer, Data & data, Partial const * partial,
Modifications * modifications)
SAL_THROW((
css::container::NoSuchElementException, css::uno::RuntimeException))
{
OSL_VERIFY(
rtl::Reference< ParseManager >(
- new ParseManager(url, new XcuParser(layer, data, modifications)))->
+ new ParseManager(
+ url, new XcuParser(layer, data, partial, modifications)))->
parse());
}
@@ -112,7 +117,7 @@ rtl::OUString expand(rtl::OUString const & str) {
}
static bool singletonCreated = false;
-static Components * singleton; // leaks
+static Components * singleton = 0;
}
@@ -122,7 +127,8 @@ void Components::initSingleton(
OSL_ASSERT(context.is());
if (!singletonCreated) {
singletonCreated = true;
- singleton = new Components(context);
+ static Components theSingleton(context);
+ singleton = &theSingleton;
}
}
@@ -143,11 +149,12 @@ bool Components::allLocales(rtl::OUString const & locale) {
}
rtl::Reference< Node > Components::resolvePathRepresentation(
- rtl::OUString const & pathRepresentation, Path * path,
- int * finalizedLayer) const
+ rtl::OUString const & pathRepresentation,
+ rtl::OUString * canonicRepresentation, Path * path, int * finalizedLayer)
+ const
{
return data_.resolvePathRepresentation(
- pathRepresentation, path, finalizedLayer);
+ pathRepresentation, canonicRepresentation, path, finalizedLayer);
}
rtl::Reference< Node > Components::getTemplate(
@@ -211,7 +218,7 @@ void Components::insertExtensionXcsFile(
bool shared, rtl::OUString const & fileUri)
{
try {
- parseXcsFile(fileUri, shared ? 9 : 13, &data_, 0);
+ parseXcsFile(fileUri, shared ? 9 : 13, data_, 0, 0);
} catch (css::container::NoSuchElementException & e) {
throw css::uno::RuntimeException(
(rtl::OUString(
@@ -227,7 +234,7 @@ void Components::insertExtensionXcuFile(
{
OSL_ASSERT(modifications != 0);
try {
- parseXcuFile(fileUri, shared ? 10 : 14, &data_, modifications);
+ parseXcuFile(fileUri, shared ? 10 : 14, data_, 0, modifications);
} catch (css::container::NoSuchElementException & e) {
throw css::uno::RuntimeException(
(rtl::OUString(
@@ -238,6 +245,24 @@ void Components::insertExtensionXcuFile(
}
}
+void Components::insertModificationXcuFile(
+ rtl::OUString const & fileUri,
+ std::set< rtl::OUString > const & includedPaths,
+ std::set< rtl::OUString > const & excludedPaths,
+ Modifications * modifications)
+{
+ OSL_ASSERT(modifications != 0);
+ try {
+ Partial part(includedPaths, excludedPaths);
+ parseXcuFile(fileUri, Data::NO_LAYER, data_, &part, modifications);
+ } catch (css::uno::Exception & e) { //TODO: more specific exception catching
+ OSL_TRACE(
+ "configmgr error inserting %s: %s",
+ rtl::OUStringToOString(fileUri, RTL_TEXTENCODING_UTF8).getStr(),
+ rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ }
+}
+
css::beans::Optional< css::uno::Any > Components::getExternalValue(
rtl::OUString const & descriptor)
{
@@ -315,7 +340,7 @@ Components::Components(
context_(context)
{
OSL_ASSERT(context.is());
-/*SB*/try{
+ RTL_LOGFILE_TRACE_AUTHOR("configmgr", "sb", "begin parsing");
parseXcsXcuLayer(
0,
expand(
@@ -344,22 +369,22 @@ Components::Components(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"$BRAND_BASE_DIR/share/registry/modules"))));
- parseXcsXcuLayer( //TODO: migrate
+ parseXcsXcuIniLayer(
7,
expand(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno")
- ":UNO_SHARED_PACKAGES_CACHE}/registry/"
+ ":BUNDLED_EXTENSIONS_USER}/registry/"
"com.sun.star.comp.deployment.configuration."
- "PackageRegistryBackend/registry"))));
+ "PackageRegistryBackend/configmgr.ini"))));
parseXcsXcuIniLayer(
9,
expand(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno")
- ":UNO_SHARED_PACKAGES_CACHE}/registry/"
+ ":SHARED_EXTENSIONS_USER}/registry/"
"com.sun.star.comp.deployment.configuration."
"PackageRegistryBackend/configmgr.ini"))));
parseXcsXcuLayer( //TODO: migrate
@@ -380,24 +405,22 @@ Components::Components(
":UNO_USER_PACKAGES_CACHE}/registry/"
"com.sun.star.comp.deployment.configuration."
"PackageRegistryBackend/configmgr.ini"))));
-/*SB*/}catch(css::uno::Exception&e){fprintf(stderr,"caught <%s>\n",rtl::OUStringToOString(e.Message,RTL_TEXTENCODING_UTF8).getStr());throw;}
try {
parseModificationLayer();
} catch (css::uno::Exception & e) { //TODO: more specific exception catching
- // Silently ignore unreadable parts of a corrupted
- // registrymodifications.xcu file, instead of completely preventing OOo
- // from starting:
+ // Silently ignore unreadable parts of a corrupted user modification
+ // layer, instead of completely preventing OOo from starting:
OSL_TRACE(
"configmgr error reading user modification layer: %s",
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,
- void (* parseFile)(rtl::OUString const &, int, Data *, Modifications *),
+ int layer, rtl::OUString const & extension, FileParser * parseFile,
rtl::OUString const & url, bool recursive)
{
osl::Directory dir(url);
@@ -447,7 +470,7 @@ void Components::parseFiles(
file.match(extension, file.getLength() - extension.getLength()))
{
try {
- (*parseFile)(stat.getFileURL(), layer, &data_, 0);
+ (*parseFile)(stat.getFileURL(), layer, data_, 0, 0);
} catch (css::container::NoSuchElementException & e) {
throw css::uno::RuntimeException(
(rtl::OUString(
@@ -462,23 +485,20 @@ void Components::parseFiles(
}
void Components::parseFileList(
- int layer,
- void (* parseFile)(rtl::OUString const &, int, Data *, Modifications *),
- rtl::OUString const & urls, rtl::Bootstrap const & ini)
+ int layer, FileParser * parseFile, rtl::OUString const & urls,
+ rtl::Bootstrap const & ini)
{
for (sal_Int32 i = 0;;) {
rtl::OUString url(urls.getToken(0, ' ', i));
if (url.getLength() != 0) {
ini.expandMacrosFrom(url); //TODO: detect failure
try {
- (*parseFile)(url, layer, &data_, 0);
+ (*parseFile)(url, layer, data_, 0, 0);
} catch (css::container::NoSuchElementException & e) {
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "stat'ed file does not exist: ")) +
- e.Message),
- css::uno::Reference< css::uno::XInterface >());
+ OSL_TRACE(
+ "configmgr file does not exist: %s",
+ rtl::OUStringToOString(
+ e.Message, RTL_TEXTENCODING_UTF8).getStr());
}
}
if (i == -1) {
@@ -539,7 +559,7 @@ void Components::parseXcdFiles(int layer, rtl::OUString const & url) {
rtl::Reference< ParseManager > manager;
try {
manager = new ParseManager(
- stat.getFileURL(), new XcdParser(layer, deps, &data_));
+ stat.getFileURL(), new XcdParser(layer, deps, data_));
} catch (css::container::NoSuchElementException & e) {
throw css::uno::RuntimeException(
(rtl::OUString(
@@ -630,7 +650,7 @@ rtl::OUString Components::getModificationFileUrl() const {
void Components::parseModificationLayer() {
try {
- parseXcuFile(getModificationFileUrl(), Data::NO_LAYER, &data_, 0);
+ parseXcuFile(getModificationFileUrl(), Data::NO_LAYER, data_, 0, 0);
} catch (css::container::NoSuchElementException &) {
OSL_TRACE(
"configmgr user registrymodifications.xcu does not (yet) exist");
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index 8523b02cbbaf..2e635680c1ce 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -58,6 +58,7 @@ namespace configmgr {
class Broadcaster;
class Modifications;
class Node;
+class Partial;
class RootAccess;
class Components: private boost::noncopyable {
@@ -71,8 +72,9 @@ public:
static bool allLocales(rtl::OUString const & locale);
rtl::Reference< Node > resolvePathRepresentation(
- rtl::OUString const & pathRepresentation, Path * path,
- int * finalizedLayer) const;
+ rtl::OUString const & pathRepresentation,
+ rtl::OUString * canonicRepresenation, Path * path, int * finalizedLayer)
+ const;
rtl::Reference< Node > getTemplate(
int layer, rtl::OUString const & fullName) const;
@@ -96,10 +98,19 @@ public:
bool shared, rtl::OUString const & fileUri,
Modifications * modifications);
+ void insertModificationXcuFile(
+ rtl::OUString const & fileUri,
+ std::set< rtl::OUString > const & includedPaths,
+ std::set< rtl::OUString > const & excludedPaths,
+ Modifications * modifications);
+
com::sun::star::beans::Optional< com::sun::star::uno::Any >
getExternalValue(rtl::OUString const & descriptor);
private:
+ typedef void FileParser(
+ rtl::OUString const &, int, Data &, Partial const *, Modifications *);
+
Components(
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
const & context);
@@ -107,14 +118,12 @@ private:
~Components();
void parseFiles(
- int layer, rtl::OUString const & extension,
- void (* parseFile)(rtl::OUString const &, int, Data *, Modifications *),
+ int layer, rtl::OUString const & extension, FileParser * parseFile,
rtl::OUString const & url, bool recursive);
void parseFileList(
- int layer,
- void (* parseFile)(rtl::OUString const &, int, Data *, Modifications *),
- rtl::OUString const & urls, rtl::Bootstrap const & ini);
+ int layer, FileParser * parseFile, rtl::OUString const & urls,
+ rtl::Bootstrap const & ini);
void parseXcdFiles(int layer, rtl::OUString const & url);
diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx
index 5540a40fd5f4..e12f9596940b 100644
--- a/configmgr/source/data.cxx
+++ b/configmgr/source/data.cxx
@@ -205,7 +205,8 @@ rtl::Reference< Node > Data::findNode(
}
rtl::Reference< Node > Data::resolvePathRepresentation(
- rtl::OUString const & pathRepresentation, Path * path, int * finalizedLayer)
+ rtl::OUString const & pathRepresentation,
+ rtl::OUString * canonicRepresentation, Path * path, int * finalizedLayer)
const
{
if (pathRepresentation.getLength() == 0 || pathRepresentation[0] != '/') {
@@ -216,6 +217,7 @@ rtl::Reference< Node > Data::resolvePathRepresentation(
}
rtl::OUString seg;
bool setElement;
+ rtl::OUString templateName;
sal_Int32 n = parseSegment(pathRepresentation, 1, &seg, &setElement, 0);
if (n == -1 || setElement)
{
@@ -225,6 +227,7 @@ rtl::Reference< Node > Data::resolvePathRepresentation(
css::uno::Reference< css::uno::XInterface >());
}
NodeMap::const_iterator i(components.find(seg));
+ rtl::OUStringBuffer canonic;
if (path != 0) {
path->clear();
}
@@ -234,6 +237,10 @@ rtl::Reference< Node > Data::resolvePathRepresentation(
if (!p.is()) {
return p;
}
+ if (canonicRepresentation != 0) {
+ canonic.append(sal_Unicode('/'));
+ canonic.append(createSegment(templateName, seg));
+ }
if (path != 0) {
path->push_back(seg);
}
@@ -248,13 +255,16 @@ rtl::Reference< Node > Data::resolvePathRepresentation(
}
// for backwards compatibility, ignore a final slash
if (n == pathRepresentation.getLength()) {
+ if (canonicRepresentation != 0) {
+ *canonicRepresentation = canonic.makeStringAndClear();
+ }
if (finalizedLayer != 0) {
*finalizedLayer = finalized;
}
return p;
}
parent = p;
- rtl::OUString templateName;
+ templateName = rtl::OUString();
n = parseSegment(
pathRepresentation, n, &seg, &setElement, &templateName);
if (n == -1) {
diff --git a/configmgr/source/data.hxx b/configmgr/source/data.hxx
index 495ca1233878..52353d066b67 100644
--- a/configmgr/source/data.hxx
+++ b/configmgr/source/data.hxx
@@ -74,8 +74,9 @@ struct Data: private boost::noncopyable {
int layer, NodeMap const & map, rtl::OUString const & name);
rtl::Reference< Node > resolvePathRepresentation(
- rtl::OUString const & pathRepresentation, Path * path,
- int * finalizedLayer) const;
+ rtl::OUString const & pathRepresentation,
+ rtl::OUString * canonicRepresenation, Path * path, int * finalizedLayer)
+ const;
rtl::Reference< Node > getTemplate(
int layer, rtl::OUString const & fullName) const;
diff --git a/configmgr/source/groupnode.cxx b/configmgr/source/groupnode.cxx
index 60d825451d69..59c0f89df5d1 100644
--- a/configmgr/source/groupnode.cxx
+++ b/configmgr/source/groupnode.cxx
@@ -44,8 +44,8 @@ GroupNode::GroupNode(
mandatory_(Data::NO_LAYER)
{}
-rtl::Reference< Node > GroupNode::clone() const {
- return new GroupNode(*this);
+rtl::Reference< Node > GroupNode::clone(bool keepTemplateName) const {
+ return new GroupNode(*this, keepTemplateName);
}
NodeMap & GroupNode::getMembers() {
@@ -68,11 +68,13 @@ bool GroupNode::isExtensible() const {
return extensible_;
}
-GroupNode::GroupNode(GroupNode const & other):
- Node(other), extensible_(other.extensible_),
- templateName_(other.templateName_), mandatory_(other.mandatory_)
+GroupNode::GroupNode(GroupNode const & other, bool keepTemplateName):
+ Node(other), extensible_(other.extensible_), mandatory_(other.mandatory_)
{
cloneNodeMap(other.members_, &members_);
+ if (keepTemplateName) {
+ templateName_ = other.templateName_;
+ }
}
GroupNode::~GroupNode() {}
diff --git a/configmgr/source/groupnode.hxx b/configmgr/source/groupnode.hxx
index be4907b86ce3..9d7bbbafa5b3 100644
--- a/configmgr/source/groupnode.hxx
+++ b/configmgr/source/groupnode.hxx
@@ -42,7 +42,7 @@ class GroupNode: public Node {
public:
GroupNode(int layer, bool extensible, rtl::OUString const & templateName);
- virtual rtl::Reference< Node > clone() const;
+ virtual rtl::Reference< Node > clone(bool keepTemplateName) const;
virtual NodeMap & getMembers();
@@ -55,7 +55,7 @@ public:
bool isExtensible() const;
private:
- GroupNode(GroupNode const & other);
+ GroupNode(GroupNode const & other, bool keepTemplateName);
virtual ~GroupNode();
diff --git a/configmgr/source/localizedpropertynode.cxx b/configmgr/source/localizedpropertynode.cxx
index 9c5fa3328a58..54560d7aded4 100644
--- a/configmgr/source/localizedpropertynode.cxx
+++ b/configmgr/source/localizedpropertynode.cxx
@@ -51,7 +51,7 @@ LocalizedPropertyNode::LocalizedPropertyNode(
Node(layer), staticType_(staticType), nillable_(nillable)
{}
-rtl::Reference< Node > LocalizedPropertyNode::clone() const {
+rtl::Reference< Node > LocalizedPropertyNode::clone(bool) const {
return new LocalizedPropertyNode(*this);
}
diff --git a/configmgr/source/localizedpropertynode.hxx b/configmgr/source/localizedpropertynode.hxx
index d5a16af0e54d..4ebcf8e243da 100644
--- a/configmgr/source/localizedpropertynode.hxx
+++ b/configmgr/source/localizedpropertynode.hxx
@@ -47,7 +47,7 @@ class LocalizedPropertyNode: public Node {
public:
LocalizedPropertyNode(int layer, Type staticType, bool nillable);
- virtual rtl::Reference< Node > clone() const;
+ virtual rtl::Reference< Node > clone(bool keepTemplateName) const;
virtual NodeMap & getMembers();
diff --git a/configmgr/source/localizedvaluenode.cxx b/configmgr/source/localizedvaluenode.cxx
index f6246106c8fe..c0e3bc333187 100644
--- a/configmgr/source/localizedvaluenode.cxx
+++ b/configmgr/source/localizedvaluenode.cxx
@@ -48,7 +48,7 @@ LocalizedValueNode::LocalizedValueNode(int layer, css::uno::Any const & value):
Node(layer), value_(value)
{}
-rtl::Reference< Node > LocalizedValueNode::clone() const {
+rtl::Reference< Node > LocalizedValueNode::clone(bool) const {
return new LocalizedValueNode(*this);
}
diff --git a/configmgr/source/localizedvaluenode.hxx b/configmgr/source/localizedvaluenode.hxx
index 7f8a5dd987ce..bfcbdea1de51 100644
--- a/configmgr/source/localizedvaluenode.hxx
+++ b/configmgr/source/localizedvaluenode.hxx
@@ -43,7 +43,7 @@ class LocalizedValueNode: public Node {
public:
LocalizedValueNode(int layer, com::sun::star::uno::Any const & value);
- virtual rtl::Reference< Node > clone() const;
+ virtual rtl::Reference< Node > clone(bool keepTemplateName) const;
virtual rtl::OUString getTemplateName() const;
diff --git a/configmgr/source/makefile.mk b/configmgr/source/makefile.mk
index d6972e12b9d8..777fed3323d8 100644
--- a/configmgr/source/makefile.mk
+++ b/configmgr/source/makefile.mk
@@ -34,7 +34,7 @@ VISIBILITY_HIDDEN = TRUE
.INCLUDE: settings.mk
-CDEFS += -DOOO_DLLIMPLEMENTATION_CONFIGMGR
+DLLPRE =
SLOFILES = \
$(SLO)/access.obj \
@@ -54,6 +54,7 @@ SLOFILES = \
$(SLO)/nodemap.obj \
$(SLO)/pad.obj \
$(SLO)/parsemanager.obj \
+ $(SLO)/partial.obj \
$(SLO)/propertynode.obj \
$(SLO)/rootaccess.obj \
$(SLO)/services.obj \
@@ -76,7 +77,7 @@ SHL1STDLIBS = \
$(CPPULIB) \
$(SALHELPERLIB) \
$(SALLIB)
-SHL1TARGET = configmgr
+SHL1TARGET = configmgr.uno
SHL1USE_EXPORTS = name
DEF1NAME = $(SHL1TARGET)
diff --git a/configmgr/source/node.hxx b/configmgr/source/node.hxx
index 10f168520595..7c9417e68ea9 100644
--- a/configmgr/source/node.hxx
+++ b/configmgr/source/node.hxx
@@ -46,7 +46,7 @@ public:
virtual Kind kind() const = 0;
- virtual rtl::Reference< Node > clone() const = 0;
+ virtual rtl::Reference< Node > clone(bool keepTemplateName) const = 0;
virtual NodeMap & getMembers();
diff --git a/configmgr/source/nodemap.cxx b/configmgr/source/nodemap.cxx
index 6b22863b5672..8e4d06030bdf 100644
--- a/configmgr/source/nodemap.cxx
+++ b/configmgr/source/nodemap.cxx
@@ -42,7 +42,7 @@ void cloneNodeMap(NodeMap const & source, NodeMap * target) {
OSL_ASSERT(target != 0 && target->empty());
NodeMap clone(source);
for (NodeMap::iterator i(clone.begin()); i != clone.end(); ++i) {
- i->second = i->second->clone();
+ i->second = i->second->clone(true);
}
std::swap(clone, *target);
}
diff --git a/configmgr/source/partial.cxx b/configmgr/source/partial.cxx
new file mode 100644
index 000000000000..4c9189ed05c4
--- /dev/null
+++ b/configmgr/source/partial.cxx
@@ -0,0 +1,137 @@
+/*************************************************************************
+*
+* 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 <map>
+#include <set>
+
+#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 "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "data.hxx"
+#include "partial.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+bool parseSegment(
+ rtl::OUString const & path, sal_Int32 * index, rtl::OUString * segment)
+{
+ OSL_ASSERT(
+ index != 0 && *index >= 0 && *index <= path.getLength() &&
+ segment != 0);
+ if (path[(*index)++] == '/') {
+ rtl::OUString name;
+ bool setElement;
+ rtl::OUString templateName;
+ *index = Data::parseSegment(
+ path, *index, &name, &setElement, &templateName);
+ if (*index != -1) {
+ *segment = Data::createSegment(templateName, name);
+ return *index == path.getLength();
+ }
+ }
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad path ")) + path,
+ css::uno::Reference< css::uno::XInterface >());
+}
+
+}
+
+Partial::Partial(
+ std::set< rtl::OUString > const & includedPaths,
+ std::set< rtl::OUString > const & excludedPaths)
+{
+ for (std::set< rtl::OUString >::const_iterator i(includedPaths.begin());
+ i != includedPaths.end(); ++i)
+ {
+ sal_Int32 n = 0;
+ for (Node * p = &root_;;) {
+ rtl::OUString seg;
+ bool end = parseSegment(*i, &n, &seg);
+ p = &p->children[seg];
+ if (p->startInclude) {
+ break;
+ }
+ if (end) {
+ p->children.clear();
+ p->startInclude = true;
+ break;
+ }
+ }
+ }
+ for (std::set< rtl::OUString >::const_iterator i(excludedPaths.begin());
+ i != excludedPaths.end(); ++i)
+ {
+ sal_Int32 n = 0;
+ for (Node * p = &root_;;) {
+ rtl::OUString seg;
+ bool end = parseSegment(*i, &n, &seg);
+ if (end) {
+ p->children[seg] = Node();
+ break;
+ }
+ Node::Children::iterator j(p->children.find(seg));
+ if (j == p->children.end()) {
+ break;
+ }
+ p = &j->second;
+ }
+ }
+}
+
+Partial::~Partial() {}
+
+Partial::Containment Partial::contains(Path const & path) const {
+ //TODO: For set elements, the segment names recorded in the node tree need
+ // not match the corresponding path segments, so this function can fail.
+ Node const * p = &root_;
+ bool includes = false;
+ for (Path::const_iterator i(path.begin()); i != path.end(); ++i) {
+ Node::Children::const_iterator j(p->children.find(*i));
+ if (j == p->children.end()) {
+ break;
+ }
+ p = &j->second;
+ includes |= p->startInclude;
+ }
+ return p->children.empty() && !p->startInclude
+ ? CONTAINS_NOT
+ : includes ? CONTAINS_NODE : CONTAINS_SUBNODES;
+}
+
+}
diff --git a/configmgr/source/partial.hxx b/configmgr/source/partial.hxx
new file mode 100644
index 000000000000..39931448c66d
--- /dev/null
+++ b/configmgr/source/partial.hxx
@@ -0,0 +1,71 @@
+/*************************************************************************
+*
+* 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_PARTIAL_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_PARTIAL_HXX
+
+#include "sal/config.h"
+
+#include <map>
+#include <set>
+
+#include "boost/noncopyable.hpp"
+
+#include "path.hxx"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class Partial: private boost::noncopyable {
+public:
+ enum Containment { CONTAINS_NOT, CONTAINS_SUBNODES, CONTAINS_NODE };
+
+ Partial(
+ std::set< rtl::OUString > const & includedPaths,
+ std::set< rtl::OUString > const & excludedPaths);
+
+ ~Partial();
+
+ Containment contains(Path const & path) const;
+
+private:
+ struct Node {
+ typedef std::map< rtl::OUString, Node > Children;
+
+ Node(): startInclude(false) {}
+
+ Children children;
+ bool startInclude;
+ };
+
+ Node root_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/propertynode.cxx b/configmgr/source/propertynode.cxx
index 070b56d9be9a..f3e459998e7e 100644
--- a/configmgr/source/propertynode.cxx
+++ b/configmgr/source/propertynode.cxx
@@ -55,7 +55,7 @@ PropertyNode::PropertyNode(
extension_(extension)
{}
-rtl::Reference< Node > PropertyNode::clone() const {
+rtl::Reference< Node > PropertyNode::clone(bool) const {
return new PropertyNode(*this);
}
diff --git a/configmgr/source/propertynode.hxx b/configmgr/source/propertynode.hxx
index 1566cbf72dbe..506526ffcc1e 100644
--- a/configmgr/source/propertynode.hxx
+++ b/configmgr/source/propertynode.hxx
@@ -48,7 +48,7 @@ public:
int layer, Type staticType, bool nillable,
com::sun::star::uno::Any const & value, bool extension);
- virtual rtl::Reference< Node > clone() const;
+ virtual rtl::Reference< Node > clone(bool keepTemplateName) const;
Type getStaticType() const;
diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx
index f8ccc6a31546..95a346d720c2 100644
--- a/configmgr/source/rootaccess.cxx
+++ b/configmgr/source/rootaccess.cxx
@@ -113,6 +113,11 @@ void RootAccess::release() throw () {
Access::release();
}
+rtl::OUString RootAccess::getAbsolutePathRepresentation() {
+ getNode(); // turn pathRepresentation_ into canonic form
+ return pathRepresentation_;
+}
+
rtl::OUString RootAccess::getLocale() const {
return locale_;
}
@@ -136,9 +141,10 @@ rtl::OUString RootAccess::getRelativePathRepresentation() {
rtl::Reference< Node > RootAccess::getNode() {
if (!node_.is()) {
+ rtl::OUString canonic;
int finalizedLayer;
node_ = getComponents().resolvePathRepresentation(
- pathRepresentation_, &path_, &finalizedLayer);
+ pathRepresentation_, &canonic, &path_, &finalizedLayer);
if (!node_.is()) {
throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cannot find ")) +
@@ -150,6 +156,7 @@ rtl::Reference< Node > RootAccess::getNode() {
// queryInterface on it would cause trouble; therefore,
// RuntimeException.Context is left null here
}
+ pathRepresentation_ = canonic;
OSL_ASSERT(!path_.empty());
name_ = path_.back();
finalized_ = finalizedLayer != Data::NO_LAYER;
@@ -285,7 +292,7 @@ void RootAccess::commitChanges()
Modifications globalMods;
commitChildChanges(
((getComponents().resolvePathRepresentation(
- pathRepresentation_, 0, &finalizedLayer)
+ pathRepresentation_, 0, 0, &finalizedLayer)
== node_) &&
finalizedLayer == Data::NO_LAYER),
&globalMods);
diff --git a/configmgr/source/rootaccess.hxx b/configmgr/source/rootaccess.hxx
index 45d4193d70de..77d945cdbbed 100644
--- a/configmgr/source/rootaccess.hxx
+++ b/configmgr/source/rootaccess.hxx
@@ -78,6 +78,8 @@ public:
virtual void SAL_CALL release() throw ();
+ rtl::OUString getAbsolutePathRepresentation();
+
rtl::OUString getLocale() const;
bool isUpdate() const;
diff --git a/configmgr/source/services.cxx b/configmgr/source/services.cxx
index 3a009b3cee15..f8c3289664ef 100644
--- a/configmgr/source/services.cxx
+++ b/configmgr/source/services.cxx
@@ -44,6 +44,7 @@
#include "configurationprovider.hxx"
#include "configurationregistry.hxx"
#include "defaultprovider.hxx"
+#include "update.hxx"
namespace {
@@ -67,6 +68,9 @@ static cppu::ImplementationEntry const services[] = {
{ &dummy, &configmgr::configuration_registry::getImplementationName,
&configmgr::configuration_registry::getSupportedServiceNames,
&configmgr::configuration_registry::createFactory, 0, 0 },
+ { &dummy, &configmgr::update::getImplementationName,
+ &configmgr::update::getSupportedServiceNames,
+ &configmgr::update::createFactory, 0, 0 },
{ 0, 0, 0, 0, 0, 0 }
};
@@ -107,6 +111,19 @@ extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
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(
diff --git a/configmgr/source/setnode.cxx b/configmgr/source/setnode.cxx
index f19c36c0bba5..465345a5f856 100644
--- a/configmgr/source/setnode.cxx
+++ b/configmgr/source/setnode.cxx
@@ -69,8 +69,8 @@ SetNode::SetNode(
templateName_(templateName), mandatory_(Data::NO_LAYER)
{}
-rtl::Reference< Node > SetNode::clone() const {
- return new SetNode(*this);
+rtl::Reference< Node > SetNode::clone(bool keepTemplateName) const {
+ return new SetNode(*this, keepTemplateName);
}
NodeMap & SetNode::getMembers() {
@@ -105,12 +105,15 @@ bool SetNode::isValidTemplate(rtl::OUString const & templateName) const {
additionalTemplateNames_.end());
}
-SetNode::SetNode(SetNode const & other):
+SetNode::SetNode(SetNode const & other, bool keepTemplateName):
Node(other), defaultTemplateName_(other.defaultTemplateName_),
additionalTemplateNames_(other.additionalTemplateNames_),
- templateName_(other.templateName_), mandatory_(other.mandatory_)
+ mandatory_(other.mandatory_)
{
cloneNodeMap(other.members_, &members_);
+ if (keepTemplateName) {
+ templateName_ = other.templateName_;
+ }
}
SetNode::~SetNode() {}
diff --git a/configmgr/source/setnode.hxx b/configmgr/source/setnode.hxx
index 7bf1ab0a199e..94ce537adda1 100644
--- a/configmgr/source/setnode.hxx
+++ b/configmgr/source/setnode.hxx
@@ -46,7 +46,7 @@ public:
int layer, rtl::OUString const & defaultTemplateName,
rtl::OUString const & templateName);
- virtual rtl::Reference< Node > clone() const;
+ virtual rtl::Reference< Node > clone(bool keepTemplateName) const;
virtual NodeMap & getMembers();
@@ -63,7 +63,7 @@ public:
bool isValidTemplate(rtl::OUString const & templateName) const;
private:
- SetNode(SetNode const & other);
+ SetNode(SetNode const & other, bool keepTemplateName);
virtual ~SetNode();
diff --git a/configmgr/source/update.cxx b/configmgr/source/update.cxx
index ab711c3bec10..4c1d59d5d054 100644
--- a/configmgr/source/update.cxx
+++ b/configmgr/source/update.cxx
@@ -28,27 +28,86 @@
#include "precompiled_configmgr.hxx"
#include "sal/config.h"
-#include "configmgr/update.hxx"
+#include <set>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/configuration/XUpdate.hpp"
+#include "com/sun/star/lang/XSingleComponentFactory.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/Sequence.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase1.hxx"
+#include "cppuhelper/weak.hxx"
#include "osl/mutex.hxx"
#include "rtl/ref.hxx"
+#include "rtl/unload.h"
+#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
+#include "sal/types.h"
#include "broadcaster.hxx"
#include "components.hxx"
#include "lock.hxx"
#include "modifications.hxx"
#include "rootaccess.hxx"
+#include "update.hxx"
+
+namespace configmgr { namespace update {
+
+namespace {
+
+namespace css = com::sun::star;
+
+std::set< rtl::OUString > seqToSet(
+ css::uno::Sequence< rtl::OUString > const & sequence)
+{
+ return std::set< rtl::OUString >(
+ sequence.getConstArray(),
+ sequence.getConstArray() + sequence.getLength());
+}
+
+class Service:
+ public cppu::WeakImplHelper1< css::configuration::XUpdate >,
+ private boost::noncopyable
+{
+public:
+ Service() {}
+
+private:
+ virtual ~Service() {}
+
+ virtual void SAL_CALL insertExtensionXcsFile(
+ sal_Bool shared, rtl::OUString const & fileUri)
+ throw (css::uno::RuntimeException);
-namespace configmgr {
+ virtual void SAL_CALL insertExtensionXcuFile(
+ sal_Bool shared, rtl::OUString const & fileUri)
+ throw (css::uno::RuntimeException);
-namespace update {
+ virtual void SAL_CALL insertModificationXcuFile(
+ rtl::OUString const & fileUri,
+ css::uno::Sequence< rtl::OUString > const & includedPaths,
+ css::uno::Sequence< rtl::OUString > const & excludedPaths)
+ throw (css::uno::RuntimeException);
+};
-void insertExtensionXcsFile(bool shared, rtl::OUString const & fileUri) {
+void Service::insertExtensionXcsFile(
+ sal_Bool shared, rtl::OUString const & fileUri)
+ throw (css::uno::RuntimeException)
+{
osl::MutexGuard g(lock);
Components::getSingleton().insertExtensionXcsFile(shared, fileUri);
}
-void insertExtensionXcuFile(bool shared, rtl::OUString const & fileUri) {
+void Service::insertExtensionXcuFile(
+ sal_Bool shared, rtl::OUString const & fileUri)
+ throw (css::uno::RuntimeException)
+{
Broadcaster bc;
{
osl::MutexGuard g(lock);
@@ -61,6 +120,91 @@ void insertExtensionXcuFile(bool shared, rtl::OUString const & fileUri) {
bc.send();
}
+void Service::insertModificationXcuFile(
+ rtl::OUString const & fileUri,
+ css::uno::Sequence< rtl::OUString > const & includedPaths,
+ css::uno::Sequence< rtl::OUString > const & excludedPaths)
+ throw (css::uno::RuntimeException)
+{
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ Modifications mods;
+ Components::getSingleton().insertModificationXcuFile(
+ fileUri, seqToSet(includedPaths), seqToSet(excludedPaths), &mods);
+ Components::getSingleton().initGlobalBroadcaster(
+ mods, rtl::Reference< RootAccess >(), &bc);
+ }
+ bc.send();
}
+class Factory:
+ public cppu::WeakImplHelper1< css::lang::XSingleComponentFactory >,
+ private boost::noncopyable
+{
+public:
+ Factory() {}
+
+private:
+ virtual ~Factory() {}
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithContext(
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any > const & Arguments,
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+};
+
+css::uno::Reference< css::uno::XInterface > Factory::createInstanceWithContext(
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ return createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any >(), Context);
+}
+
+css::uno::Reference< css::uno::XInterface >
+Factory::createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any > const & Arguments,
+ css::uno::Reference< css::uno::XComponentContext > const &)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ if (Arguments.getLength() != 0) {
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.Update must be"
+ " instantiated without arguments")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ return static_cast< cppu::OWeakObject * >(new Service);
+}
+
+}
+
+rtl::OUString getImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.Update"));
+}
+
+css::uno::Sequence< rtl::OUString > getSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.Update_Service"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
+}
+
+css::uno::Reference< css::lang::XSingleComponentFactory > createFactory(
+ cppu::ComponentFactoryFunc, rtl::OUString const &,
+ css::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
+ SAL_THROW(())
+{
+ return new Factory;
}
+
+} }
diff --git a/configmgr/source/update.hxx b/configmgr/source/update.hxx
new file mode 100644
index 000000000000..faa5c86b15fa
--- /dev/null
+++ b/configmgr/source/update.hxx
@@ -0,0 +1,59 @@
+/*************************************************************************
+*
+* 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_UPDATE_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_UPDATE_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "cppuhelper/factory.hxx"
+#include "rtl/unload.h"
+#include "sal/types.h"
+
+namespace com { namespace sun { namespace star { namespace lang {
+ class XSingleComponentFactory;
+} } } }
+namespace rtl { class OUString; }
+
+namespace configmgr { namespace update {
+
+rtl::OUString SAL_CALL getImplementationName();
+
+com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
+getSupportedServiceNames();
+
+com::sun::star::uno::Reference< com::sun::star::lang::XSingleComponentFactory >
+SAL_CALL createFactory(
+ cppu::ComponentFactoryFunc, rtl::OUString const &,
+ com::sun::star::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
+ SAL_THROW(());
+
+} }
+
+#endif
diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx
index f951aac5ca01..4adf452c409b 100644
--- a/configmgr/source/valueparser.cxx
+++ b/configmgr/source/valueparser.cxx
@@ -270,6 +270,10 @@ XmlReader::Text ValueParser::getTextMode() const {
if (node_.is()) {
switch (state_) {
case STATE_TEXT:
+ if (!items_.empty()) {
+ break;
+ }
+ // fall through
case STATE_IT:
return
(type_ == TYPE_STRING || type_ == TYPE_STRING_LIST ||
@@ -294,7 +298,9 @@ bool ValueParser::startElement(
name.equals(RTL_CONSTASCII_STRINGPARAM("it")) &&
isListType(type_) && separator_.getLength() == 0)
{
- checkEmptyPad(reader);
+ pad_.clear();
+ // before first <it>, characters are not ignored; assume they
+ // are only whitespace
state_ = STATE_IT;
return true;
}
@@ -351,7 +357,7 @@ bool ValueParser::startElement(
css::uno::Reference< css::uno::XInterface >());
}
-bool ValueParser::endElement(XmlReader const & reader) {
+bool ValueParser::endElement() {
if (!node_.is()) {
return false;
}
@@ -363,7 +369,6 @@ bool ValueParser::endElement(XmlReader const & reader) {
value = parseValue(separator_, pad_.get(), type_);
pad_.clear();
} else {
- checkEmptyPad(reader);
switch (type_) {
case TYPE_BOOLEAN_LIST:
value = convertItems< sal_Bool >();
@@ -454,17 +459,6 @@ int ValueParser::getLayer() const {
return layer_;
}
-void ValueParser::checkEmptyPad(XmlReader const & reader) const {
- if (pad_.is()) {
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "mixed text and <it> elements in ")) +
- reader.getUrl()),
- css::uno::Reference< css::uno::XInterface >());
- }
-}
-
template< typename T > css::uno::Any ValueParser::convertItems() {
css::uno::Sequence< T > seq(items_.size());
for (sal_Int32 i = 0; i < seq.getLength(); ++i) {
diff --git a/configmgr/source/valueparser.hxx b/configmgr/source/valueparser.hxx
index c328fe7eddce..4e899f4632dd 100644
--- a/configmgr/source/valueparser.hxx
+++ b/configmgr/source/valueparser.hxx
@@ -61,7 +61,7 @@ public:
bool startElement(
XmlReader & reader, XmlReader::Namespace ns, Span const & name);
- bool endElement(XmlReader const & reader);
+ bool endElement();
void characters(Span const & text);
@@ -75,8 +75,6 @@ public:
rtl::OString separator_;
private:
- void checkEmptyPad(XmlReader const & reader) const;
-
template< typename T > com::sun::star::uno::Any convertItems();
enum State { STATE_TEXT, STATE_TEXT_UNICODE, STATE_IT, STATE_IT_UNICODE };
diff --git a/configmgr/source/writemodfile.cxx b/configmgr/source/writemodfile.cxx
index a8e0f77cbd2e..c2573ab67439 100644
--- a/configmgr/source/writemodfile.cxx
+++ b/configmgr/source/writemodfile.cxx
@@ -451,9 +451,9 @@ void writeNode(
void writeModifications(
Components & components, oslFileHandle handle,
- rtl::OUString const & grandparentPathRepresentation,
- rtl::OUString const & parentName, rtl::Reference< Node > const & parent,
- rtl::OUString const & nodeName, rtl::Reference< Node > const & node,
+ rtl::OUString const & parentPathRepresentation,
+ rtl::Reference< Node > const & parent, rtl::OUString const & nodeName,
+ rtl::Reference< Node > const & node,
Modifications::Node const & modifications)
{
// It is never necessary to write oor:finalized or oor:mandatory attributes,
@@ -461,27 +461,15 @@ void writeModifications(
if (modifications.children.empty()) {
OSL_ASSERT(parent.is());
// components themselves have no parent but must have children
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("<item oor:path=\""));
+ writeAttributeValue(handle, parentPathRepresentation);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\">"));
if (node.is()) {
- writeData(handle, RTL_CONSTASCII_STRINGPARAM("<item oor:path=\""));
- writeAttributeValue(
- handle,
- (grandparentPathRepresentation +
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
- Data::createSegment(parent->getTemplateName(), parentName)));
- writeData(handle, RTL_CONSTASCII_STRINGPARAM("\">"));
writeNode(components, handle, parent, nodeName, node);
- writeData(handle, RTL_CONSTASCII_STRINGPARAM("</item>"));
} else {
- writeData(handle, RTL_CONSTASCII_STRINGPARAM("<item oor:path=\""));
switch (parent->kind()) {
case Node::KIND_LOCALIZED_PROPERTY:
- writeAttributeValue(handle, grandparentPathRepresentation);
- writeData(
- handle, RTL_CONSTASCII_STRINGPARAM("\"><prop oor:name=\""));
- writeAttributeValue(handle, parentName);
- writeData(
- handle,
- RTL_CONSTASCII_STRINGPARAM("\" oor:op=\"fuse\"><value"));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("<value"));
if (nodeName.getLength() != 0) {
writeData(
handle, RTL_CONSTASCII_STRINGPARAM(" xml:lang=\""));
@@ -489,61 +477,44 @@ void writeModifications(
writeData(handle, RTL_CONSTASCII_STRINGPARAM("\""));
}
writeData(
- handle,
- RTL_CONSTASCII_STRINGPARAM(
- " oor:op=\"remove\"/></prop></item>"));
+ handle, RTL_CONSTASCII_STRINGPARAM(" oor:op=\"remove\"/>"));
break;
case Node::KIND_GROUP:
OSL_ASSERT(
dynamic_cast< GroupNode * >(parent.get())->isExtensible());
- writeAttributeValue(
- handle,
- (grandparentPathRepresentation +
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
- Data::createSegment(
- parent->getTemplateName(), parentName)));
writeData(
- handle, RTL_CONSTASCII_STRINGPARAM("\"><prop oor:name=\""));
+ handle, RTL_CONSTASCII_STRINGPARAM("<prop oor:name=\""));
writeAttributeValue(handle, nodeName);
writeData(
handle,
- RTL_CONSTASCII_STRINGPARAM(
- "\" oor:op=\"remove\"/></item>"));
+ RTL_CONSTASCII_STRINGPARAM("\" oor:op=\"remove\"/>"));
break;
case Node::KIND_SET:
- writeAttributeValue(
- handle,
- (grandparentPathRepresentation +
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
- Data::createSegment(
- parent->getTemplateName(), parentName)));
writeData(
- handle, RTL_CONSTASCII_STRINGPARAM("\"><node oor:name=\""));
+ handle, RTL_CONSTASCII_STRINGPARAM("<node oor:name=\""));
writeAttributeValue(handle, nodeName);
writeData(
handle,
- RTL_CONSTASCII_STRINGPARAM(
- "\" oor:op=\"remove\"/></item>"));
+ RTL_CONSTASCII_STRINGPARAM("\" oor:op=\"remove\"/>"));
break;
default:
OSL_ASSERT(false); // this cannot happen
break;
}
}
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("</item>"));
} else {
- rtl::OUString parentPathRep;
- if (parent.is()) { // components themselves have no parent
- parentPathRep = grandparentPathRepresentation +
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
- Data::createSegment(parent->getTemplateName(), parentName);
- }
OSL_ASSERT(node.is());
+ rtl::OUString pathRep(
+ parentPathRepresentation +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
+ Data::createSegment(node->getTemplateName(), nodeName));
for (Modifications::Node::Children::const_iterator i(
modifications.children.begin());
i != modifications.children.end(); ++i)
{
writeModifications(
- components, handle, parentPathRep, nodeName, node, i->first,
+ components, handle, pathRep, node, i->first,
node->getMember(i->first), i->second);
}
}
@@ -605,9 +576,8 @@ void writeModFile(
j != data.modifications.getRoot().children.end(); ++j)
{
writeModifications(
- components, tmp.handle, rtl::OUString(), rtl::OUString(),
- rtl::Reference< Node >(), j->first,
- Data::findNode(Data::NO_LAYER, data.components, j->first),
+ components, tmp.handle, rtl::OUString(), rtl::Reference< Node >(),
+ j->first, Data::findNode(Data::NO_LAYER, data.components, j->first),
j->second);
}
writeData(tmp.handle, RTL_CONSTASCII_STRINGPARAM("</oor:items>"));
diff --git a/configmgr/source/xcdparser.cxx b/configmgr/source/xcdparser.cxx
index 8306c692c30f..498254b35644 100644
--- a/configmgr/source/xcdparser.cxx
+++ b/configmgr/source/xcdparser.cxx
@@ -53,7 +53,7 @@ namespace css = com::sun::star;
}
-XcdParser::XcdParser(int layer, Dependencies const & dependencies, Data * data):
+XcdParser::XcdParser(int layer, Dependencies const & dependencies, Data & data):
layer_(layer), dependencies_(dependencies), data_(data), state_(STATE_START)
{}
@@ -137,7 +137,7 @@ bool XcdParser::startElement(
if (ns == XmlReader::NAMESPACE_OOR &&
name.equals(RTL_CONSTASCII_STRINGPARAM("component-data")))
{
- nestedParser_ = new XcuParser(layer_ + 1, data_, 0);
+ nestedParser_ = new XcuParser(layer_ + 1, data_, 0, 0);
nesting_ = 1;
return nestedParser_->startElement(reader, ns, name);
}
diff --git a/configmgr/source/xcdparser.hxx b/configmgr/source/xcdparser.hxx
index 2e35b3686e60..2ad8ecea7f93 100644
--- a/configmgr/source/xcdparser.hxx
+++ b/configmgr/source/xcdparser.hxx
@@ -47,7 +47,7 @@ class XcdParser: public Parser {
public:
typedef std::set< rtl::OUString > Dependencies;
- XcdParser(int layer, Dependencies const & dependencies, Data * data);
+ XcdParser(int layer, Dependencies const & dependencies, Data & data);
private:
virtual ~XcdParser();
@@ -66,7 +66,7 @@ private:
int layer_;
Dependencies const & dependencies_;
- Data * data_;
+ Data & data_;
State state_;
rtl::OUString dependency_;
rtl::Reference< Parser > nestedParser_;
diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx
index 15141844a276..79e122759fc8 100644
--- a/configmgr/source/xcsparser.cxx
+++ b/configmgr/source/xcsparser.cxx
@@ -60,9 +60,66 @@ namespace {
namespace css = com::sun::star;
+// Conservatively merge a template or component (and its recursive parts) into
+// an existing instance:
+void merge(
+ rtl::Reference< Node > const & original,
+ rtl::Reference< Node > const & update)
+{
+ OSL_ASSERT(
+ original.is() && update.is() && original->kind() == update->kind() &&
+ update->getFinalized() == Data::NO_LAYER);
+ if (update->getLayer() >= original->getLayer() &&
+ update->getLayer() <= original->getFinalized())
+ {
+ switch (original->kind()) {
+ case Node::KIND_PROPERTY:
+ case Node::KIND_LOCALIZED_PROPERTY:
+ case Node::KIND_LOCALIZED_VALUE:
+ break; //TODO: merge certain parts?
+ case Node::KIND_GROUP:
+ for (NodeMap::iterator i2(update->getMembers().begin());
+ i2 != update->getMembers().end(); ++i2)
+ {
+ NodeMap::iterator i1(original->getMembers().find(i2->first));
+ if (i1 == original->getMembers().end()) {
+ if (i2->second->kind() == Node::KIND_PROPERTY &&
+ dynamic_cast< GroupNode * >(
+ original.get())->isExtensible())
+ {
+ original->getMembers().insert(*i2);
+ }
+ } else if (i2->second->kind() == i1->second->kind()) {
+ merge(i1->second, i2->second);
+ }
+ }
+ break;
+ case Node::KIND_SET:
+ for (NodeMap::iterator i2(update->getMembers().begin());
+ i2 != update->getMembers().end(); ++i2)
+ {
+ NodeMap::iterator i1(original->getMembers().find(i2->first));
+ if (i1 == original->getMembers().end()) {
+ if (dynamic_cast< SetNode * >(original.get())->
+ isValidTemplate(i2->second->getTemplateName()))
+ {
+ original->getMembers().insert(*i2);
+ }
+ } else if (i2->second->kind() == i1->second->kind() &&
+ (i2->second->getTemplateName() ==
+ i1->second->getTemplateName()))
+ {
+ merge(i1->second, i2->second);
+ }
+ }
+ break;
+ }
+ }
}
-XcsParser::XcsParser(int layer, Data * data):
+}
+
+XcsParser::XcsParser(int layer, Data & data):
valueParser_(layer), data_(data), state_(STATE_START)
{}
@@ -209,7 +266,7 @@ bool XcsParser::startElement(
}
void XcsParser::endElement(XmlReader const & reader) {
- if (valueParser_.endElement(reader)) {
+ if (valueParser_.endElement()) {
return;
}
if (ignoring_ > 0) {
@@ -218,15 +275,30 @@ void XcsParser::endElement(XmlReader const & reader) {
Element top(elements_.top());
elements_.pop();
if (top.node.is()) {
- NodeMap * map;
if (elements_.empty()) {
switch (state_) {
case STATE_TEMPLATES:
- map = &data_->templates;
+ {
+ NodeMap::iterator i(data_.templates.find(top.name));
+ if (i == data_.templates.end()) {
+ data_.templates.insert(
+ NodeMap::value_type(top.name, top.node));
+ } else {
+ merge(i->second, top.node);
+ }
+ }
break;
case STATE_COMPONENT:
- map = &data_->components;
- state_ = STATE_COMPONENT_DONE;
+ {
+ NodeMap::iterator i(data_.components.find(top.name));
+ if (i == data_.components.end()) {
+ data_.components.insert(
+ NodeMap::value_type(top.name, top.node));
+ } else {
+ merge(i->second, top.node);
+ }
+ state_ = STATE_COMPONENT_DONE;
+ }
break;
default:
OSL_ASSERT(false);
@@ -235,10 +307,9 @@ void XcsParser::endElement(XmlReader const & reader) {
RTL_CONSTASCII_USTRINGPARAM("this cannot happen")),
css::uno::Reference< css::uno::XInterface >());
}
- } else {
- map = &elements_.top().node->getMembers();
- }
- if (!map->insert(NodeMap::value_type(top.name, top.node)).second) {
+ } else if (!elements_.top().node->getMembers().insert(
+ NodeMap::value_type(top.name, top.node)).second)
+ {
throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("duplicate ")) +
top.name +
@@ -372,7 +443,7 @@ void XcsParser::handleNodeRef(XmlReader & reader) {
css::uno::Reference< css::uno::XInterface >());
}
rtl::Reference< Node > tmpl(
- data_->getTemplate(
+ data_.getTemplate(
valueParser_.getLayer(),
xmldata::parseTemplateReference(
component, hasNodeType, nodeType, 0)));
@@ -385,7 +456,7 @@ void XcsParser::handleNodeRef(XmlReader & reader) {
reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
}
- rtl::Reference< Node > node(tmpl->clone());
+ rtl::Reference< Node > node(tmpl->clone(false));
node->setLayer(valueParser_.getLayer());
elements_.push(Element(node, name));
}
diff --git a/configmgr/source/xcsparser.hxx b/configmgr/source/xcsparser.hxx
index 21a124945a2e..196add9a826a 100644
--- a/configmgr/source/xcsparser.hxx
+++ b/configmgr/source/xcsparser.hxx
@@ -48,7 +48,7 @@ struct Span;
class XcsParser: public Parser {
public:
- XcsParser(int layer, Data * data);
+ XcsParser(int layer, Data & data);
private:
virtual ~XcsParser();
@@ -94,7 +94,7 @@ private:
typedef std::stack< Element > ElementStack;
ValueParser valueParser_;
- Data * data_;
+ Data & data_;
rtl::OUString componentName_;
State state_;
long ignoring_;
diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx
index 220168c62725..eda478b18b70 100644
--- a/configmgr/source/xcuparser.cxx
+++ b/configmgr/source/xcuparser.cxx
@@ -49,6 +49,7 @@
#include "modifications.hxx"
#include "node.hxx"
#include "nodemap.hxx"
+#include "partial.hxx"
#include "path.hxx"
#include "propertynode.hxx"
#include "setnode.hxx"
@@ -65,14 +66,15 @@ namespace css = com::sun::star;
}
-XcuParser::XcuParser(int layer, Data * data, Modifications * modifications):
- valueParser_(layer), data_(data), modifications_(modifications)
-{
- if (layer == Data::NO_LAYER) {
- OSL_ASSERT(modifications_ == 0);
- modifications_ = &data_->modifications;
- }
-}
+XcuParser::XcuParser(
+ int layer, Data & data, Partial const * partial,
+ Modifications * broadcastModifications):
+ valueParser_(layer), data_(data),
+ partial_(partial), broadcastModifications_(broadcastModifications),
+ recordModifications_(layer == Data::NO_LAYER),
+ trackPath_(
+ partial_ != 0 || broadcastModifications_ != 0 || recordModifications_)
+{}
XcuParser::~XcuParser() {}
@@ -105,7 +107,7 @@ bool XcuParser::startElement(
css::uno::Reference< css::uno::XInterface >());
}
} else if (state_.top().ignore) {
- state_.push(state_.top());
+ state_.push(State(false));
} else if (!state_.top().node.is()) {
if (ns == XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("item")))
@@ -209,12 +211,12 @@ bool XcuParser::startElement(
return true;
}
-void XcuParser::endElement(XmlReader const & reader) {
- if (valueParser_.endElement(reader)) {
+void XcuParser::endElement(XmlReader const &) {
+ if (valueParser_.endElement()) {
return;
}
OSL_ASSERT(!state_.empty());
- bool ignore = state_.top().ignore;
+ bool pop = state_.top().pop;
rtl::Reference< Node > insert;
rtl::OUString name;
if (state_.top().insert) {
@@ -227,10 +229,10 @@ void XcuParser::endElement(XmlReader const & reader) {
OSL_ASSERT(!state_.empty() && state_.top().node.is());
state_.top().node->getMembers()[name] = insert;
}
- if (!ignore && !modificationPath_.empty()) {
- modificationPath_.pop_back();
+ if (pop && !path_.empty()) {
+ path_.pop_back();
// </item> will pop less than <item> pushed, but that is harmless,
- // as the next <item> will reset modificationPath_
+ // as the next <item> will reset path_
}
}
@@ -328,16 +330,27 @@ void XcuParser::handleComponentData(XmlReader & reader) {
}
componentName_ = xmldata::convertFromUtf8(
Span(buf.getStr(), buf.getLength()));
+ if (trackPath_) {
+ OSL_ASSERT(path_.empty());
+ path_.push_back(componentName_);
+ if (partial_ != 0 && partial_->contains(path_) == Partial::CONTAINS_NOT)
+ {
+ state_.push(State(true)); // ignored
+ return;
+ }
+ }
rtl::Reference< Node > node(
Data::findNode(
- valueParser_.getLayer(), data_->components, componentName_));
+ valueParser_.getLayer(), data_.components, componentName_));
if (!node.is()) {
- throw css::uno::RuntimeException(
- (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown component ")) +
- componentName_ +
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
- reader.getUrl()),
- css::uno::Reference< css::uno::XInterface >());
+ OSL_TRACE(
+ "configmgr unknown component %s in %s",
+ rtl::OUStringToOString(
+ componentName_, RTL_TEXTENCODING_UTF8).getStr(),
+ rtl::OUStringToOString(
+ reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr());
+ state_.push(State(true)); // ignored
+ return;
}
switch (op) {
case OPERATION_MODIFY:
@@ -356,10 +369,6 @@ void XcuParser::handleComponentData(XmlReader & reader) {
node->getFinalized());
node->setFinalized(finalizedLayer);
state_.push(State(node, finalizedLayer < valueParser_.getLayer()));
- if (modifications_ != 0) {
- OSL_ASSERT(modificationPath_.empty());
- modificationPath_.push_back(componentName_);
- }
}
void XcuParser::handleItem(XmlReader & reader) {
@@ -386,27 +395,44 @@ void XcuParser::handleItem(XmlReader & reader) {
rtl::OUString path(xmldata::convertFromUtf8(attrPath));
int finalizedLayer;
rtl::Reference< Node > node(
- data_->resolvePathRepresentation(
- path, &modificationPath_, &finalizedLayer));
+ data_.resolvePathRepresentation(
+ path, 0, &path_, &finalizedLayer));
if (!node.is()) {
- //TODO: Within Components::parseModificationLayer (but only there) it
- // can rightly happen that data is read that does not match a schema
- // (that no schema exists, or that the schema specifies a different
- // type), namely if the schema was brought along by an extension that
- // has been removed or replaced; instead of taking care of that at all
- // the relevant places, as a hack, only "top-level" <item>s (that only
- // appear in modification layer data) with unknown path are filtered out
- // here.
OSL_TRACE(
- "configmgr unknown <item path=\"%s\">",
- rtl::OUStringToOString(path, RTL_TEXTENCODING_UTF8).getStr());
- state_.push(State()); // ignored
+ "configmgr unknown item %s in %s",
+ rtl::OUStringToOString(path, RTL_TEXTENCODING_UTF8).getStr(),
+ rtl::OUStringToOString(
+ reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr());
+ state_.push(State(true)); // ignored
return;
}
- OSL_ASSERT(!modificationPath_.empty());
- componentName_ = modificationPath_.front();
- if (modifications_ == 0) {
- modificationPath_.clear();
+ OSL_ASSERT(!path_.empty());
+ componentName_ = path_.front();
+ if (trackPath_) {
+ if (partial_ != 0 && partial_->contains(path_) == Partial::CONTAINS_NOT)
+ {
+ state_.push(State(true)); // ignored
+ return;
+ }
+ } else {
+ path_.clear();
+ }
+ switch (node->kind()) {
+ case Node::KIND_PROPERTY:
+ case Node::KIND_LOCALIZED_VALUE:
+ OSL_TRACE(
+ "configmgr item of bad type %s in %s",
+ rtl::OUStringToOString(path, RTL_TEXTENCODING_UTF8).getStr(),
+ rtl::OUStringToOString(
+ reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr());
+ state_.push(State(true)); // ignored
+ return;
+ case Node::KIND_LOCALIZED_PROPERTY:
+ valueParser_.type_ = dynamic_cast< LocalizedPropertyNode * >(
+ node.get())->getStaticType();
+ break;
+ default:
+ break;
}
state_.push(State(node, finalizedLayer < valueParser_.getLayer()));
}
@@ -483,13 +509,13 @@ void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) {
css::uno::Reference< css::uno::XInterface >());
}
prop->setValue(valueParser_.getLayer(), css::uno::Any());
- state_.push(State());
+ state_.push(State(false));
} else if (external.getLength() == 0) {
valueParser_.separator_ = separator;
valueParser_.start(prop);
} else {
prop->setExternal(valueParser_.getLayer(), external);
- state_.push(State());
+ state_.push(State(false));
}
}
@@ -546,11 +572,20 @@ void XcuParser::handleLocpropValue(
op = parseOperation(reader.getAttributeValue(true));
}
}
+ if (trackPath_) {
+ path_.push_back(name);
+ if (partial_ != 0 &&
+ partial_->contains(path_) != Partial::CONTAINS_NODE)
+ {
+ state_.push(State(true)); // ignored
+ return;
+ }
+ }
NodeMap::iterator i(locprop->getMembers().find(name));
if (i != locprop->getMembers().end() &&
i->second->getLayer() > valueParser_.getLayer())
{
- state_.push(State()); // ignored
+ state_.push(State(true)); // ignored
return;
}
if (nil && !locprop->isNillable()) {
@@ -563,23 +598,29 @@ void XcuParser::handleLocpropValue(
}
switch (op) {
case OPERATION_FUSE:
- if (nil) {
- if (i == locprop->getMembers().end()) {
- locprop->getMembers()[name] = new LocalizedValueNode(
- valueParser_.getLayer(), css::uno::Any());
+ {
+ bool pop = false;
+ if (nil) {
+ if (i == locprop->getMembers().end()) {
+ locprop->getMembers()[name] = new LocalizedValueNode(
+ valueParser_.getLayer(), css::uno::Any());
+ } else {
+ dynamic_cast< LocalizedValueNode * >(
+ i->second.get())->setValue(
+ valueParser_.getLayer(), css::uno::Any());
+ }
+ state_.push(State(true));
} else {
- dynamic_cast< LocalizedValueNode * >(i->second.get())->setValue(
- valueParser_.getLayer(), css::uno::Any());
+ valueParser_.separator_ = separator;
+ valueParser_.start(locprop, name);
+ pop = true;
+ }
+ if (trackPath_) {
+ recordModification();
+ if (pop) {
+ path_.pop_back();
+ }
}
- state_.push(State());
- } else {
- valueParser_.separator_ = separator;
- valueParser_.start(locprop, name);
- }
- if (modifications_ != 0) {
- modificationPath_.push_back(name);
- modifications_->add(modificationPath_);
- modificationPath_.pop_back();
}
break;
case OPERATION_REMOVE:
@@ -588,12 +629,8 @@ void XcuParser::handleLocpropValue(
if (i != locprop->getMembers().end()) {
locprop->getMembers().erase(i);
}
- state_.push(State());
- if (modifications_ != 0) {
- modificationPath_.push_back(name);
- modifications_->add(modificationPath_);
- modificationPath_.pop_back();
- }
+ state_.push(State(true));
+ recordModification();
break;
default:
throw css::uno::RuntimeException(
@@ -643,6 +680,17 @@ void XcuParser::handleGroupProp(XmlReader & reader, GroupNode * group) {
reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
}
+ if (trackPath_) {
+ path_.push_back(name);
+ //TODO: This ignores locprop values for which specific include paths
+ // exist (i.e., for which contains(locprop path) = CONTAINS_SUBNODES):
+ if (partial_ != 0 &&
+ partial_->contains(path_) != Partial::CONTAINS_NODE)
+ {
+ state_.push(State(true)); // ignored
+ return;
+ }
+ }
NodeMap::iterator i(group->getMembers().find(name));
if (i == group->getMembers().end()) {
handleUnknownGroupProp(reader, group, name, type, op, finalized);
@@ -672,17 +720,10 @@ void XcuParser::handleUnknownGroupProp(
XmlReader const & reader, GroupNode * group, rtl::OUString const & name,
Type type, Operation operation, bool finalized)
{
- if (!group->isExtensible()) {
- throw css::uno::RuntimeException(
- (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown prop ")) +
- name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
- reader.getUrl()),
- css::uno::Reference< css::uno::XInterface >());
- }
switch (operation) {
case OPERATION_REPLACE:
case OPERATION_FUSE:
- {
+ if (group->isExtensible()) {
if (type == TYPE_ERROR) {
throw css::uno::RuntimeException(
(rtl::OUString(
@@ -701,17 +742,17 @@ void XcuParser::handleUnknownGroupProp(
prop->setFinalized(valueParser_.getLayer());
}
state_.push(State(prop, name, state_.top().locked));
- if (modifications_ != 0) {
- modificationPath_.push_back(name);
- modifications_->add(modificationPath_);
- }
+ recordModification();
+ break;
}
- break;
+ // fall through
default:
OSL_TRACE(
- "ignoring modify or remove of unknown (presumably extension)"
- " property");
- state_.push(State());
+ "configmgr unknown property %s in %s",
+ rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr(),
+ rtl::OUStringToOString(
+ reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr());
+ state_.push(State(true)); // ignored
break;
}
}
@@ -724,7 +765,7 @@ void XcuParser::handlePlainGroupProp(
PropertyNode * property = dynamic_cast< PropertyNode * >(
propertyIndex->second.get());
if (property->getLayer() > valueParser_.getLayer()) {
- state_.push(State()); // ignored
+ state_.push(State(true)); // ignored
return;
}
int finalizedLayer = std::min(
@@ -751,10 +792,7 @@ void XcuParser::handlePlainGroupProp(
property,
(state_.top().locked ||
finalizedLayer < valueParser_.getLayer())));
- if (modifications_ != 0) {
- modificationPath_.push_back(name);
- modifications_->add(modificationPath_);
- }
+ recordModification();
break;
case OPERATION_REMOVE:
if (!property->isExtension()) {
@@ -767,12 +805,8 @@ void XcuParser::handlePlainGroupProp(
css::uno::Reference< css::uno::XInterface >());
}
group->getMembers().erase(propertyIndex);
- state_.push(State()); // ignore children
- if (modifications_ != 0) {
- modificationPath_.push_back(name);
- modifications_->add(modificationPath_);
- modificationPath_.pop_back();
- }
+ state_.push(State(true)); // ignore children
+ recordModification();
break;
}
}
@@ -782,7 +816,7 @@ void XcuParser::handleLocalizedGroupProp(
rtl::OUString const & name, Type type, Operation operation, bool finalized)
{
if (property->getLayer() > valueParser_.getLayer()) {
- state_.push(State()); // ignored
+ state_.push(State(true)); // ignored
return;
}
int finalizedLayer = std::min(
@@ -808,9 +842,6 @@ void XcuParser::handleLocalizedGroupProp(
property,
(state_.top().locked ||
finalizedLayer < valueParser_.getLayer())));
- if (modifications_ != 0) {
- modificationPath_.push_back(name);
- }
break;
case OPERATION_REPLACE:
{
@@ -824,10 +855,7 @@ void XcuParser::handleLocalizedGroupProp(
replacement, name,
(state_.top().locked ||
finalizedLayer < valueParser_.getLayer())));
- if (modifications_ != 0) {
- modificationPath_.push_back(name);
- modifications_->add(modificationPath_);
- }
+ recordModification();
}
break;
case OPERATION_REMOVE:
@@ -876,14 +904,24 @@ void XcuParser::handleGroupNode(
reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
}
+ if (trackPath_) {
+ path_.push_back(name);
+ if (partial_ != 0 && partial_->contains(path_) == Partial::CONTAINS_NOT)
+ {
+ state_.push(State(true)); // ignored
+ return;
+ }
+ }
rtl::Reference< Node > child(
Data::findNode(valueParser_.getLayer(), group->getMembers(), name));
if (!child.is()) {
- throw css::uno::RuntimeException(
- (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown node ")) +
- name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
- reader.getUrl()),
- css::uno::Reference< css::uno::XInterface >());
+ OSL_TRACE(
+ "configmgr unknown node %s in %s",
+ rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr(),
+ rtl::OUStringToOString(
+ reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr());
+ state_.push(State(true)); // ignored
+ return;
}
if (op != OPERATION_MODIFY && op != OPERATION_FUSE) {
throw css::uno::RuntimeException(
@@ -901,9 +939,6 @@ void XcuParser::handleGroupNode(
State(
child,
state_.top().locked || finalizedLayer < valueParser_.getLayer()));
- if (modifications_ != 0) {
- modificationPath_.push_back(name);
- }
}
void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
@@ -958,6 +993,14 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
}
+ if (trackPath_) {
+ path_.push_back(name);
+ if (partial_ != 0 && partial_->contains(path_) == Partial::CONTAINS_NOT)
+ {
+ state_.push(State(true)); // ignored
+ return;
+ }
+ }
rtl::OUString templateName(
xmldata::parseTemplateReference(
component, hasNodeType, nodeType, &set->getDefaultTemplateName()));
@@ -972,7 +1015,7 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
css::uno::Reference< css::uno::XInterface >());
}
rtl::Reference< Node > tmpl(
- data_->getTemplate(valueParser_.getLayer(), templateName));
+ data_.getTemplate(valueParser_.getLayer(), templateName));
if (!tmpl.is()) {
throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("set member node ")) +
@@ -993,7 +1036,7 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
mandatoryLayer = std::min(mandatoryLayer, i->second->getMandatory());
i->second->setMandatory(mandatoryLayer);
if (i->second->getLayer() > valueParser_.getLayer()) {
- state_.push(State()); // ignored
+ state_.push(State(true)); // ignored
return;
}
}
@@ -1001,48 +1044,39 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
case OPERATION_MODIFY:
if (i == set->getMembers().end()) {
OSL_TRACE("ignoring modify of unknown set member node");
- state_.push(State());
+ state_.push(State(true)); // ignored
} else {
state_.push(
State(
i->second,
(state_.top().locked ||
finalizedLayer < valueParser_.getLayer())));
- if (modifications_ != 0) {
- modificationPath_.push_back(name);
- }
}
break;
case OPERATION_REPLACE:
if (state_.top().locked || finalizedLayer < valueParser_.getLayer()) {
- state_.push(State()); // ignored
+ state_.push(State(true)); // ignored
} else {
- rtl::Reference< Node > member(tmpl->clone());
+ rtl::Reference< Node > member(tmpl->clone(true));
member->setLayer(valueParser_.getLayer());
member->setFinalized(finalizedLayer);
member->setMandatory(mandatoryLayer);
state_.push(State(member, name, false));
- if (modifications_ != 0) {
- modificationPath_.push_back(name);
- modifications_->add(modificationPath_);
- }
+ recordModification();
}
break;
case OPERATION_FUSE:
if (i == set->getMembers().end()) {
if (state_.top().locked || finalizedLayer < valueParser_.getLayer())
{
- state_.push(State()); // ignored
+ state_.push(State(true)); // ignored
} else {
- rtl::Reference< Node > member(tmpl->clone());
+ rtl::Reference< Node > member(tmpl->clone(true));
member->setLayer(valueParser_.getLayer());
member->setFinalized(finalizedLayer);
member->setMandatory(mandatoryLayer);
state_.push(State(member, name, false));
- if (modifications_ != 0) {
- modificationPath_.push_back(name);
- modifications_->add(modificationPath_);
- }
+ recordModification();
}
} else {
state_.push(
@@ -1050,9 +1084,6 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
i->second,
(state_.top().locked ||
finalizedLayer < valueParser_.getLayer())));
- if (modifications_ != 0) {
- modificationPath_.push_back(name);
- }
}
break;
case OPERATION_REMOVE:
@@ -1064,14 +1095,19 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
{
set->getMembers().erase(i);
}
- state_.push(State());
- if (modifications_ != 0) {
- modificationPath_.push_back(name);
- modifications_->add(modificationPath_);
- modificationPath_.pop_back();
- }
+ state_.push(State(true));
+ recordModification();
break;
}
}
+void XcuParser::recordModification() {
+ if (broadcastModifications_ != 0) {
+ broadcastModifications_->add(path_);
+ }
+ if (recordModifications_) {
+ data_.modifications.add(path_);
+ }
+}
+
}
diff --git a/configmgr/source/xcuparser.hxx b/configmgr/source/xcuparser.hxx
index 21806edebe9c..64108451b4ef 100644
--- a/configmgr/source/xcuparser.hxx
+++ b/configmgr/source/xcuparser.hxx
@@ -49,6 +49,7 @@ namespace configmgr {
class GroupNode;
class LocalizedPropertyNode;
class Modifications;
+class Partial;
class PropertyNode;
class SetNode;
struct Data;
@@ -56,7 +57,9 @@ struct Span;
class XcuParser: public Parser {
public:
- XcuParser(int layer, Data * data, Modifications * modifications);
+ XcuParser(
+ int layer, Data & data, Partial const * partial,
+ Modifications * broadcastModifications);
private:
virtual ~XcuParser();
@@ -105,36 +108,44 @@ private:
void handleSetNode(XmlReader & reader, SetNode * set);
+ void recordModification();
+
struct State {
rtl::Reference< Node > node; // empty iff ignore or <items>
rtl::OUString name; // empty and ignored if !insert
bool ignore;
bool insert;
bool locked;
+ bool pop;
- inline State(): ignore(true), insert(false), locked(false) {}
+ inline State(bool thePop):
+ ignore(true), insert(false), locked(false), pop(thePop)
+ {}
inline State(rtl::Reference< Node > const & theNode, bool theLocked):
- node(theNode), ignore(false), insert(false), locked(theLocked)
+ node(theNode), ignore(false), insert(false), locked(theLocked),
+ pop(true)
{}
inline State(
rtl::Reference< Node > const & theNode,
rtl::OUString const & theName, bool theLocked):
node(theNode), name(theName), ignore(false), insert(true),
- locked(theLocked)
+ locked(theLocked), pop(true)
{}
};
typedef std::stack< State > StateStack;
ValueParser valueParser_;
- Data * data_;
- Modifications * modifications_;
+ Data & data_;
+ Partial const * partial_;
+ Modifications * broadcastModifications_;
+ bool recordModifications_;
+ bool trackPath_;
rtl::OUString componentName_;
StateStack state_;
- Path modificationPath_;
- rtl::OUString path_;
+ Path path_;
};
}
diff --git a/connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk b/connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk
index 4976a7d607ca..ce9581b93458 100644
--- a/connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk
+++ b/connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk
@@ -38,10 +38,9 @@ SECONDARY_PACKAGE = org$/hsqldb$/lib
.IF "$(SYSTEM_HSQLDB)" == "YES"
-XCLASSPATH!:=$(XCLASSPATH)$(PATH_SEPERATOR)$(HSQLDB_JAR)
-JARFILES+= $(HSQLDB_JAR)
+EXTRAJARFILES = $(HSQLDB_JAR)
.ELSE
-JARFILES+= hsqldb.jar
+JARFILES = hsqldb.jar
.ENDIF
JAVAFILES =\
@@ -60,7 +59,7 @@ JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class
JARCOMPRESS = TRUE
JARCLASSDIRS = $(PACKAGE) $(SECONDARY_PACKAGE)
JARTARGET = $(TARGET).jar
-JARCLASSPATH = $(JARFILES) ..
+JARCLASSPATH = $(JARFILES) $(EXTRAJARFILES) ..
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
diff --git a/connectivity/inc/connectivity/PColumn.hxx b/connectivity/inc/connectivity/PColumn.hxx
index 8f22de0be964..547cc8fb9970 100644
--- a/connectivity/inc/connectivity/PColumn.hxx
+++ b/connectivity/inc/connectivity/PColumn.hxx
@@ -33,6 +33,7 @@
#include <vos/ref.hxx>
#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
#include <comphelper/proparrhlp.hxx>
namespace connectivity
@@ -49,6 +50,7 @@ namespace connectivity
{
::rtl::OUString m_aRealName;
::rtl::OUString m_aTableName;
+ ::rtl::OUString m_sLabel;
sal_Bool m_bFunction;
sal_Bool m_bDbasePrecisionChanged;
sal_Bool m_bAggregateFunction;
@@ -64,6 +66,7 @@ namespace connectivity
OParseColumn(const ::rtl::OUString& _Name,
const ::rtl::OUString& _TypeName,
const ::rtl::OUString& _DefaultValue,
+ const ::rtl::OUString& _Description,
sal_Int32 _IsNullable,
sal_Int32 _Precision,
sal_Int32 _Scale,
@@ -75,15 +78,17 @@ namespace connectivity
virtual void construct();
void setRealName(const ::rtl::OUString& _rName) { m_aRealName = _rName; }
+ void setLabel(const ::rtl::OUString& i_sLabel) { m_sLabel = i_sLabel; }
void setTableName(const ::rtl::OUString& _rName) { m_aTableName = _rName; }
void setFunction(sal_Bool _bFunction) { m_bFunction = _bFunction; }
void setAggregateFunction(sal_Bool _bFunction) { m_bAggregateFunction = _bFunction; }
void setIsSearchable( sal_Bool _bIsSearchable ) { m_bIsSearchable = _bIsSearchable; }
void setDbasePrecisionChanged(sal_Bool _bDbasePrecisionChanged) { m_bDbasePrecisionChanged = _bDbasePrecisionChanged; }
- ::rtl::OUString getRealName() const { return m_aRealName; }
- ::rtl::OUString getTableName() const { return m_aTableName; }
- sal_Bool getFunction() const { return m_bFunction; }
+ ::rtl::OUString getRealName() const { return m_aRealName; }
+ ::rtl::OUString getLabel() const { return m_sLabel; }
+ ::rtl::OUString getTableName() const { return m_aTableName; }
+ sal_Bool getFunction() const { return m_bFunction; }
sal_Bool getDbasePrecisionChanged() const { return m_bDbasePrecisionChanged; }
public:
@@ -92,16 +97,20 @@ namespace connectivity
static ::vos::ORef< OSQLColumns >
createColumnsForResultSet(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData >& _rxResMetaData,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxDBMetaData
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxDBMetaData,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& i_xQueryColumns
);
- /** creates a single OParseColumn, as described by a result set meta data instance
+ DECLARE_STL_USTRINGACCESS_MAP(int,StringMap);
+ /** creates a single OParseColumn, as described by a result set meta data instance.
+ The column names are unique.
*/
static OParseColumn*
createColumnForResultSet(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData >& _rxResMetaData,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxDBMetaData,
- sal_Int32 _nColumnPos
+ sal_Int32 _nColumnPos,
+ StringMap& _rColumns
);
private:
@@ -125,17 +134,6 @@ namespace connectivity
virtual ~OOrderColumn();
public:
OOrderColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn,sal_Bool _bCase,sal_Bool _bAscending);
- OOrderColumn(const ::rtl::OUString& _Name,
- const ::rtl::OUString& _TypeName,
- const ::rtl::OUString& _DefaultValue,
- sal_Int32 _IsNullable,
- sal_Int32 _Precision,
- sal_Int32 _Scale,
- sal_Int32 _Type,
- sal_Bool _IsAutoIncrement,
- sal_Bool _IsCurrency,
- sal_Bool _bCase
- ,sal_Bool _bAscending);
virtual void construct();
diff --git a/connectivity/inc/connectivity/SQLStatementHelper.hxx b/connectivity/inc/connectivity/SQLStatementHelper.hxx
new file mode 100644
index 000000000000..0d1bb97c7b7f
--- /dev/null
+++ b/connectivity/inc/connectivity/SQLStatementHelper.hxx
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dbtools.hxx,v $
+ * $Revision: 1.37 $
+ *
+ * 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 _CONNECTIVITY_SQLSTATEMENTHELPER_HXX_
+#define _CONNECTIVITY_SQLSTATEMENTHELPER_HXX_
+
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <com/sun/star/beans/XPropertySet.hpp>
+namespace rtl
+{
+ class OUStringBuffer;
+}
+//.........................................................................
+namespace dbtools
+{
+ class OOO_DLLPUBLIC_DBTOOLS ISQLStatementHelper
+ {
+ public:
+ virtual void addComment(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor,::rtl::OUStringBuffer& _rOut) = 0;
+ };
+
+//.........................................................................
+} // namespace dbtools
+//.........................................................................
+
+#endif // _CONNECTIVITY_SQLSTATEMENTHELPER_HXX_
+
diff --git a/connectivity/inc/connectivity/TTableHelper.hxx b/connectivity/inc/connectivity/TTableHelper.hxx
index 9f0a644e0b6d..f99a106bce37 100644
--- a/connectivity/inc/connectivity/TTableHelper.hxx
+++ b/connectivity/inc/connectivity/TTableHelper.hxx
@@ -45,6 +45,7 @@ namespace connectivity
{
::rtl::OUString sName;
::rtl::OUString aField6;
+ ::rtl::OUString sField12; // REMARKS
::rtl::OUString sField13;
sal_Int32 nField5
, nField7
@@ -60,10 +61,12 @@ namespace connectivity
, sal_Int32 _nField7
, sal_Int32 _nField9
, sal_Int32 _nField11
+ , const ::rtl::OUString& _sField12
, const ::rtl::OUString& _sField13
,OrdinalPosition _nPosition )
:sName( _rName )
,aField6(_aField6)
+ ,sField12(_sField12)
,sField13(_sField13)
,nField5(_nField5)
,nField7(_nField7)
diff --git a/connectivity/inc/connectivity/dbtools.hxx b/connectivity/inc/connectivity/dbtools.hxx
index 1503291ef9b7..9b93830aeefe 100644
--- a/connectivity/inc/connectivity/dbtools.hxx
+++ b/connectivity/inc/connectivity/dbtools.hxx
@@ -87,6 +87,7 @@ namespace rtl
//.........................................................................
namespace dbtools
{
+ class ISQLStatementHelper;
typedef ::utl::SharedUNOComponent< ::com::sun::star::sdbc::XConnection > SharedConnection;
enum EComposeRule
@@ -225,6 +226,15 @@ namespace dbtools
const ::rtl::OUString& _rName
);
+ /** returns the primary key columns of the table
+ */
+ OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> getPrimaryKeyColumns_throw(
+ const ::com::sun::star::uno::Any& i_aTable
+ );
+ OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> getPrimaryKeyColumns_throw(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_xTable
+ );
+
/** get fields for a result set given by a "command descriptor"
<p>A command descriptor here means:
@@ -661,6 +671,7 @@ namespace dbtools
OOO_DLLPUBLIC_DBTOOLS
::rtl::OUString createStandardCreateStatement( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection,
+ ISQLStatementHelper* _pHelper,
const ::rtl::OUString& _sCreatePattern = ::rtl::OUString());
/** creates the standard sql statement for the key part of a create table statement.
@@ -674,32 +685,39 @@ namespace dbtools
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection);
/** creates the standard sql statement for the column part of a create table statement.
+ @param _pHelper
+ Allow to add special SQL constructs.
@param descriptor
The descriptor of the column.
@param _xConnection
The connection.
- @param _bAddScale
- The scale will also be added when the value is 0.
+ @param _pHelper
+ Allow to add special SQL constructs.
*/
OOO_DLLPUBLIC_DBTOOLS
- ::rtl::OUString createStandardColumnPart( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection,
- const ::rtl::OUString& _sCreatePattern = ::rtl::OUString());
+ ::rtl::OUString createStandardColumnPart( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection
+ ,ISQLStatementHelper* _pHelper = NULL
+ ,const ::rtl::OUString& _sCreatePattern = ::rtl::OUString());
/** creates a SQL CREATE TABLE statement
+
@param descriptor
The descriptor of the new table.
@param _xConnection
The connection.
- @param _bAddScale
- The scale will also be added when the value is 0.
+ @param _pHelper
+ Allow to add special SQL constructs.
+ @param _sCreatePattern
+
@return
The CREATE TABLE statement.
*/
OOO_DLLPUBLIC_DBTOOLS
- ::rtl::OUString createSqlCreateTableStatement( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection,
- const ::rtl::OUString& _sCreatePattern = ::rtl::OUString());
+ ::rtl::OUString createSqlCreateTableStatement( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection
+ ,ISQLStatementHelper* _pHelper = NULL
+ ,const ::rtl::OUString& _sCreatePattern = ::rtl::OUString());
/** creates a SDBC column with the help of getColumns.
@param _xTable
diff --git a/connectivity/inc/connectivity/sdbcx/VColumn.hxx b/connectivity/inc/connectivity/sdbcx/VColumn.hxx
index 2c9fa31a2d7e..0a8c5498cf60 100644
--- a/connectivity/inc/connectivity/sdbcx/VColumn.hxx
+++ b/connectivity/inc/connectivity/sdbcx/VColumn.hxx
@@ -84,6 +84,7 @@ namespace connectivity
OColumn( const ::rtl::OUString& _Name,
const ::rtl::OUString& _TypeName,
const ::rtl::OUString& _DefaultValue,
+ const ::rtl::OUString& _Description,
sal_Int32 _IsNullable,
sal_Int32 _Precision,
sal_Int32 _Scale,
diff --git a/connectivity/inc/connectivity/sqliterator.hxx b/connectivity/inc/connectivity/sqliterator.hxx
index 3b7db6968671..5152b7221f85 100644
--- a/connectivity/inc/connectivity/sqliterator.hxx
+++ b/connectivity/inc/connectivity/sqliterator.hxx
@@ -40,6 +40,7 @@
#include <map>
#include <memory>
+#include <vector>
namespace connectivity
{
@@ -47,6 +48,8 @@ namespace connectivity
class OSQLParseNode;
class OSQLParser;
+ typedef ::std::pair<const OSQLParseNode*,const OSQLParseNode* > TNodePair;
+
enum OSQLStatementType {
SQL_STATEMENT_UNKNOWN,
SQL_STATEMENT_SELECT,
@@ -279,6 +282,10 @@ namespace connectivity
// tries to find the correct type of the function
sal_Int32 getFunctionReturnType(const OSQLParseNode* _pNode );
+
+ // returns a lis of all joined columns
+ ::std::vector< TNodePair >& getJoinConditions() const;
+
private:
/** traverses the list of table names, and filles _rTables
*/
@@ -351,6 +358,7 @@ namespace connectivity
{
m_aErrors = ::com::sun::star::sdbc::SQLException();
}
+ void impl_fillJoinConditions(const OSQLParseNode* i_pJoinCondition);
};
}
diff --git a/connectivity/inc/connectivity/sqlnode.hxx b/connectivity/inc/connectivity/sqlnode.hxx
index 5f1d7137e678..fa283cb5cf04 100644
--- a/connectivity/inc/connectivity/sqlnode.hxx
+++ b/connectivity/inc/connectivity/sqlnode.hxx
@@ -226,6 +226,11 @@ namespace connectivity
concatenation,
char_factor,
bit_value_fct,
+ comparison_predicate_part_2,
+ parenthesized_boolean_value_expression,
+ character_string_type,
+ other_like_predicate_part_2,
+ between_predicate_part_2,
rule_count, // letzter_wert
UNKNOWN_RULE // ID indicating that a node is no rule with a matching Rule-enum value (see getKnownRuleID)
};
diff --git a/connectivity/prj/build.lst b/connectivity/prj/build.lst
index dd386c7c7161..0b15c06acf15 100644
--- a/connectivity/prj/build.lst
+++ b/connectivity/prj/build.lst
@@ -1,4 +1,4 @@
-cn connectivity : shell l10n comphelper MOZ:moz SO:moz_prebuilt svl UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb QADEVOOO:qadevOOo officecfg NSS:nss NULL
+cn connectivity : shell l10n comphelper MOZ:moz SO:moz_prebuilt svl UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb qadevOOo officecfg NSS:nss NULL
cn connectivity usr1 - all cn_mkout NULL
cn connectivity\inc nmake - all cn_inc NULL
cn connectivity\com\sun\star\sdbcx\comp\hsqldb nmake - all cn_jhsqldbdb cn_hsqldb cn_inc NULL
diff --git a/connectivity/qa/connectivity/tools/CRMDatabase.java b/connectivity/qa/connectivity/tools/CRMDatabase.java
index c35faac75ff7..a1b457884948 100644
--- a/connectivity/qa/connectivity/tools/CRMDatabase.java
+++ b/connectivity/qa/connectivity/tools/CRMDatabase.java
@@ -285,7 +285,7 @@ public class CRMDatabase
m_database.getDataSource().createQuery( "parseable", "SELECT * FROM \"customers\"" );
m_database.getDataSource().createQuery( "parseable native", "SELECT * FROM INFORMATION_SCHEMA.SYSTEM_VIEWS", false );
m_database.getDataSource().createQuery( "unparseable",
- "SELECT CAST( \"ID\" AS VARCHAR(3) ) AS \"ID_VARCHAR\" FROM \"products\"", false );
+ "SELECT {fn DAYOFMONTH ('2001-01-01')} AS \"ID_VARCHAR\" FROM \"products\"", false );
validateUnparseable();
}
diff --git a/connectivity/qa/connectivity/tools/makefile.mk b/connectivity/qa/connectivity/tools/makefile.mk
index 0f3c9c84b92e..07490532a1b1 100644
--- a/connectivity/qa/connectivity/tools/makefile.mk
+++ b/connectivity/qa/connectivity/tools/makefile.mk
@@ -38,7 +38,6 @@ all:
@echo "Java not available. Build skipped"
.ELSE
-.IF "$(BUILD_QADEVOOO)" == "YES"
#----- compile .java files -----------------------------------------
JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunnerLight.jar
@@ -61,8 +60,6 @@ ALL : ALLTAR
ALL: ALLDEP
.ENDIF
-.ENDIF
-
.ENDIF # "$(SOLAR_JAVA)" == ""
.INCLUDE : target.mk
diff --git a/connectivity/qa/drivers/dbase/test.properties b/connectivity/qa/drivers/dbase/test.properties
index 6f301f972d40..c26879f480f3 100644
--- a/connectivity/qa/drivers/dbase/test.properties
+++ b/connectivity/qa/drivers/dbase/test.properties
@@ -1,3 +1,4 @@
+# x-no-translate
Driver=org.openoffice.comp.drivers.MySQL.Driver
user=testuser
password=
diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx
index a09260782fd6..9f5be37f208f 100644
--- a/connectivity/source/commontools/DateConversion.cxx
+++ b/connectivity/source/commontools/DateConversion.cxx
@@ -126,9 +126,27 @@ using namespace ::com::sun::star::beans;
case DataType::TIMESTAMP:
{
DateTime aDateTime;
+ bool bOk = false;
+ if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_DOUBLE)
+ {
+ double nValue = 0.0;
+ _rVal >>= nValue;
+ aDateTime = DBTypeConversion::toDateTime(nValue);
+ bOk = true;
+ }
+ else if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_STRING)
+ {
+ ::rtl::OUString sValue;
+ _rVal >>= sValue;
+ aDateTime = DBTypeConversion::toDateTime(sValue);
+ bOk = true;
+ }
+ else
+ bOk = _rVal >>= aDateTime;
+ OSL_VERIFY_RES( bOk, "DBTypeConversion::toSQLString: _rVal is not datetime!");
// check if this is really a timestamp or only a date
- if ( _rVal >>= aDateTime )
+ if ( bOk )
{
if (bQuote)
aRet.appendAscii("{TS '");
@@ -142,7 +160,24 @@ using namespace ::com::sun::star::beans;
case DataType::DATE:
{
Date aDate;
- OSL_VERIFY_RES( _rVal >>= aDate, "DBTypeConversion::toSQLString: _rVal is not date!");
+ bool bOk = false;
+ if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_DOUBLE)
+ {
+ double nValue = 0.0;
+ _rVal >>= nValue;
+ aDate = DBTypeConversion::toDate(nValue);
+ bOk = true;
+ }
+ else if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_STRING)
+ {
+ ::rtl::OUString sValue;
+ _rVal >>= sValue;
+ aDate = DBTypeConversion::toDate(sValue);
+ bOk = true;
+ }
+ else
+ bOk = _rVal >>= aDate;
+ OSL_VERIFY_RES( bOk, "DBTypeConversion::toSQLString: _rVal is not date!");
if (bQuote)
aRet.appendAscii("{D '");
aRet.append(DBTypeConversion::toDateString(aDate));
@@ -152,7 +187,24 @@ using namespace ::com::sun::star::beans;
case DataType::TIME:
{
Time aTime;
- OSL_VERIFY_RES( _rVal >>= aTime,"DBTypeConversion::toSQLString: _rVal is not time!");
+ bool bOk = false;
+ if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_DOUBLE)
+ {
+ double nValue = 0.0;
+ _rVal >>= nValue;
+ aTime = DBTypeConversion::toTime(nValue);
+ bOk = true;
+ }
+ else if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_STRING)
+ {
+ ::rtl::OUString sValue;
+ _rVal >>= sValue;
+ aTime = DBTypeConversion::toTime(sValue);
+ bOk = true;
+ }
+ else
+ bOk = _rVal >>= aTime;
+ OSL_VERIFY_RES( bOk,"DBTypeConversion::toSQLString: _rVal is not time!");
if (bQuote)
aRet.appendAscii("{T '");
aRet.append(DBTypeConversion::toTimeString(aTime));
diff --git a/connectivity/source/commontools/DriversConfig.cxx b/connectivity/source/commontools/DriversConfig.cxx
index f99c637fa396..48c2736cd05a 100755
--- a/connectivity/source/commontools/DriversConfig.cxx
+++ b/connectivity/source/commontools/DriversConfig.cxx
@@ -136,26 +136,26 @@ DriversConfig::DriversConfig(const uno::Reference< lang::XMultiServiceFactory >&
}
// -----------------------------------------------------------------------------
-DriversConfig::~DriversConfig()
-{
-}
-
+DriversConfig::~DriversConfig()
+{
+}
+
// -----------------------------------------------------------------------------
-DriversConfig::DriversConfig( const DriversConfig& _rhs )
-{
- *this = _rhs;
-}
-
+DriversConfig::DriversConfig( const DriversConfig& _rhs )
+{
+ *this = _rhs;
+}
+
// -----------------------------------------------------------------------------
-DriversConfig& DriversConfig::operator=( const DriversConfig& _rhs )
-{
- if ( this != &_rhs )
- {
- m_aNode = _rhs.m_aNode;
- }
- return *this;
-}
-
+DriversConfig& DriversConfig::operator=( const DriversConfig& _rhs )
+{
+ if ( this != &_rhs )
+ {
+ m_aNode = _rhs.m_aNode;
+ }
+ return *this;
+}
+
// -----------------------------------------------------------------------------
::rtl::OUString DriversConfig::getDriverFactoryName(const ::rtl::OUString& _sURL) const
{
diff --git a/connectivity/source/commontools/TColumnsHelper.cxx b/connectivity/source/commontools/TColumnsHelper.cxx
index d6b26dffbe92..325fcfbd0f42 100644
--- a/connectivity/source/commontools/TColumnsHelper.cxx
+++ b/connectivity/source/commontools/TColumnsHelper.cxx
@@ -121,29 +121,7 @@ sdbcx::ObjectType OColumnsHelper::createObject(const ::rtl::OUString& _rName)
if ( pColDesc )
{
Reference<XPropertySet> xPr = m_pTable;
- Reference<XKeysSupplier> xKeysSup(xPr,UNO_QUERY);
- Reference<XNameAccess> xPrimaryKeyColumns;
- if ( xKeysSup.is() )
- {
- const Reference<XIndexAccess> xKeys = xKeysSup->getKeys();
- if ( xKeys.is() )
- {
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- const sal_Int32 nKeyCount = xKeys->getCount();
- for(sal_Int32 nKeyIter = 0; nKeyIter < nKeyCount;++nKeyIter)
- {
- const Reference<XPropertySet> xKey(xKeys->getByIndex(nKeyIter),UNO_QUERY_THROW);
- sal_Int32 nType = 0;
- xKey->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE)) >>= nType;
- if ( nType == KeyType::PRIMARY )
- {
- const Reference<XColumnsSupplier> xColS(xKey,UNO_QUERY_THROW);
- xPrimaryKeyColumns = xColS->getColumns();
- break;
- }
- } // for(sal_Int32 nKeyIter = 0; nKeyIter < nKeyCount;++)
- }
- }
+ const Reference<XNameAccess> xPrimaryKeyColumns = getPrimaryKeyColumns_throw(xPr);
sal_Int32 nField11 = pColDesc->nField11;
if ( nField11 != ColumnValue::NO_NULLS && xPrimaryKeyColumns.is() && xPrimaryKeyColumns->hasByName(_rName) )
{
@@ -152,6 +130,7 @@ sdbcx::ObjectType OColumnsHelper::createObject(const ::rtl::OUString& _rName)
connectivity::sdbcx::OColumn* pRet = new connectivity::sdbcx::OColumn(_rName,
pColDesc->aField6,
pColDesc->sField13,
+ pColDesc->sField12,
nField11,
pColDesc->nField7,
pColDesc->nField9,
@@ -207,7 +186,7 @@ sdbcx::ObjectType OColumnsHelper::appendObject( const ::rtl::OUString& _rForName
aSql += ::dbtools::composeTableName( xMetaData, m_pTable, ::dbtools::eInTableDefinitions, false, false, true );
aSql += ::rtl::OUString::createFromAscii(" ADD ");
- aSql += ::dbtools::createStandardColumnPart(descriptor,m_pTable->getConnection(),m_pTable->getTypeCreatePattern());
+ aSql += ::dbtools::createStandardColumnPart(descriptor,m_pTable->getConnection(),NULL,m_pTable->getTypeCreatePattern());
Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
if ( xStmt.is() )
diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx
index f44b08fa15b7..7d020e9fc4a6 100644
--- a/connectivity/source/commontools/TTableHelper.cxx
+++ b/connectivity/source/commontools/TTableHelper.cxx
@@ -210,9 +210,10 @@ namespace
sal_Int32 nField7 = xRow->getInt(7)
, nField9 = xRow->getInt(9)
, nField11= xRow->getInt(11);
- ::rtl::OUString sField13 = xRow->getString(13);
+ ::rtl::OUString sField12 = xRow->getString(12)
+ ,sField13 = xRow->getString(13);
nOrdinalPosition = xRow->getInt( 17 ); // ORDINAL_POSITION
- _out_rColumns.push_back( ColumnDesc( sName,nField5,aField6,nField7,nField9,nField11,sField13, nOrdinalPosition ) );
+ _out_rColumns.push_back( ColumnDesc( sName,nField5,aField6,nField7,nField9,nField11,sField12,sField13, nOrdinalPosition ) );
}
}
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index 0b7cb5b5df58..05bcf997268f 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -60,8 +60,10 @@
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XRowSet.hpp>
#include <com/sun/star/sdbc/XRowUpdate.hpp>
+#include <com/sun/star/sdbcx/KeyType.hpp>
#include <com/sun/star/sdbcx/Privilege.hpp>
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
+#include <com/sun/star/sdbcx/XKeysSupplier.hpp>
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/task/XInteractionRequest.hpp>
@@ -528,6 +530,46 @@ Reference< XNameAccess> getTableFields(const Reference< XConnection>& _rxConn,co
Reference< XComponent > xDummy;
return getFieldsByCommandDescriptor( _rxConn, CommandType::TABLE, _rName, xDummy );
}
+//------------------------------------------------------------------------------
+Reference< XNameAccess> getPrimaryKeyColumns_throw(const Any& i_aTable)
+{
+ const Reference< XPropertySet > xTable(i_aTable,UNO_QUERY_THROW);
+ return getPrimaryKeyColumns_throw(xTable);
+}
+//------------------------------------------------------------------------------
+Reference< XNameAccess> getPrimaryKeyColumns_throw(const Reference< XPropertySet >& i_xTable)
+{
+ Reference<XNameAccess> xKeyColumns;
+ const Reference<XKeysSupplier> xKeySup(i_xTable,UNO_QUERY);
+ if ( xKeySup.is() )
+ {
+ const Reference<XIndexAccess> xKeys = xKeySup->getKeys();
+ if ( xKeys.is() )
+ {
+ ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
+ const ::rtl::OUString sPropName = rPropMap.getNameByIndex(PROPERTY_ID_TYPE);
+ Reference<XPropertySet> xProp;
+ const sal_Int32 nCount = xKeys->getCount();
+ for(sal_Int32 i = 0;i< nCount;++i)
+ {
+ xProp.set(xKeys->getByIndex(i),UNO_QUERY_THROW);
+ if ( xProp.is() )
+ {
+ sal_Int32 nKeyType = 0;
+ xProp->getPropertyValue(sPropName) >>= nKeyType;
+ if(KeyType::PRIMARY == nKeyType)
+ {
+ const Reference<XColumnsSupplier> xKeyColsSup(xProp,UNO_QUERY_THROW);
+ xKeyColumns = xKeyColsSup->getColumns();
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return xKeyColumns;
+}
//------------------------------------------------------------------------------
namespace
@@ -2051,7 +2093,7 @@ namespace connectivity
void release(oslInterlockedCount& _refCount,
::cppu::OBroadcastHelper& rBHelper,
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
+ Reference< XInterface >& _xInterface,
::com::sun::star::lang::XComponent* _pObject)
{
if (osl_decrementInterlockedCount( &_refCount ) == 0)
@@ -2061,7 +2103,7 @@ void release(oslInterlockedCount& _refCount,
if (!rBHelper.bDisposed && !rBHelper.bInDispose)
{
// remember the parent
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xParent;
+ Reference< XInterface > xParent;
{
::osl::MutexGuard aGuard( rBHelper.rMutex );
xParent = _xInterface;
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx
index 7cf12345ae67..c9a878fe1840 100644
--- a/connectivity/source/commontools/dbtools2.cxx
+++ b/connectivity/source/commontools/dbtools2.cxx
@@ -30,11 +30,10 @@
#include "connectivity/dbtools.hxx"
#include "connectivity/dbconversion.hxx"
#include "connectivity/dbcharset.hxx"
+#include "connectivity/SQLStatementHelper.hxx"
#include <unotools/confignode.hxx>
#include "resource/sharedresources.hxx"
-#ifndef CONNECTIVITY_RESOURCE_COMMON_HRC
#include "resource/common_res.hrc"
-#endif
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
@@ -71,7 +70,7 @@ namespace dbtools
using namespace connectivity;
using namespace comphelper;
-::rtl::OUString createStandardColumnPart(const Reference< XPropertySet >& xColProp,const Reference< XConnection>& _xConnection,const ::rtl::OUString& _sCreatePattern)
+::rtl::OUString createStandardColumnPart(const Reference< XPropertySet >& xColProp,const Reference< XConnection>& _xConnection,ISQLStatementHelper* _pHelper,const ::rtl::OUString& _sCreatePattern)
{
Reference<XDatabaseMetaData> xMetaData = _xConnection->getMetaData();
@@ -186,11 +185,14 @@ namespace dbtools
aSql.append(sAutoIncrementValue);
}
+ if ( _pHelper )
+ _pHelper->addComment(xColProp,aSql);
+
return aSql.makeStringAndClear();
}
// -----------------------------------------------------------------------------
-::rtl::OUString createStandardCreateStatement(const Reference< XPropertySet >& descriptor,const Reference< XConnection>& _xConnection,const ::rtl::OUString& _sCreatePattern)
+::rtl::OUString createStandardCreateStatement(const Reference< XPropertySet >& descriptor,const Reference< XConnection>& _xConnection,ISQLStatementHelper* _pHelper,const ::rtl::OUString& _sCreatePattern)
{
::rtl::OUStringBuffer aSql = ::rtl::OUString::createFromAscii("CREATE TABLE ");
::rtl::OUString sCatalog,sSchema,sTable,sComposedName;
@@ -223,7 +225,7 @@ namespace dbtools
{
if ( (xColumns->getByIndex(i) >>= xColProp) && xColProp.is() )
{
- aSql.append(createStandardColumnPart(xColProp,_xConnection,_sCreatePattern));
+ aSql.append(createStandardColumnPart(xColProp,_xConnection,_pHelper,_sCreatePattern));
aSql.appendAscii(",");
}
}
@@ -364,9 +366,10 @@ namespace
// -----------------------------------------------------------------------------
::rtl::OUString createSqlCreateTableStatement( const Reference< XPropertySet >& descriptor,
const Reference< XConnection>& _xConnection,
+ ISQLStatementHelper* _pHelper,
const ::rtl::OUString& _sCreatePattern)
{
- ::rtl::OUString aSql = ::dbtools::createStandardCreateStatement(descriptor,_xConnection,_sCreatePattern);
+ ::rtl::OUString aSql = ::dbtools::createStandardCreateStatement(descriptor,_xConnection,_pHelper,_sCreatePattern);
const ::rtl::OUString sKeyStmt = ::dbtools::createStandardKeyStatement(descriptor,_xConnection);
if ( sKeyStmt.getLength() )
aSql += sKeyStmt;
@@ -411,7 +414,8 @@ namespace
sal_Int32 nField7 = xRow->getInt(7)
, nField9 = xRow->getInt(9)
, nField11= xRow->getInt(11);
- ::rtl::OUString sField13 = xRow->getString(13);
+ ::rtl::OUString sField12 = xRow->getString(12),
+ sField13 = xRow->getString(13);
::comphelper::disposeComponent(xRow);
sal_Bool bAutoIncrement = _bIsAutoIncrement
@@ -471,6 +475,7 @@ namespace
connectivity::sdbcx::OColumn* pRet = new connectivity::sdbcx::OColumn(_rName,
aField6,
sField13,
+ sField12,
nField11,
nField7,
nField9,
@@ -526,28 +531,7 @@ Reference<XPropertySet> createSDBCXColumn(const Reference<XPropertySet>& _xTable
_xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= aSchema;
_xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= aTable;
- Reference<XKeysSupplier> xKeysSup(_xTable,UNO_QUERY);
- Reference<XNameAccess> xPrimaryKeyColumns;
- if ( xKeysSup.is() )
- {
- const Reference<XIndexAccess> xKeys = xKeysSup->getKeys();
- if ( xKeys.is() )
- {
- const sal_Int32 nKeyCount = xKeys->getCount();
- for(sal_Int32 nKeyIter = 0; nKeyIter < nKeyCount;++nKeyIter)
- {
- const Reference<XPropertySet> xKey(xKeys->getByIndex(nKeyIter),UNO_QUERY_THROW);
- sal_Int32 nType = 0;
- xKey->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE)) >>= nType;
- if ( nType == KeyType::PRIMARY )
- {
- const Reference<XColumnsSupplier> xColS(xKey,UNO_QUERY_THROW);
- xPrimaryKeyColumns = xColS->getColumns();
- break;
- }
- } // for(sal_Int32 nKeyIter = 0; nKeyIter < nKeyCount;++)
- }
- }
+ Reference<XNameAccess> xPrimaryKeyColumns = getPrimaryKeyColumns_throw(_xTable);
xProp = lcl_createSDBCXColumn(xPrimaryKeyColumns,_xConnection,aCatalog, aSchema, aTable, _rName,_rName,_bCase,_bQueryForInfo,_bIsAutoIncrement,_bIsCurrency,_nDataType);
if ( !xProp.is() )
@@ -555,7 +539,7 @@ Reference<XPropertySet> createSDBCXColumn(const Reference<XPropertySet>& _xTable
xProp = lcl_createSDBCXColumn(xPrimaryKeyColumns,_xConnection,aCatalog, aSchema, aTable, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),_rName,_bCase,_bQueryForInfo,_bIsAutoIncrement,_bIsCurrency,_nDataType);
if ( !xProp.is() )
xProp = new connectivity::sdbcx::OColumn(_rName,
- ::rtl::OUString(),::rtl::OUString(),
+ ::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),
ColumnValue::NULLABLE_UNKNOWN,
0,
0,
@@ -665,19 +649,9 @@ Reference< XTablesSupplier> getDataDefinitionByURLAndConnection(
Reference< XDataDefinitionSupplier > xSupp( xManager->getDriverByURL( _rsUrl ), UNO_QUERY );
if ( xSupp.is() )
+ {
xTablesSup = xSupp->getDataDefinitionByConnection( _xConnection );
-
- // if we don't get the catalog from the original driver we have to try them all.
- if ( !xTablesSup.is() )
- { // !TODO: Why?
- Reference< XEnumerationAccess> xEnumAccess( xManager, UNO_QUERY_THROW );
- Reference< XEnumeration > xEnum( xEnumAccess->createEnumeration(), UNO_QUERY_THROW );
- while ( xEnum.is() && xEnum->hasMoreElements() && !xTablesSup.is() )
- {
- xEnum->nextElement() >>= xSupp;
- if ( xSupp.is() )
- xTablesSup = xSupp->getDataDefinitionByConnection( _xConnection );
- }
+ OSL_ENSURE(xTablesSup.is(),"No table supplier!");
}
}
catch( const Exception& )
diff --git a/connectivity/source/commontools/propertyids.cxx b/connectivity/source/commontools/propertyids.cxx
index f1e31a2c7f0e..b6bae373a7db 100644
--- a/connectivity/source/commontools/propertyids.cxx
+++ b/connectivity/source/commontools/propertyids.cxx
@@ -93,6 +93,7 @@ namespace dbtools
const sal_Char* getPROPERTY_ID_FIELDTYPE() { return "FieldType"; }
const sal_Char* getPROPERTY_ID_VALUE() { return "Value"; }
const sal_Char* getPROPERTY_ID_ACTIVE_CONNECTION() { return "ActiveConnection"; }
+ const sal_Char* getPROPERTY_ID_LABEL() { return "Label"; }
//============================================================
//= error messages
@@ -180,6 +181,7 @@ namespace dbtools
case PROPERTY_ID_HAVINGCLAUSE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_HAVINGCLAUSE() ); break; }
case PROPERTY_ID_ISSIGNED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_ISSIGNED() ); break; }
case PROPERTY_ID_ISSEARCHABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_ISSEARCHABLE() ); break; }
+ case PROPERTY_ID_LABEL: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_LABEL() ); break; }
case PROPERTY_ID_APPLYFILTER: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_APPLYFILTER() ); break; }
case PROPERTY_ID_FILTER: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_FILTER() ); break; }
case PROPERTY_ID_MASTERFIELDS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_MASTERFIELDS() ); break; }
diff --git a/connectivity/source/cpool/dbpool.map b/connectivity/source/cpool/dbpool.map
deleted file mode 100644
index 7202c9d71b93..000000000000
--- a/connectivity/source/cpool/dbpool.map
+++ /dev/null
@@ -1,8 +0,0 @@
-DBPOOL_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/cpool/makefile.mk b/connectivity/source/cpool/makefile.mk
index 124e7b574d6c..1f6e49c6cbd7 100644
--- a/connectivity/source/cpool/makefile.mk
+++ b/connectivity/source/cpool/makefile.mk
@@ -55,7 +55,7 @@ SLOFILES=\
SHL1TARGET= $(DBPOOL_TARGET)$(DBPOOL_MAJOR)
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1OBJS=$(SLOFILES)
SHL1STDLIBS=\
diff --git a/connectivity/source/dbtools/dbt.map b/connectivity/source/dbtools/dbt.map
deleted file mode 100644
index c3eaaa5a253f..000000000000
--- a/connectivity/source/dbtools/dbt.map
+++ /dev/null
@@ -1,8 +0,0 @@
-DBTOOLS_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/adabas/BColumns.cxx b/connectivity/source/drivers/adabas/BColumns.cxx
index 8fc009917fb2..bb0363792c12 100644
--- a/connectivity/source/drivers/adabas/BColumns.cxx
+++ b/connectivity/source/drivers/adabas/BColumns.cxx
@@ -96,6 +96,7 @@ sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName)
xRet = new OColumn(_rName,
sTypeName,
xRow->getString(13),
+ xRow->getString(12),
xRow->getInt(11),
nPrec,
xRow->getInt(9),
diff --git a/connectivity/source/drivers/adabas/adabas.map b/connectivity/source/drivers/adabas/adabas.map
deleted file mode 100644
index 7ce4c703e6b3..000000000000
--- a/connectivity/source/drivers/adabas/adabas.map
+++ /dev/null
@@ -1,8 +0,0 @@
-ADABAS_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/adabas/adabas.xcu b/connectivity/source/drivers/adabas/adabas.xcu
index 20c811bd2d5a..b92067235e15 100755
--- a/connectivity/source/drivers/adabas/adabas.xcu
+++ b/connectivity/source/drivers/adabas/adabas.xcu
@@ -65,6 +65,11 @@
<value></value>
</prop>
</node>
+ <node oor:name="AddIndexAppendix" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
<node oor:name="Features">
<node oor:name="UseSQL92NamingConstraints" oor:op="replace">
diff --git a/connectivity/source/drivers/adabas/makefile.mk b/connectivity/source/drivers/adabas/makefile.mk
index e3e9d76ac2f2..9268f02a3b42 100644
--- a/connectivity/source/drivers/adabas/makefile.mk
+++ b/connectivity/source/drivers/adabas/makefile.mk
@@ -71,7 +71,7 @@ SLOFILES=\
$(SLO)$/BResultSetMetaData.obj \
$(SLO)$/BResultSet.obj
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/ado/AColumn.cxx b/connectivity/source/drivers/ado/AColumn.cxx
index bb4b985e3bfc..aa287c185b26 100644
--- a/connectivity/source/drivers/ado/AColumn.cxx
+++ b/connectivity/source/drivers/ado/AColumn.cxx
@@ -65,7 +65,7 @@ void WpADOColumn::Create()
}
// -------------------------------------------------------------------------
OAdoColumn::OAdoColumn(sal_Bool _bCase,OConnection* _pConnection,_ADOColumn* _pColumn)
- : connectivity::sdbcx::OColumn(::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),0,0,0,0,sal_False,sal_False,sal_False,_bCase)
+ : connectivity::sdbcx::OColumn(::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),0,0,0,0,sal_False,sal_False,sal_False,_bCase)
,m_pConnection(_pConnection)
{
construct();
@@ -183,12 +183,13 @@ void OAdoColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& r
OTools::putValue( m_aColumn.get_Properties(), ::rtl::OUString::createFromAscii( "Autoincrement" ), getBOOL( rValue ) );
break;
+ case PROPERTY_ID_IM001:
case PROPERTY_ID_DESCRIPTION:
- pAdoPropertyName = "Default";
+ pAdoPropertyName = "Description";
break;
case PROPERTY_ID_DEFAULTVALUE:
- pAdoPropertyName = "Description";
+ pAdoPropertyName = "Default";
break;
}
diff --git a/connectivity/source/drivers/ado/ado.xcu b/connectivity/source/drivers/ado/ado.xcu
index 5859d5eecf3e..50c29cf7ba2e 100755
--- a/connectivity/source/drivers/ado/ado.xcu
+++ b/connectivity/source/drivers/ado/ado.xcu
@@ -134,6 +134,11 @@
<value>UserPassword</value>
</prop>
</node>
+ <node oor:name="SupportsColumnDescription" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
</node>
<node oor:name="sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=*" oor:op="replace">
@@ -228,6 +233,11 @@
<value>mdb</value>
</prop>
</node>
+ <node oor:name="SupportsColumnDescription" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
</node>
<node oor:name="sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=*" oor:op="replace">
diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx
index 1d19c05a46c0..a4e5f35825f5 100644
--- a/connectivity/source/drivers/calc/CTable.cxx
+++ b/connectivity/source/drivers/calc/CTable.cxx
@@ -347,14 +347,15 @@ void lcl_SetValue( ORowSetValue& rValue, const Reference<XSpreadsheet>& xSheet,
switch (nType)
{
case DataType::VARCHAR:
- if ( eCellType == CellContentType_TEXT )
+ if ( eCellType == CellContentType_EMPTY )
+ rValue.setNull();
+ else
{
+ // #i25840# still let Calc convert numbers to text
const Reference<XText> xText( xCell, UNO_QUERY );
if ( xText.is() )
rValue = xText->getString();
- } // if ( eCellType == CellContentType_TEXT )
- else
- rValue.setNull();
+ }
break;
case DataType::DECIMAL:
if ( eCellType == CellContentType_VALUE )
@@ -525,7 +526,7 @@ void OCalcTable::fillColumns()
aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
}
- sdbcx::OColumn* pColumn = new sdbcx::OColumn( aAlias, aTypeName, ::rtl::OUString(),
+ sdbcx::OColumn* pColumn = new sdbcx::OColumn( aAlias, aTypeName, ::rtl::OUString(),::rtl::OUString(),
ColumnValue::NULLABLE, nPrecision, nDecimals,
eType, sal_False, sal_False, bCurrency,
bStoresMixedCaseQuotedIdentifiers);
diff --git a/connectivity/source/drivers/calc/calc.map b/connectivity/source/drivers/calc/calc.map
deleted file mode 100644
index bcab8e6c9101..000000000000
--- a/connectivity/source/drivers/calc/calc.map
+++ /dev/null
@@ -1,8 +0,0 @@
-CALC_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/calc/makefile.mk b/connectivity/source/drivers/calc/makefile.mk
index 452e9a92b320..8e193524aa45 100644
--- a/connectivity/source/drivers/calc/makefile.mk
+++ b/connectivity/source/drivers/calc/makefile.mk
@@ -57,7 +57,7 @@ SLOFILES=\
$(SLO)$/Cservices.obj \
$(SLO)$/CDriver.obj
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index d19f419f17ae..8544e4affda7 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -449,6 +449,7 @@ OSL_TRACE("column type: %c",aDBFColumn.db_typ);
Reference< XPropertySet> xCol = new sdbcx::OColumn(aColumnName,
aTypeName,
::rtl::OUString(),
+ ::rtl::OUString(),
ColumnValue::NULLABLE,
nPrecision,
aDBFColumn.db_dez,
@@ -1527,6 +1528,7 @@ BOOL ODbaseTable::InsertRow(OValueRefVector& rRow, BOOL bFlush,const Reference<X
// Buffer mit Leerzeichen fuellen
AllocBuffer();
memset(m_pBuffer, 0, m_aHeader.db_slng);
+ m_pBuffer[0] = ' ';
// Gesamte neue Row uebernehmen:
// ... und am Ende als neuen Record hinzufuegen:
diff --git a/connectivity/source/drivers/dbase/dbase.map b/connectivity/source/drivers/dbase/dbase.map
deleted file mode 100644
index 2c620b4f3620..000000000000
--- a/connectivity/source/drivers/dbase/dbase.map
+++ /dev/null
@@ -1,10 +0,0 @@
-DBASE_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
-
-
diff --git a/connectivity/source/drivers/dbase/dbase.xcu b/connectivity/source/drivers/dbase/dbase.xcu
index 5e6e7596c3fe..f5de1d53ab0e 100755
--- a/connectivity/source/drivers/dbase/dbase.xcu
+++ b/connectivity/source/drivers/dbase/dbase.xcu
@@ -50,6 +50,11 @@
<value>false</value>
</prop>
</node>
+ <node oor:name="AddIndexAppendix" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
</node>
<node oor:name="Features">
<node oor:name="UseSQL92NamingConstraints" oor:op="replace">
diff --git a/connectivity/source/drivers/dbase/makefile.mk b/connectivity/source/drivers/dbase/makefile.mk
index dded9086bcb1..f855cf1f4554 100644
--- a/connectivity/source/drivers/dbase/makefile.mk
+++ b/connectivity/source/drivers/dbase/makefile.mk
@@ -89,7 +89,7 @@ EXCEPTIONSFILES +=\
.ENDIF
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/evoab/evoab.map b/connectivity/source/drivers/evoab/evoab.map
deleted file mode 100644
index 00cf7191f143..000000000000
--- a/connectivity/source/drivers/evoab/evoab.map
+++ /dev/null
@@ -1,8 +0,0 @@
-EVOAB_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/evoab/makefile.mk b/connectivity/source/drivers/evoab/makefile.mk
index 31d654fd26a2..c1dbc21cdf1e 100644
--- a/connectivity/source/drivers/evoab/makefile.mk
+++ b/connectivity/source/drivers/evoab/makefile.mk
@@ -65,7 +65,7 @@ SLOFILES=\
$(SLO)$/LDebug.obj
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/evoab2/NColumns.cxx b/connectivity/source/drivers/evoab2/NColumns.cxx
index ddad36e52262..d1854e62181d 100644
--- a/connectivity/source/drivers/evoab2/NColumns.cxx
+++ b/connectivity/source/drivers/evoab2/NColumns.cxx
@@ -66,6 +66,7 @@ sdbcx::ObjectType OEvoabColumns::createObject(const ::rtl::OUString& _rName)
_rName,
xRow->getString(6),
xRow->getString(13),
+ xRow->getString(12),
xRow->getInt(11),
xRow->getInt(7),
xRow->getInt(9),
diff --git a/connectivity/source/drivers/evoab2/NStatement.cxx b/connectivity/source/drivers/evoab2/NStatement.cxx
index 77598f97380c..feca8f55aeff 100644
--- a/connectivity/source/drivers/evoab2/NStatement.cxx
+++ b/connectivity/source/drivers/evoab2/NStatement.cxx
@@ -381,15 +381,16 @@ EBookQuery *OCommonStatement::whereAnalysis( const OSQLParseNode* parseTree )
// SQL like
else if( SQL_ISRULE( parseTree, like_predicate ) )
{
- ENSURE_OR_THROW( parseTree->count() >= 4, "unexpected like_predicate structure" );
+ ENSURE_OR_THROW( parseTree->count() == 2, "unexpected like_predicate structure" );
+ const OSQLParseNode* pPart2 = parseTree->getChild(1);
if( ! SQL_ISRULE( parseTree->getChild( 0 ), column_ref) )
m_pConnection->throwGenericSQLException(STR_QUERY_INVALID_LIKE_COLUMN,*this);
::rtl::OUString aColumnName( impl_getColumnRefColumnName_throw( *parseTree->getChild( 0 ) ) );
- OSQLParseNode *pAtom = parseTree->getChild( parseTree->count() - 2 ); // Match String
- bool bNotLike = parseTree->count() == 5;
+ OSQLParseNode *pAtom = pPart2->getChild( pPart2->count() - 2 ); // Match String
+ bool bNotLike = pPart2->getChild(0)->isToken();
if( !( pAtom->getNodeType() == SQL_NODE_STRING ||
pAtom->getNodeType() == SQL_NODE_NAME ||
diff --git a/connectivity/source/drivers/evoab2/evoab2.map b/connectivity/source/drivers/evoab2/evoab2.map
deleted file mode 100644
index 00cf7191f143..000000000000
--- a/connectivity/source/drivers/evoab2/evoab2.map
+++ /dev/null
@@ -1,8 +0,0 @@
-EVOAB_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/evoab2/makefile.mk b/connectivity/source/drivers/evoab2/makefile.mk
index 43600a379fbc..e8a1cf96cddf 100644
--- a/connectivity/source/drivers/evoab2/makefile.mk
+++ b/connectivity/source/drivers/evoab2/makefile.mk
@@ -65,7 +65,7 @@ SLOFILES=\
$(SLO)$/EApi.obj \
$(SLO)$/NDebug.obj
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/file/FColumns.cxx b/connectivity/source/drivers/file/FColumns.cxx
index 7c70d4c4372d..3c3929a80c50 100644
--- a/connectivity/source/drivers/file/FColumns.cxx
+++ b/connectivity/source/drivers/file/FColumns.cxx
@@ -64,6 +64,7 @@ sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName)
sdbcx::OColumn* pRet = new sdbcx::OColumn(_rName,
xRow->getString(6),
xRow->getString(13),
+ xRow->getString(12),
xRow->getInt(11),
xRow->getInt(7),
xRow->getInt(9),
diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx b/connectivity/source/drivers/file/FPreparedStatement.cxx
index 080b2a592aef..68e23360331b 100644
--- a/connectivity/source/drivers/file/FPreparedStatement.cxx
+++ b/connectivity/source/drivers/file/FPreparedStatement.cxx
@@ -511,6 +511,7 @@ UINT32 OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Refere
Reference<XPropertySet> xParaColumn = new connectivity::parse::OParseColumn(sParameterName
,::rtl::OUString()
,::rtl::OUString()
+ ,::rtl::OUString()
,nNullable
,nPrecision
,nScale
diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx
index 9cf9874dbf10..eeaec1ff40f1 100644
--- a/connectivity/source/drivers/file/fcomp.cxx
+++ b/connectivity/source/drivers/file/fcomp.cxx
@@ -288,17 +288,14 @@ OOperand* OPredicateCompiler::execute_COMPARE(OSQLParseNode* pPredicateNode) th
//------------------------------------------------------------------
OOperand* OPredicateCompiler::execute_LIKE(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
{
- DBG_ASSERT(pPredicateNode->count() >= 4,"OFILECursor: Fehler im Parse Tree");
+ DBG_ASSERT(pPredicateNode->count() == 2,"OFILECursor: Fehler im Parse Tree");
+ const OSQLParseNode* pPart2 = pPredicateNode->getChild(1);
- sal_Int32 ePredicateType;
sal_Unicode cEscape = L'\0';
- if (pPredicateNode->count() == 5)
- ePredicateType = SQLFilterOperator::NOT_LIKE;
- else
- ePredicateType = SQLFilterOperator::LIKE;
+ const bool bNotLike = pPart2->getChild(0)->isToken();
- OSQLParseNode* pAtom = pPredicateNode->getChild(pPredicateNode->count()-2);
- OSQLParseNode* pOptEscape = pPredicateNode->getChild(pPredicateNode->count()-1);
+ OSQLParseNode* pAtom = pPart2->getChild(pPart2->count()-2);
+ OSQLParseNode* pOptEscape = pPart2->getChild(pPart2->count()-1);
if (!(pAtom->getNodeType() == SQL_NODE_STRING || SQL_ISRULE(pAtom,parameter)))
{
@@ -322,9 +319,9 @@ OOperand* OPredicateCompiler::execute_LIKE(OSQLParseNode* pPredicateNode) throw(
execute(pPredicateNode->getChild(0));
execute(pAtom);
- OBoolOperator* pOperator = (ePredicateType == SQLFilterOperator::LIKE)
- ? new OOp_LIKE(cEscape)
- : new OOp_NOTLIKE(cEscape);
+ OBoolOperator* pOperator = bNotLike
+ ? new OOp_NOTLIKE(cEscape)
+ : new OOp_LIKE(cEscape);
m_aCodeList.push_back(pOperator);
return NULL;
@@ -332,11 +329,12 @@ OOperand* OPredicateCompiler::execute_LIKE(OSQLParseNode* pPredicateNode) throw(
//------------------------------------------------------------------
OOperand* OPredicateCompiler::execute_BETWEEN(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
{
- DBG_ASSERT(pPredicateNode->count() == 6,"OFILECursor: Fehler im Parse Tree");
+ DBG_ASSERT(pPredicateNode->count() == 2,"OFILECursor: Fehler im Parse Tree");
OSQLParseNode* pColumn = pPredicateNode->getChild(0);
- OSQLParseNode* p1stValue = pPredicateNode->getChild(3);
- OSQLParseNode* p2ndtValue = pPredicateNode->getChild(5);
+ const OSQLParseNode* pPart2 = pPredicateNode->getChild(1);
+ OSQLParseNode* p1stValue = pPart2->getChild(2);
+ OSQLParseNode* p2ndtValue = pPart2->getChild(4);
if (
!(p1stValue->getNodeType() == SQL_NODE_STRING || SQL_ISRULE(p1stValue,parameter))
@@ -346,7 +344,7 @@ OOperand* OPredicateCompiler::execute_BETWEEN(OSQLParseNode* pPredicateNode) thr
m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_INVALID_BETWEEN,NULL);
}
- sal_Bool bNot = SQL_ISTOKEN(pPredicateNode->getChild(1),NOT);
+ sal_Bool bNot = SQL_ISTOKEN(pPart2->getChild(0),NOT);
OOperand* pColumnOp = execute(pColumn);
OOperand* pOb1 = execute(p1stValue);
@@ -411,11 +409,12 @@ OOperand* OPredicateCompiler::execute_BETWEEN(OSQLParseNode* pPredicateNode) thr
//------------------------------------------------------------------
OOperand* OPredicateCompiler::execute_ISNULL(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
{
- DBG_ASSERT(pPredicateNode->count() >= 3,"OFILECursor: Fehler im Parse Tree");
- DBG_ASSERT(SQL_ISTOKEN(pPredicateNode->getChild(1),IS),"OFILECursor: Fehler im Parse Tree");
+ DBG_ASSERT(pPredicateNode->count() == 2,"OFILECursor: Fehler im Parse Tree");
+ const OSQLParseNode* pPart2 = pPredicateNode->getChild(1);
+ DBG_ASSERT(SQL_ISTOKEN(pPart2->getChild(0),IS),"OFILECursor: Fehler im Parse Tree");
sal_Int32 ePredicateType;
- if (SQL_ISTOKEN(pPredicateNode->getChild(2),NOT))
+ if (SQL_ISTOKEN(pPart2->getChild(1),NOT))
ePredicateType = SQLFilterOperator::NOT_SQLNULL;
else
ePredicateType = SQLFilterOperator::SQLNULL;
@@ -635,7 +634,6 @@ OOperand* OPredicateCompiler::executeFunction(OSQLParseNode* pPredicateNode)
switch ( nTokenId )
{
case SQL_TOKEN_CHAR_LENGTH:
- case SQL_TOKEN_CHARACTER_LENGTH:
case SQL_TOKEN_LENGTH:
case SQL_TOKEN_OCTET_LENGTH:
case SQL_TOKEN_ASCII:
@@ -677,7 +675,6 @@ OOperand* OPredicateCompiler::executeFunction(OSQLParseNode* pPredicateNode)
switch( nTokenId )
{
case SQL_TOKEN_CHAR_LENGTH:
- case SQL_TOKEN_CHARACTER_LENGTH:
case SQL_TOKEN_LENGTH:
case SQL_TOKEN_OCTET_LENGTH:
pOperator = new OOp_CharLength();
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index 2d46c3be5bf3..eff2464ce533 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -304,7 +304,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
}
- sdbcx::OColumn* pColumn = new sdbcx::OColumn(aAlias,aTypeName,::rtl::OUString(),
+ sdbcx::OColumn* pColumn = new sdbcx::OColumn(aAlias,aTypeName,::rtl::OUString(),::rtl::OUString(),
ColumnValue::NULLABLE,
nPrecision,
nScale,
diff --git a/connectivity/source/drivers/flat/flat.map b/connectivity/source/drivers/flat/flat.map
deleted file mode 100644
index bf26bd0fa0fa..000000000000
--- a/connectivity/source/drivers/flat/flat.map
+++ /dev/null
@@ -1,8 +0,0 @@
-FLAT_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/flat/makefile.mk b/connectivity/source/drivers/flat/makefile.mk
index 312e6d6c9426..2d1f99f759c7 100644
--- a/connectivity/source/drivers/flat/makefile.mk
+++ b/connectivity/source/drivers/flat/makefile.mk
@@ -70,7 +70,7 @@ EXCEPTIONSFILES=\
$(SLO)$/EDriver.obj
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
diff --git a/connectivity/source/drivers/hsqldb/hsqldb.xcu b/connectivity/source/drivers/hsqldb/hsqldb.xcu
index e5ab3cc4ba14..f97b5e357179 100755
--- a/connectivity/source/drivers/hsqldb/hsqldb.xcu
+++ b/connectivity/source/drivers/hsqldb/hsqldb.xcu
@@ -50,6 +50,11 @@
<value>true</value>
</prop>
</node>
+ <node oor:name="AddIndexAppendix" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
</node>
<node oor:name="MetaData">
<node oor:name="SupportsTableCreation" oor:op="replace">
diff --git a/connectivity/source/drivers/jdbc/jdbc.map b/connectivity/source/drivers/jdbc/jdbc.map
deleted file mode 100644
index 23369ec76466..000000000000
--- a/connectivity/source/drivers/jdbc/jdbc.map
+++ /dev/null
@@ -1,8 +0,0 @@
-JDBC_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/jdbc/jdbc.xcu b/connectivity/source/drivers/jdbc/jdbc.xcu
index 59fb95460aa2..f4f599a701d9 100755
--- a/connectivity/source/drivers/jdbc/jdbc.xcu
+++ b/connectivity/source/drivers/jdbc/jdbc.xcu
@@ -189,6 +189,11 @@
<value>oracle.jdbc.driver.OracleDriver</value>
</prop>
</node>
+ <node oor:name="AddIndexAppendix" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
</node>
<node oor:name="Features">
<node oor:name="IgnoreCurrency" oor:op="replace">
diff --git a/connectivity/source/drivers/jdbc/makefile.mk b/connectivity/source/drivers/jdbc/makefile.mk
index 2de63f2c0366..46619952163b 100644
--- a/connectivity/source/drivers/jdbc/makefile.mk
+++ b/connectivity/source/drivers/jdbc/makefile.mk
@@ -78,7 +78,7 @@ SLOFILES=\
$(SLO)$/tools.obj \
$(SLO)$/ContextClassLoader.obj
-SHL1VERSIONMAP=$(JDBC_TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/kab/KColumns.cxx b/connectivity/source/drivers/kab/KColumns.cxx
index d75e782aed7b..4adcbe304c82 100644
--- a/connectivity/source/drivers/kab/KColumns.cxx
+++ b/connectivity/source/drivers/kab/KColumns.cxx
@@ -66,6 +66,7 @@ sdbcx::ObjectType KabColumns::createObject(const ::rtl::OUString& _rName)
_rName,
xRow->getString(6),
xRow->getString(13),
+ xRow->getString(12),
xRow->getInt(11),
xRow->getInt(7),
xRow->getInt(9),
diff --git a/connectivity/source/drivers/kab/KStatement.cxx b/connectivity/source/drivers/kab/KStatement.cxx
index 4164ffe0ee52..f0069fc6875e 100644
--- a/connectivity/source/drivers/kab/KStatement.cxx
+++ b/connectivity/source/drivers/kab/KStatement.cxx
@@ -185,12 +185,13 @@ KabCondition *KabCommonStatement::analyseWhereClause(const OSQLParseNode *pParse
}
}
}
- else if (pParseNode->count() == 4)
+ else if (SQL_ISRULE(pParseNode, test_for_null) || SQL_ISRULE(pParseNode, like_predicate))
{
- const OSQLParseNode *pLeft = pParseNode->getChild(0),
- *pMiddleLeft = pParseNode->getChild(1),
- *pMiddleRight = pParseNode->getChild(2),
- *pRight = pParseNode->getChild(3);
+ const OSQLParseNode *pLeft = pParseNode->getChild(0);
+ const OSQLParseNode* pPart2 = pParseNode->getChild(1);
+ const OSQLParseNode *pMiddleLeft = pPart2->getChild(0),
+ *pMiddleRight = pPart2->getChild(1),
+ *pRight = pPart2->getChild(2);
if (SQL_ISRULE(pParseNode, test_for_null))
{
diff --git a/connectivity/source/drivers/kab/kab.map b/connectivity/source/drivers/kab/kab.map
deleted file mode 100644
index 6b7216de8c11..000000000000
--- a/connectivity/source/drivers/kab/kab.map
+++ /dev/null
@@ -1,8 +0,0 @@
-KAB_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/kab/kabdrv.map b/connectivity/source/drivers/kab/kabdrv.map
index c32084ddd4ab..5de866f2e52f 100644
--- a/connectivity/source/drivers/kab/kabdrv.map
+++ b/connectivity/source/drivers/kab/kabdrv.map
@@ -1,4 +1,4 @@
-KAB_1_0 {
+UDK_3_0_0 {
global:
createKabConnection;
initKApplication;
diff --git a/connectivity/source/drivers/kab/makefile.mk b/connectivity/source/drivers/kab/makefile.mk
index 98148a29e98d..2a0dc5cd8999 100644
--- a/connectivity/source/drivers/kab/makefile.mk
+++ b/connectivity/source/drivers/kab/makefile.mk
@@ -61,7 +61,7 @@ DEPOBJFILES= \
# --- Library -----------------------------------
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1TARGET= $(TARGET)$(KAB_MAJOR)
SHL1OBJS=$(SLOFILES)
diff --git a/connectivity/source/drivers/macab/MacabColumns.cxx b/connectivity/source/drivers/macab/MacabColumns.cxx
index 9eccf1a11b73..c1ba3f1fe6d0 100755
--- a/connectivity/source/drivers/macab/MacabColumns.cxx
+++ b/connectivity/source/drivers/macab/MacabColumns.cxx
@@ -66,6 +66,7 @@ sdbcx::ObjectType MacabColumns::createObject(const ::rtl::OUString& _rName)
_rName,
xRow->getString(6),
xRow->getString(13),
+ xRow->getString(12),
xRow->getInt(11),
xRow->getInt(7),
xRow->getInt(9),
diff --git a/connectivity/source/drivers/macab/MacabConnection.cxx b/connectivity/source/drivers/macab/MacabConnection.cxx
index 58cf82f272fc..31b2bbfd6b1e 100755
--- a/connectivity/source/drivers/macab/MacabConnection.cxx
+++ b/connectivity/source/drivers/macab/MacabConnection.cxx
@@ -314,10 +314,11 @@ MacabAddressBook* MacabConnection::getAddressBook() const
return m_pAddressBook;
}
// -----------------------------------------------------------------------------
-extern "C" void* SAL_CALL createMacabConnection( void* _pDriver )
+extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL createMacabConnection( void* _pDriver )
{
MacabConnection* pConnection = new MacabConnection( static_cast< MacabDriver* >( _pDriver ) );
// by definition, the pointer crossing library boundaries as void ptr is acquired once
pConnection->acquire();
return pConnection;
}
+
diff --git a/connectivity/source/drivers/macab/MacabServices.cxx b/connectivity/source/drivers/macab/MacabServices.cxx
index 6f48fb0a7e57..b3c303324302 100755
--- a/connectivity/source/drivers/macab/MacabServices.cxx
+++ b/connectivity/source/drivers/macab/MacabServices.cxx
@@ -114,7 +114,7 @@ struct ProviderRequest
//---------------------------------------------------------------------------------------
-extern "C" void SAL_CALL component_getImplementationEnvironment(
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
const sal_Char **ppEnvTypeName,
uno_Environment **
)
@@ -123,7 +123,7 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
}
//---------------------------------------------------------------------------------------
-extern "C" sal_Bool SAL_CALL component_writeInfo(
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
void*,
void* pRegistryKey
)
@@ -148,7 +148,7 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(
}
//---------------------------------------------------------------------------------------
-extern "C" void* SAL_CALL component_getFactory(
+extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
void*)
diff --git a/connectivity/source/drivers/macab/MacabStatement.cxx b/connectivity/source/drivers/macab/MacabStatement.cxx
index 8ee24921667a..9960ea7a4d97 100755
--- a/connectivity/source/drivers/macab/MacabStatement.cxx
+++ b/connectivity/source/drivers/macab/MacabStatement.cxx
@@ -188,12 +188,13 @@ MacabCondition *MacabCommonStatement::analyseWhereClause(const OSQLParseNode *pP
}
}
}
- else if (pParseNode->count() == 4)
+ else if (SQL_ISRULE(pParseNode, test_for_null) || SQL_ISRULE(pParseNode, like_predicate))
{
- const OSQLParseNode *pLeft = pParseNode->getChild(0),
- *pMiddleLeft = pParseNode->getChild(1),
- *pMiddleRight = pParseNode->getChild(2),
- *pRight = pParseNode->getChild(3);
+ const OSQLParseNode *pLeft = pParseNode->getChild(0);
+ const OSQLParseNode* pPart2 = pParseNode->getChild(1);
+ const OSQLParseNode *pMiddleLeft = pPart2->getChild(0),
+ *pMiddleRight = pPart2->getChild(1),
+ *pRight = pPart2->getChild(2);
if (SQL_ISRULE(pParseNode, test_for_null))
{
diff --git a/connectivity/source/drivers/macab/macab.map b/connectivity/source/drivers/macab/macab.map
deleted file mode 100755
index fe2d1ac90534..000000000000
--- a/connectivity/source/drivers/macab/macab.map
+++ /dev/null
@@ -1,8 +0,0 @@
-MACAB_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/macab/macab.xcu b/connectivity/source/drivers/macab/macab.xcu
index 7d4fa6df7d70..0845bc9a2ce2 100755
--- a/connectivity/source/drivers/macab/macab.xcu
+++ b/connectivity/source/drivers/macab/macab.xcu
@@ -27,7 +27,7 @@
************************************************************************ -->
<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<node oor:name="Installed">
- <node oor:name="sdbc:address:macab:*" oor:op="replace">
+ <node oor:name="sdbc:address:macab" oor:op="replace">
<prop oor:name="Driver">
<value>com.sun.star.comp.sdbc.macab.Driver</value>
</prop>
diff --git a/connectivity/source/drivers/macab/macabdrv.map b/connectivity/source/drivers/macab/macabdrv.map
deleted file mode 100755
index d953690f6ba3..000000000000
--- a/connectivity/source/drivers/macab/macabdrv.map
+++ /dev/null
@@ -1,6 +0,0 @@
-MACAB_1_0 {
- global:
- createMacabConnection;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/macab/makefile.mk b/connectivity/source/drivers/macab/makefile.mk
index 811f1fabb143..35532b15ec2d 100755
--- a/connectivity/source/drivers/macab/makefile.mk
+++ b/connectivity/source/drivers/macab/makefile.mk
@@ -54,8 +54,6 @@ DEPOBJFILES= \
# --- Library -----------------------------------
-SHL1VERSIONMAP=$(TARGET).map
-
SHL1TARGET= $(TARGET)$(MACAB_MAJOR)
SHL1OBJS=$(SLOFILES)
SHL1STDLIBS=\
@@ -98,8 +96,6 @@ MACAB_LIB=-framework Carbon -framework AddressBook
# --- Library -----------------------------------
-SHL2VERSIONMAP=$(TARGET2).map
-
SHL2TARGET= $(TARGET2)$(MACAB_MAJOR)
SHL2OBJS=$(SLO2FILES)
SHL2STDLIBS=\
diff --git a/connectivity/source/drivers/mozab/MColumns.cxx b/connectivity/source/drivers/mozab/MColumns.cxx
index 17b418899f45..42a33bbc2a98 100644
--- a/connectivity/source/drivers/mozab/MColumns.cxx
+++ b/connectivity/source/drivers/mozab/MColumns.cxx
@@ -74,6 +74,7 @@ sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName)
OColumn* pRet = new OColumn(_rName,
sTypeName,
xRow->getString(13),
+ xRow->getString(12),
xRow->getInt(11),
nPrec,
xRow->getInt(9),
diff --git a/connectivity/source/drivers/mozab/MPreparedStatement.cxx b/connectivity/source/drivers/mozab/MPreparedStatement.cxx
index 38caad53b551..5aad943b151a 100644
--- a/connectivity/source/drivers/mozab/MPreparedStatement.cxx
+++ b/connectivity/source/drivers/mozab/MPreparedStatement.cxx
@@ -450,6 +450,7 @@ sal_uInt32 OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Re
Reference<XPropertySet> xParaColumn = new connectivity::sdbcx::OColumn(sParameterName
,::rtl::OUString()
,::rtl::OUString()
+ ,::rtl::OUString()
,nNullable
,nPrecision
,nScale
diff --git a/connectivity/source/drivers/mozab/MResultSet.cxx b/connectivity/source/drivers/mozab/MResultSet.cxx
index 9602a35a8b29..c7c85770419e 100644
--- a/connectivity/source/drivers/mozab/MResultSet.cxx
+++ b/connectivity/source/drivers/mozab/MResultSet.cxx
@@ -882,7 +882,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
}
else if (SQL_ISRULE(parseTree,like_predicate))
{
- OSL_ENSURE(parseTree->count() >= 4, "Error parsing LIKE predicate");
+ OSL_ENSURE(parseTree->count() == 2, "Error parsing LIKE predicate");
OSL_TRACE("analyseSQL : Got LIKE rule\n");
@@ -895,9 +895,11 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
OSQLParseNode *pColumn;
OSQLParseNode *pAtom;
OSQLParseNode *pOptEscape;
+ const OSQLParseNode* pPart2 = parseTree->getChild(1);
pColumn = parseTree->getChild(0); // Match Item
- pAtom = parseTree->getChild(parseTree->count()-2); // Match String
- pOptEscape = parseTree->getChild(parseTree->count()-1); // Opt Escape Rule
+ pAtom = pPart2->getChild(parseTree->count()-2); // Match String
+ pOptEscape = pPart2->getChild(parseTree->count()-1); // Opt Escape Rule
+ const bool bNot = SQL_ISTOKEN(pPart2->getChild(0), NOT);
if (!(pAtom->getNodeType() == SQL_NODE_STRING ||
pAtom->getNodeType() == SQL_NODE_NAME ||
@@ -945,7 +947,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
matchString.indexOf ( MATCHCHAR ) == -1 )
{
// Simple string , eg. "to match"
- if ( parseTree->count() == 5 )
+ if ( bNot )
op = MQueryOp::DoesNotContain;
else
op = MQueryOp::Contains;
@@ -961,12 +963,12 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
matchString = matchString.replaceAt( 0, 1, rtl::OUString() );
matchString = matchString.replaceAt( matchString.getLength() -1 , 1, rtl::OUString() );
- if ( parseTree->count() == 5 )
+ if (bNot)
op = MQueryOp::DoesNotContain;
else
op = MQueryOp::Contains;
}
- else if ( parseTree->count() == 5 )
+ else if ( bNot )
{
// We currently can't handle a 'NOT LIKE' when there are '%' or
// '_' dispersed throughout
@@ -1020,15 +1022,16 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
}
else if (SQL_ISRULE(parseTree,test_for_null))
{
- OSL_ENSURE(parseTree->count() >= 3,"Error in ParseTree");
- OSL_ENSURE(SQL_ISTOKEN(parseTree->getChild(1),IS),"Error in ParseTree");
+ OSL_ENSURE(parseTree->count() == 2,"Error in ParseTree");
+ const OSQLParseNode* pPart2 = parseTree->getChild(1);
+ OSL_ENSURE(SQL_ISTOKEN(pPart2->getChild(0),IS),"Error in ParseTree");
if (!SQL_ISRULE(parseTree->getChild(0),column_ref))
{
m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_INVALID_IS_NULL_COLUMN, *this );
}
- if (SQL_ISTOKEN(parseTree->getChild(2),NOT))
+ if (SQL_ISTOKEN(pPart2->getChild(1),NOT))
{
op = MQueryOp::Exists;
}
diff --git a/connectivity/source/drivers/mozab/bootstrap/makefile.mk b/connectivity/source/drivers/mozab/bootstrap/makefile.mk
index 78c1e39578c0..6a4172da205d 100644
--- a/connectivity/source/drivers/mozab/bootstrap/makefile.mk
+++ b/connectivity/source/drivers/mozab/bootstrap/makefile.mk
@@ -67,7 +67,7 @@ SLOFILES += \
CDEFS+=-DMINIMAL_PROFILEDISCOVER
SHL1TARGET=$(TARGET)
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1OBJS=$(SLOFILES)
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.map b/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.map
deleted file mode 100644
index 750db5d4af09..000000000000
--- a/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.map
+++ /dev/null
@@ -1,8 +0,0 @@
-MOZBOOTSTRAP_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/mozab/makefile.mk b/connectivity/source/drivers/mozab/makefile.mk
index ffcc41af7536..b1e12fde6f8a 100644
--- a/connectivity/source/drivers/mozab/makefile.mk
+++ b/connectivity/source/drivers/mozab/makefile.mk
@@ -85,7 +85,7 @@ SLOFILES=\
# --- MOZAB BASE Library -----------------------------------
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
SHL1OBJS=$(SLOFILES)
SHL1STDLIBS=\
diff --git a/connectivity/source/drivers/mozab/mozab.map b/connectivity/source/drivers/mozab/mozab.map
deleted file mode 100644
index 9f3a1f27d0f5..000000000000
--- a/connectivity/source/drivers/mozab/mozab.map
+++ /dev/null
@@ -1,8 +0,0 @@
-MOZAB_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/mozab/mozabdrv.map b/connectivity/source/drivers/mozab/mozabdrv.map
index 918cb530e1f1..a431a0737754 100644
--- a/connectivity/source/drivers/mozab/mozabdrv.map
+++ b/connectivity/source/drivers/mozab/mozabdrv.map
@@ -1,4 +1,4 @@
-MOZABDRV_1_0 {
+UDK_3_0_0 {
global:
OMozabConnection_CreateInstance;
OMozillaBootstrap_CreateInstance;
diff --git a/connectivity/source/drivers/mysql/YTable.cxx b/connectivity/source/drivers/mysql/YTable.cxx
index 72383be76c58..06be64f83313 100644
--- a/connectivity/source/drivers/mysql/YTable.cxx
+++ b/connectivity/source/drivers/mysql/YTable.cxx
@@ -220,12 +220,16 @@ void SAL_CALL OMySQLTable::alterColumnByName( const ::rtl::OUString& colName, co
xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)) >>= bOldAutoIncrement;
descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)) >>= bAutoIncrement;
bool bColumnNameChanged = false;
+ ::rtl::OUString sOldDesc,sNewDesc;
+ xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_DESCRIPTION)) >>= sOldDesc;
+ descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_DESCRIPTION)) >>= sNewDesc;
if ( nOldType != nNewType
|| nOldPrec != nNewPrec
|| nOldScale != nNewScale
|| nNewNullable != nOldNullable
- || bOldAutoIncrement != bAutoIncrement )
+ || bOldAutoIncrement != bAutoIncrement
+ || sOldDesc != sNewDesc )
{
// special handling because they change dthe type names to distinguish
// if a column should be an auto_incmrement one
@@ -281,7 +285,7 @@ void SAL_CALL OMySQLTable::alterColumnByName( const ::rtl::OUString& colName, co
const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
sSql += ::dbtools::quoteName(sQuote,colName);
sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
- sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(descriptor,getConnection(),getTypeCreatePattern()));
+ sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(descriptor,getConnection(),static_cast<OTables*>(m_pTables),getTypeCreatePattern()));
executeStatement(sSql);
}
m_pColumns->refresh();
@@ -310,7 +314,7 @@ void OMySQLTable::alterColumnType(sal_Int32 nNewType,const ::rtl::OUString& _rCo
::comphelper::copyProperties(_xDescriptor,xProp);
xProp->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE),makeAny(nNewType));
- sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(xProp,getConnection(),getTypeCreatePattern()));
+ sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(xProp,getConnection(),static_cast<OTables*>(m_pTables),getTypeCreatePattern()));
executeStatement(sSql);
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/mysql/YTables.cxx b/connectivity/source/drivers/mysql/YTables.cxx
index b337ddc92390..80bb2baf58c0 100644
--- a/connectivity/source/drivers/mysql/YTables.cxx
+++ b/connectivity/source/drivers/mysql/YTables.cxx
@@ -204,7 +204,7 @@ void OTables::createTable( const Reference< XPropertySet >& descriptor )
{
const Reference< XConnection > xConnection = static_cast<OMySQLCatalog&>(m_rParent).getConnection();
static const ::rtl::OUString s_sCreatePattern(RTL_CONSTASCII_USTRINGPARAM("(M,D)"));
- const ::rtl::OUString aSql = adjustSQL(::dbtools::createSqlCreateTableStatement(descriptor,xConnection,s_sCreatePattern));
+ const ::rtl::OUString aSql = adjustSQL(::dbtools::createSqlCreateTableStatement(descriptor,xConnection,this,s_sCreatePattern));
Reference< XStatement > xStmt = xConnection->createStatement( );
if ( xStmt.is() )
{
@@ -230,4 +230,14 @@ void OTables::appendNew(const ::rtl::OUString& _rsNewTable)
return ::dbtools::composeTableName( m_xMetaData, _xObject, ::dbtools::eInDataManipulation, false, false, false );
}
// -----------------------------------------------------------------------------
-
+void OTables::addComment(const Reference< XPropertySet >& descriptor,::rtl::OUStringBuffer& _rOut)
+{
+ ::rtl::OUString sDesc;
+ descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION)) >>= sDesc;
+ if ( sDesc.getLength() )
+ {
+ _rOut.appendAscii(" COMMENT '");
+ _rOut.append(sDesc);
+ _rOut.appendAscii("'");
+ }
+}
diff --git a/connectivity/source/drivers/mysql/makefile.mk b/connectivity/source/drivers/mysql/makefile.mk
index af486c293806..fbb68321cb01 100644
--- a/connectivity/source/drivers/mysql/makefile.mk
+++ b/connectivity/source/drivers/mysql/makefile.mk
@@ -55,7 +55,7 @@ SLOFILES=\
$(SLO)$/YUsers.obj \
$(SLO)$/Yservices.obj
-SHL1VERSIONMAP=$(MYSQL_TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/mysql/mysql.map b/connectivity/source/drivers/mysql/mysql.map
deleted file mode 100644
index 834658431ada..000000000000
--- a/connectivity/source/drivers/mysql/mysql.map
+++ /dev/null
@@ -1,8 +0,0 @@
-MYSQL_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/mysql/mysql.xcu b/connectivity/source/drivers/mysql/mysql.xcu
index 2fc59be5bdc3..afc5c0d07f5d 100755
--- a/connectivity/source/drivers/mysql/mysql.xcu
+++ b/connectivity/source/drivers/mysql/mysql.xcu
@@ -45,6 +45,11 @@
<value>com.mysql.jdbc.Driver</value>
</prop>
</node>
+ <node oor:name="AddIndexAppendix" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
<node oor:name="Features">
<node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
@@ -94,6 +99,11 @@
<value>UserPassword</value>
</prop>
</node>
+ <node oor:name="SupportsColumnDescription" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
</node>
<node oor:name="sdbc:mysql:odbc:*" oor:op="replace">
@@ -109,6 +119,11 @@
<value></value>
</prop>
</node>
+ <node oor:name="AddIndexAppendix" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
<node oor:name="Features">
<node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
@@ -183,6 +198,11 @@
<value></value>
</prop>
</node>
+ <node oor:name="AddIndexAppendix" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
<node oor:name="Features">
<node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
@@ -227,6 +247,11 @@
<value>UserPassword</value>
</prop>
</node>
+ <node oor:name="SupportsColumnDescription" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
</node>
</node>
diff --git a/connectivity/source/drivers/odbc/makefile.mk b/connectivity/source/drivers/odbc/makefile.mk
index 09052f9d77a3..508cbfb6df63 100644
--- a/connectivity/source/drivers/odbc/makefile.mk
+++ b/connectivity/source/drivers/odbc/makefile.mk
@@ -71,7 +71,7 @@ SHL1IMPLIB= i$(ODBC_TARGET)
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
-SHL1VERSIONMAP=odbc.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Targets ----------------------------------
diff --git a/connectivity/source/drivers/odbc/odbc.map b/connectivity/source/drivers/odbc/odbc.map
deleted file mode 100644
index 14e4b7110c89..000000000000
--- a/connectivity/source/drivers/odbc/odbc.map
+++ /dev/null
@@ -1,8 +0,0 @@
-ODBC_3_0_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
index 80aacacef576..751ab7cf2988 100644
--- a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
@@ -97,7 +97,7 @@ ODatabaseMetaDataResultSet::~ODatabaseMetaDataResultSet()
osl_incrementInterlockedCount( &m_refCount );
dispose();
}
- delete m_pRowStatusArray;
+ delete [] m_pRowStatusArray;
}
// -------------------------------------------------------------------------
void ODatabaseMetaDataResultSet::disposing(void)
diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx
index da29bcf08c17..7055bd273370 100644
--- a/connectivity/source/drivers/odbcbase/OResultSet.cxx
+++ b/connectivity/source/drivers/odbcbase/OResultSet.cxx
@@ -162,7 +162,7 @@ OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,OStatement_Base* pStmt) :
// -------------------------------------------------------------------------
OResultSet::~OResultSet()
{
- delete m_pRowStatusArray;
+ delete [] m_pRowStatusArray;
delete m_pSkipDeletedSet;
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/odbcbase/OTools.cxx b/connectivity/source/drivers/odbcbase/OTools.cxx
index b892e6336b19..43de55e3505c 100644
--- a/connectivity/source/drivers/odbcbase/OTools.cxx
+++ b/connectivity/source/drivers/odbcbase/OTools.cxx
@@ -391,6 +391,7 @@ void OTools::bindValue( OConnection* _pConnection,
case SQL_TIMESTAMP:
*pLen = sizeof(TIMESTAMP_STRUCT);
*((TIMESTAMP_STRUCT*)_pData) = *(TIMESTAMP_STRUCT*)_pValue;
+ break;
}
}
catch ( ... )
diff --git a/connectivity/source/inc/mysql/YTables.hxx b/connectivity/source/inc/mysql/YTables.hxx
index 421012e3678e..ec19ac83140b 100644
--- a/connectivity/source/inc/mysql/YTables.hxx
+++ b/connectivity/source/inc/mysql/YTables.hxx
@@ -28,12 +28,14 @@
#define CONNECTIVITY_MYSQL_TABLES_HXX
#include "connectivity/sdbcx/VCollection.hxx"
+#include "connectivity/SQLStatementHelper.hxx"
#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
namespace connectivity
{
namespace mysql
{
- class OTables : public sdbcx::OCollection
+ class OTables : public sdbcx::OCollection,
+ public ::dbtools::ISQLStatementHelper
{
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
@@ -76,6 +78,9 @@ namespace connectivity
@param _sSql in/out
*/
static ::rtl::OUString adjustSQL(const ::rtl::OUString& _sSql);
+
+ // ISQLStatementHelper
+ virtual void addComment(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor,::rtl::OUStringBuffer& _rOut);
};
}
}
diff --git a/connectivity/source/inc/propertyids.hxx b/connectivity/source/inc/propertyids.hxx
index 1f7252158918..b28278b0477d 100644
--- a/connectivity/source/inc/propertyids.hxx
+++ b/connectivity/source/inc/propertyids.hxx
@@ -133,7 +133,7 @@ pProperties[nPos++] = ::com::sun::star::beans::Property(::connectivity::OMetaCon
#define PROPERTY_ID_INVALID_INDEX 41
#define PROPERTY_ID_HY010 43
- // FREE
+#define PROPERTY_ID_LABEL 44
#define PROPERTY_ID_DELIMITER 45
#define PROPERTY_ID_FORMATKEY 46
#define PROPERTY_ID_LOCALE 47
diff --git a/connectivity/source/manager/makefile.mk b/connectivity/source/manager/makefile.mk
index e72dfc78bcdf..52ec191ec836 100644
--- a/connectivity/source/manager/makefile.mk
+++ b/connectivity/source/manager/makefile.mk
@@ -52,7 +52,7 @@ SLOFILES=\
SHL1TARGET= $(SDBC_TARGET)$(SDBC_MAJOR)
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1OBJS=$(SLOFILES)
SHL1STDLIBS=\
diff --git a/connectivity/source/manager/sdbc.map b/connectivity/source/manager/sdbc.map
deleted file mode 100644
index 2d8534b22e21..000000000000
--- a/connectivity/source/manager/sdbc.map
+++ /dev/null
@@ -1,8 +0,0 @@
-SDBC_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/parse/PColumn.cxx b/connectivity/source/parse/PColumn.cxx
index 21e78ec61fea..43e38f5a1674 100644
--- a/connectivity/source/parse/PColumn.cxx
+++ b/connectivity/source/parse/PColumn.cxx
@@ -42,12 +42,14 @@ using namespace connectivity::parse;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
// -------------------------------------------------------------------------
OParseColumn::OParseColumn(const Reference<XPropertySet>& _xColumn,sal_Bool _bCase)
: connectivity::sdbcx::OColumn( getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)))
, getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME)))
, getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE)))
+ , getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION)))
, getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)))
, getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)))
, getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)))
@@ -69,6 +71,7 @@ OParseColumn::OParseColumn(const Reference<XPropertySet>& _xColumn,sal_Bool
OParseColumn::OParseColumn( const ::rtl::OUString& _Name,
const ::rtl::OUString& _TypeName,
const ::rtl::OUString& _DefaultValue,
+ const ::rtl::OUString& _Description,
sal_Int32 _IsNullable,
sal_Int32 _Precision,
sal_Int32 _Scale,
@@ -79,6 +82,7 @@ OParseColumn::OParseColumn( const ::rtl::OUString& _Name,
) : connectivity::sdbcx::OColumn(_Name,
_TypeName,
_DefaultValue,
+ _Description,
_IsNullable,
_Precision,
_Scale,
@@ -97,25 +101,52 @@ OParseColumn::OParseColumn( const ::rtl::OUString& _Name,
// -------------------------------------------------------------------------
::vos::ORef< OSQLColumns > OParseColumn::createColumnsForResultSet( const Reference< XResultSetMetaData >& _rxResMetaData,
- const Reference< XDatabaseMetaData >& _rxDBMetaData )
+ const Reference< XDatabaseMetaData >& _rxDBMetaData,const Reference< XNameAccess>& i_xQueryColumns )
{
sal_Int32 nColumnCount = _rxResMetaData->getColumnCount();
::vos::ORef< OSQLColumns > aReturn( new OSQLColumns ); aReturn->get().reserve( nColumnCount );
+ StringMap aColumnMap;
for ( sal_Int32 i = 1; i <= nColumnCount; ++i )
- aReturn->get().push_back( createColumnForResultSet( _rxResMetaData, _rxDBMetaData, i ) );
+ {
+ OParseColumn* pColumn = createColumnForResultSet( _rxResMetaData, _rxDBMetaData, i,aColumnMap );
+ aReturn->get().push_back( pColumn );
+ if ( i_xQueryColumns.is() && i_xQueryColumns->hasByName(pColumn->getRealName()) )
+ {
+ Reference<XPropertySet> xColumn(i_xQueryColumns->getByName(pColumn->getRealName()),UNO_QUERY_THROW);
+ ::rtl::OUString sLabel;
+ xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_LABEL)) >>= sLabel;
+ if ( sLabel.getLength() )
+ pColumn->setLabel(sLabel);
+ }
+ }
return aReturn;
}
// -------------------------------------------------------------------------
OParseColumn* OParseColumn::createColumnForResultSet( const Reference< XResultSetMetaData >& _rxResMetaData,
- const Reference< XDatabaseMetaData >& _rxDBMetaData, sal_Int32 _nColumnPos )
+ const Reference< XDatabaseMetaData >& _rxDBMetaData, sal_Int32 _nColumnPos,StringMap& _rColumns )
{
+ ::rtl::OUString sLabel = _rxResMetaData->getColumnLabel( _nColumnPos );
+ // retrieve the name of the column
+ // check for duplicate entries
+ if(_rColumns.find(sLabel) != _rColumns.end())
+ {
+ ::rtl::OUString sAlias(sLabel);
+ sal_Int32 searchIndex=1;
+ while(_rColumns.find(sAlias) != _rColumns.end())
+ {
+ (sAlias = sLabel) += ::rtl::OUString::valueOf(searchIndex++);
+ }
+ sLabel = sAlias;
+ }
+ _rColumns.insert(StringMap::value_type(sLabel,0));
OParseColumn* pColumn = new OParseColumn(
- _rxResMetaData->getColumnLabel( _nColumnPos ),
+ sLabel,
_rxResMetaData->getColumnTypeName( _nColumnPos ),
::rtl::OUString(),
+ ::rtl::OUString(),
_rxResMetaData->isNullable( _nColumnPos ),
_rxResMetaData->getPrecision( _nColumnPos ),
_rxResMetaData->getScale( _nColumnPos ),
@@ -133,6 +164,7 @@ OParseColumn* OParseColumn::createColumnForResultSet( const Reference< XResultSe
) );
pColumn->setIsSearchable( _rxResMetaData->isSearchable( _nColumnPos ) );
pColumn->setRealName(_rxResMetaData->getColumnName( _nColumnPos ));
+ pColumn->setLabel(sLabel);
return pColumn;
}
@@ -149,7 +181,7 @@ void OParseColumn::construct()
registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REALNAME), PROPERTY_ID_REALNAME, 0, &m_aRealName, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DBASEPRECISIONCHANGED), PROPERTY_ID_DBASEPRECISIONCHANGED, 0, &m_bDbasePrecisionChanged, ::getCppuType(reinterpret_cast<sal_Bool*>(NULL)));
registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISSEARCHABLE), PROPERTY_ID_ISSEARCHABLE, 0, &m_bIsSearchable, ::getCppuType(reinterpret_cast< sal_Bool*>(NULL)));
-
+ registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_LABEL), PROPERTY_ID_LABEL, 0, &m_sLabel, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
}
// -----------------------------------------------------------------------------
::cppu::IPropertyArrayHelper* OParseColumn::createArrayHelper() const
@@ -169,6 +201,7 @@ OOrderColumn::OOrderColumn( const Reference<XPropertySet>& _xColumn
: connectivity::sdbcx::OColumn( getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)))
, getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME)))
, getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE)))
+ , getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION)))
, getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)))
, getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)))
, getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)))
@@ -183,33 +216,6 @@ OOrderColumn::OOrderColumn( const Reference<XPropertySet>& _xColumn
construct();
}
// -------------------------------------------------------------------------
-OOrderColumn::OOrderColumn( const ::rtl::OUString& _Name,
- const ::rtl::OUString& _TypeName,
- const ::rtl::OUString& _DefaultValue,
- sal_Int32 _IsNullable,
- sal_Int32 _Precision,
- sal_Int32 _Scale,
- sal_Int32 _Type,
- sal_Bool _IsAutoIncrement,
- sal_Bool _IsCurrency,
- sal_Bool _bCase
- ,sal_Bool _bAscending
- ) : connectivity::sdbcx::OColumn(_Name,
- _TypeName,
- _DefaultValue,
- _IsNullable,
- _Precision,
- _Scale,
- _Type,
- _IsAutoIncrement,
- sal_False,
- _IsCurrency,
- _bCase)
- , m_bAscending(_bAscending)
-{
- construct();
-}
-// -------------------------------------------------------------------------
OOrderColumn::~OOrderColumn()
{
}
diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
index 4151314d36eb..84e9aa2532ff 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -145,7 +145,7 @@ using namespace connectivity;
%union {
connectivity::OSQLParseNode * pParseNode;
}
-%type <pParseNode> '(' ')' ',' ':' ';' '?' '[' ']' '{' '}' '.'
+%type <pParseNode> '(' ')' ',' ':' ';' '?' '[' ']' '{' '}' '.' 'K' 'M' 'G' 'T' 'P'
%token <pParseNode> SQL_TOKEN_STRING SQL_TOKEN_ACCESS_DATE SQL_TOKEN_INT SQL_TOKEN_REAL_NUM
%token <pParseNode> SQL_TOKEN_INTNUM SQL_TOKEN_APPROXNUM SQL_TOKEN_NOT SQL_TOKEN_NAME
@@ -188,7 +188,7 @@ using namespace connectivity;
/* ODBC KEYWORDS */
%token <pParseNode> SQL_TOKEN_CALL SQL_TOKEN_D SQL_TOKEN_FN SQL_TOKEN_T SQL_TOKEN_TS SQL_TOKEN_OJ
/* string functions */
-%token <pParseNode> SQL_TOKEN_ASCII SQL_TOKEN_BIT_LENGTH SQL_TOKEN_CHAR SQL_TOKEN_CHAR_LENGTH SQL_TOKEN_CHARACTER_LENGTH
+%token <pParseNode> SQL_TOKEN_ASCII SQL_TOKEN_BIT_LENGTH SQL_TOKEN_CHAR SQL_TOKEN_CHAR_LENGTH SQL_TOKEN_SQL_TOKEN_INTNUM
%token <pParseNode> SQL_TOKEN_CONCAT
%token <pParseNode> SQL_TOKEN_DIFFERENCE SQL_TOKEN_INSERT SQL_TOKEN_LCASE SQL_TOKEN_LEFT SQL_TOKEN_LENGTH SQL_TOKEN_LOCATE
%token <pParseNode> SQL_TOKEN_LOCATE_2 SQL_TOKEN_LTRIM SQL_TOKEN_POSITION SQL_TOKEN_REPEAT SQL_TOKEN_REPLACE
@@ -210,6 +210,13 @@ using namespace connectivity;
%token <pParseNode> SQL_TOKEN_EVERY SQL_TOKEN_INTERSECTION SQL_TOKEN_FUSION SQL_TOKEN_COLLECT SQL_TOKEN_VAR_POP SQL_TOKEN_VAR_SAMP
%token <pParseNode> SQL_TOKEN_STDDEV_SAMP SQL_TOKEN_STDDEV_POP
+%token <pParseNode> SQL_TOKEN_RANK SQL_TOKEN_DENSE_RANK SQL_TOKEN_PERCENT_RANK SQL_TOKEN_CUME_DIST SQL_TOKEN_PERCENTILE_CONT SQL_TOKEN_PERCENTILE_DISC SQL_TOKEN_WITHIN SQL_TOKEN_ARRAY_AGG
+%token <pParseNode> SQL_TOKEN_CASE SQL_TOKEN_THEN SQL_TOKEN_END SQL_TOKEN_NULLIF SQL_TOKEN_COALESCE SQL_TOKEN_WHEN SQL_TOKEN_ELSE
+%token <pParseNode> SQL_TOKEN_BEFORE SQL_TOKEN_AFTER SQL_TOKEN_INSTEAD SQL_TOKEN_EACH SQL_TOKEN_REFERENCING SQL_TOKEN_BEGIN SQL_TOKEN_ATOMIC SQL_TOKEN_TRIGGER SQL_TOKEN_ROW SQL_TOKEN_STATEMENT
+%token <pParseNode> SQL_TOKEN_NEW SQL_TOKEN_OLD
+%token <pParseNode> SQL_TOKEN_VALUE SQL_TOKEN_CURRENT_CATALOG SQL_TOKEN_CURRENT_DEFAULT_TRANSFORM_GROUP SQL_TOKEN_CURRENT_PATH SQL_TOKEN_CURRENT_ROLE SQL_TOKEN_CURRENT_SCHEMA SQL_TOKEN_CURRENT_USER
+%token <pParseNode> SQL_TOKEN_SESSION_USER SQL_TOKEN_SYSTEM_USER SQL_TOKEN_VARCHAR SQL_TOKEN_VARBINARY SQL_TOKEN_VARYING SQL_TOKEN_OBJECT SQL_TOKEN_NCLOB SQL_TOKEN_NATIONAL
+%token <pParseNode> SQL_TOKEN_LARGE SQL_TOKEN_CLOB SQL_TOKEN_BLOB SQL_TOKEN_BIGINT SQL_TOKEN_BINARY SQL_TOKEN_WITHOUT SQL_TOKEN_BOOLEAN SQL_TOKEN_INTERVAL
/* operators */
%left SQL_TOKEN_NAME
%left <pParseNode> SQL_TOKEN_OR
@@ -242,10 +249,10 @@ using namespace connectivity;
%type <pParseNode> update_statement_searched target_commalist target opt_where_clause
%type <pParseNode> select_statement selection table_exp from_clause table_ref_commalist table_ref
%type <pParseNode> where_clause opt_group_by_clause column_ref_commalist opt_having_clause
-%type <pParseNode> search_condition predicate comparison_predicate between_predicate
-%type <pParseNode> like_predicate opt_escape test_for_null in_predicate
-%type <pParseNode> all_or_any_predicate any_all_some existence_test subquery
-%type <pParseNode> scalar_exp_commalist parameter_ref literal
+%type <pParseNode> search_condition predicate comparison_predicate comparison_predicate_part_2 between_predicate between_predicate_part_2
+%type <pParseNode> like_predicate opt_escape test_for_null null_predicate_part_2 in_predicate in_predicate_part_2 character_like_predicate_part_2 other_like_predicate_part_2
+%type <pParseNode> all_or_any_predicate any_all_some existence_test subquery quantified_comparison_predicate_part_2
+%type <pParseNode> scalar_exp_commalist parameter_ref literal parenthesized_boolean_value_expression
%type <pParseNode> column_ref data_type column cursor parameter range_variable user /*like_check*/
/* neue Regeln bei OJ */
%type <pParseNode> derived_column as_clause table_name num_primary term num_value_exp
@@ -257,8 +264,8 @@ using namespace connectivity;
%type <pParseNode> qualified_join value_exp query_term join_type outer_join_type join_condition boolean_term
%type <pParseNode> boolean_factor truth_value boolean_test boolean_primary named_columns_join join_spec
%type <pParseNode> cast_operand cast_target factor datetime_value_exp /*interval_value_exp*/ datetime_term datetime_factor
-%type <pParseNode> datetime_primary datetime_value_fct time_zone time_zone_specifier /*interval_term*/ /*interval_qualifier*/
-%type <pParseNode> /*start_field*/ non_second_datetime_field /*end_field*/ /*single_datetime_field*/ extract_field datetime_field time_zone_field
+%type <pParseNode> datetime_primary datetime_value_fct time_zone time_zone_specifier /*interval_term*/ interval_qualifier
+%type <pParseNode> start_field non_second_datetime_field end_field single_datetime_field extract_field datetime_field time_zone_field
%type <pParseNode> extract_source char_length_exp octet_length_exp bit_length_exp select_sublist string_value_exp
%type <pParseNode> char_value_exp concatenation char_factor char_primary string_value_fct char_substring_fct fold
%type <pParseNode> form_conversion char_translation trim_fct trim_operands trim_spec bit_value_fct bit_substring_fct op_column_commalist
@@ -270,6 +277,15 @@ using namespace connectivity;
%type <pParseNode> column_def odbc_fct_spec odbc_call_spec odbc_fct_type op_parameter union_statement
%type <pParseNode> op_odbc_call_parameter odbc_parameter_commalist odbc_parameter function_args_commalist function_arg
%type <pParseNode> catalog_name schema_name table_node numeric_function string_function function_name date_function table_primary_as_range_column opt_as
+%type <pParseNode> ordered_set_function inverse_distribution_function hypothetical_set_function hypothetical_set_function_value_expression_list rank_function_type within_group_specification inverse_distribution_function_type array_aggregate_function inverse_distribution_function_argument
+%type <pParseNode> case_expression else_clause result_expression result case_abbreviation case_specification searched_when_clause simple_when_clause searched_case simple_case
+%type <pParseNode> when_operand_list when_operand case_operand
+%type <pParseNode> trigger_definition trigger_name trigger_action_time trigger_event transition_table_or_variable_list triggered_action trigger_column_list triggered_when_clause triggered_SQL_statement SQL_procedure_statement old_transition_variable_name new_transition_variable_name
+%type <pParseNode> op_referencing op_trigger_columnlist op_triggered_action_for opt_row trigger_for SQL_procedure_statement_list transition_table_or_variable old_transition_table_name new_transition_table_name transition_table_name
+%type <pParseNode> searched_when_clause_list simple_when_clause_list predefined_type opt_char_set_spec opt_collate_clause character_string_type national_character_string_type
+%type <pParseNode> binary_string_type numeric_type boolean_type datetime_type interval_type opt_paren_precision paren_char_length opt_paren_char_large_length paren_character_large_object_length
+%type <pParseNode> large_object_length opt_multiplier character_large_object_type national_character_large_object_type binary_large_object_string_type opt_with_or_without_time_zone
+%type <pParseNode> approximate_numeric_type exact_numeric_type opt_paren_precision_scale
%%
/* Parse Tree an OSQLParser zurueckliefern
@@ -282,25 +298,20 @@ sql_single_statement:
| sql ';'
{ xxx_pGLOBAL_SQLPARSER->setParseTree( $1 ); }
;
-/*
-sql_list:
- sql_ ';'
- {$$ = SQL_NEW_LISTRULE;
- $$->append($1);
- pSqlParseTreeRoot = $1; -- obsolete - Ergebnis in yyval! rdm }
- | sql_list sql ';'
- {$1->append($2);
- $$ = $1;}
- ;
-*/
-
/* schema definition language */
/* Note: other ``sql:sal_Unicode() rules appear later in the grammar */
-/***
+
sql:
- schema
+ manipulative_statement
+ | schema_element
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ }
;
+
+/***
op_authorization:
{$$ = SQL_NEW_RULE;}
@@ -336,7 +347,7 @@ schema:
;
opt_schema_element_list:
- /* empty * / {$$ = SQL_NEW_RULE;}
+ {$$ = SQL_NEW_RULE;}
| schema_glement_list
;
@@ -349,17 +360,12 @@ schema_element_list:
$$ = $1;}
;
*/
-sql:
- schema_element
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- }
- ;
schema_element:
base_table_def
| view_def
| privilege_def
+ | trigger_definition
;
base_table_def:
@@ -676,9 +682,6 @@ sql_not:
/* manipulative statements */
-sql: manipulative_statement
- ;
-
manipulative_statement:
commit_statement
/* | delete_statement_positioned*/
@@ -953,6 +956,10 @@ opt_as:
/* empty */ {$$ = SQL_NEW_RULE;}
| SQL_TOKEN_AS
;
+opt_row:
+ /* empty */ {$$ = SQL_NEW_RULE;}
+ | SQL_TOKEN_ROW
+ ;
table_primary_as_range_column:
{$$ = SQL_NEW_RULE;}
| opt_as SQL_TOKEN_NAME op_column_commalist
@@ -1073,7 +1080,15 @@ boolean_primary:
YYERROR;
}
;
-
+parenthesized_boolean_value_expression:
+ '(' search_condition ')'
+ { // boolean_primary: rule 2
+ $$ = SQL_NEW_RULE;
+ $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($2);
+ $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
+ }
+ ;
boolean_test:
boolean_primary
| boolean_primary SQL_TOKEN_IS sql_not truth_value
@@ -1124,7 +1139,13 @@ predicate:
| in_predicate
| like_predicate
;
-
+comparison_predicate_part_2:
+ comparison row_value_constructor
+ {
+ $$ = SQL_NEW_RULE; // comparison_predicate: rule 1
+ $$->append($1);
+ $$->append($2);
+ }
comparison_predicate:
row_value_constructor comparison row_value_constructor
{
@@ -1165,17 +1186,8 @@ comparison:
| SQL_LESSEQ
| SQL_GREATEQ
;
-between_predicate:
- row_value_constructor sql_not SQL_TOKEN_BETWEEN row_value_constructor SQL_TOKEN_AND row_value_constructor
- {$$ = SQL_NEW_RULE; // between_predicate: rule 1
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);
- $$->append($6);
- }
- | sql_not SQL_TOKEN_BETWEEN row_value_constructor SQL_TOKEN_AND row_value_constructor
+between_predicate_part_2:
+ sql_not SQL_TOKEN_BETWEEN row_value_constructor SQL_TOKEN_AND row_value_constructor
{
if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck()) // between_predicate: rule 2
{
@@ -1186,7 +1198,13 @@ between_predicate:
{
OSQLParseNode* pTemp = $$;
$$ = pTemp->removeAt((sal_uInt32)0);
- $$->insert(1,$1);
+ OSQLParseNode* pColumnRef = $$->removeAt((sal_uInt32)0);
+ $$->insert(0,$1);
+ OSQLParseNode* pBetween_predicate = new OSQLInternalNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::between_predicate));
+ pBetween_predicate->append(pColumnRef);
+ pBetween_predicate->append($$);
+ $$ = pBetween_predicate;
+
delete pTemp;
delete $4;
}
@@ -1197,46 +1215,58 @@ between_predicate:
}
}
else
- YYERROR;
+ {
+ $$ = SQL_NEW_RULE; // between_predicate: rule 1
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ $$->append($5);
+ }
+ }
+between_predicate:
+ row_value_constructor between_predicate_part_2
+ {
+ $$ = SQL_NEW_RULE; // between_predicate: rule 1
+ $$->append($1);
+ $$->append($2);
}
+ | between_predicate_part_2
;
-
-like_predicate:
- row_value_constructor SQL_TOKEN_NOT SQL_TOKEN_LIKE string_value_exp opt_escape
+character_like_predicate_part_2:
+ sql_not SQL_TOKEN_LIKE string_value_exp opt_escape
{
$$ = SQL_NEW_RULE; // like_predicate: rule 1
$$->append($1);
$$->append($2);
$$->append($3);
$$->append($4);
- $$->append($5);
}
- | row_value_constructor SQL_TOKEN_LIKE string_value_exp opt_escape
+ ;
+other_like_predicate_part_2:
+ sql_not SQL_TOKEN_LIKE value_exp_primary opt_escape
{
- $$ = SQL_NEW_RULE; // like_predicate: rule 2
+ $$ = SQL_NEW_RULE; // like_predicate: rule 1
$$->append($1);
$$->append($2);
$$->append($3);
$$->append($4);
}
- | row_value_constructor SQL_TOKEN_NOT SQL_TOKEN_LIKE value_exp_primary opt_escape
+ ;
+like_predicate:
+ row_value_constructor character_like_predicate_part_2
{
- $$ = SQL_NEW_RULE; // like_predicate: rule 3
+ $$ = SQL_NEW_RULE; // like_predicate: rule 1
$$->append($1);
$$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);
}
- | row_value_constructor SQL_TOKEN_LIKE value_exp_primary opt_escape
+ | row_value_constructor other_like_predicate_part_2
{
- $$ = SQL_NEW_RULE; // like_predicate: rule 4
+ $$ = SQL_NEW_RULE; // like_predicate: rule 3
$$->append($1);
$$->append($2);
- $$->append($3);
- $$->append($4);
}
- | sql_not SQL_TOKEN_LIKE string_value_exp opt_escape
+ | character_like_predicate_part_2
{
if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck()) // like_predicate: rule 5
{
@@ -1246,19 +1276,19 @@ like_predicate:
$$ = SQL_NEW_RULE;
$$->append(pColumnRef);
$$->append($1);
- $$->append($2);
- if (xxx_pGLOBAL_SQLPARSER->buildLikeRule($$,$3,$4))
- $$->append($4);
- else
+ OSQLParseNode* p2nd = $1->removeAt(2);
+ OSQLParseNode* p3rd = $1->removeAt(2);
+ if ( !xxx_pGLOBAL_SQLPARSER->buildLikeRule($1,p2nd,p3rd) )
{
delete $$;
YYABORT;
}
+ $1->append(p3rd);
}
else
YYERROR;
}
- | sql_not SQL_TOKEN_LIKE value_exp_primary opt_escape
+ | other_like_predicate_part_2
{
if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck()) // like_predicate: rule 6
{
@@ -1268,14 +1298,14 @@ like_predicate:
$$ = SQL_NEW_RULE;
$$->append(pColumnRef);
$$->append($1);
- $$->append($2);
- if (xxx_pGLOBAL_SQLPARSER->buildLikeRule($$,$3,$4))
- $$->append($4);
- else
+ OSQLParseNode* p2nd = $1->removeAt(2);
+ OSQLParseNode* p3rd = $1->removeAt(2);
+ if ( !xxx_pGLOBAL_SQLPARSER->buildLikeRule($1,p2nd,p3rd) )
{
delete $$;
YYABORT;
}
+ $1->append(p3rd);
}
else
YYERROR;
@@ -1298,16 +1328,23 @@ opt_escape:
}
;
+null_predicate_part_2:
+ SQL_TOKEN_IS sql_not SQL_TOKEN_NULL
+ {
+ $$ = SQL_NEW_RULE; // test_for_null: rule 1
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ ;
test_for_null:
- row_value_constructor SQL_TOKEN_IS sql_not truth_value
+ row_value_constructor null_predicate_part_2
{
$$ = SQL_NEW_RULE; // test_for_null: rule 1
$$->append($1);
$$->append($2);
- $$->append($3);
- $$->append($4);
}
- | SQL_TOKEN_IS sql_not truth_value
+ | null_predicate_part_2
{
if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck())// test_for_null: rule 2
{
@@ -1317,8 +1354,6 @@ test_for_null:
$$ = SQL_NEW_RULE;
$$->append(pColumnRef);
$$->append($1);
- $$->append($2);
- $$->append($3);
}
else
YYERROR;
@@ -1336,16 +1371,23 @@ in_predicate_value:
$$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
}
;
+in_predicate_part_2:
+ sql_not SQL_TOKEN_IN in_predicate_value
+ {
+ $$ = SQL_NEW_RULE;// in_predicate: rule 1
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ ;
in_predicate:
- row_value_constructor sql_not SQL_TOKEN_IN in_predicate_value
+ row_value_constructor in_predicate_part_2
{
$$ = SQL_NEW_RULE;// in_predicate: rule 1
$$->append($1);
$$->append($2);
- $$->append($3);
- $$->append($4);
}
- | sql_not SQL_TOKEN_IN in_predicate_value
+ | in_predicate_part_2
{
if ( xxx_pGLOBAL_SQLPARSER->inPredicateCheck() )// in_predicate: rule 2
{
@@ -1355,24 +1397,28 @@ in_predicate:
$$ = SQL_NEW_RULE;
$$->append(pColumnRef);
$$->append($1);
- $$->append($2);
- $$->append($3);
- // hello
}
else
YYERROR;
}
;
+quantified_comparison_predicate_part_2:
+ comparison any_all_some subquery
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ ;
all_or_any_predicate:
- row_value_constructor comparison any_all_some subquery
+ row_value_constructor quantified_comparison_predicate_part_2
{
$$ = SQL_NEW_RULE;
$$->append($1);
$$->append($2);
- $$->append($3);
- $$->append($4);
}
- | comparison any_all_some subquery
+ | quantified_comparison_predicate_part_2
{
if(xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
{
@@ -1382,8 +1428,6 @@ all_or_any_predicate:
$$ = SQL_NEW_RULE;
$$->append(pColumnRef);
$$->append($1);
- $$->append($2);
- $$->append($3);
}
else
YYERROR;
@@ -1576,7 +1620,7 @@ char_length_exp:
$$->append($3);
$$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
}
- | SQL_TOKEN_CHARACTER_LENGTH '(' value_exp ')'
+ | SQL_TOKEN_SQL_TOKEN_INTNUM '(' value_exp ')'
{
$$ = SQL_NEW_RULE;
$$->append($1);
@@ -1682,10 +1726,19 @@ unsigned_value_spec:
;
general_value_spec:
parameter
- | SQL_TOKEN_USER
- | SQL_TOKEN_NULL
- | SQL_TOKEN_FALSE
- | SQL_TOKEN_TRUE
+ | SQL_TOKEN_USER
+ /* | SQL_TOKEN_NULL*/
+ | SQL_TOKEN_FALSE
+ | SQL_TOKEN_TRUE
+ | SQL_TOKEN_VALUE
+ | SQL_TOKEN_CURRENT_CATALOG
+ | SQL_TOKEN_CURRENT_DEFAULT_TRANSFORM_GROUP
+ | SQL_TOKEN_CURRENT_PATH
+ | SQL_TOKEN_CURRENT_ROLE
+ | SQL_TOKEN_CURRENT_SCHEMA
+ | SQL_TOKEN_CURRENT_USER
+ | SQL_TOKEN_SESSION_USER
+ | SQL_TOKEN_SYSTEM_USER
;
set_fct_spec:
general_set_fct
@@ -1962,7 +2015,7 @@ odbc_fct_type:
;
general_set_fct:
- set_fct_type '(' opt_all_distinct value_exp ')'
+ set_fct_type '(' opt_all_distinct function_arg ')'
{
$$ = SQL_NEW_RULE;
$$->append($1);
@@ -1979,7 +2032,7 @@ general_set_fct:
$$->append($3 = newNode("*", SQL_NODE_PUNCTUATION));
$$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
}
- | SQL_TOKEN_COUNT '(' opt_all_distinct value_exp ')'
+ | SQL_TOKEN_COUNT '(' opt_all_distinct function_arg ')'
{
$$ = SQL_NEW_RULE;
$$->append($1);
@@ -1988,6 +2041,8 @@ general_set_fct:
$$->append($4);
$$->append($5 = newNode(")", SQL_NODE_PUNCTUATION));
}
+ | ordered_set_function
+ | array_aggregate_function
;
set_fct_type:
SQL_TOKEN_AVG
@@ -2006,6 +2061,87 @@ set_fct_type:
| SQL_TOKEN_INTERSECTION
;
+ordered_set_function:
+ hypothetical_set_function
+ | inverse_distribution_function
+ ;
+hypothetical_set_function:
+ rank_function_type '(' hypothetical_set_function_value_expression_list ')' within_group_specification
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($3);
+ $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
+ $$->append($5);
+ }
+ | rank_function_type '(' hypothetical_set_function_value_expression_list SQL_TOKEN_BY value_exp_commalist ')' within_group_specification
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($3);
+ $$->append($4);
+ $$->append($5);
+ $$->append($6 = newNode(")", SQL_NODE_PUNCTUATION));
+ $$->append($7);
+ }
+ ;
+
+within_group_specification:
+ {
+ $$ = SQL_NEW_RULE;
+ }
+ | SQL_TOKEN_WITHIN SQL_TOKEN_GROUP '(' opt_order_by_clause ')'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($4);
+ $$->append($5 = newNode(")", SQL_NODE_PUNCTUATION));
+ }
+ ;
+hypothetical_set_function_value_expression_list:
+ value_exp_commalist
+ ;
+
+inverse_distribution_function:
+ inverse_distribution_function_type '('inverse_distribution_function_argument ')' within_group_specification
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($3);
+ $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
+ }
+ ;
+inverse_distribution_function_argument:
+ num_value_exp
+ ;
+inverse_distribution_function_type:
+ SQL_TOKEN_PERCENTILE_CONT
+ | SQL_TOKEN_PERCENTILE_DISC
+ ;
+
+array_aggregate_function:
+ SQL_TOKEN_ARRAY_AGG '(' value_exp opt_order_by_clause ')'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($3);
+ $$->append($4);
+ $$->append($5 = newNode(")", SQL_NODE_PUNCTUATION));
+ }
+ ;
+
+rank_function_type:
+ SQL_TOKEN_RANK
+ | SQL_TOKEN_DENSE_RANK
+ | SQL_TOKEN_PERCENT_RANK
+ | SQL_TOKEN_CUME_DIST
+ ;
outer_join_type:
SQL_TOKEN_LEFT %prec SQL_TOKEN_LEFT
{
@@ -2051,7 +2187,7 @@ join_type:
}
;
cross_union:
- table_ref /*[SQL_TOKEN_CROSS]*/ SQL_TOKEN_CROSS SQL_TOKEN_JOIN table_ref
+ table_ref SQL_TOKEN_CROSS SQL_TOKEN_JOIN table_ref
{
$$ = SQL_NEW_RULE;
$$->append($1);
@@ -2063,7 +2199,7 @@ cross_union:
qualified_join:
/* wenn SQL_TOKEN_NATURAL, dann keine join_spec */
- table_ref /*[SQL_TOKEN_NATURAL]*/ SQL_TOKEN_NATURAL join_type SQL_TOKEN_JOIN table_ref
+ table_ref SQL_TOKEN_NATURAL join_type SQL_TOKEN_JOIN table_ref
{
$$ = SQL_NEW_RULE;
$$->append($1);
@@ -2178,6 +2314,7 @@ value_exp_primary:
| column_ref
| set_fct_spec
| scalar_subquery
+ | case_expression
| '(' value_exp ')'
{
$$ = SQL_NEW_RULE;
@@ -2401,83 +2538,39 @@ non_second_datetime_field:
| SQL_TOKEN_HOUR
| SQL_TOKEN_MINUTE
;
-/*start_field:
- non_second_datetime_field
+start_field:
+ non_second_datetime_field opt_paren_precision
{
$$ = SQL_NEW_RULE;
$$->append($1);
- }
- | non_second_datetime_field '(' SQL_TOKEN_INTNUM ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
+ $$->append($2);
}
;
end_field:
non_second_datetime_field
+ | SQL_TOKEN_SECOND opt_paren_precision
{
$$ = SQL_NEW_RULE;
$$->append($1);
- }
- | SQL_TOKEN_SECOND
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- | SQL_TOKEN_SECOND '(' SQL_TOKEN_INTNUM ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
+ $$->append($2);
}
;
-*/
-/*
+
single_datetime_field:
- non_second_datetime_field
+ non_second_datetime_field opt_paren_precision
{
$$ = SQL_NEW_RULE;
$$->append($1);
+ $$->append($2);
}
- | non_second_datetime_field '(' SQL_TOKEN_INTNUM ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | SQL_TOKEN_SECOND
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- | SQL_TOKEN_SECOND '(' SQL_TOKEN_INTNUM ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | SQL_TOKEN_SECOND '(' SQL_TOKEN_INTNUM ',' SQL_TOKEN_INTNUM ')'
+ | SQL_TOKEN_SECOND opt_paren_precision_scale
{
$$ = SQL_NEW_RULE;
$$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(",", SQL_NODE_PUNCTUATION));
- $$->append($5);
- $$->append($6 = newNode(")", SQL_NODE_PUNCTUATION));
+ $$->append($2);
}
;
-*/
-/*
+
interval_qualifier:
start_field SQL_TOKEN_TO end_field
{
@@ -2486,13 +2579,9 @@ interval_qualifier:
$$->append($2);
$$->append($3);
}
- | single_datetime_field
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
+ | single_datetime_field
;
-*/
+
function_arg_commalist2:
function_arg ',' function_arg
{$$ = SQL_NEW_COMMALISTRULE;
@@ -2546,6 +2635,21 @@ function_arg:
$$->append($2);
$$->append($3);
}
+ | value_exp SQL_TOKEN_USING value_exp comparison value_exp
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ }
+ | value_exp SQL_TOKEN_BY value_exp_commalist
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
;
function_args_commalist:
function_arg
@@ -2952,59 +3056,384 @@ column_val:
}
;
data_type:
- SQL_TOKEN_CHARACTER
- | SQL_TOKEN_CHARACTER '(' SQL_TOKEN_INTNUM ')'
- {$$ = SQL_NEW_RULE;
+ predefined_type
+ ;
+opt_char_set_spec:
+ {$$ = SQL_NEW_RULE;}
+ | SQL_TOKEN_CHARACTER SQL_TOKEN_SET SQL_TOKEN_NAME
+ {
+ $$ = SQL_NEW_RULE;
$$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($2);
$$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));}
- | SQL_TOKEN_NUMERIC
- | SQL_TOKEN_NUMERIC '(' SQL_TOKEN_INTNUM ')'
- {$$ = SQL_NEW_RULE;
+ }
+ ;
+opt_collate_clause:
+ {$$ = SQL_NEW_RULE;}
+ | collate_clause
+ ;
+predefined_type:
+ character_string_type opt_char_set_spec opt_collate_clause
+ {
+ $$ = SQL_NEW_RULE;
$$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($2);
$$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));}
- | SQL_TOKEN_NUMERIC '(' SQL_TOKEN_INTNUM ',' SQL_TOKEN_INTNUM ')'
- {$$ = SQL_NEW_RULE;
+ }
+ | national_character_string_type opt_collate_clause
+ {
+ $$ = SQL_NEW_RULE;
$$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($2);
+ }
+ | binary_string_type
+ | numeric_type
+ | boolean_type
+ | datetime_type
+ | interval_type
+ ;
+character_string_type:
+ SQL_TOKEN_CHARACTER opt_paren_precision
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ | SQL_TOKEN_CHAR opt_paren_precision
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ | SQL_TOKEN_CHARACTER SQL_TOKEN_VARYING paren_char_length
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
$$->append($3);
- $$->append($4 = newNode(",", SQL_NODE_PUNCTUATION));
- $$->append($5);
- $$->append($6 = newNode(")", SQL_NODE_PUNCTUATION));}
- | SQL_TOKEN_DECIMAL
- | SQL_TOKEN_DECIMAL '(' SQL_TOKEN_INTNUM ')'
- {$$ = SQL_NEW_RULE;
+ }
+ | SQL_TOKEN_CHAR SQL_TOKEN_VARYING paren_char_length
+ {
+ $$ = SQL_NEW_RULE;
$$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($2);
$$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));}
- | SQL_TOKEN_DECIMAL '(' SQL_TOKEN_INTNUM ',' SQL_TOKEN_INTNUM ')'
- {$$ = SQL_NEW_RULE;
+ }
+ | SQL_TOKEN_VARCHAR paren_char_length
+ {
+ $$ = SQL_NEW_RULE;
$$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($2);
+ }
+ | character_large_object_type
+ ;
+opt_paren_precision:
+ {$$ = SQL_NEW_RULE;}
+ | paren_char_length
+ ;
+paren_char_length:
+ '(' SQL_TOKEN_INTNUM ')'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($2);
+ $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
+ }
+ ;
+opt_paren_char_large_length:
+ {$$ = SQL_NEW_RULE;}
+ | paren_character_large_object_length
+ ;
+paren_character_large_object_length:
+ '(' large_object_length ')'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($2);
+ $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
+ }
+ ;
+
+large_object_length:
+ SQL_TOKEN_INTNUM opt_multiplier
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ ;
+opt_multiplier:
+ {$$ = SQL_NEW_RULE;}
+ | 'K'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1 = newNode("K", SQL_NODE_PUNCTUATION));
+ }
+ | 'M'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1 = newNode("M", SQL_NODE_PUNCTUATION));
+ }
+ | 'G'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1 = newNode("G", SQL_NODE_PUNCTUATION));
+ }
+ | 'T'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1 = newNode("T", SQL_NODE_PUNCTUATION));
+ }
+ | 'P'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1 = newNode("P", SQL_NODE_PUNCTUATION));
+ }
+ ;
+character_large_object_type:
+ SQL_TOKEN_CHARACTER SQL_TOKEN_LARGE SQL_TOKEN_OBJECT opt_paren_char_large_length
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
$$->append($3);
- $$->append($4 = newNode(",", SQL_NODE_PUNCTUATION));
+ $$->append($4);
+ }
+ | SQL_TOKEN_CHAR SQL_TOKEN_LARGE SQL_TOKEN_OBJECT opt_paren_char_large_length
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ }
+ | SQL_TOKEN_CLOB opt_paren_char_large_length
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ ;
+national_character_string_type:
+ SQL_TOKEN_NATIONAL SQL_TOKEN_CHARACTER opt_paren_precision
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ | SQL_TOKEN_NATIONAL SQL_TOKEN_CHAR opt_paren_precision
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ | SQL_TOKEN_NCHAR opt_paren_precision
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ | SQL_TOKEN_NATIONAL SQL_TOKEN_CHARACTER SQL_TOKEN_VARYING paren_char_length
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ }
+ | SQL_TOKEN_NATIONAL SQL_TOKEN_CHAR SQL_TOKEN_VARYING paren_char_length
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ }
+ | SQL_TOKEN_NCHAR SQL_TOKEN_VARYING paren_char_length
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ | national_character_large_object_type
+ ;
+national_character_large_object_type:
+ SQL_TOKEN_NATIONAL SQL_TOKEN_CHARACTER SQL_TOKEN_LARGE SQL_TOKEN_OBJECT opt_paren_char_large_length
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
$$->append($5);
- $$->append($6 = newNode(")", SQL_NODE_PUNCTUATION));}
- | SQL_TOKEN_INTEGER
- | SQL_TOKEN_SMALLINT
- | SQL_TOKEN_FLOAT
- | SQL_TOKEN_FLOAT '(' SQL_TOKEN_INTNUM ')'
- {$$ = SQL_NEW_RULE;
+ }
+ | SQL_TOKEN_NCHAR SQL_TOKEN_LARGE SQL_TOKEN_OBJECT opt_paren_char_large_length
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ }
+ | SQL_TOKEN_NCLOB opt_paren_char_large_length
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ ;
+binary_string_type:
+ SQL_TOKEN_BINARY opt_paren_precision
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ | SQL_TOKEN_BINARY SQL_TOKEN_VARYING paren_char_length
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ | SQL_TOKEN_VARBINARY paren_char_length
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ | binary_large_object_string_type
+ ;
+binary_large_object_string_type:
+ SQL_TOKEN_BINARY SQL_TOKEN_LARGE SQL_TOKEN_OBJECT opt_paren_char_large_length
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ }
+ | SQL_TOKEN_BLOB opt_paren_char_large_length
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ ;
+numeric_type:
+ exact_numeric_type
+ | approximate_numeric_type
+ ;
+opt_paren_precision_scale:
+ {$$ = SQL_NEW_RULE;}
+ | '(' SQL_TOKEN_INTNUM ')'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($2);
+ $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
+ }
+ | '(' SQL_TOKEN_INTNUM ',' SQL_TOKEN_INTNUM ')'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($2);
+ $$->append($3 = newNode(",", SQL_NODE_PUNCTUATION));
+ $$->append($4);
+ $$->append($5 = newNode(")", SQL_NODE_PUNCTUATION));
+ }
+ ;
+exact_numeric_type:
+ SQL_TOKEN_NUMERIC opt_paren_precision_scale
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ | SQL_TOKEN_DECIMAL opt_paren_precision_scale
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ | SQL_TOKEN_DEC opt_paren_precision_scale
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ | SQL_TOKEN_SMALLINT
+ | SQL_TOKEN_INTEGER
+ | SQL_TOKEN_INT
+ | SQL_TOKEN_BIGINT
+ ;
+approximate_numeric_type:
+ SQL_TOKEN_FLOAT '(' SQL_TOKEN_INTNUM ')'
+ {
+ $$ = SQL_NEW_RULE;
$$->append($1);
$$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
$$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));}
- | SQL_TOKEN_REAL
- | SQL_TOKEN_DOUBLE SQL_TOKEN_PRECISION
- {$$ = SQL_NEW_RULE;
+ $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
+ }
+ | SQL_TOKEN_FLOAT
+ | SQL_TOKEN_REAL
+ | SQL_TOKEN_DOUBLE
+ | SQL_TOKEN_DOUBLE SQL_TOKEN_PRECISION
+ {
+ $$ = SQL_NEW_RULE;
$$->append($1);
- $$->append($2);}
+ $$->append($2);
+ }
+ ;
+boolean_type:
+ SQL_TOKEN_BOOLEAN
+;
+datetime_type:
+ SQL_TOKEN_DATE
+ | SQL_TOKEN_TIME opt_paren_precision opt_with_or_without_time_zone
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ | SQL_TOKEN_TIMESTAMP opt_paren_precision opt_with_or_without_time_zone
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ ;
+opt_with_or_without_time_zone:
+ {$$ = SQL_NEW_RULE;}
+ | SQL_TOKEN_WITH SQL_TOKEN_TIME SQL_TOKEN_ZONE
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ | SQL_TOKEN_WITHOUT SQL_TOKEN_TIME SQL_TOKEN_ZONE
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ ;
+interval_type:
+ SQL_TOKEN_INTERVAL interval_qualifier
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
;
-
/* the various things you can name */
column:
@@ -3028,7 +3457,141 @@ column:
$$ = newNode(xxx_pGLOBAL_SQLPARSER->TokenIDToStr(nNod), SQL_NODE_NAME);
}
;
-
+case_expression:
+ case_abbreviation
+ | case_specification
+ ;
+case_abbreviation:
+ SQL_TOKEN_NULLIF '(' value_exp_commalist ')'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($3);
+ $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
+ }
+ | SQL_TOKEN_COALESCE '(' value_exp ')'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($3);
+ $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
+ }
+ | SQL_TOKEN_COALESCE '(' value_exp_commalist ')'
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($3);
+ $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
+ }
+ ;
+case_specification:
+ simple_case
+ | searched_case
+ ;
+simple_case:
+ SQL_TOKEN_CASE case_operand simple_when_clause_list else_clause SQL_TOKEN_END
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ $$->append($5);
+ }
+ ;
+searched_case:
+ SQL_TOKEN_CASE searched_when_clause_list else_clause SQL_TOKEN_END
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ }
+ ;
+simple_when_clause_list:
+ simple_when_clause
+ {
+ $$ = SQL_NEW_LISTRULE;
+ $$->append($1);
+ }
+ | searched_when_clause_list simple_when_clause
+ {
+ $1->append($2);
+ $$ = $1;
+ }
+ ;
+simple_when_clause:
+ SQL_TOKEN_WHEN when_operand_list SQL_TOKEN_THEN result
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ }
+ ;
+when_operand_list:
+ when_operand
+ {$$ = SQL_NEW_COMMALISTRULE;
+ $$->append($1);}
+ | when_operand_list ',' when_operand
+ {$1->append($3);
+ $$ = $1;}
+ ;
+when_operand:
+ row_value_constructor_elem
+ | comparison_predicate_part_2
+ | between_predicate_part_2
+ | in_predicate_part_2
+ | character_like_predicate_part_2
+ | null_predicate_part_2
+;
+searched_when_clause_list:
+ searched_when_clause
+ {
+ $$ = SQL_NEW_LISTRULE;
+ $$->append($1);
+ }
+ | searched_when_clause_list searched_when_clause
+ {
+ $1->append($2);
+ $$ = $1;
+ }
+ ;
+searched_when_clause:
+ SQL_TOKEN_WHEN search_condition SQL_TOKEN_THEN result
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ }
+ ;
+else_clause:
+ {$$ = SQL_NEW_RULE;}
+ | SQL_TOKEN_ELSE result
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ ;
+result:
+ result_expression
+ | SQL_TOKEN_NULL
+ ;
+result_expression:
+ value_exp
+ ;
+case_operand:
+ row_value_constructor_elem
+ ;
+
cursor: SQL_TOKEN_NAME
{$$ = SQL_NEW_RULE;
$$->append($1);}
@@ -3093,6 +3656,195 @@ sql:
}
| '(' sql ')' /* checking predicats */
;
+trigger_definition:
+ SQL_TOKEN_CREATE SQL_TOKEN_TRIGGER trigger_name trigger_action_time trigger_event SQL_TOKEN_ON table_name op_referencing triggered_action
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ $$->append($5);
+ $$->append($6);
+ $$->append($7);
+ $$->append($8);
+ $$->append($9);
+ }
+ ;
+op_referencing:
+ {
+ $$ = SQL_NEW_RULE;
+ }
+ | SQL_TOKEN_REFERENCING transition_table_or_variable_list
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ ;
+trigger_action_time:
+ SQL_TOKEN_BEFORE
+ | SQL_TOKEN_AFTER
+ | SQL_TOKEN_INSTEAD SQL_TOKEN_OF
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+;
+trigger_event:
+ SQL_TOKEN_INSERT
+ | SQL_TOKEN_DELETE
+ | SQL_TOKEN_UPDATE op_trigger_columnlist
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ ;
+op_trigger_columnlist:
+ {
+ $$ = SQL_NEW_RULE;
+ }
+ | SQL_TOKEN_OF trigger_column_list
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ ;
+trigger_column_list:
+ column_commalist
+ ;
+triggered_action:
+ op_triggered_action_for triggered_when_clause triggered_SQL_statement
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ ;
+op_triggered_action_for:
+ {
+ $$ = SQL_NEW_RULE;
+ }
+ | SQL_TOKEN_FOR SQL_TOKEN_EACH trigger_for
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ }
+ ;
+trigger_for:
+ SQL_TOKEN_ROW
+ | SQL_TOKEN_STATEMENT
+ ;
+triggered_when_clause:
+ {
+ $$ = SQL_NEW_RULE;
+ }
+ | SQL_TOKEN_WHEN parenthesized_boolean_value_expression
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ ;
+triggered_SQL_statement:
+ SQL_procedure_statement
+ | SQL_TOKEN_BEGIN SQL_TOKEN_ATOMIC SQL_procedure_statement_list ';' SQL_TOKEN_END
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4 = newNode(";", SQL_NODE_PUNCTUATION));
+ $$->append($5);
+ }
+ ;
+SQL_procedure_statement_list:
+ SQL_procedure_statement
+ {
+ $$ = SQL_NEW_LISTRULE;
+ $$->append($1);
+ }
+ | SQL_procedure_statement_list ';' SQL_procedure_statement
+ {
+ $1->append($3);
+ $$ = $1;
+ }
+ ;
+SQL_procedure_statement:
+ sql
+ ;
+
+transition_table_or_variable_list:
+ transition_table_or_variable
+ {
+ $$ = SQL_NEW_LISTRULE;
+ $$->append($1);
+ }
+ | transition_table_or_variable_list transition_table_or_variable
+ {
+ $1->append($2);
+ $$ = $1;
+ }
+ ;
+
+transition_table_or_variable:
+ SQL_TOKEN_OLD opt_row opt_as old_transition_variable_name
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ }
+ | SQL_TOKEN_NEW opt_row opt_as new_transition_variable_name
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ }
+ | SQL_TOKEN_OLD SQL_TOKEN_TABLE opt_as old_transition_table_name
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ }
+ | SQL_TOKEN_NEW SQL_TOKEN_TABLE opt_as new_transition_table_name
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
+ }
+;
+old_transition_table_name:
+ transition_table_name
+;
+new_transition_table_name:
+ transition_table_name
+;
+transition_table_name:
+ SQL_TOKEN_NAME
+;
+old_transition_variable_name:
+ SQL_TOKEN_NAME
+;
+new_transition_variable_name:
+ SQL_TOKEN_NAME
+;
+trigger_name:
+ SQL_TOKEN_NAME
+;
%%
@@ -3507,7 +4259,7 @@ sal_Int16 OSQLParser::buildNode(OSQLParseNode*& pAppend,OSQLParseNode* pCompare,
pColumnRef->append(new OSQLInternalNode(m_sFieldName,SQL_NODE_NAME));
OSQLParseNode* pComp = NULL;
if ( SQL_ISTOKEN( pCompare, BETWEEN) && pLiteral2 )
- pComp = new OSQLInternalNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::between_predicate));
+ pComp = new OSQLInternalNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::between_predicate_part_2));
else
pComp = new OSQLInternalNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::comparison_predicate));
diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l
index 275bd5b34619..c6723dfd6869 100644
--- a/connectivity/source/parse/sqlflex.l
+++ b/connectivity/source/parse/sqlflex.l
@@ -86,15 +86,11 @@ OSQLScanner* xxx_pGLOBAL_SQLSCAN = NULL;
SQLyylval.pParseNode = new OSQLInternalNode(text, token);
#define SQL_NEW_KEYWORD(token) \
- SQLyylval.pParseNode = new OSQLInternalNode(aEmptyString, SQL_NODE_KEYWORD, (token));
+ SQLyylval.pParseNode = new OSQLInternalNode(aEmptyString, SQL_NODE_KEYWORD, (token)); return token;
-#define SQL_NEW_NAME SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_NAME)
-#define SQL_NEW_INTNUM SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_INTNUM)
-#define SQL_NEW_APPROXNUM SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_APPROXNUM)
-#define SQL_NEW_STRING SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_STRING)
-#define SQL_NEW_COMPARISON SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_COMPARISON)
-#define SQL_NEW_AMMSC SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_AMMSC)
-#define SQL_NEW_DATE SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_ACCESS_DATE)
+#define SQL_NEW_INTNUM SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_INTNUM); return SQL_TOKEN_INTNUM;
+#define SQL_NEW_APPROXNUM SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_APPROXNUM); return SQL_TOKEN_APPROXNUM;
+#define SQL_NEW_DATE SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_ACCESS_DATE); return SQL_TOKEN_ACCESS_DATE;
#define YY_INPUT(buf,result,max_size) \
{ \
@@ -122,231 +118,280 @@ OSQLScanner* xxx_pGLOBAL_SQLSCAN = NULL;
%option never-interactive
%%
-[Aa][Bb][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_ABS); return SQL_TOKEN_ABS; }
-[Aa][Cc][Oo][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_ACOS); return SQL_TOKEN_ACOS; }
-[Aa][Ll][Ll] {SQL_NEW_KEYWORD(SQL_TOKEN_ALL); return SQL_TOKEN_ALL; }
-[Aa][Ll][Tt][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_ALTER); return SQL_TOKEN_ALTER; }
-[Aa][Nn][Dd] {SQL_NEW_KEYWORD(SQL_TOKEN_AND); return SQL_TOKEN_AND; }
-[Aa][Nn][Yy] {SQL_NEW_KEYWORD(SQL_TOKEN_ANY); return SQL_TOKEN_ANY; }
-[Aa][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_AS); return SQL_TOKEN_AS; }
-[Aa][Ss][Cc] {SQL_NEW_KEYWORD(SQL_TOKEN_ASC); return SQL_TOKEN_ASC; }
-[Aa][Ss][Cc][Ii][Ii] {SQL_NEW_KEYWORD(SQL_TOKEN_ASCII); return SQL_TOKEN_ASCII; }
-[Aa][Ss][Ii][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_ASIN); return SQL_TOKEN_ASIN; }
-[Aa][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_AT); return SQL_TOKEN_AT; }
-[Aa][Tt][Aa][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_ATAN); return SQL_TOKEN_ATAN; }
-[Aa][Tt][Aa][Nn]2 {SQL_NEW_KEYWORD(SQL_TOKEN_ATAN2); return SQL_TOKEN_ATAN2; }
-[Aa][Uu][Tt][Hh][Oo][Rr][Ii][Zz][Aa][Tt][Ii][Oo][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_AUTHORIZATION); return SQL_TOKEN_AUTHORIZATION; }
-[Aa][Vv][Gg] {SQL_NEW_KEYWORD(SQL_TOKEN_AVG); return SQL_TOKEN_AVG; }
-
-[Bb][Ee][Tt][Ww][Ee][Ee][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_BETWEEN); return SQL_TOKEN_BETWEEN; }
-[Bb][Ii][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_BIT); return SQL_TOKEN_BIT; }
-[Bb][Ii][Tt]_[Ll][Ee][Nn][Gg][Tt][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_BIT_LENGTH); return SQL_TOKEN_BIT_LENGTH; }
-[Bb][Oo][Tt][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_BOTH); return SQL_TOKEN_BOTH; }
-[Bb][Yy] {SQL_NEW_KEYWORD(SQL_TOKEN_BY); return SQL_TOKEN_BY; }
-
-[Cc][Aa][Ll][Ll] {SQL_NEW_KEYWORD(SQL_TOKEN_CALL); return SQL_TOKEN_CALL; }
-[Cc][Aa][Ss][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_CAST); return SQL_TOKEN_CAST; }
-[Cc][Hh][Aa][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_CHAR); return SQL_TOKEN_CHAR; }
-[Cc][Hh][Aa][Rr][Aa][Cc][Tt][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_CHARACTER); return SQL_TOKEN_CHARACTER; }
-[Cc][Hh][Aa][Rr]([Aa][Cc][Tt][Ee][Rr])?_[Ll][Ee][Nn][Gg][Tt][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_CHAR_LENGTH); return SQL_TOKEN_CHAR_LENGTH; }
-[Cc][Hh][Ee][Cc][Kk] {SQL_NEW_KEYWORD(SQL_TOKEN_CHECK); return SQL_TOKEN_CHECK; }
-[Cc][Ee][Ii][Ll][Ii][Nn][Gg] {SQL_NEW_KEYWORD(SQL_TOKEN_CEILING); return SQL_TOKEN_CEILING; }
-[Cc][Oo][Ll][Ll][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_COLLATE); return SQL_TOKEN_COLLATE; }
-COLLECT {SQL_NEW_KEYWORD(SQL_TOKEN_COLLECT); return SQL_TOKEN_COLLECT; }
-[Cc][Oo][Mm][Mm][Ii][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_COMMIT); return SQL_TOKEN_COMMIT; }
-[Cc][Oo][Nn][Cc][Aa][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_CONCAT); return SQL_TOKEN_CONCAT; }
-[Cc][Oo][Nn][Tt][Ii][Nn][Uu][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_CONTINUE); return SQL_TOKEN_CONTINUE; }
-[Cc][Oo][Nn][Vv][Ee][Rr][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_CONVERT); return SQL_TOKEN_CONVERT; }
-[Cc][Oo][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_COS); return SQL_TOKEN_COS; }
-[Cc][Oo][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_COT); return SQL_TOKEN_COT; }
-[Cc][Oo][Uu][Nn][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_COUNT); return SQL_TOKEN_COUNT; }
-[Cc][Rr][Ee][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_CREATE); return SQL_TOKEN_CREATE; }
-[Cc][Rr][Oo][Ss][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_CROSS); return SQL_TOKEN_CROSS; }
-[Cc][Uu][Rr][Rr][Ee][Nn][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT); return SQL_TOKEN_CURRENT; }
-[Cc][Uu][Rr][Rr][Ee][Nn][Tt]_[Dd][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_DATE); return SQL_TOKEN_CURRENT_DATE; }
-[Cc][Uu][Rr][Dd][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_CURDATE); return SQL_TOKEN_CURDATE; }
-[Cc][Uu][Rr][Rr][Ee][Nn][Tt]_[Tt][Ii][Mm][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_TIME); return SQL_TOKEN_CURRENT_TIME; }
-[Cc][Uu][Rr][Tt][Ii][Mm][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_CURTIME); return SQL_TOKEN_CURTIME; }
-[Cc][Uu][Rr][Rr][Ee][Nn][Tt]_[Tt][Ii][Mm][Ee][Ss][Tt][Aa][Mm][Pp] {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_TIMESTAMP); return SQL_TOKEN_CURRENT_TIMESTAMP; }
-[Cc][Uu][Rr][Ss][Oo][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_CURSOR); return SQL_TOKEN_CURSOR; }
-
-[Dd] {SQL_NEW_KEYWORD(SQL_TOKEN_D); return SQL_TOKEN_D; }
-[Dd][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_DATE); return SQL_TOKEN_DATE; }
-[Dd][Aa][Tt][Ee][Dd][Ii][Ff][Ff] {SQL_NEW_KEYWORD(SQL_TOKEN_DATEDIFF); return SQL_TOKEN_DATEDIFF; }
-[Dd][Aa][Tt][Ee][Vv][Aa][Ll][Uu][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_DATEVALUE); return SQL_TOKEN_DATEVALUE; }
-[Dd][Aa][Yy] {SQL_NEW_KEYWORD(SQL_TOKEN_DAY); return SQL_TOKEN_DAY; }
-[Dd][Aa][Yy][Nn][Aa][Mm][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_DAYNAME); return SQL_TOKEN_DAYNAME; }
-[Dd][Aa][Yy][Oo][Ff][Mm][Oo][Nn][Tt][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFMONTH); return SQL_TOKEN_DAYOFMONTH; }
-[Dd][Aa][Yy][Oo][Ff][Ww][Ee][Ee][Kk] {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFWEEK); return SQL_TOKEN_DAYOFWEEK; }
-[Dd][Aa][Yy][Oo][Ff][Yy][Ee][Aa][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFYEAR); return SQL_TOKEN_DAYOFYEAR; }
-[Dd][Ee][Cc] {SQL_NEW_KEYWORD(SQL_TOKEN_DEC); return SQL_TOKEN_DEC; }
-[Dd][Ee][Cc][Ii][Mm][Aa][Ll] {SQL_NEW_KEYWORD(SQL_TOKEN_DECIMAL); return SQL_TOKEN_DECIMAL; }
-[Dd][Ee][Cc][Ll][Aa][Rr][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_DECLARE); return SQL_TOKEN_DECLARE; }
-[Dd][Ee][Ff][Aa][Uu][Ll][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_DEFAULT); return SQL_TOKEN_DEFAULT; }
-[Dd][Ee][Gg][Rr][Ee][Ee][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_DEGREES); return SQL_TOKEN_DEGREES; }
-[Dd][Ee][Ll][Ee][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_DELETE); return SQL_TOKEN_DELETE; }
-[Dd][Ee][Ss][Cc] {SQL_NEW_KEYWORD(SQL_TOKEN_DESC); return SQL_TOKEN_DESC; }
-[Dd][Ii][Ff][Ff][Ee][Rr][Ee][Nn][Cc][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_DIFFERENCE); return SQL_TOKEN_DIFFERENCE; }
-[Dd][Ii][Ss][Tt][Ii][Nn][Cc][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_DISTINCT); return SQL_TOKEN_DISTINCT; }
-[Dd][Oo][Uu][Bb][Ll][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_DOUBLE); return SQL_TOKEN_DOUBLE; }
-[Dd][Rr][Oo][Pp] {SQL_NEW_KEYWORD(SQL_TOKEN_DROP); return SQL_TOKEN_DROP; }
-
-EVERY {SQL_NEW_KEYWORD(SQL_TOKEN_EVERY); return SQL_TOKEN_EVERY; }
-[Ee][Ss][Cc][Aa][Pp][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_ESCAPE); return SQL_TOKEN_ESCAPE; }
-[Ee][Xx][Cc][Ee][Pp][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_EXCEPT); return SQL_TOKEN_EXCEPT; }
-[Ee][Xx][Ii][Ss][Tt][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_EXISTS); return SQL_TOKEN_EXISTS; }
-[Ee][Xx][Pp] {SQL_NEW_KEYWORD(SQL_TOKEN_EXP); return SQL_TOKEN_EXP; }
-[Ee][Xx][Tt][Rr][Aa][Cc][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_EXTRACT); return SQL_TOKEN_EXTRACT; }
-
-[Ff][Aa][Ll][Ss][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_FALSE); return SQL_TOKEN_FALSE; }
-[Ff][Ee][Tt][Cc][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_FETCH); return SQL_TOKEN_FETCH; }
-[Ff][Ll][Oo][Aa][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_FLOAT); return SQL_TOKEN_FLOAT; }
-[Ff][Ll][Oo][Oo][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_FLOOR); return SQL_TOKEN_FLOOR; }
-[Ff][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_FN); return SQL_TOKEN_FN; }
-[Ff][Oo][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_FOR); return SQL_TOKEN_FOR; }
-[Ff][Oo][Rr][Ee][Ii][Gg][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_FOREIGN); return SQL_TOKEN_FOREIGN; }
-[Ff][Oo][Uu][Nn][Dd] {SQL_NEW_KEYWORD(SQL_TOKEN_FOUND); return SQL_TOKEN_FOUND; }
-[Ff][Rr][Oo][Mm] {SQL_NEW_KEYWORD(SQL_TOKEN_FROM); return SQL_TOKEN_FROM; }
-[Ff][Uu][Ll][Ll] {SQL_NEW_KEYWORD(SQL_TOKEN_FULL); return SQL_TOKEN_FULL; }
-FUSION {SQL_NEW_KEYWORD(SQL_TOKEN_FUSION); return SQL_TOKEN_FUSION; }
-
-[Gg][Rr][Aa][Nn][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_GRANT); return SQL_TOKEN_GRANT; }
-[Gg][Rr][Oo][Uu][Pp] {SQL_NEW_KEYWORD(SQL_TOKEN_GROUP); return SQL_TOKEN_GROUP; }
-
-[Hh][Aa][Vv][Ii][Nn][Gg] {SQL_NEW_KEYWORD(SQL_TOKEN_HAVING); return SQL_TOKEN_HAVING; }
-[Hh][Oo][Uu][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_HOUR); return SQL_TOKEN_HOUR; }
-
-[Ii][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_IN); return SQL_TOKEN_IN; }
-[Ii][Nn][Nn][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_INNER); return SQL_TOKEN_INNER; }
-[Ii][Nn][Ss][Ee][Rr][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_INSERT); return SQL_TOKEN_INSERT; }
-[Ii][Nn][Tt]([Ee][Gg][Ee][Rr])? {SQL_NEW_KEYWORD(SQL_TOKEN_INTEGER); return SQL_TOKEN_INTEGER; }
-[Ii][Nn][Tt][Ee][Rr][Ss][Ee][Cc][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_INTERSECT); return SQL_TOKEN_INTERSECT; }
-INTERSECTION {SQL_NEW_KEYWORD(SQL_TOKEN_INTERSECTION); return SQL_TOKEN_INTERSECTION; }
-[Ii][Nn][Tt][Oo] {SQL_NEW_KEYWORD(SQL_TOKEN_INTO); return SQL_TOKEN_INTO; }
-[Ii][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_IS); return SQL_TOKEN_IS; }
-
-[Jj][Oo][Ii][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_JOIN); return SQL_TOKEN_JOIN; }
-
-[Kk][Ee][Yy] {SQL_NEW_KEYWORD(SQL_TOKEN_KEY); return SQL_TOKEN_KEY; }
-
-[Ll][Cc][Aa][Ss][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_LCASE); return SQL_TOKEN_LCASE; }
-[Ll][Ee][Aa][Dd][Ii][Nn][Gg] {SQL_NEW_KEYWORD(SQL_TOKEN_LEADING); return SQL_TOKEN_LEADING; }
-[Ll][Ee][Ff][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_LEFT); return SQL_TOKEN_LEFT; }
-[Ll][Ee][Nn][Gg][Tt][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_LENGTH); return SQL_TOKEN_LENGTH; }
-[Ll][Ii][Kk][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_LIKE); return SQL_TOKEN_LIKE; }
-[Ll][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_LN); return SQL_TOKEN_LN; }
-[Ll][Oo][Cc][Aa][Ll] {SQL_NEW_KEYWORD(SQL_TOKEN_LOCAL); return SQL_TOKEN_LOCAL; }
-[Ll][Oo][Cc][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_LOCATE); return SQL_TOKEN_LOCATE; }
-[Ll][Oo][Gg] {SQL_NEW_KEYWORD(SQL_TOKEN_LOG); return SQL_TOKEN_LOG; }
-[Ll][Oo][Gg][Ff] {SQL_NEW_KEYWORD(SQL_TOKEN_LOGF); return SQL_TOKEN_LOGF; }
-[Ll][Oo][Gg]10 {SQL_NEW_KEYWORD(SQL_TOKEN_LOG10); return SQL_TOKEN_LOG10; }
-[Ll][Oo][Ww][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_LOWER); return SQL_TOKEN_LOWER; }
-[Ll][Tt][Rr][Ii][Mm] {SQL_NEW_KEYWORD(SQL_TOKEN_LTRIM); return SQL_TOKEN_LTRIM; }
-
-[Mm][Aa][Xx] {SQL_NEW_KEYWORD(SQL_TOKEN_MAX); return SQL_TOKEN_MAX; }
-[Mm][Ii][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_MIN); return SQL_TOKEN_MIN; }
-[Mm][Ii][Nn][Uu][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_MINUTE); return SQL_TOKEN_MINUTE; }
-[Mm][Oo][Dd] {SQL_NEW_KEYWORD(SQL_TOKEN_MOD); return SQL_TOKEN_MOD; }
-[Mm][Oo][Nn][Tt][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_MONTH); return SQL_TOKEN_MONTH; }
-[Mm][Oo][Nn][Tt][Hh][Nn][Aa][Mm][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_MONTHNAME); return SQL_TOKEN_MONTHNAME; }
-
-[Nn][Aa][Tt][Uu][Rr][Aa][LL] {SQL_NEW_KEYWORD(SQL_TOKEN_NATURAL); return SQL_TOKEN_NATURAL; }
-[Nn][Cc][Hh][Aa][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_NCHAR); return SQL_TOKEN_NCHAR; }
-[Nn][Oo][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_NOT); return SQL_TOKEN_NOT; }
-[Nn][Oo][Ww] {SQL_NEW_KEYWORD(SQL_TOKEN_NOW); return SQL_TOKEN_NOW; }
-[Nn][Uu][Ll][Ll] {SQL_NEW_KEYWORD(SQL_TOKEN_NULL); return SQL_TOKEN_NULL; }
-[Nn][Uu][Mm][Ee][Rr][Ii][Cc] {SQL_NEW_KEYWORD(SQL_TOKEN_NUMERIC); return SQL_TOKEN_NUMERIC; }
-
-[Oo][Cc][Tt][Ee][Tt]_[Ll][Ee][Nn][Gg][Tt][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_OCTET_LENGTH); return SQL_TOKEN_OCTET_LENGTH; }
-[Oo][Ff] {SQL_NEW_KEYWORD(SQL_TOKEN_OF); return SQL_TOKEN_OF; }
-[Oo][Jj] {SQL_NEW_KEYWORD(SQL_TOKEN_OJ); return SQL_TOKEN_OJ; }
-[Oo][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_ON); return SQL_TOKEN_ON; }
-[Oo][Pp][Tt][Ii][Oo][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_OPTION); return SQL_TOKEN_OPTION; }
-[Oo][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_OR); return SQL_TOKEN_OR; }
-[Oo][Rr][Dd][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_ORDER); return SQL_TOKEN_ORDER; }
-[Oo][Uu][Tt][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_OUTER); return SQL_TOKEN_OUTER; }
-
-[Pp][Ii] {SQL_NEW_KEYWORD(SQL_TOKEN_PI); return SQL_TOKEN_PI; }
-[Pp][Oo][Ss][Ii][Tt][Ii][Oo][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_POSITION); return SQL_TOKEN_POSITION; }
-[Pp][Oo][Ww][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_POWER); return SQL_TOKEN_POWER; }
-[Pp][Rr][Ee][Cc][Ii][Ss][Ii][Oo][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_PRECISION); return SQL_TOKEN_PRECISION; }
-[Pp][Rr][Ii][Mm][Aa][Rr][Yy] {SQL_NEW_KEYWORD(SQL_TOKEN_PRIMARY); return SQL_TOKEN_PRIMARY; }
-[Pp][Rr][Ii][Vv][Ii][Ll][Ee][Gg][Ee][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_PRIVILEGES); return SQL_TOKEN_PRIVILEGES; }
-[Pp][Rr][Oo][Cc][Ee][Dd][Uu][Rr][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_PROCEDURE); return SQL_TOKEN_PROCEDURE; }
-[Pp][Uu][Bb][Ll][Ii][Cc] {SQL_NEW_KEYWORD(SQL_TOKEN_PUBLIC); return SQL_TOKEN_PUBLIC; }
-
-[Qq][Uu][Aa][Rr][Tt][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_QUARTER); return SQL_TOKEN_QUARTER; }
-
-[Rr][Aa][Dd][Ii][Aa][Nn][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_RADIANS); return SQL_TOKEN_RADIANS; }
-[Rr][Aa][Nn][Dd] {SQL_NEW_KEYWORD(SQL_TOKEN_RAND); return SQL_TOKEN_RAND; }
-[Rr][Ee][Aa][Ll] {SQL_NEW_KEYWORD(SQL_TOKEN_REAL); return SQL_TOKEN_REAL; }
-[Rr][Ee][Ff][Ee][Rr][Ee][Nn][Cc][Ee][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_REFERENCES); return SQL_TOKEN_REFERENCES; }
-[Rr][Ee][Pp][Ee][Aa][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_REPEAT); return SQL_TOKEN_REPEAT; }
-[Rr][Ee][Pp][Ll][Aa][Cc][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_REPLACE); return SQL_TOKEN_REPLACE; }
-[Rr][Oo][Ll][Ll][Bb][Aa][Cc][Kk] {SQL_NEW_KEYWORD(SQL_TOKEN_ROLLBACK); return SQL_TOKEN_ROLLBACK; }
-[Rr][Oo][Uu][Nn][Dd] {SQL_NEW_KEYWORD(SQL_TOKEN_ROUND); return SQL_TOKEN_ROUND; }
-[Rr][Oo][Uu][Nn][Dd][Mm][Aa][Gg][Ii][Cc] {SQL_NEW_KEYWORD(SQL_TOKEN_ROUNDMAGIC); return SQL_TOKEN_ROUNDMAGIC; }
-[Rr][Ii][Gg][Hh][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_RIGHT); return SQL_TOKEN_RIGHT; }
-[Rr][Tt][Rr][Ii][Mm] {SQL_NEW_KEYWORD(SQL_TOKEN_RTRIM); return SQL_TOKEN_RTRIM; }
-
-[Ss][Cc][Hh][Ee][Mm][Aa] {SQL_NEW_KEYWORD(SQL_TOKEN_SCHEMA); return SQL_TOKEN_SCHEMA; }
-[Ss][Ee][Cc][Oo][Nn][Dd] {SQL_NEW_KEYWORD(SQL_TOKEN_SECOND); return SQL_TOKEN_SECOND; }
-[Ss][Ee][Ll][Ee][Cc][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_SELECT); return SQL_TOKEN_SELECT; }
-[Ss][Ee][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_SET); return SQL_TOKEN_SET; }
-[Ss][Ii][Zz][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_SIZE); return SQL_TOKEN_SIZE; }
-[Ss][Ii][Gg][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_SIGN); return SQL_TOKEN_SIGN; }
-[Ss][Ii][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_SIN); return SQL_TOKEN_SIN; }
-[Ss][Mm][Aa][Ll][Ll][Ii][Nn][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_SMALLINT); return SQL_TOKEN_SMALLINT; }
-[Ss][Oo][Mm][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_SOME); return SQL_TOKEN_SOME; }
-[Ss][Oo][Uu][Nn][Dd][Ee][Xx] {SQL_NEW_KEYWORD(SQL_TOKEN_SOUNDEX); return SQL_TOKEN_SOUNDEX; }
-[Ss][Pp][Aa][Cc][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_SPACE); return SQL_TOKEN_SPACE; }
-[Ss][Qq][Rr][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_SQRT); return SQL_TOKEN_SQRT; }
-STDDEV_POP {SQL_NEW_KEYWORD(SQL_TOKEN_STDDEV_POP); return SQL_TOKEN_STDDEV_POP; }
-STDDEV_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_STDDEV_SAMP); return SQL_TOKEN_STDDEV_SAMP; }
-[Ss][Uu][Bb][Ss][Tt][Rr][Ii][Nn][Gg] {SQL_NEW_KEYWORD(SQL_TOKEN_SUBSTRING); return SQL_TOKEN_SUBSTRING; }
-[Ss][Uu][Mm] {SQL_NEW_KEYWORD(SQL_TOKEN_SUM); return SQL_TOKEN_SUM; }
-
-[Tt][Aa][Bb][Ll][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_TABLE); return SQL_TOKEN_TABLE; }
-[Tt][Aa][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_TAN); return SQL_TOKEN_TAN; }
-[Tt][Ii][Mm][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_TIME); return SQL_TOKEN_TIME; }
-[Tt][Ii][Mm][Ee][Ss][Tt][Aa][Mm][Pp] {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMP); return SQL_TOKEN_TIMESTAMP; }
-[Tt][Ii][Mm][Ee][Ss][Tt][Aa][Mm][Pp][Aa][Dd][Dd] {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMPADD); return SQL_TOKEN_TIMESTAMPADD; }
-[Tt][Ii][Mm][Ee][Ss][Tt][Aa][Mm][Pp][Dd][Ii][Ff][Ff] {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMPDIFF); return SQL_TOKEN_TIMESTAMPDIFF; }
-[Tt][Ii][Mm][Ee][Vv][Aa][Ll][Uu][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEVALUE); return SQL_TOKEN_TIMEVALUE; }
-[Tt][Ii][Mm][Ee][Zz][Oo][Nn][Ee]_[Hh][Oo][Uu][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEZONE_HOUR); return SQL_TOKEN_TIMEZONE_HOUR; }
-[Tt][Ii][Mm][Ee][Zz][Oo][Nn][Ee]_[Mm][Ii][Nn][Uu][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEZONE_MINUTE); return SQL_TOKEN_TIMEZONE_MINUTE; }
-[Tt][Oo] {SQL_NEW_KEYWORD(SQL_TOKEN_TO); return SQL_TOKEN_TO; }
-[Tt][Rr][Aa][Ii][Ll][Ii][Nn][Gg] {SQL_NEW_KEYWORD(SQL_TOKEN_TRAILING); return SQL_TOKEN_TRAILING; }
-[Tt][Rr][Aa][Nn][Ss][Ll][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_TRANSLATE); return SQL_TOKEN_TRANSLATE; }
-[Tt][Rr][Ii][Mm] {SQL_NEW_KEYWORD(SQL_TOKEN_TRIM); return SQL_TOKEN_TRIM; }
-[Tt][Rr][Uu][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_TRUE); return SQL_TOKEN_TRUE; }
-[Tt][Rr][Uu][Nn][Cc][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_TRUNCATE); return SQL_TOKEN_TRUNCATE; }
-[Tt][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_TS); return SQL_TOKEN_TS; }
-[Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_T); return SQL_TOKEN_T; }
-
-[Uu][Cc][Aa][Ss][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_UCASE); return SQL_TOKEN_UCASE; }
-[Uu][Nn][Ii][Oo][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_UNION); return SQL_TOKEN_UNION; }
-[Uu][Nn][Ii][Qq][Uu][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_UNIQUE); return SQL_TOKEN_UNIQUE; }
-[Uu][Nn][Kk][Nn][Oo][Ww][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_UNKNOWN); return SQL_TOKEN_UNKNOWN; }
-[Uu][Pp][Dd][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_UPDATE); return SQL_TOKEN_UPDATE; }
-[Uu][Pp][Pp][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_UPPER); return SQL_TOKEN_UPPER; }
-[Uu][Ss][Aa][Gg][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_USAGE); return SQL_TOKEN_USAGE; }
-[Uu][Ss][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_USER); return SQL_TOKEN_USER; }
-[Uu][Ss][Ii][Nn][Gg] {SQL_NEW_KEYWORD(SQL_TOKEN_USING); return SQL_TOKEN_USING; }
-
-VAR_POP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_POP); return SQL_TOKEN_VAR_POP; }
-VAR_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_SAMP); return SQL_TOKEN_VAR_SAMP; }
-[Vv][Aa][Ll][Uu][Ee][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_VALUES); return SQL_TOKEN_VALUES; }
-[Vv][Ii][Ee][Ww] {SQL_NEW_KEYWORD(SQL_TOKEN_VIEW); return SQL_TOKEN_VIEW; }
-
-[Ww][Ee][Ee][Kk] {SQL_NEW_KEYWORD(SQL_TOKEN_WEEK); return SQL_TOKEN_WEEK; }
-[Ww][Hh][Ee][Rr][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_WHERE); return SQL_TOKEN_WHERE; }
-[Ww][Ii][Tt][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_WITH); return SQL_TOKEN_WITH; }
-[Ww][Oo][Rr][Kk] {SQL_NEW_KEYWORD(SQL_TOKEN_WORK); return SQL_TOKEN_WORK; }
-
-[Yy][Ee][Aa][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_YEAR); return SQL_TOKEN_YEAR; }
-
-[Zz][Oo][Nn][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_ZONE); return SQL_TOKEN_ZONE; }
+ABS {SQL_NEW_KEYWORD(SQL_TOKEN_ABS); }
+ACOS {SQL_NEW_KEYWORD(SQL_TOKEN_ACOS); }
+AFTER {SQL_NEW_KEYWORD(SQL_TOKEN_AFTER); }
+ALL {SQL_NEW_KEYWORD(SQL_TOKEN_ALL); }
+ALTER {SQL_NEW_KEYWORD(SQL_TOKEN_ALTER); }
+AND {SQL_NEW_KEYWORD(SQL_TOKEN_AND); }
+ANY {SQL_NEW_KEYWORD(SQL_TOKEN_ANY); }
+ARRAY_AGG {SQL_NEW_KEYWORD(SQL_TOKEN_ARRAY_AGG); }
+AS {SQL_NEW_KEYWORD(SQL_TOKEN_AS); }
+ASC {SQL_NEW_KEYWORD(SQL_TOKEN_ASC); }
+ASCII {SQL_NEW_KEYWORD(SQL_TOKEN_ASCII); }
+ASIN {SQL_NEW_KEYWORD(SQL_TOKEN_ASIN); }
+AT {SQL_NEW_KEYWORD(SQL_TOKEN_AT); }
+ATAN {SQL_NEW_KEYWORD(SQL_TOKEN_ATAN); }
+ATAN2 {SQL_NEW_KEYWORD(SQL_TOKEN_ATAN2); }
+ATOMIC {SQL_NEW_KEYWORD(SQL_TOKEN_ATOMIC); }
+AUTHORIZATION {SQL_NEW_KEYWORD(SQL_TOKEN_AUTHORIZATION); }
+AVG {SQL_NEW_KEYWORD(SQL_TOKEN_AVG); }
+
+BEFORE {SQL_NEW_KEYWORD(SQL_TOKEN_BEFORE); }
+BEGIN {SQL_NEW_KEYWORD(SQL_TOKEN_BEGIN); }
+BETWEEN {SQL_NEW_KEYWORD(SQL_TOKEN_BETWEEN); }
+BIGINT {SQL_NEW_KEYWORD(SQL_TOKEN_BIGINT); }
+BINARY {SQL_NEW_KEYWORD(SQL_TOKEN_BINARY); }
+BIT {SQL_NEW_KEYWORD(SQL_TOKEN_BIT); }
+BIT_LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_BIT_LENGTH); }
+BLOB {SQL_NEW_KEYWORD(SQL_TOKEN_BLOB); }
+BOTH {SQL_NEW_KEYWORD(SQL_TOKEN_BOTH); }
+BY {SQL_NEW_KEYWORD(SQL_TOKEN_BY); }
+
+CALL {SQL_NEW_KEYWORD(SQL_TOKEN_CALL); }
+CASE {SQL_NEW_KEYWORD(SQL_TOKEN_CASE); }
+CAST {SQL_NEW_KEYWORD(SQL_TOKEN_CAST); }
+CEILING {SQL_NEW_KEYWORD(SQL_TOKEN_CEILING); }
+CHAR {SQL_NEW_KEYWORD(SQL_TOKEN_CHAR); }
+CHARACTER {SQL_NEW_KEYWORD(SQL_TOKEN_CHARACTER); }
+CHAR(ACTER)?_LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_CHAR_LENGTH); }
+CHECK {SQL_NEW_KEYWORD(SQL_TOKEN_CHECK); }
+CLOB {SQL_NEW_KEYWORD(SQL_TOKEN_CLOB); }
+COALESCE {SQL_NEW_KEYWORD(SQL_TOKEN_COALESCE); }
+COLLATE {SQL_NEW_KEYWORD(SQL_TOKEN_COLLATE); }
+COLLECT {SQL_NEW_KEYWORD(SQL_TOKEN_COLLECT); }
+COMMIT {SQL_NEW_KEYWORD(SQL_TOKEN_COMMIT); }
+CONCAT {SQL_NEW_KEYWORD(SQL_TOKEN_CONCAT); }
+CONTINUE {SQL_NEW_KEYWORD(SQL_TOKEN_CONTINUE); }
+CONVERT {SQL_NEW_KEYWORD(SQL_TOKEN_CONVERT); }
+COS {SQL_NEW_KEYWORD(SQL_TOKEN_COS); }
+COT {SQL_NEW_KEYWORD(SQL_TOKEN_COT); }
+COUNT {SQL_NEW_KEYWORD(SQL_TOKEN_COUNT); }
+CREATE {SQL_NEW_KEYWORD(SQL_TOKEN_CREATE); }
+CROSS {SQL_NEW_KEYWORD(SQL_TOKEN_CROSS); }
+CUME_RANK {SQL_NEW_KEYWORD(SQL_TOKEN_CUME_DIST); }
+CURRENT {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT); }
+CURRENT_DATE {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_DATE); }
+CURRENT_CATALOG {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_CATALOG); }
+CURRENT_DEFAULT_TRANSFORM_GROUP {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_DEFAULT_TRANSFORM_GROUP); }
+CURRENT_PATH {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_PATH); }
+CURRENT_ROLE {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_ROLE); }
+CURRENT_SCHEMA {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_SCHEMA); }
+CURRENT_USER {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_USER); }
+CURDATE {SQL_NEW_KEYWORD(SQL_TOKEN_CURDATE); }
+CURRENT_TIME {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_TIME); }
+CURTIME {SQL_NEW_KEYWORD(SQL_TOKEN_CURTIME); }
+CURRENT_TIMESTAMP {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_TIMESTAMP); }
+CURSOR {SQL_NEW_KEYWORD(SQL_TOKEN_CURSOR); }
+
+D {SQL_NEW_KEYWORD(SQL_TOKEN_D); }
+DATE {SQL_NEW_KEYWORD(SQL_TOKEN_DATE); }
+DATEDIFF {SQL_NEW_KEYWORD(SQL_TOKEN_DATEDIFF); }
+DATEVALUE {SQL_NEW_KEYWORD(SQL_TOKEN_DATEVALUE); }
+DAY {SQL_NEW_KEYWORD(SQL_TOKEN_DAY); }
+DAYNAME {SQL_NEW_KEYWORD(SQL_TOKEN_DAYNAME); }
+DAYOFMONTH {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFMONTH); }
+DAYOFWEEK {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFWEEK); }
+DAYOFYEAR {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFYEAR); }
+DEC {SQL_NEW_KEYWORD(SQL_TOKEN_DEC); }
+DECIMAL {SQL_NEW_KEYWORD(SQL_TOKEN_DECIMAL); }
+DECLARE {SQL_NEW_KEYWORD(SQL_TOKEN_DECLARE); }
+DEFAULT {SQL_NEW_KEYWORD(SQL_TOKEN_DEFAULT); }
+DEGREES {SQL_NEW_KEYWORD(SQL_TOKEN_DEGREES); }
+DELETE {SQL_NEW_KEYWORD(SQL_TOKEN_DELETE); }
+DENSE_RANK {SQL_NEW_KEYWORD(SQL_TOKEN_DENSE_RANK); }
+DESC {SQL_NEW_KEYWORD(SQL_TOKEN_DESC); }
+DIFFERENCE {SQL_NEW_KEYWORD(SQL_TOKEN_DIFFERENCE); }
+DISTINCT {SQL_NEW_KEYWORD(SQL_TOKEN_DISTINCT); }
+DOUBLE {SQL_NEW_KEYWORD(SQL_TOKEN_DOUBLE); }
+DROP {SQL_NEW_KEYWORD(SQL_TOKEN_DROP); }
+
+EACH {SQL_NEW_KEYWORD(SQL_TOKEN_EACH); }
+ELSE {SQL_NEW_KEYWORD(SQL_TOKEN_ELSE); }
+END {SQL_NEW_KEYWORD(SQL_TOKEN_END); }
+EVERY {SQL_NEW_KEYWORD(SQL_TOKEN_EVERY); }
+ESCAPE {SQL_NEW_KEYWORD(SQL_TOKEN_ESCAPE); }
+EXCEPT {SQL_NEW_KEYWORD(SQL_TOKEN_EXCEPT); }
+EXISTS {SQL_NEW_KEYWORD(SQL_TOKEN_EXISTS); }
+EXP {SQL_NEW_KEYWORD(SQL_TOKEN_EXP); }
+EXTRACT {SQL_NEW_KEYWORD(SQL_TOKEN_EXTRACT); }
+
+FALSE {SQL_NEW_KEYWORD(SQL_TOKEN_FALSE); }
+FETCH {SQL_NEW_KEYWORD(SQL_TOKEN_FETCH); }
+FLOAT {SQL_NEW_KEYWORD(SQL_TOKEN_FLOAT); }
+FLOOR {SQL_NEW_KEYWORD(SQL_TOKEN_FLOOR); }
+FN {SQL_NEW_KEYWORD(SQL_TOKEN_FN); }
+FOR {SQL_NEW_KEYWORD(SQL_TOKEN_FOR); }
+FOREIGN {SQL_NEW_KEYWORD(SQL_TOKEN_FOREIGN); }
+FOUND {SQL_NEW_KEYWORD(SQL_TOKEN_FOUND); }
+FROM {SQL_NEW_KEYWORD(SQL_TOKEN_FROM); }
+FULL {SQL_NEW_KEYWORD(SQL_TOKEN_FULL); }
+FUSION {SQL_NEW_KEYWORD(SQL_TOKEN_FUSION); }
+
+GRANT {SQL_NEW_KEYWORD(SQL_TOKEN_GRANT); }
+GROUP {SQL_NEW_KEYWORD(SQL_TOKEN_GROUP); }
+
+HAVING {SQL_NEW_KEYWORD(SQL_TOKEN_HAVING); }
+HOUR {SQL_NEW_KEYWORD(SQL_TOKEN_HOUR); }
+
+IN {SQL_NEW_KEYWORD(SQL_TOKEN_IN); }
+INNER {SQL_NEW_KEYWORD(SQL_TOKEN_INNER); }
+INSERT {SQL_NEW_KEYWORD(SQL_TOKEN_INSERT); }
+INSTEAD {SQL_NEW_KEYWORD(SQL_TOKEN_INSTEAD); }
+INT(EGER)? {SQL_NEW_KEYWORD(SQL_TOKEN_INTEGER); }
+INTERSECT {SQL_NEW_KEYWORD(SQL_TOKEN_INTERSECT); }
+INTERVAL {SQL_NEW_KEYWORD(SQL_TOKEN_INTERVAL); }
+INTERSECTION {SQL_NEW_KEYWORD(SQL_TOKEN_INTERSECTION); }
+INTO {SQL_NEW_KEYWORD(SQL_TOKEN_INTO); }
+IS {SQL_NEW_KEYWORD(SQL_TOKEN_IS); }
+
+JOIN {SQL_NEW_KEYWORD(SQL_TOKEN_JOIN); }
+
+KEY {SQL_NEW_KEYWORD(SQL_TOKEN_KEY); }
+
+LARGE {SQL_NEW_KEYWORD(SQL_TOKEN_LARGE); }
+LCASE {SQL_NEW_KEYWORD(SQL_TOKEN_LCASE); }
+LEADING {SQL_NEW_KEYWORD(SQL_TOKEN_LEADING); }
+LEFT {SQL_NEW_KEYWORD(SQL_TOKEN_LEFT); }
+LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_LENGTH); }
+LIKE {SQL_NEW_KEYWORD(SQL_TOKEN_LIKE); }
+LN {SQL_NEW_KEYWORD(SQL_TOKEN_LN); }
+LOCAL {SQL_NEW_KEYWORD(SQL_TOKEN_LOCAL); }
+LOCATE {SQL_NEW_KEYWORD(SQL_TOKEN_LOCATE); }
+LOG {SQL_NEW_KEYWORD(SQL_TOKEN_LOG); }
+LOGF {SQL_NEW_KEYWORD(SQL_TOKEN_LOGF); }
+LOG10 {SQL_NEW_KEYWORD(SQL_TOKEN_LOG10); }
+LOWER {SQL_NEW_KEYWORD(SQL_TOKEN_LOWER); }
+LTRIM {SQL_NEW_KEYWORD(SQL_TOKEN_LTRIM); }
+
+MAX {SQL_NEW_KEYWORD(SQL_TOKEN_MAX); }
+MIN {SQL_NEW_KEYWORD(SQL_TOKEN_MIN); }
+MINUTE {SQL_NEW_KEYWORD(SQL_TOKEN_MINUTE); }
+MOD {SQL_NEW_KEYWORD(SQL_TOKEN_MOD); }
+MONTH {SQL_NEW_KEYWORD(SQL_TOKEN_MONTH); }
+MONTHNAME {SQL_NEW_KEYWORD(SQL_TOKEN_MONTHNAME); }
+
+NATIONAL {SQL_NEW_KEYWORD(SQL_TOKEN_NATIONAL); }
+NATURAL {SQL_NEW_KEYWORD(SQL_TOKEN_NATURAL); }
+NCHAR {SQL_NEW_KEYWORD(SQL_TOKEN_NCHAR); }
+NCLOB {SQL_NEW_KEYWORD(SQL_TOKEN_NCLOB); }
+NEW {SQL_NEW_KEYWORD(SQL_TOKEN_NEW); }
+NOT {SQL_NEW_KEYWORD(SQL_TOKEN_NOT); }
+NOW {SQL_NEW_KEYWORD(SQL_TOKEN_NOW); }
+NULL {SQL_NEW_KEYWORD(SQL_TOKEN_NULL); }
+NULLIF {SQL_NEW_KEYWORD(SQL_TOKEN_NULLIF); }
+NUMERIC {SQL_NEW_KEYWORD(SQL_TOKEN_NUMERIC); }
+
+OBJECT {SQL_NEW_KEYWORD(SQL_TOKEN_OBJECT); }
+OCTET_LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_OCTET_LENGTH); }
+OF {SQL_NEW_KEYWORD(SQL_TOKEN_OF); }
+OJ {SQL_NEW_KEYWORD(SQL_TOKEN_OJ); }
+OLD {SQL_NEW_KEYWORD(SQL_TOKEN_OLD); }
+ON {SQL_NEW_KEYWORD(SQL_TOKEN_ON); }
+OPTION {SQL_NEW_KEYWORD(SQL_TOKEN_OPTION); }
+OR {SQL_NEW_KEYWORD(SQL_TOKEN_OR); }
+ORDER {SQL_NEW_KEYWORD(SQL_TOKEN_ORDER); }
+OUTER {SQL_NEW_KEYWORD(SQL_TOKEN_OUTER); }
+
+PERCENT_RANK {SQL_NEW_KEYWORD(SQL_TOKEN_PERCENT_RANK); }
+PERCENTILE_CONT {SQL_NEW_KEYWORD(SQL_TOKEN_PERCENTILE_CONT); }
+PERCENTILE_DISC {SQL_NEW_KEYWORD(SQL_TOKEN_PERCENTILE_DISC); }
+PI {SQL_NEW_KEYWORD(SQL_TOKEN_PI); }
+POSITION {SQL_NEW_KEYWORD(SQL_TOKEN_POSITION); }
+POWER {SQL_NEW_KEYWORD(SQL_TOKEN_POWER); }
+PRECISION {SQL_NEW_KEYWORD(SQL_TOKEN_PRECISION); }
+PRIMARY {SQL_NEW_KEYWORD(SQL_TOKEN_PRIMARY); }
+PRIVILEGES {SQL_NEW_KEYWORD(SQL_TOKEN_PRIVILEGES); }
+PROCEDURE {SQL_NEW_KEYWORD(SQL_TOKEN_PROCEDURE); }
+PUBLIC {SQL_NEW_KEYWORD(SQL_TOKEN_PUBLIC); }
+
+QUARTER {SQL_NEW_KEYWORD(SQL_TOKEN_QUARTER); }
+
+RADIANS {SQL_NEW_KEYWORD(SQL_TOKEN_RADIANS); }
+RAND {SQL_NEW_KEYWORD(SQL_TOKEN_RAND); }
+RANK {SQL_NEW_KEYWORD(SQL_TOKEN_RANK); }
+REAL {SQL_NEW_KEYWORD(SQL_TOKEN_REAL); }
+REFERENCES {SQL_NEW_KEYWORD(SQL_TOKEN_REFERENCES); }
+REFERENCING {SQL_NEW_KEYWORD(SQL_TOKEN_REFERENCING); }
+REPEAT {SQL_NEW_KEYWORD(SQL_TOKEN_REPEAT); }
+REPLACE {SQL_NEW_KEYWORD(SQL_TOKEN_REPLACE); }
+ROLLBACK {SQL_NEW_KEYWORD(SQL_TOKEN_ROLLBACK); }
+ROUND {SQL_NEW_KEYWORD(SQL_TOKEN_ROUND); }
+ROUNDMAGIC {SQL_NEW_KEYWORD(SQL_TOKEN_ROUNDMAGIC); }
+ROW {SQL_NEW_KEYWORD(SQL_TOKEN_ROW); }
+RIGHT {SQL_NEW_KEYWORD(SQL_TOKEN_RIGHT); }
+RTRIM {SQL_NEW_KEYWORD(SQL_TOKEN_RTRIM); }
+
+SCHEMA {SQL_NEW_KEYWORD(SQL_TOKEN_SCHEMA); }
+SECOND {SQL_NEW_KEYWORD(SQL_TOKEN_SECOND); }
+SELECT {SQL_NEW_KEYWORD(SQL_TOKEN_SELECT); }
+SET {SQL_NEW_KEYWORD(SQL_TOKEN_SET); }
+SIZE {SQL_NEW_KEYWORD(SQL_TOKEN_SIZE); }
+SIGN {SQL_NEW_KEYWORD(SQL_TOKEN_SIGN); }
+SIN {SQL_NEW_KEYWORD(SQL_TOKEN_SIN); }
+SMALLINT {SQL_NEW_KEYWORD(SQL_TOKEN_SMALLINT); }
+SOME {SQL_NEW_KEYWORD(SQL_TOKEN_SOME); }
+SOUNDEX {SQL_NEW_KEYWORD(SQL_TOKEN_SOUNDEX); }
+SPACE {SQL_NEW_KEYWORD(SQL_TOKEN_SPACE); }
+SQRT {SQL_NEW_KEYWORD(SQL_TOKEN_SQRT); }
+STDDEV_POP {SQL_NEW_KEYWORD(SQL_TOKEN_STDDEV_POP); }
+STDDEV_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_STDDEV_SAMP); }
+STATEMENT {SQL_NEW_KEYWORD(SQL_TOKEN_STATEMENT); }
+SUBSTRING {SQL_NEW_KEYWORD(SQL_TOKEN_SUBSTRING); }
+SUM {SQL_NEW_KEYWORD(SQL_TOKEN_SUM); }
+SESSION_USER {SQL_NEW_KEYWORD(SQL_TOKEN_SESSION_USER); }
+SYSTEM_USER {SQL_NEW_KEYWORD(SQL_TOKEN_SYSTEM_USER); }
+
+TABLE {SQL_NEW_KEYWORD(SQL_TOKEN_TABLE); }
+TAN {SQL_NEW_KEYWORD(SQL_TOKEN_TAN); }
+THEN {SQL_NEW_KEYWORD(SQL_TOKEN_THEN); }
+TIME {SQL_NEW_KEYWORD(SQL_TOKEN_TIME); }
+TIMESTAMP {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMP); }
+TIMESTAMPADD {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMPADD); }
+TIMESTAMPDIFF {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMPDIFF); }
+TIMEVALUE {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEVALUE); }
+TIMEZONE_HOUR {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEZONE_HOUR); }
+TIMEZONE_MINUTE {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEZONE_MINUTE); }
+TO {SQL_NEW_KEYWORD(SQL_TOKEN_TO); }
+TRAILING {SQL_NEW_KEYWORD(SQL_TOKEN_TRAILING); }
+TRANSLATE {SQL_NEW_KEYWORD(SQL_TOKEN_TRANSLATE); }
+TRIGGER {SQL_NEW_KEYWORD(SQL_TOKEN_TRIGGER); }
+TRIM {SQL_NEW_KEYWORD(SQL_TOKEN_TRIM); }
+TRUE {SQL_NEW_KEYWORD(SQL_TOKEN_TRUE); }
+TRUNCATE {SQL_NEW_KEYWORD(SQL_TOKEN_TRUNCATE); }
+TS {SQL_NEW_KEYWORD(SQL_TOKEN_TS); }
+T {SQL_NEW_KEYWORD(SQL_TOKEN_T); }
+
+UCASE {SQL_NEW_KEYWORD(SQL_TOKEN_UCASE); }
+UNION {SQL_NEW_KEYWORD(SQL_TOKEN_UNION); }
+UNIQUE {SQL_NEW_KEYWORD(SQL_TOKEN_UNIQUE); }
+UNKNOWN {SQL_NEW_KEYWORD(SQL_TOKEN_UNKNOWN); }
+UPDATE {SQL_NEW_KEYWORD(SQL_TOKEN_UPDATE); }
+UPPER {SQL_NEW_KEYWORD(SQL_TOKEN_UPPER); }
+USAGE {SQL_NEW_KEYWORD(SQL_TOKEN_USAGE); }
+USER {SQL_NEW_KEYWORD(SQL_TOKEN_USER); }
+USING {SQL_NEW_KEYWORD(SQL_TOKEN_USING); }
+
+VARBINARY {SQL_NEW_KEYWORD(SQL_TOKEN_VARBINARY); }
+VARCHAR {SQL_NEW_KEYWORD(SQL_TOKEN_VARCHAR); }
+VARYING {SQL_NEW_KEYWORD(SQL_TOKEN_VARYING); }
+VAR_POP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_POP); }
+VAR_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_SAMP); }
+VALUE {SQL_NEW_KEYWORD(SQL_TOKEN_VALUE); }
+VALUES {SQL_NEW_KEYWORD(SQL_TOKEN_VALUES); }
+VIEW {SQL_NEW_KEYWORD(SQL_TOKEN_VIEW); }
+
+WEEK {SQL_NEW_KEYWORD(SQL_TOKEN_WEEK); }
+WHEN {SQL_NEW_KEYWORD(SQL_TOKEN_WHEN); }
+WHERE {SQL_NEW_KEYWORD(SQL_TOKEN_WHERE); }
+WITH {SQL_NEW_KEYWORD(SQL_TOKEN_WITH); }
+WITHIN {SQL_NEW_KEYWORD(SQL_TOKEN_WITHIN); }
+WITHOUT {SQL_NEW_KEYWORD(SQL_TOKEN_WITHOUT); }
+WORK {SQL_NEW_KEYWORD(SQL_TOKEN_WORK); }
+
+YEAR {SQL_NEW_KEYWORD(SQL_TOKEN_YEAR); }
+
+ZONE {SQL_NEW_KEYWORD(SQL_TOKEN_ZONE); }
"<" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_LESS);return SQL_LESS;}
">" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_GREAT);return SQL_GREAT;}
@@ -365,31 +410,31 @@ VAR_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_S
<SQL>([0-9]+) |
<SQL>([0-9]+"."[0-9]*) |
-<SQL>("."[0-9]*) {SQL_NEW_INTNUM; return SQL_TOKEN_INTNUM;}
+<SQL>("."[0-9]*) {SQL_NEW_INTNUM; }
<SQL>[0-9]+[eE][+-]?[0-9]+ |
<SQL>[0-9]+"."[0-9]*[eE][+-]?[0-9]+ |
-<SQL>"."[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; return SQL_TOKEN_APPROXNUM; }
+<SQL>"."[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; }
<PREDICATE_GER,PREDICATE_ENG,DATE>[A-Za-z\200-\277\300-\337\340-\357\360-\367\370-\373\374-\375][A-Za-z0-9_%.,*?\200-\277\300-\337\340-\357\360-\367\370-\373\374-\375]* {return gatherNamePre(SQLyytext);}
-<PREDICATE_GER,PREDICATE_ENG>([0-9]+) {SQL_NEW_INTNUM; return SQL_TOKEN_INTNUM;}
-<PREDICATE_ENG>([0-9]{1,3}(","[0-9]{3})+) {SQL_NEW_INTNUM; return SQL_TOKEN_INTNUM;}
-<PREDICATE_GER>([0-9]{1,3}("."[0-9]{3})+) {SQL_NEW_INTNUM; return SQL_TOKEN_INTNUM;}
+<PREDICATE_GER,PREDICATE_ENG>([0-9]+) {SQL_NEW_INTNUM; }
+<PREDICATE_ENG>([0-9]{1,3}(","[0-9]{3})+) {SQL_NEW_INTNUM; }
+<PREDICATE_GER>([0-9]{1,3}("."[0-9]{3})+) {SQL_NEW_INTNUM; }
<PREDICATE_ENG>([0-9]+"."[0-9]+) |
<PREDICATE_ENG>([0-9]{1,3}(","[0-9]{3})+"."[0-9]+) |
-<PREDICATE_ENG>("."[0-9]+) {SQL_NEW_APPROXNUM; return SQL_TOKEN_APPROXNUM; }
+<PREDICATE_ENG>("."[0-9]+) {SQL_NEW_APPROXNUM; }
<PREDICATE_ENG>[0-9]+[eE][+-]?[0-9]+ |
<PREDICATE_ENG>[0-9]+"."[0-9]*[eE][+-]?[0-9]+ |
-<PREDICATE_ENG>"."[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; return SQL_TOKEN_APPROXNUM; }
+<PREDICATE_ENG>"."[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; }
<PREDICATE_GER>([0-9]+","[0-9]+) |
<PREDICATE_GER>([0-9]{1,3}("."[0-9]{3})+","[0-9]+) |
-<PREDICATE_GER>(","[0-9]+) {SQL_NEW_APPROXNUM; return SQL_TOKEN_APPROXNUM; }
+<PREDICATE_GER>(","[0-9]+) {SQL_NEW_APPROXNUM; }
<PREDICATE_GER>[0-9]+[eE][+-]?[0-9]+ |
<PREDICATE_GER>[0-9]+","[0-9]*[eE][+-]?[0-9]+ |
-<PREDICATE_GER>","[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; return SQL_TOKEN_APPROXNUM; }
+<PREDICATE_GER>","[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; }
<PREDICATE_GER,PREDICATE_ENG>[0-9.,][A-Za-z0-9_.,%]* {return gatherNamePre(SQLyytext);}
@@ -403,7 +448,7 @@ VAR_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_S
<PREDICATE_GER,PREDICATE_ENG,DATE># { return gatherString('#' ,2); }
<DATE>[0-9]{1,4}[^ ]*[0-9] |
-<DATE>[0-9]{1,4}[^ ]*[0-9][ ][0-9]{1,4}[^ ]*[0-9] { SQL_NEW_DATE; return SQL_TOKEN_ACCESS_DATE;}
+<DATE>[0-9]{1,4}[^ ]*[0-9][ ][0-9]{1,4}[^ ]*[0-9] { SQL_NEW_DATE; }
<STRING>["-""+""*""/"":""("")"",""."";""?""{""}"] { return SQLyytext[0]; } /* */
<STRING>"[" { return gatherString(']' ,0); }
@@ -464,7 +509,7 @@ sal_Int32 gatherString( sal_Int32 delim, sal_Int32 nTyp)
{
case 0:
SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_NAME);
- return SQL_TOKEN_NAME;
+ return SQL_TOKEN_NAME;
case 1:
SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_STRING);
return SQL_TOKEN_STRING;
@@ -487,7 +532,7 @@ sal_Int32 gatherString( sal_Int32 delim, sal_Int32 nTyp)
}
}
YY_FATAL_ERROR("Unterminated name string");
- return SQL_TOKEN_INVALIDSYMBOL;
+ return SQL_TOKEN_INVALIDSYMBOL;
}
sal_Int32 mapEnumToToken(IParseContext::InternationalKeyCode _eKeyCode )
@@ -562,10 +607,10 @@ sal_Int32 gatherName(const sal_Char* text)
case IParseContext::KEY_INTERSECTION:
nToken = mapEnumToToken(eKeyCode);
SQL_NEW_KEYWORD(nToken);
- return nToken;
+ break;
default:
SQL_NEW_NODE(::rtl::OUString(text,strlen(text),RTL_TEXTENCODING_UTF8), SQL_NODE_NAME);
- return SQL_TOKEN_NAME;
+ return SQL_TOKEN_NAME;
}
}
/**
diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx
index feecc26a4052..e1d805e9a1e5 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -50,6 +50,10 @@
#include "diagnose_ex.h"
#include <rtl/logfile.hxx>
+#define SQL_ISRULEOR2(pParseNode, e1,e2) ((pParseNode)->isRule() && (\
+ (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e1) || \
+ (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e2)))
+
using namespace ::comphelper;
using namespace ::connectivity;
using namespace ::connectivity::sdbcx;
@@ -67,6 +71,7 @@ namespace connectivity
{
struct OSQLParseTreeIteratorImpl
{
+ ::std::vector< TNodePair > m_aJoinConditions;
Reference< XConnection > m_xConnection;
Reference< XDatabaseMetaData > m_xDatabaseMetaData;
Reference< XNameAccess > m_xTableContainer;
@@ -476,7 +481,42 @@ void OSQLParseTreeIterator::traverseOneTableName( OSQLTables& _rTables,const OSQ
if ( aTable.is() )
_rTables[ aTableRange ] = aTable;
}
-
+//-----------------------------------------------------------------------------
+void OSQLParseTreeIterator::impl_fillJoinConditions(const OSQLParseNode* i_pJoinCondition)
+{
+ if (i_pJoinCondition->count() == 3 && // Ausdruck is geklammert
+ SQL_ISPUNCTUATION(i_pJoinCondition->getChild(0),"(") &&
+ SQL_ISPUNCTUATION(i_pJoinCondition->getChild(2),")"))
+ {
+ impl_fillJoinConditions(i_pJoinCondition->getChild(1));
+ }
+ else if (SQL_ISRULEOR2(i_pJoinCondition,search_condition,boolean_term) && // AND/OR-Verknuepfung:
+ i_pJoinCondition->count() == 3)
+ {
+ // nur AND Verknüpfung zulassen
+ if ( SQL_ISTOKEN(i_pJoinCondition->getChild(1),AND) )
+ {
+ impl_fillJoinConditions(i_pJoinCondition->getChild(0));
+ impl_fillJoinConditions(i_pJoinCondition->getChild(1));
+ }
+ }
+ else if (SQL_ISRULE(i_pJoinCondition,comparison_predicate))
+ {
+ // only the comparison of columns is allowed
+ OSL_ENSURE(i_pJoinCondition->count() == 3,"OQueryDesignView::InsertJoinConnection: Fehler im Parse Tree");
+ if (SQL_ISRULE(i_pJoinCondition->getChild(0),column_ref) &&
+ SQL_ISRULE(i_pJoinCondition->getChild(2),column_ref) &&
+ i_pJoinCondition->getChild(1)->getNodeType() == SQL_NODE_EQUAL)
+ {
+ m_pImpl->m_aJoinConditions.push_back( TNodePair(i_pJoinCondition->getChild(0),i_pJoinCondition->getChild(2)) );
+ }
+ }
+}
+//-----------------------------------------------------------------------------
+::std::vector< TNodePair >& OSQLParseTreeIterator::getJoinConditions() const
+{
+ return m_pImpl->m_aJoinConditions;
+}
//-----------------------------------------------------------------------------
void OSQLParseTreeIterator::getQualified_join( OSQLTables& _rTables, const OSQLParseNode *pTableRef, ::rtl::OUString& aTableRange )
{
@@ -491,8 +531,30 @@ void OSQLParseTreeIterator::getQualified_join( OSQLTables& _rTables, const OSQLP
traverseOneTableName( _rTables, pNode, aTableRange );
sal_uInt32 nPos = 4;
- if(SQL_ISRULE(pTableRef,cross_union) || pTableRef->getChild(1)->getTokenID() != SQL_TOKEN_NATURAL)
+ if( SQL_ISRULE(pTableRef,cross_union) || pTableRef->getChild(1)->getTokenID() != SQL_TOKEN_NATURAL)
+ {
nPos = 3;
+ // join_condition,named_columns_join
+ if ( SQL_ISRULE( pTableRef, qualified_join ) )
+ {
+ const OSQLParseNode* pJoin_spec = pTableRef->getChild(4);
+ if ( SQL_ISRULE( pJoin_spec, join_condition ) )
+ {
+ impl_fillJoinConditions(pJoin_spec->getChild(1));
+ }
+ else
+ {
+ const OSQLParseNode* pColumnCommalist = pJoin_spec->getChild(2);
+ // Alle Columns in der column_commalist ...
+ for (sal_uInt32 i = 0; i < pColumnCommalist->count(); i++)
+ {
+ const OSQLParseNode * pCol = pColumnCommalist->getChild(i);
+ // add twice because the column must exists in both tables
+ m_pImpl->m_aJoinConditions.push_back( TNodePair(pCol,pCol) );
+ }
+ }
+ }
+ }
pNode = getTableNode(_rTables,pTableRef->getChild(nPos),aTableRange);
if ( isTableNode( pNode ) )
@@ -826,17 +888,17 @@ void OSQLParseTreeIterator::traverseCreateColumns(const OSQLParseNode* pSelectNo
aColumnName = pColumnRef->getChild(0)->getTokenValue();
OSQLParseNode *pDatatype = pColumnRef->getChild(1);
- if (pDatatype && SQL_ISRULE(pDatatype,data_type))
+ if (pDatatype && SQL_ISRULE(pDatatype,character_string_type))
{
- //data type
- // 0 | 1| 2 |3
- //char ( 20 )
- aTypeName = pDatatype->getChild(0)->getTokenValue();
- if (pDatatype->count() == 4
- && SQL_ISPUNCTUATION(pDatatype->getChild(1), "(")
- && SQL_ISPUNCTUATION(pDatatype->getChild(3) , ")") )
+ const OSQLParseNode *pType = pDatatype->getChild(0);
+ aTypeName = pType->getTokenValue();
+ if (pDatatype->count() == 2 && (pType->getTokenID() == SQL_TOKEN_CHAR || pType->getTokenID() == SQL_TOKEN_CHARACTER ))
+ nType = DataType::CHAR;
+
+ const OSQLParseNode *pParams = pDatatype->getChild(pDatatype->count()-1);
+ if ( pParams->count() )
{
- nLen = pDatatype->getChild(2)->getTokenValue().toInt32();
+ nLen = pParams->getChild(1)->getTokenValue().toInt32();
}
}
else if(pDatatype && pDatatype->getNodeType() == SQL_NODE_KEYWORD)
@@ -846,8 +908,8 @@ void OSQLParseTreeIterator::traverseCreateColumns(const OSQLParseNode* pSelectNo
if (aTypeName.getLength())
{
- //TO DO:Create a new class for create statement to handle field length
- OParseColumn* pColumn = new OParseColumn(aColumnName,aTypeName,::rtl::OUString(),
+ //TODO:Create a new class for create statement to handle field length
+ OParseColumn* pColumn = new OParseColumn(aColumnName,aTypeName,::rtl::OUString(),::rtl::OUString(),
ColumnValue::NULLABLE_UNKNOWN,0,0,nType,sal_False,sal_False,isCaseSensitive());
pColumn->setFunction(sal_False);
pColumn->setRealName(aColumnName);
@@ -1115,17 +1177,17 @@ void OSQLParseTreeIterator::traverseParameters(const OSQLParseNode* _pNode)
else
pOther->parseNodeToStr( sColumnName, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
} // if ( SQL_ISRULE(pParent,comparison_predicate) ) // x = X
- else if ( SQL_ISRULE(pParent,like_predicate) )
+ else if ( SQL_ISRULE(pParent,other_like_predicate_part_2) )
{
- const OSQLParseNode* pOther = pParent->getChild(0);
+ const OSQLParseNode* pOther = pParent->getParent()->getChild(0);
if ( SQL_ISRULE( pOther, column_ref ) )
getColumnRange( pOther, sColumnName, sTableRange, aColumnAlias);
else
pOther->parseNodeToStr( sColumnName, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
}
- else if ( SQL_ISRULE(pParent,between_predicate) )
+ else if ( SQL_ISRULE(pParent,between_predicate_part_2) )
{
- const OSQLParseNode* pOther = pParent->getChild(0);
+ const OSQLParseNode* pOther = pParent->getParent()->getChild(0);
if ( SQL_ISRULE( pOther, column_ref ) )
getColumnRange( pOther, sColumnName, sTableRange, aColumnAlias);
else
@@ -1304,17 +1366,19 @@ void OSQLParseTreeIterator::traverseANDCriteria(OSQLParseNode * pSearchCondition
::rtl::OUString aValue;
pSearchCondition->getChild(2)->parseNodeToStr( aValue, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
traverseOnePredicate(pSearchCondition->getChild(0),aValue,pSearchCondition->getChild(2));
+ impl_fillJoinConditions(pSearchCondition);
// if (! aIteratorStatus.IsSuccessful())
// return;
}
else if (SQL_ISRULE(pSearchCondition,like_predicate) /*&& SQL_ISRULE(pSearchCondition->getChild(0),column_ref)*/)
{
- OSL_ENSURE(pSearchCondition->count() >= 4,"OSQLParseTreeIterator: error in parse tree!");
+ OSL_ENSURE(pSearchCondition->count() == 2,"OSQLParseTreeIterator: error in parse tree!");
+ const OSQLParseNode* pPart2 = pSearchCondition->getChild(1);
- sal_Int32 nCurentPos = pSearchCondition->count()-2;
+ sal_Int32 nCurentPos = pPart2->count()-2;
- OSQLParseNode * pNum_value_exp = pSearchCondition->getChild(nCurentPos);
- OSQLParseNode * pOptEscape = pSearchCondition->getChild(nCurentPos+1);
+ OSQLParseNode * pNum_value_exp = pPart2->getChild(nCurentPos);
+ OSQLParseNode * pOptEscape = pPart2->getChild(nCurentPos+1);
OSL_ENSURE(pNum_value_exp != NULL,"OSQLParseTreeIterator: error in parse tree!");
OSL_ENSURE(pOptEscape != NULL,"OSQLParseTreeIterator: error in parse tree!");
@@ -1344,12 +1408,13 @@ void OSQLParseTreeIterator::traverseANDCriteria(OSQLParseNode * pSearchCondition
}
else if (SQL_ISRULE(pSearchCondition,in_predicate))
{
- OSL_ENSURE(pSearchCondition->count() == 4,"OSQLParseTreeIterator: error in parse tree!");
+ OSL_ENSURE(pSearchCondition->count() == 2,"OSQLParseTreeIterator: error in parse tree!");
+ const OSQLParseNode* pPart2 = pSearchCondition->getChild(1);
traverseORCriteria(pSearchCondition->getChild(0));
// if (! aIteratorStatus.IsSuccessful()) return;
- OSQLParseNode* pChild = pSearchCondition->getChild(3);
+ OSQLParseNode* pChild = pPart2->getChild(2);
if ( SQL_ISRULE(pChild->getChild(0),subquery) )
{
traverseTableNames( *m_pImpl->m_pSubTables );
@@ -1367,8 +1432,10 @@ void OSQLParseTreeIterator::traverseANDCriteria(OSQLParseNode * pSearchCondition
}
else if (SQL_ISRULE(pSearchCondition,test_for_null) /*&& SQL_ISRULE(pSearchCondition->getChild(0),column_ref)*/)
{
- OSL_ENSURE(pSearchCondition->count() >= 3,"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(SQL_ISTOKEN(pSearchCondition->getChild(1),IS),"OSQLParseTreeIterator: error in parse tree!");
+ OSL_ENSURE(pSearchCondition->count() == 2,"OSQLParseTreeIterator: error in parse tree!");
+ const OSQLParseNode* pPart2 = pSearchCondition->getChild(1);
+ (void)pPart2;
+ OSL_ENSURE(SQL_ISTOKEN(pPart2->getChild(0),IS),"OSQLParseTreeIterator: error in parse tree!");
::rtl::OUString aString;
traverseOnePredicate(pSearchCondition->getChild(0),aString,NULL);
@@ -1427,11 +1494,19 @@ void OSQLParseTreeIterator::traverseParameter(const OSQLParseNode* _pParseNode
{// found a function as column_ref
::rtl::OUString sFunctionName;
_pColumnRef->getChild(0)->parseNodeToStr( sFunctionName, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
- sal_Int32 nType = ::connectivity::OSQLParser::getFunctionReturnType( sFunctionName, &m_rParser.getContext() );
+ const sal_uInt32 nCount = _pColumnRef->count();
+ sal_uInt32 i = 0;
+ for(; i < nCount;++i)
+ {
+ if ( _pColumnRef->getChild(i) == _pParseNode )
+ break;
+ }
+ sal_Int32 nType = ::connectivity::OSQLParser::getFunctionParameterType( _pColumnRef->getParent()->getChild(0)->getTokenID(), i+1);
OParseColumn* pColumn = new OParseColumn( sParameterName,
::rtl::OUString(),
::rtl::OUString(),
+ ::rtl::OUString(),
ColumnValue::NULLABLE_UNKNOWN,
0,
0,
@@ -1495,6 +1570,7 @@ void OSQLParseTreeIterator::traverseParameter(const OSQLParseNode* _pParseNode
OParseColumn* pColumn = new OParseColumn(aNewColName,
::rtl::OUString(),
::rtl::OUString(),
+ ::rtl::OUString(),
ColumnValue::NULLABLE_UNKNOWN,
0,
0,
@@ -1637,6 +1713,7 @@ void OSQLParseTreeIterator::appendColumns(::vos::ORef<OSQLColumns>& _rColumns,co
OParseColumn* pColumn = new OParseColumn(aName
, getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME)))
, getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE)))
+ , getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION)))
, getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)))
, getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)))
, getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)))
@@ -1714,6 +1791,7 @@ void OSQLParseTreeIterator::setSelectColumnName(::vos::ORef<OSQLColumns>& _rColu
// TODO: does this match with _nType?
// Or should be fill this from the getTypeInfo of the connection?
::rtl::OUString(),
+ ::rtl::OUString(),
ColumnValue::NULLABLE_UNKNOWN,
0,
0,
@@ -1733,7 +1811,7 @@ void OSQLParseTreeIterator::setSelectColumnName(::vos::ORef<OSQLColumns>& _rColu
{
::rtl::OUString aNewColName(getUniqueColumnName(rColumnAlias));
- OParseColumn* pColumn = new OParseColumn(aNewColName,::rtl::OUString(),::rtl::OUString(),
+ OParseColumn* pColumn = new OParseColumn(aNewColName,::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),
ColumnValue::NULLABLE_UNKNOWN,0,0,_nType,sal_False,sal_False,isCaseSensitive());
pColumn->setFunction(sal_True);
pColumn->setAggregateFunction(bAggFkt);
@@ -1754,7 +1832,7 @@ void OSQLParseTreeIterator::setSelectColumnName(::vos::ORef<OSQLColumns>& _rColu
{
::rtl::OUString aNewColName(getUniqueColumnName(rColumnAlias));
- OParseColumn* pColumn = new OParseColumn(aNewColName,::rtl::OUString(),::rtl::OUString(),
+ OParseColumn* pColumn = new OParseColumn(aNewColName,::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),
ColumnValue::NULLABLE_UNKNOWN,0,0,_nType,sal_False,sal_False,isCaseSensitive());
pColumn->setFunction(sal_True);
pColumn->setAggregateFunction(bAggFkt);
@@ -1791,7 +1869,7 @@ void OSQLParseTreeIterator::setSelectColumnName(::vos::ORef<OSQLColumns>& _rColu
{
::rtl::OUString aNewColName(getUniqueColumnName(rColumnAlias));
- OParseColumn* pColumn = new OParseColumn(aNewColName,::rtl::OUString(),::rtl::OUString(),
+ OParseColumn* pColumn = new OParseColumn(aNewColName,::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),
ColumnValue::NULLABLE_UNKNOWN,0,0,DataType::VARCHAR,sal_False,sal_False,isCaseSensitive());
pColumn->setFunction(sal_True);
pColumn->setAggregateFunction(bAggFkt);
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index 20b35b21a493..b8bcd5334787 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -677,7 +677,7 @@ void OSQLParseNode::impl_parseTableRangeNodeToString_throw(::rtl::OUStringBuffer
void OSQLParseNode::impl_parseLikeNodeToString_throw( ::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam ) const
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::impl_parseLikeNodeToString_throw" );
- OSL_ENSURE(count() >= 4,"count != 5: Prepare for GPF");
+ OSL_ENSURE(count() == 2,"count != 2: Prepare for GPF");
const OSQLParseNode* pEscNode = NULL;
const OSQLParseNode* pParaNode = NULL;
@@ -714,13 +714,11 @@ void OSQLParseNode::impl_parseLikeNodeToString_throw( ::rtl::OUStringBuffer& rSt
if (bAddName)
m_aChildren[0]->impl_parseNodeToString_throw( rString, aNewParam );
- m_aChildren[1]->impl_parseNodeToString_throw( rString, aNewParam );
- if(count() == 5)
- m_aChildren[2]->impl_parseNodeToString_throw( rString, aNewParam );
-
- sal_Int32 nCurentPos = m_aChildren.size()-2;
- pParaNode = m_aChildren[nCurentPos];
- pEscNode = m_aChildren[nCurentPos+1];
+ const OSQLParseNode* pPart2 = m_aChildren[1];
+ pPart2->getChild(0)->impl_parseNodeToString_throw( rString, aNewParam );
+ pPart2->getChild(1)->impl_parseNodeToString_throw( rString, aNewParam );
+ pParaNode = pPart2->getChild(2);
+ pEscNode = pPart2->getChild(3);
if (pParaNode->isToken())
{
@@ -1422,7 +1420,12 @@ OSQLParser::OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star:
{ OSQLParseNode::datetime_primary, "datetime_primary" },
{ OSQLParseNode::concatenation, "concatenation" },
{ OSQLParseNode::char_factor, "char_factor" },
- { OSQLParseNode::bit_value_fct, "bit_value_fct" }
+ { OSQLParseNode::bit_value_fct, "bit_value_fct" },
+ { OSQLParseNode::comparison_predicate_part_2, "comparison_predicate_part_2" },
+ { OSQLParseNode::parenthesized_boolean_value_expression, "parenthesized_boolean_value_expression" },
+ { OSQLParseNode::character_string_type, "character_string_type" },
+ { OSQLParseNode::other_like_predicate_part_2, "other_like_predicate_part_2" },
+ { OSQLParseNode::between_predicate_part_2, "between_predicate_part_2" }
};
size_t nRuleMapCount = sizeof( aRuleDescriptions ) / sizeof( aRuleDescriptions[0] );
OSL_ENSURE( nRuleMapCount == size_t( OSQLParseNode::rule_count ), "OSQLParser::OSQLParser: added a new rule? Adjust this map!" );
@@ -1984,39 +1987,34 @@ void OSQLParseNode::negateSearchCondition(OSQLParseNode*& pSearchCondition,sal_B
else if(bNegate && (SQL_ISRULE(pSearchCondition,test_for_null) || SQL_ISRULE(pSearchCondition,in_predicate) ||
SQL_ISRULE(pSearchCondition,between_predicate) || SQL_ISRULE(pSearchCondition,boolean_test) ))
{
+ OSQLParseNode* pPart2 = pSearchCondition;
+ if ( !SQL_ISRULE(pSearchCondition,boolean_test) )
+ pPart2 = pSearchCondition->getChild(1);
sal_uInt32 nNotPos = 0;
- // row_value_constructor not SQL_TOKEN_IN in_predicate_value
- // row_value_constructor not SQL_TOKEN_BETWEEN row_value_constructor SQL_TOKEN_AND row_value_constructor
- if ( SQL_ISRULE( pSearchCondition, in_predicate )
- || SQL_ISRULE( pSearchCondition, between_predicate )
- )
+ if ( SQL_ISRULE( pSearchCondition, test_for_null ) )
nNotPos = 1;
- // row_value_constructor SQL_TOKEN_IS not SQL_TOKEN_NULL
- // boolean_primary SQL_TOKEN_IS not truth_value
- else if ( SQL_ISRULE( pSearchCondition, test_for_null )
- || SQL_ISRULE( pSearchCondition, boolean_test )
- )
+ else if ( SQL_ISRULE( pSearchCondition, boolean_test ) )
nNotPos = 2;
- OSQLParseNode* pNot = pSearchCondition->getChild(nNotPos);
+ OSQLParseNode* pNot = pPart2->getChild(nNotPos);
OSQLParseNode* pNotNot = NULL;
if(pNot->isRule())
pNotNot = new OSQLParseNode(::rtl::OUString::createFromAscii("NOT"),SQL_NODE_KEYWORD,SQL_TOKEN_NOT);
else
pNotNot = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::sql_not));
- pSearchCondition->replace(pNot, pNotNot);
+ pPart2->replace(pNot, pNotNot);
delete pNot;
}
else if(bNegate && (SQL_ISRULE(pSearchCondition,like_predicate)))
{
- OSQLParseNode* pCheckForNOT = pSearchCondition->getChild( 1 );
- if ( SQL_ISTOKEN(pCheckForNOT,NOT) )
- delete pSearchCondition->removeAt( 1 );
+ OSQLParseNode* pNot = pSearchCondition->getChild( 1 )->getChild( 0 );
+ OSQLParseNode* pNotNot = NULL;
+ if(pNot->isRule())
+ pNotNot = new OSQLParseNode(::rtl::OUString::createFromAscii("NOT"),SQL_NODE_KEYWORD,SQL_TOKEN_NOT);
else
- {
- OSQLParseNode* pNot = new OSQLParseNode( ::rtl::OUString::createFromAscii( "NOT" ), SQL_NODE_KEYWORD, SQL_TOKEN_NOT );
- pSearchCondition->insert( 1, pNot );
- }
+ pNotNot = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::sql_not));
+ pSearchCondition->getChild( 1 )->replace(pNot, pNotNot);
+ delete pNot;
}
}
//-----------------------------------------------------------------------------
@@ -2554,7 +2552,6 @@ sal_Int32 OSQLParser::getFunctionReturnType(const ::rtl::OUString& _sFunctionNam
else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_BIT_LENGTH,pContext))) nType = DataType::INTEGER;
else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CHAR,pContext))) nType = DataType::VARCHAR;
else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CHAR_LENGTH,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CHARACTER_LENGTH,pContext))) nType = DataType::INTEGER;
else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CONCAT,pContext))) nType = DataType::VARCHAR;
else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_DIFFERENCE,pContext))) nType = DataType::VARCHAR;
else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_INSERT,pContext))) nType = DataType::VARCHAR;
diff --git a/connectivity/source/sdbcx/VColumn.cxx b/connectivity/source/sdbcx/VColumn.cxx
index e4535c713ec7..65bc1b368b1e 100644
--- a/connectivity/source/sdbcx/VColumn.cxx
+++ b/connectivity/source/sdbcx/VColumn.cxx
@@ -89,6 +89,7 @@ OColumn::OColumn(sal_Bool _bCase)
OColumn::OColumn( const ::rtl::OUString& _Name,
const ::rtl::OUString& _TypeName,
const ::rtl::OUString& _DefaultValue,
+ const ::rtl::OUString& _Description,
sal_Int32 _IsNullable,
sal_Int32 _Precision,
sal_Int32 _Scale,
@@ -100,6 +101,7 @@ OColumn::OColumn( const ::rtl::OUString& _Name,
:OColumnDescriptor_BASE(m_aMutex)
,ODescriptor(OColumnDescriptor_BASE::rBHelper,_bCase)
,m_TypeName(_TypeName)
+ ,m_Description(_Description)
,m_DefaultValue(_DefaultValue)
,m_IsNullable(_IsNullable)
,m_Precision(_Precision)
@@ -195,6 +197,7 @@ Reference< XPropertySet > SAL_CALL OColumn::createDataDescriptor( ) throw(Runti
OColumn* pNewColumn = new OColumn( m_Name,
m_TypeName,
m_DefaultValue,
+ m_Description,
m_IsNullable,
m_Precision,
m_Scale,
@@ -203,7 +206,6 @@ Reference< XPropertySet > SAL_CALL OColumn::createDataDescriptor( ) throw(Runti
m_IsRowVersion,
m_IsCurrency,
isCaseSensitive());
- pNewColumn->m_Description = m_Description;
pNewColumn->setNew(sal_True);
return pNewColumn;
}
diff --git a/connectivity/source/sdbcx/VIndexColumn.cxx b/connectivity/source/sdbcx/VIndexColumn.cxx
index 31aaaa3d17ab..ca1649b06384 100644
--- a/connectivity/source/sdbcx/VIndexColumn.cxx
+++ b/connectivity/source/sdbcx/VIndexColumn.cxx
@@ -85,6 +85,7 @@ OIndexColumn::OIndexColumn( sal_Bool _IsAscending,
) : OColumn(_Name,
_TypeName,
_DefaultValue,
+ ::rtl::OUString(),
_IsNullable,
_Precision,
_Scale,
diff --git a/connectivity/source/sdbcx/VKeyColumn.cxx b/connectivity/source/sdbcx/VKeyColumn.cxx
index bbcec5cc0501..97e83f5c633a 100644
--- a/connectivity/source/sdbcx/VKeyColumn.cxx
+++ b/connectivity/source/sdbcx/VKeyColumn.cxx
@@ -85,6 +85,7 @@ OKeyColumn::OKeyColumn( const ::rtl::OUString& _ReferencedColumn,
) : OColumn(_Name,
_TypeName,
_DefaultValue,
+ ::rtl::OUString(),
_IsNullable,
_Precision,
_Scale,
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index 0ae632a6e968..486d280311d9 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -133,6 +133,10 @@ class Desktop : public Application
static sal_Bool IsFirstStartWizardNeeded();
static sal_Bool CheckExtensionDependencies();
+ void SynchronizeExtensionRepositories();
+ void SetSplashScreenText( const ::rtl::OUString& rText );
+ void SetSplashScreenProgress( sal_Int32 );
+
private:
// Bootstrap methods
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > CreateApplicationServiceManager();
@@ -164,7 +168,6 @@ class Desktop : public Application
Reference<XStatusIndicator> m_rSplashScreen;
void OpenSplashScreen();
- void SetSplashScreenProgress(sal_Int32);
void CloseSplashScreen();
void EnableOleAutomation();
diff --git a/desktop/inc/deployment.hrc b/desktop/inc/deployment.hrc
index 7e4c21d3c5a4..370996c710ae 100644
--- a/desktop/inc/deployment.hrc
+++ b/desktop/inc/deployment.hrc
@@ -63,7 +63,6 @@
#define RID_IMG_JAVA_TYPELIB_HC (RID_DEPLOYMENT_COMPONENT_START+7)
#define RID_DEPLOYMENT_UNOPKG_START (RID_DEPLOYMENT_START+4000)
-#define RID_STR_UNOPKG_NO_SHARED_ALLOWED RID_DEPLOYMENT_UNOPKG_START
#define RID_STR_UNOPKG_ACCEPT_LIC_1 (RID_DEPLOYMENT_UNOPKG_START+1)
#define RID_STR_UNOPKG_ACCEPT_LIC_2 (RID_DEPLOYMENT_UNOPKG_START+2)
#define RID_STR_UNOPKG_ACCEPT_LIC_3 (RID_DEPLOYMENT_UNOPKG_START+3)
diff --git a/desktop/prj/build.lst b/desktop/prj/build.lst
index 9253b4e82bc7..8029b6ecc9f7 100644
--- a/desktop/prj/build.lst
+++ b/desktop/prj/build.lst
@@ -1,4 +1,4 @@
-dt desktop : l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg configmgr NULL
+dt desktop : l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg offuh NULL
dt desktop usr1 - all dt_mkout NULL
dt desktop\inc nmake - all dt_inc NULL
dt desktop\prj get - all dt_prj NULL
@@ -21,10 +21,9 @@ dt desktop\os2\source\applauncher nmake - p dt_applauncher dt_inc NULL
dt desktop\unx\source\officeloader nmake - u dt_officeloader_unx dt_inc NULL
dt desktop\source\pagein nmake - u dt_pagein dt_inc NULL
dt desktop\source\pkgchk\unopkg nmake - all dt_unopkg dt_dp_misc dt_app dt_inc dt_guiloader.w NULL
-dt desktop\source\deployment nmake - all dt_deployment dt_dp_manager dt_dp_registry dt_dp_registry_package dt_dp_registry_executable dt_dp_registry_help dt_dp_registry_script dt_dp_registry_sfwk dt_dp_registry_component dt_dp_registry_configuration dt_dp_migration dt_dp_unopkg dt_inc dt_dp_misc NULL
+dt desktop\source\deployment nmake - all dt_deployment dt_dp_manager dt_dp_registry dt_dp_registry_package dt_dp_registry_executable dt_dp_registry_help dt_dp_registry_script dt_dp_registry_sfwk dt_dp_registry_component dt_dp_registry_configuration dt_dp_unopkg dt_inc dt_dp_misc NULL
dt desktop\source\deployment\misc nmake - all dt_dp_misc dt_inc NULL
dt desktop\source\deployment\unopkg nmake - all dt_dp_unopkg dt_inc NULL
-dt desktop\source\deployment\migration nmake - all dt_dp_migration dt_inc NULL
dt desktop\source\deployment\gui nmake - all dt_dp_gui dt_dp_misc dt_inc NULL
dt desktop\source\deployment\manager nmake - all dt_dp_manager dt_inc NULL
dt desktop\source\deployment\registry nmake - all dt_dp_registry dt_inc NULL
diff --git a/desktop/qa/deployment_misc/makefile.mk b/desktop/qa/deployment_misc/makefile.mk
index 556df1a623c4..15faef0dc46e 100644
--- a/desktop/qa/deployment_misc/makefile.mk
+++ b/desktop/qa/deployment_misc/makefile.mk
@@ -34,6 +34,7 @@ ENABLE_EXCEPTIONS := TRUE
.INCLUDE: settings.mk
.INCLUDE: $(PRJ)$/source$/deployment$/inc$/dp_misc.mk
+CFLAGSCXX += $(CPPUNIT_CFLAGS)
DLLPRE = # no leading "lib" on .so files
SHL1TARGET = $(TARGET)
diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index 73653092f59c..0215f88d1ff0 100644
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -114,19 +114,20 @@ if [ -f /etc/adabasrc ]; then
. /etc/adabasrc
fi
-# Set PATH so that crash_report is found:
-PATH=$sd_prog${PATH+:$PATH}
-export PATH
-
# execute soffice binary
"$sd_prog/$sd_binary" "$@" &
trap 'kill -9 $!' TERM
wait $!
sd_ret=$?
-while [ $sd_ret -eq 79 ]
+while [ $sd_ret -eq 79 -o $sd_ret -eq 81 ]
do
- "$sd_prog/$sd_binary" ""$BOOTSTRAPVARS"" &
+ if [ $sd_ret -eq 79 ]; then
+ "$sd_prog/$sd_binary" ""$BOOTSTRAPVARS"" &
+ elif [ $sd_ret -eq 81 ]; then
+ "$sd_prog/$sd_binary" "$@" &
+ fi
+
wait $!
sd_ret=$?
done
diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
index 9e74f34d0e57..0fe319735c06 100644
--- a/desktop/scripts/unopkg.sh
+++ b/desktop/scripts/unopkg.sh
@@ -70,10 +70,6 @@ unset XENVIRONMENT
# uncomment line below if you encounter problems starting soffice on your system
# SAL_NO_XINITTHREADS=true; export SAL_NO_XINITTHREADS
-# Set PATH so that crash_report is found:
-PATH=$sd_prog${PATH+:$PATH}
-export PATH
-
# execute binary
exec "$sd_prog/unopkg.bin" "$@" \
"-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 53778534c750..bba615e0ebbc 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -84,6 +84,7 @@
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <com/sun/star/task/XJobExecutor.hpp>
+#include <com/sun/star/task/XRestartManager.hpp>
#ifndef _COM_SUN_STAR_TASK_XJOBEXECUTOR_HPP_
#include <com/sun/star/task/XJob.hpp>
#endif
@@ -103,6 +104,7 @@
#include <vos/security.hxx>
#include <vos/ref.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/componentcontext.hxx>
#include <comphelper/configurationhelper.hxx>
#ifndef _UTL__HXX_
#include <unotools/configmgr.hxx>
@@ -140,6 +142,7 @@
#include <sfx2/sfx.hrc>
#include <ucbhelper/contentbroker.hxx>
#include <unotools/bootstrap.hxx>
+#include <cppuhelper/bootstrap.hxx>
#include "vos/process.hxx"
@@ -359,6 +362,8 @@ namespace
: public rtl::Static< String, Version > {};
struct AboutBoxVersion
: public rtl::Static< String, AboutBoxVersion > {};
+ struct OOOVendor
+ : public rtl::Static< String, OOOVendor > {};
struct Extension
: public rtl::Static< String, Extension > {};
struct XMLFileFormatName
@@ -422,6 +427,21 @@ void ReplaceStringHookProc( UniString& rStr )
rStr.SearchAndReplaceAllAscii( "%PRODUCTXMLFILEFORMATNAME", rXMLFileFormatName );
rStr.SearchAndReplaceAllAscii( "%PRODUCTXMLFILEFORMATVERSION", rXMLFileFormatVersion );
}
+ if ( rStr.SearchAscii( "%OOOVENDOR" ) != STRING_NOTFOUND )
+ {
+ String &rOOOVendor = OOOVendor::get();
+
+ if ( !rOOOVendor.Len() )
+ {
+ rtl::OUString aTmp;
+ Any aRet = ::utl::ConfigManager::GetDirectConfigProperty(
+ ::utl::ConfigManager::OOOVENDOR );
+ aRet >>= aTmp;
+ rOOOVendor = aTmp;
+
+ }
+ rStr.SearchAndReplaceAllAscii( "%OOOVENDOR" ,rOOOVendor );
+ }
if ( rStr.SearchAscii( "%WRITERCOMPATIBILITYVERSIONOOO11" ) != STRING_NOTFOUND )
{
@@ -1149,16 +1169,6 @@ USHORT Desktop::Exception(USHORT nError)
switch( nError & EXC_MAJORTYPE )
{
-/*
- case EXC_USER:
- if( nError == EXC_OUTOFMEMORY )
- {
- // not possible without a special NewHandler!
- String aMemExceptionString;
- Application::Abort( aMemExceptionString );
- }
- break;
-*/
case EXC_RSCNOTLOADED:
{
String aResExceptionString;
@@ -1175,23 +1185,14 @@ USHORT Desktop::Exception(USHORT nError)
default:
{
- if ( pArgs->IsNoRestore() ) {
- if (m_pLockfile != NULL) {
- m_pLockfile->clean();
- }
- _exit( ExitHelper::E_LOCKFILE );
+ if (m_pLockfile != NULL) {
+ m_pLockfile->clean();
}
-
if( bRestart )
{
OfficeIPCThread::DisableOfficeIPCThread();
if( pSignalHandler )
DELETEZ( pSignalHandler );
-
- if (m_pLockfile != NULL) {
- m_pLockfile->clean();
- }
-
#ifdef MACOSX
DoRestart();
#endif
@@ -1199,17 +1200,15 @@ USHORT Desktop::Exception(USHORT nError)
}
else
{
- bInException = sal_False;
- _exit( ExitHelper::E_CRASH );
+ Application::Abort( String() );
}
break;
}
}
+ OSL_ASSERT(false); // unreachable
return 0;
-
- // ConfigManager is disposed, so no way to continue
}
void Desktop::AppEvent( const ApplicationEvent& rAppEvent )
@@ -1413,10 +1412,13 @@ void Desktop::Main()
tools::InitTestToolLib();
RTL_LOGFILE_CONTEXT_TRACE( aLog, "} tools::InitTestToolLib" );
+ // Check if bundled or shared extensions were added /removed
+ // and process those extensions (has to be done before checking
+ // the extension dependencies!
+ SynchronizeExtensionRepositories();
bool bAbort = CheckExtensionDependencies();
if ( bAbort )
return;
-
// First Start Wizard allowed ?
if ( ! pCmdLineArgs->IsNoFirstStartWizard())
{
@@ -1460,7 +1462,6 @@ void Desktop::Main()
}
SetSplashScreenProgress(50);
-
// Backing Component
sal_Bool bCrashed = sal_False;
sal_Bool bExistsRecoveryData = sal_False;
@@ -1579,7 +1580,8 @@ void Desktop::Main()
// SetSplashScreenProgress(80);
- if ( !bTerminateRequested && !pCmdLineArgs->IsInvisible() )
+ if ( !bTerminateRequested && !pCmdLineArgs->IsInvisible() &&
+ !pCmdLineArgs->IsNoQuickstart() )
InitializeQuickstartMode( xSMgr );
RTL_LOGFILE_CONTEXT( aLog2, "desktop (cd100003) createInstance com.sun.star.frame.Desktop" );
@@ -1630,6 +1632,7 @@ void Desktop::Main()
// call Application::Execute to process messages in vcl message loop
RTL_LOGFILE_PRODUCT_TRACE( "PERFORMANCE - enter Application::Execute()" );
+ Reference< ::com::sun::star::task::XRestartManager > xRestartManager;
try
{
// The JavaContext contains an interaction handler which is used when
@@ -1637,7 +1640,10 @@ void Desktop::Main()
com::sun::star::uno::ContextLayer layer2(
new svt::JavaContext( com::sun::star::uno::getCurrentContext() ) );
- Execute();
+ ::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)
{
@@ -1650,6 +1656,9 @@ void Desktop::Main()
FatalError( MakeStartupErrorMessage(exAnyCfg.Message) );
}
+ // check whether the shutdown is caused by restart
+ sal_Bool bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) );
+
if (xGlobalBroadcaster.is())
{
css::document::EventObject aEvent;
@@ -1658,18 +1667,18 @@ void Desktop::Main()
}
delete pResMgr;
-
// Restore old value
if ( pCmdLineArgs->IsHeadless() )
SvtMiscOptions().SetUseSystemFileDialog( bUseSystemFileDialog );
// remove temp directory
RemoveTemporaryDirectory();
-
+ // The acceptors in the AcceptorMap must be released (in DeregisterServices)
+ // with the solar mutex unlocked, to avoid deadlock:
+ nAcquireCount = Application::ReleaseSolarMutex();
DeregisterServices();
-
+ Application::AcquireSolarMutex(nAcquireCount);
tools::DeInitTestToolLib();
-
// be sure that path/language options gets destroyed before
// UCB is deinitialized
RTL_LOGFILE_CONTEXT_TRACE( aLog, "-> dispose path/language options" );
@@ -1682,6 +1691,14 @@ void Desktop::Main()
RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- deinit ucb" );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "FINISHED WITH Destop::Main" );
+ if ( bRestartRequested )
+ {
+#ifdef MACOSX
+ DoRestart();
+#endif
+ // wouldn't the solution be more clean if SalMain returns the exit code to the system?
+ _exit( ExitHelper::E_NORMAL_RESTART );
+ }
}
IMPL_LINK( Desktop, ImplInitFilterHdl, ConvertData*, pData )
@@ -2932,6 +2949,14 @@ void Desktop::SetSplashScreenProgress(sal_Int32 iProgress)
}
}
+void Desktop::SetSplashScreenText( const ::rtl::OUString& rText )
+{
+ if( m_rSplashScreen.is() )
+ {
+ m_rSplashScreen->setText( rText );
+ }
+}
+
void Desktop::CloseSplashScreen()
{
if(m_rSplashScreen.is())
diff --git a/desktop/source/app/appfirststart.cxx b/desktop/source/app/appfirststart.cxx
index c48805fcfeb7..2f0d4ab9e538 100644
--- a/desktop/source/app/appfirststart.cxx
+++ b/desktop/source/app/appfirststart.cxx
@@ -108,6 +108,9 @@ OUString Desktop::GetLicensePath()
/* Check if we need to accept license. */
sal_Bool Desktop::LicenseNeedsAcceptance()
{
+ // Don't show a license
+ return sal_False;
+/*
sal_Bool bShowLicense = sal_True;
sal_Int32 nOpenSourceContext = 0;
try
@@ -122,6 +125,7 @@ sal_Bool Desktop::LicenseNeedsAcceptance()
bShowLicense = sal_False;
return bShowLicense;
+*/
}
/* Local function - was the wizard completed already? */
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index a8f9580fa2f6..97eb3f555f60 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -311,7 +311,6 @@ void Desktop::RegisterServices( Reference< XMultiServiceFactory >& xSMgr )
namespace
{
struct acceptorMap : public rtl::Static< AcceptorMap, acceptorMap > {};
- struct mtxAccMap : public rtl::Static< osl::Mutex, mtxAccMap > {};
struct CurrentTempURL : public rtl::Static< String, CurrentTempURL > {};
}
@@ -319,8 +318,6 @@ static sal_Bool bAccept = sal_False;
void Desktop::createAcceptor(const OUString& aAcceptString)
{
- // make sure nobody adds an acceptor whle we create one...
- osl::MutexGuard aGuard(mtxAccMap::get());
// check whether the requested acceptor already exists
AcceptorMap &rMap = acceptorMap::get();
AcceptorMap::const_iterator pIter = rMap.find(aAcceptString);
@@ -367,7 +364,6 @@ class enable
void Desktop::enableAcceptors()
{
RTL_LOGFILE_CONTEXT(aLog, "desktop (lo119109) Desktop::enableAcceptors");
- osl::MutexGuard aGuard(mtxAccMap::get());
if (!bAccept)
{
// from now on, all new acceptors are enabled
@@ -381,7 +377,6 @@ void Desktop::enableAcceptors()
void Desktop::destroyAcceptor(const OUString& aAcceptString)
{
- osl::MutexGuard aGuard(mtxAccMap::get());
// special case stop all acceptors
AcceptorMap &rMap = acceptorMap::get();
if (aAcceptString.compareToAscii("all") == 0) {
diff --git a/desktop/source/app/check_ext_deps.cxx b/desktop/source/app/check_ext_deps.cxx
index 8b73e0c2c525..664e63c7f6ca 100644..100755
--- a/desktop/source/app/check_ext_deps.cxx
+++ b/desktop/source/app/check_ext_deps.cxx
@@ -27,35 +27,202 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_desktop.hxx"
+#include "osl/file.hxx"
+#include "osl/mutex.hxx"
+
#include <rtl/bootstrap.hxx>
#include <rtl/ustring.hxx>
+#include <rtl/logfile.hxx>
+#include "cppuhelper/compbase3.hxx"
+
+#include "vcl/wrkwin.hxx"
+#include "vcl/timer.hxx"
+
#include <unotools/configmgr.hxx>
+#include "toolkit/helper/vclunohelper.hxx"
#include <comphelper/processfactory.hxx>
#include <comphelper/sequence.hxx>
#include <cppuhelper/bootstrap.hxx>
-
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include "com/sun/star/deployment/XPackage.hpp"
-#include "com/sun/star/deployment/XPackageManager.hpp"
-#include "com/sun/star/deployment/thePackageManagerFactory.hpp"
+#include "com/sun/star/deployment/ExtensionManager.hpp"
+#include "com/sun/star/deployment/LicenseException.hpp"
+#include "com/sun/star/deployment/ui/LicenseDialog.hpp"
#include <com/sun/star/task/XJob.hpp>
#include <com/sun/star/task/XJobExecutor.hpp>
+#include <com/sun/star/task/XInteractionApprove.hpp>
+#include <com/sun/star/task/XInteractionAbort.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include "com/sun/star/ui/dialogs/ExecutableDialogResults.hpp"
#include <com/sun/star/util/XChangesBatch.hpp>
#include "app.hxx"
+#include "../deployment/inc/dp_misc.h"
+
using rtl::OUString;
using namespace desktop;
using namespace com::sun::star;
-#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
+#define UNISTRING(s) OUString(RTL_CONSTASCII_USTRINGPARAM(s))
+
+namespace
+{
+//For use with XExtensionManager.synchronize
+class SilentCommandEnv
+ : public ::cppu::WeakImplHelper3< ucb::XCommandEnvironment,
+ task::XInteractionHandler,
+ ucb::XProgressHandler >
+{
+ Desktop *mpDesktop;
+ sal_Int32 mnLevel;
+ sal_Int32 mnProgress;
+
+public:
+ SilentCommandEnv( Desktop* pDesktop );
+ virtual ~SilentCommandEnv();
+
+ // XCommandEnvironment
+ virtual uno::Reference<task::XInteractionHandler > SAL_CALL
+ getInteractionHandler() throw (uno::RuntimeException);
+ virtual uno::Reference<ucb::XProgressHandler >
+ SAL_CALL getProgressHandler() throw (uno::RuntimeException);
+
+ // XInteractionHandler
+ virtual void SAL_CALL handle(
+ uno::Reference<task::XInteractionRequest > const & xRequest )
+ throw (uno::RuntimeException);
+
+ // XProgressHandler
+ virtual void SAL_CALL push( uno::Any const & Status )
+ throw (uno::RuntimeException);
+ virtual void SAL_CALL update( uno::Any const & Status )
+ throw (uno::RuntimeException);
+ virtual void SAL_CALL pop() throw (uno::RuntimeException);
+};
+
+//-----------------------------------------------------------------------------
+SilentCommandEnv::SilentCommandEnv( Desktop* pDesktop )
+{
+ mpDesktop = pDesktop;
+ mnLevel = 0;
+ mnProgress = 25;
+}
+
+//-----------------------------------------------------------------------------
+SilentCommandEnv::~SilentCommandEnv()
+{
+ mpDesktop->SetSplashScreenText( OUString() );
+}
+
+//-----------------------------------------------------------------------------
+Reference<task::XInteractionHandler> SilentCommandEnv::getInteractionHandler()
+ throw (uno::RuntimeException)
+{
+ return this;
+}
+
+//-----------------------------------------------------------------------------
+Reference<ucb::XProgressHandler> SilentCommandEnv::getProgressHandler()
+ throw (uno::RuntimeException)
+{
+ return this;
+}
+//-----------------------------------------------------------------------------
+// XInteractionHandler
+void SilentCommandEnv::handle( Reference< task::XInteractionRequest> const & xRequest )
+ throw (uno::RuntimeException)
+{
+ deployment::LicenseException licExc;
+
+ uno::Any request( xRequest->getRequest() );
+ bool bApprove = true;
+
+ if ( request >>= licExc )
+ {
+ uno::Reference< uno::XComponentContext > xContext = comphelper_getProcessComponentContext();
+ uno::Reference< ui::dialogs::XExecutableDialog > xDialog(
+ deployment::ui::LicenseDialog::create(
+ xContext, VCLUnoHelper::GetInterface( NULL ),
+ licExc.ExtensionName, licExc.Text ) );
+ sal_Int16 res = xDialog->execute();
+ if ( res == ui::dialogs::ExecutableDialogResults::CANCEL )
+ bApprove = false;
+ else if ( res == ui::dialogs::ExecutableDialogResults::OK )
+ bApprove = true;
+ else
+ {
+ OSL_ASSERT(0);
+ }
+ }
+
+ // We approve everything here
+ uno::Sequence< Reference< task::XInteractionContinuation > > conts( xRequest->getContinuations() );
+ Reference< task::XInteractionContinuation > const * pConts = conts.getConstArray();
+ sal_Int32 len = conts.getLength();
+
+ for ( sal_Int32 pos = 0; pos < len; ++pos )
+ {
+ if ( bApprove )
+ {
+ uno::Reference< task::XInteractionApprove > xInteractionApprove( pConts[ pos ], uno::UNO_QUERY );
+ if ( xInteractionApprove.is() )
+ xInteractionApprove->select();
+ }
+ else
+ {
+ uno::Reference< task::XInteractionAbort > xInteractionAbort( pConts[ pos ], uno::UNO_QUERY );
+ if ( xInteractionAbort.is() )
+ xInteractionAbort->select();
+ }
+ }
+}
+
+//-----------------------------------------------------------------------------
+// XProgressHandler
+void SilentCommandEnv::push( uno::Any const & rStatus )
+ throw (uno::RuntimeException)
+{
+ OUString sText;
+ mnLevel += 1;
+
+ if ( rStatus.hasValue() && ( rStatus >>= sText) )
+ {
+ if ( mnLevel <= 3 )
+ mpDesktop->SetSplashScreenText( sText );
+ else
+ mpDesktop->SetSplashScreenProgress( ++mnProgress );
+ }
+}
+
+//-----------------------------------------------------------------------------
+void SilentCommandEnv::update( uno::Any const & rStatus )
+ throw (uno::RuntimeException)
+{
+ OUString sText;
+ if ( rStatus.hasValue() && ( rStatus >>= sText) )
+ {
+ mpDesktop->SetSplashScreenText( sText );
+ }
+}
+
+//-----------------------------------------------------------------------------
+void SilentCommandEnv::pop() throw (uno::RuntimeException)
+{
+ mnLevel -= 1;
+}
+
+} // end namespace
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
static const OUString sConfigSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) );
static const OUString sAccessSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) );
-
//------------------------------------------------------------------------------
static sal_Int16 impl_showExtensionDialog( uno::Reference< uno::XComponentContext > &xContext )
{
@@ -79,55 +246,75 @@ static sal_Int16 impl_showExtensionDialog( uno::Reference< uno::XComponentContex
//------------------------------------------------------------------------------
// Check dependencies of all packages
//------------------------------------------------------------------------------
-static bool impl_checkDependencies( const uno::Reference< deployment::XPackageManager > &xPackageManager )
+static bool impl_checkDependencies( const uno::Reference< uno::XComponentContext > &xContext )
{
- uno::Sequence< uno::Reference< deployment::XPackage > > packages;
+ uno::Sequence< uno::Sequence< uno::Reference< deployment::XPackage > > > xAllPackages;
+ uno::Reference< deployment::XExtensionManager > xExtensionManager = deployment::ExtensionManager::get( xContext );
+
+ if ( !xExtensionManager.is() )
+ {
+ OSL_ENSURE( 0, "Could not get the Extension Manager!" );
+ return true;
+ }
try {
- packages = xPackageManager->getDeployedPackages( uno::Reference< task::XAbortChannel >(),
- uno::Reference< ucb::XCommandEnvironment >() );
+ xAllPackages = xExtensionManager->getAllExtensions( uno::Reference< task::XAbortChannel >(),
+ uno::Reference< ucb::XCommandEnvironment >() );
}
- catch ( deployment::DeploymentException & ) { /* handleGeneralError(e.Cause);*/ }
- catch ( ucb::CommandFailedException & ) { /* handleGeneralError(e.Reason);*/ }
- catch ( ucb::CommandAbortedException & ) {}
+ catch ( deployment::DeploymentException & ) { return true; }
+ catch ( ucb::CommandFailedException & ) { return true; }
+ catch ( ucb::CommandAbortedException & ) { return true; }
catch ( lang::IllegalArgumentException & e ) {
throw uno::RuntimeException( e.Message, e.Context );
}
- for ( sal_Int32 i = 0; i < packages.getLength(); ++i )
+ sal_Int32 nMax = 2;
+#ifdef DEBUG
+ nMax = 3;
+#endif
+
+ for ( sal_Int32 i = 0; i < xAllPackages.getLength(); ++i )
{
- bool bRegistered = false;
- try {
- beans::Optional< beans::Ambiguous< sal_Bool > > option( packages[i]->isRegistered( uno::Reference< task::XAbortChannel >(),
- uno::Reference< ucb::XCommandEnvironment >() ) );
- if ( option.IsPresent )
- {
- ::beans::Ambiguous< sal_Bool > const & reg = option.Value;
- if ( reg.IsAmbiguous )
- bRegistered = false;
- else
- bRegistered = reg.Value ? true : false;
- }
- else
- bRegistered = false;
- }
- catch ( uno::RuntimeException & ) { throw; }
- catch ( uno::Exception & exc) {
- (void) exc;
- OSL_ENSURE( 0, ::rtl::OUStringToOString( exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
- bRegistered = false;
- }
+ uno::Sequence< uno::Reference< deployment::XPackage > > xPackageList = xAllPackages[i];
- if ( bRegistered )
+ for ( sal_Int32 j = 0; (j<nMax) && (j < xPackageList.getLength()); ++j )
{
- bool bDependenciesValid = false;
- try {
- bDependenciesValid = packages[i]->checkDependencies( uno::Reference< ucb::XCommandEnvironment >() );
- }
- catch ( deployment::DeploymentException & ) {}
- if ( ! bDependenciesValid )
+ uno::Reference< deployment::XPackage > xPackage = xPackageList[j];
+ if ( xPackage.is() )
{
- return false;
+ bool bRegistered = false;
+ try {
+ beans::Optional< beans::Ambiguous< sal_Bool > > option( xPackage->isRegistered( uno::Reference< task::XAbortChannel >(),
+ uno::Reference< ucb::XCommandEnvironment >() ) );
+ if ( option.IsPresent )
+ {
+ ::beans::Ambiguous< sal_Bool > const & reg = option.Value;
+ if ( reg.IsAmbiguous )
+ bRegistered = false;
+ else
+ bRegistered = reg.Value ? true : false;
+ }
+ else
+ bRegistered = false;
+ }
+ catch ( uno::RuntimeException & ) { throw; }
+ catch ( uno::Exception & exc) {
+ (void) exc;
+ OSL_ENSURE( 0, ::rtl::OUStringToOString( exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
+
+ if ( bRegistered )
+ {
+ bool bDependenciesValid = false;
+ try {
+ bDependenciesValid = xPackage->checkDependencies( uno::Reference< ucb::XCommandEnvironment >() );
+ }
+ catch ( deployment::DeploymentException & ) {}
+ if ( ! bDependenciesValid )
+ {
+ return false;
+ }
+ }
}
}
}
@@ -164,31 +351,11 @@ static void impl_setNeedsCompatCheck()
static bool impl_check()
{
uno::Reference< uno::XComponentContext > xContext = comphelper_getProcessComponentContext();
- uno::Reference< deployment::XPackageManager > xManager;
- bool bDependenciesValid = true;
-
- try {
- xManager = deployment::thePackageManagerFactory::get( xContext )->getPackageManager( UNISTRING("user") );
- }
- catch ( ucb::CommandFailedException & ){}
- catch ( uno::RuntimeException & ) {}
- if ( xManager.is() )
- bDependenciesValid = impl_checkDependencies( xManager );
-
- if ( bDependenciesValid )
- {
- try {
- xManager = deployment::thePackageManagerFactory::get( xContext )->getPackageManager( UNISTRING("shared") );
- }
- catch ( ucb::CommandFailedException & ){}
- catch ( uno::RuntimeException & ) {}
-
- if ( xManager.is() )
- bDependenciesValid = impl_checkDependencies( xManager );
- }
+ bool bDependenciesValid = impl_checkDependencies( xContext );
short nRet = 0;
+
if ( !bDependenciesValid )
nRet = impl_showExtensionDialog( xContext );
@@ -202,7 +369,7 @@ static bool impl_check()
}
//------------------------------------------------------------------------------
-// to check, if we need checking the dependencies of the extensions again, we compare
+// to check if we need checking the dependencies of the extensions again, we compare
// the build id of the office with the one of the last check
//------------------------------------------------------------------------------
static bool impl_needsCompatCheck()
@@ -235,6 +402,9 @@ static bool impl_needsCompatCheck()
pset->setPropertyValue( OUString::createFromAscii("LastCompatibilityCheckID"), result );
Reference< util::XChangesBatch >( pset, UNO_QUERY_THROW )->commitChanges();
}
+#ifdef DEBUG
+ bNeedsCheck = true;
+#endif
}
catch (const Exception&) {}
@@ -254,3 +424,8 @@ sal_Bool Desktop::CheckExtensionDependencies()
return bAbort;
}
+void Desktop::SynchronizeExtensionRepositories()
+{
+ RTL_LOGFILE_CONTEXT(aLog,"desktop (jl) ::Desktop::SynchronizeExtensionRepositories");
+ dp_misc::syncRepositories( new SilentCommandEnv( this ) );
+}
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index ac0381c3a96d..0625191ee2ea 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -399,6 +399,13 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
#if defined(WNT) || defined(OS2) || defined(QUARTZ)
SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_True );
#endif
+ SetBoolParam_Impl( CMD_BOOLPARAM_NOQUICKSTART, sal_False );
+ return sal_True;
+ }
+ else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-quickstart=no" )))
+ {
+ SetBoolParam_Impl( CMD_BOOLPARAM_NOQUICKSTART, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_False );
return sal_True;
}
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-terminate_after_init" )) == sal_True )
@@ -662,6 +669,12 @@ sal_Bool CommandLineArgs::IsQuickstart() const
return m_aBoolParams[ CMD_BOOLPARAM_QUICKSTART ];
}
+sal_Bool CommandLineArgs::IsNoQuickstart() const
+{
+ osl::MutexGuard aMutexGuard( m_aMutex );
+ return m_aBoolParams[ CMD_BOOLPARAM_NOQUICKSTART ];
+}
+
sal_Bool CommandLineArgs::IsTerminateAfterInit() const
{
osl::MutexGuard aMutexGuard( m_aMutex );
diff --git a/desktop/source/app/cmdlineargs.hxx b/desktop/source/app/cmdlineargs.hxx
index 1ec1ac3ad760..615577098c2d 100644
--- a/desktop/source/app/cmdlineargs.hxx
+++ b/desktop/source/app/cmdlineargs.hxx
@@ -48,6 +48,7 @@ class CommandLineArgs
CMD_BOOLPARAM_SERVER,
CMD_BOOLPARAM_HEADLESS,
CMD_BOOLPARAM_QUICKSTART,
+ CMD_BOOLPARAM_NOQUICKSTART,
CMD_BOOLPARAM_TERMINATEAFTERINIT,
CMD_BOOLPARAM_NOFIRSTSTARTWIZARD,
CMD_BOOLPARAM_NOLOGO,
@@ -132,6 +133,7 @@ class CommandLineArgs
sal_Bool IsServer() const;
sal_Bool IsHeadless() const;
sal_Bool IsQuickstart() const;
+ sal_Bool IsNoQuickstart() const;
sal_Bool IsTerminateAfterInit() const;
sal_Bool IsNoFirstStartWizard() const;
sal_Bool IsNoLogo() const;
diff --git a/desktop/source/app/copyright_ascii_ooo.c b/desktop/source/app/copyright_ascii_ooo.c
index 7b58f1a60f7e..7439547f62b4 100644
--- a/desktop/source/app/copyright_ascii_ooo.c
+++ b/desktop/source/app/copyright_ascii_ooo.c
@@ -5,12 +5,6 @@
*/
extern const char copyright_text_1[];
-extern const char copyright_text_2[];
-extern const char copyright_text_21[];
-extern const char copyright_text_22[];
-const char copyright_text_1[] = "Copyright © 2010 Sun Microsystems, Inc., All rights reserved.";
-const char copyright_text_2[] = "Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and in other countries.";
-const char copyright_text_21[] = "Copyright © 2010 Sun Microsystems, Tous droits réservés.";
-const char copyright_text_22[] = "Sun Microsystems, Inc. a les droits de propriété intellectuels relatants à la technologie incorporée dans ce produit. En particulier, et sans la limitation, ces droits de propriété intellectuels peuvent inclure un ou plus des brevets américains énumérés à http://www.sun.com/patents et un ou les brevets plus supplémentaires ou les applications de brevet en attente dans les États - Unis et les autres pays.";
+const char copyright_text_1[] = "Copyright © 2000, 2010 Oracle and/or its affiliates, All rights reserved.";
diff --git a/desktop/source/app/copyright_ascii_sun.c b/desktop/source/app/copyright_ascii_sun.c
index 6284744db94f..c7de54e98fba 100644
--- a/desktop/source/app/copyright_ascii_sun.c
+++ b/desktop/source/app/copyright_ascii_sun.c
@@ -4,17 +4,5 @@
*
*/
-const char copyright_text_1[] = "Copyright © 2010 Sun Microsystems, Inc., All rights reserved.";
-const char copyright_text_2[] = "Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and in other countries.";
-const char copyright_text_3[] = "U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Use is subject to license terms.";
-const char copyright_text_4[] = "This distribution may include materials developed by third parties.Sun, Sun Microsystems, the Sun logo, Java, Solaris and StarOffice are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries.";
-const char copyright_text_5[] = "UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd.";
-const char copyright_text_21[] = "Copyright © 2010 Sun Microsystems, Tous droits réservés.";
-const char copyright_text_22[] = "Sun Microsystems, Inc. a les droits de propriété intellectuels relatants à la technologie incorporée dans ce produit. En particulier, et sans la limitation, ces droits de propriété intellectuels peuvent inclure un ou plus des brevets américains énumérés à http://www.sun.com/patents et un ou les brevets plus supplémentaires ou les applications de brevet en attente dans les États - Unis et les autres pays.";
-const char copyright_text_23[] = "Ce produit ou document est protégé par un copyright et distribué avec des licences qui en restreignent l'utilisation, la copie, la distribution, et la décompilation. Aucune partie de ce produit ou document ne peut être reproduite sous aucune forme, par quelque moyen que ce soit, sans l'autorisation préalable et écrite de Sun et de ses bailleurs de licence, s'il y ena.";
-const char copyright_text_24[] = "L'utilisation est soumise aux termes du contrat de licence.";
-const char copyright_text_25[] = "Cette distribution peut comprendre des composants développés par des tierces parties.";
-const char copyright_text_26[] = "Sun, Sun Microsystems, le logo Sun, Java, Solaris et StarOffice sont des marques de fabrique ou des marques déposées de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pay";
-const char copyright_text_27[] = "Toutes les marques SPARC sont utilisées sous licence et sont des marques de fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans d'autres pay";
-const char copyright_text_28[] = "UNIX est une marque déposée aux Etats-Unis et dans d'autres pays et licenciée exlusivement par X/Open Company, Ltd.";
+const char copyright_text_1[] = "Copyright © 2000, 2010 Oracle and/or its affiliates, All rights reserved.";
diff --git a/desktop/source/app/desktop.src b/desktop/source/app/desktop.src
index d7ab4a27764e..2f6897adf80e 100644
--- a/desktop/source/app/desktop.src
+++ b/desktop/source/app/desktop.src
@@ -209,7 +209,7 @@ InfoBox INFOBOX_EXPIRED
{
Buttons = WB_OK ;
DefButton = WB_DEF_OK ;
- Message [ en-US ] = "This Evaluation Version has expired. To find out more about %PRODUCTNAME,\nvisit www.sun.com/%PRODUCTNAME.";
+ Message [ en-US ] = "This Evaluation Version has expired. To find out more about %PRODUCTNAME,\nvisit http://www.oracle.com/us/products/applications/open-office.";
};
String STR_TITLE_EXPIRED
diff --git a/desktop/source/app/makefile.mk b/desktop/source/app/makefile.mk
index d9db7c163481..085d8520e7ad 100644
--- a/desktop/source/app/makefile.mk
+++ b/desktop/source/app/makefile.mk
@@ -35,11 +35,24 @@ ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
+.INCLUDE : ../deployment/inc/dp_misc.mk
.IF "$(ENABLE_GNOMEVFS)"=="TRUE"
CFLAGS+=-DGNOME_VFS_ENABLED
.ENDIF
+# .IF "$(OS)" == "WNT"
+# .IF "$(COM)" == "GCC"
+# DEPLOYMENTMISCLIB = -ldeploymentmisc$(DLLPOSTFIX)
+# .ELSE
+# DEPLOYMENTMISCLIB = ideploymentmisc$(DLLPOSTFIX).lib
+# .ENDIF
+# .ELIF "$(OS)" == "OS2"
+# DEPLOYMENTMISCLIB = ideploymentmisc$(DLLPOSTFIX).lib
+# .ELSE
+# DEPLOYMENTMISCLIB = -ldeploymentmisc$(DLLPOSTFIX)
+# .ENDIF
+
SHL1TARGET = sofficeapp
SHL1OBJS = \
$(SLO)$/app.obj \
@@ -67,6 +80,7 @@ SHL1STDLIBS = \
$(COMPHELPERLIB) \
$(CPPUHELPERLIB) \
$(CPPULIB) \
+ $(DEPLOYMENTMISCLIB) \
$(I18NISOLANGLIB) \
$(SALLIB) \
$(SFXLIB) \
diff --git a/desktop/source/app/version.map b/desktop/source/app/version.map
index 657ee2a95433..0ffffcd58635 100644
--- a/desktop/source/app/version.map
+++ b/desktop/source/app/version.map
@@ -25,7 +25,7 @@
#
#*************************************************************************
-soffice.3 {
+UDK_3_0_0 {
global:
soffice_main;
diff --git a/desktop/source/deployment/deployment.map b/desktop/source/deployment/deployment.map
deleted file mode 100644
index 563b3d86a5d0..000000000000
--- a/desktop/source/deployment/deployment.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/desktop/source/deployment/dp_services.cxx b/desktop/source/deployment/dp_services.cxx
index c83a62bfd17e..f7ebf66355ba 100644
--- a/desktop/source/deployment/dp_services.cxx
+++ b/desktop/source/deployment/dp_services.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_desktop.hxx"
-#define COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS 11
+#define COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS 12
#include "comphelper/servicedecl.hxx"
using namespace com::sun::star;
@@ -69,13 +69,11 @@ namespace factory {
extern sdecl::ServiceDecl const serviceDecl;
bool singleton_entries( uno::Reference<registry::XRegistryKey> const& );
}
-}
-
-namespace dp_log {
extern sdecl::ServiceDecl const serviceDecl;
+bool singleton_entries( uno::Reference<registry::XRegistryKey> const& );
}
-namespace dp_migration {
+namespace dp_log {
extern sdecl::ServiceDecl const serviceDecl;
}
@@ -108,10 +106,11 @@ sal_Bool SAL_CALL component_writeInfo(
dp_registry::backend::executable::serviceDecl,
dp_manager::factory::serviceDecl,
dp_log::serviceDecl,
- dp_migration::serviceDecl,
- dp_info::serviceDecl ) &&
+ dp_info::serviceDecl,
+ dp_manager::serviceDecl) &&
dp_manager::factory::singleton_entries( pRegistryKey ) &&
- dp_info::singleton_entries( pRegistryKey );
+ dp_info::singleton_entries( pRegistryKey ) &&
+ dp_manager::singleton_entries( pRegistryKey);
}
void * SAL_CALL component_getFactory(
@@ -129,8 +128,8 @@ void * SAL_CALL component_getFactory(
dp_registry::backend::executable::serviceDecl,
dp_manager::factory::serviceDecl,
dp_log::serviceDecl,
- dp_migration::serviceDecl,
- dp_info::serviceDecl );
+ dp_info::serviceDecl,
+ dp_manager::serviceDecl);
}
} // extern "C"
diff --git a/desktop/source/deployment/dp_xml.cxx b/desktop/source/deployment/dp_xml.cxx
index 0453ab8372c0..65c48d70c92d 100644
--- a/desktop/source/deployment/dp_xml.cxx
+++ b/desktop/source/deployment/dp_xml.cxx
@@ -44,6 +44,20 @@ namespace dp_misc
//==============================================================================
void xml_parse(
+ Reference<xml::input::XRoot> const & xRoot,
+ ::ucbhelper::Content & ucb_content,
+ Reference<XComponentContext> const & xContext )
+{
+ const Any arg(xRoot);
+ const Reference<xml::sax::XDocumentHandler> xDocHandler(
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
+ OUSTR("com.sun.star.xml.input.SaxDocumentHandler"),
+ Sequence<Any>( &arg, 1 ), xContext ), UNO_QUERY_THROW );
+ xml_parse( xDocHandler, ucb_content, xContext );
+ }
+
+//==============================================================================
+void xml_parse(
Reference<xml::sax::XDocumentHandler> const & xDocHandler,
::ucbhelper::Content & ucb_content,
Reference<XComponentContext> const & xContext )
@@ -61,199 +75,4 @@ void xml_parse(
xParser->parseStream( source );
}
-//==============================================================================
-void xml_parse(
- Reference<xml::input::XRoot> const & xRoot,
- ::ucbhelper::Content & ucb_content,
- Reference<XComponentContext> const & xContext )
-{
- const Any arg(xRoot);
- const Reference<xml::sax::XDocumentHandler> xDocHandler(
- xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
- OUSTR("com.sun.star.xml.input.SaxDocumentHandler"),
- Sequence<Any>( &arg, 1 ), xContext ), UNO_QUERY_THROW );
- xml_parse( xDocHandler, ucb_content, xContext );
-}
-
-//##############################################################################
-
-//______________________________________________________________________________
-XmlRootElement::XmlRootElement(
- OUString const & uri, OUString const & localname )
- : m_uri( uri )
-{
- m_localname = localname;
-}
-
-//______________________________________________________________________________
-XmlRootElement::~XmlRootElement()
-{
-}
-
-// XRoot
-//______________________________________________________________________________
-void XmlRootElement::startDocument(
- Reference<xml::input::XNamespaceMapping> const & xMapping )
- throw (xml::sax::SAXException, RuntimeException)
-{
- m_xNamespaceMapping = xMapping;
-
- try {
- m_uid = m_xNamespaceMapping->getUidByUri( m_uri );
- }
- catch (container::NoSuchElementException & exc) {
- throw xml::sax::SAXException(
- exc.Message, static_cast<OWeakObject *>(this), Any(exc) );
- }
-}
-
-//______________________________________________________________________________
-void XmlRootElement::endDocument()
- throw (xml::sax::SAXException, RuntimeException)
-{
-}
-
-//______________________________________________________________________________
-void XmlRootElement::processingInstruction(
- OUString const &, OUString const & )
- throw (xml::sax::SAXException, RuntimeException)
-{
-}
-
-//______________________________________________________________________________
-void XmlRootElement::setDocumentLocator(
- Reference<xml::sax::XLocator> const & )
- throw (xml::sax::SAXException, RuntimeException)
-{
-}
-
-//______________________________________________________________________________
-Reference<xml::input::XElement> XmlRootElement::startRootElement(
- sal_Int32 uid, OUString const & localname,
- Reference<xml::input::XAttributes> const & xAttributes )
- throw (xml::sax::SAXException, RuntimeException)
-{
- check_xmlns( uid );
- if (! localname.equals( m_localname )) {
- throw xml::sax::SAXException(
- OUSTR("unexpected root element ") + localname,
- static_cast<OWeakObject *>(this), Any() );
- }
- m_xAttributes = xAttributes;
-
- return this;
-}
-
-//##############################################################################
-
-//______________________________________________________________________________
-XmlElement::~XmlElement()
-{
-}
-
-//______________________________________________________________________________
-void XmlElement::check_xmlns( sal_Int32 uid ) const
- throw (xml::sax::SAXException)
-{
- if (uid != m_uid)
- {
- ::rtl::OUStringBuffer buf;
- buf.appendAscii(
- RTL_CONSTASCII_STRINGPARAM("illegal xml namespace uri=\"") );
- try {
- buf.append( m_xNamespaceMapping->getUriByUid( uid ) );
- }
- catch (container::NoSuchElementException & exc) {
- throw xml::sax::SAXException(
- exc.Message, static_cast<OWeakObject *>(
- const_cast<XmlElement *>(this) ), Any(exc) );
- }
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"!") );
- throw xml::sax::SAXException(
- buf.makeStringAndClear(),
- static_cast<OWeakObject *>( const_cast<XmlElement *>(this) ),
- Any() );
- }
-}
-
-// XElement
-//______________________________________________________________________________
-Reference<xml::input::XElement> XmlElement::getParent()
- throw (RuntimeException)
-{
- return m_xParent;
-}
-
-//______________________________________________________________________________
-OUString XmlElement::getLocalName()
- throw (RuntimeException)
-{
- return m_localname;
-}
-
-//______________________________________________________________________________
-sal_Int32 XmlElement::getUid()
- throw (RuntimeException)
-{
- return m_uid;
-}
-
-//______________________________________________________________________________
-Reference<xml::input::XAttributes> XmlElement::getAttributes()
- throw (RuntimeException)
-{
- return m_xAttributes;
-}
-
-//______________________________________________________________________________
-void XmlElement::ignorableWhitespace(
- OUString const & )
- throw (xml::sax::SAXException, RuntimeException)
-{
-}
-
-//______________________________________________________________________________
-void XmlElement::characters( OUString const & chars )
- throw (xml::sax::SAXException, RuntimeException)
-{
- m_characters += chars;
-}
-
-//______________________________________________________________________________
-void XmlElement::processingInstruction(
- OUString const &, OUString const & )
- throw (xml::sax::SAXException, RuntimeException)
-{
-}
-
-//______________________________________________________________________________
-void XmlElement::endElement()
- throw (xml::sax::SAXException, RuntimeException)
-{
- m_got_endElement = true;
-}
-
-//______________________________________________________________________________
-Reference<xml::input::XElement> XmlElement::startChildElement(
- sal_Int32 uid, OUString const & localName,
- Reference<xml::input::XAttributes> const & )
- throw (xml::sax::SAXException, RuntimeException)
-{
- ::rtl::OUStringBuffer buf;
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("unexpected element "
- "{ tag=\"") );
- buf.append( localName );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\", uri=\"") );
- try {
- buf.append( m_xNamespaceMapping->getUriByUid( uid ) );
- }
- catch (container::NoSuchElementException & exc) {
- throw xml::sax::SAXException(
- exc.Message, static_cast<OWeakObject *>(this), Any(exc) );
- }
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\" }!") );
- throw xml::sax::SAXException(
- buf.makeStringAndClear(), static_cast<OWeakObject *>(this), Any() );
-}
-
}
diff --git a/desktop/source/deployment/gui/dp_gui.h b/desktop/source/deployment/gui/dp_gui.h
index 85e6eaef3544..092b232ce96d 100644
--- a/desktop/source/deployment/gui/dp_gui.h
+++ b/desktop/source/deployment/gui/dp_gui.h
@@ -79,21 +79,18 @@ enum PackageState { REGISTERED, NOT_REGISTERED, AMBIGUOUS, NOT_AVAILABLE };
class SelectedPackage: public salhelper::SimpleReferenceObject {
public:
SelectedPackage() {}
- SelectedPackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage> &xPackage,
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager> &xPackageManager )
- : m_xPackage( xPackage ),
- m_xPackageManager( xPackageManager )
+ SelectedPackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage> &xPackage)
+ : m_xPackage( xPackage )
{}
virtual ~SelectedPackage();
::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage> getPackage() const { return m_xPackage; }
- ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager> getPackageManager() const { return m_xPackageManager; }
+
private:
SelectedPackage(SelectedPackage &); // not defined
void operator =(SelectedPackage &); // not defined
::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage> m_xPackage;
- ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager> m_xPackageManager;
};
} // namespace dp_gui
diff --git a/desktop/source/deployment/gui/dp_gui.hrc b/desktop/source/deployment/gui/dp_gui.hrc
index 8da4db5ca74f..5f52b042edf3 100644..100755
--- a/desktop/source/deployment/gui/dp_gui.hrc
+++ b/desktop/source/deployment/gui/dp_gui.hrc
@@ -138,6 +138,8 @@
#define RID_IMG_LOCKED_HC (RID_DEPLOYMENT_GUI_START+59)
#define RID_IMG_EXTENSION (RID_DEPLOYMENT_GUI_START+60)
#define RID_IMG_EXTENSION_HC (RID_DEPLOYMENT_GUI_START+61)
+#define RID_IMG_SHARED (RID_DEPLOYMENT_GUI_START+62)
+#define RID_IMG_SHARED_HC (RID_DEPLOYMENT_GUI_START+63)
#define RID_STR_ADD_PACKAGES (RID_DEPLOYMENT_GUI_START+70)
@@ -151,6 +153,7 @@
#define RID_STR_REMOVING_PACKAGES (RID_DEPLOYMENT_GUI_START+86)
#define RID_STR_ENABLING_PACKAGES (RID_DEPLOYMENT_GUI_START+87)
#define RID_STR_DISABLING_PACKAGES (RID_DEPLOYMENT_GUI_START+88)
+#define RID_STR_ACCEPT_LICENSE (RID_DEPLOYMENT_GUI_START+89)
#define RID_STR_INSTALL_FOR_ALL (RID_DEPLOYMENT_GUI_START+90)
#define RID_STR_INSTALL_FOR_ME (RID_DEPLOYMENT_GUI_START+91)
@@ -159,6 +162,7 @@
#define RID_STR_EXIT_BTN (RID_DEPLOYMENT_GUI_START+94)
#define RID_STR_NO_ADMIN_PRIVILEGE (RID_DEPLOYMENT_GUI_START+95)
#define RID_STR_ERROR_MISSING_DEPENDENCIES (RID_DEPLOYMENT_GUI_START+96)
+#define RID_STR_ERROR_MISSING_LICENSE (RID_DEPLOYMENT_GUI_START+97)
#define WARNINGBOX_CONCURRENTINSTANCE (RID_DEPLOYMENT_GUI_START+100)
@@ -170,7 +174,6 @@
#define RID_WARNINGBOX_DISABLE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+106)
#define RID_DLG_LICENSE RID_DEPLOYMENT_LICENSE_START
-#define WARNINGBOX_NOSHAREDALLOWED (RID_DEPLOYMENT_LICENSE_START+1)
diff --git a/desktop/source/deployment/gui/dp_gui_dialog.src b/desktop/source/deployment/gui/dp_gui_dialog.src
index 79c0c5172030..15823288ee20 100644..100755
--- a/desktop/source/deployment/gui/dp_gui_dialog.src
+++ b/desktop/source/deployment/gui/dp_gui_dialog.src
@@ -72,6 +72,11 @@ String RID_STR_DISABLING_PACKAGES
Text [ en-US ] = "Disabling %EXTENSION_NAME";
};
+String RID_STR_ACCEPT_LICENSE
+{
+ Text [ en-US ] = "Accept license for %EXTENSION_NAME";
+};
+
String RID_STR_INSTALL_FOR_ALL
{
Text [ en-US ] = "~For all users";
@@ -109,6 +114,11 @@ String RID_STR_ERROR_MISSING_DEPENDENCIES
Text [ en-US ] = "The extension cannot be enabled as the following system dependencies are not fulfilled:";
};
+String RID_STR_ERROR_MISSING_LICENSE
+{
+ Text [ en-US ] = "This extension is disabled because you haven't accepted the license yet.\n";
+};
+
// Dialog layout
// ---------------------------------------------------
// row 1 | multi line edit
@@ -131,7 +141,7 @@ String RID_STR_ERROR_MISSING_DEPENDENCIES
#define ROW1_Y RSC_SP_DLG_INNERBORDER_TOP
#define ROW1_HEIGHT 16*RSC_CD_FIXEDTEXT_HEIGHT
#define ROW2_Y ROW1_Y+ROW1_HEIGHT+RSC_SP_CTRL_GROUP_Y
-#define ROW2_HEIGHT 2*RSC_CD_FIXEDTEXT_HEIGHT
+#define ROW2_HEIGHT 3*RSC_CD_FIXEDTEXT_HEIGHT
#define ROW3_Y ROW2_Y+ROW2_HEIGHT+RSC_SP_CTRL_GROUP_Y
#define ROW3_HEIGHT 3*RSC_CD_FIXEDTEXT_HEIGHT
#define ROW4_Y ROW3_Y+ROW3_HEIGHT+RSC_SP_CTRL_GROUP_Y
@@ -282,14 +292,6 @@ ModalDialog RID_DLG_LICENSE
-WarningBox WARNINGBOX_NOSHAREDALLOWED
-{
- Buttons = WB_OK ;
- DefButton = WB_DEF_OK;
- Message[ en-US ] ="The extension \'%NAME\' cannot be installed under \"%PRODUCTNAME Extensions\", because "
- "every user has to agree to the license agreement of the extension. The extension will not be installed.";
-};
-
WarningBox RID_WARNINGBOX_INSTALL_EXTENSION {
Buttons = WB_OK_CANCEL;
DefButton = WB_DEF_OK;
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 2d0733dfbae3..1a66ff38e4a4 100644..100755
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -30,14 +30,17 @@
#include "dp_gui.hrc"
#include "svtools/controldims.hrc"
-#include "svl/svtools.hrc"
+#include "svtools/svtools.hrc"
#include "dp_gui.h"
#include "dp_gui_dialog2.hxx"
#include "dp_gui_extlistbox.hxx"
#include "dp_gui_shared.hxx"
#include "dp_gui_theextmgr.hxx"
+#include "dp_gui_extensioncmdqueue.hxx"
#include "dp_misc.h"
+#include "dp_update.hxx"
+#include "dp_identifier.hxx"
#include "vcl/ctrl.hxx"
#include "vcl/menu.hxx"
@@ -74,8 +77,6 @@
#include "com/sun/star/uno/Any.hxx"
#include "com/sun/star/uno/XComponentContext.hpp"
-#include "com/sun/star/deployment/thePackageManagerFactory.hpp"
-
#include <map>
#include <vector>
#include <boost/shared_ptr.hpp>
@@ -108,17 +109,6 @@ struct StrAllFiles : public rtl::StaticWithInit< const OUString, StrAllFiles >
};
//------------------------------------------------------------------------------
-UpdateListEntry::UpdateListEntry( const uno::Reference< deployment::XPackage > &xPackage,
- const uno::Reference< deployment::XPackageManager > &xPackageManager ) :
- m_xPackage( xPackage ),
- m_xPackageManager( xPackageManager )
-{}
-
-//------------------------------------------------------------------------------
-UpdateListEntry::~UpdateListEntry()
-{}
-
-//------------------------------------------------------------------------------
// ExtBoxWithBtns_Impl
//------------------------------------------------------------------------------
@@ -239,7 +229,10 @@ void ExtBoxWithBtns_Impl::RecalcAll()
const sal_Int32 nActive = getSelIndex();
if ( nActive != EXTENSION_LISTBOX_ENTRY_NOTFOUND )
+ {
SetButtonPos( GetEntryRect( nActive ) );
+ SetButtonStatus( GetEntryData( nActive) );
+ }
else
{
m_pOptionsBtn->Hide();
@@ -257,21 +250,6 @@ void ExtBoxWithBtns_Impl::selectEntry( const long nPos )
return;
ExtensionBox_Impl::selectEntry( nPos );
-
- if ( ( nPos >= 0 ) && ( nPos < GetEntryCount() ) )
- {
- if ( IsReallyVisible() )
- {
- SetButtonPos( GetEntryRect( nPos ) );
- }
- SetButtonStatus( GetEntryData( nPos) );
- }
- else
- {
- m_pOptionsBtn->Hide();
- m_pEnableBtn->Hide();
- m_pRemoveBtn->Hide();
- }
}
// -----------------------------------------------------------------------
@@ -291,6 +269,9 @@ void ExtBoxWithBtns_Impl::SetButtonPos( const Rectangle& rRect )
// -----------------------------------------------------------------------
void ExtBoxWithBtns_Impl::SetButtonStatus( const TEntry_Impl pEntry )
{
+ bool bShowOptionBtn = true;
+
+ pEntry->m_bHasButtons = false;
if ( ( pEntry->m_eState == REGISTERED ) || ( pEntry->m_eState == NOT_AVAILABLE ) )
{
m_pEnableBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) );
@@ -300,26 +281,36 @@ void ExtBoxWithBtns_Impl::SetButtonStatus( const TEntry_Impl pEntry )
{
m_pEnableBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) );
m_pEnableBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_ENABLE );
+ bShowOptionBtn = false;
}
- if ( ( pEntry->m_eState == NOT_AVAILABLE ) || pEntry->m_bMissingDeps )
+ if ( ( !pEntry->m_bUser || ( pEntry->m_eState == NOT_AVAILABLE ) || pEntry->m_bMissingDeps )
+ && !pEntry->m_bMissingLic )
m_pEnableBtn->Hide();
else
{
m_pEnableBtn->Enable( !pEntry->m_bLocked );
m_pEnableBtn->Show();
+ pEntry->m_bHasButtons = true;
}
- if ( pEntry->m_bHasOptions )
+ if ( pEntry->m_bHasOptions && bShowOptionBtn )
{
m_pOptionsBtn->Enable( pEntry->m_bHasOptions );
m_pOptionsBtn->Show();
+ pEntry->m_bHasButtons = true;
}
else
m_pOptionsBtn->Hide();
- m_pRemoveBtn->Show();
- m_pRemoveBtn->Enable( !pEntry->m_bLocked );
+ if ( pEntry->m_bUser || pEntry->m_bShared )
+ {
+ m_pRemoveBtn->Enable( !pEntry->m_bLocked );
+ m_pRemoveBtn->Show();
+ pEntry->m_bHasButtons = true;
+ }
+ else
+ m_pRemoveBtn->Hide();
}
// -----------------------------------------------------------------------
@@ -406,17 +397,13 @@ void ExtBoxWithBtns_Impl::MouseButtonDown( const MouseEvent& rMEvt )
switch( ShowPopupMenu( aMousePos, nPos ) )
{
case CMD_NONE: break;
- case CMD_ENABLE: m_pParent->enablePackage( GetEntryData( nPos )->m_xPackageManager,
- GetEntryData( nPos )->m_xPackage, true );
+ case CMD_ENABLE: m_pParent->enablePackage( GetEntryData( nPos )->m_xPackage, true );
break;
- case CMD_DISABLE: m_pParent->enablePackage( GetEntryData( nPos )->m_xPackageManager,
- GetEntryData( nPos )->m_xPackage, false );
+ case CMD_DISABLE: m_pParent->enablePackage( GetEntryData( nPos )->m_xPackage, false );
break;
- case CMD_UPDATE: m_pParent->updatePackage( GetEntryData( nPos )->m_xPackageManager,
- GetEntryData( nPos )->m_xPackage );
+ case CMD_UPDATE: m_pParent->updatePackage( GetEntryData( nPos )->m_xPackage );
break;
- case CMD_REMOVE: m_pParent->removePackage( GetEntryData( nPos )->m_xPackageManager,
- GetEntryData( nPos )->m_xPackage );
+ case CMD_REMOVE: m_pParent->removePackage( GetEntryData( nPos )->m_xPackage );
break;
}
}
@@ -518,11 +505,14 @@ IMPL_LINK( ExtBoxWithBtns_Impl, HandleEnableBtn, void*, EMPTYARG )
if ( nActive != EXTENSION_LISTBOX_ENTRY_NOTFOUND )
{
TEntry_Impl pEntry = GetEntryData( nActive );
- const bool bEnable( pEntry->m_eState != REGISTERED );
- m_pParent->enablePackage( pEntry->m_xPackageManager,
- pEntry->m_xPackage,
- bEnable );
+ if ( pEntry->m_bMissingLic )
+ m_pParent->acceptLicense( pEntry->m_xPackage );
+ else
+ {
+ const bool bEnable( pEntry->m_eState != REGISTERED );
+ m_pParent->enablePackage( pEntry->m_xPackage, bEnable );
+ }
}
return 1;
@@ -536,8 +526,7 @@ IMPL_LINK( ExtBoxWithBtns_Impl, HandleRemoveBtn, void*, EMPTYARG )
if ( nActive != EXTENSION_LISTBOX_ENTRY_NOTFOUND )
{
TEntry_Impl pEntry = GetEntryData( nActive );
- m_pParent->removePackage( pEntry->m_xPackageManager,
- pEntry->m_xPackage );
+ m_pParent->removePackage( pEntry->m_xPackage );
}
return 1;
@@ -583,21 +572,21 @@ String DialogHelper::getResourceString( USHORT id )
}
//------------------------------------------------------------------------------
-bool DialogHelper::IsSharedPkgMgr( const uno::Reference< deployment::XPackageManager > &xPackageManager )
+bool DialogHelper::IsSharedPkgMgr( const uno::Reference< deployment::XPackage > &xPackage )
{
- if ( xPackageManager->getContext().equals( OUSTR("shared") ) )
+ if ( xPackage->getRepositoryName().equals( OUSTR("shared") ) )
return true;
else
return false;
}
//------------------------------------------------------------------------------
-bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment::XPackageManager > &xPackageManager,
+bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment::XPackage > &xPackage,
Window *pParent,
const USHORT nResID,
bool &bHadWarning )
{
- if ( !bHadWarning && IsSharedPkgMgr( xPackageManager ) )
+ if ( !bHadWarning && IsSharedPkgMgr( xPackage ) )
{
const ::vos::OGuard guard( Application::GetSolarMutex() );
WarningBox aInfoBox( pParent, getResId( nResID ) );
@@ -771,17 +760,16 @@ void ExtMgrDialog::setGetExtensionsURL( const ::rtl::OUString &rURL )
//------------------------------------------------------------------------------
long ExtMgrDialog::addPackageToList( const uno::Reference< deployment::XPackage > &xPackage,
- const uno::Reference< deployment::XPackageManager > &xPackageManager )
+ bool bLicenseMissing )
{
m_aUpdateBtn.Enable( true );
- return m_pExtensionBox->addEntry( xPackage, xPackageManager );
+ return m_pExtensionBox->addEntry( xPackage, bLicenseMissing );
}
//------------------------------------------------------------------------------
-void ExtMgrDialog::prepareChecking( const uno::Reference< deployment::XPackageManager > &xPackageManager )
+void ExtMgrDialog::prepareChecking()
{
- if ( xPackageManager.is() )
- m_pExtensionBox->prepareChecking( xPackageManager );
+ m_pExtensionBox->prepareChecking();
}
//------------------------------------------------------------------------------
@@ -805,68 +793,82 @@ bool ExtMgrDialog::removeExtensionWarn( const OUString &rExtensionName ) const
}
//------------------------------------------------------------------------------
-bool ExtMgrDialog::enablePackage( const uno::Reference< deployment::XPackageManager > &xPackageManager,
- const uno::Reference< deployment::XPackage > &xPackage,
+bool ExtMgrDialog::enablePackage( const uno::Reference< deployment::XPackage > &xPackage,
bool bEnable )
{
- if ( !xPackageManager.is() || !xPackage.is() )
+ if ( !xPackage.is() )
return false;
if ( bEnable )
{
- if ( ! continueOnSharedExtension( xPackageManager, this, RID_WARNINGBOX_ENABLE_SHARED_EXTENSION, m_bEnableWarning ) )
+ if ( ! continueOnSharedExtension( xPackage, this, RID_WARNINGBOX_ENABLE_SHARED_EXTENSION, m_bEnableWarning ) )
return false;
}
else
{
- if ( ! continueOnSharedExtension( xPackageManager, this, RID_WARNINGBOX_DISABLE_SHARED_EXTENSION, m_bDisableWarning ) )
+ if ( ! continueOnSharedExtension( xPackage, this, RID_WARNINGBOX_DISABLE_SHARED_EXTENSION, m_bDisableWarning ) )
return false;
}
- m_pManager->enablePackage( xPackage, bEnable );
+ m_pManager->getCmdQueue()->enableExtension( xPackage, bEnable );
return true;
}
//------------------------------------------------------------------------------
-bool ExtMgrDialog::removePackage( const uno::Reference< deployment::XPackageManager > &xPackageManager,
- const uno::Reference< deployment::XPackage > &xPackage )
+bool ExtMgrDialog::removePackage( const uno::Reference< deployment::XPackage > &xPackage )
{
- if ( !xPackageManager.is() || !xPackage.is() )
+ if ( !xPackage.is() )
return false;
- if ( !IsSharedPkgMgr( xPackageManager ) || m_bDeleteWarning )
+ if ( !IsSharedPkgMgr( xPackage ) || m_bDeleteWarning )
{
if ( ! removeExtensionWarn( xPackage->getDisplayName() ) )
return false;
}
- if ( ! continueOnSharedExtension( xPackageManager, this, RID_WARNINGBOX_REMOVE_SHARED_EXTENSION, m_bDeleteWarning ) )
+ if ( ! continueOnSharedExtension( xPackage, this, RID_WARNINGBOX_REMOVE_SHARED_EXTENSION, m_bDeleteWarning ) )
return false;
- m_pManager->removePackage( xPackageManager, xPackage );
+ m_pManager->getCmdQueue()->removeExtension( xPackage );
return true;
}
//------------------------------------------------------------------------------
-bool ExtMgrDialog::updatePackage( const uno::Reference< deployment::XPackageManager > &xPackageManager,
- const uno::Reference< deployment::XPackage > &xPackage )
+bool ExtMgrDialog::updatePackage( const uno::Reference< deployment::XPackage > &xPackage )
{
- if ( !xPackageManager.is() || !xPackage.is() )
+ if ( !xPackage.is() )
return false;
- std::vector< TUpdateListEntry > vEntries;
- TUpdateListEntry pEntry( new UpdateListEntry( xPackage, xPackageManager ) );
- vEntries.push_back( pEntry );
+ // get the extension with highest version
+ uno::Sequence<uno::Reference<deployment::XPackage> > seqExtensions =
+ m_pManager->getExtensionManager()->getExtensionsWithSameIdentifier(
+ dp_misc::getIdentifier(xPackage), xPackage->getName(), uno::Reference<ucb::XCommandEnvironment>());
+ uno::Reference<deployment::XPackage> extension =
+ dp_misc::getExtensionWithHighestVersion(seqExtensions);
+ OSL_ASSERT(extension.is());
+ std::vector< css::uno::Reference< css::deployment::XPackage > > vEntries;
+ vEntries.push_back(extension);
- m_pManager->updatePackages( vEntries );
+ m_pManager->getCmdQueue()->checkForUpdates( vEntries );
return true;
}
//------------------------------------------------------------------------------
-uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker( const uno::Reference< deployment::XPackageManager > &xPackageManager )
+bool ExtMgrDialog::acceptLicense( const uno::Reference< deployment::XPackage > &xPackage )
+{
+ if ( !xPackage.is() )
+ return false;
+
+ m_pManager->getCmdQueue()->acceptLicense( xPackage );
+
+ return true;
+}
+
+//------------------------------------------------------------------------------
+uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker()
{
const uno::Any mode( static_cast< sal_Int16 >( ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE ) );
const uno::Reference< uno::XComponentContext > xContext( m_pManager->getContext() );
@@ -884,7 +886,8 @@ uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker( const uno::Reference< de
t_string2string title2filter;
OUString sDefaultFilter( StrAllFiles::get() );
- const uno::Sequence< uno::Reference< deployment::XPackageTypeInfo > > packageTypes( xPackageManager->getSupportedPackageTypes() );
+ const uno::Sequence< uno::Reference< deployment::XPackageTypeInfo > > packageTypes(
+ m_pManager->getExtensionManager()->getSupportedPackageTypes() );
for ( sal_Int32 pos = 0; pos < packageTypes.getLength(); ++pos )
{
@@ -1038,8 +1041,7 @@ IMPL_LINK( ExtMgrDialog, HandleAddBtn, void*, EMPTYARG )
{
setBusy( true );
- uno::Reference< deployment::XPackageManager > xUserPkgMgr = m_pManager->getUserPkgMgr();
- uno::Sequence< OUString > aFileList = raiseAddPicker( xUserPkgMgr );
+ uno::Sequence< OUString > aFileList = raiseAddPicker();
if ( aFileList.getLength() )
{
@@ -1310,23 +1312,22 @@ UpdateRequiredDialog::~UpdateRequiredDialog()
//------------------------------------------------------------------------------
long UpdateRequiredDialog::addPackageToList( const uno::Reference< deployment::XPackage > &xPackage,
- const uno::Reference< deployment::XPackageManager > &xPackageManager )
+ bool bLicenseMissing )
{
// We will only add entries to the list with unsatisfied dependencies
- if ( !checkDependencies( xPackage ) )
+ if ( !bLicenseMissing && !checkDependencies( xPackage ) )
{
- m_bHasLockedEntries |= (bool) xPackageManager->isReadOnly();
+ m_bHasLockedEntries |= m_pManager->isReadOnly( xPackage );
m_aUpdateBtn.Enable( true );
- return m_pExtensionBox->addEntry( xPackage, xPackageManager );
+ return m_pExtensionBox->addEntry( xPackage );
}
return 0;
}
//------------------------------------------------------------------------------
-void UpdateRequiredDialog::prepareChecking( const uno::Reference< deployment::XPackageManager > &xPackageManager )
+void UpdateRequiredDialog::prepareChecking()
{
- if ( xPackageManager.is() )
- m_pExtensionBox->prepareChecking( xPackageManager );
+ m_pExtensionBox->prepareChecking();
}
//------------------------------------------------------------------------------
@@ -1343,11 +1344,10 @@ void UpdateRequiredDialog::checkEntries()
}
//------------------------------------------------------------------------------
-bool UpdateRequiredDialog::enablePackage( const uno::Reference< deployment::XPackageManager > &,
- const uno::Reference< deployment::XPackage > &xPackage,
- bool bEnable )
+bool UpdateRequiredDialog::enablePackage( const uno::Reference< deployment::XPackage > &xPackage,
+ bool bEnable )
{
- m_pManager->enablePackage( xPackage, bEnable );
+ m_pManager->getCmdQueue()->enableExtension( xPackage, bEnable );
return true;
}
@@ -1463,20 +1463,18 @@ IMPL_LINK( UpdateRequiredDialog, HandleUpdateBtn, void*, EMPTYARG )
{
::osl::ClearableMutexGuard aGuard( m_aMutex );
- std::vector< TUpdateListEntry > vUpdateEntries;
+ std::vector< uno::Reference< deployment::XPackage > > vUpdateEntries;
sal_Int32 nCount = m_pExtensionBox->GetEntryCount();
for ( sal_Int32 i = 0; i < nCount; ++i )
{
TEntry_Impl pEntry = m_pExtensionBox->GetEntryData( i );
- TUpdateListEntry pUpdateEntry( new UpdateListEntry( pEntry->m_xPackage,
- pEntry->m_xPackageManager ) );
- vUpdateEntries.push_back( pUpdateEntry );
+ vUpdateEntries.push_back( pEntry->m_xPackage );
}
aGuard.clear();
- m_pManager->updatePackages( vUpdateEntries );
+ m_pManager->getCmdQueue()->checkForUpdates( vUpdateEntries );
return 1;
}
@@ -1731,7 +1729,7 @@ void UpdateRequiredDialog::disableAllEntries()
for ( long nIndex = 0; nIndex < nCount; nIndex++ )
{
TEntry_Impl pEntry = m_pExtensionBox->GetEntryData( nIndex );
- enablePackage( pEntry->m_xPackageManager, pEntry->m_xPackage, false );
+ enablePackage( pEntry->m_xPackage, false );
}
setBusy( false );
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
index d5e939ace8a9..f0a85cce98c0 100644..100755
--- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
@@ -46,7 +46,6 @@
#include "com/sun/star/awt/XWindow.hpp"
#include "com/sun/star/deployment/XPackage.hpp"
-#include "com/sun/star/deployment/XPackageManager.hpp"
#include "com/sun/star/uno/XComponentContext.hpp"
#include "com/sun/star/ui/dialogs/XExecutableDialog.hpp"
#include "com/sun/star/util/XModifyListener.hpp"
@@ -82,16 +81,16 @@ public:
virtual void updateProgress( const long nProgress ) = 0;
virtual void updatePackageInfo( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage ) = 0;
- virtual long addPackageToList( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &,
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > & ) = 0;
+ virtual long addPackageToList( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage,
+ bool bLicenseMissing = false ) = 0;
- virtual void prepareChecking( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager ) = 0;
+ virtual void prepareChecking() = 0;
virtual void checkEntries() = 0;
static ResId getResId( USHORT nId );
static String getResourceString( USHORT id );
- static bool IsSharedPkgMgr( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &);
- static bool continueOnSharedExtension( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &,
+ static bool IsSharedPkgMgr( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &);
+ static bool continueOnSharedExtension( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &,
Window *pParent,
const USHORT nResID,
bool &bHadWarning );
@@ -160,19 +159,17 @@ public:
void setGetExtensionsURL( const ::rtl::OUString &rURL );
virtual long addPackageToList( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &,
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > & );
- bool enablePackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager,
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage,
+ bool bLicenseMissing = false );
+ bool enablePackage(const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage,
bool bEnable );
- bool removePackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager,
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
- bool updatePackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager,
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
+ bool removePackage(const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
+ bool updatePackage(const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
+ bool acceptLicense(const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
- virtual void prepareChecking( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
+ virtual void prepareChecking();
virtual void checkEntries();
- ::com::sun::star::uno::Sequence< ::rtl::OUString > raiseAddPicker( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > raiseAddPicker();
};
//==============================================================================
@@ -235,17 +232,14 @@ public:
void selectEntry( long nPos );
virtual long addPackageToList( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &,
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > & );
- bool enablePackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager,
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage,
- bool bEnable );
- bool updatePackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager,
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
+ bool bLicenseMissing = false );
+ bool enablePackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage, bool bEnable );
+ bool updatePackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
- virtual void prepareChecking( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
+ virtual void prepareChecking();
virtual void checkEntries();
- ::com::sun::star::uno::Sequence< ::rtl::OUString > raiseAddPicker( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > raiseAddPicker();
bool installForAllUsers( bool &bInstallForAll ) const;
bool installExtensionWarn( const ::rtl::OUString &rExtensionURL ) const;
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.src b/desktop/source/deployment/gui/dp_gui_dialog2.src
index d55421d50d75..7c47365999a0 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.src
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.src
@@ -165,11 +165,21 @@ Image RID_IMG_WARNING_HC
Image RID_IMG_LOCKED
{
- ImageBitmap = Bitmap { File = "shared_16.png"; };
+ ImageBitmap = Bitmap { File = "lock_16.png"; };
};
Image RID_IMG_LOCKED_HC
{
+ ImageBitmap = Bitmap { File = "lock_16_h.png"; };
+};
+
+Image RID_IMG_SHARED
+{
+ ImageBitmap = Bitmap { File = "shared_16.png"; };
+};
+
+Image RID_IMG_SHARED_HC
+{
ImageBitmap = Bitmap { File = "shared_16_h.png"; };
};
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index 58a5ab1c19ea..8bd8a6191201 100644..100755
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -36,10 +36,10 @@
#include <cstddef>
#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/beans/NamedValue.hpp"
#include "com/sun/star/deployment/DependencyException.hpp"
#include "com/sun/star/deployment/LicenseException.hpp"
-#include "com/sun/star/deployment/LicenseIndividualAgreementException.hpp"
#include "com/sun/star/deployment/VersionException.hpp"
#include "com/sun/star/deployment/InstallException.hpp"
#include "com/sun/star/deployment/PlatformException.hpp"
@@ -48,7 +48,6 @@
#include "com/sun/star/deployment/DeploymentException.hpp"
#include "com/sun/star/deployment/UpdateInformationProvider.hpp"
#include "com/sun/star/deployment/XPackage.hpp"
-#include "com/sun/star/deployment/XPackageManager.hpp"
#include "com/sun/star/task/XAbortChannel.hpp"
#include "com/sun/star/task/XInteractionAbort.hpp"
@@ -77,6 +76,7 @@
#include "comphelper/anytostring.hxx"
#include "vcl/msgbox.hxx"
#include "toolkit/helper/vclunohelper.hxx"
+#include "comphelper/processfactory.hxx"
#include "dp_gui.h"
#include "dp_gui_thread.hxx"
@@ -110,12 +110,15 @@ using ::rtl::OUString;
namespace {
-OUString getVersion( const uno::Reference< deployment::XPackage > &rPackage )
+OUString getVersion( OUString const & sVersion )
{
- OUString sVersion( rPackage->getVersion());
return ( sVersion.getLength() == 0 ) ? OUString( RTL_CONSTASCII_USTRINGPARAM( "0" ) ) : sVersion;
}
+OUString getVersion( const uno::Reference< deployment::XPackage > &rPackage )
+{
+ return getVersion( rPackage->getVersion());
+}
}
@@ -193,37 +196,30 @@ public:
//------------------------------------------------------------------------------
struct ExtensionCmd
{
- enum E_CMD_TYPE { ADD, ENABLE, DISABLE, REMOVE, CHECK_FOR_UPDATES };
+ enum E_CMD_TYPE { ADD, ENABLE, DISABLE, REMOVE, CHECK_FOR_UPDATES, ACCEPT_LICENSE };
E_CMD_TYPE m_eCmdType;
bool m_bWarnUser;
OUString m_sExtensionURL;
- uno::Reference< deployment::XPackageManager > m_xPackageManager;
- uno::Reference< deployment::XPackage > m_xPackage;
- std::vector< TUpdateListEntry > m_vExtensionList;
+ OUString m_sRepository;
+ uno::Reference< deployment::XPackage > m_xPackage;
+ std::vector< uno::Reference< deployment::XPackage > > m_vExtensionList;
ExtensionCmd( const E_CMD_TYPE eCommand,
- const uno::Reference< deployment::XPackageManager > &rPackageManager,
const OUString &rExtensionURL,
+ const OUString &rRepository,
const bool bWarnUser )
: m_eCmdType( eCommand ),
m_bWarnUser( bWarnUser ),
m_sExtensionURL( rExtensionURL ),
- m_xPackageManager( rPackageManager ) {};
+ m_sRepository( rRepository ) {};
ExtensionCmd( const E_CMD_TYPE eCommand,
- const uno::Reference< deployment::XPackageManager > &rPackageManager,
const uno::Reference< deployment::XPackage > &rPackage )
: m_eCmdType( eCommand ),
m_bWarnUser( false ),
- m_xPackageManager( rPackageManager ),
m_xPackage( rPackage ) {};
ExtensionCmd( const E_CMD_TYPE eCommand,
- const uno::Reference< deployment::XPackage > &rPackage )
- : m_eCmdType( eCommand ),
- m_bWarnUser( false ),
- m_xPackage( rPackage ) {};
- ExtensionCmd( const E_CMD_TYPE eCommand,
- const std::vector< TUpdateListEntry > &vExtensionList )
+ const std::vector<uno::Reference<deployment::XPackage > > &vExtensionList )
: m_eCmdType( eCommand ),
m_bWarnUser( false ),
m_vExtensionList( vExtensionList ) {};
@@ -239,14 +235,14 @@ public:
TheExtensionManager *pManager,
const uno::Reference< uno::XComponentContext > & rContext );
- void addExtension( const uno::Reference< deployment::XPackageManager > &rPackageManager,
- const OUString &rExtensionURL,
+ void addExtension( const OUString &rExtensionURL,
+ const OUString &rRepository,
const bool bWarnUser );
- void removeExtension( const uno::Reference< deployment::XPackageManager > &rPackageManager,
- const uno::Reference< deployment::XPackage > &rPackage );
+ void removeExtension( const uno::Reference< deployment::XPackage > &rPackage );
void enableExtension( const uno::Reference< deployment::XPackage > &rPackage,
const bool bEnable );
- void checkForUpdates( const std::vector< TUpdateListEntry > &vExtensionList );
+ void checkForUpdates( const std::vector<uno::Reference<deployment::XPackage > > &vExtensionList );
+ void acceptLicense( const uno::Reference< deployment::XPackage > &rPackage );
void stop();
bool isBusy();
@@ -263,17 +259,18 @@ private:
virtual void SAL_CALL onTerminated();
void _addExtension( ::rtl::Reference< ProgressCmdEnv > &rCmdEnv,
- const uno::Reference< deployment::XPackageManager > &xPackageManager,
const OUString &rPackageURL,
+ const OUString &rRepository,
const bool bWarnUser );
void _removeExtension( ::rtl::Reference< ProgressCmdEnv > &rCmdEnv,
- const uno::Reference< deployment::XPackageManager > &xPackageManager,
const uno::Reference< deployment::XPackage > &xPackage );
void _enableExtension( ::rtl::Reference< ProgressCmdEnv > &rCmdEnv,
const uno::Reference< deployment::XPackage > &xPackage );
void _disableExtension( ::rtl::Reference< ProgressCmdEnv > &rCmdEnv,
const uno::Reference< deployment::XPackage > &xPackage );
- void _checkForUpdates( const std::vector< TUpdateListEntry > &vExtensionList );
+ void _checkForUpdates( const std::vector<uno::Reference<deployment::XPackage > > &vExtensionList );
+ void _acceptLicense( ::rtl::Reference< ProgressCmdEnv > &rCmdEnv,
+ const uno::Reference< deployment::XPackage > &xPackage );
enum Input { NONE, START, STOP };
@@ -288,6 +285,7 @@ private:
const OUString m_sAddingPackages;
const OUString m_sRemovingPackages;
const OUString m_sDefaultCmd;
+ const OUString m_sAcceptLicense;
osl::Condition m_wakeup;
osl::Mutex m_mutex;
Input m_eInput;
@@ -376,7 +374,6 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
lang::WrappedTargetException wtExc;
deployment::DependencyException depExc;
deployment::LicenseException licExc;
- deployment::LicenseIndividualAgreementException licAgreementExc;
deployment::VersionException verExc;
deployment::InstallException instExc;
deployment::PlatformException platExc;
@@ -438,23 +435,12 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
|| (n == RET_CANCEL && !Application::IsDialogCancelEnabled());
}
}
- else if (request >>= licAgreementExc)
- {
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
- ResId warnId(WARNINGBOX_NOSHAREDALLOWED, *DeploymentGuiResMgr::get());
- WarningBox warn( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, warnId);
- String msgText = warn.GetMessText();
- msgText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
- msgText.SearchAndReplaceAllAscii("%NAME", licAgreementExc.ExtensionName);
- warn.SetMessText(msgText);
- warn.Execute();
- abort = true;
- }
else if (request >>= licExc)
{
uno::Reference< ui::dialogs::XExecutableDialog > xDialog(
deployment::ui::LicenseDialog::create(
- m_xContext, VCLUnoHelper::GetInterface( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL ), licExc.Text ) );
+ m_xContext, VCLUnoHelper::GetInterface( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL ),
+ licExc.ExtensionName, licExc.Text ) );
sal_Int16 res = xDialog->execute();
if ( res == ui::dialogs::ExecutableDialogResults::CANCEL )
abort = true;
@@ -468,7 +454,8 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
else if (request >>= verExc)
{
sal_uInt32 id;
- switch (dp_misc::comparePackageVersions( verExc.New, verExc.Deployed ))
+ switch (dp_misc::compareVersions(
+ verExc.NewVersion, verExc.Deployed->getVersion() ))
{
case dp_misc::LESS:
id = RID_WARNINGBOX_VERSION_LESS;
@@ -480,8 +467,8 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
id = RID_WARNINGBOX_VERSION_GREATER;
break;
}
- OSL_ASSERT( verExc.New.is() && verExc.Deployed.is() );
- bool bEqualNames = verExc.New->getDisplayName().equals(
+ OSL_ASSERT( verExc.Deployed.is() );
+ bool bEqualNames = verExc.NewDisplayName.equals(
verExc.Deployed->getDisplayName());
{
vos::OGuard guard(Application::GetSolarMutex());
@@ -506,9 +493,9 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
{
s = String(ResId(RID_STR_WARNINGBOX_VERSION_GREATER_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
}
- s.SearchAndReplaceAllAscii( "$NAME", verExc.New->getDisplayName());
+ s.SearchAndReplaceAllAscii( "$NAME", verExc.NewDisplayName);
s.SearchAndReplaceAllAscii( "$OLDNAME", verExc.Deployed->getDisplayName());
- s.SearchAndReplaceAllAscii( "$NEW", getVersion(verExc.New) );
+ s.SearchAndReplaceAllAscii( "$NEW", getVersion(verExc.NewVersion) );
s.SearchAndReplaceAllAscii( "$DEPLOYED", getVersion(verExc.Deployed) );
box.SetMessText(s);
approve = box.Execute() == RET_OK;
@@ -527,7 +514,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
{
vos::OGuard guard(Application::GetSolarMutex());
- approve = m_pDialogHelper->installExtensionWarn( instExc.New->getDisplayName() );
+ approve = m_pDialogHelper->installExtensionWarn( instExc.displayName );
}
else
approve = false;
@@ -644,6 +631,7 @@ ExtensionCmdQueue::Thread::Thread( DialogHelper *pDialogHelper,
m_sAddingPackages( DialogHelper::getResourceString( RID_STR_ADDING_PACKAGES ) ),
m_sRemovingPackages( DialogHelper::getResourceString( RID_STR_REMOVING_PACKAGES ) ),
m_sDefaultCmd( DialogHelper::getResourceString( RID_STR_ADD_PACKAGES ) ),
+ m_sAcceptLicense( DialogHelper::getResourceString( RID_STR_ACCEPT_LICENSE ) ),
m_eInput( NONE ),
m_bTerminated( false ),
m_bStopped( false ),
@@ -653,8 +641,8 @@ ExtensionCmdQueue::Thread::Thread( DialogHelper *pDialogHelper,
}
//------------------------------------------------------------------------------
-void ExtensionCmdQueue::Thread::addExtension( const uno::Reference< deployment::XPackageManager > &rPackageManager,
- const ::rtl::OUString &rExtensionURL,
+void ExtensionCmdQueue::Thread::addExtension( const ::rtl::OUString &rExtensionURL,
+ const ::rtl::OUString &rRepository,
const bool bWarnUser )
{
::osl::MutexGuard aGuard( m_mutex );
@@ -665,7 +653,26 @@ void ExtensionCmdQueue::Thread::addExtension( const uno::Reference< deployment::
if ( rExtensionURL.getLength() )
{
- TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::ADD, rPackageManager, rExtensionURL, bWarnUser ) );
+ TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::ADD, rExtensionURL, rRepository, bWarnUser ) );
+
+ m_queue.push( pEntry );
+ m_eInput = START;
+ m_wakeup.set();
+ }
+}
+
+//------------------------------------------------------------------------------
+void ExtensionCmdQueue::Thread::removeExtension( const uno::Reference< deployment::XPackage > &rPackage )
+{
+ ::osl::MutexGuard aGuard( m_mutex );
+
+ //If someone called stop then we do not remove the extension -> game over!
+ if ( m_bStopped )
+ return;
+
+ if ( rPackage.is() )
+ {
+ TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::REMOVE, rPackage ) );
m_queue.push( pEntry );
m_eInput = START;
@@ -674,8 +681,7 @@ void ExtensionCmdQueue::Thread::addExtension( const uno::Reference< deployment::
}
//------------------------------------------------------------------------------
-void ExtensionCmdQueue::Thread::removeExtension( const uno::Reference< deployment::XPackageManager > &rPackageManager,
- const uno::Reference< deployment::XPackage > &rPackage )
+void ExtensionCmdQueue::Thread::acceptLicense( const uno::Reference< deployment::XPackage > &rPackage )
{
::osl::MutexGuard aGuard( m_mutex );
@@ -683,9 +689,9 @@ void ExtensionCmdQueue::Thread::removeExtension( const uno::Reference< deploymen
if ( m_bStopped )
return;
- if ( rPackageManager.is() && rPackage.is() )
+ if ( rPackage.is() )
{
- TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::REMOVE, rPackageManager, rPackage ) );
+ TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::ACCEPT_LICENSE, rPackage ) );
m_queue.push( pEntry );
m_eInput = START;
@@ -715,7 +721,8 @@ void ExtensionCmdQueue::Thread::enableExtension( const uno::Reference< deploymen
}
//------------------------------------------------------------------------------
-void ExtensionCmdQueue::Thread::checkForUpdates( const std::vector< TUpdateListEntry > &vExtensionList )
+void ExtensionCmdQueue::Thread::checkForUpdates(
+ const std::vector<uno::Reference<deployment::XPackage > > &vExtensionList )
{
::osl::MutexGuard aGuard( m_mutex );
@@ -819,10 +826,10 @@ void ExtensionCmdQueue::Thread::execute()
switch ( pEntry->m_eCmdType ) {
case ExtensionCmd::ADD :
- _addExtension( currentCmdEnv, pEntry->m_xPackageManager, pEntry->m_sExtensionURL, pEntry->m_bWarnUser );
+ _addExtension( currentCmdEnv, pEntry->m_sExtensionURL, pEntry->m_sRepository, pEntry->m_bWarnUser );
break;
case ExtensionCmd::REMOVE :
- _removeExtension( currentCmdEnv, pEntry->m_xPackageManager, pEntry->m_xPackage );
+ _removeExtension( currentCmdEnv, pEntry->m_xPackage );
break;
case ExtensionCmd::ENABLE :
_enableExtension( currentCmdEnv, pEntry->m_xPackage );
@@ -833,6 +840,9 @@ void ExtensionCmdQueue::Thread::execute()
case ExtensionCmd::CHECK_FOR_UPDATES :
_checkForUpdates( pEntry->m_vExtensionList );
break;
+ case ExtensionCmd::ACCEPT_LICENSE :
+ _acceptLicense( currentCmdEnv, pEntry->m_xPackage );
+ break;
}
}
//catch ( deployment::DeploymentException &)
@@ -912,8 +922,8 @@ void ExtensionCmdQueue::Thread::execute()
//------------------------------------------------------------------------------
void ExtensionCmdQueue::Thread::_addExtension( ::rtl::Reference< ProgressCmdEnv > &rCmdEnv,
- const uno::Reference< deployment::XPackageManager > &xPackageManager,
const OUString &rPackageURL,
+ const OUString &rRepository,
const bool bWarnUser )
{
//check if we have a string in anyTitle. For example "unopkg gui \" caused anyTitle to be void
@@ -936,17 +946,16 @@ void ExtensionCmdQueue::Thread::_addExtension( ::rtl::Reference< ProgressCmdEnv
}
rCmdEnv->setWarnUser( bWarnUser );
- uno::Reference< task::XAbortChannel > xAbortChannel( xPackageManager->createAbortChannel() );
+ uno::Reference< deployment::XExtensionManager > xExtMgr = m_pManager->getExtensionManager();
+ uno::Reference< task::XAbortChannel > xAbortChannel( xExtMgr->createAbortChannel() );
OUString sTitle = searchAndReplaceAll( m_sAddingPackages, OUSTR("%EXTENSION_NAME"), sName );
rCmdEnv->progressSection( sTitle, xAbortChannel );
try
{
- uno::Reference< deployment::XPackage > xPackage( xPackageManager->addPackage(
- rPackageURL, OUString() /* detect media-type */,
- xAbortChannel, rCmdEnv.get() ) );
- OSL_ASSERT( xPackage.is() );
- }
+ xExtMgr->addExtension(rPackageURL, uno::Sequence<beans::NamedValue>(),
+ rRepository, xAbortChannel, rCmdEnv.get() );
+ }
catch ( ucb::CommandFailedException & )
{
// When the extension is already installed we'll get a dialog asking if we want to overwrite. If we then press
@@ -962,18 +971,22 @@ void ExtensionCmdQueue::Thread::_addExtension( ::rtl::Reference< ProgressCmdEnv
//------------------------------------------------------------------------------
void ExtensionCmdQueue::Thread::_removeExtension( ::rtl::Reference< ProgressCmdEnv > &rCmdEnv,
- const uno::Reference< deployment::XPackageManager > &xPackageManager,
const uno::Reference< deployment::XPackage > &xPackage )
{
- uno::Reference< task::XAbortChannel > xAbortChannel( xPackageManager->createAbortChannel() );
+ uno::Reference< deployment::XExtensionManager > xExtMgr = m_pManager->getExtensionManager();
+ uno::Reference< task::XAbortChannel > xAbortChannel( xExtMgr->createAbortChannel() );
OUString sTitle = searchAndReplaceAll( m_sRemovingPackages, OUSTR("%EXTENSION_NAME"), xPackage->getDisplayName() );
rCmdEnv->progressSection( sTitle, xAbortChannel );
OUString id( dp_misc::getIdentifier( xPackage ) );
try
{
- xPackageManager->removePackage( id, xPackage->getName(), xAbortChannel, rCmdEnv.get() );
+ xExtMgr->removeExtension( id, xPackage->getName(), xPackage->getRepositoryName(), xAbortChannel, rCmdEnv.get() );
}
+ catch ( deployment::DeploymentException & )
+ {}
+ catch ( ucb::CommandFailedException & )
+ {}
catch ( ucb::CommandAbortedException & )
{}
@@ -983,7 +996,8 @@ void ExtensionCmdQueue::Thread::_removeExtension( ::rtl::Reference< ProgressCmdE
}
//------------------------------------------------------------------------------
-void ExtensionCmdQueue::Thread::_checkForUpdates( const std::vector< TUpdateListEntry > &vExtensionList )
+void ExtensionCmdQueue::Thread::_checkForUpdates(
+ const std::vector<uno::Reference<deployment::XPackage > > &vExtensionList )
{
UpdateDialog* pUpdateDialog;
std::vector< UpdateData > vData;
@@ -1042,13 +1056,14 @@ void ExtensionCmdQueue::Thread::_enableExtension( ::rtl::Reference< ProgressCmdE
if ( !xPackage.is() )
return;
- uno::Reference< task::XAbortChannel > xAbortChannel( xPackage->createAbortChannel() );
+ uno::Reference< deployment::XExtensionManager > xExtMgr = m_pManager->getExtensionManager();
+ uno::Reference< task::XAbortChannel > xAbortChannel( xExtMgr->createAbortChannel() );
OUString sTitle = searchAndReplaceAll( m_sEnablingPackages, OUSTR("%EXTENSION_NAME"), xPackage->getDisplayName() );
rCmdEnv->progressSection( sTitle, xAbortChannel );
try
{
- xPackage->registerPackage( xAbortChannel, rCmdEnv.get() );
+ xExtMgr->enableExtension( xPackage, xAbortChannel, rCmdEnv.get() );
if ( m_pDialogHelper )
m_pDialogHelper->updatePackageInfo( xPackage );
}
@@ -1063,13 +1078,36 @@ void ExtensionCmdQueue::Thread::_disableExtension( ::rtl::Reference< ProgressCmd
if ( !xPackage.is() )
return;
- uno::Reference< task::XAbortChannel > xAbortChannel( xPackage->createAbortChannel() );
+ uno::Reference< deployment::XExtensionManager > xExtMgr = m_pManager->getExtensionManager();
+ uno::Reference< task::XAbortChannel > xAbortChannel( xExtMgr->createAbortChannel() );
OUString sTitle = searchAndReplaceAll( m_sDisablingPackages, OUSTR("%EXTENSION_NAME"), xPackage->getDisplayName() );
rCmdEnv->progressSection( sTitle, xAbortChannel );
try
{
- xPackage->revokePackage( xAbortChannel, rCmdEnv.get() );
+ xExtMgr->disableExtension( xPackage, xAbortChannel, rCmdEnv.get() );
+ if ( m_pDialogHelper )
+ m_pDialogHelper->updatePackageInfo( xPackage );
+ }
+ catch ( ::ucb::CommandAbortedException & )
+ {}
+}
+
+//------------------------------------------------------------------------------
+void ExtensionCmdQueue::Thread::_acceptLicense( ::rtl::Reference< ProgressCmdEnv > &rCmdEnv,
+ const uno::Reference< deployment::XPackage > &xPackage )
+{
+ if ( !xPackage.is() )
+ return;
+
+ uno::Reference< deployment::XExtensionManager > xExtMgr = m_pManager->getExtensionManager();
+ uno::Reference< task::XAbortChannel > xAbortChannel( xExtMgr->createAbortChannel() );
+ OUString sTitle = searchAndReplaceAll( m_sAcceptLicense, OUSTR("%EXTENSION_NAME"), xPackage->getDisplayName() );
+ rCmdEnv->progressSection( sTitle, xAbortChannel );
+
+ try
+ {
+ xExtMgr->checkPrerequisitesAndEnable( xPackage, xAbortChannel, rCmdEnv.get() );
if ( m_pDialogHelper )
m_pDialogHelper->updatePackageInfo( xPackage );
}
@@ -1120,17 +1158,16 @@ ExtensionCmdQueue::~ExtensionCmdQueue() {
stop();
}
-void ExtensionCmdQueue::addExtension( const uno::Reference< deployment::XPackageManager > &rPackageManager,
- const ::rtl::OUString & extensionURL,
+void ExtensionCmdQueue::addExtension( const ::rtl::OUString & extensionURL,
+ const ::rtl::OUString & repository,
const bool bWarnUser )
{
- m_thread->addExtension( rPackageManager, extensionURL, bWarnUser );
+ m_thread->addExtension( extensionURL, repository, bWarnUser );
}
-void ExtensionCmdQueue::removeExtension( const uno::Reference< deployment::XPackageManager > &rPackageManager,
- const uno::Reference< deployment::XPackage > &rPackage )
+void ExtensionCmdQueue::removeExtension( const uno::Reference< deployment::XPackage > &rPackage )
{
- m_thread->removeExtension( rPackageManager, rPackage );
+ m_thread->removeExtension( rPackage );
}
void ExtensionCmdQueue::enableExtension( const uno::Reference< deployment::XPackage > &rPackage,
@@ -1139,11 +1176,21 @@ void ExtensionCmdQueue::enableExtension( const uno::Reference< deployment::XPack
m_thread->enableExtension( rPackage, bEnable );
}
-void ExtensionCmdQueue::checkForUpdates( const std::vector< TUpdateListEntry > &vExtensionList )
+void ExtensionCmdQueue::checkForUpdates( const std::vector<uno::Reference<deployment::XPackage > > &vExtensionList )
{
m_thread->checkForUpdates( vExtensionList );
}
+void ExtensionCmdQueue::acceptLicense( const uno::Reference< deployment::XPackage > &rPackage )
+{
+ m_thread->acceptLicense( rPackage );
+}
+
+void ExtensionCmdQueue::syncRepositories( const uno::Reference< uno::XComponentContext > &xContext )
+{
+ dp_misc::syncRepositories( new ProgressCmdEnv( xContext, NULL, OUSTR("Extension Manager") ) );
+}
+
void ExtensionCmdQueue::stop()
{
m_thread->stop();
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx
index f984c71c6c1c..7ac00e2740d4 100644..100755
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx
@@ -40,7 +40,6 @@
/// @HTML
namespace com { namespace sun { namespace star {
- namespace deployment { class XPackageManager; }
namespace task { class XInteractionRequest; }
namespace uno { class XComponentContext; }
} } }
@@ -78,14 +77,16 @@ public:
/**
*/
- void addExtension( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &rPackageManager,
- const ::rtl::OUString &rExtensionURL,
+ void addExtension( const ::rtl::OUString &rExtensionURL,
+ const ::rtl::OUString &rRepository,
const bool bWarnUser );
- void removeExtension( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &rPackageManager,
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &rPackage );
+ void removeExtension( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &rPackage );
void enableExtension( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &rPackage,
const bool bEnable );
- void checkForUpdates( const std::vector< TUpdateListEntry > &vList );
+ void checkForUpdates(const std::vector< ::com::sun::star::uno::Reference<
+ ::com::sun::star::deployment::XPackage > > &vList );
+ void acceptLicense( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &rPackage );
+ static void syncRepositories( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & xContext );
/**
This call does not block. It signals the internal thread
that it should install the remaining extensions and then terminate.
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index 2e02a90f59fd..24b47aa223e3 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -44,6 +44,10 @@
#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
+#define USER_PACKAGE_MANAGER OUSTR("user")
+#define SHARED_PACKAGE_MANAGER OUSTR("shared")
+#define BUNDLED_PACKAGE_MANAGER OUSTR("bundled")
+
using namespace ::com::sun::star;
namespace dp_gui {
@@ -52,19 +56,20 @@ namespace dp_gui {
// struct Entry_Impl
//------------------------------------------------------------------------------
Entry_Impl::Entry_Impl( const uno::Reference< deployment::XPackage > &xPackage,
- const uno::Reference< deployment::XPackageManager > &xPackageManager,
- PackageState eState ) :
+ const PackageState eState, const bool bReadOnly ) :
m_bActive( false ),
- m_bLocked( false ),
+ m_bLocked( bReadOnly ),
m_bHasOptions( false ),
+ m_bUser( false ),
m_bShared( false ),
m_bNew( false ),
m_bChecked( false ),
m_bMissingDeps( false ),
+ m_bHasButtons( false ),
+ m_bMissingLic( false ),
m_eState( eState ),
m_pPublisher( NULL ),
- m_xPackage( xPackage ),
- m_xPackageManager( xPackageManager )
+ m_xPackage( xPackage )
{
m_sTitle = xPackage->getDisplayName();
m_sVersion = xPackage->getVersion();
@@ -85,8 +90,6 @@ Entry_Impl::Entry_Impl( const uno::Reference< deployment::XPackage > &xPackage,
else
m_aIconHC = m_aIcon;
- m_bLocked = m_xPackageManager->isReadOnly();
-
if ( eState == AMBIGUOUS )
m_sErrorText = DialogHelper::getResourceString( RID_STR_ERROR_UNKNOWN_STATUS );
else if ( eState == NOT_REGISTERED )
@@ -106,14 +109,11 @@ StringCompare Entry_Impl::CompareTo( const CollatorWrapper *pCollator, const TEn
eCompare = m_sVersion.CompareTo( pEntry->m_sVersion );
if ( eCompare == COMPARE_EQUAL )
{
- if ( m_xPackageManager != pEntry->m_xPackageManager )
- {
- sal_Int32 nCompare = m_xPackageManager->getContext().compareTo( pEntry->m_xPackageManager->getContext() );
- if ( nCompare < 0 )
- eCompare = COMPARE_LESS;
- else if ( nCompare > 0 )
- eCompare = COMPARE_GREATER;
- }
+ sal_Int32 nCompare = m_xPackage->getRepositoryName().compareTo( pEntry->m_xPackage->getRepositoryName() );
+ if ( nCompare < 0 )
+ eCompare = COMPARE_LESS;
+ else if ( nCompare > 0 )
+ eCompare = COMPARE_GREATER;
}
}
return eCompare;
@@ -177,6 +177,8 @@ ExtensionBox_Impl::ExtensionBox_Impl( Dialog* pParent, TheExtensionManager *pMan
m_nTopIndex( 0 ),
m_nActiveHeight( 0 ),
m_nExtraHeight( 2 ),
+ m_aSharedImage( DialogHelper::getResId( RID_IMG_SHARED ) ),
+ m_aSharedImageHC( DialogHelper::getResId( RID_IMG_SHARED_HC ) ),
m_aLockedImage( DialogHelper::getResId( RID_IMG_LOCKED ) ),
m_aLockedImageHC( DialogHelper::getResId( RID_IMG_LOCKED_HC ) ),
m_aWarningImage( DialogHelper::getResId( RID_IMG_WARNING ) ),
@@ -371,6 +373,8 @@ void ExtensionBox_Impl::CalcActiveHeight( const long nPos )
aSize.Height() = 10000;
rtl::OUString aText( m_vEntries[ nPos ]->m_sErrorText );
+ if ( aText.getLength() )
+ aText += OUSTR("\n");
aText += m_vEntries[ nPos ]->m_sDescription;
Rectangle aRect = GetTextRect( Rectangle( Point(), aSize ), aText,
@@ -380,7 +384,10 @@ void ExtensionBox_Impl::CalcActiveHeight( const long nPos )
if ( aTextHeight < m_nStdHeight )
aTextHeight = m_nStdHeight;
- m_nActiveHeight = aTextHeight + m_nExtraHeight;
+ if ( m_vEntries[ nPos ]->m_bHasButtons )
+ m_nActiveHeight = aTextHeight + m_nExtraHeight;
+ else
+ m_nActiveHeight = aTextHeight + 2;
}
//------------------------------------------------------------------------------
@@ -469,13 +476,15 @@ void ExtensionBox_Impl::selectEntry( const long nPos )
if ( IsReallyVisible() )
{
- m_bNeedsRecalc = true;
m_bAdjustActive = true;
}
}
if ( IsReallyVisible() )
+ {
+ m_bNeedsRecalc = true;
Invalidate();
+ }
guard.clear();
}
@@ -595,7 +604,12 @@ void ExtensionBox_Impl::DrawRow( const Rectangle& rRect, const TEntry_Impl pEntr
aPos.Y() += aTextHeight;
if ( pEntry->m_bActive )
{
- DrawText( Rectangle( aPos.X(), aPos.Y(), rRect.Right(), rRect.Bottom() - m_nExtraHeight ),
+ long nExtraHeight = 0;
+
+ if ( pEntry->m_bHasButtons )
+ nExtraHeight = m_nExtraHeight;
+
+ DrawText( Rectangle( aPos.X(), aPos.Y(), rRect.Right(), rRect.Bottom() - nExtraHeight ),
sDescription, TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
}
else
@@ -615,12 +629,15 @@ void ExtensionBox_Impl::DrawRow( const Rectangle& rRect, const TEntry_Impl pEntr
}
// Draw status icons
- if ( pEntry->m_bShared )
+ if ( !pEntry->m_bUser )
{
aPos = rRect.TopRight() + Point( -(RIGHT_ICON_OFFSET + SMALL_ICON_SIZE), TOP_OFFSET );
- DrawImage( aPos, Size( SMALL_ICON_SIZE, SMALL_ICON_SIZE ), isHCMode() ? m_aLockedImageHC : m_aLockedImage );
+ if ( pEntry->m_bLocked )
+ DrawImage( aPos, Size( SMALL_ICON_SIZE, SMALL_ICON_SIZE ), isHCMode() ? m_aLockedImageHC : m_aLockedImage );
+ else
+ DrawImage( aPos, Size( SMALL_ICON_SIZE, SMALL_ICON_SIZE ), isHCMode() ? m_aSharedImageHC : m_aSharedImage );
}
- if ( ( pEntry->m_eState == AMBIGUOUS ) || pEntry->m_bMissingDeps )
+ if ( ( pEntry->m_eState == AMBIGUOUS ) || pEntry->m_bMissingDeps || pEntry->m_bMissingLic )
{
aPos = rRect.TopRight() + Point( -(RIGHT_ICON_OFFSET + SPACE_BETWEEN + 2*SMALL_ICON_SIZE), TOP_OFFSET );
DrawImage( aPos, Size( SMALL_ICON_SIZE, SMALL_ICON_SIZE ), isHCMode() ? m_aWarningImageHC : m_aWarningImage );
@@ -939,29 +956,24 @@ bool ExtensionBox_Impl::FindEntryPos( const TEntry_Impl pEntry, const long nStar
//------------------------------------------------------------------------------
long ExtensionBox_Impl::addEntry( const uno::Reference< deployment::XPackage > &xPackage,
- const uno::Reference< deployment::XPackageManager > &xPackageManager )
+ bool bLicenseMissing )
{
- long nPos = 0;
+ long nPos = 0;
PackageState eState = m_pManager->getPackageState( xPackage );
+ bool bLocked = m_pManager->isReadOnly( xPackage );
- TEntry_Impl pEntry( new Entry_Impl( xPackage, xPackageManager, eState ) );
+ TEntry_Impl pEntry( new Entry_Impl( xPackage, eState, bLocked ) );
xPackage->addEventListener( uno::Reference< lang::XEventListener > ( m_xRemoveListener, uno::UNO_QUERY ) );
::osl::ClearableMutexGuard guard(m_entriesMutex);
if ( m_vEntries.empty() )
{
- pEntry->m_bHasOptions = m_pManager->supportsOptions( xPackage );
- pEntry->m_bShared = ( m_pManager->getSharedPkgMgr() == xPackageManager );
- pEntry->m_bNew = m_bInCheckMode;
m_vEntries.push_back( pEntry );
}
else
{
if ( !FindEntryPos( pEntry, 0, m_vEntries.size()-1, nPos ) )
{
- pEntry->m_bHasOptions = m_pManager->supportsOptions( xPackage );
- pEntry->m_bShared = ( m_pManager->getSharedPkgMgr() == xPackageManager );
- pEntry->m_bNew = m_bInCheckMode;
m_vEntries.insert( m_vEntries.begin()+nPos, pEntry );
}
else if ( !m_bInCheckMode )
@@ -969,6 +981,16 @@ long ExtensionBox_Impl::addEntry( const uno::Reference< deployment::XPackage > &
OSL_ENSURE( 0, "ExtensionBox_Impl::addEntry(): Will not add duplicate entries" );
}
}
+
+ pEntry->m_bHasOptions = m_pManager->supportsOptions( xPackage );
+ pEntry->m_bUser = xPackage->getRepositoryName().equals( USER_PACKAGE_MANAGER );
+ pEntry->m_bShared = xPackage->getRepositoryName().equals( SHARED_PACKAGE_MANAGER );
+ pEntry->m_bNew = m_bInCheckMode;
+ pEntry->m_bMissingLic = bLicenseMissing;
+
+ if ( bLicenseMissing )
+ pEntry->m_sErrorText = DialogHelper::getResourceString( RID_STR_ERROR_MISSING_LICENSE );
+
//access to m_nActive must be guarded
if ( !m_bInCheckMode && m_bHasActive && ( m_nActive >= nPos ) )
m_nActive += 1;
@@ -998,9 +1020,12 @@ void ExtensionBox_Impl::updateEntry( const uno::Reference< deployment::XPackage
(*iIndex)->m_sVersion = xPackage->getVersion();
(*iIndex)->m_sDescription = xPackage->getDescription();
+ if ( eState == REGISTERED )
+ (*iIndex)->m_bMissingLic = false;
+
if ( eState == AMBIGUOUS )
(*iIndex)->m_sErrorText = DialogHelper::getResourceString( RID_STR_ERROR_UNKNOWN_STATUS );
- else
+ else if ( ! (*iIndex)->m_bMissingLic )
(*iIndex)->m_sErrorText = String();
if ( IsReallyVisible() )
@@ -1084,16 +1109,13 @@ void ExtensionBox_Impl::RemoveUnlocked()
}
//------------------------------------------------------------------------------
-void ExtensionBox_Impl::prepareChecking( const uno::Reference< deployment::XPackageManager > &xPackageMgr )
+void ExtensionBox_Impl::prepareChecking()
{
m_bInCheckMode = true;
typedef std::vector< TEntry_Impl >::iterator ITER;
for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
{
- if ( (*iIndex)->m_xPackageManager == xPackageMgr )
- (*iIndex)->m_bChecked = false;
- else
- (*iIndex)->m_bChecked = true;
+ (*iIndex)->m_bChecked = false;
(*iIndex)->m_bNew = false;
}
}
@@ -1112,17 +1134,30 @@ void ExtensionBox_Impl::checkEntries()
{
if ( (*iIndex)->m_bChecked == false )
{
+ (*iIndex)->m_bChecked = true;
bNeedsUpdate = true;
nPos = iIndex-m_vEntries.begin();
if ( (*iIndex)->m_bNew )
- {
+ { // add entry to list and correct active pos
if ( nNewPos == - 1)
nNewPos = nPos;
if ( nPos <= m_nActive )
m_nActive += 1;
+ iIndex++;
+ }
+ else
+ { // remove entry from list
+ if ( nPos < m_nActive )
+ m_nActive -= 1;
+ else if ( ( nPos == m_nActive ) && ( nPos == (long) m_vEntries.size() - 1 ) )
+ m_nActive -= 1;
+ m_vRemovedEntries.push_back( *iIndex );
+ m_vEntries.erase( iIndex );
+ iIndex = m_vEntries.begin() + nPos;
}
}
- iIndex++;
+ else
+ iIndex++;
}
guard.clear();
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
index ad62bfd1a2d8..762f50296690 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
@@ -38,7 +38,6 @@
#include "com/sun/star/lang/Locale.hpp"
#include "com/sun/star/lang/XEventListener.hpp"
#include "com/sun/star/deployment/XPackage.hpp"
-#include "com/sun/star/deployment/XPackageManager.hpp"
#include <boost/shared_ptr.hpp>
@@ -65,13 +64,16 @@ typedef ::boost::shared_ptr< Entry_Impl > TEntry_Impl;
struct Entry_Impl
{
- bool m_bActive;
- bool m_bLocked;
- bool m_bHasOptions;
- bool m_bShared;
- bool m_bNew;
- bool m_bChecked;
- bool m_bMissingDeps;
+ bool m_bActive :1;
+ bool m_bLocked :1;
+ bool m_bHasOptions :1;
+ bool m_bUser :1;
+ bool m_bShared :1;
+ bool m_bNew :1;
+ bool m_bChecked :1;
+ bool m_bMissingDeps :1;
+ bool m_bHasButtons :1;
+ bool m_bMissingLic :1;
PackageState m_eState;
String m_sTitle;
String m_sVersion;
@@ -84,11 +86,9 @@ struct Entry_Impl
svt::FixedHyperlink *m_pPublisher;
::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage> m_xPackage;
- ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager> m_xPackageManager;
Entry_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage,
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager,
- PackageState eState );
+ const PackageState eState, const bool bReadOnly );
~Entry_Impl();
StringCompare CompareTo( const CollatorWrapper *pCollator, const TEntry_Impl pEntry ) const;
@@ -135,6 +135,8 @@ class ExtensionBox_Impl : public ::svt::IExtensionListBox
long m_nActiveHeight;
long m_nExtraHeight;
Size m_aOutputSize;
+ Image m_aSharedImage;
+ Image m_aSharedImageHC;
Image m_aLockedImage;
Image m_aLockedImageHC;
Image m_aWarningImage;
@@ -205,11 +207,11 @@ public:
//-----------------
virtual void selectEntry( const long nPos );
long addEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage,
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
+ bool bLicenseMissing = false );
void updateEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
void removeEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
- void prepareChecking( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageMgr );
+ void prepareChecking();
void checkEntries();
TheExtensionManager* getExtensionManager() const { return m_pManager; }
diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx
index 061988d5b04d..29bedf1b229f 100644..100755
--- a/desktop/source/deployment/gui/dp_gui_service.cxx
+++ b/desktop/source/deployment/gui/dp_gui_service.cxx
@@ -46,6 +46,7 @@
#include "boost/bind.hpp"
#include "license_dialog.hxx"
#include "dp_gui_dialog2.hxx"
+#include "dp_gui_extensioncmdqueue.hxx"
using namespace ::dp_misc;
using namespace ::com::sun::star;
@@ -92,6 +93,8 @@ namespace
: public rtl::Static< String, Version > {};
struct AboutBoxVersion
: public rtl::Static< String, AboutBoxVersion > {};
+ struct OOOVendor
+ : public rtl::Static< String, OOOVendor > {};
struct Extension
: public rtl::Static< String, Extension > {};
}
@@ -107,6 +110,7 @@ void ReplaceProductNameHookProc( String& rStr )
String &rVersion = Version::get();
String &rAboutBoxVersion = AboutBoxVersion::get();
String &rExtension = Extension::get();
+ String &rOOOVendor = OOOVendor::get();
if ( !rProductName.Len() )
{
@@ -123,6 +127,10 @@ void ReplaceProductNameHookProc( String& rStr )
aRet >>= aTmp;
rAboutBoxVersion = aTmp;
+ aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::OOOVENDOR );
+ aRet >>= aTmp;
+ rOOOVendor = aTmp;
+
if ( !rExtension.Len() )
{
aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTEXTENSION );
@@ -135,6 +143,7 @@ void ReplaceProductNameHookProc( String& rStr )
rStr.SearchAndReplaceAllAscii( "%PRODUCTNAME", rProductName );
rStr.SearchAndReplaceAllAscii( "%PRODUCTVERSION", rVersion );
rStr.SearchAndReplaceAllAscii( "%ABOUTBOXPRODUCTVERSION", rAboutBoxVersion );
+ rStr.SearchAndReplaceAllAscii( "%OOOVENDOR", rOOOVendor );
rStr.SearchAndReplaceAllAscii( "%PRODUCTEXTENSION", rExtension );
}
}
@@ -256,6 +265,7 @@ void ServiceImpl::startExecuteModal(
+ ::utl::ConfigManager::GetDirectConfigProperty(
::utl::ConfigManager::PRODUCTVERSION).get<OUString>();
app->SetDisplayName(sTitle);
+ ExtensionCmdQueue::syncRepositories( m_xComponentContext );
}
}
else
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index 796918202a52..d0347c7cbf4e 100644..100755
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -36,17 +36,20 @@
#include "toolkit/helper/vclunohelper.hxx"
#include "com/sun/star/beans/XPropertySet.hpp"
-#include "com/sun/star/deployment/XPackageManagerFactory.hpp"
-#include "com/sun/star/deployment/thePackageManagerFactory.hpp"
#include "dp_gui_dialog2.hxx"
#include "dp_gui_extensioncmdqueue.hxx"
#include "dp_gui_theextmgr.hxx"
#include "dp_gui_theextmgr.hxx"
#include "dp_identifier.hxx"
+#include "dp_update.hxx"
#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
+#define USER_PACKAGE_MANAGER OUSTR("user")
+#define SHARED_PACKAGE_MANAGER OUSTR("shared")
+#define BUNDLED_PACKAGE_MANAGER OUSTR("bundled")
+
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -65,16 +68,11 @@ TheExtensionManager::TheExtensionManager( Window *pParent,
m_xContext( xContext ),
m_pParent( pParent ),
m_pExtMgrDialog( NULL ),
- m_pUpdReqDialog( NULL )
+ m_pUpdReqDialog( NULL ),
+ m_pExecuteCmdQueue( NULL )
{
- m_sPackageManagers.realloc(2);
- m_sPackageManagers[0] = deployment::thePackageManagerFactory::get( m_xContext )->getPackageManager( OUSTR("user") );
- m_sPackageManagers[1] = deployment::thePackageManagerFactory::get( m_xContext )->getPackageManager( OUSTR("shared") );;
-
- for ( sal_Int32 i = 0; i < m_sPackageManagers.getLength(); ++i )
- {
- m_sPackageManagers[i]->addModifyListener( this );
- }
+ m_xExtensionManager = deployment::ExtensionManager::get( xContext );
+ m_xExtensionManager->addModifyListener( this );
uno::Reference< lang::XMultiServiceFactory > xConfig(
xContext->getServiceManager()->createInstanceWithContext(
@@ -121,6 +119,8 @@ TheExtensionManager::~TheExtensionManager()
delete m_pUpdReqDialog;
if ( m_pExtMgrDialog )
delete m_pExtMgrDialog;
+ if ( m_pExecuteCmdQueue )
+ delete m_pExecuteCmdQueue;
}
//------------------------------------------------------------------------------
@@ -133,14 +133,16 @@ void TheExtensionManager::createDialog( const bool bCreateUpdDlg )
if ( !m_pUpdReqDialog )
{
m_pUpdReqDialog = new UpdateRequiredDialog( NULL, this );
- m_pExecuteCmdQueue.reset( new ExtensionCmdQueue( (DialogHelper*) m_pUpdReqDialog, this, m_xContext ) );
+ delete m_pExecuteCmdQueue;
+ m_pExecuteCmdQueue = new ExtensionCmdQueue( (DialogHelper*) m_pUpdReqDialog, this, m_xContext );
createPackageList();
}
}
else if ( !m_pExtMgrDialog )
{
m_pExtMgrDialog = new ExtMgrDialog( m_pParent, this );
- m_pExecuteCmdQueue.reset( new ExtensionCmdQueue( (DialogHelper*) m_pExtMgrDialog, this, m_xContext ) );
+ delete m_pExecuteCmdQueue;
+ m_pExecuteCmdQueue = new ExtensionCmdQueue( (DialogHelper*) m_pExtMgrDialog, this, m_xContext );
m_pExtMgrDialog->setGetExtensionsURL( m_sGetExtensionsURL );
createPackageList();
}
@@ -205,27 +207,29 @@ bool TheExtensionManager::isVisible()
//------------------------------------------------------------------------------
bool TheExtensionManager::checkUpdates( bool /* bShowUpdateOnly */, bool /*bParentVisible*/ )
{
- std::vector< TUpdateListEntry > vEntries;
+ std::vector< uno::Reference< deployment::XPackage > > vEntries;
+ uno::Sequence< uno::Sequence< uno::Reference< deployment::XPackage > > > xAllPackages;
- for ( sal_Int32 i = 0; i < m_sPackageManagers.getLength(); ++i )
+ try {
+ xAllPackages = m_xExtensionManager->getAllExtensions( uno::Reference< task::XAbortChannel >(),
+ uno::Reference< ucb::XCommandEnvironment >() );
+ } catch ( deployment::DeploymentException & ) {
+ return false;
+ } catch ( ucb::CommandFailedException & ) {
+ return false;
+ } catch ( ucb::CommandAbortedException & ) {
+ return false;
+ } catch ( lang::IllegalArgumentException & e ) {
+ throw uno::RuntimeException( e.Message, e.Context );
+ }
+
+ for ( sal_Int32 i = 0; i < xAllPackages.getLength(); ++i )
{
- uno::Sequence< uno::Reference< deployment::XPackage > > xPackages;
- try {
- xPackages = m_sPackageManagers[i]->getDeployedPackages( uno::Reference< task::XAbortChannel >(),
- uno::Reference< ucb::XCommandEnvironment >() );
- for ( sal_Int32 k = 0; k < xPackages.getLength(); ++k )
- {
- TUpdateListEntry pEntry( new UpdateListEntry( xPackages[k], m_sPackageManagers[i] ) );
- vEntries.push_back( pEntry );
- }
- } catch ( deployment::DeploymentException & ) {
- continue;
- } catch ( ucb::CommandFailedException & ) {
- continue;
- } catch ( ucb::CommandAbortedException & ) {
- return true;
- } catch ( lang::IllegalArgumentException & e ) {
- throw uno::RuntimeException( e.Message, e.Context );
+ uno::Reference< deployment::XPackage > xPackage = dp_misc::getExtensionWithHighestVersion(xAllPackages[i]);
+ OSL_ASSERT(xPackage.is());
+ if ( xPackage.is() )
+ {
+ vEntries.push_back( xPackage );
}
}
@@ -234,32 +238,6 @@ bool TheExtensionManager::checkUpdates( bool /* bShowUpdateOnly */, bool /*bPare
}
//------------------------------------------------------------------------------
-bool TheExtensionManager::enablePackage( const uno::Reference< deployment::XPackage > &xPackage,
- bool bEnable )
-{
- m_pExecuteCmdQueue->enableExtension( xPackage, bEnable );
-
- return true;
-}
-
-//------------------------------------------------------------------------------
-bool TheExtensionManager::removePackage( const uno::Reference< deployment::XPackageManager > &xPackageManager,
- const uno::Reference< deployment::XPackage > &xPackage )
-{
- m_pExecuteCmdQueue->removeExtension( xPackageManager, xPackage );
-
- return true;
-}
-
-//------------------------------------------------------------------------------
-bool TheExtensionManager::updatePackages( const std::vector< TUpdateListEntry > &vList )
-{
- m_pExecuteCmdQueue->checkForUpdates( vList );
-
- return true;
-}
-
-//------------------------------------------------------------------------------
bool TheExtensionManager::installPackage( const OUString &rPackageURL, bool bWarnUser )
{
if ( rPackageURL.getLength() == 0 )
@@ -267,22 +245,20 @@ bool TheExtensionManager::installPackage( const OUString &rPackageURL, bool bWar
createDialog( false );
- uno::Reference< deployment::XPackageManager > xUserPkgMgr = getUserPkgMgr();
- uno::Reference< deployment::XPackageManager > xSharedPkgMgr = getSharedPkgMgr();
-
bool bInstall = true;
bool bInstallForAll = false;
- if ( !bWarnUser && ! xSharedPkgMgr->isReadOnly() )
+ // DV! missing function is read only repository from extension manager
+ if ( !bWarnUser && ! m_xExtensionManager->isReadOnlyRepository( SHARED_PACKAGE_MANAGER ) )
bInstall = getDialogHelper()->installForAllUsers( bInstallForAll );
if ( !bInstall )
return false;
if ( bInstallForAll )
- m_pExecuteCmdQueue->addExtension( xSharedPkgMgr, rPackageURL, false );
+ m_pExecuteCmdQueue->addExtension( rPackageURL, SHARED_PACKAGE_MANAGER, false );
else
- m_pExecuteCmdQueue->addExtension( xUserPkgMgr, rPackageURL, bWarnUser );
+ m_pExecuteCmdQueue->addExtension( rPackageURL, USER_PACKAGE_MANAGER, bWarnUser );
return true;
}
@@ -312,40 +288,52 @@ void TheExtensionManager::terminateDialog()
}
//------------------------------------------------------------------------------
-bool TheExtensionManager::createPackageList( const uno::Reference< deployment::XPackageManager > &xPackageManager )
+void TheExtensionManager::createPackageList()
{
- uno::Sequence< uno::Reference< deployment::XPackage > > packages;
+ uno::Sequence< uno::Sequence< uno::Reference< deployment::XPackage > > > xAllPackages;
try {
- packages = xPackageManager->getDeployedPackages( uno::Reference< task::XAbortChannel >(),
- uno::Reference< ucb::XCommandEnvironment >() );
+ xAllPackages = m_xExtensionManager->getAllExtensions( uno::Reference< task::XAbortChannel >(),
+ uno::Reference< ucb::XCommandEnvironment >() );
} catch ( deployment::DeploymentException & ) {
- //handleGeneralError(e.Cause);
- return true;
+ return;
} catch ( ucb::CommandFailedException & ) {
- //handleGeneralError(e.Reason);
- return true;
+ return;
} catch ( ucb::CommandAbortedException & ) {
- return false;
+ return;
} catch ( lang::IllegalArgumentException & e ) {
throw uno::RuntimeException( e.Message, e.Context );
}
- for ( sal_Int32 j = 0; j < packages.getLength(); ++j )
+ for ( sal_Int32 i = 0; i < xAllPackages.getLength(); ++i )
{
- getDialogHelper()->addPackageToList( packages[j], xPackageManager );
- }
+ uno::Sequence< uno::Reference< deployment::XPackage > > xPackageList = xAllPackages[i];
- return true;
-}
+ for ( sal_Int32 j = 0; j < xPackageList.getLength(); ++j )
+ {
+ uno::Reference< deployment::XPackage > xPackage = xPackageList[j];
+ if ( xPackage.is() )
+ {
+ PackageState eState = getPackageState( xPackage );
+ getDialogHelper()->addPackageToList( xPackage );
+ // When the package is enabled, we can stop here, otherwise we have to look for
+ // another version of this package
+ if ( ( eState == REGISTERED ) || ( eState == NOT_AVAILABLE ) )
+ break;
+ }
+ }
+ }
-//------------------------------------------------------------------------------
-void TheExtensionManager::createPackageList()
-{
- for ( sal_Int32 i = 0; i < m_sPackageManagers.getLength(); ++i )
+ uno::Sequence< uno::Reference< deployment::XPackage > > xNoLicPackages;
+ xNoLicPackages = m_xExtensionManager->getExtensionsWithUnacceptedLicenses( SHARED_PACKAGE_MANAGER,
+ uno::Reference< ucb::XCommandEnvironment >() );
+ for ( sal_Int32 i = 0; i < xNoLicPackages.getLength(); ++i )
{
- if ( ! createPackageList( m_sPackageManagers[i] ) )
- break;
+ uno::Reference< deployment::XPackage > xPackage = xNoLicPackages[i];
+ if ( xPackage.is() )
+ {
+ getDialogHelper()->addPackageToList( xPackage, true );
+ }
}
}
@@ -378,6 +366,17 @@ PackageState TheExtensionManager::getPackageState( const uno::Reference< deploym
}
//------------------------------------------------------------------------------
+bool TheExtensionManager::isReadOnly( const uno::Reference< deployment::XPackage > &xPackage ) const
+{
+ if ( m_xExtensionManager.is() && xPackage.is() )
+ {
+ return m_xExtensionManager->isReadOnlyRepository( xPackage->getRepositoryName() );
+ }
+ else
+ return true;
+}
+
+//------------------------------------------------------------------------------
// The function investigates if the extension supports options.
bool TheExtensionManager::supportsOptions( const uno::Reference< deployment::XPackage > &xPackage ) const
{
@@ -488,16 +487,12 @@ void TheExtensionManager::notifyTermination( ::lang::EventObject const & rEvt )
//------------------------------------------------------------------------------
// XModifyListener
-void TheExtensionManager::modified( ::lang::EventObject const & rEvt )
+void TheExtensionManager::modified( ::lang::EventObject const & /*rEvt*/ )
throw ( uno::RuntimeException )
{
- uno::Reference< deployment::XPackageManager > xPackageManager( rEvt.Source, uno::UNO_QUERY );
- if ( xPackageManager.is() )
- {
- getDialogHelper()->prepareChecking( xPackageManager );
- createPackageList( xPackageManager );
- getDialogHelper()->checkEntries();
- }
+ getDialogHelper()->prepareChecking();
+ createPackageList();
+ getDialogHelper()->checkEntries();
}
//------------------------------------------------------------------------------
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
index 1cdd1851d59e..094e25e249b7 100644..100755
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
@@ -33,7 +33,8 @@
#include "cppuhelper/implbase2.hxx"
#include "com/sun/star/container/XNameAccess.hpp"
-#include "com/sun/star/deployment/XPackageManager.hpp"
+#include "com/sun/star/deployment/XExtensionManager.hpp"
+#include "com/sun/star/deployment/ExtensionManager.hpp"
#include "com/sun/star/frame/XDesktop.hpp"
#include "com/sun/star/frame/XTerminateListener.hpp"
#include "com/sun/star/uno/XComponentContext.hpp"
@@ -57,21 +58,17 @@ class TheExtensionManager :
private:
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDesktop > m_xDesktop;
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager> > m_sPackageManagers;
+ ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager > m_xExtensionManager;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xNameAccessNodes;
- ::std::auto_ptr< ExtensionCmdQueue > m_pExecuteCmdQueue;
-
Window *m_pParent;
ExtMgrDialog *m_pExtMgrDialog;
UpdateRequiredDialog *m_pUpdReqDialog;
+ ExtensionCmdQueue *m_pExecuteCmdQueue;
::rtl::OUString m_sGetExtensionsURL;
- // liste der packages ( xpackage?, mit parent manager, ... )
-
void createPackageList();
- bool createPackageList( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
public:
static ::rtl::Reference<TheExtensionManager> s_ExtMgr;
@@ -85,6 +82,7 @@ public:
Dialog* getDialog() { return m_pExtMgrDialog ? (Dialog*) m_pExtMgrDialog : (Dialog*) m_pUpdReqDialog; }
DialogHelper* getDialogHelper() { return m_pExtMgrDialog ? (DialogHelper*) m_pExtMgrDialog : (DialogHelper*) m_pUpdReqDialog; }
+ ExtensionCmdQueue* getCmdQueue() const { return m_pExecuteCmdQueue; }
void SetText( const ::rtl::OUString &rTitle );
void Show();
@@ -94,12 +92,6 @@ public:
//-----------------
bool checkUpdates( bool showUpdateOnly, bool parentVisible );
- bool updatePackages( const std::vector< TUpdateListEntry > &vList );
-
- bool enablePackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage,
- bool bEnable );
- bool removePackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager,
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
bool installPackage( const ::rtl::OUString &rPackageURL, bool bWarnUser = false );
bool queryTermination();
@@ -109,8 +101,8 @@ public:
bool supportsOptions( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage ) const;
PackageState getPackageState( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage ) const;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getContext() const { return m_xContext; }
- ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > getUserPkgMgr() const { return m_sPackageManagers[0]; }
- ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > getSharedPkgMgr() const { return m_sPackageManagers[1]; }
+ ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager > getExtensionManager() const { return m_xExtensionManager; }
+ bool isReadOnly( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage ) const;
//-----------------
static ::rtl::Reference<TheExtensionManager> get(
diff --git a/desktop/source/deployment/gui/dp_gui_updatedata.hxx b/desktop/source/deployment/gui/dp_gui_updatedata.hxx
index dda6126f70d0..76eb8af31e8e 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedata.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedata.hxx
@@ -35,7 +35,6 @@
namespace com { namespace sun { namespace star { namespace deployment {
- class XPackageManager;
class XPackage;
}}}}
namespace com { namespace sun { namespace star { namespace xml { namespace dom {
@@ -45,31 +44,42 @@ namespace com { namespace sun { namespace star { namespace xml { namespace dom {
namespace dp_gui {
-struct UpdateListEntry
+struct UpdateData
{
- ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage> m_xPackage;
- ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager> m_xPackageManager;
-
- UpdateListEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage,
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
- ~UpdateListEntry();
-};
-
-typedef ::boost::shared_ptr< UpdateListEntry > TUpdateListEntry;
+ UpdateData( ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > const & aExt):
+ bIsShared(false), aInstalledPackage(aExt){};
+ //When entries added to the listbox then there can be one for the user update and one
+ //for the shared update. However, both list entries will contain the same UpdateData.
+ //isShared is used to indicate which one is used for the shared entry.
+ bool bIsShared;
-struct UpdateData
-{
+ //The currently installed extension which is going to be updated. If the extension exist in
+ //multiple repositories then it is the one with the highest version.
::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > aInstalledPackage;
- ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > aPackageManager;
- // The content of the update information
+ //The version of the update
+ ::rtl::OUString updateVersion;
+
+ //For online update
+ // ======================
+ // The content of the update information.
+ //Only if aUpdateInfo is set then there is an online update available with a better version
+ //than any of the currently installed extensions with the same identifier.
::com::sun::star::uno::Reference< ::com::sun::star::xml::dom::XNode > aUpdateInfo;
//The URL of the locally downloaded extension. It will only be set if there were no errors
//during the download
::rtl::OUString sLocalURL;
//The URL of the website wher the download can be obtained.
::rtl::OUString sWebsiteURL;
+
+ //For local update
+ //=====================
+ //The locale extension which is used as update for the user or shared repository.
+ //If set then the data for the online update (aUpdateInfo, sLocalURL, sWebsiteURL)
+ //are to be ignored.
+ ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage >
+ aUpdateSource;
};
}
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index 61479f799e6f..b27cd8da81fe 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -54,7 +54,8 @@
#include "com/sun/star/deployment/DeploymentException.hpp"
#include "com/sun/star/deployment/UpdateInformationProvider.hpp"
#include "com/sun/star/deployment/XPackage.hpp"
-#include "com/sun/star/deployment/XPackageManager.hpp"
+#include "com/sun/star/deployment/XExtensionManager.hpp"
+#include "com/sun/star/deployment/ExtensionManager.hpp"
#include "com/sun/star/deployment/XUpdateInformationProvider.hpp"
#include "com/sun/star/frame/XDesktop.hpp"
#include "com/sun/star/frame/XDispatch.hpp"
@@ -111,6 +112,7 @@
#include "dp_identifier.hxx"
#include "dp_version.hxx"
#include "dp_misc.h"
+#include "dp_update.hxx"
#include "dp_gui.h"
#include "dp_gui.hrc"
@@ -150,7 +152,6 @@ rtl::OUString confineToParagraph(rtl::OUString const & text) {
struct UpdateDialog::DisabledUpdate {
rtl::OUString name;
css::uno::Sequence< rtl::OUString > unsatisfiedDependencies;
- bool permission;
// We also want to show release notes and publisher for disabled updates
::com::sun::star::uno::Reference< ::com::sun::star::xml::dom::XNode > aUpdateInfo;
};
@@ -229,7 +230,7 @@ public:
Thread(
css::uno::Reference< css::uno::XComponentContext > const & context,
UpdateDialog & dialog,
- const std::vector< TUpdateListEntry > &vExtensionList);
+ const std::vector< css::uno::Reference< css::deployment::XPackage > > & vExtensionList);
void stop();
@@ -240,18 +241,21 @@ private:
struct Entry {
explicit Entry(
css::uno::Reference< css::deployment::XPackage > const & thePackage,
- css::uno::Reference< css::deployment::XPackageManager > const &
- thePackageManager,
rtl::OUString const & theVersion);
css::uno::Reference< css::deployment::XPackage > package;
- css::uno::Reference< css::deployment::XPackageManager > packageManager;
rtl::OUString version;
+ //Indicates that the extension provides its own update URLs.
+ //If this is true, then we must not use the default update
+ //URL to find the update information.
+ bool bProvidesOwnUpdate;
css::uno::Reference< css::xml::dom::XNode > info;
+ UpdateDialog::DisabledUpdate disableUpdate;
+ dp_gui::UpdateData updateData;
};
- // A multimap in case an extension is installed in both "user" and "shared":
- typedef std::multimap< rtl::OUString, Entry > Map;
+ // A multimap in case an extension is installed in "user", "shared" or "bundled"
+ typedef std::map< rtl::OUString, Entry > Map;
virtual ~Thread();
@@ -269,21 +273,25 @@ private:
css::uno::Sequence< rtl::OUString > const & urls,
rtl::OUString const & identifier) const;
- void handle(
+ void getOwnUpdateInformation(
css::uno::Reference< css::deployment::XPackage > const & package,
- css::uno::Reference< css::deployment::XPackageManager > const &
- packageManager,
Map * map);
+ ::rtl::OUString getUpdateDisplayString(
+ dp_gui::UpdateData const & data, ::rtl::OUString const & version = ::rtl::OUString()) const;
+
+ void prepareUpdateData(
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::dom::XNode > const & updateInfo,
+ UpdateDialog::DisabledUpdate & out_du,
+ dp_gui::UpdateData & out_data) const;
+
bool update(
- css::uno::Reference< css::deployment::XPackage > const & package,
- css::uno::Reference< css::deployment::XPackageManager > const &
- packageManager,
- css::uno::Reference< css::xml::dom::XNode > const & updateInfo) const;
+ UpdateDialog::DisabledUpdate const & du,
+ dp_gui::UpdateData const & data) const;
css::uno::Reference< css::uno::XComponentContext > m_context;
UpdateDialog & m_dialog;
- std::vector< dp_gui::TUpdateListEntry > m_vExtensionList;
+ std::vector< css::uno::Reference< css::deployment::XPackage > > m_vExtensionList;
css::uno::Reference< css::deployment::XUpdateInformationProvider > m_updateInformation;
css::uno::Reference< css::task::XInteractionHandler > m_xInteractionHdl;
@@ -295,7 +303,7 @@ private:
UpdateDialog::Thread::Thread(
css::uno::Reference< css::uno::XComponentContext > const & context,
UpdateDialog & dialog,
- const std::vector< dp_gui::TUpdateListEntry > &vExtensionList):
+ const std::vector< css::uno::Reference< css::deployment::XPackage > > &vExtensionList):
m_context(context),
m_dialog(dialog),
m_vExtensionList(vExtensionList),
@@ -333,13 +341,14 @@ void UpdateDialog::Thread::stop() {
UpdateDialog::Thread::Entry::Entry(
css::uno::Reference< css::deployment::XPackage > const & thePackage,
- css::uno::Reference< css::deployment::XPackageManager > const &
- thePackageManager,
rtl::OUString const & theVersion):
+
package(thePackage),
- packageManager(thePackageManager),
- version(theVersion)
-{}
+ version(theVersion),
+ bProvidesOwnUpdate(false),
+ updateData(thePackage)
+{
+}
UpdateDialog::Thread::~Thread()
{
@@ -349,65 +358,94 @@ UpdateDialog::Thread::~Thread()
void UpdateDialog::Thread::execute()
{
- OSL_ASSERT( ! m_vExtensionList.empty() );
- Map map;
+ {
+ vos::OGuard g( Application::GetSolarMutex() );
+ if ( m_stop ) {
+ return;
+ }
+ }
+ css::uno::Reference<css::deployment::XExtensionManager> extMgr =
+ css::deployment::ExtensionManager::get(m_context);
+
+ std::vector<std::pair<css::uno::Reference<css::deployment::XPackage>, css::uno::Any > > errors;
+
+ dp_misc::UpdateInfoMap updateInfoMap = dp_misc::getOnlineUpdateInfos(
+ m_context, extMgr, m_updateInformation, &m_vExtensionList, errors);
- typedef std::vector< TUpdateListEntry >::const_iterator ITER;
- for ( ITER iIndex = m_vExtensionList.begin(); iIndex < m_vExtensionList.end(); ++iIndex )
+ typedef std::vector<std::pair<css::uno::Reference<css::deployment::XPackage>,
+ css::uno::Any> >::const_iterator ITERROR;
+ for (ITERROR ite = errors.begin(); ite != errors.end(); ite ++)
+ handleSpecificError(ite->first, ite->second);
+
+ for (dp_misc::UpdateInfoMap::iterator i(updateInfoMap.begin()); i != updateInfoMap.end(); i++)
{
- css::uno::Reference< css::deployment::XPackage > p = (*iIndex)->m_xPackage;
- css::uno::Reference< css::deployment::XPackageManager > m = (*iIndex)->m_xPackageManager;
- if ( p.is() )
+ dp_misc::UpdateInfo const & info = i->second;
+ UpdateData updateData(info.extension);
+ DisabledUpdate disableUpdate;
+ //determine if online updates meet the requirements
+ prepareUpdateData(info.info, disableUpdate, updateData);
+
+ //determine if the update is installed in the user or shared repository
+ rtl::OUString sOnlineVersion;
+ if (info.info.is())
+ sOnlineVersion = info.version;
+ rtl::OUString sVersionUser;
+ rtl::OUString sVersionShared;
+ rtl::OUString sVersionBundled;
+ css::uno::Sequence< css::uno::Reference< css::deployment::XPackage> > extensions;
+ try {
+ extensions = extMgr->getExtensionsWithSameIdentifier(
+ dp_misc::getIdentifier(info.extension), info.extension->getName(),
+ css::uno::Reference<css::ucb::XCommandEnvironment>());
+ } catch (css::lang::IllegalArgumentException& ) {
+ OSL_ASSERT(0);
+ }
+ OSL_ASSERT(extensions.getLength() == 3);
+ if (extensions[0].is() )
+ sVersionUser = extensions[0]->getVersion();
+ if (extensions[1].is() )
+ sVersionShared = extensions[1]->getVersion();
+ if (extensions[2].is() )
+ sVersionBundled = extensions[2]->getVersion();
+
+ bool bSharedReadOnly = extMgr->isReadOnlyRepository(OUSTR("shared"));
+
+ dp_misc::UPDATE_SOURCE sourceUser = dp_misc::isUpdateUserExtension(
+ bSharedReadOnly, sVersionUser, sVersionShared, sVersionBundled, sOnlineVersion);
+ dp_misc::UPDATE_SOURCE sourceShared = dp_misc::isUpdateSharedExtension(
+ bSharedReadOnly, sVersionShared, sVersionBundled, sOnlineVersion);
+
+ css::uno::Reference<css::deployment::XPackage> updateSource;
+ if (sourceUser != dp_misc::UPDATE_SOURCE_NONE)
{
+ if (sourceUser == dp_misc::UPDATE_SOURCE_SHARED)
{
- vos::OGuard g( Application::GetSolarMutex() );
- if ( m_stop ) {
- return;
- }
+ updateData.aUpdateSource = extensions[1];
+ updateData.updateVersion = extensions[1]->getVersion();
}
- handle( p, m, &map );
+ else if (sourceUser == dp_misc::UPDATE_SOURCE_BUNDLED)
+ {
+ updateData.aUpdateSource = extensions[2];
+ updateData.updateVersion = extensions[2]->getVersion();
+ }
+ if (!update(disableUpdate, updateData))
+ return;
}
- }
- if (!map.empty()) {
- const rtl::OUString sDefaultURL(dp_misc::getExtensionDefaultUpdateURL());
- if (sDefaultURL.getLength())
+ if (sourceShared != dp_misc::UPDATE_SOURCE_NONE)
{
- css::uno::Sequence< css::uno::Reference< css::xml::dom::XElement > >
- infos(
- getUpdateInformation(
- css::uno::Reference< css::deployment::XPackage >(),
- css::uno::Sequence< rtl::OUString >(&sDefaultURL, 1), rtl::OUString()));
- for (sal_Int32 i = 0; i < infos.getLength(); ++i) {
- css::uno::Reference< css::xml::dom::XNode > node(
- infos[i], css::uno::UNO_QUERY_THROW);
- dp_misc::DescriptionInfoset infoset(m_context, node);
- boost::optional< rtl::OUString > id(infoset.getIdentifier());
- if (!id) {
- continue;
- }
- Map::iterator end(map.upper_bound(*id));
- for (Map::iterator j(map.lower_bound(*id)); j != end; ++j) {
- rtl::OUString v(infoset.getVersion());
- if (dp_misc::compareVersions(v, j->second.version) ==
- dp_misc::GREATER)
- {
- j->second.version = v;
- j->second.info = node;
- }
- }
- }
- for (Map::const_iterator i(map.begin()); i != map.end(); ++i) {
- if (i->second.info.is() &&
- !update(
- i->second.package, i->second.packageManager,
- i->second.info))
- {
- break;
- }
+ if (sourceShared == dp_misc::UPDATE_SOURCE_BUNDLED)
+ {
+ updateData.aUpdateSource = extensions[2];
+ updateData.updateVersion = extensions[2]->getVersion();
}
+ updateData.bIsShared = true;
+ if (!update(disableUpdate, updateData))
+ return;
}
}
+
+
vos::OGuard g(Application::GetSolarMutex());
if (!m_stop) {
m_dialog.checkingDone();
@@ -446,142 +484,95 @@ void UpdateDialog::Thread::handleSpecificError(
}
}
-css::uno::Sequence< css::uno::Reference< css::xml::dom::XElement > >
-UpdateDialog::Thread::getUpdateInformation(
- css::uno::Reference< css::deployment::XPackage > const & package,
- css::uno::Sequence< rtl::OUString > const & urls,
- rtl::OUString const & identifier) const
+::rtl::OUString UpdateDialog::Thread::getUpdateDisplayString(
+ dp_gui::UpdateData const & data, ::rtl::OUString const & version) const
{
- try {
- return m_updateInformation->getUpdateInformation(urls, identifier);
- } catch (css::uno::RuntimeException &) {
- throw;
- } catch (css::ucb::CommandFailedException & e) {
- handleSpecificError(package, e.Reason);
- } catch (css::ucb::CommandAbortedException &) {
- } catch (css::uno::Exception & e) {
- handleSpecificError(package, css::uno::makeAny(e));
+ OSL_ASSERT(data.aInstalledPackage.is());
+ rtl::OUStringBuffer b(data.aInstalledPackage->getDisplayName());
+ b.append(static_cast< sal_Unicode >(' '));
+ {
+ vos::OGuard g( Application::GetSolarMutex() );
+ if(!m_stop)
+ b.append(m_dialog.m_version);
}
- return
- css::uno::Sequence< css::uno::Reference< css::xml::dom::XElement > >();
-}
+ b.append(static_cast< sal_Unicode >(' '));
+ if (version.getLength())
+ b.append(version);
+ else
+ b.append(data.updateVersion);
-void UpdateDialog::Thread::handle(
- css::uno::Reference< css::deployment::XPackage > const & package,
- css::uno::Reference< css::deployment::XPackageManager > const &
- packageManager,
- Map * map)
-{
- rtl::OUString id(dp_misc::getIdentifier(package));
- css::uno::Sequence< rtl::OUString > urls(
- package->getUpdateInformationURLs());
- if (urls.getLength() == 0) {
- map->insert(
- Map::value_type(
- id, Entry(package, packageManager, package->getVersion())));
- } else {
- css::uno::Sequence< css::uno::Reference< css::xml::dom::XElement > >
- infos(getUpdateInformation(package, urls, id));
- rtl::OUString latestVersion(package->getVersion());
- sal_Int32 latestIndex = -1;
- for (sal_Int32 i = 0; i < infos.getLength(); ++i) {
- dp_misc::DescriptionInfoset infoset(
- m_context,
- css::uno::Reference< css::xml::dom::XNode >(
- infos[i], css::uno::UNO_QUERY_THROW));
- boost::optional< rtl::OUString > id2(infoset.getIdentifier());
- if (!id2) {
- continue;
- }
- if (*id2 == id) {
- rtl::OUString v(infoset.getVersion());
- if (dp_misc::compareVersions(v, latestVersion) ==
- dp_misc::GREATER)
- {
- latestVersion = v;
- latestIndex = i;
- }
- }
- }
- if (latestIndex != -1) {
- update(
- package, packageManager,
- css::uno::Reference< css::xml::dom::XNode >(
- infos[latestIndex], css::uno::UNO_QUERY_THROW));
+ if (data.sWebsiteURL.getLength())
+ {
+ b.append(static_cast< sal_Unicode >(' '));
+ {
+ vos::OGuard g( Application::GetSolarMutex() );
+ if(!m_stop)
+ b.append(m_dialog.m_browserbased);
}
}
+ return b.makeStringAndClear();
}
-bool UpdateDialog::Thread::update(
- css::uno::Reference< css::deployment::XPackage > const & package,
- css::uno::Reference< css::deployment::XPackageManager > const &
- packageManager,
- css::uno::Reference< css::xml::dom::XNode > const & updateInfo) const
+/** out_data will only be filled if all dependencies are ok.
+ */
+void UpdateDialog::Thread::prepareUpdateData(
+ css::uno::Reference< css::xml::dom::XNode > const & updateInfo,
+ UpdateDialog::DisabledUpdate & out_du,
+ dp_gui::UpdateData & out_data) const
{
+ if (!updateInfo.is())
+ return;
dp_misc::DescriptionInfoset infoset(m_context, updateInfo);
OSL_ASSERT(infoset.getVersion().getLength() != 0);
css::uno::Sequence< css::uno::Reference< css::xml::dom::XElement > > ds(
dp_misc::Dependencies::check(infoset));
- UpdateDialog::DisabledUpdate du;
- du.aUpdateInfo = updateInfo;
- du.unsatisfiedDependencies.realloc(ds.getLength());
+ out_du.aUpdateInfo = updateInfo;
+ out_du.unsatisfiedDependencies.realloc(ds.getLength());
for (sal_Int32 i = 0; i < ds.getLength(); ++i) {
- du.unsatisfiedDependencies[i] = dp_misc::Dependencies::getErrorText(ds[i]);
+ out_du.unsatisfiedDependencies[i] = dp_misc::Dependencies::getErrorText(ds[i]);
}
- du.permission = ! packageManager->isReadOnly();
+
const ::boost::optional< ::rtl::OUString> updateWebsiteURL(infoset.getLocalizedUpdateWebsiteURL());
- rtl::OUStringBuffer b(package->getDisplayName());
- b.append(static_cast< sal_Unicode >(' '));
- {
- vos::OGuard g( Application::GetSolarMutex() );
- if ( m_stop )
- return !m_stop;
- else
- b.append(m_dialog.m_version);
- }
- b.append(static_cast< sal_Unicode >(' '));
- b.append(infoset.getVersion());
- if (updateWebsiteURL)
+
+ out_du.name = getUpdateDisplayString(out_data, infoset.getVersion());
+
+ if (out_du.unsatisfiedDependencies.getLength() == 0)
{
- b.append(static_cast< sal_Unicode >(' '));
- {
- vos::OGuard g( Application::GetSolarMutex() );
- if ( m_stop )
- return !m_stop;
- else
- b.append(m_dialog.m_browserbased);
- }
+ out_data.aUpdateInfo = updateInfo;
+ out_data.updateVersion = infoset.getVersion();
+ if (updateWebsiteURL)
+ out_data.sWebsiteURL = *updateWebsiteURL;
}
- du.name = b.makeStringAndClear();
+}
- if (du.unsatisfiedDependencies.getLength() == 0 && du.permission)
+bool UpdateDialog::Thread::update(
+ UpdateDialog::DisabledUpdate const & du,
+ dp_gui::UpdateData const & data) const
+{
+ bool ret = false;
+ if (du.unsatisfiedDependencies.getLength() == 0)
{
- dp_gui::UpdateData data;
- data.aInstalledPackage = package;
- data.aPackageManager = packageManager;
- data.aUpdateInfo = updateInfo;
- if (updateWebsiteURL)
- data.sWebsiteURL = *updateWebsiteURL;
vos::OGuard g(Application::GetSolarMutex());
if (!m_stop) {
- m_dialog.addEnabledUpdate(du.name, data);
+ m_dialog.addEnabledUpdate(getUpdateDisplayString(data), data);
}
- return !m_stop;
+ ret = !m_stop;
} else {
vos::OGuard g(Application::GetSolarMutex());
if (!m_stop) {
- m_dialog.addDisabledUpdate(du);
+ m_dialog.addDisabledUpdate(du);
}
- return !m_stop;
+ ret = !m_stop;
}
+ return ret;
}
// UpdateDialog ----------------------------------------------------------
UpdateDialog::UpdateDialog(
css::uno::Reference< css::uno::XComponentContext > const & context,
Window * parent,
- const std::vector< dp_gui::TUpdateListEntry > &vExtensionList,
+ const std::vector<css::uno::Reference< css::deployment::XPackage > > &vExtensionList,
std::vector< dp_gui::UpdateData > * updateData):
ModalDialog(parent,DpGuiResId(RID_DLG_UPDATE)),
m_context(context),
@@ -611,8 +602,6 @@ UpdateDialog::UpdateDialog(
m_noInstall(String(DpGuiResId(RID_DLG_UPDATE_NOINSTALL))),
m_noDependency(String(DpGuiResId(RID_DLG_UPDATE_NODEPENDENCY))),
m_noDependencyCurVer(String(DpGuiResId(RID_DLG_UPDATE_NODEPENDENCY_CUR_VER))),
- m_noPermission(String(DpGuiResId(RID_DLG_UPDATE_NOPERMISSION))),
- m_noPermissionVista(String(DpGuiResId(RID_DLG_UPDATE_NOPERMISSION_VISTA))),
m_browserbased(String(DpGuiResId(RID_DLG_UPDATE_BROWSERBASED))),
m_version(String(DpGuiResId(RID_DLG_UPDATE_VERSION))),
m_updateData(*updateData),
@@ -626,6 +615,9 @@ UpdateDialog::UpdateDialog(
// m_extensionManagerDialog(extensionManagerDialog)
{
OSL_ASSERT(updateData != NULL);
+
+ m_xExtensionManager = css::deployment::ExtensionManager::get( context );
+
css::uno::Reference< css::awt::XToolkit > toolkit;
try {
toolkit = css::uno::Reference< css::awt::XToolkit >(
@@ -666,9 +658,6 @@ UpdateDialog::UpdateDialog(
if ( ! dp_misc::office_is_running())
m_help.Disable();
FreeResource();
- String sTemp(m_noPermissionVista);
- sTemp.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
- m_noPermissionVista = sTemp;
initDescription();
}
@@ -998,12 +987,25 @@ void UpdateDialog::clearDescription()
bool UpdateDialog::showDescription(css::uno::Reference< css::xml::dom::XNode > const & aUpdateInfo)
{
dp_misc::DescriptionInfoset infoset(m_context, aUpdateInfo);
- std::pair< rtl::OUString, rtl::OUString > pairPub = infoset.getLocalizedPublisherNameAndURL();
- rtl::OUString sPub = pairPub.first;
- rtl::OUString sURL = pairPub.second;
- rtl::OUString sRel = infoset.getLocalizedReleaseNotesURL();
+ return showDescription(infoset.getLocalizedPublisherNameAndURL(),
+ infoset.getLocalizedReleaseNotesURL());
+}
- if ( sPub.getLength() == 0 && sURL.getLength() == 0 && sRel.getLength() == 0 )
+bool UpdateDialog::showDescription(css::uno::Reference< css::deployment::XPackage > const & aExtension)
+{
+ OSL_ASSERT(aExtension.is());
+ css::beans::StringPair pubInfo = aExtension->getPublisherInfo();
+ return showDescription(std::make_pair(pubInfo.First, pubInfo.Second),
+ OUSTR(""));
+}
+
+bool UpdateDialog::showDescription(std::pair< rtl::OUString, rtl::OUString > const & pairPublisher,
+ rtl::OUString const & sReleaseNotes)
+{
+ rtl::OUString sPub = pairPublisher.first;
+ rtl::OUString sURL = pairPublisher.second;
+
+ if ( sPub.getLength() == 0 && sURL.getLength() == 0 && sReleaseNotes.getLength() == 0 )
// nothing to show
return false;
@@ -1017,7 +1019,7 @@ bool UpdateDialog::showDescription(css::uno::Reference< css::xml::dom::XNode > c
bPublisher = true;
}
- if ( sRel.getLength() > 0 )
+ if ( sReleaseNotes.getLength() > 0 )
{
if ( !bPublisher )
{
@@ -1026,7 +1028,7 @@ bool UpdateDialog::showDescription(css::uno::Reference< css::xml::dom::XNode > c
}
m_ReleaseNotesLabel.Show();
m_ReleaseNotesLink.Show();
- m_ReleaseNotesLink.SetURL( sRel );
+ m_ReleaseNotesLink.SetURL( sReleaseNotes );
}
return true;
}
@@ -1055,6 +1057,16 @@ bool UpdateDialog::showDescription( const String& rDescription, bool bWithPublis
return true;
}
+bool UpdateDialog::isReadOnly( const css::uno::Reference< css::deployment::XPackage > &xPackage ) const
+{
+ if ( m_xExtensionManager.is() && xPackage.is() )
+ {
+ return m_xExtensionManager->isReadOnlyRepository( xPackage->getRepositoryName() );
+ }
+ else
+ return true;
+}
+
IMPL_LINK(UpdateDialog, selectionHandler, void *, EMPTYARG)
{
rtl::OUStringBuffer b;
@@ -1074,7 +1086,12 @@ IMPL_LINK(UpdateDialog, selectionHandler, void *, EMPTYARG)
const std::vector< UpdateDialog::DisabledUpdate >::size_type sizeDisabled =
m_disabledUpdates.size();
if (pos < sizeEnabled)
- bInserted = showDescription(m_enabledUpdates[pos].aUpdateInfo);
+ {
+ if (m_enabledUpdates[pos].aUpdateSource.is())
+ bInserted = showDescription(m_enabledUpdates[pos].aUpdateSource);
+ else
+ bInserted = showDescription(m_enabledUpdates[pos].aUpdateInfo);
+ }
else if (pos >= sizeEnabled
&& pos < (sizeEnabled + sizeDisabled))
bInserted = showDescription(m_disabledUpdates[pos - sizeEnabled].aUpdateInfo);
@@ -1120,16 +1137,6 @@ IMPL_LINK(UpdateDialog, selectionHandler, void *, EMPTYARG)
b.appendAscii(RTL_CONSTASCII_STRINGPARAM(" "));
b.append(m_noDependencyCurVer);
}
- if (!data.permission) {
- if (b.getLength() == 0) {
- b.append(m_noInstall);
- }
- b.append(LF);
- if (isVista())
- b.append(m_noPermissionVista);
- else
- b.append(m_noPermission);
- }
break;
}
case GENERAL_ERROR:
@@ -1233,10 +1240,10 @@ IMPL_LINK(UpdateDialog, okHandler, void *, EMPTYARG)
typedef ::std::vector<UpdateData>::const_iterator CIT;
for (CIT i = m_enabledUpdates.begin(); i < m_enabledUpdates.end(); i++)
{
- OSL_ASSERT(i->aPackageManager.is());
+ OSL_ASSERT(i->aInstalledPackage.is());
//If the user has no write access to the shared folder then the update
//for a shared extension is disable, that is it cannot be in m_enabledUpdates
- OSL_ASSERT(i->aPackageManager->isReadOnly() == sal_False);
+// OSL_ASSERT(isReadOnly(i->aInstalledPackage) == sal_False);
#if 0
// TODO: check!
OSL_ASSERT(m_extensionManagerDialog.get());
@@ -1248,6 +1255,7 @@ IMPL_LINK(UpdateDialog, okHandler, void *, EMPTYARG)
#endif
}
+
for (USHORT i = 0; i < m_updates.getItemCount(); ++i) {
UpdateDialog::Index const * p =
static_cast< UpdateDialog::Index const * >(
@@ -1256,6 +1264,7 @@ IMPL_LINK(UpdateDialog, okHandler, void *, EMPTYARG)
m_updateData.push_back(m_enabledUpdates[p->index.enabledUpdate]);
}
}
+
EndDialog(RET_OK);
return 0;
}
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
index 1a8484e2c20f..32c317cb8735 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
@@ -60,7 +60,8 @@ class Window;
namespace com { namespace sun { namespace star {
namespace awt { class XThrobber; }
- namespace deployment { class XPackageManager; }
+ namespace deployment { class XExtensionManager;
+ class XPackage; }
namespace uno { class XComponentContext; }
} } }
@@ -82,16 +83,17 @@ public:
@param parent
the parent window, may be null
- @param selectedPackages
- if non-null, only check for updates for the selected packages
-
- @param packageManagers
- if non-null, check for updates for all managed packages
+ @param vExtensionList
+ check for updates for the contained extensions. There must only be one extension with
+ a particular identifier. If one extension is installed in several repositories, then the
+ one with the highest version must be used, because it contains the latest known update
+ information.
*/
UpdateDialog(
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const & context,
Window * parent,
- const std::vector< dp_gui::TUpdateListEntry > &vExtensionList,
+ const std::vector< com::sun::star::uno::Reference<
+ com::sun::star::deployment::XPackage > > & vExtensionList,
std::vector< dp_gui::UpdateData > * updateData);
~UpdateDialog();
@@ -141,6 +143,7 @@ private:
UpdateDialog & m_dialog;
};
+
friend class CheckListBox;
void insertItem(
@@ -168,9 +171,14 @@ private:
void initDescription();
void clearDescription();
+ bool showDescription(::com::sun::star::uno::Reference<
+ ::com::sun::star::deployment::XPackage > const & aExtension);
+ bool showDescription(std::pair< rtl::OUString, rtl::OUString > const & pairPublisher,
+ rtl::OUString const & sReleaseNotes);
bool showDescription( ::com::sun::star::uno::Reference<
::com::sun::star::xml::dom::XNode > const & aUpdateInfo);
bool showDescription( const String& rDescription, bool bWithPublisher );
+ bool isReadOnly( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage ) const;
DECL_LINK(selectionHandler, void *);
DECL_LINK(allHandler, void *);
@@ -204,8 +212,6 @@ private:
rtl::OUString m_noInstall;
rtl::OUString m_noDependency;
rtl::OUString m_noDependencyCurVer;
- rtl::OUString m_noPermission;
- rtl::OUString m_noPermissionVista;
rtl::OUString m_browserbased;
rtl::OUString m_version;
std::vector< dp_gui::UpdateData > m_enabledUpdates;
@@ -214,6 +220,7 @@ private:
std::vector< UpdateDialog::SpecificError > m_specificErrors;
std::vector< dp_gui::UpdateData > & m_updateData;
rtl::Reference< UpdateDialog::Thread > m_thread;
+ ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager > m_xExtensionManager;
Point m_aFirstLinePos;
Size m_aFirstLineSize;
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.src b/desktop/source/deployment/gui/dp_gui_updatedialog.src
index b86a8ad66f08..325d98c88d48 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.src
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.src
@@ -244,18 +244,6 @@ ModalDialog RID_DLG_UPDATE {
String RID_DLG_UPDATE_NODEPENDENCY_CUR_VER {
Text[en-US] = "You have OpenOffice.org %VERSION";
};
- String RID_DLG_UPDATE_NOPERMISSION {
- Text[en-US] = "No write permission (shared extension).";
- };
- String RID_DLG_UPDATE_NOPERMISSION_VISTA {
- Text[en-US] = "No write permission. %PRODUCTNAME needs to run as administrator.\n"
- "Please follow these steps to update this shared extension:\n"
- "1. Close Extension Manager dialog.\n"
- "2. Exit %PRODUCTNAME.\n"
- "3. Exit %PRODUCTNAME Quickstarter located in the tray area of Windows.\n"
- "4. Run %PRODUCTNAME as administrator. In order to do this call the context menu of the %PRODUCTNAME program icon and choose \'Run as administrator\'.\n"
- "5. Call the Extension Manager dialog and update this shared extension.\n";
- };
String RID_DLG_UPDATE_BROWSERBASED {
Text[en-US] = "browser based update";
};
diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
index 113e6d2069ac..067a703ec413 100644
--- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
@@ -46,6 +46,7 @@
#include "cppuhelper/implbase3.hxx"
#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/beans/NamedValue.hpp"
#include "com/sun/star/xml/dom/XElement.hpp"
#include "com/sun/star/xml/dom/XNode.hpp"
#include "com/sun/star/xml/dom/XNodeList.hpp"
@@ -53,7 +54,8 @@
#include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp"
#include "com/sun/star/ucb/XCommandEnvironment.hpp"
#include "com/sun/star/ucb/XProgressHandler.hpp"
-#include "com/sun/star/deployment/XPackageManager.hpp"
+#include "com/sun/star/deployment/XExtensionManager.hpp"
+#include "com/sun/star/deployment/ExtensionManager.hpp"
#include "com/sun/star/deployment/XUpdateInformationProvider.hpp"
#include "com/sun/star/deployment/DependencyException.hpp"
#include "com/sun/star/deployment/LicenseException.hpp"
@@ -256,6 +258,8 @@ UpdateInstallDialog::UpdateInstallDialog(
{
FreeResource();
+ m_xExtensionManager = css::deployment::ExtensionManager::get( xCtx );
+
m_cancel.SetClickHdl(LINK(this, UpdateInstallDialog, cancelHandler));
m_mle_info.EnableCursor(FALSE);
if ( ! dp_misc::office_is_running())
@@ -376,13 +380,12 @@ void UpdateInstallDialog::Thread::downloadExtensions()
{
UpdateData & curData = *i;
- OSL_ASSERT(curData.aUpdateInfo.is());
+ if (!curData.aUpdateInfo.is() || curData.aUpdateSource.is())
+ continue;
//We assume that m_aVecUpdateData contains only information about extensions which
//can be downloaded directly.
OSL_ASSERT(curData.sWebsiteURL.getLength() == 0);
- if (!curData.aUpdateInfo.is())
- continue;
//update the name of the extension which is to be downloaded
{
::vos::OGuard g(Application::GetSolarMutex());
@@ -487,15 +490,13 @@ void UpdateInstallDialog::Thread::installExtensions()
// osl::Thread::wait(v);
bool bError = false;
bool bLicenseDeclined = false;
- cssu::Reference<css::deployment::XPackage> xPackage;
+ cssu::Reference<css::deployment::XPackage> xExtension;
UpdateData & curData = *i;
cssu::Exception exc;
try
{
- if (curData.sLocalURL.getLength() == 0)
- continue;
cssu::Reference< css::task::XAbortChannel > xAbortChannel(
- curData.aPackageManager->createAbortChannel() );
+ curData.aInstalledPackage->createAbortChannel() );
{
vos::OGuard g(Application::GetSolarMutex());
if (m_stop) {
@@ -503,8 +504,35 @@ void UpdateInstallDialog::Thread::installExtensions()
}
m_abort = xAbortChannel;
}
- xPackage = curData.aPackageManager->addPackage(
- curData.sLocalURL, OUString(), xAbortChannel, m_updateCmdEnv.get());
+ if (!curData.aUpdateSource.is() && curData.sLocalURL.getLength())
+ {
+ css::beans::NamedValue prop(OUSTR("EXTENSION_UPDATE"), css::uno::makeAny(OUSTR("1")));
+ if (!curData.bIsShared)
+ xExtension = m_dialog.getExtensionManager()->addExtension(
+ curData.sLocalURL, css::uno::Sequence<css::beans::NamedValue>(&prop, 1),
+ OUSTR("user"), xAbortChannel, m_updateCmdEnv.get());
+ else
+ xExtension = m_dialog.getExtensionManager()->addExtension(
+ curData.sLocalURL, css::uno::Sequence<css::beans::NamedValue>(&prop, 1),
+ OUSTR("shared"), xAbortChannel, m_updateCmdEnv.get());
+ }
+ else if (curData.aUpdateSource.is())
+ {
+ OSL_ASSERT(curData.aUpdateSource.is());
+ //I am not sure if we should obtain the install properties and pass them into
+ //add extension. Currently it contains only "SUPPRESS_LICENSE". So it it could happen
+ //that a license is displayed when updating from the shared repository, although the
+ //shared extension was installed using "SUPPRESS_LICENSE".
+ css::beans::NamedValue prop(OUSTR("EXTENSION_UPDATE"), css::uno::makeAny(OUSTR("1")));
+ if (!curData.bIsShared)
+ xExtension = m_dialog.getExtensionManager()->addExtension(
+ curData.aUpdateSource->getURL(), css::uno::Sequence<css::beans::NamedValue>(&prop, 1),
+ OUSTR("user"), xAbortChannel, m_updateCmdEnv.get());
+ else
+ xExtension = m_dialog.getExtensionManager()->addExtension(
+ curData.aUpdateSource->getURL(), css::uno::Sequence<css::beans::NamedValue>(&prop, 1),
+ OUSTR("shared"), xAbortChannel, m_updateCmdEnv.get());
+ }
}
catch (css::deployment::DeploymentException & de)
{
@@ -533,7 +561,7 @@ void UpdateInstallDialog::Thread::installExtensions()
m_dialog.setError(UpdateInstallDialog::ERROR_LICENSE_DECLINED,
curData.aInstalledPackage->getDisplayName(), OUString());
}
- else if (!xPackage.is() || bError)
+ else if (!xExtension.is() || bError)
{
::vos::OGuard g(Application::GetSolarMutex());
if (m_stop) {
diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx
index c3d01c8ee6d9..c0e64a8028e8 100644
--- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx
@@ -41,6 +41,9 @@
#include "dp_gui_autoscrolledit.hxx"
/// @HTML
+namespace com { namespace sun { namespace star { namespace deployment {
+ class XExtensionManager;
+}}}}
namespace com { namespace sun { namespace star { namespace uno {
class XComponentContext;
}}}}
@@ -102,9 +105,12 @@ private:
};
void setError(INSTALL_ERROR err, ::rtl::OUString const & sExtension, ::rtl::OUString const & exceptionMessage);
void setError(::rtl::OUString const & exceptionMessage);
+ ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager > getExtensionManager() const
+ { return m_xExtensionManager; }
rtl::Reference< Thread > m_thread;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xComponentContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager > m_xExtensionManager;
//Signals that an error occurred during download and installation
bool m_bError;
bool m_bNoEntry;
diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx
index 50992eb07a97..9698e257b953 100644
--- a/desktop/source/deployment/gui/license_dialog.cxx
+++ b/desktop/source/deployment/gui/license_dialog.cxx
@@ -116,6 +116,7 @@ struct LicenseDialogImpl : public ModalDialog
LicenseDialogImpl(
Window * pParent,
css::uno::Reference< css::uno::XComponentContext > const & xContext,
+ const ::rtl::OUString & sExtensionName,
const ::rtl::OUString & sLicenseText);
virtual void Activate();
@@ -193,6 +194,7 @@ void LicenseView::Notify( SfxBroadcaster&, const SfxHint& rHint )
LicenseDialogImpl::LicenseDialogImpl(
Window * pParent,
cssu::Reference< cssu::XComponentContext > const & xContext,
+ const ::rtl::OUString & sExtensionName,
const ::rtl::OUString & sLicenseText):
ModalDialog(pParent, DpGuiResId(RID_DLG_LICENSE))
,m_xComponentContext(xContext)
@@ -225,6 +227,7 @@ LicenseDialogImpl::LicenseDialogImpl(
m_fiArrow1.Show(true);
m_fiArrow2.Show(false);
m_mlLicense.SetText(sLicenseText);
+ m_ftHead.SetText(m_ftHead.GetText() + OUString('\n') + sExtensionName);
m_mlLicense.SetEndReachedHdl( LINK(this, LicenseDialogImpl, EndReachedHdl) );
m_mlLicense.SetScrolledHdl( LINK(this, LicenseDialogImpl, ScrolledHdl) );
@@ -296,7 +299,7 @@ LicenseDialog::LicenseDialog( Sequence<Any> const& args,
Reference<XComponentContext> const& xComponentContext)
: m_xComponentContext(xComponentContext)
{
- comphelper::unwrapArgs( args, m_parent, m_sLicenseText );
+ comphelper::unwrapArgs( args, m_parent, m_sExtensionName, m_sLicenseText );
}
// XExecutableDialog
@@ -315,8 +318,10 @@ sal_Int16 LicenseDialog::execute() throw (RuntimeException)
sal_Int16 LicenseDialog::solar_execute()
{
- std::auto_ptr<LicenseDialogImpl> dlg(new LicenseDialogImpl(
- VCLUnoHelper::GetWindow(m_parent), m_xComponentContext, m_sLicenseText));
+ std::auto_ptr<LicenseDialogImpl> dlg(
+ new LicenseDialogImpl(
+ VCLUnoHelper::GetWindow(m_parent),
+ m_xComponentContext, m_sExtensionName, m_sLicenseText));
return dlg->Execute();
}
diff --git a/desktop/source/deployment/gui/license_dialog.hxx b/desktop/source/deployment/gui/license_dialog.hxx
index 4733922dc607..bb4a6b6646c8 100644
--- a/desktop/source/deployment/gui/license_dialog.hxx
+++ b/desktop/source/deployment/gui/license_dialog.hxx
@@ -48,6 +48,7 @@ class LicenseDialog
{
Reference<XComponentContext> const m_xComponentContext;
Reference<awt::XWindow> /* const */ m_parent;
+ OUString m_sExtensionName;
OUString /* const */ m_sLicenseText;
OUString m_initialTitle;
diff --git a/desktop/source/deployment/gui/makefile.mk b/desktop/source/deployment/gui/makefile.mk
index b55ad49421fc..52092a077a4b 100644
--- a/desktop/source/deployment/gui/makefile.mk
+++ b/desktop/source/deployment/gui/makefile.mk
@@ -60,7 +60,7 @@ SLOFILES = \
$(SLO)$/descedit.obj
SHL1TARGET = $(TARGET)$(DLLPOSTFIX).uno
-SHL1VERSIONMAP = ..$/deployment.map
+SHL1VERSIONMAP = $(SOLARENV)/src/component.map
SHL1STDLIBS = \
$(SALLIB) \
@@ -77,6 +77,7 @@ SHL1STDLIBS = \
$(SVTOOLLIB) \
$(SVLLIB) \
$(SVXLIB) \
+ $(SVXCORELIB) \
$(SFXLIB) \
$(DEPLOYMENTMISCLIB) \
$(OLE32LIB)
diff --git a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx b/desktop/source/deployment/inc/dp_descriptioninfoset.hxx
index 38a1870782ed..37e616bb1a0b 100644
--- a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx
+++ b/desktop/source/deployment/inc/dp_descriptioninfoset.hxx
@@ -62,6 +62,7 @@ struct DESKTOP_DEPLOYMENTMISC_DLLPUBLIC SimpleLicenseAttributes
bool suppressIfRequired;
};
+
/**
Access to the content of an XML <code>description</code> element.
@@ -216,15 +217,7 @@ public:
*/
::rtl::OUString getIconURL( sal_Bool bHighContrast ) const;
- /**
- Allow direct access to the XPath functionality.
-
- @return
- direct access to the XPath functionality; null iff this instance was
- constructed with a null <code>element</code>
- */
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::xpath::XXPathAPI >
- getXpath() const;
+ bool hasDescription() const;
private:
SAL_DLLPRIVATE ::boost::optional< ::rtl::OUString > getOptionalValue(
@@ -289,6 +282,18 @@ private:
::com::sun::star::xml::xpath::XXPathAPI > m_xpath;
};
+inline bool DescriptionInfoset::hasDescription() const
+{
+ return m_element.is();
+}
+
+/** creates a DescriptionInfoset object.
+
+ The argument sExtensionFolderURL is a file URL to extension folder containing
+ the description.xml.
+ */
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+DescriptionInfoset getDescriptionInfoset(::rtl::OUString const & sExtensionFolderURL);
}
#endif
diff --git a/desktop/source/deployment/inc/dp_misc.h b/desktop/source/deployment/inc/dp_misc.h
index a717e7797c8a..61e3fcc45418 100644
--- a/desktop/source/deployment/inc/dp_misc.h
+++ b/desktop/source/deployment/inc/dp_misc.h
@@ -36,6 +36,7 @@
#include "com/sun/star/lang/XComponent.hpp"
#include "com/sun/star/lang/DisposedException.hpp"
#include "com/sun/star/deployment/XPackageRegistry.hpp"
+#include "com/sun/star/ucb/XCommandEnvironment.hpp"
#include "com/sun/star/awt/XWindow.hpp"
#include "dp_misc_api.hxx"
@@ -69,14 +70,33 @@ inline void try_dispose( ::com::sun::star::uno::Reference< ::com::sun::star::uno
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
::rtl::OUString expandUnoRcTerm( ::rtl::OUString const & term );
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+::rtl::OUString makeRcTerm( ::rtl::OUString const & url );
+
//==============================================================================
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
::rtl::OUString expandUnoRcUrl( ::rtl::OUString const & url );
//==============================================================================
+
+/** appends a relative path to a url.
+
+ The relative path must already be correctly encoded for use in an URL.
+ If the URL starts with vnd.sun.star.expand then the relative path will
+ be again encoded for use in an "expand" URL.
+ */
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC ::rtl::OUString makeURL(
::rtl::OUString const & baseURL, ::rtl::OUString const & relPath );
+
+/** appends a relative path to a url.
+
+ This is the same as makeURL, but the relative Path must me a segment
+ of an system path.
+ */
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC ::rtl::OUString makeURLAppendSysPathSegment(
+ ::rtl::OUString const & baseURL, ::rtl::OUString const & relPath );
+
//==============================================================================
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC ::rtl::OUString generateRandomPipeId();
@@ -97,11 +117,6 @@ oslProcess raiseProcess( ::rtl::OUString const & appURL,
::com::sun::star::uno::Sequence< ::rtl::OUString > const & args );
//==============================================================================
-/** returns the default update URL (for the update information) which
- is used when an extension does not provide its own URL.
-*/
-DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
-::rtl::OUString getExtensionDefaultUpdateURL();
/** writes the argument string to the console.
On Linux/Unix/etc. it converts the UTF16 string to an ANSI string using
@@ -151,6 +166,14 @@ DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
void TRACE(::rtl::OUString const & sText);
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
void TRACE(::rtl::OString const & sText);
+
+/** registers or revokes shared or bundled extensions which have been
+ recently added or removed.
+*/
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+void syncRepositories(::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XCommandEnvironment> const & xCmdEnv);
+
}
#endif
diff --git a/desktop/source/deployment/inc/dp_ucb.h b/desktop/source/deployment/inc/dp_ucb.h
index 6f9127504860..03144388e8a8 100644
--- a/desktop/source/deployment/inc/dp_ucb.h
+++ b/desktop/source/deployment/inc/dp_ucb.h
@@ -28,6 +28,7 @@
#if ! defined INCLUDED_DP_UCB_H
#define INCLUDED_DP_UCB_H
+#include <list>
#include "rtl/byteseq.hxx"
#include "rtl/instance.hxx"
#include "com/sun/star/ucb/XCommandEnvironment.hpp"
@@ -79,6 +80,12 @@ DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
bool readLine( ::rtl::OUString * res, ::rtl::OUString const & startingWith,
::ucbhelper::Content & ucb_content, rtl_TextEncoding textenc );
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+bool readProperties( ::std::list< ::std::pair< ::rtl::OUString, ::rtl::OUString> > & out_result,
+ ::ucbhelper::Content & ucb_content);
+
+
+
}
#endif
diff --git a/desktop/source/deployment/inc/dp_update.hxx b/desktop/source/deployment/inc/dp_update.hxx
new file mode 100755
index 000000000000..01511b1f2d21
--- /dev/null
+++ b/desktop/source/deployment/inc/dp_update.hxx
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#if ! defined INCLUDED_DP_UPDATE_HXX
+#define INCLUDED_DP_UPDATE_HXX
+
+
+#include "com/sun/star/deployment/XPackage.hpp"
+#include "com/sun/star/deployment/XExtensionManager.hpp"
+#include "com/sun/star/deployment/XUpdateInformationProvider.hpp"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/xml/dom/XNode.hpp"
+
+#include "rtl/ustrbuf.hxx"
+#include "dp_misc_api.hxx"
+
+#include <map>
+#include <vector>
+
+namespace dp_misc {
+
+/** returns the default update URL (for the update information) which
+ is used when an extension does not provide its own URL.
+*/
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+::rtl::OUString getExtensionDefaultUpdateURL();
+
+enum UPDATE_SOURCE
+{
+ UPDATE_SOURCE_NONE,
+ UPDATE_SOURCE_SHARED,
+ UPDATE_SOURCE_BUNDLED,
+ UPDATE_SOURCE_ONLINE
+};
+
+/* determine if an update is available which is installed in the
+ user repository.
+
+ If the return value is UPDATE_SOURCE_NONE, then no update is
+ available, otherwise the return value determine from which the
+ repository the update is used.
+*/
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+UPDATE_SOURCE isUpdateUserExtension(
+ bool bReadOnlyShared,
+ ::rtl::OUString const & userVersion,
+ ::rtl::OUString const & sharedVersion,
+ ::rtl::OUString const & bundledVersion,
+ ::rtl::OUString const & onlineVersion);
+
+/* determine if an update is available which is installed in the
+ shared repository.
+
+ If the return value is UPDATE_SOURCE_NONE, then no update is
+ available, otherwise the return value determine from which the
+ repository the update is used.
+*/
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+UPDATE_SOURCE isUpdateSharedExtension(
+ bool bReadOnlyShared,
+ ::rtl::OUString const & sharedVersion,
+ ::rtl::OUString const & bundledVersion,
+ ::rtl::OUString const & onlineVersion);
+
+/* determines the extension with the highest identifier and returns it
+
+ */
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage>
+getExtensionWithHighestVersion(
+ ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::deployment::XPackage> > const & seqExtensionsWithSameId);
+
+
+struct UpdateInfo
+{
+ UpdateInfo( ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage> const & ext);
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::deployment::XPackage> extension;
+//version of the update
+ ::rtl::OUString version;
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::dom::XNode > info;
+};
+
+typedef std::map< ::rtl::OUString, UpdateInfo > UpdateInfoMap;
+
+/*
+ @param extensionList
+ List of extension for which online update information are to be obtained. If NULL, then
+ for update information are obtained for all installed extension. There may be only one extension
+ with a particular identifier contained in the list. If one extension is installed
+ in several repositories, then the one with the highest version must be used, because it contains
+ the more recent URLs for getting the update information (if at all).
+ @param out_errors
+ the first member of the pair is the extension and the second the exception that was produced
+ when processing the extension.
+
+ @return
+ A map of UpdateInfo instances. If the parameter extensionList was given, then the map contains
+ at only information for those extensions.
+ */
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+UpdateInfoMap getOnlineUpdateInfos(
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> const &xContext,
+ ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager> const & xExtMgr,
+ ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XUpdateInformationProvider > const & updateInformation,
+ std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > > const * extensionList,
+ ::std::vector< ::std::pair< ::com::sun::star::uno::Reference<
+ ::com::sun::star::deployment::XPackage>, ::com::sun::star::uno::Any> > & out_errors);
+
+/* retunrs the highest version from the provided arguments.
+*/
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+::rtl::OUString getHighestVersion(
+ ::rtl::OUString const & userVersion,
+ ::rtl::OUString const & sharedVersion,
+ ::rtl::OUString const & bundledVersion,
+ ::rtl::OUString const & onlineVersion);
+
+}
+
+#endif
diff --git a/desktop/source/deployment/inc/dp_version.hxx b/desktop/source/deployment/inc/dp_version.hxx
index 9808ebaab388..c459333f97a9 100644
--- a/desktop/source/deployment/inc/dp_version.hxx
+++ b/desktop/source/deployment/inc/dp_version.hxx
@@ -43,13 +43,6 @@ enum Order { LESS, EQUAL, GREATER };
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Order compareVersions(
::rtl::OUString const & version1, ::rtl::OUString const & version2);
-
-DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Order comparePackageVersions(
- ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage >
- const & package1,
- ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage >
- const & package2);
-
}
#endif
diff --git a/desktop/source/deployment/inc/dp_xml.h b/desktop/source/deployment/inc/dp_xml.h
index 41c12f282428..300051bd1512 100644
--- a/desktop/source/deployment/inc/dp_xml.h
+++ b/desktop/source/deployment/inc/dp_xml.h
@@ -52,110 +52,6 @@ void xml_parse(
::ucbhelper::Content & ucb_content,
css::uno::Reference< css::uno::XComponentContext > const & xContext );
-//==============================================================================
-void xml_parse(
- css::uno::Reference< css::xml::input::XRoot > const & xRoot,
- ::ucbhelper::Content & ucb_content,
- css::uno::Reference< css::uno::XComponentContext > const & xContext );
-
-//==============================================================================
-class XmlElement : public ::cppu::WeakImplHelper1< css::xml::input::XElement >
-{
-protected:
- css::uno::Reference<css::xml::input::XNamespaceMapping> m_xNamespaceMapping;
- const css::uno::Reference<css::xml::input::XElement> m_xParent;
- sal_Int32 m_uid;
- ::rtl::OUString m_localname;
- css::uno::Reference<css::xml::input::XAttributes> m_xAttributes;
- ::rtl::OUString m_characters;
- bool m_got_endElement;
-
- void check_xmlns( sal_Int32 uid ) const throw (css::xml::sax::SAXException);
-
- inline XmlElement()
- : m_uid( -1 ),
- m_got_endElement( false )
- {}
- virtual ~XmlElement();
-public:
- inline bool isParsed() const { return m_got_endElement; }
-
- inline XmlElement(
- css::uno::Reference<css::xml::input::XNamespaceMapping>
- const & xMapping,
- css::uno::Reference<css::xml::input::XElement> const & xParent,
- sal_Int32 uid, ::rtl::OUString const & localname,
- css::uno::Reference< css::xml::input::XAttributes >
- const & xAttributes )
- : m_xNamespaceMapping( xMapping ),
- m_xParent( xParent ),
- m_uid( uid ),
- m_localname( localname ),
- m_xAttributes( xAttributes ),
- m_got_endElement( false )
- {}
-
- // XElement
- virtual css::uno::Reference<css::xml::input::XElement> SAL_CALL
- getParent() throw (css::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getLocalName()
- throw (css::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getUid()
- throw (css::uno::RuntimeException);
- virtual css::uno::Reference<css::xml::input::XAttributes> SAL_CALL
- getAttributes() throw (css::uno::RuntimeException);
- virtual void SAL_CALL ignorableWhitespace(
- ::rtl::OUString const & rWhitespaces )
- throw (css::xml::sax::SAXException, css::uno::RuntimeException);
- virtual void SAL_CALL characters( ::rtl::OUString const & rChars )
- throw (css::xml::sax::SAXException, css::uno::RuntimeException);
- virtual void SAL_CALL processingInstruction(
- ::rtl::OUString const & Target, ::rtl::OUString const & Data )
- throw (css::xml::sax::SAXException, css::uno::RuntimeException);
- virtual void SAL_CALL endElement()
- throw (css::xml::sax::SAXException, css::uno::RuntimeException);
- virtual css::uno::Reference<css::xml::input::XElement> SAL_CALL
- startChildElement(
- sal_Int32 nUid, ::rtl::OUString const & rLocalName,
- css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
- throw (css::xml::sax::SAXException, css::uno::RuntimeException);
-};
-
-//==============================================================================
-class XmlRootElement : public ::cppu::ImplInheritanceHelper1<
- XmlElement, css::xml::input::XRoot >
-{
- const ::rtl::OUString m_uri;
-
-protected:
- virtual ~XmlRootElement();
-public:
- inline ::rtl::OUString const & getUri() const
- { return m_uri; }
-
- XmlRootElement(
- ::rtl::OUString const & uri, ::rtl::OUString const & localname );
-
- // XRoot
- virtual void SAL_CALL startDocument(
- css::uno::Reference<css::xml::input::XNamespaceMapping>
- const & xMapping )
- throw (css::xml::sax::SAXException, css::uno::RuntimeException);
- virtual void SAL_CALL endDocument()
- throw (css::xml::sax::SAXException, css::uno::RuntimeException);
- virtual void SAL_CALL processingInstruction(
- ::rtl::OUString const & target, ::rtl::OUString const & data )
- throw (css::xml::sax::SAXException, css::uno::RuntimeException);
- virtual void SAL_CALL setDocumentLocator(
- css::uno::Reference<css::xml::sax::XLocator> const & xLocator )
- throw (css::xml::sax::SAXException, css::uno::RuntimeException);
- virtual css::uno::Reference<css::xml::input::XElement> SAL_CALL
- startRootElement(
- sal_Int32 uid, ::rtl::OUString const & localname,
- css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
- throw (css::xml::sax::SAXException, css::uno::RuntimeException);
-};
-
}
#endif
diff --git a/desktop/source/deployment/makefile.mk b/desktop/source/deployment/makefile.mk
index f11f87ad56cd..6d83a5c1004b 100644
--- a/desktop/source/deployment/makefile.mk
+++ b/desktop/source/deployment/makefile.mk
@@ -49,11 +49,10 @@ INCPRE += inc
DLLPRE =
SHL1TARGET = $(TARGET)$(DLLPOSTFIX).uno
-SHL1VERSIONMAP = deployment.map
+SHL1VERSIONMAP = $(SOLARENV)/src/component.map
SHL1LIBS = \
$(SLB)$/deployment_manager.lib \
- $(SLB)$/deployment_migration.lib \
$(SLB)$/deployment_registry.lib \
$(SLB)$/deployment_registry_executable.lib \
$(SLB)$/deployment_registry_component.lib \
@@ -80,8 +79,7 @@ SHL1STDLIBS = \
$(SVLLIB) \
$(UNOTOOLSLIB) \
$(DEPLOYMENTMISCLIB) \
- $(HELPLINKERLIB) \
- $(CONFIGMGRLIB)
+ $(HELPLINKERLIB)
SHL1DEPN =
SHL1IMPLIB = i$(TARGET)
diff --git a/desktop/source/deployment/manager/dp_activepackages.cxx b/desktop/source/deployment/manager/dp_activepackages.cxx
index 04dc22b77a77..8f6b6b82c0b7 100644
--- a/desktop/source/deployment/manager/dp_activepackages.cxx
+++ b/desktop/source/deployment/manager/dp_activepackages.cxx
@@ -96,9 +96,27 @@ static char const legacyPrefix[] = "org.openoffice.legacy.";
OSL_ASSERT(i2 >= 0);
d.fileName = ::rtl::OUString(
value.getStr() + i1 + 1, i2 - i1 - 1, RTL_TEXTENCODING_UTF8);
- d.mediaType = ::rtl::OUString(
- value.getStr() + i2 + 1, value.getLength() - i2 - 1,
- RTL_TEXTENCODING_UTF8);
+ sal_Int32 i3 = value.indexOf(separator, i2 + 1);
+
+ if (i3 < 0)
+ {
+ //Before ActivePackages::Data::version was added
+ d.mediaType = ::rtl::OUString(
+ value.getStr() + i2 + 1, value.getLength() - i2 - 1,
+ RTL_TEXTENCODING_UTF8);
+ }
+ else
+ {
+ sal_Int32 i4 = value.indexOf(separator, i3 + 1);
+ d.mediaType = ::rtl::OUString(
+ value.getStr() + i2 + 1, i3 - i2 -1, RTL_TEXTENCODING_UTF8);
+ d.version = ::rtl::OUString(
+ value.getStr() + i3 + 1, i4 - i3 - 1,
+ RTL_TEXTENCODING_UTF8);
+ d.failedPrerequisites = ::rtl::OUString(
+ value.getStr() + i4 + 1, value.getLength() - i4 - 1,
+ RTL_TEXTENCODING_UTF8);
+ }
return d;
}
@@ -172,6 +190,10 @@ void ActivePackages::put(::rtl::OUString const & id, Data const & data) {
b.append(::rtl::OUStringToOString(data.fileName, RTL_TEXTENCODING_UTF8));
b.append(separator);
b.append(::rtl::OUStringToOString(data.mediaType, RTL_TEXTENCODING_UTF8));
+ b.append(separator);
+ b.append(::rtl::OUStringToOString(data.version, RTL_TEXTENCODING_UTF8));
+ b.append(separator);
+ b.append(::rtl::OUStringToOString(data.failedPrerequisites, RTL_TEXTENCODING_UTF8));
m_map.put(newKey(id), b.makeStringAndClear());
}
diff --git a/desktop/source/deployment/manager/dp_activepackages.hxx b/desktop/source/deployment/manager/dp_activepackages.hxx
index 1c58f76be245..7d9c7e32cfb4 100644
--- a/desktop/source/deployment/manager/dp_activepackages.hxx
+++ b/desktop/source/deployment/manager/dp_activepackages.hxx
@@ -42,9 +42,28 @@ namespace dp_manager {
class ActivePackages {
public:
struct Data {
+ Data(): failedPrerequisites(::rtl::OUString::valueOf((sal_Int32)0))
+ {}
+ /* name of the temporary file (shared, user extension) or the name of
+ the folder of the bundled extension.
+ It does not contain the trailing '_' of the folder.
+ UTF-8 encoded
+ */
::rtl::OUString temporaryName;
+ /* The file name (shared, user) or the folder name (bundled)
+ If the key is the file name, then file name is not encoded.
+ If the key is the idendifier then the file name is UTF-8 encoded.
+ */
::rtl::OUString fileName;
::rtl::OUString mediaType;
+ ::rtl::OUString version;
+ /* If this string contains the value according to
+ com::sun::star::deployment::Prerequisites or "0". That is, if
+ the value is > 0 then
+ the call to XPackage::checkPrerequisites failed.
+ In this case the extension must not be registered.
+ */
+ ::rtl::OUString failedPrerequisites;
};
typedef ::std::vector< ::std::pair< ::rtl::OUString, Data > > Entries;
diff --git a/desktop/source/deployment/manager/dp_commandenvironments.cxx b/desktop/source/deployment/manager/dp_commandenvironments.cxx
new file mode 100644
index 000000000000..c2801ba1d965
--- /dev/null
+++ b/desktop/source/deployment/manager/dp_commandenvironments.cxx
@@ -0,0 +1,286 @@
+/*************************************************************************
+ *
+ * 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_desktop.hxx"
+
+#include "com/sun/star/deployment/VersionException.hpp"
+#include "com/sun/star/deployment/LicenseException.hpp"
+#include "com/sun/star/deployment/InstallException.hpp"
+#include "com/sun/star/task/XInteractionApprove.hpp"
+#include "com/sun/star/task/XInteractionAbort.hpp"
+#include "com/sun/star/task/XInteractionHandler.hpp"
+#include "com/sun/star/ucb/XCommandEnvironment.hpp"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "dp_commandenvironments.hxx"
+
+namespace deployment = com::sun::star::deployment;
+namespace lang = com::sun::star::lang;
+namespace task = com::sun::star::task;
+namespace ucb = com::sun::star::ucb;
+namespace uno = com::sun::star::uno;
+namespace css = com::sun::star;
+
+#define OUSTR(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
+
+using ::com::sun::star::uno::Reference;
+using ::rtl::OUString;
+
+namespace dp_manager {
+
+BaseCommandEnv::BaseCommandEnv()
+{
+}
+
+BaseCommandEnv::BaseCommandEnv(
+ Reference< task::XInteractionHandler> const & handler)
+ : m_forwardHandler(handler)
+{
+}
+
+BaseCommandEnv::~BaseCommandEnv()
+{
+}
+// XCommandEnvironment
+//______________________________________________________________________________
+Reference<task::XInteractionHandler> BaseCommandEnv::getInteractionHandler()
+throw (uno::RuntimeException)
+{
+ return this;
+}
+
+//______________________________________________________________________________
+Reference<ucb::XProgressHandler> BaseCommandEnv::getProgressHandler()
+throw (uno::RuntimeException)
+{
+ return this;
+}
+
+void BaseCommandEnv::handle(
+ Reference< task::XInteractionRequest> const & /*xRequest*/ )
+ throw (uno::RuntimeException)
+{
+}
+
+void BaseCommandEnv::handle_(bool approve, bool abort,
+ Reference< task::XInteractionRequest> const & xRequest )
+{
+ if (approve == false && abort == false)
+ {
+ //not handled so far -> forwarding
+ if (m_forwardHandler.is())
+ m_forwardHandler->handle(xRequest);
+ else
+ return; //cannot handle
+ }
+ else
+ {
+ // select:
+ uno::Sequence< Reference< task::XInteractionContinuation > > conts(
+ xRequest->getContinuations() );
+ Reference< task::XInteractionContinuation > const * pConts =
+ conts.getConstArray();
+ sal_Int32 len = conts.getLength();
+ for ( sal_Int32 pos = 0; pos < len; ++pos )
+ {
+ if (approve) {
+ Reference< task::XInteractionApprove > xInteractionApprove(
+ pConts[ pos ], uno::UNO_QUERY );
+ if (xInteractionApprove.is()) {
+ xInteractionApprove->select();
+ // don't query again for ongoing continuations:
+ approve = false;
+ }
+ }
+ else if (abort) {
+ Reference< task::XInteractionAbort > xInteractionAbort(
+ pConts[ pos ], uno::UNO_QUERY );
+ if (xInteractionAbort.is()) {
+ xInteractionAbort->select();
+ // don't query again for ongoing continuations:
+ abort = false;
+ }
+ }
+ }
+ }
+
+}
+
+// XProgressHandler
+void BaseCommandEnv::push( uno::Any const & /*Status*/ )
+throw (uno::RuntimeException)
+{
+}
+
+
+void BaseCommandEnv::update( uno::Any const & /*Status */)
+throw (uno::RuntimeException)
+{
+}
+
+void BaseCommandEnv::pop() throw (uno::RuntimeException)
+{
+}
+//==============================================================================
+
+TmpRepositoryCommandEnv::TmpRepositoryCommandEnv()
+{
+}
+
+TmpRepositoryCommandEnv::TmpRepositoryCommandEnv(
+ css::uno::Reference< css::task::XInteractionHandler> const & handler):
+ BaseCommandEnv(handler)
+{
+}
+// XInteractionHandler
+void TmpRepositoryCommandEnv::handle(
+ Reference< task::XInteractionRequest> const & xRequest )
+ throw (uno::RuntimeException)
+{
+ uno::Any request( xRequest->getRequest() );
+ OSL_ASSERT( request.getValueTypeClass() == uno::TypeClass_EXCEPTION );
+
+ deployment::VersionException verExc;
+ deployment::LicenseException licExc;
+ deployment::InstallException instExc;
+
+ bool approve = false;
+ bool abort = false;
+
+ if ((request >>= verExc)
+ || (request >>= licExc)
+ || (request >>= instExc))
+ {
+ approve = true;
+ }
+
+ handle_(approve, abort, xRequest);
+}
+//================================================================================
+
+LicenseCommandEnv::LicenseCommandEnv(
+ css::uno::Reference< css::task::XInteractionHandler> const & handler,
+ bool bSuppressLicense,
+ OUString const & repository):
+ BaseCommandEnv(handler), m_repository(repository),
+ m_bSuppressLicense(bSuppressLicense)
+{
+}
+// XInteractionHandler
+void LicenseCommandEnv::handle(
+ Reference< task::XInteractionRequest> const & xRequest )
+ throw (uno::RuntimeException)
+{
+ uno::Any request( xRequest->getRequest() );
+ OSL_ASSERT( request.getValueTypeClass() == uno::TypeClass_EXCEPTION );
+
+
+ deployment::LicenseException licExc;
+
+ bool approve = false;
+ bool abort = false;
+
+ if (request >>= licExc)
+ {
+ if (m_bSuppressLicense
+ || m_repository.equals(OUSTR("bundled"))
+ || licExc.AcceptBy.equals(OUSTR("admin")))
+ {
+ //always approve in bundled case, because we do not support
+ //showing licenses anyway.
+ //The "admin" already accepted the license when installing the
+ // shared extension
+ approve = true;
+ }
+ }
+
+ handle_(approve, abort, xRequest);
+}
+
+//================================================================================
+//================================================================================
+
+NoLicenseCommandEnv::NoLicenseCommandEnv(
+ css::uno::Reference< css::task::XInteractionHandler> const & handler):
+ BaseCommandEnv(handler)
+{
+}
+// XInteractionHandler
+void NoLicenseCommandEnv::handle(
+ Reference< task::XInteractionRequest> const & xRequest )
+ throw (uno::RuntimeException)
+{
+ uno::Any request( xRequest->getRequest() );
+ OSL_ASSERT( request.getValueTypeClass() == uno::TypeClass_EXCEPTION );
+
+
+ deployment::LicenseException licExc;
+
+ bool approve = false;
+ bool abort = false;
+
+ if (request >>= licExc)
+ {
+ approve = true;
+ }
+ handle_(approve, abort, xRequest);
+}
+
+
+// NoExceptionCommandEnv::NoExceptionCommandEnv(
+// css::uno::Reference< css::task::XInteractionHandler> const & handler,
+// css::uno::Type const & type):
+// BaseCommandEnv(handler),
+// m_type(type)
+// {
+// }
+// // XInteractionHandler
+// void NoExceptionCommandEnv::handle(
+// Reference< task::XInteractionRequest> const & xRequest )
+// throw (uno::RuntimeException)
+// {
+// uno::Any request( xRequest->getRequest() );
+// OSL_ASSERT( request.getValueTypeClass() == uno::TypeClass_EXCEPTION );
+
+
+// deployment::LicenseException licExc;
+
+// bool approve = false;
+// bool abort = false;
+
+// if (request.getValueType() == m_type)
+// {
+// approve = true;
+// }
+// handle_(approve, abort, xRequest);
+// }
+
+
+
+} // namespace dp_manager
+
+
diff --git a/desktop/source/deployment/manager/dp_commandenvironments.hxx b/desktop/source/deployment/manager/dp_commandenvironments.hxx
new file mode 100644
index 000000000000..aa21f8281c72
--- /dev/null
+++ b/desktop/source/deployment/manager/dp_commandenvironments.hxx
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#if ! defined INCLUDED_DP_COMMANDENVIRONMENTS_HXX
+#define INCLUDED_DP_COMMANDENVIRONMENTS_HXX
+
+
+#include "cppuhelper/compbase3.hxx"
+//#include "cppuhelper/implbase2.hxx"
+#include "ucbhelper/content.hxx"
+#include "com/sun/star/uno/Type.hxx"
+
+
+namespace css = ::com::sun::star;
+
+namespace dp_manager {
+
+
+
+/**
+ This command environment is to be used when an extension is temporarily
+ stored in the "tmp" repository. It prevents all kind of user interaction.
+ */
+class BaseCommandEnv
+ : public ::cppu::WeakImplHelper3< css::ucb::XCommandEnvironment,
+ css::task::XInteractionHandler,
+ css::ucb::XProgressHandler >
+{
+protected:
+ css::uno::Reference< css::uno::XComponentContext > m_xContext;
+ css::uno::Reference< css::task::XInteractionHandler> m_forwardHandler;
+
+ void handle_(bool approve, bool abort,
+ css::uno::Reference< css::task::XInteractionRequest> const & xRequest );
+public:
+ virtual ~BaseCommandEnv();
+ BaseCommandEnv();
+ BaseCommandEnv(
+ css::uno::Reference< css::task::XInteractionHandler> const & handler);
+
+ // XCommandEnvironment
+ virtual css::uno::Reference<css::task::XInteractionHandler > SAL_CALL
+ getInteractionHandler() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference<css::ucb::XProgressHandler >
+ SAL_CALL getProgressHandler() throw (css::uno::RuntimeException);
+
+ // XInteractionHandler
+ virtual void SAL_CALL handle(
+ css::uno::Reference<css::task::XInteractionRequest > const & xRequest )
+ throw (css::uno::RuntimeException);
+
+ // XProgressHandler
+ virtual void SAL_CALL push( css::uno::Any const & Status )
+ throw (css::uno::RuntimeException);
+ virtual void SAL_CALL update( css::uno::Any const & Status )
+ throw (css::uno::RuntimeException);
+ virtual void SAL_CALL pop() throw (css::uno::RuntimeException);
+};
+
+class TmpRepositoryCommandEnv : public BaseCommandEnv
+{
+public:
+ TmpRepositoryCommandEnv();
+ TmpRepositoryCommandEnv(css::uno::Reference< css::task::XInteractionHandler> const & handler);
+
+// XInteractionHandler
+ virtual void SAL_CALL handle(
+ css::uno::Reference<css::task::XInteractionRequest > const & xRequest )
+ throw (css::uno::RuntimeException);
+
+};
+
+/** this class is for use in XPackageManager::synchronize.
+
+ It handles particular license cases.
+ */
+class LicenseCommandEnv : public BaseCommandEnv
+{
+private:
+ ::rtl::OUString m_repository;
+ bool m_bSuppressLicense;
+public:
+ LicenseCommandEnv(){};
+ LicenseCommandEnv(
+ css::uno::Reference< css::task::XInteractionHandler> const & handler,
+ bool bSuppressLicense,
+ ::rtl::OUString const & repository);
+
+// XInteractionHandler
+ virtual void SAL_CALL handle(
+ css::uno::Reference<css::task::XInteractionRequest > const & xRequest )
+ throw (css::uno::RuntimeException);
+
+};
+
+/** this class is for use in XPackageManager::checkPrerequisites
+
+ It always prohibits a license interaction
+ */
+class NoLicenseCommandEnv : public BaseCommandEnv
+{
+
+public:
+ NoLicenseCommandEnv(){};
+ NoLicenseCommandEnv(css::uno::Reference< css::task::XInteractionHandler> const & handler);
+
+// XInteractionHandler
+ virtual void SAL_CALL handle(
+ css::uno::Reference<css::task::XInteractionRequest > const & xRequest )
+ throw (css::uno::RuntimeException);
+
+};
+
+// class NoExceptionCommandEnv : public BaseCommandEnv
+// {
+// css::uno::Type m_type;
+// public:
+// NoExceptionCommandEnv::NoExceptionCommandEnv(){};
+// NoExceptionCommandEnv::NoExceptionCommandEnv(
+// css::uno::Reference< css::task::XInteractionHandler> const & handler,
+// css::uno::Type const & type);
+
+// // XInteractionHandler
+// virtual void SAL_CALL handle(
+// css::uno::Reference<css::task::XInteractionRequest > const & xRequest )
+// throw (css::uno::RuntimeException);
+
+// };
+
+}
+
+
+
+
+#endif
+
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx
new file mode 100644
index 000000000000..de9d97db2b48
--- /dev/null
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -0,0 +1,1361 @@
+/*************************************************************************
+ *
+ * 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_desktop.hxx"
+
+#include <cppuhelper/implbase1.hxx>
+
+#include "comphelper/servicedecl.hxx"
+#include "cppuhelper/exc_hlp.hxx"
+#include "rtl/bootstrap.hxx"
+#include "com/sun/star/deployment/ExtensionManager.hpp"
+#include "com/sun/star/deployment/XExtensionManager.hpp"
+#include "com/sun/star/deployment/thePackageManagerFactory.hpp"
+#include "com/sun/star/deployment/XPackageManager.hpp"
+#include "com/sun/star/deployment/XPackageManagerFactory.hpp"
+#include "com/sun/star/deployment/XPackage.hpp"
+#include "com/sun/star/deployment/InstallException.hpp"
+#include "com/sun/star/deployment/VersionException.hpp"
+#include "com/sun/star/deployment/LicenseException.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/registry/XRegistryKey.hpp"
+#include "com/sun/star/beans/Optional.hpp"
+#include "com/sun/star/task/XInteractionApprove.hpp"
+#include "com/sun/star/beans/Ambiguous.hpp"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/io/XInputStream.hpp"
+#include "com/sun/star/util/XModifyBroadcaster.hpp"
+#include "comphelper/sequence.hxx"
+#include "xmlscript/xml_helper.hxx"
+#include "osl/diagnose.h"
+#include "dp_interact.h"
+#include "dp_resource.h"
+#include "dp_ucb.h"
+#include "dp_identifier.hxx"
+#include "dp_descriptioninfoset.hxx"
+#include "dp_extensionmanager.hxx"
+#include "dp_commandenvironments.hxx"
+#include "dp_properties.hxx"
+#include "boost/bind.hpp"
+
+#include <list>
+#include <hash_map>
+#include <algorithm>
+
+namespace deploy = com::sun::star::deployment;
+namespace lang = com::sun::star::lang;
+namespace registry = com::sun::star::registry;
+namespace task = com::sun::star::task;
+namespace ucb = com::sun::star::ucb;
+namespace uno = com::sun::star::uno;
+namespace beans = com::sun::star::beans;
+namespace util = com::sun::star::util;
+namespace css = com::sun::star;
+
+
+//#define OUSTR(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
+
+using ::com::sun::star::uno::Reference;
+using ::rtl::OUString;
+
+namespace {
+
+struct CompIdentifiers
+{
+ bool operator() (::std::vector<Reference<deploy::XPackage> > const & a,
+ ::std::vector<Reference<deploy::XPackage> > const & b)
+ {
+
+ if (getName(a).compareTo(getName(b)) < 0)
+ return true;
+ return false;
+ }
+
+ OUString getName(::std::vector<Reference<deploy::XPackage> > const & a);
+};
+
+OUString CompIdentifiers::getName(::std::vector<Reference<deploy::XPackage> > const & a)
+{
+ OSL_ASSERT(a.size() == 3);
+ //get the first non-null reference
+ Reference<deploy::XPackage> extension;
+ ::std::vector<Reference<deploy::XPackage> >::const_iterator it = a.begin();
+ for (; it != a.end(); it++)
+ {
+ if (it->is())
+ {
+ extension = *it;
+ break;
+ }
+ }
+ OSL_ASSERT(extension.is());
+ return extension->getDisplayName();
+}
+
+void writeLastModified(OUString & url, Reference<ucb::XCommandEnvironment> const & xCmdEnv)
+{
+ //Write the lastmodified file
+ try {
+ ::rtl::Bootstrap::expandMacros(url);
+ ::ucbhelper::Content ucbStamp(url, xCmdEnv );
+ dp_misc::erase_path( url, xCmdEnv );
+ ::rtl::OString stamp("1" );
+ Reference<css::io::XInputStream> xData(
+ ::xmlscript::createInputStream(
+ ::rtl::ByteSequence(
+ reinterpret_cast<sal_Int8 const *>(stamp.getStr()),
+ stamp.getLength() ) ) );
+ ucbStamp.writeStream( xData, true /* replace existing */ );
+ }
+ catch(...)
+ {
+ uno::Any exc(::cppu::getCaughtException());
+ throw deploy::DeploymentException(
+ OUSTR("Failed to update") + url, 0, exc);
+ }
+}
+} //end namespace
+
+namespace dp_manager {
+
+
+
+//------------------------------------------------------------------------------
+
+//ToDo: bundled extension
+ExtensionManager::ExtensionManager( Reference< uno::XComponentContext > const& xContext) :
+ ::cppu::WeakComponentImplHelper1< css::deployment::XExtensionManager >(getMutex()),
+ m_xContext( xContext )
+{
+ Reference<deploy::XPackageManagerFactory> xPackageManagerFactory(
+ deploy::thePackageManagerFactory::get(m_xContext));
+ m_userRepository = xPackageManagerFactory->getPackageManager(OUSTR("user"));
+ m_sharedRepository = xPackageManagerFactory->getPackageManager(OUSTR("shared"));
+ m_bundledRepository = xPackageManagerFactory->getPackageManager(OUSTR("bundled"));
+ m_tmpRepository = xPackageManagerFactory->getPackageManager(OUSTR("tmp"));
+
+ m_repositoryNames.push_back(OUSTR("user"));
+ m_repositoryNames.push_back(OUSTR("shared"));
+ m_repositoryNames.push_back(OUSTR("bundled"));
+}
+
+//------------------------------------------------------------------------------
+
+ExtensionManager::~ExtensionManager()
+{
+}
+
+Reference<task::XAbortChannel> ExtensionManager::createAbortChannel()
+ throw (uno::RuntimeException)
+{
+ return new dp_misc::AbortChannel;
+}
+
+css::uno::Reference<css::deployment::XPackageManager>
+ExtensionManager::getPackageManager(::rtl::OUString const & repository)
+ throw (css::lang::IllegalArgumentException)
+{
+ Reference<deploy::XPackageManager> xPackageManager;
+ if (repository.equals(OUSTR("user")))
+ xPackageManager = m_userRepository;
+ else if (repository.equals(OUSTR("shared")))
+ xPackageManager = m_sharedRepository;
+ else if (repository.equals(OUSTR("bundled")))
+ xPackageManager = m_bundledRepository;
+ else
+ throw lang::IllegalArgumentException(
+ OUSTR("No valid repository name provided."),
+ static_cast<cppu::OWeakObject*>(this), 0);
+ return xPackageManager;
+}
+
+
+/*
+ Enters the XPackage objects into a map. They must be all from the
+ same repository. The value type of the map is a vector, where each vector
+ represents an extension with a particular identifier. The first member
+ is represents the user extension, the second the shared extension and the
+ third the bundled extension.
+ */
+void ExtensionManager::addExtensionsToMap(
+ id2extensions & mapExt,
+ uno::Sequence<Reference<deploy::XPackage> > const & seqExt,
+ OUString const & repository)
+{
+ //Determine the index in the vector where these extensions are to be
+ //added.
+ ::std::list<OUString>::const_iterator citNames =
+ m_repositoryNames.begin();
+ int index = 0;
+ for (;citNames != m_repositoryNames.end(); citNames++, index++)
+ {
+ if (citNames->equals(repository))
+ break;
+ }
+
+ for (int i = 0; i < seqExt.getLength(); i++)
+ {
+ Reference<deploy::XPackage> const & xExtension = seqExt[i];
+ OUString id = dp_misc::getIdentifier(xExtension);
+ id2extensions::iterator ivec = mapExt.find(id);
+ if (ivec == mapExt.end())
+ {
+ ::std::vector<Reference<deploy::XPackage> > vec(3);
+ vec[index] = xExtension;
+ mapExt[id] = vec;
+ }
+ else
+ {
+ ivec->second[index] = xExtension;
+ }
+ }
+}
+
+/*
+ returns a list containing extensions with the same identifier from
+ all repositories (user, shared, bundled) If one repository does not
+ have this extension, then the list contains an empty Referenc. The list
+ is ordered according to the priority of the repostories:
+ 1. user
+ 2. shared
+ 3. bundled
+
+ The number of elements is always three, unless the number of repository
+ changes.
+ */
+::std::list<Reference<deploy::XPackage> >
+ ExtensionManager::getExtensionsWithSameId(
+ OUString const & identifier, OUString const & fileName,
+ Reference< ucb::XCommandEnvironment> const & /*xCmdEnv*/)
+
+{
+ ::std::list<Reference<deploy::XPackage> > extensionList;
+ try
+ { //will throw an exception if the extension does not exist
+ extensionList.push_back(m_userRepository->getDeployedPackage(
+ identifier, fileName, Reference<ucb::XCommandEnvironment>()));
+ } catch(lang::IllegalArgumentException &)
+ {
+ extensionList.push_back(Reference<deploy::XPackage>());
+ }
+ try
+ {
+ extensionList.push_back(m_sharedRepository->getDeployedPackage(
+ identifier, fileName, Reference<ucb::XCommandEnvironment>()));
+ } catch (lang::IllegalArgumentException &)
+ {
+ extensionList.push_back(Reference<deploy::XPackage>());
+ }
+ try
+ {
+ extensionList.push_back(m_bundledRepository->getDeployedPackage(
+ identifier, fileName, Reference<ucb::XCommandEnvironment>()));
+ } catch (lang::IllegalArgumentException &)
+ {
+ extensionList.push_back(Reference<deploy::XPackage>());
+ }
+ OSL_ASSERT(extensionList.size() == 3);
+ return extensionList;
+}
+
+uno::Sequence<Reference<deploy::XPackage> >
+ExtensionManager::getExtensionsWithSameIdentifier(
+ OUString const & identifier,
+ OUString const & fileName,
+ Reference< ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (
+ deploy::DeploymentException,
+ ucb::CommandFailedException,
+ lang::IllegalArgumentException,
+ uno::RuntimeException)
+{
+ try
+ {
+ ::std::list<Reference<deploy::XPackage> > listExtensions =
+ getExtensionsWithSameId(
+ identifier, fileName, xCmdEnv);
+ sal_Bool bHasExtension = false;
+
+ //throw an IllegalArgumentException if there is no extension at all.
+ typedef ::std::list<Reference<deploy::XPackage> >::const_iterator CIT;
+ for (CIT i = listExtensions.begin(); i != listExtensions.end(); i++)
+ bHasExtension |= i->is();
+ if (!bHasExtension)
+ throw lang::IllegalArgumentException(
+ OUSTR("Could not find extension: ") + identifier + OUSTR(", ") + fileName,
+ static_cast<cppu::OWeakObject*>(this), -1);
+
+ return comphelper::containerToSequence<
+ Reference<deploy::XPackage>,
+ ::std::list<Reference<deploy::XPackage> >
+ > (listExtensions);
+ }
+ catch (deploy::DeploymentException & )
+ {
+ throw;
+ }
+ catch ( ucb::CommandFailedException & )
+ {
+ throw;
+ }
+ catch (lang::IllegalArgumentException &)
+ {
+ throw;
+ }
+ catch (...)
+ {
+ uno::Any exc = ::cppu::getCaughtException();
+ throw deploy::DeploymentException(
+ OUSTR("Extension Manager: exception during getExtensionsWithSameIdentifier"),
+ static_cast<OWeakObject*>(this), exc);
+ }
+}
+
+
+
+bool ExtensionManager::isUserDisabled(
+ OUString const & identifier, OUString const & fileName)
+{
+ ::std::list<Reference<deploy::XPackage> > listExtensions;
+
+ try {
+ listExtensions = getExtensionsWithSameId(identifier, fileName);
+ } catch (lang::IllegalArgumentException & ) {
+ }
+ OSL_ASSERT(listExtensions.size() == 3);
+
+ return isUserDisabled( ::comphelper::containerToSequence<
+ Reference<deploy::XPackage>,
+ ::std::list<Reference<deploy::XPackage> >
+ > (listExtensions));
+}
+
+bool ExtensionManager::isUserDisabled(
+ uno::Sequence<Reference<deploy::XPackage> > const & seqExtSameId)
+{
+ OSL_ASSERT(seqExtSameId.getLength() == 3);
+ Reference<deploy::XPackage> const & userExtension = seqExtSameId[0];
+ if (userExtension.is())
+ {
+ beans::Optional<beans::Ambiguous<sal_Bool> > reg =
+ userExtension->isRegistered(Reference<task::XAbortChannel>(),
+ Reference<ucb::XCommandEnvironment>());
+ //If the value is ambiguous is than we assume that the extension
+ //is enabled, but something went wrong during enabling. We do not
+ //automatically disable user extensions.
+ if (reg.IsPresent &&
+ ! reg.Value.IsAmbiguous && ! reg.Value.Value)
+ return true;
+ }
+ return false;
+}
+
+/*
+ This method determines the active extension (XPackage.registerPackage) with a
+ particular identifier.
+
+ The parameter bUserDisabled determines if the user extension is disabled.
+
+ When the user repository contains an extension with the given identifier and
+ it is not disabled by the user, then it is always registered. Otherwise an
+ extension is only registered when there is no registered extension in one of
+ the repositories with a higher priority. That is, if the extension is from
+ the shared repository and an active extension with the same identifer is in
+ the user repository, then the extension is not registered. Similarly a
+ bundled extension is not registered if there is an active extension with the
+ same identifier in the shared or user repository.
+*/
+void ExtensionManager::activateExtension(
+ OUString const & identifier, OUString const & fileName,
+ bool bUserDisabled,
+ bool bStartup,
+ Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
+{
+ ::std::list<Reference<deploy::XPackage> > listExtensions;
+ try {
+ listExtensions = getExtensionsWithSameId(identifier, fileName);
+ } catch (lang::IllegalArgumentException &) {
+ }
+ OSL_ASSERT(listExtensions.size() == 3);
+
+ activateExtension(
+ ::comphelper::containerToSequence<
+ Reference<deploy::XPackage>,
+ ::std::list<Reference<deploy::XPackage> >
+ > (listExtensions),
+ bUserDisabled, bStartup, xAbortChannel, xCmdEnv);
+
+ fireModified();
+}
+
+void ExtensionManager::activateExtension(
+ uno::Sequence<Reference<deploy::XPackage> > const & seqExt,
+ bool bUserDisabled,
+ bool bStartup,
+ Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
+{
+ bool bActive = false;
+ sal_Int32 len = seqExt.getLength();
+ for (sal_Int32 i = 0; i < len; i++)
+ {
+ Reference<deploy::XPackage> const & aExt = seqExt[i];
+ if (aExt.is())
+ {
+ //get the registration value of the current iteration
+ beans::Optional<beans::Ambiguous<sal_Bool> > optReg =
+ aExt->isRegistered(xAbortChannel, xCmdEnv);
+ //If nothing can be registered then break
+ if (!optReg.IsPresent)
+ break;
+
+ //Check if this is a disabled user extension,
+ if (i == 0 && bUserDisabled)
+ {
+ aExt->revokePackage(xAbortChannel, xCmdEnv);
+ continue;
+ }
+
+ //If we have already determined an active extension then we must
+ //make sure to unregister all extensions with the same id in
+ //repositories with a lower priority
+ if (bActive)
+ {
+ aExt->revokePackage(xAbortChannel, xCmdEnv);
+ }
+ else
+ {
+ //This is the first extension in the ordered list, which becomes
+ //the active extension
+ bActive = true;
+ //Register if not already done.
+ //reregister if the value is ambiguous, which indicates that
+ //something went wrong during last registration.
+ aExt->registerPackage(bStartup, xAbortChannel, xCmdEnv);
+ }
+ }
+ }
+}
+
+Reference<deploy::XPackage> ExtensionManager::backupExtension(
+ OUString const & identifier, OUString const & fileName,
+ Reference<deploy::XPackageManager> const & xPackageManager,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
+{
+ Reference<deploy::XPackage> xBackup;
+ Reference<ucb::XCommandEnvironment> tmpCmdEnv(
+ new TmpRepositoryCommandEnv(xCmdEnv->getInteractionHandler()));
+ Reference<deploy::XPackage> xOldExtension;
+ xOldExtension = xPackageManager->getDeployedPackage(
+ identifier, fileName, tmpCmdEnv);
+
+ if (xOldExtension.is())
+ {
+ xBackup = m_tmpRepository->addPackage(
+ xOldExtension->getURL(), uno::Sequence<beans::NamedValue>(),
+ OUString(), Reference<task::XAbortChannel>(), tmpCmdEnv);
+
+ OSL_ENSURE(xBackup.is(), "Failed to backup extension");
+ }
+ return xBackup;
+}
+
+//The supported package types are actually determined by the registry. However
+//creating a registry
+//(desktop/source/deployment/registry/dp_registry.cxx:PackageRegistryImpl) will
+//create all the backends, so that the registry can obtain from them the package
+//types. Creating the registry will also set up the registry folder containing
+//all the subfolders for the respective backends.
+//Because all repositories support the same backends, we can just delegate this
+//call to one of the repositories.
+uno::Sequence< Reference<deploy::XPackageTypeInfo> >
+ExtensionManager::getSupportedPackageTypes()
+ throw (uno::RuntimeException)
+{
+ return m_userRepository->getSupportedPackageTypes();
+}
+
+// Only add to shared and user repository
+Reference<deploy::XPackage> ExtensionManager::addExtension(
+ OUString const & url, uno::Sequence<beans::NamedValue> const & properties,
+ OUString const & repository,
+ Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (deploy::DeploymentException,
+ ucb::CommandFailedException,
+ ucb::CommandAbortedException,
+ lang::IllegalArgumentException,
+ uno::RuntimeException)
+{
+ Reference<deploy::XPackage> xNewExtension;
+ //Determine the repository to use
+ Reference<deploy::XPackageManager> xPackageManager;
+ if (repository.equals(OUSTR("user")))
+ xPackageManager = m_userRepository;
+ else if (repository.equals(OUSTR("shared")))
+ xPackageManager = m_sharedRepository;
+ else
+ throw lang::IllegalArgumentException(
+ OUSTR("No valid repository name provided."),
+ static_cast<cppu::OWeakObject*>(this), 0);
+ ::osl::MutexGuard guard(getMutex());
+ Reference<deploy::XPackage> xTmpExtension =
+ getTempExtension(url, xAbortChannel, xCmdEnv);
+ const OUString sIdentifier = dp_misc::getIdentifier(xTmpExtension);
+ const OUString sFileName = xTmpExtension->getName();
+ const OUString sDisplayName = xTmpExtension->getDisplayName();
+ const OUString sVersion = xTmpExtension->getVersion();
+ dp_misc::DescriptionInfoset info(dp_misc::getDescriptionInfoset(xTmpExtension->getURL()));
+ const ::boost::optional<dp_misc::SimpleLicenseAttributes> licenseAttributes =
+ info.getSimpleLicenseAttributes();
+ Reference<deploy::XPackage> xOldExtension;
+ Reference<deploy::XPackage> xExtensionBackup;
+
+ uno::Any excOccurred1;
+ uno::Any excOccurred2;
+ bool bUserDisabled = false;
+ try
+ {
+ bUserDisabled = isUserDisabled(sIdentifier, sFileName);
+ try
+ {
+ xOldExtension = xPackageManager->getDeployedPackage(
+ sIdentifier, sFileName, xCmdEnv);
+ }
+ catch (lang::IllegalArgumentException &)
+ {
+ }
+ bool bCanInstall = false;
+ try
+ {
+ if (xOldExtension.is())
+ {
+ //throws a CommandFailedException if the user cancels
+ //the action.
+ checkUpdate(sVersion, sDisplayName,xOldExtension, xCmdEnv);
+ }
+ else
+ {
+ //throws a CommandFailedException if the user cancels
+ //the action.
+ checkInstall(sDisplayName, xCmdEnv);
+ }
+ //Prevent showing the license if requested.
+ Reference<ucb::XCommandEnvironment> _xCmdEnv(xCmdEnv);
+ ExtensionProperties props(OUString(), properties, Reference<ucb::XCommandEnvironment>());
+ if (licenseAttributes && licenseAttributes->suppressIfRequired
+ && props.isSuppressedLicense())
+ _xCmdEnv = Reference<ucb::XCommandEnvironment>(
+ new NoLicenseCommandEnv(xCmdEnv->getInteractionHandler()));
+
+ bCanInstall = xTmpExtension->checkPrerequisites(
+ xAbortChannel, _xCmdEnv, xOldExtension.is() || props.isExtensionUpdate()) == 0 ? true : false;
+ }
+ catch (deploy::DeploymentException& ) {
+ excOccurred1 = ::cppu::getCaughtException();
+ } catch (ucb::CommandFailedException & ) {
+ excOccurred1 = ::cppu::getCaughtException();
+ } catch (ucb::CommandAbortedException & ) {
+ excOccurred1 = ::cppu::getCaughtException();
+ } catch (lang::IllegalArgumentException &) {
+ excOccurred1 = ::cppu::getCaughtException();
+ } catch (uno::RuntimeException &) {
+ excOccurred1 = ::cppu::getCaughtException();
+ } catch (...) {
+ excOccurred1 = ::cppu::getCaughtException();
+ deploy::DeploymentException exc(
+ OUSTR("Extension Manager: exception during addExtension, url: ")
+ + url, static_cast<OWeakObject*>(this), excOccurred1);
+ excOccurred1 <<= exc;
+ }
+
+ if (bCanInstall)
+ {
+ if (xOldExtension.is())
+ {
+ xOldExtension->revokePackage(xAbortChannel, xCmdEnv);
+ //save the old user extension in case the user aborts
+ //store the extension in the tmp repository, this will overwrite
+ //xTmpPackage (same identifier). Do not let the user abort or
+ //interact
+ Reference<ucb::XCommandEnvironment> tmpCmdEnv(
+ new TmpRepositoryCommandEnv(xCmdEnv->getInteractionHandler()));
+ //importing the old extension in the tmp repository will remove
+ //the xTmpExtension
+ xTmpExtension = 0;
+ xExtensionBackup = m_tmpRepository->importExtension(
+ xOldExtension, Reference<task::XAbortChannel>(),
+ tmpCmdEnv);
+ }
+ xNewExtension = xPackageManager->addPackage(
+ url, properties, OUString(), xAbortChannel, xCmdEnv);
+ //If we add a user extension and there is already one which was
+ //disabled by a user, then the newly installed one is enabled. If we
+ //add to another repository then the user extension remains
+ //disabled.
+ bool bUserDisabled2 = bUserDisabled;
+ if (repository.equals(OUSTR("user")))
+ bUserDisabled2 = false;
+ activateExtension(
+ dp_misc::getIdentifier(xNewExtension),
+ xNewExtension->getName(), bUserDisabled2, false, xAbortChannel, xCmdEnv);
+ fireModified();
+ }
+ }
+ catch (deploy::DeploymentException& ) {
+ excOccurred2 = ::cppu::getCaughtException();
+ } catch (ucb::CommandFailedException & ) {
+ excOccurred2 = ::cppu::getCaughtException();
+ } catch (ucb::CommandAbortedException & ) {
+ excOccurred2 = ::cppu::getCaughtException();
+ } catch (lang::IllegalArgumentException &) {
+ excOccurred2 = ::cppu::getCaughtException();
+ } catch (uno::RuntimeException &) {
+ excOccurred2 = ::cppu::getCaughtException();
+ } catch (...) {
+ excOccurred2 = ::cppu::getCaughtException();
+ deploy::DeploymentException exc(
+ OUSTR("Extension Manager: exception during addExtension, url: ")
+ + url, static_cast<OWeakObject*>(this), excOccurred2);
+ excOccurred2 <<= exc;
+ }
+
+ if (excOccurred2.hasValue())
+ {
+ //It does not matter what exception is thrown. We try to
+ //recover the original status.
+ //If the user aborted installation then a ucb::CommandAbortedException
+ //is thrown.
+ //Use a private AbortChannel so the user cannot interrupt.
+ try
+ {
+ Reference<ucb::XCommandEnvironment> tmpCmdEnv(
+ new TmpRepositoryCommandEnv(xCmdEnv->getInteractionHandler()));
+ if (xExtensionBackup.is())
+ {
+ Reference<deploy::XPackage> xRestored =
+ xPackageManager->importExtension(
+ xExtensionBackup, Reference<task::XAbortChannel>(),
+ tmpCmdEnv);
+ }
+ activateExtension(
+ sIdentifier, sFileName, bUserDisabled, false,
+ Reference<task::XAbortChannel>(), tmpCmdEnv);
+ if (xTmpExtension.is() || xExtensionBackup.is())
+ m_tmpRepository->removePackage(
+ sIdentifier, OUString(), xAbortChannel, xCmdEnv);
+ fireModified();
+ }
+ catch (...)
+ {
+ }
+ ::cppu::throwException(excOccurred2);
+ }
+ if (xTmpExtension.is() || xExtensionBackup.is())
+ m_tmpRepository->removePackage(
+ sIdentifier,OUString(), xAbortChannel, xCmdEnv);
+
+ if (excOccurred1.hasValue())
+ ::cppu::throwException(excOccurred1);
+
+ return xNewExtension;
+}
+
+void ExtensionManager::removeExtension(
+ OUString const & identifier, OUString const & fileName,
+ OUString const & repository,
+ Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (deploy::DeploymentException,
+ ucb::CommandFailedException,
+ ucb::CommandAbortedException,
+ lang::IllegalArgumentException,
+ uno::RuntimeException)
+{
+ uno::Any excOccurred1;
+ Reference<deploy::XPackage> xExtensionBackup;
+ Reference<deploy::XPackageManager> xPackageManager;
+ bool bUserDisabled = false;
+ ::osl::MutexGuard guard(getMutex());
+ try
+ {
+//Determine the repository to use
+ if (repository.equals(OUSTR("user")))
+ xPackageManager = m_userRepository;
+ else if (repository.equals(OUSTR("shared")))
+ xPackageManager = m_sharedRepository;
+ else
+ throw lang::IllegalArgumentException(
+ OUSTR("No valid repository name provided."),
+ static_cast<cppu::OWeakObject*>(this), 0);
+
+ bUserDisabled = isUserDisabled(identifier, fileName);
+ //Backup the extension, in case the user cancels the action
+ xExtensionBackup = backupExtension(
+ identifier, fileName, xPackageManager, xCmdEnv);
+
+ //revoke the extension if it is active
+ Reference<deploy::XPackage> xOldExtension =
+ xPackageManager->getDeployedPackage(
+ identifier, fileName, xCmdEnv);
+ xOldExtension->revokePackage(xAbortChannel, xCmdEnv);
+
+ xPackageManager->removePackage(
+ identifier, fileName, xAbortChannel, xCmdEnv);
+ activateExtension(identifier, fileName, bUserDisabled, false,
+ xAbortChannel, xCmdEnv);
+ fireModified();
+ }
+ catch (deploy::DeploymentException& ) {
+ excOccurred1 = ::cppu::getCaughtException();
+ } catch (ucb::CommandFailedException & ) {
+ excOccurred1 = ::cppu::getCaughtException();
+ } catch (ucb::CommandAbortedException & ) {
+ excOccurred1 = ::cppu::getCaughtException();
+ } catch (lang::IllegalArgumentException &) {
+ excOccurred1 = ::cppu::getCaughtException();
+ } catch (uno::RuntimeException &) {
+ excOccurred1 = ::cppu::getCaughtException();
+ } catch (...) {
+ excOccurred1 = ::cppu::getCaughtException();
+ deploy::DeploymentException exc(
+ OUSTR("Extension Manager: exception during removeEtension"),
+ static_cast<OWeakObject*>(this), excOccurred1);
+ excOccurred1 <<= exc;
+ }
+
+ if (excOccurred1.hasValue())
+ {
+ //User aborted installation, restore the previous situation.
+ //Use a private AbortChannel so the user cannot interrupt.
+ try
+ {
+ Reference<ucb::XCommandEnvironment> tmpCmdEnv(
+ new TmpRepositoryCommandEnv(xCmdEnv->getInteractionHandler()));
+ if (xExtensionBackup.is())
+ {
+ Reference<deploy::XPackage> xRestored =
+ xPackageManager->importExtension(
+ xExtensionBackup, Reference<task::XAbortChannel>(),
+ tmpCmdEnv);
+ activateExtension(
+ identifier, fileName, bUserDisabled, false,
+ Reference<task::XAbortChannel>(),
+ tmpCmdEnv);
+
+ m_tmpRepository->removePackage(
+ dp_misc::getIdentifier(xExtensionBackup),
+ xExtensionBackup->getName(), xAbortChannel, xCmdEnv);
+ fireModified();
+ }
+ }
+ catch (...)
+ {
+ }
+ ::cppu::throwException(excOccurred1);
+ }
+
+ if (xExtensionBackup.is())
+ m_tmpRepository->removePackage(
+ dp_misc::getIdentifier(xExtensionBackup),
+ xExtensionBackup->getName(), xAbortChannel, xCmdEnv);
+}
+
+// Only enable extensions from shared and user repository
+void ExtensionManager::enableExtension(
+ Reference<deploy::XPackage> const & extension,
+ Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv)
+ throw (deploy::DeploymentException,
+ ucb::CommandFailedException,
+ ucb::CommandAbortedException,
+ lang::IllegalArgumentException,
+ uno::RuntimeException)
+{
+ ::osl::MutexGuard guard(getMutex());
+ bool bUserDisabled = false;
+ uno::Any excOccurred;
+ try
+ {
+ if (!extension.is())
+ return;
+ OUString repository = extension->getRepositoryName();
+ if (!repository.equals(OUSTR("user")))
+ throw lang::IllegalArgumentException(
+ OUSTR("No valid repository name provided."),
+ static_cast<cppu::OWeakObject*>(this), 0);
+
+ bUserDisabled = isUserDisabled(dp_misc::getIdentifier(extension),
+ extension->getName());
+
+ activateExtension(dp_misc::getIdentifier(extension),
+ extension->getName(), false, false,
+ xAbortChannel, xCmdEnv);
+ }
+ catch (deploy::DeploymentException& ) {
+ excOccurred = ::cppu::getCaughtException();
+ } catch (ucb::CommandFailedException & ) {
+ excOccurred = ::cppu::getCaughtException();
+ } catch (ucb::CommandAbortedException & ) {
+ excOccurred = ::cppu::getCaughtException();
+ } catch (lang::IllegalArgumentException &) {
+ excOccurred = ::cppu::getCaughtException();
+ } catch (uno::RuntimeException &) {
+ excOccurred = ::cppu::getCaughtException();
+ } catch (...) {
+ excOccurred = ::cppu::getCaughtException();
+ deploy::DeploymentException exc(
+ OUSTR("Extension Manager: exception during enableExtension"),
+ static_cast<OWeakObject*>(this), excOccurred);
+ excOccurred <<= exc;
+ }
+
+ if (excOccurred.hasValue())
+ {
+ try
+ {
+ activateExtension(dp_misc::getIdentifier(extension),
+ extension->getName(), bUserDisabled, false,
+ xAbortChannel, xCmdEnv);
+ }
+ catch (...)
+ {
+ }
+ ::cppu::throwException(excOccurred);
+ }
+}
+
+/**
+ */
+sal_Int32 ExtensionManager::checkPrerequisitesAndEnable(
+ Reference<deploy::XPackage> const & extension,
+ Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv)
+ throw (deploy::DeploymentException,
+ ucb::CommandFailedException,
+ ucb::CommandAbortedException,
+ lang::IllegalArgumentException,
+ uno::RuntimeException)
+{
+ try
+ {
+ if (!extension.is())
+ return 0;
+ ::osl::MutexGuard guard(getMutex());
+ sal_Int32 ret = 0;
+ Reference<deploy::XPackageManager> mgr =
+ getPackageManager(extension->getRepositoryName());
+ ret = mgr->checkPrerequisites(extension, xAbortChannel, xCmdEnv);
+ if (ret)
+ {
+ //There are some unfulfilled prerequisites, try to revoke
+ extension->revokePackage(xAbortChannel, xCmdEnv);
+ }
+ const OUString id(dp_misc::getIdentifier(extension));
+ activateExtension(id, extension->getName(),
+ isUserDisabled(id, extension->getName()), false,
+ xAbortChannel, xCmdEnv);
+ return ret;
+ }
+ catch (deploy::DeploymentException& ) {
+ throw;
+ } catch (ucb::CommandFailedException & ) {
+ throw;
+ } catch (ucb::CommandAbortedException & ) {
+ throw;
+ } catch (lang::IllegalArgumentException &) {
+ throw;
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (...) {
+ uno::Any excOccurred = ::cppu::getCaughtException();
+ deploy::DeploymentException exc(
+ OUSTR("Extension Manager: exception during disableExtension"),
+ static_cast<OWeakObject*>(this), excOccurred);
+ throw exc;
+ }
+}
+
+
+void ExtensionManager::disableExtension(
+ Reference<deploy::XPackage> const & extension,
+ Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (deploy::DeploymentException,
+ ucb::CommandFailedException,
+ ucb::CommandAbortedException,
+ lang::IllegalArgumentException,
+ uno::RuntimeException)
+{
+ ::osl::MutexGuard guard(getMutex());
+ uno::Any excOccurred;
+ bool bUserDisabled = false;
+ try
+ {
+ if (!extension.is())
+ return;
+ const OUString repository( extension->getRepositoryName());
+ if (!repository.equals(OUSTR("user")))
+ throw lang::IllegalArgumentException(
+ OUSTR("No valid repository name provided."),
+ static_cast<cppu::OWeakObject*>(this), 0);
+
+ const OUString id(dp_misc::getIdentifier(extension));
+ bUserDisabled = isUserDisabled(id, extension->getName());
+
+ activateExtension(id, extension->getName(), true, false,
+ xAbortChannel, xCmdEnv);
+ }
+ catch (deploy::DeploymentException& ) {
+ excOccurred = ::cppu::getCaughtException();
+ } catch (ucb::CommandFailedException & ) {
+ excOccurred = ::cppu::getCaughtException();
+ } catch (ucb::CommandAbortedException & ) {
+ excOccurred = ::cppu::getCaughtException();
+ } catch (lang::IllegalArgumentException &) {
+ excOccurred = ::cppu::getCaughtException();
+ } catch (uno::RuntimeException &) {
+ excOccurred = ::cppu::getCaughtException();
+ } catch (...) {
+ excOccurred = ::cppu::getCaughtException();
+ deploy::DeploymentException exc(
+ OUSTR("Extension Manager: exception during disableExtension"),
+ static_cast<OWeakObject*>(this), excOccurred);
+ excOccurred <<= exc;
+ }
+
+ if (excOccurred.hasValue())
+ {
+ try
+ {
+ activateExtension(dp_misc::getIdentifier(extension),
+ extension->getName(), bUserDisabled, false,
+ xAbortChannel, xCmdEnv);
+ }
+ catch (...)
+ {
+ }
+ ::cppu::throwException(excOccurred);
+ }
+}
+
+uno::Sequence< Reference<deploy::XPackage> >
+ ExtensionManager::getDeployedExtensions(
+ OUString const & repository,
+ Reference<task::XAbortChannel> const &xAbort,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (deploy::DeploymentException,
+ ucb::CommandFailedException,
+ ucb::CommandAbortedException,
+ lang::IllegalArgumentException,
+ uno::RuntimeException)
+{
+ return getPackageManager(repository)->getDeployedPackages(
+ xAbort, xCmdEnv);
+}
+
+Reference<deploy::XPackage>
+ ExtensionManager::getDeployedExtension(
+ OUString const & repository,
+ OUString const & identifier,
+ OUString const & filename,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (deploy::DeploymentException,
+ ucb::CommandFailedException,
+ lang::IllegalArgumentException,
+ uno::RuntimeException)
+{
+ return getPackageManager(repository)->getDeployedPackage(
+ identifier, filename, xCmdEnv);
+}
+
+uno::Sequence< uno::Sequence<Reference<deploy::XPackage> > >
+ ExtensionManager::getAllExtensions(
+ Reference<task::XAbortChannel> const & xAbort,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (deploy::DeploymentException,
+ ucb::CommandFailedException,
+ ucb::CommandAbortedException,
+ lang::IllegalArgumentException,
+ uno::RuntimeException)
+{
+ try
+ {
+ id2extensions mapExt;
+
+ uno::Sequence<Reference<deploy::XPackage> > userExt =
+ m_userRepository->getDeployedPackages(xAbort, xCmdEnv);
+ addExtensionsToMap(mapExt, userExt, OUSTR("user"));
+ uno::Sequence<Reference<deploy::XPackage> > sharedExt =
+ m_sharedRepository->getDeployedPackages(xAbort, xCmdEnv);
+ addExtensionsToMap(mapExt, sharedExt, OUSTR("shared"));
+ uno::Sequence<Reference<deploy::XPackage> > bundledExt =
+ m_bundledRepository->getDeployedPackages(xAbort, xCmdEnv);
+ addExtensionsToMap(mapExt, bundledExt, OUSTR("bundled"));
+
+ //copy the values of the map to a vector for sorting
+ ::std::vector< ::std::vector<Reference<deploy::XPackage> > >
+ vecExtensions;
+ id2extensions::const_iterator mapIt = mapExt.begin();
+ for (;mapIt != mapExt.end(); mapIt++)
+ vecExtensions.push_back(mapIt->second);
+
+ //sort the element according to the identifier
+ ::std::sort(vecExtensions.begin(), vecExtensions.end(), CompIdentifiers());
+
+ ::std::vector< ::std::vector<Reference<deploy::XPackage> > >::const_iterator
+ citVecVec = vecExtensions.begin();
+ sal_Int32 j = 0;
+ uno::Sequence< uno::Sequence<Reference<deploy::XPackage> > > seqSeq(vecExtensions.size());
+ for (;citVecVec != vecExtensions.end(); citVecVec++, j++)
+ {
+ seqSeq[j] = comphelper::containerToSequence(*citVecVec);
+ }
+ return seqSeq;
+
+ } catch (deploy::DeploymentException& ) {
+ throw;
+ } catch (ucb::CommandFailedException & ) {
+ throw;
+ } catch (ucb::CommandAbortedException & ) {
+ throw;
+ } catch (lang::IllegalArgumentException &) {
+ throw;
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (...) {
+ uno::Any exc = ::cppu::getCaughtException();
+ throw deploy::DeploymentException(
+ OUSTR("Extension Manager: exception during enableExtension"),
+ static_cast<OWeakObject*>(this), exc);
+ }
+}
+
+//only to be called from unopkg!!!
+void ExtensionManager::reinstallDeployedExtensions(
+ OUString const & repository,
+ Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (deploy::DeploymentException,
+ ucb::CommandFailedException, ucb::CommandAbortedException,
+ lang::IllegalArgumentException, uno::RuntimeException)
+{
+ try
+ {
+ Reference<deploy::XPackageManager>
+ xPackageManager = getPackageManager(repository);
+
+ ::osl::MutexGuard guard(getMutex());
+ xPackageManager->reinstallDeployedPackages(xAbortChannel, xCmdEnv);
+ //We must sync here, otherwise we will get exceptions when extensions
+ //are removed.
+ dp_misc::syncRepositories(xCmdEnv);
+ const uno::Sequence< Reference<deploy::XPackage> > extensions(
+ xPackageManager->getDeployedPackages(xAbortChannel, xCmdEnv));
+
+ for ( sal_Int32 pos = 0; pos < extensions.getLength(); ++pos )
+ {
+ try
+ {
+ const OUString id = dp_misc::getIdentifier(extensions[ pos ]);
+ const OUString fileName = extensions[ pos ]->getName();
+ OSL_ASSERT(id.getLength());
+ activateExtension(id, fileName, false, false, xAbortChannel, xCmdEnv );
+ }
+ catch (lang::DisposedException &)
+ {
+ }
+ }
+ } catch (deploy::DeploymentException& ) {
+ throw;
+ } catch (ucb::CommandFailedException & ) {
+ throw;
+ } catch (ucb::CommandAbortedException & ) {
+ throw;
+ } catch (lang::IllegalArgumentException &) {
+ throw;
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (...) {
+ uno::Any exc = ::cppu::getCaughtException();
+ throw deploy::DeploymentException(
+ OUSTR("Extension Manager: exception during enableExtension"),
+ static_cast<OWeakObject*>(this), exc);
+ }
+}
+
+sal_Bool ExtensionManager::synchronize(
+ Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (deploy::DeploymentException,
+ ucb::CommandFailedException,
+ ucb::CommandAbortedException,
+ lang::IllegalArgumentException,
+ uno::RuntimeException)
+{
+ try
+ {
+ sal_Bool bModified = sal_False;
+
+ ::osl::MutexGuard guard(getMutex());
+ String sSynchronizingShared(StrSyncRepository::get());
+ sSynchronizingShared.SearchAndReplaceAllAscii( "%NAME", OUSTR("shared"));
+ dp_misc::ProgressLevel progressShared(xCmdEnv, sSynchronizingShared);
+ bModified = m_sharedRepository->synchronize(xAbortChannel, xCmdEnv);
+ progressShared.update(OUSTR("\n\n"));
+
+ String sSynchronizingBundled(StrSyncRepository::get());
+ sSynchronizingBundled.SearchAndReplaceAllAscii( "%NAME", OUSTR("bundled"));
+ dp_misc::ProgressLevel progressBundled(xCmdEnv, sSynchronizingBundled);
+ bModified |= m_bundledRepository->synchronize(xAbortChannel, xCmdEnv);
+ progressBundled.update(OUSTR("\n\n"));
+
+ try
+ {
+ const uno::Sequence<uno::Sequence<Reference<deploy::XPackage> > >
+ seqSeqExt = getAllExtensions(xAbortChannel, xCmdEnv);
+ for (sal_Int32 i = 0; i < seqSeqExt.getLength(); i++)
+ {
+ uno::Sequence<Reference<deploy::XPackage> > const & seqExt =
+ seqSeqExt[i];
+ activateExtension(seqExt, isUserDisabled(seqExt), true,
+ xAbortChannel, xCmdEnv);
+ }
+ }
+ catch (...)
+ {
+ //We catch the exception, so we can write the lastmodified file
+ //so we will no repeat this everytime OOo starts.
+ OSL_ENSURE(0, "Extensions Manager: synchronize");
+ }
+ OUString lastSyncBundled(RTL_CONSTASCII_USTRINGPARAM(
+ "$BUNDLED_EXTENSIONS_USER/lastsynchronized"));
+ writeLastModified(lastSyncBundled, xCmdEnv);
+ OUString lastSyncShared(RTL_CONSTASCII_USTRINGPARAM(
+ "$SHARED_EXTENSIONS_USER/lastsynchronized"));
+ writeLastModified(lastSyncShared, xCmdEnv);
+ return bModified;
+ } catch (deploy::DeploymentException& ) {
+ throw;
+ } catch (ucb::CommandFailedException & ) {
+ throw;
+ } catch (ucb::CommandAbortedException & ) {
+ throw;
+ } catch (lang::IllegalArgumentException &) {
+ throw;
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (...) {
+ uno::Any exc = ::cppu::getCaughtException();
+ throw deploy::DeploymentException(
+ OUSTR("Extension Manager: exception in synchronize"),
+ static_cast<OWeakObject*>(this), exc);
+ }
+}
+
+// Notify the user when a new extension is to be installed. This is only the
+// case when one uses the system integration to install an extension (double
+// clicking on .oxt file etc.)). The function must only be called if there is no
+// extension with the same identifier already deployed. Then the checkUpdate
+// function will inform the user that the extension is about to be installed In
+// case the user cancels the installation a CommandFailed exception is
+// thrown.
+void ExtensionManager::checkInstall(
+ OUString const & displayName,
+ Reference<ucb::XCommandEnvironment> const & cmdEnv)
+{
+ uno::Any request(
+ deploy::InstallException(
+ OUSTR("Extension ") + displayName +
+ OUSTR(" is about to be installed."),
+ static_cast<OWeakObject *>(this), displayName));
+ bool approve = false, abort = false;
+ if (! dp_misc::interactContinuation(
+ request, task::XInteractionApprove::static_type(),
+ cmdEnv, &approve, &abort ))
+ {
+ OSL_ASSERT( !approve && !abort );
+ throw deploy::DeploymentException(
+ dp_misc::getResourceString(RID_STR_ERROR_WHILE_ADDING) + displayName,
+ static_cast<OWeakObject *>(this), request );
+ }
+ if (abort || !approve)
+ throw ucb::CommandFailedException(
+ dp_misc::getResourceString(RID_STR_ERROR_WHILE_ADDING) + displayName,
+ static_cast<OWeakObject *>(this), request );
+}
+
+/* The function will make the user interaction in case there is an extension
+installed with the same id. This function may only be called if there is already
+an extension.
+*/
+void ExtensionManager::checkUpdate(
+ OUString const & newVersion,
+ OUString const & newDisplayName,
+ Reference<deploy::XPackage> const & oldExtension,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
+{
+ // package already deployed, interact --force:
+ uno::Any request(
+ (deploy::VersionException(
+ dp_misc::getResourceString(
+ RID_STR_PACKAGE_ALREADY_ADDED ) + newDisplayName,
+ static_cast<OWeakObject *>(this), newVersion, newDisplayName,
+ oldExtension ) ) );
+ bool replace = false, abort = false;
+ if (! dp_misc::interactContinuation(
+ request, task::XInteractionApprove::static_type(),
+ xCmdEnv, &replace, &abort )) {
+ OSL_ASSERT( !replace && !abort );
+ throw deploy::DeploymentException(
+ dp_misc::getResourceString(
+ RID_STR_ERROR_WHILE_ADDING) + newDisplayName,
+ static_cast<OWeakObject *>(this), request );
+ }
+ if (abort || !replace)
+ throw ucb::CommandFailedException(
+ dp_misc::getResourceString(
+ RID_STR_PACKAGE_ALREADY_ADDED) + newDisplayName,
+ static_cast<OWeakObject *>(this), request );
+}
+
+Reference<deploy::XPackage> ExtensionManager::getTempExtension(
+ OUString const & url,
+ Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<ucb::XCommandEnvironment> const & /*xCmdEnv*/)
+
+{
+ Reference<ucb::XCommandEnvironment> tmpCmdEnvA(new TmpRepositoryCommandEnv());
+ Reference<deploy::XPackage> xTmpPackage = m_tmpRepository->addPackage(
+ url, uno::Sequence<beans::NamedValue>(),OUString(), xAbortChannel, tmpCmdEnvA);
+ if (!xTmpPackage.is())
+ {
+ throw deploy::DeploymentException(
+ OUSTR("Extension Manager: Failed to create temporary XPackage for url: ") + url,
+ static_cast<OWeakObject*>(this), uno::Any());
+
+ }
+ return xTmpPackage;
+}
+
+uno::Sequence<Reference<deploy::XPackage> > SAL_CALL
+ExtensionManager::getExtensionsWithUnacceptedLicenses(
+ OUString const & repository,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv)
+ throw (deploy::DeploymentException,
+ uno::RuntimeException)
+{
+ Reference<deploy::XPackageManager>
+ xPackageManager = getPackageManager(repository);
+ ::osl::MutexGuard guard(getMutex());
+ return xPackageManager->getExtensionsWithUnacceptedLicenses(xCmdEnv);
+}
+
+sal_Bool ExtensionManager::isReadOnlyRepository(::rtl::OUString const & repository)
+ throw (uno::RuntimeException)
+{
+ return getPackageManager(repository)->isReadOnly();
+}
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+namespace sdecl = comphelper::service_decl;
+sdecl::class_<ExtensionManager> servicePIP;
+extern sdecl::ServiceDecl const serviceDecl(
+ servicePIP,
+ // a private one:
+ "com.sun.star.comp.deployment.ExtensionManager",
+ "com.sun.star.comp.deployment.ExtensionManager");
+
+//------------------------------------------------------------------------------
+bool singleton_entries(
+ uno::Reference< registry::XRegistryKey > const & xRegistryKey )
+{
+ try {
+ uno::Reference< registry::XRegistryKey > xKey(
+ xRegistryKey->createKey(
+ serviceDecl.getImplementationName() +
+ // xxx todo: use future generated function to get singleton name
+ OUSTR("/UNO/SINGLETONS/"
+ "com.sun.star.deployment.ExtensionManager") ) );
+ xKey->setStringValue( serviceDecl.getSupportedServiceNames()[0] );
+ return true;
+ }
+ catch (registry::InvalidRegistryException & exc) {
+ (void) exc; // avoid warnings
+ OSL_ENSURE( 0, ::rtl::OUStringToOString(
+ exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ return false;
+ }
+}
+
+// XModifyBroadcaster
+//______________________________________________________________________________
+void ExtensionManager::addModifyListener(
+ Reference<util::XModifyListener> const & xListener )
+ throw (uno::RuntimeException)
+{
+ check();
+ rBHelper.addListener( ::getCppuType( &xListener ), xListener );
+}
+
+//______________________________________________________________________________
+void ExtensionManager::removeModifyListener(
+ Reference<util::XModifyListener> const & xListener )
+ throw (uno::RuntimeException)
+{
+ check();
+ rBHelper.removeListener( ::getCppuType( &xListener ), xListener );
+}
+
+void ExtensionManager::check()
+{
+ ::osl::MutexGuard guard( getMutex() );
+ if (rBHelper.bInDispose || rBHelper.bDisposed) {
+ throw lang::DisposedException(
+ OUSTR("ExtensionManager instance has already been disposed!"),
+ static_cast<OWeakObject *>(this) );
+ }
+}
+
+void ExtensionManager::fireModified()
+{
+ ::cppu::OInterfaceContainerHelper * pContainer = rBHelper.getContainer(
+ util::XModifyListener::static_type() );
+ if (pContainer != 0) {
+ pContainer->forEach<util::XModifyListener>(
+ boost::bind(&util::XModifyListener::modified, _1,
+ lang::EventObject(static_cast<OWeakObject *>(this))) );
+ }
+}
+
+} // namespace dp_manager
+
+
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.hxx b/desktop/source/deployment/manager/dp_extensionmanager.hxx
new file mode 100644
index 000000000000..64cada7da3ac
--- /dev/null
+++ b/desktop/source/deployment/manager/dp_extensionmanager.hxx
@@ -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.
+ *
+ ************************************************************************/
+
+
+#if ! defined INCLUDED_DP_EXTENSIONMANAGER_H
+#define INCLUDED_DP_EXTENSIONMANAGER_H
+
+#include "dp_manager.hrc"
+#include "dp_misc.h"
+#include "dp_interact.h"
+#include "dp_activepackages.hxx"
+#include "rtl/ref.hxx"
+#include "cppuhelper/compbase1.hxx"
+#include "ucbhelper/content.hxx"
+#include "com/sun/star/deployment/XPackageRegistry.hpp"
+#include "com/sun/star/deployment/XPackageManager.hpp"
+#include "osl/mutex.hxx"
+#include <list>
+
+
+namespace css = ::com::sun::star;
+
+namespace dp_manager {
+
+typedef ::std::hash_map<
+ ::rtl::OUString,
+ ::std::vector<css::uno::Reference<css::deployment::XPackage> >,
+ ::rtl::OUStringHash > id2extensions;
+
+
+class ExtensionManager : private ::dp_misc::MutexHolder,
+ public ::cppu::WeakComponentImplHelper1< css::deployment::XExtensionManager >
+{
+public:
+ ExtensionManager( css::uno::Reference< css::uno::XComponentContext >const& xContext);
+ virtual ~ExtensionManager();
+
+ static css::uno::Sequence< ::rtl::OUString > getServiceNames();
+ static ::rtl::OUString getImplName();
+
+ void check();
+ void fireModified();
+
+public:
+
+// XModifyBroadcaster
+ virtual void SAL_CALL addModifyListener(
+ css::uno::Reference<css::util::XModifyListener> const & xListener )
+ throw (css::uno::RuntimeException);
+ virtual void SAL_CALL removeModifyListener(
+ css::uno::Reference<css::util::XModifyListener> const & xListener )
+ throw (css::uno::RuntimeException);
+
+//XExtensionManager
+ virtual css::uno::Sequence<
+ css::uno::Reference<css::deployment::XPackageTypeInfo> > SAL_CALL
+ getSupportedPackageTypes()
+ throw (css::uno::RuntimeException);
+
+ virtual css::uno::Reference<css::task::XAbortChannel> SAL_CALL
+ createAbortChannel() throw (css::uno::RuntimeException);
+
+ virtual css::uno::Reference<css::deployment::XPackage> SAL_CALL addExtension(
+ ::rtl::OUString const & url,
+ css::uno::Sequence<css::beans::NamedValue> const & properties,
+ ::rtl::OUString const & repository,
+ css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::ucb::CommandAbortedException,
+ css::lang::IllegalArgumentException,
+ css::uno::RuntimeException);
+
+ virtual void SAL_CALL removeExtension(
+ ::rtl::OUString const & identifier,
+ ::rtl::OUString const & filename,
+ ::rtl::OUString const & repository,
+ css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::ucb::CommandAbortedException,
+ css::lang::IllegalArgumentException,
+ css::uno::RuntimeException);
+
+ virtual void SAL_CALL enableExtension(
+ css::uno::Reference<css::deployment::XPackage> const & extension,
+ css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::ucb::CommandAbortedException,
+ css::lang::IllegalArgumentException,
+ css::uno::RuntimeException);
+
+ virtual void SAL_CALL disableExtension(
+ css::uno::Reference<css::deployment::XPackage> const & extension,
+ css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::ucb::CommandAbortedException,
+ css::lang::IllegalArgumentException,
+ css::uno::RuntimeException);
+
+
+ virtual sal_Int32 SAL_CALL checkPrerequisitesAndEnable(
+ css::uno::Reference<css::deployment::XPackage> const & extension,
+ css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::ucb::CommandAbortedException,
+ css::lang::IllegalArgumentException,
+ css::uno::RuntimeException);
+
+
+ virtual css::uno::Sequence< css::uno::Reference<css::deployment::XPackage> >
+ SAL_CALL getDeployedExtensions(
+ ::rtl::OUString const & repository,
+ css::uno::Reference<css::task::XAbortChannel> const &,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::ucb::CommandAbortedException,
+ css::lang::IllegalArgumentException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::deployment::XPackage>
+ SAL_CALL getDeployedExtension(
+ ::rtl::OUString const & repository,
+ ::rtl::OUString const & identifier,
+ ::rtl::OUString const & filename,
+ css::uno::Reference< css::ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (
+ css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::lang::IllegalArgumentException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> >
+ SAL_CALL getExtensionsWithSameIdentifier(
+ ::rtl::OUString const & identifier,
+ ::rtl::OUString const & filename,
+ css::uno::Reference< css::ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (
+ css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::lang::IllegalArgumentException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Sequence< css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> > >
+ SAL_CALL getAllExtensions(
+ css::uno::Reference<css::task::XAbortChannel> const &,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::ucb::CommandAbortedException,
+ css::lang::IllegalArgumentException,
+ css::uno::RuntimeException);
+
+
+ virtual void SAL_CALL reinstallDeployedExtensions(
+ ::rtl::OUString const & repository,
+ css::uno::Reference< css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference< css::ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (
+ css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::ucb::CommandAbortedException,
+ css::lang::IllegalArgumentException,
+ css::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL synchronize(
+ css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::ucb::CommandAbortedException,
+ css::lang::IllegalArgumentException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> > SAL_CALL
+ getExtensionsWithUnacceptedLicenses(
+ ::rtl::OUString const & repository,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv)
+ throw (css::deployment::DeploymentException,
+ css::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL isReadOnlyRepository(::rtl::OUString const & repository)
+ throw (css::uno::RuntimeException);
+
+private:
+
+ struct StrSyncRepository : public ::dp_misc::StaticResourceString<
+ StrSyncRepository, RID_STR_SYNCHRONIZING_REPOSITORY> {};
+
+ struct ExtensionInfos
+ {
+ ::rtl::OUString identifier;
+ ::rtl::OUString fileName;
+ ::rtl::OUString displayName;
+ ::rtl::OUString version;
+ };
+
+ css::uno::Reference< css::uno::XComponentContext> m_xContext;
+
+ css::uno::Reference<css::deployment::XPackageManager> m_userRepository;
+ css::uno::Reference<css::deployment::XPackageManager> m_sharedRepository;
+ css::uno::Reference<css::deployment::XPackageManager> m_bundledRepository;
+ css::uno::Reference<css::deployment::XPackageManager> m_tmpRepository;
+
+ /* contains the names of all repositories (except tmp) in order of there
+ priority. That is, the first element is "user" follod by "shared" and
+ then "bundled"
+ */
+ ::std::list< ::rtl::OUString > m_repositoryNames;
+
+ bool isUserDisabled(::rtl::OUString const & identifier,
+ ::rtl::OUString const & filename);
+
+ bool isUserDisabled(
+ css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> > const & seqExtSameId);
+
+ void activateExtension(
+ ::rtl::OUString const & identifier,
+ ::rtl::OUString const & fileName,
+ bool bUserDisabled, bool bStartup,
+ css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv);
+
+ void activateExtension(
+ css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> > const & seqExt,
+ bool bUserDisabled, bool bStartup,
+ css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv );
+
+
+ ::std::list<css::uno::Reference<css::deployment::XPackage> >
+ getExtensionsWithSameId(::rtl::OUString const & identifier,
+ ::rtl::OUString const & fileName,
+ css::uno::Reference< css::ucb::XCommandEnvironment> const & xCmdEnv =
+ css::uno::Reference< css::ucb::XCommandEnvironment>());
+
+ css::uno::Reference<css::deployment::XPackage> backupExtension(
+ ::rtl::OUString const & identifier, ::rtl::OUString const & fileName,
+ css::uno::Reference<css::deployment::XPackageManager> const & xPackageManager,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv);
+
+ void checkInstall(
+ ::rtl::OUString const & displayName,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & cmdEnv);
+
+ void checkUpdate(
+ ::rtl::OUString const & newVersion,
+ ::rtl::OUString const & newDisplayName,
+ css::uno::Reference<css::deployment::XPackage> const & oldExtension,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv);
+
+ css::uno::Reference<css::deployment::XPackage> getTempExtension(
+ ::rtl::OUString const & url,
+ css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv);
+
+
+ void addExtensionsToMap(
+ id2extensions & mapExt,
+ css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> > const & seqExt,
+ ::rtl::OUString const & repository);
+
+ css::uno::Reference<css::deployment::XPackageManager>
+ getPackageManager(::rtl::OUString const & repository)
+ throw (css::lang::IllegalArgumentException);
+};
+
+}
+
+
+
+
+#endif
+
diff --git a/desktop/source/deployment/manager/dp_informationprovider.cxx b/desktop/source/deployment/manager/dp_informationprovider.cxx
index 9f2e0c9e1177..4cc43a8386d8 100644
--- a/desktop/source/deployment/manager/dp_informationprovider.cxx
+++ b/desktop/source/deployment/manager/dp_informationprovider.cxx
@@ -32,11 +32,10 @@
#include "comphelper/servicedecl.hxx"
-#include "com/sun/star/deployment/thePackageManagerFactory.hpp"
#include "com/sun/star/deployment/UpdateInformationProvider.hpp"
#include "com/sun/star/deployment/XPackage.hpp"
#include "com/sun/star/deployment/XPackageInformationProvider.hpp"
-#include "com/sun/star/deployment/XPackageManager.hpp"
+#include "com/sun/star/deployment/ExtensionManager.hpp"
#include "com/sun/star/deployment/XUpdateInformationProvider.hpp"
#include "com/sun/star/lang/XServiceInfo.hpp"
#include "com/sun/star/registry/XRegistryKey.hpp"
@@ -56,6 +55,7 @@
#include "dp_identifier.hxx"
#include "dp_version.hxx"
#include "dp_misc.h"
+#include "dp_update.hxx"
namespace beans = com::sun::star::beans ;
namespace deployment = com::sun::star::deployment ;
@@ -104,21 +104,10 @@ private:
uno::Reference< uno::XComponentContext> mxContext;
- rtl::OUString getPackageLocation( const uno::Reference< deployment::XPackageManager > _xManager,
+ rtl::OUString getPackageLocation( const rtl::OUString& repository,
const rtl::OUString& _sExtensionId );
uno::Reference< deployment::XUpdateInformationProvider > mxUpdateInformation;
-
- uno::Sequence< uno::Reference< xml::dom::XElement > >
- getUpdateInformation( uno::Sequence< rtl::OUString > const & urls,
- rtl::OUString const & identifier ) const;
- uno::Sequence< uno::Reference< deployment::XPackage > >
- getPackages( const uno::Reference< deployment::XPackageManager > _xManager );
- uno::Sequence< uno::Sequence< rtl::OUString > > isUpdateAvailable( const uno::Reference< deployment::XPackageManager > _xManager,
- const rtl::OUString& _sExtensionId );
- uno::Sequence< uno::Sequence< rtl::OUString > > getExtensionList( const uno::Reference< deployment::XPackageManager > _xManager );
- uno::Sequence< uno::Sequence< rtl::OUString > > concatLists( uno::Sequence< uno::Sequence< rtl::OUString > > aFirst,
- uno::Sequence< uno::Sequence< rtl::OUString > > aSecond );
};
//------------------------------------------------------------------------------
@@ -148,15 +137,18 @@ void SAL_CALL PackageInformationProvider::handle( uno::Reference< task::XInterac
//------------------------------------------------------------------------------
rtl::OUString PackageInformationProvider::getPackageLocation(
- const uno::Reference< deployment::XPackageManager > _xManager,
- const rtl::OUString& _rExtensionId )
+ const rtl::OUString & repository,
+ const rtl::OUString& _rExtensionId )
{
rtl::OUString aLocationURL;
+ uno::Reference<deployment::XExtensionManager> xManager =
+ deployment::ExtensionManager::get(mxContext);
- if ( _xManager.is() )
+ if ( xManager.is() )
{
const uno::Sequence< uno::Reference< deployment::XPackage > > packages(
- _xManager->getDeployedPackages(
+ xManager->getDeployedExtensions(
+ repository,
uno::Reference< task::XAbortChannel >(),
static_cast < XCommandEnvironment *> (this) ) );
@@ -187,32 +179,21 @@ rtl::OUString SAL_CALL
PackageInformationProvider::getPackageLocation( const rtl::OUString& _sExtensionId )
throw ( uno::RuntimeException )
{
- uno::Reference< deployment::XPackageManager > xManager;
- try {
- xManager = deployment::thePackageManagerFactory::get( mxContext )->getPackageManager( UNISTRING("user") );
- }
- catch ( css_ucb::CommandFailedException & ){}
- catch ( uno::RuntimeException & ) {}
-
- rtl::OUString aLocationURL = getPackageLocation( xManager, _sExtensionId );
+ rtl::OUString aLocationURL = getPackageLocation( UNISTRING("user"), _sExtensionId );
if ( aLocationURL.getLength() == 0 )
{
- try {
- xManager = deployment::thePackageManagerFactory::get( mxContext )->getPackageManager( UNISTRING("shared") );
- }
- catch ( css_ucb::CommandFailedException & ){}
- catch ( uno::RuntimeException & ) {}
-
- aLocationURL = getPackageLocation( xManager, _sExtensionId );
+ aLocationURL = getPackageLocation( UNISTRING("shared"), _sExtensionId );
+ }
+ if ( aLocationURL.getLength() == 0 )
+ {
+ aLocationURL = getPackageLocation( UNISTRING("bundled"), _sExtensionId );
}
-
if ( aLocationURL.getLength() )
{
::ucbhelper::Content aContent( aLocationURL, NULL );
aLocationURL = aContent.getURL();
}
-
return aLocationURL;
}
@@ -222,252 +203,157 @@ uno::Sequence< uno::Sequence< rtl::OUString > > SAL_CALL
PackageInformationProvider::isUpdateAvailable( const rtl::OUString& _sExtensionId )
throw ( uno::RuntimeException )
{
- uno::Sequence< uno::Sequence< rtl::OUString > > aUpdateListUser;
-
- uno::Reference< deployment::XPackageManager > xManager;
- try {
- xManager = deployment::thePackageManagerFactory::get( mxContext )->getPackageManager( UNISTRING("user") );
- }
- catch ( css_ucb::CommandFailedException & ){}
- catch ( uno::RuntimeException & ) {}
-
- aUpdateListUser = isUpdateAvailable( xManager, _sExtensionId );
-
- uno::Sequence< uno::Sequence< rtl::OUString > > aUpdateListShared;
- try {
- xManager = deployment::thePackageManagerFactory::get( mxContext )->getPackageManager( UNISTRING("shared") );
- }
- catch ( css_ucb::CommandFailedException & ){}
- catch ( uno::RuntimeException & ) {}
-
- aUpdateListShared = isUpdateAvailable( xManager, _sExtensionId );
-
- if ( !aUpdateListUser.hasElements() )
- return aUpdateListShared;
- else if ( !aUpdateListShared.hasElements() )
- return aUpdateListUser;
- else
- return concatLists( aUpdateListUser, aUpdateListShared );
-}
-
-//------------------------------------------------------------------------------
-uno::Sequence< uno::Sequence< rtl::OUString > > SAL_CALL PackageInformationProvider::getExtensionList()
- throw ( uno::RuntimeException )
-{
- uno::Sequence< uno::Sequence< rtl::OUString > > aListUser;
-
- uno::Reference< deployment::XPackageManager > xManager;
- try {
- xManager = deployment::thePackageManagerFactory::get( mxContext )->getPackageManager( UNISTRING("user") );
- }
- catch ( css_ucb::CommandFailedException & ){}
- catch ( uno::RuntimeException & ) {}
-
- aListUser = getExtensionList( xManager );
-
- uno::Sequence< uno::Sequence< rtl::OUString > > aListShared;
- try {
- xManager = deployment::thePackageManagerFactory::get( mxContext )->getPackageManager( UNISTRING("shared") );
- }
- catch ( css_ucb::CommandFailedException & ){}
- catch ( uno::RuntimeException & ) {}
-
- aListShared = getExtensionList( xManager );
+ uno::Sequence< uno::Sequence< rtl::OUString > > aList;
- if ( !aListUser.hasElements() )
- return aListShared;
- else if ( !aListShared.hasElements() )
- return aListUser;
- else
- return concatLists( aListUser, aListShared );
-}
+ uno::Reference<deployment::XExtensionManager> extMgr =
+ deployment::ExtensionManager::get(mxContext);
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-uno::Sequence< uno::Reference< deployment::XPackage > >
- PackageInformationProvider::getPackages( const uno::Reference< deployment::XPackageManager > _xMgr )
-{
- uno::Sequence< uno::Reference< deployment::XPackage > > packages;
- try {
- packages = _xMgr->getDeployedPackages( uno::Reference< task::XAbortChannel >(),
- static_cast < XCommandEnvironment *> (this) );
- }
- catch ( deployment::DeploymentException & )
- {}
- catch ( css_ucb::CommandFailedException & )
- {}
- catch ( css_ucb::CommandAbortedException & )
- {}
- catch ( lang::IllegalArgumentException & e )
+ if (!extMgr.is())
{
- throw uno::RuntimeException(e.Message, e.Context);
+ OSL_ASSERT(0);
+ return aList;
}
-
- return packages;
-}
-
-//------------------------------------------------------------------------------
-uno::Sequence< uno::Reference< xml::dom::XElement > >
- PackageInformationProvider::getUpdateInformation( uno::Sequence< rtl::OUString > const & urls,
- rtl::OUString const & identifier ) const
-{
- try
+ std::vector<std::pair<uno::Reference<deployment::XPackage>, uno::Any > > errors;
+ dp_misc::UpdateInfoMap updateInfoMap;
+ if (_sExtensionId.getLength())
{
- return mxUpdateInformation->getUpdateInformation( urls, identifier );
+ std::vector<uno::Reference<deployment::XPackage> > vecExtensions;
+ uno::Reference<deployment::XPackage> extension;
+ try
+ {
+ extension = dp_misc::getExtensionWithHighestVersion(
+ extMgr->getExtensionsWithSameIdentifier(
+ _sExtensionId, _sExtensionId, uno::Reference<css_ucb::XCommandEnvironment>()));
+ vecExtensions.push_back(extension);
+ }
+ catch (lang::IllegalArgumentException &)
+ {
+ OSL_ASSERT(0);
+ }
+ updateInfoMap = dp_misc::getOnlineUpdateInfos(
+ mxContext, extMgr, mxUpdateInformation, &vecExtensions, errors);
}
- catch ( uno::RuntimeException & ) {
- throw;
+ else
+ {
+ updateInfoMap = dp_misc::getOnlineUpdateInfos(
+ mxContext, extMgr, mxUpdateInformation, NULL, errors);
}
- catch ( css_ucb::CommandFailedException & ) {}
- catch ( css_ucb::CommandAbortedException & ) {}
- catch ( uno::Exception & ) {}
-
- return uno::Sequence< uno::Reference< xml::dom::XElement > >();
-}
-//------------------------------------------------------------------------------
-uno::Sequence< uno::Sequence< rtl::OUString > >
- PackageInformationProvider::isUpdateAvailable(
- const uno::Reference< deployment::XPackageManager > _xManager,
- const rtl::OUString& _sExtensionId )
-{
- uno::Sequence< uno::Sequence< rtl::OUString > > aList;
- sal_Int32 nCount = 0;
- bool bPackageFound = false;
-
- // If the package manager is readonly then the user cannot modify anything anyway
- // so we can abort the search here
- if ( _xManager.is() && ! _xManager->isReadOnly() )
+ int nCount = 0;
+ for (dp_misc::UpdateInfoMap::iterator i(updateInfoMap.begin()); i != updateInfoMap.end(); i++)
{
- uno::Sequence< uno::Reference< deployment::XPackage > > packages( getPackages( _xManager ) );
- uno::Sequence< uno::Reference< xml::dom::XElement > > defaultInfos;
+ dp_misc::UpdateInfo const & info = i->second;
- for ( int pos = packages.getLength(); pos-- && !bPackageFound; )
+ rtl::OUString sOnlineVersion;
+ if (info.info.is())
{
- uno::Reference< deployment::XPackage > package( packages[ pos ] );
- uno::Sequence< rtl::OUString > urls( package->getUpdateInformationURLs());
- uno::Sequence< uno::Reference< xml::dom::XElement > > infos;
- rtl::OUString id( dp_misc::getIdentifier( package ) );
-
- if ( _sExtensionId.getLength() )
- {
- if ( _sExtensionId == id )
- bPackageFound = true;
- else /* we have an ID and the IDs don't match, continue with next package */
- continue;
- }
-
- if ( urls.getLength() != 0)
- {
- infos = getUpdateInformation( urls, id );
- }
- else
- {
- if ( defaultInfos.getLength() == 0 )
- {
- const rtl::OUString defaultURL( dp_misc::getExtensionDefaultUpdateURL() );
- if ( defaultURL.getLength() )
- defaultInfos = getUpdateInformation( uno::Sequence< rtl::OUString >( &defaultURL, 1 ),
- rtl::OUString() );
- }
- infos = defaultInfos;
- }
- rtl::OUString latestVersion( package->getVersion() );
- sal_Int32 latestIndex = -1;
- for ( sal_Int32 i = 0; i < infos.getLength(); ++i )
- {
- dp_misc::DescriptionInfoset infoset( mxContext,
- uno::Reference< xml::dom::XNode >( infos[i], uno::UNO_QUERY_THROW));
- boost::optional< rtl::OUString > id2( infoset.getIdentifier() );
+ // check, if there are unsatisfied dependencies and ignore this online update
+ dp_misc::DescriptionInfoset infoset(mxContext, info.info);
+ uno::Sequence< uno::Reference< xml::dom::XElement > >
+ ds( dp_misc::Dependencies::check( infoset ) );
+ if ( ! ds.getLength() )
+ sOnlineVersion = info.version;
+ }
- if (!id2)
- continue;
+ rtl::OUString sVersionUser;
+ rtl::OUString sVersionShared;
+ rtl::OUString sVersionBundled;
+ uno::Sequence< uno::Reference< deployment::XPackage> > extensions;
+ try {
+ extensions = extMgr->getExtensionsWithSameIdentifier(
+ dp_misc::getIdentifier(info.extension), info.extension->getName(),
+ uno::Reference<css_ucb::XCommandEnvironment>());
+ } catch (lang::IllegalArgumentException& ) {
+ OSL_ASSERT(0);
+ }
+ OSL_ASSERT(extensions.getLength() == 3);
+ if (extensions[0].is() )
+ sVersionUser = extensions[0]->getVersion();
+ if (extensions[1].is() )
+ sVersionShared = extensions[1]->getVersion();
+ if (extensions[2].is() )
+ sVersionBundled = extensions[2]->getVersion();
+
+ bool bSharedReadOnly = extMgr->isReadOnlyRepository(OUSTR("shared"));
+
+ dp_misc::UPDATE_SOURCE sourceUser = dp_misc::isUpdateUserExtension(
+ bSharedReadOnly, sVersionUser, sVersionShared, sVersionBundled, sOnlineVersion);
+ dp_misc::UPDATE_SOURCE sourceShared = dp_misc::isUpdateSharedExtension(
+ bSharedReadOnly, sVersionShared, sVersionBundled, sOnlineVersion);
+
+ rtl::OUString updateVersionUser;
+ rtl::OUString updateVersionShared;
+ if (sourceUser != dp_misc::UPDATE_SOURCE_NONE)
+ updateVersionUser = dp_misc::getHighestVersion(
+ rtl::OUString(), sVersionShared, sVersionBundled, sOnlineVersion);
+ if (sourceShared != dp_misc::UPDATE_SOURCE_NONE)
+ updateVersionShared = dp_misc::getHighestVersion(
+ rtl::OUString(), rtl::OUString(), sVersionBundled, sOnlineVersion);
+ rtl::OUString updateVersion;
+ if (dp_misc::compareVersions(updateVersionUser, updateVersionShared) == dp_misc::GREATER)
+ updateVersion = updateVersionUser;
+ else
+ updateVersion = updateVersionShared;
+ if (updateVersion.getLength())
+ {
- if (*id2 == id)
- {
- // check, if there are unsatisfied dependencies and ignore those updates
- uno::Sequence< uno::Reference< xml::dom::XElement > > ds( dp_misc::Dependencies::check( infoset ) );
- if ( ds.getLength() )
- continue;
-
- rtl::OUString v( infoset.getVersion() );
- if ( dp_misc::compareVersions( v, latestVersion ) == dp_misc::GREATER )
- {
- latestVersion = v;
- latestIndex = i;
- }
- }
- }
- if ( latestIndex != -1 )
- {
- rtl::OUString aNewEntry[2];
- aNewEntry[0] = id;
- aNewEntry[1] = latestVersion;
- aList.realloc( ++nCount );
- aList[ nCount-1 ] = ::uno::Sequence< rtl::OUString >( aNewEntry, 2 );
- }
+ rtl::OUString aNewEntry[2];
+ aNewEntry[0] = i->first;
+ aNewEntry[1] = updateVersion;
+ aList.realloc( ++nCount );
+ aList[ nCount-1 ] = ::uno::Sequence< rtl::OUString >( aNewEntry, 2 );
}
}
return aList;
}
//------------------------------------------------------------------------------
-uno::Sequence< uno::Sequence< rtl::OUString > >
- PackageInformationProvider::getExtensionList(
- const uno::Reference< deployment::XPackageManager > _xManager )
+uno::Sequence< uno::Sequence< rtl::OUString > > SAL_CALL PackageInformationProvider::getExtensionList()
+ throw ( uno::RuntimeException )
{
- uno::Sequence< uno::Sequence< rtl::OUString > > aList;
+ const uno::Reference<deployment::XExtensionManager> mgr =
+ deployment::ExtensionManager::get(mxContext);
- if ( _xManager.is() )
- {
- uno::Sequence< uno::Reference< deployment::XPackage > > packages( getPackages( _xManager ) );
+ if (!mgr.is())
+ return uno::Sequence< uno::Sequence< rtl::OUString > >();
- aList.realloc( packages.getLength() );
+ const uno::Sequence< uno::Sequence< uno::Reference<deployment::XPackage > > >
+ allExt = mgr->getAllExtensions(
+ uno::Reference< task::XAbortChannel >(),
+ static_cast < XCommandEnvironment *> (this) );
- for ( int pos = packages.getLength(); pos--; )
- {
- uno::Reference< deployment::XPackage > package( packages[ pos ] );
- rtl::OUString aNewEntry[2];
-
- aNewEntry[0] = dp_misc::getIdentifier( package );
- aNewEntry[1] = package->getVersion();
- aList[ pos ] = ::uno::Sequence< rtl::OUString >( aNewEntry, 2 );
- }
- }
- return aList;
-}
+ uno::Sequence< uno::Sequence< rtl::OUString > > retList;
-//------------------------------------------------------------------------------
-uno::Sequence< uno::Sequence< rtl::OUString > > PackageInformationProvider::concatLists(
- uno::Sequence< uno::Sequence< rtl::OUString > > aFirst,
- uno::Sequence< uno::Sequence< rtl::OUString > > aSecond )
-{
- sal_Int32 nFirstCount = aFirst.getLength();
- sal_Int32 nSecondCount = aSecond.getLength();
- sal_Int32 nIndex = nFirstCount;
+ sal_Int32 cAllIds = allExt.getLength();
+ retList.realloc(cAllIds);
- for ( sal_Int32 i=0; i < nSecondCount; i++ )
+ for (sal_Int32 i = 0; i < cAllIds; i++)
{
- bool bDuplicateEntry = false;
- for ( sal_Int32 j=0; j < nFirstCount; j++ )
+ //The inner sequence contains extensions with the same identifier from
+ //all the different repositories, that is user, share, bundled.
+ const uno::Sequence< uno::Reference< deployment::XPackage > > &
+ seqExtension = allExt[i];
+ sal_Int32 cExt = seqExtension.getLength();
+ OSL_ASSERT(cExt == 3);
+ for (sal_Int32 j = 0; j < cExt; j++)
{
- if ( aFirst[ j ][0] == aSecond[ i ][0] )
+ //ToDo according to the old code the first found extenions is used
+ //even if another one with the same id has a better version.
+ uno::Reference< deployment::XPackage > const & xExtension( seqExtension[j] );
+ if (xExtension.is())
{
- bDuplicateEntry = true;
+ rtl::OUString aNewEntry[2];
+ aNewEntry[0] = dp_misc::getIdentifier(xExtension);
+ aNewEntry[1] = xExtension->getVersion();
+ retList[i] = ::uno::Sequence< rtl::OUString >( aNewEntry, 2 );
break;
}
}
- if ( !bDuplicateEntry )
- {
- nIndex += 1;
- aFirst.realloc( nIndex );
- aFirst[ nIndex - 1 ] = aSecond[ i ];
- }
}
- return aFirst;
+ return retList;
}
+
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 165efbaeca5a..44bc4d469f2f 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -39,6 +39,7 @@
#include "rtl/bootstrap.hxx"
#include "osl/diagnose.h"
#include "osl/file.hxx"
+#include "osl/security.hxx"
#include "cppuhelper/weakref.hxx"
#include "cppuhelper/exc_hlp.hxx"
#include "cppuhelper/implbase1.hxx"
@@ -57,11 +58,18 @@
#include "com/sun/star/ucb/NameClash.hpp"
#include "com/sun/star/deployment/VersionException.hpp"
#include "com/sun/star/deployment/InstallException.hpp"
+#include "com/sun/star/deployment/Prerequisites.hpp"
#include "com/sun/star/task/XInteractionApprove.hpp"
#include "com/sun/star/ucb/UnsupportedCommandException.hpp"
#include "boost/bind.hpp"
-#include <vector>
+#include "tools/urlobj.hxx"
+#include "osl/file.hxx"
+#include <vector>
+#include <list>
+#include "dp_descriptioninfoset.hxx"
+#include "dp_commandenvironments.hxx"
+#include "dp_properties.hxx"
using namespace ::dp_misc;
using namespace ::com::sun::star;
@@ -91,6 +99,28 @@ struct MatchTempDir
}
};
+
+namespace {
+OUString getExtensionFolder(OUString const & parentFolder,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv)
+{
+ ::ucbhelper::Content tempFolder(
+ parentFolder, xCmdEnv );
+ Reference<sdbc::XResultSet> xResultSet(
+ tempFolder.createCursor(
+ Sequence<OUString>( &StrTitle::get(), 1 ),
+ ::ucbhelper::INCLUDE_FOLDERS_ONLY ) );
+
+ OUString title;
+ while (xResultSet->next())
+ {
+ title = Reference<sdbc::XRow>(
+ xResultSet, UNO_QUERY_THROW )->getString(1 /* Title */ ) ;
+ break;
+ }
+ return title;
+}
+}
//______________________________________________________________________________
void PackageManagerImpl::initActivationLayer(
Reference<XCommandEnvironment> const & xCmdEnv )
@@ -135,7 +165,8 @@ void PackageManagerImpl::initActivationLayer(
{
ActivePackages::Data dbData;
insertToActivationLayer(
- mediaType, sourceContent, title, &dbData );
+ Sequence<css::beans::NamedValue>(),mediaType, sourceContent,
+ title, &dbData );
insertToActivationLayerDB( title, dbData );
//TODO #i73136#: insertToActivationLayerDB needs id not
@@ -151,12 +182,24 @@ void PackageManagerImpl::initActivationLayer(
// user|share:
OSL_ASSERT( m_activePackages.getLength() > 0 );
m_activePackages_expanded = expandUnoRcUrl( m_activePackages );
- create_folder( 0, m_activePackages_expanded, xCmdEnv, !m_readOnly );
+ m_registrationData_expanded = expandUnoRcUrl(m_registrationData);
+ if (!m_readOnly)
+ create_folder( 0, m_activePackages_expanded, xCmdEnv, true);
+
+ OUString dbName;
+ if (m_context.equals(OUSTR("user")))
+ dbName = m_activePackages_expanded + OUSTR(".db");
+ else
+ {
+ //Create the extension data base in the user installation
+ create_folder( 0, m_registrationData_expanded, xCmdEnv, true);
+ dbName = m_registrationData_expanded + OUSTR("/extensions.db");
+ }
+ //The data base can always be written because it it always in the user installation
m_activePackagesDB.reset(
- new ActivePackages(
- m_activePackages_expanded + OUSTR(".db"), m_readOnly ) );
+ new ActivePackages( dbName, false ) );
- if (! m_readOnly)
+ if (! m_readOnly && ! m_context.equals(OUSTR("bundled")))
{
// clean up activation layer, scan for zombie temp dirs:
ActivePackages::Entries id2temp( m_activePackagesDB->getEntries() );
@@ -169,17 +212,37 @@ void PackageManagerImpl::initActivationLayer(
::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) );
// get all temp directories:
::std::vector<OUString> tempEntries;
- while (xResultSet->next()) {
+ ::std::vector<OUString> removedEntries;
+ while (xResultSet->next())
+ {
OUString title(
Reference<sdbc::XRow>(
xResultSet, UNO_QUERY_THROW )->getString(
1 /* Title */ ) );
- tempEntries.push_back( ::rtl::Uri::encode(
- title, rtl_UriCharClassPchar,
- rtl_UriEncodeIgnoreEscapes,
- RTL_TEXTENCODING_UTF8 ) );
+
+ const char extensionRemoved[] = "removed";
+ if (title.endsWithAsciiL(
+ extensionRemoved, sizeof(extensionRemoved) - 1))
+ {
+ //save the file name withouth the "removed" part
+ sal_Int32 index = title.lastIndexOfAsciiL(
+ extensionRemoved, sizeof(extensionRemoved) - 1);
+ OUString remFile = title.copy(0, index);
+ removedEntries.push_back(::rtl::Uri::encode(
+ remFile, rtl_UriCharClassPchar,
+ rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8 ) );
+ }
+ else
+ {
+ tempEntries.push_back( ::rtl::Uri::encode(
+ title, rtl_UriCharClassPchar,
+ rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8 ) );
+ }
}
+ bool bShared = m_context.equals(OUSTR("shared")) ? true : false;
for ( ::std::size_t pos = 0; pos < tempEntries.size(); ++pos )
{
OUString const & tempEntry = tempEntries[ pos ];
@@ -187,14 +250,52 @@ void PackageManagerImpl::initActivationLayer(
if (::std::find_if( id2temp.begin(), id2temp.end(), match ) ==
id2temp.end())
{
+ const OUString url(
+ makeURL(m_activePackages_expanded, tempEntry ) );
+
+ //In case of shared extensions, new entries are regarded as
+ //added extensions if there is no xxx.tmpremoved file.
+ if (bShared)
+ {
+ if (::std::find(removedEntries.begin(), removedEntries.end(), tempEntry) ==
+ removedEntries.end())
+ {
+ continue;
+ }
+ else
+ {
+ //Make sure only the same user removes the extension, who
+ //previously unregistered it. This is avoid races if multiple instances
+ //of OOo are running which all have write access to the shared installation.
+ //For example, a user removes the extension, but keeps OOo
+ //running. Parts of the extension may still be loaded and used by OOo.
+ //Therefore the extension is only deleted the next time the extension manager is
+ //run after restarting OOo. While OOo is still running, another user starts OOo
+ //which would deleted the extension files. If the same user starts another
+ //instance of OOo then the lock file will prevent this.
+ OUString aUserName;
+ ::osl::Security aSecurity;
+ aSecurity.getUserName( aUserName );
+ ucbhelper::Content remFileContent(
+ url + OUSTR("removed"), Reference<XCommandEnvironment>());
+ ::rtl::ByteSequence data = dp_misc::readFile(remFileContent);
+ ::rtl::OString osData(reinterpret_cast<const sal_Char*>(data.getConstArray()),
+ data.getLength());
+ OUString sData = ::rtl::OStringToOUString(
+ osData, RTL_TEXTENCODING_UTF8);
+ if (!sData.equals(aUserName))
+ continue;
+ }
+ }
// temp entry not needed anymore:
- const OUString url( makeURL( m_activePackages_expanded,
- tempEntry ) );
erase_path( url + OUSTR("_"),
Reference<XCommandEnvironment>(),
false /* no throw: ignore errors */ );
erase_path( url, Reference<XCommandEnvironment>(),
false /* no throw: ignore errors */ );
+ //delete the xxx.tmpremoved file
+ erase_path(url + OUSTR("removed"),
+ Reference<XCommandEnvironment>(), false);
}
}
}
@@ -206,9 +307,9 @@ void PackageManagerImpl::initRegistryBackends()
{
if (m_registryCache.getLength() > 0)
create_folder( 0, m_registryCache,
- Reference<XCommandEnvironment>(), !m_readOnly );
+ Reference<XCommandEnvironment>(), false);
m_xRegistry.set( ::dp_registry::create(
- m_context, m_registryCache, m_readOnly,
+ m_context, m_registryCache, false,
m_xComponentContext ) );
}
@@ -223,12 +324,14 @@ Reference<deployment::XPackageManager> PackageManagerImpl::create(
OUString packages, logFile, stampURL;
if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("user") )) {
- that->m_activePackages = OUSTR("vnd.sun.star.expand:$UNO_"
- "USER_PACKAGES_CACHE/uno_packages");
- that->m_registryCache = OUSTR("vnd.sun.star.expand:$UNO_"
- "USER_PACKAGES_CACHE/registry");
- logFile = OUSTR("vnd.sun.star.expand:$UNO_"
- "USER_PACKAGES_CACHE/log.txt");
+ that->m_activePackages = OUSTR(
+ "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/uno_packages");
+ that->m_registrationData = OUSTR(
+ "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE");
+ that->m_registryCache = OUSTR(
+ "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/registry");
+ logFile = OUSTR(
+ "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/log.txt");
//We use the extension .sys for the file because on Windows Vista a sys
//(as well as exe and dll) file
//will not be written in the VirtualStore. For example if the process has no
@@ -240,25 +343,42 @@ Reference<deployment::XPackageManager> PackageManagerImpl::create(
//using virtualization it appears that he/she can. Then a shared extension can
//be installed but is only visible for the user (because the extension is in
//the virtual store).
- stampURL = OUSTR("vnd.sun.star.expand:$UNO_"
- "USER_PACKAGES_CACHE/stamp.sys");
+ stampURL = OUSTR(
+ "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/stamp.sys");
}
else if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("shared") )) {
- that->m_activePackages = OUSTR("vnd.sun.star.expand:$UNO_"
- "SHARED_PACKAGES_CACHE/uno_packages");
- that->m_registryCache = OUSTR("vnd.sun.star.expand:$UNO_"
- "SHARED_PACKAGES_CACHE/registry");
-// The current logging implementation does not work for shared, because it requires
-// write access to the logfile. When two users run OOo at the same time on the same machine
-// then the
-// second will fail because it does not get write access. One cannot write into the
-// user's home, because then people may complain that when installing shared extension
-// stuff is written in their home.
-// logFile = OUSTR("vnd.sun.star.expand:$UNO_"
-// "SHARED_PACKAGES_CACHE/log.txt");
- //See description for stampURL for user packages.
- stampURL = OUSTR("vnd.sun.star.expand:$UNO_"
- "SHARED_PACKAGES_CACHE/stamp.sys");
+ that->m_activePackages = OUSTR(
+ "vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages");
+ that->m_registrationData = OUSTR(
+ "vnd.sun.star.expand:$SHARED_EXTENSIONS_USER");
+ that->m_registryCache = OUSTR(
+ "vnd.sun.star.expand:$SHARED_EXTENSIONS_USER/registry");
+ logFile = OUSTR(
+ "vnd.sun.star.expand:$SHARED_EXTENSIONS_USER/log.txt");
+ stampURL = OUSTR(
+ "vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/stamp.sys");
+ }
+ else if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bundled") )) {
+ that->m_activePackages = OUSTR(
+ "vnd.sun.star.expand:$BUNDLED_EXTENSIONS");
+ that->m_registrationData = OUSTR(
+ "vnd.sun.star.expand:$BUNDLED_EXTENSIONS_USER");
+ that->m_registryCache = OUSTR(
+ "vnd.sun.star.expand:$BUNDLED_EXTENSIONS_USER/registry");
+ logFile = OUSTR(
+ "vnd.sun.star.expand:$BUNDLED_EXTENSIONS_USER/log.txt");
+ //No stamp file. We assume that bundled is always readonly. It must not be
+ //modified from ExtensionManager but only by the installer
+ }
+ else if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("tmp") )) {
+ that->m_activePackages = OUSTR(
+ "vnd.sun.star.expand:$TMP_EXTENSIONS/extensions");
+ that->m_registrationData = OUSTR(
+ "vnd.sun.star.expand:$TMP_EXTENSIONS");
+ that->m_registryCache = OUSTR(
+ "vnd.sun.star.expand:$TMP_EXTENSIONS/registry");
+ stampURL = OUSTR(
+ "vnd.sun.star.expand:$TMP_EXTENSIONS/stamp.sys");
}
else if (! context.matchAsciiL(
RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.tdoc:/") )) {
@@ -270,29 +390,15 @@ Reference<deployment::XPackageManager> PackageManagerImpl::create(
Reference<XCommandEnvironment> xCmdEnv;
try {
- bool renewal = false;
-
+ //There is no stampURL for the bundled folder
if (stampURL.getLength() > 0)
{
- // currently no automatic renewal possible, because quickstarter
- // already hinders from deleting registry directory...
-
#define CURRENT_STAMP "1"
-// renewal = true;
-// {
-// ::ucbhelper::Content ucbStamp;
-// if (create_ucb_content(
-// &ucbStamp, stampURL, xCmdEnv, false /* no throw */ ))
-// {
-// OUString line;
-// renewal = !readLine( &line, OUSTR(CURRENT_STAMP), ucbStamp,
-// RTL_TEXTENCODING_ASCII_US );
-// }
-// }
-
try {
+ //The osl file API does not allow to find out if one can write
+ //into a folder. Therefore we try to write a file. Then we delete
+ //it, so that it does not hinder uninstallation of OOo
// probe writing:
- erase_path( stampURL, xCmdEnv );
::ucbhelper::Content ucbStamp( stampURL, xCmdEnv );
::rtl::OString stamp(
RTL_CONSTASCII_STRINGPARAM(CURRENT_STAMP) );
@@ -302,8 +408,15 @@ Reference<deployment::XPackageManager> PackageManagerImpl::create(
reinterpret_cast<sal_Int8 const *>(stamp.getStr()),
stamp.getLength() ) ) );
ucbStamp.writeStream( xData, true /* replace existing */ );
+ that->m_readOnly = false;
+ erase_path( stampURL, xCmdEnv );
}
catch (RuntimeException &) {
+ try {
+ erase_path( stampURL, xCmdEnv );
+ } catch (...)
+ {
+ }
throw;
}
catch (Exception &) {
@@ -324,12 +437,6 @@ Reference<deployment::XPackageManager> PackageManagerImpl::create(
xCmdEnv.set( new CmdEnvWrapperImpl( xCmdEnv, that->m_xLogFile ) );
}
- OSL_ENSURE( !that->m_readOnly || !renewal,
- "### ought to reinstall all packages, but cannot write!" );
- if (!that->m_readOnly && renewal) // try to reinstall
- that->reinstallDeployedPackages(
- Reference<task::XAbortChannel>(), xCmdEnv );
-
that->initRegistryBackends();
that->initActivationLayer( xCmdEnv );
@@ -484,7 +591,7 @@ OUString PackageManagerImpl::detectMediaType(
try {
Reference<deployment::XPackage> xPackage(
m_xRegistry->bindPackage(
- url, OUString(), ucbContent.getCommandEnvironment() ) );
+ url, OUString(), false, OUString(), ucbContent.getCommandEnvironment() ) );
const Reference<deployment::XPackageTypeInfo> xPackageType(
xPackage->getPackageType() );
OSL_ASSERT( xPackageType.is() );
@@ -504,6 +611,7 @@ OUString PackageManagerImpl::detectMediaType(
//______________________________________________________________________________
OUString PackageManagerImpl::insertToActivationLayer(
+ Sequence<beans::NamedValue> const & properties,
OUString const & mediaType, ::ucbhelper::Content const & sourceContent_,
OUString const & title, ActivePackages::Data * dbData )
{
@@ -542,11 +650,19 @@ OUString PackageManagerImpl::insertToActivationLayer(
{
// inflate content:
::rtl::OUStringBuffer buf;
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.zip://") );
- buf.append( ::rtl::Uri::encode( sourceContent.getURL(),
- rtl_UriCharClassRegName,
- rtl_UriEncodeIgnoreEscapes,
- RTL_TEXTENCODING_UTF8 ) );
+ if (!sourceContent.isFolder())
+ {
+ buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.zip://") );
+ buf.append( ::rtl::Uri::encode( sourceContent.getURL(),
+ rtl_UriCharClassRegName,
+ rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8 ) );
+ }
+ else
+ {
+ //Folder. No need to unzip, just copy
+ buf.append(sourceContent.getURL());
+ }
buf.append( static_cast<sal_Unicode>('/') );
sourceContent = ::ucbhelper::Content(
buf.makeStringAndClear(), xCmdEnv );
@@ -556,10 +672,22 @@ OUString PackageManagerImpl::insertToActivationLayer(
title, NameClash::OVERWRITE ))
throw RuntimeException( OUSTR("UCB transferContent() failed!"), 0 );
+
// write to DB:
+ //bundled extensions should only be added by the synchronizeAddedExtensions
+ //functions. Moreover, there is no "temporary folder" for bundled extensions.
+ OSL_ASSERT(!m_context.equals(OUSTR("bundled")));
+ OUString sFolderUrl = makeURLAppendSysPathSegment(destFolderContent.getURL(), title);
+ DescriptionInfoset info =
+ dp_misc::getDescriptionInfoset(sFolderUrl);
dbData->temporaryName = tempEntry;
dbData->fileName = title;
dbData->mediaType = mediaType;
+ dbData->version = info.getVersion();
+
+ //No write the properties file next to the extension
+ ExtensionProperties props(sFolderUrl, properties, xCmdEnv);
+ props.write();
return destFolder;
}
@@ -567,6 +695,8 @@ OUString PackageManagerImpl::insertToActivationLayer(
void PackageManagerImpl::insertToActivationLayerDB(
OUString const & id, ActivePackages::Data const & dbData )
{
+ //access to the database must be guarded. See removePackage
+ const ::osl::MutexGuard guard( getMutex() );
m_activePackagesDB->put( id, dbData );
}
@@ -574,81 +704,40 @@ void PackageManagerImpl::insertToActivationLayerDB(
/* The function returns true if there is an extension with the same id already
installed which needs to be uninstalled, before the new extension can be installed.
*/
-bool PackageManagerImpl::checkUpdate(
- Reference<deployment::XPackage> const & package,
- Reference<XCommandEnvironment> const & origCmdEnv,
- Reference<XCommandEnvironment> const & wrappedCmdEnv )
+bool PackageManagerImpl::isInstalled(
+ Reference<deployment::XPackage> const & package)
{
OUString id(dp_misc::getIdentifier(package));
OUString fn(package->getName());
- bool removeExisting = false;
+ bool bInstalled = false;
if (m_activePackagesDB->has( id, fn ))
{
- // package already deployed, interact --force:
- Any request(
- (deployment::VersionException(
- getResourceString( RID_STR_PACKAGE_ALREADY_ADDED ) + id,
- static_cast<OWeakObject *>(this), package,
- getDeployedPackage_( id, fn, origCmdEnv ) ) ) );
- bool replace = false, abort = false;
- if (! interactContinuation(
- request, task::XInteractionApprove::static_type(),
- wrappedCmdEnv, &replace, &abort )) {
- OSL_ASSERT( !replace && !abort );
- throw deployment::DeploymentException(
- getResourceString(RID_STR_ERROR_WHILE_ADDING) + id,
- static_cast<OWeakObject *>(this), request );
- }
- if (abort || !replace)
- throw CommandFailedException(
- getResourceString(RID_STR_PACKAGE_ALREADY_ADDED) + id,
- static_cast<OWeakObject *>(this), request );
-
- // remove clashing package before registering new version:
- removeExisting = true;
+ bInstalled = true;
}
- return removeExisting;
+ return bInstalled;
}
+
+// XPackageManager
//______________________________________________________________________________
-// Notify the user when a new extension is to be installed. This is only the case
-//when unopkg gui extension1 is used (used by system integration (double click on .oxt
-// file etc.)). In case there is already this extension then the function returns
-//true.
-//ToDo: Function always returns true or throws an exception
-bool PackageManagerImpl::checkInstall(
- Reference<deployment::XPackage> const & package,
- Reference<XCommandEnvironment> const & cmdEnv)
+Reference<deployment::XPackage> PackageManagerImpl::importExtension(
+ Reference<deployment::XPackage> const & extension,
+ Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<XCommandEnvironment> const & xCmdEnv_ )
+ throw (deployment::DeploymentException, CommandFailedException,
+ CommandAbortedException, lang::IllegalArgumentException,
+ RuntimeException)
{
- OUString id(dp_misc::getIdentifier(package));
- if ( ! m_activePackagesDB->has( id, package->getName() ))
- {
- Any request(
- deployment::InstallException(
- OUSTR("Extension ") + id + OUSTR(" is about to be installed."),
- static_cast<OWeakObject *>(this), package));
- bool approve = false, abort = false;
- if (! interactContinuation(
- request, task::XInteractionApprove::static_type(),
- cmdEnv, &approve, &abort ))
- {
- OSL_ASSERT( !approve && !abort );
- throw deployment::DeploymentException(
- getResourceString(RID_STR_ERROR_WHILE_ADDING) + id,
- static_cast<OWeakObject *>(this), request );
- }
- if (abort || !approve)
- throw CommandFailedException(
- getResourceString(RID_STR_ERROR_WHILE_ADDING) + id,
- static_cast<OWeakObject *>(this), request );
-
- }
- return true;
+ return addPackage(extension->getURL(), Sequence<beans::NamedValue>(),
+ OUString(), xAbortChannel, xCmdEnv_);
}
-// XPackageManager
-//______________________________________________________________________________
+/* The function adds an extension but does not register it!!!
+ It may not do any user interaction. This is done in XExtensionManager::addExtension
+*/
Reference<deployment::XPackage> PackageManagerImpl::addPackage(
- OUString const & url, OUString const & mediaType_,
+ OUString const & url,
+ css::uno::Sequence<css::beans::NamedValue> const & properties,
+ OUString const & mediaType_,
Reference<task::XAbortChannel> const & xAbortChannel,
Reference<XCommandEnvironment> const & xCmdEnv_ )
throw (deployment::DeploymentException, CommandFailedException,
@@ -721,84 +810,34 @@ Reference<deployment::XPackage> PackageManagerImpl::addPackage(
}
ActivePackages::Data dbData;
destFolder = insertToActivationLayer(
- mediaType, sourceContent, title, &dbData );
+ properties, mediaType, sourceContent, title, &dbData );
// bind activation package:
- //Because every extension will be unpacked in a folder, which was created with a unique name
- //we will always have two different XPackage objects, even if the second extension is the same.
+ //Because every shared/user extension will be unpacked in a folder,
+ //which was created with a unique name we will always have two different
+ //XPackage objects, even if the second extension is the same.
//Therefore bindPackage does not need a guard here.
xPackage = m_xRegistry->bindPackage(
- makeURL( destFolder, title_enc ), mediaType, xCmdEnv );
+ makeURL( destFolder, title_enc ), mediaType, false, OUString(), xCmdEnv );
OSL_ASSERT( xPackage.is() );
if (xPackage.is())
{
bool install = false;
- OUString id;
-
try
{
- id = dp_misc::getIdentifier( xPackage );
- //checkInstall throws an exception if the user denies the installation
- checkInstall(xPackage, xCmdEnv);
- //checkUpdate throws an exception if the user cancels the interaction.
- //For example, he may be asked if he wants to replace the older version
- //with the new version.
- //checkUpdates must be called before checkPrerequisites
- bool bAlreadyInstalled = checkUpdate(
- xPackage, xCmdEnv_, xCmdEnv );
-
- if (xPackage->checkPrerequisites(xAbortChannel, xCmdEnv, bAlreadyInstalled, m_context))
+ OUString const id = dp_misc::getIdentifier( xPackage );
+
+ ::osl::MutexGuard g(m_addMutex);
+ if (isInstalled(xPackage))
{
- //This guard is used to prevent that an extension is installed twice. Do not use it in other
- //functions.
- //Imagine addPackage is called two times by different threads for the same extension quickly
- //after each other.
- //The second call would calculate "bAlreadyInstalled = false" if the first thread has not yet reached
- //insertToActivationLayerDB.
- ::osl::MutexGuard g(m_addMutex);
-
- //Holds the database data of the old extension, in case we need to roll back.
- ActivePackages::Data oldDbData;
- if (bAlreadyInstalled)
- {
- // Remove extension which is already installed. It is not removed from disk, only
- // the different contents are being unregisterd. We remember the databas information
- // in case we need to roll back this operation.
- // When the user canceled the operation (CommandAbortedException) than the package is still
- // fully functional.
- // Do not guard the complete function with the getMutex
- removePackage_(id, xPackage->getName(), xAbortChannel,
- xCmdEnv, & oldDbData);
- }
- install = true;
- const ::osl::MutexGuard guard( getMutex() );
- try
- {
- //throws CommandAbortedException if the user cancelled the installation.
- xPackage->registerPackage(xAbortChannel, xCmdEnv);
- }
- catch(CommandAbortedException & )
- { //ToDo: Interaction so that the gui can display an appropriate string.
- //See also removePackage_
- //User aborted installation, restore the previous situation.
- //Use a private AbortChannel so the user cannot interrupt.
- xPackage->revokePackage(new AbortChannel(), xCmdEnv);
- if (bAlreadyInstalled)
- {
- OUString instFolder = makeURL( m_activePackages, oldDbData.temporaryName)
- + OUSTR("_");
- Reference<deployment::XPackage> xOldPgk = m_xRegistry->bindPackage(
- makeURL( instFolder, oldDbData.fileName ), oldDbData.mediaType, xCmdEnv );
- xOldPgk->registerPackage(new AbortChannel(), xCmdEnv);
- insertToActivationLayerDB(dp_misc::getIdentifier( xOldPgk ), oldDbData);
- }
- throw;
- }
- //access to the database must be guarded. See removePackage_
- insertToActivationLayerDB(id, dbData);
+ //Do not guard the complete function with the getMutex
+ removePackage(id, xPackage->getName(), xAbortChannel,
+ xCmdEnv);
}
+ install = true;
+ insertToActivationLayerDB(id, dbData);
}
catch (...)
{
@@ -809,6 +848,7 @@ Reference<deployment::XPackage> PackageManagerImpl::addPackage(
{
deletePackageFromCache( xPackage, destFolder );
}
+ //ToDo: We should notify only if the extension is registered
fireModified();
}
return xPackage;
@@ -853,57 +893,15 @@ void PackageManagerImpl::deletePackageFromCache(
}
//______________________________________________________________________________
-void PackageManagerImpl::removePackage_(
- OUString const & id, OUString const & fileName,
- Reference<task::XAbortChannel> const & xAbortChannel,
- Reference<XCommandEnvironment> const & xCmdEnv,
- ActivePackages::Data * out_dbData)
-{
- Reference<deployment::XPackage> xPackage;
- {
- try {
- const ::osl::MutexGuard guard(getMutex());
- xPackage = getDeployedPackage_(id, fileName, xCmdEnv );
- m_activePackagesDB->get(out_dbData, id, fileName);
- beans::Optional< beans::Ambiguous<sal_Bool> > option(
- xPackage->isRegistered( Reference<task::XAbortChannel>(),
- xCmdEnv ) );
- if (!option.IsPresent || option.Value.IsAmbiguous || option.Value.Value)
- xPackage->revokePackage( xAbortChannel, xCmdEnv );
- m_activePackagesDB->erase( id, fileName ); // to be removed upon next start
- }
- catch (CommandAbortedException &)
- {
- //ToDo: interaction, so that gui can show an appropriate string
- //reregister the package
- //Create our own XAbortChannel, so the user cannot interrupt the registration.
- xPackage->registerPackage(new AbortChannel(), xCmdEnv);
- throw;
- }
- }
- try_dispose( xPackage );
-}
-
-//______________________________________________________________________________
void PackageManagerImpl::removePackage(
OUString const & id, ::rtl::OUString const & fileName,
- Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<task::XAbortChannel> const & /*xAbortChannel*/,
Reference<XCommandEnvironment> const & xCmdEnv_ )
throw (deployment::DeploymentException, CommandFailedException,
CommandAbortedException, lang::IllegalArgumentException,
RuntimeException)
{
check();
- if (m_readOnly)
- {
- OUString message;
- if (m_context == OUSTR("shared"))
- message = OUSTR("You need write permissions in order to remove a shared extension!");
- else
- message = OUSTR("You need write permissions in order to remove this extension!");
- throw deployment::DeploymentException(
- message, static_cast<OWeakObject *>(this), Any() );
- }
Reference<XCommandEnvironment> xCmdEnv;
if (m_xLogFile.is())
@@ -912,7 +910,48 @@ void PackageManagerImpl::removePackage(
xCmdEnv.set( xCmdEnv_ );
try {
- removePackage_( id, fileName, xAbortChannel, xCmdEnv, NULL);
+ Reference<deployment::XPackage> xPackage;
+ {
+ const ::osl::MutexGuard guard(getMutex());
+ //Check if this extension exist and throw an IllegalArgumentException
+ //if it does not
+ //If the files of the extension are already removed, or there is a
+ //different extension at the same place, for example after updating the
+ //extension, then the returned object is that which uses the database data.
+ xPackage = getDeployedPackage_(id, fileName, xCmdEnv );
+
+
+ //Because the extension is only removed the next time the extension
+ //manager runs after restarting OOo, we need to indicate that a
+ //shared extension was "deleted". When a user starts OOo, then it
+ //will check if something changed in the shared repository. Based on
+ //the flag file it will then recognize, that the extension was
+ //deleted and can then update the extnesion database of the shared
+ //extensions in the user installation.
+ if ( xPackage.is() && !m_readOnly && !xPackage->isRemoved() && m_context.equals(OUSTR("shared")))
+ {
+ ActivePackages::Data val;
+ m_activePackagesDB->get( & val, id, fileName);
+ OSL_ASSERT(val.temporaryName.getLength());
+ OUString url(makeURL(m_activePackages_expanded,
+ val.temporaryName + OUSTR("removed")));
+ ::ucbhelper::Content contentRemoved(url, xCmdEnv );
+ OUString aUserName;
+ ::osl::Security aSecurity;
+ aSecurity.getUserName( aUserName );
+
+ ::rtl::OString stamp = ::rtl::OUStringToOString(aUserName, RTL_TEXTENCODING_UTF8);
+ Reference<css::io::XInputStream> xData(
+ ::xmlscript::createInputStream(
+ ::rtl::ByteSequence(
+ reinterpret_cast<sal_Int8 const *>(stamp.getStr()),
+ stamp.getLength() ) ) );
+ contentRemoved.writeStream( xData, true /* replace existing */ );
+ }
+ m_activePackagesDB->erase( id, fileName ); // to be removed upon next start
+ }
+ try_dispose( xPackage );
+
fireModified();
}
catch (RuntimeException &) {
@@ -947,10 +986,16 @@ OUString PackageManagerImpl::getDeployPath( ActivePackages::Data const & data )
{
::rtl::OUStringBuffer buf;
buf.append( data.temporaryName );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("_/") );
- buf.append( ::rtl::Uri::encode( data.fileName, rtl_UriCharClassPchar,
+ //The bundled extensions are not contained in an additional folder
+ //with a unique name. data.temporaryName contains already the
+ //UTF8 encoded folder name. See PackageManagerImpl::synchronize
+ if (!m_context.equals(OUSTR("bundled")))
+ {
+ buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("_/") );
+ buf.append( ::rtl::Uri::encode( data.fileName, rtl_UriCharClassPchar,
rtl_UriEncodeIgnoreEscapes,
RTL_TEXTENCODING_UTF8 ) );
+ }
return makeURL( m_activePackages, buf.makeStringAndClear() );
}
@@ -989,8 +1034,22 @@ Reference<deployment::XPackage> PackageManagerImpl::getDeployedPackage_(
static_cast<sal_Int16>(-1) );
}
}
- return m_xRegistry->bindPackage(
- getDeployPath( data ), data.mediaType, xCmdEnv );
+ Reference<deployment::XPackage> xExtension;
+ try
+ {
+ //Ignore extensions where XPackage::checkPrerequisites failed.
+ //They must not be usable for this user.
+ if (data.failedPrerequisites.equals(OUSTR("0")))
+ {
+ xExtension = m_xRegistry->bindPackage(
+ getDeployPath( data ), data.mediaType, false, OUString(), xCmdEnv );
+ }
+ }
+ catch (deployment::InvalidRemovedParameterException& e)
+ {
+ xExtension = e.Extension;
+ }
+ return xExtension;
}
//______________________________________________________________________________
@@ -1004,6 +1063,8 @@ PackageManagerImpl::getDeployedPackages_(
ActivePackages::Entries::const_iterator const iEnd( id2temp.end() );
for ( ; iPos != iEnd; ++iPos )
{
+ if (! iPos->second.failedPrerequisites.equals(OUSTR("0")))
+ continue;
try {
packages.push_back(
getDeployedPackage_(
@@ -1116,25 +1177,18 @@ PackageManagerImpl::getDeployedPackages(
}
//______________________________________________________________________________
+
+
+//ToDo: the function must not call registerPackage, do this in
+//XExtensionManager.reinstallDeployedExtensions
void PackageManagerImpl::reinstallDeployedPackages(
- Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<task::XAbortChannel> const & /*xAbortChannel*/,
Reference<XCommandEnvironment> const & xCmdEnv_ )
throw (deployment::DeploymentException,
CommandFailedException, CommandAbortedException,
lang::IllegalArgumentException, RuntimeException)
{
check();
- if (m_readOnly)
- {
- OUString message;
- if (m_context == OUSTR("shared"))
- message = OUSTR("You need write permissions in order to install shared extensions!");
- else
- message = OUSTR("You need write permissions in order to install extensions!");
- throw deployment::DeploymentException(
- message, static_cast<OWeakObject *>(this), Any() );
- }
-
if (office_is_running())
throw RuntimeException(
OUSTR("You must close any running Office process before "
@@ -1159,12 +1213,7 @@ void PackageManagerImpl::reinstallDeployedPackages(
if (xUpdatable.is())
xUpdatable->update();
- // reregister all:
- const ::osl::MutexGuard guard( getMutex() );
- const Sequence< Reference<deployment::XPackage> > packages(
- getDeployedPackages_( xCmdEnv ) );
- for ( sal_Int32 pos = 0; pos < packages.getLength(); ++pos )
- packages[ pos ]->registerPackage( xAbortChannel, xCmdEnv );
+ //registering is done by the ExtensionManager service.
}
catch (RuntimeException &) {
throw;
@@ -1197,6 +1246,362 @@ void PackageManagerImpl::reinstallDeployedPackages(
{
return m_readOnly;
}
+bool PackageManagerImpl::synchronizeRemovedExtensions(
+ Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<css::ucb::XCommandEnvironment> const & xCmdEnv)
+{
+
+ //find all which are in the extension data base but which
+ //are removed already.
+ OSL_ASSERT(!m_context.equals(OUSTR("user")));
+ bool bModified = false;
+ ActivePackages::Entries id2temp( m_activePackagesDB->getEntries() );
+
+ typedef ActivePackages::Entries::const_iterator ITActive;
+ bool bShared = m_context.equals(OUSTR("shared"));
+
+ for (ITActive i = id2temp.begin(); i != id2temp.end(); i++)
+ {
+ try
+ {
+ //Get the URL to the extensions folder, first make the url for the
+ //shared repository including the temporary name
+ OUString url = makeURL(m_activePackages, i->second.temporaryName);
+ if (bShared)
+ url = makeURLAppendSysPathSegment( url + OUSTR("_"), i->second.fileName);
+
+ bool bRemoved = false;
+ //Check if the URL to the extension is still the same
+ ::ucbhelper::Content contentExtension;
+
+ if (!create_ucb_content(
+ &contentExtension, url,
+ Reference<XCommandEnvironment>(), false))
+ {
+ bRemoved = true;
+ }
+
+ //The folder is in the extension database, but it can still be deleted.
+ //look for the xxx.tmpremoved file
+ //There can also be the case that a different extension was installed
+ //in a "temp" folder with name that is already used.
+ if (!bRemoved && bShared)
+ {
+ ::ucbhelper::Content contentRemoved;
+
+ if (create_ucb_content(
+ &contentRemoved,
+ m_activePackages_expanded + OUSTR("/") +
+ i->second.temporaryName + OUSTR("removed"),
+ Reference<XCommandEnvironment>(), false))
+ {
+ bRemoved = true;
+ }
+ }
+
+ if (!bRemoved)
+ {
+ //There may be another extensions at the same place
+ dp_misc::DescriptionInfoset infoset =
+ dp_misc::getDescriptionInfoset(url);
+ OSL_ENSURE(infoset.hasDescription(),
+ "Extension Manager: bundled and shared extensions "
+ "must have an identifer and a version");
+ if (infoset.hasDescription() &&
+ infoset.getIdentifier() &&
+ (! i->first.equals(*(infoset.getIdentifier()))
+ || ! i->second.version.equals(infoset.getVersion())))
+ {
+ bRemoved = true;
+ }
+
+ }
+ if (bRemoved)
+ {
+ Reference<deployment::XPackage> xPackage = m_xRegistry->bindPackage(
+ url, i->second.mediaType, true, i->first, xCmdEnv );
+ OSL_ASSERT(xPackage.is()); //Even if the files are removed, we must get the object.
+ xPackage->revokePackage(xAbortChannel, xCmdEnv);
+ removePackage(xPackage->getIdentifier().Value, xPackage->getName(),
+ xAbortChannel, xCmdEnv);
+ bModified |= true;
+ }
+ }
+ catch( uno::Exception & )
+ {
+ OSL_ASSERT(0);
+ }
+ }
+ return bModified;
+}
+
+
+bool PackageManagerImpl::synchronizeAddedExtensions(
+ Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<css::ucb::XCommandEnvironment> const & xCmdEnv)
+{
+ bool bModified = false;
+ ActivePackages::Entries id2temp( m_activePackagesDB->getEntries() );
+ //check if the folder exist at all. The shared extension folder
+ //may not exist for a normal user.
+ if (!create_ucb_content(
+ NULL, m_activePackages_expanded, Reference<css::ucb::XCommandEnvironment>(), false))
+ return bModified;
+ ::ucbhelper::Content tempFolder(
+ m_activePackages_expanded, xCmdEnv );
+
+ Reference<sdbc::XResultSet> xResultSet(
+ tempFolder.createCursor(
+ Sequence<OUString>( &StrTitle::get(), 1 ),
+ ::ucbhelper::INCLUDE_FOLDERS_ONLY ) );
+
+ while (xResultSet->next())
+ {
+ try
+ {
+ OUString title(
+ Reference<sdbc::XRow>(
+ xResultSet, UNO_QUERY_THROW )->getString(
+ 1 /* Title */ ) );
+ //The temporary folders of user and shared have an '_' at then end.
+ //But the name in ActivePackages.temporaryName is saved without.
+ OUString title2 = title;
+ bool bNotBundled = !m_context.equals(OUSTR("bundled"));
+ if (bNotBundled)
+ {
+ OSL_ASSERT(title2[title2.getLength() -1] == '_');
+ title2 = title2.copy(0, title2.getLength() -1);
+ }
+ OUString titleEncoded = ::rtl::Uri::encode(
+ title2, rtl_UriCharClassPchar,
+ rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8);
+
+ //It it sufficient to check for the folder name, because when the administor
+ //installed the extension it was already checked if there is one with the
+ //same identifier.
+ const MatchTempDir match(titleEncoded);
+ if (::std::find_if( id2temp.begin(), id2temp.end(), match ) ==
+ id2temp.end())
+ {
+
+ // The folder was not found in the data base, so it must be
+ // an added extension
+ OUString url(m_activePackages_expanded + OUSTR("/") + titleEncoded);
+ OUString sExtFolder;
+ if (bNotBundled) //that is, shared
+ {
+ //Check if the extension was not "deleted" already which is indicated
+ //by a xxx.tmpremoved file
+ ::ucbhelper::Content contentRemoved;
+ if (create_ucb_content(&contentRemoved, url + OUSTR("removed"),
+ Reference<XCommandEnvironment>(), false))
+ continue;
+ sExtFolder = getExtensionFolder(
+ m_activePackages_expanded +
+ OUString(OUSTR("/")) + titleEncoded + OUSTR("_"), xCmdEnv);
+ url = makeURLAppendSysPathSegment(m_activePackages_expanded, title);
+ url = makeURLAppendSysPathSegment(url, sExtFolder);
+ }
+ Reference<deployment::XPackage> xPackage = m_xRegistry->bindPackage(
+ url, OUString(), false, OUString(), xCmdEnv );
+ if (xPackage.is())
+ {
+ //Prepare the database entry
+ ActivePackages::Data dbData;
+
+ dbData.temporaryName = titleEncoded;
+ if (bNotBundled)
+ dbData.fileName = sExtFolder;
+ else
+ dbData.fileName = title;
+ dbData.mediaType = xPackage->getPackageType()->getMediaType();
+ dbData.version = xPackage->getVersion();
+ OSL_ENSURE(dbData.version.getLength() > 0,
+ "Extension Manager: bundled and shared extensions must have "
+ "an identifier and a version");
+
+ OUString id = dp_misc::getIdentifier( xPackage );
+
+ //We provide a special command environment that will prevent
+ //showing a license if simple-licens/@accept-by = "admin"
+ //It will also prevent showing the license for bundled extensions
+ //which is not supported.
+ OSL_ASSERT(!m_context.equals(OUSTR("user")));
+
+ // shall the license be suppressed?
+ DescriptionInfoset info =
+ dp_misc::getDescriptionInfoset(url);
+ ::boost::optional<dp_misc::SimpleLicenseAttributes>
+ attr = info.getSimpleLicenseAttributes();
+ ExtensionProperties props(url,xCmdEnv);
+ bool bNoLicense = false;
+ if (attr && attr->suppressIfRequired && props.isSuppressedLicense())
+ bNoLicense = true;
+
+ Reference<ucb::XCommandEnvironment> licCmdEnv(
+ new LicenseCommandEnv(xCmdEnv->getInteractionHandler(),
+ bNoLicense, m_context));
+ sal_Int32 failedPrereq = xPackage->checkPrerequisites(
+ xAbortChannel, licCmdEnv, false);
+ //Remember that this failed. For example, the user
+ //could have declined the license. Then the next time the
+ //extension folder is investigated we do not want to
+ //try to install the extension again.
+ dbData.failedPrerequisites = OUString::valueOf(failedPrereq);
+ insertToActivationLayerDB(id, dbData);
+ bModified |= true;
+ }
+ }
+ }
+ catch (uno::Exception &)
+ {
+ OSL_ASSERT(0);
+ }
+ }
+ return bModified;
+}
+
+sal_Bool PackageManagerImpl::synchronize(
+ Reference<task::XAbortChannel> const & xAbortChannel,
+ Reference<css::ucb::XCommandEnvironment> const & xCmdEnv)
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::ucb::CommandAbortedException,
+ css::uno::RuntimeException)
+{
+ check();
+ bool bModified = false;
+ if (m_context.equals(OUSTR("user")))
+ return bModified;
+ bModified |=
+ synchronizeRemovedExtensions(xAbortChannel, xCmdEnv);
+ bModified |= synchronizeAddedExtensions(xAbortChannel, xCmdEnv);
+
+ return bModified;
+}
+
+Sequence< Reference<deployment::XPackage> > PackageManagerImpl::getExtensionsWithUnacceptedLicenses(
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv)
+ throw (deployment::DeploymentException, RuntimeException)
+{
+ ::std::vector<Reference<deployment::XPackage> > vec;
+
+ try
+ {
+ const ::osl::MutexGuard guard( getMutex() );
+ // clean up activation layer, scan for zombie temp dirs:
+ ActivePackages::Entries id2temp( m_activePackagesDB->getEntries() );
+
+ ActivePackages::Entries::const_iterator i = id2temp.begin();
+ bool bShared = m_context.equals(OUSTR("shared"));
+
+ for (; i != id2temp.end(); i++ )
+ {
+ //Get the database entry
+ ActivePackages::Data const & dbData = i->second;
+ sal_Int32 failedPrereq = dbData.failedPrerequisites.toInt32();
+ //If the installation failed for other reason then the license then we
+ //ignore it.
+ if (failedPrereq ^= deployment::Prerequisites::LICENSE)
+ continue;
+
+ //Prepare the URL to the extension
+ OUString url = makeURL(m_activePackages, i->second.temporaryName);
+ if (bShared)
+ url = makeURLAppendSysPathSegment( url + OUSTR("_"), i->second.fileName);
+
+ Reference<deployment::XPackage> p = m_xRegistry->bindPackage(
+ url, OUString(), false, OUString(), xCmdEnv );
+
+ if (p.is())
+ vec.push_back(p);
+
+ }
+ return ::comphelper::containerToSequence(vec);
+ }
+ catch (deployment::DeploymentException &)
+ {
+ throw;
+ }
+ catch (RuntimeException&)
+ {
+ throw;
+ }
+ catch (...)
+ {
+ Any exc = ::cppu::getCaughtException();
+ deployment::DeploymentException de(
+ OUSTR("PackageManagerImpl::getExtensionsWithUnacceptedLicenses"),
+ static_cast<OWeakObject*>(this), exc);
+ exc <<= de;
+ ::cppu::throwException(exc);
+ }
+
+ return ::comphelper::containerToSequence(vec);
+}
+
+sal_Int32 PackageManagerImpl::checkPrerequisites(
+ css::uno::Reference<css::deployment::XPackage> const & extension,
+ css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::ucb::CommandAbortedException,
+ css::lang::IllegalArgumentException,
+ css::uno::RuntimeException)
+{
+ try
+ {
+ if (!extension.is())
+ return 0;
+ if (!m_context.equals(extension->getRepositoryName()))
+ throw lang::IllegalArgumentException(
+ OUSTR("PackageManagerImpl::checkPrerequisites: extension is not"
+ " from this repository."), 0, 0);
+
+ ActivePackages::Data dbData;
+ OUString id = dp_misc::getIdentifier(extension);
+ if (m_activePackagesDB->get( &dbData, id, OUString()))
+ {
+ //If the license was already displayed, then do not show it again
+ Reference<ucb::XCommandEnvironment> _xCmdEnv = xCmdEnv;
+ sal_Int32 prereq = dbData.failedPrerequisites.toInt32();
+ if ( !(prereq & deployment::Prerequisites::LICENSE))
+ _xCmdEnv = new NoLicenseCommandEnv(xCmdEnv->getInteractionHandler());
+
+ sal_Int32 failedPrereq = extension->checkPrerequisites(
+ xAbortChannel, _xCmdEnv, false);
+ dbData.failedPrerequisites = OUString::valueOf(failedPrereq);
+ insertToActivationLayerDB(id, dbData);
+ }
+ else
+ {
+ throw lang::IllegalArgumentException(
+ OUSTR("PackageManagerImpl::checkPrerequisites: unknown extension"),
+ 0, 0);
+
+ }
+ return 0;
+ }
+ catch (deployment::DeploymentException& ) {
+ throw;
+ } catch (ucb::CommandFailedException & ) {
+ throw;
+ } catch (ucb::CommandAbortedException & ) {
+ throw;
+ } catch (lang::IllegalArgumentException &) {
+ throw;
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (...) {
+ uno::Any excOccurred = ::cppu::getCaughtException();
+ deployment::DeploymentException exc(
+ OUSTR("PackageManagerImpl::checkPrerequisites: exception "),
+ static_cast<OWeakObject*>(this), excOccurred);
+ throw exc;
+ }
+}
//##############################################################################
diff --git a/desktop/source/deployment/manager/dp_manager.h b/desktop/source/deployment/manager/dp_manager.h
index ffa7252d7883..8fe0f662011b 100644
--- a/desktop/source/deployment/manager/dp_manager.h
+++ b/desktop/source/deployment/manager/dp_manager.h
@@ -53,6 +53,8 @@ class PackageManagerImpl : private ::dp_misc::MutexHolder, public t_pm_helper
{
css::uno::Reference<css::uno::XComponentContext> m_xComponentContext;
::rtl::OUString m_context;
+ ::rtl::OUString m_registrationData;
+ ::rtl::OUString m_registrationData_expanded;
::rtl::OUString m_registryCache;
bool m_readOnly;
@@ -73,6 +75,7 @@ class PackageManagerImpl : private ::dp_misc::MutexHolder, public t_pm_helper
::rtl::OUString detectMediaType(
::ucbhelper::Content const & ucbContent, bool throw_exc = true );
::rtl::OUString insertToActivationLayer(
+ css::uno::Sequence<css::beans::NamedValue> const & properties,
::rtl::OUString const & mediaType,
::ucbhelper::Content const & sourceContent,
::rtl::OUString const & title, ActivePackages::Data * dbData );
@@ -83,16 +86,16 @@ class PackageManagerImpl : private ::dp_misc::MutexHolder, public t_pm_helper
css::uno::Reference<css::deployment::XPackage> const & xPackage,
::rtl::OUString const & destFolder );
- bool checkUpdate(
- css::uno::Reference<css::deployment::XPackage> const & package,
- css::uno::Reference<css::ucb::XCommandEnvironment> const & origCmdEnv,
- css::uno::Reference<css::ucb::XCommandEnvironment> const &
- wrappedCmdEnv );
+ bool isInstalled(
+ css::uno::Reference<css::deployment::XPackage> const & package);
- bool checkInstall(
- css::uno::Reference<css::deployment::XPackage> const & package,
- css::uno::Reference<css::ucb::XCommandEnvironment> const & cmdEnv);
+ bool synchronizeRemovedExtensions(
+ css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv);
+ bool synchronizeAddedExtensions(
+ css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv);
class CmdEnvWrapperImpl
: public ::cppu::WeakImplHelper2< css::ucb::XCommandEnvironment,
@@ -135,7 +138,7 @@ protected:
: t_pm_helper( getMutex() ),
m_xComponentContext( xComponentContext ),
m_context( context ),
- m_readOnly( false )
+ m_readOnly( true )
{}
public:
@@ -171,7 +174,9 @@ public:
createAbortChannel() throw (css::uno::RuntimeException);
virtual css::uno::Reference<css::deployment::XPackage> SAL_CALL addPackage(
- ::rtl::OUString const & url, ::rtl::OUString const & mediaType,
+ ::rtl::OUString const & url,
+ css::uno::Sequence<css::beans::NamedValue> const & properties,
+ ::rtl::OUString const & mediaType,
css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
throw (css::deployment::DeploymentException,
@@ -180,17 +185,15 @@ public:
css::lang::IllegalArgumentException,
css::uno::RuntimeException);
- /* Unregisters the package but does not remove it from disk.
- When the operation is canceled by the user, a CommandAbortedException
- is thrown. Then the package is still fully functional.
- @param out_oldData
- can be NULL
- */
- void removePackage_(
- ::rtl::OUString const & id, ::rtl::OUString const & fileName,
+ virtual css::uno::Reference<css::deployment::XPackage> SAL_CALL importExtension(
+ css::uno::Reference<css::deployment::XPackage> const & extension,
css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
- css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
- ActivePackages::Data * out_oldData);
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::ucb::CommandAbortedException,
+ css::lang::IllegalArgumentException,
+ css::uno::RuntimeException);
virtual void SAL_CALL removePackage(
::rtl::OUString const & id, ::rtl::OUString const & fileName,
@@ -242,7 +245,31 @@ public:
virtual ::sal_Bool SAL_CALL isReadOnly( )
throw (::com::sun::star::uno::RuntimeException);
-};
+
+ virtual ::sal_Bool SAL_CALL synchronize(
+ css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::ucb::CommandAbortedException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> > SAL_CALL
+ getExtensionsWithUnacceptedLicenses(
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv)
+ throw (css::deployment::DeploymentException,
+ css::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL checkPrerequisites(
+ css::uno::Reference<css::deployment::XPackage> const & extension,
+ css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::ucb::CommandAbortedException,
+ css::lang::IllegalArgumentException,
+ css::uno::RuntimeException);
+ };
//______________________________________________________________________________
inline void PackageManagerImpl::check()
diff --git a/desktop/source/deployment/manager/dp_manager.hrc b/desktop/source/deployment/manager/dp_manager.hrc
index bdbfc079cda6..6131cc381abf 100644
--- a/desktop/source/deployment/manager/dp_manager.hrc
+++ b/desktop/source/deployment/manager/dp_manager.hrc
@@ -35,5 +35,5 @@
#define RID_STR_PACKAGE_ALREADY_ADDED (RID_DEPLOYMENT_MANAGER_START+2)
#define RID_STR_COPYING_PACKAGE (RID_DEPLOYMENT_MANAGER_START+3)
#define RID_STR_NO_SUCH_PACKAGE (RID_DEPLOYMENT_MANAGER_START+4)
-
+#define RID_STR_SYNCHRONIZING_REPOSITORY (RID_DEPLOYMENT_MANAGER_START+5)
#endif
diff --git a/desktop/source/deployment/manager/dp_manager.src b/desktop/source/deployment/manager/dp_manager.src
index 95ede4aa6227..7d38b880c37a 100644
--- a/desktop/source/deployment/manager/dp_manager.src
+++ b/desktop/source/deployment/manager/dp_manager.src
@@ -53,3 +53,7 @@ String RID_STR_NO_SUCH_PACKAGE
Text [ en-US ] = "There is no such extension deployed: ";
};
+String RID_STR_SYNCHRONIZING_REPOSITORY
+{
+ Text [ en-US ] = "Synchronizing repository for %NAME extensions";
+};
diff --git a/desktop/source/deployment/manager/dp_managerfac.cxx b/desktop/source/deployment/manager/dp_managerfac.cxx
index d4c9df1d57af..f6fde6b07d60 100644
--- a/desktop/source/deployment/manager/dp_managerfac.cxx
+++ b/desktop/source/deployment/manager/dp_managerfac.cxx
@@ -53,6 +53,7 @@ class PackageManagerFactoryImpl : private MutexHolder, public t_pmfac_helper
Reference<deployment::XPackageManager> m_xUserMgr;
Reference<deployment::XPackageManager> m_xSharedMgr;
+ Reference<deployment::XPackageManager> m_xBundledMgr;
typedef ::std::hash_map<
OUString, WeakReference<deployment::XPackageManager>,
::rtl::OUStringHash > t_string2weakref;
@@ -141,6 +142,7 @@ void PackageManagerFactoryImpl::disposing()
// the below are already disposed:
m_xUserMgr.clear();
m_xSharedMgr.clear();
+ m_xBundledMgr.clear();
}
// XPackageManagerFactory
@@ -172,6 +174,8 @@ PackageManagerFactoryImpl::getPackageManager( OUString const & context )
m_xUserMgr = xRet;
else if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("shared") ))
m_xSharedMgr = xRet;
+ else if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bundled") ))
+ m_xBundledMgr = xRet;
}
else
{
diff --git a/desktop/source/deployment/manager/dp_properties.cxx b/desktop/source/deployment/manager/dp_properties.cxx
new file mode 100644
index 000000000000..df579944c6e4
--- /dev/null
+++ b/desktop/source/deployment/manager/dp_properties.cxx
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_desktop.hxx"
+
+#include "com/sun/star/ucb/XCommandEnvironment.hpp"
+#include "com/sun/star/lang/IllegalArgumentException.hpp"
+#include "xmlscript/xml_helper.hxx"
+#include "ucbhelper/content.hxx"
+#include <list>
+
+#include "dp_ucb.h"
+#include "rtl/ustrbuf.hxx"
+#include "dp_properties.hxx"
+
+namespace lang = com::sun::star::lang;
+namespace task = com::sun::star::task;
+namespace ucb = com::sun::star::ucb;
+namespace uno = com::sun::star::uno;
+namespace css = com::sun::star;
+
+#define OUSTR(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
+
+using ::com::sun::star::uno::Reference;
+using ::rtl::OUString;
+
+#define PROP_SUPPRESS_LICENSE "SUPPRESS_LICENSE"
+#define PROP_EXTENSION_UPDATE "EXTENSION_UPDATE"
+
+namespace dp_manager {
+
+//Reading the file
+ExtensionProperties::ExtensionProperties(
+ OUString const & urlExtension,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv) :
+ m_xCmdEnv(xCmdEnv)
+{
+ m_propFileUrl = urlExtension + OUSTR("properties");
+
+ ::std::list< ::std::pair< OUString, OUString> > props;
+ if (! dp_misc::create_ucb_content(NULL, m_propFileUrl, 0, false))
+ return;
+
+ ::ucbhelper::Content contentProps(m_propFileUrl, m_xCmdEnv);
+ dp_misc::readProperties(props, contentProps);
+
+ typedef ::std::list< ::std::pair< OUString, OUString> >::const_iterator CI;
+ for (CI i = props.begin(); i != props.end(); i++)
+ {
+ if (i->first.equals(OUSTR(PROP_SUPPRESS_LICENSE)))
+ m_prop_suppress_license = i->second;
+ }
+}
+
+//Writing the file
+ExtensionProperties::ExtensionProperties(
+ OUString const & urlExtension,
+ uno::Sequence<css::beans::NamedValue> const & properties,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv) :
+ m_xCmdEnv(xCmdEnv)
+{
+ m_propFileUrl = urlExtension + OUSTR("properties");
+
+ for (sal_Int32 i = 0; i < properties.getLength(); i++)
+ {
+ css::beans::NamedValue const & v = properties[i];
+ if (v.Name.equals(OUSTR(PROP_SUPPRESS_LICENSE)))
+ {
+ m_prop_suppress_license = getPropertyValue(v);
+ }
+ else if (v.Name.equals(OUSTR(PROP_EXTENSION_UPDATE)))
+ {
+ m_prop_extension_update = getPropertyValue(v);
+ }
+ else
+ {
+ throw lang::IllegalArgumentException(
+ OUSTR("Extension Manager: unknown property"), 0, -1);
+ }
+ }
+}
+
+OUString ExtensionProperties::getPropertyValue(css::beans::NamedValue const & v)
+{
+ OUString value(OUSTR("0"));
+ if (v.Value >>= value)
+ {
+ if (value.equals(OUSTR("1")))
+ value = OUSTR("1");
+ }
+ else
+ {
+ throw lang::IllegalArgumentException(
+ OUSTR("Extension Manager: wrong property value"), 0, -1);
+ }
+ return value;
+}
+void ExtensionProperties::write()
+{
+ ::ucbhelper::Content contentProps(m_propFileUrl, m_xCmdEnv);
+ ::rtl::OUStringBuffer buf;
+
+ if (m_prop_suppress_license)
+ {
+ buf.append(OUSTR(PROP_SUPPRESS_LICENSE));
+ buf.append(OUSTR("="));
+ buf.append(*m_prop_suppress_license);
+ }
+
+ ::rtl::OString stamp = ::rtl::OUStringToOString(
+ buf.makeStringAndClear(), RTL_TEXTENCODING_UTF8);
+ Reference<css::io::XInputStream> xData(
+ ::xmlscript::createInputStream(
+ ::rtl::ByteSequence(
+ reinterpret_cast<sal_Int8 const *>(stamp.getStr()),
+ stamp.getLength() ) ) );
+ contentProps.writeStream( xData, true /* replace existing */ );
+}
+
+bool ExtensionProperties::isSuppressedLicense()
+{
+ bool ret = false;
+ if (m_prop_suppress_license)
+ {
+ if (m_prop_suppress_license->equals(OUSTR("1")))
+ ret = true;
+ }
+ return ret;
+}
+
+bool ExtensionProperties::isExtensionUpdate()
+{
+ bool ret = false;
+ if (m_prop_extension_update)
+ {
+ if (m_prop_extension_update->equals(OUSTR("1")))
+ ret = true;
+ }
+ return ret;
+}
+
+} // namespace dp_manager
+
+
diff --git a/desktop/source/deployment/manager/dp_properties.hxx b/desktop/source/deployment/manager/dp_properties.hxx
new file mode 100644
index 000000000000..97fc8b8c5394
--- /dev/null
+++ b/desktop/source/deployment/manager/dp_properties.hxx
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: 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
+ * 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.
+ *
+ ************************************************************************/
+
+#if ! defined INCLUDED_DP_PROPERTIES_HXX
+#define INCLUDED_DP_PROPERTIES_HXX
+
+
+
+#include "com/sun/star/beans/NamedValue.hpp"
+#include "com/sun/star/ucb/XCommandEnvironment.hpp"
+#include "boost/optional.hpp"
+
+
+namespace css = ::com::sun::star;
+
+namespace dp_manager {
+
+
+
+/**
+
+ */
+class ExtensionProperties
+{
+protected:
+ ::rtl::OUString m_propFileUrl;
+ const css::uno::Reference<css::ucb::XCommandEnvironment> m_xCmdEnv;
+ ::boost::optional< ::rtl::OUString> m_prop_suppress_license;
+ ::boost::optional< ::rtl::OUString> m_prop_extension_update;
+
+ ::rtl::OUString getPropertyValue(css::beans::NamedValue const & v);
+public:
+
+ virtual ~ExtensionProperties() {};
+ ExtensionProperties(::rtl::OUString const & urlExtension,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv);
+
+ ExtensionProperties(::rtl::OUString const & urlExtension,
+ css::uno::Sequence<css::beans::NamedValue> const & properties,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv);
+
+ void write();
+
+ bool isSuppressedLicense();
+
+ bool isExtensionUpdate();
+};
+}
+
+
+
+
+#endif
+
diff --git a/desktop/source/deployment/manager/makefile.mk b/desktop/source/deployment/manager/makefile.mk
index a9ff47881fc3..4dc6405e34bf 100644
--- a/desktop/source/deployment/manager/makefile.mk
+++ b/desktop/source/deployment/manager/makefile.mk
@@ -45,7 +45,10 @@ SLOFILES = \
$(SLO)$/dp_activepackages.obj \
$(SLO)$/dp_manager.obj \
$(SLO)$/dp_managerfac.obj \
- $(SLO)$/dp_informationprovider.obj
+ $(SLO)$/dp_informationprovider.obj \
+ $(SLO)$/dp_extensionmanager.obj \
+ $(SLO)$/dp_commandenvironments.obj \
+ $(SLO)$/dp_properties.obj
.INCLUDE : ..$/target.pmk
.INCLUDE : target.mk
diff --git a/desktop/source/deployment/migration/dp_migration.cxx b/desktop/source/deployment/migration/dp_migration.cxx
deleted file mode 100644
index 49362f7e2f5f..000000000000
--- a/desktop/source/deployment/migration/dp_migration.cxx
+++ /dev/null
@@ -1,251 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_desktop.hxx"
-
-#include "dp_misc.h"
-#include "dp_ucb.h"
-#include "cppuhelper/implbase1.hxx"
-#include "cppuhelper/implbase2.hxx"
-#include "cppuhelper/exc_hlp.hxx"
-#include "ucbhelper/content.hxx"
-#include "comphelper/anytostring.hxx"
-#include "comphelper/servicedecl.hxx"
-#include "com/sun/star/lang/WrappedTargetException.hpp"
-#include "com/sun/star/task/XJob.hpp"
-#include "com/sun/star/task/XInteractionAbort.hpp"
-#include "com/sun/star/task/XInteractionApprove.hpp"
-#include "com/sun/star/sdbc/XResultSet.hpp"
-#include "com/sun/star/sdbc/XRow.hpp"
-#include "com/sun/star/ucb/XContentAccess.hpp"
-#include "com/sun/star/deployment/thePackageManagerFactory.hpp"
-
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::ucb;
-using namespace ::com::sun::star::uno;
-using namespace ::dp_misc;
-using ::rtl::OUString;
-
-namespace dp_migration {
-
-class MigrationImpl : public ::cppu::WeakImplHelper1<task::XJob>
-{
- struct CommandEnvironmentImpl
- : public ::cppu::WeakImplHelper2< XCommandEnvironment,
- task::XInteractionHandler >
- {
- // XCommandEnvironment
- virtual Reference<task::XInteractionHandler> SAL_CALL
- getInteractionHandler() throw (RuntimeException);
- virtual Reference<XProgressHandler> SAL_CALL getProgressHandler()
- throw (RuntimeException);
- // XInteractionHandler
- virtual void SAL_CALL handle(
- Reference<task::XInteractionRequest> const & xRequest )
- throw (RuntimeException);
- };
-
- const Reference<XComponentContext> m_xContext;
- OUString m_userData;
-
-protected:
- virtual ~MigrationImpl();
-public:
- MigrationImpl( Sequence<Any> const & args,
- Reference<XComponentContext> const & xComponentContext );
-
- // XJob
- virtual Any SAL_CALL execute( Sequence<beans::NamedValue> const & args )
- throw (lang::IllegalArgumentException, Exception, RuntimeException);
-};
-
-MigrationImpl::~MigrationImpl()
-{
-}
-
-MigrationImpl::MigrationImpl(
- Sequence<Any> const & args, Reference<XComponentContext> const & xContext )
- : m_xContext(xContext)
-{
- for ( sal_Int32 pos = args.getLength(); pos--; )
- {
- const beans::NamedValue nv(args[pos].get<beans::NamedValue>());
- if (nv.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("UserData") ))
- m_userData = nv.Value.get<OUString>();
- }
- if (m_userData.getLength() == 0)
- throw lang::IllegalArgumentException( OUSTR("missing UserData!"), 0,
- static_cast<sal_Int16>(-1) );
-}
-
-// XJob
-Any MigrationImpl::execute( Sequence<beans::NamedValue> const & )
- throw (lang::IllegalArgumentException, Exception, RuntimeException)
-{
- const Reference<deployment::XPackageManager> xManager(
- deployment::thePackageManagerFactory::get(
- m_xContext )->getPackageManager( OUSTR("user") ) );
- ::ucbhelper::Content packagesDir;
- if (create_ucb_content( &packagesDir,
- makeURL( m_userData, OUSTR("user/uno_packages") ),
- Reference<XCommandEnvironment>(),
- false /* no throw */ ))
- {
- const Reference<XCommandEnvironment> xCmdEnv(
- new CommandEnvironmentImpl );
- OUString const & strTitle = StrTitle::get();
- const Reference<sdbc::XResultSet> xResultSet(
- packagesDir.createCursor( Sequence<OUString>( &strTitle, 1 ),
- ::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) );
- while (xResultSet->next())
- {
- Reference<sdbc::XRow> xRow( xResultSet, UNO_QUERY_THROW );
- const OUString title( xRow->getString( 1 /* Title */ ) );
- // exclude stampIt, not migratable to OOo 2.0:
- if (title.matchIgnoreAsciiCaseAsciiL(
- RTL_CONSTASCII_STRINGPARAM("SSICONCT.") ))
- continue;
- const OUString sourceURL( Reference<XContentAccess>(
- xResultSet, UNO_QUERY_THROW )
- ->queryContentIdentifierString() );
- try {
- xManager->addPackage(
- sourceURL, OUString() /* detect media-type */,
- Reference<task::XAbortChannel>(), xCmdEnv );
- }
- catch (RuntimeException &) {
- throw;
- }
- catch (Exception &) {
- OSL_ENSURE( 0, ::rtl::OUStringToOString(
- ::comphelper::anyToString(
- ::cppu::getCaughtException() ),
- RTL_TEXTENCODING_UTF8 ).getStr() );
- }
- }
- }
- return Any();
-}
-
-// XCommandEnvironment
-Reference<task::XInteractionHandler>
-MigrationImpl::CommandEnvironmentImpl::getInteractionHandler()
- throw (RuntimeException)
-{
- return this;
-}
-
-Reference<XProgressHandler>
-MigrationImpl::CommandEnvironmentImpl::getProgressHandler()
- throw (RuntimeException)
-{
- return Reference<XProgressHandler>();
-}
-
-// XInteractionHandler
-void MigrationImpl::CommandEnvironmentImpl::handle(
- Reference<task::XInteractionRequest> const & xRequest )
- throw (RuntimeException)
-{
- Any request( xRequest->getRequest() );
- OSL_ASSERT( request.getValueTypeClass() == TypeClass_EXCEPTION );
-#if OSL_DEBUG_LEVEL > 1
- OSL_TRACE( "[dp_migration.cxx] incoming request:\n%s\n",
- ::rtl::OUStringToOString( ::comphelper::anyToString(request),
- RTL_TEXTENCODING_UTF8 ).getStr() );
-#endif
-
- // selections:
- bool approve = false;
- bool abort = false;
-
- lang::WrappedTargetException wtExc;
- if (request >>= wtExc) {
- OSL_ENSURE( 0, ::rtl::OUStringToOString(
- ::comphelper::anyToString(wtExc.TargetException),
- RTL_TEXTENCODING_UTF8 ).getStr() );
-
- // ignore intermediate errors of legacy packages, i.e.
- // former pkgchk behaviour:
- const Reference<deployment::XPackage> xPackage(
- wtExc.Context, UNO_QUERY );
- OSL_ASSERT( xPackage.is() );
- if (xPackage.is()) {
- const Reference<deployment::XPackageTypeInfo> xPackageType(
- xPackage->getPackageType() );
- OSL_ASSERT( xPackageType.is() );
- if (xPackageType.is()) {
- approve = (xPackage->isBundle() &&
- xPackageType->getMediaType().matchAsciiL(
- RTL_CONSTASCII_STRINGPARAM(
- "application/"
- "vnd.sun.star.legacy-package-bundle") ));
- }
- }
- abort = !approve;
- }
- else
- return; // unknown request => no selection at all
-
- // select:
- const Sequence< Reference<task::XInteractionContinuation> > conts(
- xRequest->getContinuations() );
- for ( sal_Int32 pos = 0; pos < conts.getLength(); ++pos )
- {
- if (approve) {
- const Reference<task::XInteractionApprove> xInteractionApprove(
- conts[ pos ], UNO_QUERY );
- if (xInteractionApprove.is()) {
- xInteractionApprove->select();
- // don't query again for ongoing continuations:
- approve = false;
- }
- }
- else if (abort) {
- const Reference<task::XInteractionAbort> xInteractionAbort(
- conts[ pos ], UNO_QUERY );
- if (xInteractionAbort.is()) {
- xInteractionAbort->select();
- // don't query again for ongoing continuations:
- abort = false;
- }
- }
- }
-}
-
-namespace sdecl = comphelper::service_decl;
-sdecl::class_<MigrationImpl, sdecl::with_args<true> > serviceMI;
-extern sdecl::ServiceDecl const serviceDecl(
- serviceMI,
- // a private one (config entry):
- "com.sun.star.comp.deployment.migration.Migration_2_0",
- "com.sun.star.comp.deployment.migration.Migration_2_0" );
-
-} // namespace dp_migration
-
diff --git a/desktop/source/deployment/misc/dp_dependencies.cxx b/desktop/source/deployment/misc/dp_dependencies.cxx
index 63badbb0c211..9534f166f2f0 100644
--- a/desktop/source/deployment/misc/dp_dependencies.cxx
+++ b/desktop/source/deployment/misc/dp_dependencies.cxx
@@ -56,17 +56,13 @@ namespace css = ::com::sun::star;
static char const xmlNamespace[] =
"http://openoffice.org/extensions/description/2006";
-::dp_misc::Order compareWithVersion(::rtl::OUString const & version) {
+bool satisfiesMinimalVersion(::rtl::OUString const & version) {
::rtl::OUString v(
RTL_CONSTASCII_USTRINGPARAM(
"${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("version")
":Version:OOOPackageVersion}"));
::rtl::Bootstrap::expandMacros(v);
- return ::dp_misc::compareVersions(v, version);
-}
-
-bool satisfiesMinimalVersion(::rtl::OUString const & version) {
- return compareWithVersion(version) != ::dp_misc::LESS;
+ return ::dp_misc::compareVersions(v, version) != ::dp_misc::LESS;
}
}
@@ -102,8 +98,14 @@ check(::dp_misc::DescriptionInfoset const & infoset) {
RTL_CONSTASCII_STRINGPARAM(
"OpenOffice.org-maximal-version")))
{
+ ::rtl::OUString v(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("version")
+ ":Version:OOOBaseVersion}"));
+ ::rtl::Bootstrap::expandMacros(v);
sat =
- compareWithVersion(
+ ::dp_misc::compareVersions(
+ v,
e->getAttribute(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value"))))
!= ::dp_misc::GREATER;
diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
index 28f45918e9e2..b4132db61f03 100644
--- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
+++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
@@ -35,6 +35,7 @@
#include "comphelper/sequence.hxx"
#include "comphelper/makesequence.hxx"
+#include "comphelper/processfactory.hxx"
#include "boost/optional.hpp"
#include "com/sun/star/beans/Optional.hpp"
#include "com/sun/star/lang/XMultiComponentFactory.hpp"
@@ -47,17 +48,23 @@
#include "com/sun/star/xml/dom/DOMException.hpp"
#include "com/sun/star/xml/dom/XNode.hpp"
#include "com/sun/star/xml/dom/XNodeList.hpp"
+#include "com/sun/star/xml/dom/XDocumentBuilder.hpp"
#include "com/sun/star/xml/xpath/XXPathAPI.hpp"
+#include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp"
#include "cppuhelper/implbase1.hxx"
+#include "cppuhelper/implbase2.hxx"
#include "cppuhelper/weak.hxx"
+#include "cppuhelper/exc_hlp.hxx"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "sal/types.h"
-
+#include "ucbhelper/content.hxx"
namespace {
namespace css = ::com::sun::star;
+using css::uno::Reference;
+using ::rtl::OUString;
class EmptyNodeList: public ::cppu::WeakImplHelper1< css::xml::dom::XNodeList >
{
@@ -110,10 +117,251 @@ css::uno::Reference< css::xml::dom::XNode > EmptyNodeList::item(::sal_Int32)
}
}
+/**The class uses the UCB to access the description.xml file in an
+ extension. The UCB must have been initialized already. It also
+ requires that the extension has already be unzipped to a particular
+ location.
+ */
+class ExtensionDescription
+{
+public:
+ /**throws an exception if the description.xml is not
+ available, cannot be read, does not contain the expected data,
+ or any other error occured. Therefore it shoult only be used with
+ new extensions.
+
+ Throws com::sun::star::uno::RuntimeException,
+ com::sun::star::deployment::DeploymentException,
+ dp_registry::backend::bundle::NoDescriptionException.
+ */
+ ExtensionDescription(
+ const css::uno::Reference<css::uno::XComponentContext>& xContext,
+ const ::rtl::OUString& installDir,
+ const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv);
+
+ ~ExtensionDescription();
+
+ css::uno::Reference<css::xml::dom::XNode> getRootElement() const
+ {
+ return m_xRoot;
+ }
+
+ ::rtl::OUString getExtensionRootUrl() const
+ {
+ return m_sExtensionRootUrl;
+ }
+
+
+private:
+ css::uno::Reference<css::xml::dom::XNode> m_xRoot;
+ ::rtl::OUString m_sExtensionRootUrl;
+};
+
+class NoDescriptionException
+{
+};
+
+class FileDoesNotExistFilter
+ : public ::cppu::WeakImplHelper2< css::ucb::XCommandEnvironment,
+ css::task::XInteractionHandler >
+
+{
+ //css::uno::Reference<css::task::XInteractionHandler> m_xHandler;
+ bool m_bExist;
+ css::uno::Reference< css::ucb::XCommandEnvironment > m_xCommandEnv;
+
+public:
+ virtual ~FileDoesNotExistFilter();
+ FileDoesNotExistFilter(
+ const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv);
+
+ bool exist();
+ // XCommandEnvironment
+ virtual css::uno::Reference<css::task::XInteractionHandler > SAL_CALL
+ getInteractionHandler() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference<css::ucb::XProgressHandler >
+ SAL_CALL getProgressHandler() throw (css::uno::RuntimeException);
+
+ // XInteractionHandler
+ virtual void SAL_CALL handle(
+ css::uno::Reference<css::task::XInteractionRequest > const & xRequest )
+ throw (css::uno::RuntimeException);
+};
+
+ExtensionDescription::ExtensionDescription(
+ const Reference<css::uno::XComponentContext>& xContext,
+ const OUString& installDir,
+ const Reference< css::ucb::XCommandEnvironment >& xCmdEnv)
+{
+ try {
+ m_sExtensionRootUrl = installDir;
+ //may throw ::com::sun::star::ucb::ContentCreationException
+ //If there is no description.xml then ucb will start an interaction which
+ //brings up a dialog.We want to prevent this. Therefore we wrap the xCmdEnv
+ //and filter the respective exception out.
+ OUString sDescriptionUri(installDir + OUSTR("/description.xml"));
+ Reference<css::ucb::XCommandEnvironment> xFilter =
+ static_cast<css::ucb::XCommandEnvironment*>(
+ new FileDoesNotExistFilter(xCmdEnv));
+ ::ucbhelper::Content descContent(sDescriptionUri, xFilter);
+
+ //throws an com::sun::star::uno::Exception if the file is not available
+ Reference<css::io::XInputStream> xIn;
+ try
+ { //throws com.sun.star.ucb.InteractiveAugmentedIOException
+ xIn = descContent.openStream();
+ }
+ catch (css::uno::Exception& )
+ {
+ if ( ! static_cast<FileDoesNotExistFilter*>(xFilter.get())->exist())
+ throw NoDescriptionException();
+ throw;
+ }
+ if (!xIn.is())
+ {
+ throw css::uno::Exception(
+ OUSTR("Could not get XInputStream for description.xml of extension ") +
+ sDescriptionUri, 0);
+ }
+
+ //get root node of description.xml
+ Reference<css::xml::dom::XDocumentBuilder> xDocBuilder(
+ xContext->getServiceManager()->createInstanceWithContext(
+ OUSTR("com.sun.star.xml.dom.DocumentBuilder"),
+ xContext ), css::uno::UNO_QUERY);
+ if (!xDocBuilder.is())
+ throw css::uno::Exception(OUSTR(" Could not create service com.sun.star.xml.dom.DocumentBuilder"), 0);
+
+ if (xDocBuilder->isNamespaceAware() == sal_False)
+ {
+ throw css::uno::Exception(
+ OUSTR("Service com.sun.star.xml.dom.DocumentBuilder is not namespace aware."), 0);
+ }
+
+ Reference<css::xml::dom::XDocument> xDoc = xDocBuilder->parse(xIn);
+ if (!xDoc.is())
+ {
+ throw css::uno::Exception(sDescriptionUri + OUSTR(" contains data which cannot be parsed. "), 0);
+ }
+
+ //check for proper root element and namespace
+ Reference<css::xml::dom::XElement> xRoot = xDoc->getDocumentElement();
+ if (!xRoot.is())
+ {
+ throw css::uno::Exception(
+ sDescriptionUri + OUSTR(" contains no root element."), 0);
+ }
+
+ if ( ! xRoot->getTagName().equals(OUSTR("description")))
+ {
+ throw css::uno::Exception(
+ sDescriptionUri + OUSTR(" does not contain the root element <description>."), 0);
+ }
+
+ m_xRoot = Reference<css::xml::dom::XNode>(
+ xRoot, css::uno::UNO_QUERY_THROW);
+ OUString nsDescription = xRoot->getNamespaceURI();
+
+ //check if this namespace is supported
+ if ( ! nsDescription.equals(OUSTR("http://openoffice.org/extensions/description/2006")))
+ {
+ throw css::uno::Exception(sDescriptionUri + OUSTR(" contains a root element with an unsupported namespace. "), 0);
+ }
+ } catch (css::uno::RuntimeException &) {
+ throw;
+ } catch (css::deployment::DeploymentException &) {
+ throw;
+ } catch (css::uno::Exception & e) {
+ css::uno::Any a(cppu::getCaughtException());
+ throw css::deployment::DeploymentException(
+ e.Message, Reference< css::uno::XInterface >(), a);
+ }
+}
+
+ExtensionDescription::~ExtensionDescription()
+{
+}
+
+//======================================================================
+FileDoesNotExistFilter::FileDoesNotExistFilter(
+ const Reference< css::ucb::XCommandEnvironment >& xCmdEnv):
+ m_bExist(true), m_xCommandEnv(xCmdEnv)
+{}
+
+FileDoesNotExistFilter::~FileDoesNotExistFilter()
+{
+};
+
+bool FileDoesNotExistFilter::exist()
+{
+ return m_bExist;
+}
+ // XCommandEnvironment
+Reference<css::task::XInteractionHandler >
+ FileDoesNotExistFilter::getInteractionHandler() throw (css::uno::RuntimeException)
+{
+ return static_cast<css::task::XInteractionHandler*>(this);
+}
+
+Reference<css::ucb::XProgressHandler >
+ FileDoesNotExistFilter::getProgressHandler() throw (css::uno::RuntimeException)
+{
+ return m_xCommandEnv.is()
+ ? m_xCommandEnv->getProgressHandler()
+ : Reference<css::ucb::XProgressHandler>();
+}
+
+// XInteractionHandler
+//If the interaction was caused by a non-existing file which is specified in the ctor
+//of FileDoesNotExistFilter, then we do nothing
+void FileDoesNotExistFilter::handle(
+ Reference<css::task::XInteractionRequest > const & xRequest )
+ throw (css::uno::RuntimeException)
+{
+ css::uno::Any request( xRequest->getRequest() );
+
+ css::ucb::InteractiveAugmentedIOException ioexc;
+ if ((request>>= ioexc) && ioexc.Code == css::ucb::IOErrorCode_NOT_EXISTING )
+ {
+ m_bExist = false;
+ return;
+ }
+ Reference<css::task::XInteractionHandler> xInteraction;
+ if (m_xCommandEnv.is()) {
+ xInteraction = m_xCommandEnv->getInteractionHandler();
+ }
+ if (xInteraction.is()) {
+ xInteraction->handle(xRequest);
+ }
+}
+
}
namespace dp_misc {
+DescriptionInfoset getDescriptionInfoset(OUString const & sExtensionFolderURL)
+{
+ Reference< css::xml::dom::XNode > root;
+ Reference<css::uno::XComponentContext> context =
+ comphelper_getProcessComponentContext();
+ OSL_ASSERT(context.is());
+ try {
+ root =
+ ExtensionDescription(
+ context, sExtensionFolderURL,
+ Reference< css::ucb::XCommandEnvironment >()).
+ getRootElement();
+ } catch (NoDescriptionException &) {
+ } catch (css::deployment::DeploymentException & e) {
+ throw css::uno::RuntimeException(
+ (OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.deployment.DeploymentException: ")) +
+ e.Message), 0);
+ }
+ return DescriptionInfoset(context, root);
+}
+
DescriptionInfoset::DescriptionInfoset(
css::uno::Reference< css::uno::XComponentContext > const & context,
css::uno::Reference< css::xml::dom::XNode > const & element):
@@ -264,12 +512,6 @@ DescriptionInfoset::getUpdateDownloadUrls() const
::boost::optional< ::rtl::OUString >();
}
-css::uno::Reference< css::xml::xpath::XXPathAPI > DescriptionInfoset::getXpath()
- const
-{
- return m_xpath;
-}
-
::boost::optional< ::rtl::OUString > DescriptionInfoset::getOptionalValue(
::rtl::OUString const & expression) const
{
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index 3ed2d554b59f..fe3490903043 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -30,6 +30,7 @@
#include "dp_misc.h"
+#include "dp_version.hxx"
#include "dp_interact.h"
#include "rtl/uri.hxx"
#include "rtl/digest.h"
@@ -42,10 +43,14 @@
#include "osl/thread.hxx"
#include "osl/mutex.hxx"
#include "com/sun/star/ucb/CommandAbortedException.hpp"
+#include "com/sun/star/task/XInteractionHandler.hpp"
#include "com/sun/star/bridge/UnoUrlResolver.hpp"
#include "com/sun/star/bridge/XUnoUrlResolver.hpp"
+#include "com/sun/star/deployment/ExtensionManager.hpp"
+#include "com/sun/star/task/XRestartManager.hpp"
#include "boost/scoped_array.hpp"
#include "boost/shared_ptr.hpp"
+#include <comphelper/processfactory.hxx>
#ifdef WNT
//#include "tools/prewin.h"
@@ -138,6 +143,103 @@ bool existsOfficePipe()
return pipe.is();
}
+
+//Returns true if the Folder was more recently modified then
+//the lastsynchronized file. That is the repository needs to
+//be synchronized.
+bool compareExtensionFolderWithLastSynchronizedFile(
+ OUString const & folderURL, OUString const & fileURL)
+{
+ bool bNeedsSync = false;
+ ::osl::DirectoryItem itemExtFolder;
+ ::osl::File::RC err1 =
+ ::osl::DirectoryItem::get(folderURL, itemExtFolder);
+ //If it does not exist, then there is nothing to be done
+ if (err1 == ::osl::File::E_NOENT)
+ {
+ return false;
+ }
+ else if (err1 != ::osl::File::E_None)
+ {
+ OSL_ENSURE(0, "Cannot access extension folder");
+ return true; //sync just in case
+ }
+
+ //If last synchronized does not exist, then OOo is started for the first time
+ ::osl::DirectoryItem itemFile;
+ ::osl::File::RC err2 = ::osl::DirectoryItem::get(fileURL, itemFile);
+ if (err2 == ::osl::File::E_NOENT)
+ {
+ return true;
+
+ }
+ else if (err2 != ::osl::File::E_None)
+ {
+ OSL_ENSURE(0, "Cannot access file lastsynchronized");
+ return true; //sync just in case
+ }
+
+ //compare the modification time of the extension folder and the last
+ //modified file
+ ::osl::FileStatus statFolder(FileStatusMask_ModifyTime);
+ ::osl::FileStatus statFile(FileStatusMask_ModifyTime);
+ if (itemExtFolder.getFileStatus(statFolder) == ::osl::File::E_None)
+ {
+ if (itemFile.getFileStatus(statFile) == ::osl::File::E_None)
+ {
+ TimeValue timeFolder = statFolder.getModifyTime();
+ TimeValue timeFile = statFile.getModifyTime();
+
+ if (timeFile.Seconds < timeFolder.Seconds)
+ bNeedsSync = true;
+ }
+ else
+ {
+ OSL_ASSERT(0);
+ bNeedsSync = true;
+ }
+ }
+ else
+ {
+ OSL_ASSERT(0);
+ bNeedsSync = true;
+ }
+ return bNeedsSync;
+}
+
+bool needToSyncRepostitory(OUString const & name)
+{
+ OUString folder;
+ OUString file;
+ if (name.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("bundled"))))
+ {
+ folder = OUString(
+ RTL_CONSTASCII_USTRINGPARAM("$BUNDLED_EXTENSIONS"));
+ file = OUString (
+ RTL_CONSTASCII_USTRINGPARAM(
+ "$BUNDLED_EXTENSIONS_USER/lastsynchronized"));
+ }
+ else if (name.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("shared"))))
+ {
+ folder = OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "$UNO_SHARED_PACKAGES_CACHE/uno_packages"));
+ file = OUString (
+ RTL_CONSTASCII_USTRINGPARAM(
+ "$SHARED_EXTENSIONS_USER/lastsynchronized"));
+ }
+ else
+ {
+ OSL_ASSERT(0);
+ return true;
+ }
+ ::rtl::Bootstrap::expandMacros(folder);
+ ::rtl::Bootstrap::expandMacros(file);
+ return compareExtensionFolderWithLastSynchronizedFile(
+ folder, file);
+}
+
+
} // anon namespace
//==============================================================================
@@ -197,6 +299,19 @@ OUString makeURL( OUString const & baseURL, OUString const & relPath_ )
return buf.makeStringAndClear();
}
+OUString makeURLAppendSysPathSegment( OUString const & baseURL, OUString const & relPath_ )
+{
+ OUString segment = relPath_;
+ OSL_ASSERT(segment.indexOf(static_cast<sal_Unicode>('/')) == -1);
+
+ ::rtl::Uri::encode(
+ segment, rtl_UriCharClassPchar, rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8);
+ return makeURL(baseURL, segment);
+}
+
+
+
//==============================================================================
OUString expandUnoRcTerm( OUString const & term_ )
{
@@ -205,6 +320,22 @@ OUString expandUnoRcTerm( OUString const & term_ )
return term;
}
+OUString makeRcTerm( OUString const & url )
+{
+ OSL_ASSERT( url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM(
+ "vnd.sun.star.expand:") ) );
+ if (url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:") )) {
+ // cut protocol:
+ OUString rcterm( url.copy( sizeof ("vnd.sun.star.expand:") - 1 ) );
+ // decode uric class chars:
+ rcterm = ::rtl::Uri::decode(
+ rcterm, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
+ return rcterm;
+ }
+ else
+ return url;
+}
+
//==============================================================================
OUString expandUnoRcUrl( OUString const & url )
{
@@ -346,17 +477,6 @@ Reference<XInterface> resolveUnoURL(
}
}
-OUString getExtensionDefaultUpdateURL()
-{
- ::rtl::OUString sUrl(
- RTL_CONSTASCII_USTRINGPARAM(
- "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version")
- ":Version:ExtensionUpdateURL}"));
- ::rtl::Bootstrap::expandMacros(sUrl);
- return sUrl;
-}
-
-
#ifdef WNT
void writeConsoleWithStream(::rtl::OUString const & sText, HANDLE stream)
{
@@ -467,4 +587,39 @@ void TRACE(::rtl::OString const & sText)
#endif
}
+void syncRepositories(Reference<ucb::XCommandEnvironment> const & xCmdEnv)
+{
+ Reference<deployment::XExtensionManager> xExtensionManager;
+ //synchronize shared before bundled otherewise there are
+ //more revoke and registration calls.
+ sal_Bool bModified = false;
+ if (needToSyncRepostitory(OUString(RTL_CONSTASCII_USTRINGPARAM("shared")))
+ || needToSyncRepostitory(OUString(RTL_CONSTASCII_USTRINGPARAM("bundled"))))
+ {
+ xExtensionManager =
+ deployment::ExtensionManager::get(
+ comphelper_getProcessComponentContext());
+
+ if (xExtensionManager.is())
+ {
+ bModified = xExtensionManager->synchronize(
+ Reference<task::XAbortChannel>(), xCmdEnv);
+ }
+ }
+
+ if (bModified)
+ {
+ Reference<task::XRestartManager> restarter(
+ comphelper_getProcessComponentContext()->getValueByName(
+ OUSTR( "/singletons/com.sun.star.task.OfficeRestartManager") ), UNO_QUERY );
+ if (restarter.is())
+ {
+ restarter->requestRestart(xCmdEnv.is() == sal_True ? xCmdEnv->getInteractionHandler() :
+ Reference<task::XInteractionHandler>());
+ }
+ }
+}
+
+
+
}
diff --git a/desktop/source/deployment/misc/dp_platform.cxx b/desktop/source/deployment/misc/dp_platform.cxx
index bb93f78689b6..ac28b6816708 100644
--- a/desktop/source/deployment/misc/dp_platform.cxx
+++ b/desktop/source/deployment/misc/dp_platform.cxx
@@ -39,6 +39,8 @@
#define PLATFORM_WIN_X86 "windows_x86"
#define PLATFORM_LINUX_X86 "linux_x86"
#define PLATFORM_LINUX_X86_64 "linux_x86_64"
+#define PLATFORM_KFREEBSD_X86 "kfreebsd_x86"
+#define PLATFORM_KFREEBSD_X86_64 "kfreebsd_x86_64"
#define PLATFORM_LINUX_SPARC "linux_sparc"
#define PLATFORM_LINUX_POWERPC "linux_powerpc"
#define PLATFORM_LINUX_POWERPC64 "linux_powerpc64"
@@ -47,8 +49,11 @@
#define PLATFORM_LINUX_MIPS_EL "linux_mips_el"
#define PLATFORM_LINUX_MIPS_EB "linux_mips_eb"
#define PLATFORM_LINUX_IA64 "linux_ia64"
+#define PLATFORM_LINUX_M68K "linux_m68k"
#define PLATFORM_LINUX_S390 "linux_s390"
#define PLATFORM_LINUX_S390x "linux_s390x"
+#define PLATFORM_LINUX_HPPA "linux_hppa"
+#define PLATFORM_LINUX_ALPHA "linux_alpha"
@@ -126,6 +131,10 @@ namespace
ret = checkOSandCPU(OUSTR("Linux"), OUSTR("x86"));
else if (token.equals(OUSTR(PLATFORM_LINUX_X86_64)))
ret = checkOSandCPU(OUSTR("Linux"), OUSTR("X86_64"));
+ else if (token.equals(OUSTR(PLATFORM_KFREEBSD_X86)))
+ ret = checkOSandCPU(OUSTR("kFreeBSD"), OUSTR("x86"));
+ else if (token.equals(OUSTR(PLATFORM_KFREEBSD_X86_64)))
+ ret = checkOSandCPU(OUSTR("kFreeBSD"), OUSTR("X86_64"));
else if (token.equals(OUSTR(PLATFORM_LINUX_SPARC)))
ret = checkOSandCPU(OUSTR("Linux"), OUSTR("SPARC"));
else if (token.equals(OUSTR(PLATFORM_LINUX_POWERPC)))
@@ -142,10 +151,16 @@ namespace
ret = checkOSandCPU(OUSTR("Linux"), OUSTR("MIPS_EB"));
else if (token.equals(OUSTR(PLATFORM_LINUX_IA64)))
ret = checkOSandCPU(OUSTR("Linux"), OUSTR("IA64"));
+ else if (token.equals(OUSTR(PLATFORM_LINUX_M68K)))
+ ret = checkOSandCPU(OUSTR("Linux"), OUSTR("M68K"));
else if (token.equals(OUSTR(PLATFORM_LINUX_S390)))
ret = checkOSandCPU(OUSTR("Linux"), OUSTR("S390"));
else if (token.equals(OUSTR(PLATFORM_LINUX_S390x)))
ret = checkOSandCPU(OUSTR("Linux"), OUSTR("S390x"));
+ else if (token.equals(OUSTR(PLATFORM_LINUX_HPPA)))
+ ret = checkOSandCPU(OUSTR("Linux"), OUSTR("HPPA"));
+ else if (token.equals(OUSTR(PLATFORM_LINUX_ALPHA)))
+ ret = checkOSandCPU(OUSTR("Linux"), OUSTR("ALPHA"));
else if (token.equals(OUSTR(PLATFORM_SOLARIS_SPARC)))
ret = checkOSandCPU(OUSTR("Solaris"), OUSTR("SPARC"));
else if (token.equals(OUSTR(PLATFORM_SOLARIS_SPARC64)))
diff --git a/desktop/source/deployment/misc/dp_ucb.cxx b/desktop/source/deployment/misc/dp_ucb.cxx
index 571aef9c1b95..795a492aa0d5 100644
--- a/desktop/source/deployment/misc/dp_ucb.cxx
+++ b/desktop/source/deployment/misc/dp_ucb.cxx
@@ -271,4 +271,50 @@ bool readLine( OUString * res, OUString const & startingWith,
return false;
}
+bool readProperties( ::std::list< ::std::pair< ::rtl::OUString, ::rtl::OUString> > & out_result,
+ ::ucbhelper::Content & ucb_content )
+{
+ // read whole file:
+ ::rtl::ByteSequence bytes( readFile( ucb_content ) );
+ OUString file( reinterpret_cast<sal_Char const *>(bytes.getConstArray()),
+ bytes.getLength(), RTL_TEXTENCODING_UTF8);
+ sal_Int32 pos = 0;
+
+ for (;;)
+ {
+
+ ::rtl::OUStringBuffer buf;
+ sal_Int32 start = pos;
+
+ bool bEOF = false;
+ pos = file.indexOf( LF, pos );
+ if (pos < 0) { // EOF
+ buf.append( file.copy( start ) );
+ bEOF = true;
+ }
+ else
+ {
+ if (pos > 0 && file[ pos - 1 ] == CR)
+ // consume extra CR
+ buf.append( file.copy( start, pos - start - 1 ) );
+ else
+ buf.append( file.copy( start, pos - start ) );
+ pos++;
+ }
+ OUString aLine = buf.makeStringAndClear();
+
+ sal_Int32 posEqual = aLine.indexOf('=');
+ if (posEqual > 0 && (posEqual + 1) < aLine.getLength())
+ {
+ OUString name = aLine.copy(0, posEqual);
+ OUString value = aLine.copy(posEqual + 1);
+ out_result.push_back(::std::make_pair(name, value));
+ }
+
+ if (bEOF)
+ break;
+ }
+ return false;
+}
+
}
diff --git a/desktop/source/deployment/misc/dp_update.cxx b/desktop/source/deployment/misc/dp_update.cxx
new file mode 100755
index 000000000000..52011f1f0ca0
--- /dev/null
+++ b/desktop/source/deployment/misc/dp_update.cxx
@@ -0,0 +1,397 @@
+/*************************************************************************
+ *
+ * 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_desktop.hxx"
+
+
+#include "dp_update.hxx"
+#include "dp_version.hxx"
+#include "dp_identifier.hxx"
+#include "dp_descriptioninfoset.hxx"
+
+#include "rtl/bootstrap.hxx"
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using ::rtl::OUString;
+using ::rtl::OString;
+
+
+namespace dp_misc {
+namespace {
+
+int determineHighestVersion(
+ ::rtl::OUString const & userVersion,
+ ::rtl::OUString const & sharedVersion,
+ ::rtl::OUString const & bundledVersion,
+ ::rtl::OUString const & onlineVersion)
+{
+ int index = 0;
+ OUString greatest = userVersion;
+ if (dp_misc::compareVersions(sharedVersion, greatest) == dp_misc::GREATER)
+ {
+ index = 1;
+ greatest = sharedVersion;
+ }
+ if (dp_misc::compareVersions(bundledVersion, greatest) == dp_misc::GREATER)
+ {
+ index = 2;
+ greatest = bundledVersion;
+ }
+ if (dp_misc::compareVersions(onlineVersion, greatest) == dp_misc::GREATER)
+ {
+ index = 3;
+ }
+ return index;
+}
+
+Sequence< Reference< xml::dom::XElement > >
+getUpdateInformation( Reference<deployment::XUpdateInformationProvider > const & updateInformation,
+ Sequence< OUString > const & urls,
+ OUString const & identifier,
+ uno::Any & out_error)
+{
+ try {
+ return updateInformation->getUpdateInformation(urls, identifier);
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (ucb::CommandFailedException & e) {
+ out_error = e.Reason;
+ } catch (ucb::CommandAbortedException &) {
+ } catch (uno::Exception & e) {
+ out_error = uno::makeAny(e);
+ }
+ return
+ Sequence<Reference< xml::dom::XElement > >();
+}
+
+//Put in anonymous namespace
+
+void getOwnUpdateInfos(
+ Reference<uno::XComponentContext> const & xContext,
+ Reference<deployment::XUpdateInformationProvider > const & updateInformation,
+ UpdateInfoMap& inout_map, std::vector<std::pair<Reference<deployment::XPackage>, uno::Any> > & out_errors,
+ bool & out_allFound)
+{
+ bool allHaveOwnUpdateInformation = true;
+ for (UpdateInfoMap::iterator i = inout_map.begin(); i != inout_map.end(); i++)
+ {
+ OSL_ASSERT(i->second.extension.is());
+ Sequence<OUString> urls(i->second.extension->getUpdateInformationURLs());
+ if (urls.getLength())
+ {
+ const OUString id = dp_misc::getIdentifier(i->second.extension);
+ uno::Any anyError;
+ //It is unclear from the idl if there can be a null reference returned.
+ //However all valid information should be the same
+ Sequence<Reference< xml::dom::XElement > >
+ infos(getUpdateInformation(updateInformation, urls, id, anyError));
+ if (anyError.hasValue())
+ out_errors.push_back(std::make_pair(i->second.extension, anyError));
+
+ for (sal_Int32 j = 0; j < infos.getLength(); ++j)
+ {
+ dp_misc::DescriptionInfoset infoset(
+ xContext,
+ Reference< xml::dom::XNode >(infos[j], UNO_QUERY_THROW));
+ if (!infoset.hasDescription())
+ continue;
+ boost::optional< OUString > id2(infoset.getIdentifier());
+ if (!id2)
+ continue;
+ OSL_ASSERT(*id2 == id);
+ if (*id2 == id)
+ {
+ i->second.version = infoset.getVersion();
+ i->second.info = Reference< xml::dom::XNode >(
+ infos[j], UNO_QUERY_THROW);
+ }
+ break;
+ }
+ }
+ else
+ {
+ allHaveOwnUpdateInformation &= false;
+ }
+ }
+ out_allFound = allHaveOwnUpdateInformation;
+}
+
+void getDefaultUpdateInfos(
+ Reference<uno::XComponentContext> const & xContext,
+ Reference<deployment::XUpdateInformationProvider > const & updateInformation,
+ UpdateInfoMap& inout_map,
+ std::vector<std::pair<Reference<deployment::XPackage>, uno::Any> > & out_errors)
+{
+ const rtl::OUString sDefaultURL(dp_misc::getExtensionDefaultUpdateURL());
+ OSL_ASSERT(sDefaultURL.getLength());
+
+ Any anyError;
+ Sequence< Reference< xml::dom::XElement > >
+ infos(
+ getUpdateInformation(
+ updateInformation,
+ Sequence< OUString >(&sDefaultURL, 1), OUString(), anyError));
+ if (anyError.hasValue())
+ out_errors.push_back(std::make_pair(Reference<deployment::XPackage>(), anyError));
+ for (sal_Int32 i = 0; i < infos.getLength(); ++i)
+ {
+ Reference< xml::dom::XNode > node(infos[i], UNO_QUERY_THROW);
+ dp_misc::DescriptionInfoset infoset(xContext, node);
+ boost::optional< OUString > id(infoset.getIdentifier());
+ if (!id) {
+ continue;
+ }
+ UpdateInfoMap::iterator j = inout_map.find(*id);
+ if (j != inout_map.end())
+ {
+ //skip those extension which provide its own update urls
+ if (j->second.extension->getUpdateInformationURLs().getLength())
+ continue;
+ OUString v(infoset.getVersion());
+ //look for the highest version in the online repository
+ if (dp_misc::compareVersions(v, j->second.version) ==
+ dp_misc::GREATER)
+ {
+ j->second.version = v;
+ j->second.info = node;
+ }
+ }
+ }
+}
+
+
+} // anon namespace
+
+
+OUString getExtensionDefaultUpdateURL()
+{
+ ::rtl::OUString sUrl(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version")
+ ":Version:ExtensionUpdateURL}"));
+ ::rtl::Bootstrap::expandMacros(sUrl);
+ return sUrl;
+}
+
+/* returns the index of the greatest version, starting with 0
+
+ */
+UPDATE_SOURCE isUpdateUserExtension(
+ bool bReadOnlyShared,
+ ::rtl::OUString const & userVersion,
+ ::rtl::OUString const & sharedVersion,
+ ::rtl::OUString const & bundledVersion,
+ ::rtl::OUString const & onlineVersion)
+{
+ UPDATE_SOURCE retVal = UPDATE_SOURCE_NONE;
+ if (bReadOnlyShared)
+ {
+ if (userVersion.getLength())
+ {
+ int index = determineHighestVersion(
+ userVersion, sharedVersion, bundledVersion, onlineVersion);
+ if (index == 1)
+ retVal = UPDATE_SOURCE_SHARED;
+ else if (index == 2)
+ retVal = UPDATE_SOURCE_BUNDLED;
+ else if (index == 3)
+ retVal = UPDATE_SOURCE_ONLINE;
+ }
+ else if (sharedVersion.getLength())
+ {
+ int index = determineHighestVersion(
+ OUString(), sharedVersion, bundledVersion, onlineVersion);
+ if (index == 2)
+ retVal = UPDATE_SOURCE_BUNDLED;
+ 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;
+ }
+ }
+ else
+ {
+ if (userVersion.getLength())
+ {
+ int index = determineHighestVersion(
+ userVersion, sharedVersion, bundledVersion, onlineVersion);
+ if (index == 1)
+ retVal = UPDATE_SOURCE_SHARED;
+ else if (index == 2)
+ retVal = UPDATE_SOURCE_BUNDLED;
+ else if (index == 3)
+ retVal = UPDATE_SOURCE_ONLINE;
+ }
+ }
+
+ return retVal;
+}
+
+UPDATE_SOURCE isUpdateSharedExtension(
+ bool bReadOnlyShared,
+ ::rtl::OUString const & sharedVersion,
+ ::rtl::OUString const & bundledVersion,
+ ::rtl::OUString const & onlineVersion)
+{
+ if (bReadOnlyShared)
+ return UPDATE_SOURCE_NONE;
+ UPDATE_SOURCE retVal = UPDATE_SOURCE_NONE;
+
+ if (sharedVersion.getLength())
+ {
+ int index = determineHighestVersion(
+ OUString(), sharedVersion, bundledVersion, onlineVersion);
+ if (index == 2)
+ retVal = UPDATE_SOURCE_BUNDLED;
+ 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;
+ }
+ return retVal;
+}
+
+Reference<deployment::XPackage>
+getExtensionWithHighestVersion(
+ Sequence<Reference<deployment::XPackage> > const & seqExt)
+{
+ if (seqExt.getLength() == 0)
+ return Reference<deployment::XPackage>();
+
+ Reference<deployment::XPackage> greatest;
+ sal_Int32 len = seqExt.getLength();
+
+ for (sal_Int32 i = 0; i < len; i++)
+ {
+ if (!greatest.is())
+ {
+ greatest = seqExt[i];
+ continue;
+ }
+ Reference<deployment::XPackage> const & current = seqExt[i];
+ //greatest has a value
+ if (! current.is())
+ continue;
+
+ if (dp_misc::compareVersions(current->getVersion(), greatest->getVersion()) == dp_misc::GREATER)
+ greatest = current;
+ }
+ return greatest;
+}
+
+UpdateInfo::UpdateInfo( Reference< deployment::XPackage> const & ext):
+extension(ext)
+{
+}
+
+
+
+UpdateInfoMap getOnlineUpdateInfos(
+ Reference<uno::XComponentContext> const &xContext,
+ Reference<deployment::XExtensionManager> const & xExtMgr,
+ Reference<deployment::XUpdateInformationProvider > const & updateInformation,
+ std::vector<Reference<deployment::XPackage > > const * extensionList,
+ std::vector<std::pair< Reference<deployment::XPackage>, uno::Any> > & out_errors)
+{
+ OSL_ASSERT(xExtMgr.is());
+ UpdateInfoMap infoMap;
+ if (!xExtMgr.is())
+ return infoMap;
+
+ if (!extensionList)
+ {
+ const uno::Sequence< uno::Sequence< Reference<deployment::XPackage > > > seqAllExt = xExtMgr->getAllExtensions(
+ Reference<task::XAbortChannel>(), Reference<ucb::XCommandEnvironment>());
+
+ //fill the UpdateInfoMap. key = extension identifier, value = UpdateInfo
+ for (int pos = seqAllExt.getLength(); pos --; )
+ {
+ uno::Sequence<Reference<deployment::XPackage> > const & seqExt = seqAllExt[pos];
+
+ Reference<deployment::XPackage> extension = getExtensionWithHighestVersion(seqExt);
+ OSL_ASSERT(extension.is());
+
+ std::pair<UpdateInfoMap::iterator, bool> insertRet = infoMap.insert(
+ UpdateInfoMap::value_type(
+ dp_misc::getIdentifier(extension), UpdateInfo(extension)));
+ OSL_ASSERT(insertRet.second == true);
+ }
+ }
+ else
+ {
+ typedef std::vector<Reference<deployment::XPackage > >::const_iterator CIT;
+ for (CIT i = extensionList->begin(); i != extensionList->end(); i++)
+ {
+ OSL_ASSERT(i->is());
+ std::pair<UpdateInfoMap::iterator, bool> insertRet = infoMap.insert(
+ UpdateInfoMap::value_type(
+ dp_misc::getIdentifier(*i), UpdateInfo(*i)));
+ OSL_ASSERT(insertRet.second == true);
+ }
+ }
+
+ //Now find the update information for the extensions which provide their own
+ //URLs to update information.
+ bool allInfosObtained = false;
+ getOwnUpdateInfos(xContext, updateInformation, infoMap, out_errors, allInfosObtained);
+
+ if (!allInfosObtained)
+ getDefaultUpdateInfos(xContext, updateInformation, infoMap, out_errors);
+ return infoMap;
+}
+OUString getHighestVersion(
+ ::rtl::OUString const & userVersion,
+ ::rtl::OUString const & sharedVersion,
+ ::rtl::OUString const & bundledVersion,
+ ::rtl::OUString const & onlineVersion)
+{
+ int index = determineHighestVersion(userVersion, sharedVersion, bundledVersion, onlineVersion);
+ switch (index)
+ {
+ case 0: return userVersion;
+ case 1: return sharedVersion;
+ case 2: return bundledVersion;
+ case 3: return onlineVersion;
+ default: OSL_ASSERT(0);
+ }
+
+ return OUString();
+}
+} //namespace dp_misc
diff --git a/desktop/source/deployment/misc/dp_version.cxx b/desktop/source/deployment/misc/dp_version.cxx
index 1668ebe4a0b7..c0da0533b54c 100644
--- a/desktop/source/deployment/misc/dp_version.cxx
+++ b/desktop/source/deployment/misc/dp_version.cxx
@@ -70,11 +70,5 @@ namespace dp_misc {
return ::dp_misc::EQUAL;
}
-::dp_misc::Order comparePackageVersions(
- css::uno::Reference< css::deployment::XPackage > const & package1,
- css::uno::Reference< css::deployment::XPackage > const & package2)
-{
- return compareVersions(package1->getVersion(), package2->getVersion());
-}
}
diff --git a/desktop/source/deployment/misc/makefile.mk b/desktop/source/deployment/misc/makefile.mk
index e191169202fd..3e4bd68cb4c0 100644
--- a/desktop/source/deployment/misc/makefile.mk
+++ b/desktop/source/deployment/misc/makefile.mk
@@ -65,7 +65,8 @@ SHL1OBJS = \
$(SLO)$/dp_version.obj \
$(SLO)$/dp_descriptioninfoset.obj \
$(SLO)$/dp_dependencies.obj \
- $(SLO)$/dp_platform.obj
+ $(SLO)$/dp_platform.obj \
+ $(SLO)$/dp_update.obj
SHL1STDLIBS = \
$(BERKELEYLIB) \
@@ -75,7 +76,8 @@ SHL1STDLIBS = \
$(TOOLSLIB) \
$(UCBHELPERLIB) \
$(UNOTOOLSLIB) \
- $(XMLSCRIPTLIB)
+ $(XMLSCRIPTLIB) \
+ $(COMPHELPERLIB)
.IF "$(GUI)"=="OS2"
SHL1IMPLIB = ideploymentmisc$(DLLPOSTFIX)
LIB1TARGET = $(SLB)$/_deplmisc.lib
diff --git a/desktop/source/deployment/registry/component/dp_compbackenddb.cxx b/desktop/source/deployment/registry/component/dp_compbackenddb.cxx
new file mode 100644
index 000000000000..898e7c931f6d
--- /dev/null
+++ b/desktop/source/deployment/registry/component/dp_compbackenddb.cxx
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * 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_desktop.hxx"
+
+#include "rtl/string.h"
+#include "rtl/bootstrap.hxx"
+#include "cppuhelper/exc_hlp.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/xml/dom/XDocumentBuilder.hpp"
+#include "com/sun/star/xml/xpath/XXPathAPI.hpp"
+#include "dp_misc.h"
+
+#include "dp_compbackenddb.hxx"
+
+
+namespace css = ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using ::rtl::OUString;
+
+#define EXTENSION_REG_NS "http://openoffice.org/extensionmanager/component-registry/2010"
+#define NS_PREFIX "comp"
+#define ROOT_ELEMENT_NAME "component-backend-db"
+#define KEY_ELEMENT_NAME "component"
+
+namespace dp_registry {
+namespace backend {
+namespace component {
+
+ComponentBackendDb::ComponentBackendDb(
+ Reference<XComponentContext> const & xContext,
+ ::rtl::OUString const & url):BackendDb(xContext, url)
+{
+
+}
+
+OUString ComponentBackendDb::getDbNSName()
+{
+ return OUSTR(EXTENSION_REG_NS);
+}
+
+OUString ComponentBackendDb::getNSPrefix()
+{
+ return OUSTR(NS_PREFIX);
+}
+
+OUString ComponentBackendDb::getRootElementName()
+{
+ return OUSTR(ROOT_ELEMENT_NAME);
+}
+
+OUString ComponentBackendDb::getKeyElementName()
+{
+ return OUSTR(KEY_ELEMENT_NAME);
+}
+
+void ComponentBackendDb::addEntry(::rtl::OUString const & url, Data const & data)
+{
+ try{
+ Reference<css::xml::dom::XNode> componentNode = writeKeyElement(url);
+ writeSimpleElement(OUSTR("java-type-library"),
+ OUString::valueOf((sal_Bool) data.javaTypeLibrary),
+ componentNode);
+
+ writeSimpleList(
+ data.implementationNames,
+ OUSTR("implementation-names"),
+ OUSTR("name"),
+ componentNode);
+
+ writeVectorOfPair(
+ data.singletons,
+ OUSTR("singletons"),
+ OUSTR("item"),
+ OUSTR("key"),
+ OUSTR("value"),
+ componentNode);
+
+ save();
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to write data entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+ComponentBackendDb::Data ComponentBackendDb::getEntry(::rtl::OUString const & url)
+{
+ try
+ {
+ ComponentBackendDb::Data retData;
+ Reference<css::xml::dom::XNode> aNode = getKeyElement(url);
+ if (aNode.is())
+ {
+ bool bJava = readSimpleElement(OUSTR("java-type-library"), aNode)
+ .equals(OUSTR("true")) ? true : false;
+ retData.javaTypeLibrary = bJava;
+
+ retData.implementationNames =
+ readList(
+ aNode,
+ OUSTR("implementation-names"),
+ OUSTR("name"));
+
+ retData.singletons =
+ readVectorOfPair(
+ aNode,
+ OUSTR("singletons"),
+ OUSTR("item"),
+ OUSTR("key"),
+ OUSTR("value"));
+ }
+ return retData;
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to read data entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+
+} // namespace bundle
+} // namespace backend
+} // namespace dp_registry
+
diff --git a/desktop/source/deployment/registry/component/dp_compbackenddb.hxx b/desktop/source/deployment/registry/component/dp_compbackenddb.hxx
new file mode 100644
index 000000000000..b9a5ed737b7c
--- /dev/null
+++ b/desktop/source/deployment/registry/component/dp_compbackenddb.hxx
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#if ! defined INCLUDED_DP_COMPBACKENDDB_HXX
+#define INCLUDED_DP_COMPBACKENDDB_HXX
+
+#include "rtl/ustring.hxx"
+#include "rtl/string.hxx"
+#include <vector>
+#include <list>
+#include "dp_backenddb.hxx"
+
+namespace css = ::com::sun::star;
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+ namespace xml { namespace dom {
+ class XDocument;
+ class XNode;
+ }}
+ namespace xml { namespace xpath {
+ class XXPathAPI;
+ }}
+}}}
+
+namespace dp_registry {
+namespace backend {
+namespace component {
+
+/* The XML file stores the extensions which are currently registered.
+ They will be removed when they are revoked.
+ The format looks like this:
+
+<?xml version="1.0"?>
+<component-backend-db xmlns="http://openoffice.org/extensionmanager/component-registry/2010">
+ <component url="vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/uno_packages/5CD5.tmp_/leaves1.oxt/extensionoptions.jar">
+ <name>FileName</name>
+ <java-type-library>true</java-type-library>
+ <implementation-names>
+ <name>com.sun.star.comp.extensionoptions.OptionsEventHandler$_OptionsEventHandler</name>
+ ...
+ </implementation-names>
+ <singletons>
+ <item>
+ <key>com.sun.star.java.theJavaVirtualMachine</key>
+ <value>com.sun.star.java.JavaVirtualMachine</value>
+ </item>
+ ...
+ </singletons>
+ </component>
+
+ <component ...>
+ ...
+</component-backend-db>
+ */
+class ComponentBackendDb: public dp_registry::backend::BackendDb
+{
+protected:
+ virtual ::rtl::OUString getDbNSName();
+ virtual ::rtl::OUString getNSPrefix();
+ virtual ::rtl::OUString getRootElementName();
+ virtual ::rtl::OUString getKeyElementName();
+
+public:
+ struct Data
+ {
+ Data(): javaTypeLibrary(false) {};
+
+ ::std::list< ::rtl::OUString> implementationNames;
+ /* every singleton has a key and a value
+ */
+ ::std::vector< ::std::pair< ::rtl::OUString, ::rtl::OUString> >singletons;
+ bool javaTypeLibrary;
+ };
+
+public:
+
+ ComponentBackendDb( css::uno::Reference<css::uno::XComponentContext> const & xContext,
+ ::rtl::OUString const & url);
+
+ void addEntry(::rtl::OUString const & url, Data const & data);
+
+ Data getEntry(::rtl::OUString const & url);
+
+
+};
+
+
+
+}
+}
+}
+#endif
+
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index e6781e2a1746..e0844c227669 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -58,7 +58,7 @@
#include <vector>
#include <memory>
#include <algorithm>
-
+#include "dp_compbackenddb.hxx"
using namespace ::dp_misc;
using namespace ::com::sun::star;
@@ -74,6 +74,8 @@ namespace {
typedef ::std::list<OUString> t_stringlist;
typedef ::std::vector< ::std::pair<OUString, OUString> > t_stringpairvec;
+#define IMPLEMENTATION_NAME "com.sun.star.comp.deployment.component.PackageRegistryBackend"
+
/** return a vector of bootstrap variables which have been provided
as command arguments.
*/
@@ -119,7 +121,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
BackendImpl * getMyBackend() const;
const OUString m_loader;
- Reference<XComponentContext> m_xRemoteContext;
+ ComponentBackendDb::Data m_registeredComponentsDb;
enum reg {
REG_UNINIT, REG_VOID, REG_REGISTERED, REG_NOT_REGISTERED, REG_MAYBE_REGISTERED
@@ -139,6 +141,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
@@ -149,16 +152,12 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
const Reference<registry::XSimpleRegistry> getRDB_RO() const;
public:
- inline ComponentPackageImpl(
+ ComponentPackageImpl(
::rtl::Reference<PackageRegistryBackend> const & myBackend,
OUString const & url, OUString const & name,
Reference<deployment::XPackageTypeInfo> const & xPackageType,
- OUString const & loader )
- : Package( myBackend, url, name, name /* display-name */,
- xPackageType ),
- m_loader( loader ),
- m_registered( REG_UNINIT )
- {}
+ OUString const & loader, bool bRemoved,
+ OUString const & identifier);
};
friend class ComponentPackageImpl;
@@ -179,19 +178,17 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
public:
- inline TypelibraryPackageImpl(
+ TypelibraryPackageImpl(
::rtl::Reference<PackageRegistryBackend> const & myBackend,
OUString const & url, OUString const & name,
Reference<deployment::XPackageTypeInfo> const & xPackageType,
- bool jarFile )
- : Package( myBackend, url, name, name /* display-name */,
- xPackageType ),
- m_jarFile( jarFile )
- {}
+ bool jarFile, bool bRemoved,
+ OUString const & identifier);
};
friend class TypelibraryPackageImpl;
@@ -212,6 +209,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
// PackageRegistryBackend
virtual Reference<deployment::XPackage> bindPackage_(
OUString const & url, OUString const & mediaType,
+ sal_Bool bRemoved, OUString const & identifier,
Reference<XCommandEnvironment> const & xCmdEnv );
virtual void SAL_CALL disposing();
@@ -230,6 +228,13 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
OUString m_commonRDB_RO;
OUString m_nativeRDB_RO;
+ std::auto_ptr<ComponentBackendDb> m_backendDb;
+
+ void addDataToDb(OUString const & url, ComponentBackendDb::Data const & data);
+ void deleteDataFromDb(OUString const & url);
+ ComponentBackendDb::Data readDataFromDb(OUString const & url);
+
+
//These rdbs are for writing new service entries. The rdb files are copies
//which are created when services are added or removed.
Reference<registry::XSimpleRegistry> m_xCommonRDB;
@@ -275,6 +280,25 @@ public:
};
//______________________________________________________________________________
+
+BackendImpl::ComponentPackageImpl::ComponentPackageImpl(
+ ::rtl::Reference<PackageRegistryBackend> const & myBackend,
+ OUString const & url, OUString const & name,
+ Reference<deployment::XPackageTypeInfo> const & xPackageType,
+ OUString const & loader, bool bRemoved,
+ OUString const & identifier)
+ : Package( myBackend, url, name, name /* display-name */,
+ xPackageType, bRemoved, identifier),
+ m_loader( loader ),
+ m_registered( REG_UNINIT )
+{
+ if (bRemoved)
+ {
+ m_registeredComponentsDb = getMyBackend()->readDataFromDb(url);
+ }
+}
+
+
const Reference<registry::XSimpleRegistry>
BackendImpl::ComponentPackageImpl::getRDB() const
{
@@ -332,7 +356,7 @@ BackendImpl * BackendImpl::ComponentPackageImpl::getMyBackend() const
//______________________________________________________________________________
void BackendImpl::ComponentPackageImpl::disposing()
{
- m_xRemoteContext.clear();
+// m_xRemoteContext.clear();
Package::disposing();
}
@@ -371,59 +395,59 @@ void BackendImpl::disposing()
}
}
+
void BackendImpl::initServiceRdbFiles()
{
const Reference<XCommandEnvironment> xCmdEnv;
- if (! m_readOnly)
+
+ ::ucbhelper::Content cacheDir( getCachePath(), xCmdEnv );
+ ::ucbhelper::Content oldRDB;
+ // switch common rdb:
+ if (m_commonRDB_RO.getLength() > 0)
{
- ::ucbhelper::Content cacheDir( getCachePath(), xCmdEnv );
- ::ucbhelper::Content oldRDB;
- // switch common rdb:
- if (m_commonRDB_RO.getLength() > 0)
- {
- create_ucb_content(
- &oldRDB, makeURL( getCachePath(), m_commonRDB_RO),
- xCmdEnv, false /* no throw */ );
- }
- m_commonRDB = m_commonRDB_RO.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM("common.rdb") )
- ? OUSTR("common_.rdb") : OUSTR("common.rdb");
- if (oldRDB.get().is())
- {
- if (! cacheDir.transferContent(
+ create_ucb_content(
+ &oldRDB, makeURL( getCachePath(), m_commonRDB_RO),
+ xCmdEnv, false /* no throw */ );
+ }
+ m_commonRDB = m_commonRDB_RO.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("common.rdb") )
+ ? OUSTR("common_.rdb") : OUSTR("common.rdb");
+ if (oldRDB.get().is())
+ {
+ if (! cacheDir.transferContent(
oldRDB, ::ucbhelper::InsertOperation_COPY,
m_commonRDB, NameClash::OVERWRITE ))
- {
-
- throw RuntimeException(
- OUSTR("UCB transferContent() failed!"), 0 );
- }
- oldRDB = ::ucbhelper::Content();
- }
- // switch native rdb:
- if (m_nativeRDB_RO.getLength() > 0)
{
- create_ucb_content(
- &oldRDB, makeURL(getCachePath(), m_nativeRDB_RO),
- xCmdEnv, false /* no throw */ );
+
+ throw RuntimeException(
+ OUSTR("UCB transferContent() failed!"), 0 );
}
- const OUString plt_rdb( getPlatformString() + OUSTR(".rdb") );
- const OUString plt_rdb_( getPlatformString() + OUSTR("_.rdb") );
- m_nativeRDB = m_nativeRDB_RO.equals( plt_rdb ) ? plt_rdb_ : plt_rdb;
- if (oldRDB.get().is())
- {
- if (! cacheDir.transferContent(
+ oldRDB = ::ucbhelper::Content();
+ }
+ // switch native rdb:
+ if (m_nativeRDB_RO.getLength() > 0)
+ {
+ create_ucb_content(
+ &oldRDB, makeURL(getCachePath(), m_nativeRDB_RO),
+ xCmdEnv, false /* no throw */ );
+ }
+ const OUString plt_rdb( getPlatformString() + OUSTR(".rdb") );
+ const OUString plt_rdb_( getPlatformString() + OUSTR("_.rdb") );
+ m_nativeRDB = m_nativeRDB_RO.equals( plt_rdb ) ? plt_rdb_ : plt_rdb;
+ if (oldRDB.get().is())
+ {
+ if (! cacheDir.transferContent(
oldRDB, ::ucbhelper::InsertOperation_COPY,
m_nativeRDB, NameClash::OVERWRITE ))
- throw RuntimeException(
+ throw RuntimeException(
OUSTR("UCB transferContent() failed!"), 0 );
- }
-
- // UNO is bootstrapped, flush for next process start:
- m_unorc_modified = true;
- unorc_flush( Reference<XCommandEnvironment>() );
}
+ // UNO is bootstrapped, flush for next process start:
+ m_unorc_modified = true;
+ unorc_flush( Reference<XCommandEnvironment>() );
+
+
// common rdb for java, native rdb for shared lib components
if (m_commonRDB.getLength() > 0) {
m_xCommonRDB.set(
@@ -433,7 +457,8 @@ void BackendImpl::initServiceRdbFiles()
m_xComponentContext ), UNO_QUERY_THROW );
m_xCommonRDB->open(
makeURL( expandUnoRcUrl(getCachePath()), m_commonRDB ),
- m_readOnly, !m_readOnly );
+// m_readOnly, !m_readOnly );
+ false, true);
}
if (m_nativeRDB.getLength() > 0) {
m_xNativeRDB.set(
@@ -443,7 +468,8 @@ void BackendImpl::initServiceRdbFiles()
m_xComponentContext ), UNO_QUERY_THROW );
m_xNativeRDB->open(
makeURL( expandUnoRcUrl(getCachePath()), m_nativeRDB ),
- m_readOnly, !m_readOnly );
+// m_readOnly, !m_readOnly );
+ false, true);
}
}
@@ -562,9 +588,33 @@ BackendImpl::BackendImpl(
initServiceRdbFiles_RO();
+ OUString dbFile = makeURL(getCachePath(), OUSTR("backenddb.xml"));
+ m_backendDb.reset(
+ new ComponentBackendDb(getComponentContext(), dbFile));
}
}
+void BackendImpl::addDataToDb(
+ OUString const & url, ComponentBackendDb::Data const & data)
+{
+ if (m_backendDb.get())
+ m_backendDb->addEntry(url, data);
+}
+
+void BackendImpl::deleteDataFromDb(OUString const & url)
+{
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
+}
+
+ComponentBackendDb::Data BackendImpl::readDataFromDb(OUString const & url)
+{
+ ComponentBackendDb::Data data;
+ if (m_backendDb.get())
+ data = m_backendDb->getEntry(url);
+ return data;
+}
+
// XPackageRegistry
//______________________________________________________________________________
Sequence< Reference<deployment::XPackageTypeInfo> >
@@ -577,6 +627,7 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
//______________________________________________________________________________
Reference<deployment::XPackage> BackendImpl::bindPackage_(
OUString const & url, OUString const & mediaType_,
+ sal_Bool bRemoved, OUString const & identifier,
Reference<XCommandEnvironment> const & xCmdEnv )
{
OUString mediaType(mediaType_);
@@ -632,9 +683,14 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
{
if (type.EqualsIgnoreCaseAscii("application"))
{
- ::ucbhelper::Content ucbContent( url, xCmdEnv );
- const OUString name( ucbContent.getPropertyValue(
- StrTitle::get() ).get<OUString>() );
+ OUString name;
+ if (!bRemoved)
+ {
+ ::ucbhelper::Content ucbContent( url, xCmdEnv );
+ name = ucbContent.getPropertyValue(
+ StrTitle::get() ).get<OUString>();
+ }
+
if (subType.EqualsIgnoreCaseAscii("vnd.sun.star.uno-component"))
{
// xxx todo: probe and evaluate component xml description
@@ -649,17 +705,20 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
if (value.EqualsIgnoreCaseAscii("native")) {
return new BackendImpl::ComponentPackageImpl(
this, url, name, m_xDynComponentTypeInfo,
- OUSTR("com.sun.star.loader.SharedLibrary") );
+ OUSTR("com.sun.star.loader.SharedLibrary"),
+ bRemoved, identifier);
}
if (value.EqualsIgnoreCaseAscii("Java")) {
return new BackendImpl::ComponentPackageImpl(
this, url, name, m_xJavaComponentTypeInfo,
- OUSTR("com.sun.star.loader.Java2") );
+ OUSTR("com.sun.star.loader.Java2"),
+ bRemoved, identifier);
}
if (value.EqualsIgnoreCaseAscii("Python")) {
return new BackendImpl::ComponentPackageImpl(
this, url, name, m_xPythonComponentTypeInfo,
- OUSTR("com.sun.star.loader.Python") );
+ OUSTR("com.sun.star.loader.Python"),
+ bRemoved, identifier);
}
}
}
@@ -675,12 +734,12 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
{
return new BackendImpl::TypelibraryPackageImpl(
this, url, name, m_xRDBTypelibTypeInfo,
- false /* rdb */ );
+ false /* rdb */, bRemoved, identifier);
}
if (value.EqualsIgnoreCaseAscii("Java")) {
return new BackendImpl::TypelibraryPackageImpl(
this, url, name, m_xJavaTypelibTypeInfo,
- true /* jar */ );
+ true /* jar */, bRemoved, identifier);
}
}
}
@@ -717,16 +776,18 @@ void BackendImpl::unorc_verify_init(
sal_Int32 index = sizeof ("UNO_JAVA_CLASSPATH=") - 1;
do {
OUString token( line.getToken( 0, ' ', index ).trim() );
- if (token.getLength() > 0) {
- // cleanup, check if existing:
+ if (token.getLength() > 0)
+ {
if (create_ucb_content(
0, expandUnoRcTerm(token), xCmdEnv,
- false /* no throw */ )) {
+ false /* no throw */ ))
+ {
+ //The jar file may not exist anymore if a shared or bundled
+ //extension was removed, but it can still be in the unorc
+ //After running XExtensionManager::synchronize, the unorc is
+ //cleaned up
m_jar_typelibs.push_back( token );
}
- else
- OSL_ENSURE(
- 0, "### invalid UNO_JAVA_CLASSPATH entry!" );
}
}
while (index >= 0);
@@ -736,17 +797,20 @@ void BackendImpl::unorc_verify_init(
sal_Int32 index = sizeof ("UNO_TYPES=") - 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 */ )) {
- m_rdb_typelibs.push_back( token );
- }
- else
- OSL_ENSURE( 0, "### invalid UNO_TYPES entry!" );
+ if (create_ucb_content(
+ 0, expandUnoRcTerm(token), xCmdEnv,
+ false /* no throw */ ))
+ {
+ //The RDB file may not exist anymore if a shared or bundled
+ //extension was removed, but it can still be in the unorc.
+ //After running XExtensionManager::synchronize, the unorc is
+ //cleaned up
+ m_rdb_typelibs.push_back( token );
+ }
}
}
while (index >= 0);
@@ -785,18 +849,11 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv )
return;
::rtl::OStringBuffer buf;
- // UNO_USER_PACKAGES_CACHE, UNO_SHARED_PACKAGES_CACHE have to be resolved
- // locally:
- if (m_eContext == CONTEXT_USER) {
- buf.append( RTL_CONSTASCII_STRINGPARAM(
- "UNO_USER_PACKAGES_CACHE=$ORIGIN/../..") );
- }
- else if (m_eContext == CONTEXT_SHARED) {
- buf.append( RTL_CONSTASCII_STRINGPARAM(
- "UNO_SHARED_PACKAGES_CACHE=$ORIGIN/../..") );
- }
- else
- OSL_ASSERT(0);
+
+ buf.append(RTL_CONSTASCII_STRINGPARAM("ORIGIN="));
+ OUString sOrigin = dp_misc::makeRcTerm(m_cachePath);
+ ::rtl::OString osOrigin = ::rtl::OUStringToOString(sOrigin, RTL_TEXTENCODING_UTF8);
+ buf.append(osOrigin);
buf.append(LF);
if (! m_jar_typelibs.empty())
@@ -852,6 +909,9 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv )
// write native rc:
::rtl::OStringBuffer buf2;
+ buf2.append(RTL_CONSTASCII_STRINGPARAM("ORIGIN="));
+ buf2.append(osOrigin);
+ buf2.append(LF);
buf2.append( RTL_CONSTASCII_STRINGPARAM("UNO_SERVICES=?$ORIGIN/") );
buf2.append( ::rtl::OUStringToOString(
sNativeRDB, RTL_TEXTENCODING_ASCII_US ) );
@@ -882,28 +942,11 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv )
m_unorc_modified = false;
}
-//------------------------------------------------------------------------------
-inline OUString makeRcTerm( OUString const & url )
-{
- OSL_ASSERT( url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM(
- "vnd.sun.star.expand:") ) );
- if (url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:") )) {
- // cut protocol:
- OUString rcterm( url.copy( sizeof ("vnd.sun.star.expand:") - 1 ) );
- // decode uric class chars:
- rcterm = ::rtl::Uri::decode(
- rcterm, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
- return rcterm;
- }
- else
- return url;
-}
-
//______________________________________________________________________________
bool BackendImpl::addToUnoRc( bool jarFile, OUString const & url_,
Reference<XCommandEnvironment> const & xCmdEnv )
{
- const OUString rcterm( makeRcTerm(url_) );
+ const OUString rcterm( dp_misc::makeRcTerm(url_) );
const ::osl::MutexGuard guard( getMutex() );
unorc_verify_init( xCmdEnv );
t_stringlist & rSet = getTypelibs(jarFile);
@@ -923,7 +966,7 @@ bool BackendImpl::removeFromUnoRc(
bool jarFile, OUString const & url_,
Reference<XCommandEnvironment> const & xCmdEnv )
{
- const OUString rcterm( makeRcTerm(url_) );
+ const OUString rcterm( dp_misc::makeRcTerm(url_) );
const ::osl::MutexGuard guard( getMutex() );
unorc_verify_init( xCmdEnv );
getTypelibs(jarFile).remove( rcterm );
@@ -937,7 +980,7 @@ bool BackendImpl::removeFromUnoRc(
bool BackendImpl::hasInUnoRc(
bool jarFile, OUString const & url_ )
{
- const OUString rcterm( makeRcTerm(url_) );
+ const OUString rcterm( dp_misc::makeRcTerm(url_) );
const ::osl::MutexGuard guard( getMutex() );
t_stringlist const & rSet = getTypelibs(jarFile);
return ::std::find( rSet.begin(), rSet.end(), rcterm ) != rSet.end();
@@ -1174,6 +1217,7 @@ BackendImpl::ComponentPackageImpl::isRegistered_(
void BackendImpl::ComponentPackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv )
{
@@ -1183,16 +1227,25 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
const bool java = m_loader.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("com.sun.star.loader.Java2") );
const OUString url( getURL() );
- bool isJavaTypelib = java &&
- !jarManifestHeaderPresent( url, OUSTR("UNO-Type-Path"), xCmdEnv );
+ bool isJavaTypelib;
+ if (m_bRemoved)
+ isJavaTypelib = m_registeredComponentsDb.javaTypeLibrary;
+ else
+ isJavaTypelib = java &&
+ !jarManifestHeaderPresent( url, OUSTR("UNO-Type-Path"), xCmdEnv );
+ ComponentBackendDb::Data data;
+ data.javaTypeLibrary = isJavaTypelib;
if (doRegisterPackage)
{
- if (! m_xRemoteContext.is()) {
- m_xRemoteContext.set(
+ Reference <uno::XComponentContext> context(that->getComponentContext());
+ if (! startup)
+ {
+ context.set(
that->getObject( url ), UNO_QUERY );
- if (! m_xRemoteContext.is()) {
- m_xRemoteContext.set(
+
+ if (! context.is()) {
+ context.set(
that->insertObject( url, raise_uno_process(
that->getComponentContext(),
abortChannel ) ),
@@ -1202,147 +1255,170 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
const Reference<registry::XSimpleRegistry> xServicesRDB( getRDB() );
const Reference<registry::XImplementationRegistration> xImplReg(
- m_xRemoteContext->getServiceManager()->createInstanceWithContext(
+ context->getServiceManager()->createInstanceWithContext(
OUSTR("com.sun.star.registry.ImplementationRegistration"),
- m_xRemoteContext ), UNO_QUERY_THROW );
+ context ), UNO_QUERY_THROW );
xImplReg->registerImplementation( m_loader, url, xServicesRDB );
//only write to unorc if registration was successful.
//It may fail if there is no suitable java.
if (isJavaTypelib)
+ {
that->addToUnoRc( java, url, xCmdEnv );
+ data.javaTypeLibrary = true;
+ }
t_stringlist implNames;
t_stringpairvec singletons;
- const Reference<loader::XImplementationLoader> xLoader(
- getComponentInfo( &implNames, &singletons, m_xRemoteContext ) );
-
- // factories live insertion:
- const Reference<container::XSet> xSet(
- that->getComponentContext()->getServiceManager(), UNO_QUERY_THROW );
- for ( t_stringlist::const_iterator iPos( implNames.begin() );
- iPos != implNames.end(); ++iPos )
+ const Reference<loader::XImplementationLoader> xLoader(
+ getComponentInfo( &implNames, &singletons, context ) );
+ data.implementationNames = implNames;
+ data.singletons = singletons;
+
+ if (!startup)
{
- checkAborted( abortChannel );
- OUString const & implName = *iPos;
- // activate factory:
- const Reference<XInterface> xFactory(
- xLoader->activate(
- implName, OUString(), url,
- xServicesRDB->getRootKey()->openKey(
- OUSTR("/IMPLEMENTATIONS/") + implName ) ) );
- try {
- xSet->insert( Any(xFactory) );
- } // ignore if factory has already been inserted:
- catch (container::ElementExistException &) {
- OSL_ENSURE( 0, "### factory already registered?" );
+ // factories live insertion:
+ const Reference<container::XSet> xSet(
+ that->getComponentContext()->getServiceManager(), UNO_QUERY_THROW );
+ for ( t_stringlist::const_iterator iPos( implNames.begin() );
+ iPos != implNames.end(); ++iPos )
+ {
+ checkAborted( abortChannel );
+ OUString const & implName = *iPos;
+ // activate factory:
+ const Reference<XInterface> xFactory(
+ xLoader->activate(
+ implName, OUString(), url,
+ xServicesRDB->getRootKey()->openKey(
+ OUSTR("/IMPLEMENTATIONS/") + implName ) ) );
+ try {
+ xSet->insert( Any(xFactory) );
+ } // ignore if factory has already been inserted:
+ catch (container::ElementExistException &) {
+ OSL_ENSURE( 0, "### factory already registered?" );
+ }
}
- }
- if (! singletons.empty())
- {
- // singletons live insertion:
- const Reference<container::XNameContainer> xRootContext(
- that->getComponentContext()->getValueByName(
- OUSTR("_root") ), UNO_QUERY );
- if (xRootContext.is())
+ if (! singletons.empty())
{
- for ( t_stringpairvec::const_iterator iPos(
- singletons.begin() );
- iPos != singletons.end(); ++iPos )
+ // singletons live insertion:
+ const Reference<container::XNameContainer> xRootContext(
+ that->getComponentContext()->getValueByName(
+ OUSTR("_root") ), UNO_QUERY );
+ if (xRootContext.is())
{
- ::std::pair<OUString, OUString> const & sp = *iPos;
- const OUString name( OUSTR("/singletons/") + sp.first );
- // assure no arguments:
- try {
- xRootContext->removeByName( name + OUSTR("/arguments"));
- } catch (container::NoSuchElementException &) {}
- // used service:
- try {
- xRootContext->insertByName(
- name + OUSTR("/service"), Any(sp.second) );
- } catch (container::ElementExistException &) {
- xRootContext->replaceByName(
- name + OUSTR("/service"), Any(sp.second) );
- }
- // singleton entry:
- try {
- xRootContext->insertByName( name, Any() );
- } catch (container::ElementExistException & exc) {
- (void) exc; // avoid warnings
- OSL_ENSURE(
- 0, OUStringToOString(
- exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
- xRootContext->replaceByName( name, Any() );
+ for ( t_stringpairvec::const_iterator iPos(
+ singletons.begin() );
+ iPos != singletons.end(); ++iPos )
+ {
+ ::std::pair<OUString, OUString> const & sp = *iPos;
+ const OUString name( OUSTR("/singletons/") + sp.first );
+ // assure no arguments:
+ try {
+ xRootContext->removeByName( name + OUSTR("/arguments"));
+ } catch (container::NoSuchElementException &) {}
+ // used service:
+ try {
+ xRootContext->insertByName(
+ name + OUSTR("/service"), Any(sp.second) );
+ } catch (container::ElementExistException &) {
+ xRootContext->replaceByName(
+ name + OUSTR("/service"), Any(sp.second) );
+ }
+ // singleton entry:
+ try {
+ xRootContext->insertByName( name, Any() );
+ } catch (container::ElementExistException & exc) {
+ (void) exc; // avoid warnings
+ OSL_ENSURE(
+ 0, OUStringToOString(
+ exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ xRootContext->replaceByName( name, Any() );
+ }
}
}
}
}
m_registered = REG_REGISTERED;
+ getMyBackend()->addDataToDb(url, data);
}
else // revokePackage()
{
// set to VOID during revocation process:
m_registered = REG_VOID;
- Reference<XComponentContext> xContext;
- if (m_xRemoteContext.is()) // has been activated in this process
- xContext = m_xRemoteContext;
- else // has been deployed in former times
+ //get the remote context. If it does not exist then use the local one
+ Reference<XComponentContext> xContext(
+ that->getObject( url ), UNO_QUERY );
+ bool bRemoteContext = false;
+ if (!xContext.is())
xContext = that->getComponentContext();
+ else
+ bRemoteContext = true;
t_stringlist implNames;
t_stringpairvec singletons;
- getComponentInfo( &implNames, &singletons, xContext );
-
- // factories live removal:
- const Reference<container::XSet> xSet(
- that->getComponentContext()->getServiceManager(), UNO_QUERY_THROW );
- for ( t_stringlist::const_iterator iPos( implNames.begin() );
- iPos != implNames.end(); ++iPos )
+ if (m_bRemoved)
{
- OUString const & implName = *iPos;
- try {
- xSet->remove( Any(implName) );
- } // ignore if factory has not been live deployed:
- catch (container::NoSuchElementException &) {
- }
+ implNames = m_registeredComponentsDb.implementationNames;
+ singletons = m_registeredComponentsDb.singletons;
+ }
+ else
+ {
+ getComponentInfo( &implNames, &singletons, xContext );
}
- if (! singletons.empty())
+ if (!startup)
{
- // singletons live removal:
- const Reference<container::XNameContainer> xRootContext(
- that->getComponentContext()->getValueByName(
- OUSTR("_root") ), UNO_QUERY );
- if (xRootContext.is())
+ // factories live removal:
+ const Reference<container::XSet> xSet(
+ that->getComponentContext()->getServiceManager(), UNO_QUERY_THROW );
+ for ( t_stringlist::const_iterator iPos( implNames.begin() );
+ iPos != implNames.end(); ++iPos )
+ {
+ OUString const & implName = *iPos;
+ try {
+ xSet->remove( Any(implName) );
+ } // ignore if factory has not been live deployed:
+ catch (container::NoSuchElementException &) {
+ }
+ }
+
+ if (! singletons.empty())
{
- for ( t_stringpairvec::const_iterator iPos(
- singletons.begin() );
- iPos != singletons.end(); ++iPos )
+ // singletons live removal:
+ const Reference<container::XNameContainer> xRootContext(
+ that->getComponentContext()->getValueByName(
+ OUSTR("_root") ), UNO_QUERY );
+ if (xRootContext.is())
{
- ::std::pair<OUString, OUString> const & sp = *iPos;
- const OUString name( OUSTR("/singletons/") + sp.first );
- // arguments:
- try {
- xRootContext->removeByName( name + OUSTR("/arguments"));
- }
- catch (container::NoSuchElementException &) {}
- // used service:
- try {
- xRootContext->removeByName( name + OUSTR("/service") );
- }
- catch (container::NoSuchElementException &) {}
- // singleton entry:
- try {
- xRootContext->removeByName( name );
- }
- catch (container::NoSuchElementException & exc) {
- (void) exc; // avoid warnings
- OSL_ENSURE(
- 0, OUStringToOString(
- exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ for ( t_stringpairvec::const_iterator iPos(
+ singletons.begin() );
+ iPos != singletons.end(); ++iPos )
+ {
+ ::std::pair<OUString, OUString> const & sp = *iPos;
+ const OUString name( OUSTR("/singletons/") + sp.first );
+ // arguments:
+ try {
+ xRootContext->removeByName( name + OUSTR("/arguments"));
+ }
+ catch (container::NoSuchElementException &) {}
+ // used service:
+ try {
+ xRootContext->removeByName( name + OUSTR("/service") );
+ }
+ catch (container::NoSuchElementException &) {}
+ // singleton entry:
+ try {
+ xRootContext->removeByName( name );
+ }
+ catch (container::NoSuchElementException & exc) {
+ (void) exc; // avoid warnings
+ OSL_ENSURE(
+ 0, OUStringToOString(
+ exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
}
}
}
@@ -1358,16 +1434,25 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
if (isJavaTypelib)
that->removeFromUnoRc( java, url, xCmdEnv );
- if (m_xRemoteContext.is()) {
+ if (bRemoteContext)
that->releaseObject( url );
- m_xRemoteContext.clear();
- }
m_registered = REG_NOT_REGISTERED;
+ getMyBackend()->deleteDataFromDb(url);
}
}
//##############################################################################
+BackendImpl::TypelibraryPackageImpl::TypelibraryPackageImpl(
+ ::rtl::Reference<PackageRegistryBackend> const & myBackend,
+ OUString const & url, OUString const & name,
+ Reference<deployment::XPackageTypeInfo> const & xPackageType,
+ bool jarFile, bool bRemoved, OUString const & identifier)
+ : Package( myBackend, url, name, name /* display-name */,
+ xPackageType, bRemoved, identifier),
+ m_jarFile( jarFile )
+{
+}
// Package
BackendImpl * BackendImpl::TypelibraryPackageImpl::getMyBackend() const
@@ -1403,6 +1488,7 @@ BackendImpl::TypelibraryPackageImpl::isRegistered_(
void BackendImpl::TypelibraryPackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
+ bool /*startup*/,
::rtl::Reference<AbortChannel> const &,
Reference<XCommandEnvironment> const & xCmdEnv )
{
@@ -1490,7 +1576,7 @@ namespace sdecl = comphelper::service_decl;
sdecl::class_<BackendImpl, sdecl::with_args<true> > serviceBI;
extern sdecl::ServiceDecl const serviceDecl(
serviceBI,
- "com.sun.star.comp.deployment.component.PackageRegistryBackend",
+ IMPLEMENTATION_NAME,
BACKEND_SERVICE_NAME );
} // namespace component
diff --git a/desktop/source/deployment/registry/component/makefile.mk b/desktop/source/deployment/registry/component/makefile.mk
index 4c4016f9bf6c..b7ee5c203cd5 100644
--- a/desktop/source/deployment/registry/component/makefile.mk
+++ b/desktop/source/deployment/registry/component/makefile.mk
@@ -40,7 +40,8 @@ SRC1FILES = \
INCPRE += ..$/..$/inc
SLOFILES = \
- $(SLO)$/dp_component.obj
+ $(SLO)$/dp_component.obj \
+ $(SLO)$/dp_compbackenddb.obj
.INCLUDE : ..$/..$/target.pmk
.INCLUDE : target.mk
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
index 460ba5e9fed0..9ea6e8227340 100644
--- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
@@ -35,7 +35,6 @@
#include "dp_backend.h"
#include "dp_persmap.h"
#include "dp_ucb.h"
-#include "dp_xml.h"
#include "rtl/string.hxx"
#include "rtl/ustrbuf.hxx"
#include "rtl/uri.hxx"
@@ -45,9 +44,9 @@
#include "ucbhelper/content.hxx"
#include "comphelper/anytostring.hxx"
#include "comphelper/servicedecl.hxx"
-#include "configmgr/update.hxx"
#include "xmlscript/xml_helper.hxx"
#include "svl/inettype.hxx"
+#include "com/sun/star/configuration/Update.hpp"
#include "com/sun/star/ucb/NameClash.hpp"
#include "com/sun/star/io/XActiveDataSink.hpp"
#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
@@ -55,6 +54,7 @@
#include <list>
#include <memory>
+#include "dp_configurationbackenddb.hxx"
using namespace ::dp_misc;
using namespace ::com::sun::star;
@@ -86,6 +86,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
@@ -94,9 +95,9 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
::rtl::Reference<PackageRegistryBackend> const & myBackend,
OUString const & url, OUString const & name,
Reference<deployment::XPackageTypeInfo> const & xPackageType,
- bool isSchema )
+ bool isSchema, bool bRemoved, OUString const & identifier)
: Package( myBackend, url, name, name /* display-name */,
- xPackageType ),
+ xPackageType, bRemoved, identifier),
m_isSchema( isSchema )
{}
};
@@ -110,10 +111,12 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
bool m_configmgrini_inited;
bool m_configmgrini_modified;
+ std::auto_ptr<ConfigurationBackendDb> m_backendDb;
// PackageRegistryBackend
virtual Reference<deployment::XPackage> bindPackage_(
- OUString const & url, OUString const & mediaType,
+ OUString const & url, OUString const & mediaType, sal_Bool bRemoved,
+ OUString const & identifier,
Reference<XCommandEnvironment> const & xCmdEnv );
::std::auto_ptr<PersistentMap> m_registeredPackages;
@@ -133,7 +136,11 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
Reference<XCommandEnvironment> const & xCmdEnv );
bool removeFromConfigmgrIni( bool isSchema, OUString const & url,
Reference<XCommandEnvironment> const & xCmdEnv );
- bool hasInConfigmgrIni( bool isSchema, OUString const & url );
+
+ void addDataToDb(OUString const & url, ConfigurationBackendDb::Data const & data);
+ ::boost::optional<ConfigurationBackendDb::Data> readDataFromDb(OUString const & url);
+ void deleteDataFromDb(OUString const & url);
+ ::std::list<OUString> getAllIniEntries();
public:
BackendImpl( Sequence<Any> const & args,
@@ -191,18 +198,64 @@ BackendImpl::BackendImpl(
const Reference<XCommandEnvironment> xCmdEnv;
- if (transientMode()) {
+ if (transientMode())
+ {
//TODO
}
- else {
+ else
+ {
+ OUString dbFile = makeURL(getCachePath(), OUSTR("backenddb.xml"));
+ m_backendDb.reset(
+ new ConfigurationBackendDb(getComponentContext(), dbFile));
+ //clean up data folders which are no longer used.
+ //This must not be done in the same process where the help files
+ //are still registers. Only after revoking and restarting OOo the folders
+ //can be removed. This works now, because the extension manager is a singleton
+ //and the backends are only create once per process.
+ ::std::list<OUString> folders = m_backendDb->getAllDataUrls();
+ deleteUnusedFolders(OUString(), folders);
+
+
configmgrini_verify_init( xCmdEnv );
m_registeredPackages.reset(
new PersistentMap(
makeURL( getCachePath(), OUSTR("registered_packages.db") ),
- m_readOnly ) );
- }
+ false ) );
+ }
}
+void BackendImpl::addDataToDb(
+ OUString const & url, ConfigurationBackendDb::Data const & data)
+{
+ if (m_backendDb.get())
+ m_backendDb->addEntry(url, data);
+}
+
+::boost::optional<ConfigurationBackendDb::Data> BackendImpl::readDataFromDb(
+ OUString const & url)
+{
+ ::boost::optional<ConfigurationBackendDb::Data> data;
+ if (m_backendDb.get())
+ data = m_backendDb->getEntry(url);
+ return data;
+}
+
+void BackendImpl::deleteDataFromDb(OUString const & url)
+{
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
+}
+
+::std::list<OUString> BackendImpl::getAllIniEntries()
+{
+ if (m_backendDb.get())
+ return m_backendDb->getAllIniEntries();
+ else
+ return ::std::list<OUString>();
+}
+
+
+
// XPackageRegistry
//______________________________________________________________________________
Sequence< Reference<deployment::XPackageTypeInfo> >
@@ -215,6 +268,7 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
//______________________________________________________________________________
Reference<deployment::XPackage> BackendImpl::bindPackage_(
OUString const & url, OUString const & mediaType_,
+ sal_Bool bRemoved, OUString const & identifier,
Reference<XCommandEnvironment> const & xCmdEnv )
{
OUString mediaType( mediaType_ );
@@ -249,20 +303,27 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
{
if (type.EqualsIgnoreCaseAscii("application"))
{
+ OUString name;
+ if (!bRemoved)
+ {
+ ::ucbhelper::Content ucbContent( url, xCmdEnv );
+ name = ucbContent.getPropertyValue(
+ StrTitle::get() ).get<OUString>();
+ }
+
::ucbhelper::Content ucbContent( url, xCmdEnv );
if (subType.EqualsIgnoreCaseAscii(
- "vnd.sun.star.configuration-data")) {
+ "vnd.sun.star.configuration-data"))
+ {
return new PackageImpl(
- this, url, ucbContent.getPropertyValue(
- StrTitle::get() ).get<OUString>(),
- m_xConfDataTypeInfo, false /* data file */ );
+ this, url, name, m_xConfDataTypeInfo, false /* data file */,
+ bRemoved, identifier);
}
else if (subType.EqualsIgnoreCaseAscii(
"vnd.sun.star.configuration-schema")) {
return new PackageImpl(
- this, url, ucbContent.getPropertyValue(
- StrTitle::get() ).get<OUString>(),
- m_xConfSchemaTypeInfo, true /* schema file */ );
+ this, url, name, m_xConfSchemaTypeInfo, true /* schema file */,
+ bRemoved, identifier);
}
}
}
@@ -302,11 +363,12 @@ void BackendImpl::configmgrini_verify_init(
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 );
}
- else
- OSL_ENSURE(
- 0, "### invalid SCHEMA entry!" );
}
}
while (index >= 0);
@@ -323,10 +385,24 @@ void BackendImpl::configmgrini_verify_init(
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
- OSL_ENSURE( 0, "### invalid DATA entry!" );
+ {
+ //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.");
+ }
}
}
while (index >= 0);
@@ -347,20 +423,6 @@ void BackendImpl::configmgrini_flush(
return;
::rtl::OStringBuffer buf;
- // UNO_USER_PACKAGES_CACHE, UNO_SHARED_PACKAGES_CACHE have to be resolved
- // locally:
- if (m_eContext == CONTEXT_USER) {
- buf.append( RTL_CONSTASCII_STRINGPARAM(
- "UNO_USER_PACKAGES_CACHE=$ORIGIN/../..") );
- }
- else if (m_eContext == CONTEXT_SHARED) {
- buf.append( RTL_CONSTASCII_STRINGPARAM(
- "UNO_SHARED_PACKAGES_CACHE=$ORIGIN/../..") );
- }
- else
- OSL_ASSERT(0);
- buf.append(LF);
-
if (! m_xcs_files.empty())
{
t_stringlist::const_iterator iPos( m_xcs_files.begin() );
@@ -407,28 +469,11 @@ void BackendImpl::configmgrini_flush(
m_configmgrini_modified = false;
}
-//------------------------------------------------------------------------------
-inline OUString makeRcTerm( OUString const & url )
-{
- OSL_ASSERT( url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM(
- "vnd.sun.star.expand:") ) );
- if (url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:") )) {
- // cut protocol:
- OUString rcterm( url.copy( sizeof ("vnd.sun.star.expand:") - 1 ) );
- // decode uric class chars:
- rcterm = ::rtl::Uri::decode(
- rcterm, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
- return rcterm;
- }
- else
- return url;
-}
-
//______________________________________________________________________________
bool BackendImpl::addToConfigmgrIni( bool isSchema, OUString const & url_,
Reference<XCommandEnvironment> const & xCmdEnv )
{
- const OUString rcterm( makeRcTerm(url_) );
+ const OUString rcterm( dp_misc::makeRcTerm(url_) );
const ::osl::MutexGuard guard( getMutex() );
configmgrini_verify_init( xCmdEnv );
t_stringlist & rSet = getFiles(isSchema);
@@ -448,15 +493,18 @@ bool BackendImpl::removeFromConfigmgrIni(
bool isSchema, OUString const & url_,
Reference<XCommandEnvironment> const & xCmdEnv )
{
- const OUString rcterm( makeRcTerm(url_) );
+ const OUString rcterm( dp_misc::makeRcTerm(url_) );
const ::osl::MutexGuard guard( getMutex() );
configmgrini_verify_init( xCmdEnv );
t_stringlist & rSet = getFiles(isSchema);
t_stringlist::iterator i(std::find(rSet.begin(), rSet.end(), rcterm));
- if (i == rSet.end() && !isSchema) { //TODO: see replaceOrigin()
- i = std::find(
- rSet.begin(), rSet.end(),
- rcterm + OUString(RTL_CONSTASCII_USTRINGPARAM(".mod")));
+ if (i == rSet.end() && !isSchema)
+ {
+ //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)
+ ::boost::optional<ConfigurationBackendDb::Data> data = readDataFromDb(url_);
+ if (data)
+ i = std::find(rSet.begin(), rSet.end(), data->iniEntry);
}
if (i == rSet.end()) {
return false;
@@ -468,21 +516,6 @@ bool BackendImpl::removeFromConfigmgrIni(
return true;
}
-//______________________________________________________________________________
-bool BackendImpl::hasInConfigmgrIni(
- bool isSchema, OUString const & url_ )
-{
- const OUString rcterm( makeRcTerm(url_) );
- const ::osl::MutexGuard guard( getMutex() );
- t_stringlist const & rSet = getFiles(isSchema);
- return ::std::find( rSet.begin(), rSet.end(), rcterm ) != rSet.end()
- || (!isSchema && //TODO: see replaceOrigin()
- ::std::find(
- rSet.begin(), rSet.end(),
- rcterm + OUString(RTL_CONSTASCII_USTRINGPARAM(".mod"))) !=
- rSet.end());
-}
-
//##############################################################################
// Package
@@ -509,14 +542,18 @@ BackendImpl::PackageImpl::isRegistered_(
Reference<XCommandEnvironment> const & )
{
BackendImpl * that = getMyBackend();
- rtl::OUString url(getURL());
+ const rtl::OUString url(getURL());
+
+ bool bReg = false;
+ if (that->readDataFromDb(getURL()))
+ bReg = true;
+ if (!bReg)
+ //fallback for user extension registered in berkeley DB
+ bReg = that->m_registeredPackages->has(
+ rtl::OUStringToOString( url, RTL_TEXTENCODING_UTF8 ));
+
return beans::Optional< beans::Ambiguous<sal_Bool> >(
- true /* IsPresent */,
- beans::Ambiguous<sal_Bool>(
- that->hasInConfigmgrIni( m_isSchema, url ) ||
- that->m_registeredPackages->has(
- rtl::OUStringToOString( url, RTL_TEXTENCODING_UTF8 ) ),
- false /* IsAmbiguous */ ) );
+ true, beans::Ambiguous<sal_Bool>( bReg, false ) );
}
//------------------------------------------------------------------------------
@@ -554,7 +591,7 @@ OUString encodeForXml( OUString const & text )
//______________________________________________________________________________
OUString replaceOrigin(
- OUString const & url, Reference< XCommandEnvironment > const & xCmdEnv )
+ OUString const & url, OUString const & destFolder, Reference< XCommandEnvironment > const & xCmdEnv, bool & out_replaced)
{
// looking for %origin%:
::ucbhelper::Content ucb_content( url, xCmdEnv );
@@ -624,10 +661,17 @@ OUString replaceOrigin(
return url;
if (write_pos < filtered.getLength())
filtered.realloc( write_pos );
- rtl::OUString newUrl(url + OUString(RTL_CONSTASCII_USTRINGPARAM(".mod")));
- //TODO: unique name
+ rtl::OUString newUrl(url);
+ if (destFolder.getLength())
+ {
+ //get the file name of the xcu and add it to the url of the temporary folder
+ sal_Int32 i = url.lastIndexOf('/');
+ newUrl = destFolder + url.copy(i);
+ }
+
ucbhelper::Content(newUrl, xCmdEnv).writeStream(
xmlscript::createInputStream(filtered), true);
+ out_replaced = true;
return newUrl;
}
@@ -635,6 +679,7 @@ OUString replaceOrigin(
void BackendImpl::PackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const &,
Reference<XCommandEnvironment> const & xCmdEnv )
{
@@ -643,19 +688,38 @@ void BackendImpl::PackageImpl::processPackage_(
if (doRegisterPackage)
{
- if (m_isSchema)
+ ConfigurationBackendDb::Data data;
+ if (!m_isSchema)
{
- configmgr::update::insertExtensionXcsFile(
- that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url));
+ const OUString sModFolder = that->createFolder(OUString(), xCmdEnv);
+ bool out_replaced = false;
+ url = replaceOrigin(url, sModFolder, xCmdEnv, out_replaced);
+ if (out_replaced)
+ data.dataUrl = sModFolder;
+ else
+ deleteTempFolder(sModFolder);
}
- else
+ //No need for live-deployment for bundled extension, because OOo
+ //restarts after installation
+ if (that->m_eContext != CONTEXT_BUNDLED
+ && !startup)
{
- url = replaceOrigin(url, xCmdEnv);
- configmgr::update::insertExtensionXcuFile(
- that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url));
+ if (m_isSchema)
+ {
+ com::sun::star::configuration::Update::get(
+ that->m_xComponentContext)->insertExtensionXcsFile(
+ that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url));
+ }
+ else
+ {
+ com::sun::star::configuration::Update::get(
+ that->m_xComponentContext)->insertExtensionXcuFile(
+ that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url));
+ }
}
-
that->addToConfigmgrIni( m_isSchema, url, xCmdEnv );
+ data.iniEntry = dp_misc::makeRcTerm(url);
+ that->addDataToDb(getURL(), data);
}
else // revoke
{
@@ -665,15 +729,31 @@ void BackendImpl::PackageImpl::processPackage_(
for (t_string2string_map::iterator i(entries.begin());
i != entries.end(); ++i)
{
+ //If the xcu file was installed before the configmgr was chaned
+ //to use the configmgr.ini, one needed to rebuild to whole directory
+ //structur containing the xcu, xcs files from all extensions. Now,
+ //we just add all other xcu/xcs files to the configmgr.ini instead of
+ //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");
- if (!schema) {
- url2 = replaceOrigin(url2, xCmdEnv);
- }
- that->addToConfigmgrIni(schema, url2, xCmdEnv);
+ bool schema = i->second.equalsIgnoreAsciiCase(
+ "vnd.sun.star.configuration-schema");
+ OUString url_replaced(url2);
+ if (!schema)
+ {
+ const OUString sModFolder = that->createFolder(OUString(), xCmdEnv);
+ bool out_replaced = false;
+ url_replaced = replaceOrigin(
+ url2, sModFolder, xCmdEnv, out_replaced);
+ if (out_replaced)
+ data.dataUrl = sModFolder;
+ else
+ deleteTempFolder(sModFolder);
+ }
+ that->addToConfigmgrIni(schema, url_replaced, xCmdEnv);
+ that->addDataToDb(url2, data);
}
that->m_registeredPackages->erase(i->first);
}
@@ -682,6 +762,7 @@ void BackendImpl::PackageImpl::processPackage_(
xCmdEnv ).executeCommand(
OUSTR("delete"), Any( true /* delete physically */ ) );
}
+ 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
new file mode 100644
index 000000000000..845ba88cb813
--- /dev/null
+++ b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: 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
+ * 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_desktop.hxx"
+
+#include "rtl/string.h"
+#include "rtl/bootstrap.hxx"
+#include "cppuhelper/exc_hlp.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/xml/dom/XDocumentBuilder.hpp"
+#include "com/sun/star/xml/xpath/XXPathAPI.hpp"
+#include "dp_misc.h"
+
+#include "dp_configurationbackenddb.hxx"
+
+
+namespace css = ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using ::rtl::OUString;
+
+#define EXTENSION_REG_NS "http://openoffice.org/extensionmanager/configuration-registry/2010"
+#define NS_PREFIX "conf"
+#define ROOT_ELEMENT_NAME "configuration-backend-db"
+#define KEY_ELEMENT_NAME "configuration"
+
+namespace dp_registry {
+namespace backend {
+namespace configuration {
+
+ConfigurationBackendDb::ConfigurationBackendDb(
+ Reference<XComponentContext> const & xContext,
+ ::rtl::OUString const & url):BackendDb(xContext, url)
+{
+
+}
+
+OUString ConfigurationBackendDb::getDbNSName()
+{
+ return OUSTR(EXTENSION_REG_NS);
+}
+
+OUString ConfigurationBackendDb::getNSPrefix()
+{
+ return OUSTR(NS_PREFIX);
+}
+
+OUString ConfigurationBackendDb::getRootElementName()
+{
+ return OUSTR(ROOT_ELEMENT_NAME);
+}
+
+OUString ConfigurationBackendDb::getKeyElementName()
+{
+ return OUSTR(KEY_ELEMENT_NAME);
+}
+
+
+void ConfigurationBackendDb::addEntry(::rtl::OUString const & url, Data const & data)
+{
+ try{
+ Reference<css::xml::dom::XNode> helpNode
+ = writeKeyElement(url);
+
+ writeSimpleElement(OUSTR("data-url"), data.dataUrl, helpNode);
+ writeSimpleElement(OUSTR("ini-entry"), data.iniEntry, helpNode);
+ save();
+ }
+ catch (css::deployment::DeploymentException& )
+ {
+ throw;
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to write data entry in configuration backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+
+::boost::optional<ConfigurationBackendDb::Data>
+ConfigurationBackendDb::getEntry(::rtl::OUString const & url)
+{
+ try
+ {
+ ConfigurationBackendDb::Data retData;
+ Reference<css::xml::dom::XNode> aNode = getKeyElement(url);
+ if (aNode.is())
+ {
+ retData.dataUrl = readSimpleElement(OUSTR("data-url"), aNode);
+ retData.iniEntry = readSimpleElement(OUSTR("ini-entry"), aNode);
+ }
+ else
+ {
+ return ::boost::optional<Data>();
+ }
+ return ::boost::optional<Data>(retData);
+ }
+ catch (css::deployment::DeploymentException& )
+ {
+ throw;
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to read data entry in configuration backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+::std::list<OUString> ConfigurationBackendDb::getAllDataUrls()
+{
+ try
+ {
+ ::std::list<OUString> listRet;
+ Reference<css::xml::dom::XDocument> doc = getDocument();
+ Reference<css::xml::dom::XNode> root = doc->getFirstChild();
+
+ Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI();
+ const OUString sPrefix = getNSPrefix();
+ OUString sExpression(
+ sPrefix + OUSTR(":configuration/") + sPrefix + OUSTR(":data-url/text()"));
+ Reference<css::xml::dom::XNodeList> nodes =
+ xpathApi->selectNodeList(root, sExpression);
+ if (nodes.is())
+ {
+ sal_Int32 length = nodes->getLength();
+ for (sal_Int32 i = 0; i < length; i++)
+ listRet.push_back(nodes->item(i)->getNodeValue());
+ }
+ return listRet;
+ }
+ catch (css::deployment::DeploymentException& )
+ {
+ throw;
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to read data entry in configuration backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+::std::list<OUString> ConfigurationBackendDb::getAllIniEntries()
+{
+ return getOneChildFromAllEntries(OUSTR("ini-entry"));
+}
+
+
+
+} // namespace configuration
+} // namespace backend
+} // namespace dp_registry
+
diff --git a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx
new file mode 100644
index 000000000000..1b6c4f8973a4
--- /dev/null
+++ b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: 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
+ * 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.
+ *
+ ************************************************************************/
+
+#if ! defined INCLUDED_DP_CONFIGURATIONBACKENDDB_HXX
+#define INCLUDED_DP_CONFIGURATIONBACKENDDB_HXX
+
+#include "rtl/ustring.hxx"
+#include "rtl/string.hxx"
+#include <list>
+#include "boost/optional.hpp"
+#include "dp_backenddb.hxx"
+
+namespace css = ::com::sun::star;
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+}}}
+
+namespace dp_registry {
+namespace backend {
+namespace configuration {
+
+/* The XML file stores the extensions which are currently registered.
+ They will be removed when they are revoked.
+ */
+class ConfigurationBackendDb: public dp_registry::backend::BackendDb
+{
+protected:
+ virtual ::rtl::OUString getDbNSName();
+
+ virtual ::rtl::OUString getNSPrefix();
+
+ virtual ::rtl::OUString getRootElementName();
+
+ virtual ::rtl::OUString getKeyElementName();
+
+public:
+ struct Data
+ {
+ /* the URL to the folder containing the xcu or xcs files which contained
+ %origin%
+ */
+ ::rtl::OUString dataUrl;
+ /* the URL of the xcu or xcs file which is written in to the configmgr.ini
+ */
+ ::rtl::OUString iniEntry;
+ };
+
+public:
+
+ ConfigurationBackendDb( css::uno::Reference<css::uno::XComponentContext> const & xContext,
+ ::rtl::OUString const & url);
+
+ void addEntry(::rtl::OUString const & url, Data const & data);
+
+ ::boost::optional<Data> getEntry(::rtl::OUString const & url);
+ ::std::list< ::rtl::OUString> getAllDataUrls();
+ ::std::list< ::rtl::OUString> getAllIniEntries();
+};
+
+
+
+}
+}
+}
+#endif
+
diff --git a/desktop/source/deployment/registry/configuration/makefile.mk b/desktop/source/deployment/registry/configuration/makefile.mk
index f549b0e7b0f8..9bcbd50d4230 100644
--- a/desktop/source/deployment/registry/configuration/makefile.mk
+++ b/desktop/source/deployment/registry/configuration/makefile.mk
@@ -44,7 +44,8 @@ SRC1FILES = \
dp_configuration.src
SLOFILES = \
- $(SLO)$/dp_configuration.obj
+ $(SLO)$/dp_configuration.obj \
+ $(SLO)$/dp_configurationbackenddb.obj
.INCLUDE : ..$/..$/target.pmk
.INCLUDE : target.mk
diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx
index c06b30be1669..d781ba9e40ef 100644
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -31,12 +31,19 @@
#include "dp_backend.h"
#include "dp_ucb.h"
#include "rtl/uri.hxx"
+#include "rtl/bootstrap.hxx"
+#include "osl/file.hxx"
#include "cppuhelper/exc_hlp.hxx"
#include "comphelper/servicedecl.hxx"
#include "comphelper/unwrapargs.hxx"
#include "ucbhelper/content.hxx"
#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
+#include "com/sun/star/deployment/InvalidRemovedParameterException.hpp"
+#include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp"
+#include "com/sun/star/ucb/IOErrorCode.hpp"
#include "com/sun/star/beans/StringPair.hpp"
+#include "com/sun/star/sdbc/XResultSet.hpp"
+#include "com/sun/star/sdbc/XRow.hpp"
using namespace ::dp_misc;
@@ -88,6 +95,10 @@ PackageRegistryBackend::PackageRegistryBackend(
m_eContext = CONTEXT_USER;
else if (m_context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("shared") ))
m_eContext = CONTEXT_SHARED;
+ else if (m_context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bundled") ))
+ m_eContext = CONTEXT_BUNDLED;
+ else if (m_context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("tmp") ))
+ m_eContext = CONTEXT_TMP;
else if (m_context.matchIgnoreAsciiCaseAsciiL(
RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.tdoc:/") ))
m_eContext = CONTEXT_DOCUMENT;
@@ -127,24 +138,41 @@ void PackageRegistryBackend::disposing()
// XPackageRegistry
//______________________________________________________________________________
Reference<deployment::XPackage> PackageRegistryBackend::bindPackage(
- OUString const & url, OUString const & mediaType,
- Reference<XCommandEnvironment> const & xCmdEnv )
- throw (deployment::DeploymentException, CommandFailedException,
+ OUString const & url, OUString const & mediaType, sal_Bool bRemoved,
+ OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv )
+ throw (deployment::DeploymentException,
+ deployment::InvalidRemovedParameterException,
+ ucb::CommandFailedException,
lang::IllegalArgumentException, RuntimeException)
{
::osl::ResettableMutexGuard guard( getMutex() );
check();
+
t_string2ref::const_iterator const iFind( m_bound.find( url ) );
- if (iFind != m_bound.end()) {
+ if (iFind != m_bound.end())
+ {
Reference<deployment::XPackage> xPackage( iFind->second );
if (xPackage.is())
+ {
+ if (mediaType.getLength() &&
+ mediaType != xPackage->getPackageType()->getMediaType())
+ throw lang::IllegalArgumentException
+ (OUSTR("XPackageRegistry::bindPackage: media type does not match"),
+ static_cast<OWeakObject*>(this), 1);
+ if (xPackage->isRemoved() != bRemoved)
+ throw deployment::InvalidRemovedParameterException(
+ OUSTR("XPackageRegistry::bindPackage: bRemoved parameter does not match"),
+ static_cast<OWeakObject*>(this), xPackage->isRemoved(), xPackage);
return xPackage;
+ }
}
+
guard.clear();
Reference<deployment::XPackage> xNewPackage;
try {
- xNewPackage = bindPackage_( url, mediaType, xCmdEnv );
+ xNewPackage = bindPackage_( url, mediaType, bRemoved,
+ identifier, xCmdEnv );
}
catch (RuntimeException &) {
throw;
@@ -166,6 +194,7 @@ Reference<deployment::XPackage> PackageRegistryBackend::bindPackage(
}
guard.reset();
+
::std::pair< t_string2ref::iterator, bool > insertion(
m_bound.insert( t_string2ref::value_type( url, xNewPackage ) ) );
if (insertion.second)
@@ -180,11 +209,105 @@ Reference<deployment::XPackage> PackageRegistryBackend::bindPackage(
return xPackage;
insertion.first->second = xNewPackage;
}
+
guard.clear();
xNewPackage->addEventListener( this ); // listen for disposing events
return xNewPackage;
}
+OUString PackageRegistryBackend::createFolder(
+ OUString const & relUrl,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv)
+{
+ OUString sDataFolder = makeURL(getCachePath(), relUrl);
+ //make sure the folder exist
+ ucbhelper::Content dataContent;
+ ::dp_misc::create_folder(&dataContent, sDataFolder, xCmdEnv);
+
+ OUString sDataFolderURL = dp_misc::expandUnoRcUrl(sDataFolder);
+
+ OUString tempEntry;
+ if (::osl::File::createTempFile(
+ &sDataFolderURL, 0, &tempEntry ) != ::osl::File::E_None)
+ throw RuntimeException(
+ OUSTR("::osl::File::createTempFile() failed!"), 0 );
+ tempEntry = tempEntry.copy( tempEntry.lastIndexOf( '/' ) + 1 );
+ OUString destFolder= makeURL(sDataFolder, tempEntry) + OUSTR("_");
+ ::ucbhelper::Content destFolderContent;
+ dp_misc::create_folder( &destFolderContent, destFolder, xCmdEnv );
+
+ return destFolder;
+}
+
+void PackageRegistryBackend::deleteTempFolder(
+ OUString const & folderUrl)
+{
+ OSL_ASSERT(folderUrl.getLength()
+ && folderUrl[folderUrl.getLength() - 1] == '_');
+ if (folderUrl.getLength()
+ && folderUrl[folderUrl.getLength() - 1] == '_')
+ {
+ const OUString tempFile = folderUrl.copy(0, folderUrl.getLength() - 1);
+ erase_path( folderUrl, Reference<XCommandEnvironment>(),
+ false /* no throw: ignore errors */ );
+ erase_path( tempFile, Reference<XCommandEnvironment>(),
+ false /* no throw: ignore errors */ );
+ }
+}
+
+void PackageRegistryBackend::deleteUnusedFolders(
+ OUString const & relUrl,
+ ::std::list< OUString> const & usedFolders)
+{
+ try
+ {
+ const OUString sDataFolder = makeURL(getCachePath(), relUrl);
+ ::ucbhelper::Content tempFolder(
+ sDataFolder, Reference<ucb::XCommandEnvironment>());
+ Reference<sdbc::XResultSet> xResultSet(
+ tempFolder.createCursor(
+ Sequence<OUString>( &StrTitle::get(), 1 ),
+ ::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) );
+ // get all temp directories:
+ ::std::vector<OUString> tempEntries;
+
+ char tmp[] = ".tmp";
+
+ while (xResultSet->next())
+ {
+ OUString title(
+ Reference<sdbc::XRow>(
+ xResultSet, UNO_QUERY_THROW )->getString(
+ 1 /* Title */ ) );
+
+ if (title.endsWithAsciiL(tmp, sizeof(tmp) - 1))
+ tempEntries.push_back(
+ makeURLAppendSysPathSegment(sDataFolder, title));
+ }
+
+ for ( ::std::size_t pos = 0; pos < tempEntries.size(); ++pos )
+ {
+ //usedFolders contains the urls to the folders which have
+ //a trailing underscore
+ const OUString tempFolderName = tempEntries[ pos ] + OUSTR("_");
+
+ if (::std::find( usedFolders.begin(), usedFolders.end(), tempFolderName ) ==
+ usedFolders.end())
+ {
+ deleteTempFolder(tempFolderName);
+ }
+ }
+ }
+ catch (ucb::InteractiveAugmentedIOException& e)
+ {
+ //In case the folder containing all the data folder does not
+ //exist yet, we ignore the exception
+ if (e.Code != ucb::IOErrorCode_NOT_EXISTING)
+ throw e;
+ }
+
+}
+
//##############################################################################
//______________________________________________________________________________
@@ -195,16 +318,30 @@ Package::~Package()
//______________________________________________________________________________
Package::Package( ::rtl::Reference<PackageRegistryBackend> const & myBackend,
OUString const & url,
- OUString const & name,
+ OUString const & rName,
OUString const & displayName,
- Reference<deployment::XPackageTypeInfo> const & xPackageType )
+ Reference<deployment::XPackageTypeInfo> const & xPackageType,
+ bool bRemoved,
+ OUString const & identifier)
: t_PackageBase( getMutex() ),
m_myBackend( myBackend ),
m_url( url ),
- m_name( name ),
+ m_name( rName ),
m_displayName( displayName ),
- m_xPackageType( xPackageType )
+ m_xPackageType( xPackageType ),
+ m_bRemoved(bRemoved),
+ m_identifier(identifier)
{
+ if (m_bRemoved)
+ {
+ //We use the last segment of the URL
+ OSL_ASSERT(m_name.getLength() == 0);
+ OUString name = m_url;
+ rtl::Bootstrap::expandMacros(name);
+ sal_Int32 index = name.lastIndexOf('/');
+ if (index != -1 && index < name.getLength())
+ m_name = name.copy(index + 1);
+ }
}
//______________________________________________________________________________
@@ -294,25 +431,31 @@ sal_Bool Package::isBundle() throw (RuntimeException)
}
//______________________________________________________________________________
-::sal_Bool Package::checkPrerequisites(
+::sal_Int32 Package::checkPrerequisites(
const css::uno::Reference< css::task::XAbortChannel >&,
const css::uno::Reference< css::ucb::XCommandEnvironment >&,
- sal_Bool, ::rtl::OUString const &)
+ sal_Bool)
throw (css::deployment::DeploymentException,
- css::ucb::CommandFailedException,
- css::ucb::CommandAbortedException,
- css::uno::RuntimeException)
+ css::deployment::ExtensionRemovedException,
+ css::ucb::CommandFailedException,
+ css::ucb::CommandAbortedException,
+ css::uno::RuntimeException)
{
- return true;
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
+ return 0;
}
//______________________________________________________________________________
::sal_Bool Package::checkDependencies(
const css::uno::Reference< css::ucb::XCommandEnvironment >& )
throw (css::deployment::DeploymentException,
- css::ucb::CommandFailedException,
- css::uno::RuntimeException)
+ css::deployment::ExtensionRemovedException,
+ css::ucb::CommandFailedException,
+ css::uno::RuntimeException)
{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
return true;
}
@@ -336,12 +479,19 @@ OUString Package::getName() throw (RuntimeException)
beans::Optional<OUString> Package::getIdentifier() throw (RuntimeException)
{
+ if (m_bRemoved)
+ return beans::Optional<OUString>(true, m_identifier);
+
return beans::Optional<OUString>();
}
//______________________________________________________________________________
-OUString Package::getVersion() throw (RuntimeException)
+OUString Package::getVersion() throw (
+ deployment::ExtensionRemovedException,
+ RuntimeException)
{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
return OUString();
}
@@ -352,33 +502,49 @@ OUString Package::getURL() throw (RuntimeException)
}
//______________________________________________________________________________
-OUString Package::getDisplayName() throw (RuntimeException)
+OUString Package::getDisplayName() throw (
+ deployment::ExtensionRemovedException, RuntimeException)
{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
return m_displayName;
}
//______________________________________________________________________________
-OUString Package::getDescription() throw (RuntimeException)
+OUString Package::getDescription() throw (
+ deployment::ExtensionRemovedException,RuntimeException)
{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
return OUString();
}
//______________________________________________________________________________
-Sequence<OUString> Package::getUpdateInformationURLs() throw (RuntimeException)
+Sequence<OUString> Package::getUpdateInformationURLs() throw (
+ deployment::ExtensionRemovedException, RuntimeException)
{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
return Sequence<OUString>();
}
//______________________________________________________________________________
-css::beans::StringPair Package::getPublisherInfo() throw (RuntimeException)
+css::beans::StringPair Package::getPublisherInfo() throw (
+ deployment::ExtensionRemovedException, RuntimeException)
{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
css::beans::StringPair aEmptyPair;
return aEmptyPair;
}
//______________________________________________________________________________
-uno::Reference< css::graphic::XGraphic > Package::getIcon( sal_Bool /*bHighContrast*/ ) throw ( RuntimeException )
+uno::Reference< css::graphic::XGraphic > Package::getIcon( sal_Bool /*bHighContrast*/ )
+ throw (deployment::ExtensionRemovedException, RuntimeException )
{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
+
uno::Reference< css::graphic::XGraphic > aEmpty;
return aEmpty;
}
@@ -394,8 +560,12 @@ Reference<deployment::XPackageTypeInfo> Package::getPackageType()
void Package::exportTo(
OUString const & destFolderURL, OUString const & newTitle,
sal_Int32 nameClashAction, Reference<XCommandEnvironment> const & xCmdEnv )
- throw (CommandFailedException, CommandAbortedException, RuntimeException)
+ throw (deployment::ExtensionRemovedException,
+ CommandFailedException, CommandAbortedException, RuntimeException)
{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
+
::ucbhelper::Content destFolder( destFolderURL, xCmdEnv );
::ucbhelper::Content sourceContent( getURL(), xCmdEnv );
if (! destFolder.transferContent(
@@ -461,6 +631,7 @@ beans::Optional< beans::Ambiguous<sal_Bool> > Package::isRegistered(
//______________________________________________________________________________
void Package::processPackage_impl(
bool doRegisterPackage,
+ bool startup,
Reference<task::XAbortChannel> const & xAbortChannel,
Reference<XCommandEnvironment> const & xCmdEnv )
{
@@ -478,7 +649,8 @@ void Package::processPackage_impl(
(doRegisterPackage ? !option.Value.Value
: option.Value.Value)));
if (action) {
- OUString displayName( getDisplayName() );
+
+ OUString displayName = isRemoved() ? getName() : getDisplayName();
ProgressLevel progress(
xCmdEnv,
(doRegisterPackage
@@ -487,6 +659,7 @@ void Package::processPackage_impl(
+ displayName );
processPackage_( guard,
doRegisterPackage,
+ startup,
AbortChannel::get(xAbortChannel),
xCmdEnv );
}
@@ -524,13 +697,17 @@ void Package::processPackage_impl(
//______________________________________________________________________________
void Package::registerPackage(
+ sal_Bool startup,
Reference<task::XAbortChannel> const & xAbortChannel,
Reference<XCommandEnvironment> const & xCmdEnv )
throw (deployment::DeploymentException,
+ deployment::ExtensionRemovedException,
CommandFailedException, CommandAbortedException,
lang::IllegalArgumentException, RuntimeException)
{
- processPackage_impl( true /* register */, xAbortChannel, xCmdEnv );
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
+ processPackage_impl( true /* register */, startup, xAbortChannel, xCmdEnv );
}
//______________________________________________________________________________
@@ -541,7 +718,44 @@ void Package::revokePackage(
CommandFailedException, CommandAbortedException,
lang::IllegalArgumentException, RuntimeException)
{
- processPackage_impl( false /* revoke */, xAbortChannel, xCmdEnv );
+ processPackage_impl( false /* revoke */, false, xAbortChannel, xCmdEnv );
+
+}
+
+PackageRegistryBackend * Package::getMyBackend() const
+{
+ PackageRegistryBackend * pBackend = m_myBackend.get();
+ if (NULL == pBackend)
+ {
+ //May throw a DisposedException
+ check();
+ //We should never get here...
+ throw RuntimeException(
+ OUSTR("Failed to get the BackendImpl"),
+ static_cast<OWeakObject*>(const_cast<Package *>(this)));
+ }
+ return pBackend;
+}
+OUString Package::getRepositoryName()
+ throw (RuntimeException)
+{
+ PackageRegistryBackend * backEnd = getMyBackend();
+ return backEnd->getContext();
+}
+
+beans::Optional< OUString > Package::getRegistrationDataURL()
+ throw (deployment::ExtensionRemovedException,
+ css::uno::RuntimeException)
+{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
+ return beans::Optional<OUString>();
+}
+
+sal_Bool Package::isRemoved()
+ throw (RuntimeException)
+{
+ return m_bRemoved;
}
//##############################################################################
@@ -559,13 +773,15 @@ OUString Package::TypeInfo::getMediaType() throw (RuntimeException)
}
//______________________________________________________________________________
-OUString Package::TypeInfo::getDescription() throw (RuntimeException)
+OUString Package::TypeInfo::getDescription()
+ throw (deployment::ExtensionRemovedException, RuntimeException)
{
return getShortDescription();
}
//______________________________________________________________________________
-OUString Package::TypeInfo::getShortDescription() throw (RuntimeException)
+OUString Package::TypeInfo::getShortDescription()
+ throw (deployment::ExtensionRemovedException, RuntimeException)
{
return m_shortDescr;
}
diff --git a/desktop/source/deployment/registry/dp_backenddb.cxx b/desktop/source/deployment/registry/dp_backenddb.cxx
new file mode 100644
index 000000000000..14b4f2374c5b
--- /dev/null
+++ b/desktop/source/deployment/registry/dp_backenddb.cxx
@@ -0,0 +1,649 @@
+/*************************************************************************
+ *
+ * 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_desktop.hxx"
+
+#include "rtl/string.h"
+#include "rtl/strbuf.hxx"
+#include "rtl/bootstrap.hxx"
+#include "cppuhelper/exc_hlp.hxx"
+#include "osl/file.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/xml/dom/XDocumentBuilder.hpp"
+#include "com/sun/star/xml/xpath/XXPathAPI.hpp"
+#include "com/sun/star/io/XActiveDataSource.hpp"
+#include "com/sun/star/io/XActiveDataControl.hpp"
+#include "dp_ucb.h"
+#include "dp_misc.h"
+#include "ucbhelper/content.hxx"
+#include "xmlscript/xml_helper.hxx"
+#include "dp_backenddb.hxx"
+
+
+namespace css = ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using ::rtl::OUString;
+
+
+namespace dp_registry {
+namespace backend {
+
+BackendDb::BackendDb(
+ Reference<css::uno::XComponentContext> const & xContext,
+ ::rtl::OUString const & url):
+ m_xContext(xContext)
+{
+ m_urlDb = dp_misc::expandUnoRcUrl(url);
+}
+
+void BackendDb::save()
+{
+ const Reference<css::io::XActiveDataSource> xDataSource(m_doc,css::uno::UNO_QUERY_THROW);
+ ::rtl::ByteSequence bytes;
+ xDataSource->setOutputStream(::xmlscript::createOutputStream(&bytes));
+ const Reference<css::io::XActiveDataControl> xDataControl(m_doc,css::uno::UNO_QUERY_THROW);
+ xDataControl->start();
+
+ const Reference<css::io::XInputStream> xData(
+ ::xmlscript::createInputStream(bytes));
+ ::ucbhelper::Content ucbDb(m_urlDb, 0);
+ ucbDb.writeStream(xData, true /*replace existing*/);
+}
+
+css::uno::Reference<css::xml::dom::XDocument> BackendDb::getDocument()
+{
+ if (!m_doc.is())
+ {
+ const Reference<css::xml::dom::XDocumentBuilder> xDocBuilder(
+ m_xContext->getServiceManager()->createInstanceWithContext(
+ OUSTR("com.sun.star.xml.dom.DocumentBuilder"),
+ m_xContext ), css::uno::UNO_QUERY);
+ if (!xDocBuilder.is())
+ throw css::uno::RuntimeException(
+ OUSTR(" Could not create service com.sun.star.xml.dom.DocumentBuilder"), 0);
+
+ ::osl::DirectoryItem item;
+ ::osl::File::RC err = ::osl::DirectoryItem::get(m_urlDb, item);
+ if (err == ::osl::File::E_None)
+ {
+ m_doc = xDocBuilder->parseURI(m_urlDb);
+ }
+ else if (err == ::osl::File::E_NOENT)
+ {
+ //Create a new document and insert some basic stuff
+ m_doc = xDocBuilder->newDocument();
+ const Reference<css::xml::dom::XElement> rootNode =
+ m_doc->createElementNS(getDbNSName(), getNSPrefix() +
+ OUSTR(":") + getRootElementName());
+
+ m_doc->appendChild(Reference<css::xml::dom::XNode>(
+ rootNode, UNO_QUERY_THROW));
+ save();
+ }
+ else
+ throw css::uno::RuntimeException(
+ OUSTR("Extension manager could not access database file:" )
+ + m_urlDb, 0);
+
+ if (!m_doc.is())
+ throw css::uno::RuntimeException(
+ OUSTR("Extension manager could not get root node of data base file: ")
+ + m_urlDb, 0);
+ }
+
+ return m_doc;
+}
+
+Reference<css::xml::xpath::XXPathAPI> BackendDb::getXPathAPI()
+{
+ if (!m_xpathApi.is())
+ {
+ m_xpathApi = Reference< css::xml::xpath::XXPathAPI >(
+ m_xContext->getServiceManager()->createInstanceWithContext(
+ OUSTR("com.sun.star.xml.xpath.XPathAPI"),
+ m_xContext), css::uno::UNO_QUERY);
+
+ if (!m_xpathApi.is())
+ throw css::uno::RuntimeException(
+ OUSTR(" Could not create service com.sun.star.xml.xpath.XPathAPI"), 0);
+
+ m_xpathApi->registerNS(
+ getNSPrefix(), getDbNSName());
+ }
+
+ return m_xpathApi;
+}
+
+void BackendDb::removeElement(::rtl::OUString const & sXPathExpression)
+{
+ try
+ {
+ const Reference<css::xml::dom::XDocument> doc = getDocument();
+ const Reference<css::xml::dom::XNode> root = doc->getFirstChild();
+ const Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI();
+ //find the extension element that is to be removed
+ const Reference<css::xml::dom::XNode> aNode =
+ xpathApi->selectSingleNode(root, sXPathExpression);
+
+ if (aNode.is())
+ {
+ root->removeChild(aNode);
+ save();
+ }
+
+#if OSL_DEBUG_LEVEL > 0
+ //There must not be any other entry with the same url
+ const Reference<css::xml::dom::XNode> nextNode =
+ xpathApi->selectSingleNode(root, sXPathExpression);
+ OSL_ASSERT(! nextNode.is());
+#endif
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to write data entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+void BackendDb::removeEntry(::rtl::OUString const & url)
+{
+ const OUString sKeyElement = getKeyElementName();
+ const OUString sPrefix = getNSPrefix();
+ ::rtl::OUStringBuffer sExpression(500);
+ sExpression.append(sPrefix);
+ sExpression.appendAscii(":");
+ sExpression.append(sKeyElement);
+ sExpression.append(OUSTR("[@url = \""));
+ sExpression.append(url);
+ sExpression.appendAscii("\"]");
+
+ removeElement(sExpression.makeStringAndClear());
+}
+
+Reference<css::xml::dom::XNode> BackendDb::getKeyElement(
+ ::rtl::OUString const & url)
+{
+ try
+ {
+ const OUString sPrefix = getNSPrefix();
+ const OUString sKeyElement = getKeyElementName();
+ ::rtl::OUStringBuffer sExpression(500);
+ sExpression.append(sPrefix);
+ sExpression.appendAscii(":");
+ sExpression.append(sKeyElement);
+ sExpression.append(OUSTR("[@url = \""));
+ sExpression.append(url);
+ sExpression.appendAscii("\"]");
+
+ const Reference<css::xml::dom::XDocument> doc = getDocument();
+ const Reference<css::xml::dom::XNode> root = doc->getFirstChild();
+ const Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI();
+ return xpathApi->selectSingleNode(root, sExpression.makeStringAndClear());
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to read key element in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+//Only writes the data if there is at least one entry
+void BackendDb::writeVectorOfPair(
+ ::std::vector< ::std::pair< ::rtl::OUString, ::rtl::OUString > > const & vecPairs,
+ OUString const & sVectorTagName,
+ OUString const & sPairTagName,
+ OUString const & sFirstTagName,
+ OUString const & sSecondTagName,
+ css::uno::Reference<css::xml::dom::XNode> const & xParent)
+{
+ try{
+ if (vecPairs.size() == 0)
+ return;
+ const OUString sNameSpace = getDbNSName();
+ OSL_ASSERT(sNameSpace.getLength());
+ const OUString sPrefix(getNSPrefix() + OUSTR(":"));
+ const Reference<css::xml::dom::XDocument> doc = getDocument();
+ const Reference<css::xml::dom::XNode> root = doc->getFirstChild();
+
+ const Reference<css::xml::dom::XElement> vectorNode(
+ doc->createElementNS(sNameSpace, sPrefix + sVectorTagName));
+
+ xParent->appendChild(
+ Reference<css::xml::dom::XNode>(
+ vectorNode, css::uno::UNO_QUERY_THROW));
+ typedef ::std::vector< ::std::pair< OUString, OUString > >::const_iterator CIT;
+ for (CIT i = vecPairs.begin(); i != vecPairs.end(); i++)
+ {
+ const Reference<css::xml::dom::XElement> pairNode(
+ doc->createElementNS(sNameSpace, sPrefix + sPairTagName));
+
+ vectorNode->appendChild(
+ Reference<css::xml::dom::XNode>(
+ pairNode, css::uno::UNO_QUERY_THROW));
+
+ const Reference<css::xml::dom::XElement> firstNode(
+ doc->createElementNS(sNameSpace, sPrefix + sFirstTagName));
+
+ pairNode->appendChild(
+ Reference<css::xml::dom::XNode>(
+ firstNode, css::uno::UNO_QUERY_THROW));
+
+ const Reference<css::xml::dom::XText> firstTextNode(
+ doc->createTextNode( i->first));
+
+ firstNode->appendChild(
+ Reference<css::xml::dom::XNode>(
+ firstTextNode, css::uno::UNO_QUERY_THROW));
+
+ const Reference<css::xml::dom::XElement> secondNode(
+ doc->createElementNS(sNameSpace, sPrefix + sSecondTagName));
+
+ pairNode->appendChild(
+ Reference<css::xml::dom::XNode>(
+ secondNode, css::uno::UNO_QUERY_THROW));
+
+ const Reference<css::xml::dom::XText> secondTextNode(
+ doc->createTextNode( i->second));
+
+ secondNode->appendChild(
+ Reference<css::xml::dom::XNode>(
+ secondTextNode, css::uno::UNO_QUERY_THROW));
+ }
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to write data entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+::std::vector< ::std::pair< OUString, OUString > >
+BackendDb::readVectorOfPair(
+ Reference<css::xml::dom::XNode> const & parent,
+ OUString const & sListTagName,
+ OUString const & sPairTagName,
+ OUString const & sFirstTagName,
+ OUString const & sSecondTagName)
+{
+ try
+ {
+ OSL_ASSERT(parent.is());
+ const OUString sPrefix(getNSPrefix() + OUSTR(":"));
+ const Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI();
+ const OUString sExprPairs(
+ sPrefix + sListTagName + OUSTR("/") + sPrefix + sPairTagName);
+ const Reference<css::xml::dom::XNodeList> listPairs =
+ xpathApi->selectNodeList(parent, sExprPairs);
+
+ ::std::vector< ::std::pair< OUString, OUString > > retVector;
+ sal_Int32 length = listPairs->getLength();
+ for (sal_Int32 i = 0; i < length; i++)
+ {
+ const Reference<css::xml::dom::XNode> aPair = listPairs->item(i);
+ const OUString sExprFirst(sPrefix + sFirstTagName + OUSTR("/text()"));
+ const Reference<css::xml::dom::XNode> first =
+ xpathApi->selectSingleNode(aPair, sExprFirst);
+
+ const OUString sExprSecond(sPrefix + sSecondTagName + OUSTR("/text()"));
+ const Reference<css::xml::dom::XNode> second =
+ xpathApi->selectSingleNode(aPair, sExprSecond);
+ OSL_ASSERT(first.is() && second.is());
+
+ retVector.push_back(::std::make_pair(
+ first->getNodeValue(), second->getNodeValue()));
+ }
+ return retVector;
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to read data entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+//Only writes the data if there is at least one entry
+void BackendDb::writeSimpleList(
+ ::std::list< ::rtl::OUString> const & list,
+ OUString const & sListTagName,
+ OUString const & sMemberTagName,
+ Reference<css::xml::dom::XNode> const & xParent)
+{
+ try
+ {
+ if (list.size() == 0)
+ return;
+ const OUString sNameSpace = getDbNSName();
+ const OUString sPrefix(getNSPrefix() + OUSTR(":"));
+ const Reference<css::xml::dom::XDocument> doc = getDocument();
+
+ const Reference<css::xml::dom::XElement> listNode(
+ doc->createElementNS(sNameSpace, sPrefix + sListTagName));
+
+ xParent->appendChild(
+ Reference<css::xml::dom::XNode>(
+ listNode, css::uno::UNO_QUERY_THROW));
+
+ typedef ::std::list<OUString>::const_iterator ITC_ITEMS;
+ for (ITC_ITEMS i = list.begin(); i != list.end(); i++)
+ {
+ const Reference<css::xml::dom::XNode> memberNode(
+ doc->createElementNS(sNameSpace, sPrefix + sMemberTagName), css::uno::UNO_QUERY_THROW);
+
+ listNode->appendChild(memberNode);
+
+ const Reference<css::xml::dom::XNode> textNode(
+ doc->createTextNode( *i), css::uno::UNO_QUERY_THROW);
+
+ memberNode->appendChild(textNode);
+ }
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to write data entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+//Writes only the element if is has a value.
+//The prefix is automatically added to the element name
+void BackendDb::writeSimpleElement(
+ OUString const & sElementName, OUString const & value,
+ Reference<css::xml::dom::XNode> const & xParent)
+{
+ try
+ {
+ if (value.getLength() == 0)
+ return;
+ const OUString sPrefix = getNSPrefix();
+ const Reference<css::xml::dom::XDocument> doc = getDocument();
+ const OUString sNameSpace = getDbNSName();
+ const Reference<css::xml::dom::XNode> dataNode(
+ doc->createElementNS(sNameSpace, sPrefix + OUSTR(":") + sElementName),
+ UNO_QUERY_THROW);
+ xParent->appendChild(dataNode);
+
+ const Reference<css::xml::dom::XNode> dataValue(
+ doc->createTextNode(value), UNO_QUERY_THROW);
+ dataNode->appendChild(dataValue);
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to write data entry(writeSimpleElement) in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+
+}
+
+/** The key elements have an url attribute and are always children of the root
+ element.
+*/
+Reference<css::xml::dom::XNode> BackendDb::writeKeyElement(
+ ::rtl::OUString const & url)
+{
+ try
+ {
+ const OUString sNameSpace = getDbNSName();
+ const OUString sPrefix = getNSPrefix();
+ const OUString sElementName = getKeyElementName();
+ const Reference<css::xml::dom::XDocument> doc = getDocument();
+ const Reference<css::xml::dom::XNode> root = doc->getFirstChild();
+
+ //Check if there are an entry with the same url. This can be the case if the
+ //the status of an XPackage is ambiguous. In this case a call to activateExtension
+ //(dp_extensionmanager.cxx), will register the package again. See also
+ //Package::processPackage_impl in dp_backend.cxx.
+ //A package can become
+ //invalid after its successful registration, for example if a second extension with
+ //the same service is installed.
+ const OUString sExpression(
+ sPrefix + OUSTR(":") + sElementName + OUSTR("[@url = \"") + url + OUSTR("\"]"));
+ const Reference<css::xml::dom::XNode> existingNode =
+ getXPathAPI()->selectSingleNode(root, sExpression);
+ if (existingNode.is())
+ {
+ OSL_ASSERT(0);
+ //replace the existing entry.
+ removeEntry(url);
+ }
+
+ const Reference<css::xml::dom::XElement> keyElement(
+ doc->createElementNS(sNameSpace, sPrefix + OUSTR(":") + sElementName));
+
+ keyElement->setAttribute(OUSTR("url"), url);
+
+ const Reference<css::xml::dom::XNode> keyNode(
+ keyElement, UNO_QUERY_THROW);
+ root->appendChild(keyNode);
+ return keyNode;
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to write key element in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+OUString BackendDb::readSimpleElement(
+ OUString const & sElementName, Reference<css::xml::dom::XNode> const & xParent)
+{
+ try
+ {
+ const OUString sPrefix = getNSPrefix();
+ const OUString sExpr(sPrefix + OUSTR(":") + sElementName + OUSTR("/text()"));
+ const Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI();
+ const Reference<css::xml::dom::XNode> val =
+ xpathApi->selectSingleNode(xParent, sExpr);
+ if (val.is())
+ return val->getNodeValue();
+ return OUString();
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to read data (readSimpleElement) in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+
+::std::list< OUString> BackendDb::readList(
+ Reference<css::xml::dom::XNode> const & parent,
+ OUString const & sListTagName,
+ OUString const & sMemberTagName)
+{
+ try
+ {
+ OSL_ASSERT(parent.is());
+ const OUString sPrefix(getNSPrefix() + OUSTR(":"));
+ const Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI();
+ const OUString sExprList(
+ sPrefix + sListTagName + OUSTR("/") + sPrefix + sMemberTagName + OUSTR("/text()"));
+ const Reference<css::xml::dom::XNodeList> list =
+ xpathApi->selectNodeList(parent, sExprList);
+
+ ::std::list<OUString > retList;
+ sal_Int32 length = list->getLength();
+ for (sal_Int32 i = 0; i < length; i++)
+ {
+ const Reference<css::xml::dom::XNode> member = list->item(i);
+ retList.push_back(member->getNodeValue());
+ }
+ return retList;
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to read data entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+::std::list<OUString> BackendDb::getOneChildFromAllEntries(
+ OUString const & name)
+{
+ try
+ {
+ ::std::list<OUString> listRet;
+ Reference<css::xml::dom::XDocument> doc = getDocument();
+ Reference<css::xml::dom::XNode> root = doc->getFirstChild();
+
+ Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI();
+ const OUString sPrefix = getNSPrefix();
+ const OUString sKeyElement = getKeyElementName();
+ ::rtl::OUStringBuffer buf(512);
+ buf.append(sPrefix);
+ buf.appendAscii(":");
+ buf.append(sKeyElement);
+ buf.appendAscii("/");
+ buf.append(sPrefix);
+ buf.appendAscii(":");
+ buf.append(name);
+ buf.append(OUSTR("/text()"));
+
+ Reference<css::xml::dom::XNodeList> nodes =
+ xpathApi->selectNodeList(root, buf.makeStringAndClear());
+ if (nodes.is())
+ {
+ sal_Int32 length = nodes->getLength();
+ for (sal_Int32 i = 0; i < length; i++)
+ listRet.push_back(nodes->item(i)->getNodeValue());
+ }
+ return listRet;
+ }
+ catch (css::deployment::DeploymentException& )
+ {
+ throw;
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to read data entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+
+
+//================================================================================
+RegisteredDb::RegisteredDb(
+ Reference<XComponentContext> const & xContext,
+ ::rtl::OUString const & url):BackendDb(xContext, url)
+{
+
+}
+
+void RegisteredDb::addEntry(::rtl::OUString const & url)
+{
+ try{
+
+ const OUString sNameSpace = getDbNSName();
+ const OUString sPrefix = getNSPrefix();
+ const OUString sEntry = getKeyElementName();
+
+ Reference<css::xml::dom::XDocument> doc = getDocument();
+ Reference<css::xml::dom::XNode> root = doc->getFirstChild();
+
+#if OSL_DEBUG_LEVEL > 0
+ //There must not be yet an entry with the same url
+ OUString sExpression(
+ sPrefix + OUSTR(":") + sEntry + OUSTR("[@url = \"") + url + OUSTR("\"]"));
+ Reference<css::xml::dom::XNode> _extensionNode =
+ getXPathAPI()->selectSingleNode(root, sExpression);
+ OSL_ASSERT(! _extensionNode.is());
+#endif
+ Reference<css::xml::dom::XElement> helpElement(
+ doc->createElementNS(sNameSpace, sPrefix + OUSTR(":") + sEntry));
+
+ helpElement->setAttribute(OUSTR("url"), url);
+
+ Reference<css::xml::dom::XNode> helpNode(
+ helpElement, UNO_QUERY_THROW);
+ root->appendChild(helpNode);
+
+ save();
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to write data entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+bool RegisteredDb::getEntry(::rtl::OUString const & url)
+{
+ try
+ {
+ const OUString sPrefix = getNSPrefix();
+ const OUString sEntry = getKeyElementName();
+ const OUString sExpression(
+ sPrefix + OUSTR(":") + sEntry + OUSTR("[@url = \"") + url + OUSTR("\"]"));
+ Reference<css::xml::dom::XDocument> doc = getDocument();
+ Reference<css::xml::dom::XNode> root = doc->getFirstChild();
+
+ Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI();
+ //find the extension element that is to be removed
+ Reference<css::xml::dom::XNode> aNode =
+ xpathApi->selectSingleNode(root, sExpression);
+ if (!aNode.is())
+ {
+ return false;
+ }
+ return true;
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to read data entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+
+} // namespace backend
+} // namespace dp_registry
+
diff --git a/desktop/source/deployment/registry/dp_registry.cxx b/desktop/source/deployment/registry/dp_registry.cxx
index c6572364aac0..c5e440a2a825 100644
--- a/desktop/source/deployment/registry/dp_registry.cxx
+++ b/desktop/source/deployment/registry/dp_registry.cxx
@@ -115,6 +115,7 @@ protected:
virtual ~PackageRegistryImpl();
PackageRegistryImpl() : t_helper( getMutex() ) {}
+
public:
static Reference<deployment::XPackageRegistry> create(
OUString const & context,
@@ -126,8 +127,8 @@ public:
// XPackageRegistry
virtual Reference<deployment::XPackage> SAL_CALL bindPackage(
- OUString const & url, OUString const & mediaType,
- Reference<XCommandEnvironment> const & xCmdEnv )
+ OUString const & url, OUString const & mediaType, sal_Bool bRemoved,
+ OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv )
throw (deployment::DeploymentException, CommandFailedException,
lang::IllegalArgumentException, RuntimeException);
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
@@ -181,6 +182,7 @@ OUString normalizeMediaType( OUString const & mediaType )
}
//______________________________________________________________________________
+
void PackageRegistryImpl::insertBackend(
Reference<deployment::XPackageRegistry> const & xBackend )
{
@@ -201,7 +203,8 @@ void PackageRegistryImpl::insertBackend(
::std::pair<t_string2registry::iterator, bool> mb_insertion(
m_mediaType2backend.insert( t_string2registry::value_type(
mediaType, xBackend ) ) );
- if (mb_insertion.second) {
+ if (mb_insertion.second)
+ {
// add parameterless media-type, too:
sal_Int32 semi = mediaType.indexOf( ';' );
if (semi >= 0) {
@@ -210,9 +213,13 @@ void PackageRegistryImpl::insertBackend(
mediaType.copy( 0, semi ), xBackend ) );
}
const OUString fileFilter( xPackageType->getFileFilter() );
+ //The package backend shall also be called to determine the mediatype
+ //(XPackageRegistry.bindPackage) when the URL points to a directory.
+ const bool bExtension = mediaType.equals(OUSTR("application/vnd.sun.star.package-bundle"));
if (fileFilter.getLength() == 0 ||
fileFilter.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("*.*") ) ||
- fileFilter.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("*") ))
+ fileFilter.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("*") ) ||
+ bExtension)
{
m_ambiguousBackends.insert( xBackend );
}
@@ -351,10 +358,28 @@ Reference<deployment::XPackageRegistry> PackageRegistryImpl::create(
}
}
- // insert bundle be:
- that->insertBackend(
+ // Insert bundle back-end.
+ // Always register as last, because we want to add extensions also as folders
+ // and as a default we accept every folder, which was not recognized by the other
+ // backends.
+ Reference<deployment::XPackageRegistry> extensionBackend =
::dp_registry::backend::bundle::create(
- that, context, cachePath, readOnly, xComponentContext ) );
+ that, context, cachePath, readOnly, xComponentContext);
+ that->insertBackend(extensionBackend);
+
+ Reference<lang::XServiceInfo> xServiceInfo(
+ extensionBackend, UNO_QUERY_THROW );
+
+ OSL_ASSERT(xServiceInfo.is());
+ OUString registryCachePath(
+ makeURL( cachePath,
+ ::rtl::Uri::encode(
+ xServiceInfo->getImplementationName(),
+ rtl_UriCharClassPchar,
+ rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8 ) ) );
+ create_folder( 0, registryCachePath, Reference<XCommandEnvironment>());
+
#if OSL_DEBUG_LEVEL > 1
// dump tables:
@@ -434,8 +459,8 @@ void PackageRegistryImpl::update() throw (RuntimeException)
// XPackageRegistry
//______________________________________________________________________________
Reference<deployment::XPackage> PackageRegistryImpl::bindPackage(
- OUString const & url, OUString const & mediaType_,
- Reference<XCommandEnvironment> const & xCmdEnv )
+ OUString const & url, OUString const & mediaType_, sal_Bool bRemoved,
+ OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv )
throw (deployment::DeploymentException, CommandFailedException,
lang::IllegalArgumentException, RuntimeException)
{
@@ -445,7 +470,8 @@ Reference<deployment::XPackage> PackageRegistryImpl::bindPackage(
{
::ucbhelper::Content ucbContent;
if (create_ucb_content(
- &ucbContent, url, xCmdEnv, false /* no throw */ ))
+ &ucbContent, url, xCmdEnv, false /* no throw */ )
+ && !ucbContent.isFolder())
{
OUString title( ucbContent.getPropertyValue(
StrTitle::get() ).get<OUString>() );
@@ -472,7 +498,8 @@ Reference<deployment::XPackage> PackageRegistryImpl::bindPackage(
for ( ; iPos != iEnd; ++iPos )
{
try {
- return (*iPos)->bindPackage( url, mediaType, xCmdEnv );
+ return (*iPos)->bindPackage( url, mediaType, bRemoved,
+ identifier, xCmdEnv );
}
catch (lang::IllegalArgumentException &) {
}
@@ -501,7 +528,8 @@ Reference<deployment::XPackage> PackageRegistryImpl::bindPackage(
getResourceString(RID_STR_UNSUPPORTED_MEDIA_TYPE) + mediaType,
static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) );
}
- return iFind->second->bindPackage( url, mediaType, xCmdEnv );
+ return iFind->second->bindPackage( url, mediaType, bRemoved,
+ identifier, xCmdEnv );
}
}
@@ -511,7 +539,6 @@ PackageRegistryImpl::getSupportedPackageTypes() throw (RuntimeException)
{
return comphelper::containerToSequence(m_typesInfos);
}
-
} // anon namespace
//==============================================================================
diff --git a/desktop/source/deployment/registry/executable/dp_executable.cxx b/desktop/source/deployment/registry/executable/dp_executable.cxx
index 8c95d5874b4c..968ee7297b0f 100644
--- a/desktop/source/deployment/registry/executable/dp_executable.cxx
+++ b/desktop/source/deployment/registry/executable/dp_executable.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_desktop.hxx"
+#include "dp_misc.h"
#include "dp_backend.h"
#include "dp_ucb.h"
#include "dp_interact.h"
@@ -37,10 +38,12 @@
#include "comphelper/servicedecl.hxx"
#include "svl/inettype.hxx"
#include "cppuhelper/implbase1.hxx"
+#include "dp_executablebackenddb.hxx"
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ucb;
+using namespace dp_misc;
using ::rtl::OUString;
namespace dp_registry {
@@ -62,19 +65,20 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference<dp_misc::AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
bool getFileAttributes(sal_uInt64& out_Attributes);
bool isUrlTargetInExtension();
-
public:
inline ExecutablePackageImpl(
::rtl::Reference<PackageRegistryBackend> const & myBackend,
OUString const & url, OUString const & name,
- Reference<deployment::XPackageTypeInfo> const & xPackageType)
+ Reference<deployment::XPackageTypeInfo> const & xPackageType,
+ bool bRemoved, OUString const & identifier)
: Package( myBackend, url, name, name /* display-name */,
- xPackageType ) //,
+ xPackageType, bRemoved, identifier)
{}
};
friend class ExecutablePackageImpl;
@@ -84,11 +88,15 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
// PackageRegistryBackend
virtual Reference<deployment::XPackage> bindPackage_(
- OUString const & url, OUString const & mediaType,
- Reference<XCommandEnvironment> const & xCmdEnv );
+ OUString const & url, OUString const & mediaType, sal_Bool bRemoved,
+ OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv );
- Reference<deployment::XPackageTypeInfo> m_xExecutableTypeInfo;
+ void addDataToDb(OUString const & url);
+ bool isRegisteredInDb(OUString const & url);
+ void deleteDataFromDb(OUString const & url);
+ Reference<deployment::XPackageTypeInfo> m_xExecutableTypeInfo;
+ std::auto_ptr<ExecutableBackendDb> m_backendDb;
public:
BackendImpl( Sequence<Any> const & args,
Reference<XComponentContext> const & xComponentContext );
@@ -112,7 +120,32 @@ BackendImpl::BackendImpl(
RID_IMG_COMPONENT,
RID_IMG_COMPONENT_HC ) )
{
+ if (!transientMode())
+ {
+ OUString dbFile = makeURL(getCachePath(), OUSTR("backenddb.xml"));
+ m_backendDb.reset(
+ new ExecutableBackendDb(getComponentContext(), dbFile));
+ }
+}
+void BackendImpl::addDataToDb(OUString const & url)
+{
+ if (m_backendDb.get())
+ m_backendDb->addEntry(url);
+}
+
+bool BackendImpl::isRegisteredInDb(OUString const & url)
+{
+ bool ret = false;
+ if (m_backendDb.get())
+ ret = m_backendDb->getEntry(url);
+ return ret;
+}
+
+void BackendImpl::deleteDataFromDb(OUString const & url)
+{
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
}
// XPackageRegistry
@@ -125,8 +158,8 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
// PackageRegistryBackend
Reference<deployment::XPackage> BackendImpl::bindPackage_(
- OUString const & url, OUString const & mediaType,
- Reference<XCommandEnvironment> const & xCmdEnv )
+ OUString const & url, OUString const & mediaType, sal_Bool bRemoved,
+ OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv )
{
if (mediaType.getLength() == 0)
{
@@ -141,13 +174,18 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
{
if (type.EqualsIgnoreCaseAscii("application"))
{
- ::ucbhelper::Content ucbContent( url, xCmdEnv );
- const OUString name( ucbContent.getPropertyValue(
- dp_misc::StrTitle::get() ).get<OUString>() );
+ OUString name;
+ if (!bRemoved)
+ {
+ ::ucbhelper::Content ucbContent( url, xCmdEnv );
+ name = ucbContent.getPropertyValue(
+ dp_misc::StrTitle::get() ).get<OUString>();
+ }
if (subType.EqualsIgnoreCaseAscii("vnd.sun.star.executable"))
{
return new BackendImpl::ExecutablePackageImpl(
- this, url, name, m_xExecutableTypeInfo);
+ this, url, name, m_xExecutableTypeInfo, bRemoved,
+ identifier);
}
}
}
@@ -179,23 +217,17 @@ BackendImpl::ExecutablePackageImpl::isRegistered_(
::rtl::Reference<dp_misc::AbortChannel> const &,
Reference<XCommandEnvironment> const & )
{
- //We must return Optional.isPresent = true, otherwise
- //processPackage is not called.
- //The user shall not be able to enable/disable the executable. This is not needed since
- //the executable does not affect the office. The best thing is to show no
- //status at all. See also BackendImpl::PackageImpl::isRegistered_ (dp_package.cxx)
- //On Windows there is no executable file attribute. One has to use security API for this.
- //However, on Windows we do not have the problem, that after unzipping the file cannot be
- //executed.
+ bool registered = getMyBackend()->isRegisteredInDb(getURL());
return beans::Optional< beans::Ambiguous<sal_Bool> >(
sal_True /* IsPresent */,
beans::Ambiguous<sal_Bool>(
- sal_True, sal_True /* IsAmbiguous */ ) );
+ registered, sal_False /* IsAmbiguous */ ) );
}
void BackendImpl::ExecutablePackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
+ bool /*startup*/,
::rtl::Reference<dp_misc::AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & /*xCmdEnv*/ )
{
@@ -216,19 +248,27 @@ void BackendImpl::ExecutablePackageImpl::processPackage_(
else if (getMyBackend()->m_context.equals(OUSTR("shared")))
attributes |= (osl_File_Attribute_OwnExe | osl_File_Attribute_GrpExe
| osl_File_Attribute_OthExe);
- else
+ else if (!getMyBackend()->m_context.equals(OUSTR("bundled")))
+ //Bundled extension are required to be in the properly
+ //installed. That is an executable must have the right flags
OSL_ASSERT(0);
//This won't have affect on Windows
- if (osl::File::E_None != osl::File::setAttributes(
- dp_misc::expandUnoRcUrl(m_url), attributes))
- OSL_ENSURE(0, "Extension Manager: Could not set executable file attribute.");
+ osl::File::setAttributes(
+ dp_misc::expandUnoRcUrl(m_url), attributes);
}
+ getMyBackend()->addDataToDb(getURL());
+ }
+ else
+ {
+ getMyBackend()->deleteDataFromDb(getURL());
}
}
-//We currently cannot check if this XPackage represents a content of a particular exension
+//We currently cannot check if this XPackage represents a content of a particular extension
//But we can check if we are within $UNO_USER_PACKAGES_CACHE etc.
+//Done for security reasons. For example an extension manifest could contain a path to
+//an executable outside the extension.
bool BackendImpl::ExecutablePackageImpl::isUrlTargetInExtension()
{
bool bSuccess = false;
@@ -237,6 +277,8 @@ bool BackendImpl::ExecutablePackageImpl::isUrlTargetInExtension()
sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$UNO_USER_PACKAGES_CACHE"));
else if (getMyBackend()->m_context.equals(OUSTR("shared")))
sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$UNO_SHARED_PACKAGES_CACHE"));
+ else if (getMyBackend()->m_context.equals(OUSTR("bundled")))
+ sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$BUNDLED_EXTENSIONS"));
else
OSL_ASSERT(0);
//remove file ellipses
diff --git a/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx b/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx
new file mode 100644
index 000000000000..976a6281a2bd
--- /dev/null
+++ b/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: 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
+ * 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_desktop.hxx"
+
+#include "rtl/string.h"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "dp_misc.h"
+#include "dp_executablebackenddb.hxx"
+
+
+namespace css = ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using ::rtl::OUString;
+
+#define EXTENSION_REG_NS "http://openoffice.org/extensionmanager/executable-registry/2010"
+#define NS_PREFIX "exe"
+#define ROOT_ELEMENT_NAME "executable-backend-db"
+#define ENTRY_NAME "executable"
+
+namespace dp_registry {
+namespace backend {
+namespace executable {
+
+ExecutableBackendDb::ExecutableBackendDb(
+ Reference<XComponentContext> const & xContext,
+ ::rtl::OUString const & url):RegisteredDb(xContext, url)
+{
+
+}
+
+OUString ExecutableBackendDb::getDbNSName()
+{
+ return OUSTR(EXTENSION_REG_NS);
+}
+
+OUString ExecutableBackendDb::getNSPrefix()
+{
+ return OUSTR(NS_PREFIX);
+}
+
+OUString ExecutableBackendDb::getRootElementName()
+{
+ return OUSTR(ROOT_ELEMENT_NAME);
+}
+
+OUString ExecutableBackendDb::getKeyElementName()
+{
+ return OUSTR(ENTRY_NAME);
+}
+
+
+} // namespace executable
+} // namespace backend
+} // namespace dp_registry
+
diff --git a/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx b/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx
new file mode 100644
index 000000000000..4f17eeda24a6
--- /dev/null
+++ b/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: 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
+ * 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.
+ *
+ ************************************************************************/
+
+#if ! defined INCLUDED_DP_EXECUTABLEBACKENDDB_HXX
+#define INCLUDED_DP_EXECUTABLEBACKENDDB_HXX
+
+#include "rtl/ustring.hxx"
+#include "dp_backenddb.hxx"
+
+namespace css = ::com::sun::star;
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+}}}
+
+namespace dp_registry {
+namespace backend {
+namespace executable {
+
+/* The XML file stores the extensions which are currently registered.
+ They will be removed when they are revoked.
+ The format looks like this:
+
+<?xml version="1.0"?>
+ */
+class ExecutableBackendDb: public dp_registry::backend::RegisteredDb
+{
+protected:
+ virtual ::rtl::OUString getDbNSName();
+
+ virtual ::rtl::OUString getNSPrefix();
+
+ virtual ::rtl::OUString getRootElementName();
+
+ virtual ::rtl::OUString getKeyElementName();
+
+public:
+
+ ExecutableBackendDb( css::uno::Reference<css::uno::XComponentContext> const & xContext,
+ ::rtl::OUString const & url);
+
+};
+
+
+
+}
+}
+}
+#endif
+
diff --git a/desktop/source/deployment/registry/executable/makefile.mk b/desktop/source/deployment/registry/executable/makefile.mk
index 1e57f5ecf3b1..81b2baa44e5d 100644
--- a/desktop/source/deployment/registry/executable/makefile.mk
+++ b/desktop/source/deployment/registry/executable/makefile.mk
@@ -36,7 +36,8 @@ ENABLE_EXCEPTIONS = TRUE
INCPRE += ..$/..$/inc
SLOFILES = \
- $(SLO)$/dp_executable.obj
+ $(SLO)$/dp_executable.obj \
+ $(SLO)$/dp_executablebackenddb.obj
.INCLUDE : ..$/..$/target.pmk
.INCLUDE : target.mk
diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx
index 2b0d91250e4a..bc17a1f7163d 100644
--- a/desktop/source/deployment/registry/help/dp_help.cxx
+++ b/desktop/source/deployment/registry/help/dp_help.cxx
@@ -30,9 +30,11 @@
#include "dp_help.hrc"
#include "dp_backend.h"
+#include "dp_helpbackenddb.hxx"
#include "dp_ucb.h"
#include "rtl/uri.hxx"
#include "osl/file.hxx"
+#include "rtl/bootstrap.hxx"
#include "ucbhelper/content.hxx"
#include "comphelper/servicedecl.hxx"
#include "svl/inettype.hxx"
@@ -44,6 +46,7 @@
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
#include <com/sun/star/uri/XVndSunStarExpandUrl.hpp>
#include <com/sun/star/script/XInvocation.hpp>
+#include "boost/optional.hpp"
using namespace ::dp_misc;
using namespace ::com::sun::star;
@@ -63,6 +66,8 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
{
BackendImpl * getMyBackend() const;
+// HelpBackendDb::Data m_dbData;
+
// Package
virtual beans::Optional< beans::Ambiguous<sal_Bool> > isRegistered_(
::osl::ResettableMutexGuard & guard,
@@ -71,36 +76,44 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
public:
- inline PackageImpl(
+ PackageImpl(
::rtl::Reference<PackageRegistryBackend> const & myBackend,
OUString const & url, OUString const & name,
- Reference<deployment::XPackageTypeInfo> const & xPackageType )
- : Package( myBackend, url, name, name, xPackageType )
- {}
+ Reference<deployment::XPackageTypeInfo> const & xPackageType,
+ bool bRemoved, OUString const & identifier);
+
+ //XPackage
+ virtual css::beans::Optional< ::rtl::OUString > SAL_CALL getRegistrationDataURL()
+ throw (deployment::ExtensionRemovedException, css::uno::RuntimeException);
};
friend class PackageImpl;
// PackageRegistryBackend
virtual Reference<deployment::XPackage> bindPackage_(
OUString const & url, OUString const & mediaType,
+ sal_Bool bRemoved, OUString const & identifier,
Reference<XCommandEnvironment> const & xCmdEnv );
- void implProcessHelp( Reference< deployment::XPackage > xPackage, bool doRegisterPackage );
+ void implProcessHelp( Reference< deployment::XPackage > xPackage, bool doRegisterPackage,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv);
void implCollectXhpFiles( const rtl::OUString& aDir,
std::vector< rtl::OUString >& o_rXhpFileVector );
- rtl::OUString getFlagFileURL( Reference< deployment::XPackage > xPackage, const char* pFlagStr );
- rtl::OUString getRegisteredFlagFileURL( Reference< deployment::XPackage > xPackage );
- rtl::OUString getCompiledFlagFileURL( Reference< deployment::XPackage > xPackage );
- rtl::OUString expandURL( const rtl::OUString& aURL );
+
+ void addDataToDb(OUString const & url, HelpBackendDb::Data const & data);
+ ::boost::optional<HelpBackendDb::Data> readDataFromDb(OUString const & url);
+ void deleteDataFromDb(OUString const & url);
+
Reference< ucb::XSimpleFileAccess > getFileAccess( void );
Reference< ucb::XSimpleFileAccess > m_xSFA;
const Reference<deployment::XPackageTypeInfo> m_xHelpTypeInfo;
Sequence< Reference<deployment::XPackageTypeInfo> > m_typeInfos;
+ std::auto_ptr<HelpBackendDb> m_backendDb;
public:
BackendImpl( Sequence<Any> const & args,
@@ -124,6 +137,20 @@ BackendImpl::BackendImpl(
m_typeInfos( 1 )
{
m_typeInfos[ 0 ] = m_xHelpTypeInfo;
+ if (!transientMode())
+ {
+ OUString dbFile = makeURL(getCachePath(), OUSTR("backenddb.xml"));
+ m_backendDb.reset(
+ new HelpBackendDb(getComponentContext(), dbFile));
+
+ //clean up data folders which are no longer used.
+ //This must not be done in the same process where the help files
+ //are still registers. Only after revoking and restarting OOo the folders
+ //can be removed. This works now, because the extension manager is a singleton
+ //and the backends are only create once per process.
+ ::std::list<OUString> folders = m_backendDb->getAllDataUrls();
+ deleteUnusedFolders(OUString(), folders);
+ }
}
// XPackageRegistry
@@ -138,6 +165,7 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
//______________________________________________________________________________
Reference<deployment::XPackage> BackendImpl::bindPackage_(
OUString const & url, OUString const & mediaType_,
+ sal_Bool bRemoved, OUString const & identifier,
Reference<XCommandEnvironment> const & xCmdEnv )
{
// we don't support auto detection:
@@ -152,12 +180,20 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
{
if (type.EqualsIgnoreCaseAscii("application"))
{
- ::ucbhelper::Content ucbContent( url, xCmdEnv );
+ OUString name;
+ if (!bRemoved)
+ {
+ ::ucbhelper::Content ucbContent( url, xCmdEnv );
+ name = ucbContent.getPropertyValue(
+ StrTitle::get() ).get<OUString>();
+ }
+
if (subType.EqualsIgnoreCaseAscii(
"vnd.sun.star.help"))
{
- return new PackageImpl( this, url,
- ucbContent.getPropertyValue( StrTitle::get() ).get<OUString>(), m_xHelpTypeInfo );
+ return new PackageImpl(
+ this, url, name, m_xHelpTypeInfo, bRemoved,
+ identifier);
}
}
}
@@ -167,8 +203,45 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
static_cast<sal_Int16>(-1) );
}
+void BackendImpl::addDataToDb(
+ OUString const & url, HelpBackendDb::Data const & data)
+{
+ if (m_backendDb.get())
+ m_backendDb->addEntry(url, data);
+}
+
+::boost::optional<HelpBackendDb::Data> BackendImpl::readDataFromDb(
+ OUString const & url)
+{
+ ::boost::optional<HelpBackendDb::Data> data;
+ if (m_backendDb.get())
+ data = m_backendDb->getEntry(url);
+ return data;
+}
+
+void BackendImpl::deleteDataFromDb(OUString const & url)
+{
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
+}
//##############################################################################
+BackendImpl::PackageImpl::PackageImpl(
+ ::rtl::Reference<PackageRegistryBackend> const & myBackend,
+ OUString const & url, OUString const & name,
+ Reference<deployment::XPackageTypeInfo> const & xPackageType,
+ bool bRemoved, OUString const & identifier)
+ : Package( myBackend, url, name, name, xPackageType, bRemoved,
+ identifier)
+{
+// if (bRemoved)
+// {
+// ::boost::optional<HelpBackendDb::Data> opt =
+// getMyBackend()->readDataFromDb(url);
+// if (opt)
+// m_dbData = *opt;
+// }
+}
// Package
BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
@@ -194,11 +267,10 @@ BackendImpl::PackageImpl::isRegistered_(
Reference<XCommandEnvironment> const & )
{
BackendImpl * that = getMyBackend();
- Reference< deployment::XPackage > xThisPackage( this );
- rtl::OUString aRegisteredFlagFile = that->getRegisteredFlagFileURL( xThisPackage );
- Reference< ucb::XSimpleFileAccess > xSFA = that->getFileAccess();
- bool bReg = xSFA->exists( aRegisteredFlagFile );
+ bool bReg = false;
+ if (that->readDataFromDb(getURL()))
+ bReg = true;
return beans::Optional< beans::Ambiguous<sal_Bool> >( true, beans::Ambiguous<sal_Bool>( bReg, false ) );
}
@@ -207,6 +279,7 @@ BackendImpl::PackageImpl::isRegistered_(
void BackendImpl::PackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
+ bool /* startup */,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv )
{
@@ -216,39 +289,46 @@ void BackendImpl::PackageImpl::processPackage_(
BackendImpl* that = getMyBackend();
Reference< deployment::XPackage > xThisPackage( this );
- that->implProcessHelp( xThisPackage, doRegisterPackage );
+ that->implProcessHelp( xThisPackage, doRegisterPackage, xCmdEnv);
}
+beans::Optional< OUString > BackendImpl::PackageImpl::getRegistrationDataURL()
+ throw (deployment::ExtensionRemovedException,
+ css::uno::RuntimeException)
+{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
+
+ ::boost::optional<HelpBackendDb::Data> data =
+ getMyBackend()->readDataFromDb(getURL());
+
+ if (data)
+ return beans::Optional<OUString>(true, data->dataUrl);
+
+ return beans::Optional<OUString>(true, OUString());
+}
+
+
//##############################################################################
static rtl::OUString aSlash( rtl::OUString::createFromAscii( "/" ) );
static rtl::OUString aHelpStr( rtl::OUString::createFromAscii( "help" ) );
+
void BackendImpl::implProcessHelp
- ( Reference< deployment::XPackage > xPackage, bool doRegisterPackage )
+( Reference< deployment::XPackage > xPackage, bool doRegisterPackage,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv)
{
- if( !xPackage.is() )
- return;
-
- Reference< ucb::XSimpleFileAccess > xSFA = getFileAccess();
-
- rtl::OUString aRegisteredFlagFile = getRegisteredFlagFileURL( xPackage );
- if( !doRegisterPackage )
+ OSL_ASSERT(xPackage.is());
+ if (doRegisterPackage)
{
- if( xSFA->exists( aRegisteredFlagFile ) )
- xSFA->kill( aRegisteredFlagFile );
- return;
- }
-
- bool bCompile = true;
- rtl::OUString aCompiledFlagFile = getCompiledFlagFileURL( xPackage );
- if( xSFA->exists( aCompiledFlagFile ) )
- bCompile = false;
+ HelpBackendDb::Data data;
+ const OUString sHelpFolder = createFolder(OUString(), xCmdEnv);
+ data.dataUrl = sHelpFolder;
- if( bCompile )
- {
+ Reference< ucb::XSimpleFileAccess > xSFA = getFileAccess();
rtl::OUString aHelpURL = xPackage->getURL();
- rtl::OUString aExpandedHelpURL = expandURL( aHelpURL );
+ rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl( aHelpURL );
rtl::OUString aName = xPackage->getName();
if( !xSFA->isFolder( aExpandedHelpURL ) )
{
@@ -256,7 +336,7 @@ void BackendImpl::implProcessHelp
aErrStr += rtl::OUString::createFromAscii( "No help folder" );
OWeakObject* oWeakThis = static_cast<OWeakObject *>(this);
throw deployment::DeploymentException( rtl::OUString(), oWeakThis,
- makeAny( uno::Exception( aErrStr, oWeakThis ) ) );
+ makeAny( uno::Exception( aErrStr, oWeakThis ) ) );
}
Reference<XComponentContext> const & xContext = getComponentContext();
@@ -267,7 +347,7 @@ void BackendImpl::implProcessHelp
{
xInvocation = Reference< script::XInvocation >(
xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii(
- "com.sun.star.help.HelpIndexer" ), xContext ) , UNO_QUERY );
+ "com.sun.star.help.HelpIndexer" ), xContext ) , UNO_QUERY );
}
catch (Exception &)
{
@@ -286,34 +366,30 @@ void BackendImpl::implProcessHelp
{
std::vector< rtl::OUString > aXhpFileVector;
- // Delete (old) files in any case to allow compiler to be started every time
- rtl::OUString aLangWithPureNameURL( aLangURL );
- aLangWithPureNameURL += aSlash;
- aLangWithPureNameURL += aHelpStr;
- rtl::OUString aDbFile( aLangWithPureNameURL );
- aDbFile += rtl::OUString::createFromAscii( ".db" );
- if( xSFA->exists( aDbFile ) )
- xSFA->kill( aDbFile );
- rtl::OUString aHtFile( aLangWithPureNameURL );
- aHtFile += rtl::OUString::createFromAscii( ".ht" );
- if( xSFA->exists( aHtFile ) )
- xSFA->kill( aHtFile );
- rtl::OUString aKeyFile( aLangWithPureNameURL );
- aKeyFile += rtl::OUString::createFromAscii( ".key" );
- if( xSFA->exists( aKeyFile ) )
- xSFA->kill( aKeyFile );
-
// calculate jar file URL
- rtl::OUString aJarFile( aLangURL );
- aJarFile += aSlash;
- aJarFile += aHelpStr;
- aJarFile += rtl::OUString::createFromAscii( ".jar" );
- // remove in any case to clean up
- if( xSFA->exists( aJarFile ) )
- xSFA->kill( aJarFile );
-
- rtl::OUString aEncodedJarFilePath = rtl::Uri::encode( aJarFile,
- rtl_UriCharClassPchar, rtl_UriEncodeIgnoreEscapes, RTL_TEXTENCODING_UTF8 );
+ 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 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( "/" );
@@ -353,8 +429,10 @@ void BackendImpl::implProcessHelp
::osl::File::getFileURLFromSystemPath( aOfficeHelpPath, aOfficeHelpPathFileURL );
HelpProcessingErrorInfo aErrorInfo;
- bool bSuccess = compileExtensionHelp( aOfficeHelpPathFileURL, aHelpStr, aLangURL,
- nXhpFileCount, pXhpFiles, aErrorInfo );
+ bool bSuccess = compileExtensionHelp(
+ aOfficeHelpPathFileURL, aHelpStr, aLangURL,
+ nXhpFileCount, pXhpFiles,
+ langFolderDestExpanded, aErrorInfo );
if( bSuccess && xInvocation.is() )
{
@@ -375,13 +453,14 @@ void BackendImpl::implProcessHelp
aParamsSeq[4] = uno::makeAny( rtl::OUString::createFromAscii( "-zipdir" ) );
rtl::OUString aSystemPath;
- osl::FileBase::getSystemPathFromFileURL( aLangURL, 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 );
+ aParamsSeq, aOutParamIndex, aOutParam );
}
if( !bSuccess )
@@ -389,10 +468,10 @@ void BackendImpl::implProcessHelp
USHORT nErrStrId = 0;
switch( aErrorInfo.m_eErrorClass )
{
- 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: ;
+ 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;
@@ -423,7 +502,7 @@ void BackendImpl::implProcessHelp
aErrStr += rtl::OUString::createFromAscii( " in " );
rtl::OUString aDecodedFile = rtl::Uri::decode( aErrorInfo.m_aXMLParsingFile,
- rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
+ rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
aErrStr += aDecodedFile;
if( aErrorInfo.m_nXMLParsingLine != -1 )
{
@@ -435,96 +514,21 @@ void BackendImpl::implProcessHelp
OWeakObject* oWeakThis = static_cast<OWeakObject *>(this);
throw deployment::DeploymentException( rtl::OUString(), oWeakThis,
- makeAny( uno::Exception( aErrStr, oWeakThis ) ) );
+ makeAny( uno::Exception( aErrStr, oWeakThis ) ) );
}
}
}
- // Write compiled flag file (this code is only reached in case of success)
- Reference< io::XOutputStream > xOutputStream = xSFA->openFileWrite( aCompiledFlagFile );
- if( xOutputStream.is() )
- xOutputStream->closeOutput();
-
- } // if( bCompile )
-
- // Write registered flag file (this code is only reached in case of success)
- if( !xSFA->exists( aRegisteredFlagFile ) )
+ //Writing the data entry replaces writing the flag file. If we got to this
+ //point the registration was successful.
+ addDataToDb(xPackage->getURL(), data);
+ }
+ else
{
- Reference< io::XOutputStream > xOutputStream = xSFA->openFileWrite( aRegisteredFlagFile );
- if( xOutputStream.is() )
- xOutputStream->closeOutput();
+ deleteDataFromDb(xPackage->getURL());
}
}
-rtl::OUString BackendImpl::getFlagFileURL( Reference< deployment::XPackage > xPackage, const char* pFlagStr )
-{
- rtl::OUString aRetURL;
- if( !xPackage.is() )
- return aRetURL;
- rtl::OUString aHelpURL = xPackage->getURL();
- aRetURL = expandURL( aHelpURL );
- aRetURL += rtl::OUString::createFromAscii( pFlagStr );
- return aRetURL;
-}
-
-rtl::OUString BackendImpl::getRegisteredFlagFileURL( Reference< deployment::XPackage > xPackage )
-{
- return getFlagFileURL( xPackage, "/RegisteredFlag" );
-}
-
-rtl::OUString BackendImpl::getCompiledFlagFileURL( Reference< deployment::XPackage > xPackage )
-{
- return getFlagFileURL( xPackage, "/CompiledFlag" );
-}
-
-rtl::OUString BackendImpl::expandURL( const rtl::OUString& aURL )
-{
- static Reference< util::XMacroExpander > xMacroExpander;
- static Reference< uri::XUriReferenceFactory > xFac;
-
- if( !xMacroExpander.is() || !xFac.is() )
- {
- Reference<XComponentContext> const & xContext = getComponentContext();
- if( xContext.is() )
- {
- xFac = Reference< uri::XUriReferenceFactory >(
- xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii(
- "com.sun.star.uri.UriReferenceFactory"), xContext ) , UNO_QUERY );
- }
- if( !xFac.is() )
- {
- throw RuntimeException(
- ::rtl::OUString::createFromAscii(
- "dp_registry::backend::help::BackendImpl::expandURL(), "
- "could not instatiate UriReferenceFactory." ),
- Reference< XInterface >() );
- }
-
- xMacroExpander = Reference< util::XMacroExpander >(
- xContext->getValueByName(
- ::rtl::OUString::createFromAscii( "/singletons/com.sun.star.util.theMacroExpander" ) ),
- UNO_QUERY_THROW );
- }
-
- rtl::OUString aRetURL = aURL;
- if( xMacroExpander.is() )
- {
- Reference< uri::XUriReference > uriRef;
- for (;;)
- {
- uriRef = Reference< uri::XUriReference >( xFac->parse( aRetURL ), UNO_QUERY );
- if ( uriRef.is() )
- {
- Reference < uri::XVndSunStarExpandUrl > sxUri( uriRef, UNO_QUERY );
- if( !sxUri.is() )
- break;
-
- aRetURL = sxUri->expand( xMacroExpander );
- }
- }
- }
- return aRetURL;
-}
void BackendImpl::implCollectXhpFiles( const rtl::OUString& aDir,
std::vector< rtl::OUString >& o_rXhpFileVector )
diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx
new file mode 100644
index 000000000000..3bf67e0c050b
--- /dev/null
+++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx
@@ -0,0 +1,178 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: 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
+ * 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_desktop.hxx"
+
+#include "rtl/string.h"
+#include "rtl/bootstrap.hxx"
+#include "cppuhelper/exc_hlp.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/xml/dom/XDocumentBuilder.hpp"
+#include "com/sun/star/xml/xpath/XXPathAPI.hpp"
+#include "dp_misc.h"
+
+#include "dp_helpbackenddb.hxx"
+
+
+namespace css = ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using ::rtl::OUString;
+
+#define EXTENSION_REG_NS "http://openoffice.org/extensionmanager/help-registry/2010"
+#define NS_PREFIX "help"
+#define ROOT_ELEMENT_NAME "help-backend-db"
+#define KEY_ELEMENT_NAME "help"
+
+namespace dp_registry {
+namespace backend {
+namespace help {
+
+HelpBackendDb::HelpBackendDb(
+ Reference<XComponentContext> const & xContext,
+ ::rtl::OUString const & url):BackendDb(xContext, url)
+{
+
+}
+
+OUString HelpBackendDb::getDbNSName()
+{
+ return OUSTR(EXTENSION_REG_NS);
+}
+
+OUString HelpBackendDb::getNSPrefix()
+{
+ return OUSTR(NS_PREFIX);
+}
+
+OUString HelpBackendDb::getRootElementName()
+{
+ return OUSTR(ROOT_ELEMENT_NAME);
+}
+
+OUString HelpBackendDb::getKeyElementName()
+{
+ return OUSTR(KEY_ELEMENT_NAME);
+}
+
+
+void HelpBackendDb::addEntry(::rtl::OUString const & url, Data const & data)
+{
+ try{
+ Reference<css::xml::dom::XNode> helpNode
+ = writeKeyElement(url);
+
+ writeSimpleElement(OUSTR("data-url"), data.dataUrl, helpNode);
+ save();
+ }
+ catch (css::deployment::DeploymentException& )
+ {
+ throw;
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to write data entry in help backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+
+::boost::optional<HelpBackendDb::Data>
+HelpBackendDb::getEntry(::rtl::OUString const & url)
+{
+ try
+ {
+ HelpBackendDb::Data retData;
+ Reference<css::xml::dom::XNode> aNode = getKeyElement(url);
+ if (aNode.is())
+ {
+ retData.dataUrl = readSimpleElement(OUSTR("data-url"), aNode);
+ }
+ else
+ {
+ return ::boost::optional<Data>();
+ }
+ return ::boost::optional<Data>(retData);
+ }
+ catch (css::deployment::DeploymentException& )
+ {
+ throw;
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to read data entry in help backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+::std::list<OUString> HelpBackendDb::getAllDataUrls()
+{
+ try
+ {
+ ::std::list<OUString> listRet;
+ Reference<css::xml::dom::XDocument> doc = getDocument();
+ Reference<css::xml::dom::XNode> root = doc->getFirstChild();
+
+ Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI();
+ const OUString sPrefix = getNSPrefix();
+ OUString sExpression(
+ sPrefix + OUSTR(":help/") + sPrefix + OUSTR(":data-url/text()"));
+ Reference<css::xml::dom::XNodeList> nodes =
+ xpathApi->selectNodeList(root, sExpression);
+ if (nodes.is())
+ {
+ sal_Int32 length = nodes->getLength();
+ for (sal_Int32 i = 0; i < length; i++)
+ listRet.push_back(nodes->item(i)->getNodeValue());
+ }
+ return listRet;
+ }
+ catch (css::deployment::DeploymentException& )
+ {
+ throw;
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to read data entry in help backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+
+} // namespace help
+} // namespace backend
+} // namespace dp_registry
+
diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx
new file mode 100644
index 000000000000..edf7dfdfc284
--- /dev/null
+++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: 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
+ * 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.
+ *
+ ************************************************************************/
+
+#if ! defined INCLUDED_DP_HELPBACKENDDB_HXX
+#define INCLUDED_DP_HELPBACKENDDB_HXX
+
+#include "rtl/ustring.hxx"
+#include <list>
+#include "boost/optional.hpp"
+#include "dp_backenddb.hxx"
+
+namespace css = ::com::sun::star;
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+}}}
+
+namespace dp_registry {
+namespace backend {
+namespace help {
+
+/* The XML file stores the extensions which are currently registered.
+ They will be removed when they are revoked.
+ */
+class HelpBackendDb: public dp_registry::backend::BackendDb
+{
+protected:
+ virtual ::rtl::OUString getDbNSName();
+
+ virtual ::rtl::OUString getNSPrefix();
+
+ virtual ::rtl::OUString getRootElementName();
+
+ virtual ::rtl::OUString getKeyElementName();
+
+public:
+ struct Data
+ {
+ /* the URL to the folder containing the compiled help files, etc.
+ */
+ ::rtl::OUString dataUrl;
+
+ };
+
+public:
+
+ HelpBackendDb( css::uno::Reference<css::uno::XComponentContext> const & xContext,
+ ::rtl::OUString const & url);
+
+ void addEntry(::rtl::OUString const & url, Data const & data);
+
+ ::boost::optional<Data> getEntry(::rtl::OUString const & url);
+ ::std::list< ::rtl::OUString> getAllDataUrls();
+
+};
+
+
+
+}
+}
+}
+#endif
+
diff --git a/desktop/source/deployment/registry/help/makefile.mk b/desktop/source/deployment/registry/help/makefile.mk
index ba904bb7f28a..d4934f71a46f 100644
--- a/desktop/source/deployment/registry/help/makefile.mk
+++ b/desktop/source/deployment/registry/help/makefile.mk
@@ -44,7 +44,8 @@ SRC1FILES = \
dp_help.src
SLOFILES = \
- $(SLO)$/dp_help.obj
+ $(SLO)$/dp_help.obj \
+ $(SLO)$/dp_helpbackenddb.obj
.INCLUDE : ..$/..$/target.pmk
.INCLUDE : target.mk
diff --git a/desktop/source/deployment/registry/inc/dp_backend.h b/desktop/source/deployment/registry/inc/dp_backend.h
index fe52c8ffc7e3..3d3bf7cf912c 100644
--- a/desktop/source/deployment/registry/inc/dp_backend.h
+++ b/desktop/source/deployment/registry/inc/dp_backend.h
@@ -40,8 +40,10 @@
#include "com/sun/star/lang/XEventListener.hpp"
#include "com/sun/star/deployment/XPackageRegistry.hpp"
#include "com/sun/star/deployment/XPackageManager.hpp"
+#include "com/sun/star/deployment/InvalidRemovedParameterException.hpp"
#include <memory>
#include <hash_map>
+#include <list>
#include "dp_registry.hrc"
namespace dp_registry
@@ -62,8 +64,10 @@ typedef ::cppu::WeakComponentImplHelper1<
//==============================================================================
class Package : protected ::dp_misc::MutexHolder, public t_PackageBase
{
+ PackageRegistryBackend * getMyBackend() const;
void processPackage_impl(
bool registerPackage,
+ bool startup,
css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv );
@@ -73,6 +77,9 @@ protected:
::rtl::OUString m_name;
::rtl::OUString m_displayName;
const css::uno::Reference<css::deployment::XPackageTypeInfo> m_xPackageType;
+ const bool m_bRemoved;
+ //Only set if m_bRemoved = true;
+ const ::rtl::OUString m_identifier;
void check() const;
void fireModified();
@@ -91,6 +98,7 @@ protected:
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference< ::dp_misc::AbortChannel > const & abortChannel,
css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
= 0;
@@ -101,7 +109,9 @@ protected:
::rtl::OUString const & name,
::rtl::OUString const & displayName,
css::uno::Reference<css::deployment::XPackageTypeInfo> const &
- xPackageType );
+ xPackageType,
+ bool bRemoved,
+ ::rtl::OUString const & identifier);
public:
@@ -126,9 +136,11 @@ public:
virtual ::rtl::OUString SAL_CALL getMediaType()
throw (css::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getDescription()
- throw (css::uno::RuntimeException);
+ throw (css::deployment::ExtensionRemovedException,
+ css::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getShortDescription()
- throw (css::uno::RuntimeException);
+ throw (css::deployment::ExtensionRemovedException,
+ css::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getFileFilter()
throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL getIcon( sal_Bool highContrast,
@@ -165,25 +177,29 @@ public:
css::ucb::CommandAbortedException,
css::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL checkPrerequisites(
+ virtual ::sal_Int32 SAL_CALL checkPrerequisites(
const css::uno::Reference< css::task::XAbortChannel >& xAbortChannel,
const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv,
- sal_Bool bInstalled, ::rtl::OUString const & aContextName)
+ sal_Bool noLicenseChecking)
throw (css::deployment::DeploymentException,
- css::ucb::CommandFailedException,
- css::ucb::CommandAbortedException,
- css::uno::RuntimeException);
+ css::deployment::ExtensionRemovedException,
+ css::ucb::CommandFailedException,
+ css::ucb::CommandAbortedException,
+ css::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL checkDependencies(
const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv )
throw (css::deployment::DeploymentException,
- css::ucb::CommandFailedException,
- css::uno::RuntimeException);
+ css::deployment::ExtensionRemovedException,
+ css::ucb::CommandFailedException,
+ css::uno::RuntimeException);
virtual void SAL_CALL registerPackage(
+ sal_Bool startup,
css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
throw (css::deployment::DeploymentException,
+ css::deployment::ExtensionRemovedException,
css::ucb::CommandFailedException,
css::ucb::CommandAbortedException,
css::lang::IllegalArgumentException, css::uno::RuntimeException);
@@ -211,19 +227,27 @@ public:
virtual css::beans::Optional< ::rtl::OUString > SAL_CALL getIdentifier()
throw (css::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getVersion()
- throw (css::uno::RuntimeException);
+ throw (css::deployment::ExtensionRemovedException,
+ css::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getURL()
throw (css::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getDisplayName()
- throw (css::uno::RuntimeException);
+ throw (css::deployment::ExtensionRemovedException,
+ css::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getDescription()
- throw (css::uno::RuntimeException);
+ throw (css::deployment::ExtensionRemovedException,
+ css::uno::RuntimeException);
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL
- getUpdateInformationURLs() throw (css::uno::RuntimeException);
-
- virtual css::beans::StringPair SAL_CALL getPublisherInfo() throw (css::uno::RuntimeException);
- virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL getIcon( sal_Bool bHighContrast ) throw (css::uno::RuntimeException);
-
+ getUpdateInformationURLs()
+ throw (css::deployment::ExtensionRemovedException,
+ css::uno::RuntimeException);
+ virtual css::beans::StringPair SAL_CALL getPublisherInfo()
+ throw (css::deployment::ExtensionRemovedException,
+ css::uno::RuntimeException);
+ virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL
+ getIcon( sal_Bool bHighContrast )
+ throw (css::deployment::ExtensionRemovedException,
+ css::uno::RuntimeException);
virtual css::uno::Reference<css::deployment::XPackageTypeInfo> SAL_CALL
getPackageType() throw (css::uno::RuntimeException);
virtual void SAL_CALL exportTo(
@@ -231,8 +255,17 @@ public:
::rtl::OUString const & newTitle,
sal_Int32 nameClashAction,
css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
- throw (css::ucb::CommandFailedException,
+ throw (css::deployment::ExtensionRemovedException,
+ css::ucb::CommandFailedException,
css::ucb::CommandAbortedException, css::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getRepositoryName()
+ throw (css::uno::RuntimeException);
+ virtual css::beans::Optional< ::rtl::OUString > SAL_CALL getRegistrationDataURL()
+ throw (css::deployment::ExtensionRemovedException,
+ css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isRemoved()
+ throw (css::uno::RuntimeException);
+
};
typedef ::cppu::WeakComponentImplHelper2<
@@ -243,7 +276,6 @@ typedef ::cppu::WeakComponentImplHelper2<
class PackageRegistryBackend
: protected ::dp_misc::MutexHolder, public t_BackendBase
{
- ::rtl::OUString m_cachePath;
//The map held originally WeakReferences. The map entries are removed in the disposing
//function, which is called when the XPackages are destructed or they are
//explicitely disposed. The latter happens, for example, when a extension is
@@ -257,13 +289,14 @@ class PackageRegistryBackend
t_string2ref m_bound;
protected:
+ ::rtl::OUString m_cachePath;
css::uno::Reference<css::uno::XComponentContext> m_xComponentContext;
::rtl::OUString m_context;
// currently only for library containers:
enum context {
CONTEXT_UNKNOWN,
- CONTEXT_USER, CONTEXT_SHARED,
+ CONTEXT_USER, CONTEXT_SHARED,CONTEXT_BUNDLED, CONTEXT_TMP,
CONTEXT_DOCUMENT
} m_eContext;
bool m_readOnly;
@@ -276,6 +309,7 @@ protected:
// @@@ to be implemented by specific backend:
virtual css::uno::Reference<css::deployment::XPackage> bindPackage_(
::rtl::OUString const & url, ::rtl::OUString const & mediaType,
+ sal_Bool bRemoved, ::rtl::OUString const & identifier,
css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
= 0;
@@ -287,6 +321,28 @@ protected:
css::uno::Sequence<css::uno::Any> const & args,
css::uno::Reference<css::uno::XComponentContext> const & xContext );
+ /* creates a folder with a unique name.
+ If url is empty then it is created in the the backend folder, otherwise
+ at a location relative to that folder specified by url.
+ */
+ ::rtl::OUString createFolder(
+ ::rtl::OUString const & relUrl,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv);
+ /* deletes folders and files.
+
+ All folder all files which end with ".tmp" or ".tmp_" and which are
+ not used are deleted.
+ */
+ void deleteUnusedFolders(
+ ::rtl::OUString const & relUrl,
+ ::std::list< ::rtl::OUString> const & usedFolders);
+ /* deletes one folder with a "temporary" name and the corresponding
+ tmp file, which was used to derive the folder name.
+ */
+ static void deleteTempFolder(
+ ::rtl::OUString const & folderUrl);
+
+
public:
struct StrRegisteringPackage : public ::dp_misc::StaticResourceString<
StrRegisteringPackage, RID_STR_REGISTERING_PACKAGE> {};
@@ -299,6 +355,8 @@ public:
inline ::rtl::OUString const & getCachePath() const { return m_cachePath; }
inline bool transientMode() const { return m_cachePath.getLength() == 0; }
+ inline ::rtl::OUString getContext() const {return m_context; }
+
// XEventListener
virtual void SAL_CALL disposing( css::lang::EventObject const & evt )
throw (css::uno::RuntimeException);
@@ -306,13 +364,12 @@ public:
// XPackageRegistry
virtual css::uno::Reference<css::deployment::XPackage> SAL_CALL bindPackage(
::rtl::OUString const & url, ::rtl::OUString const & mediaType,
+ sal_Bool bRemoved, ::rtl::OUString const & identifier,
css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
throw (css::deployment::DeploymentException,
+ css::deployment::InvalidRemovedParameterException,
css::ucb::CommandFailedException,
css::lang::IllegalArgumentException, css::uno::RuntimeException);
-// virtual css::uno::Sequence<
-// css::uno::Reference<css::deployment::XPackageTypeInfo> > SAL_CALL
-// getSupportedPackageTypes() throw (css::uno::RuntimeException);
};
}
diff --git a/desktop/source/deployment/registry/inc/dp_backenddb.hxx b/desktop/source/deployment/registry/inc/dp_backenddb.hxx
new file mode 100644
index 000000000000..a0e477979f8c
--- /dev/null
+++ b/desktop/source/deployment/registry/inc/dp_backenddb.hxx
@@ -0,0 +1,170 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#if ! defined INCLUDED_DP_BACKENDDB_HXX
+#define INCLUDED_DP_BACKENDDB_HXX
+
+#include "rtl/ustring.hxx"
+#include <list>
+#include <vector>
+
+namespace css = ::com::sun::star;
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+ namespace xml { namespace dom {
+ class XDocument;
+ class XNode;
+ }}
+ namespace xml { namespace xpath {
+ class XXPathAPI;
+ }}
+}}}
+
+namespace dp_registry {
+namespace backend {
+
+class BackendDb
+{
+private:
+
+ css::uno::Reference<css::xml::dom::XDocument> m_doc;
+ css::uno::Reference<css::xml::xpath::XXPathAPI> m_xpathApi;
+
+ BackendDb(BackendDb const &);
+ BackendDb & operator = (BackendDb const &);
+
+protected:
+ const css::uno::Reference<css::uno::XComponentContext> m_xContext;
+ ::rtl::OUString m_urlDb;
+
+protected:
+
+ /* caller must make sure that only one thread accesses the function
+ */
+ css::uno::Reference<css::xml::dom::XDocument> getDocument();
+
+ /* the namespace prefix is "reg" (without quotes)
+ */
+ css::uno::Reference<css::xml::xpath::XXPathAPI> getXPathAPI();
+ void save();
+ void removeElement(::rtl::OUString const & sXPathExpression);
+
+ css::uno::Reference<css::xml::dom::XNode> getKeyElement(
+ ::rtl::OUString const & url);
+
+ void writeSimpleList(
+ ::std::list< ::rtl::OUString> const & list,
+ ::rtl::OUString const & sListTagName,
+ ::rtl::OUString const & sMemberTagName,
+ css::uno::Reference<css::xml::dom::XNode> const & xParent);
+
+ void writeVectorOfPair(
+ ::std::vector< ::std::pair< ::rtl::OUString, ::rtl::OUString > > const & vecPairs,
+ ::rtl::OUString const & sVectorTagName,
+ ::rtl::OUString const & sPairTagName,
+ ::rtl::OUString const & sFirstTagName,
+ ::rtl::OUString const & sSecondTagName,
+ css::uno::Reference<css::xml::dom::XNode> const & xParent);
+
+ void writeSimpleElement(
+ ::rtl::OUString const & sElementName, ::rtl::OUString const & value,
+ css::uno::Reference<css::xml::dom::XNode> const & xParent);
+
+ css::uno::Reference<css::xml::dom::XNode> writeKeyElement(
+ ::rtl::OUString const & url);
+
+ ::rtl::OUString readSimpleElement(
+ ::rtl::OUString const & sElementName,
+ css::uno::Reference<css::xml::dom::XNode> const & xParent);
+
+ ::std::vector< ::std::pair< ::rtl::OUString, ::rtl::OUString > >
+ readVectorOfPair(
+ css::uno::Reference<css::xml::dom::XNode> const & parent,
+ ::rtl::OUString const & sListTagName,
+ ::rtl::OUString const & sPairTagName,
+ ::rtl::OUString const & sFirstTagName,
+ ::rtl::OUString const & sSecondTagName);
+
+ ::std::list< ::rtl::OUString> readList(
+ css::uno::Reference<css::xml::dom::XNode> const & parent,
+ ::rtl::OUString const & sListTagName,
+ ::rtl::OUString const & sMemberTagName);
+
+ /* returns the values of one particulary child element of all key elements.
+ */
+ ::std::list< ::rtl::OUString> getOneChildFromAllEntries(
+ ::rtl::OUString const & sElementName);
+
+
+ /* returns the namespace which is to be written as xmlns attribute
+ into the root element.
+ */
+ virtual ::rtl::OUString getDbNSName()=0;
+ /* return the namespace prefix which is to be registered with the XPath API.
+
+ The prefix can then be used in XPath expressions.
+ */
+ virtual ::rtl::OUString getNSPrefix()=0;
+ /* returns the name of the root element without any namespace prefix.
+ */
+ virtual ::rtl::OUString getRootElementName()=0;
+ /* returns the name of xml element for each entry
+ */
+ virtual ::rtl::OUString getKeyElementName()=0;
+
+
+
+public:
+ BackendDb(css::uno::Reference<css::uno::XComponentContext> const & xContext,
+ ::rtl::OUString const & url);
+ virtual ~BackendDb() {};
+
+ void removeEntry(::rtl::OUString const & url);
+};
+
+class RegisteredDb: public BackendDb
+{
+
+public:
+ RegisteredDb( css::uno::Reference<css::uno::XComponentContext> const & xContext,
+ ::rtl::OUString const & url);
+ virtual ~RegisteredDb() {};
+
+
+ virtual void addEntry(::rtl::OUString const & url);
+ virtual bool getEntry(::rtl::OUString const & url);
+
+};
+
+
+}
+}
+#endif
+
diff --git a/desktop/source/deployment/registry/makefile.mk b/desktop/source/deployment/registry/makefile.mk
index de0e943654d9..e45cec272ca7 100644
--- a/desktop/source/deployment/registry/makefile.mk
+++ b/desktop/source/deployment/registry/makefile.mk
@@ -41,7 +41,8 @@ INCPRE += inc
SLOFILES = \
$(SLO)$/dp_backend.obj \
- $(SLO)$/dp_registry.obj
+ $(SLO)$/dp_registry.obj \
+ $(SLO)$/dp_backenddb.obj
.INCLUDE : ..$/target.pmk
.INCLUDE : target.mk
diff --git a/desktop/source/deployment/registry/package/dp_description.cxx b/desktop/source/deployment/registry/package/dp_description.cxx
deleted file mode 100644
index 7c05bfd90a5b..000000000000
--- a/desktop/source/deployment/registry/package/dp_description.cxx
+++ /dev/null
@@ -1,205 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_desktop.hxx"
-
-#include "dp_description.hxx"
-
-#include "cppuhelper/exc_hlp.hxx"
-#include "ucbhelper/content.hxx"
-#include "com/sun/star/deployment/DeploymentException.hpp"
-#include "com/sun/star/xml/dom/XDocumentBuilder.hpp"
-#include "com/sun/star/uno/XComponentContext.hpp"
-#include "com/sun/star/ucb/CommandFailedException.hpp"
-#include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp"
-#include "com/sun/star/ucb/IOErrorCode.hpp"
-
-#include "com/sun/star/beans/PropertyValue.hpp"
-
-
-#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
-
-namespace css = com::sun::star;
-namespace cssu = com::sun::star::uno;
-
-namespace dp_registry {
-namespace backend {
-namespace bundle {
-
-ExtensionDescription::ExtensionDescription(
- const cssu::Reference<cssu::XComponentContext>& xContext,
- const ::rtl::OUString& installDir,
- const cssu::Reference< css::ucb::XCommandEnvironment >& xCmdEnv)
-{
- try {
- m_sExtensionRootUrl = installDir;
- //may throw ::com::sun::star::ucb::ContentCreationException
- //If there is no description.xml then ucb will start an interaction which
- //brings up a dialog.We want to prevent this. Therefore we wrap the xCmdEnv
- //and filter the respective exception out.
- ::rtl::OUString sDescriptionUri(installDir + OUSTR("/description.xml"));
- cssu::Reference<css::ucb::XCommandEnvironment> xFilter =
- static_cast<css::ucb::XCommandEnvironment*>(
- new FileDoesNotExistFilter(xCmdEnv));
- ::ucbhelper::Content descContent(sDescriptionUri, xFilter);
-
- //throws an com::sun::star::uno::Exception if the file is not available
- cssu::Reference<css::io::XInputStream> xIn;
- try
- { //throws com.sun.star.ucb.InteractiveAugmentedIOException
- xIn = descContent.openStream();
- }
- catch (cssu::Exception& )
- {
- if ( ! static_cast<FileDoesNotExistFilter*>(xFilter.get())->exist())
- throw NoDescriptionException();
- throw;
- }
- if (!xIn.is())
- {
- throw cssu::Exception(
- OUSTR("Could not get XInputStream for description.xml of extension ") +
- sDescriptionUri, 0);
- }
-
- //get root node of description.xml
- cssu::Reference<css::xml::dom::XDocumentBuilder> xDocBuilder(
- xContext->getServiceManager()->createInstanceWithContext(
- OUSTR("com.sun.star.xml.dom.DocumentBuilder"),
- xContext ), cssu::UNO_QUERY);
- if (!xDocBuilder.is())
- throw css::uno::Exception(OUSTR(" Could not create service com.sun.star.xml.dom.DocumentBuilder"), 0);
-
- if (xDocBuilder->isNamespaceAware() == sal_False)
- {
- throw cssu::Exception(
- OUSTR("Service com.sun.star.xml.dom.DocumentBuilder is not namespace aware."), 0);
- }
-
- cssu::Reference<css::xml::dom::XDocument> xDoc = xDocBuilder->parse(xIn);
- if (!xDoc.is())
- {
- throw cssu::Exception(sDescriptionUri + OUSTR(" contains data which cannot be parsed. "), 0);
- }
-
- //check for proper root element and namespace
- cssu::Reference<css::xml::dom::XElement> xRoot = xDoc->getDocumentElement();
- if (!xRoot.is())
- {
- throw cssu::Exception(
- sDescriptionUri + OUSTR(" contains no root element."), 0);
- }
-
- if ( ! xRoot->getTagName().equals(OUSTR("description")))
- {
- throw cssu::Exception(
- sDescriptionUri + OUSTR(" does not contain the root element <description>."), 0);
- }
-
- m_xRoot = cssu::Reference<css::xml::dom::XNode>(
- xRoot, cssu::UNO_QUERY_THROW);
- ::rtl::OUString nsDescription = xRoot->getNamespaceURI();
-
- //check if this namespace is supported
- if ( ! nsDescription.equals(OUSTR("http://openoffice.org/extensions/description/2006")))
- {
- throw cssu::Exception(sDescriptionUri + OUSTR(" contains a root element with an unsupported namespace. "), 0);
- }
- } catch (css::uno::RuntimeException &) {
- throw;
- } catch (css::deployment::DeploymentException &) {
- throw;
- } catch (css::uno::Exception & e) {
- css::uno::Any a(cppu::getCaughtException());
- throw css::deployment::DeploymentException(
- e.Message, css::uno::Reference< css::uno::XInterface >(), a);
- }
-}
-
-ExtensionDescription::~ExtensionDescription()
-{
-}
-
-//======================================================================
-FileDoesNotExistFilter::FileDoesNotExistFilter(
- const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv):
- m_bExist(true), m_xCommandEnv(xCmdEnv)
-{}
-
-FileDoesNotExistFilter::~FileDoesNotExistFilter()
-{
-};
-
-bool FileDoesNotExistFilter::exist()
-{
- return m_bExist;
-}
- // XCommandEnvironment
-cssu::Reference<css::task::XInteractionHandler >
- FileDoesNotExistFilter::getInteractionHandler() throw (css::uno::RuntimeException)
-{
- return static_cast<css::task::XInteractionHandler*>(this);
-}
-
-cssu::Reference<css::ucb::XProgressHandler >
- FileDoesNotExistFilter::getProgressHandler() throw (css::uno::RuntimeException)
-{
- return m_xCommandEnv.is()
- ? m_xCommandEnv->getProgressHandler()
- : cssu::Reference<css::ucb::XProgressHandler>();
-}
-
-// XInteractionHandler
-//If the interaction was caused by a non-existing file which is specified in the ctor
-//of FileDoesNotExistFilter, then we do nothing
-void FileDoesNotExistFilter::handle(
- cssu::Reference<css::task::XInteractionRequest > const & xRequest )
- throw (css::uno::RuntimeException)
-{
- cssu::Any request( xRequest->getRequest() );
-
- css::ucb::InteractiveAugmentedIOException ioexc;
- if ((request>>= ioexc) && ioexc.Code == css::ucb::IOErrorCode_NOT_EXISTING )
- {
- m_bExist = false;
- return;
- }
- css::uno::Reference<css::task::XInteractionHandler> xInteraction;
- if (m_xCommandEnv.is()) {
- xInteraction = m_xCommandEnv->getInteractionHandler();
- }
- if (xInteraction.is()) {
- xInteraction->handle(xRequest);
- }
-}
-
-
-} // namespace bundle
-} // namespace backend
-} // namespace dp_registry
-
diff --git a/desktop/source/deployment/registry/package/dp_description.hxx b/desktop/source/deployment/registry/package/dp_description.hxx
deleted file mode 100644
index eb74c454af75..000000000000
--- a/desktop/source/deployment/registry/package/dp_description.hxx
+++ /dev/null
@@ -1,125 +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.
- *
- ************************************************************************/
-
-#if !defined INCLUDED_DESKTOP_EXTENSION_DESCRIPTION_HXX
-#define INCLUDED_DESKTOP_EXTENSION_DESCRIPTION_HXX
-
-
-
-#include "com/sun/star/uno/Reference.hxx"
-
-#include "com/sun/star/ucb/XCommandEnvironment.hpp"
-#include "com/sun/star/uno/XComponentContext.hpp"
-#include "com/sun/star/xml/dom/XNode.hpp"
-#include "com/sun/star/task/XInteractionHandler.hpp"
-#include "cppuhelper/implbase2.hxx"
-
-
-namespace css = ::com::sun::star;
-
-namespace dp_registry {
-namespace backend {
-namespace bundle {
-
-/**The class uses the UCB to access the description.xml file in an
- extension. The UCB must have been initialized already. It also
- requires that the extension has already be unzipped to a particular
- location.
- */
-class ExtensionDescription
-{
-public:
- /**throws an exception if the description.xml is not
- available, cannot be read, does not contain the expected data,
- or any other error occured. Therefore it shoult only be used with
- new extensions.
-
- Throws com::sun::star::uno::RuntimeException,
- com::sun::star::deployment::DeploymentException,
- dp_registry::backend::bundle::NoDescriptionException.
- */
- ExtensionDescription(
- const css::uno::Reference<css::uno::XComponentContext>& xContext,
- const ::rtl::OUString& installDir,
- const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv);
-
- ~ExtensionDescription();
-
- css::uno::Reference<css::xml::dom::XNode> getRootElement() const
- {
- return m_xRoot;
- }
-
- ::rtl::OUString getExtensionRootUrl() const
- {
- return m_sExtensionRootUrl;
- }
-
-
-private:
- css::uno::Reference<css::xml::dom::XNode> m_xRoot;
- ::rtl::OUString m_sExtensionRootUrl;
-};
-
-class NoDescriptionException
-{
-};
-
-class FileDoesNotExistFilter
- : public ::cppu::WeakImplHelper2< css::ucb::XCommandEnvironment,
- css::task::XInteractionHandler >
-
-{
- //css::uno::Reference<css::task::XInteractionHandler> m_xHandler;
- bool m_bExist;
- css::uno::Reference< css::ucb::XCommandEnvironment > m_xCommandEnv;
-
-public:
- virtual ~FileDoesNotExistFilter();
- FileDoesNotExistFilter(
- const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv);
-
- bool exist();
- // XCommandEnvironment
- virtual css::uno::Reference<css::task::XInteractionHandler > SAL_CALL
- getInteractionHandler() throw (css::uno::RuntimeException);
- virtual css::uno::Reference<css::ucb::XProgressHandler >
- SAL_CALL getProgressHandler() throw (css::uno::RuntimeException);
-
- // XInteractionHandler
- virtual void SAL_CALL handle(
- css::uno::Reference<css::task::XInteractionRequest > const & xRequest )
- throw (css::uno::RuntimeException);
-};
-
-
-} // namespace bundle
-} // namespace backend
-} // namespace dp_registry
-
-
-#endif // INCLUDED_DESKTOP_LICENSE_INTERACT_HXX
diff --git a/desktop/source/deployment/registry/package/dp_extbackenddb.cxx b/desktop/source/deployment/registry/package/dp_extbackenddb.cxx
new file mode 100644
index 000000000000..2e92a907f8fb
--- /dev/null
+++ b/desktop/source/deployment/registry/package/dp_extbackenddb.cxx
@@ -0,0 +1,135 @@
+/*************************************************************************
+ *
+ * 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_desktop.hxx"
+
+#include "rtl/string.h"
+#include "rtl/bootstrap.hxx"
+#include "cppuhelper/exc_hlp.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/xml/dom/XDocumentBuilder.hpp"
+#include "com/sun/star/xml/xpath/XXPathAPI.hpp"
+#include "dp_misc.h"
+
+#include "dp_extbackenddb.hxx"
+
+
+namespace css = ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using ::rtl::OUString;
+
+#define EXTENSION_REG_NS "http://openoffice.org/extensionmanager/extension-registry/2010"
+#define NS_PREFIX "ext"
+#define ROOT_ELEMENT_NAME "extension-backend-db"
+#define KEY_ELEMENT_NAME "extension"
+
+namespace dp_registry {
+namespace backend {
+namespace bundle {
+
+ExtensionBackendDb::ExtensionBackendDb(
+ Reference<XComponentContext> const & xContext,
+ ::rtl::OUString const & url):BackendDb(xContext, url)
+{
+
+}
+
+OUString ExtensionBackendDb::getDbNSName()
+{
+ return OUSTR(EXTENSION_REG_NS);
+}
+
+OUString ExtensionBackendDb::getNSPrefix()
+{
+ return OUSTR(NS_PREFIX);
+}
+
+OUString ExtensionBackendDb::getRootElementName()
+{
+ return OUSTR(ROOT_ELEMENT_NAME);
+}
+
+OUString ExtensionBackendDb::getKeyElementName()
+{
+ return OUSTR(KEY_ELEMENT_NAME);
+}
+
+void ExtensionBackendDb::addEntry(::rtl::OUString const & url, Data const & data)
+{
+ try{
+ Reference<css::xml::dom::XNode> extensionNodeNode = writeKeyElement(url);
+ writeVectorOfPair(
+ data.items,
+ OUSTR("extension-items"),
+ OUSTR("item"),
+ OUSTR("url"),
+ OUSTR("media-type"),
+ extensionNodeNode);
+ save();
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to write data entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+ExtensionBackendDb::Data ExtensionBackendDb::getEntry(::rtl::OUString const & url)
+{
+ try
+ {
+ ExtensionBackendDb::Data retData;
+ Reference<css::xml::dom::XNode> aNode = getKeyElement(url);
+
+ if (aNode.is())
+ {
+ retData.items =
+ readVectorOfPair(
+ aNode,
+ OUSTR("extension-items"),
+ OUSTR("item"),
+ OUSTR("url"),
+ OUSTR("media-type"));
+ }
+ return retData;
+ }
+ catch(css::uno::Exception &)
+ {
+ Any exc( ::cppu::getCaughtException() );
+ throw css::deployment::DeploymentException(
+ OUSTR("Extension Manager: failed to read data entry in backend db: ") +
+ m_urlDb, 0, exc);
+ }
+}
+
+} // namespace bundle
+} // namespace backend
+} // namespace dp_registry
+
diff --git a/desktop/source/deployment/registry/package/dp_extbackenddb.hxx b/desktop/source/deployment/registry/package/dp_extbackenddb.hxx
new file mode 100644
index 000000000000..d09fd0891a32
--- /dev/null
+++ b/desktop/source/deployment/registry/package/dp_extbackenddb.hxx
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+
+#if ! defined INCLUDED_DP_EXTBACKENDDB_HXX
+#define INCLUDED_DP_EXTBACKENDDB_HXX
+
+#include "rtl/ustring.hxx"
+#include "rtl/string.hxx"
+#include <vector>
+#include "dp_backenddb.hxx"
+
+namespace css = ::com::sun::star;
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+ namespace xml { namespace dom {
+ class XDocument;
+ class XNode;
+ }}
+ namespace xml { namespace xpath {
+ class XXPathAPI;
+ }}
+}}}
+
+namespace dp_registry {
+namespace backend {
+namespace bundle {
+
+/* The XML file stores the extensions which are currently registered.
+ They will be removed when they are revoked.
+ */
+class ExtensionBackendDb: public dp_registry::backend::BackendDb
+{
+protected:
+ virtual ::rtl::OUString getDbNSName();
+ virtual ::rtl::OUString getNSPrefix();
+ virtual ::rtl::OUString getRootElementName();
+ virtual ::rtl::OUString getKeyElementName();
+
+public:
+ struct Data
+ {
+ /* every element consists of a pair of the url to the item (jar,rdb, etc)
+ and the media type
+ */
+ ::std::vector< ::std::pair< ::rtl::OUString, ::rtl::OUString> > items;
+ typedef ::std::vector<
+ ::std::pair< ::rtl::OUString, ::rtl::OUString> >::const_iterator ITC_ITEMS;
+
+ };
+
+public:
+
+ ExtensionBackendDb( css::uno::Reference<css::uno::XComponentContext> const & xContext,
+ ::rtl::OUString const & url);
+
+ void addEntry(::rtl::OUString const & url, Data const & data);
+
+ Data getEntry(::rtl::OUString const & url);
+
+};
+
+
+
+}
+}
+}
+#endif
+
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index e45f7fb7ef73..2ad6478b665c 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -34,7 +34,6 @@
#include "dp_interact.h"
#include "dp_dependencies.hxx"
#include "dp_platform.hxx"
-#include "dp_description.hxx"
#include "dp_descriptioninfoset.hxx"
#include "dp_identifier.hxx"
#include "rtl/uri.hxx"
@@ -65,8 +64,8 @@
#include "com/sun/star/packages/manifest/XManifestWriter.hpp"
#include "com/sun/star/deployment/DependencyException.hpp"
#include "com/sun/star/deployment/LicenseException.hpp"
-#include "com/sun/star/deployment/LicenseIndividualAgreementException.hpp"
#include "com/sun/star/deployment/PlatformException.hpp"
+#include "com/sun/star/deployment/Prerequisites.hpp"
#include "com/sun/star/xml/dom/XDocumentBuilder.hpp"
#include "com/sun/star/xml/xpath/XXPathAPI.hpp"
#include "com/sun/star/deployment/XPackageManager.hpp"
@@ -74,13 +73,13 @@
#include <vector>
#include <stdio.h>
-
+#include "dp_extbackenddb.hxx"
using namespace ::dp_misc;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::ucb;
+
namespace css = ::com::sun::star;
-namespace cssu = ::com::sun::star::uno;
+
using ::rtl::OUString;
namespace dp_registry {
@@ -106,44 +105,48 @@ class BackendImpl : public ImplBaseT
Sequence< Reference<deployment::XPackage> > m_bundle;
Sequence< Reference<deployment::XPackage> > * m_pBundle;
+ ExtensionBackendDb::Data m_dbData;
+
Reference<deployment::XPackage> bindBundleItem(
OUString const & url, OUString const & mediaType,
- Reference<XCommandEnvironment> const & xCmdEnv,
+ sal_Bool bRemoved, //that is, useing data base information
+ OUString const & identifier,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv,
bool notifyDetectionError = true );
typedef ::std::vector< Reference<deployment::XPackage> > t_packagevec;
void scanBundle(
t_packagevec & bundle,
::rtl::Reference<AbortChannel> const & abortChannel,
- Reference<XCommandEnvironment> const & xCmdEnv );
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv );
void scanLegacyBundle(
t_packagevec & bundle,
OUString const & url,
::rtl::Reference<AbortChannel> const & abortChannel,
- Reference<XCommandEnvironment> const & xCmdEnv,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv,
bool skip_registration = false );
-
+ ::std::vector<Reference<deployment::XPackage> > getPackagesFromDb(
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv);
bool checkPlatform(
- css::uno::Reference< css::ucb::XCommandEnvironment > const & environment);
+ Reference<ucb::XCommandEnvironment > const & environment);
bool checkDependencies(
- css::uno::Reference< css::ucb::XCommandEnvironment > const &
+ Reference<ucb::XCommandEnvironment > const &
environment,
- ExtensionDescription const & description);
+ DescriptionInfoset const & description);
// throws css::uno::RuntimeException,
// css::deployment::DeploymentException
::sal_Bool checkLicense(
- css::uno::Reference< css::ucb::XCommandEnvironment > const & xCmdEnv,
- ExtensionDescription const& description, bool bInstalled,
- OUString const & aContextName )
- throw (css::deployment::DeploymentException,
- css::ucb::CommandFailedException,
- css::ucb::CommandAbortedException,
- css::uno::RuntimeException);
+ Reference< ucb::XCommandEnvironment > const & xCmdEnv,
+ DescriptionInfoset const & description, bool bNoLicenseChecking)
+ throw (deployment::DeploymentException,
+ ucb::CommandFailedException,
+ ucb::CommandAbortedException,
+ RuntimeException);
// @throws DeploymentException
OUString getTextFromURL(
- const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv,
+ const Reference< ucb::XCommandEnvironment >& xCmdEnv,
const OUString& licenseUrl);
DescriptionInfoset getDescriptionInfoset();
@@ -152,12 +155,13 @@ class BackendImpl : public ImplBaseT
virtual beans::Optional< beans::Ambiguous<sal_Bool> > isRegistered_(
::osl::ResettableMutexGuard & guard,
::rtl::Reference<AbortChannel> const & abortChannel,
- Reference<XCommandEnvironment> const & xCmdEnv );
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv );
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
- Reference<XCommandEnvironment> const & xCmdEnv );
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv );
virtual void SAL_CALL disposing();
@@ -169,57 +173,68 @@ class BackendImpl : public ImplBaseT
OUString const & url,
OUString const & name,
Reference<deployment::XPackageTypeInfo> const & xPackageType,
- bool legacyBundle )
- : Package( myBackend, url, name, name /* display-name */,
- xPackageType ),
- m_url_expanded( expandUnoRcUrl( url ) ),
- m_legacyBundle( legacyBundle ),
- m_pBundle( 0 )
- {}
+ bool legacyBundle,
+ bool bRemoved,
+ OUString const & identifier);
// XPackage
virtual sal_Bool SAL_CALL isBundle() throw (RuntimeException);
+
virtual Sequence< Reference<deployment::XPackage> > SAL_CALL getBundle(
Reference<task::XAbortChannel> const & xAbortChannel,
- Reference<XCommandEnvironment> const & xCmdEnv )
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
throw (deployment::DeploymentException,
- CommandFailedException, CommandAbortedException,
+ ucb::CommandFailedException,
+ ucb::CommandAbortedException,
lang::IllegalArgumentException, RuntimeException);
- virtual OUString SAL_CALL getDescription() throw (RuntimeException);
+ virtual OUString SAL_CALL getDescription()
+ throw (deployment::ExtensionRemovedException, RuntimeException);
+
virtual void SAL_CALL exportTo(
OUString const & destFolderURL, OUString const & newTitle,
sal_Int32 nameClashAction,
- Reference<XCommandEnvironment> const & xCmdEnv )
- throw (CommandFailedException, CommandAbortedException,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (deployment::ExtensionRemovedException,
+ ucb::CommandFailedException,
+ ucb::CommandAbortedException,
RuntimeException);
- virtual ::sal_Bool SAL_CALL checkPrerequisites(
- const css::uno::Reference< css::task::XAbortChannel >& xAbortChannel,
- const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv,
- ::sal_Bool bInstalled, OUString const & aContextName)
- throw (css::deployment::DeploymentException,
- css::ucb::CommandFailedException,
- css::ucb::CommandAbortedException,
- css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL checkPrerequisites(
+ const Reference< task::XAbortChannel >& xAbortChannel,
+ const Reference< ucb::XCommandEnvironment >& xCmdEnv,
+ ::sal_Bool noLicenseChecking)
+ throw (deployment::ExtensionRemovedException,
+ deployment::DeploymentException,
+ ucb::CommandFailedException,
+ ucb::CommandAbortedException,
+ RuntimeException);
virtual ::sal_Bool SAL_CALL checkDependencies(
- const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv )
- throw (css::deployment::DeploymentException,
- css::ucb::CommandFailedException,
- css::uno::RuntimeException);
+ const Reference< ucb::XCommandEnvironment >& xCmdEnv )
+ throw (deployment::DeploymentException,
+ deployment::ExtensionRemovedException,
+ ucb::CommandFailedException,
+ RuntimeException);
virtual beans::Optional<OUString> SAL_CALL getIdentifier()
throw (RuntimeException);
- virtual OUString SAL_CALL getVersion() throw (RuntimeException);
+ virtual OUString SAL_CALL getVersion()
+ throw (deployment::ExtensionRemovedException, RuntimeException);
virtual Sequence<OUString> SAL_CALL getUpdateInformationURLs()
- throw (RuntimeException);
+ throw (deployment::ExtensionRemovedException, RuntimeException);
+
+ virtual beans::StringPair SAL_CALL getPublisherInfo()
+ throw (deployment::ExtensionRemovedException, RuntimeException);
- virtual css::beans::StringPair SAL_CALL getPublisherInfo() throw (css::uno::RuntimeException);
+ virtual OUString SAL_CALL getDisplayName()
+ throw (deployment::ExtensionRemovedException, RuntimeException);
- virtual OUString SAL_CALL getDisplayName() throw (RuntimeException);
- virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL getIcon( ::sal_Bool bHighContrast ) throw (css::uno::RuntimeException);
+ virtual Reference< graphic::XGraphic > SAL_CALL
+ getIcon( ::sal_Bool bHighContrast )
+ throw (deployment::ExtensionRemovedException,
+ RuntimeException);
};
friend class PackageImpl;
@@ -228,10 +243,17 @@ class BackendImpl : public ImplBaseT
const Reference<deployment::XPackageTypeInfo> m_xLegacyBundleTypeInfo;
Sequence< Reference<deployment::XPackageTypeInfo> > m_typeInfos;
+ std::auto_ptr<ExtensionBackendDb> m_backendDb;
+
+ void addDataToDb(OUString const & url, ExtensionBackendDb::Data const & data);
+ ExtensionBackendDb::Data readDataFromDb(OUString const & url);
+ void deleteDataFromDb(OUString const & url);
+
// PackageRegistryBackend
virtual Reference<deployment::XPackage> bindPackage_(
OUString const & url, OUString const & mediaType,
- Reference<XCommandEnvironment> const & xCmdEnv );
+ sal_Bool bRemoved, OUString const & identifier,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv );
virtual void SAL_CALL disposing();
@@ -287,10 +309,18 @@ BackendImpl::BackendImpl(
m_xBundleTypeInfo->getShortDescription(),
RID_IMG_DEF_PACKAGE_BUNDLE,
RID_IMG_DEF_PACKAGE_BUNDLE_HC ) ),
- m_typeInfos( 2 )
+ m_typeInfos(2)
{
m_typeInfos[ 0 ] = m_xBundleTypeInfo;
m_typeInfos[ 1 ] = m_xLegacyBundleTypeInfo;
+
+ if (!transientMode())
+ {
+ OUString dbFile = makeURL(getCachePath(), getImplementationName());
+ dbFile = makeURL(dbFile, OUSTR("backenddb.xml"));
+ m_backendDb.reset(
+ new ExtensionBackendDb(getComponentContext(), dbFile));
+ }
}
//______________________________________________________________________________
@@ -333,7 +363,8 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
//______________________________________________________________________________
Reference<deployment::XPackage> BackendImpl::bindPackage_(
OUString const & url, OUString const & mediaType_,
- Reference<XCommandEnvironment> const & xCmdEnv )
+ sal_Bool bRemoved, OUString const & identifier,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
{
OUString mediaType( mediaType_ );
if (mediaType.getLength() == 0)
@@ -342,17 +373,32 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
::ucbhelper::Content ucbContent;
if (create_ucb_content( &ucbContent, url, xCmdEnv ))
{
- const OUString title( ucbContent.getPropertyValue(
- StrTitle::get() ).get<OUString>() );
- if (title.endsWithIgnoreAsciiCaseAsciiL(
- RTL_CONSTASCII_STRINGPARAM(".oxt") ) ||
- title.endsWithIgnoreAsciiCaseAsciiL(
- RTL_CONSTASCII_STRINGPARAM(".uno.pkg") ))
- mediaType = OUSTR("application/vnd.sun.star.package-bundle");
- else if (title.endsWithIgnoreAsciiCaseAsciiL(
- RTL_CONSTASCII_STRINGPARAM(".zip") ))
- mediaType =
- OUSTR("application/vnd.sun.star.legacy-package-bundle");
+ if (ucbContent.isFolder())
+ {
+ //Every .oxt, uno.pkg file must contain a META-INF folder
+ ::ucbhelper::Content metaInfContent;
+ if (create_ucb_content(
+ &metaInfContent, makeURL( url, OUSTR("META-INF") ),
+ xCmdEnv, false /* no throw */ ))
+ {
+ mediaType = OUSTR("application/vnd.sun.star.package-bundle");
+ }
+ //No support of legacy bundles, because every folder could be one.
+ }
+ else
+ {
+ const OUString title( ucbContent.getPropertyValue(
+ StrTitle::get() ).get<OUString>() );
+ if (title.endsWithIgnoreAsciiCaseAsciiL(
+ RTL_CONSTASCII_STRINGPARAM(".oxt") ) ||
+ title.endsWithIgnoreAsciiCaseAsciiL(
+ RTL_CONSTASCII_STRINGPARAM(".uno.pkg") ))
+ mediaType = OUSTR("application/vnd.sun.star.package-bundle");
+ else if (title.endsWithIgnoreAsciiCaseAsciiL(
+ RTL_CONSTASCII_STRINGPARAM(".zip") ))
+ mediaType =
+ OUSTR("application/vnd.sun.star.legacy-package-bundle");
+ }
}
if (mediaType.getLength() == 0)
throw lang::IllegalArgumentException(
@@ -366,19 +412,26 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
{
if (type.EqualsIgnoreCaseAscii("application"))
{
- ::ucbhelper::Content ucbContent( url, xCmdEnv );
+
+ //In case a XPackage is created for a removed extension, we cannot
+ //obtain the name
+ OUString name;
+ if (!bRemoved)
+ {
+ ::ucbhelper::Content ucbContent( url, xCmdEnv );
+ name = ucbContent.getPropertyValue(
+ StrTitle::get() ).get<OUString>();
+ }
if (subType.EqualsIgnoreCaseAscii("vnd.sun.star.package-bundle")) {
return new PackageImpl(
- this, url, ucbContent.getPropertyValue(
- StrTitle::get() ).get<OUString>(),
- m_xBundleTypeInfo, false );
+ this, url, name, m_xBundleTypeInfo, false, bRemoved,
+ identifier);
}
else if (subType.EqualsIgnoreCaseAscii(
"vnd.sun.star.legacy-package-bundle")) {
return new PackageImpl(
- this, url, ucbContent.getPropertyValue(
- StrTitle::get() ).get<OUString>(),
- m_xLegacyBundleTypeInfo, true );
+ this, url, name, m_xLegacyBundleTypeInfo, true, bRemoved,
+ identifier);
}
}
}
@@ -388,8 +441,47 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
static_cast<sal_Int16>(-1) );
}
+void BackendImpl::addDataToDb(
+ OUString const & url, ExtensionBackendDb::Data const & data)
+{
+ if (m_backendDb.get())
+ m_backendDb->addEntry(url, data);
+}
+
+ExtensionBackendDb::Data BackendImpl::readDataFromDb(
+ OUString const & url)
+{
+ ExtensionBackendDb::Data data;
+ if (m_backendDb.get())
+ data = m_backendDb->getEntry(url);
+ return data;
+}
+
+void BackendImpl::deleteDataFromDb(OUString const & url)
+{
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
+}
+
+
//##############################################################################
+BackendImpl::PackageImpl::PackageImpl(
+ ::rtl::Reference<PackageRegistryBackend> const & myBackend,
+ OUString const & url,
+ OUString const & name,
+ Reference<deployment::XPackageTypeInfo> const & xPackageType,
+ bool legacyBundle, bool bRemoved, OUString const & identifier)
+ : Package( myBackend, url, name, name /* display-name */,
+ xPackageType, bRemoved, identifier),
+ m_url_expanded( expandUnoRcUrl( url ) ),
+ m_legacyBundle( legacyBundle ),
+ m_pBundle( 0 )
+{
+ if (bRemoved)
+ m_dbData = getMyBackend()->readDataFromDb(url);
+}
+
BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
{
BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get());
@@ -422,22 +514,23 @@ beans::Optional< beans::Ambiguous<sal_Bool> >
BackendImpl::PackageImpl::isRegistered_(
::osl::ResettableMutexGuard &,
::rtl::Reference<AbortChannel> const & abortChannel,
- Reference<XCommandEnvironment> const & xCmdEnv )
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
{
+ //In case the object was created for a removed extension (m_bRemoved = true)
+ //but the extension is not registered, then bundle will be empty. Then
+ //the return value will be Optional<...>.IsPresent= false. Althoug this is
+ //not true, this does not matter. Then registerPackage or revokePackage
+ //would never be called for the items. But since the extension is removed
+ //and not registered anyway, this does not matter.
const Sequence< Reference<deployment::XPackage> > bundle(
getBundle( abortChannel.get(), xCmdEnv ) );
+
bool reg = false;
bool present = false;
bool ambig = false;
for ( sal_Int32 pos = bundle.getLength(); pos--; )
{
Reference<deployment::XPackage> const & xPackage = bundle[ pos ];
- //disregard executable (application/vnd.sun.star.executable)
- //it will not be disabled/enabled.
- OUString sType = xPackage->getPackageType()->getMediaType();
- if (sType.equals(OUSTR("application/vnd.sun.star.executable")))
- continue;
-
Reference<task::XAbortChannel> xSubAbortChannel(
xPackage->createAbortChannel() );
AbortChannel::Chain chain( abortChannel, xSubAbortChannel );
@@ -495,23 +588,7 @@ OUString BackendImpl::PackageImpl::getTextFromURL(
DescriptionInfoset BackendImpl::PackageImpl::getDescriptionInfoset()
{
- css::uno::Reference< css::xml::dom::XNode > root;
- try {
- root =
- ExtensionDescription(
- getMyBackend()->getComponentContext(), m_url_expanded,
- css::uno::Reference< css::ucb::XCommandEnvironment >()).
- getRootElement();
- } catch (NoDescriptionException &) {
- } catch (css::deployment::DeploymentException & e) {
- throw RuntimeException(
- (OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.deployment.DeploymentException: ")) +
- e.Message),
- static_cast< OWeakObject * >(this));
- }
- return DescriptionInfoset(getMyBackend()->getComponentContext(), root);
+ return dp_misc::getDescriptionInfoset(m_url_expanded);
}
bool BackendImpl::PackageImpl::checkPlatform(
@@ -546,14 +623,11 @@ bool BackendImpl::PackageImpl::checkPlatform(
bool BackendImpl::PackageImpl::checkDependencies(
css::uno::Reference< css::ucb::XCommandEnvironment > const & environment,
- ExtensionDescription const & description)
+ DescriptionInfoset const & description)
{
css::uno::Sequence< css::uno::Reference< css::xml::dom::XElement > >
- unsatisfied(
- dp_misc::Dependencies::check(
- DescriptionInfoset(
- getMyBackend()->getComponentContext(),
- description.getRootElement())));
+ unsatisfied(dp_misc::Dependencies::check(description));
+
if (unsatisfied.getLength() == 0) {
return true;
} else {
@@ -575,7 +649,7 @@ bool BackendImpl::PackageImpl::checkDependencies(
::sal_Bool BackendImpl::PackageImpl::checkLicense(
css::uno::Reference< css::ucb::XCommandEnvironment > const & xCmdEnv,
- ExtensionDescription const & desc, bool bInstalled, OUString const & aContextName)
+ DescriptionInfoset const & info, bool alreadyInstalled)
throw (css::deployment::DeploymentException,
css::ucb::CommandFailedException,
css::ucb::CommandAbortedException,
@@ -583,7 +657,6 @@ bool BackendImpl::PackageImpl::checkDependencies(
{
try
{
- DescriptionInfoset info = getDescriptionInfoset();
::boost::optional<SimpleLicenseAttributes> simplLicAttr
= info.getSimpleLicenseAttributes();
if (! simplLicAttr)
@@ -595,7 +668,7 @@ bool BackendImpl::PackageImpl::checkDependencies(
if (sLic.getLength() == 0)
throw css::deployment::DeploymentException(
OUSTR("Could not obtain path to license. Possible error in description.xml"), 0, Any());
- OUString sHref = desc.getExtensionRootUrl() + OUSTR("/") + sLic;
+ OUString sHref = m_url_expanded + OUSTR("/") + sLic;
OUString sLicense = getTextFromURL(xCmdEnv, sHref);
////determine who has to agree to the license
//check correct value for attribute
@@ -603,41 +676,21 @@ bool BackendImpl::PackageImpl::checkDependencies(
throw css::deployment::DeploymentException(
OUSTR("Could not obtain attribute simple-lincense@accept-by or it has no valid value"), 0, Any());
- //If if @accept-by="user" then every user needs to accept the license before it can be installed.
- //Therefore we must prevent the installation as shared extension unless suppress-if-required="true"
- OSL_ASSERT(aContextName.getLength());
- if (simplLicAttr->acceptBy.equals(OUSTR("user")) && aContextName.equals(OUSTR("shared")))
- {
- css::deployment::LicenseIndividualAgreementException
- exc = css::deployment::LicenseIndividualAgreementException(
- OUString(), 0, m_name, simplLicAttr->suppressIfRequired);
-
- bool approve = false;
- bool abort = false;
- if (! interactContinuation(
- Any(exc), task::XInteractionApprove::static_type(), xCmdEnv, &approve, &abort ))
- throw css::deployment::DeploymentException(
- OUSTR("Could not interact with user."), 0, Any());
- if (abort == true)
- return false;
-
- //If the unopkg --suppress-license was used and simplLicAttr->suppressIfRequired == true,
- //then the user implicitely accepts the license
- }
//Only use interaction if there is no version of this extension already installed
//and the suppress-on-update flag is not set for the new extension
- // bInstalled | bSuppressOnUpdate | show license
+ // alreadyInstalled | bSuppressOnUpdate | show license
//----------------------------------------
// 0 | 0 | 1
// 0 | 1 | 1
// 1 | 0 | 1
// 1 | 1 | 0
- if ( !(bInstalled && simplLicAttr->suppressOnUpdate))
+ if ( !(alreadyInstalled && simplLicAttr->suppressOnUpdate))
{
css::deployment::LicenseException licExc(
- OUString(), 0, m_name, sLicense, simplLicAttr->suppressIfRequired);
+ OUString(), 0, getDisplayName(), sLicense,
+ simplLicAttr->acceptBy);
bool approve = false;
bool abort = false;
if (! interactContinuation(
@@ -669,69 +722,88 @@ bool BackendImpl::PackageImpl::checkDependencies(
}
}
-::sal_Bool BackendImpl::PackageImpl::checkPrerequisites(
+::sal_Int32 BackendImpl::PackageImpl::checkPrerequisites(
const css::uno::Reference< css::task::XAbortChannel >&,
const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv,
- sal_Bool bInstalled, OUString const & aContextName)
+ sal_Bool alreadyInstalled)
throw (css::deployment::DeploymentException,
- css::ucb::CommandFailedException,
- css::ucb::CommandAbortedException,
- css::uno::RuntimeException)
+ css::deployment::ExtensionRemovedException,
+ css::ucb::CommandFailedException,
+ css::ucb::CommandAbortedException,
+ css::uno::RuntimeException)
{
- std::auto_ptr<ExtensionDescription> spDescription;
- try {
- spDescription.reset(
- new ExtensionDescription(
- getMyBackend()->getComponentContext(),
- m_url_expanded,
- xCmdEnv));
- } catch (NoDescriptionException& ) {
- return sal_True;
- }
- return checkPlatform(xCmdEnv)
- && checkDependencies(xCmdEnv, *spDescription)
- && checkLicense(xCmdEnv, *spDescription, bInstalled, aContextName);
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
+ DescriptionInfoset info = getDescriptionInfoset();
+ if (!info.hasDescription())
+ return 0;
+
+ //always return LICENSE as long as the user did not accept the license
+ //so that XExtensonManager::checkPrerequisitesAndEnable will again
+ //check the license
+ if (!checkPlatform(xCmdEnv))
+ return deployment::Prerequisites::PLATFORM |
+ deployment::Prerequisites::LICENSE;
+ else if(!checkDependencies(xCmdEnv, info))
+ return deployment::Prerequisites::DEPENDENCIES |
+ deployment::Prerequisites::LICENSE;
+ else if(!checkLicense(xCmdEnv, info, alreadyInstalled))
+ return deployment::Prerequisites::LICENSE;
+ else
+ return 0;
}
::sal_Bool BackendImpl::PackageImpl::checkDependencies(
const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv )
- throw (css::deployment::DeploymentException,
- css::ucb::CommandFailedException,
- css::uno::RuntimeException)
+ throw (deployment::DeploymentException,
+ deployment::ExtensionRemovedException,
+ ucb::CommandFailedException,
+ RuntimeException)
{
- std::auto_ptr<ExtensionDescription> spDescription;
- try {
- spDescription.reset(
- new ExtensionDescription( getMyBackend()->getComponentContext(), m_url_expanded, xCmdEnv ));
- } catch (NoDescriptionException& ) {
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
+ DescriptionInfoset info = getDescriptionInfoset();
+ if (!info.hasDescription())
return sal_True;
- }
- return checkDependencies(xCmdEnv, *spDescription);
+
+ return checkDependencies(xCmdEnv, info);
}
beans::Optional<OUString> BackendImpl::PackageImpl::getIdentifier()
throw (RuntimeException)
{
+ OUString identifier;
+ if (m_bRemoved)
+ identifier = m_identifier;
+ else
+ identifier = dp_misc::generateIdentifier(
+ getDescriptionInfoset().getIdentifier(), m_name);
+
return beans::Optional<OUString>(
- true,
- dp_misc::generateIdentifier(
- getDescriptionInfoset().getIdentifier(), m_name));
+ true, identifier);
}
-OUString BackendImpl::PackageImpl::getVersion() throw (RuntimeException)
+OUString BackendImpl::PackageImpl::getVersion()
+ throw (deployment::ExtensionRemovedException, RuntimeException)
{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
return getDescriptionInfoset().getVersion();
}
Sequence<OUString> BackendImpl::PackageImpl::getUpdateInformationURLs()
- throw (RuntimeException)
+ throw (deployment::ExtensionRemovedException, RuntimeException)
{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
return getDescriptionInfoset().getUpdateInformationUrls();
}
beans::StringPair BackendImpl::PackageImpl::getPublisherInfo()
- throw (RuntimeException)
+ throw (deployment::ExtensionRemovedException, RuntimeException)
{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
::std::pair< OUString, OUString > aInfo = getDescriptionInfoset().getLocalizedPublisherNameAndURL();
beans::StringPair aStrPair( aInfo.first, aInfo.second );
return aStrPair;
@@ -739,8 +811,11 @@ beans::StringPair BackendImpl::PackageImpl::getPublisherInfo()
//______________________________________________________________________________
uno::Reference< graphic::XGraphic > BackendImpl::PackageImpl::getIcon( sal_Bool bHighContrast )
- throw ( RuntimeException )
+ throw (deployment::ExtensionRemovedException, RuntimeException )
{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
+
uno::Reference< graphic::XGraphic > xGraphic;
OUString aIconURL = getDescriptionInfoset().getIconURL( bHighContrast );
@@ -770,14 +845,16 @@ uno::Reference< graphic::XGraphic > BackendImpl::PackageImpl::getIcon( sal_Bool
void BackendImpl::PackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
- Reference<XCommandEnvironment> const & xCmdEnv )
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
{
const Sequence< Reference<deployment::XPackage> > bundle(
getBundle( abortChannel.get(), xCmdEnv ) );
if (doRegisterPackage)
{
+ ExtensionBackendDb::Data data;
const sal_Int32 len = bundle.getLength();
for ( sal_Int32 pos = 0; pos < len; ++pos )
{
@@ -787,12 +864,12 @@ void BackendImpl::PackageImpl::processPackage_(
xPackage->createAbortChannel() );
AbortChannel::Chain chain( abortChannel, xSubAbortChannel );
try {
- xPackage->registerPackage( xSubAbortChannel, xCmdEnv );
+ xPackage->registerPackage( startup, xSubAbortChannel, xCmdEnv );
}
catch (RuntimeException &) {
throw;
}
- catch (CommandAbortedException &) {
+ catch (ucb::CommandAbortedException &) {
throw;
}
catch (Exception &) {
@@ -830,7 +907,7 @@ void BackendImpl::PackageImpl::processPackage_(
catch (RuntimeException &) {
throw;
}
- catch (CommandAbortedException &) {
+ catch (ucb::CommandAbortedException &) {
throw;
}
catch (Exception &) {
@@ -847,7 +924,7 @@ void BackendImpl::PackageImpl::processPackage_(
deployment::DeploymentException dpExc;
if (exc >>= dpExc) {
- throw CommandFailedException(
+ throw ucb::CommandFailedException(
dpExc.Message, dpExc.Context, dpExc.Cause );
}
else {
@@ -855,7 +932,11 @@ void BackendImpl::PackageImpl::processPackage_(
::cppu::throwException(exc);
}
}
+ data.items.push_back(
+ ::std::make_pair(xPackage->getURL(),
+ xPackage->getPackageType()->getMediaType()));
}
+ getMyBackend()->addDataToDb(getURL(), data);
}
else
{
@@ -873,7 +954,7 @@ void BackendImpl::PackageImpl::processPackage_(
catch (RuntimeException &) {
throw;
}
- catch (CommandAbortedException &) {
+ catch (ucb::CommandAbortedException &) {
throw;
}
catch (Exception &) {
@@ -899,12 +980,17 @@ void BackendImpl::PackageImpl::processPackage_(
// selected
}
}
+ getMyBackend()->deleteDataFromDb(getURL());
}
}
//______________________________________________________________________________
-OUString BackendImpl::PackageImpl::getDescription() throw (RuntimeException)
+OUString BackendImpl::PackageImpl::getDescription()
+ throw (deployment::ExtensionRemovedException, RuntimeException)
{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
+
const OUString sRelativeURL(getDescriptionInfoset().getLocalizedDescriptionURL());
OUString sDescription;
if (sRelativeURL.getLength())
@@ -925,9 +1011,14 @@ OUString BackendImpl::PackageImpl::getDescription() throw (RuntimeException)
//______________________________________________________________________________
void BackendImpl::PackageImpl::exportTo(
OUString const & destFolderURL, OUString const & newTitle,
- sal_Int32 nameClashAction, Reference<XCommandEnvironment> const & xCmdEnv )
- throw (CommandFailedException, CommandAbortedException, RuntimeException)
+ sal_Int32 nameClashAction, Reference<ucb::XCommandEnvironment> const & xCmdEnv )
+ throw (ucb::CommandFailedException,
+ deployment::ExtensionRemovedException,
+ ucb::CommandAbortedException, RuntimeException)
{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
+
::ucbhelper::Content sourceContent( m_url_expanded, xCmdEnv );
OUString title(newTitle);
if (title.getLength() == 0)
@@ -937,25 +1028,25 @@ void BackendImpl::PackageImpl::exportTo(
rtl_UriEncodeIgnoreEscapes,
RTL_TEXTENCODING_UTF8 ) ) );
- if (nameClashAction == NameClash::ASK)
+ if (nameClashAction == ucb::NameClash::ASK)
{
if (create_ucb_content(
0, destURL, xCmdEnv, false /* no throw */ )) {
bool replace = false, abort = false;
if (! interactContinuation(
- Any( NameClashResolveRequest(
+ Any( ucb::NameClashResolveRequest(
OUSTR("file already exists: ") + title,
static_cast<OWeakObject *>(this),
task::InteractionClassification_QUERY,
destFolderURL, title, OUString() ) ),
- XInteractionReplaceExistingData::static_type(), xCmdEnv,
+ ucb::XInteractionReplaceExistingData::static_type(), xCmdEnv,
&replace, &abort ) || !replace) {
return;
}
}
}
- else if (nameClashAction != NameClash::OVERWRITE) {
- throw CommandFailedException(
+ else if (nameClashAction != ucb::NameClash::OVERWRITE) {
+ throw ucb::CommandFailedException(
OUSTR("unsupported nameClashAction!"),
static_cast<OWeakObject *>(this), Any() );
}
@@ -981,11 +1072,11 @@ void BackendImpl::PackageImpl::exportTo(
while (xResultSet->next())
{
::ucbhelper::Content subContent(
- Reference<XContentAccess>(
+ Reference<ucb::XContentAccess>(
xResultSet, UNO_QUERY_THROW )->queryContent(), xCmdEnv );
if (! destFolderContent.transferContent(
subContent, ::ucbhelper::InsertOperation_COPY,
- OUString(), NameClash::OVERWRITE ))
+ OUString(), ucb::NameClash::OVERWRITE ))
throw RuntimeException( OUSTR("UCB transferContent() failed!"),
static_cast<OWeakObject *>(this) );
progress.update( Any() ); // animating progress bar
@@ -1093,7 +1184,7 @@ void BackendImpl::PackageImpl::exportTo(
if (! metainfFolderContent.transferContent(
manifestContent, ::ucbhelper::InsertOperation_COPY,
- OUString(), NameClash::OVERWRITE ))
+ OUString(), ucb::NameClash::OVERWRITE ))
throw RuntimeException( OUSTR("UCB transferContent() failed!"),
static_cast<OWeakObject *>(this) );
}
@@ -1102,7 +1193,7 @@ void BackendImpl::PackageImpl::exportTo(
try {
destFolderContent.executeCommand( OUSTR("flush"), Any() );
}
- catch (UnsupportedCommandException &) {
+ catch (ucb::UnsupportedCommandException &) {
}
}
@@ -1115,67 +1206,76 @@ sal_Bool BackendImpl::PackageImpl::isBundle() throw (RuntimeException)
//______________________________________________________________________________
Sequence< Reference<deployment::XPackage> > BackendImpl::PackageImpl::getBundle(
Reference<task::XAbortChannel> const & xAbortChannel,
- Reference<XCommandEnvironment> const & xCmdEnv )
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
throw (deployment::DeploymentException,
- CommandFailedException, CommandAbortedException,
+ ucb::CommandFailedException, ucb::CommandAbortedException,
lang::IllegalArgumentException, RuntimeException)
{
Sequence< Reference<deployment::XPackage> > * pBundle = m_pBundle;
if (pBundle == 0)
{
t_packagevec bundle;
- try {
- if (m_legacyBundle)
- {
- // .zip legacy packages allow script.xlb, dialog.xlb in bundle
- // root folder:
- OUString mediaType;
- // probe for script.xlb:
- if (create_ucb_content(
- 0, makeURL( m_url_expanded, OUSTR("script.xlb") ),
- xCmdEnv, false /* no throw */ )) {
- mediaType = OUSTR("application/vnd.sun.star.basic-library");
+ if (m_bRemoved)
+ {
+ bundle = getPackagesFromDb(xCmdEnv);
+ }
+ else
+ {
+ try {
+ if (m_legacyBundle)
+ {
+ // .zip legacy packages allow script.xlb, dialog.xlb in bundle
+ // root folder:
+ OUString mediaType;
+ // probe for script.xlb:
+ if (create_ucb_content(
+ 0, makeURL( m_url_expanded, OUSTR("script.xlb") ),
+ xCmdEnv, false /* no throw */ )) {
+ mediaType = OUSTR("application/vnd.sun.star.basic-library");
+ }
+ // probe for dialog.xlb:
+ else if (create_ucb_content(
+ 0, makeURL( m_url_expanded, OUSTR("dialog.xlb") ),
+ xCmdEnv, false /* no throw */ ))
+ mediaType = OUSTR("application/vnd.sun.star."
+ "dialog-library");
+
+ if (mediaType.getLength() > 0) {
+ const Reference<deployment::XPackage> xPackage(
+ bindBundleItem( getURL(), mediaType, false, OUString(),
+ xCmdEnv ) );
+ if (xPackage.is())
+ bundle.push_back( xPackage );
+ // continue scanning:
+ }
+ scanLegacyBundle( bundle, getURL(),
+ AbortChannel::get(xAbortChannel), xCmdEnv );
}
- // probe for dialog.xlb:
- else if (create_ucb_content(
- 0, makeURL( m_url_expanded, OUSTR("dialog.xlb") ),
- xCmdEnv, false /* no throw */ ))
- mediaType = OUSTR("application/vnd.sun.star."
- "dialog-library");
-
- if (mediaType.getLength() > 0) {
- const Reference<deployment::XPackage> xPackage(
- bindBundleItem( getURL(), mediaType, xCmdEnv ) );
- if (xPackage.is())
- bundle.push_back( xPackage );
- // continue scanning:
+ else
+ {
+ // .oxt:
+ scanBundle( bundle, AbortChannel::get(xAbortChannel), xCmdEnv );
}
- scanLegacyBundle( bundle, getURL(),
- AbortChannel::get(xAbortChannel), xCmdEnv );
+
}
- else
- {
- // .oxt:
- scanBundle( bundle, AbortChannel::get(xAbortChannel), xCmdEnv );
+ catch (RuntimeException &) {
+ throw;
+ }
+ catch (ucb::CommandFailedException &) {
+ throw;
+ }
+ catch (ucb::CommandAbortedException &) {
+ throw;
+ }
+ catch (deployment::DeploymentException &) {
+ throw;
+ }
+ catch (Exception &) {
+ Any exc( ::cppu::getCaughtException() );
+ throw deployment::DeploymentException(
+ OUSTR("error scanning bundle: ") + getURL(),
+ static_cast<OWeakObject *>(this), exc );
}
- }
- catch (RuntimeException &) {
- throw;
- }
- catch (CommandFailedException &) {
- throw;
- }
- catch (CommandAbortedException &) {
- throw;
- }
- catch (deployment::DeploymentException &) {
- throw;
- }
- catch (Exception &) {
- Any exc( ::cppu::getCaughtException() );
- throw deployment::DeploymentException(
- OUSTR("error scanning bundle: ") + getURL(),
- static_cast<OWeakObject *>(this), exc );
}
// sort: schema before config data, typelibs before components:
@@ -1242,7 +1342,8 @@ inline bool isBundle_( OUString const & mediaType )
//______________________________________________________________________________
Reference<deployment::XPackage> BackendImpl::PackageImpl::bindBundleItem(
OUString const & url, OUString const & mediaType,
- Reference<XCommandEnvironment> const & xCmdEnv,
+ sal_Bool bRemoved, OUString const & identifier,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv,
bool notifyDetectionError )
{
// ignore any nested bundles:
@@ -1252,13 +1353,13 @@ Reference<deployment::XPackage> BackendImpl::PackageImpl::bindBundleItem(
Reference<deployment::XPackage>xPackage;
try {
xPackage.set( getMyBackend()->m_xRootRegistry->bindPackage(
- url, mediaType, xCmdEnv ) );
+ url, mediaType, bRemoved, identifier, xCmdEnv ) );
OSL_ASSERT( xPackage.is() );
}
catch (RuntimeException &) {
throw;
}
- catch (CommandFailedException &) {
+ catch (ucb::CommandFailedException &) {
// ignore already handled error
}
catch (Exception &) {
@@ -1291,7 +1392,7 @@ Reference<deployment::XPackage> BackendImpl::PackageImpl::bindBundleItem(
void BackendImpl::PackageImpl::scanBundle(
t_packagevec & bundle,
::rtl::Reference<AbortChannel> const & abortChannel,
- Reference<XCommandEnvironment> const & xCmdEnv )
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv )
{
OSL_ASSERT( !m_legacyBundle );
@@ -1303,7 +1404,7 @@ void BackendImpl::PackageImpl::scanBundle(
{
OSL_ENSURE( 0, "### missing META-INF/manifest.xml file!" );
return;
-}
+ }
const lang::Locale officeLocale = getOfficeLocale();
@@ -1388,7 +1489,7 @@ void BackendImpl::PackageImpl::scanBundle(
if (bundle.end() == std::find_if(bundle.begin(), bundle.end(), XPackage_eq(url)))
{
const Reference<deployment::XPackage> xPackage(
- bindBundleItem( url, mediaType, xCmdEnv ) );
+ bindBundleItem( url, mediaType, false, OUString(), xCmdEnv ) );
if (xPackage.is())
bundle.push_back( xPackage );
}
@@ -1427,7 +1528,7 @@ void BackendImpl::PackageImpl::scanLegacyBundle(
t_packagevec & bundle,
OUString const & url,
::rtl::Reference<AbortChannel> const & abortChannel,
- Reference<XCommandEnvironment> const & xCmdEnv,
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv,
bool skip_registration )
{
::ucbhelper::Content ucbContent( url, xCmdEnv );
@@ -1463,8 +1564,8 @@ void BackendImpl::PackageImpl::scanLegacyBundle(
OUString mediaType;
const Reference<deployment::XPackage> xPackage(
- bindBundleItem( path, OUString() /* detect */, xCmdEnv,
- false /* ignore detection errors */ ) );
+ bindBundleItem( path, OUString() /* detect */, false, OUString(),
+ xCmdEnv, false /* ignore detection errors */ ) );
if (xPackage.is()) {
const Reference<deployment::XPackageTypeInfo> xPackageType(
xPackage->getPackageType() );
@@ -1499,8 +1600,12 @@ void BackendImpl::PackageImpl::scanLegacyBundle(
}
}
-OUString BackendImpl::PackageImpl::getDisplayName() throw (RuntimeException)
+OUString BackendImpl::PackageImpl::getDisplayName()
+ throw (deployment::ExtensionRemovedException, RuntimeException)
{
+ if (m_bRemoved)
+ throw deployment::ExtensionRemovedException();
+
OUString sName = getDescriptionInfoset().getLocalizedDisplayName();
if (sName.getLength() == 0)
return m_displayName;
@@ -1508,6 +1613,24 @@ OUString BackendImpl::PackageImpl::getDisplayName() throw (RuntimeException)
return sName;
}
+::std::vector<Reference<deployment::XPackage> >
+BackendImpl::PackageImpl::getPackagesFromDb(
+ Reference<ucb::XCommandEnvironment> const & xCmdEnv)
+{
+ ::std::vector<Reference<deployment::XPackage> > retVector;
+
+ typedef ::std::vector< ::std::pair<OUString, OUString> >::const_iterator ITC;
+ for (ITC i = m_dbData.items.begin(); i != m_dbData.items.end(); i++)
+ {
+ Reference<deployment::XPackage> xExtension =
+ bindBundleItem(i->first, i->second, true, m_identifier, xCmdEnv);
+ OSL_ASSERT(xExtension.is());
+ retVector.push_back(xExtension);
+ }
+
+ return retVector;
+}
+
} // anon namespace
//==============================================================================
diff --git a/desktop/source/deployment/registry/package/makefile.mk b/desktop/source/deployment/registry/package/makefile.mk
index ccadc2070301..203ce176d289 100644
--- a/desktop/source/deployment/registry/package/makefile.mk
+++ b/desktop/source/deployment/registry/package/makefile.mk
@@ -41,7 +41,7 @@ INCPRE += ..$/..$/inc
SLOFILES = \
$(SLO)$/dp_package.obj \
- $(SLO)$/dp_description.obj
+ $(SLO)$/dp_extbackenddb.obj
.INCLUDE : ..$/..$/target.pmk
.INCLUDE : target.mk
diff --git a/desktop/source/deployment/registry/script/dp_script.cxx b/desktop/source/deployment/registry/script/dp_script.cxx
index 4af0cbb84130..edeae256cbaf 100644
--- a/desktop/source/deployment/registry/script/dp_script.cxx
+++ b/desktop/source/deployment/registry/script/dp_script.cxx
@@ -39,12 +39,12 @@
#include "comphelper/servicedecl.hxx"
#include "svl/inettype.hxx"
#include "com/sun/star/util/XUpdatable.hpp"
-#include "com/sun/star/script/XLibraryContainer.hpp"
+#include "com/sun/star/script/XLibraryContainer3.hpp"
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/util/XMacroExpander.hpp>
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
-#include <com/sun/star/uri/XVndSunStarExpandUrl.hpp>
#include <memory>
+#include "dp_scriptbackenddb.hxx"
using namespace ::dp_misc;
using namespace ::com::sun::star;
@@ -80,6 +80,7 @@ class BackendImpl : public t_helper
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
@@ -88,24 +89,30 @@ class BackendImpl : public t_helper
::rtl::Reference<BackendImpl> const & myBackend,
OUString const & url,
Reference<XCommandEnvironment> const &xCmdEnv,
- OUString const & scriptURL, OUString const & dialogURL );
+ OUString const & scriptURL, OUString const & dialogURL,
+ bool bRemoved, OUString const & identifier);
};
friend class PackageImpl;
// PackageRegistryBackend
virtual Reference<deployment::XPackage> bindPackage_(
OUString const & url, OUString const & mediaType,
+ sal_Bool bRemoved, OUString const & identifier,
Reference<XCommandEnvironment> const & xCmdEnv );
- rtl::OUString getRegisteredFlagFileURL( Reference< deployment::XPackage > xPackage );
- rtl::OUString expandURL( const rtl::OUString& aURL );
- Reference< ucb::XSimpleFileAccess > getFileAccess( void );
- Reference< ucb::XSimpleFileAccess > m_xSFA;
+ void addDataToDb(OUString const & url);
+ void deleteDataFromDb(OUString const & url);
+ bool isRegisteredInDb(OUString const & url);
+
+
+
+// Reference< ucb::XSimpleFileAccess > getFileAccess( void );
+// Reference< ucb::XSimpleFileAccess > m_xSFA;
const Reference<deployment::XPackageTypeInfo> m_xBasicLibTypeInfo;
const Reference<deployment::XPackageTypeInfo> m_xDialogLibTypeInfo;
Sequence< Reference<deployment::XPackageTypeInfo> > m_typeInfos;
-
+ std::auto_ptr<ScriptBackendDb> m_backendDb;
public:
BackendImpl( Sequence<Any> const & args,
Reference<XComponentContext> const & xComponentContext );
@@ -123,11 +130,12 @@ BackendImpl::PackageImpl::PackageImpl(
::rtl::Reference<BackendImpl> const & myBackend,
OUString const & url,
Reference<XCommandEnvironment> const &xCmdEnv,
- OUString const & scriptURL, OUString const & dialogURL )
+ OUString const & scriptURL, OUString const & dialogURL, bool bRemoved,
+ OUString const & identifier)
: Package( myBackend.get(), url,
OUString(), OUString(), // will be late-initialized
scriptURL.getLength() > 0 ? myBackend->m_xBasicLibTypeInfo
- : myBackend->m_xDialogLibTypeInfo ),
+ : myBackend->m_xDialogLibTypeInfo, bRemoved, identifier),
m_scriptURL( scriptURL ),
m_dialogURL( dialogURL )
{
@@ -168,6 +176,33 @@ BackendImpl::BackendImpl(
m_typeInfos[ 1 ] = m_xDialogLibTypeInfo;
OSL_ASSERT( ! transientMode() );
+
+ if (!transientMode())
+ {
+ OUString dbFile = makeURL(getCachePath(), OUSTR("backenddb.xml"));
+ m_backendDb.reset(
+ new ScriptBackendDb(getComponentContext(), dbFile));
+ }
+
+}
+void BackendImpl::addDataToDb(OUString const & url)
+{
+ if (m_backendDb.get())
+ m_backendDb->addEntry(url);
+}
+
+bool BackendImpl::isRegisteredInDb(OUString const & url)
+{
+ bool registered = false;
+ if (m_backendDb.get())
+ registered = m_backendDb->getEntry(url);
+ return registered;
+}
+
+void BackendImpl::deleteDataFromDb(OUString const & url)
+{
+ if (m_backendDb.get())
+ m_backendDb->removeEntry(url);
}
// XUpdatable
@@ -189,6 +224,7 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
//______________________________________________________________________________
Reference<deployment::XPackage> BackendImpl::bindPackage_(
OUString const & url, OUString const & mediaType_,
+ sal_Bool bRemoved, OUString const & identifier,
Reference<XCommandEnvironment> const & xCmdEnv )
{
OUString mediaType( mediaType_ );
@@ -222,22 +258,31 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
{
if (type.EqualsIgnoreCaseAscii("application"))
{
+ OUString dialogURL( makeURL( url, OUSTR("dialog.xlb") ) );
+ if (! create_ucb_content(
+ 0, dialogURL, xCmdEnv, false /* no throw */ )) {
+ dialogURL = OUString();
+ }
+
if (subType.EqualsIgnoreCaseAscii("vnd.sun.star.basic-library"))
{
- OUString dialogURL( makeURL( url, OUSTR("dialog.xlb") ) );
+ OUString scriptURL( makeURL( url, OUSTR("script.xlb")));
if (! create_ucb_content(
- 0, dialogURL, xCmdEnv, false /* no throw */ )) {
- dialogURL = OUString();
+ 0, scriptURL, xCmdEnv, false /* no throw */ )) {
+ scriptURL = OUString();
}
- return new PackageImpl( this, url, xCmdEnv,
- makeURL( url, OUSTR("script.xlb") ),
- dialogURL );
+
+ return new PackageImpl(
+ this, url, xCmdEnv, scriptURL,
+ dialogURL, bRemoved, identifier);
}
else if (subType.EqualsIgnoreCaseAscii(
"vnd.sun.star.dialog-library")) {
- return new PackageImpl( this, url, xCmdEnv,
- OUString() /* no script lib */,
- makeURL( url, OUSTR("dialog.xlb") ) );
+ return new PackageImpl(
+ this, url, xCmdEnv,
+ OUString() /* no script lib */,
+ dialogURL,
+ bRemoved, identifier);
}
}
}
@@ -247,90 +292,6 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
static_cast<sal_Int16>(-1) );
}
-rtl::OUString BackendImpl::getRegisteredFlagFileURL( Reference< deployment::XPackage > xPackage )
-{
- rtl::OUString aRetURL;
- if( !xPackage.is() )
- return aRetURL;
- rtl::OUString aHelpURL = xPackage->getURL();
- aRetURL = expandURL( aHelpURL );
- aRetURL += rtl::OUString::createFromAscii( "/RegisteredFlag" );
- return aRetURL;
-}
-
-rtl::OUString BackendImpl::expandURL( const rtl::OUString& aURL )
-{
- static Reference< util::XMacroExpander > xMacroExpander;
- static Reference< uri::XUriReferenceFactory > xFac;
-
- if( !xMacroExpander.is() || !xFac.is() )
- {
- Reference<XComponentContext> const & xContext = getComponentContext();
- if( xContext.is() )
- {
- xFac = Reference< uri::XUriReferenceFactory >(
- xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii(
- "com.sun.star.uri.UriReferenceFactory"), xContext ) , UNO_QUERY );
- }
- if( !xFac.is() )
- {
- throw RuntimeException(
- ::rtl::OUString::createFromAscii(
- "dp_registry::backend::help::BackendImpl::expandURL(), "
- "could not instatiate UriReferenceFactory." ),
- Reference< XInterface >() );
- }
-
- xMacroExpander = Reference< util::XMacroExpander >(
- xContext->getValueByName(
- ::rtl::OUString::createFromAscii( "/singletons/com.sun.star.util.theMacroExpander" ) ),
- UNO_QUERY_THROW );
- }
-
- rtl::OUString aRetURL = aURL;
- if( xMacroExpander.is() )
- {
- Reference< uri::XUriReference > uriRef;
- for (;;)
- {
- uriRef = Reference< uri::XUriReference >( xFac->parse( aRetURL ), UNO_QUERY );
- if ( uriRef.is() )
- {
- Reference < uri::XVndSunStarExpandUrl > sxUri( uriRef, UNO_QUERY );
- if( !sxUri.is() )
- break;
-
- aRetURL = sxUri->expand( xMacroExpander );
- }
- }
- }
- return aRetURL;
-}
-
-Reference< ucb::XSimpleFileAccess > BackendImpl::getFileAccess( void )
-{
- if( !m_xSFA.is() )
- {
- Reference<XComponentContext> const & xContext = getComponentContext();
- if( xContext.is() )
- {
- m_xSFA = Reference< ucb::XSimpleFileAccess >(
- xContext->getServiceManager()->createInstanceWithContext(
- rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ),
- xContext ), UNO_QUERY );
- }
- if( !m_xSFA.is() )
- {
- throw RuntimeException(
- ::rtl::OUString::createFromAscii(
- "dp_registry::backend::help::BackendImpl::getFileAccess(), "
- "could not instatiate SimpleFileAccess." ),
- Reference< XInterface >() );
- }
- }
- return m_xSFA;
-}
-
//##############################################################################
// Package
@@ -359,20 +320,18 @@ BackendImpl::PackageImpl::isRegistered_(
BackendImpl * that = getMyBackend();
Reference< deployment::XPackage > xThisPackage( this );
- rtl::OUString aRegisteredFlagFile = that->getRegisteredFlagFileURL( xThisPackage );
-
- Reference< ucb::XSimpleFileAccess > xSFA = that->getFileAccess();
- bool bReg = xSFA->exists( aRegisteredFlagFile );
+ bool registered = that->isRegisteredInDb(getURL());
return beans::Optional< beans::Ambiguous<sal_Bool> >(
true /* IsPresent */,
- beans::Ambiguous<sal_Bool>( bReg, false /* IsAmbiguous */ ) );
+ beans::Ambiguous<sal_Bool>( registered, false /* IsAmbiguous */ ) );
}
//______________________________________________________________________________
void BackendImpl::PackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const &,
Reference<XCommandEnvironment> const & xCmdEnv )
{
@@ -381,15 +340,13 @@ void BackendImpl::PackageImpl::processPackage_(
BackendImpl * that = getMyBackend();
Reference< deployment::XPackage > xThisPackage( this );
- rtl::OUString aRegisteredFlagFile = that->getRegisteredFlagFileURL( xThisPackage );
- Reference< ucb::XSimpleFileAccess > xSFA = that->getFileAccess();
Reference<XComponentContext> const & xComponentContext = that->getComponentContext();
bool bScript = (m_scriptURL.getLength() > 0);
- Reference<css::script::XLibraryContainer> xScriptLibs;
+ Reference<css::script::XLibraryContainer3> xScriptLibs;
bool bDialog = (m_dialogURL.getLength() > 0);
- Reference<css::script::XLibraryContainer> xDialogLibs;
+ Reference<css::script::XLibraryContainer3> xDialogLibs;
bool bRunning = office_is_running();
if( bRunning )
@@ -410,52 +367,121 @@ void BackendImpl::PackageImpl::processPackage_(
xComponentContext ), UNO_QUERY_THROW );
}
}
-
+ bool bRegistered = getMyBackend()->isRegisteredInDb(getURL());
if( !doRegisterPackage )
{
- if( xSFA->exists( aRegisteredFlagFile ) )
+ //We cannot just call removeLibrary(name) because this could remove a
+ //script which was added by an extension in a different repository. For
+ //example, extension foo is contained in the bundled repository and then
+ //the user adds it it to the user repository. The extension manager will
+ //then register the new script and revoke the script from the bundled
+ //extension. removeLibrary(name) would now remove the script from the
+ //user repository. That is, the script of the newly added user extension does
+ //not work anymore. Therefore we must check if the currently active
+ //script comes in fact from the currently processed extension.
+
+ if (bRegistered)
{
- xSFA->kill( aRegisteredFlagFile );
-
- if( bScript && xScriptLibs.is() && xScriptLibs->hasByName( m_name ) )
- xScriptLibs->removeLibrary( m_name );
+ //we also prevent and live deployment at startup
+ if (!isRemoved() && !startup)
+ {
+ if (bScript && xScriptLibs.is() && xScriptLibs->hasByName(m_name))
+ {
+ const OUString sScriptUrl = xScriptLibs->getOriginalLibraryLinkURL(m_name);
+ if (sScriptUrl.equals(m_scriptURL))
+ xScriptLibs->removeLibrary(m_name);
+ }
- if( bDialog && xDialogLibs.is() && xDialogLibs->hasByName( m_dialogName ) )
- xDialogLibs->removeLibrary( m_dialogName );
+ if (bDialog && xDialogLibs.is() && xDialogLibs->hasByName(m_dialogName))
+ {
+ const OUString sDialogUrl = xDialogLibs->getOriginalLibraryLinkURL(m_dialogName);
+ if (sDialogUrl.equals(m_dialogURL))
+ xDialogLibs->removeLibrary(m_dialogName);
+ }
+ }
+ getMyBackend()->deleteDataFromDb(getURL());
+ return;
}
- return;
}
-
- if( xSFA->exists( aRegisteredFlagFile ) )
+ if (bRegistered)
return; // Already registered
// Update LibraryContainer
bool bScriptSuccess = false;
const bool bReadOnly = false;
- if( bScript && xScriptLibs.is() && !xScriptLibs->hasByName( m_name ) )
- {
- xScriptLibs->createLibraryLink( m_name, m_scriptURL, bReadOnly );
- bScriptSuccess = xScriptLibs->hasByName( m_name );
- }
bool bDialogSuccess = false;
- if( bDialog && xDialogLibs.is() && !xDialogLibs->hasByName( m_dialogName ) )
+ if (!startup)
{
- xDialogLibs->createLibraryLink( m_dialogName, m_dialogURL, bReadOnly );
- bDialogSuccess = xDialogLibs->hasByName( m_dialogName );
- }
+ //If there is a bundled extension, and the user installes the same extension
+ //then the script from the bundled extension must be removed. If this does not work
+ //then live deployment does not work for scripts.
+ if (bScript && xScriptLibs.is())
+ {
+ bool bCanAdd = true;
+ if (xScriptLibs->hasByName(m_name))
+ {
+ const OUString sOriginalUrl = xScriptLibs->getOriginalLibraryLinkURL(m_name);
+ //We assume here that library names in extensions are unique, which may not be the case
+ //ToDo: If the script exist in another extension, then both extensions must have the
+ //same id
+ if (sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE"))
+ || sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE"))
+ || sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$BUNDLED_EXTENSIONS")))
+ {
+ xScriptLibs->removeLibrary(m_name);
+ bCanAdd = true;
+ }
+ else
+ {
+ bCanAdd = false;
+ }
+ }
+
+ if (bCanAdd)
+ {
+ xScriptLibs->createLibraryLink( m_name, m_scriptURL, bReadOnly );
+ bScriptSuccess = xScriptLibs->hasByName( m_name );
+ }
+ }
+
+
+ if (bDialog && xDialogLibs.is())
+ {
+ bool bCanAdd = true;
+ if (xDialogLibs->hasByName(m_dialogName))
+ {
+ const OUString sOriginalUrl = xDialogLibs->getOriginalLibraryLinkURL(m_dialogName);
+ //We assume here that library names in extensions are unique, which may not be the case
+ //ToDo: If the script exist in another extension, then both extensions must have the
+ //same id
+ if (sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE"))
+ || sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE"))
+ || sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$BUNDLED_EXTENSIONS")))
+ {
+ xDialogLibs->removeLibrary(m_dialogName);
+ bCanAdd = true;
+ }
+ else
+ {
+ bCanAdd = false;
+ }
+ }
+ if (bCanAdd)
+ {
+ xDialogLibs->createLibraryLink( m_dialogName, m_dialogURL, bReadOnly );
+ bDialogSuccess = xDialogLibs->hasByName(m_dialogName);
+ }
+ }
+ }
bool bSuccess = bScript || bDialog; // Something must have happened
- if( bRunning )
+ if( bRunning && !startup)
if( (bScript && !bScriptSuccess) || (bDialog && !bDialogSuccess) )
bSuccess = false;
- if( bSuccess && !xSFA->exists( aRegisteredFlagFile ) )
- {
- Reference< io::XOutputStream > xOutputStream = xSFA->openFileWrite( aRegisteredFlagFile );
- if( xOutputStream.is() )
- xOutputStream->closeOutput();
- }
+ if (bSuccess)
+ getMyBackend()->addDataToDb(getURL());
}
} // anon namespace
diff --git a/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx b/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx
new file mode 100644
index 000000000000..ce0d3029084d
--- /dev/null
+++ b/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx
@@ -0,0 +1,88 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: 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
+ * 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_desktop.hxx"
+
+#include "rtl/string.h"
+#include "cppuhelper/exc_hlp.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/xml/dom/XDocument.hpp"
+#include "com/sun/star/xml/xpath/XXPathAPI.hpp"
+#include "dp_misc.h"
+#include "dp_scriptbackenddb.hxx"
+
+
+namespace css = ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using ::rtl::OUString;
+
+#define EXTENSION_REG_NS "http://openoffice.org/extensionmanager/script-registry/2010"
+#define NS_PREFIX "script"
+#define ROOT_ELEMENT_NAME "script-backend-db"
+#define KEY_ELEMENT_NAME "script"
+
+namespace dp_registry {
+namespace backend {
+namespace script {
+
+ScriptBackendDb::ScriptBackendDb(
+ Reference<XComponentContext> const & xContext,
+ ::rtl::OUString const & url):RegisteredDb(xContext, url)
+{
+
+}
+
+OUString ScriptBackendDb::getDbNSName()
+{
+ return OUSTR(EXTENSION_REG_NS);
+}
+
+OUString ScriptBackendDb::getNSPrefix()
+{
+ return OUSTR(NS_PREFIX);
+}
+
+OUString ScriptBackendDb::getRootElementName()
+{
+ return OUSTR(ROOT_ELEMENT_NAME);
+}
+
+OUString ScriptBackendDb::getKeyElementName()
+{
+ return OUSTR(KEY_ELEMENT_NAME);
+}
+
+
+
+} // namespace executable
+} // namespace backend
+} // namespace dp_registry
+
diff --git a/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx b/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx
new file mode 100644
index 000000000000..9d227f8b64b8
--- /dev/null
+++ b/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: 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
+ * 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.
+ *
+ ************************************************************************/
+
+#if ! defined INCLUDED_DP_SCRIPTBACKENDDB_HXX
+#define INCLUDED_DP_SCRIPTBACKENDDB_HXX
+
+#include "rtl/ustring.hxx"
+#include "dp_backenddb.hxx"
+#include "boost/optional.hpp"
+namespace css = ::com::sun::star;
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+}}}
+
+namespace dp_registry {
+namespace backend {
+namespace script {
+
+/* The XML file stores the extensions which are currently registered.
+ They will be removed when they are revoked.
+ */
+class ScriptBackendDb: public dp_registry::backend::RegisteredDb
+{
+protected:
+ virtual ::rtl::OUString getDbNSName();
+
+ virtual ::rtl::OUString getNSPrefix();
+
+ virtual ::rtl::OUString getRootElementName();
+
+ virtual ::rtl::OUString getKeyElementName();
+
+
+public:
+
+ ScriptBackendDb( css::uno::Reference<css::uno::XComponentContext> const & xContext,
+ ::rtl::OUString const & url);
+};
+
+
+
+}
+}
+}
+#endif
+
diff --git a/desktop/source/deployment/registry/script/makefile.mk b/desktop/source/deployment/registry/script/makefile.mk
index ae159914a548..708def358021 100644
--- a/desktop/source/deployment/registry/script/makefile.mk
+++ b/desktop/source/deployment/registry/script/makefile.mk
@@ -41,7 +41,8 @@ INCPRE += ..$/..$/inc
SLOFILES = \
$(SLO)$/dp_script.obj \
- $(SLO)$/dp_lib_container.obj
+ $(SLO)$/dp_lib_container.obj \
+ $(SLO)$/dp_scriptbackenddb.obj
.INCLUDE : ..$/..$/target.pmk
.INCLUDE : target.mk
diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
index 52ced6908bd8..8a4ee1b45fbc 100644
--- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
+++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
@@ -77,12 +77,15 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
public:
- PackageImpl( ::rtl::Reference<BackendImpl> const & myBackend,
- OUString const & url, OUString const & libType );
+ PackageImpl(
+ ::rtl::Reference<BackendImpl> const & myBackend,
+ OUString const & url, OUString const & libType, bool bRemoved,
+ OUString const & identifier);
// XPackage
virtual OUString SAL_CALL getDescription() throw (RuntimeException);
};
@@ -91,6 +94,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
// PackageRegistryBackend
virtual Reference<deployment::XPackage> bindPackage_(
OUString const & url, OUString const & mediaType,
+ sal_Bool bRemoved, OUString const & identifier,
Reference<XCommandEnvironment> const & xCmdEnv );
const Reference<deployment::XPackageTypeInfo> m_xTypeInfo;
@@ -131,9 +135,10 @@ OUString BackendImpl::PackageImpl::getDescription() throw (RuntimeException)
//______________________________________________________________________________
BackendImpl::PackageImpl::PackageImpl(
::rtl::Reference<BackendImpl> const & myBackend,
- OUString const & url, OUString const & libType )
+ OUString const & url, OUString const & libType, bool bRemoved,
+ OUString const & identifier)
: Package( myBackend.get(), url, OUString(), OUString(),
- myBackend->m_xTypeInfo ),
+ myBackend->m_xTypeInfo, bRemoved, identifier),
m_descr(libType)
{
initPackageHandler();
@@ -217,8 +222,8 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
// PackageRegistryBackend
//______________________________________________________________________________
Reference<deployment::XPackage> BackendImpl::bindPackage_(
- OUString const & url, OUString const & mediaType_,
- Reference<XCommandEnvironment> const & xCmdEnv )
+ OUString const & url, OUString const & mediaType_, sal_Bool bRemoved,
+ OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv )
{
OUString mediaType( mediaType_ );
if (mediaType.getLength() == 0)
@@ -294,7 +299,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
dp_misc::TRACE(OUSTR(" BackEnd detected lang = ") + lang + OUSTR("\n"));
dp_misc::TRACE(OUSTR(" for url ") + sParcelDescURL + OUSTR("\n") );
dp_misc::TRACE("******************************\n");
- return new PackageImpl( this, url, sfwkLibType );
+ return new PackageImpl( this, url, sfwkLibType, bRemoved, identifier);
}
}
}
@@ -322,6 +327,10 @@ void BackendImpl::PackageImpl:: initPackageHandler()
{
aContext <<= OUSTR("share");
}
+ else if ( that->m_eContext == CONTEXT_BUNDLED )
+ {
+ aContext <<= OUSTR("bundled");
+ }
else
{
OSL_ASSERT( 0 );
@@ -363,6 +372,7 @@ BackendImpl::PackageImpl::isRegistered_(
void BackendImpl::PackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
+ bool /* startup */,
::rtl::Reference<AbortChannel> const &,
Reference<XCommandEnvironment> const & )
{
diff --git a/desktop/source/deployment/unopkg/unopkg.src b/desktop/source/deployment/unopkg/unopkg.src
index 79c578628676..dc204e265ec6 100644
--- a/desktop/source/deployment/unopkg/unopkg.src
+++ b/desktop/source/deployment/unopkg/unopkg.src
@@ -27,15 +27,10 @@
#include "deployment.hrc"
-String RID_STR_UNOPKG_NO_SHARED_ALLOWED
-{
- Text [ en-US ] = "The option \"--shared\" cannot be used to install the extension \'%NAME\', "
- "because every user has to agree to the license agreement of the extension. The extension will not be installed.";
-};
String RID_STR_UNOPKG_ACCEPT_LIC_1
{
- Text [ en-US ] = "Extension License Agreement:";
+ Text [ en-US ] = "Extension Software License Agreement of $NAME:";
};
String RID_STR_UNOPKG_ACCEPT_LIC_2
diff --git a/desktop/source/inc/exithelper.hxx b/desktop/source/inc/exithelper.hxx
index 958b549adfa0..e2604ce49b68 100644
--- a/desktop/source/inc/exithelper.hxx
+++ b/desktop/source/inc/exithelper.hxx
@@ -56,12 +56,10 @@ class ExitHelper
E_SECOND_OFFICE = 1,
/// an uno exception was catched during startup
E_FATAL_ERROR = 333, // Only the low 8 bits are significant 333 % 256 = 77
- /// crash during runtime
- E_CRASH = 78,
/// user force automatic restart after crash
E_CRASH_WITH_RESTART = 79,
- /// ???
- E_LOCKFILE = 80
+ /// the office restarts itself
+ E_NORMAL_RESTART = 81
};
};
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index 2181daab7454..314537836921 100644..100755
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -28,6 +28,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_desktop.hxx"
+#include <map>
+#include <new>
+#include <set>
+
#include "migration.hxx"
#include "migration_impl.hxx"
#include "cfgfilter.hxx"
@@ -37,6 +41,7 @@
#include <comphelper/sequence.hxx>
#include <unotools/bootstrap.hxx>
#include <rtl/bootstrap.hxx>
+#include <rtl/uri.hxx>
#include <tools/config.hxx>
#include <i18npool/lang.h>
#include <tools/urlobj.hxx>
@@ -46,15 +51,19 @@
#include <osl/security.hxx>
#include <unotools/configmgr.hxx>
+#include <com/sun/star/configuration/Update.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/task/XJob.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
#include <com/sun/star/util/XRefreshable.hpp>
#include <com/sun/star/util/XChangesBatch.hpp>
#include <com/sun/star/util/XStringSubstitution.hpp>
+#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/ui/XUIConfiguration.hpp>
+#include <com/sun/star/ui/XUIConfigurationStorage.hpp>
+#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
using namespace rtl;
using namespace osl;
@@ -64,13 +73,125 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::util;
using namespace com::sun::star::container;
-using namespace com::sun::star::configuration;
-using namespace com::sun::star::configuration::backend;
using com::sun::star::uno::Exception;
using namespace com::sun::star;
namespace desktop {
+static const ::rtl::OUString ITEM_DESCRIPTOR_COMMANDURL = ::rtl::OUString::createFromAscii("CommandURL");
+static const ::rtl::OUString ITEM_DESCRIPTOR_CONTAINER = ::rtl::OUString::createFromAscii("ItemDescriptorContainer");
+static const ::rtl::OUString ITEM_DESCRIPTOR_LABEL = ::rtl::OUString::createFromAscii("Label");
+
+static const ::rtl::OUString MENU_SEPERATOR = ::rtl::OUString::createFromAscii(" | ");
+static const ::rtl::OUString MENU_SUBMENU = ::rtl::OUString::createFromAscii("...");
+
+::rtl::OUString retrieveLabelFromCommand(const ::rtl::OUString& sCommand, const ::rtl::OUString& sModuleIdentifier)
+{
+ ::rtl::OUString sLabel;
+
+ uno::Reference< container::XNameAccess > xUICommands;
+ uno::Reference< container::XNameAccess > xNameAccess( ::comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.frame.UICommandDescription") ), uno::UNO_QUERY );
+ if ( xNameAccess.is() )
+ {
+ uno::Any a = xNameAccess->getByName( sModuleIdentifier );
+ a >>= xUICommands;
+ }
+ if (xUICommands.is())
+ {
+ if ( sCommand.getLength() > 0 )
+ {
+ rtl::OUString aStr;
+ ::uno::Sequence< beans::PropertyValue > aPropSeq;
+ try
+ {
+ uno::Any a( xUICommands->getByName( sCommand ));
+ if ( a >>= aPropSeq )
+ {
+ for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
+ {
+ if ( aPropSeq[i].Name.equalsAscii( "Label" ))
+ {
+ aPropSeq[i].Value >>= aStr;
+ break;
+ }
+ }
+ }
+
+ sLabel = aStr;
+ }
+
+ catch(container::NoSuchElementException&)
+ {
+ sLabel = sCommand;
+ sal_Int32 nIndex = sLabel.indexOf(':');
+ if (nIndex>=0 && nIndex <= sLabel.getLength()-1)
+ sLabel = sLabel.copy(nIndex+1);
+ }
+
+ }
+ }
+
+ return sLabel;
+}
+
+::rtl::OUString stripHotKey( const ::rtl::OUString& str )
+{
+ sal_Int32 index = str.indexOf( '~' );
+ if ( index == -1 )
+ {
+ return str;
+ }
+ else
+ {
+ return str.replaceAt( index, 1, ::rtl::OUString() );
+ }
+}
+
+::rtl::OUString mapModuleShortNameToIdentifier(const ::rtl::OUString& sShortName)
+{
+ ::rtl::OUString sIdentifier;
+
+ if (sShortName.equals(::rtl::OUString::createFromAscii("StartModule")))
+ sIdentifier = ::rtl::OUString::createFromAscii("com.sun.star.frame.StartModule");
+
+ else if (sShortName.equals(::rtl::OUString::createFromAscii("swriter")))
+ sIdentifier = ::rtl::OUString::createFromAscii("com.sun.star.text.TextDocument");
+
+ else if (sShortName.equals(::rtl::OUString::createFromAscii("scalc")))
+ sIdentifier = ::rtl::OUString::createFromAscii("com.sun.star.sheet.SpreadsheetDocument");
+
+ else if (sShortName.equals(::rtl::OUString::createFromAscii("sdraw")))
+ sIdentifier = ::rtl::OUString::createFromAscii("com.sun.star.drawing.DrawingDocument");
+
+ else if (sShortName.equals(::rtl::OUString::createFromAscii("simpress")))
+ sIdentifier = ::rtl::OUString::createFromAscii("com.sun.star.presentation.PresentationDocument");
+
+ else if (sShortName.equals(::rtl::OUString::createFromAscii("smath")))
+ sIdentifier = ::rtl::OUString::createFromAscii("com.sun.star.formula.FormulaProperties");
+
+ else if (sShortName.equals(::rtl::OUString::createFromAscii("schart")))
+ sIdentifier = ::rtl::OUString::createFromAscii("com.sun.star.chart2.ChartDocument");
+
+ else if (sShortName.equals(::rtl::OUString::createFromAscii("BasicIDE")))
+ sIdentifier = ::rtl::OUString::createFromAscii("com.sun.star.script.BasicIDE");
+
+ else if (sShortName.equals(::rtl::OUString::createFromAscii("dbapp")))
+ sIdentifier = ::rtl::OUString::createFromAscii("com.sun.star.sdb.OfficeDatabaseDocument");
+
+ else if (sShortName.equals(::rtl::OUString::createFromAscii("sglobal")))
+ sIdentifier = ::rtl::OUString::createFromAscii("com.sun.star.text.GlobalDocument");
+
+ else if (sShortName.equals(::rtl::OUString::createFromAscii("sweb")))
+ sIdentifier = ::rtl::OUString::createFromAscii("com.sun.star.text.WebDocument");
+
+ else if (sShortName.equals(::rtl::OUString::createFromAscii("swxform")))
+ sIdentifier = ::rtl::OUString::createFromAscii("com.sun.star.xforms.XMLFormDocument");
+
+ else if (sShortName.equals(::rtl::OUString::createFromAscii("sbibliography")))
+ sIdentifier = ::rtl::OUString::createFromAscii("com.sun.star.frame.Bibliography");
+
+ return sIdentifier;
+}
static MigrationImpl *pImpl = 0;
static Mutex aMutex;
@@ -154,18 +275,78 @@ MigrationImpl::~MigrationImpl()
sal_Bool MigrationImpl::doMigration()
{
- // compile file and service list for migration
- m_vrFileList = compileFileList();
- m_vrServiceList = compileServiceList();
+ // compile file list for migration
+ m_vrFileList = compileFileList();
sal_Bool result = sal_False;
- try{
+ try
+ {
+ NewVersionUIInfo aNewVersionUIInfo;
+ ::std::vector< MigrationModuleInfo > vModulesInfo = dectectUIChangesForAllModules();
+ aNewVersionUIInfo.init(vModulesInfo);
+
copyFiles();
+ const ::rtl::OUString sMenubarResourceURL = ::rtl::OUString::createFromAscii("private:resource/menubar/menubar");
+ const ::rtl::OUString sToolbarResourcePre = ::rtl::OUString::createFromAscii("private:resource/toolbar/");
+ for (sal_uInt32 i=0; i<vModulesInfo.size(); ++i)
+ {
+ ::rtl::OUString sModuleIdentifier = mapModuleShortNameToIdentifier(vModulesInfo[i].sModuleShortName);
+ if (sModuleIdentifier.getLength()==0)
+ continue;
+
+ uno::Sequence< uno::Any > lArgs(2);
+ ::rtl::OUString aOldCfgDataPath = m_aInfo.userdata + ::rtl::OUString::createFromAscii("/user/config/soffice.cfg/modules/");
+ lArgs[0] <<= aOldCfgDataPath + vModulesInfo[i].sModuleShortName;
+ lArgs[1] <<= embed::ElementModes::READ;
+
+ uno::Reference< lang::XSingleServiceFactory > xStorageFactory(m_xFactory->createInstance(::rtl::OUString::createFromAscii("com.sun.star.embed.FileSystemStorageFactory")), uno::UNO_QUERY);
+ uno::Reference< embed::XStorage > xModules;
+
+ xModules = uno::Reference< embed::XStorage >(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY);
+ uno::Reference< ui::XUIConfigurationManager > xOldCfgManager( m_xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.ui.UIConfigurationManager")), uno::UNO_QUERY );
+ uno::Reference< ui::XUIConfigurationStorage > xOldCfgStorage( xOldCfgManager, uno::UNO_QUERY );
+ uno::Reference< ui::XUIConfigurationPersistence > xOldCfgPersistence( xOldCfgManager, uno::UNO_QUERY );
+
+ if ( xOldCfgStorage.is() && xOldCfgPersistence.is() && xModules.is() )
+ {
+ xOldCfgStorage->setStorage( xModules );
+ xOldCfgPersistence->reload();
+ }
+
+ uno::Reference< ui::XUIConfigurationManager > xCfgManager = aNewVersionUIInfo.getConfigManager(vModulesInfo[i].sModuleShortName);
+
+ if (vModulesInfo[i].bHasMenubar)
+ {
+ uno::Reference< container::XIndexContainer > xOldVersionMenuSettings = uno::Reference< container::XIndexContainer >(xOldCfgManager->getSettings(sMenubarResourceURL, sal_True), uno::UNO_QUERY);
+ uno::Reference< container::XIndexContainer > xNewVersionMenuSettings = aNewVersionUIInfo.getNewMenubarSettings(vModulesInfo[i].sModuleShortName);
+ ::rtl::OUString sParent;
+ compareOldAndNewConfig(sParent, xOldVersionMenuSettings, xNewVersionMenuSettings, sMenubarResourceURL);
+ mergeOldToNewVersion(xCfgManager, xNewVersionMenuSettings, sModuleIdentifier, sMenubarResourceURL);
+ }
+
+ sal_Int32 nToolbars = vModulesInfo[i].m_vToolbars.size();
+ if (nToolbars >0)
+ {
+ for (sal_Int32 j=0; j<nToolbars; ++j)
+ {
+ ::rtl::OUString sToolbarName = vModulesInfo[i].m_vToolbars[j];
+ ::rtl::OUString sToolbarResourceURL = sToolbarResourcePre + sToolbarName;
+
+ uno::Reference< container::XIndexContainer > xOldVersionToolbarSettings = uno::Reference< container::XIndexContainer >(xOldCfgManager->getSettings(sToolbarResourceURL, sal_True), uno::UNO_QUERY);
+ uno::Reference< container::XIndexContainer > xNewVersionToolbarSettings = aNewVersionUIInfo.getNewToolbarSettings(vModulesInfo[i].sModuleShortName, sToolbarName);
+ ::rtl::OUString sParent;
+ compareOldAndNewConfig(sParent, xOldVersionToolbarSettings, xNewVersionToolbarSettings, sToolbarResourceURL);
+ mergeOldToNewVersion(xCfgManager, xNewVersionToolbarSettings, sModuleIdentifier, sToolbarResourceURL);
+ }
+ }
+
+ m_aOldVersionItemsHashMap.clear();
+ m_aNewVersionItemsHashMap.clear();
+ }
+
// execute the migration items from Setup.xcu
- // and refresh the cache
copyConfig();
- refresh();
// execute custom migration services from Setup.xcu
// and refresh the cache
@@ -232,6 +413,7 @@ static void insertSorted(migrations_available& rAvailableMigrations, supported_m
{
rAvailableMigrations.insert(pIter, aSupportedMigration );
bInserted = true;
+ break; // i111193: insert invalidates iterator!
}
++pIter;
}
@@ -291,10 +473,14 @@ migrations_vr MigrationImpl::readMigrationSteps(const ::rtl::OUString& rMigratio
tmpStep.name = seqMigrations[i];
// read included files from current step description
+ ::rtl::OUString aSeqEntry;
if (tmpAccess->getByName(OUString::createFromAscii("IncludedFiles")) >>= tmpSeq)
{
for (sal_Int32 j=0; j<tmpSeq.getLength(); j++)
- tmpStep.includeFiles.push_back(tmpSeq[j]);
+ {
+ aSeqEntry = tmpSeq[j];
+ tmpStep.includeFiles.push_back(aSeqEntry);
+ }
}
// exluded files...
@@ -329,14 +515,10 @@ migrations_vr MigrationImpl::readMigrationSteps(const ::rtl::OUString& rMigratio
if (tmpAccess->getByName(OUString::createFromAscii("ExcludedExtensions")) >>= tmpSeq)
{
for (sal_Int32 j=0; j<tmpSeq.getLength(); j++)
- tmpStep.excludeExtensions.push_back(tmpSeq[j]);
- }
-
- // config components
- if (tmpAccess->getByName(OUString::createFromAscii("ServiceConfigComponents")) >>= tmpSeq)
- {
- for (sal_Int32 j=0; j<tmpSeq.getLength(); j++)
- tmpStep.configComponents.push_back(tmpSeq[j]);
+ {
+ aSeqEntry = tmpSeq[j];
+ tmpStep.excludeExtensions.push_back(aSeqEntry);
+ }
}
// generic service
@@ -525,77 +707,104 @@ strings_vr MigrationImpl::compileFileList()
return vrResult;
}
+namespace {
-void MigrationImpl::copyConfig()
-{
- try {
- // 1. get a list of all components from hierachy browser
- uno::Reference< XJob > xBrowser(m_xFactory->createInstance(
- OUString::createFromAscii("com.sun.star.configuration.backend.LocalHierarchyBrowser")), uno::UNO_QUERY_THROW);
-
- uno::Sequence< NamedValue > seqArgs(2);
- seqArgs[0] = NamedValue(
- OUString::createFromAscii("LayerDataUrl"),
- uno::makeAny(m_aInfo.userdata + OUString::createFromAscii("/user/registry")));
- seqArgs[1] = NamedValue(
- OUString::createFromAscii("FetchComponentNames"),
- uno::makeAny(sal_True));
-
- // execute the search
- uno::Any aResult = xBrowser->execute(seqArgs);
- uno::Sequence< OUString > seqComponents;
- aResult >>= seqComponents;
- OSL_ENSURE(seqComponents.getLength()>0, "MigrationImpl::copyConfig(): no config components available");
-
- // 2. create an importer
- uno::Reference< XJob > xImporter(m_xFactory->createInstance(
- OUString::createFromAscii("com.sun.star.configuration.backend.LocalDataImporter")), uno::UNO_QUERY_THROW);
-
- // 3. for each migration step...
- uno::Sequence< NamedValue > importerArgs(3);
- importerArgs[0] = NamedValue(
- OUString::createFromAscii("LayerDataUrl"),
- uno::makeAny(m_aInfo.userdata + OUString::createFromAscii("/user/registry")));
- importerArgs[1] = NamedValue(
- OUString::createFromAscii("LayerFilter"),
- uno::Any());
- importerArgs[2] = NamedValue(
- OUString::createFromAscii("Component"),
- uno::Any());
-
- migrations_v::const_iterator i_mig = m_vrMigrations->begin();
- while (i_mig != m_vrMigrations->end())
- {
- // a. create config filter for step
- uno::Reference< XInitialization > xFilter(
- new CConfigFilter(&(i_mig->includeConfig), &(i_mig->excludeConfig)));
- importerArgs[1].Value = uno::makeAny(xFilter);
-
- // b. run each importer with config filter
- for (sal_Int32 i=0; i<seqComponents.getLength(); i++)
- {
- OUString component = seqComponents[i];
- importerArgs[2].Value = uno::makeAny(seqComponents[i]);
- try {
- aResult = xImporter->execute(importerArgs);
- Exception myException;
- if (aResult >>= myException) throw myException;
- } catch(Exception& aException) {
- OString aMsg("Exception in config layer import.\ncomponent: ");
- aMsg += OUStringToOString(seqComponents[i], RTL_TEXTENCODING_ASCII_US);
- aMsg += "\nmessage: ";
- aMsg += OUStringToOString(aException.Message, RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(sal_False, aMsg.getStr());
- }
+struct componentParts {
+ std::set< rtl::OUString > includedPaths;
+ std::set< rtl::OUString > excludedPaths;
+};
+
+typedef std::map< rtl::OUString, componentParts > Components;
+
+bool getComponent(rtl::OUString const & path, rtl::OUString * component) {
+ OSL_ASSERT(component != 0);
+ if (path.getLength() == 0 || path[0] != '/') {
+ OSL_TRACE(
+ ("configuration migration in/exclude path %s ignored (does not"
+ " start with slash)"),
+ rtl::OUStringToOString(path, RTL_TEXTENCODING_UTF8).getStr());
+ return false;
+ }
+ sal_Int32 i = path.indexOf('/', 1);
+ *component = i < 0 ? path.copy(1) : path.copy(1, i - 1);
+ return true;
+}
+
+uno::Sequence< rtl::OUString > setToSeq(std::set< rtl::OUString > const & set) {
+ std::set< rtl::OUString >::size_type n = set.size();
+ if (n > SAL_MAX_INT32) {
+ throw std::bad_alloc();
+ }
+ uno::Sequence< rtl::OUString > seq(static_cast< sal_Int32 >(n));
+ sal_Int32 i = 0;
+ for (std::set< rtl::OUString >::const_iterator j(set.begin());
+ j != set.end(); ++j)
+ {
+ seq[i++] = *j;
+ }
+ return seq;
+}
+
+}
+
+void MigrationImpl::copyConfig() {
+ Components comps;
+ for (migrations_v::const_iterator i(m_vrMigrations->begin());
+ i != m_vrMigrations->end(); ++i)
+ {
+ for (strings_v::const_iterator j(i->includeConfig.begin());
+ j != i->includeConfig.end(); ++j)
+ {
+ rtl::OUString comp;
+ if (getComponent(*j, &comp)) {
+ comps[comp].includedPaths.insert(*j);
+ }
+ }
+ for (strings_v::const_iterator j(i->excludeConfig.begin());
+ j != i->excludeConfig.end(); ++j)
+ {
+ rtl::OUString comp;
+ if (getComponent(*j, &comp)) {
+ comps[comp].excludedPaths.insert(*j);
}
- i_mig++;
}
}
- catch (Exception& e)
- {
- OString aMsg("Exception in config layer import.\nmessage: ");
- aMsg += OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(sal_False, aMsg.getStr());
+ for (Components::const_iterator i(comps.begin()); i != comps.end(); ++i) {
+ if (!i->second.includedPaths.empty()) {
+ rtl::OUStringBuffer buf(m_aInfo.userdata);
+ buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("/user/registry/data"));
+ sal_Int32 n = 0;
+ do {
+ rtl::OUString seg(i->first.getToken(0, '.', n));
+ rtl::OUString enc(
+ rtl::Uri::encode(
+ seg, rtl_UriCharClassPchar, rtl_UriEncodeStrict,
+ RTL_TEXTENCODING_UTF8));
+ if (enc.getLength() == 0 && seg.getLength() != 0) {
+ OSL_TRACE(
+ ("configuration migration component %s ignored (cannot"
+ " be encoded as file path)"),
+ rtl::OUStringToOString(
+ i->first, RTL_TEXTENCODING_UTF8).getStr());
+ goto next;
+ }
+ buf.append(sal_Unicode('/'));
+ buf.append(enc);
+ } while (n >= 0);
+ buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(".xcu"));
+ configuration::Update::get(
+ comphelper::getProcessComponentContext())->
+ insertModificationXcuFile(
+ buf.makeStringAndClear(), setToSeq(i->second.includedPaths),
+ setToSeq(i->second.excludedPaths));
+ } else {
+ OSL_TRACE(
+ ("configuration migration component %s ignored (only excludes,"
+ " no includes)"),
+ rtl::OUStringToOString(
+ i->first, RTL_TEXTENCODING_UTF8).getStr());
+ }
+ next:;
}
}
@@ -704,17 +913,8 @@ void MigrationImpl::copyFiles()
void MigrationImpl::runServices()
{
- //create stratum for old user layer
- OUString aOldLayerURL = m_aInfo.userdata;
- aOldLayerURL += OUString::createFromAscii("/user/registry");
- OUString aStratumSvc = OUString::createFromAscii("com.sun.star.configuration.backend.LocalSingleStratum");
- uno::Sequence< uno::Any > stratumArgs(1);
- stratumArgs[0] = uno::makeAny(aOldLayerURL);
- uno::Reference< XSingleLayerStratum> xStartum( m_xFactory->createInstanceWithArguments(
- aStratumSvc, stratumArgs), uno::UNO_QUERY);
-
// Build argument array
- uno::Sequence< uno::Any > seqArguments(4);
+ uno::Sequence< uno::Any > seqArguments(3);
seqArguments[0] = uno::makeAny(NamedValue(
OUString::createFromAscii("Productname"),
uno::makeAny(m_aInfo.productname)));
@@ -735,34 +935,13 @@ void MigrationImpl::runServices()
try
{
- // create access to old configuration components in the user layer
- // that were requested by the migration service
- uno::Sequence< NamedValue > seqComponents(i_mig->configComponents.size());
- strings_v::const_iterator i_comp = i_mig->configComponents.begin();
- sal_Int32 i = 0;
- while (i_comp != i_mig->configComponents.end() && xStartum.is())
- {
- // create Layer for i_comp
- seqComponents[i] = NamedValue(
- *i_comp, uno::makeAny(xStartum->getLayer(*i_comp, OUString())));
-
- // next component
- i_comp++;
- i++;
- }
-
- // set old config argument
- seqArguments[2] = uno::makeAny(NamedValue(
- OUString::createFromAscii("OldConfiguration"),
- uno::makeAny(seqComponents)));
-
// set black list for extension migration
uno::Sequence< rtl::OUString > seqExtBlackList;
sal_uInt32 nSize = i_mig->excludeExtensions.size();
if ( nSize > 0 )
seqExtBlackList = comphelper::arrayToSequence< ::rtl::OUString >(
&i_mig->excludeExtensions[0], nSize );
- seqArguments[3] = uno::makeAny(NamedValue(
+ seqArguments[2] = uno::makeAny(NamedValue(
OUString::createFromAscii("ExtensionBlackList"),
uno::makeAny( seqExtBlackList )));
@@ -791,17 +970,396 @@ void MigrationImpl::runServices()
}
}
+::std::vector< MigrationModuleInfo > MigrationImpl::dectectUIChangesForAllModules() const
+{
+ ::std::vector< MigrationModuleInfo > vModulesInfo;
+ const ::rtl::OUString MENUBAR = ::rtl::OUString::createFromAscii("menubar");
+ const ::rtl::OUString TOOLBAR = ::rtl::OUString::createFromAscii("toolbar");
+
+ uno::Sequence< uno::Any > lArgs(2);
+ lArgs[0] <<= m_aInfo.userdata + ::rtl::OUString::createFromAscii("/user/config/soffice.cfg/modules");
+ lArgs[1] <<= embed::ElementModes::READ;
+
+ uno::Reference< lang::XSingleServiceFactory > xStorageFactory(m_xFactory->createInstance(::rtl::OUString::createFromAscii("com.sun.star.embed.FileSystemStorageFactory")), uno::UNO_QUERY);
+ uno::Reference< embed::XStorage > xModules;
-strings_vr MigrationImpl::compileServiceList()
+ xModules = uno::Reference< embed::XStorage >(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY);
+ if (!xModules.is())
+ return vModulesInfo;
+
+ uno::Reference< container::XNameAccess > xAccess = uno::Reference< container::XNameAccess >(xModules, uno::UNO_QUERY);
+ uno::Sequence< ::rtl::OUString > lNames = xAccess->getElementNames();
+ sal_Int32 nLength = lNames.getLength();
+ for (sal_Int32 i=0; i<nLength; ++i)
+ {
+ ::rtl::OUString sModuleShortName = lNames[i];
+ uno::Reference< embed::XStorage > xModule = xModules->openStorageElement(sModuleShortName, embed::ElementModes::READ);
+ if (xModule.is())
+ {
+ MigrationModuleInfo aModuleInfo;
+
+ uno::Reference< embed::XStorage > xMenubar = xModule->openStorageElement(MENUBAR, embed::ElementModes::READ);
+ if (xMenubar.is())
+ {
+ uno::Reference< container::XNameAccess > xNameAccess = uno::Reference< container::XNameAccess >(xMenubar, uno::UNO_QUERY);
+ if (xNameAccess->getElementNames().getLength() > 0)
+ {
+ aModuleInfo.sModuleShortName = sModuleShortName;
+ aModuleInfo.bHasMenubar = sal_True;
+ }
+ }
+
+ uno::Reference< embed::XStorage > xToolbar = xModule->openStorageElement(TOOLBAR, embed::ElementModes::READ);
+ if (xToolbar.is())
+ {
+ const ::rtl::OUString RESOURCEURL_CUSTOM_ELEMENT = ::rtl::OUString::createFromAscii("custom_");
+ sal_Int32 nCustomLen = 7;
+
+ uno::Reference< container::XNameAccess > xNameAccess = uno::Reference< container::XNameAccess >(xToolbar, uno::UNO_QUERY);
+ ::uno::Sequence< ::rtl::OUString > lToolbars = xNameAccess->getElementNames();
+ for (sal_Int32 j=0; j<lToolbars.getLength(); ++j)
+ {
+ ::rtl::OUString sToolbarName = lToolbars[j];
+ if (sToolbarName.getLength()>=nCustomLen &&
+ sToolbarName.copy(0, nCustomLen).equals(RESOURCEURL_CUSTOM_ELEMENT))
+ continue;
+
+ aModuleInfo.sModuleShortName = sModuleShortName;
+ sal_Int32 nIndex = sToolbarName.lastIndexOf('.');
+ if (nIndex > 0)
+ {
+ ::rtl::OUString sExtension(sToolbarName.copy(nIndex));
+ ::rtl::OUString sToolbarResourceName(sToolbarName.copy(0, nIndex));
+ if (sToolbarResourceName.getLength()>0 && sExtension.equalsAsciiL(".xml", 4))
+ aModuleInfo.m_vToolbars.push_back(sToolbarResourceName);
+ }
+ }
+ }
+
+ if (aModuleInfo.sModuleShortName.getLength()>0)
+ vModulesInfo.push_back(aModuleInfo);
+ }
+ }
+
+ return vModulesInfo;
+}
+
+void MigrationImpl::compareOldAndNewConfig(const ::rtl::OUString& sParent,
+ const uno::Reference< container::XIndexContainer >& xIndexOld,
+ const uno::Reference< container::XIndexContainer >& xIndexNew,
+ const ::rtl::OUString& sResourceURL)
{
- strings_vr vrResult(new strings_v);
- migrations_v::const_iterator i_migr = m_vrMigrations->begin();
- while (i_migr != m_vrMigrations->end())
+ ::std::vector< MigrationItem > vOldItems;
+ ::std::vector< MigrationItem > vNewItems;
+ uno::Sequence< beans::PropertyValue > aProp;
+ sal_Int32 nOldCount = xIndexOld->getCount();
+ sal_Int32 nNewCount = xIndexNew->getCount();
+
+ for (int n=0; n<nOldCount; ++n)
{
- vrResult->push_back(i_migr->service);
- i_migr++;
+ MigrationItem aMigrationItem;
+ if (xIndexOld->getByIndex(n) >>= aProp)
+ {
+ for(int i=0; i<aProp.getLength(); ++i)
+ {
+ if (aProp[i].Name.equals(ITEM_DESCRIPTOR_COMMANDURL))
+ aProp[i].Value >>= aMigrationItem.m_sCommandURL;
+ else if (aProp[i].Name.equals(ITEM_DESCRIPTOR_CONTAINER))
+ aProp[i].Value >>= aMigrationItem.m_xPopupMenu;
+ }
+
+ if (aMigrationItem.m_sCommandURL.getLength())
+ vOldItems.push_back(aMigrationItem);
+ }
+ }
+
+ for (int n=0; n<nNewCount; ++n)
+ {
+ MigrationItem aMigrationItem;
+ if (xIndexNew->getByIndex(n) >>= aProp)
+ {
+ for(int i=0; i<aProp.getLength(); ++i)
+ {
+ if (aProp[i].Name.equals(ITEM_DESCRIPTOR_COMMANDURL))
+ aProp[i].Value >>= aMigrationItem.m_sCommandURL;
+ else if (aProp[i].Name.equals(ITEM_DESCRIPTOR_CONTAINER))
+ aProp[i].Value >>= aMigrationItem.m_xPopupMenu;
+ }
+
+ if (aMigrationItem.m_sCommandURL.getLength())
+ vNewItems.push_back(aMigrationItem);
+ }
+ }
+
+ ::std::vector< MigrationItem >::iterator it;
+
+ ::rtl::OUString sSibling;
+ for (it = vOldItems.begin(); it!=vOldItems.end(); ++it)
+ {
+ ::std::vector< MigrationItem >::iterator pFound = ::std::find(vNewItems.begin(), vNewItems.end(), *it);
+ if (pFound != vNewItems.end() && it->m_xPopupMenu.is())
+ {
+ ::rtl::OUString sName;
+ if (sParent.getLength()>0)
+ sName = sParent + MENU_SEPERATOR + it->m_sCommandURL;
+ else
+ sName = it->m_sCommandURL;
+ compareOldAndNewConfig(sName, it->m_xPopupMenu, pFound->m_xPopupMenu, sResourceURL);
+ }
+ else if (pFound == vNewItems.end())
+ {
+ MigrationItem aMigrationItem(sParent, sSibling, it->m_sCommandURL, it->m_xPopupMenu);
+ if (m_aOldVersionItemsHashMap.find(sResourceURL)==m_aOldVersionItemsHashMap.end())
+ {
+ ::std::vector< MigrationItem > vMigrationItems;
+ m_aOldVersionItemsHashMap.insert(MigrationHashMap::value_type(sResourceURL, vMigrationItems));
+ m_aOldVersionItemsHashMap[sResourceURL].push_back(aMigrationItem);
+ }
+ else
+ {
+ if (::std::find(m_aOldVersionItemsHashMap[sResourceURL].begin(), m_aOldVersionItemsHashMap[sResourceURL].end(), aMigrationItem)==m_aOldVersionItemsHashMap[sResourceURL].end())
+ m_aOldVersionItemsHashMap[sResourceURL].push_back(aMigrationItem);
+ }
+ }
+
+ sSibling = it->m_sCommandURL;
+ }
+
+ ::rtl::OUString sNewSibling;
+ uno::Reference< container::XIndexContainer > xPopup;
+ for (it = vNewItems.begin(); it!=vNewItems.end(); ++it)
+ {
+ ::std::vector< MigrationItem >::iterator pFound = ::std::find(vOldItems.begin(), vOldItems.end(), *it);
+ if (pFound != vOldItems.end() && it->m_xPopupMenu.is())
+ {
+ ::rtl::OUString sName;
+ if (sParent.getLength()>0)
+ sName = sParent + MENU_SEPERATOR + it->m_sCommandURL;
+ else
+ sName = it->m_sCommandURL;
+ compareOldAndNewConfig(sName, pFound->m_xPopupMenu, it->m_xPopupMenu, sResourceURL);
+ }
+ else if (::std::find(vOldItems.begin(), vOldItems.end(), *it) == vOldItems.end())
+ {
+ MigrationItem aMigrationItem(sParent, sSibling, it->m_sCommandURL, it->m_xPopupMenu);
+ if (m_aNewVersionItemsHashMap.find(sResourceURL)==m_aNewVersionItemsHashMap.end())
+ {
+ ::std::vector< MigrationItem > vMigrationItems;
+ m_aNewVersionItemsHashMap.insert(MigrationHashMap::value_type(sResourceURL, vMigrationItems));
+ m_aNewVersionItemsHashMap[sResourceURL].push_back(aMigrationItem);
+ }
+ else
+ {
+ if (::std::find(m_aNewVersionItemsHashMap[sResourceURL].begin(), m_aNewVersionItemsHashMap[sResourceURL].end(), aMigrationItem)==m_aNewVersionItemsHashMap[sResourceURL].end())
+ m_aNewVersionItemsHashMap[sResourceURL].push_back(aMigrationItem);
+ }
+ }
+ }
+}
+
+void MigrationImpl::mergeOldToNewVersion(const uno::Reference< ui::XUIConfigurationManager >& xCfgManager,
+ const uno::Reference< container::XIndexContainer>& xIndexContainer,
+ const ::rtl::OUString& sModuleIdentifier,
+ const ::rtl::OUString& sResourceURL)
+{
+ MigrationHashMap::iterator pFound = m_aOldVersionItemsHashMap.find(sResourceURL);
+ if (pFound==m_aOldVersionItemsHashMap.end())
+ return;
+
+ ::std::vector< MigrationItem >::iterator it;
+ for (it=pFound->second.begin(); it!=pFound->second.end(); ++it)
+ {
+ uno::Reference< container::XIndexContainer > xTemp = xIndexContainer;
+
+ ::rtl::OUString sParentNodeName = it->m_sParentNodeName;
+ sal_Int32 nIndex = 0;
+ do
+ {
+ ::rtl::OUString sToken = sParentNodeName.getToken(0, '|', nIndex).trim();
+ if (sToken.getLength()<=0)
+ break;
+
+ sal_Int32 nCount = xTemp->getCount();
+ for (sal_Int32 i=0; i<nCount; ++i)
+ {
+ ::rtl::OUString sCommandURL;
+ ::rtl::OUString sLabel;
+ uno::Reference< container::XIndexContainer > xChild;
+
+ uno::Sequence< beans::PropertyValue > aPropSeq;
+ xTemp->getByIndex(i) >>= aPropSeq;
+ for (sal_Int32 j=0; j<aPropSeq.getLength(); ++j)
+ {
+ ::rtl::OUString sPropName = aPropSeq[j].Name;
+ if (sPropName.equals(ITEM_DESCRIPTOR_COMMANDURL))
+ aPropSeq[j].Value >>= sCommandURL;
+ else if (sPropName.equals(ITEM_DESCRIPTOR_LABEL))
+ aPropSeq[j].Value >>= sLabel;
+ else if (sPropName.equals(ITEM_DESCRIPTOR_CONTAINER))
+ aPropSeq[j].Value >>= xChild;
+ }
+
+ if (sCommandURL == sToken)
+ {
+ xTemp = xChild;
+ break;
+ }
+ }
+
+ } while (nIndex>=0);
+
+ if (nIndex == -1)
+ {
+ uno::Sequence< beans::PropertyValue > aPropSeq(3);
+
+ aPropSeq[0].Name = ITEM_DESCRIPTOR_COMMANDURL;
+ aPropSeq[0].Value <<= it->m_sCommandURL;
+ aPropSeq[1].Name = ITEM_DESCRIPTOR_LABEL;
+ aPropSeq[1].Value <<= retrieveLabelFromCommand(it->m_sCommandURL, sModuleIdentifier);
+ aPropSeq[2].Name = ITEM_DESCRIPTOR_CONTAINER;
+ aPropSeq[2].Value <<= it->m_xPopupMenu;
+
+ if (it->m_sPrevSibling.getLength() == 0)
+ xTemp->insertByIndex(0, uno::makeAny(aPropSeq));
+ else if (it->m_sPrevSibling.getLength() > 0)
+ {
+ sal_Int32 nCount = xTemp->getCount();
+ sal_Int32 i = 0;
+ for (; i<nCount; ++i)
+ {
+ ::rtl::OUString sCmd;
+ uno::Sequence< beans::PropertyValue > aTempPropSeq;
+ xTemp->getByIndex(i) >>= aTempPropSeq;
+ for (sal_Int32 j=0; j<aTempPropSeq.getLength(); ++j)
+ {
+ if (aTempPropSeq[j].Name.equals(ITEM_DESCRIPTOR_COMMANDURL))
+ {
+ aTempPropSeq[j].Value >>= sCmd;
+ break;
+ }
+ }
+
+ if (sCmd.equals(it->m_sPrevSibling))
+ break;
+ }
+
+ xTemp->insertByIndex(i+1, uno::makeAny(aPropSeq));
+ }
+ }
+ }
+
+ uno::Reference< container::XIndexAccess > xIndexAccess(xIndexContainer, uno::UNO_QUERY);
+ if (xIndexAccess.is())
+ xCfgManager->replaceSettings(sResourceURL, xIndexAccess);
+
+ uno::Reference< ui::XUIConfigurationPersistence > xUIConfigurationPersistence(xCfgManager, uno::UNO_QUERY);
+ if (xUIConfigurationPersistence.is())
+ xUIConfigurationPersistence->store();
+}
+
+uno::Reference< ui::XUIConfigurationManager > NewVersionUIInfo::getConfigManager(const ::rtl::OUString& sModuleShortName) const
+{
+ uno::Reference< ui::XUIConfigurationManager > xCfgManager;
+
+ for (sal_Int32 i=0; i<m_lCfgManagerSeq.getLength(); ++i)
+ {
+ if (m_lCfgManagerSeq[i].Name.equals(sModuleShortName))
+ {
+ m_lCfgManagerSeq[i].Value >>= xCfgManager;
+ break;
+ }
+ }
+
+ return xCfgManager;
+}
+
+uno::Reference< container::XIndexContainer > NewVersionUIInfo::getNewMenubarSettings(const ::rtl::OUString& sModuleShortName) const
+{
+ uno::Reference< container::XIndexContainer > xNewMenuSettings;
+
+ for (sal_Int32 i=0; i<m_lNewVersionMenubarSettingsSeq.getLength(); ++i)
+ {
+ if (m_lNewVersionMenubarSettingsSeq[i].Name.equals(sModuleShortName))
+ {
+ m_lNewVersionMenubarSettingsSeq[i].Value >>= xNewMenuSettings;
+ break;
+ }
+ }
+
+ return xNewMenuSettings;
+}
+
+uno::Reference< container::XIndexContainer > NewVersionUIInfo::getNewToolbarSettings(const ::rtl::OUString& sModuleShortName, const ::rtl::OUString& sToolbarName) const
+{
+ uno::Reference< container::XIndexContainer > xNewToolbarSettings;
+
+ for (sal_Int32 i=0; i<m_lNewVersionToolbarSettingsSeq.getLength(); ++i)
+ {
+ if (m_lNewVersionToolbarSettingsSeq[i].Name.equals(sModuleShortName))
+ {
+ uno::Sequence< beans::PropertyValue > lToolbarSettingsSeq;
+ m_lNewVersionToolbarSettingsSeq[i].Value >>= lToolbarSettingsSeq;
+ for (sal_Int32 j=0; j<lToolbarSettingsSeq.getLength(); ++j)
+ {
+ if (lToolbarSettingsSeq[j].Name.equals(sToolbarName))
+ {
+ lToolbarSettingsSeq[j].Value >>= xNewToolbarSettings;
+ break;
+ }
+ }
+
+ break;
+ }
+ }
+
+ return xNewToolbarSettings;
+}
+
+void NewVersionUIInfo::init(const ::std::vector< MigrationModuleInfo >& vModulesInfo)
+{
+ m_lCfgManagerSeq.realloc(vModulesInfo.size());
+ m_lNewVersionMenubarSettingsSeq.realloc(vModulesInfo.size());
+ m_lNewVersionToolbarSettingsSeq.realloc(vModulesInfo.size());
+
+ const ::rtl::OUString sModuleCfgSupplier = ::rtl::OUString::createFromAscii("com.sun.star.ui.ModuleUIConfigurationManagerSupplier");
+ const ::rtl::OUString sMenubarResourceURL = ::rtl::OUString::createFromAscii("private:resource/menubar/menubar");
+ const ::rtl::OUString sToolbarResourcePre = ::rtl::OUString::createFromAscii("private:resource/toolbar/");
+
+ uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier = uno::Reference< ui::XModuleUIConfigurationManagerSupplier >(::comphelper::getProcessServiceFactory()->createInstance(sModuleCfgSupplier), uno::UNO_QUERY);
+
+ for (sal_uInt32 i=0; i<vModulesInfo.size(); ++i)
+ {
+ ::rtl::OUString sModuleIdentifier = mapModuleShortNameToIdentifier(vModulesInfo[i].sModuleShortName);
+ if (sModuleIdentifier.getLength() > 0)
+ {
+ uno::Reference< ui::XUIConfigurationManager > xCfgManager = xModuleCfgSupplier->getUIConfigurationManager(sModuleIdentifier);
+ m_lCfgManagerSeq[i].Name = vModulesInfo[i].sModuleShortName;
+ m_lCfgManagerSeq[i].Value <<= xCfgManager;
+
+ if (vModulesInfo[i].bHasMenubar)
+ {
+ m_lNewVersionMenubarSettingsSeq[i].Name = vModulesInfo[i].sModuleShortName;
+ m_lNewVersionMenubarSettingsSeq[i].Value <<= xCfgManager->getSettings(sMenubarResourceURL, sal_True);
+ }
+
+ sal_Int32 nToolbars = vModulesInfo[i].m_vToolbars.size();
+ if (nToolbars > 0)
+ {
+ uno::Sequence< beans::PropertyValue > lPropSeq(nToolbars);
+ for (sal_Int32 j=0; j<nToolbars; ++j)
+ {
+ ::rtl::OUString sToolbarName = vModulesInfo[i].m_vToolbars[j];
+ ::rtl::OUString sToolbarResourceURL = sToolbarResourcePre + sToolbarName;
+
+ lPropSeq[j].Name = sToolbarName;
+ lPropSeq[j].Value <<= xCfgManager->getSettings(sToolbarResourceURL, sal_True);
+ }
+
+ m_lNewVersionToolbarSettingsSeq[i].Name = vModulesInfo[i].sModuleShortName;
+ m_lNewVersionToolbarSettingsSeq[i].Value <<= lPropSeq;
+ }
+ }
}
- return vrResult;
}
} // namespace desktop
diff --git a/desktop/source/migration/migration_impl.hxx b/desktop/source/migration/migration_impl.hxx
index b40de510261d..f73e44fea523 100644
--- a/desktop/source/migration/migration_impl.hxx
+++ b/desktop/source/migration/migration_impl.hxx
@@ -30,6 +30,7 @@
#include <vector>
#include <algorithm>
#include <memory>
+#include <hash_map>
#include "migration.hxx"
@@ -41,6 +42,13 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/lang/XSingleComponentFactory.hpp>
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
+#include <com/sun/star/ui/XUIConfigurationManager.hpp>
+#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
#define NS_CSS com::sun::star
#define NS_UNO com::sun::star::uno
@@ -64,7 +72,6 @@ struct migration_step
strings_v excludeFiles;
strings_v includeConfig;
strings_v excludeConfig;
- strings_v configComponents;
strings_v includeExtensions;
strings_v excludeExtensions;
rtl::OUString service;
@@ -81,6 +88,107 @@ typedef std::vector< migration_step > migrations_v;
typedef std::auto_ptr< migrations_v > migrations_vr;
typedef std::vector< supported_migration > migrations_available;
+//__________________________________________
+/**
+ define the item, e.g.:menuitem, toolbaritem, to be migrated. we keep the information
+ of the command URL, the previous sibling node and the parent node of a item
+*/
+struct MigrationItem
+{
+ ::rtl::OUString m_sParentNodeName;
+ ::rtl::OUString m_sPrevSibling;
+ ::rtl::OUString m_sCommandURL;
+ NS_UNO::Reference< NS_CSS::container::XIndexContainer > m_xPopupMenu;
+
+ MigrationItem()
+ :m_xPopupMenu(0)
+ {
+ }
+
+ MigrationItem(const ::rtl::OUString& sParentNodeName,
+ const ::rtl::OUString& sPrevSibling,
+ const ::rtl::OUString& sCommandURL,
+ const NS_UNO::Reference< NS_CSS::container::XIndexContainer > xPopupMenu)
+ {
+ m_sParentNodeName = sParentNodeName;
+ m_sPrevSibling = sPrevSibling;
+ m_sCommandURL = sCommandURL;
+ m_xPopupMenu = xPopupMenu;
+ }
+
+ MigrationItem& operator=(const MigrationItem& aMigrationItem)
+ {
+ m_sParentNodeName = aMigrationItem.m_sParentNodeName;
+ m_sPrevSibling = aMigrationItem.m_sPrevSibling;
+ m_sCommandURL = aMigrationItem.m_sCommandURL;
+ m_xPopupMenu = aMigrationItem.m_xPopupMenu;
+
+ return *this;
+ }
+
+ sal_Bool operator==(const MigrationItem& aMigrationItem)
+ {
+ return ( aMigrationItem.m_sParentNodeName == m_sParentNodeName &&
+ aMigrationItem.m_sPrevSibling == m_sPrevSibling &&
+ aMigrationItem.m_sCommandURL == m_sCommandURL &&
+ aMigrationItem.m_xPopupMenu.is() == m_xPopupMenu.is() );
+ }
+
+ ::rtl::OUString GetPrevSibling() const { return m_sPrevSibling; }
+};
+
+typedef ::std::hash_map< ::rtl::OUString,
+ ::std::vector< MigrationItem >,
+ ::rtl::OUStringHash,
+ ::std::equal_to< ::rtl::OUString > > MigrationHashMap;
+
+struct MigrationItemInfo
+{
+ ::rtl::OUString m_sResourceURL;
+ MigrationItem m_aMigrationItem;
+
+ MigrationItemInfo(){}
+
+ MigrationItemInfo(const ::rtl::OUString& sResourceURL, const MigrationItem& aMigratiionItem)
+ {
+ m_sResourceURL = sResourceURL;
+ m_aMigrationItem = aMigratiionItem;
+ }
+};
+
+//__________________________________________
+/**
+ information for the UI elements to be migrated for one module
+*/
+struct MigrationModuleInfo
+{
+ ::rtl::OUString sModuleShortName;
+ sal_Bool bHasMenubar;
+ ::std::vector< ::rtl::OUString > m_vToolbars;
+
+ MigrationModuleInfo():bHasMenubar(sal_False){};
+};
+
+//__________________________________________
+/**
+ get the information before copying the ui configuration files of old version to new version
+*/
+class NewVersionUIInfo
+{
+public:
+
+ NS_UNO::Reference< NS_CSS::ui::XUIConfigurationManager > getConfigManager(const ::rtl::OUString& sModuleShortName) const;
+ NS_UNO::Reference< NS_CSS::container::XIndexContainer > getNewMenubarSettings(const ::rtl::OUString& sModuleShortName) const;
+ NS_UNO::Reference< NS_CSS::container::XIndexContainer > getNewToolbarSettings(const ::rtl::OUString& sModuleShortName, const ::rtl::OUString& sToolbarName) const;
+ void init(const ::std::vector< MigrationModuleInfo >& vModulesInfo);
+
+private:
+
+ NS_UNO::Sequence< NS_CSS::beans::PropertyValue > m_lCfgManagerSeq;
+ NS_UNO::Sequence< NS_CSS::beans::PropertyValue > m_lNewVersionMenubarSettingsSeq;
+ NS_UNO::Sequence< NS_CSS::beans::PropertyValue > m_lNewVersionToolbarSettingsSeq;
+};
+
class MigrationImpl
{
@@ -92,8 +200,9 @@ private:
migrations_vr m_vrMigrations; // list of all migration specs from config
install_info m_aInfo; // info about the version being migrated
strings_vr m_vrFileList; // final list of files to be copied
- strings_vr m_vrConfigList; // final list of nodes to be copied
- strings_vr m_vrServiceList; // final list of services to be called
+ MigrationHashMap m_aOldVersionItemsHashMap;
+ MigrationHashMap m_aNewVersionItemsHashMap;
+ ::rtl::OUString m_sModuleIdentifier;
// functions to control the migration process
bool readAvailableMigrations(migrations_available&);
@@ -101,8 +210,6 @@ private:
sal_Int32 findPreferedMigrationProcess(const migrations_available&);
install_info findInstallation(const strings_v& rVersions);
strings_vr compileFileList();
- strings_vr compileConfigList();
- strings_vr compileServiceList();
// helpers
void substract(strings_v& va, const strings_v& vb_c) const;
@@ -110,6 +217,16 @@ private:
strings_vr applyPatterns(const strings_v& vSet, const strings_v& vPatterns) const;
NS_UNO::Reference< NS_CSS::container::XNameAccess > getConfigAccess(const sal_Char* path, sal_Bool rw=sal_False);
+ ::std::vector< MigrationModuleInfo > dectectUIChangesForAllModules() const;
+ void compareOldAndNewConfig(const ::rtl::OUString& sParentNodeName,
+ const NS_UNO::Reference< NS_CSS::container::XIndexContainer >& xOldIndexContainer,
+ const NS_UNO::Reference< NS_CSS::container::XIndexContainer >& xNewIndexContainer,
+ const ::rtl::OUString& sToolbarName);
+ void mergeOldToNewVersion(const NS_UNO::Reference< NS_CSS::ui::XUIConfigurationManager >& xCfgManager,
+ const NS_UNO::Reference< NS_CSS::container::XIndexContainer>& xIndexContainer,
+ const ::rtl::OUString& sModuleIdentifier,
+ const ::rtl::OUString& sResourceURL);
+
// actual processing function that perform the migration steps
void copyFiles();
void copyConfig();
diff --git a/desktop/source/migration/pages.cxx b/desktop/source/migration/pages.cxx
index 11cc61ed84ff..53ec488c2082 100644
--- a/desktop/source/migration/pages.cxx
+++ b/desktop/source/migration/pages.cxx
@@ -357,9 +357,9 @@ MigrationPage::MigrationPage(
m_ftBody.SetText( aText );
}
-sal_Bool MigrationPage::commitPage( CommitPageReason _eReason )
+sal_Bool MigrationPage::commitPage( svt::WizardTypes::CommitPageReason _eReason )
{
- if (_eReason == eTravelForward && m_cbMigration.IsChecked() && !m_bMigrationDone)
+ if (_eReason == svt::WizardTypes::eTravelForward && m_cbMigration.IsChecked() && !m_bMigrationDone)
{
GetParent()->EnterWait();
FirstStartWizard* pWizard = dynamic_cast< FirstStartWizard* >( GetParent() );
@@ -433,7 +433,7 @@ UserPage::UserPage( svt::OWizardMachine* parent, const ResId& resid)
}
}
-sal_Bool UserPage::commitPage( CommitPageReason )
+sal_Bool UserPage::commitPage( svt::WizardTypes::CommitPageReason )
{
SvtUserOptions aUserOpt;
aUserOpt.SetFirstName(m_edFirst.GetText());
@@ -463,9 +463,9 @@ UpdateCheckPage::UpdateCheckPage( svt::OWizardMachine* parent, const ResId& resi
_setBold(m_ftHead);
}
-sal_Bool UpdateCheckPage::commitPage( CommitPageReason _eReason )
+sal_Bool UpdateCheckPage::commitPage( svt::WizardTypes::CommitPageReason _eReason )
{
- if ( _eReason == eTravelForward )
+ if ( _eReason == svt::WizardTypes::eTravelForward )
{
try {
Reference < XNameReplace > xUpdateAccess;
@@ -589,9 +589,9 @@ void RegistrationPage::updateButtonStates()
m_rbNever.Show( m_bNeverVisible );
}
-sal_Bool RegistrationPage::commitPage( CommitPageReason _eReason )
+sal_Bool RegistrationPage::commitPage( svt::WizardTypes::CommitPageReason _eReason )
{
- if ( _eReason == eFinish )
+ if ( _eReason == svt::WizardTypes::eFinish )
{
::utl::RegOptions aOptions;
rtl::OUString aEvent;
@@ -665,7 +665,7 @@ void RegistrationPage::executeSingleMode()
// the registration modes "Now" and "Later" are handled by the page
RegistrationPage::RegistrationMode eMode = pPage->getRegistrationMode();
if ( eMode == RegistrationPage::rmNow || eMode == RegistrationPage::rmLater )
- pPage->commitPage( IWizardPage::eFinish );
+ pPage->commitPage( WizardTypes::eFinish );
if ( eMode != RegistrationPage::rmLater )
::utl::RegOptions().removeReminder();
}
diff --git a/desktop/source/migration/pages.hxx b/desktop/source/migration/pages.hxx
index 9740773fe602..776268eb475c 100644
--- a/desktop/source/migration/pages.hxx
+++ b/desktop/source/migration/pages.hxx
@@ -125,7 +125,7 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > m_xThrobber;
public:
MigrationPage( svt::OWizardMachine* parent, const ResId& resid, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > xThrobber );
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( svt::WizardTypes::CommitPageReason _eReason );
protected:
virtual void ActivatePage();
@@ -148,7 +148,7 @@ private:
public:
UserPage( svt::OWizardMachine* parent, const ResId& resid);
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( svt::WizardTypes::CommitPageReason _eReason );
protected:
virtual void ActivatePage();
};
@@ -161,7 +161,7 @@ private:
CheckBox m_cbUpdateCheck;
public:
UpdateCheckPage( svt::OWizardMachine* parent, const ResId& resid);
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( svt::WizardTypes::CommitPageReason _eReason );
protected:
virtual void ActivatePage();
@@ -188,7 +188,7 @@ protected:
virtual bool canAdvance() const;
virtual void ActivatePage();
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( svt::WizardTypes::CommitPageReason _eReason );
public:
RegistrationPage( Window* parent, const ResId& resid);
diff --git a/desktop/source/migration/services/cexports.cxx b/desktop/source/migration/services/cexports.cxx
index c1971e9d4d00..cf9a9ab30b0c 100644
--- a/desktop/source/migration/services/cexports.cxx
+++ b/desktop/source/migration/services/cexports.cxx
@@ -31,7 +31,7 @@
#include "cppuhelper/implementationentry.hxx"
#include "basicmigration.hxx"
#include "wordbookmigration.hxx"
-#include "extensionmigration.hxx"
+//#include "extensionmigration.hxx"
extern "C"
{
@@ -48,11 +48,11 @@ extern "C"
migration::WordbookMigration_getSupportedServiceNames, ::cppu::createSingleComponentFactory,
0, 0
},
- {
- migration::ExtensionMigration_create, migration::ExtensionMigration_getImplementationName,
- migration::ExtensionMigration_getSupportedServiceNames, ::cppu::createSingleComponentFactory,
- 0, 0
- },
+// {
+// migration::ExtensionMigration_create, migration::ExtensionMigration_getImplementationName,
+// migration::ExtensionMigration_getSupportedServiceNames, ::cppu::createSingleComponentFactory,
+// 0, 0
+// },
{ 0, 0, 0, 0, 0, 0 }
};
diff --git a/desktop/source/migration/services/extensionmigration.cxx b/desktop/source/migration/services/extensionmigration.cxx
deleted file mode 100755
index a926f17c0c19..000000000000
--- a/desktop/source/migration/services/extensionmigration.cxx
+++ /dev/null
@@ -1,540 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_desktop.hxx"
-#include "extensionmigration.hxx"
-#include <tools/urlobj.hxx>
-#include <unotools/bootstrap.hxx>
-#include <unotools/ucbstreamhelper.hxx>
-#include <ucbhelper/content.hxx>
-#include <com/sun/star/ucb/XCommandInfo.hpp>
-#include <com/sun/star/ucb/TransferInfo.hpp>
-#include <com/sun/star/ucb/NameClash.hpp>
-#include "comphelper/processfactory.hxx"
-#include "com/sun/star/deployment/XPackageManagerFactory.hpp"
-#include "com/sun/star/ucb/XCommandEnvironment.hpp"
-#include "com/sun/star/xml/sax/XParser.hpp"
-#include "rtl/instance.hxx"
-#include "osl/file.hxx"
-#include "osl/thread.h"
-
-#include "xmlscript/xmllib_imexp.hxx"
-#include "../../deployment/inc/dp_ucb.h"
-
-#ifdef SYSTEM_DB
-#include <db.h>
-#else
-#include <berkeleydb/db.h>
-#endif
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-
-namespace {
-
- struct LibDescriptor :
- public rtl::StaticWithInit<const ::xmlscript::LibDescriptorArray, LibDescriptor> {
- const ::xmlscript::LibDescriptorArray operator () () {
-
-
- return ::xmlscript::LibDescriptorArray();
- }
-};
-}
-//.........................................................................
-namespace migration
-{
-//.........................................................................
-
-
- static ::rtl::OUString sExtensionSubDir = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/uno_packages/" ) );
- static ::rtl::OUString sSubDirName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "cache" ) );
- static ::rtl::OUString sConfigDir = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/registry/data" ) );
- static ::rtl::OUString sOrgDir = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/registry/data/org" ) );
- static ::rtl::OUString sExcludeDir1 = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/registry/data/org" ) );
- static ::rtl::OUString sExcludeDir2 = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/registry/data/org/openoffice" ) );
-
- static ::rtl::OUString sBasicType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.star.basic-library"));
- static ::rtl::OUString sDialogType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.star.dialog-library"));
-
- static ::rtl::OUString sConfigurationDataType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.star.configuration-data"));
- static ::rtl::OUString sConfigurationSchemaType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.star.configuration-schema"));
-
- // =============================================================================
- // component operations
- // =============================================================================
-
- ::rtl::OUString ExtensionMigration_getImplementationName()
- {
- static ::rtl::OUString* pImplName = 0;
- if ( !pImplName )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if ( !pImplName )
- {
- static ::rtl::OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.desktop.migration.Extensions" ) );
- pImplName = &aImplName;
- }
- }
- return *pImplName;
- }
-
- // -----------------------------------------------------------------------------
-
- Sequence< ::rtl::OUString > ExtensionMigration_getSupportedServiceNames()
- {
- static Sequence< ::rtl::OUString >* pNames = 0;
- if ( !pNames )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if ( !pNames )
- {
- static Sequence< ::rtl::OUString > aNames(1);
- aNames.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.migration.Extensions" ) );
- pNames = &aNames;
- }
- }
- return *pNames;
- }
-
- // =============================================================================
- // ExtensionMigration
- // =============================================================================
-
- ExtensionMigration::ExtensionMigration(Reference< XComponentContext > const & ctx) :
- m_ctx(ctx)
- {
- }
-
- // -----------------------------------------------------------------------------
-
- ExtensionMigration::~ExtensionMigration()
- {
- }
-
- ::osl::FileBase::RC ExtensionMigration::checkAndCreateDirectory( INetURLObject& rDirURL )
- {
- ::osl::FileBase::RC aResult = ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) );
- if ( aResult == ::osl::FileBase::E_NOENT )
- {
- INetURLObject aBaseURL( rDirURL );
- aBaseURL.removeSegment();
- checkAndCreateDirectory( aBaseURL );
- return ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) );
- }
- else
- {
- return aResult;
- }
- }
-
- void ExtensionMigration::prepareBasicLibs()
- {
- prepareBasicLibs(m_sSourceDir + ::rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("/user/basic/script.xlc")), m_scriptElements);
- prepareBasicLibs(m_sSourceDir + ::rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("/user/basic/dialog.xlc")), m_dialogElements);
- }
-
- void ExtensionMigration::prepareBasicLibs(const ::rtl::OUString & sURL,
- ::xmlscript::LibDescriptorArray & out_elements)
- {
-
- ::ucbhelper::Content ucb_content;
- if (dp_misc::create_ucb_content( &ucb_content, sURL,
- uno::Reference< ucb::XCommandEnvironment>(), false /* no throw */ ))
- {
- uno::Reference<xml::sax::XParser> xParser(
- m_ctx->getServiceManager()->createInstanceWithContext(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser")),
- m_ctx ), UNO_QUERY_THROW );
-
- xParser->setDocumentHandler( ::xmlscript::importLibraryContainer( &out_elements ) );
- xml::sax::InputSource source;
- source.aInputStream = ucb_content.openStream();
- source.sSystemId = ucb_content.getURL();
- xParser->parseStream( source );
- }
- //else
- //The file need not exists
- }
- /* Checks if basic package is enabled in StarOffice 8. This is the case when the dialog.xlc or
- the script.xlc in the user installation contains an entry for this package.
- The passed package MUST be a basic package.
- */
- bool ExtensionMigration::isBasicPackageEnabled( const uno::Reference< deployment::XPackage > & xPkg)
- {
- ::rtl::OUString sScriptURL = xPkg->getURL();
- if ( sScriptURL[ sScriptURL.getLength()-1 ] != '/' )
- sScriptURL += ::rtl::OUString::createFromAscii("/");
- sScriptURL += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("script.xlb") );
-
- bool bEntryFound = false;
- for ( sal_Int32 nPos = m_scriptElements.mnLibCount; nPos--; )
- {
- ::xmlscript::LibDescriptor const & descr =
- m_scriptElements.mpLibs[ nPos ];
-
- if (descr.aStorageURL.equals(sScriptURL))
- {
- bEntryFound = true;
- break;
- }
- }
-
- ::rtl::OUString sDialogURL = xPkg->getURL();
- if ( sDialogURL[ sDialogURL.getLength()-1 ] != '/' )
- sDialogURL += ::rtl::OUString::createFromAscii("/");
- sScriptURL += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("dialog.xlb") );
-
- if (!bEntryFound)
- {
- for ( sal_Int32 nPos = m_dialogElements.mnLibCount; nPos--; )
- {
- ::xmlscript::LibDescriptor const & descr =
- m_dialogElements.mpLibs[ nPos ];
-
- if (descr.aStorageURL.equals(sDialogURL))
- {
- bEntryFound = true;
- break;
- }
- }
- }
- return bEntryFound;
- }
- /* This function only registers basic and dialog packages.
- */
- void ExtensionMigration::registerBasicPackage( const uno::Reference< deployment::XPackage > & xPkg)
- {
- const ::rtl::OUString sMediaType = xPkg->getPackageType()->getMediaType();
- if ( (sMediaType.equals(sBasicType) || sMediaType.equals(sDialogType))
- && isBasicPackageEnabled(xPkg))
- {
- xPkg->registerPackage(uno::Reference< task::XAbortChannel >(),
- uno::Reference< ucb::XCommandEnvironment> ());
- }
- }
-
- bool ExtensionMigration::processExtensions( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir )
- {
- if (!copy(sSourceDir, sTargetDir))
- return false;
-
- // Find all basic and script packages and reregister them
- uno::Reference< deployment::XPackageManagerFactory > xPMF;
- if (! ( m_ctx->getValueByName( ::rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.deployment.thePackageManagerFactory")))
- >>= xPMF))
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "ExtensionsMigration: could not get thePackageManagerFactory")), 0);
-
- const uno::Reference< deployment::XPackageManager > xPackageMgr =
- xPMF->getPackageManager(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user")));
-
- if (!xPackageMgr.is())
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "ExtensionsMigration: could not get XPackageManager")), 0);
-
- const uno::Sequence< uno::Reference< deployment::XPackage > > allPackages =
- xPackageMgr->getDeployedPackages(
- uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
-
- for (int i = 0; i < allPackages.getLength(); i ++)
- {
- const uno::Reference< deployment::XPackage > aPackage = allPackages[i];
- if ( aPackage->isBundle() )
- {
- const uno::Sequence< uno::Reference < deployment::XPackage > > seqPkg =
- aPackage->getBundle(
- uno::Reference< task::XAbortChannel >(),
- uno::Reference< ucb::XCommandEnvironment> ());
-
- for ( int k = 0; k < seqPkg.getLength(); k++ )
- registerBasicPackage(seqPkg[k]);
-
- for (int l = 0; l < seqPkg.getLength(); l++)
- {
- const ::rtl::OUString sMediaType = seqPkg[l]->getPackageType()->getMediaType();
- beans::Optional<beans::Ambiguous<sal_Bool> > opt =
- seqPkg[l]->isRegistered(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
- bool bRegistered = opt.IsPresent && opt.Value.IsAmbiguous == sal_False && opt.Value.Value == sal_True ? true : false;
-
- if ( bRegistered && !sMediaType.equals(sBasicType) && !sMediaType.equals(sDialogType) )
- {
- seqPkg[l]->revokePackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
- seqPkg[l]->registerPackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
- }
- }
- }
- else
- {
- registerBasicPackage(aPackage);
- {
- aPackage->revokePackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
- aPackage->registerPackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
- }
- }
- }
-
-
- return true;
-
- }
-
-bool ExtensionMigration::isCompatibleBerkleyDb(const ::rtl::OUString& sSourceDir)
-{
- try
- {
- ::rtl::OUString sDb(sSourceDir + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "/uno_packages.db")));
- //check if the db exist at all. If not then the call to db_create would create
- //the file.
- ::osl::File f(sDb);
- if (::osl::File::E_None != f.open(OpenFlag_Read))
- {
- f.close();
- return false;
- }
- f.close();
-
- //create a system path
- ::rtl::OUString sSysPath;
- if (::osl::File::getSystemPathFromFileURL(sDb, sSysPath ) != ::osl::File::E_None)
- return false;
-
- ::rtl::OString cstr_sysPath(
- ::rtl::OUStringToOString( sSysPath, osl_getThreadTextEncoding() ) );
- char const * pcstr_sysPath = cstr_sysPath.getStr();
-
- //Open the db. If it works then we assume that the file was written with a
- //compatible version of Berkeley Db
- DB* pDB = NULL;
- //using DB_RDONLY will return an "Invalid argument" error.
- //DB_CREATE: only creates the file if it does not exist.
- //An existing db is not modified.
- if (0 != db_create(& pDB, 0, DB_CREATE))
- return false;
-
- if (0 != pDB->open(pDB, 0, pcstr_sysPath , 0, DB_HASH, DB_RDONLY, 0664 /* fs mode */))
- return false;
-
- pDB->close(pDB, 0);
- }
- catch (uno::Exception& )
- {
- return false;
- }
-
- return true;
-}
-
-bool ExtensionMigration::copy( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir )
-{
- bool bRet = false;
- if (! isCompatibleBerkleyDb(sSourceDir))
- return false;
-
- INetURLObject aSourceObj( sSourceDir );
- INetURLObject aDestObj( sTargetDir );
- String aName = aDestObj.getName();
- aDestObj.removeSegment();
- aDestObj.setFinalSlash();
-
- try
- {
- ::ucbhelper::Content aDestPath( aDestObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment > () );
- uno::Reference< ucb::XCommandInfo > xInfo = aDestPath.getCommands();
- ::rtl::OUString aTransferName = ::rtl::OUString::createFromAscii( "transfer" );
- if ( xInfo->hasCommandByName( aTransferName ) )
- {
- aDestPath.executeCommand( aTransferName, uno::makeAny(
- ucb::TransferInfo( sal_False, aSourceObj.GetMainURL( INetURLObject::NO_DECODE ), aName, ucb::NameClash::OVERWRITE ) ) );
- bRet = true;
- }
- }
- catch( uno::Exception& )
- {
- }
-
- return bRet;
-}
-
-
- // -----------------------------------------------------------------------------
- // XServiceInfo
- // -----------------------------------------------------------------------------
-
- ::rtl::OUString ExtensionMigration::getImplementationName() throw (RuntimeException)
- {
- return ExtensionMigration_getImplementationName();
- }
-
- // -----------------------------------------------------------------------------
-
- sal_Bool ExtensionMigration::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException)
- {
- Sequence< ::rtl::OUString > aNames( getSupportedServiceNames() );
- const ::rtl::OUString* pNames = aNames.getConstArray();
- const ::rtl::OUString* pEnd = pNames + aNames.getLength();
- for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames )
- ;
-
- return pNames != pEnd;
- }
-
- // -----------------------------------------------------------------------------
-
- Sequence< ::rtl::OUString > ExtensionMigration::getSupportedServiceNames() throw (RuntimeException)
- {
- return ExtensionMigration_getSupportedServiceNames();
- }
-
- // -----------------------------------------------------------------------------
- // XInitialization
- // -----------------------------------------------------------------------------
-
- void ExtensionMigration::initialize( const Sequence< Any >& aArguments ) throw (Exception, RuntimeException)
- {
- ::osl::MutexGuard aGuard( m_aMutex );
-
- const Any* pIter = aArguments.getConstArray();
- const Any* pEnd = pIter + aArguments.getLength();
- for ( ; pIter != pEnd ; ++pIter )
- {
- beans::NamedValue aValue;
- *pIter >>= aValue;
- if ( aValue.Name.equalsAscii( "UserData" ) )
- {
- if ( !(aValue.Value >>= m_sSourceDir) )
- {
- OSL_ENSURE( false, "ExtensionMigration::initialize: argument UserData has wrong type!" );
- }
- break;
- }
- }
- prepareBasicLibs();
- }
-
- TStringVectorPtr getContent( const ::rtl::OUString& rBaseURL )
- {
- TStringVectorPtr aResult( new TStringVector );
- ::osl::Directory aDir( rBaseURL);
- if ( aDir.open() == ::osl::FileBase::E_None )
- {
- // iterate over directory content
- TStringVector aSubDirs;
- ::osl::DirectoryItem aItem;
- while ( aDir.getNextItem( aItem ) == ::osl::FileBase::E_None )
- {
- ::osl::FileStatus aFileStatus( FileStatusMask_Type | FileStatusMask_FileURL );
- if ( aItem.getFileStatus( aFileStatus ) == ::osl::FileBase::E_None )
- aResult->push_back( aFileStatus.getFileURL() );
- }
- }
-
- return aResult;
- }
-
- // -----------------------------------------------------------------------------
- // XJob
- // -----------------------------------------------------------------------------
-
-void ExtensionMigration::copyConfig( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir )
-{
- ::rtl::OUString sEx1( m_sSourceDir );
- sEx1 += sExcludeDir1;
- ::rtl::OUString sEx2( m_sSourceDir );
- sEx2 += sExcludeDir2;
-
- TStringVectorPtr aList = getContent( sSourceDir );
- TStringVector::const_iterator aI = aList->begin();
- while ( aI != aList->end() )
- {
- ::rtl::OUString sSourceLocalName = aI->copy( sSourceDir.getLength() );
- ::rtl::OUString aTemp = aI->copy( m_sSourceDir.getLength() );
- if ( aTemp != sExcludeDir1 && aTemp != sExcludeDir2 )
- {
- ::rtl::OUString sTargetName = sTargetDir + sSourceLocalName;
- copy( (*aI), sTargetName );
- }
- ++aI;
- }
-}
-
- Any ExtensionMigration::execute( const Sequence< beans::NamedValue >& )
- throw (lang::IllegalArgumentException, Exception, RuntimeException)
- {
- ::osl::MutexGuard aGuard( m_aMutex );
-
- ::utl::Bootstrap::PathStatus aStatus = ::utl::Bootstrap::locateUserInstallation( m_sTargetDir );
- if ( aStatus == ::utl::Bootstrap::PATH_EXISTS )
- {
- // copy all extensions
- ::rtl::OUString sTargetDir(m_sTargetDir), sSourceDir( m_sSourceDir );
- sTargetDir += sExtensionSubDir;
- sSourceDir += sExtensionSubDir;
- sSourceDir += sSubDirName;
- sTargetDir += sSubDirName;
- processExtensions( sSourceDir, sTargetDir );
-
- // copy all user config settings in user/registry/data (except user/registry/data/org)
- sSourceDir = m_sSourceDir;
- sSourceDir += sConfigDir;
- sTargetDir = m_sTargetDir;
- sTargetDir += sConfigDir;
- copyConfig( sSourceDir, sTargetDir );
-
- // copy all user config settings in user/registry/data/org (except user/registry/data/org/openoffice)
- sSourceDir = m_sSourceDir;
- sSourceDir += sOrgDir;
- sTargetDir = m_sTargetDir;
- sTargetDir += sOrgDir;
- copyConfig( sSourceDir, sTargetDir );
- }
-
- return Any();
- }
-
- // =============================================================================
- // component operations
- // =============================================================================
-
- Reference< XInterface > SAL_CALL ExtensionMigration_create(
- Reference< XComponentContext > const & ctx )
- SAL_THROW( () )
- {
- return static_cast< lang::XTypeProvider * >( new ExtensionMigration(
- ctx) );
- }
-
- // -----------------------------------------------------------------------------
-
-//.........................................................................
-} // namespace migration
-//.........................................................................
diff --git a/desktop/source/migration/services/extensionmigration.hxx b/desktop/source/migration/services/extensionmigration.hxx
deleted file mode 100755
index 70f6a4c44c9b..000000000000
--- a/desktop/source/migration/services/extensionmigration.hxx
+++ /dev/null
@@ -1,130 +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 _DESKTOP_EXTENSIONMIGRATION_HXX_
-#define _DESKTOP_EXTENSIONMIGRATION_HXX_
-
-#include "misc.hxx"
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/task/XJob.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <cppuhelper/implbase3.hxx>
-#include <osl/mutex.hxx>
-#include <osl/file.hxx>
-#include "xmlscript/xmllib_imexp.hxx"
-
-namespace com { namespace sun { namespace star {
- namespace uno {
- class XComponentContext;
- }
- namespace deployment {
- class XPackage;
- }
-}}}
-
-
-
-class INetURLObject;
-
-
-//.........................................................................
-namespace migration
-{
-//.........................................................................
-
- ::rtl::OUString SAL_CALL ExtensionMigration_getImplementationName();
- ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL ExtensionMigration_getSupportedServiceNames();
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ExtensionMigration_create(
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext )
- SAL_THROW( (::com::sun::star::uno::Exception) );
-
-
- // =============================================================================
- // class ExtensionMigration
- // =============================================================================
-
- typedef ::cppu::WeakImplHelper3<
- ::com::sun::star::lang::XServiceInfo,
- ::com::sun::star::lang::XInitialization,
- ::com::sun::star::task::XJob > ExtensionMigration_BASE;
-
- class ExtensionMigration : public ExtensionMigration_BASE
- {
- private:
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_ctx;
- ::osl::Mutex m_aMutex;
- ::rtl::OUString m_sSourceDir;
- ::rtl::OUString m_sTargetDir;
-
- ::xmlscript::LibDescriptorArray m_scriptElements;
- ::xmlscript::LibDescriptorArray m_dialogElements;
-
- ::osl::FileBase::RC checkAndCreateDirectory( INetURLObject& rDirURL );
- void copyConfig( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir );
- bool isCompatibleBerkleyDb(const ::rtl::OUString& sSourceDir);
- bool copy( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir );
- bool processExtensions( const ::rtl::OUString& sSourceDir,
- const ::rtl::OUString& sTargetDir );
- /* fills m_scriptElements and m_dialogElements
- */
- void prepareBasicLibs();
- void prepareBasicLibs(const ::rtl::OUString & sURL,
- ::xmlscript::LibDescriptorArray & out_elements);
- bool isBasicPackageEnabled( const ::com::sun::star::uno::Reference<
- ::com::sun::star::deployment::XPackage > & xPkg);
- void registerBasicPackage(
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > & xPkg);
-
- public:
- ExtensionMigration(::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XComponentContext > const & ctx);
- virtual ~ExtensionMigration();
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName()
- throw (::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName )
- throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
- throw (::com::sun::star::uno::RuntimeException);
-
- // XInitialization
- virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
- throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
-
- // XJob
- virtual ::com::sun::star::uno::Any SAL_CALL execute(
- const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Arguments )
- throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::Exception,
- ::com::sun::star::uno::RuntimeException);
- };
-
-//.........................................................................
-} // namespace migration
-//.........................................................................
-
-#endif // _DESKTOP_AUTOCORRMIGRATION_HXX_
diff --git a/desktop/source/migration/services/makefile.mk b/desktop/source/migration/services/makefile.mk
index 64adfe70b7b2..2f3eb9308ebd 100644
--- a/desktop/source/migration/services/makefile.mk
+++ b/desktop/source/migration/services/makefile.mk
@@ -51,7 +51,6 @@ SLOFILES= \
$(SLO)$/cexports.obj \
$(SLO)$/basicmigration.obj \
$(SLO)$/wordbookmigration.obj \
- $(SLO)$/extensionmigration.obj \
$(SLO)$/autocorrmigration.obj \
$(SLO)$/oo3extensionmigration.obj \
$(SLO)$/cexportsoo3.obj
@@ -61,11 +60,10 @@ SHL1OBJS= \
$(SLO)$/cexports.obj \
$(SLO)$/basicmigration.obj \
$(SLO)$/wordbookmigration.obj \
- $(SLO)$/extensionmigration.obj \
$(SLO)$/autocorrmigration.obj
SHL1TARGET=$(TARGET)
-SHL1VERSIONMAP = migrationoo2.map
+SHL1VERSIONMAP = $(SOLARENV)/src/component.map
SHL1STDLIBS= \
$(DEPLOYMENTMISCLIB) \
diff --git a/desktop/source/migration/services/migrationoo2.map b/desktop/source/migration/services/migrationoo2.map
deleted file mode 100644
index ac2c3750bfe0..000000000000
--- a/desktop/source/migration/services/migrationoo2.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 11bf8129cc04..2e3a8d1d518c 100755
--- a/desktop/source/migration/services/oo3extensionmigration.cxx
+++ b/desktop/source/migration/services/oo3extensionmigration.cxx
@@ -43,8 +43,6 @@
#include <comphelper/processfactory.hxx>
#include <ucbhelper/content.hxx>
-#include <com/sun/star/deployment/thePackageManagerFactory.hpp>
-#include <com/sun/star/deployment/XPackageManagerFactory.hpp>
#include <com/sun/star/task/XInteractionApprove.hpp>
#include <com/sun/star/task/XInteractionAbort.hpp>
#include <com/sun/star/ucb/XCommandInfo.hpp>
@@ -52,6 +50,8 @@
#include <com/sun/star/ucb/NameClash.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/xml/xpath/XXPathAPI.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/deployment/ExtensionManager.hpp>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -139,17 +139,7 @@ OO3ExtensionMigration::~OO3ExtensionMigration()
}
}
-void OO3ExtensionMigration::registerConfigurationPackage( const uno::Reference< deployment::XPackage > & xPkg)
-{
- const ::rtl::OUString sMediaType = xPkg->getPackageType()->getMediaType();
- if ( (sMediaType.equals(sConfigurationDataType) || sMediaType.equals(sConfigurationSchemaType) ) )
- {
- xPkg->revokePackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
- xPkg->registerPackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
- }
-}
-
- void OO3ExtensionMigration::scanUserExtensions( const ::rtl::OUString& sSourceDir, TStringVector& aMigrateExtensions )
+void OO3ExtensionMigration::scanUserExtensions( const ::rtl::OUString& sSourceDir, TStringVector& aMigrateExtensions )
{
osl::Directory aScanRootDir( sSourceDir );
osl::FileStatus fs(FileStatusMask_Type | FileStatusMask_FileURL);
@@ -342,18 +332,17 @@ bool OO3ExtensionMigration::scanDescriptionXml( const ::rtl::OUString& sDescript
bool OO3ExtensionMigration::migrateExtension( const ::rtl::OUString& sSourceDir )
{
- if ( !m_xPackageManager.is() )
+ if ( !m_xExtensionManager.is() )
{
try
{
- m_xPackageManager = deployment::thePackageManagerFactory::get( m_ctx )->getPackageManager(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "user" )) );
+ m_xExtensionManager = deployment::ExtensionManager::get( m_ctx );
}
catch ( ucb::CommandFailedException & ){}
catch ( uno::RuntimeException & ) {}
}
- if ( m_xPackageManager.is() )
+ if ( m_xExtensionManager.is() )
{
try
{
@@ -363,7 +352,9 @@ bool OO3ExtensionMigration::migrateExtension( const ::rtl::OUString& sSourceDir
static_cast< cppu::OWeakObject* >( pCmdEnv ), uno::UNO_QUERY );
uno::Reference< task::XAbortChannel > xAbortChannel;
uno::Reference< deployment::XPackage > xPackage =
- m_xPackageManager->addPackage( sSourceDir, ::rtl::OUString(), xAbortChannel, xCmdEnv );
+ m_xExtensionManager->addExtension(
+ sSourceDir, uno::Sequence<beans::NamedValue>(),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user")), xAbortChannel, xCmdEnv );
if ( xPackage.is() )
return true;
@@ -382,35 +373,6 @@ bool OO3ExtensionMigration::migrateExtension( const ::rtl::OUString& sSourceDir
return false;
}
-bool OO3ExtensionMigration::copy( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir )
-{
- bool bRet = false;
-
- INetURLObject aSourceObj( sSourceDir );
- INetURLObject aDestObj( sTargetDir );
- String aName = aDestObj.getName();
- aDestObj.removeSegment();
- aDestObj.setFinalSlash();
-
- try
- {
- ::ucbhelper::Content aDestPath( aDestObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment > () );
- uno::Reference< ucb::XCommandInfo > xInfo = aDestPath.getCommands();
- ::rtl::OUString aTransferName = ::rtl::OUString::createFromAscii( "transfer" );
- if ( xInfo->hasCommandByName( aTransferName ) )
- {
- aDestPath.executeCommand( aTransferName, uno::makeAny(
- ucb::TransferInfo( sal_False, aSourceObj.GetMainURL( INetURLObject::NO_DECODE ), aName, ucb::NameClash::OVERWRITE ) ) );
- bRet = true;
- }
- }
- catch( uno::Exception& )
- {
- }
-
- return bRet;
-}
-
// -----------------------------------------------------------------------------
// XServiceInfo
@@ -496,32 +458,6 @@ TStringVectorPtr getContent( const ::rtl::OUString& rBaseURL )
return aResult;
}
-// -----------------------------------------------------------------------------
-// XJob
-// -----------------------------------------------------------------------------
-
-void OO3ExtensionMigration::copyConfig( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir )
-{
- ::rtl::OUString sEx1( m_sSourceDir );
- sEx1 += sExcludeDir1;
- ::rtl::OUString sEx2( m_sSourceDir );
- sEx2 += sExcludeDir2;
-
- TStringVectorPtr aList = getContent( sSourceDir );
- TStringVector::const_iterator aI = aList->begin();
- while ( aI != aList->end() )
- {
- ::rtl::OUString sSourceLocalName = aI->copy( sSourceDir.getLength() );
- ::rtl::OUString aTemp = aI->copy( m_sSourceDir.getLength() );
- if ( aTemp != sExcludeDir1 && aTemp != sExcludeDir2 )
- {
- ::rtl::OUString sTargetName = sTargetDir + sSourceLocalName;
- copy( (*aI), sTargetName );
- }
- ++aI;
- }
-}
-
Any OO3ExtensionMigration::execute( const Sequence< beans::NamedValue >& )
throw (lang::IllegalArgumentException, Exception, RuntimeException)
{
@@ -559,12 +495,6 @@ TmpRepositoryCommandEnv::TmpRepositoryCommandEnv()
{
}
-TmpRepositoryCommandEnv::TmpRepositoryCommandEnv(
- uno::Reference< task::XInteractionHandler> const & handler)
- : m_forwardHandler(handler)
-{
-}
-
TmpRepositoryCommandEnv::~TmpRepositoryCommandEnv()
{
}
diff --git a/desktop/source/migration/services/oo3extensionmigration.hxx b/desktop/source/migration/services/oo3extensionmigration.hxx
index a001f41d92c5..03995652888c 100755
--- a/desktop/source/migration/services/oo3extensionmigration.hxx
+++ b/desktop/source/migration/services/oo3extensionmigration.hxx
@@ -37,7 +37,7 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/xml/dom/XDocumentBuilder.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
-#include <com/sun/star/deployment/XPackageManager.hpp>
+#include <com/sun/star/deployment/XExtensionManager.hpp>
#include <osl/mutex.hxx>
#include <osl/file.hxx>
@@ -83,7 +83,7 @@ namespace migration
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_ctx;
::com::sun::star::uno::Reference< ::com::sun::star::xml::dom::XDocumentBuilder > m_xDocBuilder;
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > m_xSimpleFileAccess;
- ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > m_xPackageManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager > m_xExtensionManager;
::osl::Mutex m_aMutex;
::rtl::OUString m_sSourceDir;
::rtl::OUString m_sTargetDir;
@@ -97,16 +97,10 @@ namespace migration
};
::osl::FileBase::RC checkAndCreateDirectory( INetURLObject& rDirURL );
- void copyConfig( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir );
- bool copy( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir );
ScanResult scanExtensionFolder( const ::rtl::OUString& sExtFolder );
void scanUserExtensions( const ::rtl::OUString& sSourceDir, TStringVector& aMigrateExtensions );
bool scanDescriptionXml( const ::rtl::OUString& sDescriptionXmlFilePath );
bool migrateExtension( const ::rtl::OUString& sSourceDir );
- /* fills m_scriptElements and m_dialogElements
- */
- void registerConfigurationPackage(
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > & xPkg);
public:
OO3ExtensionMigration(::com::sun::star::uno::Reference<
@@ -142,8 +136,6 @@ namespace migration
public:
virtual ~TmpRepositoryCommandEnv();
TmpRepositoryCommandEnv();
- TmpRepositoryCommandEnv(
- ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler> const & handler);
// XCommandEnvironment
virtual ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > SAL_CALL
diff --git a/desktop/source/migration/wizard.cxx b/desktop/source/migration/wizard.cxx
index 48ee2abc71ca..81a789a613b9 100644
--- a/desktop/source/migration/wizard.cxx
+++ b/desktop/source/migration/wizard.cxx
@@ -219,11 +219,6 @@ FirstStartWizard::FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAccep
defaultButton(WZB_NEXT);
}
-void FirstStartWizard::EnableButtonsWhileMigration()
-{
- enableButtons(0xff, sal_True);
-}
-
void FirstStartWizard::DisableButtonsWhileMigration()
{
enableButtons(0xff, sal_False);
@@ -439,10 +434,10 @@ sal_Bool FirstStartWizard::leaveState(WizardState)
return sal_True;
}
-sal_Bool FirstStartWizard::onFinish(sal_Int32 _nResult)
+sal_Bool FirstStartWizard::onFinish()
{
// return sal_True;
- if (svt::RoadmapWizard::onFinish(_nResult))
+ if ( svt::RoadmapWizard::onFinish() )
{
#ifndef OS2 // cannot enable quickstart on first startup, see shutdownicon.cxx comments.
enableQuickstart();
diff --git a/desktop/source/migration/wizard.hxx b/desktop/source/migration/wizard.hxx
index e41bfe373cde..3317880f8bd6 100644
--- a/desktop/source/migration/wizard.hxx
+++ b/desktop/source/migration/wizard.hxx
@@ -62,7 +62,6 @@ public:
virtual short Execute();
virtual long PreNotify( NotifyEvent& rNEvt );
- void EnableButtonsWhileMigration();
void DisableButtonsWhileMigration();
private:
@@ -97,7 +96,7 @@ protected:
virtual TabPage* createPage(WizardState _nState);
virtual sal_Bool prepareLeaveCurrentState( CommitPageReason _eReason );
virtual sal_Bool leaveState(WizardState _nState );
- virtual sal_Bool onFinish(sal_Int32 _nResult);
+ virtual sal_Bool onFinish();
virtual void enterState(WizardState _nState);
// from svt::RoadmapWizard
diff --git a/desktop/source/offacc/acceptor.cxx b/desktop/source/offacc/acceptor.cxx
index 4eee12f5949a..4e100fd99665 100644
--- a/desktop/source/offacc/acceptor.cxx
+++ b/desktop/source/offacc/acceptor.cxx
@@ -67,6 +67,7 @@ Acceptor::Acceptor( const Reference< XMultiServiceFactory >& rFactory )
, m_aConnectString()
, m_aProtocol()
, m_bInit(sal_False)
+ , m_bDying(false)
{
m_rSMgr = rFactory;
m_rAcceptor = Reference< XAcceptor > (m_rSMgr->createInstance(
@@ -88,6 +89,9 @@ Acceptor::~Acceptor()
osl::MutexGuard g(m_aMutex);
t = m_thread;
}
+ //prevent locking if the thread is still waiting
+ m_bDying = true;
+ m_cEnable.set();
osl_joinWithThread(t);
{
// Make the final state of m_bridges visible to this thread (since
@@ -117,6 +121,8 @@ void SAL_CALL Acceptor::run()
RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109)"\
"Acceptor::run waiting for office to come up");
m_cEnable.wait();
+ if (m_bDying) //see destructor
+ break;
RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109)"\
"Acceptor::run now enabled and continuing");
diff --git a/desktop/source/offacc/acceptor.hxx b/desktop/source/offacc/acceptor.hxx
index 1693dd8b75d0..87f50db032dd 100644
--- a/desktop/source/offacc/acceptor.hxx
+++ b/desktop/source/offacc/acceptor.hxx
@@ -83,6 +83,7 @@ private:
OUString m_aProtocol;
sal_Bool m_bInit;
+ bool m_bDying;
public:
Acceptor( const Reference< XMultiServiceFactory >& aFactory );
diff --git a/desktop/source/offacc/exports.map b/desktop/source/offacc/exports.map
deleted file mode 100644
index ba501f9ae076..000000000000
--- a/desktop/source/offacc/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/desktop/source/offacc/makefile.mk b/desktop/source/offacc/makefile.mk
index fb5cb9ab936c..c2d53930b580 100644
--- a/desktop/source/offacc/makefile.mk
+++ b/desktop/source/offacc/makefile.mk
@@ -47,7 +47,7 @@ SHL1OBJS= $(SLOFILES)
SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
SHL1IMPLIB= i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index 2acd4f79a781..a9a0c8271373 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -35,13 +35,16 @@
#include "tools/extendapplicationenvironment.hxx"
#include "rtl/ustrbuf.hxx"
#include "rtl/uri.hxx"
+#include "rtl/bootstrap.hxx"
#include "osl/thread.h"
#include "osl/process.h"
#include "osl/conditn.hxx"
#include "cppuhelper/implbase1.hxx"
#include "cppuhelper/exc_hlp.hxx"
#include "comphelper/anytostring.hxx"
-#include "com/sun/star/deployment/thePackageManagerFactory.hpp"
+#include "comphelper/sequence.hxx"
+#include "com/sun/star/deployment/ExtensionManager.hpp"
+
#include "com/sun/star/deployment/ui/PackageManagerDialog.hpp"
#include "com/sun/star/ui/dialogs/XExecutableDialog.hpp"
#include "com/sun/star/lang/DisposedException.hpp"
@@ -59,10 +62,24 @@ using ::rtl::OUString;
namespace css = ::com::sun::star;
namespace {
+struct ExtensionName
+{
+ OUString m_str;
+ ExtensionName( OUString const & str ) : m_str( str ) {}
+ bool operator () ( Reference<deployment::XPackage> const & e ) const
+ {
+ if (m_str.equals(dp_misc::getIdentifier(e))
+ || m_str.equals(e->getName()))
+ return true;
+ return false;
+ }
+};
+
//------------------------------------------------------------------------------
const char s_usingText [] =
"\n"
"using: " APP_NAME " add <options> extension-path...\n"
+" " APP_NAME " validate <options> extension-identifier...\n"
" " APP_NAME " remove <options> extension-identifier...\n"
" " APP_NAME " list <options> extension-identifier...\n"
" " APP_NAME " reinstall <options>\n"
@@ -72,6 +89,8 @@ const char s_usingText [] =
"\n"
"sub-commands:\n"
" add add extension\n"
+" validate checks the prerequisites of an installed extension and"
+" registers it if possible\n"
" remove remove extensions by identifier\n"
" reinstall expert feature: reinstall all deployed extensions\n"
" list list information about deployed extensions\n"
@@ -89,6 +108,8 @@ const char s_usingText [] =
" deployment context;\n"
" run only when no concurrent Office\n"
" process(es) are running!\n"
+" --bundled expert feature: operate on bundled extensions. Only\n"
+" works with list, validate, reinstall;\n"
" --deployment-context expert feature: explicit deployment context\n"
" <context>\n"
"\n"
@@ -149,12 +170,13 @@ void DialogClosedListenerImpl::dialogClosed(
// installed with OOo 2.2 or later could not normally be found via its file
// name.
Reference<deployment::XPackage> findPackage(
- Reference<deployment::XPackageManager> const & manager,
+ OUString const & repository,
+ Reference<deployment::XExtensionManager> const & manager,
Reference<ucb::XCommandEnvironment > const & environment,
OUString const & idOrFileName )
{
Sequence< Reference<deployment::XPackage> > ps(
- manager->getDeployedPackages(
+ manager->getDeployedExtensions(repository,
Reference<task::XAbortChannel>(), environment ) );
for ( sal_Int32 i = 0; i < ps.getLength(); ++i )
if ( dp_misc::getIdentifier( ps[i] ) == idOrFileName )
@@ -214,7 +236,7 @@ extern "C" int unopkg_main()
bool subcmd_add = false;
bool subcmd_gui = false;
OUString logFile;
- OUString deploymentContext;
+ OUString repository;
OUString cmdArg;
::std::vector<OUString> cmdPackages;
@@ -250,7 +272,7 @@ extern "C" int unopkg_main()
return 0;
}
else if (isOption( info_version, &nPos )) {
- dp_misc::writeConsole("\n"APP_NAME" Version 3.0\n");
+ dp_misc::writeConsole("\n"APP_NAME" Version 3.3\n");
return 0;
}
//consume all bootstrap variables which may occur before the subcommannd
@@ -279,7 +301,7 @@ extern "C" int unopkg_main()
!readOption( &option_force, info_force, &nPos ) &&
!readOption( &option_bundled, info_bundled, &nPos ) &&
!readOption( &option_suppressLicense, info_suppressLicense, &nPos ) &&
- !readArgument( &deploymentContext, info_context, &nPos ) &&
+ !readArgument( &repository, info_context, &nPos ) &&
!isBootstrapVariable(&nPos))
{
osl_getCommandArg( nPos, &cmdArg.pData );
@@ -312,25 +334,18 @@ extern "C" int unopkg_main()
}
}
- //make sure the bundled option was provided together with shared
- if (option_bundled && !option_shared)
+ if (repository.getLength() == 0)
{
- dp_misc::writeConsoleError(
- "\nERROR: option --bundled can only be used together with --shared!");
- return 1;
- }
-
-
- xComponentContext = getUNO(
- disposeGuard, option_verbose, option_shared, subcmd_gui,
- xLocalComponentContext );
-
- if (deploymentContext.getLength() == 0) {
- deploymentContext = option_shared ? OUSTR("shared") : OUSTR("user");
+ if (option_shared)
+ repository = OUSTR("shared");
+ else if (option_bundled)
+ repository = OUSTR("bundled");
+ else
+ repository = OUSTR("user");
}
else
{
- if (deploymentContext.equalsAsciiL(
+ if (repository.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("shared") )) {
option_shared = true;
}
@@ -343,15 +358,44 @@ extern "C" int unopkg_main()
}
}
- Reference<deployment::XPackageManagerFactory> xPackageManagerFactory(
- deployment::thePackageManagerFactory::get( xComponentContext ) );
- Reference<deployment::XPackageManager> xPackageManager(
- xPackageManagerFactory->getPackageManager( deploymentContext ) );
+ if (subCommand.equals(OUSTR("reinstall")))
+ {
+ //We must prevent that services and types are loaded by UNO,
+ //otherwise we cannot delete the registry data folder.
+ OUString extensionUnorc;
+ if (repository.equals(OUSTR("user")))
+ extensionUnorc = OUSTR("$UNO_USER_PACKAGES_CACHE/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc");
+ else if (repository.equals(OUSTR("shared")))
+ extensionUnorc = OUSTR("$SHARED_EXTENSIONS_USER/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc");
+ else if (repository.equals(OUSTR("bundled")))
+ extensionUnorc = OUSTR("$BUNDLED_EXTENSIONS_USER/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc");
+ else
+ OSL_ASSERT(0);
+
+ ::rtl::Bootstrap::expandMacros(extensionUnorc);
+ oslFileError e = osl_removeFile(extensionUnorc.pData);
+ if (e != osl_File_E_None && e != osl_File_E_NOENT)
+ throw Exception(OUSTR("Could not delete ") + extensionUnorc, 0);
+ }
+
+ xComponentContext = getUNO(
+ disposeGuard, option_verbose, option_shared, subcmd_gui,
+ xLocalComponentContext );
+
+ Reference<deployment::XExtensionManager> xExtensionManager(
+ deployment::ExtensionManager::get( xComponentContext ) );
Reference< ::com::sun::star::ucb::XCommandEnvironment > xCmdEnv(
createCmdEnv( xComponentContext, logFile,
- option_force, option_verbose, option_bundled,
- option_suppressLicense) );
+ option_force, option_verbose) );
+
+ //synchronize bundled/shared extensions
+ //Do not synchronize when command is "reinstall". This could add types and services to UNO and
+ //prevent the deletion of the registry data folder
+ //synching is done in XExtensionManager.reinstall
+ if (!subcmd_gui && ! subCommand.equals(OUSTR("reinstall"))
+ && ! dp_misc::office_is_running())
+ dp_misc::syncRepositories(xCmdEnv);
if (subcmd_add ||
subCommand.equalsAsciiL(
@@ -362,35 +406,32 @@ extern "C" int unopkg_main()
OUString const & cmdPackage = cmdPackages[ pos ];
if (subcmd_add)
{
- Reference<deployment::XPackage> xPackage(
- xPackageManager->addPackage(
- cmdPackage, OUString() /* to be detected */,
- Reference<task::XAbortChannel>(), xCmdEnv ) );
- OSL_ASSERT( xPackage.is() );
+ beans::NamedValue nvSuppress(
+ OUSTR("SUPPRESS_LICENSE"), option_suppressLicense ?
+ makeAny(OUSTR("1")):makeAny(OUSTR("0")));
+ xExtensionManager->addExtension(
+ cmdPackage, Sequence<beans::NamedValue>(&nvSuppress, 1),
+ repository, Reference<task::XAbortChannel>(), xCmdEnv);
}
else
{
try
{
- xPackageManager->removePackage(
- cmdPackage, cmdPackage,
+ xExtensionManager->removeExtension(
+ cmdPackage, cmdPackage, repository,
Reference<task::XAbortChannel>(), xCmdEnv );
}
catch (lang::IllegalArgumentException &)
{
Reference<deployment::XPackage> p(
- findPackage(
- xPackageManager, xCmdEnv, cmdPackage ) );
- //Todo. temporary preventing exception in bundled case.
- //In case of a bundled extension, remove would be called as a result of
- //uninstalling a rpm. Then we do not want to show an error when the
- //extension does not exist, because the package will be uninstalled anyway
- //and the error would only confuse people.
- if ( !p.is() && !option_bundled)
+ findPackage(repository,
+ xExtensionManager, xCmdEnv, cmdPackage ) );
+ if ( !p.is())
throw;
else if (p.is())
- xPackageManager->removePackage(
+ xExtensionManager->removeExtension(
::dp_misc::getIdentifier(p), p->getName(),
+ repository,
Reference<task::XAbortChannel>(), xCmdEnv );
}
}
@@ -399,37 +440,136 @@ extern "C" int unopkg_main()
else if (subCommand.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("reinstall") ))
{
- xPackageManager->reinstallDeployedPackages(
- Reference<task::XAbortChannel>(), xCmdEnv );
+ xExtensionManager->reinstallDeployedExtensions(
+ repository, Reference<task::XAbortChannel>(), xCmdEnv);
}
else if (subCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("list") ))
{
- Sequence< Reference<deployment::XPackage> > packages;
+ ::std::vector<Reference<deployment::XPackage> > vecExtUnaccepted;
+ ::comphelper::sequenceToContainer(vecExtUnaccepted,
+ xExtensionManager->getExtensionsWithUnacceptedLicenses(
+ repository, xCmdEnv));
+
+ //This vector tells what XPackage in allExtensions has an
+ //unaccepted license.
+ std::vector<bool> vecUnaccepted;
+ std::vector<Reference<deployment::XPackage> > allExtensions;
if (cmdPackages.empty())
{
- packages = xPackageManager->getDeployedPackages(
- Reference<task::XAbortChannel>(), xCmdEnv );
+ Sequence< Reference<deployment::XPackage> >
+ packages = xExtensionManager->getDeployedExtensions(
+ repository, Reference<task::XAbortChannel>(), xCmdEnv );
+
+ ::std::vector<Reference<deployment::XPackage> > vec_packages;
+ ::comphelper::sequenceToContainer(vec_packages, packages);
+
+ //First copy the extensions with the unaccepted license
+ //to vector allExtensions.
+ allExtensions.resize(vecExtUnaccepted.size() + vec_packages.size());
+
+ ::std::vector<Reference<deployment::XPackage> >::iterator i_all_ext =
+ ::std::copy(vecExtUnaccepted.begin(), vecExtUnaccepted.end(),
+ allExtensions.begin());
+ //Now copy those we got from getDeployedExtensions
+ ::std::copy(vec_packages.begin(), vec_packages.end(), i_all_ext);
+
+ //Now prepare the vector which tells what extension has an
+ //unaccepted license
+ vecUnaccepted.resize(vecExtUnaccepted.size() + vec_packages.size());
+ ::std::vector<bool>::iterator i_unaccepted =
+ ::std::fill_n(vecUnaccepted.begin(),
+ vecExtUnaccepted.size(), true);
+ ::std::fill_n(i_unaccepted, vec_packages.size(), false);
+
dp_misc::writeConsole(
- OUSTR("all deployed ") + deploymentContext + OUSTR(" packages:\n"));
+ OUSTR("All deployed ") + repository + OUSTR(" extensions:\n\n"));
}
else
{
- packages.realloc( cmdPackages.size() );
+ //The user provided the names (ids or file names) of the extensions
+ //which shall be listed
for ( ::std::size_t pos = 0; pos < cmdPackages.size(); ++pos )
+ {
+ Reference<deployment::XPackage> extension;
try
{
- packages[ pos ] = xPackageManager->getDeployedPackage(
- cmdPackages[ pos ], cmdPackages[ pos ], xCmdEnv );
+ extension = xExtensionManager->getDeployedExtension(
+ repository, cmdPackages[ pos ], cmdPackages[ pos ], xCmdEnv );
}
catch (lang::IllegalArgumentException &)
{
- packages[ pos ] = findPackage(
- xPackageManager, xCmdEnv, cmdPackages[ pos ] );
- if ( !packages[ pos ].is() )
- throw;
+ extension = findPackage(repository,
+ xExtensionManager, xCmdEnv, cmdPackages[ pos ] );
+ }
+
+ //Now look if the requested extension has an unaccepted license
+ bool bUnacceptedLic = false;
+ if (!extension.is())
+ {
+ ::std::vector<Reference<deployment::XPackage> >::const_iterator
+ i = ::std::find_if(
+ vecExtUnaccepted.begin(),
+ vecExtUnaccepted.end(), ExtensionName(cmdPackages[pos]));
+ if (i != vecExtUnaccepted.end())
+ {
+ extension = *i;
+ bUnacceptedLic = true;
+ }
+ }
+
+ if (extension.is())
+ {
+ allExtensions.push_back(extension);
+ vecUnaccepted.push_back(bUnacceptedLic);
+ }
+
+ else
+ throw lang::IllegalArgumentException(
+ OUSTR("There is no such extension deployed: ") +
+ cmdPackages[pos],0,-1);
+ }
+
+ }
+
+ printf_packages(allExtensions, vecUnaccepted, xCmdEnv );
+ }
+ else if (subCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("validate") ))
+ {
+ ::std::vector<Reference<deployment::XPackage> > vecExtUnaccepted;
+ ::comphelper::sequenceToContainer(
+ vecExtUnaccepted, xExtensionManager->getExtensionsWithUnacceptedLicenses(
+ repository, xCmdEnv));
+
+ for ( ::std::size_t pos = 0; pos < cmdPackages.size(); ++pos )
+ {
+ Reference<deployment::XPackage> extension;
+ try
+ {
+ extension = xExtensionManager->getDeployedExtension(
+ repository, cmdPackages[ pos ], cmdPackages[ pos ], xCmdEnv );
+ }
+ catch (lang::IllegalArgumentException &)
+ {
+ extension = findPackage(
+ repository, xExtensionManager, xCmdEnv, cmdPackages[ pos ] );
+ }
+
+ if (!extension.is())
+ {
+ ::std::vector<Reference<deployment::XPackage> >::const_iterator
+ i = ::std::find_if(
+ vecExtUnaccepted.begin(),
+ vecExtUnaccepted.end(), ExtensionName(cmdPackages[pos]));
+ if (i != vecExtUnaccepted.end())
+ {
+ extension = *i;
}
+ }
+
+ if (extension.is())
+ xExtensionManager->checkPrerequisitesAndEnable(
+ extension, Reference<task::XAbortChannel>(), xCmdEnv);
}
- printf_packages( packages, xCmdEnv );
}
else if (subCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("gui") ))
{
diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
index e4a503d98732..69a973b90a42 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
@@ -49,7 +49,7 @@
#include "com/sun/star/deployment/PlatformException.hpp"
#include "com/sun/star/i18n/XCollator.hpp"
#include "com/sun/star/i18n/CollatorOptions.hpp"
-#include "com/sun/star/deployment/LicenseIndividualAgreementException.hpp"
+
#include <stdio.h>
#include "deployment.hrc"
#include "dp_version.hxx"
@@ -85,13 +85,12 @@ class CommandEnvironmentImpl
sal_Int32 m_logLevel;
bool m_option_force_overwrite;
bool m_option_verbose;
- bool m_option_bundled;
- bool m_option_suppressLicense;
Reference< XComponentContext > m_xComponentContext;
Reference< XProgressHandler > m_xLogFile;
void update_( Any const & Status ) throw (RuntimeException);
- void printLicense(const OUString& sLicense, bool & accept, bool & decline);
+ void printLicense(const OUString & sName,const OUString& sLicense,
+ bool & accept, bool & decline);
public:
virtual ~CommandEnvironmentImpl();
@@ -99,9 +98,7 @@ public:
Reference<XComponentContext> const & xComponentContext,
OUString const & log_file,
bool option_force_overwrite,
- bool option_verbose,
- bool option_bundled,
- bool option_suppressLicense);
+ bool option_verbose);
// XCommandEnvironment
virtual Reference< task::XInteractionHandler > SAL_CALL
@@ -120,19 +117,16 @@ public:
virtual void SAL_CALL pop() throw (RuntimeException);
};
+
//______________________________________________________________________________
CommandEnvironmentImpl::CommandEnvironmentImpl(
Reference<XComponentContext> const & xComponentContext,
OUString const & log_file,
bool option_force_overwrite,
- bool option_verbose,
- bool option_bundled,
- bool option_suppressLicense)
+ bool option_verbose)
: m_logLevel(0),
m_option_force_overwrite( option_force_overwrite ),
m_option_verbose( option_verbose ),
- m_option_bundled( option_bundled),
- m_option_suppressLicense( option_suppressLicense),
m_xComponentContext(xComponentContext)
{
if (log_file.getLength() > 0) {
@@ -162,10 +156,13 @@ CommandEnvironmentImpl::~CommandEnvironmentImpl()
}
//May throw exceptions
-void CommandEnvironmentImpl::printLicense(const OUString& sLicense, bool & accept, bool &decline)
+void CommandEnvironmentImpl::printLicense(
+ const OUString & sName, const OUString& sLicense, bool & accept, bool &decline)
{
ResMgr * pResMgr = DeploymentResMgr::get();
- OUString s1 = String(ResId(RID_STR_UNOPKG_ACCEPT_LIC_1, *pResMgr));
+ String s1tmp(ResId(RID_STR_UNOPKG_ACCEPT_LIC_1, *pResMgr));
+ s1tmp.SearchAndReplaceAllAscii( "$NAME", sName );
+ OUString s1(s1tmp);
OUString s2 = String(ResId(RID_STR_UNOPKG_ACCEPT_LIC_2, *pResMgr));
OUString s3 = String(ResId(RID_STR_UNOPKG_ACCEPT_LIC_3, *pResMgr));
OUString s4 = String(ResId(RID_STR_UNOPKG_ACCEPT_LIC_4, *pResMgr));
@@ -246,7 +243,6 @@ void CommandEnvironmentImpl::handle(
lang::WrappedTargetException wtExc;
deployment::LicenseException licExc;
deployment::InstallException instExc;
- deployment::LicenseIndividualAgreementException licAgreementExc;
deployment::PlatformException platExc;
deployment::VersionException verExc;
@@ -281,27 +277,9 @@ void CommandEnvironmentImpl::handle(
update_( wtExc.TargetException );
}
}
- else if (request >>= licAgreementExc)
- {
- if (m_option_suppressLicense && licAgreementExc.SuppressIfRequired)
- {
- approve = true;
- }
- else
- {
- String sResMsg( ResId( RID_STR_UNOPKG_NO_SHARED_ALLOWED, *DeploymentResMgr::get() ) );
- sResMsg.SearchAndReplaceAllAscii( "%NAME", licAgreementExc.ExtensionName );
- dp_misc::writeConsole(OUSTR("\n") + sResMsg + OUSTR("\n\n"));
- abort = true;
- }
- }
else if (request >>= licExc)
{
- bLicenseException = true;
- if (m_option_suppressLicense && licExc.SuppressIfRequired)
- approve = true;
- else
- printLicense(licExc.Text, approve, abort);
+ printLicense(licExc.ExtensionName, licExc.Text, approve, abort);
}
else if (request >>= instExc)
{
@@ -320,7 +298,7 @@ void CommandEnvironmentImpl::handle(
deployment::VersionException nc_exc;
if (request >>= nc_exc) {
approve = m_option_force_overwrite ||
- (::dp_misc::comparePackageVersions(nc_exc.New, nc_exc.Deployed)
+ (::dp_misc::compareVersions(nc_exc.NewVersion, nc_exc.Deployed->getVersion())
== ::dp_misc::GREATER);
abort = !approve;
}
@@ -436,6 +414,7 @@ void CommandEnvironmentImpl::pop() throw (RuntimeException)
m_xLogFile->pop();
}
+
} // anon namespace
namespace unopkg {
@@ -445,14 +424,10 @@ Reference< XCommandEnvironment > createCmdEnv(
Reference< XComponentContext > const & xContext,
OUString const & logFile,
bool option_force_overwrite,
- bool option_verbose,
- bool option_bundled,
- bool option_suppressLicense)
+ bool option_verbose)
{
return new CommandEnvironmentImpl(
- xContext, logFile, option_force_overwrite, option_verbose, option_bundled,
- option_suppressLicense);
+ xContext, logFile, option_force_overwrite, option_verbose);
}
-
} // unopkg
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index b25176e1dcee..3272810afee2 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
@@ -48,6 +48,7 @@
#include "unotools/configmgr.hxx"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "cppuhelper/bootstrap.hxx"
+#include "comphelper/sequence.hxx"
#include <stdio.h>
using ::rtl::OUString;
@@ -317,7 +318,10 @@ void printf_package(
xPackage->getBundle( Reference<task::XAbortChannel>(), xCmdEnv ) );
printf_space( level + 1 );
dp_misc::writeConsole("bundled Packages: {\n");
- printf_packages( seq, xCmdEnv, level + 2 );
+ ::std::vector<Reference<deployment::XPackage> >vec_bundle;
+ ::comphelper::sequenceToContainer(vec_bundle, seq);
+ printf_packages( vec_bundle, ::std::vector<bool>(vec_bundle.size()),
+ xCmdEnv, level + 2 );
printf_space( level + 1 );
dp_misc::writeConsole("}\n");
}
@@ -325,23 +329,45 @@ void printf_package(
} // anon namespace
+void printf_unaccepted_licenses(
+ Reference<deployment::XPackage> const & ext)
+{
+ OUString id(
+ dp_misc::getIdentifier(ext) );
+ printf_line( OUSTR("Identifier"), id, 0 );
+ printf_space(1);
+ dp_misc::writeConsole(OUSTR("License not accepted\n\n"));
+}
+
//==============================================================================
void printf_packages(
- Sequence< Reference<deployment::XPackage> > const & seq,
+ ::std::vector< Reference<deployment::XPackage> > const & allExtensions,
+ ::std::vector<bool> const & vecUnaccepted,
Reference<XCommandEnvironment> const & xCmdEnv, sal_Int32 level )
{
- sal_Int32 len = seq.getLength();
- Reference< deployment::XPackage > const * p = seq.getConstArray();
- if (len == 0) {
+ OSL_ASSERT(allExtensions.size() == vecUnaccepted.size());
+
+ if (allExtensions.size() == 0)
+ {
printf_space( level );
dp_misc::writeConsole("<none>\n");
}
- else {
- for ( sal_Int32 pos = 0; pos < len; ++pos )
- printf_package( p[ pos ], xCmdEnv, level );
+ else
+ {
+ typedef ::std::vector< Reference<deployment::XPackage> >::const_iterator I_EXT;
+ int index = 0;
+ for (I_EXT i = allExtensions.begin(); i != allExtensions.end(); i++, index++)
+ {
+ if (vecUnaccepted[index])
+ printf_unaccepted_licenses(*i);
+ else
+ printf_package( *i, xCmdEnv, level );
+ dp_misc::writeConsole(OUSTR("\n"));
+ }
}
}
+
//##############################################################################
namespace {
diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h
index 6e9d30cf0d42..43f77513b10c 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_shared.h
+++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h
@@ -162,14 +162,12 @@ css::uno::Reference<css::ucb::XCommandEnvironment> createCmdEnv(
css::uno::Reference<css::uno::XComponentContext> const & xContext,
::rtl::OUString const & logFile,
bool option_force_overwrite,
- bool option_verbose,
- bool option_bundled,
- bool option_suppressLicense);
-
+ bool option_verbose);
//==============================================================================
void printf_packages(
- css::uno::Sequence<
- css::uno::Reference<css::deployment::XPackage> > const & seq,
+ ::std::vector<
+ css::uno::Reference<css::deployment::XPackage> > const & allExtensions,
+ ::std::vector<bool> const & vecUnaccepted,
css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
sal_Int32 level = 0 );
diff --git a/desktop/source/pkgchk/unopkg/version.map b/desktop/source/pkgchk/unopkg/version.map
index 66b81247e826..6d34cb662d2c 100644
--- a/desktop/source/pkgchk/unopkg/version.map
+++ b/desktop/source/pkgchk/unopkg/version.map
@@ -25,7 +25,7 @@
#
#*************************************************************************
-unopkg.3 {
+UDK_3_0_0 {
global:
unopkg_main;
diff --git a/desktop/source/so_comp/exports.map b/desktop/source/so_comp/exports.map
deleted file mode 100644
index ba501f9ae076..000000000000
--- a/desktop/source/so_comp/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/desktop/source/so_comp/makefile.mk b/desktop/source/so_comp/makefile.mk
index b16ae7a009bf..590f99518c68 100644
--- a/desktop/source/so_comp/makefile.mk
+++ b/desktop/source/so_comp/makefile.mk
@@ -55,7 +55,7 @@ SHL1OBJS= $(SLOFILES)
SHL1TARGET= $(TARGET)
SHL1IMPLIB= i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/desktop/source/splash/exports.map b/desktop/source/splash/exports.map
deleted file mode 100644
index ba501f9ae076..000000000000
--- a/desktop/source/splash/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/desktop/source/splash/makefile.mk b/desktop/source/splash/makefile.mk
index 518ccc11ad0c..89609687438c 100644
--- a/desktop/source/splash/makefile.mk
+++ b/desktop/source/splash/makefile.mk
@@ -54,7 +54,7 @@ SHL1OBJS= $(SLOFILES) \
SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index 5fee3028b4f6..381a98ce008f 100644
--- a/desktop/source/splash/splash.cxx
+++ b/desktop/source/splash/splash.cxx
@@ -135,14 +135,21 @@ void SAL_CALL SplashScreen::reset()
}
}
-void SAL_CALL SplashScreen::setText(const OUString&)
+void SAL_CALL SplashScreen::setText(const OUString& rText)
throw (RuntimeException)
{
- if (_bVisible && !_bProgressEnd) {
- if ( _eBitmapMode == BM_FULLSCREEN )
- ShowFullScreenMode( TRUE );
- Show();
- Flush();
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ if ( _sProgressText != rText )
+ {
+ _sProgressText = rText;
+
+ if (_bVisible && !_bProgressEnd)
+ {
+ if ( _eBitmapMode == BM_FULLSCREEN )
+ ShowFullScreenMode( TRUE );
+ Show();
+ updateStatus();
+ }
}
}
@@ -647,7 +654,7 @@ void SplashScreen::Paint( const Rectangle&)
}
if( (bNativeOK = DrawNativeControl( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
- CTRL_STATE_ENABLED, aValue, rtl::OUString() )) != FALSE )
+ CTRL_STATE_ENABLED, aValue, _sProgressText )) != FALSE )
{
return;
}
@@ -668,10 +675,8 @@ void SplashScreen::Paint( const Rectangle&)
_vdev.DrawRect(Rectangle(_tlx, _tly, _tlx+_barwidth, _tly+_barheight));
_vdev.SetFillColor( _cProgressBarColor );
_vdev.SetLineColor();
- Rectangle aRect(_tlx+_barspace, _tly+_barspace, _tlx+_barspace+length, _tly+_barheight-_barspace);
- _vdev.DrawRect(Rectangle(_tlx+_barspace, _tly+_barspace,
- _tlx+_barspace+length, _tly+_barheight-_barspace));
-
+ _vdev.DrawRect(Rectangle(_tlx+_barspace, _tly+_barspace, _tlx+_barspace+length, _tly+_barheight-_barspace));
+ _vdev.DrawText( Rectangle(_tlx, _tly+_barheight+5, _tlx+_barwidth, _tly+_barheight+5+20), _sProgressText, TEXT_DRAW_CENTER );
}
Size aSize = GetOutputSizePixel();
Size bSize = _vdev.GetOutputSizePixel();
diff --git a/desktop/source/splash/splash.hxx b/desktop/source/splash/splash.hxx
index 99677aa107f1..8480ed3df9ae 100644
--- a/desktop/source/splash/splash.hxx
+++ b/desktop/source/splash/splash.hxx
@@ -91,6 +91,7 @@ private:
Color _cProgressBarColor;
bool _bNativeProgress;
OUString _sAppName;
+ OUString _sProgressText;
std::vector< FullScreenProgressRatioValue > _sFullScreenProgressRatioValues;
sal_Int32 _iMax;
diff --git a/desktop/test/deployment/boxt/Addons.xcu b/desktop/test/deployment/boxt/Addons.xcu
new file mode 100644
index 000000000000..3df7e2de274c
--- /dev/null
+++ b/desktop/test/deployment/boxt/Addons.xcu
@@ -0,0 +1,50 @@
+<?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.
+*
+**********************************************************************-->
+
+<o:component-data xmlns:o="http://openoffice.org/2001/registry"
+ o:package="org.openoffice.Office" o:name="Addons">
+ <node o:name="AddonUI">
+ <node o:name="OfficeMenuBar">
+ <node o:name="org.openoffice.test.desktop.deployment.boxt" o:op="replace">
+ <prop o:name="Title" xml:lang="en-US">
+ <value>boxt</value>
+ </prop>
+ <node o:name="Submenu">
+ <node o:name="1" o:op="replace">
+ <prop o:name="URL">
+ <value>vnd.org.openoffice.test.desktop.deployment.boxt:</value>
+ </prop>
+ <prop o:name="Title" xml:lang="en-US">
+ <value>boxt</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+ </node>
+</o:component-data>
diff --git a/configmgr/inc/configmgr/update.hxx b/desktop/test/deployment/boxt/ProtocolHandler.xcu
index b27a32487400..fe448aedbe17 100644
--- a/configmgr/inc/configmgr/update.hxx
+++ b/desktop/test/deployment/boxt/ProtocolHandler.xcu
@@ -1,4 +1,5 @@
-/*************************************************************************
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,29 +24,15 @@
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
-************************************************************************/
-
-#ifndef INCLUDED_CONFIGMGR_UPDATE_HXX
-#define INCLUDED_CONFIGMGR_UPDATE_HXX
-
-#include "sal/config.h"
-
-#include "configmgr/detail/configmgrdllapi.hxx"
-
-namespace rtl { class OUString; }
-
-namespace configmgr {
-
-namespace update {
-
-OOO_DLLPUBLIC_CONFIGMGR void insertExtensionXcsFile(
- bool shared, rtl::OUString const & fileUri);
-
-OOO_DLLPUBLIC_CONFIGMGR void insertExtensionXcuFile(
- bool shared, rtl::OUString const & fileUri);
-
-}
-
-}
-
-#endif
+**********************************************************************-->
+
+<o:component-data xmlns:o="http://openoffice.org/2001/registry"
+ o:package="org.openoffice.Office" o:name="ProtocolHandler">
+ <node o:name="HandlerSet">
+ <node o:name="com.sun.star.test.deployment.boxt" o:op="replace">
+ <prop o:name="Protocols">
+ <value>vnd.org.openoffice.test.desktop.deployment.boxt:*</value>
+ </prop>
+ </node>
+ </node>
+</o:component-data>
diff --git a/desktop/test/deployment/boxt/boxt.cxx b/desktop/test/deployment/boxt/boxt.cxx
new file mode 100644
index 000000000000..dc82c0c004d6
--- /dev/null
+++ b/desktop/test/deployment/boxt/boxt.cxx
@@ -0,0 +1,235 @@
+/*************************************************************************
+*
+* 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_desktop.hxx"
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/frame/DispatchDescriptor.hpp"
+#include "com/sun/star/frame/XDispatch.hpp"
+#include "com/sun/star/frame/XDispatchProvider.hpp"
+#include "com/sun/star/frame/XStatusListener.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/XSingleComponentFactory.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/Sequence.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "com/sun/star/util/URL.hpp"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase1.hxx"
+#include "cppuhelper/implbase3.hxx"
+#include "cppuhelper/implementationentry.hxx"
+#include "cppuhelper/weak.hxx"
+#include "filter/msfilter/countryid.hxx"
+#include "osl/diagnose.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "uno/lbnames.h"
+#include "vcl/svapp.hxx"
+
+namespace {
+
+namespace css = com::sun::star;
+
+namespace service {
+
+rtl::OUString getImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.test.deployment.boxt"));
+}
+
+css::uno::Sequence< rtl::OUString > getSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM("com.sun.star.test.deployment.boxt"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
+}
+
+}
+
+class Service:
+ public cppu::WeakImplHelper3<
+ css::lang::XServiceInfo, css::frame::XDispatchProvider,
+ css::frame::XDispatch >,
+ private boost::noncopyable
+{
+public:
+ Service() {}
+
+private:
+ virtual ~Service() {}
+
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ { return service::getImplementationName(); }
+
+ virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ { return ServiceName == getSupportedServiceNames()[0]; } //TODO
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (css::uno::RuntimeException)
+ { return service::getSupportedServiceNames(); }
+
+ virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(
+ css::util::URL const &, rtl::OUString const &, sal_Int32)
+ throw (css::uno::RuntimeException)
+ { return this; }
+
+ virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > >
+ SAL_CALL queryDispatches(
+ css::uno::Sequence< css::frame::DispatchDescriptor > const & Requests)
+ throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL dispatch(
+ css::util::URL const &,
+ css::uno::Sequence< css::beans::PropertyValue > const &)
+ throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL addStatusListener(
+ css::uno::Reference< css::frame::XStatusListener > const &,
+ css::util::URL const &)
+ throw (css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removeStatusListener(
+ css::uno::Reference< css::frame::XStatusListener > const &,
+ css::util::URL const &)
+ throw (css::uno::RuntimeException)
+ {}
+};
+
+css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > >
+Service::queryDispatches(
+ css::uno::Sequence< css::frame::DispatchDescriptor > const & Requests)
+ throw (css::uno::RuntimeException)
+{
+ css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > s(
+ Requests.getLength());
+ for (sal_Int32 i = 0; i < s.getLength(); ++i) {
+ s[i] = queryDispatch(
+ Requests[i].FeatureURL, Requests[i].FrameName,
+ Requests[i].SearchFlags);
+ }
+ return s;
+}
+
+void Service::dispatch(
+ css::util::URL const &,
+ css::uno::Sequence< css::beans::PropertyValue > const &)
+ throw (css::uno::RuntimeException)
+{
+ msfilter::ConvertCountryToLanguage(msfilter::COUNTRY_DONTKNOW);
+ // link against some obscure library that is unlikely already loaded
+ Application::ShowNativeErrorBox(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("boxt")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("test")));
+}
+
+class Factory:
+ public cppu::WeakImplHelper1< css::lang::XSingleComponentFactory >,
+ private boost::noncopyable
+{
+public:
+ Factory() {}
+
+private:
+ virtual ~Factory() {}
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithContext(
+ css::uno::Reference< css::uno::XComponentContext > const &)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+ { return static_cast< cppu::OWeakObject * >(new Service); }
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any > const &,
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+ { return createInstanceWithContext(Context); }
+};
+
+css::uno::Reference< css::uno::XInterface > SAL_CALL dummy(
+ css::uno::Reference< css::uno::XComponentContext > const &)
+ SAL_THROW((css::uno::Exception))
+{
+ OSL_ASSERT(false);
+ return css::uno::Reference< css::uno::XInterface >();
+}
+
+rtl::OUString SAL_CALL getImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.test.deployment.boxt"));
+}
+
+css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM("com.sun.star.test.deployment.boxt"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
+}
+
+css::uno::Reference< css::lang::XSingleComponentFactory > SAL_CALL
+createFactory(
+ cppu::ComponentFactoryFunc, rtl::OUString const &,
+ css::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
+ SAL_THROW(())
+{
+ return new Factory;
+}
+
+static cppu::ImplementationEntry const services[] = {
+ { &dummy, &service::getImplementationName,
+ &service::getSupportedServiceNames, &createFactory, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 }
+};
+
+}
+
+extern "C" void * SAL_CALL component_getFactory(
+ char const * pImplName, void * pServiceManager, void * pRegistryKey)
+{
+ return cppu::component_getFactoryHelper(
+ pImplName, pServiceManager, pRegistryKey, services);
+}
+
+extern "C" void SAL_CALL component_getImplementationEnvironment(
+ char const ** ppEnvTypeName, uno_Environment **)
+{
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+extern "C" sal_Bool SAL_CALL component_writeInfo(
+ void * pServiceManager, void * pRegistryKey)
+{
+ return component_writeInfoHelper(pServiceManager, pRegistryKey, services);
+}
diff --git a/desktop/test/deployment/boxt/description.xml b/desktop/test/deployment/boxt/description.xml
new file mode 100644
index 000000000000..5a67bf3e949f
--- /dev/null
+++ b/desktop/test/deployment/boxt/description.xml
@@ -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.
+*
+**********************************************************************-->
+
+<d:description xmlns:d="http://openoffice.org/extensions/description/2006">
+ <d:identifier value="org.openoffice/framework/desktop/test/deployment/boxt"/>
+ <d:version value="@VERSION@"/>
+ <d:platform value="@PLATFORM@"/>
+ <d:dependencies>
+ <d:OpenOffice.org-minimal-version d:name="OpenOffice.org @VERSION@"
+ value="@VERSION@"/>
+ <d:OpenOffice.org-maximal-version d:name="OpenOffice.org @VERSION@ or older"
+ d:OpenOffice.org-minimal-version="2.3" value="@VERSION@"/>
+ </d:dependencies>
+</d:description>
diff --git a/desktop/test/deployment/boxt/makefile.mk b/desktop/test/deployment/boxt/makefile.mk
new file mode 100644
index 000000000000..63f123fcc608
--- /dev/null
+++ b/desktop/test/deployment/boxt/makefile.mk
@@ -0,0 +1,70 @@
+#*************************************************************************
+#
+# 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 = desktop
+TARGET = test_deployment_boxt
+
+ENABLE_EXCEPTIONS = TRUE
+
+.INCLUDE: settings.mk
+.INCLUDE: rtlbootstrap.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
+
+DLLPRE =
+
+SLOFILES = $(SHL1OBJS)
+
+SHL1TARGET = boxt.uno
+SHL1OBJS = $(SLO)/boxt.obj
+SHL1RPATH = BOXT
+SHL1STDLIBS = \
+ $(CPPUHELPERLIB) $(CPPULIB) $(MSFILTERLIB) $(SALLIB) $(TOOLSLIB) $(VCLLIB)
+SHL1VERSIONMAP = $(SOLARENV)/src/component.map
+DEF1NAME = $(SHL1TARGET)
+
+.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/boxt.oxt
+
+$(MISC)/boxt.oxt .ERRREMOVE : manifest.xml description.xml Addons.xcu \
+ ProtocolHandler.xcu $(SHL1TARGETN)
+ $(RM) -r $@ $(MISC)/$(TARGET).zip
+ $(MKDIR) $(MISC)/$(TARGET).zip
+ $(MKDIR) $(MISC)/$(TARGET).zip/META-INF
+ $(SED) -e 's|@PATH@|$(SHL1TARGETN:f)|g' < manifest.xml \
+ > $(MISC)/$(TARGET).zip/META-INF/manifest.xml
+ $(SED) -e 's|@PLATFORM@|$(RTL_OS:l)_$(RTL_ARCH:l)|g' \
+ -e 's|@VERSION@|$(my_version)|g' < description.xml \
+ > $(MISC)/$(TARGET).zip/description.xml
+ $(COPY) Addons.xcu ProtocolHandler.xcu $(SHL1TARGETN) $(MISC)/$(TARGET).zip
+ cd $(MISC)/$(TARGET).zip && zip ../boxt.oxt META-INF/manifest.xml \
+ description.xml Addons.xcu ProtocolHandler.xcu $(SHL1TARGETN:f)
diff --git a/desktop/test/deployment/boxt/manifest.xml b/desktop/test/deployment/boxt/manifest.xml
new file mode 100644
index 000000000000..73ebfc306e30
--- /dev/null
+++ b/desktop/test/deployment/boxt/manifest.xml
@@ -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.
+*
+**********************************************************************-->
+
+<m:manifest xmlns:m="http://openoffice.org/2001/manifest">
+ <m:file-entry m:media-type="application/vnd.sun.star.configuration-data"
+ m:full-path="Addons.xcu"/>
+ <m:file-entry m:media-type="application/vnd.sun.star.configuration-data"
+ m:full-path="ProtocolHandler.xcu"/>
+ <m:file-entry
+ m:media-type="application/vnd.sun.star.uno-component;type=native"
+ m:full-path="@PATH@"/>
+</m:manifest>
diff --git a/desktop/unx/source/officeloader/officeloader.cxx b/desktop/unx/source/officeloader/officeloader.cxx
index de84985cdea6..87621960c61a 100755
--- a/desktop/unx/source/officeloader/officeloader.cxx
+++ b/desktop/unx/source/officeloader/officeloader.cxx
@@ -93,7 +93,7 @@ SAL_IMPLEMENT_MAIN()
if ( info.Fields & osl_Process_EXITCODE )
{
exitcode = info.Code;
- bRestart = (ExitHelper::E_CRASH_WITH_RESTART == exitcode);
+ bRestart = (ExitHelper::E_CRASH_WITH_RESTART == exitcode || ExitHelper::E_NORMAL_RESTART == exitcode);
}
else
break;
diff --git a/desktop/util/makefile.mk b/desktop/util/makefile.mk
index c669206bb3f3..8cf03f157254 100644
--- a/desktop/util/makefile.mk
+++ b/desktop/util/makefile.mk
@@ -81,41 +81,7 @@ APP1TARGET=so$/$(TARGET)
APP1NOSAL=TRUE
APP1RPATH=BRAND
APP1OBJS=$(OBJ)$/copyright_ascii_sun.obj $(OBJ)$/main.obj
-APP1STDLIBS = \
- $(SALLIB) \
- $(SOFFICELIB) \
- $(COMPHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(I18NISOLANGLIB) \
- $(SALLIB) \
- $(SFXLIB) \
- $(SVLLIB) \
- $(SVTOOLLIB) \
- $(TKLIB) \
- $(TOOLSLIB) \
- $(UCBHELPERLIB) \
- $(UNOTOOLSLIB) \
- $(VCLLIB) \
- $(FWELIB) \
- $(BASICLIB) \
- $(XMLSCRIPTLIB) \
- $(SALHELPERLIB) \
- $(SOTLIB) \
- $(SAXLIB) \
- $(FWILIB) \
- $(ICUUCLIB) \
- $(I18NUTILLIB) \
- $(ICULIB) \
- $(JVMFWKLIB) \
- $(BASEGFXLIB) \
- $(ICUDATALIB) \
- $(ICULELIB) \
- $(JVMACCESSLIB) \
- $(SALHELPERLIB) \
- $(VOSLIB)
-
-
+APP1STDLIBS = $(SALLIB) $(SOFFICELIB)
APP1DEPN= $(APP1RES) verinfo.rc
.IF "$(GUI)" == "WNT"
@@ -140,42 +106,9 @@ APP5TARGET=soffice
APP5NOSAL=TRUE
APP5RPATH=BRAND
APP5OBJS=$(OBJ)$/copyright_ascii_ooo.obj $(OBJ)$/main.obj
-APP5STDLIBS = \
- $(SALLIB) \
- $(SOFFICELIB) \
- $(COMPHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(I18NISOLANGLIB) \
- $(SALLIB) \
- $(SFXLIB) \
- $(SVLLIB) \
- $(SVTOOLLIB) \
- $(TKLIB) \
- $(TOOLSLIB) \
- $(UCBHELPERLIB) \
- $(UNOTOOLSLIB) \
- $(VCLLIB) \
- $(FWELIB) \
- $(BASICLIB) \
- $(XMLSCRIPTLIB) \
- $(SALHELPERLIB) \
- $(SOTLIB) \
- $(SAXLIB) \
- $(FWILIB) \
- $(ICUUCLIB) \
- $(I18NUTILLIB) \
- $(ICULIB) \
- $(JVMFWKLIB) \
- $(BASEGFXLIB) \
- $(ICUDATALIB) \
- $(ICULELIB) \
- $(JVMACCESSLIB) \
- $(SALHELPERLIB) \
- $(VOSLIB)
-
+APP5STDLIBS = $(SALLIB) $(SOFFICELIB)
.IF "$(OS)" == "LINUX"
-APP5STDLIBS+= -lXext
+APP5STDLIBS+= -lXext -lX11
#APP5STDLIBS+= -lXext -lSM -lICE
.ENDIF # LINUX
diff --git a/desktop/util/ooverinfo.rc b/desktop/util/ooverinfo.rc
index 28b1e0d4a811..6d92e2a99500 100644
--- a/desktop/util/ooverinfo.rc
+++ b/desktop/util/ooverinfo.rc
@@ -110,10 +110,10 @@ VS_VERSION_INFO versioninfo
13 ICON "icons\\oasis-empty-document.ico"
14 ICON "icons\\oasis-database.ico"
15 ICON "icons\\oasis-formula.ico"
-16 ICON "icons\\empty-template.ico"
+16 ICON "icons\\oasis-web-template.ico"
17 ICON "icons\\empty-document.ico"
18 ICON "icons\\ooo-configuration.ico"
-19 ICON "icons\\ooo-open.ico"
+19 ICON "icons\\ooo3_open.ico"
20 ICON "icons\\empty-document.ico"
21 ICON "icons\\ooo3_writer_app.ico"
22 ICON "icons\\ooo3_calc_app.ico"
diff --git a/desktop/util/ooverinfo2.rc b/desktop/util/ooverinfo2.rc
index d19603d54855..f149ec6474e7 100644
--- a/desktop/util/ooverinfo2.rc
+++ b/desktop/util/ooverinfo2.rc
@@ -62,7 +62,7 @@ ICON 10 "icons/oasis-presentation-template.ico"
ICON 13 "icons/oasis-empty-document.ico"
ICON 14 "icons/oasis-database.ico"
ICON 15 "icons/oasis-formula.ico"
-ICON 16 "icons/empty-template.ico"
+ICON 16 "icons/oasis-web-template.ico"
ICON 17 "icons/empty-document.ico"
ICON 18 "icons/ooo-configuration.ico"
ICON 19 "icons/ooo-open.ico"
diff --git a/desktop/util/verinfo.rc b/desktop/util/verinfo.rc
index d61493568490..038953f2aa79 100644
--- a/desktop/util/verinfo.rc
+++ b/desktop/util/verinfo.rc
@@ -115,10 +115,10 @@ VS_VERSION_INFO versioninfo
13 ICON "icons\\oasis-empty-document.ico"
14 ICON "icons\\oasis-database.ico"
15 ICON "icons\\oasis-formula.ico"
-16 ICON "icons\\empty-template.ico"
+16 ICON "icons\\oasis-web-template.ico"
17 ICON "icons\\empty-document.ico"
18 ICON "icons\\so8-configuration.ico"
-19 ICON "icons\\so8-open.ico"
+19 ICON "icons\\so9_open.ico"
20 ICON "icons\\empty-document.ico"
21 ICON "icons\\so9_writer_app.ico"
22 ICON "icons\\so9_calc_app.ico"
diff --git a/desktop/win32/source/applauncher/makefile.mk b/desktop/win32/source/applauncher/makefile.mk
index 4285476475ca..f0f5743f38a1 100644
--- a/desktop/win32/source/applauncher/makefile.mk
+++ b/desktop/win32/source/applauncher/makefile.mk
@@ -129,7 +129,7 @@ APP6PRODUCTDEF+=-DRES_APP_NAME=smath
APP7TARGET=so$/sweb
APP7NOSAL=TRUE
APP7LINKRES=$(MISC)$/$(TARGET)7.res
-APP7ICON=$(SOLARRESDIR)$/icons/so9_html_doc.ico
+APP7ICON=$(SOLARRESDIR)$/icons/so9_writer_app.ico
APP7OBJS = \
$(OBJ)$/launcher.obj\
$(OBJ)$/sweb.obj
diff --git a/desktop/win32/source/applauncher/ooo/makefile.mk b/desktop/win32/source/applauncher/ooo/makefile.mk
index 9c60ad1b48e4..02f240cce9e0 100644
--- a/desktop/win32/source/applauncher/ooo/makefile.mk
+++ b/desktop/win32/source/applauncher/ooo/makefile.mk
@@ -116,7 +116,7 @@ APP7DEPN=verinfo.rc
APP7VERINFO=verinfo.rc
APP7NOSAL=TRUE
APP7LINKRES=$(MISC)$/$(TARGET)7.res
-APP7ICON=$(SOLARRESDIR)$/icons/ooo3_html_doc.ico
+APP7ICON=$(SOLARRESDIR)$/icons/ooo3_writer_app.ico
APP7OBJS = \
$(OBJ)$/launcher.obj\
$(OBJ)$/sweb.obj
diff --git a/desktop/win32/source/officeloader/officeloader.cxx b/desktop/win32/source/officeloader/officeloader.cxx
index f36bfc134ded..7c2dafc79bbb 100644
--- a/desktop/win32/source/officeloader/officeloader.cxx
+++ b/desktop/win32/source/officeloader/officeloader.cxx
@@ -212,7 +212,7 @@ int WINAPI _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int )
LPTSTR lpCommandLine = NULL;
int argc = 0;
LPTSTR * argv = NULL;
- bool first = true;
+ bool bFirst = true;
WCHAR cwd[MAX_PATH];
DWORD cwdLen = GetCurrentDirectoryW(MAX_PATH, cwd);
if (cwdLen >= MAX_PATH) {
@@ -318,7 +318,7 @@ int WINAPI _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int )
}
}
- if (first) {
+ if ( bFirst ) {
argv = GetCommandArgs(&argc);
std::size_t n = wcslen(argv[0]) + 2;
for (int i = 1; i < argc; ++i) {
@@ -334,7 +334,7 @@ int WINAPI _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int )
lpCommandLine, MY_STRING(L"\""));
p = desktop_win32::commandLineAppend(p, argv[0]);
for (int i = 1; i < argc; ++i) {
- if (first || wcsncmp(argv[i], MY_STRING(L"-env:")) == 0) {
+ if (bFirst || ::desktop::ExitHelper::E_NORMAL_RESTART == dwExitCode || wcsncmp(argv[i], MY_STRING(L"-env:")) == 0) {
p = desktop_win32::commandLineAppend(p, MY_STRING(L"\" \""));
p = desktop_win32::commandLineAppend(p, argv[i]);
}
@@ -348,7 +348,7 @@ int WINAPI _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int )
p = desktop_win32::commandLineAppendEncoded(p, cwd);
}
desktop_win32::commandLineAppend(p, MY_STRING(L"\""));
- first = false;
+ bFirst = false;
TCHAR szParentProcessId[64]; // This is more than large enough for a 128 bit decimal value
BOOL bHeadlessMode( FALSE );
@@ -416,7 +416,8 @@ int WINAPI _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int )
CloseHandle( aProcessInfo.hProcess );
CloseHandle( aProcessInfo.hThread );
}
- } while ( fSuccess && ::desktop::ExitHelper::E_CRASH_WITH_RESTART == dwExitCode );
+ } while ( fSuccess
+ && ( ::desktop::ExitHelper::E_CRASH_WITH_RESTART == dwExitCode || ::desktop::ExitHelper::E_NORMAL_RESTART == dwExitCode ));
delete[] lpCommandLine;
return fSuccess ? dwExitCode : -1;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
index 0f426c6ad2ba..6c67bded2b17 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
@@ -62,11 +62,48 @@ namespace drawinglayer
To get better text quality, it is suggested to handle tis primitive directly
in a renderer. In that case, e.g. hintings on the system can be supported.
+
+ @param maTextTransform
+ The text transformation contains the text start position (always baselined)
+ as translation, the FontSize as scale (where width relative to height defines
+ font scaling and width == height means no font scaling) and the font rotation
+ and shear.
+ When shear is used and a renderer does not support it, it may be better to use
+ the decomposition which will do everything correctly. Same is true for mirroring
+ which would be expressed as negative scalings.
+
+ @param rText
+ The text to be used. Only a part may be used, but a bigger part of the string
+ may be necessary for correct layouting (e.g. international)
+
+ @param aTextPosition
+ The index to the first character to use from rText
+
+ @param aTextLength
+ The number of characters to use from rText
+
+ @param rDXArray
+ The distances between the characters. This parameter may be empty, in that case
+ the renderer is responsible to do something useful. If it is given, it has to be of
+ the size aTextLength. Its values are in logical coordinates and describe the
+ distance for each character to use. This is independent from the font width which
+ is given with maTextTransform. The first value is the offset to use from the start
+ point in FontCoordinateSystem X-Direction (given by maTextTransform) to the start
+ point of the second character
+
+ @param rFontAttribute
+ The font definition
+
+ @param rLocale
+ The locale to use
+
+ @param rFontColor
+ The font color to use
*/
class TextSimplePortionPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
- /// text range transformation from unit range ([0.0 .. 1.0]) to text range
+ /// text transformation (FontCoordinateSystem)
basegfx::B2DHomMatrix maTextTransform;
/// The text, used from maTextPosition up to maTextPosition + maTextLength
@@ -78,10 +115,10 @@ namespace drawinglayer
/// The length for maText usage, starting from maTextPosition
xub_StrLen maTextLength;
- /// The DX array scale-independent in unit coordinates
+ /// The DX array in logic units
::std::vector< double > maDXArray;
- /// The font to use
+ /// The font definition
attribute::FontAttribute maFontAttribute;
/// The Locale for the text
@@ -90,7 +127,7 @@ namespace drawinglayer
/// font color
basegfx::BColor maFontColor;
- /// #i96669# add simple range buffering for this primitive
+ /// #i96669# internal: add simple range buffering for this primitive
basegfx::B2DRange maB2DRange;
protected:
diff --git a/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx b/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx
index 23d8e7edd913..93ebfeab48e7 100644
--- a/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx
+++ b/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx
@@ -54,9 +54,12 @@ namespace drawinglayer
class Shadow3DExtractingProcessor : public BaseProcessor3D
{
private:
+ /// typedef for data handling
+ typedef std::vector< primitive2d::BasePrimitive2D* > BasePrimitive2DVector;
+
/// result holding vector (2D) and target vector for stacking (inited to &maPrimitive2DSequence)
- primitive2d::Primitive2DSequence maPrimitive2DSequence;
- primitive2d::Primitive2DSequence* mpPrimitive2DSequence;
+ BasePrimitive2DVector maPrimitive2DSequence;
+ BasePrimitive2DVector* mpPrimitive2DSequence;
/// object transformation for scene for 2d definition
basegfx::B2DHomMatrix maObjectTransformation;
@@ -93,6 +96,10 @@ namespace drawinglayer
*/
virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
+ /// helper to convert from BasePrimitive2DVector to primitive2d::Primitive2DSequence
+ const primitive2d::Primitive2DSequence getPrimitive2DSequenceFromBasePrimitive2DVector(
+ const BasePrimitive2DVector& rVector) const;
+
public:
Shadow3DExtractingProcessor(
const geometry::ViewInformation3D& rViewInformation,
@@ -100,9 +107,10 @@ namespace drawinglayer
const basegfx::B3DVector& rLightNormal,
double fShadowSlant,
const basegfx::B3DRange& rContained3DRange);
+ virtual ~Shadow3DExtractingProcessor();
/// data read access
- const primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; }
+ const primitive2d::Primitive2DSequence getPrimitive2DSequence() const;
const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
const basegfx::B3DHomMatrix& getWorldToEye() const { return maWorldToEye; }
const basegfx::B3DHomMatrix& getEyeToView() const { return maEyeToView; }
diff --git a/drawinglayer/prj/d.lst b/drawinglayer/prj/d.lst
index 7ae13f8ebe33..e863e47a3b18 100644
--- a/drawinglayer/prj/d.lst
+++ b/drawinglayer/prj/d.lst
@@ -55,7 +55,6 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive3d
..\inc\drawinglayer\primitive3d\baseprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\baseprimitive3d.hxx
..\inc\drawinglayer\primitive3d\groupprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\groupprimitive3d.hxx
..\inc\drawinglayer\primitive3d\hatchtextureprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\hatchtextureprimitive3d.hxx
-..\inc\drawinglayer\primitive2d\hiddengeometryprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\hiddengeometryprimitive3d.hxx
..\inc\drawinglayer\primitive3d\modifiedcolorprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\modifiedcolorprimitive3d.hxx
..\inc\drawinglayer\primitive3d\polygonprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\polygonprimitive3d.hxx
..\inc\drawinglayer\primitive3d\polygontubeprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\polygontubeprimitive3d.hxx
@@ -95,7 +94,6 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\processor3d
..\inc\drawinglayer\processor3d\cutfindprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\cutfindprocessor3d.hxx
..\inc\drawinglayer\processor3d\defaultprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\defaultprocessor3d.hxx
..\inc\drawinglayer\processor3d\zbufferprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\zbufferprocessor3d.hxx
-..\inc\drawinglayer\processor3d\tbufferprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\tbufferprocessor3d.hxx
mkdir: %_DEST%\inc%_EXT%\drawinglayer\attribute
..\inc\drawinglayer\attribute\fillgradientattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fillgradientattribute.hxx
diff --git a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
index c2d097d74a3b..8659eb356405 100644
--- a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
@@ -78,14 +78,14 @@ namespace drawinglayer
{
case attribute::GRADIENTSTYLE_LINEAR:
{
- texture::GeoTexSvxGradientLinear aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), -getFillGradient().getAngle());
+ texture::GeoTexSvxGradientLinear aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getAngle());
aGradient.appendTransformations(rMatrices);
aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_AXIAL:
{
- texture::GeoTexSvxGradientAxial aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), -getFillGradient().getAngle());
+ texture::GeoTexSvxGradientAxial aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getAngle());
aGradient.appendTransformations(rMatrices);
aGradient.appendColors(rColors);
break;
@@ -99,21 +99,21 @@ namespace drawinglayer
}
case attribute::GRADIENTSTYLE_ELLIPTICAL:
{
- texture::GeoTexSvxGradientElliptical aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), -getFillGradient().getAngle());
+ texture::GeoTexSvxGradientElliptical aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), getFillGradient().getAngle());
aGradient.appendTransformations(rMatrices);
aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_SQUARE:
{
- texture::GeoTexSvxGradientSquare aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), -getFillGradient().getAngle());
+ texture::GeoTexSvxGradientSquare aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), getFillGradient().getAngle());
aGradient.appendTransformations(rMatrices);
aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_RECT:
{
- texture::GeoTexSvxGradientRect aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), -getFillGradient().getAngle());
+ texture::GeoTexSvxGradientRect aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), getFillGradient().getAngle());
aGradient.appendTransformations(rMatrices);
aGradient.appendColors(rColors);
break;
@@ -213,12 +213,16 @@ namespace drawinglayer
if(attribute::GRADIENTSTYLE_RADIAL == getFillGradient().getStyle()
|| attribute::GRADIENTSTYLE_ELLIPTICAL == getFillGradient().getStyle())
{
- const basegfx::B2DPoint aCircleCenter(0.5, 0.5);
- aUnitPolygon = basegfx::tools::createPolygonFromEllipse(aCircleCenter, 0.5, 0.5);
+ aUnitPolygon = basegfx::tools::createPolygonFromCircle(
+ basegfx::B2DPoint(0,0), 1);
+ }
+ else if(attribute::GRADIENTSTYLE_LINEAR == maFillGradient.getStyle())
+ {
+ aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0, 0, 1, 1));
}
else
{
- aUnitPolygon = basegfx::tools::createUnitPolygon();
+ aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(-1, -1, 1, 1));
}
// get the transform matrices and colors (where colors
diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
index b606f4a286fc..4466081cae32 100644
--- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
@@ -50,12 +50,11 @@ namespace drawinglayer
Primitive2DSequence FillHatchPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
Primitive2DSequence aRetval;
-
if(!getFillHatch().isDefault())
{
// create hatch
const basegfx::BColor aHatchColor(getFillHatch().getColor());
- const double fAngle(-getFillHatch().getAngle());
+ const double fAngle(getFillHatch().getAngle());
::std::vector< basegfx::B2DHomMatrix > aMatrices;
// get hatch transformations
@@ -64,7 +63,7 @@ namespace drawinglayer
case attribute::HATCHSTYLE_TRIPLE:
{
// rotated 45 degrees
- texture::GeoTexSvxHatch aHatch(getObjectRange(), getFillHatch().getDistance(), fAngle + F_PI4);
+ texture::GeoTexSvxHatch aHatch(getObjectRange(), getFillHatch().getDistance(), fAngle - F_PI4);
aHatch.appendTransformations(aMatrices);
// fall-through by purpose
@@ -72,7 +71,7 @@ namespace drawinglayer
case attribute::HATCHSTYLE_DOUBLE:
{
// rotated 90 degrees
- texture::GeoTexSvxHatch aHatch(getObjectRange(), getFillHatch().getDistance(), fAngle + F_PI2);
+ texture::GeoTexSvxHatch aHatch(getObjectRange(), getFillHatch().getDistance(), fAngle - F_PI2);
aHatch.appendTransformations(aMatrices);
// fall-through by purpose
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index 238c47419eb9..6fa1cef2d23f 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -94,8 +94,10 @@ namespace
basegfx::BColor maTextLineColor;
basegfx::BColor maOverlineColor;
- /// clipping, font, etc.
- Region maRegion;
+ /// clipping
+ basegfx::B2DPolyPolygon maClipPolyPoygon;
+
+ /// font, etc.
Font maFont;
RasterOp maRasterOp;
sal_uInt32 mnLayoutMode;
@@ -110,7 +112,7 @@ namespace
bool mbTextFillColor : 1;
bool mbTextLineColor : 1;
bool mbOverlineColor : 1;
- bool mbRegion : 1;
+ bool mbClipPolyPolygonActive : 1;
public:
PropertyHolder()
@@ -122,7 +124,7 @@ namespace
maTextFillColor(),
maTextLineColor(),
maOverlineColor(),
- maRegion(),
+ maClipPolyPoygon(),
maFont(),
maRasterOp(ROP_OVERPAINT),
mnLayoutMode(0),
@@ -134,7 +136,7 @@ namespace
mbTextFillColor(false),
mbTextLineColor(false),
mbOverlineColor(false),
- mbRegion(false)
+ mbClipPolyPolygonActive(false)
{
}
@@ -179,10 +181,10 @@ namespace
bool getOverlineColorActive() const { return mbOverlineColor; }
void setOverlineColorActive(bool bNew) { if(bNew != mbOverlineColor) mbOverlineColor = bNew; }
- const Region& getRegion() const { return maRegion; }
- void setRegion(const Region& rRegion) { if(rRegion != maRegion) maRegion = rRegion; }
- bool getRegionActive() const { return mbRegion; }
- void setRegionActive(bool bNew) { if(bNew != mbRegion) mbRegion = bNew; }
+ const basegfx::B2DPolyPolygon& getClipPolyPolygon() const { return maClipPolyPoygon; }
+ void setClipPolyPolygon(const basegfx::B2DPolyPolygon& rNew) { if(rNew != maClipPolyPoygon) maClipPolyPoygon = rNew; }
+ bool getClipPolyPolygonActive() const { return mbClipPolyPolygonActive; }
+ void setClipPolyPolygonActive(bool bNew) { if(bNew != mbClipPolyPolygonActive) mbClipPolyPolygonActive = bNew; }
const Font& getFont() const { return maFont; }
void setFont(const Font& rFont) { if(rFont != maFont) maFont = rFont; }
@@ -235,6 +237,12 @@ namespace
return maPropertyHolders.size();
}
+ void PushDefault()
+ {
+ PropertyHolder* pNew = new PropertyHolder();
+ maPropertyHolders.push_back(pNew);
+ }
+
void Push(sal_uInt16 nPushFlags)
{
if(nPushFlags)
@@ -291,8 +299,8 @@ namespace
}
if(!(nPushFlags & PUSH_CLIPREGION ))
{
- pLast->setRegion(pTip->getRegion());
- pLast->setRegionActive(pTip->getRegionActive());
+ pLast->setClipPolyPolygon(pTip->getClipPolyPolygon());
+ pLast->setClipPolyPolygonActive(pTip->getClipPolyPolygonActive());
}
if(!(nPushFlags & PUSH_RASTEROP ))
{
@@ -336,11 +344,11 @@ namespace
}
}
}
-
- // execute the pop
- delete maPropertyHolders.back();
- maPropertyHolders.pop_back();
}
+
+ // execute the pop
+ delete maPropertyHolders.back();
+ maPropertyHolders.pop_back();
}
}
@@ -465,25 +473,18 @@ namespace
// the buffer to not delete them in the destructor.
aTargets.clear();
- if(xRetval.hasElements() && rPropertyHolder.getRegionActive())
+ if(xRetval.hasElements() && rPropertyHolder.getClipPolyPolygonActive())
{
- const Region& rRegion = rPropertyHolder.getRegion();
+ const basegfx::B2DPolyPolygon& rClipPolyPolygon = rPropertyHolder.getClipPolyPolygon();
- if(!rRegion.IsEmpty())
+ if(rClipPolyPolygon.count())
{
- basegfx::B2DPolyPolygon aClipPolyPolygon(getB2DPolyPolygonFromRegion(rRegion));
+ const drawinglayer::primitive2d::Primitive2DReference xMask(
+ new drawinglayer::primitive2d::MaskPrimitive2D(
+ rClipPolyPolygon,
+ xRetval));
- if(aClipPolyPolygon.count())
- {
- aClipPolyPolygon.transform(rPropertyHolder.getTransformation());
-
- const drawinglayer::primitive2d::Primitive2DReference xMask(
- new drawinglayer::primitive2d::MaskPrimitive2D(
- aClipPolyPolygon,
- xRetval));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xMask, 1);
- }
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xMask, 1);
}
}
@@ -943,14 +944,17 @@ namespace
default : // case HATCH_SINGLE :
{
aHatchStyle = drawinglayer::attribute::HATCHSTYLE_SINGLE;
+ break;
}
case HATCH_DOUBLE :
{
aHatchStyle = drawinglayer::attribute::HATCHSTYLE_DOUBLE;
+ break;
}
case HATCH_TRIPLE :
{
aHatchStyle = drawinglayer::attribute::HATCHSTYLE_TRIPLE;
+ break;
}
}
@@ -969,53 +973,56 @@ namespace
a new target for embracing new geometry to the current region
*/
void HandleNewClipRegion(
- const Region* pRegion,
+ const basegfx::B2DPolyPolygon& rClipPolyPolygon,
TargetHolders& rTargetHolders,
PropertyHolders& rPropertyHolders)
{
- const bool bNewActive(pRegion && !pRegion->IsEmpty());
+ const bool bNewActive(rClipPolyPolygon.count());
- // #i108636# The handlig of new ClipRegions was not done as good as possible
- // in the first version of this interpreter; e.g. when a ClipRegion was set
+ // #i108636# The handlig of new ClipPolyPolygons was not done as good as possible
+ // in the first version of this interpreter; e.g. when a ClipPolyPolygon was set
// initially and then using a lot of push/pop actions, the pop always leads
- // to setting a 'new' ClipRegion which indeed is the return to the ClipRegion
+ // to setting a 'new' ClipPolyPolygon which indeed is the return to the ClipPolyPolygon
// of the properties next on the stack.
- // This ClipRegion is identical to the current one, so there is no need to
+ //
+ // This ClipPolyPolygon is identical to the current one, so there is no need to
// create a MaskPrimitive2D containing the up-to-now created primitives, but
// this was done before. While this does not lead to wrong primitive
// representations of the metafile data, it creates unneccesarily expensive
- // representations. Just detecting when no really 'new' ClipRegion gets set
+ // representations. Just detecting when no really 'new' ClipPolyPolygon gets set
// solves the problem.
- if(!rPropertyHolders.Current().getRegionActive() && !bNewActive)
+ if(!rPropertyHolders.Current().getClipPolyPolygonActive() && !bNewActive)
{
- // no active region exchanged by no new one, done
+ // no active ClipPolyPolygon exchanged by no new one, done
return;
}
- if(rPropertyHolders.Current().getRegionActive() && bNewActive)
+ if(rPropertyHolders.Current().getClipPolyPolygonActive() && bNewActive)
{
- // active region and new active region
- if(rPropertyHolders.Current().getRegion() == *pRegion)
+ // active ClipPolyPolygon and new active ClipPolyPolygon
+ if(rPropertyHolders.Current().getClipPolyPolygon() == rClipPolyPolygon)
{
- // new region is the same as the old region, done
+ // new is the same as old, done
return;
}
}
- // Here the old region and the new one are definitively different, maybe
+ // Here the old and the new are definitively different, maybe
// old one and/or new one is not active.
- // Handle deletion of old region.The process evtl. created primitives which
- // belong to this active region. These need to be embedded to a
+ // Handle deletion of old ClipPolyPolygon. The process evtl. created primitives which
+ // belong to this active ClipPolyPolygon. These need to be embedded to a
// MaskPrimitive2D accordingly.
- if(rPropertyHolders.Current().getRegionActive() && rTargetHolders.size() > 1)
+ if(rPropertyHolders.Current().getClipPolyPolygonActive() && rTargetHolders.size() > 1)
{
drawinglayer::primitive2d::Primitive2DSequence aSubContent;
- if(!rPropertyHolders.Current().getRegion().IsEmpty() && rTargetHolders.Current().size())
+ if(rPropertyHolders.Current().getClipPolyPolygon().count()
+ && rTargetHolders.Current().size())
{
- aSubContent = rTargetHolders.Current().getPrimitive2DSequence(rPropertyHolders.Current());
+ aSubContent = rTargetHolders.Current().getPrimitive2DSequence(
+ rPropertyHolders.Current());
}
rTargetHolders.Pop();
@@ -1030,11 +1037,11 @@ namespace
// apply new settings to current properties by setting
// the new region now
- rPropertyHolders.Current().setRegionActive(bNewActive);
+ rPropertyHolders.Current().setClipPolyPolygonActive(bNewActive);
if(bNewActive)
{
- rPropertyHolders.Current().setRegion(*pRegion);
+ rPropertyHolders.Current().setClipPolyPolygon(rClipPolyPolygon);
// prepare new content holder for new active region
rTargetHolders.Push();
@@ -2134,8 +2141,11 @@ namespace
drawinglayer::primitive2d::Primitive2DSequence xSubContent;
{
rTargetHolders.Push();
+ // #i# for sub-Mteafile contents, do start with new, default render state
+ rPropertyHolders.PushDefault();
interpretMetafile(aGDIMetaFile, rTargetHolders, rPropertyHolders, rViewInformation);
xSubContent = rTargetHolders.Current().getPrimitive2DSequence(rPropertyHolders.Current());
+ rPropertyHolders.Pop();
rTargetHolders.Pop();
}
@@ -2411,13 +2421,18 @@ namespace
if(pA->IsClipping())
{
- // new clipping
- HandleNewClipRegion(&pA->GetRegion(), rTargetHolders, rPropertyHolders);
+ // new clipping. Get PolyPolygon and transform with current transformation
+ basegfx::B2DPolyPolygon aNewClipPolyPolygon(getB2DPolyPolygonFromRegion(pA->GetRegion()));
+
+ aNewClipPolyPolygon.transform(rPropertyHolders.Current().getTransformation());
+ HandleNewClipRegion(aNewClipPolyPolygon, rTargetHolders, rPropertyHolders);
}
else
{
// end clipping
- HandleNewClipRegion(0, rTargetHolders, rPropertyHolders);
+ const basegfx::B2DPolyPolygon aEmptyPolyPolygon;
+
+ HandleNewClipRegion(aEmptyPolyPolygon, rTargetHolders, rPropertyHolders);
}
break;
@@ -2431,49 +2446,60 @@ namespace
if(rRectangle.IsEmpty())
{
// intersect with empty rectangle will always give empty
- // region; start new clipping with empty region
- const Region aNewRegion;
- HandleNewClipRegion(&aNewRegion, rTargetHolders, rPropertyHolders);
+ // ClipPolyPolygon; start new clipping with empty PolyPolygon
+ const basegfx::B2DPolyPolygon aEmptyPolyPolygon;
+
+ HandleNewClipRegion(aEmptyPolyPolygon, rTargetHolders, rPropertyHolders);
}
else
{
- if(rPropertyHolders.Current().getRegionActive())
+ // create transformed ClipRange
+ basegfx::B2DRange aClipRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+
+ aClipRange.transform(rPropertyHolders.Current().getTransformation());
+
+ if(rPropertyHolders.Current().getClipPolyPolygonActive())
{
- if(rPropertyHolders.Current().getRegion().IsEmpty())
+ if(0 == rPropertyHolders.Current().getClipPolyPolygon().count())
{
- // nothing to do, empty active clip region will stay
+ // nothing to do, empty active clipPolyPolygon will stay
// empty when intersecting
}
else
{
- // AND existing region and new rectangle
+ // AND existing region and new ClipRange
const basegfx::B2DPolyPolygon aOriginalPolyPolygon(
- getB2DPolyPolygonFromRegion(rPropertyHolders.Current().getRegion()));
+ rPropertyHolders.Current().getClipPolyPolygon());
basegfx::B2DPolyPolygon aClippedPolyPolygon;
if(aOriginalPolyPolygon.count())
{
- const basegfx::B2DRange aIntersectRange(
- rRectangle.Left(), rRectangle.Top(),
- rRectangle.Right(), rRectangle.Bottom());
-
aClippedPolyPolygon = basegfx::tools::clipPolyPolygonOnRange(
- aOriginalPolyPolygon, aIntersectRange, true, false);
+ aOriginalPolyPolygon,
+ aClipRange,
+ true,
+ false);
}
if(aClippedPolyPolygon != aOriginalPolyPolygon)
{
// start new clipping with intersected region
- const Region aNewRegion(aClippedPolyPolygon);
- HandleNewClipRegion(&aNewRegion, rTargetHolders, rPropertyHolders);
+ HandleNewClipRegion(
+ aClippedPolyPolygon,
+ rTargetHolders,
+ rPropertyHolders);
}
}
}
else
{
- // start new clipping with rectangle
- const Region aNewRegion(rRectangle);
- HandleNewClipRegion(&aNewRegion, rTargetHolders, rPropertyHolders);
+ // start new clipping with ClipRange
+ const basegfx::B2DPolyPolygon aNewClipPolyPolygon(
+ basegfx::tools::createPolygonFromRect(aClipRange));
+
+ HandleNewClipRegion(aNewClipPolyPolygon, rTargetHolders, rPropertyHolders);
}
}
@@ -2488,50 +2514,48 @@ namespace
if(rNewRegion.IsEmpty())
{
// intersect with empty region will always give empty
- // region; start new clipping with empty region
- const Region aNewRegion;
- HandleNewClipRegion(&aNewRegion, rTargetHolders, rPropertyHolders);
+ // region; start new clipping with empty PolyPolygon
+ const basegfx::B2DPolyPolygon aEmptyPolyPolygon;
+
+ HandleNewClipRegion(aEmptyPolyPolygon, rTargetHolders, rPropertyHolders);
}
else
{
- if(rPropertyHolders.Current().getRegionActive())
+ // get new ClipPolyPolygon, transform it with current transformation
+ basegfx::B2DPolyPolygon aNewClipPolyPolygon(getB2DPolyPolygonFromRegion(rNewRegion));
+ aNewClipPolyPolygon.transform(rPropertyHolders.Current().getTransformation());
+
+ if(rPropertyHolders.Current().getClipPolyPolygonActive())
{
- if(rPropertyHolders.Current().getRegion().IsEmpty())
+ if(0 == rPropertyHolders.Current().getClipPolyPolygon().count())
{
- // nothing to do, empty active clip region will stay empty
+ // nothing to do, empty active clipPolyPolygon will stay empty
// when intersecting with any region
}
else
{
// AND existing and new region
const basegfx::B2DPolyPolygon aOriginalPolyPolygon(
- getB2DPolyPolygonFromRegion(rPropertyHolders.Current().getRegion()));
+ rPropertyHolders.Current().getClipPolyPolygon());
basegfx::B2DPolyPolygon aClippedPolyPolygon;
if(aOriginalPolyPolygon.count())
{
- const basegfx::B2DPolyPolygon aClipPolyPolygon(
- getB2DPolyPolygonFromRegion(rNewRegion));
-
- if(aClipPolyPolygon.count())
- {
- aClippedPolyPolygon = basegfx::tools::clipPolyPolygonOnPolyPolygon(
- aOriginalPolyPolygon, aClipPolyPolygon, true, false);
- }
+ aClippedPolyPolygon = basegfx::tools::clipPolyPolygonOnPolyPolygon(
+ aOriginalPolyPolygon, aNewClipPolyPolygon, true, false);
}
if(aClippedPolyPolygon != aOriginalPolyPolygon)
{
- // start new clipping with intersected region
- const Region aNewRegion(aClippedPolyPolygon);
- HandleNewClipRegion(&aNewRegion, rTargetHolders, rPropertyHolders);
+ // start new clipping with intersected ClipPolyPolygon
+ HandleNewClipRegion(aClippedPolyPolygon, rTargetHolders, rPropertyHolders);
}
}
}
else
{
- // start new clipping with new region
- HandleNewClipRegion(&rNewRegion, rTargetHolders, rPropertyHolders);
+ // start new clipping with new ClipPolyPolygon
+ HandleNewClipRegion(aNewClipPolyPolygon, rTargetHolders, rPropertyHolders);
}
}
@@ -2542,24 +2566,31 @@ namespace
/** CHECKED, WORKS WELL */
const MetaMoveClipRegionAction* pA = (const MetaMoveClipRegionAction*)pAction;
- if(rPropertyHolders.Current().getRegionActive())
+ if(rPropertyHolders.Current().getClipPolyPolygonActive())
{
- if(rPropertyHolders.Current().getRegion().IsEmpty())
+ if(0 == rPropertyHolders.Current().getClipPolyPolygon().count())
{
// nothing to do
}
else
{
- // move using old interface
- Region aRegion(rPropertyHolders.Current().getRegion());
-
const sal_Int32 nHor(pA->GetHorzMove());
const sal_Int32 nVer(pA->GetVertMove());
if(0 != nHor || 0 != nVer)
{
- aRegion.Move(nHor, nVer);
- HandleNewClipRegion(&aRegion, rTargetHolders, rPropertyHolders);
+ // prepare translation, add current transformation
+ basegfx::B2DVector aVector(pA->GetHorzMove(), pA->GetVertMove());
+ aVector *= rPropertyHolders.Current().getTransformation();
+ basegfx::B2DHomMatrix aTransform(
+ basegfx::tools::createTranslateB2DHomMatrix(aVector));
+
+ // transform existing region
+ basegfx::B2DPolyPolygon aClipPolyPolygon(
+ rPropertyHolders.Current().getClipPolyPolygon());
+
+ aClipPolyPolygon.transform(aTransform);
+ HandleNewClipRegion(aClipPolyPolygon, rTargetHolders, rPropertyHolders);
}
}
}
@@ -2764,10 +2795,12 @@ namespace
const bool bRegionMayChange(rPropertyHolders.Current().getPushFlags() & PUSH_CLIPREGION);
const bool bRasterOpMayChange(rPropertyHolders.Current().getPushFlags() & PUSH_RASTEROP);
- if(bRegionMayChange && rPropertyHolders.Current().getRegionActive())
+ if(bRegionMayChange && rPropertyHolders.Current().getClipPolyPolygonActive())
{
// end evtl. clipping
- HandleNewClipRegion(0, rTargetHolders, rPropertyHolders);
+ const basegfx::B2DPolyPolygon aEmptyPolyPolygon;
+
+ HandleNewClipRegion(aEmptyPolyPolygon, rTargetHolders, rPropertyHolders);
}
if(bRasterOpMayChange && rPropertyHolders.Current().isRasterOpActive())
@@ -2784,10 +2817,11 @@ namespace
HandleNewRasterOp(rPropertyHolders.Current().getRasterOp(), rTargetHolders, rPropertyHolders);
}
- if(bRegionMayChange && rPropertyHolders.Current().getRegionActive())
+ if(bRegionMayChange && rPropertyHolders.Current().getClipPolyPolygonActive())
{
// start evtl. clipping
- HandleNewClipRegion(&rPropertyHolders.Current().getRegion(), rTargetHolders, rPropertyHolders);
+ HandleNewClipRegion(
+ rPropertyHolders.Current().getClipPolyPolygon(), rTargetHolders, rPropertyHolders);
}
break;
@@ -2935,8 +2969,11 @@ namespace
drawinglayer::primitive2d::Primitive2DSequence xSubContent;
{
rTargetHolders.Push();
+ // #i# for sub-Mteafile contents, do start with new, default render state
+ rPropertyHolders.PushDefault();
interpretMetafile(rContent, rTargetHolders, rPropertyHolders, rViewInformation);
xSubContent = rTargetHolders.Current().getPrimitive2DSequence(rPropertyHolders.Current());
+ rPropertyHolders.Pop();
rTargetHolders.Pop();
}
diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
index 5dbdce756a5a..d94fbb5f893c 100644
--- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
@@ -147,7 +147,7 @@ namespace drawinglayer
// get 2d range of texture coordinates
const basegfx::B2DRange aOutlineRange(basegfx::tools::getRange(aTexPolyPolygon));
const basegfx::BColor aHatchColor(getHatch().getColor());
- const double fAngle(-getHatch().getAngle());
+ const double fAngle(getHatch().getAngle());
::std::vector< basegfx::B2DHomMatrix > aMatrices;
// get hatch transformations
@@ -156,13 +156,13 @@ namespace drawinglayer
case attribute::HATCHSTYLE_TRIPLE:
{
// rotated 45 degrees
- texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle + F_PI4);
+ texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle - F_PI4);
aHatch.appendTransformations(aMatrices);
}
case attribute::HATCHSTYLE_DOUBLE:
{
// rotated 90 degrees
- texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle + F_PI2);
+ texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle - F_PI2);
aHatch.appendTransformations(aMatrices);
}
case attribute::HATCHSTYLE_SINGLE:
diff --git a/drawinglayer/source/processor2d/vclhelpergradient.cxx b/drawinglayer/source/processor2d/vclhelpergradient.cxx
index b9fa91a89750..6c318dbcedc9 100644
--- a/drawinglayer/source/processor2d/vclhelpergradient.cxx
+++ b/drawinglayer/source/processor2d/vclhelpergradient.cxx
@@ -210,16 +210,6 @@ namespace drawinglayer
::std::vector< basegfx::BColor > aColors;
basegfx::B2DPolygon aUnitPolygon;
- if(attribute::GRADIENTSTYLE_RADIAL == eGradientStyle || attribute::GRADIENTSTYLE_ELLIPTICAL == eGradientStyle)
- {
- const basegfx::B2DPoint aCircleCenter(0.5, 0.5);
- aUnitPolygon = basegfx::tools::createPolygonFromEllipse(aCircleCenter, 0.5, 0.5);
- }
- else
- {
- aUnitPolygon = basegfx::tools::createUnitPolygon();
- }
-
// make sure steps is not too high/low
nSteps = impCalcGradientSteps(rOutDev, nSteps, aOutlineRange, sal_uInt32((rStart.getMaximumDistance(rEnd) * 127.5) + 0.5));
@@ -231,6 +221,7 @@ namespace drawinglayer
texture::GeoTexSvxGradientLinear aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fAngle);
aGradient.appendTransformations(aMatrices);
aGradient.appendColors(aColors);
+ aUnitPolygon = basegfx::tools::createUnitPolygon();
break;
}
case attribute::GRADIENTSTYLE_AXIAL:
@@ -238,6 +229,7 @@ namespace drawinglayer
texture::GeoTexSvxGradientAxial aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fAngle);
aGradient.appendTransformations(aMatrices);
aGradient.appendColors(aColors);
+ aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(-1, -1, 1, 1));
break;
}
case attribute::GRADIENTSTYLE_RADIAL:
@@ -245,6 +237,7 @@ namespace drawinglayer
texture::GeoTexSvxGradientRadial aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetY);
aGradient.appendTransformations(aMatrices);
aGradient.appendColors(aColors);
+ aUnitPolygon = basegfx::tools::createPolygonFromCircle(basegfx::B2DPoint(0,0), 1);
break;
}
case attribute::GRADIENTSTYLE_ELLIPTICAL:
@@ -252,6 +245,7 @@ namespace drawinglayer
texture::GeoTexSvxGradientElliptical aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetX, fAngle);
aGradient.appendTransformations(aMatrices);
aGradient.appendColors(aColors);
+ aUnitPolygon = basegfx::tools::createPolygonFromCircle(basegfx::B2DPoint(0,0), 1);
break;
}
case attribute::GRADIENTSTYLE_SQUARE:
@@ -259,6 +253,7 @@ namespace drawinglayer
texture::GeoTexSvxGradientSquare aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetX, fAngle);
aGradient.appendTransformations(aMatrices);
aGradient.appendColors(aColors);
+ aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(-1, -1, 1, 1));
break;
}
case attribute::GRADIENTSTYLE_RECT:
@@ -266,6 +261,7 @@ namespace drawinglayer
texture::GeoTexSvxGradientRect aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetX, fAngle);
aGradient.appendTransformations(aMatrices);
aGradient.appendColors(aColors);
+ aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(-1, -1, 1, 1));
break;
}
}
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 0bc1b57113b8..983cc8f58d4f 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1225,17 +1225,16 @@ namespace drawinglayer
{
// need to handle PolyPolygonHatchPrimitive2D here to support XPATHFILL_SEQ_BEGIN/XPATHFILL_SEQ_END
SvtGraphicFill* pSvtGraphicFill = 0;
+ const primitive2d::PolyPolygonHatchPrimitive2D& rHatchCandidate = static_cast< const primitive2d::PolyPolygonHatchPrimitive2D& >(rCandidate);
+ const attribute::FillHatchAttribute& rFillHatchAttribute = rHatchCandidate.getFillHatch();
+ basegfx::B2DPolyPolygon aLocalPolyPolygon(rHatchCandidate.getB2DPolyPolygon());
+ aLocalPolyPolygon.transform(maCurrentTransformation);
if(!mnSvtGraphicFillCount)
{
- const primitive2d::PolyPolygonHatchPrimitive2D& rHatchCandidate = static_cast< const primitive2d::PolyPolygonHatchPrimitive2D& >(rCandidate);
- basegfx::B2DPolyPolygon aLocalPolyPolygon(rHatchCandidate.getB2DPolyPolygon());
- aLocalPolyPolygon.transform(maCurrentTransformation);
-
if(aLocalPolyPolygon.count())
{
// re-create a VCL hatch as base data
- const attribute::FillHatchAttribute& rFillHatchAttribute = rHatchCandidate.getFillHatch();
SvtGraphicFill::HatchType eHatch(SvtGraphicFill::hatchSingle);
switch(rFillHatchAttribute.getStyle())
@@ -1289,9 +1288,22 @@ namespace drawinglayer
// Do use decomposition; encapsulate with SvtGraphicFill
impStartSvtGraphicFill(pSvtGraphicFill);
- process(rCandidate.get2DDecomposition(getViewInformation2D()));
- impEndSvtGraphicFill(pSvtGraphicFill);
+ // #i111954# do NOT use decomposition, but use direct VCL-command
+ // process(rCandidate.get2DDecomposition(getViewInformation2D()));
+ const PolyPolygon aToolsPolyPolygon(aLocalPolyPolygon);
+ const HatchStyle aHatchStyle(
+ attribute::HATCHSTYLE_SINGLE == rFillHatchAttribute.getStyle() ? HATCH_SINGLE :
+ attribute::HATCHSTYLE_DOUBLE == rFillHatchAttribute.getStyle() ? HATCH_DOUBLE :
+ HATCH_TRIPLE);
+
+ mpOutputDevice->DrawHatch(aToolsPolyPolygon,
+ Hatch(aHatchStyle,
+ Color(rFillHatchAttribute.getColor()),
+ basegfx::fround(rFillHatchAttribute.getDistance()),
+ basegfx::fround(rFillHatchAttribute.getAngle() / F_PI1800)));
+
+ impEndSvtGraphicFill(pSvtGraphicFill);
break;
}
case PRIMITIVE2D_ID_POLYPOLYGONGRADIENTPRIMITIVE2D :
@@ -1429,7 +1441,11 @@ namespace drawinglayer
{
// there is already a clip polygon set; build clipped union of
// current mask polygon and new one
- maClipPolyPolygon = basegfx::tools::clipPolyPolygonOnPolyPolygon(aMask, maClipPolyPolygon, false, false);
+ maClipPolyPolygon = basegfx::tools::clipPolyPolygonOnPolyPolygon(
+ aMask,
+ maClipPolyPolygon,
+ true, // #i106516# we want the inside of aMask, not the outside
+ false);
}
else
{
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index a1b1393a2fac..6a280fcad95e 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -284,20 +284,37 @@ namespace drawinglayer
if(bAllowUsingDrawTransparent && 1 == rContent.getLength())
{
const primitive2d::Primitive2DReference xReference(rContent[0]);
- const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get());
+ const primitive2d::BasePrimitive2D* pBasePrimitive = dynamic_cast< const primitive2d::BasePrimitive2D* >(xReference.get());
- if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID())
+ if(pBasePrimitive)
{
- // single transparent PolyPolygon identified, use directly
- const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor()));
- mpOutputDevice->SetFillColor(Color(aPolygonColor));
- mpOutputDevice->SetLineColor();
-
- basegfx::B2DPolyPolygon aLocalPolyPolygon(pPoPoColor->getB2DPolyPolygon());
- aLocalPolyPolygon.transform(maCurrentTransformation);
-
- mpOutputDevice->DrawTransparent(aLocalPolyPolygon, rUniTransparenceCandidate.getTransparence());
- bDrawTransparentUsed = true;
+ switch(pBasePrimitive->getPrimitive2DID())
+ {
+ case PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D:
+ {
+ // single transparent PolyPolygon identified, use directly
+ const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = static_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(pBasePrimitive);
+ OSL_ENSURE(pPoPoColor, "OOps, PrimitiveID and PrimitiveType do not match (!)");
+ const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor()));
+ mpOutputDevice->SetFillColor(Color(aPolygonColor));
+ mpOutputDevice->SetLineColor();
+
+ basegfx::B2DPolyPolygon aLocalPolyPolygon(pPoPoColor->getB2DPolyPolygon());
+ aLocalPolyPolygon.transform(maCurrentTransformation);
+
+ mpOutputDevice->DrawTransparent(aLocalPolyPolygon, rUniTransparenceCandidate.getTransparence());
+ bDrawTransparentUsed = true;
+ break;
+ }
+ // #i# need to wait for #i101378# which is in CWS vcl112 to directly paint transparent hairlines
+ //case PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D:
+ //{
+ // // single transparent PolygonHairlinePrimitive2D identified, use directly
+ // const primitive2d::PolygonHairlinePrimitive2D* pPoHair = static_cast< const primitive2d::PolygonHairlinePrimitive2D* >(pBasePrimitive);
+ // OSL_ENSURE(pPoHair, "OOps, PrimitiveID and PrimitiveType do not match (!)");
+ // break;
+ //}
+ }
}
}
@@ -469,19 +486,29 @@ namespace drawinglayer
// This is wrong in principle, but looks nicer. This could also be done here directly
// without VCL usage if needed
const primitive2d::FillHatchPrimitive2D& rFillHatchPrimitive = static_cast< const primitive2d::FillHatchPrimitive2D& >(rCandidate);
+ const attribute::FillHatchAttribute& rFillHatchAttributes = rFillHatchPrimitive.getFillHatch();
// create hatch polygon in range size and discrete coordinates
basegfx::B2DRange aHatchRange(rFillHatchPrimitive.getObjectRange());
aHatchRange.transform(maCurrentTransformation);
const basegfx::B2DPolygon aHatchPolygon(basegfx::tools::createPolygonFromRect(aHatchRange));
+ if(rFillHatchAttributes.isFillBackground())
+ {
+ // #i111846# background fill is active; draw fill polygon
+ const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(rFillHatchPrimitive.getBColor()));
+
+ mpOutputDevice->SetFillColor(Color(aPolygonColor));
+ mpOutputDevice->SetLineColor();
+ mpOutputDevice->DrawPolygon(aHatchPolygon);
+ }
+
// set hatch line color
const basegfx::BColor aHatchColor(maBColorModifierStack.getModifiedColor(rFillHatchPrimitive.getBColor()));
mpOutputDevice->SetFillColor();
mpOutputDevice->SetLineColor(Color(aHatchColor));
// get hatch style
- const attribute::FillHatchAttribute& rFillHatchAttributes = rFillHatchPrimitive.getFillHatch();
HatchStyle eHatchStyle(HATCH_SINGLE);
switch(rFillHatchAttributes.getStyle())
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index fe0c6ff1ea4f..e49e54fb751c 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -581,7 +581,7 @@ namespace drawinglayer
impDrawGradientToOutDev(
*mpOutputDevice, aLocalPolyPolygon, rGradient.getStyle(), rGradient.getSteps(),
aStartColor, aEndColor, rGradient.getBorder(),
- -rGradient.getAngle(), rGradient.getOffsetX(), rGradient.getOffsetY(), false);
+ rGradient.getAngle(), rGradient.getOffsetX(), rGradient.getOffsetY(), false);
}
}
}
diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
index b6f5cd60f271..13d50a63878b 100644
--- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
@@ -100,12 +100,12 @@ namespace drawinglayer
{
case attribute::GRADIENTSTYLE_LINEAR:
{
- pNewTex.reset(new texture::GeoTexSvxGradientLinear(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), -rFillGradient.getAngle()));
+ pNewTex.reset(new texture::GeoTexSvxGradientLinear(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getAngle()));
break;
}
case attribute::GRADIENTSTYLE_AXIAL:
{
- pNewTex.reset(new texture::GeoTexSvxGradientAxial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), -rFillGradient.getAngle()));
+ pNewTex.reset(new texture::GeoTexSvxGradientAxial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getAngle()));
break;
}
case attribute::GRADIENTSTYLE_RADIAL:
@@ -115,17 +115,17 @@ namespace drawinglayer
}
case attribute::GRADIENTSTYLE_ELLIPTICAL:
{
- pNewTex.reset(new texture::GeoTexSvxGradientElliptical(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle()));
+ pNewTex.reset(new texture::GeoTexSvxGradientElliptical(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()));
break;
}
case attribute::GRADIENTSTYLE_SQUARE:
{
- pNewTex.reset(new texture::GeoTexSvxGradientSquare(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle()));
+ pNewTex.reset(new texture::GeoTexSvxGradientSquare(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()));
break;
}
case attribute::GRADIENTSTYLE_RECT:
{
- pNewTex.reset(new texture::GeoTexSvxGradientRect(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle()));
+ pNewTex.reset(new texture::GeoTexSvxGradientRect(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()));
break;
}
}
diff --git a/drawinglayer/source/processor3d/shadow3dextractor.cxx b/drawinglayer/source/processor3d/shadow3dextractor.cxx
index 2abbcaa9f83f..9e0c0674ea66 100644
--- a/drawinglayer/source/processor3d/shadow3dextractor.cxx
+++ b/drawinglayer/source/processor3d/shadow3dextractor.cxx
@@ -51,6 +51,25 @@ namespace drawinglayer
{
namespace processor3d
{
+ /// helper to convert from BasePrimitive2DVector to primitive2d::Primitive2DSequence
+ const primitive2d::Primitive2DSequence Shadow3DExtractingProcessor::getPrimitive2DSequenceFromBasePrimitive2DVector(
+ const BasePrimitive2DVector& rVector) const
+ {
+ const sal_uInt32 nCount(rVector.size());
+ primitive2d::Primitive2DSequence aRetval(nCount);
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ aRetval[a] = rVector[a];
+ }
+
+ // all entries taken over; no need to delete entries, just reset to
+ // mark as empty
+ const_cast< BasePrimitive2DVector& >(rVector).clear();
+
+ return aRetval;
+ }
+
// as tooling, the process() implementation takes over API handling and calls this
// virtual render method when the primitive implementation is BasePrimitive3D-based.
void Shadow3DExtractingProcessor::processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate)
@@ -64,8 +83,8 @@ namespace drawinglayer
const primitive3d::ShadowPrimitive3D& rPrimitive = static_cast< const primitive3d::ShadowPrimitive3D& >(rCandidate);
// set new target
- primitive2d::Primitive2DSequence aNewSubList;
- primitive2d::Primitive2DSequence* pLastTargetSequence = mpPrimitive2DSequence;
+ BasePrimitive2DVector aNewSubList;
+ BasePrimitive2DVector* pLastTargetSequence = mpPrimitive2DSequence;
mpPrimitive2DSequence = &aNewSubList;
// activate convert
@@ -84,21 +103,26 @@ namespace drawinglayer
mbConvert = bLastConvert;
mpPrimitive2DSequence = pLastTargetSequence;
- // create 2d shadow primitive with result
- const primitive2d::Primitive2DReference xRef(new primitive2d::ShadowPrimitive2D(rPrimitive.getShadowTransform(), rPrimitive.getShadowColor(), aNewSubList));
+ // create 2d shadow primitive with result. This also fetches all entries
+ // from aNewSubList, so there is no need to delete them
+ primitive2d::BasePrimitive2D* pNew = new primitive2d::ShadowPrimitive2D(
+ rPrimitive.getShadowTransform(),
+ rPrimitive.getShadowColor(),
+ getPrimitive2DSequenceFromBasePrimitive2DVector(aNewSubList));
if(basegfx::fTools::more(rPrimitive.getShadowTransparence(), 0.0))
{
// create simpleTransparencePrimitive, add created primitives
- const primitive2d::Primitive2DSequence aNewTransPrimitiveVector(&xRef, 1L);
- const primitive2d::Primitive2DReference xRef2(new primitive2d::UnifiedTransparencePrimitive2D(aNewTransPrimitiveVector, rPrimitive.getShadowTransparence()));
- primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(*mpPrimitive2DSequence, xRef2);
- }
- else
- {
- // add directly
- primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(*mpPrimitive2DSequence, xRef);
+ const primitive2d::Primitive2DReference xRef(pNew);
+ const primitive2d::Primitive2DSequence aNewTransPrimitiveVector(&xRef, 1);
+
+ pNew = new primitive2d::UnifiedTransparencePrimitive2D(
+ aNewTransPrimitiveVector,
+ rPrimitive.getShadowTransparence());
}
+
+ mpPrimitive2DSequence->push_back(pNew);
+
break;
}
case PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D :
@@ -161,8 +185,10 @@ namespace drawinglayer
if(a2DHairline.count())
{
a2DHairline.transform(getObjectTransformation());
- const primitive2d::Primitive2DReference xRef(new primitive2d::PolygonHairlinePrimitive2D(a2DHairline, maPrimitiveColor));
- primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(*mpPrimitive2DSequence, xRef);
+ mpPrimitive2DSequence->push_back(
+ new primitive2d::PolygonHairlinePrimitive2D(
+ a2DHairline,
+ maPrimitiveColor));
}
}
break;
@@ -190,8 +216,10 @@ namespace drawinglayer
if(a2DFill.count())
{
a2DFill.transform(getObjectTransformation());
- const primitive2d::Primitive2DReference xRef(new primitive2d::PolyPolygonColorPrimitive2D(a2DFill, maPrimitiveColor));
- primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(*mpPrimitive2DSequence, xRef);
+ mpPrimitive2DSequence->push_back(
+ new primitive2d::PolyPolygonColorPrimitive2D(
+ a2DFill,
+ maPrimitiveColor));
}
}
break;
@@ -251,6 +279,16 @@ namespace drawinglayer
}
}
+ Shadow3DExtractingProcessor::~Shadow3DExtractingProcessor()
+ {
+ OSL_ENSURE(0 == maPrimitive2DSequence.size(),
+ "OOps, someone used Shadow3DExtractingProcessor, but did not fetch the results (!)");
+ for(sal_uInt32 a(0); a < maPrimitive2DSequence.size(); a++)
+ {
+ delete maPrimitive2DSequence[a];
+ }
+ }
+
basegfx::B2DPolygon Shadow3DExtractingProcessor::impDoShadowProjection(const basegfx::B3DPolygon& rSource)
{
basegfx::B2DPolygon aRetval;
@@ -291,6 +329,12 @@ namespace drawinglayer
return aRetval;
}
+
+ const primitive2d::Primitive2DSequence Shadow3DExtractingProcessor::getPrimitive2DSequence() const
+ {
+ return getPrimitive2DSequenceFromBasePrimitive2DVector(maPrimitive2DSequence);
+ }
+
} // end of namespace processor3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
index 326b9d392999..b06718d01ccb 100644
--- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
@@ -487,7 +487,7 @@ private:
boost::shared_ptr< drawinglayer::texture::GeoTexSvx > mpTransparenceGeoTexSvx;
drawinglayer::attribute::MaterialAttribute3D maMaterial;
basegfx::B3DPolyPolygon maPolyPolygon;
- sal_uInt32 mfCenterZ;
+ double mfCenterZ;
// bitfield
bool mbModulate : 1;
diff --git a/drawinglayer/source/texture/texture.cxx b/drawinglayer/source/texture/texture.cxx
index 770e3035692d..107072b712dd 100644
--- a/drawinglayer/source/texture/texture.cxx
+++ b/drawinglayer/source/texture/texture.cxx
@@ -158,15 +158,10 @@ namespace drawinglayer
{
if(maGradientInfo.mnSteps)
{
- const double fTop(mfBorder);
- const double fStripeWidth((1.0 - fTop) / maGradientInfo.mnSteps);
-
+ const double fStripeWidth(1.0 / maGradientInfo.mnSteps);
for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++)
{
- const double fOffsetUpper(fStripeWidth * (double)a);
-
- // create matrix
- const basegfx::B2DRange aRect(0.0, fTop + fOffsetUpper, 1.0, 1.0);
+ const basegfx::B2DRange aRect(0.0, fStripeWidth * a, 1.0, 1.0);
impAppendMatrix(rMatrices, aRect);
}
}
@@ -218,17 +213,10 @@ namespace drawinglayer
{
if(maGradientInfo.mnSteps)
{
- const double fHalfBorder(mfBorder * 0.5);
- double fTop(fHalfBorder);
- double fBottom(1.0 - fHalfBorder);
- const double fStripeWidth((fBottom - fTop) / ((maGradientInfo.mnSteps * 2L) - 1L));
-
- for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++)
+ const double fStripeWidth=1.0 / (maGradientInfo.mnSteps - 1L);
+ for(sal_uInt32 a(maGradientInfo.mnSteps-1L); a != 0; a--)
{
- const double fOffset(fStripeWidth * (double)a);
-
- // create matrix
- const basegfx::B2DRange aRect(0.0, fTop + fOffset, 1.0, fBottom - fOffset);
+ const basegfx::B2DRange aRect(0, 0, 1.0, fStripeWidth * a);
impAppendMatrix(rMatrices, aRect);
}
}
@@ -280,34 +268,10 @@ namespace drawinglayer
{
if(maGradientInfo.mnSteps)
{
- const double fHalfBorder((1.0 - mfBorder) * 0.5);
- double fLeft(0.5 - fHalfBorder);
- double fTop(0.5 - fHalfBorder);
- double fRight(0.5 + fHalfBorder);
- double fBottom(0.5 + fHalfBorder);
- double fIncrementX, fIncrementY;
-
- if(maGradientInfo.mfAspectRatio > 1.0)
- {
- fIncrementY = (fBottom - fTop) / (double)(maGradientInfo.mnSteps * 2L);
- fIncrementX = fIncrementY / maGradientInfo.mfAspectRatio;
- }
- else
- {
- fIncrementX = (fRight - fLeft) / (double)(maGradientInfo.mnSteps * 2L);
- fIncrementY = fIncrementX * maGradientInfo.mfAspectRatio;
- }
-
- for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++)
+ const double fStepSize=1.0 / maGradientInfo.mnSteps;
+ for(sal_uInt32 a(maGradientInfo.mnSteps-1L); a > 0; a--)
{
- // next step
- fLeft += fIncrementX;
- fRight -= fIncrementX;
- fTop += fIncrementY;
- fBottom -= fIncrementY;
-
- // create matrix
- const basegfx::B2DRange aRect(fLeft, fTop, fRight, fBottom);
+ const basegfx::B2DRange aRect(0, 0, fStepSize*a, fStepSize*a);
impAppendMatrix(rMatrices, aRect);
}
}
@@ -352,34 +316,29 @@ namespace drawinglayer
{
if(maGradientInfo.mnSteps)
{
- const double fHalfBorder((1.0 - mfBorder) * 0.5);
- double fLeft(0.5 - fHalfBorder);
- double fTop(0.5 - fHalfBorder);
- double fRight(0.5 + fHalfBorder);
- double fBottom(0.5 + fHalfBorder);
+ double fWidth(1);
+ double fHeight(1);
double fIncrementX, fIncrementY;
if(maGradientInfo.mfAspectRatio > 1.0)
{
- fIncrementY = (fBottom - fTop) / (double)(maGradientInfo.mnSteps * 2L);
+ fIncrementY = fHeight / maGradientInfo.mnSteps;
fIncrementX = fIncrementY / maGradientInfo.mfAspectRatio;
}
else
{
- fIncrementX = (fRight - fLeft) / (double)(maGradientInfo.mnSteps * 2L);
+ fIncrementX = fWidth / maGradientInfo.mnSteps;
fIncrementY = fIncrementX * maGradientInfo.mfAspectRatio;
}
for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++)
{
// next step
- fLeft += fIncrementX;
- fRight -= fIncrementX;
- fTop += fIncrementY;
- fBottom -= fIncrementY;
+ fWidth -= fIncrementX;
+ fHeight -= fIncrementY;
// create matrix
- const basegfx::B2DRange aRect(fLeft, fTop, fRight, fBottom);
+ const basegfx::B2DRange aRect(0, 0, fWidth, fHeight);
impAppendMatrix(rMatrices, aRect);
}
}
@@ -424,42 +383,10 @@ namespace drawinglayer
{
if(maGradientInfo.mnSteps)
{
- const double fHalfBorder((1.0 - mfBorder) * 0.5);
- double fLeft(0.5 - fHalfBorder);
- double fTop(0.5 - fHalfBorder);
- double fRight(0.5 + fHalfBorder);
- double fBottom(0.5 + fHalfBorder);
- double fIncrementX, fIncrementY;
-
- if(maGradientInfo.mfAspectRatio > 1.0)
- {
- const double fWidth(fRight - fLeft);
- const double fHalfAspectExpansion(((maGradientInfo.mfAspectRatio - 1.0) * 0.5) * fWidth);
- fTop -= fHalfAspectExpansion;
- fBottom += fHalfAspectExpansion;
- fIncrementX = fWidth / (double)(maGradientInfo.mnSteps * 2L);
- fIncrementY = fIncrementX * maGradientInfo.mfAspectRatio;
- }
- else
+ const double fStepSize=1.0 / maGradientInfo.mnSteps;
+ for(sal_uInt32 a(maGradientInfo.mnSteps-1L); a > 0; a--)
{
- const double fHeight(fBottom - fTop);
- const double fHalfAspectExpansion((((1.0 / maGradientInfo.mfAspectRatio) - 1.0) * 0.5) * fHeight);
- fLeft -= fHalfAspectExpansion;
- fRight += fHalfAspectExpansion;
- fIncrementY = fHeight / (double)(maGradientInfo.mnSteps * 2L);
- fIncrementX = fIncrementY / maGradientInfo.mfAspectRatio;
- }
-
- for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++)
- {
- // next step
- fLeft += fIncrementX;
- fRight -= fIncrementX;
- fTop += fIncrementY;
- fBottom -= fIncrementY;
-
- // create matrix
- const basegfx::B2DRange aRect(fLeft, fTop, fRight, fBottom);
+ const basegfx::B2DRange aRect(0, 0, fStepSize*a, fStepSize*a);
impAppendMatrix(rMatrices, aRect);
}
}
@@ -504,34 +431,29 @@ namespace drawinglayer
{
if(maGradientInfo.mnSteps)
{
- const double fHalfBorder((1.0 - mfBorder) * 0.5);
- double fLeft(0.5 - fHalfBorder);
- double fTop(0.5 - fHalfBorder);
- double fRight(0.5 + fHalfBorder);
- double fBottom(0.5 + fHalfBorder);
+ double fWidth(1);
+ double fHeight(1);
double fIncrementX, fIncrementY;
if(maGradientInfo.mfAspectRatio > 1.0)
{
- fIncrementY = (fBottom - fTop) / (double)(maGradientInfo.mnSteps * 2L);
+ fIncrementY = fHeight / maGradientInfo.mnSteps;
fIncrementX = fIncrementY / maGradientInfo.mfAspectRatio;
}
else
{
- fIncrementX = (fRight - fLeft) / (double)(maGradientInfo.mnSteps * 2L);
+ fIncrementX = fWidth / maGradientInfo.mnSteps;
fIncrementY = fIncrementX * maGradientInfo.mfAspectRatio;
}
for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++)
{
// next step
- fLeft += fIncrementX;
- fRight -= fIncrementX;
- fTop += fIncrementY;
- fBottom -= fIncrementY;
+ fWidth -= fIncrementX;
+ fHeight -= fIncrementY;
// create matrix
- const basegfx::B2DRange aRect(fLeft, fTop, fRight, fBottom);
+ const basegfx::B2DRange aRect(0, 0, fWidth, fHeight);
impAppendMatrix(rMatrices, aRect);
}
}
@@ -567,6 +489,8 @@ namespace drawinglayer
double fTargetOffsetX(rTargetRange.getMinX());
double fTargetOffsetY(rTargetRange.getMinY());
+ fAngle = -fAngle;
+
// add object expansion
if(0.0 != fAngle)
{
diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx
index d83998df9efd..cf85b53bad43 100644
--- a/drawinglayer/source/texture/texture3d.cxx
+++ b/drawinglayer/source/texture/texture3d.cxx
@@ -189,7 +189,7 @@ namespace drawinglayer
{
const attribute::FillHatchAttribute& rHatch(rPrimitive.getHatch());
const basegfx::B2DRange aOutlineRange(0.0, 0.0, rPrimitive.getTextureSize().getX(), rPrimitive.getTextureSize().getY());
- const double fAngleA(-rHatch.getAngle());
+ const double fAngleA(rHatch.getAngle());
maColor = rHatch.getColor();
mbFillBackground = rHatch.isFillBackground();
mp0 = new GeoTexSvxHatch(aOutlineRange, rHatch.getDistance(), fAngleA);
diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index 3d9afded321f..84f4802e7b44 100644
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -232,6 +232,7 @@ public:
ESelection WordRight( const ESelection& rSelection, USHORT nWordType ) const;
ESelection CursorLeft( const ESelection& rSelection, USHORT nCharacterIteratorMode ) const;
ESelection CursorRight( const ESelection& rSelection, USHORT nCharacterIteratorMode ) const;
+ ESelection SelectSentence( const ESelection& rCurSel ) const;
void Clear();
void SetText( const String& rStr );
@@ -396,7 +397,7 @@ public:
// put spell position to start of current sentence
void PutSpellingToSentenceStart( EditView& rEditView );
//applies a changed sentence
- void ApplyChangedSentence(EditView& rEditView, const ::svx::SpellPortions& rNewPortions, bool bIsGrammarChecking );
+ void ApplyChangedSentence(EditView& rEditView, const ::svx::SpellPortions& rNewPortions, bool bRecheck );
//deinitialize sentence spelling
void EndSpelling();
diff --git a/editeng/inc/editeng/editview.hxx b/editeng/inc/editeng/editview.hxx
index ccea5d09321e..15052ecc3c0c 100644
--- a/editeng/inc/editeng/editview.hxx
+++ b/editeng/inc/editeng/editview.hxx
@@ -28,6 +28,8 @@
#ifndef _MyEDITVIEW_HXX
#define _MyEDITVIEW_HXX
+#include <com/sun/star/i18n/WordType.hpp>
+
#include <rsc/rscsfx.hxx>
#include <i18npool/lang.h>
#include <tools/color.hxx>
@@ -111,7 +113,7 @@ public:
BOOL HasSelection() const;
ESelection GetSelection() const;
void SetSelection( const ESelection& rNewSel );
- BOOL SelectCurrentWord();
+ BOOL SelectCurrentWord( sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES );
void IndentBlock();
void UnindentBlock();
diff --git a/editeng/inc/editeng/outliner.hxx b/editeng/inc/editeng/outliner.hxx
index 2d7afdb8a68c..d167d2a30f8f 100644
--- a/editeng/inc/editeng/outliner.hxx
+++ b/editeng/inc/editeng/outliner.hxx
@@ -389,6 +389,12 @@ public:
Selection GetSurroundingTextSelection() const;
};
+
+// some thesaurus functionality to avoid code duplication in different projects...
+bool EDITENG_DLLPUBLIC GetStatusValueForThesaurusFromContext( String &rStatusVal, LanguageType &rLang, const EditView &rEditView );
+void EDITENG_DLLPUBLIC ReplaceTextWithSynonym( EditView &rEditView, const String &rSynonmText );
+
+
//#if 0 // _SOLAR__PRIVATE
DECLARE_LIST(ViewList,OutlinerView*)
//#else
@@ -1017,7 +1023,7 @@ public:
// put spell position to start of current sentence
void PutSpellingToSentenceStart( EditView& rEditView );
//applies a changed sentence
- void ApplyChangedSentence(EditView& rEditView, const ::svx::SpellPortions& rNewPortions, bool bIsGrammarChecking );
+ void ApplyChangedSentence(EditView& rEditView, const ::svx::SpellPortions& rNewPortions, bool bRecheck );
void EndSpelling();
/** sets a link that is called at the beginning of a drag operation at an edit view */
diff --git a/editeng/inc/editeng/splwrap.hxx b/editeng/inc/editeng/splwrap.hxx
index 89eb0b53320b..5e46a96adb9f 100644
--- a/editeng/inc/editeng/splwrap.hxx
+++ b/editeng/inc/editeng/splwrap.hxx
@@ -56,6 +56,7 @@ class EDITENG_DLLPUBLIC SvxSpellWrapper {
private:
friend class SvxSpellCheckDialog;
friend class SvxHyphenWordDialog;
+ friend class SvxHyphenWordDialog_Impl;
Window* pWin;
::com::sun::star::uno::Reference<
diff --git a/editeng/inc/editeng/svxacorr.hxx b/editeng/inc/editeng/svxacorr.hxx
index c900228cc053..1ef6bad09d9b 100644
--- a/editeng/inc/editeng/svxacorr.hxx
+++ b/editeng/inc/editeng/svxacorr.hxx
@@ -209,6 +209,8 @@ class EDITENG_DLLPUBLIC SvxAutoCorrect
SvxAutoCorrLastFileAskTable_Impl* pLastFileTable;
CharClass* pCharClass;
+ bool bRunNext;
+
LanguageType eCharClassLang;
long nFlags;
@@ -374,6 +376,8 @@ public:
xub_StrLen nSttPos, xub_StrLen nEndPos,
LanguageType eLang = LANGUAGE_SYSTEM);
+ bool HasRunNext() { return bRunNext; }
+
static long GetDefaultFlags();
// returns TRUE for charcters where the function
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 94981dc32e73..b5a43ae8a948 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -1129,6 +1129,26 @@ namespace accessibility
return aPoint;
}
+ // --> OD 2009-12-16 #i88070#
+ // fallback to parent's <XAccessibleContext> instance
+ else
+ {
+ uno::Reference< XAccessibleContext > xParentContext = xParent->getAccessibleContext();
+ if ( xParentContext.is() )
+ {
+ uno::Reference< XAccessibleComponent > xParentContextComponent( xParentContext, uno::UNO_QUERY );
+ if( xParentContextComponent.is() )
+ {
+ awt::Point aRefPoint = xParentContextComponent->getLocationOnScreen();
+ awt::Point aPoint = getLocation();
+ aPoint.X += aRefPoint.X;
+ aPoint.Y += aRefPoint.Y;
+
+ return aPoint;
+ }
+ }
+ }
+ // <--
}
throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Cannot access parent")),
diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx
index 01a387249f24..a21c6ed345c6 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -458,7 +458,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox )
fprintf( fp, "\n\n ================================================================================" );
fprintf( fp, "\n================== EditEngine & Views ======================================" );
fprintf( fp, "\n================================================================================" );
- fprintf( fp, "\nControl: %lx", pEE->GetControlWord() );
+ fprintf( fp, "\nControl: %"SAL_PRIxUINT32, pEE->GetControlWord() );
fprintf( fp, "\nRefMapMode: %i", pEE->pImpEditEngine->pRefDev->GetMapMode().GetMapUnit() );
fprintf( fp, "\nPaperSize: %li x %li", pEE->GetPaperSize().Width(), pEE->GetPaperSize().Height() );
fprintf( fp, "\nMaxAutoPaperSize: %li x %li", pEE->GetMaxAutoPaperSize().Width(), pEE->GetMaxAutoPaperSize().Height() );
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 212fb8ff9446..1b61a405dc18 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -49,6 +49,7 @@
#include <eerdll2.hxx>
#include <editeng/eerdll.hxx>
#include <editeng.hrc>
+#include <editeng/acorrcfg.hxx>
#include <editeng/flditem.hxx>
#include <editeng/txtrange.hxx>
#include <vcl/graph.hxx>
@@ -812,6 +813,14 @@ ESelection EditEngine::CursorRight( const ESelection& rSelection, USHORT nCharac
return pE->pImpEditEngine->CreateESel( aSel );
}
+ESelection EditEngine::SelectSentence( const ESelection& rCurSel ) const
+{
+ EditEngine* pE = (EditEngine*)this;
+ EditSelection aCurSel( pE->pImpEditEngine->CreateSel( rCurSel ) );
+ EditSelection aSentenceSel( pE->pImpEditEngine->SelectSentence( aCurSel ) );
+ return pE->pImpEditEngine->CreateESel( aSentenceSel );
+}
+
sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView )
{
DBG_CHKTHIS( EditEngine, 0 );
@@ -1144,8 +1153,10 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
xub_Unicode nCharCode = rKeyEvent.GetCharCode();
pEditView->pImpEditView->DrawSelection();
// Autokorrektur ?
+ SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
if ( ( pImpEditEngine->GetStatus().DoAutoCorrect() ) &&
- SvxAutoCorrect::IsAutoCorrectChar( nCharCode ) )
+ ( SvxAutoCorrect::IsAutoCorrectChar( nCharCode ) ||
+ pAutoCorrect->HasRunNext() ) )
{
aCurSel = pImpEditEngine->AutoCorrect( aCurSel, nCharCode, !pEditView->IsInsertMode() );
}
@@ -2195,7 +2206,7 @@ void EditEngine::EndSpelling()
bool EditEngine::SpellSentence(EditView& rView, ::svx::SpellPortions& rToFill, bool bIsGrammarChecking )
{
DBG_CHKTHIS( EditEngine, 0 );
- return pImpEditEngine->SpellSentence( rView, rToFill, bIsGrammarChecking );
+ return pImpEditEngine->SpellSentence( rView, rToFill, bIsGrammarChecking );
}
/*-- 08.09.2008 11:38:32---------------------------------------------------
@@ -2208,10 +2219,10 @@ void EditEngine::PutSpellingToSentenceStart( EditView& rEditView )
/*-- 13.10.2003 16:43:27---------------------------------------------------
-----------------------------------------------------------------------*/
-void EditEngine::ApplyChangedSentence(EditView& rEditView, const ::svx::SpellPortions& rNewPortions, bool bIsGrammarChecking )
+void EditEngine::ApplyChangedSentence(EditView& rEditView, const ::svx::SpellPortions& rNewPortions, bool bRecheck )
{
DBG_CHKTHIS( EditEngine, 0 );
- pImpEditEngine->ApplyChangedSentence( rEditView, rNewPortions, bIsGrammarChecking );
+ pImpEditEngine->ApplyChangedSentence( rEditView, rNewPortions, bRecheck );
}
sal_Bool EditEngine::HasConvertibleTextPortion( LanguageType nLang )
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 766023a0038c..642b5e0d9f17 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -40,6 +40,7 @@
#include <svl/languageoptions.hxx>
#include <svtools/ctrltool.hxx>
#include <svtools/langtab.hxx>
+#include <svtools/filter.hxx>
#include <svl/srchitem.hxx>
@@ -62,6 +63,8 @@
#include <editeng/acorrcfg.hxx>
#include <editeng/unolingu.hxx>
#include <editeng/fontitem.hxx>
+#include <unotools/lingucfg.hxx>
+#include <osl/file.hxx>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/beans/PropertyValues.hdl>
@@ -71,6 +74,8 @@
#include <vcl/settings.hxx>
#include <unotools/lingucfg.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
using ::rtl::OUString;
using namespace com::sun::star;
using namespace com::sun::star::uno;
@@ -1004,6 +1009,26 @@ sal_Bool EditView::IsWrongSpelledWordAtPos( const Point& rPosPixel, sal_Bool bMa
return pImpEditView->IsWrongSpelledWord( aPaM , bMarkIfWrong );
}
+
+static Image lcl_GetImageFromPngUrl( const OUString &rFileUrl )
+{
+ Image aRes;
+ OUString aTmp;
+ osl::FileBase::getSystemPathFromFileURL( rFileUrl, aTmp );
+// ::rtl::OString aPath = OString( aTmp.getStr(), aTmp.getLength(), osl_getThreadTextEncoding() );
+#if defined(WNT)
+// aTmp = lcl_Win_GetShortPathName( aTmp );
+#endif
+ Graphic aGraphic;
+ const String aFilterName( RTL_CONSTASCII_USTRINGPARAM( IMP_PNG ) );
+ if( GRFILTER_OK == GraphicFilter::LoadGraphic( aTmp, aFilterName, aGraphic ) )
+ {
+ aRes = Image( aGraphic.GetBitmapEx() );
+ }
+ return aRes;
+}
+
+
void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
{
#ifndef SVX_LIGHT
@@ -1114,25 +1139,54 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
else
aPopupMenu.RemoveItem( MN_AUTOCORR ); // Loeschen?
- Reference< XDictionaryList > xDicList( SvxGetDictionaryList() );
+ SvtLinguConfig aCfg;
+ const bool bHC = Application::GetSettings().GetStyleSettings().GetHighContrastMode();
+ Reference< XDictionaryList > xDicList( SvxGetDictionaryList() );
Sequence< Reference< XDictionary > > aDics;
+ const Reference< XDictionary > *pDic = NULL;
if (xDicList.is())
- aDics = xDicList->getDictionaries();
- const Reference< XDictionary > *pDic = aDics.getConstArray();
- sal_uInt16 nLanguage = PIMPEE->GetLanguage( aPaM2 );
- sal_uInt16 nDicCount = (USHORT)aDics.getLength();
- for ( sal_uInt16 i = 0; i < nDicCount; i++ )
{
- Reference< XDictionary > xDic( pDic[i], UNO_QUERY );
+ // add the default positive dictionary to dic-list (if not already done).
+ // This is to ensure that there is at least one dictionary to which
+ // words could be added.
+ uno::Reference< linguistic2::XDictionary > xDic( SvxGetOrCreatePosDic( xDicList ) );
if (xDic.is())
+ xDic->setActive( sal_True );
+
+ aDics = xDicList->getDictionaries();
+ pDic = aDics.getConstArray();
+ sal_uInt16 nCheckedLanguage = PIMPEE->GetLanguage( aPaM2 );
+ sal_uInt16 nDicCount = (USHORT)aDics.getLength();
+ for (sal_uInt16 i = 0; i < nDicCount; i++)
{
- sal_uInt16 nActLanguage = SvxLocaleToLanguage( xDic->getLocale() );
- if( xDic->isActive() &&
- xDic->getDictionaryType() == DictionaryType_POSITIVE &&
- (nLanguage == nActLanguage || LANGUAGE_NONE == nActLanguage ) )
+ uno::Reference< linguistic2::XDictionary > xDicTmp( pDic[i], uno::UNO_QUERY );
+ if (!xDicTmp.is() || SvxGetIgnoreAllList() == xDicTmp)
+ continue;
+
+ uno::Reference< frame::XStorable > xStor( xDicTmp, uno::UNO_QUERY );
+ LanguageType nActLanguage = SvxLocaleToLanguage( xDicTmp->getLocale() );
+ if( xDicTmp->isActive()
+ && xDicTmp->getDictionaryType() != linguistic2::DictionaryType_NEGATIVE
+ && (nCheckedLanguage == nActLanguage || LANGUAGE_NONE == nActLanguage )
+ && (!xStor.is() || !xStor->isReadonly()) )
{
- pInsertMenu->InsertItem( MN_DICTSTART + i, xDic->getName() );
+ // the extra 1 is because of the (possible) external
+ // linguistic entry above
+ USHORT nPos = MN_DICTSTART + i;
+ pInsertMenu->InsertItem( nPos, xDicTmp->getName() );
+
+ uno::Reference< lang::XServiceInfo > xSvcInfo( xDicTmp, uno::UNO_QUERY );
+ if (xSvcInfo.is())
+ {
+ OUString aDictionaryImageUrl( aCfg.GetSpellAndGrammarContextDictionaryImage(
+ xSvcInfo->getImplementationName(), bHC) );
+ if (aDictionaryImageUrl.getLength() > 0)
+ {
+ Image aImage( lcl_GetImageFromPngUrl( aDictionaryImageUrl ) );
+ pInsertMenu->SetItemImage( nPos, aImage );
+ }
+ }
}
}
}
@@ -1256,13 +1310,13 @@ void EditView::SpellIgnoreWord()
pImpEditView->SpellIgnoreOrAddWord( sal_False );
}
-sal_Bool EditView::SelectCurrentWord()
+sal_Bool EditView::SelectCurrentWord( sal_Int16 nWordType )
{
DBG_CHKTHIS( EditView, 0 );
DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 );
EditSelection aCurSel( pImpEditView->GetEditSelection() );
pImpEditView->DrawSelection();
- aCurSel = PIMPEE->SelectWord( aCurSel.Max() );
+ aCurSel = PIMPEE->SelectWord( aCurSel.Max(), nWordType );
pImpEditView->SetEditSelection( aCurSel );
pImpEditView->DrawSelection();
ShowCursor( sal_True, sal_False );
diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx
index fed1394e5fd0..f01381a4ae62 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -208,6 +208,9 @@ void EditSpellWrapper::CheckSpellTo()
pSpellInfo->aSpellTo.nIndex = aPaM.GetNode()->Len();
}
}
+
+//////////////////////////////////////////////////////////////////////
+
SV_IMPL_VARARR( WrongRanges, WrongRange );
WrongList::WrongList()
@@ -220,6 +223,14 @@ WrongList::~WrongList()
{
}
+void WrongList::MarkInvalid( USHORT nS, USHORT nE )
+{
+ if ( ( nInvalidStart == NOT_INVALID ) || ( nInvalidStart > nS ) )
+ nInvalidStart = nS;
+ if ( nInvalidEnd < nE )
+ nInvalidEnd = nE;
+}
+
void WrongList::TextInserted( sal_uInt16 nPos, sal_uInt16 nNew, sal_Bool bPosIsSep )
{
if ( !IsInvalid() )
@@ -527,6 +538,7 @@ sal_Bool WrongList::DbgIsBuggy() const
}
#endif
+//////////////////////////////////////////////////////////////////////
EdtAutoCorrDoc::EdtAutoCorrDoc( ImpEditEngine* pE, ContentNode* pN,
sal_uInt16 nCrsr, xub_Unicode cIns )
diff --git a/editeng/source/editeng/edtspell.hxx b/editeng/source/editeng/edtspell.hxx
index cfe0aaf57e87..851848c5ede0 100644
--- a/editeng/source/editeng/edtspell.hxx
+++ b/editeng/source/editeng/edtspell.hxx
@@ -97,13 +97,7 @@ public:
BOOL IsInvalid() const { return nInvalidStart != NOT_INVALID; }
void SetValid() { nInvalidStart = NOT_INVALID; nInvalidEnd = 0; }
- void MarkInvalid( USHORT nS, USHORT nE )
- {
- if ( ( nInvalidStart == NOT_INVALID ) || ( nInvalidStart > nS ) )
- nInvalidStart = nS;
- if ( nInvalidEnd < nE )
- nInvalidEnd = nE;
- }
+ void MarkInvalid( USHORT nS, USHORT nE );
USHORT Count() const { return WrongRanges::Count(); }
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx
index ddb82a06661d..569b80639b6b 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -60,6 +60,7 @@ EditHTMLParser::EditHTMLParser( SvStream& rIn, const String& rBaseURL, SvKeyValu
bWasInPara = FALSE;
nInTable = 0;
nInCell = 0;
+ bInTitle = FALSE;
nDefListLevel = 0;
nBulletLevel = 0;
nNumberingLevel = 0;
@@ -179,11 +180,14 @@ void EditHTMLParser::NextToken( int nToken )
break;
case HTML_TEXTTOKEN:
{
- if ( !bInPara )
- StartPara( FALSE );
-
-// if ( bInPara || pCurAnchor )
+ // #i110937# for <title> content, call aImportHdl (no SkipGroup), but don't insert the text into the EditEngine
+ if (!bInTitle)
{
+ if ( !bInPara )
+ StartPara( FALSE );
+
+ // if ( bInPara || pCurAnchor )
+
String aText = aToken;
if ( aText.Len() && ( aText.GetChar( 0 ) == ' ' )
&& ThrowAwayBlank() && !IsReadPRE() )
@@ -342,6 +346,13 @@ void EditHTMLParser::NextToken( int nToken )
// #58335# kein SkipGroup on/off auf inline markup etc.
+ case HTML_TITLE_ON:
+ bInTitle = TRUE;
+ break;
+ case HTML_TITLE_OFF:
+ bInTitle = FALSE;
+ break;
+
// globals
case HTML_HTML_ON:
case HTML_HTML_OFF:
@@ -355,8 +366,6 @@ void EditHTMLParser::NextToken( int nToken )
case HTML_THEAD_OFF:
case HTML_TBODY_ON:
case HTML_TBODY_OFF:
- case HTML_TITLE_ON:
- case HTML_TITLE_OFF:
// inline elements, structural markup
// HTML 3.0
case HTML_BANNER_ON:
diff --git a/editeng/source/editeng/eehtml.hxx b/editeng/source/editeng/eehtml.hxx
index a9b20bcd652f..8d11e743755a 100644
--- a/editeng/source/editeng/eehtml.hxx
+++ b/editeng/source/editeng/eehtml.hxx
@@ -57,6 +57,7 @@ private:
BOOL bFieldsInserted;
BYTE nInTable;
BYTE nInCell;
+ BOOL bInTitle;
BYTE nDefListLevel;
BYTE nBulletLevel;
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index b327d2a685bd..9ac7de8e2b7d 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1489,7 +1489,7 @@ void ImpEditView::HideDDCursor()
void ImpEditView::ShowDDCursor( const Rectangle& rRect )
{
- if ( !pDragAndDropInfo->bVisCursor )
+ if ( pDragAndDropInfo && !pDragAndDropInfo->bVisCursor )
{
if ( pOutWin->GetCursor() )
pOutWin->GetCursor()->Hide();
@@ -1544,6 +1544,8 @@ void ImpEditView::dragGestureRecognized( const ::com::sun::star::datatransfer::d
vos::OGuard aVclGuard( Application::GetSolarMutex() );
+ pDragAndDropInfo = NULL;
+
Point aMousePosPixel( rDGE.DragOriginX, rDGE.DragOriginY );
EditSelection aCopySel( GetEditSelection() );
@@ -1717,7 +1719,7 @@ void ImpEditView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDro
DBG_ASSERT( pDragAndDropInfo, "Drop - No Drag&Drop info?!" );
- if ( pDragAndDropInfo->bDragAccepted )
+ if ( pDragAndDropInfo && pDragAndDropInfo->bDragAccepted )
{
pEditEngine->GetBeginDropHdl().Call(GetEditViewPtr());
BOOL bChanges = FALSE;
@@ -1817,7 +1819,7 @@ void ImpEditView::dragExit( const ::com::sun::star::datatransfer::dnd::DropTarge
HideDDCursor();
- if ( !pDragAndDropInfo->bStarterOfDD )
+ if ( pDragAndDropInfo && !pDragAndDropInfo->bStarterOfDD )
{
delete pDragAndDropInfo;
pDragAndDropInfo = NULL;
@@ -1837,7 +1839,7 @@ void ImpEditView::dragOver( const ::com::sun::star::datatransfer::dnd::DropTarge
{
// sal_Int8 nSupportedActions = bReadOnly ? datatransfer::dnd::DNDConstants::ACTION_COPY : datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE;
- if ( pDragAndDropInfo->bHasValidData /* && ( nSupportedActions & rDTDE.DropAction ) MT: Default = 0x80 ?! */ )
+ if ( pDragAndDropInfo && pDragAndDropInfo->bHasValidData /* && ( nSupportedActions & rDTDE.DropAction ) MT: Default = 0x80 ?! */ )
{
bAccept = sal_True;
@@ -1957,7 +1959,8 @@ void ImpEditView::dragOver( const ::com::sun::star::datatransfer::dnd::DropTarge
if ( !bAccept )
{
HideDDCursor();
- pDragAndDropInfo->bDragAccepted = FALSE;
+ if (pDragAndDropInfo)
+ pDragAndDropInfo->bDragAccepted = FALSE;
rDTDE.Context->rejectDrag();
}
}
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 3bacfc949e3b..ede5acacc698 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -164,6 +164,7 @@ struct SpellInfo
EESpellState eState;
EPaM aSpellStart;
EPaM aSpellTo;
+ EditPaM aCurSentenceStart;
sal_Bool bSpellToEnd;
sal_Bool bMultipleDoc;
::svx::SpellPortions aLastSpellPortions;
@@ -697,6 +698,8 @@ private:
*/
void ImplFillTextMarkingVector(const ::com::sun::star::lang::Locale& rLocale, EEngineData::TextMarkingVector& rTextMarkingVector, const String& rTxt, const USHORT nIdx, const USHORT nLen) const;
+ SpellInfo * CreateSpellInfo( const EditSelection &rSel, bool bMultipleDocs );
+
protected:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
@@ -953,7 +956,7 @@ public:
//put spelling back to start of current sentence - needed after switch of grammar support
void PutSpellingToSentenceStart( EditView& rEditView );
//applies a changed sentence
- void ApplyChangedSentence(EditView& rEditView, const ::svx::SpellPortions& rNewPortions, bool bIsGrammarChecking );
+ void ApplyChangedSentence(EditView& rEditView, const ::svx::SpellPortions& rNewPortions, bool bRecheck );
//deinitialize sentence spelling
void EndSpelling();
//adds one or more portions of text to the SpellPortions depending on language changes
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index bbdfa47e6a57..778942730e71 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -2755,6 +2755,11 @@ EditPaM ImpEditEngine::ImpInsertText( EditSelection aCurSel, const XubString& rS
EditPaM aCurPaM( aPaM ); // fuers Invalidieren
+ // get word boundaries in order to clear possible WrongList entries
+ // and invalidate all the necessary text (everything after and including the
+ // start of the word)
+ EditSelection aCurWord( SelectWord( aCurPaM, i18n::WordType::DICTIONARY_WORD ) );
+
XubString aText( rStr );
aText.ConvertLineEnd( LINEEND_LF );
SfxVoidItem aTabItem( EE_FEATURE_TAB );
@@ -2809,7 +2814,13 @@ EditPaM ImpEditEngine::ImpInsertText( EditSelection aCurSel, const XubString& rS
}
ParaPortion* pPortion = FindParaPortion( aPaM.GetNode() );
DBG_ASSERT( pPortion, "Blinde Portion in InsertText" );
- pPortion->MarkInvalid( aCurPaM.GetIndex(), aLine.Len() );
+
+ // now remove the Wrongs (red spell check marks) from both words...
+ WrongList *pWrongs = aCurPaM.GetNode()->GetWrongList();
+ if (pWrongs && pWrongs->HasWrongs())
+ pWrongs->ClearWrongs( aCurWord.Min().GetIndex(), aPaM.GetIndex(), aPaM.GetNode() );
+ // ... and mark both words as 'to be checked again'
+ pPortion->MarkInvalid( aCurWord.Min().GetIndex(), aLine.Len() );
}
if ( nEnd < aText.Len() )
aPaM = ImpInsertParaBreak( aPaM );
@@ -4198,7 +4209,18 @@ long ImpEditEngine::GetXPos( ParaPortion* pParaPortion, EditLine* pLine, USHORT
DBG_ERROR("svx::ImpEditEngine::GetXPos(), index out of range!");
}
+#if 0
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/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index dbc6767d1f91..08f50a0da884 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -3613,7 +3613,7 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRec, sal_Bool b
ContentNode* pNode = GetEditDoc().SaveGetObject( 0 );
SeekCursor( pNode, 1, aTmpFont );
Color aFontColor( aTmpFont.GetColor() );
- if( aFontColor == COL_AUTO )
+ if( (aFontColor == COL_AUTO) || IsForceAutoColor() )
aFontColor = GetAutoColor();
// #i69346# check for reverse color of input method attribute
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index c45c6faf2b6a..482cd6d71338 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -1455,6 +1455,23 @@ Reference< XSpellChecker1 > ImpEditEngine::GetSpeller()
return xSpeller;
}
+
+SpellInfo * ImpEditEngine::CreateSpellInfo( const EditSelection &rSel, bool bMultipleDocs )
+{
+ pSpellInfo = new SpellInfo;
+ pSpellInfo->bMultipleDoc = bMultipleDocs;
+ EditSelection aSentenceSel( SelectSentence( rSel ) );
+// pSpellInfo->aSpellStart = CreateEPaM( aSentenceSel.Min() );
+// pSpellInfo->aSpellTo = CreateEPaM( rSel.HasRange()? aSentenceSel.Max() : aSentenceSel.Min() );
+ // always spell draw objects completely, startting at the top.
+ // (spelling in only a selection or not starting with the top requires
+ // further changes elsewehe to work properly)
+ pSpellInfo->aSpellStart = EPaM();
+ pSpellInfo->aSpellTo = EPaM( EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND );
+ return pSpellInfo;
+}
+
+
EESpellState ImpEditEngine::Spell( EditView* pEditView, sal_Bool bMultipleDoc )
{
#ifdef SVX_LIGHT
@@ -1475,9 +1492,7 @@ EESpellState ImpEditEngine::Spell( EditView* pEditView, sal_Bool bMultipleDoc )
}
EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() );
- pSpellInfo = new SpellInfo;
- pSpellInfo->bMultipleDoc = bMultipleDoc;
- pSpellInfo->aSpellStart = CreateEPaM( SelectWord( aCurSel, ::com::sun::star::i18n::WordType::DICTIONARY_WORD ).Min() );
+ pSpellInfo = CreateSpellInfo( aCurSel, bMultipleDoc );
sal_Bool bIsStart = sal_False;
if ( bMultipleDoc )
@@ -1945,11 +1960,9 @@ void ImpEditEngine::EndSpelling()
void ImpEditEngine::StartSpelling(EditView& rEditView, sal_Bool bMultipleDoc)
{
DBG_ASSERT(!pSpellInfo, "pSpellInfo already set?");
- pSpellInfo = new SpellInfo;
- pSpellInfo->bMultipleDoc = bMultipleDoc;
rEditView.pImpEditView->SetEditSelection( aEditDoc.GetStartPaM() );
EditSelection aCurSel( rEditView.pImpEditView->GetEditSelection() );
- pSpellInfo->aSpellStart = CreateEPaM( SelectWord( aCurSel, ::com::sun::star::i18n::WordType::DICTIONARY_WORD ).Min() );
+ pSpellInfo = CreateSpellInfo( aCurSel, bMultipleDoc );
}
/*-- 13.10.2003 16:43:27---------------------------------------------------
Search for the next wrong word within the given selection
@@ -2002,33 +2015,31 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpFindNextError(EditSelection& r
/*-- 13.10.2003 16:43:27---------------------------------------------------
-----------------------------------------------------------------------*/
-bool ImpEditEngine::SpellSentence(EditView& rEditView, ::svx::SpellPortions& rToFill, bool /*bIsGrammarChecking*/ )
+bool ImpEditEngine::SpellSentence(EditView& rEditView,
+ ::svx::SpellPortions& rToFill,
+ bool /*bIsGrammarChecking*/ )
{
#ifdef SVX_LIGHT
#else
bool bRet = false;
+ EditSelection aCurSel( rEditView.pImpEditView->GetEditSelection() );
//the pSpellInfo has to be created on demand
if(!pSpellInfo)
- {
- pSpellInfo = new SpellInfo;
- pSpellInfo->bMultipleDoc = sal_True;
- rEditView.pImpEditView->SetEditSelection( aEditDoc.GetStartPaM() );
- EditSelection aCurSel( rEditView.pImpEditView->GetEditSelection() );
- pSpellInfo->aSpellStart = CreateEPaM( SelectWord( aCurSel, ::com::sun::star::i18n::WordType::DICTIONARY_WORD ).Min() );
- }
+ pSpellInfo = CreateSpellInfo( aCurSel, true );
+ pSpellInfo->aCurSentenceStart = aCurSel.Min();
DBG_ASSERT( xSpeller.is(), "Kein Speller gesetzt!" );
pSpellInfo->aLastSpellPortions.clear();
pSpellInfo->aLastSpellContentSelections.clear();
rToFill.clear();
- EditSelection aCurSel( rEditView.pImpEditView->GetEditSelection() );
//if no selection previously exists the range is extended to the end of the object
if(aCurSel.Min() == aCurSel.Max())
{
ContentNode* pLastNode = aEditDoc.SaveGetObject( aEditDoc.Count()-1);
aCurSel.Max() = EditPaM(pLastNode, pLastNode->Len());
}
+ // check for next error in aCurSel and set aCurSel to that one if any was found
Reference< XSpellAlternatives > xAlt = ImpFindNextError(aCurSel);
- if(xAlt.is())
+ if (xAlt.is())
{
bRet = true;
//find the sentence boundaries
@@ -2060,6 +2071,7 @@ bool ImpEditEngine::SpellSentence(EditView& rEditView, ::svx::SpellPortions& rTo
aCurSel = aNextSel;
}
while( xAlt.is() );
+
//set the selection to the end of the current sentence
rEditView.pImpEditView->SetEditSelection(aSentencePaM.Max());
}
@@ -2173,13 +2185,20 @@ void ImpEditEngine::AddPortionIterated(
/*-- 13.10.2003 16:43:33---------------------------------------------------
-----------------------------------------------------------------------*/
-void ImpEditEngine::ApplyChangedSentence(EditView& rEditView, const ::svx::SpellPortions& rNewPortions, bool /*bIsGrammarChecking*/ )
+void ImpEditEngine::ApplyChangedSentence(EditView& rEditView,
+ const ::svx::SpellPortions& rNewPortions,
+ bool bRecheck )
{
#ifdef SVX_LIGHT
#else
DBG_ASSERT(pSpellInfo, "pSpellInfo not initialized");
if(pSpellInfo)
{
+ // 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
+ EditSelection aOldSel( rEditView.pImpEditView->GetEditSelection() );
+ xub_StrLen nOldLen = aOldSel.Max().GetNode()->Len();
+
UndoActionStart( EDITUNDO_INSERT );
if(pSpellInfo->aLastSpellPortions.size() == rNewPortions.size())
{
@@ -2266,9 +2285,24 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView, const ::svx::Spell
}
}
UndoActionEnd( EDITUNDO_INSERT );
+
+ EditPaM aNext;
+ if (bRecheck)
+ aNext = pSpellInfo->aCurSentenceStart;
+ else
+ {
+ // restore cursor position to the end of the modified sentence.
+ // (This will define the continuation position for spell/grammar checking)
+ // First: check if the sentence/para length changed
+ sal_Int32 nDelta = rEditView.pImpEditView->GetEditSelection().Max().GetNode()->Len() - nOldLen;
+ xub_StrLen nEndOfSentence = aOldSel.Max().GetIndex() + nDelta;
+ aNext = EditPaM( aOldSel.Max().GetNode(), nEndOfSentence );
+ }
+ rEditView.pImpEditView->SetEditSelection( aNext );
+
+ FormatAndUpdate();
+ aEditDoc.SetModified(TRUE);
}
- FormatAndUpdate();
- aEditDoc.SetModified(TRUE);
#endif
}
/*-- 08.09.2008 11:33:02---------------------------------------------------
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 2631c71a6b17..64343517c69f 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -363,7 +363,7 @@ SvxAutoCorrect::SvxAutoCorrect( const String& rShareAutocorrFile,
sUserAutoCorrFile( rUserAutocorrFile ),
pLangTable( new SvxAutoCorrLanguageTable_Impl ),
pLastFileTable( new SvxAutoCorrLastFileAskTable_Impl ),
- pCharClass( 0 ),
+ pCharClass( 0 ), bRunNext( false ),
cStartDQuote( 0 ), cEndDQuote( 0 ), cStartSQuote( 0 ), cEndSQuote( 0 )
{
nFlags = SvxAutoCorrect::GetDefaultFlags();
@@ -380,7 +380,7 @@ SvxAutoCorrect::SvxAutoCorrect( const SvxAutoCorrect& rCpy )
pLangTable( new SvxAutoCorrLanguageTable_Impl ),
pLastFileTable( new SvxAutoCorrLastFileAskTable_Impl ),
- pCharClass( 0 ),
+ pCharClass( 0 ), bRunNext( false ),
nFlags( rCpy.nFlags & ~(ChgWordLstLoad|CplSttLstLoad|WrdSttLstLoad)),
cStartDQuote( rCpy.cStartDQuote ), cEndDQuote( rCpy.cEndDQuote ),
@@ -669,7 +669,7 @@ BOOL SvxAutoCorrect::FnAddNonBrkSpace(
// Check the presence of "://" in the word
xub_StrLen nStrPos = rTxt.Search( String::CreateFromAscii( "://" ), nSttWdPos + 1 );
- if ( STRING_NOTFOUND == nStrPos )
+ if ( STRING_NOTFOUND == nStrPos && nEndPos > 0 )
{
// Check the previous char
sal_Unicode cPrevChar = rTxt.GetChar( nEndPos - 1 );
@@ -693,9 +693,12 @@ BOOL SvxAutoCorrect::FnAddNonBrkSpace(
// Add the non-breaking space at the end pos
if ( bHasSpace )
rDoc.Insert( nPos, CHAR_HARDBLANK );
+ bRunNext = true;
bRet = true;
}
}
+ else if ( chars.indexOf( sal_Unicode( cPrevChar ) ) != -1 )
+ bRunNext = true;
}
}
else if ( cChar == '/' )
@@ -1189,6 +1192,9 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
BOOL bInsert )
{
ULONG nRet = 0;
+ bool bIsNextRun = bRunNext;
+ bRunNext = false; // if it was set, then it has to be turned off
+
do{ // only for middle check loop !!
if( cChar )
{
@@ -1227,10 +1233,39 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
rDoc.Replace( nInsPos, cChar );
// Hardspaces autocorrection
- if ( NeedsHardspaceAutocorr( cChar ) && IsAutoCorrFlag( AddNonBrkSpace ) &&
- FnAddNonBrkSpace( rDoc, rTxt, 0, nInsPos, rDoc.GetLanguage( nInsPos, FALSE ) ) )
+ if ( IsAutoCorrFlag( AddNonBrkSpace ) )
{
- nRet = AddNonBrkSpace;
+ if ( NeedsHardspaceAutocorr( cChar ) &&
+ FnAddNonBrkSpace( rDoc, rTxt, 0, nInsPos, rDoc.GetLanguage( nInsPos, FALSE ) ) )
+ {
+ nRet = AddNonBrkSpace;
+ }
+ else if ( bIsNextRun && !IsAutoCorrectChar( cChar ) )
+ {
+ // Remove the NBSP if it wasn't an autocorrection
+ if ( 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 )
+ {
+ sal_Unicode cTmpChar = rTxt.GetChar( nPos );
+ if ( cTmpChar == CHAR_HARDBLANK )
+ bFound = true;
+ else if ( !NeedsHardspaceAutocorr( cTmpChar ) )
+ nPos = STRING_NOTFOUND;
+ nPos--;
+ }
+
+ if ( bFound && nPos != STRING_NOTFOUND )
+ {
+ rDoc.Delete( nPos + 1, nPos + 2 );
+ nRet = AddNonBrkSpace;
+ }
+ }
+ }
}
}
diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx
index 1a49c087265a..81db53b3d474 100644
--- a/editeng/source/outliner/outlin2.cxx
+++ b/editeng/source/outliner/outlin2.cxx
@@ -807,7 +807,7 @@ void Outliner::PutSpellingToSentenceStart( EditView& rEditView )
/*-- 13.10.2003 16:56:25---------------------------------------------------
-----------------------------------------------------------------------*/
-void Outliner::ApplyChangedSentence(EditView& rEditView, const ::svx::SpellPortions& rNewPortions, bool bIsGrammarChecking )
+void Outliner::ApplyChangedSentence(EditView& rEditView, const ::svx::SpellPortions& rNewPortions, bool bRecheck )
{
- pEditEngine->ApplyChangedSentence( rEditView, rNewPortions, bIsGrammarChecking );
+ pEditEngine->ApplyChangedSentence( rEditView, rNewPortions, bRecheck );
}
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index fa539da6f138..e2a1fabea0ba 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -26,7 +26,11 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
+
#include "precompiled_editeng.hxx"
+
+#include <com/sun/star/i18n/WordType.hpp>
+
#include <svl/intitem.hxx>
#include <editeng/editeng.hxx>
#include <editeng/editview.hxx>
@@ -34,7 +38,9 @@
#include <editeng/eerdll.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/fhgtitem.hxx>
+
#include <svl/style.hxx>
+#include <i18npool/mslangid.hxx>
#define _OUTLINER_CXX
#include <editeng/outliner.hxx>
@@ -59,6 +65,8 @@
#define OL_SCROLL_HOROFFSET 20 /* in % von VisibleSize.Width */
#define OL_SCROLL_VEROFFSET 20 /* in % von VisibleSize.Height */
+using namespace ::com::sun::star;
+
DBG_NAME(OutlinerView)
@@ -972,7 +980,7 @@ void OutlinerView::InsertText( const OutlinerParaObject& rParaObj )
// Eigentlich nicht ganz richtig, das evtl. Einrueckungen
// korrigiert werden muessen, aber das kommt spaeter durch ein
// allgemeingueltiges Import.
- // Dann wird im Inserted gleich ermittelt, was fr eine Einrueckebene
+ // Dann wird im Inserted gleich ermittelt, was f�r eine Einrueckebene
// Moegliche Struktur:
// pImportInfo mit DestPara, DestPos, nFormat, pParaObj...
// Evtl. Problematisch:
@@ -1295,7 +1303,7 @@ void OutlinerView::RemoveAttribs( BOOL bRemoveParaAttribs, USHORT nWhich, BOOL b
- // =====================================================================
+// =====================================================================
// ====================== Einfache Durchreicher =======================
// ======================================================================
@@ -1670,3 +1678,57 @@ Selection OutlinerView::GetSurroundingTextSelection() const
DBG_CHKTHIS(OutlinerView,0);
return pEditView->GetSurroundingTextSelection();
}
+
+
+// ======================================================================
+// ===== some code for thesaurus sub menu within context menu
+// ======================================================================
+
+// returns: true if a word for thesaurus look-up was found at the current cursor position.
+// The status string will be word + iso language string (e.g. "light#en-US")
+bool EDITENG_DLLPUBLIC GetStatusValueForThesaurusFromContext(
+ String &rStatusVal,
+ LanguageType &rLang,
+ const EditView &rEditView )
+{
+ // get text and locale for thesaurus look up
+ String aText;
+ EditEngine *pEditEngine = rEditView.GetEditEngine();
+ ESelection aTextSel( rEditView.GetSelection() );
+ if (!aTextSel.HasRange())
+ aTextSel = pEditEngine->GetWord( aTextSel, i18n::WordType::DICTIONARY_WORD );
+ aText = pEditEngine->GetText( aTextSel );
+ aTextSel.Adjust();
+ LanguageType nLang = pEditEngine->GetLanguage( aTextSel.nStartPara, aTextSel.nStartPos );
+ String aLangText( MsLangId::convertLanguageToIsoString( nLang ) );
+
+ // set word and locale to look up as status value
+ String aStatusVal( aText );
+ aStatusVal.AppendAscii( "#" );
+ aStatusVal += aLangText;
+
+ rStatusVal = aStatusVal;
+ rLang = nLang;
+
+ return aText.Len() > 0;
+}
+
+
+void EDITENG_DLLPUBLIC ReplaceTextWithSynonym( EditView &rEditView, const String &rSynonmText )
+{
+ // get selection to use
+ ESelection aCurSel( rEditView.GetSelection() );
+ if (!rEditView.HasSelection())
+ {
+ // select the same word that was used in GetStatusValueForThesaurusFromContext by calling GetWord.
+ // (In the end both functions will call ImpEditEngine::SelectWord)
+ rEditView.SelectCurrentWord( i18n::WordType::DICTIONARY_WORD );
+ aCurSel = rEditView.GetSelection();
+ }
+
+ // replace word ...
+ rEditView.InsertText( rSynonmText );
+ rEditView.ShowCursor( sal_True, sal_False );
+}
+
+
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 45ef23c2be8f..ec7e76b144c0 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -260,12 +260,14 @@ SvxUnoTextRangeBase::SvxUnoTextRangeBase( const SvxEditSource* pSource, const Sv
DBG_ASSERT(pSource,"SvxUnoTextRangeBase: I need a valid SvxEditSource!");
mpEditSource = pSource->Clone();
- ESelection aSelection;
- ::GetSelection( aSelection, mpEditSource->GetTextForwarder() );
- SetSelection( aSelection );
+ if (mpEditSource != NULL)
+ {
+ ESelection aSelection;
+ ::GetSelection( aSelection, mpEditSource->GetTextForwarder() );
+ SetSelection( aSelection );
- if( mpEditSource )
mpEditSource->addRange( this );
+ }
#ifdef DEBUG
gNumRanges.add(this);
#endif
@@ -348,7 +350,8 @@ void SvxUnoTextRangeBase::SetSelection( const ESelection& rSelection ) throw()
OGuard aGuard( Application::GetSolarMutex() );
maSelection = rSelection;
- CheckSelection( maSelection, mpEditSource->GetTextForwarder() );
+ if (mpEditSource != NULL)
+ CheckSelection( maSelection, mpEditSource->GetTextForwarder() );
}
// Interface XTextRange ( XText )
diff --git a/embeddedobj/source/inc/oleembobj.hxx b/embeddedobj/source/inc/oleembobj.hxx
index 11ecce69834b..fa25274b3136 100644
--- a/embeddedobj/source/inc/oleembobj.hxx
+++ b/embeddedobj/source/inc/oleembobj.hxx
@@ -186,6 +186,8 @@ class OleEmbeddedObject : public ::cppu::WeakImplHelper5
::rtl::OUString m_aTempURL;
+ ::rtl::OUString m_aTempDumpURL;
+
// STAMPIT solution
// the following member is used during verb execution to detect whether the verb execution modifies the object
VerbExecutionController m_aVerbExecutionController;
diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx
index f57dcb8e7fd8..78ad2c2e5885 100644
--- a/embeddedobj/source/msole/oleembed.cxx
+++ b/embeddedobj/source/msole/oleembed.cxx
@@ -46,10 +46,16 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XLoadable.hpp>
#include <com/sun/star/document/XStorageBasedDocument.hpp>
+#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/system/XSystemShellExecute.hpp>
+#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <rtl/logfile.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <comphelper/mimeconfighelper.hxx>
+#include <comphelper/storagehelper.hxx>
#include <targetstatecontrol.hxx>
@@ -674,6 +680,85 @@ sal_Int32 SAL_CALL OleEmbeddedObject::getCurrentState()
return m_nObjectState;
}
+namespace
+{
+ bool lcl_CopyStream(uno::Reference<io::XInputStream> xIn, uno::Reference<io::XOutputStream> xOut)
+ {
+ const sal_Int32 nChunkSize = 4096;
+ uno::Sequence< sal_Int8 > aData(nChunkSize);
+ sal_Int32 nTotalRead = 0;
+ sal_Int32 nRead;
+ do
+ {
+ nRead = xIn->readBytes(aData, nChunkSize);
+ nTotalRead += nRead;
+ xOut->writeBytes(aData);
+ } while (nRead == nChunkSize);
+ return nTotalRead != 0;
+ }
+
+ //Dump the objects content to a tempfile, just the "CONTENTS" stream if
+ //there is one for non-compound documents, otherwise the whole content.
+ //
+ //On success a file is returned which must be removed by the caller
+ rtl::OUString lcl_ExtractObject(::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xObjectStream)
+ {
+ rtl::OUString sUrl;
+
+ // the solution is only active for Unix systems
+#ifndef WNT
+ uno::Reference <beans::XPropertySet> xNativeTempFile(
+ xFactory->createInstance(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile"))), uno::UNO_QUERY_THROW);
+ uno::Reference < io::XStream > xStream(xNativeTempFile, uno::UNO_QUERY_THROW);
+
+ uno::Sequence< uno::Any > aArgs( 2 );
+ aArgs[0] <<= xObjectStream;
+ aArgs[1] <<= (sal_Bool)sal_True; // do not create copy
+ uno::Reference< container::XNameContainer > xNameContainer(
+ xFactory->createInstanceWithArguments(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.OLESimpleStorage")),
+ aArgs ), uno::UNO_QUERY_THROW );
+
+ uno::Reference< io::XStream > xCONTENTS;
+ xNameContainer->getByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CONTENTS"))) >>= xCONTENTS;
+
+ sal_Bool bCopied = xCONTENTS.is() && lcl_CopyStream(xCONTENTS->getInputStream(), xStream->getOutputStream());
+
+ uno::Reference< io::XSeekable > xSeekableStor(xObjectStream, uno::UNO_QUERY);
+ if (xSeekableStor.is())
+ xSeekableStor->seek(0);
+
+ if (!bCopied)
+ bCopied = lcl_CopyStream(xObjectStream->getInputStream(), xStream->getOutputStream());
+
+ if (bCopied)
+ {
+ xNativeTempFile->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RemoveFile")),
+ uno::makeAny(sal_False));
+ uno::Any aUrl = xNativeTempFile->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Uri")));
+ aUrl >>= sUrl;
+
+ xNativeTempFile = uno::Reference<beans::XPropertySet>();
+
+ uno::Reference<ucb::XSimpleFileAccess> xSimpleFileAccess(
+ xFactory->createInstance(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess"))),
+ uno::UNO_QUERY_THROW);
+
+ xSimpleFileAccess->setReadOnly(sUrl, sal_True);
+ }
+ else
+ {
+ xNativeTempFile->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RemoveFile")),
+ uno::makeAny(sal_True));
+ }
+#endif
+ return sUrl;
+ }
+}
+
//----------------------------------------------
void SAL_CALL OleEmbeddedObject::doVerb( sal_Int32 nVerbID )
throw ( lang::IllegalArgumentException,
@@ -789,10 +874,28 @@ void SAL_CALL OleEmbeddedObject::doVerb( sal_Int32 nVerbID )
}
if ( !m_pOwnView || !m_pOwnView->Open() )
- throw embed::UnreachableStateException();
+ {
+ //Make a RO copy and see if the OS can find something to at
+ //least display the content for us
+ if (!m_aTempDumpURL.getLength())
+ m_aTempDumpURL = lcl_ExtractObject(m_xFactory, m_xObjectStream);
+
+ if (m_aTempDumpURL.getLength())
+ {
+ uno::Reference< ::com::sun::star::system::XSystemShellExecute > xSystemShellExecute( m_xFactory->createInstance(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.system.SystemShellExecute"))),
+ uno::UNO_QUERY_THROW);
+ xSystemShellExecute->execute(m_aTempDumpURL, ::rtl::OUString(), ::com::sun::star::system::SystemShellExecuteFlags::DEFAULTS);
+ }
+ else
+ throw embed::UnreachableStateException();
+ }
}
else
+ {
+
throw embed::UnreachableStateException();
+ }
}
}
diff --git a/embeddedobj/source/msole/olemisc.cxx b/embeddedobj/source/msole/olemisc.cxx
index 698ae719fbf0..adf07e1f522e 100644
--- a/embeddedobj/source/msole/olemisc.cxx
+++ b/embeddedobj/source/msole/olemisc.cxx
@@ -158,6 +158,9 @@ OleEmbeddedObject::~OleEmbeddedObject()
if ( m_aTempURL.getLength() )
KillFile_Impl( m_aTempURL, m_xFactory );
+
+ if ( m_aTempDumpURL.getLength() )
+ KillFile_Impl( m_aTempDumpURL, m_xFactory );
}
//------------------------------------------------------
diff --git a/eventattacher/source/exports.map b/eventattacher/source/exports.map
deleted file mode 100644
index ba501f9ae076..000000000000
--- a/eventattacher/source/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/eventattacher/source/makefile.mk b/eventattacher/source/makefile.mk
index ddab6f7ea30f..632a1fa41ad5 100644
--- a/eventattacher/source/makefile.mk
+++ b/eventattacher/source/makefile.mk
@@ -44,7 +44,7 @@ SLOFILES= \
SHL1TARGET= $(TARGET)
SHL1IMPLIB= i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/fileaccess/source/exports.map b/fileaccess/source/exports.map
deleted file mode 100644
index 2dd01358d43f..000000000000
--- a/fileaccess/source/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-OOO_1.1 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/fileaccess/source/makefile.mk b/fileaccess/source/makefile.mk
index 7bd6266f7df0..2b7826534618 100644
--- a/fileaccess/source/makefile.mk
+++ b/fileaccess/source/makefile.mk
@@ -46,7 +46,7 @@ SLOFILES= \
SHL1TARGET= $(TARGET)
SHL1IMPLIB= i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/formula/inc/formula/compiler.hrc b/formula/inc/formula/compiler.hrc
index e8243482a776..e4dc05aca4e9 100644
--- a/formula/inc/formula/compiler.hrc
+++ b/formula/inc/formula/compiler.hrc
@@ -393,12 +393,8 @@
#define SC_OPCODE_LAST_OPCODE_ID 394 /* last OpCode */
/*** Interna ***/
-#define SC_OPCODE_INTERNAL_BEGIN 9995
-#define SC_OPCODE_GAME 9995
-#define SC_OPCODE_SPEW 9996
-#define SC_OPCODE_TTT 9997
-#define SC_OPCODE_TEAM 9998
-#define SC_OPCODE_ANSWER 9999
+#define SC_OPCODE_INTERNAL_BEGIN 9999
+#define SC_OPCODE_TTT 9999
#define SC_OPCODE_INTERNAL_END 9999
/*** from here on ExtraData contained ***/
diff --git a/formula/inc/formula/errorcodes.hxx b/formula/inc/formula/errorcodes.hxx
index 2d8d9d18b71b..f9b04e012fab 100644
--- a/formula/inc/formula/errorcodes.hxx
+++ b/formula/inc/formula/errorcodes.hxx
@@ -83,9 +83,13 @@ const USHORT NOTAVAILABLE = 0x7fff;
represent an interpreter error code. */
inline double CreateDoubleError( USHORT nErr )
{
- double fVal;
+ union
+ {
+ double fVal;
+ sal_math_Double smVal;
+ };
::rtl::math::setNan( &fVal );
- reinterpret_cast< sal_math_Double * >(&fVal)->nan_parts.fraction_lo = nErr;
+ smVal.nan_parts.fraction_lo = nErr;
return fVal;
}
diff --git a/formula/inc/formula/opcode.hxx b/formula/inc/formula/opcode.hxx
index 2ec322d29bf7..390ab21048d3 100644
--- a/formula/inc/formula/opcode.hxx
+++ b/formula/inc/formula/opcode.hxx
@@ -386,11 +386,7 @@ enum OpCodeEnum
ocNumberValue = SC_OPCODE_NUMBERVALUE,
// internal stuff
ocInternalBegin = SC_OPCODE_INTERNAL_BEGIN,
- ocGame = SC_OPCODE_GAME,
- ocSpew = SC_OPCODE_SPEW,
ocTTT = SC_OPCODE_TTT,
- ocTeam = SC_OPCODE_TEAM,
- ocAnswer = SC_OPCODE_ANSWER,
ocInternalEnd = SC_OPCODE_INTERNAL_END,
// from here on ExtraData
ocDataToken1 = SC_OPCODE_DATA_TOKEN_1,
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 4cc5306fec9f..2010679907d2 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -46,7 +46,7 @@ namespace formula
// =============================================================================
using namespace ::com::sun::star;
- static const sal_Char* pInternal[ 5 ] = { "GAME", "SPEW", "TTT", "STARCALCTEAM", "ANTWORT" };
+ static const sal_Char* pInternal[ 1 ] = { "TTT" };
// =============================================================================
namespace
@@ -493,7 +493,7 @@ void FormulaCompiler::OpCodeMap::putOpCode( const String & rStr, const OpCode eO
DBG_ASSERT( 0 < eOp && USHORT(eOp) < mnSymbols, "OpCodeMap::putOpCode: OpCode out of range");
if (0 < eOp && USHORT(eOp) < mnSymbols)
{
- DBG_ASSERT( (mpTable[eOp].Len() == 0) || (mpTable[eOp] == rStr),
+ DBG_ASSERT( (mpTable[eOp].Len() == 0) || (mpTable[eOp] == rStr) || (eOp == ocCurrency),
ByteString( "OpCodeMap::putOpCode: reusing OpCode ").
Append( ByteString::CreateFromInt32( sal_Int32( eOp))).Append( " (").
Append( ByteString( rStr, RTL_TEXTENCODING_ASCII_US)).Append( ')').GetBuffer());
diff --git a/formula/util/for.map b/formula/util/for.map
deleted file mode 100644
index b34eff63c44f..000000000000
--- a/formula/util/for.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_0_0 {
- global:
- component_getFactory;
- component_getImplementationEnvironment;
- component_writeInfo;
- local:
- *;
-};
diff --git a/formula/util/forui.map b/formula/util/forui.map
deleted file mode 100644
index b34eff63c44f..000000000000
--- a/formula/util/forui.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_0_0 {
- global:
- component_getFactory;
- component_getImplementationEnvironment;
- component_writeInfo;
- local:
- *;
-};
diff --git a/formula/util/makefile.mk b/formula/util/makefile.mk
index 3e8f2301b283..7ae30b007d00 100644
--- a/formula/util/makefile.mk
+++ b/formula/util/makefile.mk
@@ -120,7 +120,6 @@ DEFLIB2NAME=$(TARGET2)
.ENDIF
SHL2USE_EXPORTS=name
-# SHL2VERSIONMAP=$(TARGET2).map
# --- .res file ----------------------------------------------------------
diff --git a/fpicker/source/aqua/FilterHelper.cxx b/fpicker/source/aqua/FilterHelper.cxx
index 10e429f201c5..9c644326005e 100644
--- a/fpicker/source/aqua/FilterHelper.cxx
+++ b/fpicker/source/aqua/FilterHelper.cxx
@@ -35,6 +35,7 @@
// #endif
#include "CFStringUtilities.hxx"
#include "NSString_OOoAdditions.hxx"
+#include "NSURL_OOoAdditions.hxx"
#include "FilterHelper.hxx"
@@ -428,6 +429,16 @@ sal_Bool FilterHelper::filenameMatchesFilter(NSString* sFilename)
}
}
+ // might be an alias
+ NSString* pResolved = resolveAlias( sFilename );
+ if( pResolved )
+ {
+ sal_Bool bResult = filenameMatchesFilter( pResolved );
+ [pResolved autorelease];
+ if( bResult )
+ return sal_True;
+ }
+
DBG_PRINT_EXIT(CLASS_NAME, __func__);
return sal_False;
diff --git a/fpicker/source/aqua/NSURL_OOoAdditions.hxx b/fpicker/source/aqua/NSURL_OOoAdditions.hxx
index 8be2c0362096..31b55385e155 100644
--- a/fpicker/source/aqua/NSURL_OOoAdditions.hxx
+++ b/fpicker/source/aqua/NSURL_OOoAdditions.hxx
@@ -29,15 +29,20 @@
#define _NSURL_OOOADDITIONS_HXX_
#include <premac.h>
-#include <Foundation/Foundation.h>
+#include <CoreFoundation/CoreFoundation.h>
#include <postmac.h>
#include "CFStringUtilities.hxx"
#include <rtl/ustring.hxx>
-// #include <sal/types.h>
-
@interface NSURL (OOoAdditions)
- (rtl::OUString) OUStringForInfo:(InfoType)info;
@end
-#endif \ No newline at end of file
+/*
+ returns the resolved string if there was an alias
+ if there was no alias, nil is returned
+*/
+
+NSString* resolveAlias( NSString* i_pSystemPath );
+
+#endif
diff --git a/fpicker/source/aqua/NSURL_OOoAdditions.mm b/fpicker/source/aqua/NSURL_OOoAdditions.mm
index 56fc198650c8..ecc38b7e232b 100644
--- a/fpicker/source/aqua/NSURL_OOoAdditions.mm
+++ b/fpicker/source/aqua/NSURL_OOoAdditions.mm
@@ -80,3 +80,33 @@
return sResult;
}
@end
+
+NSString* resolveAlias( NSString* i_pSystemPath )
+{
+ NSString* pResolvedPath = nil;
+ CFURLRef rUrl = CFURLCreateWithFileSystemPath( kCFAllocatorDefault,
+ (CFStringRef)i_pSystemPath,
+ kCFURLPOSIXPathStyle, false);
+ if( rUrl != NULL )
+ {
+ FSRef rFS;
+ if( CFURLGetFSRef( rUrl, &rFS ) )
+ {
+ MacOSBoolean bIsFolder = false;
+ MacOSBoolean bAlias = false;
+ OSErr err = FSResolveAliasFile( &rFS, true, &bIsFolder, &bAlias);
+ if( (err == noErr) && bAlias )
+ {
+ CFURLRef rResolvedUrl = CFURLCreateFromFSRef( kCFAllocatorDefault, &rFS );
+ if( rResolvedUrl != NULL )
+ {
+ pResolvedPath = (NSString*)CFURLCopyFileSystemPath( rResolvedUrl, kCFURLPOSIXPathStyle );
+ CFRelease( rResolvedUrl );
+ }
+ }
+ }
+ CFRelease( rUrl );
+ }
+
+ return pResolvedPath;
+}
diff --git a/fpicker/source/aqua/exports.map b/fpicker/source/aqua/exports.map
deleted file mode 100644
index f4ed78b9e970..000000000000
--- a/fpicker/source/aqua/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_0_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/fpicker/source/aqua/makefile.mk b/fpicker/source/aqua/makefile.mk
index f79d2a018952..10990e22d5e1 100644
--- a/fpicker/source/aqua/makefile.mk
+++ b/fpicker/source/aqua/makefile.mk
@@ -74,7 +74,7 @@ SHL1STDLIBS=\
$(CPPULIB) \
$(SALLIB)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/fpicker/source/aqua/resourceprovider.cxx b/fpicker/source/aqua/resourceprovider.cxx
index 5d958d8e2888..51985208c7ed 100644
--- a/fpicker/source/aqua/resourceprovider.cxx
+++ b/fpicker/source/aqua/resourceprovider.cxx
@@ -38,7 +38,7 @@
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
#ifndef _SVTOOLS_SVTOOLS_HRC_
-#include <svl/svtools.hrc>
+#include <svtools/svtools.hrc>
#endif
#ifndef _SVTOOLS_FILEDLG2_HRC_
diff --git a/fpicker/source/generic/exports.map b/fpicker/source/generic/exports.map
deleted file mode 100644
index f4ed78b9e970..000000000000
--- a/fpicker/source/generic/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_0_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/fpicker/source/generic/makefile.mk b/fpicker/source/generic/makefile.mk
index f5d624f8e4d6..bfbfb65f3da6 100644
--- a/fpicker/source/generic/makefile.mk
+++ b/fpicker/source/generic/makefile.mk
@@ -53,7 +53,7 @@ SHL1STDLIBS=\
$(CPPULIB) \
$(SALLIB)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
diff --git a/fpicker/source/office/OfficeFilePicker.src b/fpicker/source/office/OfficeFilePicker.src
index 77de1dc3918b..8fbbc35a40e5 100644
--- a/fpicker/source/office/OfficeFilePicker.src
+++ b/fpicker/source/office/OfficeFilePicker.src
@@ -25,7 +25,7 @@
*
************************************************************************/
-#include "svl/svtools.hrc"
+#include "svtools/svtools.hrc"
String STR_SVT_FILEPICKER_AUTO_EXTENSION
{
diff --git a/fpicker/source/office/exports.map b/fpicker/source/office/exports.map
deleted file mode 100644
index f4ed78b9e970..000000000000
--- a/fpicker/source/office/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_0_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index c7a18050c3ff..b9d7fac3aa3b 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -57,7 +57,7 @@
#include <unotools/localfilehelper.hxx>
#ifndef _SVTOOLS_HRC
-#include "svl/svtools.hrc"
+#include "svtools/svtools.hrc"
#endif
#ifndef _SVT_HELPID_HRC
#include "svtools/helpid.hrc"
@@ -1587,6 +1587,9 @@ void SvtFileDialog::UpdateControls( const String& rURL )
sText = sURL;
}
+ if ( !sText.Len() && rURL.Len() )
+ // happens, for instance, for URLs which the INetURLObject does not know to belong to a hierarchical scheme
+ sText = rURL;
_pImp->_pFtCurrentPath->SetText( sText );
}
diff --git a/fpicker/source/office/iodlg.hrc b/fpicker/source/office/iodlg.hrc
index 9f5997a4089c..15f5121b0965 100644
--- a/fpicker/source/office/iodlg.hrc
+++ b/fpicker/source/office/iodlg.hrc
@@ -29,7 +29,7 @@
#define _SVTOOLS_IODLGIMPL_HRC
#ifndef _SVTOOLS_HRC
-#include "svl/svtools.hrc"
+#include "svtools/svtools.hrc"
#endif
// ModalDialog DLG_SVT_EXPLORERFILE
diff --git a/fpicker/source/office/iodlg.src b/fpicker/source/office/iodlg.src
index b1712e6b1820..0b3c27b68071 100644
--- a/fpicker/source/office/iodlg.src
+++ b/fpicker/source/office/iodlg.src
@@ -26,7 +26,7 @@
************************************************************************/
// includes ******************************************************************
-#include "svl/svtools.hrc"
+#include "svtools/svtools.hrc"
#include "svtools/helpid.hrc"
#include "iodlg.hrc"
diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx
index 4a7c615a35b3..5e57075a6bb7 100644
--- a/fpicker/source/office/iodlgimp.cxx
+++ b/fpicker/source/office/iodlgimp.cxx
@@ -46,15 +46,12 @@
#include "svtools/fileview.hxx"
#include "svtools/inettbc.hxx"
#include "iodlg.hxx"
-#ifndef _SVTOOLS_IODLGIMPL_HRC
#include "iodlg.hrc"
-#endif
#include "svtools/imagemgr.hxx"
#include <unotools/localfilehelper.hxx>
#include "unotools/useroptions.hxx"
-#ifndef _RTL_INSTANCE_HXX_
#include "rtl/instance.hxx"
-#endif
+#include <svl/svl.hrc>
#define _SVSTDARR_STRINGSSORTDTOR
#define _SVSTDARR_STRINGSDTOR
diff --git a/fpicker/source/office/makefile.mk b/fpicker/source/office/makefile.mk
index c687d8cb333e..adc3c30f9a3d 100644
--- a/fpicker/source/office/makefile.mk
+++ b/fpicker/source/office/makefile.mk
@@ -69,7 +69,7 @@ SHL1STDLIBS=\
$(CPPULIB) \
$(SALLIB)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
diff --git a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
index 4fe6f6f11b20..c6b0acd6a33f 100644
--- a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
+++ b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
@@ -96,6 +96,8 @@ namespace
static void expandexpanders(GtkContainer *pWidget)
{
+ GdkThreadLock aLock;
+
GList *pChildren = gtk_container_get_children(pWidget);
for( GList *p = pChildren; p; p = p->next )
{
@@ -114,6 +116,8 @@ void SalGtkFilePicker::dialog_mapped_cb(GtkWidget *, SalGtkFilePicker *pobjFP)
void SalGtkFilePicker::InitialMapping()
{
+ GdkThreadLock aLock;
+
if (!mbPreviewState )
{
gtk_widget_hide( m_pPreview );
@@ -208,6 +212,8 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference<lang::XMultiServiceFact
CResourceProvider aResProvider;
OUString aFilePickerTitle = aResProvider.getResString( FILE_PICKER_TITLE_OPEN );
+ GdkThreadLock aLock;
+
m_pDialog = gtk_file_chooser_dialog_new(
OUStringToOString( aFilePickerTitle, RTL_TEXTENCODING_UTF8 ).getStr(),
NULL,
@@ -385,14 +391,12 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference<lang::XMultiServiceFact
void SAL_CALL SalGtkFilePicker::addFilePickerListener( const uno::Reference<XFilePickerListener>& xListener )
throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
m_xListener = xListener;
}
void SAL_CALL SalGtkFilePicker::removeFilePickerListener( const uno::Reference<XFilePickerListener>& )
throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
m_xListener.clear();
}
@@ -591,6 +595,8 @@ shrinkFilterName( const rtl::OUString &rFilterName, bool bAllowNoStar = false )
static void
dialog_remove_buttons( GtkDialog *pDialog )
{
+ GdkThreadLock aLock;
+
g_return_if_fail( GTK_IS_DIALOG( pDialog ) );
GList *pChildren =
@@ -700,7 +706,6 @@ void SAL_CALL SalGtkFilePicker::appendFilter( const rtl::OUString& aTitle, const
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
if( FilterNameExists( aTitle ) )
throw IllegalArgumentException();
@@ -721,7 +726,6 @@ void SAL_CALL SalGtkFilePicker::setCurrentFilter( const rtl::OUString& aTitle )
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
OSL_TRACE( "Setting current filter to %s\n",
OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ).getStr() );
@@ -763,6 +767,9 @@ void SalGtkFilePicker::UpdateFilterfromUI()
// from the filter of the files glob on which he is currently searching
if (!mnHID_FolderChange || !mnHID_SelectionChange)
return;
+
+ GdkThreadLock aLock;
+
GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(m_pFilterView));
GtkTreeIter iter;
GtkTreeModel *model;
@@ -782,7 +789,6 @@ void SalGtkFilePicker::UpdateFilterfromUI()
rtl::OUString SAL_CALL SalGtkFilePicker::getCurrentFilter() throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
OSL_TRACE( "GetCURRENTfilter\n" );
@@ -802,7 +808,6 @@ void SAL_CALL SalGtkFilePicker::appendFilterGroup( const rtl::OUString& /*sGroup
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
// TODO m_pImpl->appendFilterGroup( sGroupTitle, aFilters );
// check the names
@@ -832,7 +837,8 @@ void SAL_CALL SalGtkFilePicker::appendFilterGroup( const rtl::OUString& /*sGroup
void SAL_CALL SalGtkFilePicker::setMultiSelectionMode( sal_Bool bMode ) throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+
+ GdkThreadLock aLock;
gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER(m_pDialog), bMode );
}
@@ -841,7 +847,8 @@ void SAL_CALL SalGtkFilePicker::setDefaultName( const rtl::OUString& aName )
throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+
+ GdkThreadLock aLock;
OString aStr = OUStringToOString( aName, RTL_TEXTENCODING_UTF8 );
GtkFileChooserAction eAction = gtk_file_chooser_get_action( GTK_FILE_CHOOSER( m_pDialog ) );
@@ -877,7 +884,8 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getFiles() throw( uno::R
uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+
+ GdkThreadLock aLock;
GSList* pPathList = gtk_file_chooser_get_uris( GTK_FILE_CHOOSER(m_pDialog) );
@@ -1014,7 +1022,8 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute() throw( uno::RuntimeException )
{
OSL_TRACE( "1: HERE WE ARE\n");
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+
+ GdkThreadLock aLock;
sal_Int16 retVal = 0;
@@ -1171,6 +1180,8 @@ namespace
{
void HackWidthToFirst(GtkComboBox *pWidget)
{
+ GdkThreadLock aLock;
+
GtkRequisition requisition;
gtk_widget_size_request(GTK_WIDGET(pWidget), &requisition);
gtk_widget_set_size_request(GTK_WIDGET(pWidget), requisition.width, -1);
@@ -1179,6 +1190,8 @@ namespace
void SalGtkFilePicker::HandleSetListValue(GtkComboBox *pWidget, sal_Int16 nControlAction, const uno::Any& rValue)
{
+ GdkThreadLock aLock;
+
switch (nControlAction)
{
case ControlActions::ADD_ITEM:
@@ -1253,6 +1266,8 @@ void SalGtkFilePicker::HandleSetListValue(GtkComboBox *pWidget, sal_Int16 nContr
uno::Any SalGtkFilePicker::HandleGetListValue(GtkComboBox *pWidget, sal_Int16 nControlAction) const
{
+ GdkThreadLock aLock;
+
uno::Any aAny;
switch (nControlAction)
{
@@ -1312,15 +1327,15 @@ void SAL_CALL SalGtkFilePicker::setValue( sal_Int16 nControlId, sal_Int16 nContr
throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
OSL_TRACE( "SETTING VALUE %d\n", nControlAction );
GType tType;
GtkWidget *pWidget;
+ GdkThreadLock aLock;
+
if( !( pWidget = getWidget( nControlId, &tType ) ) )
OSL_TRACE("enable unknown control %d\n", nControlId);
-
else if( tType == GTK_TYPE_TOGGLE_BUTTON )
{
sal_Bool bChecked = false;
@@ -1340,15 +1355,16 @@ uno::Any SAL_CALL SalGtkFilePicker::getValue( sal_Int16 nControlId, sal_Int16 nC
throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+
uno::Any aRetval;
GType tType;
GtkWidget *pWidget;
+ GdkThreadLock aLock;
+
if( !( pWidget = getWidget( nControlId, &tType ) ) )
OSL_TRACE("enable unknown control %d\n", nControlId);
-
else if( tType == GTK_TYPE_TOGGLE_BUTTON )
aRetval <<= (sal_Bool) gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( pWidget ) );
else if( tType == GTK_TYPE_COMBO_BOX )
@@ -1364,13 +1380,13 @@ void SAL_CALL SalGtkFilePicker::enableControl( sal_Int16 nControlId, sal_Bool bE
throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
GtkWidget *pWidget;
+ GdkThreadLock aLock;
+
if ( nControlId == ExtendedFilePickerElementIds::LISTBOX_FILTER_SELECTOR )
gtk_expander_set_expanded( GTK_EXPANDER( m_pFilterExpander ), bEnable );
-
else if( ( pWidget = getWidget( nControlId ) ) )
{
if( bEnable )
@@ -1392,11 +1408,12 @@ void SAL_CALL SalGtkFilePicker::setLabel( sal_Int16 nControlId, const ::rtl::OUS
throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
GType tType;
GtkWidget *pWidget;
+ GdkThreadLock aLock;
+
if( !( pWidget = getWidget( nControlId, &tType ) ) )
{
OSL_TRACE("Set label on unknown control %d\n", nControlId);
@@ -1428,18 +1445,17 @@ rtl::OUString SAL_CALL SalGtkFilePicker::getLabel( sal_Int16 nControlId )
throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
GType tType;
OString aTxt;
GtkWidget *pWidget;
+ GdkThreadLock aLock;
+
if( !( pWidget = getWidget( nControlId, &tType ) ) )
OSL_TRACE("Get label on unknown control %d\n", nControlId);
-
else if( tType == GTK_TYPE_TOGGLE_BUTTON || tType == GTK_TYPE_BUTTON || tType == GTK_TYPE_LABEL )
aTxt = gtk_button_get_label( GTK_BUTTON( pWidget ) );
-
else
OSL_TRACE("Can't get label on list\n");
@@ -1453,7 +1469,6 @@ rtl::OUString SAL_CALL SalGtkFilePicker::getLabel( sal_Int16 nControlId )
uno::Sequence<sal_Int16> SAL_CALL SalGtkFilePicker::getSupportedImageFormats() throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
// TODO return m_pImpl->getSupportedImageFormats();
return 0;
@@ -1462,7 +1477,6 @@ uno::Sequence<sal_Int16> SAL_CALL SalGtkFilePicker::getSupportedImageFormats() t
sal_Int32 SAL_CALL SalGtkFilePicker::getTargetColorDepth() throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
// TODO return m_pImpl->getTargetColorDepth();
return 0;
@@ -1471,18 +1485,14 @@ sal_Int32 SAL_CALL SalGtkFilePicker::getTargetColorDepth() throw( uno::RuntimeEx
sal_Int32 SAL_CALL SalGtkFilePicker::getAvailableWidth() throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- // TODO return m_pImpl->getAvailableWidth();
return m_PreviewImageWidth;
}
sal_Int32 SAL_CALL SalGtkFilePicker::getAvailableHeight() throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- // TODO return m_pImpl->getAvailableHeight();
return m_PreviewImageHeight;
}
@@ -1490,7 +1500,6 @@ void SAL_CALL SalGtkFilePicker::setImage( sal_Int16 /*aImageFormat*/, const uno:
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
// TODO m_pImpl->setImage( aImageFormat, aImage );
}
@@ -1499,6 +1508,9 @@ void SalGtkFilePicker::implChangeType( GtkTreeSelection *selection )
{
CResourceProvider aResProvider;
OUString aLabel = aResProvider.getResString( FILE_PICKER_FILE_TYPE );
+
+ GdkThreadLock aLock;
+
GtkTreeIter iter;
GtkTreeModel *model;
if (gtk_tree_selection_get_selected (selection, &model, &iter))
@@ -1523,6 +1535,8 @@ void SalGtkFilePicker::type_changed_cb( GtkTreeSelection *selection, SalGtkFileP
void SalGtkFilePicker::unselect_type()
{
+ GdkThreadLock aLock;
+
gtk_tree_selection_unselect_all(gtk_tree_view_get_selection(GTK_TREE_VIEW(m_pFilterView)));
}
@@ -1589,11 +1603,12 @@ void SalGtkFilePicker::update_preview_cb( GtkFileChooser *file_chooser, SalGtkFi
sal_Bool SAL_CALL SalGtkFilePicker::setShowState( sal_Bool bShowState ) throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
// TODO return m_pImpl->setShowState( bShowState );
if( bShowState != mbPreviewState )
{
+ GdkThreadLock aLock;
+
if( bShowState )
{
// Show
@@ -1622,9 +1637,7 @@ sal_Bool SAL_CALL SalGtkFilePicker::setShowState( sal_Bool bShowState ) throw( u
sal_Bool SAL_CALL SalGtkFilePicker::getShowState() throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- // TODO return m_pImpl->getShowState();
return mbPreviewState;
}
@@ -1740,6 +1753,8 @@ void SAL_CALL SalGtkFilePicker::initialize( const uno::Sequence<uno::Any>& aArgu
1 );
}
+ GdkThreadLock aLock;
+
if( GTK_FILE_CHOOSER_ACTION_SAVE == eAction )
{
CResourceProvider aResProvider;
@@ -1801,7 +1816,6 @@ void SalGtkFilePicker::preview_toggled_cb( GtkObject *cb, SalGtkFilePicker* pobj
void SAL_CALL SalGtkFilePicker::cancel() throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
// TODO m_pImpl->cancel();
}
@@ -1848,6 +1862,8 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getSupportedServiceNames
//-------------------------------------------------
void SalGtkFilePicker::SetCurFilter( const OUString& rFilter )
{
+ GdkThreadLock aLock;
+
// Get all the filters already added
GSList *filters = gtk_file_chooser_list_filters ( GTK_FILE_CHOOSER( m_pDialog ) );
bool bFound = false;
@@ -1903,6 +1919,8 @@ case_insensitive_filter (const GtkFileFilterInfo *filter_info, gpointer data)
int SalGtkFilePicker::implAddFilter( const OUString& rFilter, const OUString& rType )
{
+ GdkThreadLock aLock;
+
GtkFileFilter *filter = gtk_file_filter_new();
OUString aShrunkName = shrinkFilterName( rFilter );
@@ -1981,6 +1999,9 @@ int SalGtkFilePicker::implAddFilterGroup( const OUString& /*_rFilter*/, const Se
void SalGtkFilePicker::SetFilters()
{
OSL_TRACE( "start setting filters\n");
+
+ GdkThreadLock aLock;
+
int nAdded = 0;
if( m_pFilterList && !m_pFilterList->empty() )
{
diff --git a/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx b/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx
index 6b843d8b79f4..f9c78d76639c 100644
--- a/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx
+++ b/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx
@@ -87,6 +87,9 @@ SalGtkFolderPicker::SalGtkFolderPicker( const uno::Reference<lang::XMultiService
m_xServiceMgr( xServiceMgr )
{
CResourceProvider aResProvider;
+
+ GdkThreadLock aLock;
+
m_pDialog = gtk_file_chooser_dialog_new(
OUStringToOString( aResProvider.getResString( FOLDERPICKER_TITLE ), RTL_TEXTENCODING_UTF8 ).getStr(),
NULL, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
@@ -110,7 +113,6 @@ void SAL_CALL SalGtkFolderPicker::setDisplayDirectory( const rtl::OUString& aDir
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
OString aTxt = unicodetouri( aDirectory );
@@ -119,14 +121,17 @@ void SAL_CALL SalGtkFolderPicker::setDisplayDirectory( const rtl::OUString& aDir
OSL_TRACE( "setting path to %s\n", aTxt.getStr() );
+ GdkThreadLock aLock;
+
gtk_file_chooser_set_current_folder_uri( GTK_FILE_CHOOSER( m_pDialog ),
- aTxt.getStr() );
+ aTxt.getStr() );
}
rtl::OUString SAL_CALL SalGtkFolderPicker::getDisplayDirectory() throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+
+ GdkThreadLock aLock;
gchar* pCurrentFolder =
gtk_file_chooser_get_current_folder_uri( GTK_FILE_CHOOSER( m_pDialog ) );
@@ -156,9 +161,10 @@ void SAL_CALL SalGtkFolderPicker::setDescription( const rtl::OUString& rDescript
void SAL_CALL SalGtkFolderPicker::setTitle( const rtl::OUString& aTitle ) throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
::rtl::OString aWindowTitle = OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 );
+
+ GdkThreadLock aLock;
gtk_window_set_title( GTK_WINDOW( m_pDialog ), aWindowTitle.getStr() );
}
@@ -166,7 +172,6 @@ sal_Int16 SAL_CALL SalGtkFolderPicker::execute() throw( uno::RuntimeException )
{
OSL_TRACE( "1: HERE WE ARE\n");
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
sal_Int16 retVal = 0;
@@ -199,7 +204,6 @@ sal_Int16 SAL_CALL SalGtkFolderPicker::execute() throw( uno::RuntimeException )
void SAL_CALL SalGtkFolderPicker::cancel() throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
// TODO m_pImpl->cancel();
}
diff --git a/fpicker/source/unx/gnome/SalGtkPicker.cxx b/fpicker/source/unx/gnome/SalGtkPicker.cxx
index 2d2e086ba2ca..1a685e0981e6 100644
--- a/fpicker/source/unx/gnome/SalGtkPicker.cxx
+++ b/fpicker/source/unx/gnome/SalGtkPicker.cxx
@@ -148,6 +148,8 @@ RunDialog::RunDialog( GtkWidget *pDialog, uno::Reference< awt::XExtendedToolkit
}
}
+ GdkThreadLock aLock;
+
GdkDisplay *pDisplay = aWindowHandle.DisplayPointer ? gdk_x11_lookup_xdisplay(reinterpret_cast<void*>(static_cast<sal_IntPtr>(aWindowHandle.DisplayPointer))) : NULL;
GdkWindow* pParent = pDisplay ? gdk_window_lookup_for_display(pDisplay, aWindowHandle.WindowHandle) : NULL;
if (!pParent && pDisplay)
@@ -163,17 +165,22 @@ RunDialog::RunDialog( GtkWidget *pDialog, uno::Reference< awt::XExtendedToolkit
RunDialog::~RunDialog()
{
if (mpCreatedParent)
+ {
+ GdkThreadLock aLock;
gdk_window_destroy (mpCreatedParent);
+ }
}
void SAL_CALL RunDialog::windowOpened( const ::com::sun::star::lang::EventObject& )
throw (::com::sun::star::uno::RuntimeException)
{
+ GdkThreadLock aLock;
g_timeout_add_full(G_PRIORITY_HIGH_IDLE, 0, (GSourceFunc)canceldialog, this, NULL);
}
void RunDialog::cancel()
{
+ GdkThreadLock aLock;
gtk_dialog_response( GTK_DIALOG( mpDialog ), GTK_RESPONSE_CANCEL );
gtk_widget_hide( mpDialog );
}
@@ -183,6 +190,7 @@ gint RunDialog::run()
if (mxToolkit.is())
mxToolkit->addTopWindowListener(this);
+ GdkThreadLock aLock;
gint nStatus = gtk_dialog_run( GTK_DIALOG( mpDialog ) );
if (mxToolkit.is())
@@ -197,14 +205,16 @@ gint RunDialog::run()
SalGtkPicker::~SalGtkPicker()
{
if (m_pDialog)
+ {
+ GdkThreadLock aLock;
gtk_widget_destroy(m_pDialog);
+ }
}
void SAL_CALL SalGtkPicker::implsetDisplayDirectory( const rtl::OUString& aDirectory )
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
OString aTxt = unicodetouri(aDirectory);
@@ -213,14 +223,16 @@ void SAL_CALL SalGtkPicker::implsetDisplayDirectory( const rtl::OUString& aDirec
OSL_TRACE( "setting path to %s\n", aTxt.getStr() );
+ GdkThreadLock aLock;
gtk_file_chooser_set_current_folder_uri( GTK_FILE_CHOOSER( m_pDialog ),
- aTxt.getStr() );
+ aTxt.getStr() );
}
rtl::OUString SAL_CALL SalGtkPicker::implgetDisplayDirectory() throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+
+ GdkThreadLock aLock;
gchar* pCurrentFolder =
gtk_file_chooser_get_current_folder_uri( GTK_FILE_CHOOSER( m_pDialog ) );
@@ -233,8 +245,9 @@ rtl::OUString SAL_CALL SalGtkPicker::implgetDisplayDirectory() throw( uno::Runti
void SAL_CALL SalGtkPicker::implsetTitle( const rtl::OUString& aTitle ) throw( uno::RuntimeException )
{
OSL_ASSERT( m_pDialog != NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
::rtl::OString aWindowTitle = OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 );
+
+ GdkThreadLock aLock;
gtk_window_set_title( GTK_WINDOW( m_pDialog ), aWindowTitle.getStr() );
}
diff --git a/fpicker/source/unx/gnome/SalGtkPicker.hxx b/fpicker/source/unx/gnome/SalGtkPicker.hxx
index 5baa5bdb56e8..6349d3ed4988 100644
--- a/fpicker/source/unx/gnome/SalGtkPicker.hxx
+++ b/fpicker/source/unx/gnome/SalGtkPicker.hxx
@@ -71,6 +71,13 @@ class SalGtkPicker
static rtl::OString unicodetouri(const rtl::OUString &rURL);
};
+class GdkThreadLock
+{
+public:
+ GdkThreadLock() { gdk_threads_enter(); }
+ ~GdkThreadLock() { gdk_threads_leave(); }
+};
+
//Run the Gtk Dialog. Watch for any "new windows" created while we're
//executing and consider that a CANCEL event to avoid e.g. "file cannot be opened"
//modal dialogs and this one getting locked if some other API call causes this
diff --git a/fpicker/source/unx/gnome/exports.map b/fpicker/source/unx/gnome/exports.map
deleted file mode 100644
index f4ed78b9e970..000000000000
--- a/fpicker/source/unx/gnome/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_0_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/fpicker/source/unx/gnome/makefile.mk b/fpicker/source/unx/gnome/makefile.mk
index aa1fbc54b7f5..04c6e650ff6f 100644
--- a/fpicker/source/unx/gnome/makefile.mk
+++ b/fpicker/source/unx/gnome/makefile.mk
@@ -87,7 +87,7 @@ SHL1STDLIBS=\
LINKFLAGSDEFS=
.ENDIF # "$(OS)"=="SOLARIS"
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
DEF1NAME=$(SHL1TARGET)
.ENDIF # GTK_TWO_FOUR
diff --git a/fpicker/source/unx/gnome/resourceprovider.cxx b/fpicker/source/unx/gnome/resourceprovider.cxx
index dba51c5a606a..8df810060ee5 100644
--- a/fpicker/source/unx/gnome/resourceprovider.cxx
+++ b/fpicker/source/unx/gnome/resourceprovider.cxx
@@ -40,7 +40,7 @@
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
-#include <svl/svtools.hrc>
+#include <svtools/svtools.hrc>
#include <svtools/filedlg2.hrc>
//------------------------------------------------------------
@@ -168,8 +168,6 @@ public:
String aResString;
OUString aResOUString;
- const ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
try
{
OSL_ASSERT( m_ResMgr && m_OtherResMgr );
diff --git a/fpicker/source/unx/kde4/KDE4FilePicker.cxx b/fpicker/source/unx/kde4/KDE4FilePicker.cxx
index 046147ff4b77..a7fa01a5ece6 100644
--- a/fpicker/source/unx/kde4/KDE4FilePicker.cxx
+++ b/fpicker/source/unx/kde4/KDE4FilePicker.cxx
@@ -38,7 +38,7 @@
#include <com/sun/star/ui/dialogs/ControlActions.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#include <svl/svtools.hrc>
+#include <svtools/svtools.hrc>
#include <vos/mutex.hxx>
diff --git a/fpicker/source/win32/filepicker/FPentry.cxx b/fpicker/source/win32/filepicker/FPentry.cxx
index f22e1c3abdaf..e93c3bec18ba 100644
--- a/fpicker/source/win32/filepicker/FPentry.cxx
+++ b/fpicker/source/win32/filepicker/FPentry.cxx
@@ -67,14 +67,14 @@ static Reference< XInterface > SAL_CALL createInstance(
if (bVistaOrNewer)
{
- fprintf(stdout, "use special (vista) system file picker ...\n");
+ OSL_TRACE("use special (vista) system file picker ...");
xDlg.set(
static_cast< XFilePicker2* >(
new ::fpicker::win32::vista::VistaFilePicker( rServiceManager ) ) );
}
else
{
- fprintf(stdout, "use normal system file picker ...\n");
+ OSL_TRACE("use normal system file picker ...");
xDlg.set(
static_cast< XFilePicker2* >(
new CFilePicker( rServiceManager ) ) );
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx
index 3f51aa9c765d..2fadaa6bfdff 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx
@@ -125,14 +125,14 @@ STDMETHODIMP VistaFilePickerEventHandler::OnFileOk(IFileDialog* /*pDialog*/)
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnFolderChanging(IFileDialog* pDialog,
- IShellItem* pFolder)
+STDMETHODIMP VistaFilePickerEventHandler::OnFolderChanging(IFileDialog* /*pDialog*/,
+ IShellItem* /*pFolder*/)
{
return E_NOTIMPL;
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnFolderChange(IFileDialog* pDialog)
+STDMETHODIMP VistaFilePickerEventHandler::OnFolderChange(IFileDialog* /*pDialog*/)
{
impl_sendEvent(E_DIRECTORY_CHANGED, 0);
return S_OK;
@@ -250,7 +250,7 @@ void lcl_updateVersionListDirectly(IFileDialog* pDialog)
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnSelectionChange(IFileDialog* pDialog)
+STDMETHODIMP VistaFilePickerEventHandler::OnSelectionChange(IFileDialog* /*pDialog*/)
{
impl_sendEvent(E_FILE_SELECTION_CHANGED, 0);
//lcl_updateVersionListDirectly(pDialog);
@@ -258,16 +258,18 @@ STDMETHODIMP VistaFilePickerEventHandler::OnSelectionChange(IFileDialog* pDialog
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnShareViolation(IFileDialog* pDialog ,
- IShellItem* pItem ,
- FDE_SHAREVIOLATION_RESPONSE* pResponse)
+STDMETHODIMP VistaFilePickerEventHandler::OnShareViolation(IFileDialog* /*pDialog*/ ,
+
+ IShellItem* /*pItem*/ ,
+
+ FDE_SHAREVIOLATION_RESPONSE* /*pResponse*/)
{
impl_sendEvent(E_CONTROL_STATE_CHANGED, css::ui::dialogs::CommonFilePickerElementIds::LISTBOX_FILTER);
return S_OK;
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnTypeChange(IFileDialog* pDialog)
+STDMETHODIMP VistaFilePickerEventHandler::OnTypeChange(IFileDialog* /*pDialog*/)
{
/*
IFileDialogCustomize *iCustomize;
@@ -299,32 +301,36 @@ STDMETHODIMP VistaFilePickerEventHandler::OnTypeChange(IFileDialog* pDialog)
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnOverwrite(IFileDialog* pDialog ,
- IShellItem* pItem ,
- FDE_OVERWRITE_RESPONSE* pResponse)
+STDMETHODIMP VistaFilePickerEventHandler::OnOverwrite(IFileDialog* /*pDialog*/ ,
+ IShellItem* /*pItem*/ ,
+ FDE_OVERWRITE_RESPONSE* /*pResponse*/)
{
return E_NOTIMPL;
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnItemSelected(IFileDialogCustomize* pCustomize,
- DWORD nIDCtl ,
- DWORD nIDItem )
+STDMETHODIMP VistaFilePickerEventHandler::OnItemSelected(IFileDialogCustomize* /*pCustomize*/,
+
+ DWORD nIDCtl ,
+
+ DWORD /*nIDItem*/ )
{
- impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl);
+
+ impl_sendEvent(E_CONTROL_STATE_CHANGED, static_cast<sal_Int16>( nIDCtl ));
return S_OK;
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnButtonClicked(IFileDialogCustomize* pCustomize,
+STDMETHODIMP VistaFilePickerEventHandler::OnButtonClicked(IFileDialogCustomize* /*pCustomize*/,
DWORD nIDCtl )
{
- impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl);
+
+ impl_sendEvent(E_CONTROL_STATE_CHANGED, static_cast<sal_Int16>( nIDCtl));
return S_OK;
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnCheckButtonToggled(IFileDialogCustomize* pCustomize,
+STDMETHODIMP VistaFilePickerEventHandler::OnCheckButtonToggled(IFileDialogCustomize* /*pCustomize*/,
DWORD nIDCtl ,
BOOL bChecked )
{
@@ -353,15 +359,17 @@ STDMETHODIMP VistaFilePickerEventHandler::OnCheckButtonToggled(IFileDialogCustom
if (nIDCtl == css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION)
m_pInternalNotify->onAutoExtensionChanged(bChecked);
- impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl);
+
+ impl_sendEvent(E_CONTROL_STATE_CHANGED, static_cast<sal_Int16>( nIDCtl));
+
return S_OK;
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnControlActivating(IFileDialogCustomize* pCustomize,
+STDMETHODIMP VistaFilePickerEventHandler::OnControlActivating(IFileDialogCustomize* /*pCustomize*/,
DWORD nIDCtl )
{
- impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl);
+ impl_sendEvent(E_CONTROL_STATE_CHANGED, static_cast<sal_Int16>( nIDCtl));
return S_OK;
}
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
index c0296892cb65..ac59a4f65b99 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
@@ -147,6 +147,7 @@ VistaFilePickerImpl::VistaFilePickerImpl()
, m_lLastFiles ()
, m_iEventHandler(new VistaFilePickerEventHandler(this))
, m_bInExecute (sal_False)
+ , m_bWasExecuted (sal_False)
, m_sDirectory ()
, m_sFilename ()
{
@@ -851,6 +852,8 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(const RequestRef& rRequest)
// tasks must be done differently .-) (e.g. see impl_sta_getSelectedFiles())
m_bInExecute = sal_True;
+ m_bWasExecuted = sal_True;
+
aLock.clear();
// <- SYNCHRONIZED
@@ -1092,6 +1095,7 @@ void VistaFilePickerImpl::impl_sta_GetControlValue(const RequestRef& rRequest)
return;
css::uno::Any aValue;
+ if( m_bWasExecuted )
switch (nId)
{
case css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_PASSWORD :
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx
index 3b0fa43b0dad..6be17935609b 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx
@@ -329,6 +329,8 @@ class VistaFilePickerImpl : private ::cppu::BaseMutex
/// @todo document me
::sal_Bool m_bInExecute;
+ ::sal_Bool m_bWasExecuted;
+
// handle to parent window
HWND m_hParentWindow;
diff --git a/fpicker/source/win32/misc/resourceprovider.cxx b/fpicker/source/win32/misc/resourceprovider.cxx
index 805f24c315d7..b5448a93008c 100644
--- a/fpicker/source/win32/misc/resourceprovider.cxx
+++ b/fpicker/source/win32/misc/resourceprovider.cxx
@@ -43,7 +43,7 @@
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
-#include <svl/svtools.hrc>
+#include <svtools/svtools.hrc>
//------------------------------------------------------------
// namespace directives
diff --git a/framework/Library_fwi.mk b/framework/Library_fwi.mk
index 0e00df9d8300..e320e5cfbc9b 100644
--- a/framework/Library_fwi.mk
+++ b/framework/Library_fwi.mk
@@ -46,12 +46,15 @@ $(eval $(call gb_Library_set_include,fwi,\
$(eval $(call gb_Library_add_linked_libs,fwi,\
comphelper \
- stl \
- tk \
- tl \
cppu \
cppuhelper \
+ i18nisolang1 \
sal \
+ stl \
+ svl \
+ svt \
+ tk \
+ tl \
utl \
vcl \
vos3 \
@@ -64,7 +67,6 @@ $(eval $(call gb_Library_add_exception_objects,fwi,\
framework/source/fwi/classes/protocolhandlercache \
framework/source/fwi/helper/mischelper \
framework/source/fwi/helper/networkdomain \
- framework/source/fwi/helper/popupmenucontrollerbase \
framework/source/fwi/helper/shareablemutex \
framework/source/fwi/jobs/configaccess \
framework/source/fwi/jobs/jobconst \
diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index 8ff8adb4e5fb..c9f52c1f2699 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -73,7 +73,6 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
framework/source/classes/taskcreator \
framework/source/constant/containerquery \
framework/source/constant/contenthandler \
- framework/source/constant/filter \
framework/source/constant/frameloader \
framework/source/dispatch/closedispatcher \
framework/source/dispatch/dispatchinformationprovider \
diff --git a/framework/Library_fwl.mk b/framework/Library_fwl.mk
index f3ec59fd6c61..7af0fef7dd10 100644
--- a/framework/Library_fwl.mk
+++ b/framework/Library_fwl.mk
@@ -55,31 +55,32 @@ $(eval $(call gb_Library_add_linked_libs,fwl,\
))
$(eval $(call gb_Library_add_exception_objects,fwl,\
- framework/source/register/registertemp \
- framework/source/services/mediatypedetectionhelper \
- framework/source/dispatch/mailtodispatcher \
- framework/source/dispatch/oxt_handler \
- framework/source/uielement/toolbarsmenucontroller \
- framework/source/uielement/newmenucontroller \
- framework/source/uielement/macrosmenucontroller \
- framework/source/uielement/langselectionmenucontroller \
- framework/source/uielement/headermenucontroller \
- framework/source/uielement/footermenucontroller \
- framework/source/uielement/fontsizemenucontroller \
- framework/source/uielement/fontmenucontroller \
- framework/source/services/tabwindowservice \
framework/source/classes/fwktabwindow \
- framework/source/uielement/logotextstatusbarcontroller \
framework/source/classes/fwlresid \
- framework/source/uielement/logoimagestatusbarcontroller \
- framework/source/uielement/simpletextstatusbarcontroller \
- framework/source/services/uriabbreviation \
+ framework/source/dispatch/mailtodispatcher \
+ framework/source/dispatch/oxt_handler \
+ framework/source/dispatch/popupmenudispatcher \
framework/source/dispatch/servicehandler \
- framework/source/services/license \
framework/source/recording/dispatchrecorder \
framework/source/recording/dispatchrecordersupplier \
+ framework/source/register/registertemp \
framework/source/services/dispatchhelper \
- framework/source/dispatch/popupmenudispatcher \
+ framework/source/services/license \
+ framework/source/services/mediatypedetectionhelper \
+ framework/source/services/tabwindowservice \
+ framework/source/services/uriabbreviation \
+ framework/source/uielement/fontmenucontroller \
+ framework/source/uielement/fontsizemenucontroller \
+ framework/source/uielement/footermenucontroller \
+ framework/source/uielement/headermenucontroller \
+ framework/source/uielement/langselectionmenucontroller \
+ framework/source/uielement/logoimagestatusbarcontroller \
+ framework/source/uielement/logotextstatusbarcontroller \
+ framework/source/uielement/macrosmenucontroller \
+ framework/source/uielement/newmenucontroller \
+ framework/source/uielement/popupmenucontroller \
+ framework/source/uielement/simpletextstatusbarcontroller \
+ framework/source/uielement/toolbarsmenucontroller \
))
ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_linked_libs,fwl,\
diff --git a/framework/Package_uiconfig.mk b/framework/Package_uiconfig.mk
index c92344a153f5..295be6c87252 100644
--- a/framework/Package_uiconfig.mk
+++ b/framework/Package_uiconfig.mk
@@ -26,7 +26,6 @@
#*************************************************************************
$(eval $(call gb_Package_Package,framework_uiconfig,$(SRCDIR)/framework/uiconfig))
-$(eval $(call gb_Package_add_file,framework_uiconfig,xml/uiconfig/modules/StartModule/accelerator/en-US/default.xml,startmodule/accelerator/en-US/default.xml))
$(eval $(call gb_Package_add_file,framework_uiconfig,xml/uiconfig/modules/StartModule/menubar/menubar.xml,startmodule/menubar/menubar.xml))
$(eval $(call gb_Package_add_file,framework_uiconfig,xml/uiconfig/modules/StartModule/statusbar/statusbar.xml,startmodule/statusbar/statusbar.xml))
$(eval $(call gb_Package_add_file,framework_uiconfig,xml/uiconfig/modules/StartModule/toolbar/standardbar.xml,startmodule/toolbar/standardbar.xml))
diff --git a/framework/inc/classes/menumanager.hxx b/framework/inc/classes/menumanager.hxx
index 5c14edde9c03..8826716f1d6f 100644
--- a/framework/inc/classes/menumanager.hxx
+++ b/framework/inc/classes/menumanager.hxx
@@ -82,13 +82,14 @@ class MenuManager : public ThreadHelpBase ,
Menu* pMenu,
sal_Bool bDelete,
sal_Bool bDeleteChildren );
-
+#if 0
MenuManager(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
REFERENCE< XFRAME >& rFrame,
AddonMenu* pAddonMenu,
sal_Bool bDelete,
sal_Bool bDeleteChildren );
+#endif
virtual ~MenuManager();
diff --git a/framework/inc/classes/resource.hrc b/framework/inc/classes/resource.hrc
index a2bf56376913..8c9bd2e854b0 100644
--- a/framework/inc/classes/resource.hrc
+++ b/framework/inc/classes/resource.hrc
@@ -55,6 +55,7 @@
#define STR_SET_LANGUAGE_FOR_PARAGRAPH (RID_STR_START+19)
#define STR_SET_LANGUAGE_FOR_ALL_TEXT (RID_STR_START+20)
#define STR_UNTITLED_DOCUMENT (RID_STR_START+21)
+#define STR_RESET_TO_DEFAULT_LANGUAGE (RID_STR_START+22)
#define POPUPMENU_TOOLBAR_QUICKCUSTOMIZATION (RID_MENU_START+0)
diff --git a/framework/inc/classes/xmlnamespaces.hxx b/framework/inc/classes/xmlnamespaces.hxx
deleted file mode 100644
index 60a3de4b68ba..000000000000
--- a/framework/inc/classes/xmlnamespaces.hxx
+++ /dev/null
@@ -1,65 +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 __FRAMEWORK_CLASSES_XMLNAMESPACES_HXX_
-#define __FRAMEWORK_CLASSES_XMLNAMESPACES_HXX_
-
-#include <com/sun/star/xml/sax/SAXException.hpp>
-
-#include <map>
-
-namespace framework
-{
-
-class XMLNamespaces
-{
- public:
- XMLNamespaces();
- XMLNamespaces( const XMLNamespaces& );
- virtual ~XMLNamespaces();
-
- void addNamespace( const ::rtl::OUString& aName, const ::rtl::OUString& aValue )
- throw( ::com::sun::star::xml::sax::SAXException );
-
- ::rtl::OUString applyNSToAttributeName( const ::rtl::OUString& ) const
- throw( ::com::sun::star::xml::sax::SAXException );
- ::rtl::OUString applyNSToElementName( const ::rtl::OUString& ) const
- throw( ::com::sun::star::xml::sax::SAXException );
-
- private:
- typedef ::std::map< ::rtl::OUString, ::rtl::OUString > NamespaceMap;
-
- ::rtl::OUString getNamespaceValue( const ::rtl::OUString& aNamespace ) const
- throw( ::com::sun::star::xml::sax::SAXException );
-
- ::rtl::OUString m_aDefaultNamespace;
- NamespaceMap m_aNamespaceMap;
-};
-
-}
-
-#endif // __FRAMEWORK_XMLNAMESPACES_HXX_
diff --git a/framework/inc/filterflags.h b/framework/inc/filterflags.h
deleted file mode 100644
index 227834bc41dd..000000000000
--- a/framework/inc/filterflags.h
+++ /dev/null
@@ -1,172 +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 __FRAMEWORK_FILTERFLAGS_H_
-#define __FRAMEWORK_FILTERFLAGS_H_
-
-namespace framework{
-
-/*-************************************************************************************************************//**
- @short These values describe our supported filter flags.
- @attention Don't change flag values without reason - we must support old functionality and position
- in flag combined values!
-*//*-*************************************************************************************************************/
-
-#define FILTERFLAGNAME_IMPORT DECLARE_ASCII("Import" ) // x
-#define FILTERFLAGNAME_EXPORT DECLARE_ASCII("Export" ) // x
-#define FILTERFLAGNAME_TEMPLATE DECLARE_ASCII("Template" ) // x
-#define FILTERFLAGNAME_INTERNAL DECLARE_ASCII("Internal" ) // x
-#define FILTERFLAGNAME_TEMPLATEPATH DECLARE_ASCII("TemplatePath" ) // x
-#define FILTERFLAGNAME_OWN DECLARE_ASCII("Own" ) // x
-#define FILTERFLAGNAME_ALIEN DECLARE_ASCII("Alien" ) // x
-#define FILTERFLAGNAME_USESOPTIONS DECLARE_ASCII("UsesOptions" ) // x
-#define FILTERFLAGNAME_DEFAULT DECLARE_ASCII("Default" ) // x
-#define FILTERFLAGNAME_EXECUTABLE DECLARE_ASCII("Executable" ) // deprecated
-#define FILTERFLAGNAME_SUPPORTSSELECTION DECLARE_ASCII("SupportsSelection") // x
-#define FILTERFLAGNAME_MAPTOAPPPLUG DECLARE_ASCII("MapToAppPlug" ) // deprecated
-#define FILTERFLAGNAME_NOTINFILEDIALOG DECLARE_ASCII("NotInFileDialog" ) // x
-#define FILTERFLAGNAME_NOTINCHOOSER DECLARE_ASCII("NotInChooser" ) // x
-#define FILTERFLAGNAME_ASYNCHRON DECLARE_ASCII("Asynchron" ) // x
-#define FILTERFLAGNAME_CREATOR DECLARE_ASCII("Creator" ) // deprecated
-#define FILTERFLAGNAME_READONLY DECLARE_ASCII("Readonly" ) // x
-#define FILTERFLAGNAME_NOTINSTALLED DECLARE_ASCII("NotInstalled" ) // deprecated
-#define FILTERFLAGNAME_CONSULTSERVICE DECLARE_ASCII("ConsultService" ) // deprecated
-#define FILTERFLAGNAME_3RDPARTYFILTER DECLARE_ASCII("3rdPartyFilter" ) // x
-#define FILTERFLAGNAME_PACKED DECLARE_ASCII("Packed" ) // x
-#define FILTERFLAGNAME_SILENTEXPORT DECLARE_ASCII("SilentExport" ) // x
-#define FILTERFLAGNAME_BROWSERPREFERED DECLARE_ASCII("BrowserPrefered" ) // deprecated
-#define FILTERFLAGNAME_PREFERED DECLARE_ASCII("Prefered" ) // x
-
-#define FILTERFLAG_IMPORT 0x00000001L // 1
-#define FILTERFLAG_EXPORT 0x00000002L // 2
-#define FILTERFLAG_TEMPLATE 0x00000004L // 4
-#define FILTERFLAG_INTERNAL 0x00000008L // 8
-#define FILTERFLAG_TEMPLATEPATH 0x00000010L // 16
-#define FILTERFLAG_OWN 0x00000020L // 32
-#define FILTERFLAG_ALIEN 0x00000040L // 64
-#define FILTERFLAG_USESOPTIONS 0x00000080L // 128
-#define FILTERFLAG_DEFAULT 0x00000100L // 256
-#define FILTERFLAG_EXECUTABLE 0x00000200L // 512
-#define FILTERFLAG_SUPPORTSSELECTION 0x00000400L // 1024
-#define FILTERFLAG_MAPTOAPPPLUG 0x00000800L // 2048
-#define FILTERFLAG_NOTINFILEDIALOG 0x00001000L // 4096
-#define FILTERFLAG_NOTINCHOOSER 0x00002000L // 8192
-#define FILTERFLAG_ASYNCHRON 0x00004000L // 16384
-#define FILTERFLAG_CREATOR 0x00008000L // 32768
-#define FILTERFLAG_READONLY 0x00010000L // 65536
-#define FILTERFLAG_NOTINSTALLED 0x00020000L // 131072
-#define FILTERFLAG_CONSULTSERVICE 0x00040000L // 262144
-#define FILTERFLAG_3RDPARTYFILTER 0x00080000L // 524288
-#define FILTERFLAG_PACKED 0x00100000L // 1048576
-#define FILTERFLAG_SILENTEXPORT 0x00200000L // 2097152
-#define FILTERFLAG_BROWSERPREFERED 0x00400000L // 4194304
-//FREE! ... 0x00800000L
-#define FILTERFLAG_PREFERED 0x10000000L // 268435456
-
-class FlagCheck
-{
- public:
-
- //___________________________________________
-
- /** @short checks if the given flag mask is set.
-
- @param nFlags the flag field, which should be checked.
- @param nMask this mask field is searched inside parameter nFlags.
-
- @return TRUE if mask match to the given flag field.
- */
- static sal_Bool isMaskSet( sal_Int32 nFlags, sal_Int32 nMask )
- {
- return((nFlags & nMask) == nMask);
- }
-
- //___________________________________________
-
- /** @short checks if the given flag field contains unknown flags.
-
- @descr Of course it can work only, if not the whole range of an int32
- is used!
-
- @param nFlags the flag field, which should be checked.
-
- @return TRUE if only well known flags are set.
- */
- static sal_Bool isValid( sal_Int32 nFlags )
- {
- sal_Int32 nCheck = nFlags;
- nCheck &= ~FILTERFLAG_IMPORT;
- nCheck &= ~FILTERFLAG_EXPORT;
- nCheck &= ~FILTERFLAG_TEMPLATE;
- nCheck &= ~FILTERFLAG_INTERNAL;
- nCheck &= ~FILTERFLAG_TEMPLATEPATH;
- nCheck &= ~FILTERFLAG_OWN;
- nCheck &= ~FILTERFLAG_ALIEN;
- nCheck &= ~FILTERFLAG_USESOPTIONS;
- nCheck &= ~FILTERFLAG_DEFAULT;
- nCheck &= ~FILTERFLAG_EXECUTABLE;
- nCheck &= ~FILTERFLAG_SUPPORTSSELECTION;
- nCheck &= ~FILTERFLAG_MAPTOAPPPLUG;
- nCheck &= ~FILTERFLAG_NOTINFILEDIALOG;
- nCheck &= ~FILTERFLAG_NOTINCHOOSER;
- nCheck &= ~FILTERFLAG_ASYNCHRON;
- nCheck &= ~FILTERFLAG_CREATOR;
- nCheck &= ~FILTERFLAG_READONLY;
- nCheck &= ~FILTERFLAG_NOTINSTALLED;
- nCheck &= ~FILTERFLAG_CONSULTSERVICE;
- nCheck &= ~FILTERFLAG_3RDPARTYFILTER;
- nCheck &= ~FILTERFLAG_PACKED;
- nCheck &= ~FILTERFLAG_SILENTEXPORT;
- nCheck &= ~FILTERFLAG_BROWSERPREFERED;
- nCheck &= ~FILTERFLAG_PREFERED;
- return(nCheck == 0);
- }
-
- //___________________________________________
-
- /** @short checks if the given flag field uses deprecated flag values.
-
- @param nFlags the flag field, which should be checked.
-
- @return TRUE if one deprecated flag item could be found.
- */
- static sal_Bool useDeprecated( sal_Int32 nFlags )
- {
- return(
- isMaskSet(nFlags, FILTERFLAG_EXECUTABLE ) ||
- isMaskSet(nFlags, FILTERFLAG_MAPTOAPPPLUG ) ||
- isMaskSet(nFlags, FILTERFLAG_CREATOR ) ||
- isMaskSet(nFlags, FILTERFLAG_NOTINSTALLED ) ||
- isMaskSet(nFlags, FILTERFLAG_CONSULTSERVICE ) ||
- isMaskSet(nFlags, FILTERFLAG_BROWSERPREFERED )
- );
- }
-};
-
-} // namespace framework
-
-#endif // #ifndef __FRAMEWORK_FILTERFLAGS_H_
diff --git a/framework/inc/framework.hrc b/framework/inc/framework.hrc
index e49192aa7c33..eea91edeaa07 100644
--- a/framework/inc/framework.hrc
+++ b/framework/inc/framework.hrc
@@ -51,19 +51,10 @@
#define STR_BACKING_CREATE 3
#define STR_BACKING_TEMPLATE 4
#define STR_BACKING_FILE 5
-#define BMP_BACKING_WRITER 6
-#define BMP_BACKING_CALC 7
-#define BMP_BACKING_IMPRESS 8
-#define BMP_BACKING_DRAW 9
-#define BMP_BACKING_DATABASE 10
-#define BMP_BACKING_FORMULA 11
-#define BMP_BACKING_OPENFILE 12
-#define BMP_BACKING_OPENTEMPLATE 13
-#define STR_BACKING_EXTHELP 15
-#define STR_BACKING_REGHELP 17
-#define STR_BACKING_INFOHELP 19
-#define STR_BACKING_TPLREP 21
-#define BMP_BACKING_FOLDER 22
+#define STR_BACKING_EXTHELP 6
+#define STR_BACKING_REGHELP 7
+#define STR_BACKING_INFOHELP 8
+#define STR_BACKING_TPLREP 9
#define RES_BACKING_IMAGES (DLG_BACKING+1)
#define RES_BACKING_IMAGES_HC (DLG_BACKING+2)
@@ -77,6 +68,14 @@
#define BMP_BACKING_REG 7
#define BMP_BACKING_INFO 8
#define BMP_BACKING_TPLREP 9
+#define BMP_BACKING_WRITER 10
+#define BMP_BACKING_CALC 11
+#define BMP_BACKING_IMPRESS 12
+#define BMP_BACKING_DRAW 13
+#define BMP_BACKING_DATABASE 14
+#define BMP_BACKING_FORMULA 15
+#define BMP_BACKING_OPENFILE 16
+#define BMP_BACKING_OPENTEMPLATE 17
// Ids of TabWindow
#define WIN_TABWINDOW (RID_FWK_DIALOG_START+101)
diff --git a/framework/inc/framework/imageproducer.hxx b/framework/inc/framework/imageproducer.hxx
index 7fe78f0a78b6..595b4c913744 100644
--- a/framework/inc/framework/imageproducer.hxx
+++ b/framework/inc/framework/imageproducer.hxx
@@ -40,11 +40,11 @@
namespace framework
{
-typedef Image ( *pfunc_getImage)( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, BOOL bBig, BOOL bHiContrast );
+typedef Image ( *pfunc_getImage)( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, BOOL bBig, BOOL bHiContrast );
pfunc_getImage FWE_DLLPUBLIC SAL_CALL SetImageProducer( pfunc_getImage pGetImageFunc );
-Image FWE_DLLPUBLIC SAL_CALL GetImageFromURL( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, BOOL bBig, BOOL bHiContrast );
+Image FWE_DLLPUBLIC SAL_CALL GetImageFromURL( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, BOOL bBig, BOOL bHiContrast );
}
diff --git a/framework/inc/framework/sfxhelperfunctions.hxx b/framework/inc/framework/sfxhelperfunctions.hxx
index 7e58c375aa2c..fd4292fc340f 100644
--- a/framework/inc/framework/sfxhelperfunctions.hxx
+++ b/framework/inc/framework/sfxhelperfunctions.hxx
@@ -41,6 +41,7 @@ typedef svt::StatusbarController* ( *pfunc_setStatusBarControllerCreator)( const
typedef void ( *pfunc_getRefreshToolbars)( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
typedef void ( *pfunc_createDockingWindow)( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& rResourceURL );
typedef bool ( *pfunc_isDockingWindowVisible)( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& rResourceURL );
+typedef void ( *pfunc_activateToolPanel)( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, const ::rtl::OUString& i_rPanelURL );
namespace framework
{
@@ -64,6 +65,10 @@ FWE_DLLPUBLIC void SAL_CALL CreateDockingWindow( const ::com::sun::star::uno::Re
FWE_DLLPUBLIC pfunc_isDockingWindowVisible SAL_CALL SetIsDockingWindowVisible( pfunc_isDockingWindowVisible pIsDockingWindowVisible );
FWE_DLLPUBLIC bool SAL_CALL IsDockingWindowVisible( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& rResourceURL );
+
+FWE_DLLPUBLIC pfunc_activateToolPanel SAL_CALL SetActivateToolPanel( pfunc_activateToolPanel i_pActivator );
+
+FWE_DLLPUBLIC void SAL_CALL ActivateToolPanel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, const ::rtl::OUString& i_rPanelURL );
}
#endif // __FRAMEWORK_CLASSES_SFXHELPERFUNCTIONS_HXX_
diff --git a/framework/inc/helper/mischelper.hxx b/framework/inc/helper/mischelper.hxx
index 5fe3c2585a9b..5698974930ca 100644
--- a/framework/inc/helper/mischelper.hxx
+++ b/framework/inc/helper/mischelper.hxx
@@ -34,20 +34,68 @@
#include <i18npool/lang.h>
#include <svl/languageoptions.hxx>
+#include <rtl/ustring.hxx>
#include <fwidllapi.h>
+#include <set>
+
+class SvtLanguageTable;
+
+
+// flags for script types in use within selection
+#define LS_SCRIPT_LATIN 0x0001
+#define LS_SCRIPT_ASIAN 0x0002
+#define LS_SCRIPT_COMPLEX 0x0004
+
+
namespace framework
{
+// menu ids for language status bar control
+enum LangMenuIDs
+{
+ MID_LANG_SEL_1 = 1, // need to start with 1 since xPopupMenu->execute will return 0 if the menu is cancelled
+ MID_LANG_SEL_2,
+ MID_LANG_SEL_3,
+ MID_LANG_SEL_4,
+ MID_LANG_SEL_5,
+ MID_LANG_SEL_6,
+ MID_LANG_SEL_7,
+ MID_LANG_SEL_8,
+ MID_LANG_SEL_9,
+ MID_LANG_SEL_NONE,
+ MID_LANG_SEL_RESET,
+ MID_LANG_SEL_MORE,
+
+ MID_LANG_PARA_SEPERATOR,
+ MID_LANG_PARA_STRING,
+
+ MID_LANG_PARA_1,
+ MID_LANG_PARA_2,
+ MID_LANG_PARA_3,
+ MID_LANG_PARA_4,
+ MID_LANG_PARA_5,
+ MID_LANG_PARA_6,
+ MID_LANG_PARA_7,
+ MID_LANG_PARA_8,
+ MID_LANG_PARA_9,
+ MID_LANG_PARA_NONE,
+ MID_LANG_PARA_RESET,
+ MID_LANG_PARA_MORE,
+};
+
+
inline bool IsScriptTypeMatchingToLanguage( sal_Int16 nScriptType, LanguageType nLang )
{
return 0 != (nScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage( nLang ));
}
+
class FWI_DLLPUBLIC LanguageGuessingHelper
{
mutable ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLanguageGuessing > m_xLanguageGuesser;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+
public:
LanguageGuessingHelper(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xServiceManager) : m_xServiceManager(_xServiceManager){}
@@ -62,6 +110,15 @@ FWI_DLLPUBLIC ::rtl::OUString RetrieveLabelFromCommand( const ::rtl::OUString& a
,sal_Bool& _rIni
,const sal_Char* _pName);
+FWI_DLLPUBLIC void FillLangItems( std::set< ::rtl::OUString > &rLangItems,
+ const SvtLanguageTable &rLanguageTable,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > &rxFrame,
+ const LanguageGuessingHelper & rLangGuessHelper,
+ sal_Int16 nScriptType,
+ const ::rtl::OUString & rCurLang,
+ const ::rtl::OUString & rKeyboardLang,
+ const ::rtl::OUString & rGuessedTextLang );
+
} // namespace framework
#endif // __MISC_HELPER_HXX_
diff --git a/framework/inc/helper/popupmenucontrollerbase.hxx b/framework/inc/helper/popupmenucontrollerbase.hxx
deleted file mode 100644
index f424c1fbb917..000000000000
--- a/framework/inc/helper/popupmenucontrollerbase.hxx
+++ /dev/null
@@ -1,150 +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 __FRAMEWORK_HELPER_POPUPMENUCONTROLLERBASE_HXX_
-#define __FRAMEWORK_HELPER_POPUPMENUCONTROLLERBASE_HXX_
-
-//_________________________________________________________________________________________________________________
-// my own includes
-//_________________________________________________________________________________________________________________
-
-#include <threadhelp/threadhelpbase.hxx>
-#include <macros/generic.hxx>
-#include <macros/xinterface.hxx>
-#include <macros/xtypeprovider.hxx>
-#include <macros/xserviceinfo.hxx>
-#include <stdtypes.h>
-
-//_________________________________________________________________________________________________________________
-// interface includes
-//_________________________________________________________________________________________________________________
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XTypeProvider.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/frame/XDispatchProvider.hpp>
-#include <com/sun/star/frame/XDispatch.hpp>
-#include <com/sun/star/frame/XStatusListener.hpp>
-#include <com/sun/star/frame/XPopupMenuController.hpp>
-#include <com/sun/star/uri/XUriReferenceFactory.hpp>
-#include <com/sun/star/uri/XUriReference.hpp>
-#include <com/sun/star/util/XURLTransformer.hpp>
-//_________________________________________________________________________________________________________________
-// includes of other projects
-//_________________________________________________________________________________________________________________
-#include <toolkit/awt/vclxmenu.hxx>
-#include <cppuhelper/weak.hxx>
-#include <rtl/ustring.hxx>
-#include <fwidllapi.h>
-
-namespace framework
-{
- class FWI_DLLPUBLIC PopupMenuControllerBase : public com::sun::star::lang::XTypeProvider ,
- public com::sun::star::lang::XServiceInfo ,
- public ::com::sun::star::frame::XPopupMenuController ,
- public com::sun::star::lang::XInitialization ,
- public com::sun::star::frame::XStatusListener ,
- public com::sun::star::awt::XMenuListener ,
- public com::sun::star::frame::XDispatchProvider ,
- public com::sun::star::frame::XDispatch ,
- public com::sun::star::lang::XComponent ,
- protected ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- private ::cppu::OBroadcastHelper ,
- public ::cppu::OWeakObject
- {
- public:
- PopupMenuControllerBase( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
- virtual ~PopupMenuControllerBase();
-
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw( ::com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw( ::com::sun::star::uno::RuntimeException );
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw( ::com::sun::star::uno::RuntimeException );
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException) = 0;
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException) = 0;
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException) = 0;
-
- // XPopupMenuController
- virtual void SAL_CALL setPopupMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >& PopupMenu ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updatePopupMenu() throw (::com::sun::star::uno::RuntimeException);
-
- // XInitialization
- virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
-
- // XStatusListener
- virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ) = 0;
-
- // XMenuListener
- virtual void SAL_CALL highlight( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL select( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deactivate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
-
- // XDispatchProvider
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& sTarget, sal_Int32 nFlags ) throw( ::com::sun::star::uno::RuntimeException );
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches( const ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchDescriptor >& lDescriptor ) throw( ::com::sun::star::uno::RuntimeException );
-
- // XDispatch
- virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& seqProperties ) throw( ::com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL addStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& xControl, const ::com::sun::star::util::URL& aURL ) throw( ::com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL removeStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& xControl, const ::com::sun::star::util::URL& aURL ) throw( ::com::sun::star::uno::RuntimeException );
-
- // XEventListener
- virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) 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);
-
- protected:
- virtual void resetPopupMenu( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu );
- virtual void impl_setPopupMenu();
- virtual void impl_select(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& _xDispatch,const ::com::sun::star::util::URL& aURL);
- ::rtl::OUString determineBaseURL( const ::rtl::OUString& aURL );
-
- bool m_bInitialized;
- bool m_bDisposed;
- rtl::OUString m_aCommandURL;
- rtl::OUString m_aBaseURL;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > m_xDispatch;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu > m_xPopupMenu;
- ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; // container for ALL Listener
- };
-}
-
-#endif // __FRAMEWORK_HELPER_POPUPMENUCONTROLLERBASE_HXX_
diff --git a/framework/inc/helper/uiconfigelementwrapperbase.hxx b/framework/inc/helper/uiconfigelementwrapperbase.hxx
index 09045ef24829..a815e7ac544d 100644
--- a/framework/inc/helper/uiconfigelementwrapperbase.hxx
+++ b/framework/inc/helper/uiconfigelementwrapperbase.hxx
@@ -105,6 +105,9 @@ class UIConfigElementWrapperBase : public ::com::sun::star::lang::XTypeProvider
virtual FWE_DLLPUBLIC void SAL_CALL setSettings( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& UISettings ) throw (::com::sun::star::uno::RuntimeException);
// XUIElement
+ virtual FWE_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SAL_CALL getFrame() throw (::com::sun::star::uno::RuntimeException);
+ virtual FWE_DLLPUBLIC ::rtl::OUString SAL_CALL getResourceURL() throw (::com::sun::star::uno::RuntimeException);
+ virtual FWE_DLLPUBLIC ::sal_Int16 SAL_CALL getType() throw (::com::sun::star::uno::RuntimeException);
virtual FWE_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getRealInterface() throw (::com::sun::star::uno::RuntimeException) = 0;
// XUpdatable
diff --git a/framework/inc/helper/uielementwrapperbase.hxx b/framework/inc/helper/uielementwrapperbase.hxx
index 32b23f732c48..daa574c9411e 100644
--- a/framework/inc/helper/uielementwrapperbase.hxx
+++ b/framework/inc/helper/uielementwrapperbase.hxx
@@ -96,6 +96,9 @@ class UIElementWrapperBase : public ::com::sun::star::lang::XTypeProvider
virtual FWE_DLLPUBLIC void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
// XUIElement
+ virtual FWE_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SAL_CALL getFrame() throw (::com::sun::star::uno::RuntimeException);
+ virtual FWE_DLLPUBLIC ::rtl::OUString SAL_CALL getResourceURL() throw (::com::sun::star::uno::RuntimeException);
+ virtual FWE_DLLPUBLIC ::sal_Int16 SAL_CALL getType() throw (::com::sun::star::uno::RuntimeException);
virtual FWE_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getRealInterface() throw (::com::sun::star::uno::RuntimeException) = 0;
//-------------------------------------------------------------------------------------------------------------
diff --git a/framework/inc/properties.h b/framework/inc/properties.h
index f0358ef6f1a0..5a32a42a28cc 100644
--- a/framework/inc/properties.h
+++ b/framework/inc/properties.h
@@ -217,6 +217,14 @@ namespace framework{
#define UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDROTATEIMAGELIST "private:resource/image/commandrotateimagelist"
#define UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDMIRRORIMAGELIST "private:resource/image/commandmirrorimagelist"
+#define UICOMMANDDESCRIPTION_PROPNAME_PROPERTIES "Properties"
+#define UICOMMANDDESCRIPTION_PROPNAME_POPUP "Popup"
+
+#define UICOMMANDDESCRIPTION_PROPERTIES_IMAGE 1
+#define UICOMMANDDESCRIPTION_PROPERTIES_IMAGE_MIRRORED 2
+#define UICOMMANDDESCRIPTION_PROPERTIES_IMAGE_ROTATED 4
+#define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8
+
//_______________________________________________
/** properties for "AutoRecovery" class */
diff --git a/framework/inc/queries.h b/framework/inc/queries.h
index ce190a796dcb..b8d122118abf 100644
--- a/framework/inc/queries.h
+++ b/framework/inc/queries.h
@@ -32,7 +32,6 @@
// own includes
//_________________________________________________________________________________________________________________
-#include <filterflags.h>
#include <general.h>
//_________________________________________________________________________________________________________________
diff --git a/framework/inc/threadhelp/fairrwlock.hxx b/framework/inc/threadhelp/fairrwlock.hxx
index af9617a9ba47..0f984c8d03f9 100644
--- a/framework/inc/threadhelp/fairrwlock.hxx
+++ b/framework/inc/threadhelp/fairrwlock.hxx
@@ -40,7 +40,6 @@
// interface includes
//_________________________________________________________________________________________________________________
#include <com/sun/star/uno/XInterface.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
//_________________________________________________________________________________________________________________
// other includes
diff --git a/framework/inc/threadhelp/transactionmanager.hxx b/framework/inc/threadhelp/transactionmanager.hxx
index cfbb39017a54..a9608de0164d 100644
--- a/framework/inc/threadhelp/transactionmanager.hxx
+++ b/framework/inc/threadhelp/transactionmanager.hxx
@@ -94,7 +94,6 @@ class FWI_DLLPUBLIC TransactionManager : public ITransactionManager
virtual sal_Bool isCallRejected ( ERejectReason& eReason ) const;
virtual void registerTransaction ( EExceptionMode eMode, ERejectReason& eReason ) throw( css::uno::RuntimeException, css::lang::DisposedException );
virtual void unregisterTransaction ( ) throw( css::uno::RuntimeException, css::lang::DisposedException );
- static TransactionManager& getGlobalTransactionManager ( );
//-------------------------------------------------------------------------------------------------------------
// private methods
diff --git a/framework/inc/uielement/controlmenucontroller.hxx b/framework/inc/uielement/controlmenucontroller.hxx
index a1be2ee47b3b..6e0c9deb03c0 100644
--- a/framework/inc/uielement/controlmenucontroller.hxx
+++ b/framework/inc/uielement/controlmenucontroller.hxx
@@ -32,7 +32,7 @@
// my own includes
//_________________________________________________________________________________________________________________
-#include <helper/popupmenucontrollerbase.hxx>
+#include <macros/xserviceinfo.hxx>
#include <stdtypes.h>
//_________________________________________________________________________________________________________________
@@ -52,6 +52,7 @@
//_________________________________________________________________________________________________________________
// includes of other projects
//_________________________________________________________________________________________________________________
+#include <svtools/popupmenucontrollerbase.hxx>
#include <toolkit/awt/vclxmenu.hxx>
#include <cppuhelper/weak.hxx>
#include <rtl/ustring.hxx>
@@ -59,8 +60,10 @@
class PopupMenu;
namespace framework
{
- class ControlMenuController : public PopupMenuControllerBase
+ class ControlMenuController : public svt::PopupMenuControllerBase
{
+ using svt::PopupMenuControllerBase::disposing;
+
public:
ControlMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
virtual ~ControlMenuController();
diff --git a/framework/inc/uielement/fontmenucontroller.hxx b/framework/inc/uielement/fontmenucontroller.hxx
index f14680a49030..79905658839b 100644
--- a/framework/inc/uielement/fontmenucontroller.hxx
+++ b/framework/inc/uielement/fontmenucontroller.hxx
@@ -32,7 +32,7 @@
// my own includes
//_________________________________________________________________________________________________________________
-#include <helper/popupmenucontrollerbase.hxx>
+#include <macros/xserviceinfo.hxx>
#include <stdtypes.h>
//_________________________________________________________________________________________________________________
@@ -50,14 +50,17 @@
//_________________________________________________________________________________________________________________
// includes of other projects
//_________________________________________________________________________________________________________________
+#include <svtools/popupmenucontrollerbase.hxx>
#include <toolkit/awt/vclxmenu.hxx>
#include <cppuhelper/weak.hxx>
#include <rtl/ustring.hxx>
namespace framework
{
- class FontMenuController : public PopupMenuControllerBase
+ class FontMenuController : public svt::PopupMenuControllerBase
{
+ using svt::PopupMenuControllerBase::disposing;
+
public:
FontMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
virtual ~FontMenuController();
diff --git a/framework/inc/uielement/fontsizemenucontroller.hxx b/framework/inc/uielement/fontsizemenucontroller.hxx
index d0afe40154fe..4e5623084908 100644
--- a/framework/inc/uielement/fontsizemenucontroller.hxx
+++ b/framework/inc/uielement/fontsizemenucontroller.hxx
@@ -32,7 +32,7 @@
// my own includes
//_________________________________________________________________________________________________________________
-#include <helper/popupmenucontrollerbase.hxx>
+#include <macros/xserviceinfo.hxx>
#include <stdtypes.h>
//_________________________________________________________________________________________________________________
@@ -51,14 +51,17 @@
//_________________________________________________________________________________________________________________
// includes of other projects
//_________________________________________________________________________________________________________________
+#include <svtools/popupmenucontrollerbase.hxx>
#include <toolkit/awt/vclxmenu.hxx>
#include <cppuhelper/weak.hxx>
#include <rtl/ustring.hxx>
namespace framework
{
- class FontSizeMenuController : public PopupMenuControllerBase
+ class FontSizeMenuController : public svt::PopupMenuControllerBase
{
+ using svt::PopupMenuControllerBase::disposing;
+
public:
FontSizeMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
virtual ~FontSizeMenuController();
diff --git a/framework/inc/uielement/headermenucontroller.hxx b/framework/inc/uielement/headermenucontroller.hxx
index 8ec012e80319..0deeb878156d 100644
--- a/framework/inc/uielement/headermenucontroller.hxx
+++ b/framework/inc/uielement/headermenucontroller.hxx
@@ -32,7 +32,7 @@
// my own includes
//_________________________________________________________________________________________________________________
-#include <helper/popupmenucontrollerbase.hxx>
+#include <macros/xserviceinfo.hxx>
#include <stdtypes.h>
//_________________________________________________________________________________________________________________
@@ -52,14 +52,17 @@
//_________________________________________________________________________________________________________________
// includes of other projects
//_________________________________________________________________________________________________________________
+#include <svtools/popupmenucontrollerbase.hxx>
#include <toolkit/awt/vclxmenu.hxx>
#include <cppuhelper/weak.hxx>
#include <rtl/ustring.hxx>
namespace framework
{
- class HeaderMenuController : public PopupMenuControllerBase
+ class HeaderMenuController : public svt::PopupMenuControllerBase
{
+ using svt::PopupMenuControllerBase::disposing;
+
public:
HeaderMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager,bool _bFooter = sal_False );
virtual ~HeaderMenuController();
diff --git a/framework/inc/uielement/langselectionmenucontroller.hxx b/framework/inc/uielement/langselectionmenucontroller.hxx
index 36035040bcad..257638ecd77f 100644
--- a/framework/inc/uielement/langselectionmenucontroller.hxx
+++ b/framework/inc/uielement/langselectionmenucontroller.hxx
@@ -32,7 +32,7 @@
// my own includes
//_________________________________________________________________________________________________________________
-#include <helper/popupmenucontrollerbase.hxx>
+#include <macros/xserviceinfo.hxx>
#include <stdtypes.h>
//_________________________________________________________________________________________________________________
@@ -51,6 +51,7 @@
//_________________________________________________________________________________________________________________
// includes of other projects
//_________________________________________________________________________________________________________________
+#include <svtools/popupmenucontrollerbase.hxx>
#include <toolkit/awt/vclxmenu.hxx>
#include <cppuhelper/weak.hxx>
#include <rtl/ustring.hxx>
@@ -59,8 +60,10 @@
namespace framework
{
- class LanguageSelectionMenuController : public PopupMenuControllerBase
+ class LanguageSelectionMenuController : public svt::PopupMenuControllerBase
{
+ using svt::PopupMenuControllerBase::disposing;
+
public:
LanguageSelectionMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
virtual ~LanguageSelectionMenuController();
@@ -99,11 +102,10 @@ namespace framework
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > m_xMenuDispatch_Font;
::rtl::OUString m_aMenuCommandURL_CharDlgForParagraph;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > m_xMenuDispatch_CharDlgForParagraph;
- ::rtl::OUString m_aCurrentLanguage;
::rtl::OUString m_aCurLang;
sal_Int16 m_nScriptType;
::rtl::OUString m_aKeyboardLang;
- ::rtl::OUString m_aGuessedText;
+ ::rtl::OUString m_aGuessedTextLang;
LanguageGuessingHelper m_aLangGuessHelper;
void fillPopupMenu( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu, const Mode rMode );
diff --git a/framework/inc/uielement/langselectionstatusbarcontroller.hxx b/framework/inc/uielement/langselectionstatusbarcontroller.hxx
index 09cd83901b1e..4d46538eb6d6 100644
--- a/framework/inc/uielement/langselectionstatusbarcontroller.hxx
+++ b/framework/inc/uielement/langselectionstatusbarcontroller.hxx
@@ -35,9 +35,15 @@
#include <stdtypes.h>
#include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
#include <svtools/statusbarcontroller.hxx>
+#include <rtl/ustring.hxx>
#include "helper/mischelper.hxx"
+#include <set>
+
+class SvtLanguageTable;
+
+
// component helper namespace
namespace framework {
@@ -86,12 +92,11 @@ class LangSelectionStatusbarController : public svt::StatusbarController
void operator =(LangSelectionStatusbarController &); // not defined
- sal_Bool m_bShowMenu;
- sal_Int16 m_nScriptType;
- ::rtl::OUString m_aCurrentLanguage;
- ::rtl::OUString m_aCurLang;
- ::rtl::OUString m_aKeyboardLang;
- ::rtl::OUString m_aGuessedText;
+ sal_Bool m_bShowMenu; // if the menu is to be displayed or not (depending on the selected object/text)
+ sal_Int16 m_nScriptType; // the flags for the different script types available in the selection, LATIN = 0x0001, ASIAN = 0x0002, COMPLEX = 0x0004
+ ::rtl::OUString m_aCurLang; // the language of the current selection, "*" if there are more than one languages
+ ::rtl::OUString m_aKeyboardLang; // the keyboard language
+ ::rtl::OUString m_aGuessedTextLang; // the 'guessed' language for the selection, "" if none could be guessed
LanguageGuessingHelper m_aLangGuessHelper;
void LangMenu() throw (::com::sun::star::uno::RuntimeException);
diff --git a/framework/inc/uielement/macrosmenucontroller.hxx b/framework/inc/uielement/macrosmenucontroller.hxx
index 6070a44d3564..1e8b9024eaca 100644
--- a/framework/inc/uielement/macrosmenucontroller.hxx
+++ b/framework/inc/uielement/macrosmenucontroller.hxx
@@ -28,7 +28,7 @@
#ifndef __FRAMEWORK_UIELEMENT_MACROSMENUCONTROLLER_HXX_
#define __FRAMEWORK_UIELEMENT_MACROSMENUCONTROLLER_HXX_
-#include <helper/popupmenucontrollerbase.hxx>
+#include <macros/xserviceinfo.hxx>
#include <stdtypes.h>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
@@ -40,6 +40,7 @@
#include <com/sun/star/frame/XStatusListener.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/frame/XPopupMenuController.hpp>
+#include <svtools/popupmenucontrollerbase.hxx>
#include <toolkit/awt/vclxmenu.hxx>
#include <cppuhelper/weak.hxx>
#include <vcl/menu.hxx>
@@ -47,8 +48,10 @@
namespace framework
{
- class MacrosMenuController : public PopupMenuControllerBase
+ class MacrosMenuController : public svt::PopupMenuControllerBase
{
+ using svt::PopupMenuControllerBase::disposing;
+
struct ExecuteInfo
{
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
diff --git a/framework/inc/uielement/newmenucontroller.hxx b/framework/inc/uielement/newmenucontroller.hxx
index e937623b44b9..5e14b70f0044 100644
--- a/framework/inc/uielement/newmenucontroller.hxx
+++ b/framework/inc/uielement/newmenucontroller.hxx
@@ -32,7 +32,7 @@
// my own includes
//_________________________________________________________________________________________________________________
-#include <helper/popupmenucontrollerbase.hxx>
+#include <macros/xserviceinfo.hxx>
#include <stdtypes.h>
//_________________________________________________________________________________________________________________
@@ -53,6 +53,7 @@
//_________________________________________________________________________________________________________________
// includes of other projects
//_________________________________________________________________________________________________________________
+#include <svtools/popupmenucontrollerbase.hxx>
#include <toolkit/awt/vclxmenu.hxx>
#include <cppuhelper/weak.hxx>
#include <rtl/ustring.hxx>
@@ -71,8 +72,10 @@ namespace framework
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
};
- class NewMenuController : public PopupMenuControllerBase
+ class NewMenuController : public svt::PopupMenuControllerBase
{
+ using svt::PopupMenuControllerBase::disposing;
+
public:
NewMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
virtual ~NewMenuController();
diff --git a/framework/inc/uielement/objectmenucontroller.hxx b/framework/inc/uielement/objectmenucontroller.hxx
index 94c1d849e197..7a03dfd1458e 100644
--- a/framework/inc/uielement/objectmenucontroller.hxx
+++ b/framework/inc/uielement/objectmenucontroller.hxx
@@ -32,7 +32,7 @@
// my own includes
//_________________________________________________________________________________________________________________
-#include <helper/popupmenucontrollerbase.hxx>
+#include <macros/xserviceinfo.hxx>
#include <stdtypes.h>
//_________________________________________________________________________________________________________________
@@ -51,14 +51,17 @@
//_________________________________________________________________________________________________________________
// includes of other projects
//_________________________________________________________________________________________________________________
+#include <svtools/popupmenucontrollerbase.hxx>
#include <toolkit/awt/vclxmenu.hxx>
#include <cppuhelper/weak.hxx>
#include <rtl/ustring.hxx>
namespace framework
{
- class ObjectMenuController : public PopupMenuControllerBase
+ class ObjectMenuController : public svt::PopupMenuControllerBase
{
+ using svt::PopupMenuControllerBase::disposing;
+
public:
ObjectMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
virtual ~ObjectMenuController();
diff --git a/framework/inc/uielement/popupmenucontroller.hxx b/framework/inc/uielement/popupmenucontroller.hxx
new file mode 100644
index 000000000000..ef44a4703ca2
--- /dev/null
+++ b/framework/inc/uielement/popupmenucontroller.hxx
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * 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 __FRAMEWORK_POPUPMENUCONTROLLER_HXX_
+#define __FRAMEWORK_POPUPMENUCONTROLLER_HXX_
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/frame/XPopupMenuController.hpp>
+
+#include "svtools/toolboxcontroller.hxx"
+#include "boost/scoped_ptr.hpp"
+
+#include <macros/xserviceinfo.hxx>
+
+class Window;
+
+namespace framework
+{
+class PopupMenuControllerImpl;
+
+class PopupMenuController : public svt::ToolboxController, public ::com::sun::star::lang::XServiceInfo
+{
+public:
+ PopupMenuController( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
+ ~PopupMenuController();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // XServiceInfo
+ DECLARE_XSERVICEINFO
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& Parent ) throw (::com::sun::star::uno::RuntimeException);
+
+ bool CreatePopupMenuController() throw (::com::sun::star::uno::Exception);
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XPopupMenuController > mxPopupMenuController;
+ ::com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu > mxPopupMenu;
+};
+
+} // namespace framework
+
+#endif // __FRAMEWORK_POPUPMENUCONTROLLER_HXX_
diff --git a/framework/inc/uielement/recentfilesmenucontroller.hxx b/framework/inc/uielement/recentfilesmenucontroller.hxx
index 40c3a55737c1..26a8e38dd49c 100644
--- a/framework/inc/uielement/recentfilesmenucontroller.hxx
+++ b/framework/inc/uielement/recentfilesmenucontroller.hxx
@@ -32,7 +32,7 @@
// my own includes
//_________________________________________________________________________________________________________________
-#include <helper/popupmenucontrollerbase.hxx>
+#include <macros/xserviceinfo.hxx>
#include <stdtypes.h>
//_________________________________________________________________________________________________________________
@@ -52,6 +52,7 @@
//_________________________________________________________________________________________________________________
// includes of other projects
//_________________________________________________________________________________________________________________
+#include <svtools/popupmenucontrollerbase.hxx>
#include <toolkit/awt/vclxmenu.hxx>
#include <cppuhelper/weak.hxx>
#include <rtl/ustring.hxx>
@@ -65,8 +66,10 @@ namespace framework
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
};
- class RecentFilesMenuController : public PopupMenuControllerBase
+ class RecentFilesMenuController : public svt::PopupMenuControllerBase
{
+ using svt::PopupMenuControllerBase::disposing;
+
public:
RecentFilesMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
virtual ~RecentFilesMenuController();
diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx
index 98894b623aea..5e780edb366b 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -58,7 +58,11 @@
#include <com/sun/star/frame/XToolbarController.hpp>
#include <com/sun/star/ui/ItemStyle.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
+//shizhoubo
+#include <com/sun/star/frame/XToolbarController.hpp>
+//end
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
@@ -67,6 +71,7 @@
#include <cppuhelper/interfacecontainer.hxx>
#include <vcl/toolbox.hxx>
+#include <vcl/accel.hxx>
namespace com
{
@@ -179,8 +184,13 @@ class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener
void RemoveControllers();
rtl::OUString RetrieveLabelFromCommand( const rtl::OUString& aCmdURL );
+ sal_Int32 RetrievePropertiesFromCommand( const rtl::OUString& aCmdURL );
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > GetPropsForCommand( const ::rtl::OUString& rCmdURL );
void CreateControllers();
void UpdateControllers();
+ //for update controller via Support Visiable by shizhoubo
+ void UpdateController( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XToolbarController > xController);
+ //end
void AddFrameActionListener();
void AddImageOrientationListener();
void UpdateImageOrientation();
@@ -194,6 +204,9 @@ class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener
void setToolBarImage(const Image& _aImage,const CommandToInfoMap::const_iterator& _pIter);
void impl_elementChanged(bool _bRemove,const ::com::sun::star::ui::ConfigurationEvent& Event );
+ static bool impl_RetrieveShortcutsFromConfiguration( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XAcceleratorConfiguration >& rAccelCfg, const rtl::OUString& rCommand, rtl::OUString& rShortCut );
+ bool RetrieveShortcut( const rtl::OUString& rCommandURL, rtl::OUString& rShortCut );
+
protected:
typedef ::std::hash_map< sal_uInt16, ::com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener > > ToolBarControllerMap;
typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XSubToolbarController > > SubToolBarControllerVector;
@@ -233,6 +246,10 @@ class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener
Timer m_aAsyncUpdateControllersTimer;
sal_Int16 m_nSymbolsStyle;
MenuDescriptionMap m_aMenuMap;
+ sal_Bool m_bAcceleratorCfg;
+ ::com::sun::star::uno::Reference< ::com::sun::star::ui::XAcceleratorConfiguration > m_xDocAcceleratorManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::ui::XAcceleratorConfiguration > m_xModuleAcceleratorManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::ui::XAcceleratorConfiguration > m_xGlobalAcceleratorManager;
};
}
diff --git a/framework/inc/uielement/toolbarsmenucontroller.hxx b/framework/inc/uielement/toolbarsmenucontroller.hxx
index dcb0b57182df..35f517d33e80 100644
--- a/framework/inc/uielement/toolbarsmenucontroller.hxx
+++ b/framework/inc/uielement/toolbarsmenucontroller.hxx
@@ -32,7 +32,7 @@
// my own includes
//_________________________________________________________________________________________________________________
-#include <helper/popupmenucontrollerbase.hxx>
+#include <macros/xserviceinfo.hxx>
#include <stdtypes.h>
//_________________________________________________________________________________________________________________
@@ -54,6 +54,7 @@
//_________________________________________________________________________________________________________________
// includes of other projects
//_________________________________________________________________________________________________________________
+#include <svtools/popupmenucontrollerbase.hxx>
#include <toolkit/awt/vclxmenu.hxx>
#include <cppuhelper/weak.hxx>
#include <rtl/ustring.hxx>
@@ -63,8 +64,10 @@
namespace framework
{
- class ToolbarsMenuController : public PopupMenuControllerBase
+ class ToolbarsMenuController : public svt::PopupMenuControllerBase
{
+ using svt::PopupMenuControllerBase::disposing;
+
public:
ToolbarsMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
virtual ~ToolbarsMenuController();
diff --git a/framework/inc/uielement/uicommanddescription.hxx b/framework/inc/uielement/uicommanddescription.hxx
index d9f8e461c5b5..dd95981bba90 100644
--- a/framework/inc/uielement/uicommanddescription.hxx
+++ b/framework/inc/uielement/uicommanddescription.hxx
@@ -109,7 +109,7 @@ public:
ModuleToCommandFileMap m_aModuleToCommandFileMap;
UICommandsHashMap m_aUICommandsHashMap;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xGenericUICommands;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > m_xModuleManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > m_xModuleManager;
};
} // namespace framework
diff --git a/framework/inc/uielement/uielementtypenames.hxx b/framework/inc/uielement/uielementtypenames.hxx
index fcd14c2f8bff..ca7815f90af7 100644
--- a/framework/inc/uielement/uielementtypenames.hxx
+++ b/framework/inc/uielement/uielementtypenames.hxx
@@ -7,5 +7,6 @@
#define UIELEMENTTYPE_STATUSBAR_NAME "statusbar"
#define UIELEMENTTYPE_FLOATINGWINDOW_NAME "floater"
#define UIELEMENTTYPE_PROGRESSBAR_NAME "progressbar"
+#define UIELEMENTTYPE_TOOLPANEL_NAME "toolpanel"
#endif // __FRAMEWORK_UIELEMENT_UIELEMENTTYPENAMES_HXX_
diff --git a/framework/inc/xml/toolboxlayoutdocumenthandler.hxx b/framework/inc/xml/toolboxlayoutdocumenthandler.hxx
deleted file mode 100644
index 1aba4d192b85..000000000000
--- a/framework/inc/xml/toolboxlayoutdocumenthandler.hxx
+++ /dev/null
@@ -1,59 +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 __FRAMEWORK_XML_TOOLBOXLAYOUTDOCUMENTHANDLER_HXX_
-#define __FRAMEWORK_XML_TOOLBOXLAYOUTDOCUMENTHANDLER_HXX_
-
-#include <framework/toolboxconfiguration.hxx>
-
-//_________________________________________________________________________________________________________________
-// interface includes
-//_________________________________________________________________________________________________________________
-
-#ifndef __COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP_
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-#endif
-
-//_________________________________________________________________________________________________________________
-// other includes
-//_________________________________________________________________________________________________________________
-#include <threadhelp/threadhelpbase.hxx>
-#include <rtl/ustring.hxx>
-#include <cppuhelper/weak.hxx>
-
-#include <hash_map>
-#include <stdtypes.h>
-
-//_________________________________________________________________________________________________________________
-// namespace
-//_________________________________________________________________________________________________________________
-
-namespace framework{
-
-} // namespace framework
-
-#endif
diff --git a/framework/prj/d.lst b/framework/prj/d.lst
index cffe72a703d6..123234eeffb7 100644
--- a/framework/prj/d.lst
+++ b/framework/prj/d.lst
@@ -5,8 +5,6 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\modules
mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\StartModule
mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\menubar
mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\toolbar
-mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\accelerator
-mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\accelerator\en-US
mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\statusbar
..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin%_EXT%\hid\*.hid
@@ -32,7 +30,6 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\statusbar
..\uiconfig\startmodule\menubar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\menubar\*.xml
..\uiconfig\startmodule\toolbar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\toolbar\*.xml
-..\uiconfig\startmodule\accelerator\en-US\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\accelerator\en-US\*.xml
..\uiconfig\startmodule\statusbar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\statusbar\*.xml
..\source\unotypes\fw?.xml %_DEST%\xml%_EXT%\*.xml
diff --git a/framework/qa/unoapi/Test.java b/framework/qa/unoapi/Test.java
new file mode 100644
index 000000000000..da9bb3bd5020
--- /dev/null
+++ b/framework/qa/unoapi/Test.java
@@ -0,0 +1,51 @@
+/*************************************************************************
+* 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.
+************************************************************************/
+
+package org.openoffice.framework.qa.unoapi;
+
+import org.openoffice.Runner;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+public final class Test {
+ @org.junit.Before public void setUp() throws Exception {
+ connection.setUp();
+ }
+
+ @org.junit.After public void tearDown()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ connection.tearDown();
+ }
+
+ @org.junit.Test public void test() {
+ assertTrue(
+ Runner.run(
+ "-sce", "framework.sce", "-xcl", "knownissues.xcl", "-tdoc",
+ "testdocuments", "-cs", connection.getDescription()));
+ }
+
+ private final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/framework/qa/unoapi/knownissues.xcl b/framework/qa/unoapi/knownissues.xcl
index f939efcca412..40f1965de639 100755
--- a/framework/qa/unoapi/knownissues.xcl
+++ b/framework/qa/unoapi/knownissues.xcl
@@ -54,3 +54,6 @@ fwk.Frame
### i90345 ###
fwk.URLTransformer::com::sun::star::util::XURLTransformer
+
+### i111180 ###
+fwk.Desktop::com::sun::star::frame::XComponentLoader
diff --git a/framework/qa/unoapi/makefile.mk b/framework/qa/unoapi/makefile.mk
index 0be0e52a17c2..38a6cf7cced8 100755
--- a/framework/qa/unoapi/makefile.mk
+++ b/framework/qa/unoapi/makefile.mk
@@ -1,7 +1,6 @@
#*************************************************************************
-#
# 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
@@ -22,22 +21,28 @@
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
+#***********************************************************************/
-PRJ=..$/..
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-PRJNAME=framework
-TARGET=qa_unoapi
+PRJ = ../..
+PRJNAME = framework
+TARGET = qa_unoapi
-.INCLUDE: settings.mk
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/framework/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-ALLTAR : UNOAPI_TEST
+ALLTAR : javatest
-UNOAPI_TEST:
- +$(SOLARENV)$/bin$/checkapi -sce framework.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments -THRCNT 1 -AutoRestart true
- @echo =======================================================================
- @echo In case you noticed a failures of fwk.JobExecutor or fwk.JobHandler make sure that you registered $(SOLARSRC)$/qadevOOo$/testdocs$/qadevlibs$/JobExecutor.jar
- @echo =======================================================================
+.END
diff --git a/framework/source/classes/menumanager.cxx b/framework/source/classes/menumanager.cxx
index 3979d72b1e62..493ac9dfb4a1 100644
--- a/framework/source/classes/menumanager.cxx
+++ b/framework/source/classes/menumanager.cxx
@@ -357,6 +357,7 @@ MenuManager::MenuManager(
SetHdl();
}
+#if 0
// #110897#
MenuManager::MenuManager(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
@@ -413,6 +414,7 @@ MenuManager::MenuManager(
SetHdl();
}
+#endif
void MenuManager::SetHdl()
{
diff --git a/framework/source/classes/resource.src b/framework/source/classes/resource.src
index 0f45e683654f..2f8e1bdf2f16 100644
--- a/framework/source/classes/resource.src
+++ b/framework/source/classes/resource.src
@@ -124,7 +124,7 @@ String STR_TOOLBAR_TITLE_ADDON
String STR_STATUSBAR_LOGOTEXT
{
- Text [ en-US ] = "A %PRODUCTNAME product by Sun Microsystems, Inc.";
+ Text [ en-US ] = "A %PRODUCTNAME product by Oracle";
};
// ***********************************************************************
@@ -327,6 +327,11 @@ String STR_LANGSTATUS_NONE
Text [ en-US ] = "None (Do not check spelling)" ;
Text [ x-comment ] = " ";
};
+String STR_RESET_TO_DEFAULT_LANGUAGE
+{
+ Text [ en-US ] = "Reset to Default Language" ;
+ Text [ x-comment ] = " ";
+};
String STR_LANGSTATUS_MORE
{
Text [ en-US ] = "More..." ;
diff --git a/framework/source/constant/filter.cxx b/framework/source/constant/filter.cxx
deleted file mode 100644
index 57d94d772e6d..000000000000
--- a/framework/source/constant/filter.cxx
+++ /dev/null
@@ -1,119 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_framework.hxx"
-
-#ifndef __FRAMEWORK_CONSTANT_FILTER_HXX_
-#include <constant/filter.hxx>
-#endif
-
-namespace framework{
- namespace constant{
-
-const ::rtl::OUString Filter::PROP_NAME = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name" ));
-const ::rtl::OUString Filter::PROP_TYPE = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Type" ));
-const ::rtl::OUString Filter::PROP_DOCUMENTSERVICE = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentService"));
-const ::rtl::OUString Filter::PROP_FILTERSERVICE = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterService" ));
-const ::rtl::OUString Filter::PROP_UICOMPONENT = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIComponent" ));
-const ::rtl::OUString Filter::PROP_FLAGS = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Flags" ));
-const ::rtl::OUString Filter::PROP_USERDATA = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UserData" ));
-const ::rtl::OUString Filter::PROP_TEMPLATENAME = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TemplateName" ));
-
-const ::rtl::OUString Filter::QUERY_GET_DEFAULT_FILTER_FOR_TYPE = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("getDefaultFilterForType"));
-const ::rtl::OUString Filter::QUERY_ALL = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_query_all" ));
-const ::rtl::OUString Filter::QUERY_WRITER = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_query_writer" ));
-const ::rtl::OUString Filter::QUERY_WEB = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_query_web" ));
-const ::rtl::OUString Filter::QUERY_GLOBAL = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_query_global" ));
-const ::rtl::OUString Filter::QUERY_CHART = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_query_chart" ));
-const ::rtl::OUString Filter::QUERY_CALC = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_query_calc" ));
-const ::rtl::OUString Filter::QUERY_IMPRESS = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_query_impress" ));
-const ::rtl::OUString Filter::QUERY_DRAW = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_query_draw" ));
-const ::rtl::OUString Filter::QUERY_MATH = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_query_math" ));
-
-const ::rtl::OUString Filter::QUERYPARAM_IFLAGS = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("iflags" ));
-const ::rtl::OUString Filter::QUERYPARAM_EFLAGS = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("eflags" ));
-const ::rtl::OUString Filter::QUERYPARAM_SORT_PROP = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sort_prop" ));
-const ::rtl::OUString Filter::QUERYPARAM_DESCENDING = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("descending" ));
-const ::rtl::OUString Filter::QUERYPARAM_USE_ORDER = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("use_order" ));
-const ::rtl::OUString Filter::QUERYPARAM_DEFAULT_FIRST = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("default_first" ));
-const ::rtl::OUString Filter::QUERYPARAM_CASE_SENSITIVE = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("case_sensitive"));
-const ::rtl::OUString Filter::QUERYPARAMVALUE_SORT_PROP_NAME = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name" ));
-const ::rtl::OUString Filter::QUERYPARAMVALUE_SORT_PROP_UINAME = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("uiname" ));
-
-const ::rtl::OUString Filter::FLAGNAME_IMPORT = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Import" ));
-const ::rtl::OUString Filter::FLAGNAME_EXPORT = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Export" ));
-const ::rtl::OUString Filter::FLAGNAME_TEMPLATE = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Template" ));
-const ::rtl::OUString Filter::FLAGNAME_INTERNAL = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Internal" ));
-const ::rtl::OUString Filter::FLAGNAME_TEMPLATEPATH = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TemplatePath" ));
-const ::rtl::OUString Filter::FLAGNAME_OWN = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Own" ));
-const ::rtl::OUString Filter::FLAGNAME_ALIEN = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Alien" ));
-const ::rtl::OUString Filter::FLAGNAME_USESOPTIONS = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UsesOptions" ));
-const ::rtl::OUString Filter::FLAGNAME_DEFAULT = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Default" ));
-const ::rtl::OUString Filter::FLAGNAME_EXECUTABLE = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Executable" ));
-const ::rtl::OUString Filter::FLAGNAME_SUPPORTSSELECTION = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SupportsSelection"));
-const ::rtl::OUString Filter::FLAGNAME_MAPTOAPPPLUG = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MapToAppPlug" ));
-const ::rtl::OUString Filter::FLAGNAME_NOTINFILEDIALOG = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NotInFileDialog" ));
-const ::rtl::OUString Filter::FLAGNAME_NOTINCHOOSER = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NotInChooser" ));
-const ::rtl::OUString Filter::FLAGNAME_ASYNCHRON = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Asynchron" ));
-const ::rtl::OUString Filter::FLAGNAME_CREATOR = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Creator" ));
-const ::rtl::OUString Filter::FLAGNAME_READONLY = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Readonly" ));
-const ::rtl::OUString Filter::FLAGNAME_NOTINSTALLED = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NotInstalled" ));
-const ::rtl::OUString Filter::FLAGNAME_CONSULTSERVICE = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ConsultService" ));
-const ::rtl::OUString Filter::FLAGNAME_3RDPARTYFILTER = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("3rdPartyFilter" ));
-const ::rtl::OUString Filter::FLAGNAME_PACKED = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Packed" ));
-const ::rtl::OUString Filter::FLAGNAME_SILENTEXPORT = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SilentExport" ));
-const ::rtl::OUString Filter::FLAGNAME_BROWSERPREFERED = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BrowserPrefered" ));
-const ::rtl::OUString Filter::FLAGNAME_PREFERED = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Prefered" ));
-
-const sal_Int32 Filter::FLAGVALUE_IMPORT = 0x00000001L; // 1
-const sal_Int32 Filter::FLAGVALUE_EXPORT = 0x00000002L; // 2
-const sal_Int32 Filter::FLAGVALUE_TEMPLATE = 0x00000004L; // 4
-const sal_Int32 Filter::FLAGVALUE_INTERNAL = 0x00000008L; // 8
-const sal_Int32 Filter::FLAGVALUE_TEMPLATEPATH = 0x00000010L; // 16
-const sal_Int32 Filter::FLAGVALUE_OWN = 0x00000020L; // 32
-const sal_Int32 Filter::FLAGVALUE_ALIEN = 0x00000040L; // 64
-const sal_Int32 Filter::FLAGVALUE_USESOPTIONS = 0x00000080L; // 128
-const sal_Int32 Filter::FLAGVALUE_DEFAULT = 0x00000100L; // 256
-const sal_Int32 Filter::FLAGVALUE_EXECUTABLE = 0x00000200L; // 512
-const sal_Int32 Filter::FLAGVALUE_SUPPORTSSELECTION = 0x00000400L; // 1024
-const sal_Int32 Filter::FLAGVALUE_MAPTOAPPPLUG = 0x00000800L; // 2048
-const sal_Int32 Filter::FLAGVALUE_NOTINFILEDIALOG = 0x00001000L; // 4096
-const sal_Int32 Filter::FLAGVALUE_NOTINCHOOSER = 0x00002000L; // 8192
-const sal_Int32 Filter::FLAGVALUE_ASYNCHRON = 0x00004000L; // 16384
-const sal_Int32 Filter::FLAGVALUE_CREATOR = 0x00008000L; // 32768
-const sal_Int32 Filter::FLAGVALUE_READONLY = 0x00010000L; // 65536
-const sal_Int32 Filter::FLAGVALUE_NOTINSTALLED = 0x00020000L; // 131072
-const sal_Int32 Filter::FLAGVALUE_CONSULTSERVICE = 0x00040000L; // 262144
-const sal_Int32 Filter::FLAGVALUE_3RDPARTYFILTER = 0x00080000L; // 524288
-const sal_Int32 Filter::FLAGVALUE_PACKED = 0x00100000L; // 1048576
-const sal_Int32 Filter::FLAGVALUE_SILENTEXPORT = 0x00200000L; // 2097152
-const sal_Int32 Filter::FLAGVALUE_BROWSERPREFERED = 0x00400000L; // 4194304
-const sal_Int32 Filter::FLAGVALUE_PREFERED = 0x10000000L; // 268435456
-
- } // namespace constant
-} // namespace framework
diff --git a/framework/source/constant/makefile.mk b/framework/source/constant/makefile.mk
index 1c050db57dca..05fc28870d0a 100644
--- a/framework/source/constant/makefile.mk
+++ b/framework/source/constant/makefile.mk
@@ -35,8 +35,7 @@ ENABLE_EXCEPTIONS= TRUE
# --- Generate -----------------------------------------------------
-SLOFILES= $(SLO)$/filter.obj \
- $(SLO)$/frameloader.obj \
+SLOFILES= $(SLO)$/frameloader.obj \
$(SLO)$/contenthandler.obj \
$(SLO)$/containerquery.obj
diff --git a/framework/source/fwe/classes/sfxhelperfunctions.cxx b/framework/source/fwe/classes/sfxhelperfunctions.cxx
index a6171f4219b6..ba3db729817d 100644
--- a/framework/source/fwe/classes/sfxhelperfunctions.cxx
+++ b/framework/source/fwe/classes/sfxhelperfunctions.cxx
@@ -30,11 +30,14 @@
#include <framework/sfxhelperfunctions.hxx>
+#include <tools/diagnose_ex.h>
+
static pfunc_setToolBoxControllerCreator pToolBoxControllerCreator = NULL;
static pfunc_setStatusBarControllerCreator pStatusBarControllerCreator = NULL;
static pfunc_getRefreshToolbars pRefreshToolbars = NULL;
static pfunc_createDockingWindow pCreateDockingWindow = NULL;
static pfunc_isDockingWindowVisible pIsDockingWindowVisible = NULL;
+static pfunc_activateToolPanel pActivateToolPanel = NULL;
@@ -153,4 +156,24 @@ bool SAL_CALL IsDockingWindowVisible( const ::com::sun::star::uno::Reference< ::
return false;
}
+pfunc_activateToolPanel SAL_CALL SetActivateToolPanel( pfunc_activateToolPanel i_pActivator )
+{
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ pfunc_activateToolPanel pOldFunc = pActivateToolPanel;
+ pActivateToolPanel = i_pActivator;
+ return pOldFunc;
+}
+
+void SAL_CALL ActivateToolPanel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, const ::rtl::OUString& i_rPanelURL )
+{
+ pfunc_activateToolPanel pActivator = NULL;
+ {
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ pActivator = pActivateToolPanel;
+ }
+
+ ENSURE_OR_RETURN_VOID( pActivator, "framework::ActivateToolPanel: no activator function!" );
+ (*pActivator)( i_rFrame, i_rPanelURL );
+}
+
}
diff --git a/framework/source/fwe/helper/imageproducer.cxx b/framework/source/fwe/helper/imageproducer.cxx
index 97ad3063fb3c..eae77637187c 100644
--- a/framework/source/fwe/helper/imageproducer.cxx
+++ b/framework/source/fwe/helper/imageproducer.cxx
@@ -44,7 +44,7 @@ pfunc_getImage SAL_CALL SetImageProducer( pfunc_getImage pNewGetImageFunc )
}
-Image SAL_CALL GetImageFromURL( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, BOOL bBig, BOOL bHiContrast )
+Image SAL_CALL GetImageFromURL( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, BOOL bBig, BOOL bHiContrast )
{
if ( _pGetImageFunc )
return _pGetImageFunc( rFrame, aURL, bBig, bHiContrast );
diff --git a/framework/source/fwe/helper/uiconfigelementwrapperbase.cxx b/framework/source/fwe/helper/uiconfigelementwrapperbase.cxx
index 1ddda0eb0f4d..030ec5bf8cf6 100644
--- a/framework/source/fwe/helper/uiconfigelementwrapperbase.cxx
+++ b/framework/source/fwe/helper/uiconfigelementwrapperbase.cxx
@@ -45,7 +45,6 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/ui/XUIConfiguration.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
//_________________________________________________________________________________________________________________
// includes of other projects
@@ -550,4 +549,23 @@ Reference< XIndexAccess > SAL_CALL UIConfigElementWrapperBase::getSettings( sal_
return m_xConfigData;
}
+Reference< XFrame > SAL_CALL UIConfigElementWrapperBase::getFrame() throw (RuntimeException)
+{
+ ResetableGuard aLock( m_aLock );
+ Reference< XFrame > xFrame( m_xWeakFrame );
+ return xFrame;
+}
+
+::rtl::OUString SAL_CALL UIConfigElementWrapperBase::getResourceURL() throw (RuntimeException)
+{
+ ResetableGuard aLock( m_aLock );
+ return m_aResourceURL;
+}
+
+::sal_Int16 SAL_CALL UIConfigElementWrapperBase::getType() throw (RuntimeException)
+{
+ ResetableGuard aLock( m_aLock );
+ return m_nType;
+}
+
}
diff --git a/framework/source/fwe/helper/uielementwrapperbase.cxx b/framework/source/fwe/helper/uielementwrapperbase.cxx
index 85bb1cdb1e60..6329f94b3063 100644
--- a/framework/source/fwe/helper/uielementwrapperbase.cxx
+++ b/framework/source/fwe/helper/uielementwrapperbase.cxx
@@ -151,6 +151,23 @@ throw ( Exception, RuntimeException )
}
}
+// XUIElement
+::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SAL_CALL UIElementWrapperBase::getFrame() throw (::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame( m_xWeakFrame );
+ return xFrame;
+}
+
+::rtl::OUString SAL_CALL UIElementWrapperBase::getResourceURL() throw (::com::sun::star::uno::RuntimeException)
+{
+ return m_aResourceURL;
+}
+
+::sal_Int16 SAL_CALL UIElementWrapperBase::getType() throw (::com::sun::star::uno::RuntimeException)
+{
+ return m_nType;
+}
+
// XUpdatable
void SAL_CALL UIElementWrapperBase::update() throw (::com::sun::star::uno::RuntimeException)
{
diff --git a/framework/source/fwe/xml/menudocumenthandler.cxx b/framework/source/fwe/xml/menudocumenthandler.cxx
index b3decdde9859..c5d5e84cf609 100644
--- a/framework/source/fwe/xml/menudocumenthandler.cxx
+++ b/framework/source/fwe/xml/menudocumenthandler.cxx
@@ -94,6 +94,7 @@
#define ATTRIBUTE_ITEMSTYLE_TEXT "text"
#define ATTRIBUTE_ITEMSTYLE_IMAGE "image"
+#define ATTRIBUTE_ITEMSTYLE_RADIO "radio"
// Property names of a menu/menu item ItemDescriptor
static const char ITEM_DESCRIPTOR_COMMANDURL[] = "CommandURL";
@@ -134,6 +135,7 @@ struct MenuStyleItem
MenuStyleItem MenuItemStyles[ ] = {
{ ::com::sun::star::ui::ItemStyle::ICON, ATTRIBUTE_ITEMSTYLE_IMAGE },
{ ::com::sun::star::ui::ItemStyle::TEXT, ATTRIBUTE_ITEMSTYLE_TEXT },
+ { ::com::sun::star::ui::ItemStyle::RADIO_CHECK, ATTRIBUTE_ITEMSTYLE_RADIO }
};
@@ -437,8 +439,10 @@ throw( SAXException, RuntimeException )
{
if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_TEXT ) ) )
nItemBits |= ::com::sun::star::ui::ItemStyle::TEXT;
- if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) )
+ else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) )
nItemBits |= ::com::sun::star::ui::ItemStyle::ICON;
+ else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_RADIO ) ) )
+ nItemBits |= ::com::sun::star::ui::ItemStyle::RADIO_CHECK;
}
}
while ( nIndex >= 0 );
@@ -670,8 +674,10 @@ throw( SAXException, RuntimeException )
{
if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_TEXT ) ) )
nItemBits |= ::com::sun::star::ui::ItemStyle::TEXT;
- if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) )
+ else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) )
nItemBits |= ::com::sun::star::ui::ItemStyle::ICON;
+ else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_RADIO ) ) )
+ nItemBits |= ::com::sun::star::ui::ItemStyle::RADIO_CHECK;
}
}
while ( nIndex >= 0 );
@@ -725,8 +731,10 @@ throw( SAXException, RuntimeException )
{
if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_TEXT ) ) )
nItemBits |= ::com::sun::star::ui::ItemStyle::TEXT;
- if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) )
+ else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) )
nItemBits |= ::com::sun::star::ui::ItemStyle::ICON;
+ else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_RADIO ) ) )
+ nItemBits |= ::com::sun::star::ui::ItemStyle::RADIO_CHECK;
}
}
while ( nIndex >= 0 );
diff --git a/framework/source/fwe/xml/toolboxconfiguration.cxx b/framework/source/fwe/xml/toolboxconfiguration.cxx
index 00ef4111ad55..994354a7e1a8 100644
--- a/framework/source/fwe/xml/toolboxconfiguration.cxx
+++ b/framework/source/fwe/xml/toolboxconfiguration.cxx
@@ -30,7 +30,6 @@
#include "precompiled_framework.hxx"
#include <framework/toolboxconfiguration.hxx>
#include <xml/toolboxdocumenthandler.hxx>
-#include <xml/toolboxlayoutdocumenthandler.hxx>
#include <xml/saxnamespacefilter.hxx>
#include <services.h>
diff --git a/framework/source/fwi/helper/mischelper.cxx b/framework/source/fwi/helper/mischelper.cxx
index edf69523e873..deb5aa023c1b 100644
--- a/framework/source/fwi/helper/mischelper.cxx
+++ b/framework/source/fwi/helper/mischelper.cxx
@@ -29,10 +29,15 @@
#include "precompiled_framework.hxx"
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/document/XDocumentLanguages.hpp>
#include <com/sun/star/frame/XModuleManager.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <tools/debug.hxx>
+#include <vcl/settings.hxx>
+#include <vcl/svapp.hxx>
+#include <i18npool/mslangid.hxx>
+#include <svtools/langtab.hxx>
#include <comphelper/processfactory.hxx>
#include <helper/mischelper.hxx>
#include <services.h>
@@ -45,6 +50,9 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
+using ::rtl::OUString;
+
+
namespace framework
{
@@ -68,20 +76,23 @@ uno::Reference< linguistic2::XLanguageGuessing > LanguageGuessingHelper::GetGues
return m_xLanguageGuesser;
}
-::rtl::OUString RetrieveLabelFromCommand( const ::rtl::OUString& aCmdURL
- ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xServiceFactory
- ,::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _xUICommandLabels
- ,const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _xFrame
- ,::rtl::OUString& _rModuleIdentifier
- ,sal_Bool& _rIni
- ,const sal_Char* _pName)
+////////////////////////////////////////////////////////////
+
+::rtl::OUString RetrieveLabelFromCommand(
+ const ::rtl::OUString& aCmdURL,
+ const uno::Reference< lang::XMultiServiceFactory >& _xServiceFactory,
+ uno::Reference< container::XNameAccess >& _xUICommandLabels,
+ const uno::Reference< frame::XFrame >& _xFrame,
+ ::rtl::OUString& _rModuleIdentifier,
+ sal_Bool& _rIni,
+ const sal_Char* _pName)
{
::rtl::OUString aLabel;
// Retrieve popup menu labels
if ( !_xUICommandLabels.is() )
{
- try
+ try
{
if ( !_rIni )
{
@@ -137,5 +148,92 @@ uno::Reference< linguistic2::XLanguageGuessing > LanguageGuessingHelper::GetGues
return aLabel;
}
+
+////////////////////////////////////////////////////////////
+
+void FillLangItems( std::set< OUString > &rLangItems,
+ const SvtLanguageTable & rLanguageTable,
+ const uno::Reference< frame::XFrame > & rxFrame,
+ const LanguageGuessingHelper & rLangGuessHelper,
+ sal_Int16 nScriptType,
+ const OUString & rCurLang,
+ const OUString & rKeyboardLang,
+ const OUString & rGuessedTextLang )
+{
+ rLangItems.clear();
+
+ //1--add current language
+ if( rCurLang != OUString() &&
+ LANGUAGE_DONTKNOW != rLanguageTable.GetType( rCurLang ))
+ rLangItems.insert( rCurLang );
+
+ //2--System
+ const AllSettings& rAllSettings = Application::GetSettings();
+ LanguageType rSystemLanguage = rAllSettings.GetLanguage();
+ if( rSystemLanguage != LANGUAGE_DONTKNOW )
+ {
+ if ( IsScriptTypeMatchingToLanguage( nScriptType, rSystemLanguage ))
+ rLangItems.insert( OUString( rLanguageTable.GetString( rSystemLanguage )) );
+ }
+
+ //3--UI
+ LanguageType rUILanguage = rAllSettings.GetUILanguage();
+ if( rUILanguage != LANGUAGE_DONTKNOW )
+ {
+ if ( IsScriptTypeMatchingToLanguage( nScriptType, rUILanguage ))
+ rLangItems.insert( OUString( rLanguageTable.GetString( rUILanguage )) );
+ }
+
+ //4--guessed language
+ uno::Reference< linguistic2::XLanguageGuessing > xLangGuesser( rLangGuessHelper.GetGuesser() );
+ if ( xLangGuesser.is() && rGuessedTextLang.getLength() > 0)
+ {
+ ::com::sun::star::lang::Locale aLocale(xLangGuesser->guessPrimaryLanguage( rGuessedTextLang, 0, rGuessedTextLang.getLength()) );
+ LanguageType nLang = MsLangId::convertLocaleToLanguageWithFallback( aLocale );
+ if (nLang != LANGUAGE_DONTKNOW && nLang != LANGUAGE_NONE && nLang != LANGUAGE_SYSTEM
+ && IsScriptTypeMatchingToLanguage( nScriptType, nLang ))
+ rLangItems.insert( rLanguageTable.GetString( nLang ));
+ }
+
+ //5--keyboard language
+ if( rKeyboardLang != OUString())
+ {
+ if ( IsScriptTypeMatchingToLanguage( nScriptType, rLanguageTable.GetType( rKeyboardLang )))
+ rLangItems.insert( rKeyboardLang );
+ }
+
+ //6--all languages used in current document
+ Reference< com::sun::star::frame::XModel > xModel;
+ if ( rxFrame.is() )
+ {
+ Reference< com::sun::star::frame::XController > xController( rxFrame->getController(), UNO_QUERY );
+ if ( xController.is() )
+ xModel = xController->getModel();
+ }
+ Reference< document::XDocumentLanguages > xDocumentLanguages( xModel, UNO_QUERY );
+ /*the description of nScriptType
+ LATIN : 0x001
+ ASIAN : 0x002
+ COMPLEX: 0x004
+ */
+ const sal_Int16 nMaxCount = 7;
+ if ( xDocumentLanguages.is() )
+ {
+ Sequence< Locale > rLocales( xDocumentLanguages->getDocumentLanguages( nScriptType, nMaxCount ));
+ if ( rLocales.getLength() > 0 )
+ {
+ for ( USHORT i = 0; i < rLocales.getLength(); ++i )
+ {
+ if ( rLangItems.size() == static_cast< size_t >(nMaxCount) )
+ break;
+ const Locale& rLocale=rLocales[i];
+ if( IsScriptTypeMatchingToLanguage( nScriptType, rLanguageTable.GetType( rLocale.Language )))
+ rLangItems.insert( OUString( rLocale.Language ) );
+ }
+ }
+ }
+}
+
} // namespace framework
+
diff --git a/framework/source/fwi/helper/popupmenucontrollerbase.cxx b/framework/source/fwi/helper/popupmenucontrollerbase.cxx
deleted file mode 100644
index cc5d388de9a8..000000000000
--- a/framework/source/fwi/helper/popupmenucontrollerbase.cxx
+++ /dev/null
@@ -1,429 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_framework.hxx"
-#include <helper/popupmenucontrollerbase.hxx>
-
-//_________________________________________________________________________________________________________________
-// my own includes
-//_________________________________________________________________________________________________________________
-#include <threadhelp/resetableguard.hxx>
-#include "services.h"
-
-//_________________________________________________________________________________________________________________
-// interface includes
-//_________________________________________________________________________________________________________________
-#include <com/sun/star/awt/XDevice.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/awt/MenuItemStyle.hpp>
-#include <com/sun/star/frame/XDispatchProvider.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-
-//_________________________________________________________________________________________________________________
-// includes of other projects
-//_________________________________________________________________________________________________________________
-
-#ifndef _VCL_MENU_HXX_
-#include <vcl/menu.hxx>
-#endif
-#include <vcl/svapp.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <rtl/logfile.hxx>
-//_________________________________________________________________________________________________________________
-// Defines
-//_________________________________________________________________________________________________________________
-//
-
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::frame;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::util;
-
-namespace framework
-{
-
-//*****************************************************************************************************************
-// XInterface, XTypeProvider, XServiceInfo
-//*****************************************************************************************************************
-DEFINE_XINTERFACE_11 ( PopupMenuControllerBase ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XServiceInfo ),
- DIRECT_INTERFACE( ::com::sun::star::frame::XPopupMenuController ),
- DIRECT_INTERFACE( css::lang::XInitialization ),
- DIRECT_INTERFACE( css::frame::XStatusListener ),
- DIRECT_INTERFACE( css::awt::XMenuListener ),
- DIRECT_INTERFACE( css::frame::XDispatchProvider ),
- DIRECT_INTERFACE( css::frame::XDispatch ),
- DIRECT_INTERFACE( css::lang::XComponent ),
- DERIVED_INTERFACE( css::lang::XEventListener, css::frame::XStatusListener ),
- DERIVED_INTERFACE( css::lang::XEventListener, css::awt::XMenuListener )
- )
-
-DEFINE_XTYPEPROVIDER_10 ( PopupMenuControllerBase ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- ::com::sun::star::frame::XPopupMenuController ,
- css::lang::XInitialization ,
- css::frame::XStatusListener ,
- css::awt::XMenuListener ,
- css::lang::XEventListener ,
- css::frame::XDispatchProvider ,
- css::frame::XDispatch ,
- css::lang::XComponent
- )
-
-PopupMenuControllerBase::PopupMenuControllerBase( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
- ThreadHelpBase(),
- ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType >( m_aLock.getShareableOslMutex() ),
- m_bInitialized( false ),
- m_bDisposed( false ),
- m_xServiceManager( xServiceManager ),
- m_aListenerContainer( m_aLock.getShareableOslMutex() )
-{
- if ( m_xServiceManager.is() )
- m_xURLTransformer.set( m_xServiceManager->createInstance(
- SERVICENAME_URLTRANSFORMER),
- UNO_QUERY );
-}
-
-PopupMenuControllerBase::~PopupMenuControllerBase()
-{
-}
-
-// protected function
-void PopupMenuControllerBase::resetPopupMenu( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu )
-{
- VCLXPopupMenu* pPopupMenu = 0;
- if ( rPopupMenu.is() && rPopupMenu->getItemCount() > 0 )
- {
- pPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( rPopupMenu );
- if ( pPopupMenu )
- {
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
-
- PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu();
- pVCLPopupMenu->Clear();
- }
- }
-}
-
-void SAL_CALL PopupMenuControllerBase::dispose()
-throw (::com::sun::star::uno::RuntimeException)
-{
- css::uno::Reference< css::lang::XComponent > xThis( static_cast< ::cppu::OWeakObject* >(this), UNO_QUERY );
-
- // Send message to all listener and forget their references.
- css::lang::EventObject aEvent( xThis );
- m_aListenerContainer.disposeAndClear( aEvent );
-
- // Reset our members and set disposed flag
- ResetableGuard aLock( m_aLock );
- m_xFrame.clear();
- m_xDispatch.clear();
- m_xPopupMenu.clear();
- m_xServiceManager.clear();
- m_bDisposed = true;
-}
-
-void SAL_CALL PopupMenuControllerBase::addEventListener(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener )
-throw (::com::sun::star::uno::RuntimeException)
-{
- m_aListenerContainer.addInterface( ::getCppuType( (const css::uno::Reference< css::lang::XEventListener >*)NULL ), xListener );
-}
-
-void SAL_CALL PopupMenuControllerBase::removeEventListener(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener )
-throw (::com::sun::star::uno::RuntimeException)
-{
- m_aListenerContainer.removeInterface( ::getCppuType( (const css::uno::Reference< css::lang::XEventListener >*)NULL ), xListener );
-}
-
-// XEventListener
-void SAL_CALL PopupMenuControllerBase::disposing( const EventObject& ) throw ( RuntimeException )
-{
- ResetableGuard aLock( m_aLock );
- m_xFrame.clear();
- m_xDispatch.clear();
- m_xPopupMenu.clear();
-}
-
-// XMenuListener
-void SAL_CALL PopupMenuControllerBase::highlight( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
-void PopupMenuControllerBase::impl_select(const Reference< XDispatch >& _xDispatch,const ::com::sun::star::util::URL& aURL)
-{
- Sequence<PropertyValue> aArgs;
- OSL_ENSURE(_xDispatch.is(),"PopupMenuControllerBase::impl_select: No dispatch");
- if ( _xDispatch.is() )
- _xDispatch->dispatch( aURL, aArgs );
-}
-
-void SAL_CALL PopupMenuControllerBase::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
-{
- Reference< css::awt::XPopupMenu > xPopupMenu;
- Reference< XDispatch > xDispatch;
- Reference< XMultiServiceFactory > xServiceManager;
-
- if ( m_bDisposed )
- throw DisposedException();
-
- ResetableGuard aLock( m_aLock );
- xPopupMenu = m_xPopupMenu;
- xDispatch = m_xDispatch;
- xServiceManager = m_xServiceManager;
- aLock.unlock();
-
- if ( xPopupMenu.is() )
- {
- VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( xPopupMenu );
- if ( pPopupMenu )
- {
- css::util::URL aTargetURL;
- {
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
- PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu();
- aTargetURL.Complete = pVCLPopupMenu->GetItemCommand( rEvent.MenuId );
- }
-
- m_xURLTransformer->parseStrict( aTargetURL );
- impl_select(xDispatch,aTargetURL);
- }
- }
-}
-
-void SAL_CALL PopupMenuControllerBase::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
-void SAL_CALL PopupMenuControllerBase::deactivate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
-void SAL_CALL PopupMenuControllerBase::updatePopupMenu() throw ( ::com::sun::star::uno::RuntimeException )
-{
- ResetableGuard aLock( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- Reference< XStatusListener > xStatusListener( static_cast< OWeakObject* >( this ), UNO_QUERY );
- Reference< XDispatch > xDispatch( m_xDispatch );
- com::sun::star::util::URL aTargetURL;
- aTargetURL.Complete = m_aCommandURL;
- m_xURLTransformer->parseStrict( aTargetURL );
- aLock.unlock();
-
- // Add/remove status listener to get a status update once
- if ( xDispatch.is() )
- {
- xDispatch->addStatusListener( xStatusListener, aTargetURL );
- xDispatch->removeStatusListener( xStatusListener, aTargetURL );
- }
-}
-
-// XDispatchProvider
-Reference< XDispatch > SAL_CALL
-PopupMenuControllerBase::queryDispatch(
- const URL& /*aURL*/,
- const rtl::OUString& /*sTarget*/,
- sal_Int32 /*nFlags*/ )
-throw( RuntimeException )
-{
- // must be implemented by subclass
- ResetableGuard aLock( m_aLock );
- if ( m_bDisposed )
- throw DisposedException();
-
- return Reference< XDispatch >();
-}
-
-Sequence< Reference< XDispatch > > SAL_CALL PopupMenuControllerBase::queryDispatches( const Sequence< DispatchDescriptor >& lDescriptor ) throw( RuntimeException )
-{
- // Create return list - which must have same size then the given descriptor
- // It's not allowed to pack it!
- ResetableGuard aLock( m_aLock );
- if ( m_bDisposed )
- throw DisposedException();
- aLock.unlock();
-
- sal_Int32 nCount = lDescriptor.getLength();
- css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > lDispatcher( nCount );
-
- // Step over all descriptors and try to get any dispatcher for it.
- for( sal_Int32 i=0; i<nCount; ++i )
- {
- lDispatcher[i] = queryDispatch( lDescriptor[i].FeatureURL ,
- lDescriptor[i].FrameName ,
- lDescriptor[i].SearchFlags );
- }
-
- return lDispatcher;
-}
-
-// XDispatch
-void SAL_CALL
-PopupMenuControllerBase::dispatch(
- const URL& /*aURL*/,
- const Sequence< PropertyValue >& /*seqProperties*/ )
-throw( ::com::sun::star::uno::RuntimeException )
-{
- // must be implemented by subclass
- ResetableGuard aLock( m_aLock );
- if ( m_bDisposed )
- throw DisposedException();
-}
-
-void SAL_CALL
-PopupMenuControllerBase::addStatusListener(
- const Reference< XStatusListener >& xControl,
- const URL& aURL )
-throw( ::com::sun::star::uno::RuntimeException )
-{
- ResetableGuard aLock( m_aLock );
- if ( m_bDisposed )
- throw DisposedException();
- aLock.unlock();
-
- bool bStatusUpdate( false );
- m_aListenerContainer.addInterface( ::getCppuType( (const css::uno::Reference< css::frame::XStatusListener >*)NULL ), xControl );
-
- aLock.lock();
- if ( aURL.Complete.indexOf( m_aBaseURL ) == 0 )
- bStatusUpdate = true;
- aLock.unlock();
-
- if ( bStatusUpdate )
- {
- // Dummy update for popup menu controllers
- FeatureStateEvent aEvent;
- aEvent.FeatureURL = aURL;
- aEvent.IsEnabled = sal_True;
- aEvent.Requery = sal_False;
- aEvent.State = Any();
- xControl->statusChanged( aEvent );
- }
-}
-
-void SAL_CALL PopupMenuControllerBase::removeStatusListener(
- const Reference< XStatusListener >& xControl,
- const URL& /*aURL*/ )
-throw( ::com::sun::star::uno::RuntimeException )
-{
- m_aListenerContainer.removeInterface( ::getCppuType( (const css::uno::Reference< css::frame::XStatusListener >*)NULL ), xControl );
-}
-
-::rtl::OUString PopupMenuControllerBase::determineBaseURL( const ::rtl::OUString& aURL )
-{
- // Just use the main part of the URL for popup menu controllers
- sal_Int32 nQueryPart( 0 );
- sal_Int32 nSchemePart( 0 );
- rtl::OUString aMainURL( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.popup:" ));
-
- nSchemePart = aURL.indexOf( ':' );
- if (( nSchemePart > 0 ) &&
- ( aURL.getLength() > ( nSchemePart+1 )))
- {
- nQueryPart = aURL.indexOf( '?', nSchemePart );
- if ( nQueryPart > 0 )
- aMainURL += aURL.copy( nSchemePart, nQueryPart-nSchemePart );
- else if ( nQueryPart == -1 )
- aMainURL += aURL.copy( nSchemePart+1 );
- }
-
- return aMainURL;
-}
-
-// XInitialization
-void SAL_CALL PopupMenuControllerBase::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
-{
- ResetableGuard aLock( m_aLock );
-
- sal_Bool bInitalized( m_bInitialized );
- if ( !bInitalized )
- {
- PropertyValue aPropValue;
- rtl::OUString aCommandURL;
- Reference< XFrame > xFrame;
-
- for ( int i = 0; i < aArguments.getLength(); i++ )
- {
- if ( aArguments[i] >>= aPropValue )
- {
- if ( aPropValue.Name.equalsAscii( "Frame" ))
- aPropValue.Value >>= xFrame;
- else if ( aPropValue.Name.equalsAscii( "CommandURL" ))
- aPropValue.Value >>= aCommandURL;
- }
- }
-
- if ( xFrame.is() && aCommandURL.getLength() )
- {
- m_xFrame = xFrame;
- m_aCommandURL = aCommandURL;
- m_aBaseURL = determineBaseURL( aCommandURL );
- m_bInitialized = true;
- }
- }
-}
-// XPopupMenuController
-void SAL_CALL PopupMenuControllerBase::setPopupMenu( const Reference< css::awt::XPopupMenu >& xPopupMenu ) throw ( RuntimeException )
-{
- ResetableGuard aLock( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_xFrame.is() && !m_xPopupMenu.is() )
- {
- // Create popup menu on demand
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
-
- m_xPopupMenu = xPopupMenu;
- m_xPopupMenu->addMenuListener( Reference< css::awt::XMenuListener >( (OWeakObject*)this, UNO_QUERY ));
-
- Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
-
- com::sun::star::util::URL aTargetURL;
- aTargetURL.Complete = m_aCommandURL;
- m_xURLTransformer->parseStrict( aTargetURL );
- m_xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
-
- impl_setPopupMenu();
-
- updatePopupMenu();
- }
-}
-void PopupMenuControllerBase::impl_setPopupMenu()
-{
-}
-}
diff --git a/framework/source/fwi/threadhelp/transactionmanager.cxx b/framework/source/fwi/threadhelp/transactionmanager.cxx
index 7094bd884302..3523ddbbd128 100644
--- a/framework/source/fwi/threadhelp/transactionmanager.cxx
+++ b/framework/source/fwi/threadhelp/transactionmanager.cxx
@@ -320,42 +320,6 @@ sal_Bool TransactionManager::isCallRejected( ERejectReason& eReason ) const
}
/*-****************************************************************************************************//**
- @short return a reference to a static manager
- @descr Sometimes we need the global member! (e.g. in our own static methods)
- We create our own "class global static" member threadsafe.
- It will be created at first call only!
- All other requests use these created one then directly.
-
- @seealso -
-
- @param -
- @return A reference to a static member.
-
- @onerror No error should occure.
-*//*-*****************************************************************************************************/
-TransactionManager& TransactionManager::getGlobalTransactionManager()
-{
- // Initialize static member only for one time!
- static TransactionManager* pManager = NULL;
- // If these method first called (member not already exist!) ...
- if( pManager == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- // We must check our pointer again - because ... another instance of ouer class could be faster then these one!
- if( pManager == NULL )
- {
- // Create the new manager and set it for return on static variable.
- static TransactionManager aManager;
- pManager = &aManager;
- }
- }
- // Return new created or already existing object.
- return *pManager;
-}
-
-/*-****************************************************************************************************//**
@short throw any exceptions for rejected calls
@descr If user whish to use our automaticly exception mode we use this impl-method.
We check all combinations of eReason and eExceptionMode and throw right exception with some
diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx b/framework/source/fwi/uielement/rootitemcontainer.cxx
index e67b734730e5..8c81f31f2394 100644
--- a/framework/source/fwi/uielement/rootitemcontainer.cxx
+++ b/framework/source/fwi/uielement/rootitemcontainer.cxx
@@ -127,7 +127,6 @@ RootItemContainer::RootItemContainer( const Reference< XIndexAccess >& rSourceCo
Reference< XPropertySet > xPropSet( rSourceContainer, UNO_QUERY );
if ( xPropSet.is() )
{
- rtl::OUString aUIName;
xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UIName" ))) >>= m_aUIName;
}
}
diff --git a/framework/source/helper/makefile.mk b/framework/source/helper/makefile.mk
index f19416899c86..556a9829d27c 100644
--- a/framework/source/helper/makefile.mk
+++ b/framework/source/helper/makefile.mk
@@ -41,18 +41,29 @@ CDEFS+=-DCOMPMOD_NAMESPACE=framework
# --- Generate -----------------------------------------------------
-SLOFILES=\
- $(SLO)$/dockingareadefaultacceptor.obj \
- $(SLO)$/ocomponentaccess.obj \
- $(SLO)$/ocomponentenumeration.obj \
- $(SLO)$/oframes.obj \
- $(SLO)$/persistentwindowstate.obj \
- $(SLO)$/statusindicator.obj \
- $(SLO)$/statusindicatorfactory.obj \
- $(SLO)$/tagwindowasmodified.obj \
- $(SLO)$/titlebarupdate.obj \
- $(SLO)$/vclstatusindicator.obj \
- $(SLO)$/wakeupthread.obj \
+SLOFILES= $(SLO)$/ocomponentaccess.obj \
+ $(SLO)$/ocomponentenumeration.obj \
+ $(SLO)$/oframes.obj \
+ $(SLO)$/statusindicatorfactory.obj \
+ $(SLO)$/statusindicator.obj \
+ $(SLO)$/imageproducer.obj \
+ $(SLO)$/propertysetcontainer.obj \
+ $(SLO)$/actiontriggerhelper.obj \
+ $(SLO)$/persistentwindowstate.obj \
+ $(SLO)$/networkdomain.obj \
+ $(SLO)$/acceleratorinfo.obj \
+ $(SLO)$/uielementwrapperbase.obj \
+ $(SLO)$/popupmenucontrollerbase.obj \
+ $(SLO)$/dockingareadefaultacceptor.obj \
+ $(SLO)$/uiconfigelementwrapperbase.obj \
+ $(SLO)$/shareablemutex.obj \
+ $(SLO)$/vclstatusindicator.obj \
+ $(SLO)$/wakeupthread.obj \
+ $(SLO)$/configimporter.obj \
+ $(SLO)$/tagwindowasmodified.obj \
+ $(SLO)$/titlebarupdate.obj \
+ $(SLO)$/titlehelper.obj \
+ $(SLO)$/mischelper.obj
# --- Targets ------------------------------------------------------
diff --git a/framework/source/inc/constant/filter.hxx b/framework/source/inc/constant/filter.hxx
deleted file mode 100644
index 141440a77716..000000000000
--- a/framework/source/inc/constant/filter.hxx
+++ /dev/null
@@ -1,126 +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 __FRAMEWORK_CONSTANT_FILTER_H_
-#define __FRAMEWORK_CONSTANT_FILTER_H_
-
-#include <rtl/ustring.hxx>
-
-namespace framework{
- namespace constant{
-
-struct Filter
-{
- public:
-
- static const ::rtl::OUString PROP_NAME; // string
- static const ::rtl::OUString PROP_TYPE; // string
- static const ::rtl::OUString PROP_DOCUMENTSERVICE; // string
- static const ::rtl::OUString PROP_FILTERSERVICE; // string
- static const ::rtl::OUString PROP_UICOMPONENT; // string
- static const ::rtl::OUString PROP_FLAGS; // int32
- static const ::rtl::OUString PROP_USERDATA; // seq< string >
- static const ::rtl::OUString PROP_TEMPLATENAME; // string
-
- static const ::rtl::OUString QUERY_GET_DEFAULT_FILTER_FOR_TYPE;
- static const ::rtl::OUString QUERY_ALL;
- static const ::rtl::OUString QUERY_WRITER;
- static const ::rtl::OUString QUERY_WEB;
- static const ::rtl::OUString QUERY_GLOBAL;
- static const ::rtl::OUString QUERY_CHART;
- static const ::rtl::OUString QUERY_CALC;
- static const ::rtl::OUString QUERY_IMPRESS;
- static const ::rtl::OUString QUERY_DRAW;
- static const ::rtl::OUString QUERY_MATH;
-
- static const ::rtl::OUString QUERYPARAM_IFLAGS;
- static const ::rtl::OUString QUERYPARAM_EFLAGS;
- static const ::rtl::OUString QUERYPARAM_SORT_PROP;
- static const ::rtl::OUString QUERYPARAM_DESCENDING;
- static const ::rtl::OUString QUERYPARAM_USE_ORDER;
- static const ::rtl::OUString QUERYPARAM_DEFAULT_FIRST;
- static const ::rtl::OUString QUERYPARAM_CASE_SENSITIVE;
- static const ::rtl::OUString QUERYPARAMVALUE_SORT_PROP_NAME;
- static const ::rtl::OUString QUERYPARAMVALUE_SORT_PROP_UINAME;
-
- static const ::rtl::OUString FLAGNAME_IMPORT;
- static const ::rtl::OUString FLAGNAME_EXPORT;
- static const ::rtl::OUString FLAGNAME_TEMPLATE;
- static const ::rtl::OUString FLAGNAME_INTERNAL;
- static const ::rtl::OUString FLAGNAME_TEMPLATEPATH;
- static const ::rtl::OUString FLAGNAME_OWN;
- static const ::rtl::OUString FLAGNAME_ALIEN;
- static const ::rtl::OUString FLAGNAME_USESOPTIONS;
- static const ::rtl::OUString FLAGNAME_DEFAULT;
- static const ::rtl::OUString FLAGNAME_EXECUTABLE;
- static const ::rtl::OUString FLAGNAME_SUPPORTSSELECTION;
- static const ::rtl::OUString FLAGNAME_MAPTOAPPPLUG;
- static const ::rtl::OUString FLAGNAME_NOTINFILEDIALOG;
- static const ::rtl::OUString FLAGNAME_NOTINCHOOSER;
- static const ::rtl::OUString FLAGNAME_ASYNCHRON;
- static const ::rtl::OUString FLAGNAME_CREATOR;
- static const ::rtl::OUString FLAGNAME_READONLY;
- static const ::rtl::OUString FLAGNAME_NOTINSTALLED;
- static const ::rtl::OUString FLAGNAME_CONSULTSERVICE;
- static const ::rtl::OUString FLAGNAME_3RDPARTYFILTER;
- static const ::rtl::OUString FLAGNAME_PACKED;
- static const ::rtl::OUString FLAGNAME_SILENTEXPORT;
- static const ::rtl::OUString FLAGNAME_BROWSERPREFERED;
- static const ::rtl::OUString FLAGNAME_PREFERED;
-
- static const sal_Int32 FLAGVALUE_IMPORT;
- static const sal_Int32 FLAGVALUE_EXPORT;
- static const sal_Int32 FLAGVALUE_TEMPLATE;
- static const sal_Int32 FLAGVALUE_INTERNAL;
- static const sal_Int32 FLAGVALUE_TEMPLATEPATH;
- static const sal_Int32 FLAGVALUE_OWN;
- static const sal_Int32 FLAGVALUE_ALIEN;
- static const sal_Int32 FLAGVALUE_USESOPTIONS;
- static const sal_Int32 FLAGVALUE_DEFAULT;
- static const sal_Int32 FLAGVALUE_EXECUTABLE;
- static const sal_Int32 FLAGVALUE_SUPPORTSSELECTION;
- static const sal_Int32 FLAGVALUE_MAPTOAPPPLUG;
- static const sal_Int32 FLAGVALUE_NOTINFILEDIALOG;
- static const sal_Int32 FLAGVALUE_NOTINCHOOSER;
- static const sal_Int32 FLAGVALUE_ASYNCHRON;
- static const sal_Int32 FLAGVALUE_CREATOR;
- static const sal_Int32 FLAGVALUE_READONLY;
- static const sal_Int32 FLAGVALUE_NOTINSTALLED;
- static const sal_Int32 FLAGVALUE_CONSULTSERVICE;
- static const sal_Int32 FLAGVALUE_3RDPARTYFILTER;
- static const sal_Int32 FLAGVALUE_PACKED;
- static const sal_Int32 FLAGVALUE_SILENTEXPORT;
- static const sal_Int32 FLAGVALUE_BROWSERPREFERED;
- //FREE! ... 0x00800000L
- static const sal_Int32 FLAGVALUE_PREFERED;
-
-};
-
- } // namespace constant
-} // namespace framework
-
-#endif // #ifndef __FRAMEWORK_CONSTANT_FILTER_H_
diff --git a/framework/source/interaction/quietinteraction.cxx b/framework/source/interaction/quietinteraction.cxx
index f00bee4ed432..d5d11ebc2097 100644
--- a/framework/source/interaction/quietinteraction.cxx
+++ b/framework/source/interaction/quietinteraction.cxx
@@ -44,7 +44,9 @@
#include <com/sun/star/task/XInteractionAbort.hpp>
#include <com/sun/star/task/XInteractionApprove.hpp>
#include <com/sun/star/document/XInteractionFilterSelect.hpp>
+#include <com/sun/star/document/XInteractionFilterOptions.hpp>
#include <com/sun/star/document/AmbigousFilterRequest.hpp>
+#include <com/sun/star/document/FilterOptionsRequest.hpp>
#include <com/sun/star/task/ErrorCodeRequest.hpp>
#ifndef _COM_SUN_STAR_DOCUMENT_LOCKEDDOCUMENTREQUEST_HPP_
@@ -111,6 +113,7 @@ void SAL_CALL QuietInteraction::handle( const css::uno::Reference< css::task::XI
css::uno::Reference< css::task::XInteractionAbort > xAbort ;
css::uno::Reference< css::task::XInteractionApprove > xApprove ;
css::uno::Reference< css::document::XInteractionFilterSelect > xFilter ;
+ css::uno::Reference< css::document::XInteractionFilterOptions > xFOptions ;
sal_Int32 nCount=lContinuations.getLength();
for (sal_Int32 i=0; i<nCount; ++i)
@@ -123,6 +126,9 @@ void SAL_CALL QuietInteraction::handle( const css::uno::Reference< css::task::XI
if ( ! xFilter.is() )
xFilter = css::uno::Reference< css::document::XInteractionFilterSelect >( lContinuations[i], css::uno::UNO_QUERY );
+
+ if ( ! xFOptions.is() )
+ xFOptions = css::uno::Reference< css::document::XInteractionFilterOptions >( lContinuations[i], css::uno::UNO_QUERY );
}
// differ between abortable interactions (error, unknown filter ...)
@@ -130,6 +136,7 @@ void SAL_CALL QuietInteraction::handle( const css::uno::Reference< css::task::XI
css::task::ErrorCodeRequest aErrorCodeRequest ;
css::document::AmbigousFilterRequest aAmbigousFilterRequest;
css::document::LockedDocumentRequest aLockedDocumentRequest;
+ css::document::FilterOptionsRequest aFilterOptionsRequest;
if (aRequest>>=aAmbigousFilterRequest)
{
@@ -163,6 +170,15 @@ void SAL_CALL QuietInteraction::handle( const css::uno::Reference< css::task::XI
xAbort->select();
}
else
+ if (aRequest>>=aFilterOptionsRequest)
+ {
+ if (xFOptions.is())
+ {
+ // let the default filter options be used
+ xFOptions->select();
+ }
+ }
+ else
if (xAbort.is())
xAbort->select();
}
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index d4db2d70e771..08d49b179a56 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -4707,6 +4707,14 @@ throw (RuntimeException)
impl_setDockingWindowVisibility( xSMGR, xFrame, aElementName, true );
}
+ else if ( aElementType.equalsIgnoreAsciiCaseAscii( "toolpanel" ))
+ {
+ ReadGuard aReadGuard( m_aLock );
+ css::uno::Reference< css::frame::XFrame > xFrame( m_xFrame );
+ aReadGuard.unlock();
+
+ ActivateToolPanel( m_xFrame, aName );
+ }
}
if ( bNotify )
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 07c8846bb3ce..1084fbc7f74c 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -36,13 +36,6 @@
#endif
#include <classes/framelistanalyzer.hxx>
-#ifndef __FRAMEWORK_CONSTANT_FILTER_HXX_
-#include <constant/filter.hxx>
-#endif
-
-#include <comphelper/interaction.hxx>
-#include <framework/interaction.hxx>
-
#ifndef __FRAMEWORK_CONSTANT_FRAMELOADER_HXX_
#include <constant/frameloader.hxx>
#endif
@@ -61,6 +54,7 @@
#include <properties.h>
#include <protocols.h>
#include <services.h>
+#include <comphelper/interaction.hxx>
#include <framework/interaction.hxx>
//_______________________________________________
@@ -1770,7 +1764,10 @@ void LoadEnv::impl_makeFrameWindowVisible(const css::uno::Reference< css::awt::X
::comphelper::ConfigurationHelper::E_READONLY);
a >>= bForceFrontAndFocus;
- pWindow->Show(sal_True, (bForceFrontAndFocus || bForceToFront) ? SHOW_FOREGROUNDTASK : 0 );
+ if( pWindow->IsVisible() && (bForceFrontAndFocus || bForceToFront) )
+ pWindow->ToTop();
+ else
+ pWindow->Show(sal_True, (bForceFrontAndFocus || bForceToFront) ? SHOW_FOREGROUNDTASK : 0 );
}
/* #i19976#
diff --git a/framework/source/register/registertemp.cxx b/framework/source/register/registertemp.cxx
index dc5682c7d398..7382380ef525 100644
--- a/framework/source/register/registertemp.cxx
+++ b/framework/source/register/registertemp.cxx
@@ -78,6 +78,7 @@
#include <uielement/macrosmenucontroller.hxx>
#include <uielement/newmenucontroller.hxx>
#include <uielement/toolbarsmenucontroller.hxx>
+#include <uielement/popupmenucontroller.hxx>
COMPONENTGETIMPLEMENTATIONENVIRONMENT
@@ -103,6 +104,7 @@ COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::MediaTypeDetectionHelper
COMPONENTINFO( ::framework::DispatchRecorderSupplier )
COMPONENTINFO( ::framework::Oxt_Handler )
COMPONENTINFO( ::framework::License )
+ COMPONENTINFO( ::framework::PopupMenuController )
)
COMPONENTGETFACTORY ( IFFACTORY( ::framework::MediaTypeDetectionHelper )
@@ -126,5 +128,6 @@ COMPONENTGETFACTORY ( IFFACTORY( ::framework::MediaTypeDetectionHelper
IFFACTORY( ::framework::FooterMenuController ) else
IFFACTORY( ::framework::HeaderMenuController ) else
IFFACTORY( ::framework::LanguageSelectionMenuController ) else
- IFFACTORY( ::framework::Oxt_Handler )
+ IFFACTORY( ::framework::Oxt_Handler ) else
+ IFFACTORY( ::framework::PopupMenuController )
)
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index bbbefdbdbda1..17def8e1c684 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -41,21 +41,26 @@
#include "tools/urlobj.hxx"
#include "unotools/dynamicmenuoptions.hxx"
+#include "unotools/historyoptions.hxx"
#include "svtools/imagemgr.hxx"
-#include "svl/svtools.hrc"
+#include "svtools/svtools.hrc"
#include "comphelper/processfactory.hxx"
#include "comphelper/sequenceashashmap.hxx"
#include "comphelper/configurationhelper.hxx"
+#include "cppuhelper/implbase1.hxx"
+
#include "rtl/strbuf.hxx"
#include "rtl/ustrbuf.hxx"
+#include "osl/file.h"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/container/XNameAccess.hpp"
#include "com/sun/star/system/XSystemShellExecute.hpp"
#include "com/sun/star/system/SystemShellExecuteFlags.hpp"
#include "com/sun/star/task/XJobExecutor.hpp"
+#include "com/sun/star/util/XStringWidth.hpp"
using namespace ::com::sun::star::beans;
@@ -110,27 +115,33 @@ Size DecoToolBox::getMinSize()
return maMinSize;
}
+class RecentFilesStringLength : public ::cppu::WeakImplHelper1< ::com::sun::star::util::XStringWidth >
+{
+ public:
+ RecentFilesStringLength() {}
+ virtual ~RecentFilesStringLength() {}
+
+ // XStringWidth
+ sal_Int32 SAL_CALL queryStringWidth( const ::rtl::OUString& aString )
+ throw (::com::sun::star::uno::RuntimeException)
+ {
+ return aString.getLength();
+ }
+};
+
#define STC_BUTTON_STYLE (WB_LEFT | WB_VCENTER | WB_FLATBUTTON | WB_BEVELBUTTON)
BackingWindow::BackingWindow( Window* i_pParent ) :
Window( i_pParent, FwkResId( DLG_BACKING ) ),
maWelcome( this, WB_LEFT ),
maProduct( this, WB_LEFT ),
- maWriterText( this, WB_WORDBREAK | WB_VCENTER ),
maWriterButton( this, STC_BUTTON_STYLE ),
- maCalcText( this, WB_WORDBREAK | WB_VCENTER ),
maCalcButton( this, STC_BUTTON_STYLE ),
- maImpressText( this, WB_WORDBREAK | WB_VCENTER ),
maImpressButton( this, STC_BUTTON_STYLE ),
- maOpenText( this, WB_WORDBREAK | WB_VCENTER ),
maOpenButton( this, STC_BUTTON_STYLE ),
- maDrawText( this, WB_WORDBREAK | WB_VCENTER ),
maDrawButton( this, STC_BUTTON_STYLE ),
- maDBText( this, WB_WORDBREAK | WB_VCENTER ),
maDBButton( this, STC_BUTTON_STYLE ),
- maMathText( this, WB_WORDBREAK | WB_VCENTER ),
maMathButton( this, STC_BUTTON_STYLE ),
- maTemplateText( this, WB_WORDBREAK | WB_VCENTER ),
maTemplateButton( this, STC_BUTTON_STYLE ),
maToolbox( this, WB_DIALOGCONTROL ),
maWelcomeString( FwkResId( STR_BACKING_WELCOME ) ),
@@ -141,7 +152,9 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
mbInitControls( false ),
mnLayoutStyle( 0 ),
mpAccExec( NULL ),
- mnBtnPos( 120 )
+ mnBtnPos( 120 ),
+ mnBtnTop( 150 ),
+ mpRecentMenu( NULL )
{
mnColumnWidth[0] = mnColumnWidth[1] = 0;
mnTextColumnWidth[0] = mnTextColumnWidth[1] = 0;
@@ -171,16 +184,6 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
{
}
- // get icon images from vcl resource and set them on the appropriate buttons
- loadImage( FwkResId( BMP_BACKING_WRITER ), maWriterButton );
- loadImage( FwkResId( BMP_BACKING_CALC ), maCalcButton );
- loadImage( FwkResId( BMP_BACKING_IMPRESS ), maImpressButton );
- loadImage( FwkResId( BMP_BACKING_DRAW ), maDrawButton );
- loadImage( FwkResId( BMP_BACKING_DATABASE ), maDBButton );
- loadImage( FwkResId( BMP_BACKING_FORMULA ), maMathButton );
- loadImage( FwkResId( BMP_BACKING_FOLDER ), maOpenButton );
- loadImage( FwkResId( BMP_BACKING_FOLDER ), maTemplateButton );
-
String aExtHelpText( FwkResId( STR_BACKING_EXTHELP ) );
String aRegHelpText( FwkResId( STR_BACKING_REGHELP ) );
String aInfoHelpText( FwkResId( STR_BACKING_INFOHELP ) );
@@ -195,10 +198,6 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
SetStyle( GetStyle() | WB_DIALOGCONTROL );
- // add some breathing space for the images
- maButtonImageSize.Width() += 12;
- maButtonImageSize.Height() += 12;
-
// force tab cycling in toolbox
maToolbox.SetStyle( maToolbox.GetStyle() | WB_FORCETABCYCLE );
@@ -244,11 +243,17 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
// init background
initBackground();
+
+ // add some breathing space for the images
+ maButtonImageSize.Width() += 12;
+ maButtonImageSize.Height() += 12;
+
}
BackingWindow::~BackingWindow()
{
+ delete mpRecentMenu;
delete mpAccExec;
}
@@ -277,6 +282,116 @@ void BackingWindow::DataChanged( const DataChangedEvent& rDCEvt )
}
}
+void BackingWindow::prepareRecentFileMenu()
+{
+ if( ! mpRecentMenu )
+ mpRecentMenu = new PopupMenu();
+ mpRecentMenu->Clear();
+ maRecentFiles.clear();
+
+ // get recent file list and dispatch arguments
+ Sequence< Sequence< PropertyValue > > aHistoryList( SvtHistoryOptions().GetList( ePICKLIST ) );
+
+ sal_Int32 nPickListMenuItems = ( aHistoryList.getLength() > 99 ) ? 99 : aHistoryList.getLength();
+
+ if( ( nPickListMenuItems > 0 ) )
+ {
+ maRecentFiles.reserve( nPickListMenuItems );
+ for ( sal_Int32 i = 0; i < nPickListMenuItems; i++ )
+ {
+ Sequence< PropertyValue >& rPickListEntry = aHistoryList[i];
+ rtl::OUString aURL, aFilter, aFilterOpt, aTitle;
+
+ for ( sal_Int32 j = 0; j < rPickListEntry.getLength(); j++ )
+ {
+ const Any& a = rPickListEntry[j].Value;
+
+ if ( rPickListEntry[j].Name == HISTORY_PROPERTYNAME_URL )
+ a >>= aURL;
+ else if ( rPickListEntry[j].Name == HISTORY_PROPERTYNAME_FILTER )
+ {
+ a >>= aFilter;
+ sal_Int32 nPos = aFilter.indexOf( '|' );
+ if ( nPos >= 0 )
+ {
+ if ( nPos < ( aFilter.getLength() - 1 ) )
+ aFilterOpt = aFilter.copy( nPos+1 );
+ aFilter = aFilter.copy( 0, nPos-1 );
+ }
+ }
+ else if ( rPickListEntry[j].Name == HISTORY_PROPERTYNAME_TITLE )
+ a >>= aTitle;
+ }
+ maRecentFiles.push_back( LoadRecentFile() );
+ maRecentFiles.back().aTargetURL = aURL;
+
+ sal_Int32 nArgs = aFilterOpt.getLength() ? 4 : 3;
+ Sequence< PropertyValue >& rArgsList( maRecentFiles.back().aArgSeq );
+ rArgsList.realloc( nArgs );
+
+ nArgs--;
+ rArgsList[nArgs].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ));
+ rArgsList[nArgs].Value = makeAny( aFilter );
+
+ if( aFilterOpt.getLength() )
+ {
+ nArgs--;
+ rArgsList[nArgs].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterOptions" ));
+ rArgsList[nArgs].Value = makeAny( aFilterOpt );
+ }
+
+ // documents in the picklist will never be opened as templates
+ nArgs--;
+ rArgsList[nArgs].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AsTemplate" ));
+ rArgsList[nArgs].Value = makeAny( (sal_Bool) sal_False );
+
+ nArgs--;
+ rArgsList[nArgs].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Referer" ));
+ rArgsList[nArgs].Value = makeAny( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:user" ) ) );
+
+ // and finally create an entry in the popupmenu
+ rtl::OUString aMenuTitle;
+ INetURLObject aURLObj( aURL );
+
+ if ( aURLObj.GetProtocol() == INET_PROT_FILE )
+ {
+ // Do handle file URL differently => convert it to a system
+ // path and abbreviate it with a special function:
+ String aFileSystemPath( aURLObj.getFSysPath( INetURLObject::FSYS_DETECT ) );
+
+ rtl::OUString aSystemPath( aFileSystemPath );
+ rtl::OUString aCompactedSystemPath;
+
+ oslFileError nError = osl_abbreviateSystemPath( aSystemPath.pData, &aCompactedSystemPath.pData, 46, NULL );
+ if ( !nError )
+ aMenuTitle = String( aCompactedSystemPath );
+ else
+ aMenuTitle = aSystemPath;
+ }
+ else
+ {
+ // Use INetURLObject to abbreviate all other URLs
+ Reference< util::XStringWidth > xStringLength( new RecentFilesStringLength() );
+ aMenuTitle = aURLObj.getAbbreviated( xStringLength, 46, INetURLObject::DECODE_UNAMBIGUOUS );
+ }
+ rtl::OUStringBuffer aBuf( aMenuTitle.getLength() + 5 );
+ if( i < 9 )
+ {
+ aBuf.append( sal_Unicode( '~' ) );
+ aBuf.append( i+1 );
+ }
+ else if( i == 9 )
+ aBuf.appendAscii( "1~0" );
+ else
+ aBuf.append( i+1 );
+ aBuf.appendAscii( ": " );
+ aBuf.append( aMenuTitle );
+ mpRecentMenu->InsertItem( static_cast<USHORT>(i+1), aBuf.makeStringAndClear() );
+ }
+ maOpenButton.SetPopupMenu( mpRecentMenu );
+ }
+}
+
void BackingWindow::initBackground()
{
SetBackground( GetSettings().GetStyleSettings().GetWorkspaceGradient() );
@@ -324,22 +439,6 @@ void BackingWindow::initBackground()
maWelcome.SetBackground();
maProduct.SetControlForeground( maWelcomeTextColor );
maProduct.SetBackground();
- maWriterText.SetControlForeground( maLabelTextColor );
- maWriterText.SetControlBackground( aTextBGColor );
- maCalcText.SetControlForeground( maLabelTextColor );
- maCalcText.SetControlBackground( aTextBGColor );
- maImpressText.SetControlForeground( maLabelTextColor );
- maImpressText.SetControlBackground( aTextBGColor );
- maDrawText.SetControlForeground( maLabelTextColor );
- maDrawText.SetControlBackground( aTextBGColor );
- maDBText.SetControlForeground( maLabelTextColor );
- maDBText.SetControlBackground( aTextBGColor );
- maMathText.SetControlForeground( maLabelTextColor );
- maMathText.SetControlBackground( aTextBGColor );
- maTemplateText.SetControlForeground( maLabelTextColor );
- maTemplateText.SetControlBackground( aTextBGColor );
- maOpenText.SetControlForeground( maLabelTextColor );
- maOpenText.SetControlBackground( aTextBGColor );
if( mnLayoutStyle == 1 )
{
@@ -348,6 +447,20 @@ void BackingWindow::initBackground()
else
mnBtnPos = maBackgroundLeft.GetSizePixel().Width() + 40;
}
+
+ // get icon images from fwk resource and set them on the appropriate buttons
+ loadImage( FwkResId( BMP_BACKING_WRITER ), maWriterButton );
+ loadImage( FwkResId( BMP_BACKING_CALC ), maCalcButton );
+ loadImage( FwkResId( BMP_BACKING_IMPRESS ), maImpressButton );
+ loadImage( FwkResId( BMP_BACKING_DRAW ), maDrawButton );
+ loadImage( FwkResId( BMP_BACKING_DATABASE ), maDBButton );
+ loadImage( FwkResId( BMP_BACKING_FORMULA ), maMathButton );
+ loadImage( FwkResId( BMP_BACKING_OPENFILE ), maOpenButton );
+ loadImage( FwkResId( BMP_BACKING_OPENTEMPLATE ), maTemplateButton );
+
+ maOpenButton.SetMenuMode( MENUBUTTON_MENUMODE_TIMED );
+ maOpenButton.SetSelectHdl( LINK( this, BackingWindow, SelectHdl ) );
+ maOpenButton.SetActivateHdl( LINK( this, BackingWindow, ActivateHdl ) );
}
void BackingWindow::initControls()
@@ -456,35 +569,35 @@ void BackingWindow::initControls()
}
// layout the buttons
- layoutButtonAndText( WRITER_URL, 0, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SWRITER,
- maWriterButton, maWriterText, aMnemns );
- layoutButtonAndText( DRAW_URL, 1, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SDRAW,
- maDrawButton, maDrawText, aMnemns );
+ layoutButton( WRITER_URL, 0, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SWRITER,
+ maWriterButton, aMnemns );
+ layoutButton( DRAW_URL, 1, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SDRAW,
+ maDrawButton, aMnemns );
nYPos += maButtonImageSize.Height() + 10;
- layoutButtonAndText( CALC_URL, 0, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SCALC,
- maCalcButton, maCalcText, aMnemns );
- layoutButtonAndText( BASE_URL, 1, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SDATABASE,
- maDBButton, maDBText, aMnemns );
+ layoutButton( CALC_URL, 0, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SCALC,
+ maCalcButton, aMnemns );
+ layoutButton( BASE_URL, 1, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SDATABASE,
+ maDBButton, aMnemns );
nYPos += maButtonImageSize.Height() + 10;
- layoutButtonAndText( IMPRESS_WIZARD_URL, 0, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SIMPRESS,
- maImpressButton, maImpressText, aMnemns );
- layoutButtonAndText( MATH_URL, 1, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SMATH,
- maMathButton, maMathText, aMnemns );
+ layoutButton( IMPRESS_WIZARD_URL, 0, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SIMPRESS,
+ maImpressButton, aMnemns );
+ layoutButton( MATH_URL, 1, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SMATH,
+ maMathButton, aMnemns );
nYPos += 3*maButtonImageSize.Height() / 2;
- layoutButtonAndText( NULL, 0, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SWRITER,
- maOpenButton, maOpenText, aMnemns, maOpenString );
- layoutButtonAndText( NULL, 1, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SWRITER,
- maTemplateButton, maTemplateText, aMnemns, maTemplateString );
+ layoutButton( NULL, 0, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SWRITER,
+ maOpenButton, aMnemns, maOpenString );
+ layoutButton( NULL, 1, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SWRITER,
+ maTemplateButton, aMnemns, maTemplateString );
nYPos += 10;
DBG_ASSERT( nYPos < maControlRect.GetHeight(), "misformatting !" );
@@ -532,9 +645,11 @@ void BackingWindow::initControls()
maBackgroundMiddle = BitmapEx();
Resize();
+
+ maWriterButton.GrabFocus();
}
-void BackingWindow::loadImage( const ResId& i_rId, ImageButton& i_rButton )
+void BackingWindow::loadImage( const ResId& i_rId, PushButton& i_rButton )
{
BitmapEx aBmp( i_rId );
Size aImgSize( aBmp.GetSizePixel() );
@@ -545,11 +660,11 @@ void BackingWindow::loadImage( const ResId& i_rId, ImageButton& i_rButton )
i_rButton.SetModeImage( aBmp );
}
-void BackingWindow::layoutButtonAndText(
+void BackingWindow::layoutButton(
const char* i_pURL, int nColumn,
const std::set<rtl::OUString>& i_rURLS,
SvtModuleOptions& i_rOpt, SvtModuleOptions::EModule i_eMod,
- ImageButton& i_rBtn, FixedText& i_rText,
+ PushButton& i_rBtn,
MnemonicGenerator& i_rMnemns,
const String& i_rStr
)
@@ -572,7 +687,7 @@ void BackingWindow::layoutButtonAndText(
long nTextWidth = i_rBtn.GetTextWidth( i_rBtn.GetText() );
- nTextWidth += maButtonImageSize.Width();
+ nTextWidth += maButtonImageSize.Width() + 8; // add some fuzz to be on the safe side
if( nColumn >= 0 && nColumn < static_cast<int>(sizeof(mnColumnWidth)/sizeof(mnColumnWidth[0])) )
{
if( nTextWidth > mnColumnWidth[nColumn] )
@@ -582,12 +697,6 @@ void BackingWindow::layoutButtonAndText(
i_rBtn.SetImageAlign( IMAGEALIGN_LEFT );
// show the controls
i_rBtn.Show();
- i_rText.Show( FALSE );
-
-
- // FIXME: the only reason the FixedTexts are left are not to trigger
- // a translation change due to changed src files. For the next minor
- // the FixedTexts should be removed completely
}
void BackingWindow::Paint( const Rectangle& )
@@ -635,8 +744,73 @@ long BackingWindow::Notify( NotifyEvent& rNEvt )
}
const KeyEvent* pEvt = rNEvt.GetKeyEvent();
- if( pEvt && mpAccExec->execute(pEvt->GetKeyCode()) )
+ const KeyCode& rKeyCode(pEvt->GetKeyCode());
+ if( pEvt && mpAccExec->execute(rKeyCode) )
return 1;
+ // #i110344# extrawurst: specialized arrow key control
+ if( rKeyCode.GetModifier() == 0 )
+ {
+ if( rKeyCode.GetCode() == KEY_RIGHT )
+ {
+ if( maWriterButton.HasFocus() )
+ maDrawButton.GrabFocus();
+ else if( maCalcButton.HasFocus() )
+ maDBButton.GrabFocus();
+ else if( maImpressButton.HasFocus() )
+ maMathButton.GrabFocus();
+ else if( maOpenButton.HasFocus() )
+ maTemplateButton.GrabFocus();
+ return 1;
+ }
+ else if( rKeyCode.GetCode() == KEY_LEFT )
+ {
+ if( maDrawButton.HasFocus() )
+ maWriterButton.GrabFocus();
+ else if( maDBButton.HasFocus() )
+ maCalcButton.GrabFocus();
+ else if( maMathButton.HasFocus() )
+ maImpressButton.GrabFocus();
+ else if( maTemplateButton.HasFocus() )
+ maOpenButton.GrabFocus();
+ return 1;
+ }
+ else if( rKeyCode.GetCode() == KEY_UP )
+ {
+ // first column
+ if( maOpenButton.HasFocus() )
+ maImpressButton.GrabFocus();
+ else if( maImpressButton.HasFocus() )
+ maCalcButton.GrabFocus();
+ else if( maCalcButton.HasFocus() )
+ maWriterButton.GrabFocus();
+ // second column
+ else if( maTemplateButton.HasFocus() )
+ maMathButton.GrabFocus();
+ else if( maMathButton.HasFocus() )
+ maDBButton.GrabFocus();
+ else if( maDBButton.HasFocus() )
+ maDrawButton.GrabFocus();
+ return 1;
+ }
+ else if( rKeyCode.GetCode() == KEY_DOWN )
+ {
+ // first column
+ if( maWriterButton.HasFocus() )
+ maCalcButton.GrabFocus();
+ else if( maCalcButton.HasFocus() )
+ maImpressButton.GrabFocus();
+ else if( maImpressButton.HasFocus() )
+ maOpenButton.GrabFocus();
+ // second column
+ else if( maDrawButton.HasFocus() )
+ maDBButton.GrabFocus();
+ else if( maDBButton.HasFocus() )
+ maMathButton.GrabFocus();
+ else if( maMathButton.HasFocus() )
+ maTemplateButton.GrabFocus();
+ return 1;
+ }
+ }
}
return Window::Notify( rNEvt );
}
@@ -696,6 +870,9 @@ void BackingWindow::Resize()
nYPos += nWDelta/2 - nDiff;
+ if( mnLayoutStyle != 1 )
+ nYPos = maControlRect.Top() + mnBtnTop;
+
maWriterButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) );
maDrawButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) );
nYPos += nBDelta - nDiff;
@@ -865,52 +1042,25 @@ IMPL_LINK( BackingWindow, ClickHdl, Button*, pButton )
return 0;
}
-Window* BackingWindow::GetParentLabelFor( const Window* pLabel ) const
+IMPL_LINK( BackingWindow, SelectHdl, Button*, pButton )
{
- const Window* pRet = NULL;
-
- if( pLabel == &maWriterText )
- pRet = &maWriterButton;
- else if( pLabel == &maCalcText )
- pRet = &maCalcButton;
- else if( pLabel == &maImpressText )
- pRet = &maImpressButton;
- else if( pLabel == &maDrawText )
- pRet = &maDrawButton;
- else if( pLabel == &maDBText )
- pRet = &maDBButton;
- else if( pLabel == &maMathText )
- pRet = &maMathButton;
- else if( pLabel == &maTemplateText )
- pRet = &maTemplateButton;
- else if( pLabel == &maOpenText )
- pRet = &maOpenButton;
-
- return const_cast<Window*>(pRet);
+ if( pButton == &maOpenButton )
+ {
+ sal_Int32 nItem = sal_Int32(maOpenButton.GetCurItemId())-1;
+ if( nItem >= 0 && nItem < sal_Int32(maRecentFiles.size()) )
+ {
+ Reference< XDispatchProvider > xFrame( mxFrame, UNO_QUERY );
+ dispatchURL( maRecentFiles[nItem].aTargetURL, rtl::OUString(), xFrame, maRecentFiles[nItem].aArgSeq );
+ }
+ }
+ return 0;
}
-Window* BackingWindow::GetParentLabeledBy( const Window* pLabeled ) const
+IMPL_LINK( BackingWindow, ActivateHdl, Button*, pButton )
{
- const Window *pRet = NULL;
-
- if( pLabeled == &maWriterButton )
- pRet = &maWriterText;
- else if( pLabeled == &maCalcButton )
- pRet = &maCalcText;
- else if( pLabeled == &maImpressButton )
- pRet = &maImpressText;
- else if( pLabeled == &maDrawButton )
- pRet = &maDrawText;
- else if( pLabeled == &maDBButton )
- pRet = &maDBText;
- else if( pLabeled == &maMathButton )
- pRet = &maMathText;
- else if( pLabeled == &maTemplateButton )
- pRet = &maTemplateText;
- else if( pLabeled == &maOpenButton )
- pRet = &maOpenText;
-
- return const_cast<Window*>(pRet);
+ if( pButton == &maOpenButton )
+ prepareRecentFileMenu();
+ return 0;
}
struct ImplDelayedDispatch
diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx
index 7b7dfa34b110..958ebfbb243e 100644
--- a/framework/source/services/backingwindow.hxx
+++ b/framework/source/services/backingwindow.hxx
@@ -31,6 +31,7 @@
#include "rtl/ustring.hxx"
#include "vcl/button.hxx"
+#include "vcl/menubtn.hxx"
#include "vcl/fixed.hxx"
#include "vcl/bitmapex.hxx"
#include "vcl/toolbox.hxx"
@@ -77,6 +78,12 @@ namespace framework
class BackingWindow : public Window
{
+ struct LoadRecentFile
+ {
+ rtl::OUString aTargetURL;
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aArgSeq;
+ };
+
com::sun::star::uno::Reference<com::sun::star::frame::XDesktop> mxDesktop;
com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider > mxDesktopDispatchProvider;
com::sun::star::uno::Reference<com::sun::star::frame::XFrame> mxFrame;
@@ -86,21 +93,13 @@ namespace framework
Size maWelcomeSize;
FixedText maProduct;
Size maProductSize;
- FixedText maWriterText;
ImageButton maWriterButton;
- FixedText maCalcText;
ImageButton maCalcButton;
- FixedText maImpressText;
ImageButton maImpressButton;
- FixedText maOpenText;
- ImageButton maOpenButton;
- FixedText maDrawText;
+ MenuButton maOpenButton;
ImageButton maDrawButton;
- FixedText maDBText;
ImageButton maDBButton;
- FixedText maMathText;
ImageButton maMathButton;
- FixedText maTemplateText;
ImageButton maTemplateButton;
DecoToolBox maToolbox;
@@ -129,6 +128,10 @@ namespace framework
sal_Int32 mnLayoutStyle;
svt::AcceleratorExecute* mpAccExec;
long mnBtnPos;
+ long mnBtnTop;
+
+ PopupMenu* mpRecentMenu;
+ std::vector< LoadRecentFile > maRecentFiles;
static const int nItemId_Extensions = 1;
static const int nItemId_Reg = 2;
@@ -139,14 +142,14 @@ namespace framework
static const int nShadowRight = 45;
static const int nShadowBottom = 50;
- void loadImage( const ResId& i_rId, ImageButton& i_rButton );
+ void loadImage( const ResId& i_rId, PushButton& i_rButton );
- void layoutButtonAndText( const char* i_pURL, int nColumn, const std::set<rtl::OUString>& i_rURLS,
- SvtModuleOptions& i_rOpt, SvtModuleOptions::EModule i_eMod,
- ImageButton& i_rBtn, FixedText& i_rText,
- MnemonicGenerator& i_rMnemonicGen,
- const String& i_rStr = String()
- );
+ void layoutButton( const char* i_pURL, int nColumn, const std::set<rtl::OUString>& i_rURLS,
+ SvtModuleOptions& i_rOpt, SvtModuleOptions::EModule i_eMod,
+ PushButton& i_rBtn,
+ MnemonicGenerator& i_rMnemonicGen,
+ const String& i_rStr = String()
+ );
void dispatchURL( const rtl::OUString& i_rURL,
const rtl::OUString& i_rTarget = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ),
@@ -155,10 +158,13 @@ namespace framework
);
DECL_LINK( ClickHdl, Button* );
+ DECL_LINK( SelectHdl, Button* );
+ DECL_LINK( ActivateHdl, Button* );
DECL_LINK( ToolboxHdl, void* );
void initControls();
void initBackground();
+ void prepareRecentFileMenu();
public:
BackingWindow( Window* pParent );
~BackingWindow();
@@ -167,9 +173,7 @@ namespace framework
virtual void Resize();
virtual long Notify( NotifyEvent& rNEvt );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual Window* GetParentLabelFor( const Window* pLabel ) const;
- virtual Window* GetParentLabeledBy( const Window* pLabeled ) const;
- virtual void GetFocus();
+ virtual void GetFocus();
void setOwningFrame( const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& xFrame );
};
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index dbdc3875df9b..dfc6225b4572 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -1551,8 +1551,9 @@ css::uno::Reference< css::awt::XWindow > SAL_CALL Frame::getComponentWindow() th
css::uno::Reference< css::frame::XController > SAL_CALL Frame::getController() throw( css::uno::RuntimeException )
{
/* UNSAFE AREA --------------------------------------------------------------------------------------------- */
+ // It seems to be unavoidable that disposed frames allow to ask for a Controller (#111452)
// Register transaction and reject wrong calls.
- TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS );
+ // TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS );
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
ReadGuard aReadLock( m_aLock );
diff --git a/framework/source/services/fwk_services.src b/framework/source/services/fwk_services.src
index 7e2ee3253e71..ef037c75778a 100644
--- a/framework/source/services/fwk_services.src
+++ b/framework/source/services/fwk_services.src
@@ -51,35 +51,7 @@ Window DLG_BACKING
};
String STR_BACKING_FILE
{
- Text [ en-US ] = "~Open a document...";
- };
- Bitmap BMP_BACKING_WRITER
- {
- File = "odt_32.png";
- };
- Bitmap BMP_BACKING_CALC
- {
- File = "ods_32.png";
- };
- Bitmap BMP_BACKING_IMPRESS
- {
- File = "odp_32.png";
- };
- Bitmap BMP_BACKING_DRAW
- {
- File = "odg_32.png";
- };
- Bitmap BMP_BACKING_DATABASE
- {
- File = "odb_32.png";
- };
- Bitmap BMP_BACKING_FORMULA
- {
- File = "odf_32.png";
- };
- Bitmap BMP_BACKING_FOLDER
- {
- File = "folder_32.png";
+ Text [ en-US ] = "~Open...";
};
String STR_BACKING_EXTHELP
{
@@ -137,6 +109,38 @@ Resource RES_BACKING_IMAGES
{
File = "addtemplate_32.png";
};
+ Bitmap BMP_BACKING_WRITER
+ {
+ File = "odt_32.png";
+ };
+ Bitmap BMP_BACKING_CALC
+ {
+ File = "ods_32.png";
+ };
+ Bitmap BMP_BACKING_IMPRESS
+ {
+ File = "odp_32.png";
+ };
+ Bitmap BMP_BACKING_DRAW
+ {
+ File = "odg_32.png";
+ };
+ Bitmap BMP_BACKING_DATABASE
+ {
+ File = "odb_32.png";
+ };
+ Bitmap BMP_BACKING_FORMULA
+ {
+ File = "odf_32.png";
+ };
+ Bitmap BMP_BACKING_OPENFILE
+ {
+ File = "folder_32.png";
+ };
+ Bitmap BMP_BACKING_OPENTEMPLATE
+ {
+ File = "templates_32.png";
+ };
};
Resource RES_BACKING_IMAGES_HC
@@ -177,6 +181,38 @@ Resource RES_BACKING_IMAGES_HC
{
File = "template_hc.png";
};
+ Bitmap BMP_BACKING_WRITER
+ {
+ File = "odt_32_hc.png";
+ };
+ Bitmap BMP_BACKING_CALC
+ {
+ File = "ods_32_hc.png";
+ };
+ Bitmap BMP_BACKING_IMPRESS
+ {
+ File = "odp_32_hc.png";
+ };
+ Bitmap BMP_BACKING_DRAW
+ {
+ File = "odg_32_hc.png";
+ };
+ Bitmap BMP_BACKING_DATABASE
+ {
+ File = "odb_32_hc.png";
+ };
+ Bitmap BMP_BACKING_FORMULA
+ {
+ File = "odf_32_hc.png";
+ };
+ Bitmap BMP_BACKING_OPENFILE
+ {
+ File = "folder_32_hc.png";
+ };
+ Bitmap BMP_BACKING_OPENTEMPLATE
+ {
+ File = "templates_32_hc.png";
+ };
};
Window WIN_TABWINDOW
diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx
index e248bb0e9480..b626ce81b2dd 100644
--- a/framework/source/services/pathsettings.cxx
+++ b/framework/source/services/pathsettings.cxx
@@ -857,6 +857,7 @@ void PathSettings::impl_setPathValue( sal_Int32 nID ,
::rtl::OUString sVal;
aVal >>= sVal;
OUStringList lList = impl_convertOldStyle2Path(sVal);
+ impl_subst(lList, fa_getSubstitution(), sal_False);
impl_purgeKnownPaths(aChangePath, lList);
if (! impl_isValidPath(lList))
throw css::lang::IllegalArgumentException();
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index d262c344d711..988168547e4d 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -120,7 +120,8 @@ static const char* UIELEMENTTYPENAMES[] =
UIELEMENTTYPE_TOOLBAR_NAME,
UIELEMENTTYPE_STATUSBAR_NAME,
UIELEMENTTYPE_FLOATINGWINDOW_NAME,
- UIELEMENTTYPE_PROGRESSBAR_NAME
+ UIELEMENTTYPE_PROGRESSBAR_NAME,
+ UIELEMENTTYPE_TOOLPANEL_NAME
};
static const char RESOURCEURL_PREFIX[] = "private:resource/";
@@ -292,11 +293,12 @@ void ModuleUIConfigurationManager::impl_preloadUIElementTypeList( Layer eLayer,
rHashMap.insert( UIElementDataHashMap::value_type( aUIElementData.aResourceURL, aUIElementData ));
}
}
+ rElementTypeData.bLoaded = true;
}
}
}
- rElementTypeData.bLoaded = true;
+ //rElementTypeData.bLoaded = true;
}
void ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElementType, Layer eLayer, UIElementData& aUIElementData )
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index df2495dd6bb1..366e58c0adb2 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -118,7 +118,8 @@ static const char* UIELEMENTTYPENAMES[] =
UIELEMENTTYPE_TOOLBAR_NAME,
UIELEMENTTYPE_STATUSBAR_NAME,
UIELEMENTTYPE_FLOATINGWINDOW_NAME,
- UIELEMENTTYPE_PROGRESSBAR_NAME
+ UIELEMENTTYPE_PROGRESSBAR_NAME,
+ UIELEMENTTYPE_TOOLPANEL_NAME
};
static const char RESOURCEURL_PREFIX[] = "private:resource/";
diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx
index 3921625cc76f..058005ffdc40 100644
--- a/framework/source/uielement/comboboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx
@@ -46,7 +46,6 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/frame/status/ItemStatus.hpp>
#include <com/sun/star/frame/status/ItemState.hpp>
#include <com/sun/star/frame/status/Visibility.hpp>
diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx
index 0672ac69d351..49501194a014 100644
--- a/framework/source/uielement/controlmenucontroller.cxx
+++ b/framework/source/uielement/controlmenucontroller.cxx
@@ -61,6 +61,7 @@
#include <vcl/image.hxx>
#include <svtools/menuoptions.hxx>
#include <dispatch/uieventloghelper.hxx>
+#include <vos/mutex.hxx>
// Copied from svx
// Function-Id's
@@ -213,7 +214,7 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( ControlMenuController
DEFINE_INIT_SERVICE ( ControlMenuController, {} )
ControlMenuController::ControlMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
- PopupMenuControllerBase( xServiceManager ),
+ svt::PopupMenuControllerBase( xServiceManager ),
m_pResPopupMenu( 0 )
{
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
@@ -272,7 +273,7 @@ void SAL_CALL ControlMenuController::disposing( const EventObject& ) throw ( Run
{
Reference< css::awt::XMenuListener > xHolder(( OWeakObject *)this, UNO_QUERY );
- ResetableGuard aLock( m_aLock );
+ osl::ResettableMutexGuard aLock( m_aMutex );
m_xFrame.clear();
m_xDispatch.clear();
m_xServiceManager.clear();
@@ -286,7 +287,7 @@ void SAL_CALL ControlMenuController::disposing( const EventObject& ) throw ( Run
// XStatusListener
void SAL_CALL ControlMenuController::statusChanged( const FeatureStateEvent& Event ) throw ( RuntimeException )
{
- ResetableGuard aLock( m_aLock );
+ osl::ResettableMutexGuard aLock( m_aMutex );
USHORT nMenuId = 0;
for (sal_uInt32 i=0; i < sizeof(aCommands)/sizeof(aCommands[0]); ++i)
@@ -351,7 +352,7 @@ void ControlMenuController::impl_select(const Reference< XDispatch >& /*_xDispat
void SAL_CALL ControlMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
{
- ResetableGuard aLock( m_aLock );
+ osl::ResettableMutexGuard aLock( m_aMutex );
if ( m_xPopupMenu.is() )
{
@@ -404,10 +405,9 @@ void ControlMenuController::impl_setPopupMenu()
void SAL_CALL ControlMenuController::updatePopupMenu() throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aLock( m_aLock );
+ osl::ResettableMutexGuard aLock( m_aMutex );
- if ( m_bDisposed )
- throw DisposedException();
+ throwIfDisposed();
if ( m_xFrame.is() && m_xPopupMenu.is() )
{
@@ -435,8 +435,8 @@ void SAL_CALL ControlMenuController::updatePopupMenu() throw (::com::sun::star::
// XInitialization
void SAL_CALL ControlMenuController::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
{
- ResetableGuard aLock( m_aLock );
- PopupMenuControllerBase::initialize(aArguments);
+ osl::ResettableMutexGuard aLock( m_aMutex );
+ svt::PopupMenuControllerBase::initialize(aArguments);
m_aBaseURL = ::rtl::OUString();
}
diff --git a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
index 43b50eb2a49a..0800103c743e 100644
--- a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
@@ -46,7 +46,6 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/frame/status/ItemStatus.hpp>
#include <com/sun/star/frame/status/ItemState.hpp>
#include <com/sun/star/frame/status/Visibility.hpp>
diff --git a/framework/source/uielement/edittoolbarcontroller.cxx b/framework/source/uielement/edittoolbarcontroller.cxx
index 3ad4b11fd1e9..387213d7c3eb 100644
--- a/framework/source/uielement/edittoolbarcontroller.cxx
+++ b/framework/source/uielement/edittoolbarcontroller.cxx
@@ -46,7 +46,6 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/frame/status/ItemStatus.hpp>
#include <com/sun/star/frame/status/ItemState.hpp>
#include <com/sun/star/frame/status/Visibility.hpp>
diff --git a/framework/source/uielement/fontmenucontroller.cxx b/framework/source/uielement/fontmenucontroller.cxx
index 7110ea5aa519..c2625a951efb 100644
--- a/framework/source/uielement/fontmenucontroller.cxx
+++ b/framework/source/uielement/fontmenucontroller.cxx
@@ -59,6 +59,7 @@
#include <vcl/mnemonic.hxx>
#endif
#include <dispatch/uieventloghelper.hxx>
+#include <vos/mutex.hxx>
//_________________________________________________________________________________________________________________
// Defines
@@ -91,7 +92,7 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( FontMenuController
DEFINE_INIT_SERVICE ( FontMenuController, {} )
FontMenuController::FontMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
- PopupMenuControllerBase( xServiceManager )
+ svt::PopupMenuControllerBase( xServiceManager )
{
}
@@ -145,7 +146,7 @@ void SAL_CALL FontMenuController::disposing( const EventObject& ) throw ( Runtim
{
Reference< css::awt::XMenuListener > xHolder(( OWeakObject *)this, UNO_QUERY );
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
m_xFrame.clear();
m_xDispatch.clear();
m_xFontListDispatch.clear();
@@ -164,12 +165,12 @@ void SAL_CALL FontMenuController::statusChanged( const FeatureStateEvent& Event
if ( Event.State >>= aFontDescriptor )
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
m_aFontFamilyName = aFontDescriptor.Name;
}
else if ( Event.State >>= aFontNameSeq )
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
if ( m_xPopupMenu.is() )
fillPopupMenu( aFontNameSeq, m_xPopupMenu );
}
@@ -192,7 +193,7 @@ void FontMenuController::impl_select(const Reference< XDispatch >& _xDispatch,co
void SAL_CALL FontMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
if ( m_xPopupMenu.is() )
{
@@ -241,14 +242,14 @@ void FontMenuController::impl_setPopupMenu()
void SAL_CALL FontMenuController::updatePopupMenu() throw ( ::com::sun::star::uno::RuntimeException )
{
- PopupMenuControllerBase::updatePopupMenu();
+ svt::PopupMenuControllerBase::updatePopupMenu();
- ResetableGuard aLock( m_aLock );
+ osl::ClearableMutexGuard aLock( m_aMutex );
Reference< XDispatch > xDispatch( m_xFontListDispatch );
com::sun::star::util::URL aTargetURL;
aTargetURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontNameList" ));
m_xURLTransformer->parseStrict( aTargetURL );
- aLock.unlock();
+ aLock.clear();
if ( xDispatch.is() )
{
diff --git a/framework/source/uielement/fontsizemenucontroller.cxx b/framework/source/uielement/fontsizemenucontroller.cxx
index 8dbd608a28e0..58cf3a3b02be 100644
--- a/framework/source/uielement/fontsizemenucontroller.cxx
+++ b/framework/source/uielement/fontsizemenucontroller.cxx
@@ -64,6 +64,7 @@
#include <svtools/ctrltool.hxx>
#endif
#include <dispatch/uieventloghelper.hxx>
+#include <vos/mutex.hxx>
//_________________________________________________________________________________________________________________
// Defines
@@ -90,7 +91,7 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( FontSizeMenuController
DEFINE_INIT_SERVICE ( FontSizeMenuController, {} )
FontSizeMenuController::FontSizeMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
- PopupMenuControllerBase( xServiceManager ),
+ svt::PopupMenuControllerBase( xServiceManager ),
m_pHeightArray( 0 ),
m_bRebuildMenu( sal_True )
{
@@ -280,7 +281,7 @@ void SAL_CALL FontSizeMenuController::disposing( const EventObject& ) throw ( Ru
{
Reference< css::awt::XMenuListener > xHolder(( OWeakObject *)this, UNO_QUERY );
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
m_xFrame.clear();
m_xDispatch.clear();
m_xCurrentFontDispatch.clear();
@@ -297,7 +298,7 @@ void SAL_CALL FontSizeMenuController::statusChanged( const FeatureStateEvent& Ev
if ( Event.State >>= aFontDescriptor )
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
m_aFontDescriptor = aFontDescriptor;
if ( m_xPopupMenu.is() )
@@ -306,7 +307,7 @@ void SAL_CALL FontSizeMenuController::statusChanged( const FeatureStateEvent& Ev
}
else if ( Event.State >>= aFontHeight )
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
m_aFontHeight = aFontHeight;
if ( m_xPopupMenu.is() )
@@ -341,16 +342,15 @@ void FontSizeMenuController::impl_setPopupMenu()
void SAL_CALL FontSizeMenuController::updatePopupMenu() throw ( ::com::sun::star::uno::RuntimeException )
{
- ResetableGuard aLock( m_aLock );
+ osl::ClearableMutexGuard aLock( m_aMutex );
- if ( m_bDisposed )
- throw DisposedException();
+ throwIfDisposed();
Reference< XDispatch > xDispatch( m_xCurrentFontDispatch );
com::sun::star::util::URL aTargetURL;
aTargetURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CharFontName" ));
m_xURLTransformer->parseStrict( aTargetURL );
- aLock.unlock();
+ aLock.clear();
if ( xDispatch.is() )
{
@@ -358,6 +358,6 @@ void SAL_CALL FontSizeMenuController::updatePopupMenu() throw ( ::com::sun::star
xDispatch->removeStatusListener( SAL_STATIC_CAST( XStatusListener*, this ), aTargetURL );
}
- PopupMenuControllerBase::updatePopupMenu();
+ svt::PopupMenuControllerBase::updatePopupMenu();
}
}
diff --git a/framework/source/uielement/headermenucontroller.cxx b/framework/source/uielement/headermenucontroller.cxx
index 50b2ed65e2d2..c0d7b48a401b 100644
--- a/framework/source/uielement/headermenucontroller.cxx
+++ b/framework/source/uielement/headermenucontroller.cxx
@@ -50,7 +50,6 @@
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
//_________________________________________________________________________________________________________________
// includes of other projects
@@ -65,6 +64,7 @@
#include <rtl/ustrbuf.hxx>
//#include <tools/solar.hrc>
#include <dispatch/uieventloghelper.hxx>
+#include <vos/mutex.hxx>
//_________________________________________________________________________________________________________________
// Defines
@@ -97,7 +97,7 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( HeaderMenuController
DEFINE_INIT_SERVICE ( HeaderMenuController, {} )
HeaderMenuController::HeaderMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager,bool _bFooter ) :
- PopupMenuControllerBase( xServiceManager )
+ svt::PopupMenuControllerBase( xServiceManager )
,m_bFooter(_bFooter)
{
}
@@ -221,7 +221,7 @@ void SAL_CALL HeaderMenuController::disposing( const EventObject& ) throw ( Runt
{
Reference< css::awt::XMenuListener > xHolder(( OWeakObject *)this, UNO_QUERY );
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
m_xFrame.clear();
m_xDispatch.clear();
m_xServiceManager.clear();
@@ -238,7 +238,7 @@ void SAL_CALL HeaderMenuController::statusChanged( const FeatureStateEvent& Even
if ( Event.State >>= xModel )
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
m_xModel = xModel;
if ( m_xPopupMenu.is() )
fillPopupMenu( xModel, m_xPopupMenu );
@@ -258,18 +258,17 @@ void HeaderMenuController::impl_select(const Reference< XDispatch >& _xDispatch,
void SAL_CALL HeaderMenuController::updatePopupMenu() throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aLock( m_aLock );
+ osl::ResettableMutexGuard aLock( m_aMutex );
- if ( m_bDisposed )
- throw DisposedException();
+ throwIfDisposed();
Reference< com::sun::star::frame::XModel > xModel( m_xModel );
- aLock.unlock();
+ aLock.clear();
if ( !xModel.is() )
- PopupMenuControllerBase::updatePopupMenu();
+ svt::PopupMenuControllerBase::updatePopupMenu();
- aLock.lock();
+ aLock.reset();
if ( m_xPopupMenu.is() && m_xModel.is() )
fillPopupMenu( m_xModel, m_xPopupMenu );
}
diff --git a/framework/source/uielement/imagebuttontoolbarcontroller.cxx b/framework/source/uielement/imagebuttontoolbarcontroller.cxx
index 887002335ff8..e883b236584a 100644
--- a/framework/source/uielement/imagebuttontoolbarcontroller.cxx
+++ b/framework/source/uielement/imagebuttontoolbarcontroller.cxx
@@ -46,7 +46,6 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/frame/XControlNotificationListener.hpp>
#include "com/sun/star/util/XMacroExpander.hpp"
#include "com/sun/star/uno/XComponentContext.hpp"
diff --git a/framework/source/uielement/langselectionmenucontroller.cxx b/framework/source/uielement/langselectionmenucontroller.cxx
index 9c8e68e24734..651c9bbfdc86 100644
--- a/framework/source/uielement/langselectionmenucontroller.cxx
+++ b/framework/source/uielement/langselectionmenucontroller.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_framework.hxx"
+
#include <uielement/langselectionmenucontroller.hxx>
//_________________________________________________________________________________________________________________
@@ -63,7 +64,7 @@
#include <com/sun/star/document/XDocumentLanguages.hpp>
#include <com/sun/star/frame/XPopupMenuController.hpp>
#include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
-#include <map>
+
#include <i18npool/mslangid.hxx>
#include <svl/languageoptions.hxx>
#include <com/sun/star/awt/MenuItemStyle.hpp>
@@ -76,6 +77,10 @@
#include <dispatch/uieventloghelper.hxx>
#include "helper/mischelper.hxx"
+#include <vos/mutex.hxx>
+
+#include <map>
+#include <set>
//_________________________________________________________________________________________________________________
// Defines
@@ -88,6 +93,7 @@ using namespace com::sun::star::frame;
using namespace com::sun::star::beans;
using namespace com::sun::star::util;
+using ::rtl::OUString;
namespace framework
{
@@ -101,9 +107,9 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( LanguageSelectionMenuController
DEFINE_INIT_SERVICE ( LanguageSelectionMenuController, {} )
LanguageSelectionMenuController::LanguageSelectionMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
- PopupMenuControllerBase( xServiceManager ),
- m_bShowMenu( sal_True )
- ,m_aLangGuessHelper(xServiceManager)
+ svt::PopupMenuControllerBase( xServiceManager ),
+ m_bShowMenu( sal_True ),
+ m_aLangGuessHelper( xServiceManager )
{
}
@@ -116,7 +122,7 @@ void SAL_CALL LanguageSelectionMenuController::disposing( const EventObject& ) t
{
Reference< css::awt::XMenuListener > xHolder(( OWeakObject *)this, UNO_QUERY );
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
m_xFrame.clear();
m_xDispatch.clear();
m_xLanguageDispatch.clear();
@@ -132,29 +138,25 @@ void SAL_CALL LanguageSelectionMenuController::statusChanged( const FeatureState
{
vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
- if ( m_bDisposed )
+ if (rBHelper.bDisposed || rBHelper.bInDispose)
return;
m_bShowMenu = sal_True;
- m_nScriptType=7;//set the default value
+ m_nScriptType = LS_SCRIPT_LATIN | LS_SCRIPT_ASIAN | LS_SCRIPT_COMPLEX; //set the default value
- rtl::OUString aStrValue;
- Sequence< ::rtl::OUString > aSeq;
+ OUString aStrValue;
+ Sequence< OUString > aSeq;
- if ( Event.State >>= aStrValue )
- {
- m_aCurrentLanguage=aStrValue;
- }
- else if ( Event.State >>= aSeq )
+ if ( Event.State >>= aSeq )
{
if ( aSeq.getLength() == 4 )
{
// Retrieve all other values from the sequence and
// store it members!
- m_aCurLang=aSeq[0];
- m_nScriptType= static_cast< sal_Int16 >(aSeq[1].toInt32());
- m_aKeyboardLang=aSeq[2];
- m_aGuessedText=aSeq[3];
+ m_aCurLang = aSeq[0];
+ m_nScriptType = static_cast< sal_Int16 >(aSeq[1].toInt32());
+ m_aKeyboardLang = aSeq[2];
+ m_aGuessedTextLang = aSeq[3];
}
}
else if ( !Event.State.hasValue() )
@@ -185,14 +187,14 @@ void LanguageSelectionMenuController::impl_select(const Reference< XDispatch >&
{
Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
if ( xDispatchProvider.is() )
- xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
+ xDispatch = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 );
}
if ( xDispatch.is() )
{
Sequence<PropertyValue> aArgs;
if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
- UiEventLogHelper(::rtl::OUString::createFromAscii("LanguageSelectionMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
+ UiEventLogHelper( OUString::createFromAscii("LanguageSelectionMenuController")).log( m_xServiceManager, m_xFrame, aTargetURL, aArgs );
xDispatch->dispatch( aTargetURL, aArgs );
}
}
@@ -207,22 +209,22 @@ void LanguageSelectionMenuController::impl_setPopupMenu()
// Register for language updates
aTargetURL.Complete = m_aLangStatusCommandURL;
m_xURLTransformer->parseStrict( aTargetURL );
- m_xLanguageDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
+ m_xLanguageDispatch = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 );
// Register for setting languages and opening language dialog
aTargetURL.Complete = m_aMenuCommandURL_Lang;
m_xURLTransformer->parseStrict( aTargetURL );
- m_xMenuDispatch_Lang = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
+ m_xMenuDispatch_Lang = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 );
// Register for opening character dialog
aTargetURL.Complete = m_aMenuCommandURL_Font;
m_xURLTransformer->parseStrict( aTargetURL );
- m_xMenuDispatch_Font = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
+ m_xMenuDispatch_Font = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 );
// Register for opening character dialog with preselected paragraph
aTargetURL.Complete = m_aMenuCommandURL_CharDlgForParagraph;
m_xURLTransformer->parseStrict( aTargetURL );
- m_xMenuDispatch_CharDlgForParagraph = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
+ m_xMenuDispatch_CharDlgForParagraph = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 );
}
void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopupMenu , const Mode eMode )
@@ -244,151 +246,91 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
String aCmd_Language;
if( eMode == MODE_SetLanguageSelectionMenu )
{
- aCmd_Dialog+=String::CreateFromAscii(".uno:FontDialog?Language:string=*");
- aCmd_Language+=String::CreateFromAscii(".uno:LanguageStatus?Language:string=Current_");
+ aCmd_Dialog.AppendAscii(".uno:FontDialog?Language:string=*");
+ aCmd_Language.AppendAscii(".uno:LanguageStatus?Language:string=Current_");
}
else if ( eMode == MODE_SetLanguageParagraphMenu )
{
- aCmd_Dialog+=String::CreateFromAscii(".uno:FontDialogForParagraph");
- aCmd_Language+=String::CreateFromAscii(".uno:LanguageStatus?Language:string=Paragraph_");
+ aCmd_Dialog.AppendAscii(".uno:FontDialogForParagraph");
+ aCmd_Language.AppendAscii(".uno:LanguageStatus?Language:string=Paragraph_");
}
else if ( eMode == MODE_SetLanguageAllTextMenu )
{
- aCmd_Dialog+=String::CreateFromAscii(".uno:LanguageStatus?Language:string=*");
- aCmd_Language+=String::CreateFromAscii(".uno:LanguageStatus?Language:string=Default_");
+ aCmd_Dialog.AppendAscii(".uno:LanguageStatus?Language:string=*");
+ aCmd_Language.AppendAscii(".uno:LanguageStatus?Language:string=Default_");
}
- //Reference< awt::XMenuExtended > m_xMenuExtended( m_xPopupMenu, UNO_QUERY );
- std::map< ::rtl::OUString, ::rtl::OUString > LangItems;
-
- SvtLanguageTable aLanguageTable;
- USHORT nItemId = 1;
-
- //1--add current language
- if(m_aCurLang.getLength())
+ SvtLanguageTable aLanguageTable;
+
+ // get languages to be displayed in the menu
+ std::set< OUString > aLangItems;
+ FillLangItems( aLangItems, aLanguageTable, m_xFrame, m_aLangGuessHelper,
+ m_nScriptType, m_aCurLang, m_aKeyboardLang, m_aGuessedTextLang );
+
+ //
+ // now add menu entries
+ // the different menues purpose will be handled by the different string
+ // for aCmd_Dialog and aCmd_Language
+ //
+
+ sal_Int16 nItemId = 1; // in this control the item id is not important for executing the command
+ const OUString sAsterix(RTL_CONSTASCII_USTRINGPARAM("*")); // multiple languages in current selection
+ const OUString sEmpty; // 'no language found' from language guessing
+ std::map< sal_Int16, OUString > aLangMap;
+ std::set< OUString >::const_iterator it;
+ for (it = aLangItems.begin(); it != aLangItems.end(); ++it)
{
- LangItems[m_aCurLang]=m_aCurLang;
- }
-
- SvtLanguageTable aLangTable;
- //2--System
- const AllSettings& rAllSettings=Application::GetSettings();
- LanguageType rSystemLanguage = rAllSettings.GetLanguage();
- if(rSystemLanguage!=LANGUAGE_DONTKNOW)
- {
- if (IsScriptTypeMatchingToLanguage(m_nScriptType,rSystemLanguage ))
- LangItems[::rtl::OUString(aLangTable.GetString(rSystemLanguage))]=::rtl::OUString(aLangTable.GetString(rSystemLanguage));
- }
-
- //3--UI
- LanguageType rUILanguage = rAllSettings.GetUILanguage();
- if(rUILanguage!=LANGUAGE_DONTKNOW)
- {
- if (IsScriptTypeMatchingToLanguage(m_nScriptType, rUILanguage ))
- LangItems[::rtl::OUString(aLangTable.GetString(rUILanguage))]=::rtl::OUString(aLangTable.GetString(rUILanguage));
- }
-
- //4--guessed language
- uno::Reference< linguistic2::XLanguageGuessing > xLangGuesser( m_aLangGuessHelper.GetGuesser() );
- if (xLangGuesser.is() && m_aGuessedText.getLength() > 0)
- {
- ::com::sun::star::lang::Locale aLocale(xLangGuesser->guessPrimaryLanguage( m_aGuessedText, 0, m_aGuessedText.getLength()) );
- LanguageType nLang = MsLangId::convertLocaleToLanguageWithFallback( aLocale );
- if (nLang != LANGUAGE_DONTKNOW && nLang != LANGUAGE_NONE && nLang != LANGUAGE_SYSTEM
- && IsScriptTypeMatchingToLanguage( m_nScriptType, nLang ))
- LangItems[aLangTable.GetString(nLang)]=aLangTable.GetString(nLang);
- }
-
- //5--keyboard language
- if(m_aKeyboardLang!=::rtl::OUString::createFromAscii(""))
- {
- if (IsScriptTypeMatchingToLanguage(m_nScriptType, aLanguageTable.GetType(m_aKeyboardLang)))
- LangItems[m_aKeyboardLang] = m_aKeyboardLang;
- }
-
- //6--all languages used in current document
- Reference< com::sun::star::frame::XModel > xModel;
- if ( m_xFrame.is() )
- {
- Reference< com::sun::star::frame::XController > xController( m_xFrame->getController(), UNO_QUERY );
- if ( xController.is() )
- xModel = xController->getModel();
- }
- Reference< document::XDocumentLanguages > xDocumentLanguages( xModel, UNO_QUERY );
- /*the description of m_nScriptType
- LATIN : 1
- ASIAN : 2
- COMPLEX:4
- LATIN + ASIAN : 3
- LATIN + COMPLEX : 5
- ASIAN + COMPLEX : 6
- LATIN + ASIAN + COMPLEX : 7
- */
-
- sal_Int16 nCount=7;
- if(xDocumentLanguages.is())
- {
- Sequence< Locale > rLocales(xDocumentLanguages->getDocumentLanguages(m_nScriptType,nCount));
- if(rLocales.getLength()>0)
- {
- for(USHORT i = 0; i<rLocales.getLength();++i)
- {
- if (LangItems.size()==7)
- break;
- const Locale& rLocale=rLocales[i];
- if(IsScriptTypeMatchingToLanguage(m_nScriptType, aLanguageTable.GetType(rLocale.Language)))
- LangItems[rLocale.Language] = rLocale.Language;
- }
- }
- }
- std::map< sal_Int16, ::rtl::OUString > LangTable;
-
- const ::rtl::OUString sAsterix(RTL_CONSTASCII_USTRINGPARAM("*"));
- for(std::map< ::rtl::OUString, ::rtl::OUString >::const_iterator it = LangItems.begin(); it != LangItems.end(); ++it)
- {
- if(it->first != ::rtl::OUString( aLangTable.GetString( LANGUAGE_NONE ) )&&
- it->first != sAsterix &&
- it->first.getLength())
+ const OUString & rStr( *it );
+ if (rStr != OUString( aLanguageTable.GetString( LANGUAGE_NONE ) )&&
+ rStr != sAsterix &&
+ rStr != sEmpty)
{
- ++nItemId;
- pPopupMenu->InsertItem( nItemId,it->first);
- LangTable[nItemId] = it->first;
- if(it->first == m_aCurLang && eMode == MODE_SetLanguageSelectionMenu )
+ pPopupMenu->InsertItem( nItemId, rStr );
+ aCmd = aCmd_Language;
+ aCmd += String( rStr );
+ pPopupMenu->SetItemCommand( nItemId, aCmd );
+ if (rStr == m_aCurLang && eMode == MODE_SetLanguageSelectionMenu )
{
//make a sign for the current language
- pPopupMenu->CheckItem(nItemId,TRUE);
+ pPopupMenu->CheckItem( nItemId, TRUE );
}
- aCmd=aCmd_Language;
- aCmd+=(String)it->first;
- pPopupMenu->SetItemCommand(nItemId,aCmd);
+ aLangMap[ nItemId ] = rStr;
+ ++nItemId;
}
}
- //7--none
- nItemId++;
+ // entry for LANGUAGE_NONE
+ ++nItemId;
pPopupMenu->InsertItem( nItemId, String(FwlResId( STR_LANGSTATUS_NONE )) );
aCmd=aCmd_Language;
- aCmd+=String::CreateFromAscii("LANGUAGE_NONE");
- pPopupMenu->SetItemCommand(nItemId,aCmd);
+ aCmd.AppendAscii("LANGUAGE_NONE");
+ pPopupMenu->SetItemCommand( nItemId, aCmd );
+
+ // entry for 'Reset to default language'
+ ++nItemId;
+ pPopupMenu->InsertItem( nItemId, String(FwlResId( STR_RESET_TO_DEFAULT_LANGUAGE )) );
+ aCmd=aCmd_Language;
+ aCmd.AppendAscii("RESET_LANGUAGES");
+ pPopupMenu->SetItemCommand( nItemId, aCmd );
- //More...
- nItemId++;
+ // entry for opening the Format/Character dialog
+ ++nItemId;
pPopupMenu->InsertItem( nItemId, String(FwlResId( STR_LANGSTATUS_MORE )));
- pPopupMenu->SetItemCommand(nItemId,aCmd_Dialog);
+ pPopupMenu->SetItemCommand( nItemId, aCmd_Dialog );
}
void SAL_CALL LanguageSelectionMenuController::updatePopupMenu() throw ( ::com::sun::star::uno::RuntimeException )
{
- PopupMenuControllerBase::updatePopupMenu();
+ svt::PopupMenuControllerBase::updatePopupMenu();
// Force status update to get information about the current languages
- ResetableGuard aLock( m_aLock );
+ osl::ClearableMutexGuard aLock( m_aMutex );
Reference< XDispatch > xDispatch( m_xLanguageDispatch );
com::sun::star::util::URL aTargetURL;
aTargetURL.Complete = m_aLangStatusCommandURL;
m_xURLTransformer->parseStrict( aTargetURL );
- aLock.unlock();
+ aLock.clear();
if ( xDispatch.is() )
{
@@ -415,19 +357,19 @@ void SAL_CALL LanguageSelectionMenuController::updatePopupMenu() throw ( ::com::
// XInitialization
void SAL_CALL LanguageSelectionMenuController::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
sal_Bool bInitalized( m_bInitialized );
if ( !bInitalized )
{
- PopupMenuControllerBase::initialize(aArguments);
+ svt::PopupMenuControllerBase::initialize(aArguments);
if ( m_bInitialized )
{
- m_aLangStatusCommandURL = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:LanguageStatus" ));
+ m_aLangStatusCommandURL = OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:LanguageStatus" ));
m_aMenuCommandURL_Lang = m_aLangStatusCommandURL;
- m_aMenuCommandURL_Font = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontDialog" ));
- m_aMenuCommandURL_CharDlgForParagraph = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontDialogForParagraph" ));
+ m_aMenuCommandURL_Font = OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontDialog" ));
+ m_aMenuCommandURL_CharDlgForParagraph = OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontDialogForParagraph" ));
}
}
}
diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx
index 953470314785..021ee4e8f8df 100644
--- a/framework/source/uielement/langselectionstatusbarcontroller.cxx
+++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_framework.hxx"
+
#include <uielement/langselectionstatusbarcontroller.hxx>
#include <classes/fwkresid.hxx>
#include <services.h>
@@ -53,8 +54,6 @@
#include <com/sun/star/frame/XModule.hpp>
#include <com/sun/star/frame/XModel.hpp>
-#include <map>
-#include <set>
#include <classes/fwkresid.hxx>
#ifndef __FRAMEWORK_CLASSES_RESOURCE_HRC_
#include <classes/resource.hrc>
@@ -74,6 +73,9 @@
#include "helper/mischelper.hxx"
+#include <map>
+#include <set>
+
using namespace ::cppu;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -82,9 +84,14 @@ using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::i18n;
using namespace ::com::sun::star::document;
+using ::rtl::OUString;
+
+
namespace framework
{
+////////////////////////////////////////////////////////////
+
DEFINE_XSERVICEINFO_MULTISERVICE ( LangSelectionStatusbarController ,
OWeakObject ,
SERVICENAME_STATUSBARCONTROLLER ,
@@ -94,10 +101,10 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( LangSelectionStatusbarController
DEFINE_INIT_SERVICE ( LangSelectionStatusbarController, {} )
LangSelectionStatusbarController::LangSelectionStatusbarController( const uno::Reference< lang::XMultiServiceFactory >& xServiceManager ) :
- svt::StatusbarController( xServiceManager, uno::Reference< frame::XFrame >(), rtl::OUString(), 0 ),
+ svt::StatusbarController( xServiceManager, uno::Reference< frame::XFrame >(), OUString(), 0 ),
m_bShowMenu( sal_True ),
- m_nScriptType( 7 )
- ,m_aLangGuessHelper(xServiceManager)
+ m_nScriptType( LS_SCRIPT_LATIN | LS_SCRIPT_ASIAN | LS_SCRIPT_COMPLEX ),
+ m_aLangGuessHelper( xServiceManager )
{
}
@@ -178,216 +185,158 @@ throw (::com::sun::star::uno::RuntimeException)
return sal_False;
}
-void LangSelectionStatusbarController::LangMenu()throw (::com::sun::star::uno::RuntimeException)
+void LangSelectionStatusbarController::LangMenu()
+throw (::com::sun::star::uno::RuntimeException)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::LangMenu" );
if (!m_bShowMenu)
return;
//add context menu
- const static ::rtl::OUString s_sPopupMenu(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.PopupMenu"));
+ const static OUString s_sPopupMenu(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.PopupMenu"));
Reference< awt::XPopupMenu > xPopupMenu( m_xServiceManager->createInstance( s_sPopupMenu ), UNO_QUERY );
//sub menu that contains all items except the last two items: Separator + Set Language for Paragraph
Reference< awt::XPopupMenu > subPopupMenu(m_xServiceManager->createInstance( s_sPopupMenu ), UNO_QUERY );
- std::set< ::rtl::OUString > LangItems;
-
- SvtLanguageTable aLanguageTable;
- USHORT nItemId=1;
-
- //1--add current language
- if( m_aCurLang != ::rtl::OUString( ) &&
- LANGUAGE_DONTKNOW != aLanguageTable.GetType( m_aCurLang ))
- LangItems.insert( m_aCurLang );
-
- //2--System
- SvtLanguageTable aLangTable;
- const AllSettings& rAllSettings = Application::GetSettings();
- LanguageType rSystemLanguage = rAllSettings.GetLanguage();
- if( rSystemLanguage != LANGUAGE_DONTKNOW )
- {
- if ( IsScriptTypeMatchingToLanguage( m_nScriptType, rSystemLanguage ))
- LangItems.insert( ::rtl::OUString( aLangTable.GetString( rSystemLanguage )) );
- }
-
- //3--UI
- LanguageType rUILanguage = rAllSettings.GetUILanguage();
- if( rUILanguage != LANGUAGE_DONTKNOW )
- {
- if ( IsScriptTypeMatchingToLanguage( m_nScriptType, rUILanguage ))
- LangItems.insert( ::rtl::OUString( aLangTable.GetString( rUILanguage )) );
- }
-
- //4--guessed language
- uno::Reference< linguistic2::XLanguageGuessing > xLangGuesser( m_aLangGuessHelper.GetGuesser() );
- if ( xLangGuesser.is() && m_aGuessedText.getLength() > 0)
- {
- ::com::sun::star::lang::Locale aLocale(xLangGuesser->guessPrimaryLanguage( m_aGuessedText, 0, m_aGuessedText.getLength()) );
- LanguageType nLang = MsLangId::convertLocaleToLanguageWithFallback( aLocale );
- if (nLang != LANGUAGE_DONTKNOW && nLang != LANGUAGE_NONE && nLang != LANGUAGE_SYSTEM
- && IsScriptTypeMatchingToLanguage( m_nScriptType, nLang ))
- LangItems.insert( aLangTable.GetString( nLang ));
- }
-
- //5--keyboard language
- if( m_aKeyboardLang != ::rtl::OUString::createFromAscii( "" ))
+ SvtLanguageTable aLanguageTable;
+
+ // get languages to be displayed in the menu
+ std::set< OUString > aLangItems;
+ FillLangItems( aLangItems, aLanguageTable, m_xFrame, m_aLangGuessHelper,
+ m_nScriptType, m_aCurLang, m_aKeyboardLang, m_aGuessedTextLang );
+
+ //
+ // add first few entries to main menu
+ //
+ sal_Int16 nItemId = static_cast< sal_Int16 >(MID_LANG_SEL_1);
+ const OUString sAsterix(RTL_CONSTASCII_USTRINGPARAM("*")); // multiple languages in current selection
+ const OUString sEmpty; // 'no language found' from language guessing
+ std::map< sal_Int16, OUString > aLangMap;
+ std::set< OUString >::const_iterator it;
+ for (it = aLangItems.begin(); it != aLangItems.end(); ++it)
{
- if ( IsScriptTypeMatchingToLanguage( m_nScriptType, aLanguageTable.GetType( m_aKeyboardLang )))
- LangItems.insert( m_aKeyboardLang );
- }
-
- //6--all languages used in current document
- Reference< com::sun::star::frame::XModel > xModel;
- if ( m_xFrame.is() )
- {
- Reference< com::sun::star::frame::XController > xController( m_xFrame->getController(), UNO_QUERY );
- if ( xController.is() )
- xModel = xController->getModel();
- }
- Reference< document::XDocumentLanguages > xDocumentLanguages( xModel, UNO_QUERY );
- /*the description of m_nScriptType
- LATIN : 1
- ASIAN : 2
- COMPLEX:4
- LATIN + ASIAN : 3
- LATIN + COMPLEX : 5
- ASIAN + COMPLEX : 6
- LATIN + ASIAN + COMPLEX : 7
- */
-
- sal_Int16 nCount=7;
- if ( xDocumentLanguages.is() )
- {
- Sequence< Locale > rLocales( xDocumentLanguages->getDocumentLanguages( m_nScriptType, nCount ));
- if ( rLocales.getLength() > 0 )
+ const OUString & rStr( *it );
+ if ( rStr != OUString( aLanguageTable.GetString( LANGUAGE_NONE ) ) &&
+ rStr != sAsterix &&
+ rStr != sEmpty)
{
- for ( USHORT i = 0; i<rLocales.getLength();++i )
- {
- if ( LangItems.size() == 7 )
- break;
- const Locale& rLocale=rLocales[i];
- if( IsScriptTypeMatchingToLanguage( m_nScriptType, aLangTable.GetType( rLocale.Language )))
- LangItems.insert( ::rtl::OUString( rLocale.Language ) );
- }
- }
- }
- std::map< sal_Int16, ::rtl::OUString > LangTable;
-
- for( std::set< ::rtl::OUString >::const_iterator it = LangItems.begin(); it != LangItems.end(); ++it )
- {
- if ( *it != ::rtl::OUString( aLangTable.GetString( LANGUAGE_NONE ) )&&
- *it != ::rtl::OUString::createFromAscii( "*" ) &&
- *it != ::rtl::OUString::createFromAscii( "" ))
- {
- //nItemId = xPopupMenu->getItemCount()+1;
- nItemId++;
- xPopupMenu->insertItem( nItemId, *it, css::awt::MenuItemStyle::RADIOCHECK, nItemId );
- LangTable[nItemId]=*it;
- if( *it == m_aCurLang )
+ DBG_ASSERT( MID_LANG_SEL_1 <= nItemId && nItemId <= MID_LANG_SEL_9,
+ "nItemId outside of expected range!" );
+ xPopupMenu->insertItem( nItemId, rStr, css::awt::MenuItemStyle::RADIOCHECK, nItemId );
+ if ( rStr == m_aCurLang )
{
//make a sign for the current language
xPopupMenu->checkItem( nItemId, TRUE );
}
+ aLangMap[ nItemId ] = rStr;
+ ++nItemId;
}
}
-
- //7--none
- nItemId++;
- xPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_NONE )), css::awt::MenuItemStyle::RADIOCHECK, nItemId );
- //More...
- nItemId++;
- xPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_MORE )), css::awt::MenuItemStyle::RADIOCHECK, nItemId );
-
- for( ::std::set< ::rtl::OUString >::const_iterator it = LangItems.begin(); it != LangItems.end(); ++it )
+ xPopupMenu->insertItem( MID_LANG_SEL_NONE, String( FwkResId( STR_LANGSTATUS_NONE )), css::awt::MenuItemStyle::RADIOCHECK, MID_LANG_SEL_NONE );
+ xPopupMenu->insertItem( MID_LANG_SEL_RESET, String( FwkResId( STR_RESET_TO_DEFAULT_LANGUAGE )), css::awt::MenuItemStyle::RADIOCHECK, MID_LANG_SEL_RESET );
+ xPopupMenu->insertItem( MID_LANG_SEL_MORE, String( FwkResId( STR_LANGSTATUS_MORE )), css::awt::MenuItemStyle::RADIOCHECK, MID_LANG_SEL_MORE );
+
+ //
+ // add entries to submenu ('set language for paragraph')
+ //
+ nItemId = static_cast< sal_Int16 >(MID_LANG_PARA_1);
+ for (it = aLangItems.begin(); it != aLangItems.end(); ++it)
{
- if( *it != ::rtl::OUString( aLangTable.GetString( LANGUAGE_NONE ) )&&
- *it != ::rtl::OUString::createFromAscii( "*" ) &&
- *it != ::rtl::OUString::createFromAscii( "" ))
+ const OUString & rStr( *it );
+ if( rStr != OUString( aLanguageTable.GetString( LANGUAGE_NONE ) )&&
+ rStr != sAsterix &&
+ rStr != sEmpty)
{
- nItemId++;
- subPopupMenu->insertItem( nItemId, *it, css::awt::MenuItemStyle::RADIOCHECK, nItemId );
- LangTable[nItemId]=*it;
+ DBG_ASSERT( MID_LANG_PARA_1 <= nItemId && nItemId <= MID_LANG_PARA_9,
+ "nItemId outside of expected range!" );
+ subPopupMenu->insertItem( nItemId, rStr, css::awt::MenuItemStyle::RADIOCHECK, nItemId );
+ aLangMap[nItemId] = rStr;
+ ++nItemId;
}
}
- //7--none
- nItemId++;
- subPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_NONE )), css::awt::MenuItemStyle::RADIOCHECK, nItemId );
- //More
- nItemId++;
- subPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_MORE )), css::awt::MenuItemStyle::RADIOCHECK, nItemId );
+ subPopupMenu->insertItem( MID_LANG_PARA_NONE, String( FwkResId( STR_LANGSTATUS_NONE )), css::awt::MenuItemStyle::RADIOCHECK, MID_LANG_PARA_NONE );
+ subPopupMenu->insertItem( MID_LANG_PARA_RESET, String( FwkResId( STR_RESET_TO_DEFAULT_LANGUAGE )), css::awt::MenuItemStyle::RADIOCHECK, MID_LANG_PARA_RESET );
+ subPopupMenu->insertItem( MID_LANG_PARA_MORE, String( FwkResId( STR_LANGSTATUS_MORE )), css::awt::MenuItemStyle::RADIOCHECK, MID_LANG_PARA_MORE );
- nItemId++;
- xPopupMenu->insertSeparator(nItemId);
+ //
+ // add last two entries to main menu
+ //
+ xPopupMenu->insertSeparator( MID_LANG_PARA_SEPERATOR );
+ xPopupMenu->insertItem( MID_LANG_PARA_STRING, String( FwkResId( STR_SET_LANGUAGE_FOR_PARAGRAPH )), css::awt::MenuItemStyle::RADIOCHECK, MID_LANG_PARA_STRING );
+ xPopupMenu->setPopupMenu( MID_LANG_PARA_STRING, subPopupMenu );
- nItemId++;
- xPopupMenu->insertItem( nItemId, String( FwkResId( STR_SET_LANGUAGE_FOR_PARAGRAPH )), css::awt::MenuItemStyle::RADIOCHECK, nItemId );
- xPopupMenu->setPopupMenu( nItemId, subPopupMenu );
- //display the popup menu and execute every command
+ //
+ // now display the popup menu and execute every command ...
+ //
Reference< awt::XWindowPeer > xParent( m_xParentWindow, UNO_QUERY );
- com::sun::star::awt::Rectangle mRectangle;
+ com::sun::star::awt::Rectangle aRectangle;
Window* pWindow = VCLUnoHelper::GetWindow( m_xParentWindow );
const Point mMousePos = pWindow->GetPointerPosPixel();
- mRectangle.X = mMousePos.X();
- mRectangle.Y = mMousePos.Y();
- sal_Int16 nId = xPopupMenu->execute( xParent, mRectangle, com::sun::star::awt::PopupMenuDirection::EXECUTE_UP+16 );
+ aRectangle.X = mMousePos.X();
+ aRectangle.Y = mMousePos.Y();
+ sal_Int16 nId = xPopupMenu->execute( xParent, aRectangle, com::sun::star::awt::PopupMenuDirection::EXECUTE_UP+16 );
//click "More..."
if ( nId && m_xFrame.is() )
{
uno::Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
util::URL aURL;
- if ( nId < nItemId-3-subPopupMenu->getItemCount() )
+ if (MID_LANG_SEL_1 <= nId && nId <= MID_LANG_SEL_9)
{
- //1..7
//set selected language as current language for selection
- String SelectedLang = LangTable[nId];
- aURL.Complete+=String::CreateFromAscii(".uno:LanguageStatus?Language:string=Current_");
- aURL.Complete+=SelectedLang;
+ String aSelectedLang = aLangMap[nId];
+ aURL.Complete += OUString::createFromAscii(".uno:LanguageStatus?Language:string=Current_");
+ aURL.Complete += aSelectedLang;
}
- else if ( nId == nItemId-3-subPopupMenu->getItemCount() )
+ else if (nId == MID_LANG_SEL_NONE)
{
- //8
//set None as current language for selection
- aURL.Complete+=String::CreateFromAscii(".uno:LanguageStatus?Language:string=Current_LANGUAGE_NONE");
+ aURL.Complete += OUString::createFromAscii(".uno:LanguageStatus?Language:string=Current_LANGUAGE_NONE");
+ }
+ else if (nId == MID_LANG_SEL_RESET)
+ {
+ // reset language attributes for selection
+ aURL.Complete += OUString::createFromAscii(".uno:LanguageStatus?Language:string=Current_RESET_LANGUAGES");
}
- else if ( nId == nItemId-2-subPopupMenu->getItemCount() )
+ else if (nId == MID_LANG_SEL_MORE)
{
- //9 (more)...
//open the dialog "format/character" for current selection
- aURL.Complete+=String::CreateFromAscii(".uno:FontDialog?Language:string=*");
+ aURL.Complete += OUString::createFromAscii(".uno:FontDialog?Language:string=*");
}
- else if ( nId < nItemId-3 && nId>nItemId-2-subPopupMenu->getItemCount() )
+ else if (MID_LANG_PARA_1 <= nId && nId <= MID_LANG_PARA_9)
{
- //1..7 para
//set selected language for current paragraph
- String SelectedLang = LangTable[nId];
- aURL.Complete+=String::CreateFromAscii(".uno:LanguageStatus?Language:string=Paragraph_");
- aURL.Complete+=SelectedLang;
+ String aSelectedLang = aLangMap[nId];
+ aURL.Complete += OUString::createFromAscii(".uno:LanguageStatus?Language:string=Paragraph_");
+ aURL.Complete += aSelectedLang;
}
- else if ( nId==nItemId-3 )
+ else if (nId == MID_LANG_PARA_NONE)
{
- //8 para
//set None as language for current paragraph
- aURL.Complete+=String::CreateFromAscii(".uno:LanguageStatus?Language:string=Paragraph_LANGUAGE_NONE");
+ aURL.Complete += OUString::createFromAscii(".uno:LanguageStatus?Language:string=Paragraph_LANGUAGE_NONE");
}
- else if ( nId==nItemId-2 )
+ else if (nId == MID_LANG_PARA_RESET)
+ {
+ // reset language attributes for paragraph
+ aURL.Complete += OUString::createFromAscii(".uno:LanguageStatus?Language:string=Paragraph_RESET_LANGUAGES");
+ }
+ else if (nId == MID_LANG_PARA_MORE)
{
- //9 (more) para...
//open the dialog "format/character" for current paragraph
- aURL.Complete+=String::CreateFromAscii(".uno:FontDialogForParagraph");
+ aURL.Complete += OUString::createFromAscii(".uno:FontDialogForParagraph");
}
- uno::Reference< util::XURLTransformer > xURLTransformer( m_xServiceManager->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), uno::UNO_QUERY );
+ uno::Reference< util::XURLTransformer > xURLTransformer( m_xServiceManager->createInstance( OUString::createFromAscii("com.sun.star.util.URLTransformer" )), uno::UNO_QUERY );
xURLTransformer->parseStrict( aURL );
- uno::Reference< XDispatch > xDispatch = xDispatchProvider->queryDispatch(aURL,::rtl::OUString(),0);
+ uno::Reference< XDispatch > xDispatch = xDispatchProvider->queryDispatch(aURL, OUString(), 0);
if( xDispatch.is() )
{
uno::Sequence< beans::PropertyValue > aPV;
if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
- UiEventLogHelper(::rtl::OUString::createFromAscii("ButtonToolbarController")).log(m_xServiceManager, m_xFrame, aURL, aPV);
+ UiEventLogHelper( OUString::createFromAscii("ButtonToolbarController")).log(m_xServiceManager, m_xFrame, aURL, aPV);
xDispatch->dispatch( aURL, aPV);
}
}
@@ -436,6 +385,13 @@ throw (::com::sun::star::uno::RuntimeException)
void SAL_CALL LangSelectionStatusbarController::statusChanged( const FeatureStateEvent& Event )
throw ( RuntimeException )
{
+ // This function will be called when observed data changes,
+ // for example the selection or keyboard language.
+ // - It displays the language in use in the status bar
+ // - and it stores the relevant data for creating the menu
+ // at some later point in the member variables
+ // m_nScriptType, m_aCurLang, m_aKeyboardLang, m_aGuessedText
+
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::statusChanged" );
vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
@@ -444,25 +400,22 @@ throw ( RuntimeException )
m_bShowMenu = sal_True;
- m_nScriptType=7;//set the default value
+ m_nScriptType = LS_SCRIPT_LATIN | LS_SCRIPT_ASIAN | LS_SCRIPT_COMPLEX; //set the default value
Window* pWindow = VCLUnoHelper::GetWindow( m_xParentWindow );
if ( pWindow && pWindow->GetType() == WINDOW_STATUSBAR && m_nID != 0 )
{
- rtl::OUString aStrValue;
- Sequence< ::rtl::OUString > aSeq;
+ OUString aStrValue;
+ Sequence< OUString > aSeq;
StatusBar* pStatusBar = (StatusBar *)pWindow;
if ( Event.State >>= aStrValue )
- {
pStatusBar->SetItemText( m_nID, aStrValue );
- m_aCurrentLanguage = aStrValue;
- }
else if ( Event.State >>= aSeq )
{
if ( aSeq.getLength() == 4 )
{
const String aMultipleLangText( FwkResId( STR_LANGSTATUS_MULTIPLE_LANGUAGES ) );
- ::rtl::OUString aStatusText = aSeq[0];
+ OUString aStatusText = aSeq[0];
if ( 0 == aStatusText.compareToAscii( "*" ))
aStatusText = aMultipleLangText;
pStatusBar->SetItemText( m_nID, aStatusText );
@@ -472,7 +425,7 @@ throw ( RuntimeException )
m_aCurLang = aSeq[0];
m_nScriptType = static_cast< sal_Int16 >( aSeq[1].toInt32() );
m_aKeyboardLang = aSeq[2];
- m_aGuessedText = aSeq[3];
+ m_aGuessedTextLang = aSeq[3];
}
}
else if ( !Event.State.hasValue() )
diff --git a/framework/source/uielement/macrosmenucontroller.cxx b/framework/source/uielement/macrosmenucontroller.cxx
index 7424b871a05f..679067cbd5c3 100644
--- a/framework/source/uielement/macrosmenucontroller.cxx
+++ b/framework/source/uielement/macrosmenucontroller.cxx
@@ -48,6 +48,7 @@
#include <rtl/ustrbuf.hxx>
#include <dispatch/uieventloghelper.hxx>
#include "helper/mischelper.hxx"
+#include <vos/mutex.hxx>
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
@@ -70,7 +71,7 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( MacrosMenuController
DEFINE_INIT_SERVICE ( MacrosMenuController, {} )
MacrosMenuController::MacrosMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
- PopupMenuControllerBase( xServiceManager ),
+ svt::PopupMenuControllerBase( xServiceManager ),
m_xServiceManager( xServiceManager)
{
}
@@ -92,6 +93,9 @@ void MacrosMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPo
if ( pVCLPopupMenu )
pPopupMenu = (PopupMenu *)pVCLPopupMenu->GetMenu();
+ if (!pPopupMenu)
+ return;
+
// insert basic
String aCommand = String::CreateFromAscii( ".uno:MacroDialog" );
String aDisplayName = RetrieveLabelFromCommand( aCommand );
@@ -109,7 +113,7 @@ void SAL_CALL MacrosMenuController::disposing( const EventObject& ) throw ( Runt
{
Reference< css::awt::XMenuListener > xHolder(( OWeakObject *)this, UNO_QUERY );
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
OSL_TRACE("disposing");
m_xFrame.clear();
m_xDispatch.clear();
@@ -126,7 +130,7 @@ void SAL_CALL MacrosMenuController::disposing( const EventObject& ) throw ( Runt
// XStatusListener
void SAL_CALL MacrosMenuController::statusChanged( const FeatureStateEvent& ) throw ( RuntimeException )
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
if ( m_xPopupMenu.is() )
{
fillPopupMenu( m_xPopupMenu );
diff --git a/framework/source/uielement/makefile.mk b/framework/source/uielement/makefile.mk
index 76ec935cac78..367ba52a3fdc 100644
--- a/framework/source/uielement/makefile.mk
+++ b/framework/source/uielement/makefile.mk
@@ -76,6 +76,7 @@ SLOFILES= \
$(SLO)$/toolbarmerger.obj \
$(SLO)$/toolbarsmenucontroller.obj \
$(SLO)$/toolbarwrapper.obj \
+ $(SLO)$/popupmenucontroller.obj \
$(SLO)$/uicommanddescription.obj \
# --- Targets ------------------------------------------------------
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 40473d0775a1..4459de78fb3f 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -548,11 +548,14 @@ throw ( RuntimeException )
if ( Event.State >>= bCheckmark )
{
- // Checkmark
+ // Checkmark or RadioButton
m_pVCLMenu->ShowItem( pMenuItemHandler->nItemId, TRUE );
m_pVCLMenu->CheckItem( pMenuItemHandler->nItemId, bCheckmark );
- m_pVCLMenu->SetItemBits( pMenuItemHandler->nItemId,
- m_pVCLMenu->GetItemBits( pMenuItemHandler->nItemId ) | MIB_CHECKABLE );
+
+ MenuItemBits nBits = m_pVCLMenu->GetItemBits( pMenuItemHandler->nItemId );
+ //If not already designated RadioButton set as CheckMark
+ if (!(nBits & MIB_RADIOCHECK))
+ m_pVCLMenu->SetItemBits( pMenuItemHandler->nItemId, nBits | MIB_CHECKABLE );
}
else if ( Event.State >>= aItemText )
{
@@ -1805,6 +1808,8 @@ void MenuBarManager::FillMenu(
nBits |= MIB_ICON;
if ( nStyle & ::com::sun::star::ui::ItemStyle::TEXT )
nBits |= MIB_TEXT;
+ if ( nStyle & ::com::sun::star::ui::ItemStyle::RADIO_CHECK )
+ nBits |= MIB_RADIOCHECK;
pMenu->SetItemBits( nId, nBits );
}
if ( xIndexContainer.is() )
diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx
index 3007816ad888..8ae7842d07fd 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -67,6 +67,7 @@
#include <svtools/acceleratorexecute.hxx>
#include <unotools/moduleoptions.hxx>
#include <dispatch/uieventloghelper.hxx>
+#include <vos/mutex.hxx>
//_________________________________________________________________________________________________________________
// Defines
@@ -326,7 +327,7 @@ void NewMenuController::retrieveShortcutsFromConfiguration(
}
NewMenuController::NewMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
- PopupMenuControllerBase( xServiceManager ),
+ svt::PopupMenuControllerBase( xServiceManager ),
m_bShowImages( sal_True ),
m_bHiContrast( sal_False ),
m_bNewMenu( sal_False ),
@@ -399,7 +400,7 @@ void SAL_CALL NewMenuController::disposing( const EventObject& ) throw ( Runtime
{
Reference< css::awt::XMenuListener > xHolder(( OWeakObject *)this, UNO_QUERY );
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
m_xFrame.clear();
m_xDispatch.clear();
m_xServiceManager.clear();
@@ -423,12 +424,12 @@ void SAL_CALL NewMenuController::select( const css::awt::MenuEvent& rEvent ) thr
Reference< XMultiServiceFactory > xServiceManager;
Reference< XURLTransformer > xURLTransformer;
- ResetableGuard aLock( m_aLock );
+ osl::ClearableMutexGuard aLock( m_aMutex );
xPopupMenu = m_xPopupMenu;
xDispatchProvider = Reference< XDispatchProvider >( m_xFrame, UNO_QUERY );
xServiceManager = m_xServiceManager;
xURLTransformer = m_xURLTransformer;
- aLock.unlock();
+ aLock.clear();
css::util::URL aTargetURL;
Sequence< PropertyValue > aArgsList( 1 );
@@ -548,12 +549,12 @@ void NewMenuController::impl_setPopupMenu()
// XInitialization
void SAL_CALL NewMenuController::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
sal_Bool bInitalized( m_bInitialized );
if ( !bInitalized )
{
- PopupMenuControllerBase::initialize( aArguments );
+ svt::PopupMenuControllerBase::initialize( aArguments );
if ( m_bInitialized )
{
diff --git a/framework/source/uielement/objectmenucontroller.cxx b/framework/source/uielement/objectmenucontroller.cxx
index f4d6aea0d82b..80dccb76db05 100644
--- a/framework/source/uielement/objectmenucontroller.cxx
+++ b/framework/source/uielement/objectmenucontroller.cxx
@@ -59,6 +59,7 @@
#include <tools/urlobj.hxx>
#include <rtl/ustrbuf.hxx>
#include <dispatch/uieventloghelper.hxx>
+#include <vos/mutex.hxx>
//_________________________________________________________________________________________________________________
// Defines
@@ -83,7 +84,7 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( ObjectMenuController
DEFINE_INIT_SERVICE ( ObjectMenuController, {} )
ObjectMenuController::ObjectMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
- PopupMenuControllerBase( xServiceManager )
+ svt::PopupMenuControllerBase( xServiceManager )
{
}
@@ -128,7 +129,7 @@ void SAL_CALL ObjectMenuController::disposing( const EventObject& ) throw ( Runt
{
Reference< css::awt::XMenuListener > xHolder(( OWeakObject *)this, UNO_QUERY );
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
m_xFrame.clear();
m_xDispatch.clear();
m_xObjectUpdateDispatch.clear();
@@ -145,7 +146,7 @@ void SAL_CALL ObjectMenuController::statusChanged( const FeatureStateEvent& Even
Sequence < com::sun::star::embed::VerbDescriptor > aVerbCommandSeq;
if ( Event.State >>= aVerbCommandSeq )
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
if ( m_xPopupMenu.is() )
fillPopupMenu( aVerbCommandSeq, m_xPopupMenu );
}
diff --git a/framework/source/uielement/popupmenucontroller.cxx b/framework/source/uielement/popupmenucontroller.cxx
new file mode 100644
index 000000000000..328777db2b79
--- /dev/null
+++ b/framework/source/uielement/popupmenucontroller.cxx
@@ -0,0 +1,248 @@
+/*************************************************************************
+ *
+ * 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_framework.hxx"
+
+#include <com/sun/star/awt/XPopupMenu.hpp>
+#include <com/sun/star/frame/XPopupMenuController.hpp>
+
+#include <toolkit/helper/vclunohelper.hxx>
+//#include <toolkit/unohlp.hxx>
+
+#include <rtl/ref.hxx>
+
+#include <vcl/toolbox.hxx>
+#include <vcl/menu.hxx>
+#include <vcl/svapp.hxx>
+#include <vos/mutex.hxx>
+
+#include "uielement/popupmenucontroller.hxx"
+#include "services.h"
+
+using rtl::OUString;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::beans;
+
+// --------------------------------------------------------------------
+
+
+namespace framework
+{
+
+DEFINE_XSERVICEINFO_MULTISERVICE ( PopupMenuController ,
+ OWeakObject ,
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ) ) ,
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.framework.PopupMenuController" ) )
+ )
+
+DEFINE_INIT_SERVICE ( PopupMenuController, {} )
+
+class PopupMenuControllerImpl
+{
+};
+
+//========================================================================
+// class PopupMenuController
+//========================================================================
+
+PopupMenuController::PopupMenuController( const Reference< lang::XMultiServiceFactory >& rServiceManager )
+: svt::ToolboxController( rServiceManager, Reference< frame::XFrame >(), OUString() )
+{
+}
+
+// --------------------------------------------------------------------
+
+PopupMenuController::~PopupMenuController()
+{
+}
+
+// --------------------------------------------------------------------
+// XInterface
+// --------------------------------------------------------------------
+
+Any SAL_CALL PopupMenuController::queryInterface( const Type& aType ) throw (RuntimeException)
+{
+ Any a( ToolboxController::queryInterface( aType ) );
+ if ( a.hasValue() )
+ return a;
+
+ return ::cppu::queryInterface( aType, static_cast< lang::XServiceInfo* >( this ));
+}
+
+// --------------------------------------------------------------------
+
+void SAL_CALL PopupMenuController::acquire() throw ()
+{
+ ToolboxController::acquire();
+}
+
+// --------------------------------------------------------------------
+
+void SAL_CALL PopupMenuController::release() throw ()
+{
+ ToolboxController::release();
+}
+
+// --------------------------------------------------------------------
+// XComponent
+// --------------------------------------------------------------------
+
+void SAL_CALL PopupMenuController::dispose() throw (RuntimeException)
+{
+ if( mxPopupMenuController.is() )
+ {
+ Reference< XComponent > xComponent( mxPopupMenuController, UNO_QUERY );
+ if( xComponent.is() )
+ xComponent->dispose();
+ mxPopupMenuController.clear();
+ }
+
+ mxPopupMenu.clear();
+
+ svt::ToolboxController::dispose();
+}
+
+// --------------------------------------------------------------------
+// XStatusListener
+// --------------------------------------------------------------------
+
+void SAL_CALL PopupMenuController::statusChanged( const frame::FeatureStateEvent& rEvent ) throw ( RuntimeException )
+{
+ svt::ToolboxController::statusChanged(rEvent);
+ enable( rEvent.IsEnabled );
+}
+
+// --------------------------------------------------------------------
+// XToolbarController
+// --------------------------------------------------------------------
+
+void SAL_CALL PopupMenuController::execute( sal_Int16 KeyModifier ) throw (RuntimeException)
+{
+ svt::ToolboxController::execute( KeyModifier );
+}
+
+// --------------------------------------------------------------------
+
+void SAL_CALL PopupMenuController::click() throw (RuntimeException)
+{
+ svt::ToolboxController::click();
+}
+
+// --------------------------------------------------------------------
+
+void SAL_CALL PopupMenuController::doubleClick() throw (RuntimeException)
+{
+ svt::ToolboxController::doubleClick();
+}
+
+// --------------------------------------------------------------------
+
+bool PopupMenuController::CreatePopupMenuController() throw (Exception)
+{
+ Reference< XMultiComponentFactory > xPopupMenuControllerRegistration( getServiceManager()->createInstance( SERVICENAME_POPUPMENUCONTROLLERFACTORY ), UNO_QUERY_THROW );
+
+ Sequence< Any > aSeq( 2 );
+ PropertyValue aPropValue;
+
+ aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ModuleName" ));
+ aPropValue.Value <<= getModuleName();
+ aSeq[0] <<= aPropValue;
+ aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Frame" ));
+ aPropValue.Value <<= m_xFrame;
+ aSeq[1] <<= aPropValue;
+
+ Reference< XPropertySet > xProps( getServiceManager(), UNO_QUERY_THROW );
+ Reference< XComponentContext > xComponentContext( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY_THROW );
+
+ Reference< XPopupMenuController > xPopupMenuController( xPopupMenuControllerRegistration->createInstanceWithArgumentsAndContext( getCommandURL(), aSeq, xComponentContext ), UNO_QUERY );
+ if ( xPopupMenuController.is() )
+ {
+ mxPopupMenuController = xPopupMenuController;
+ return true;
+ }
+ return false;
+}
+
+Reference< awt::XWindow > SAL_CALL PopupMenuController::createPopupWindow() throw (RuntimeException)
+{
+ ::vos::OGuard aSolarLock(Application::GetSolarMutex());
+
+ Reference< awt::XWindow > xRet;
+
+ try
+ {
+ ToolBox* pToolBox = dynamic_cast< ToolBox* >( VCLUnoHelper::GetWindow( getParent() ) );
+ if( !pToolBox )
+ return xRet;
+
+ // get selected button
+ USHORT nItemId = pToolBox->GetDownItemId();
+ if( !nItemId )
+ return xRet;
+
+ ::Rectangle aRect( pToolBox->GetItemRect( nItemId ) );
+
+ if( !mxPopupMenuController.is() && !CreatePopupMenuController() )
+ return xRet;
+
+ if( !mxPopupMenu.is() )
+ {
+ mxPopupMenu = Reference< awt::XPopupMenu >( getServiceManager()->createInstance( DECLARE_ASCII( "stardiv.Toolkit.VCLXPopupMenu" ) ), UNO_QUERY_THROW );
+ mxPopupMenuController->setPopupMenu( mxPopupMenu );
+ }
+ else
+ {
+ mxPopupMenuController->updatePopupMenu();
+
+ }
+ pToolBox->SetItemDown( nItemId, TRUE );
+ Reference< awt::XWindowPeer > xPeer( getParent(), UNO_QUERY_THROW );
+ mxPopupMenu->execute( xPeer, VCLUnoHelper::ConvertToAWTRect( aRect ), 0 );
+ pToolBox->SetItemDown( nItemId, FALSE );
+ }
+ catch( Exception& )
+ {
+ }
+
+ return xRet;
+}
+
+// --------------------------------------------------------------------
+
+Reference< awt::XWindow > SAL_CALL PopupMenuController::createItemWindow( const Reference< awt::XWindow >& /*Parent*/ ) throw (RuntimeException)
+{
+ return Reference< awt::XWindow >();
+}
+
+// --------------------------------------------------------------------
+
+}
+
diff --git a/framework/source/uielement/progressbarwrapper.cxx b/framework/source/uielement/progressbarwrapper.cxx
index 2cd0ed891db6..a20f107ea22e 100644
--- a/framework/source/uielement/progressbarwrapper.cxx
+++ b/framework/source/uielement/progressbarwrapper.cxx
@@ -43,6 +43,7 @@
// interface includes
//_________________________________________________________________________________________________________________
#include <com/sun/star/ui/UIElementType.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
//_________________________________________________________________________________________________________________
// includes of other projects
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx
index cec95485dacd..64f05ed642cb 100644
--- a/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/framework/source/uielement/recentfilesmenucontroller.cxx
@@ -47,7 +47,6 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/awt/MenuItemStyle.hpp>
#include <com/sun/star/util/XStringWidth.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
//_________________________________________________________________________________________________________________
// includes of other projects
//_________________________________________________________________________________________________________________
@@ -64,6 +63,7 @@
#include <osl/file.hxx>
//#include <tools/solar.hrc>
#include <dispatch/uieventloghelper.hxx>
+#include <vos/mutex.hxx>
//_________________________________________________________________________________________________________________
// Defines
@@ -105,7 +105,7 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( RecentFilesMenuController
DEFINE_INIT_SERVICE ( RecentFilesMenuController, {} )
RecentFilesMenuController::RecentFilesMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
- PopupMenuControllerBase( xServiceManager ),
+ svt::PopupMenuControllerBase( xServiceManager ),
m_bDisabled( sal_False )
{
}
@@ -245,11 +245,11 @@ void RecentFilesMenuController::executeEntry( sal_Int32 nIndex )
Reference< XDispatchProvider > xDispatchProvider;
Reference< XMultiServiceFactory > xServiceManager;
- ResetableGuard aLock( m_aLock );
+ osl::ClearableMutexGuard aLock( m_aMutex );
xPopupMenu = m_xPopupMenu;
xDispatchProvider = Reference< XDispatchProvider >( m_xFrame, UNO_QUERY );
xServiceManager = m_xServiceManager;
- aLock.unlock();
+ aLock.clear();
css::util::URL aTargetURL;
Sequence< PropertyValue > aArgsList;
@@ -312,7 +312,7 @@ void SAL_CALL RecentFilesMenuController::disposing( const EventObject& ) throw (
{
Reference< css::awt::XMenuListener > xHolder(( OWeakObject *)this, UNO_QUERY );
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
m_xFrame.clear();
m_xDispatch.clear();
m_xServiceManager.clear();
@@ -325,7 +325,7 @@ void SAL_CALL RecentFilesMenuController::disposing( const EventObject& ) throw (
// XStatusListener
void SAL_CALL RecentFilesMenuController::statusChanged( const FeatureStateEvent& Event ) throw ( RuntimeException )
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
m_bDisabled = !Event.IsEnabled;
}
@@ -336,11 +336,11 @@ void SAL_CALL RecentFilesMenuController::select( const css::awt::MenuEvent& rEve
Reference< XDispatchProvider > xDispatchProvider;
Reference< XMultiServiceFactory > xServiceManager;
- ResetableGuard aLock( m_aLock );
+ osl::ClearableMutexGuard aLock( m_aMutex );
xPopupMenu = m_xPopupMenu;
xDispatchProvider = Reference< XDispatchProvider >( m_xFrame, UNO_QUERY );
xServiceManager = m_xServiceManager;
- aLock.unlock();
+ aLock.clear();
css::util::URL aTargetURL;
Sequence< PropertyValue > aArgsList;
@@ -355,7 +355,7 @@ void SAL_CALL RecentFilesMenuController::select( const css::awt::MenuEvent& rEve
void SAL_CALL RecentFilesMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
impl_setPopupMenu();
}
@@ -368,17 +368,16 @@ void RecentFilesMenuController::impl_setPopupMenu()
void SAL_CALL RecentFilesMenuController::updatePopupMenu() throw (RuntimeException)
{
- ResetableGuard aLock( m_aLock );
+ osl::ClearableMutexGuard aLock( m_aMutex );
- if ( m_bDisposed )
- throw DisposedException();
+ throwIfDisposed();
Reference< XStatusListener > xStatusListener( static_cast< OWeakObject* >( this ), UNO_QUERY );
Reference< XDispatch > xDispatch( m_xDispatch );
com::sun::star::util::URL aTargetURL;
aTargetURL.Complete = m_aCommandURL;
m_xURLTransformer->parseStrict( aTargetURL );
- aLock.unlock();
+ aLock.clear();
// Add/remove status listener to get a status update once
if ( xDispatch.is() )
@@ -395,10 +394,9 @@ Reference< XDispatch > SAL_CALL RecentFilesMenuController::queryDispatch(
sal_Int32 /*nFlags*/ )
throw( RuntimeException )
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
- if ( m_bDisposed )
- throw DisposedException();
+ throwIfDisposed();
if ( aURL.Complete.indexOf( m_aBaseURL ) == 0 )
return Reference< XDispatch >( static_cast< OWeakObject* >( this ), UNO_QUERY );
@@ -412,10 +410,9 @@ void SAL_CALL RecentFilesMenuController::dispatch(
const Sequence< PropertyValue >& /*seqProperties*/ )
throw( RuntimeException )
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
- if ( m_bDisposed )
- throw DisposedException();
+ throwIfDisposed();
if ( aURL.Complete.indexOf( m_aBaseURL ) == 0 )
{
@@ -448,12 +445,11 @@ void SAL_CALL RecentFilesMenuController::addStatusListener(
const URL& aURL )
throw( RuntimeException )
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
- if ( m_bDisposed )
- throw DisposedException();
+ throwIfDisposed();
- PopupMenuControllerBase::addStatusListener( xControl, aURL );
+ svt::PopupMenuControllerBase::addStatusListener( xControl, aURL );
}
void SAL_CALL RecentFilesMenuController::removeStatusListener(
@@ -461,7 +457,7 @@ void SAL_CALL RecentFilesMenuController::removeStatusListener(
const URL& aURL )
throw( RuntimeException )
{
- PopupMenuControllerBase::removeStatusListener( xControl, aURL );
+ svt::PopupMenuControllerBase::removeStatusListener( xControl, aURL );
}
IMPL_STATIC_LINK_NOINSTANCE( RecentFilesMenuController, ExecuteHdl_Impl, LoadRecentFile*, pLoadRecentFile )
diff --git a/framework/source/uielement/spinfieldtoolbarcontroller.cxx b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
index 43ad09ffc1ee..dad2775dc453 100644
--- a/framework/source/uielement/spinfieldtoolbarcontroller.cxx
+++ b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
@@ -49,7 +49,6 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/frame/status/ItemStatus.hpp>
#include <com/sun/star/frame/status/ItemState.hpp>
#include <com/sun/star/frame/status/Visibility.hpp>
diff --git a/framework/source/uielement/statusbarmanager.cxx b/framework/source/uielement/statusbarmanager.cxx
index b6c4251ffaf9..8d37da3c3e49 100644
--- a/framework/source/uielement/statusbarmanager.cxx
+++ b/framework/source/uielement/statusbarmanager.cxx
@@ -56,6 +56,7 @@
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/Command.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
//_________________________________________________________________________________________________________________
// other includes
diff --git a/framework/source/uielement/togglebuttontoolbarcontroller.cxx b/framework/source/uielement/togglebuttontoolbarcontroller.cxx
index 5230cf9bbd6e..43262fcc64a2 100644
--- a/framework/source/uielement/togglebuttontoolbarcontroller.cxx
+++ b/framework/source/uielement/togglebuttontoolbarcontroller.cxx
@@ -46,7 +46,6 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/frame/XControlNotificationListener.hpp>
#include "com/sun/star/util/XMacroExpander.hpp"
#include "com/sun/star/uno/XComponentContext.hpp"
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index b6ce3a526156..a7b1f18e9c15 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -52,6 +52,7 @@
#endif
#include <framework/addonsoptions.hxx>
#include <uielement/toolbarmerger.hxx>
+#include <helper/acceleratorinfo.hxx>
//_________________________________________________________________________________________________________________
// interface includes
@@ -75,6 +76,7 @@
#include <com/sun/star/ui/UIElementType.hpp>
#include <comphelper/sequence.hxx>
#include <com/sun/star/frame/status/Visibility.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
//_________________________________________________________________________________________________________________
// other includes
@@ -97,11 +99,14 @@
#include <svtools/menuoptions.hxx>
#include <unotools/cmdoptions.hxx>
#include <boost/bind.hpp>
+#include <svtools/acceleratorexecute.hxx>
//_________________________________________________________________________________________________________________
// namespaces
//_________________________________________________________________________________________________________________
+using rtl::OUString;
+
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
@@ -112,6 +117,7 @@ using namespace ::com::sun::star::util;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::ui;
+using namespace ::com::sun::star;
namespace framework
{
@@ -257,7 +263,8 @@ ToolBarManager::ToolBarManager( const Reference< XMultiServiceFactory >& rServic
m_xFrame( rFrame ),
m_aListenerContainer( m_aLock.getShareableOslMutex() ),
m_xServiceManager( rServiceManager ),
- m_nSymbolsStyle( SvtMiscOptions().GetCurrentSymbolsStyle() )
+ m_nSymbolsStyle( SvtMiscOptions().GetCurrentSymbolsStyle() ),
+ m_bAcceleratorCfg( sal_False )
{
Window* pWindow = m_pToolBar;
while ( pWindow && !pWindow->IsSystemWindow() )
@@ -510,7 +517,47 @@ void ToolBarManager::UpdateControllers()
}
m_bUpdateControllers = sal_False;
}
+//for update toolbar controller via Support Visible by shizhoubo
+void ToolBarManager::UpdateController( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XToolbarController > xController)
+{
+ RTL_LOGFILE_CONTEXT( aLog, "framework (cd100003) ::ToolBarManager::UpdateControllers" );
+
+ if ( !m_bUpdateControllers )
+ {
+ m_bUpdateControllers = sal_True;
+ try
+ { if(xController.is())
+ {
+ Reference< XUpdatable > xUpdatable( xController, UNO_QUERY );
+ if ( xUpdatable.is() )
+ xUpdatable->update();
+ }
+ }
+ catch ( Exception& )
+ {
+ }
+
+ /* m_bUpdateControllers = sal_True;
+ ToolBarControllerMap::iterator pIter = m_aControllerMap.begin();
+
+ while ( pIter != m_aControllerMap.end() )
+ {
+ try
+ {
+ Reference< XUpdatable > xUpdatable( pIter->second, UNO_QUERY );
+ if ( xUpdatable.is() )
+ xUpdatable->update();
+ }
+ catch ( Exception& )
+ {
+ }
+ ++pIter;
+ }*/
+ }
+ m_bUpdateControllers = sal_False;
+}
+//end
void ToolBarManager::frameAction( const FrameActionEvent& Action )
throw ( RuntimeException )
{
@@ -663,6 +710,9 @@ void SAL_CALL ToolBarManager::dispose() throw( RuntimeException )
m_xFrame.clear();
m_xServiceManager.clear();
+ m_xGlobalAcceleratorManager.clear();
+ m_xModuleAcceleratorManager.clear();
+ m_xDocAcceleratorManager.clear();
m_bDisposed = sal_True;
}
@@ -803,17 +853,18 @@ void ToolBarManager::RemoveControllers()
m_aControllerMap.clear();
}
-::rtl::OUString ToolBarManager::RetrieveLabelFromCommand( const ::rtl::OUString& aCmdURL )
+uno::Sequence< beans::PropertyValue > ToolBarManager::GetPropsForCommand( const ::rtl::OUString& rCmdURL )
{
- ::rtl::OUString aLabel;
+ Sequence< PropertyValue > aPropSeq;
- // Retrieve popup menu labels
- if ( !m_bModuleIdentified )
+ // Retrieve properties for command
+ try
{
- Reference< XModuleManager > xModuleManager( m_xServiceManager->createInstance( SERVICENAME_MODULEMANAGER ), UNO_QUERY_THROW );
- Reference< XInterface > xIfac( m_xFrame, UNO_QUERY );
- try
+ if ( !m_bModuleIdentified )
{
+ Reference< XModuleManager > xModuleManager( m_xServiceManager->createInstance( SERVICENAME_MODULEMANAGER ), UNO_QUERY_THROW );
+ Reference< XInterface > xIfac( m_xFrame, UNO_QUERY );
+
m_bModuleIdentified = sal_True;
m_aModuleIdentifier = xModuleManager->identify( xIfac );
@@ -821,44 +872,57 @@ void ToolBarManager::RemoveControllers()
{
Reference< XNameAccess > xNameAccess( m_xServiceManager->createInstance( SERVICENAME_UICOMMANDDESCRIPTION ), UNO_QUERY );
if ( xNameAccess.is() )
- {
xNameAccess->getByName( m_aModuleIdentifier ) >>= m_xUICommandLabels;
- }
}
}
- catch ( Exception& )
+
+ if ( m_xUICommandLabels.is() )
{
+ if ( rCmdURL.getLength() > 0 )
+ m_xUICommandLabels->getByName( rCmdURL ) >>= aPropSeq;
}
}
+ catch ( Exception& )
+ {
+ }
- if ( m_xUICommandLabels.is() )
+ return aPropSeq;
+}
+
+::rtl::OUString ToolBarManager::RetrieveLabelFromCommand( const ::rtl::OUString& aCmdURL )
+{
+ ::rtl::OUString aLabel;
+ Sequence< PropertyValue > aPropSeq;
+
+ // Retrieve popup menu labels
+ aPropSeq = GetPropsForCommand( aCmdURL );
+ for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
{
- try
+ if ( aPropSeq[i].Name.equalsAscii( "Name" ))
{
- if ( aCmdURL.getLength() > 0 )
- {
- rtl::OUString aStr;
- Sequence< PropertyValue > aPropSeq;
- if ( m_xUICommandLabels->getByName( aCmdURL ) >>= aPropSeq )
- {
- for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
- {
- if ( aPropSeq[i].Name.equalsAscii( "Name" ))
- {
- aPropSeq[i].Value >>= aStr;
- break;
- }
- }
- }
- aLabel = aStr;
- }
+ aPropSeq[i].Value >>= aLabel;
+ break;
}
- catch ( com::sun::star::uno::Exception& )
+ }
+ return aLabel;
+}
+
+sal_Int32 ToolBarManager::RetrievePropertiesFromCommand( const ::rtl::OUString& aCmdURL )
+{
+ sal_Int32 nProperties(0);
+ Sequence< PropertyValue > aPropSeq;
+
+ // Retrieve popup menu labels
+ aPropSeq = GetPropsForCommand( aCmdURL );
+ for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
+ {
+ if ( aPropSeq[i].Name.equalsAscii( "Properties" ))
{
+ aPropSeq[i].Value >>= nProperties;
+ break;
}
}
-
- return aLabel;
+ return nProperties;
}
void ToolBarManager::CreateControllers()
@@ -969,8 +1033,15 @@ void ToolBarManager::CreateControllers()
{
MenuDescriptionMap::iterator it = m_aMenuMap.find( nId );
if ( it == m_aMenuMap.end() )
- xController = Reference< XStatusListener >(
- new GenericToolbarController( m_xServiceManager, m_xFrame, m_pToolBar, nId, aCommandURL ));
+ {
+ xController = Reference< XStatusListener >(
+ new GenericToolbarController( m_xServiceManager, m_xFrame, m_pToolBar, nId, aCommandURL ));
+
+ // Accessibility support: Set toggle button role for specific commands
+ sal_Int32 nProps = RetrievePropertiesFromCommand( aCommandURL );
+ if ( nProps & UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON )
+ m_pToolBar->SetItemBits( nId, m_pToolBar->GetItemBits( nId ) | TIB_CHECKABLE );
+ }
else
xController = Reference< XStatusListener >(
new MenuToolbarController( m_xServiceManager, m_xFrame, m_pToolBar, nId, aCommandURL, m_aModuleIdentifier, m_aMenuMap[ nId ] ));
@@ -1028,6 +1099,10 @@ void ToolBarManager::CreateControllers()
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParentWindow" ));
aPropValue.Value <<= xToolbarWindow;
aPropertyVector.push_back( makeAny( aPropValue ));
+ aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ModuleName" ));
+ aPropValue.Value <<= m_aModuleIdentifier;
+ aPropertyVector.push_back( makeAny( aPropValue ));
+
if ( nWidth > 0 )
{
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ));
@@ -1037,6 +1112,19 @@ void ToolBarManager::CreateControllers()
Sequence< Any > aArgs( comphelper::containerToSequence( aPropertyVector ));
xInit->initialize( aArgs );
+ //for Support Visiblitly by shizhoubo
+ if (pController)
+ {
+ // rtl::OUString aCommandURL = pController->m_aCommandURL;
+ if(aCommandURL == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:SwitchXFormsDesignMode" )) ||
+ aCommandURL == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ViewDataSourceBrowser" )) ||
+ aCommandURL == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ParaLeftToRight" )) ||
+ aCommandURL == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ParaRightToLeft" ))
+ )
+ pController->setFastPropertyValue_NoBroadcast(1,makeAny(sal_True));
+ }
+
+ //end
}
// Request a item window from the toolbar controller and set it at the VCL toolbar
@@ -1057,6 +1145,31 @@ void ToolBarManager::CreateControllers()
}
}
}
+ //for update Controller via support visiable state by shizhoubo
+ Reference< XPropertySet > xPropSet( xController, UNO_QUERY );
+ if ( xPropSet.is() )
+ {
+ try
+ {
+ sal_Bool bSupportVisiable = sal_True;
+ Any a( xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SupportsVisiable" ))) );
+ a >>= bSupportVisiable;
+ if ( bSupportVisiable )
+ {
+ Reference< XToolbarController > xTbxController( xController, UNO_QUERY );
+ UpdateController(xTbxController);
+ }
+ }
+ catch ( RuntimeException& )
+ {
+ throw;
+ }
+ catch ( Exception& )
+ {
+ }
+ }
+ //end
+
}
AddFrameActionListener();
@@ -1257,13 +1370,31 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
m_pToolBar->InsertItem( nId, aString, nItemBits );
m_pToolBar->SetItemCommand( nId, aCommandURL );
if ( aTooltip.getLength() )
+ {
m_pToolBar->SetQuickHelpText( nId, aTooltip );
+ }
else
- m_pToolBar->SetQuickHelpText( nId, aString );
+ {
+ ::rtl::OUString sQuickHelp( aString );
+ ::rtl::OUString sShortCut;
+ if( RetrieveShortcut( aCommandURL, sShortCut ) )
+ {
+ sQuickHelp += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " (" ) );
+ sQuickHelp += sShortCut;
+ sQuickHelp += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ")" ) );
+ }
+
+ m_pToolBar->SetQuickHelpText( nId, sQuickHelp );
+ }
+
if ( aLabel.getLength() > 0 )
+ {
m_pToolBar->SetItemText( nId, aLabel );
+ }
else
+ {
m_pToolBar->SetItemText( nId, aString );
+ }
m_pToolBar->EnableItem( nId, sal_True );
m_pToolBar->SetItemState( nId, STATE_NOCHECK );
@@ -1530,7 +1661,11 @@ IMPL_LINK( ToolBarManager, DropdownClick, ToolBox*, EMPTYARG )
Reference< XToolbarController > xController( pIter->second, UNO_QUERY );
if ( xController.is() )
- xController->createPopupWindow();
+ {
+ Reference< XWindow > xWin = xController->createPopupWindow();
+ if ( xWin.is() )
+ xWin->setFocus();
+ }
}
return 1;
}
@@ -2102,6 +2237,121 @@ Image ToolBarManager::QueryAddonsImage( const ::rtl::OUString& aCommandURL, bool
return aImage;
}
+bool ToolBarManager::impl_RetrieveShortcutsFromConfiguration(
+ const Reference< XAcceleratorConfiguration >& rAccelCfg,
+ const rtl::OUString& rCommand,
+ rtl::OUString& rShortCut )
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ToolBarManager::impl_RetrieveShortcutsFromConfiguration" );
+ if ( rAccelCfg.is() )
+ {
+ try
+ {
+ com::sun::star::awt::KeyEvent aKeyEvent;
+ Sequence< OUString > aCommands(1);
+ aCommands[0] = rCommand;
+
+ Sequence< Any > aSeqKeyCode( rAccelCfg->getPreferredKeyEventsForCommandList( aCommands ) );
+ if( aSeqKeyCode.getLength() == 1 )
+ {
+ if ( aSeqKeyCode[0] >>= aKeyEvent )
+ {
+ rShortCut = svt::AcceleratorExecute::st_AWTKey2VCLKey( aKeyEvent ).GetName();
+ return true;
+ }
+ }
+ }
+ catch ( IllegalArgumentException& )
+ {
+ }
+ }
+
+ return false;
+}
+
+bool ToolBarManager::RetrieveShortcut( const rtl::OUString& rCommandURL, rtl::OUString& rShortCut )
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ToolBarManager::RetrieveShortcuts" );
+ if ( m_bModuleIdentified )
+ {
+ Reference< XAcceleratorConfiguration > xDocAccelCfg( m_xDocAcceleratorManager );
+ Reference< XAcceleratorConfiguration > xModuleAccelCfg( m_xModuleAcceleratorManager );
+ Reference< XAcceleratorConfiguration > xGlobalAccelCfg( m_xGlobalAcceleratorManager );
+
+ if ( !m_bAcceleratorCfg )
+ {
+ // Retrieve references on demand
+ m_bAcceleratorCfg = sal_True;
+ if ( !xDocAccelCfg.is() )
+ {
+ Reference< XController > xController = m_xFrame->getController();
+ Reference< XModel > xModel;
+ if ( xController.is() )
+ {
+ xModel = xController->getModel();
+ if ( xModel.is() )
+ {
+ Reference< XUIConfigurationManagerSupplier > xSupplier( xModel, UNO_QUERY );
+ if ( xSupplier.is() )
+ {
+ Reference< XUIConfigurationManager > xDocUICfgMgr( xSupplier->getUIConfigurationManager(), UNO_QUERY );
+ if ( xDocUICfgMgr.is() )
+ {
+ xDocAccelCfg = Reference< XAcceleratorConfiguration >( xDocUICfgMgr->getShortCutManager(), UNO_QUERY );
+ m_xDocAcceleratorManager = xDocAccelCfg;
+ }
+ }
+ }
+ }
+ }
+
+ if ( !xModuleAccelCfg.is() )
+ {
+ Reference< XModuleUIConfigurationManagerSupplier > xModuleCfgMgrSupplier( m_xServiceManager->createInstance(
+ SERVICENAME_MODULEUICONFIGURATIONMANAGERSUPPLIER ),
+ UNO_QUERY );
+ try
+ {
+ Reference< XUIConfigurationManager > xUICfgMgr = xModuleCfgMgrSupplier->getUIConfigurationManager( m_aModuleIdentifier );
+ if ( xUICfgMgr.is() )
+ {
+ xModuleAccelCfg = Reference< XAcceleratorConfiguration >( xUICfgMgr->getShortCutManager(), UNO_QUERY );
+ m_xModuleAcceleratorManager = xModuleAccelCfg;
+ }
+ }
+ catch ( RuntimeException& )
+ {
+ throw;
+ }
+ catch ( Exception& )
+ {
+ }
+ }
+
+ if ( !xGlobalAccelCfg.is() )
+ {
+ xGlobalAccelCfg = Reference< XAcceleratorConfiguration >( m_xServiceManager->createInstance(
+ SERVICENAME_GLOBALACCELERATORCONFIGURATION ),
+ UNO_QUERY );
+ m_xGlobalAcceleratorManager = xGlobalAccelCfg;
+ }
+ }
+
+ bool bFound = false;
+
+ if ( m_xGlobalAcceleratorManager.is() )
+ bFound = impl_RetrieveShortcutsFromConfiguration( xGlobalAccelCfg, rCommandURL, rShortCut );
+ if ( !bFound && m_xModuleAcceleratorManager.is() )
+ bFound = impl_RetrieveShortcutsFromConfiguration( xModuleAccelCfg, rCommandURL, rShortCut );
+ if ( !bFound && m_xDocAcceleratorManager.is() )
+ impl_RetrieveShortcutsFromConfiguration( xGlobalAccelCfg, rCommandURL, rShortCut );
+
+ if( bFound )
+ return true;
+ }
+ return false;
+}
+
}
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx
index 90c372a9ff62..6450563c57ab 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -58,7 +58,6 @@
#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/ui/UIElementType.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
//_________________________________________________________________________________________________________________
// includes of other projects
@@ -167,7 +166,7 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( ToolbarsMenuController
DEFINE_INIT_SERVICE ( ToolbarsMenuController, {} )
ToolbarsMenuController::ToolbarsMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
- PopupMenuControllerBase( xServiceManager ),
+ svt::PopupMenuControllerBase( xServiceManager ),
m_aPropUIName( RTL_CONSTASCII_USTRINGPARAM( "UIName" )),
m_aPropResourceURL( RTL_CONSTASCII_USTRINGPARAM( "ResourceURL" )),
m_bModuleIdentified( sal_False ),
@@ -563,7 +562,7 @@ void SAL_CALL ToolbarsMenuController::disposing( const EventObject& ) throw ( Ru
{
Reference< css::awt::XMenuListener > xHolder(( OWeakObject *)this, UNO_QUERY );
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
m_xFrame.clear();
m_xDispatch.clear();
m_xDocCfgMgr.clear();
@@ -584,9 +583,9 @@ void SAL_CALL ToolbarsMenuController::statusChanged( const FeatureStateEvent& Ev
sal_Bool bSetCheckmark = sal_False;
sal_Bool bCheckmark = sal_False;
- ResetableGuard aLock( m_aLock );
+ osl::ClearableMutexGuard aLock( m_aMutex );
Reference< css::awt::XPopupMenu > xPopupMenu( m_xPopupMenu );
- aLock.unlock();
+ aLock.clear();
if ( xPopupMenu.is() )
{
@@ -633,13 +632,13 @@ void SAL_CALL ToolbarsMenuController::select( const css::awt::MenuEvent& rEvent
Reference< XFrame > xFrame;
Reference< XNameAccess > xPersistentWindowState;
- ResetableGuard aLock( m_aLock );
+ osl::ClearableMutexGuard aLock( m_aMutex );
xPopupMenu = m_xPopupMenu;
xServiceManager = m_xServiceManager;
xURLTransformer = m_xURLTransformer;
xFrame = m_xFrame;
xPersistentWindowState = m_xPersistentWindowState;
- aLock.unlock();
+ aLock.clear();
if ( xPopupMenu.is() )
{
@@ -792,7 +791,7 @@ void SAL_CALL ToolbarsMenuController::activate( const css::awt::MenuEvent& ) thr
Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
Reference< XURLTransformer > xURLTransformer( m_xURLTransformer );
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
fillPopupMenu( m_xPopupMenu );
aCmdVector = m_aCommandVector;
}
@@ -829,10 +828,9 @@ void SAL_CALL ToolbarsMenuController::activate( const css::awt::MenuEvent& ) thr
// XPopupMenuController
void SAL_CALL ToolbarsMenuController::setPopupMenu( const Reference< css::awt::XPopupMenu >& xPopupMenu ) throw ( RuntimeException )
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
- if ( m_bDisposed )
- throw DisposedException();
+ throwIfDisposed();
if ( m_xFrame.is() && !m_xPopupMenu.is() )
{
@@ -848,11 +846,11 @@ void SAL_CALL ToolbarsMenuController::setPopupMenu( const Reference< css::awt::X
// XInitialization
void SAL_CALL ToolbarsMenuController::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
{
- ResetableGuard aLock( m_aLock );
+ osl::MutexGuard aLock( m_aMutex );
sal_Bool bInitalized( m_bInitialized );
if ( !bInitalized )
{
- PopupMenuControllerBase::initialize(aArguments);
+ svt::PopupMenuControllerBase::initialize(aArguments);
if ( m_bInitialized )
{
diff --git a/framework/source/uielement/toolbarwrapper.cxx b/framework/source/uielement/toolbarwrapper.cxx
index 9f5593183e09..7b6e81ff91d9 100644
--- a/framework/source/uielement/toolbarwrapper.cxx
+++ b/framework/source/uielement/toolbarwrapper.cxx
@@ -53,6 +53,7 @@
#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/ui/UIElementType.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
//_________________________________________________________________________________________________________________
// other includes
diff --git a/framework/source/uielement/uicommanddescription.cxx b/framework/source/uielement/uicommanddescription.cxx
index fdcd08f221fd..0d50aa4c36d4 100644
--- a/framework/source/uielement/uicommanddescription.cxx
+++ b/framework/source/uielement/uicommanddescription.cxx
@@ -340,7 +340,7 @@ Any ConfigurationAccess_UICommand::getSequenceFromCache( const ::rtl::OUString&
if ( !pIter->second.bCommandNameCreated )
fillInfoFromResult( pIter->second, pIter->second.aLabel );
- Sequence< PropertyValue > aPropSeq( 3 );
+ Sequence< PropertyValue > aPropSeq( 4 );
aPropSeq[0].Name = m_aPropLabel;
aPropSeq[0].Value = pIter->second.aContextLabel.getLength() ?
makeAny( pIter->second.aContextLabel ): makeAny( pIter->second.aLabel );
@@ -348,6 +348,8 @@ Any ConfigurationAccess_UICommand::getSequenceFromCache( const ::rtl::OUString&
aPropSeq[1].Value <<= pIter->second.aCommandName;
aPropSeq[2].Name = m_aPropPopup;
aPropSeq[2].Value <<= pIter->second.bPopup;
+ aPropSeq[3].Name = m_aPropProperties;
+ aPropSeq[3].Value <<= pIter->second.nProperties;
return makeAny( aPropSeq );
}
diff --git a/framework/source/xml/makefile.mk b/framework/source/xml/makefile.mk
index 7384ea19645a..a4f18a555ab3 100644
--- a/framework/source/xml/makefile.mk
+++ b/framework/source/xml/makefile.mk
@@ -37,8 +37,20 @@ ENABLE_EXCEPTIONS= TRUE
# --- Generate -----------------------------------------------------
SLOFILES= \
- $(SLO)$/acceleratorconfigurationreader.obj \
- $(SLO)$/acceleratorconfigurationwriter.obj \
+ $(SLO)$/eventsconfiguration.obj \
+ $(SLO)$/eventsdocumenthandler.obj \
+ $(SLO)$/imagesconfiguration.obj \
+ $(SLO)$/imagesdocumenthandler.obj \
+ $(SLO)$/menuconfiguration.obj \
+ $(SLO)$/menudocumenthandler.obj \
+ $(SLO)$/statusbarconfiguration.obj \
+ $(SLO)$/statusbardocumenthandler.obj \
+ $(SLO)$/toolboxconfiguration.obj \
+ $(SLO)$/toolboxdocumenthandler.obj \
+ $(SLO)$/saxnamespacefilter.obj \
+ $(SLO)$/xmlnamespaces.obj \
+ $(SLO)$/acceleratorconfigurationreader.obj \
+ $(SLO)$/acceleratorconfigurationwriter.obj
# --- Targets ------------------------------------------------------
diff --git a/framework/uiconfig/startmodule/accelerator/en-GB/default.xml b/framework/uiconfig/startmodule/accelerator/en-GB/default.xml
deleted file mode 100644
index eefe2b0dde23..000000000000
--- a/framework/uiconfig/startmodule/accelerator/en-GB/default.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink">
- <accel:item accel:code="KEY_Q" accel:mod1="true" xlink:href=".uno:Quit"/>
- <accel:item accel:code="KEY_N" accel:shift="true" accel:mod1="true" xlink:href=".uno:NewDoc"/>
- <accel:item accel:code="KEY_O" accel:mod1="true" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_OPEN" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_P" accel:mod1="true" xlink:href=".uno:Print"/>
- <accel:item accel:code="KEY_S" accel:mod1="true" xlink:href=".uno:Save"/>
- <accel:item accel:code="KEY_N" accel:mod1="true" xlink:href=".uno:AddDirect"/>
- <accel:item accel:code="KEY_W" accel:mod1="true" xlink:href=".uno:CloseWin"/>
- <accel:item accel:code="KEY_F4" accel:mod1="true" xlink:href=".uno:CloseWin"/>
- <accel:item accel:code="KEY_X" accel:mod1="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_DELETE" accel:shift="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_CUT" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_C" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_INSERT" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_COPY" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_V" accel:mod1="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_INSERT" accel:shift="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_PASTE" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_DELETE" xlink:href=".uno:Delete"/>
- <accel:item accel:code="KEY_A" accel:mod1="true" xlink:href=".uno:SelectAll"/>
- <accel:item accel:code="KEY_F" accel:mod1="true" xlink:href=".uno:SearchDialog"/>
- <accel:item accel:code="KEY_Q" accel:shift="true" accel:mod1="true" xlink:href=".uno:BasicBreak"/>
- <accel:item accel:code="KEY_F4" xlink:href=".uno:ViewDataSourceBrowser"/>
- <accel:item accel:code="KEY_F5" accel:mod1="true" xlink:href=".uno:GrabControlFocus"/>
- <accel:item accel:code="KEY_F7" accel:shift="true" accel:mod1="true" xlink:href=".uno:HangulHanjaConversion"/>
-</accel:acceleratorlist>
diff --git a/framework/uiconfig/startmodule/accelerator/en-US/default.xml b/framework/uiconfig/startmodule/accelerator/en-US/default.xml
deleted file mode 100644
index eefe2b0dde23..000000000000
--- a/framework/uiconfig/startmodule/accelerator/en-US/default.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink">
- <accel:item accel:code="KEY_Q" accel:mod1="true" xlink:href=".uno:Quit"/>
- <accel:item accel:code="KEY_N" accel:shift="true" accel:mod1="true" xlink:href=".uno:NewDoc"/>
- <accel:item accel:code="KEY_O" accel:mod1="true" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_OPEN" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_P" accel:mod1="true" xlink:href=".uno:Print"/>
- <accel:item accel:code="KEY_S" accel:mod1="true" xlink:href=".uno:Save"/>
- <accel:item accel:code="KEY_N" accel:mod1="true" xlink:href=".uno:AddDirect"/>
- <accel:item accel:code="KEY_W" accel:mod1="true" xlink:href=".uno:CloseWin"/>
- <accel:item accel:code="KEY_F4" accel:mod1="true" xlink:href=".uno:CloseWin"/>
- <accel:item accel:code="KEY_X" accel:mod1="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_DELETE" accel:shift="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_CUT" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_C" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_INSERT" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_COPY" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_V" accel:mod1="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_INSERT" accel:shift="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_PASTE" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_DELETE" xlink:href=".uno:Delete"/>
- <accel:item accel:code="KEY_A" accel:mod1="true" xlink:href=".uno:SelectAll"/>
- <accel:item accel:code="KEY_F" accel:mod1="true" xlink:href=".uno:SearchDialog"/>
- <accel:item accel:code="KEY_Q" accel:shift="true" accel:mod1="true" xlink:href=".uno:BasicBreak"/>
- <accel:item accel:code="KEY_F4" xlink:href=".uno:ViewDataSourceBrowser"/>
- <accel:item accel:code="KEY_F5" accel:mod1="true" xlink:href=".uno:GrabControlFocus"/>
- <accel:item accel:code="KEY_F7" accel:shift="true" accel:mod1="true" xlink:href=".uno:HangulHanjaConversion"/>
-</accel:acceleratorlist>
diff --git a/framework/util/exports.map b/framework/util/exports.map
deleted file mode 100644
index 85610ad80888..000000000000
--- a/framework/util/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/framework/util/makefile.mk b/framework/util/makefile.mk
index 7e1a7d3c4db1..87298720cfa6 100644
--- a/framework/util/makefile.mk
+++ b/framework/util/makefile.mk
@@ -62,7 +62,6 @@ LIB1OBJFILES= \
$(SLO)$/rootitemcontainer.obj \
$(SLO)$/constitemcontainer.obj \
$(SLO)$/jobconst.obj \
- $(SLO)$/popupmenucontrollerbase.obj \
$(SLO)$/mischelper.obj \
$(SLO)$/propertysethelper.obj
@@ -83,7 +82,6 @@ LIB2OBJFILES= \
$(SLO)$/statusbardocumenthandler.obj \
$(SLO)$/toolboxconfiguration.obj \
$(SLO)$/toolboxdocumenthandler.obj \
- $(SLO)$/toolboxlayoutdocumenthandler.obj \
$(SLO)$/imagesconfiguration.obj \
$(SLO)$/imagesdocumenthandler.obj \
$(SLO)$/xmlnamespaces.obj \
@@ -116,6 +114,9 @@ SHL1STDLIBS= \
$(UNOTOOLSLIB) \
$(CPPUHELPERLIB) \
$(TOOLSLIB) \
+ $(SVTOOLLIB) \
+ $(SVLLIB) \
+ $(I18NISOLANGLIB) \
$(VOSLIB) \
$(VCLLIB) \
$(TKLIB) \
diff --git a/idl/util/svidl.hdb b/idl/util/svidl.hdb
deleted file mode 100644
index d57bedb45373..000000000000
--- a/idl/util/svidl.hdb
+++ /dev/null
@@ -1,25 +0,0 @@
-write "/*************************************************************************"
-write "* SV.HXX"
-write "* __DATE__"
-write "* (c) 1992-1994 STAR DIVISION"
-write "*************************************************************************/"
-write "#ifndef _SVIDL_HXX"
-write "#define _SVIDL_HXX"
-write "#ifndef _PSTREAM_HXX"
-write "#include <pstream.hxx>"
-write "#endif"
-write "#ifndef _SBX_HXX"
-write "#include <sbx.hxx>"
-write "#endif"
-write "#define IDL_COMPILER /*vorlaeufig immer */"
-file char.hxx
-file hash.hxx
-file lex.hxx
-file bastype.hxx
-file basobj.hxx
-file types.hxx
-file object.hxx
-file slot.hxx
-file module.hxx
-file database.hxx
-write "#endif"
diff --git a/linguistic/prj/build.lst b/linguistic/prj/build.lst
index 8e09e3fd4226..57c332f6f3ea 100644
--- a/linguistic/prj/build.lst
+++ b/linguistic/prj/build.lst
@@ -3,3 +3,4 @@ lg linguistic usr1 - all lg_mkout NULL
lg linguistic\prj get - all lg_prj NULL
lg linguistic\inc nmake - all lg_inc NULL
lg linguistic\source nmake - all lg_src lg_inc NULL
+lg linguistic\qa\unoapi nmake - all lg_qa_unoapi NULL
diff --git a/linguistic/qa/unoapi/Test.java b/linguistic/qa/unoapi/Test.java
new file mode 100644
index 000000000000..4a96418255ff
--- /dev/null
+++ b/linguistic/qa/unoapi/Test.java
@@ -0,0 +1,51 @@
+/*************************************************************************
+* 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.
+************************************************************************/
+
+package org.openoffice.linguistic.qa.unoapi;
+
+import org.openoffice.Runner;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+public final class Test {
+ @org.junit.Before public void setUp() throws Exception {
+ connection.setUp();
+ }
+
+ @org.junit.After public void tearDown()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ connection.tearDown();
+ }
+
+ @org.junit.Test public void test() {
+ assertTrue(
+ Runner.run(
+ "-sce", "lng.sce", "-xcl", "knownissues.xcl", "-cs",
+ connection.getDescription()));
+ }
+
+ private final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/linguistic/qa/unoapi/makefile.mk b/linguistic/qa/unoapi/makefile.mk
index d24be0361501..bd330c6fbaca 100644
--- a/linguistic/qa/unoapi/makefile.mk
+++ b/linguistic/qa/unoapi/makefile.mk
@@ -1,7 +1,6 @@
#*************************************************************************
-#
# 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
@@ -22,19 +21,28 @@
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
+#***********************************************************************/
-PRJ=..$/..
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-PRJNAME=linguistic
-TARGET=qa_unoapi
+PRJ = ../..
+PRJNAME = linguistic
+TARGET = qa_unoapi
-.INCLUDE: settings.mk
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/linguistic/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-ALLTAR : UNOAPI_TEST
+ALLTAR : javatest
-UNOAPI_TEST:
- +$(SOLARENV)$/bin$/checkapi -sce lng.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments
+.END
diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx
index 86c8e25b787c..6f94f4735fab 100644
--- a/linguistic/source/convdiclist.cxx
+++ b/linguistic/source/convdiclist.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_linguistic.hxx"
+
#include <tools/fsys.hxx>
#include <tools/stream.hxx>
#include <tools/urlobj.hxx>
@@ -397,41 +398,12 @@ void ConvDicNameContainer::AddConvDics(
namespace
{
-template<typename T, typename InitData,
- typename Unique = InitData, typename Data = T>
-class StaticWithInit_ {
-public:
- /** Gets the static. Mutual exclusion is performed using the
- osl global mutex.
-
- @return
- static variable
- */
- static T & get() {
- return *rtl_Instance<
- T, StaticInstanceWithInit,
- ::osl::MutexGuard, ::osl::GetGlobalMutex,
- Data, InitData >::create( StaticInstanceWithInit(),
- ::osl::GetGlobalMutex(),
- InitData() );
- }
-private:
- struct StaticInstanceWithInit {
- T * operator () ( Data d ) {
- static T instance(d);
- return &instance;
+ struct StaticConvDicList : public rtl::StaticWithInit<
+ uno::Reference<XInterface>, StaticConvDicList> {
+ uno::Reference<XInterface> operator () () {
+ return (cppu::OWeakObject *) new ConvDicList;
}
};
-};
-
-//after src680m62 you can replace StaticWithInit_ with rtl::StaticWithInit and remove the above definition of StaticWithInit_
-
-struct StaticConvDicList : public StaticWithInit_<
- uno::Reference<XInterface>, StaticConvDicList> {
- uno::Reference<XInterface> operator () () {
- return (cppu::OWeakObject *) new ConvDicList;
- }
-};
}
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx
index 969321ec3991..fe53bf344ac3 100644
--- a/linguistic/source/dicimp.cxx
+++ b/linguistic/source/dicimp.cxx
@@ -74,6 +74,12 @@ static const sal_Char* pVerStr5 = "WBSWG5";
static const sal_Char* pVerStr6 = "WBSWG6";
static const sal_Char* pVerOOo7 = "OOoUserDict1";
+static const INT16 DIC_VERSION_DONTKNOW = -1;
+static const INT16 DIC_VERSION_2 = 2;
+static const INT16 DIC_VERSION_5 = 5;
+static const INT16 DIC_VERSION_6 = 6;
+static const INT16 DIC_VERSION_7 = 7;
+
static sal_Bool getTag(const ByteString &rLine,
const sal_Char *pTagName, ByteString &rTagValue)
{
@@ -89,7 +95,7 @@ static sal_Bool getTag(const ByteString &rLine,
INT16 ReadDicVersion( SvStreamPtr &rpStream, USHORT &nLng, BOOL &bNeg )
{
// Sniff the header
- INT16 nDicVersion;
+ INT16 nDicVersion = DIC_VERSION_DONTKNOW;
sal_Char pMagicHeader[MAX_HEADER_LENGTH];
nLng = LANGUAGE_NONE;
@@ -107,7 +113,7 @@ INT16 ReadDicVersion( SvStreamPtr &rpStream, USHORT &nLng, BOOL &bNeg )
sal_Bool bSuccess;
ByteString aLine;
- nDicVersion = 7;
+ nDicVersion = DIC_VERSION_7;
// 1st skip magic / header line
rpStream->ReadLine(aLine);
@@ -160,17 +166,17 @@ INT16 ReadDicVersion( SvStreamPtr &rpStream, USHORT &nLng, BOOL &bNeg )
// Check version magic
if (0 == strcmp( pMagicHeader, pVerStr6 ))
- nDicVersion = 6;
+ nDicVersion = DIC_VERSION_6;
else if (0 == strcmp( pMagicHeader, pVerStr5 ))
- nDicVersion = 5;
+ nDicVersion = DIC_VERSION_5;
else if (0 == strcmp( pMagicHeader, pVerStr2 ))
- nDicVersion = 2;
+ nDicVersion = DIC_VERSION_2;
else
- nDicVersion = -1;
+ nDicVersion = DIC_VERSION_DONTKNOW;
- if (2 == nDicVersion ||
- 5 == nDicVersion ||
- 6 == nDicVersion)
+ if (DIC_VERSION_2 == nDicVersion ||
+ DIC_VERSION_5 == nDicVersion ||
+ DIC_VERSION_6 == nDicVersion)
{
// The language of the dictionary
*rpStream >> nLng;
@@ -203,7 +209,7 @@ DictionaryNeo::DictionaryNeo() :
nLanguage (LANGUAGE_NONE)
{
nCount = 0;
- nDicVersion = -1;
+ nDicVersion = DIC_VERSION_DONTKNOW;
bNeedEntries = FALSE;
bIsModified = bIsActive = FALSE;
bIsReadonly = FALSE;
@@ -220,7 +226,7 @@ DictionaryNeo::DictionaryNeo(const OUString &rName,
nLanguage (nLang)
{
nCount = 0;
- nDicVersion = -1;
+ nDicVersion = DIC_VERSION_DONTKNOW;
bNeedEntries = TRUE;
bIsModified = bIsActive = FALSE;
bIsReadonly = !bWriteable;
@@ -230,8 +236,8 @@ DictionaryNeo::DictionaryNeo(const OUString &rName,
BOOL bExists = FileExists( rMainURL );
if( !bExists )
{
- // save new dictionaries with in 6.0 Format (uses UTF8)
- nDicVersion = 6;
+ // save new dictionaries with in Format 7 (UTF8 plain text)
+ nDicVersion = DIC_VERSION_7;
//! create physical representation of an **empty** dictionary
//! that could be found by the dictionary-list implementation
@@ -303,13 +309,13 @@ ULONG DictionaryNeo::loadEntries(const OUString &rMainURL)
eDicType = bNegativ ? DictionaryType_NEGATIVE : DictionaryType_POSITIVE;
rtl_TextEncoding eEnc = osl_getThreadTextEncoding();
- if (nDicVersion >= 6)
+ if (nDicVersion >= DIC_VERSION_6)
eEnc = RTL_TEXTENCODING_UTF8;
nCount = 0;
- if (6 == nDicVersion ||
- 5 == nDicVersion ||
- 2 == nDicVersion)
+ if (DIC_VERSION_6 == nDicVersion ||
+ DIC_VERSION_5 == nDicVersion ||
+ DIC_VERSION_2 == nDicVersion)
{
USHORT nLen = 0;
sal_Char aWordBuf[ BUFSIZE ];
@@ -363,7 +369,7 @@ ULONG DictionaryNeo::loadEntries(const OUString &rMainURL)
*(aWordBuf + nLen) = 0;
}
}
- else if (7 == nDicVersion)
+ else if (DIC_VERSION_7 == nDicVersion)
{
sal_Bool bSuccess;
ByteString aLine;
@@ -436,10 +442,10 @@ ULONG DictionaryNeo::saveEntries(const OUString &rURL)
ULONG nErr = sal::static_int_cast< ULONG >(-1);
rtl_TextEncoding eEnc = osl_getThreadTextEncoding();
- if (nDicVersion >= 6)
+ if (nDicVersion >= DIC_VERSION_6)
eEnc = RTL_TEXTENCODING_UTF8;
- if (nDicVersion == 7)
+ if (nDicVersion == DIC_VERSION_7)
{
pStream->WriteLine(ByteString (pVerOOo7));
if (0 != (nErr = pStream->GetError()))
@@ -482,7 +488,7 @@ ULONG DictionaryNeo::saveEntries(const OUString &rURL)
// write version
const sal_Char *pVerStr = NULL;
- if (6 == nDicVersion)
+ if (DIC_VERSION_6 == nDicVersion)
pVerStr = pVerStr6;
else
pVerStr = eDicType == DictionaryType_POSITIVE ? pVerStr2 : pVerStr5;
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index be127e0999af..817dbeb311ca 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -28,6 +28,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_linguistic.hxx"
+#include <cppuhelper/factory.hxx>
+#include <i18npool/mslangid.hxx>
#include <osl/file.hxx>
#include <tools/fsys.hxx>
#include <tools/stream.hxx>
@@ -52,6 +54,11 @@
#include "dicimp.hxx"
#include "lngopt.hxx"
+#include "defs.hxx"
+#include "dlistimp.hxx"
+#include "dicimp.hxx"
+#include "lngopt.hxx"
+
//using namespace utl;
using namespace osl;
using namespace rtl;
diff --git a/linguistic/source/staticmb.cxx b/linguistic/source/staticmb.cxx
deleted file mode 100644
index 8b2b6bc1a364..000000000000
--- a/linguistic/source/staticmb.cxx
+++ /dev/null
@@ -1,29 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_linguistic.hxx"
diff --git a/linguistic/workben/lex.map b/linguistic/workben/lex.map
deleted file mode 100644
index bd76ef3b85ce..000000000000
--- a/linguistic/workben/lex.map
+++ /dev/null
@@ -1,8 +0,0 @@
-LEX_1_0 {
- global:
- component_getFactory;
- component_getImplementationEnvironment;
- component_writeInfo;
- local:
- *;
-};
diff --git a/linguistic/workben/makefile.mk b/linguistic/workben/makefile.mk
index 5c8cc67e852c..26cbb7ec8d65 100644
--- a/linguistic/workben/makefile.mk
+++ b/linguistic/workben/makefile.mk
@@ -94,7 +94,7 @@ SHL1IMPLIB= i$(TARGET)
SHL1DEPN= $(SHL1LIBS)
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
.IF "$(OS)"!="MACOSX"
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
.ENDIF
# build DEF file
diff --git a/officecfg/prj/build.lst b/officecfg/prj/build.lst
index dba837c643a7..04d2cfd87aef 100644
--- a/officecfg/prj/build.lst
+++ b/officecfg/prj/build.lst
@@ -1,5 +1,4 @@
oc officecfg : l10n soltools solenv LIBXSLT:libxslt NULL
-oc officecfg usr30073 - none NULL
oc officecfg usr1 - all oc_mkout NULL
oc officecfg\registry\schema nmake - all oc_reg_schema NULL
oc officecfg\registry nmake - all oc_reg NULL
diff --git a/officecfg/registry/component-update.dtd b/officecfg/registry/component-update.dtd
index 51623f40bafa..81acc5e35eee 100644
--- a/officecfg/registry/component-update.dtd
+++ b/officecfg/registry/component-update.dtd
@@ -113,7 +113,8 @@
<!ELEMENT oor:items (item*)>
<!ATTLIST oor:items>
-<!ELEMENT item ((prop | node)*)>
+<!ELEMENT item ((node | prop | value)*)>
<!ATTLIST item
oor:path CDATA #REQUIRED>
- <!-- the absolute path representation of a set or group node -->
+ <!-- the absolute path representation of a localized property or a group
+ or set node -->
diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
index bf08c7b5da6a..5c735744104b 100755
--- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
@@ -67,7 +67,7 @@
</node>
<node oor:name="F5_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
- <value xml:lang="en-US">.uno:GrabControlFocus</value>
+ <value xml:lang="en-US">.uno:ToggleControlFocus</value>
</prop>
</node>
<node oor:name="F7_SHIFT_MOD1" oor:op="replace">
@@ -212,7 +212,7 @@
</node>
<node oor:name="F5_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
- <value xml:lang="en-US">.uno:GrabControlFocus</value>
+ <value xml:lang="en-US">.uno:ToggleControlFocus</value>
</prop>
</node>
<node oor:name="F7_SHIFT_MOD1" oor:op="replace">
@@ -394,6 +394,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:AlignBlock</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -459,6 +460,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:AlignHorizontalCenter</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F11" oor:op="replace">
@@ -533,7 +535,7 @@
</node>
<node oor:name="F7_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
- <value xml:lang="en-US">.uno:Thesaurus</value>
+ <value xml:lang="en-US">.uno:ThesaurusDialog</value>
</prop>
</node>
<node oor:name="F7_SHIFT" oor:op="replace">
@@ -566,6 +568,11 @@
<value xml:lang="en-US">.uno:CalculateHard</value>
</prop>
</node>
+ <node oor:name="F_MOD1_MOD2" oor:op="replace">
+ <prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="en-US">vnd.sun.star.findbar:FocusToFindbar</value>
+ </prop>
+ </node>
<node oor:name="F_SHIFT_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:Bold</value>
@@ -828,6 +835,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -988,6 +996,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:JustifyPara</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -1023,6 +1032,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:CenterPara</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F11" oor:op="replace">
@@ -1072,7 +1082,7 @@
</node>
<node oor:name="F7_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
- <value xml:lang="en-US">.uno:Thesaurus</value>
+ <value xml:lang="en-US">.uno:ThesaurusDialog</value>
</prop>
</node>
<node oor:name="F8" oor:op="replace">
@@ -1085,6 +1095,11 @@
<value xml:lang="en-US">.uno:TextFitToSize</value>
</prop>
</node>
+ <node oor:name="F_MOD1_MOD2" oor:op="replace">
+ <prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="en-US">vnd.sun.star.findbar:FocusToFindbar</value>
+ </prop>
+ </node>
<node oor:name="F_SHIFT_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:Bold</value>
@@ -1228,6 +1243,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -1336,6 +1352,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:JustifyPara</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -1421,6 +1438,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:CenterPara</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F10_MOD1" oor:op="replace">
@@ -1558,6 +1576,11 @@
<value xml:lang="en-US">.uno:UpdateInputFields</value>
</prop>
</node>
+ <node oor:name="F_MOD1_MOD2" oor:op="replace">
+ <prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="en-US">vnd.sun.star.findbar:FocusToFindbar</value>
+ </prop>
+ </node>
<node oor:name="F_SHIFT_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:Bold</value>
@@ -1835,6 +1858,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -1931,6 +1955,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:JustifyPara</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -1971,6 +1996,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:CenterPara</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F11" oor:op="replace">
@@ -2030,7 +2056,7 @@
</node>
<node oor:name="F7_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
- <value xml:lang="en-US">.uno:Thesaurus</value>
+ <value xml:lang="en-US">.uno:ThesaurusDialog</value>
</prop>
</node>
<node oor:name="F8" oor:op="replace">
@@ -2043,6 +2069,11 @@
<value xml:lang="en-US">.uno:TextFitToSize</value>
</prop>
</node>
+ <node oor:name="F_MOD1_MOD2" oor:op="replace">
+ <prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="en-US">vnd.sun.star.findbar:FocusToFindbar</value>
+ </prop>
+ </node>
<node oor:name="F_SHIFT_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:Bold</value>
@@ -2201,6 +2232,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -2361,6 +2393,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:JustifyPara</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -2446,6 +2479,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:CenterPara</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F10_MOD1" oor:op="replace">
@@ -2583,6 +2617,11 @@
<value xml:lang="en-US">.uno:UpdateInputFields</value>
</prop>
</node>
+ <node oor:name="F_MOD1_MOD2" oor:op="replace">
+ <prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="en-US">vnd.sun.star.findbar:FocusToFindbar</value>
+ </prop>
+ </node>
<node oor:name="F_SHIFT_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:Bold</value>
@@ -2860,6 +2899,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -2973,6 +3013,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:JustifyPara</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -3063,6 +3104,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:CenterPara</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F10_MOD1" oor:op="replace">
@@ -3497,6 +3539,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -3595,6 +3638,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:JustifyPara</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -3680,6 +3724,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:CenterPara</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F10_MOD1" oor:op="replace">
@@ -4094,6 +4139,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -4197,6 +4243,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:JustifyPara</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -4254,7 +4301,7 @@
<value xml:lang="en-US">.uno:ParaRightToLeft</value>
</prop>
</node>
- <node oor:name="END" oor:op="replace">
+ <node oor:name="END" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:GoToEndOfLine</value>
</prop>
@@ -4282,6 +4329,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:CenterPara</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F10_MOD1" oor:op="replace">
@@ -4419,6 +4467,11 @@
<value xml:lang="en-US">.uno:UpdateInputFields</value>
</prop>
</node>
+ <node oor:name="F_MOD1_MOD2" oor:op="replace">
+ <prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="en-US">vnd.sun.star.findbar:FocusToFindbar</value>
+ </prop>
+ </node>
<node oor:name="F_SHIFT_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:Bold</value>
@@ -4696,6 +4749,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -4804,6 +4858,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:JustifyPara</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -4889,6 +4944,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:CenterPara</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F10_MOD1" oor:op="replace">
@@ -5026,6 +5082,11 @@
<value xml:lang="en-US">.uno:UpdateInputFields</value>
</prop>
</node>
+ <node oor:name="F_MOD1_MOD2" oor:op="replace">
+ <prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="en-US">vnd.sun.star.findbar:FocusToFindbar</value>
+ </prop>
+ </node>
<node oor:name="F_SHIFT_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:Bold</value>
@@ -5303,6 +5364,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -5541,7 +5603,19 @@
<value xml:lang="en-US">.uno:Paste</value>
</prop>
</node>
- <node oor:name="OPEN" oor:op="replace">
+ <node oor:name="K_MOD1" oor:op="replace">
+ <prop oor:name="Command">
+ <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="es">.uno:Italic</value>
+ </prop>
+ </node>
+ <node oor:name="N_MOD1" oor:op="replace">
+ <prop oor:name="Command">
+ <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="es">.uno:Bold</value>
+ </prop>
+ </node>
+ <node oor:name="OPEN" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Open</value>
</prop>
@@ -5615,7 +5689,19 @@
<value xml:lang="en-US">.uno:Paste</value>
</prop>
</node>
- <node oor:name="OPEN" oor:op="replace">
+ <node oor:name="K_MOD1" oor:op="replace">
+ <prop oor:name="Command">
+ <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="es">.uno:Italic</value>
+ </prop>
+ </node>
+ <node oor:name="N_MOD1" oor:op="replace">
+ <prop oor:name="Command">
+ <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="es">.uno:Bold</value>
+ </prop>
+ </node>
+ <node oor:name="OPEN" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Open</value>
</prop>
@@ -5625,6 +5711,20 @@
<value xml:lang="en-US">.uno:Paste</value>
</prop>
</node>
+ <node oor:name="S_MOD1" oor:op="replace">
+ <prop oor:name="Command">
+ <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="es">.uno:Underline</value>
+ </prop>
+ </node>
+ <node oor:name="T_MOD1" oor:op="replace">
+ <prop oor:name="Command">
+ <value xml:lang="x-no-translate" install:module="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="de" install:module="unxwnt">.uno:SubScript</value>
+ <value xml:lang="es" install:module="unxwnt">.uno:AlignHorizontalCenter</value>
+ <value xml:lang="en-US" install:module="macosx">.uno:DesignerDialog</value>
+ </prop>
+ </node>
<node oor:name="UNDO" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Undo</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu
index fe1fb92abb0e..b7c019f24c28 100644
--- a/officecfg/registry/data/org/openoffice/Office/Common.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu
@@ -134,7 +134,7 @@
<prop oor:name="TemplateRepositoryURL" oor:type="xs:string">
<value>${STARTCENTER_TEMPLREP_URL}</value>
</prop>
- <prop oor:name="StartCenterLayoutStyle" oor:type="xs:int">
+ <prop oor:name="StartCenterLayoutStyle" oor:type="xs:int" install:module="brand">
<value>${STARTCENTER_LAYOUT_STYLE}</value>
</prop>
</node>
@@ -157,6 +157,11 @@
<value install:module="wnt">WIN</value>
</prop>
</node>
+ <node oor:name="Dictionaries">
+ <prop oor:name="RepositoryURL" install:module="brand">
+ <value>${DICT_REPO_URL}</value>
+ </prop>
+ </node>
<node oor:name="AutoCorrect">
<prop oor:name="ReplaceSingleQuote" install:module="korea">
<value>true</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/Impress.xcu b/officecfg/registry/data/org/openoffice/Office/Impress.xcu
index 8db415e7c57b..353cecfd51c2 100644
--- a/officecfg/registry/data/org/openoffice/Office/Impress.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Impress.xcu
@@ -123,27 +123,27 @@
<node oor:name="ResourceList">
<node oor:name="R0" oor:op="replace">
<prop oor:name="URL">
- <value>private:resource/taskpanel/MasterPages</value>
+ <value>private:resource/toolpanel/DrawingFramework/MasterPages</value>
</prop>
</node>
<node oor:name="R1" oor:op="replace">
<prop oor:name="URL">
- <value>private:resource/taskpanel/Layouts</value>
+ <value>private:resource/toolpanel/DrawingFramework/Layouts</value>
</prop>
</node>
<node oor:name="R2" oor:op="replace">
<prop oor:name="URL">
- <value>private:resource/taskpanel/TableDesign</value>
+ <value>private:resource/toolpanel/DrawingFramework/TableDesign</value>
</prop>
</node>
<node oor:name="R3" oor:op="replace">
<prop oor:name="URL">
- <value>private:resource/taskpanel/CustomAnimations</value>
+ <value>private:resource/toolpanel/DrawingFramework/CustomAnimations</value>
</prop>
</node>
<node oor:name="R4" oor:op="replace">
<prop oor:name="URL">
- <value>private:resource/taskpanel/SlideTransitions</value>
+ <value>private:resource/toolpanel/DrawingFramework/SlideTransitions</value>
</prop>
</node>
</node>
diff --git a/officecfg/registry/data/org/openoffice/Office/Paths.xcu b/officecfg/registry/data/org/openoffice/Office/Paths.xcu
index a7ecd0e224e8..91a26137b24d 100644
--- a/officecfg/registry/data/org/openoffice/Office/Paths.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Paths.xcu
@@ -98,7 +98,13 @@
</node>
</node>
- <node oor:name="Gallery" oor:op="fuse" oor:mandatory="true">
+ <node oor:name="Libraries" oor:op="fuse" oor:mandatory="true">
+ <node oor:name="InternalPaths">
+ <node oor:name="$(progpath)/libraries" oor:op="fuse" />
+ </node>
+ </node>
+
+ <node oor:name="Gallery" oor:op="fuse" oor:mandatory="true">
<node oor:name="InternalPaths">
<node oor:name="$(insturl)/share/gallery" oor:op="fuse" />
</node>
diff --git a/officecfg/registry/data/org/openoffice/Office/ProtocolHandler.xcu b/officecfg/registry/data/org/openoffice/Office/ProtocolHandler.xcu
index 8ef8fcd259e0..0d5dd5e3b499 100644
--- a/officecfg/registry/data/org/openoffice/Office/ProtocolHandler.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/ProtocolHandler.xcu
@@ -63,5 +63,10 @@
<value>vnd.sun.star.popup:*</value>
</prop>
</node>
+ <node oor:name="com.sun.star.comp.svx.FindbarDispatcher" oor:op="replace">
+ <prop oor:name="Protocols">
+ <value>vnd.sun.star.findbar:*</value>
+ </prop>
+ </node>
</node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/SFX.xcu b/officecfg/registry/data/org/openoffice/Office/SFX.xcu
index 5a576588c974..1fbf093170cf 100644
--- a/officecfg/registry/data/org/openoffice/Office/SFX.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/SFX.xcu
@@ -30,27 +30,27 @@
<node oor:name="Help">
<prop oor:name="HelpAgentStarterList">
<value xml:lang="x-no-translate"></value>
- <value xml:lang="de">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="en-US">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="zh-CN">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="ja">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="zh-TW">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="el">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="es">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="pl">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="pt">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="ko">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="fr">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="ar">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="ru">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="nl">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="da">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="it">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="tr">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="sv">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="fi">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="pt-BR">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="ca">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
+ <value xml:lang="de">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="en-US">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="zh-CN">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="ja">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="zh-TW">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="el">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="es">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="pl">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="pt">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="ko">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="fr">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="ar">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="ru">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="nl">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="da">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="it">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="tr">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="sv">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="fi">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="pt-BR">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="ca">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
</prop>
</node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
index 8c76a2dadd9f..33e5109405d0 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
@@ -134,7 +134,7 @@
<value xml:lang="en-US">~Hyphenation...</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:ObjectTitleDescription" oor:op="replace">
@@ -1254,6 +1254,19 @@
<value xml:lang="en-US">Rename Sheet</value>
</prop>
</node>
+ <node oor:name=".uno:SetTabBgColor" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">~Tab Color...</value>
+ </prop>
+ <prop oor:name="ContextLabel" oor:type="xs:string">
+ <value xml:lang="en-US">~Tab Color...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:TabBgColor" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Tab Color</value>
+ </prop>
+ </node>
<node oor:name=".uno:Move" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Move/Copy Sheet...</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu
index c5d32679b108..a427a0caf052 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu
@@ -293,6 +293,26 @@
<value>true</value>
</prop>
</node>
+ <node oor:name="private:resource/toolbar/findbar" oor:op="replace">
+ <prop oor:name="DockPos" oor:type="xs:string">
+ <value>1,0</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Find</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
<node oor:name="private:resource/toolbar/textobjectbar" oor:op="replace">
<prop oor:name="DockPos" oor:type="xs:string">
<value>0,1</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ChartWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ChartWindowState.xcu
index 29e26bbf29a9..304ce02282e6 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/ChartWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/ChartWindowState.xcu
@@ -73,6 +73,90 @@
<value>true</value>
</prop>
</node>
+ <node oor:name="private:resource/toolbar/basicshapes" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Basic Shapes</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/symbolshapes" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Symbol Shapes</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/arrowshapes" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Block Arrows</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/flowchartshapes" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Flowchart</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/calloutshapes" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Callouts</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/starshapes" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Stars and Banners</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
</node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
index 553d94fc2fdb..0054c7af24f1 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
@@ -218,6 +218,94 @@
<value>com.sun.star.svx.FontHeightToolBoxController</value>
</prop>
</node>
+ <node oor:name="AssignLayout" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:AssignLayout</value>
+ </prop>
+ <prop oor:name="Module">
+ <value>com.sun.star.presentation.PresentationDocument</value>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.comp.sd.SlideLayoutController</value>
+ </prop>
+ </node>
+ <node oor:name="InsertPage" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:InsertPage</value>
+ </prop>
+ <prop oor:name="Module">
+ <value>com.sun.star.presentation.PresentationDocument</value>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.comp.sd.InsertSlideController</value>
+ </prop>
+ </node>
+ <node oor:name="ExtrusionDirectionFloater" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:ExtrusionDirectionFloater</value>
+ </prop>
+ <prop oor:name="Module">
+ <value/>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.comp.svx.ExtrusionDirectionController</value>
+ </prop>
+ </node>
+ <node oor:name="ExtrusionDepthController" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:ExtrusionDepthFloater</value>
+ </prop>
+ <prop oor:name="Module">
+ <value/>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.comp.svx.ExtrusionDepthController</value>
+ </prop>
+ </node>
+ <node oor:name="ExtrusionLightingFloater" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:ExtrusionLightingFloater</value>
+ </prop>
+ <prop oor:name="Module">
+ <value/>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.comp.svx.ExtrusionLightingController</value>
+ </prop>
+ </node>
+ <node oor:name="ExtrusionSurfaceFloater" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:ExtrusionSurfaceFloater</value>
+ </prop>
+ <prop oor:name="Module">
+ <value/>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.comp.svx.ExtrusionSurfaceController</value>
+ </prop>
+ </node>
+ <node oor:name="FontworkAlignmentFloater" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:FontworkAlignmentFloater</value>
+ </prop>
+ <prop oor:name="Module">
+ <value/>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.comp.svx.FontworkAlignmentController</value>
+ </prop>
+ </node>
+ <node oor:name="FontworkCharacterSpacingFloater" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:FontworkCharacterSpacingFloater</value>
+ </prop>
+ <prop oor:name="Module">
+ <value/>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.comp.svx.FontworkCharacterSpacingController</value>
+ </prop>
+ </node>
<node oor:name="c3" oor:op="replace">
<prop oor:name="Command">
<value>.uno:ChartElementSelector</value>
@@ -229,7 +317,7 @@
<value>com.sun.star.comp.chart.ElementSelectorToolbarController</value>
</prop>
</node>
- <node oor:name="c4" oor:op="replace">
+ <node oor:name="com.sun.star.chart2.BasicShapesToolbarController" oor:op="replace">
<prop oor:name="Command">
<value>.uno:BasicShapes</value>
</prop>
@@ -237,10 +325,10 @@
<value>com.sun.star.chart2.ChartDocument</value>
</prop>
<prop oor:name="Controller">
- <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ <value>com.sun.star.comp.chart2.ShapeToolbarController</value>
</prop>
</node>
- <node oor:name="c5" oor:op="replace">
+ <node oor:name="com.sun.star.chart2.SymbolShapesToolbarController" oor:op="replace">
<prop oor:name="Command">
<value>.uno:SymbolShapes</value>
</prop>
@@ -248,10 +336,10 @@
<value>com.sun.star.chart2.ChartDocument</value>
</prop>
<prop oor:name="Controller">
- <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ <value>com.sun.star.comp.chart2.ShapeToolbarController</value>
</prop>
</node>
- <node oor:name="c6" oor:op="replace">
+ <node oor:name="com.sun.star.chart2.ArrowShapesToolbarController" oor:op="replace">
<prop oor:name="Command">
<value>.uno:ArrowShapes</value>
</prop>
@@ -259,10 +347,10 @@
<value>com.sun.star.chart2.ChartDocument</value>
</prop>
<prop oor:name="Controller">
- <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ <value>com.sun.star.comp.chart2.ShapeToolbarController</value>
</prop>
</node>
- <node oor:name="c7" oor:op="replace">
+ <node oor:name="com.sun.star.chart2.FlowChartShapesToolbarController" oor:op="replace">
<prop oor:name="Command">
<value>.uno:FlowChartShapes</value>
</prop>
@@ -270,10 +358,10 @@
<value>com.sun.star.chart2.ChartDocument</value>
</prop>
<prop oor:name="Controller">
- <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ <value>com.sun.star.comp.chart2.ShapeToolbarController</value>
</prop>
</node>
- <node oor:name="c8" oor:op="replace">
+ <node oor:name="com.sun.star.chart2.CalloutShapesToolbarController" oor:op="replace">
<prop oor:name="Command">
<value>.uno:CalloutShapes</value>
</prop>
@@ -281,10 +369,10 @@
<value>com.sun.star.chart2.ChartDocument</value>
</prop>
<prop oor:name="Controller">
- <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ <value>com.sun.star.comp.chart2.ShapeToolbarController</value>
</prop>
</node>
- <node oor:name="c9" oor:op="replace">
+ <node oor:name="com.sun.star.chart2.StarShapesToolbarController" oor:op="replace">
<prop oor:name="Command">
<value>.uno:StarShapes</value>
</prop>
@@ -292,7 +380,40 @@
<value>com.sun.star.chart2.ChartDocument</value>
</prop>
<prop oor:name="Controller">
- <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ <value>com.sun.star.comp.chart2.ShapeToolbarController</value>
+ </prop>
+ </node>
+ <node oor:name="com.sun.star.svx.FindTextToolboxController" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:FindText</value>
+ </prop>
+ <prop oor:name="Module">
+ <value/>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.svx.FindTextToolboxController</value>
+ </prop>
+ </node>
+ <node oor:name="com.sun.star.svx.DownSearchToolboxController" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:DownSearch</value>
+ </prop>
+ <prop oor:name="Module">
+ <value/>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.svx.DownSearchToolboxController</value>
+ </prop>
+ </node>
+ <node oor:name="com.sun.star.svx.UpSearchToolboxController" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:UpSearch</value>
+ </prop>
+ <prop oor:name="Module">
+ <value/>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.svx.UpSearchToolboxController</value>
</prop>
</node>
</node>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
index 2925c2a97802..7138636549d6 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
@@ -1,533 +1,533 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE oor:component-data SYSTEM "../../../../../component-update.dtd">
<oor:component-data oor:name="DrawImpressCommands" 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">
- <node oor:name="Commands">
- <node oor:name=".uno:Polygon" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Polygon, filled</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ColorView" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Black &amp; White View</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:RenamePage" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Rename Slide</value>
- </prop>
- </node>
- <node oor:name=".uno:RenameLayer" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Rename</value>
- </prop>
- </node>
- <node oor:name=".uno:Presentation" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Slide Show</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:RehearseTimings" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Rehearse Timings</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:Dia" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">SlideTransition</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ShowSlide" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Sho~w Slide</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:HideSlide" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Hide Slide</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:TextAttributes" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Te~xt...</value>
- </prop>
- </node>
- <node oor:name=".uno:PagesPerRow" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Slides Per Row</value>
- </prop>
- </node>
- <node oor:name=".uno:TextFitToSizeTool" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Fit Text to Frame</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:VerticalTextFitToSizeTool" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Fit Vertical Text to Frame</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:Objects3DToolbox" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">3D Objects</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:Cube" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Cube</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:Sphere" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Sphere</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:Cylinder" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Cylinder</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:Cone" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Cone</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:Cyramid" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Pyramid</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:GlueEditMode" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Glue Points</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:GlueInsertPoint" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Insert Glue Point</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:GluePercent" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Glue Point Relative</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:GlueEscapeDirection" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Exit Direction</value>
- </prop>
- </node>
- <node oor:name=".uno:GlueHorzAlignCenter" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Glue Point Horizontal Center</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:GlueHorzAlignLeft" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Glue Point Horizontal Left</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:GlueHorzAlignRight" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Glue Point Horizontal Right</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:GlueVertAlignCenter" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Glue Point Vertical Center</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:GlueVertAlignTop" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Glue Point Vertical Top</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:GlueVertAlignBottom" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Glue Point Vertical Bottom</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:Shell3D" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Shell</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:Torus" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Torus</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:HalfSphere" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Half-Sphere</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:GlueEscapeDirectionLeft" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Exit Direction Left</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:GlueEscapeDirectionRight" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Exit Direction Right</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:GlueEscapeDirectionTop" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Exit Direction Top</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:GlueEscapeDirectionBottom" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Exit Direction Bottom</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:InsertToolbox" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Insert</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:Morphing" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Cross-fading...</value>
- </prop>
- </node>
- <node oor:name=".uno:MeasureAttributes" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Dimen~sions...</value>
- </prop>
- </node>
- <node oor:name=".uno:GridFront" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Grid to ~Front</value>
- </prop>
- </node>
- <node oor:name=".uno:HelplinesVisible" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Display Guides</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:HelplinesFront" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Guides to ~Front</value>
- </prop>
- </node>
- <node oor:name=".uno:BeforeObject" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">In Front of ~Object</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:PreviewWindow" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Pre~view</value>
- </prop>
- </node>
- <node oor:name=".uno:CustomAnimation" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Custom Animation...</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:CustomAnimationSchemes" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Animation Schemes...</value>
- </prop>
- </node>
- <node oor:name=".uno:SlideChangeWindow" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Slide Transition...</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorAttributes" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Connector...</value>
- </prop>
- </node>
- <node oor:name=".uno:PresentationDialog" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">S~lide Show Settings...</value>
- </prop>
- </node>
- <node oor:name=".uno:Hyphenation" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Hyphenation</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:NewRouting" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Reset Routing</value>
- </prop>
- </node>
- <node oor:name=".uno:DuplicatePage" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">D~uplicate Slide</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ExpandPage" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">E~xpand Slide</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:SummaryPage" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Su~mmary Slide</value>
- </prop>
- </node>
- <node oor:name=".uno:LeaveAllGroups" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Exit All Groups</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ParaspaceIncrease" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Increase Spacing</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ParaspaceDecrease" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Decrease Spacing</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:SlideMasterPage" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Slide Master</value>
- </prop>
- </node>
- <node oor:name=".uno:HandoutMasterPage" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Handout Master</value>
- </prop>
- </node>
- <node oor:name=".uno:NotesMasterPage" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Notes Master</value>
- </prop>
- </node>
- <node oor:name=".uno:TitleMasterPage" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Title Slide Master</value>
- </prop>
- </node>
- <node oor:name=".uno:InsertPageQuick" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Insert Slide Direct</value>
- </prop>
- </node>
- <node oor:name=".uno:InsertDateFieldVar" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Dat~e (variable)</value>
- </prop>
- </node>
- <node oor:name=".uno:InsertDateFieldFix" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Date (fixed)</value>
- </prop>
- </node>
- <node oor:name=".uno:InsertTimeFieldVar" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">T~ime (variable)</value>
- </prop>
- </node>
- <node oor:name=".uno:InsertTimeFieldFix" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Time (fixed)</value>
- </prop>
- </node>
- <node oor:name=".uno:InsertPageField" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Page Number</value>
- </prop>
- </node>
+ <node oor:name="UserInterface">
+ <node oor:name="Commands">
+ <node oor:name=".uno:Polygon" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Polygon, filled</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ColorView" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Black &amp; White View</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:RenamePage" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Rename Slide</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:RenameLayer" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Rename</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Presentation" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Slide Show</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:RehearseTimings" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Rehearse Timings</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Dia" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">SlideTransition</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ShowSlide" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Sho~w Slide</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:HideSlide" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Hide Slide</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:TextAttributes" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Te~xt...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:PagesPerRow" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Slides Per Row</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:TextFitToSizeTool" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Fit Text to Frame</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:VerticalTextFitToSizeTool" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Fit Vertical Text to Frame</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Objects3DToolbox" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">3D Objects</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Cube" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Cube</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Sphere" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Sphere</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Cylinder" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Cylinder</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Cone" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Cone</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Cyramid" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Pyramid</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GlueEditMode" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Glue Points</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GlueInsertPoint" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Insert Glue Point</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GluePercent" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Glue Point Relative</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GlueEscapeDirection" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Exit Direction</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GlueHorzAlignCenter" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Glue Point Horizontal Center</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GlueHorzAlignLeft" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Glue Point Horizontal Left</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GlueHorzAlignRight" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Glue Point Horizontal Right</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GlueVertAlignCenter" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Glue Point Vertical Center</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GlueVertAlignTop" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Glue Point Vertical Top</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GlueVertAlignBottom" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Glue Point Vertical Bottom</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Shell3D" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Shell</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Torus" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Torus</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:HalfSphere" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Half-Sphere</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GlueEscapeDirectionLeft" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Exit Direction Left</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GlueEscapeDirectionRight" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Exit Direction Right</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GlueEscapeDirectionTop" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Exit Direction Top</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GlueEscapeDirectionBottom" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Exit Direction Bottom</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertToolbox" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Insert</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Morphing" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Cross-fading...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:MeasureAttributes" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Dimen~sions...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GridFront" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Grid to ~Front</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:HelplinesVisible" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Display Guides</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:HelplinesFront" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Guides to ~Front</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:BeforeObject" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">In Front of ~Object</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:PreviewWindow" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Pre~view</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:CustomAnimation" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Custom Animation...</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:CustomAnimationSchemes" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Animation Schemes...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:SlideChangeWindow" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Slide Transition...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorAttributes" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Connector...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:PresentationDialog" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">S~lide Show Settings...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Hyphenation" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Hyphenation</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:NewRouting" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Reset Routing</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DuplicatePage" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">D~uplicate Slide</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ExpandPage" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">E~xpand Slide</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:SummaryPage" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Su~mmary Slide</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:LeaveAllGroups" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Exit All Groups</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ParaspaceIncrease" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Increase Spacing</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ParaspaceDecrease" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Decrease Spacing</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:SlideMasterPage" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Slide Master</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:HandoutMasterPage" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Handout Master</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:NotesMasterPage" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Notes Master</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:TitleMasterPage" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Title Slide Master</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertPageQuick" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Insert Slide Direct</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertDateFieldVar" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Dat~e (variable)</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertDateFieldFix" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Date (fixed)</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertTimeFieldVar" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">T~ime (variable)</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertTimeFieldFix" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Time (fixed)</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertPageField" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Page Number</value>
+ </prop>
+ </node>
<node oor:name=".uno:InsertPagesField" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
@@ -535,1521 +535,1527 @@
</prop>
</node>
<node oor:name=".uno:ModifyField" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">F~ields...</value>
- </prop>
- </node>
- <node oor:name=".uno:InsertFileField" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~File Name</value>
- </prop>
- </node>
- <node oor:name=".uno:InsertAuthorField" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Author</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:CustomShowDialog" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Custom Slide Show...</value>
- </prop>
- </node>
- <node oor:name=".uno:OutputQualityColor" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Color</value>
- </prop>
- </node>
- <node oor:name=".uno:OutputQualityGrayscale" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Grayscale</value>
- </prop>
- </node>
- <node oor:name=".uno:OutputQualityBlackWhite" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Black and White</value>
- </prop>
- </node>
- <node oor:name=".uno:PreviewQualityColor" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Color</value>
- </prop>
- </node>
- <node oor:name=".uno:PreviewQualityGrayscale" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Grayscale</value>
- </prop>
- </node>
- <node oor:name=".uno:PreviewQualityBlackWhite" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Black and White</value>
- </prop>
- </node>
- <node oor:name=".uno:ConvertInto3D" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">To 3~D</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConvertInto3DLatheFast" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">To 3D ~Rotation Object</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConvertIntoBitmap" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">To ~Bitmap</value>
- </prop>
- </node>
- <node oor:name=".uno:ConvertIntoMetaFile" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">To ~Metafile</value>
- </prop>
- </node>
- <node oor:name=".uno:PackAndGo" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Pack</value>
- </prop>
- </node>
- <node oor:name=".uno:convert_to_contour" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">To C~ontour</value>
- </prop>
- </node>
- <node oor:name=".uno:EditHyperlink" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">H~yperlink...</value>
- </prop>
- </node>
- <node oor:name=".uno:PageSetup" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Page...</value>
- </prop>
- </node>
- <node oor:name=".uno:PasteSpecial" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Paste ~Special...</value>
- </prop>
- </node>
- <node oor:name=".uno:CopyObjects" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Duplicat~e...</value>
- </prop>
- </node>
- <node oor:name=".uno:ManageLinks" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Lin~ks...</value>
- </prop>
- </node>
- <node oor:name=".uno:ConvertInto3DLathe" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">In 3D Rotation Object</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:DrawingMode" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Drawing View</value>
- </prop>
- </node>
- <node oor:name=".uno:OutlineMode" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Outline</value>
- </prop>
- </node>
- <node oor:name=".uno:OutputQualityContrast" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~High Contrast</value>
- </prop>
- </node>
- <node oor:name=".uno:DiaMode" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Sli~de Sorter</value>
- </prop>
- </node>
- <node oor:name=".uno:PreviewQualityContrast" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~High Contrast</value>
- </prop>
- </node>
- <node oor:name=".uno:InsertPage" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Slid~e</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ImportFromFile" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~File...</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ZoomPanning" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Shift</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:PixelMode" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Pixel Mode</value>
- </prop>
- </node>
- <node oor:name=".uno:ObjectPosition" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Arrange</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:Combine" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Comb~ine</value>
- </prop>
- </node>
- <node oor:name=".uno:ObjectTitleDescription" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Description...</value>
- </prop>
- </node>
- <node oor:name=".uno:NameGroup" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Name...</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorToolbox" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Connector</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:Forward" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Bring ~Forward</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:Backward" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Send Back~ward</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:MirrorVert" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Vertically</value>
- </prop>
- </node>
- <node oor:name=".uno:MirrorHorz" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Horizontally</value>
- </prop>
- </node>
- <node oor:name=".uno:ChangeBezier" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">To ~Curve</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ChangePolygon" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">To ~Polygon</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:CapturePoint" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Insert Snap Point/Line...</value>
- </prop>
- </node>
- <node oor:name=".uno:ShowRuler" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Ruler</value>
- </prop>
- </node>
- <node oor:name=".uno:InsertLayer" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Layer...</value>
- </prop>
- </node>
- <node oor:name=".uno:ModifyPage" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Slide ~Layout...</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ModifyLayer" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Layer...</value>
- </prop>
- </node>
- <node oor:name=".uno:PageMode" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Normal</value>
- </prop>
- </node>
- <node oor:name=".uno:LayerMode" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Layer</value>
- </prop>
- </node>
- <node oor:name=".uno:MeasureLine" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Dimension Line</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:MasterPage" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Master</value>
- </prop>
- </node>
- <node oor:name=".uno:DiaEffect" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Slide Effects</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:DiaSpeed" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Transition Speed</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:DiaAuto" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">AutoTransition</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:DiaTime" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Time</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:Connector" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Connector</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ActionMode" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Allow Interaction</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:AnimationObjects" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Animated Image...</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:AnimationEffects" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Interaction...</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:PresentationLayout" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Slide D~esign...</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:NotesMode" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Notes ~Page</value>
- </prop>
- </node>
- <node oor:name=".uno:HandoutMode" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">H~andout Page</value>
- </prop>
- </node>
- <node oor:name=".uno:DeletePage" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">D~elete Slide</value>
- </prop>
- </node>
- <node oor:name=".uno:DeleteLayer" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Delete</value>
- </prop>
- </node>
- <node oor:name=".uno:Dismantle" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Split</value>
- </prop>
- </node>
- <node oor:name=".uno:PageStatus" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Slide/Layer</value>
- </prop>
- </node>
- <node oor:name=".uno:LayoutStatus" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Layout</value>
- </prop>
- </node>
- <node oor:name=".uno:CrookRotate" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Set in Circle (perspective)</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:CrookSlant" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Set to circle (slant)</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:CrookStretch" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Set in Circle (distort)</value>
- </prop>
- </node>
- <node oor:name=".uno:Connect" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">C~onnect</value>
- </prop>
- </node>
- <node oor:name=".uno:Break" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Break</value>
- </prop>
- </node>
- <node oor:name=".uno:AdvancedMode" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Effects</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:InteractiveTransparence" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Transparency</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:InteractiveGradient" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Gradient</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:Shear" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Distort</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:BehindObject" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Be~hind Object</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ReverseOrder" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Reverse</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorArrowStart" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Connector Starts with Arrow</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorArrowEnd" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Connector Ends with Arrow</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorArrows" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Connector with Arrows</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorCircleStart" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Connector Starts with Circle</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorCircleEnd" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Connector Ends with Circle</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorCircles" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Connector with Circles</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:TextToolbox" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Text</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorLine" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Straight Connector</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:RectangleToolbox" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Rectangle</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorLineArrowStart" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Straight Connector starts with Arrow</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:EllipseToolbox" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Ellipse</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorLineArrowEnd" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Straight Connector ends with Arrow</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:LineToolbox" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Curve</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorLineArrows" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Straight Connector with Arrows</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorLineCircleStart" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Straight Connector starts with Circle</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorLineCircleEnd" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Straight Connector ends with Circle</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorLineCircles" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Straight Connector with Circles</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorCurve" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Curved Connector</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorCurveArrowStart" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Curved Connector Starts with Arrow</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorCurveArrowEnd" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Curved Connector Ends with Arrow</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorCurveArrows" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Curved Connector with Arrows</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorCurveCircleStart" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Curved Connector Starts with Circle</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorCurveCircleEnd" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Curved Connector Ends with Circle</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorCurveCircles" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Curved Connector with Circles</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorLines" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Line Connector</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorLinesArrowStart" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Line Connector Starts with Arrow</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorLinesArrowEnd" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Line Connector Ends with Arrow</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorLinesArrows" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Line Connector with Arrows</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorLinesCircleStart" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Line Connector Starts with Circle</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorLinesCircleEnd" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Line Connector Ends with Circle</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConnectorLinesCircles" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Line Connector with Circles</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:GraphicDraft" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Picture Placeholders</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:FillDraft" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Contour Mode</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:TextDraft" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Text Placeholders</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:LineDraft" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Line Contour Only</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:HandlesDraft" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Simple Handles</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:SolidCreate" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Modify Object with Attributes</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:HelplinesUse" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Snap to Guides</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:SnapBorder" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Snap to Page Margins</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:SnapFrame" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Snap to Object Border</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:SnapPoints" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Snap to Object Points</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:QuickEdit" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Allow Quick Editing</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:PickThrough" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Select Text Area Only</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ConvertTo1BitThreshold" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">1 Bit Threshold</value>
- </prop>
- </node>
- <node oor:name=".uno:ConvertTo1BitMatrix" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">1 Bit Dithered</value>
- </prop>
- </node>
- <node oor:name=".uno:ConvertTo4BitGrays" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">4 Bit grayscales</value>
- </prop>
- </node>
- <node oor:name=".uno:ConvertTo4BitColors" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">4 Bit color palette</value>
- </prop>
- </node>
- <node oor:name=".uno:ConvertTo8BitGrays" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">8 Bit Grayscales</value>
- </prop>
- </node>
- <node oor:name=".uno:ConvertTo8BitColors" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">8 Bit color palette</value>
- </prop>
- </node>
- <node oor:name=".uno:ConvertToTrueColor" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">24 Bit True Color</value>
- </prop>
- </node>
- <node oor:name=".uno:BigHandles" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Large Handles</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:DoubleClickTextEdit" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Double-click to edit Text</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ClickChangeRotation" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Rotation Mode after Clicking Object</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:ArrowsToolbox" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Lines and Arrows</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:LineArrowStart" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Line Starts with Arrow</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:LineArrowEnd" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Line Ends with Arrow</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:LineArrows" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Line with Arrows</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:LineArrowCircle" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Line with Arrow/Circle</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:LineCircleArrow" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Line with Circle/Arrow</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:LineArrowSquare" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Line with Arrow/Square</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:LineSquareArrow" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Line with Square/Arrow</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:Mirror" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Flip</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
-
- <node oor:name=".uno:InsertMasterPage" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">New Master</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:DeleteMasterPage" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Delete Master</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:RenameMasterPage" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Rename Master</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:CloseMasterView" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Close Master View</value>
- </prop>
- </node>
- <node oor:name=".uno:SendMailDocAsMS" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">E-mail as ~Microsoft PowerPoint Presentation...</value>
- </prop>
- </node>
- <node oor:name=".uno:SendMailDocAsOOo" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">E-mail as ~OpenDocument Presentation...</value>
- </prop>
- </node>
- </node>
- <node oor:name="Popups">
- <node oor:name=".uno:ModifyMenu" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Modify</value>
- </prop>
- </node>
- <node oor:name=".uno:WorkspaceMenu" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Wor~kspace</value>
- </prop>
- </node>
- <node oor:name=".uno:MirrorMenu" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Flip</value>
- </prop>
- </node>
- <node oor:name=".uno:PreviewDisplayQualityMenu" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Pre~view Mode</value>
- </prop>
- </node>
- <node oor:name=".uno:LayerMenu" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">La~yer</value>
- </prop>
- </node>
- <node oor:name=".uno:GridMenu" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Gr~id</value>
- </prop>
- </node>
- <node oor:name=".uno:ConvertMenu" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Convert</value>
- </prop>
- </node>
- <node oor:name=".uno:ArrangeMenu" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Arrange</value>
- </prop>
- </node>
- <node oor:name=".uno:DisplayQualityMenu" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Color/Grayscale</value>
- </prop>
- </node>
- <node oor:name=".uno:SlideShowMenu" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Slide Show</value>
- </prop>
- </node>
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">F~ields...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertFileField" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~File Name</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertAuthorField" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Author</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:CustomShowDialog" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Custom Slide Show...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:OutputQualityColor" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Color</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:OutputQualityGrayscale" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Grayscale</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:OutputQualityBlackWhite" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Black and White</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:PreviewQualityColor" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Color</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:PreviewQualityGrayscale" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Grayscale</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:PreviewQualityBlackWhite" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Black and White</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConvertInto3D" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">To 3~D</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConvertInto3DLatheFast" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">To 3D ~Rotation Object</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConvertIntoBitmap" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">To ~Bitmap</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConvertIntoMetaFile" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">To ~Metafile</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:PackAndGo" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Pack</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:convert_to_contour" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">To C~ontour</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:EditHyperlink" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">H~yperlink...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:PageSetup" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Page...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:PasteSpecial" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Paste ~Special...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:CopyObjects" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Duplicat~e...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ManageLinks" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Lin~ks...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConvertInto3DLathe" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">In 3D Rotation Object</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DrawingMode" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Drawing View</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:OutlineMode" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Outline</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:OutputQualityContrast" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~High Contrast</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DiaMode" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Sli~de Sorter</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:PreviewQualityContrast" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~High Contrast</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertPage" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Slid~e</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ImportFromFile" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~File...</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ZoomPanning" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Shift</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:PixelMode" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Pixel Mode</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ObjectPosition" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Arrange</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Combine" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Comb~ine</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ObjectTitleDescription" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Description...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:NameGroup" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Name...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorToolbox" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Connector</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Forward" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Bring ~Forward</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Backward" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Send Back~ward</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:MirrorVert" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Vertically</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:MirrorHorz" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Horizontally</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ChangeBezier" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">To ~Curve</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ChangePolygon" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">To ~Polygon</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:CapturePoint" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Insert Snap Point/Line...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ShowRuler" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Ruler</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertLayer" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Layer...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ModifyPage" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Slide ~Layout...</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ModifyLayer" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Layer...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:PageMode" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Normal</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:LayerMode" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Layer</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:MeasureLine" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Dimension Line</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:MasterPage" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Master</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DiaEffect" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Slide Effects</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DiaSpeed" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Transition Speed</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DiaAuto" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">AutoTransition</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DiaTime" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Time</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Connector" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Connector</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ActionMode" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Allow Interaction</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:AnimationObjects" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Animated Image...</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:AnimationEffects" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Interaction...</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:PresentationLayout" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Slide D~esign...</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:AssignLayout" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Slide Layout</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:NotesMode" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Notes ~Page</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:HandoutMode" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">H~andout Page</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DeletePage" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">D~elete Slide</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DeleteLayer" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Delete</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Dismantle" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Split</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:PageStatus" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Slide/Layer</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:LayoutStatus" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Layout</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:CrookRotate" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Set in Circle (perspective)</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:CrookSlant" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Set to circle (slant)</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:CrookStretch" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Set in Circle (distort)</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Connect" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">C~onnect</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Break" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Break</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:AdvancedMode" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Effects</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InteractiveTransparence" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Transparency</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InteractiveGradient" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Gradient</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Shear" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Distort</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:BehindObject" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Be~hind Object</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ReverseOrder" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Reverse</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorArrowStart" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Connector Starts with Arrow</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorArrowEnd" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Connector Ends with Arrow</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorArrows" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Connector with Arrows</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorCircleStart" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Connector Starts with Circle</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorCircleEnd" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Connector Ends with Circle</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorCircles" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Connector with Circles</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:TextToolbox" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Text</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorLine" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Straight Connector</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:RectangleToolbox" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Rectangle</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorLineArrowStart" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Straight Connector starts with Arrow</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:EllipseToolbox" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Ellipse</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorLineArrowEnd" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Straight Connector ends with Arrow</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:LineToolbox" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Curve</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorLineArrows" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Straight Connector with Arrows</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorLineCircleStart" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Straight Connector starts with Circle</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorLineCircleEnd" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Straight Connector ends with Circle</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorLineCircles" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Straight Connector with Circles</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorCurve" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Curved Connector</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorCurveArrowStart" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Curved Connector Starts with Arrow</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorCurveArrowEnd" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Curved Connector Ends with Arrow</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorCurveArrows" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Curved Connector with Arrows</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorCurveCircleStart" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Curved Connector Starts with Circle</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorCurveCircleEnd" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Curved Connector Ends with Circle</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorCurveCircles" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Curved Connector with Circles</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorLines" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Line Connector</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorLinesArrowStart" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Line Connector Starts with Arrow</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorLinesArrowEnd" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Line Connector Ends with Arrow</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorLinesArrows" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Line Connector with Arrows</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorLinesCircleStart" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Line Connector Starts with Circle</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorLinesCircleEnd" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Line Connector Ends with Circle</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConnectorLinesCircles" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Line Connector with Circles</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GraphicDraft" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Picture Placeholders</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:FillDraft" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Contour Mode</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:TextDraft" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Text Placeholders</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:LineDraft" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Line Contour Only</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:HandlesDraft" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Simple Handles</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:SolidCreate" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Modify Object with Attributes</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:HelplinesUse" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Snap to Guides</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:SnapBorder" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Snap to Page Margins</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:SnapFrame" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Snap to Object Border</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:SnapPoints" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Snap to Object Points</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:QuickEdit" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Allow Quick Editing</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:PickThrough" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Select Text Area Only</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConvertTo1BitThreshold" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">1 Bit Threshold</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConvertTo1BitMatrix" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">1 Bit Dithered</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConvertTo4BitGrays" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">4 Bit grayscales</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConvertTo4BitColors" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">4 Bit color palette</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConvertTo8BitGrays" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">8 Bit Grayscales</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConvertTo8BitColors" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">8 Bit color palette</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConvertToTrueColor" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">24 Bit True Color</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:BigHandles" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Large Handles</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DoubleClickTextEdit" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Double-click to edit Text</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ClickChangeRotation" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Rotation Mode after Clicking Object</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ArrowsToolbox" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Lines and Arrows</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:LineArrowStart" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Line Starts with Arrow</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:LineArrowEnd" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Line Ends with Arrow</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:LineArrows" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Line with Arrows</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:LineArrowCircle" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Line with Arrow/Circle</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:LineCircleArrow" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Line with Circle/Arrow</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:LineArrowSquare" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Line with Arrow/Square</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:LineSquareArrow" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Line with Square/Arrow</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:Mirror" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Flip</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+
+ <node oor:name=".uno:InsertMasterPage" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">New Master</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DeleteMasterPage" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Delete Master</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:RenameMasterPage" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Rename Master</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:CloseMasterView" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Close Master View</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:SendMailDocAsMS" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">E-mail as ~Microsoft PowerPoint Presentation...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:SendMailDocAsOOo" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">E-mail as ~OpenDocument Presentation...</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="Popups">
+ <node oor:name=".uno:ModifyMenu" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Modify</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:WorkspaceMenu" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Wor~kspace</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:MirrorMenu" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Flip</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:PreviewDisplayQualityMenu" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Pre~view Mode</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:LayerMenu" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">La~yer</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GridMenu" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Gr~id</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ConvertMenu" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Convert</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ArrangeMenu" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Arrange</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DisplayQualityMenu" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Color/Grayscale</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:SlideShowMenu" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Slide Show</value>
+ </prop>
+ </node>
<!--node oor:name=".uno:ReviewMenu" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Review</value>
</prop>
</node-->
<node oor:name=".uno:GroupMenu" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Group</value>
- </prop>
- </node>
- <node oor:name=".uno:SendMenu" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Sen~d</value>
- </prop>
- </node>
- <node oor:name=".uno:TemplatesMenu" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Styl~es</value>
- </prop>
- </node>
- <node oor:name=".uno:SnapLinesMenu" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Guides</value>
- </prop>
- </node>
- <node oor:name=".uno:MasterPageMenu" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Master</value>
- </prop>
- </node>
- <node oor:name=".uno:MasterLayoutsMenu" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Master Lay~outs</value>
- </prop>
- </node>
- <node oor:name=".uno:MasterLayouts" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Master ~Elements...</value>
- </prop>
- </node>
- <node oor:name=".uno:MasterLayoutsNotes" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Notes Master Layout...</value>
- </prop>
- </node>
- <node oor:name=".uno:MasterLayoutsHandouts" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Handout Master Layout...</value>
- </prop>
- </node>
- <node oor:name=".uno:HeaderAndFooter" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Header and Footer...</value>
- </prop>
- </node>
- <node oor:name=".uno:InsertPageNumber" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">P~age Number...</value>
- </prop>
- </node>
- <node oor:name=".uno:InsertDateAndTime" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Date and ~Time...</value>
- </prop>
- </node>
- <node oor:name=".uno:NormalMultiPaneGUI" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Normal</value>
- </prop>
- </node>
- <node oor:name=".uno:SlideSorterMultiPaneGUI" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Sli~de Sorter</value>
- </prop>
- </node>
- <node oor:name=".uno:LeftPaneImpress" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">S~lide Pane</value>
- </prop>
- </node>
- <node oor:name=".uno:LeftPaneDraw" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Page Pane</value>
- </prop>
- </node>
- <node oor:name=".uno:RightPane" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Tas~k Pane</value>
- </prop>
- </node>
-
- <node oor:name=".uno:MergeCells" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">Zellen verbinden</value>
- <value xml:lang="en-US">Merge Cells</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:SplitCell" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">Zelle teilen</value>
- <value xml:lang="en-US">Split Cells</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:OptimizeTable" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">Optimieren</value>
- <value xml:lang="en-US">Optimize</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:DistributeColumns" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Distribute Columns Evenly</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:DistributeRows" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Distribute Rows Equally </value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:CellVertBottom" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">Unten</value>
- <value xml:lang="en-US">Bottom</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:CellVertCenter" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">Mittig (vertikal)</value>
- <value xml:lang="en-US">Center ( vertical )</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:CellVertTop" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">Oben</value>
- <value xml:lang="en-US">Top</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:InsertRows" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">Zeile einfügen</value>
- <value xml:lang="en-US">Insert Row</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Group</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:SendMenu" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Sen~d</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:TemplatesMenu" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Styl~es</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:SnapLinesMenu" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Guides</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:MasterPageMenu" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Master</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:MasterLayoutsMenu" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Master Lay~outs</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:MasterLayouts" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Master ~Elements...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:MasterLayoutsNotes" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Notes Master Layout...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:MasterLayoutsHandouts" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Handout Master Layout...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:HeaderAndFooter" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Header and Footer...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertPageNumber" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">P~age Number...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertDateAndTime" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Date and ~Time...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:NormalMultiPaneGUI" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Normal</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:SlideSorterMultiPaneGUI" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Sli~de Sorter</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:LeftPaneImpress" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">S~lide Pane</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:LeftPaneDraw" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">~Page Pane</value>
+ </prop>
+ </node>
+
+ <node oor:name=".uno:RightPane" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Tas~k Pane</value>
+ </prop>
+ </node>
+
+ <node oor:name=".uno:MergeCells" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="de">Zellen verbinden</value>
+ <value xml:lang="en-US">Merge Cells</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:SplitCell" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="de">Zelle teilen</value>
+ <value xml:lang="en-US">Split Cells</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:OptimizeTable" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="de">Optimieren</value>
+ <value xml:lang="en-US">Optimize</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DistributeColumns" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Distribute Columns Evenly</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DistributeRows" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Distribute Rows Equally </value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:CellVertBottom" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="de">Unten</value>
+ <value xml:lang="en-US">Bottom</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:CellVertCenter" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="de">Mittig (vertikal)</value>
+ <value xml:lang="en-US">Center ( vertical )</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:CellVertTop" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="de">Oben</value>
+ <value xml:lang="en-US">Top</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertRows" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="de">Zeile einfügen</value>
+ <value xml:lang="en-US">Insert Row</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
<node oor:name=".uno:InsertRowDialog" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Rows...</value>
</prop>
</node>
<node oor:name=".uno:InsertColumns" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">Spalte einfügen</value>
- <value xml:lang="en-US">Insert Column</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="de">Spalte einfügen</value>
+ <value xml:lang="en-US">Insert Column</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
<node oor:name=".uno:InsertColumnDialog" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Columns...</value>
</prop>
</node>
<node oor:name=".uno:DeleteRows" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">Zeile löschen</value>
- <value xml:lang="en-US">Delete Row</value>
- </prop>
- <prop oor:name="ContextLabel" oor:type="xs:string">
- <value xml:lang="de">Zeilen</value>
- <value xml:lang="en-US">~Rows</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:DeleteColumns" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">Spalte löschen</value>
- <value xml:lang="en-US">Delete Column</value>
- </prop>
- <prop oor:name="ContextLabel" oor:type="xs:string">
- <value xml:lang="de">Spalten</value>
- <value xml:lang="en-US">~Columns</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:SelectTable" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">Tabelle selektieren</value>
- <value xml:lang="en-US">Select Table</value>
- </prop>
- <prop oor:name="ContextLabel" oor:type="xs:string">
- <value xml:lang="de">Tabelle</value>
- <value xml:lang="en-US">~Table</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:EntireColumn" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">Spalte selektieren</value>
- <value xml:lang="en-US">Select Column</value>
- </prop>
- <prop oor:name="ContextLabel" oor:type="xs:string">
- <value xml:lang="de">Spalten</value>
- <value xml:lang="en-US">~Columns</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:EntireRow" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">Zeile selektieren</value>
- <value xml:lang="en-US">Select Rows</value>
- </prop>
- <prop oor:name="ContextLabel" oor:type="xs:string">
- <value xml:lang="de">Zeilen</value>
- <value xml:lang="en-US">~Rows</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:TableDialog" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">Tabelleneigenschaften...</value>
- <value xml:lang="en-US">Ta~ble Properties...</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:AutoSum" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">Summe</value>
- <value xml:lang="en-US">Sum</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:TableSort" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">Sorti~eren...</value>
- <value xml:lang="en-US">So~rt...</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- <node oor:name=".uno:InsertTable" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">~Tabelle...</value>
- <value xml:lang="en-US">~Table...</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="de">Zeile löschen</value>
+ <value xml:lang="en-US">Delete Row</value>
+ </prop>
+ <prop oor:name="ContextLabel" oor:type="xs:string">
+ <value xml:lang="de">Zeilen</value>
+ <value xml:lang="en-US">~Rows</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DeleteColumns" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="de">Spalte löschen</value>
+ <value xml:lang="en-US">Delete Column</value>
+ </prop>
+ <prop oor:name="ContextLabel" oor:type="xs:string">
+ <value xml:lang="de">Spalten</value>
+ <value xml:lang="en-US">~Columns</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:SelectTable" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="de">Tabelle selektieren</value>
+ <value xml:lang="en-US">Select Table</value>
+ </prop>
+ <prop oor:name="ContextLabel" oor:type="xs:string">
+ <value xml:lang="de">Tabelle</value>
+ <value xml:lang="en-US">~Table</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:EntireColumn" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="de">Spalte selektieren</value>
+ <value xml:lang="en-US">Select Column</value>
+ </prop>
+ <prop oor:name="ContextLabel" oor:type="xs:string">
+ <value xml:lang="de">Spalten</value>
+ <value xml:lang="en-US">~Columns</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:EntireRow" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="de">Zeile selektieren</value>
+ <value xml:lang="en-US">Select Rows</value>
+ </prop>
+ <prop oor:name="ContextLabel" oor:type="xs:string">
+ <value xml:lang="de">Zeilen</value>
+ <value xml:lang="en-US">~Rows</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:TableDialog" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="de">Tabelleneigenschaften...</value>
+ <value xml:lang="en-US">Ta~ble Properties...</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:AutoSum" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="de">Summe</value>
+ <value xml:lang="en-US">Sum</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:TableSort" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="de">Sorti~eren...</value>
+ <value xml:lang="en-US">So~rt...</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertTable" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="de">~Tabelle...</value>
+ <value xml:lang="en-US">~Table...</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
<node oor:name=".uno:Grow" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Increase Font</value>
@@ -2115,5 +2121,5 @@
</prop>
</node>
</node>
- </node>
+ </node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu
index 5373bf31b1fc..c0feaba64dc6 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu
@@ -106,6 +106,26 @@
<value>true</value>
</prop>
</node>
+ <node oor:name="private:resource/toolbar/findbar" oor:op="replace">
+ <prop oor:name="DockPos" oor:type="xs:string">
+ <value>1,0</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Find</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
<node oor:name="private:resource/toolbar/drawingobjectbar" oor:op="replace">
<prop oor:name="DockPos" oor:type="xs:string">
<value>0,1</value>
@@ -705,7 +725,21 @@
<prop oor:name="ContextSensitive" oor:type="xs:boolean">
<value>true</value>
</prop>
- </node>
- </node>
+ </node>
+ <node oor:name="private:resource/toolbar/optimizetablebar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Optimize</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
</node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Factories.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Factories.xcu
index 83554a37d09e..479c193280bb 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Factories.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Factories.xcu
@@ -45,44 +45,58 @@
</node>
<node oor:name="generic_toolbar_factory" oor:op="replace">
<prop oor:name="Type">
- <value>toolbar</value>
+ <value>toolbar</value>
</prop>
<prop oor:name="Name">
- <value/>
+ <value/>
</prop>
<prop oor:name="Module">
- <value/>
+ <value/>
</prop>
<prop oor:name="FactoryImplementation">
- <value>com.sun.star.comp.framework.ToolBarFactory</value>
+ <value>com.sun.star.comp.framework.ToolBarFactory</value>
</prop>
</node>
<node oor:name="addons_toolbar_factory" oor:op="replace">
<prop oor:name="Type">
- <value>toolbar</value>
+ <value>toolbar</value>
</prop>
<prop oor:name="Name">
- <value>addon_</value>
+ <value>addon_</value>
</prop>
<prop oor:name="Module">
- <value/>
+ <value/>
</prop>
<prop oor:name="FactoryImplementation">
- <value>com.sun.star.comp.framework.AddonsToolBarFactory</value>
+ <value>com.sun.star.comp.framework.AddonsToolBarFactory</value>
</prop>
</node>
<node oor:name="statusbar_factory" oor:op="replace">
<prop oor:name="Type">
- <value>statusbar</value>
+ <value>statusbar</value>
+ </prop>
+ <prop oor:name="Name">
+ <value/>
+ </prop>
+ <prop oor:name="Module">
+ <value/>
+ </prop>
+ <prop oor:name="FactoryImplementation">
+ <value>com.sun.star.comp.framework.StatusBarFactory</value>
+ </prop>
+ </node>
+ <node oor:name="org.openoffice.Office.Impress.ImpressToolPanelFactory" oor:op="replace">
+ <prop oor:name="Type">
+ <value>toolpanel</value>
</prop>
<prop oor:name="Name">
- <value/>
+ <value>DrawingFramework</value>
</prop>
<prop oor:name="Module">
- <value/>
+ <value>com.sun.star.presentation.PresentationDocument</value>
</prop>
<prop oor:name="FactoryImplementation">
- <value>com.sun.star.comp.framework.StatusBarFactory</value>
+ <value>com.sun.star.drawing.DefaultToolPanelFactory</value>
</prop>
</node>
</node>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 4f38244540c2..ebed194fcffc 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -45,7 +45,7 @@
<value xml:lang="en-US">Fontwork Gallery</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:FontworkShapeType" oor:op="replace">
@@ -1277,7 +1277,7 @@
<value xml:lang="en-US">Can't Undo</value>
</prop>
</node>
- <node oor:name=".uno:GrabControlFocus" oor:op="replace">
+ <node oor:name=".uno:ToggleControlFocus" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Control Focus</value>
</prop>
@@ -1287,7 +1287,7 @@
<value xml:lang="en-US">Scrollbar</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:Zoom" oor:op="replace">
@@ -1303,7 +1303,7 @@
<value xml:lang="en-US">Spin Button</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:ConvertToScrollBar" oor:op="replace">
@@ -1371,7 +1371,7 @@
<value xml:lang="en-US">Italic</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:Bold" oor:op="replace">
@@ -1379,7 +1379,7 @@
<value xml:lang="en-US">Bold</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:ModuleDialog" oor:op="replace">
@@ -1395,7 +1395,7 @@
<value xml:lang="en-US">Shadow</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:ObjectCatalog" oor:op="replace">
@@ -1411,7 +1411,7 @@
<value xml:lang="en-US">Outline</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:Strikeout" oor:op="replace">
@@ -1419,7 +1419,7 @@
<value xml:lang="en-US">Strikethrough</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:HelpOnHelp" oor:op="replace">
@@ -1432,7 +1432,7 @@
<value xml:lang="en-US">Underline</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:Overline" oor:op="replace">
@@ -1440,7 +1440,7 @@
<value xml:lang="en-US">Overline</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:HelpIndex" oor:op="replace">
@@ -1459,6 +1459,38 @@
<value>1</value>
</prop>
</node>
+ <node oor:name=".uno:FindText" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Find Text</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DownSearch" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Find Next</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:UpSearch" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Find Previous</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name="vnd.sun.star.findbar:FocusToFindbar" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Focus to Findbar</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
<node oor:name=".uno:ExtendedHelp" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">What's ~This?</value>
@@ -1505,7 +1537,7 @@
<value xml:lang="en-US">Align Left</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>3</value>
+ <value>11</value>
</prop>
</node>
<node oor:name=".uno:RightPara" oor:op="replace">
@@ -1513,7 +1545,7 @@
<value xml:lang="en-US">Align Right</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>3</value>
+ <value>11</value>
</prop>
</node>
<node oor:name=".uno:CenterPara" oor:op="replace">
@@ -1521,7 +1553,7 @@
<value xml:lang="en-US">Centered</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>3</value>
+ <value>11</value>
</prop>
</node>
<node oor:name=".uno:SendFax" oor:op="replace">
@@ -1537,7 +1569,7 @@
<value xml:lang="en-US">Justified</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>7</value>
+ <value>15</value>
</prop>
</node>
<node oor:name=".uno:HelpChooseFile" oor:op="replace">
@@ -1550,7 +1582,7 @@
<value xml:lang="en-US">Line Spacing: 1</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>7</value>
+ <value>15</value>
</prop>
</node>
<node oor:name=".uno:SpacePara15" oor:op="replace">
@@ -1558,7 +1590,7 @@
<value xml:lang="en-US">Line Spacing : 1.5</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>7</value>
+ <value>15</value>
</prop>
</node>
<node oor:name=".uno:SpacePara2" oor:op="replace">
@@ -1566,7 +1598,7 @@
<value xml:lang="en-US">Line Spacing : 2</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>7</value>
+ <value>15</value>
</prop>
</node>
<node oor:name=".uno:StatusGetPosition" oor:op="replace">
@@ -1717,7 +1749,7 @@
<value xml:lang="en-US">Invert</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:Line" oor:op="replace">
@@ -2071,7 +2103,7 @@
<value xml:lang="en-US">Bullets On/Off</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>7</value>
+ <value>15</value>
</prop>
</node>
<node oor:name=".uno:FormatArea" oor:op="replace">
@@ -2090,22 +2122,22 @@
<value>1</value>
</prop>
</node>
- <node oor:name=".uno:ChangeCaseToUpper" oor:op="replace">
+ <node oor:name=".uno:LanguageStatus" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Language Status</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ChooseControls" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Uppercase</value>
+ <value xml:lang="en-US">Insert Controls</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
</prop>
</node>
- <node oor:name=".uno:LanguageStatus" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Language Status</value>
- </prop>
- </node>
- <node oor:name=".uno:ChooseControls" oor:op="replace">
+ <node oor:name=".uno:ChangeCaseToSentenceCase" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Insert Controls</value>
+ <value xml:lang="en-US">~Sentence case</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
@@ -2113,7 +2145,31 @@
</node>
<node oor:name=".uno:ChangeCaseToLower" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Lowercase</value>
+ <value xml:lang="en-US">~lowercase</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ChangeCaseToUpper" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">~UPPERCASE</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ChangeCaseToTitleCase" oor:op="replace">
+ <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>
@@ -2150,7 +2206,7 @@
<value xml:lang="en-US">Numbering On/Off</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>7</value>
+ <value>15</value>
</prop>
</node>
<node oor:name=".uno:BezierConvert" oor:op="replace">
@@ -2195,7 +2251,7 @@
<value xml:lang="en-US">Check Box</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:ChangeCaseToKatakana" oor:op="replace">
@@ -2309,7 +2365,7 @@
<value xml:lang="en-US">Edit File</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:InsertImageControl" oor:op="replace">
@@ -2423,7 +2479,7 @@
<value xml:lang="en-US">Time Field</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:StyleNewByExample" oor:op="replace">
@@ -2590,7 +2646,7 @@
<value xml:lang="en-US">Left-To-Right</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>3</value>
+ <value>11</value>
</prop>
</node>
<node oor:name=".uno:Group" oor:op="replace">
@@ -2606,7 +2662,7 @@
<value xml:lang="en-US">Right-To-Left</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>3</value>
+ <value>11</value>
</prop>
</node>
<node oor:name=".uno:Ungroup" oor:op="replace">
@@ -2726,7 +2782,7 @@
<value xml:lang="en-US">Combo Box</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:Spinbutton" oor:op="replace">
@@ -2891,7 +2947,7 @@
<value xml:lang="en-US">Guides When Moving</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:CloseWin" oor:op="replace">
@@ -2907,7 +2963,7 @@
<value xml:lang="en-US">Snap to Grid</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:InsertTextFrame" oor:op="replace">
@@ -2989,7 +3045,7 @@
<value xml:lang="en-US">New FrameSet</value>
</prop>
</node>
- <node oor:name=".uno:Thesaurus" oor:op="replace">
+ <node oor:name=".uno:ThesaurusDialog" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Thesaurus...</value>
</prop>
@@ -3144,7 +3200,7 @@
<value xml:lang="en-US">HT~ML Source</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:InsertSound" oor:op="replace">
@@ -3168,7 +3224,7 @@
<value xml:lang="en-US">~Hyperlink</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:Merge" oor:op="replace">
@@ -3186,7 +3242,7 @@
<value xml:lang="en-US">Superscript</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:Intersect" oor:op="replace">
@@ -3199,7 +3255,7 @@
<value xml:lang="en-US">Subscript</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:FontDialog" oor:op="replace">
@@ -3228,7 +3284,7 @@
<value xml:lang="en-US">Shadow</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:LineEndStyle" oor:op="replace">
@@ -3260,7 +3316,7 @@
<value xml:lang="en-US">Format Paintbrush</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:Repeat" oor:op="replace">
@@ -3328,7 +3384,7 @@
<value xml:lang="en-US">~Edit Contour...</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:SelectAll" oor:op="replace">
@@ -3417,10 +3473,15 @@
<value xml:lang="en-US">Na~vigator</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
- <node oor:name=".uno:RestoreEditingView" oor:op="replace">
+ <node oor:name=".uno:TaskPane" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Task Pane</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:RestoreEditingView" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Restore Editing View</value>
</prop>
@@ -3434,13 +3495,16 @@
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Fit to Frame</value>
</prop>
- </node>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>8</value>
+ </prop>
+ </node>
<node oor:name=".uno:ImageMapDialog" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">ImageMap</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:GoDownSel" oor:op="replace">
@@ -3684,14 +3748,17 @@
<value xml:lang="en-US">~Display Grid</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:Flash" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Flash</value>
</prop>
- </node>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>8</value>
+ </prop>
+ </node>
<node oor:name=".uno:ToolsMacroEdit" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Edit Macros</value>
@@ -3980,7 +4047,7 @@
<value xml:lang="en-US">~AutoSpellcheck</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:HideSpellMark" oor:op="replace">
@@ -3995,9 +4062,12 @@
</node>
<node oor:name=".uno:RubyDialog" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">As~ian phonetic guide...</value>
+ <value xml:lang="en-US">As~ian phonetic guide...</value>
</prop>
- </node>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>8</value>
+ </prop>
+ </node>
<node oor:name=".uno:InsertSymbol" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">S~pecial Character...</value>
@@ -4011,7 +4081,7 @@
<value xml:lang="en-US">~Data Sources</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:MenuBarVisible" oor:op="replace">
@@ -4094,7 +4164,10 @@
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Status ~Bar</value>
</prop>
- </node>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>8</value>
+ </prop>
+ </node>
<node oor:name=".uno:MacroBarVisible" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Macro Toolbar On/Off</value>
@@ -4220,7 +4293,7 @@
<value xml:lang="en-US">~Gallery</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:SearchDialog" oor:op="replace">
@@ -4228,7 +4301,7 @@
<value xml:lang="en-US">~Find &amp; Replace...</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:HelperDialog" oor:op="replace">
@@ -4260,7 +4333,7 @@
<value xml:lang="en-US">More Controls</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:FormDesignTools" oor:op="replace">
@@ -4268,7 +4341,7 @@
<value xml:lang="en-US">Form Design</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:Pushbutton" oor:op="replace">
@@ -4276,7 +4349,7 @@
<value xml:lang="en-US">Push Button</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:RadioButton" oor:op="replace">
@@ -4284,7 +4357,7 @@
<value xml:lang="en-US">Option Button</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:CheckBox" oor:op="replace">
@@ -4300,7 +4373,7 @@
<value xml:lang="en-US">Label Field</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:GroupBox" oor:op="replace">
@@ -4308,7 +4381,7 @@
<value xml:lang="en-US">Group Box</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:Edit" oor:op="replace">
@@ -4316,7 +4389,7 @@
<value xml:lang="en-US">Text Box</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:ListBox" oor:op="replace">
@@ -4324,7 +4397,7 @@
<value xml:lang="en-US">List Box</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:ComboBox" oor:op="replace">
@@ -4340,7 +4413,7 @@
<value xml:lang="en-US">Table Control</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:Imagebutton" oor:op="replace">
@@ -4348,7 +4421,7 @@
<value xml:lang="en-US">Image Button</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:FileControl" oor:op="replace">
@@ -4356,7 +4429,7 @@
<value xml:lang="en-US">File Selection</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:ControlProperties" oor:op="replace">
@@ -4364,7 +4437,7 @@
<value xml:lang="en-US">Con~trol...</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:FormProperties" oor:op="replace">
@@ -4372,7 +4445,7 @@
<value xml:lang="en-US">For~m...</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:TabDialog" oor:op="replace">
@@ -4475,7 +4548,7 @@
<value xml:lang="en-US">Design Mode On/Off</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:SwitchXFormsDesignMode" oor:op="replace">
@@ -4508,7 +4581,7 @@
<value xml:lang="pt">Modo Esboço</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:RecUndo" oor:op="replace">
@@ -4529,7 +4602,7 @@
<value xml:lang="en-US">Form Navigator...</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:ShowDataNavigator" oor:op="replace">
@@ -4537,7 +4610,7 @@
<value xml:lang="en-US">Data Navigator...</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:Window3D" oor:op="replace">
@@ -4604,7 +4677,7 @@
<value xml:lang="en-US">Date Field</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:TimeField" oor:op="replace">
@@ -4612,7 +4685,7 @@
<value xml:lang="en-US">Time Field</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:NumericField" oor:op="replace">
@@ -4620,7 +4693,7 @@
<value xml:lang="en-US">Numerical Field</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:CurrencyField" oor:op="replace">
@@ -4628,7 +4701,7 @@
<value xml:lang="en-US">Currency Field</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:PrintPreview" oor:op="replace">
@@ -4636,7 +4709,7 @@
<value xml:lang="en-US">Pa~ge Preview</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:PatternField" oor:op="replace">
@@ -4644,7 +4717,7 @@
<value xml:lang="en-US">Pattern Field</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:OpenReadOnly" oor:op="replace">
@@ -4652,7 +4725,7 @@
<value xml:lang="en-US">Open in Design Mode</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:ImageControl" oor:op="replace">
@@ -4660,7 +4733,7 @@
<value xml:lang="en-US">Image Control</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:RemoveFilterSort" oor:op="replace">
@@ -4732,7 +4805,7 @@
<value xml:lang="en-US">Run SQL command directly</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:SbaExecuteSql" oor:op="replace">
@@ -4756,7 +4829,7 @@
<value xml:lang="en-US">Apply Filter</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:Refresh" oor:op="replace">
@@ -4788,7 +4861,7 @@
<value xml:lang="en-US">Wizards On/Off</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:FormattedField" oor:op="replace">
@@ -4796,7 +4869,7 @@
<value xml:lang="en-US">Formatted Field</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:FormFilter" oor:op="replace">
@@ -4934,7 +5007,7 @@
<value xml:lang="en-US">Automatic Control Focus</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:DSBrowserExplorer" oor:op="replace">
@@ -4942,7 +5015,7 @@
<value xml:lang="en-US">Explorer On/Off</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:ExtrusionToggle" oor:op="replace">
@@ -5292,7 +5365,7 @@
<value xml:lang="en-US">Media Pla~yer</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:InsertAVMedia" oor:op="replace">
@@ -5316,7 +5389,7 @@
<value xml:lang="en-US">~Color</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:InsertHardHyphen" oor:op="replace">
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu
index 079855def699..e582c0b9dc27 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version='1.0' encoding='utf-8'?>
<!--***********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,734 +27,734 @@
************************************************************************ -->
<!DOCTYPE oor:component-data SYSTEM "../../../../../component-update.dtd">
<oor:component-data oor:name="ImpressWindowState" oor:package="org.openoffice.Office.UI" xmlns:install="http://openoffice.org/2004/installation" 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="UIElements">
- <node oor:name="States">
- <node oor:name="private:resource/toolbar/extrusionobjectbar" oor:op="replace">
- <prop oor:name="DockingArea" oor:type="xs:int">
- <value>0</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">3D-Settings</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/drawingobjectbar" oor:op="replace">
- <prop oor:name="DockPos" oor:type="xs:string">
- <value>0,1</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="DockingArea" oor:type="xs:int">
- <value>0</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Line and Filling</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/3dobjectsbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">3D-Objects</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/alignmentbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Align</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/arrowsbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Arrows</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/choosemodebar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Mode</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/commontaskbar" oor:op="replace">
- <prop oor:name="DockPos" oor:type="xs:string">
- <value>1,0</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="DockingArea" oor:type="xs:int">
- <value>0</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Presentation</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/connectorsbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Connectors</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/fullscreenbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="Style" oor:type="xs:int">
- <value>2</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Full Screen</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="NoClose" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/ellipsesbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Circles and Ovals</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
+ <node oor:name="UIElements">
+ <node oor:name="States">
+ <node oor:name="private:resource/toolbar/extrusionobjectbar" oor:op="replace">
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">3D-Settings</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/drawingobjectbar" oor:op="replace">
+ <prop oor:name="DockPos" oor:type="xs:string">
+ <value>0,1</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Line and Filling</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/3dobjectsbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">3D-Objects</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/alignmentbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Align</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/arrowsbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Arrows</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/choosemodebar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Mode</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/commontaskbar" oor:op="replace">
+ <prop oor:name="DockPos" oor:type="xs:string">
+ <value>1,0</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Presentation</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/connectorsbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Connectors</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/fullscreenbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Style" oor:type="xs:int">
+ <value>2</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Full Screen</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="NoClose" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/ellipsesbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Circles and Ovals</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
<node oor:name="private:resource/toolbar/formtextobjectbar" oor:op="replace">
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Text Box Formatting</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/formsfilterbar" oor:op="replace">
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Form Filter</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="NoClose" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/formsnavigationbar" oor:op="replace">
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Form Navigation</value>
- </prop>
- <prop oor:name="DockPos" oor:type="xs:string">
- <value>0,1</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="DockingArea" oor:type="xs:int">
- <value>1</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/formcontrols" oor:op="replace">
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Form Controls</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/moreformcontrols" oor:op="replace">
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">More Controls</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/formdesign" oor:op="replace">
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Form Design</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/fontworkobjectbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Fontwork</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/fontworkshapetype" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Fontwork Shape</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/graphicobjectbar" oor:op="replace">
- <prop oor:name="DockPos" oor:type="xs:string">
- <value>0,1</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="DockingArea" oor:type="xs:int">
- <value>0</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Picture</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/graffilterbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Graphic Filter</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/outlinetoolbar" oor:op="replace">
- <prop oor:name="DockPos" oor:type="xs:string">
- <value>1,0</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="DockingArea" oor:type="xs:int">
- <value>0</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Outline</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/insertbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Insert</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/linesbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Lines</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/basicshapes" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Basic Shapes</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/symbolshapes" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Symbol Shapes</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/arrowshapes" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Block Arrows</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/flowchartshapes" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Flowchart</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/calloutshapes" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Callouts</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/starshapes" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Stars and Banners</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/optionsbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Options</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/rectanglesbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Rectangles</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/positionbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Position</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/slideviewtoolbar" oor:op="replace">
- <prop oor:name="DockPos" oor:type="xs:string">
- <value>0,1</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="DockingArea" oor:type="xs:int">
- <value>0</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Slide Sorter</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/slideviewobjectbar" oor:op="replace">
- <prop oor:name="DockPos" oor:type="xs:string">
- <value>0,1</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="DockingArea" oor:type="xs:int">
- <value>0</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Slide View</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/standardbar" oor:op="replace">
- <prop oor:name="DockPos" oor:type="xs:string">
- <value>0,0</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="DockingArea" oor:type="xs:int">
- <value>0</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Standard</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/textbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Text</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/textobjectbar" oor:op="replace">
- <prop oor:name="DockPos" oor:type="xs:string">
- <value>0,1</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Text Formatting</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/toolbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="DockingArea" oor:type="xs:int">
- <value>1</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Drawing</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/tableobjectbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Table</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/zoombar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Zoom</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/gluepointsobjectbar" oor:op="replace">
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Gluepoints</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/bezierobjectbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Edit Points</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/viewerbar" oor:op="replace">
- <prop oor:name="DockingArea" oor:type="xs:int">
- <value>0</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Standard (Viewing Mode)</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="NoClose" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/mediaobjectbar" oor:op="replace">
- <prop oor:name="DockPos" oor:type="xs:string">
- <value>0,1</value>
- </prop>
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="DockingArea" oor:type="xs:int">
- <value>1</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Media Playback</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="private:resource/toolbar/colorbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Color</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Text Box Formatting</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/formsfilterbar" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Form Filter</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="NoClose" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/formsnavigationbar" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Form Navigation</value>
+ </prop>
+ <prop oor:name="DockPos" oor:type="xs:string">
+ <value>0,1</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/formcontrols" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Form Controls</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/moreformcontrols" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">More Controls</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/formdesign" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Form Design</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/fontworkobjectbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Fontwork</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/fontworkshapetype" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Fontwork Shape</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/graphicobjectbar" oor:op="replace">
+ <prop oor:name="DockPos" oor:type="xs:string">
+ <value>0,1</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Picture</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/graffilterbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Graphic Filter</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/outlinetoolbar" oor:op="replace">
+ <prop oor:name="DockPos" oor:type="xs:string">
+ <value>1,0</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Outline</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/insertbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Insert</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/linesbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Lines</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/basicshapes" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Basic Shapes</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/symbolshapes" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Symbol Shapes</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/arrowshapes" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Block Arrows</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/flowchartshapes" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Flowchart</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/calloutshapes" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Callouts</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/starshapes" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Stars and Banners</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/optionsbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Options</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/rectanglesbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Rectangles</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/positionbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Position</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/slideviewtoolbar" oor:op="replace">
+ <prop oor:name="DockPos" oor:type="xs:string">
+ <value>0,1</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Slide Sorter</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/slideviewobjectbar" oor:op="replace">
+ <prop oor:name="DockPos" oor:type="xs:string">
+ <value>0,1</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Slide View</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/standardbar" oor:op="replace">
+ <prop oor:name="DockPos" oor:type="xs:string">
+ <value>0,0</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Standard</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/textbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Text</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/textobjectbar" oor:op="replace">
+ <prop oor:name="DockPos" oor:type="xs:string">
+ <value>0,1</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Text Formatting</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/toolbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Drawing</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/tableobjectbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Table</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/zoombar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Zoom</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/gluepointsobjectbar" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Gluepoints</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/bezierobjectbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Edit Points</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/viewerbar" oor:op="replace">
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Standard (Viewing Mode)</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="NoClose" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/mediaobjectbar" oor:op="replace">
+ <prop oor:name="DockPos" oor:type="xs:string">
+ <value>0,1</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Media Playback</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/colorbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Color</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
<node oor:name="private:resource/toolbar/commentsbar" oor:op="replace">
<prop oor:name="Docked" oor:type="xs:boolean">
<value>false</value>
@@ -770,37 +770,126 @@
</prop>
</node>
<node oor:name="private:resource/toolbar/masterviewtoolbar" oor:op="replace">
- <prop oor:name="Docked" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="DockingArea" oor:type="xs:int">
- <value>0</value>
- </prop>
- <prop oor:name="Locked" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="Style" oor:type="xs:int">
- <value>0</value>
- </prop>
- <prop oor:name="Visible" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="Pos" oor:type="xs:string">
- <value>500,100</value>
- </prop>
- <prop oor:name="UIName" oor:type="xs:string">
- <value xml:lang="en-US">Master View</value>
- </prop>
- <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- <prop oor:name="NoClose" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="ContextSensitive" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="Locked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="Style" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="Pos" oor:type="xs:string">
+ <value>500,100</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Master View</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="NoClose" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolpanel/DrawingFramework/MasterPages" oor:op="replace">
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Master Pages</value>
+ </prop>
+ <prop oor:name="ImageURL" oor:type="xs:string">
+ <value>private:commandimage/PresentationLayout</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolpanel/DrawingFramework/Layouts" oor:op="replace">
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Layouts</value>
+ </prop>
+ <prop oor:name="ImageURL" oor:type="xs:string">
+ <value>private:commandimage/ModifyPage</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolpanel/DrawingFramework/TableDesign" oor:op="replace">
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Table Design</value>
+ </prop>
+ <prop oor:name="ImageURL" oor:type="xs:string">
+ <value>private:commandimage/InsertTable</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolpanel/DrawingFramework/CustomAnimations" oor:op="replace">
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Custom Animation</value>
+ </prop>
+ <prop oor:name="ImageURL" oor:type="xs:string">
+ <value>private:commandimage/CustomAnimation</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolpanel/DrawingFramework/SlideTransitions" oor:op="replace">
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Slide Transition</value>
+ </prop>
+ <prop oor:name="ImageURL" oor:type="xs:string">
+ <value>private:commandimage/RehearseTimings</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/optimizetablebar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Optimize</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/findbar" oor:op="replace">
+ <prop oor:name="DockPos" oor:type="xs:string">
+ <value>1,0</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Find</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
</node>
+ </node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
index e69558fc4ef5..7570fda066ca 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
@@ -156,7 +156,7 @@
</node>
<node oor:name=".uno:ToolBox" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Formula Elements</value>
+ <value xml:lang="en-US">Elements</value>
</prop>
</node>
<node oor:name=".uno:FormelCursor" oor:op="replace">
@@ -164,7 +164,7 @@
<value xml:lang="en-US">Formula Cursor</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
</node>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index fa0611e07041..4fa236666b6b 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -38,12 +38,18 @@
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Hidden Paragraphs</value>
</prop>
- </node>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>8</value>
+ </prop>
+ </node>
<node oor:name=".uno:ShowAnnotations" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Comments</value>
</prop>
- </node>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>8</value>
+ </prop>
+ </node>
<node oor:name=".uno:InsertScript" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">S~cript...</value>
@@ -115,13 +121,16 @@
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Bibliography Entry...</value>
</prop>
- </node>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>8</value>
+ </prop>
+ </node>
<node oor:name=".uno:ShadowCursor" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Direct Cursor On/Off</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:StartAutoCorrect" oor:op="replace">
@@ -166,12 +175,18 @@
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Record</value>
</prop>
- </node>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>8</value>
+ </prop>
+ </node>
<node oor:name=".uno:ShowTrackedChanges" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Show</value>
</prop>
- </node>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>8</value>
+ </prop>
+ </node>
<node oor:name=".uno:GotoPage" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">To Page</value>
@@ -460,7 +475,7 @@
<value xml:lang="en-US">Insert Fields</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:InsertDateField" oor:op="replace">
@@ -539,9 +554,12 @@
</node>
<node oor:name=".uno:OnlineAutoFormat" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~While Typing</value>
+ <value xml:lang="en-US">~While Typing</value>
</prop>
- </node>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>8</value>
+ </prop>
+ </node>
<node oor:name=".uno:StatePageNumber" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Page Number</value>
@@ -573,7 +591,7 @@
<value xml:lang="en-US">Double Underline </value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:AutoFormatRedlineApply" oor:op="replace">
@@ -596,7 +614,7 @@
<value xml:lang="en-US">Superscript</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:SubScript" oor:op="replace">
@@ -604,7 +622,7 @@
<value xml:lang="en-US">Subscript</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:CharLeftSel" oor:op="replace">
@@ -866,7 +884,7 @@
<value xml:lang="en-US">Wrap Off</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>7</value>
+ <value>15</value>
</prop>
</node>
<node oor:name=".uno:WrapOn" oor:op="replace">
@@ -1723,7 +1741,7 @@
<value xml:lang="en-US">Link Frames</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:AlignCharBottom" oor:op="replace">
@@ -1754,7 +1772,7 @@
<value xml:lang="en-US">Restart Numbering</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>7</value>
+ <value>15</value>
</prop>
</node>
<node oor:name=".uno:JumpToHeader" oor:op="replace">
@@ -1875,7 +1893,10 @@
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Allow Row to Break Across Pages and Columns</value>
</prop>
- </node>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>8</value>
+ </prop>
+ </node>
<node oor:name=".uno:SelectText" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Select Paragraph</value>
@@ -2024,7 +2045,10 @@
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Font Color Fill</value>
</prop>
- </node>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>8</value>
+ </prop>
+ </node>
<node oor:name=".uno:ViewBounds" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Te~xt Boundaries</value>
@@ -2058,7 +2082,10 @@
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Highlight Fill</value>
</prop>
- </node>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>8</value>
+ </prop>
+ </node>
<node oor:name=".uno:VRuler" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Vertical Ruler</value>
@@ -2069,7 +2096,7 @@
<value xml:lang="en-US">~Hyphenation...</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:VScroll" oor:op="replace">
@@ -2097,7 +2124,7 @@
<value xml:lang="en-US">~Nonprinting Characters</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:SortDialog" oor:op="replace">
@@ -2136,7 +2163,7 @@
<value xml:lang="en-US">Book Preview</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>9</value>
</prop>
</node>
<node oor:name=".uno:RemoveDirectCharFormats" oor:op="replace">
@@ -2158,11 +2185,17 @@
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Standard</value>
</prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>8</value>
+ </prop>
</node>
<node oor:name=".uno:SelectionModeBlock" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Block Area</value>
</prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>8</value>
+ </prop>
</node>
</node>
<node oor:name="Popups">
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu
index 870e3c5c528b..8bcc180c264b 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu
@@ -52,6 +52,26 @@
<value>true</value>
</prop>
</node>
+ <node oor:name="private:resource/toolbar/findbar" oor:op="replace">
+ <prop oor:name="DockPos" oor:type="xs:string">
+ <value>1,0</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Find</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
<node oor:name="private:resource/toolbar/textobjectbar" oor:op="replace">
<prop oor:name="DockPos" oor:type="xs:string">
<value>0,1</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterWebWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterWebWindowState.xcu
index 8c0eccc927e9..35844d1bd516 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterWebWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterWebWindowState.xcu
@@ -52,6 +52,26 @@
<value>true</value>
</prop>
</node>
+ <node oor:name="private:resource/toolbar/findbar" oor:op="replace">
+ <prop oor:name="DockPos" oor:type="xs:string">
+ <value>1,0</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Find</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
<node oor:name="private:resource/toolbar/textobjectbar" oor:op="replace">
<prop oor:name="DockPos" oor:type="xs:string">
<value>0,1</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
index 60417cae30fa..d3790df3ef92 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
@@ -52,6 +52,26 @@
<value>true</value>
</prop>
</node>
+ <node oor:name="private:resource/toolbar/findbar" oor:op="replace">
+ <prop oor:name="DockPos" oor:type="xs:string">
+ <value>1,0</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Find</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
<node oor:name="private:resource/toolbar/textobjectbar" oor:op="replace">
<prop oor:name="DockPos" oor:type="xs:string">
<value>0,1</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/XFormsWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/XFormsWindowState.xcu
index f78926234b35..76cdc52f5e3a 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/XFormsWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/XFormsWindowState.xcu
@@ -53,6 +53,26 @@
<value>true</value>
</prop>
</node>
+ <node oor:name="private:resource/toolbar/findbar" oor:op="replace">
+ <prop oor:name="DockPos" oor:type="xs:string">
+ <value>1,0</value>
+ </prop>
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>0</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Find</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
<node oor:name="private:resource/toolbar/textobjectbar" oor:op="replace">
<prop oor:name="DockPos" oor:type="xs:string">
<value>0,1</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/Writer.xcu b/officecfg/registry/data/org/openoffice/Office/Writer.xcu
index 56e6f745a0da..b318614ef789 100644
--- a/officecfg/registry/data/org/openoffice/Office/Writer.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Writer.xcu
@@ -40,7 +40,7 @@
<prop oor:name="IsHideEmptyParagraphs" >
<value>true</value>
</prop>
- <prop oor:name="EMailSupported" install:module="javamail">
+ <prop oor:name="EMailSupported">
<value>true</value>
</prop>
</node>
diff --git a/officecfg/registry/data/org/openoffice/Office/makefile.mk b/officecfg/registry/data/org/openoffice/Office/makefile.mk
index 5cd876f75b19..e65b03371da3 100644
--- a/officecfg/registry/data/org/openoffice/Office/makefile.mk
+++ b/officecfg/registry/data/org/openoffice/Office/makefile.mk
@@ -88,7 +88,6 @@ MODULEFILES= \
Paths-unxwnt.xcu \
Paths-unixdesktop.xcu \
Writer-cjk.xcu \
- Writer-javamail.xcu \
Impress-ogltrans.xcu \
Embedding-calc.xcu \
Embedding-chart.xcu \
diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu
index 6d7259b00ac2..e8b483b8622d 100755
--- a/officecfg/registry/data/org/openoffice/Setup.xcu
+++ b/officecfg/registry/data/org/openoffice/Setup.xcu
@@ -37,6 +37,10 @@
<prop oor:name="ooSetupVersionAboutBox" install:module="brand">
<value>${ABOUTBOXPRODUCTVERSION}</value>
</prop>
+ <prop oor:name="ooVendor" install:module="brand">
+ <value>${OOOVENDOR}</value>
+ </prop>
+
<prop oor:name="ooSetupExtension" install:module="brand">
<value >${PRODUCTEXTENSION}</value>
</prop>
@@ -86,6 +90,9 @@
<prop oor:name="ooSetupFactoryTemplateFile">
<value ></value>
</prop>
+ <prop oor:name="ooSetupFactorySystemDefaultTemplateChanged">
+ <value >false</value>
+ </prop>
<prop oor:name="ooSetupFactoryShortName">
<value >scalc</value>
</prop>
@@ -127,6 +134,9 @@
<prop oor:name="ooSetupFactoryTemplateFile">
<value ></value>
</prop>
+ <prop oor:name="ooSetupFactorySystemDefaultTemplateChanged">
+ <value >false</value>
+ </prop>
<prop oor:name="ooSetupFactoryShortName">
<value >sdraw</value>
</prop>
@@ -168,6 +178,9 @@
<prop oor:name="ooSetupFactoryTemplateFile">
<value ></value>
</prop>
+ <prop oor:name="ooSetupFactorySystemDefaultTemplateChanged">
+ <value >false</value>
+ </prop>
<prop oor:name="ooSetupFactoryShortName">
<value >simpress</value>
</prop>
@@ -207,6 +220,9 @@
<prop oor:name="ooSetupFactoryTemplateFile">
<value ></value>
</prop>
+ <prop oor:name="ooSetupFactorySystemDefaultTemplateChanged">
+ <value >false</value>
+ </prop>
<prop oor:name="ooSetupFactoryShortName">
<value >smath</value>
</prop>
@@ -246,6 +262,9 @@
<prop oor:name="ooSetupFactoryTemplateFile">
<value ></value>
</prop>
+ <prop oor:name="ooSetupFactorySystemDefaultTemplateChanged">
+ <value >false</value>
+ </prop>
<prop oor:name="ooSetupFactoryShortName">
<value >sglobal</value>
</prop>
@@ -287,6 +306,9 @@
<prop oor:name="ooSetupFactoryTemplateFile">
<value ></value>
</prop>
+ <prop oor:name="ooSetupFactorySystemDefaultTemplateChanged">
+ <value >false</value>
+ </prop>
<prop oor:name="ooSetupFactoryShortName">
<value >swriter</value>
</prop>
@@ -434,6 +456,9 @@
<prop oor:name="ooSetupFactoryTemplateFile">
<value ></value>
</prop>
+ <prop oor:name="ooSetupFactorySystemDefaultTemplateChanged">
+ <value >false</value>
+ </prop>
<prop oor:name="ooSetupFactoryShortName">
<value >sweb</value>
</prop>
@@ -594,7 +619,7 @@
<value>GenericCategories</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">Base: Table Data View</value>
+ <value>Base: Table Data View</value>
</prop>
</node>
<node oor:name="com.sun.star.frame.Bibliography" oor:op="replace">
@@ -616,7 +641,7 @@
<value >GenericCategories</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">Bibliography</value>
+ <value>Bibliography</value>
</prop>
</node>
<node oor:name="com.sun.star.script.BasicIDE" oor:op="replace">
@@ -686,6 +711,9 @@
<prop oor:name="ooSetupFactoryTemplateFile">
<value ></value>
</prop>
+ <prop oor:name="ooSetupFactorySystemDefaultTemplateChanged">
+ <value >false</value>
+ </prop>
<prop oor:name="ooSetupFactoryShortName">
<value >schart</value>
</prop>
@@ -725,6 +753,9 @@
<prop oor:name="ooSetupFactoryTemplateFile">
<value ></value>
</prop>
+ <prop oor:name="ooSetupFactorySystemDefaultTemplateChanged">
+ <value >false</value>
+ </prop>
<prop oor:name="ooSetupFactoryShortName">
<value >dbapp</value>
</prop>
@@ -767,14 +798,14 @@
<prop oor:name="ExcludedFiles">
</prop>
<prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.DataAccess</value>
+ <value>/org.openoffice.Office.DataAccess</value>
</prop>
<prop oor:name="ExcludedNodes">
<value>
- org.openoffice.Office.DataAccess/Bibliography
- org.openoffice.Office.DataAccess/ConnectionPool
- org.openoffice.Office.DataAccess/DataSources
- org.openoffice.Office.DataAccess/DriverManager
+ <it>/org.openoffice.Office.DataAccess/Bibliography</it>
+ <it>/org.openoffice.Office.DataAccess/ConnectionPool</it>
+ <it>/org.openoffice.Office.DataAccess/DataSources</it>
+ <it>/org.openoffice.Office.DataAccess/DriverManager</it>
</value>
</prop>
</node>
@@ -785,9 +816,7 @@
</node>
<node oor:name="Inet" oor:op="replace">
<prop oor:name="IncludedNodes">
- <value>
- org.openoffice.Inet
- </value>
+ <value>/org.openoffice.Inet</value>
</prop>
</node>
<node oor:name="Basic" oor:op="replace">
@@ -797,94 +826,94 @@
</node>
<node oor:name="UserProfile" oor:op="replace">
<prop oor:name="IncludedNodes">
- <value>org.openoffice.UserProfile</value>
+ <value>/org.openoffice.UserProfile</value>
</prop>
</node>
<node oor:name="Common" oor:op="replace">
<prop oor:name="IncludedFiles">
<value>
- .*/autotext/.*
- .*/autocorr/.*
- .*/config/.*\.so[bcdegh]
- .*/config/soffice.cfg/modules/.*/toolbar/custom.*\.xml
- .*/config/soffice.cfg/modules/.*/images/.*
- .*/gallery/.*
- .*/template/.*
+ <it>.*/autotext/.*</it>
+ <it>.*/autocorr/.*</it>
+ <it>.*/config/.*\.so[bcdegh]</it>
+ <it>.*/config/soffice.cfg/modules/.*/toolbar/custom.*\.xml</it>
+ <it>.*/config/soffice.cfg/modules/.*/images/.*</it>
+ <it>.*/gallery/.*</it>
+ <it>.*/template/.*</it>
</value>
</prop>
<prop oor:name="IncludedNodes">
<value>
- org.openoffice.Office.Compatibility
- org.openoffice.Office.Custom
- org.openoffice.Office.Embedding
- org.openoffice.Office.Events
- org.openoffice.Office.ExtendedColorScheme
- org.openoffice.Office.Common/Accessibility
- org.openoffice.Office.Common/Accessibility/AutoDetectSystemHC
- org.openoffice.Office.Common/AsianLayout
- org.openoffice.Office.Common/AutoCorrect
- org.openoffice.Office.Common/Cache
- org.openoffice.Office.Common/DateFormat
- org.openoffice.Office.Common/ExternalMailer/Program
- org.openoffice.Office.Common/Filter
- org.openoffice.Office.Common/Font
- org.openoffice.Office.Common/Forms
- org.openoffice.Office.Common/Gallery
- org.openoffice.Office.Common/Help
- org.openoffice.Office.Common/History
- org.openoffice.Office.Common/I18N
- org.openoffice.Office.Common/InternalMSExport
- org.openoffice.Office.Common/Load
- org.openoffice.Office.Common/Misc/FormControlPilotsEnabled
- org.openoffice.Office.Common/Misc/PluginsEnabled
- org.openoffice.Office.Common/Misc/SymbolSet
- org.openoffice.Office.Common/Misc/UseSystemFileDialog
- org.openoffice.Office.Common/Misc/UseSystemPrintDialog
- org.openoffice.Office.Common/Misc/SymbolStyle
- org.openoffice.Office.Common/Passwords
- org.openoffice.Office.Common/Print/PrintingModifiesDocument
- org.openoffice.Office.Common/Print/Warning
- org.openoffice.Office.Common/Vectorize
- org.openoffice.Office.Common/Save
- org.openoffice.Office.Common/SearchOptions
- org.openoffice.Office.Common/Undo
- org.openoffice.Office.Common/View/Dialog/Dialog/MiddleMouseButton
- org.openoffice.Office.Common/View/Dialog/MousePositioning
- org.openoffice.Office.Common/View/Localization
- org.openoffice.Office.Common/View/Menu
- org.openoffice.Office.Common/_3D_Engine
+ <it>/org.openoffice.Office.Compatibility</it>
+ <it>/org.openoffice.Office.Custom</it>
+ <it>/org.openoffice.Office.Embedding</it>
+ <it>/org.openoffice.Office.Events</it>
+ <it>/org.openoffice.Office.ExtendedColorScheme</it>
+ <it>/org.openoffice.Office.Common/Accessibility</it>
+ <it>/org.openoffice.Office.Common/Accessibility/AutoDetectSystemHC</it>
+ <it>/org.openoffice.Office.Common/AsianLayout</it>
+ <it>/org.openoffice.Office.Common/AutoCorrect</it>
+ <it>/org.openoffice.Office.Common/Cache</it>
+ <it>/org.openoffice.Office.Common/DateFormat</it>
+ <it>/org.openoffice.Office.Common/ExternalMailer/Program</it>
+ <it>/org.openoffice.Office.Common/Filter</it>
+ <it>/org.openoffice.Office.Common/Font</it>
+ <it>/org.openoffice.Office.Common/Forms</it>
+ <it>/org.openoffice.Office.Common/Gallery</it>
+ <it>/org.openoffice.Office.Common/Help</it>
+ <it>/org.openoffice.Office.Common/History</it>
+ <it>/org.openoffice.Office.Common/I18N</it>
+ <it>/org.openoffice.Office.Common/InternalMSExport</it>
+ <it>/org.openoffice.Office.Common/Load</it>
+ <it>/org.openoffice.Office.Common/Misc/FormControlPilotsEnabled</it>
+ <it>/org.openoffice.Office.Common/Misc/PluginsEnabled</it>
+ <it>/org.openoffice.Office.Common/Misc/SymbolSet</it>
+ <it>/org.openoffice.Office.Common/Misc/UseSystemFileDialog</it>
+ <it>/org.openoffice.Office.Common/Misc/UseSystemPrintDialog</it>
+ <it>/org.openoffice.Office.Common/Misc/SymbolStyle</it>
+ <it>/org.openoffice.Office.Common/Passwords</it>
+ <it>/org.openoffice.Office.Common/Print/PrintingModifiesDocument</it>
+ <it>/org.openoffice.Office.Common/Print/Warning</it>
+ <it>/org.openoffice.Office.Common/Vectorize</it>
+ <it>/org.openoffice.Office.Common/Save</it>
+ <it>/org.openoffice.Office.Common/SearchOptions</it>
+ <it>/org.openoffice.Office.Common/Undo</it>
+ <it>/org.openoffice.Office.Common/View/Dialog/Dialog/MiddleMouseButton</it>
+ <it>/org.openoffice.Office.Common/View/Dialog/MousePositioning</it>
+ <it>/org.openoffice.Office.Common/View/Localization</it>
+ <it>/org.openoffice.Office.Common/View/Menu</it>
+ <it>/org.openoffice.Office.Common/_3D_Engine</it>
</value>
</prop>
<prop oor:name="ExcludedNodes">
<value>
- org.openoffice.Office.Common/_3D_Engine/OpenGL
- org.openoffice.Office.Common/Help/Registration
+ <it>/org.openoffice.Office.Common/_3D_Engine/OpenGL</it>
+ <it>/org.openoffice.Office.Common/Help/Registration</it>
</value>
</prop>
</node>
<node oor:name="Calc" oor:op="replace">
<prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.Calc</value>
+ <value>/org.openoffice.Office.Calc</value>
</prop>
</node>
<node oor:name="Chart" oor:op="replace">
<prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.Chart</value>
+ <value>/org.openoffice.Office.Chart</value>
</prop>
</node>
<node oor:name="Draw" oor:op="replace">
<prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.Draw</value>
+ <value>/org.openoffice.Office.Draw</value>
</prop>
</node>
<node oor:name="Impress" oor:op="replace">
<prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.Impress</value>
+ <value>/org.openoffice.Office.Impress</value>
</prop>
</node>
<node oor:name="Labels" oor:op="replace">
<prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.Labels</value>
+ <value>/org.openoffice.Office.Labels</value>
</prop>
</node>
<node oor:name="Linguistic" oor:op="replace">
@@ -892,36 +921,36 @@
<value>com.sun.star.migration.Wordbooks</value>
</prop>
<prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.Linguistic</value>
+ <value>/org.openoffice.Office.Linguistic</value>
</prop>
<prop oor:name="ExcludedNodes">
- <value>org.openoffice.Office.Linguistic/ServiceManager</value>
+ <value>/org.openoffice.Office.Linguistic/ServiceManager</value>
</prop>
</node>
<node oor:name="Math" oor:op="replace">
<prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.Math</value>
+ <value>/org.openoffice.Office.Math</value>
</prop>
</node>
<node oor:name="Security" oor:op="replace">
<prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.Security</value>
+ <value>/org.openoffice.Office.Security</value>
</prop>
</node>
<node oor:name="UI" oor:op="replace">
<prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.UI/ColorScheme</value>
+ <value>/org.openoffice.Office.UI/ColorScheme</value>
</prop>
</node>
<node oor:name="Writer" oor:op="replace">
<prop oor:name="IncludedNodes">
<value>
- org.openoffice.Office.Writer
- org.openoffice.Office.WriterWeb
+ <it>/org.openoffice.Office.Writer</it>
+ <it>/org.openoffice.Office.WriterWeb</it>
</value>
</prop>
<prop oor:name="ExcludedNodes">
- <value>org.openoffice.Office.Writer/Wizard</value>
+ <value>/org.openoffice.Office.Writer/Wizard</value>
</prop>
</node>
</node>
diff --git a/officecfg/registry/data/org/openoffice/VCL.xcu b/officecfg/registry/data/org/openoffice/VCL.xcu
index 36fd48ebf753..575c0aba053b 100644
--- a/officecfg/registry/data/org/openoffice/VCL.xcu
+++ b/officecfg/registry/data/org/openoffice/VCL.xcu
@@ -547,22 +547,22 @@
</node>
<node oor:name="zh-cn" oor:op="replace">
<prop oor:name="CJK_DISPLAY" oor:type="xs:string" oor:op="replace">
- <value>方正宋体;MSung Light SC;SimSun;Song;FZSongYi;FZShuSong;NSimSun;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>微软雅黑;方正宋体;MSung Light SC;SimSun;Song;FZSongYi;FZShuSong;NSimSun;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="LATIN_FIXED" oor:type="xs:string" oor:op="replace">
<value>方正宋体;新宋体;NSimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light SC;Cumberland AMT;Cumberland;Courier New;Nimbus Mono L;Courier;Lucida Sans Typewriter;Lucida Typewriter;Monaco;Monospaced</value>
</prop>
<prop oor:name="CJK_HEADING" oor:type="xs:string" oor:op="replace">
- <value>方正黑体;方正宋体;宋体;SimSun;黑体;文鼎PL中楷Uni;AR PL ZenKai Uni;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light SC;Song;FZSongYi;FZShuSong;NSimSun;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>微软雅黑;方正黑体;方正宋体;宋体;SimSun;黑体;文鼎PL中楷Uni;AR PL ZenKai Uni;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light SC;Song;FZSongYi;FZShuSong;NSimSun;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="CJK_PRESENTATION" oor:type="xs:string" oor:op="replace">
- <value>方正宋体;宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light SC;Song;FZSongYi;FZShuSong;NSimSun;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>微软雅黑;方正宋体;宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light SC;Song;FZSongYi;FZShuSong;NSimSun;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="CJK_SPREADSHEET" oor:type="xs:string" oor:op="replace">
- <value>方正宋体;宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light SC;Song;FZSongYi;FZShuSong;NSimSun;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>微软雅黑;方正宋体;宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light SC;Song;FZSongYi;FZShuSong;NSimSun;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="CJK_TEXT" oor:type="xs:string" oor:op="replace">
- <value>方正宋体;宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light SC;Song;FZSongYi;FZShuSong;NSimSun;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>方正宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light SC;Song;FZSongYi;FZShuSong;NSimSun;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="UI_FIXED" oor:type="xs:string" oor:op="replace">
<value>方正宋体;新宋体;NSimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light SC;Cumberland AMT;Cumberland;Courier New;Nimbus Mono L;Courier;Lucida Sans Typewriter;Lucida Typewriter;Monaco;Monospaced</value>
@@ -571,7 +571,7 @@
<value>方正宋体;新宋体;NSimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light SC;Cumberland AMT;Cumberland;Courier New;Nimbus Mono L;Courier;Lucida Sans Typewriter;Lucida Typewriter;Monaco;Monospaced</value>
</prop>
<prop oor:name="UI_SANS" oor:type="xs:string" oor:op="replace">
- <value>方正宋体;宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Andale Sans UI;ZYSong18030;AR PL SungtiL GB;AR PL KaitiM GB;SimSun;Arial Unicode MS;Fangsong;Hei;Song;Kai;Ming;gnu-unifont;Interface User;WarpSans;Geneva;Tahoma;MS Sans Serif;Helv;Dialog;Albany AMT;Albany;Lucida;Arial;Nimbus Sans L;Helvetica;Charcoal;Chicago;Arial;Helmet;Interface System;Sans Serif</value>
+ <value>方正宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Andale Sans UI;ZYSong18030;AR PL SungtiL GB;AR PL KaitiM GB;SimSun;Arial Unicode MS;Fangsong;Hei;Song;Kai;Ming;gnu-unifont;Interface User;WarpSans;Geneva;Tahoma;MS Sans Serif;Helv;Dialog;Albany AMT;Albany;Lucida;Arial;Nimbus Sans L;Helvetica;Charcoal;Chicago;Arial;Helmet;Interface System;Sans Serif</value>
</prop>
</node>
<node oor:name="zh-tw" oor:op="replace">
@@ -579,19 +579,19 @@
<value>方正明體;細明體;MingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;Cumberland AMT;Cumberland;Courier New;Nimbus Mono L;Courier;Lucida Sans Typewriter;Lucida Typewriter;Monaco;Monospaced</value>
</prop>
<prop oor:name="CJK_DISPLAY" oor:type="xs:string" oor:op="replace">
- <value>方正明體;新細明體;PMingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>微软雅黑;方正明體;新細明體;PMingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="CJK_HEADING" oor:type="xs:string" oor:op="replace">
<value>方正黑体;新細明體;PMingLiU;文鼎PL中楷Uni;AR PL ZenKai Uni;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="CJK_PRESENTATION" oor:type="xs:string" oor:op="replace">
- <value>方正明體;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;PMingLiU;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>微软雅黑;方正明體;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;PMingLiU;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="CJK_SPREADSHEET" oor:type="xs:string" oor:op="replace">
- <value>方正明體;新細明體;PMingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>微软雅黑;方正明體;新細明體;PMingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="CJK_TEXT" oor:type="xs:string" oor:op="replace">
- <value>方正明體;新細明體;PMingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>微软雅黑;方正明體;新細明體;PMingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="UI_FIXED" oor:type="xs:string" oor:op="replace">
<value>方正明體;細明體;MingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;Cumberland AMT;Cumberland;Courier New;Nimbus Mono L;Courier;Lucida Sans Typewriter;Lucida Typewriter;Monaco;Monospaced</value>
@@ -600,7 +600,7 @@
<value>方正明體;細明體;MingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;Cumberland AMT;Cumberland;Courier New;Nimbus Mono L;Courier;Lucida Sans Typewriter;Lucida Typewriter;Monaco;Monospaced</value>
</prop>
<prop oor:name="UI_SANS" oor:type="xs:string" oor:op="replace">
- <value>方正明體;新細明體;PMingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Andale Sans UI;AR PL Mingti2L Big5;AR PL KaitiM Big5;Kai;Arial Unicode MS;Ming;gnu-unifont;Interface User;WarpSans;Geneva;Tahoma;MS Sans Serif;Helv;Dialog;Albany AMT;Albany;Lucida;Arial;Nimbus Sans L;Helvetica;Charcoal;Chicago;Arial;Helmet;Interface System;Sans Serif</value>
+ <value>微软雅黑;方正明體;新細明體;PMingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Andale Sans UI;AR PL Mingti2L Big5;AR PL KaitiM Big5;Kai;Arial Unicode MS;Ming;gnu-unifont;Interface User;WarpSans;Geneva;Tahoma;MS Sans Serif;Helv;Dialog;Albany AMT;Albany;Lucida;Arial;Nimbus Sans L;Helvetica;Charcoal;Chicago;Arial;Helmet;Interface System;Sans Serif</value>
</prop>
</node>
<node oor:name="zh-hk" oor:op="replace">
@@ -608,16 +608,16 @@
<value>方正明體;細明體;MingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;Cumberland AMT;Cumberland;Courier New;Nimbus Mono L;Courier;Lucida Sans Typewriter;Lucida Typewriter;Monaco;Monospaced</value>
</prop>
<prop oor:name="CJK_DISPLAY" oor:type="xs:string" oor:op="replace">
- <value>方正明體;新細明體;PMingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>微软雅黑;方正明體;新細明體;PMingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="CJK_HEADING" oor:type="xs:string" oor:op="replace">
- <value>FZHeiTi;方正明體;新細明體;PMingLiU;文鼎PL中楷Uni;AR PL ZenKai Uni;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>微软雅黑;FZHeiTi;方正明體;新細明體;PMingLiU;文鼎PL中楷Uni;AR PL ZenKai Uni;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="CJK_PRESENTATION" oor:type="xs:string" oor:op="replace">
- <value>方正明體;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;PMingLiU;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>微软雅黑;方正明體;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;PMingLiU;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="CJK_SPREADSHEET" oor:type="xs:string" oor:op="replace">
- <value>方正明體;新細明體;PMingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>微软雅黑;方正明體;新細明體;PMingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="CJK_TEXT" oor:type="xs:string" oor:op="replace">
<value>方正明體;新細明體;PMingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;MingLiU;Ming;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
@@ -629,7 +629,7 @@
<value>方正明體;細明體;MingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;Cumberland AMT;Cumberland;Courier New;Nimbus Mono L;Courier;Lucida Sans Typewriter;Lucida Typewriter;Monaco;Monospaced</value>
</prop>
<prop oor:name="UI_SANS" oor:type="xs:string" oor:op="replace">
- <value>方正明體;新細明體;PMingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Andale Sans UI;AR PL Mingti2L Big5;AR PL KaitiM Big5;Kai;Arial Unicode MS;Ming;gnu-unifont;Interface User;WarpSans;Geneva;Tahoma;MS Sans Serif;Helv;Dialog;Albany AMT;Albany;Lucida;Arial;Nimbus Sans L;Helvetica;Charcoal;Chicago;Arial;Helmet;Interface System;Sans Serif</value>
+ <value>微软雅黑;方正明體;新細明體;PMingLiU;文鼎PL細上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Andale Sans UI;AR PL Mingti2L Big5;AR PL KaitiM Big5;Kai;Arial Unicode MS;Ming;gnu-unifont;Interface User;WarpSans;Geneva;Tahoma;MS Sans Serif;Helv;Dialog;Albany AMT;Albany;Lucida;Arial;Nimbus Sans L;Helvetica;Charcoal;Chicago;Arial;Helmet;Interface System;Sans Serif</value>
</prop>
</node>
<node oor:name="zh-sg" oor:op="replace">
@@ -637,19 +637,19 @@
<value>方正宋体;新宋体;NSimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;Cumberland AMT;Cumberland;Courier New;Nimbus Mono L;Courier;Lucida Sans Typewriter;Lucida Typewriter;Monaco;Monospaced</value>
</prop>
<prop oor:name="CJK_DISPLAY" oor:type="xs:string" oor:op="replace">
- <value>方正宋体;宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Song;FZSongYi;FZShuSong;MSung Light TC;MingLiU;Ming;PMingLiU;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>微软雅黑;方正宋体;宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Song;FZSongYi;FZShuSong;MSung Light TC;MingLiU;Ming;PMingLiU;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="CJK_HEADING" oor:type="xs:string" oor:op="replace">
- <value>方正黑体;方正宋体;宋体;SimSun;文鼎PL中楷Uni;AR PL ZenKai Uni;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Song;FZSongYi;FZShuSong;MSung Light TC;MingLiU;Ming;PMingLiU;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>微软雅黑;方正黑体;方正宋体;宋体;SimSun;文鼎PL中楷Uni;AR PL ZenKai Uni;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Song;FZSongYi;FZShuSong;MSung Light TC;MingLiU;Ming;PMingLiU;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="CJK_PRESENTATION" oor:type="xs:string" oor:op="replace">
- <value>方正宋体;宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Song;FZSongYi;FZShuSong;MSung Light TC;MingLiU;Ming;PMingLiU;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>微软雅黑;方正宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Song;FZSongYi;FZShuSong;MSung Light TC;MingLiU;Ming;PMingLiU;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="CJK_SPREADSHEET" oor:type="xs:string" oor:op="replace">
- <value>方正宋体;宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Song;FZSongYi;FZShuSong;MSung Light TC;MingLiU;Ming;PMingLiU;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>微软雅黑;方正宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Song;FZSongYi;FZShuSong;MSung Light TC;MingLiU;Ming;PMingLiU;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="CJK_TEXT" oor:type="xs:string" oor:op="replace">
- <value>方正宋体;宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Song;FZSongYi;FZShuSong;MSung Light TC;MingLiU;Ming;PMingLiU;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
+ <value>微软雅黑;方正宋体;宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Song;FZSongYi;FZShuSong;MSung Light TC;MingLiU;Ming;PMingLiU;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;Tahoma</value>
</prop>
<prop oor:name="UI_FIXED" oor:type="xs:string" oor:op="replace">
<value>方正宋体;新宋体;NSimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;Cumberland AMT;Cumberland;Courier New;Nimbus Mono L;Courier;Lucida Sans Typewriter;Lucida Typewriter;Monaco;Monospaced</value>
@@ -658,7 +658,7 @@
<value>方正宋体;新宋体;NSimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;MSung Light TC;Cumberland AMT;Cumberland;Courier New;Nimbus Mono L;Courier;Lucida Sans Typewriter;Lucida Typewriter;Monaco;Monospaced</value>
</prop>
<prop oor:name="UI_SANS" oor:type="xs:string" oor:op="replace">
- <value>方正宋体;宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Andale Sans UI;ZYSong18030;AR PL SungtiL GB;AR PL KaitiM GB;SimSun;Arial Unicode MS;Fangsong;Hei;Song;Kai;Ming;gnu-unifont;Interface User;WarpSans;Geneva;Tahoma;MS Sans Serif;Helv;Dialog;Albany AMT;Albany;Lucida;Arial;Nimbus Sans L;Helvetica;Charcoal;Chicago;Arial;Helmet;Interface System;Sans Serif</value>
+ <value>方正宋体;SimSun;文鼎PL细上海宋Uni;AR PL ShanHeiSun Uni;文鼎PL新宋;AR PL New Sung;Andale Sans UI;ZYSong18030;AR PL SungtiL GB;AR PL KaitiM GB;SimSun;Arial Unicode MS;Fangsong;Hei;Song;Kai;Ming;gnu-unifont;Interface User;WarpSans;Geneva;Tahoma;MS Sans Serif;Helv;Dialog;Albany AMT;Albany;Lucida;Arial;Nimbus Sans L;Helvetica;Charcoal;Chicago;Arial;Helmet;Interface System;Sans Serif</value>
</prop>
</node>
<node oor:name="ko-kr" oor:op="replace">
@@ -1434,7 +1434,7 @@
</node>
<node oor:name="arialnarrow" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>arialnarrowmt;helveticanarrow;helmetcondensed;dejavusanscondensed;nimbussanslcondensed;nimbussanscondensed</value>
+ <value>arialnarrowmt;liberationsansnarrow;helveticanarrow;helmetcondensed;dejavusanscondensed;nimbussanslcondensed;nimbussanscondensed</value>
</prop>
<prop oor:name="SubstFontsMS">
<value></value>
@@ -1838,6 +1838,9 @@
</prop>
<prop oor:name="FontType"><value>Normal,SansSerif</value></prop>
</node>
+ <node oor:name="candara" oor:op="replace">
+ <prop oor:name="FontType"><value>Normal,SansSerif</value></prop>
+ </node>
<node oor:name="cambria" oor:op="replace">
<prop oor:name="SubstFonts">
@@ -1846,6 +1849,20 @@
<prop oor:name="FontType"><value>Normal,Serif</value></prop>
</node>
+ <node oor:name="consolas" oor:op="replace">
+ <prop oor:name="FontType"><value>Normal,SansSerif,Fixed</value></prop>
+ <prop oor:name="SubstFontsHTML"><value>monospace</value></prop>
+ </node>
+ <node oor:name="constantia" oor:op="replace">
+ <prop oor:name="FontType"><value>Normal,Serif</value></prop>
+ </node>
+ <node oor:name="corbel" oor:op="replace">
+ <prop oor:name="FontType"><value>Normal,SansSerif</value></prop>
+ </node>
+ <node oor:name="cordia" oor:op="replace">
+ <prop oor:name="FontType"><value>Normal,SansSerif</value></prop>
+ </node>
+
<node oor:name="calisto" oor:op="replace">
<prop oor:name="SubstFonts">
<value>thorndaleamt;thorndale;timesnewroman;nimbusromanno9l;times;timesroman;newyork;timmons;serif;lucidaserif;lucidabright;roman;nimbusromanno9;bookman;itcbookman;garamond;garamondmt;palatino</value>
@@ -2522,7 +2539,7 @@
</node>
<node oor:name="dejavusanscondensed" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>arialnarrow</value>
+ <value>arialnarrow;liberationsansnarrow</value>
</prop>
<prop oor:name="FontWeight"><value>Normal</value></prop>
<prop oor:name="FontWidth"><value>Condensed</value></prop>
@@ -3578,7 +3595,7 @@
</node>
<node oor:name="helveticanarrow" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>arialnarrow;helmetcondensed;dejavusanscondensed;nimbussanslcondensed;nimbussanscondensed</value>
+ <value>arialnarrow;liberationsansnarrow;helmetcondensed;dejavusanscondensed;nimbussanslcondensed;nimbussanscondensed</value>
</prop>
<prop oor:name="SubstFontsMS">
<value></value>
@@ -6521,7 +6538,7 @@
</node>
<node oor:name="sanscondensed" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>arialnarrow;helveticanarrow;helmetcondensed;dejavusanscondensed;nimbussanslcondensed;nimbussanscondensed</value>
+ <value>arialnarrow;liberationsansnarrow;helveticanarrow;helmetcondensed;dejavusanscondensed;nimbussanslcondensed;nimbussanscondensed</value>
</prop>
<prop oor:name="SubstFontsMS">
<value></value>
@@ -6567,7 +6584,7 @@
</node>
<node oor:name="sanslcondensed" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>arialnarrow;helveticanarrow;helmetcondensed;nimbussanslcondensed;nimbussanscondensed;dejavusanscondensed</value>
+ <value>arialnarrow;liberationsansnarrow;helveticanarrow;helmetcondensed;nimbussanslcondensed;nimbussanscondensed;dejavusanscondensed</value>
</prop>
<prop oor:name="SubstFontsMS">
<value></value>
@@ -7142,7 +7159,7 @@
</node>
<node oor:name="swissnarrow" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>dejavuserifcondensed;arialnarrow;helveticanarrow;helmetcondensed;nimbussanslcondensed;nimbussanscondensed</value>
+ <value>dejavuserifcondensed;arialnarrow;liberationsansnarrow;helveticanarrow;helmetcondensed;nimbussanslcondensed;nimbussanscondensed</value>
</prop>
<prop oor:name="SubstFontsMS">
<value></value>
diff --git a/officecfg/registry/data/org/openoffice/ucb/Configuration.xcu b/officecfg/registry/data/org/openoffice/ucb/Configuration.xcu
index df824b593a8d..88d2abef62f3 100644
--- a/officecfg/registry/data/org/openoffice/ucb/Configuration.xcu
+++ b/officecfg/registry/data/org/openoffice/ucb/Configuration.xcu
@@ -175,6 +175,17 @@
<value/>
</prop>
</node>
+ <node oor:name="Provider14" oor:op="replace">
+ <prop oor:name="ServiceName">
+ <value>com.sun.star.ucb.ExtensionContentProvider</value>
+ </prop>
+ <prop oor:name="URLTemplate">
+ <value>vnd.sun.star.extension</value>
+ </prop>
+ <prop oor:name="Arguments">
+ <value/>
+ </prop>
+ </node>
<!-- We want the Provider to be the final fallback provider -->
<node oor:name="Provider999" oor:op="replace" install:module="gio">
<prop oor:name="ServiceName">
diff --git a/officecfg/registry/schema/oo-ldap-attr-map.properties b/officecfg/registry/schema/oo-ldap-attr-map.properties
index c67cd5262fd4..684dfbdebfa3 100644
--- a/officecfg/registry/schema/oo-ldap-attr-map.properties
+++ b/officecfg/registry/schema/oo-ldap-attr-map.properties
@@ -1,4 +1,5 @@
# inetOrgPerson.givenName
+# x-no-translate
org.openoffice.UserProfile/Data/givenname = givenname
# person.sn
diff --git a/officecfg/registry/schema/oo-org-map.properties b/officecfg/registry/schema/oo-org-map.properties
index 1f4b4377677c..dc87a4346ce9 100644
--- a/officecfg/registry/schema/oo-org-map.properties
+++ b/officecfg/registry/schema/oo-org-map.properties
@@ -1,5 +1,6 @@
# attribute and objectclass identifying a user
# multi values are supported, separated by comma
+# x-no-translate
User/ObjectClass=inetorgperson
User/NamingAttribute=uid
User/Container=ou=People
diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index b5232c21eb82..913902731f29 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -782,13 +782,13 @@
<desc>MAX</desc>
</info>
</enumeration>
- <enumeration oor:value="5">
+ <enumeration oor:value="6">
<info>
<desc>IF</desc>
</info>
</enumeration>
</constraints>
- <value>224 226 222 223 5</value>
+ <value>224 226 222 223 6</value>
</prop>
<prop oor:name="AutoInput" oor:type="xs:boolean">
<!-- OldPath: Calc/Input -->
@@ -1206,7 +1206,7 @@
<desc>Specifies the number of decimals to be displayed for the Standard number format.</desc>
<label>Decimal places</label>
</info>
- <value>2</value>
+ <value>-1</value>
</prop>
<prop oor:name="RegularExpressions" oor:type="xs:boolean">
<!-- UIHints: Tools - Options Spreadsheet Calculate [Check box] Enable regular expressions in formulas -->
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index a1e203a29366..02e05a932952 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -974,6 +974,19 @@
<value>false</value>
</prop>
</group>
+ <group oor:name="Dictionaries">
+ <info>
+ <author>CD</author>
+ <desc>Contains settings related to dictionaries.</desc>
+ </info>
+ <prop oor:name="RepositoryURL" oor:type="xs:string">
+ <info>
+ <author>CD</author>
+ <desc>Specifies a repository URL where users can download additional dictionaries.</desc>
+ </info>
+ <value/>
+ </prop>
+ </group>
<group oor:name="Drawinglayer">
<info>
<author>AW</author>
@@ -5338,6 +5351,13 @@
</info>
<value>true</value>
</prop>
+ <prop oor:name="EmbedStandardFonts" oor:type="xs:boolean">
+ <info>
+ <author>pl</author>
+ <desc>Specifies whether to embed the 14 standard PDF fonts or not.</desc>
+ </info>
+ <value>false</value>
+ </prop>
<prop oor:name="FormsType" oor:type="xs:int">
<info>
<desc>Specifies the submitted format of a PDF form.</desc>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
index a5a703c0480c..8317e3e0082d 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
@@ -26,375 +26,380 @@
*
************************************************************************ -->
<!DOCTYPE oor:component-schema SYSTEM "../../../../component-schema.dtd">
-<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="Impress" oor:package="org.openoffice.Office" xml:lang="en-US"> <info>
- <author>AF</author>
- <desc >Contains configuration items related to the Impress application.</desc>
- </info>
- <import oor:component="org.openoffice.Office.Common"/>
- <templates>
- <group oor:name="MasterPageDescriptor">
+<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="Impress" oor:package="org.openoffice.Office" xml:lang="en-US">
+ <info>
+ <author>AF</author>
+ <desc >Contains configuration items related to the Impress application.</desc>
+ </info>
+ <import oor:component="org.openoffice.Office.Common"/>
+ <templates>
+ <group oor:name="MasterPageDescriptor">
+ <info>
+ <desc>Describes master pages that belong to the list of recently used master pages.</desc>
+ </info>
+ <prop oor:name="URL" oor:type="xs:string">
+ <info>
+ <desc>The URL of the template document that contains the master page.</desc>
+ </info>
+ </prop>
+ <prop oor:name="Name" oor:type="xs:string">
+ <info>
+ <desc>The internal name of the master page.</desc>
+ </info>
+ </prop>
+ </group>
+ <group oor:name="Resource">
+ <info>
+ <desc>A factory that can create one more resources for the multi pane framework.</desc>
+ </info>
+ <prop oor:name="URL" oor:type="xs:string">
+ <info>
+ <desc>URL of a multi pane framework resource.</desc>
+ </info>
+ </prop>
+ </group>
+ <group oor:name="ResourceFactory">
+ <info>
+ <desc>A factory that can create one more resources for the multi pane framework.</desc>
+ </info>
+ <prop oor:name="ServiceName" oor:type="xs:string">
+ <info>
+ <desc>
+ The service name of the factory. This service is not the factory itself.
+ It is expected to create and register a set of factories when an instance of
+ the service is created.
+ </desc>
+ </info>
+ </prop>
+ <set oor:name="ResourceList" oor:node-type="Resource">
+ <info>
+ <desc>List of URLs of the resources that are created by the factory.</desc>
+ </info>
+ </set>
+ </group>
+ <group oor:name="StartupService">
+ <info>
+ <desc>
+ A service that is instantiated when a framework is initializd for a
+ Draw or Impress document.
+ </desc>
+ </info>
+ <prop oor:name="ServiceName" oor:type="xs:string">
+ <info>
+ <desc>The name of the startup service.</desc>
+ </info>
+ </prop>
+ </group>
+ </templates>
+ <component>
+ <group oor:name="Layout">
+ <info>
+ <desc>Contains general properties of the graphical object representation.</desc>
+ </info>
+ <group oor:name="Display">
+ <info>
+ <desc>Contains general properties of the graphical object representation of screen displays.</desc>
+ </info>
+ <prop oor:name="Ruler" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Layout/Display -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation - Layout - [Section] Display -->
+ <info>
+ <desc>Indicates whether to show the rulers at the left and at the top of the working area.</desc>
+ <label>Rulers visible</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="Helpline" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Layout/Display -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation - Layout - [Section] Display -->
+ <info>
+ <desc>Indicates whether to show help-lines that can be created by dragging them from the rulers.</desc>
+ <label>Helplines visible</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="Guide" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Layout/Display -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation - Layout - [Section] Display -->
+ <info>
+ <desc>Indicates whether to show help-lines when moving an object.</desc>
+ <label>Guides when moving</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="Bezier" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Layout/Display -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation - Layout - [Section] Display -->
+ <info>
+ <desc>Indicates whether to show all control points in the Bezier curve editor.</desc>
+ <label>All control points in Bezier editor</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="Contour" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Layout/Display -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation - Layout - [Section] Display -->
+ <info>
+ <desc>Indicates whether to show the outline of all moved objects when moving more then one object at the same time.</desc>
+ <label>Contour of each individual object</label>
+ </info>
+ <value>true</value>
+ </prop>
+ </group>
+ <group oor:name="Other">
+ <info>
+ <desc>Specifies other layout options that do not fit into any other group.</desc>
+ <label>Other Layout Options</label>
+ </info>
+ <group oor:name="TabStop">
+ <!-- OldPath: Impress/Layout -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation - Layout - [Section] Tab stops -->
+ <!-- Notice: Default-Nonmetric Value: 1270 1/100 mm-->
+ <info>
+ <desc>Specifies the distance between adjacent tab stops with regard to whether the metric or the non-metric system is currently selected.</desc>
+ <label>Tab stops</label>
+ </info>
+ <prop oor:name="Metric" oor:type="xs:int">
<info>
- <desc>Describes master pages that belong to the list of recently used master pages.</desc>
+ <desc>Specifies the distance between adjacent tab stops in 1/100 mm when the metric system is selected.</desc>
+ <label/>
</info>
- <prop oor:name="URL" oor:type="xs:string">
+ <value>1250</value>
+ </prop>
+ <prop oor:name="NonMetric" oor:type="xs:int">
+ <info>
+ <desc>Specifies the distance between adjacent tab stops in 1/100 mm when the non-metric system is selected.</desc>
+ <label/>
+ </info>
+ <value>1270</value>
+ </prop>
+ </group>
+ <group oor:name="MeasureUnit">
+ <!-- OldPath: Impress/Layout -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation- Layout - [Section] Meas. units -->
+ <info>
+ <desc>Specifies the measurement unit to be used with respect to whether the metric or the non-metric system is selected.</desc>
+ <label>Measurement unit</label>
+ </info>
+ <prop oor:name="Metric" oor:type="xs:int">
+ <info>
+ <desc>Specifies the measurement unit to be used when the metric system is selected.</desc>
+ <label>Measurement unit</label>
+ </info>
+ <constraints>
+ <enumeration oor:value="1">
<info>
- <desc>The URL of the template document that contains the master page.</desc>
+ <desc>Millimeter</desc>
</info>
- </prop>
- <prop oor:name="Name" oor:type="xs:string">
+ </enumeration>
+ <enumeration oor:value="2">
<info>
- <desc>The internal name of the master page.</desc>
+ <desc>Centimeter</desc>
</info>
- </prop>
- </group>
- <group oor:name="Resource">
- <info>
- <desc>A factory that can create one more resources for the multi pane framework.</desc>
- </info>
- <prop oor:name="URL" oor:type="xs:string">
+ </enumeration>
+ <enumeration oor:value="6">
+ <info>
+ <desc>Point</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="7">
<info>
- <desc>URL of a multi pane framework resource.</desc>
+ <desc>Pica</desc>
</info>
- </prop>
- </group>
- <group oor:name="ResourceFactory">
+ </enumeration>
+ <enumeration oor:value="8">
+ <info>
+ <desc>Inch</desc>
+ </info>
+ </enumeration>
+ </constraints>
+ <value>2</value>
+ </prop>
+ <prop oor:name="NonMetric" oor:type="xs:int">
<info>
- <desc>A factory that can create one more resources for the multi pane framework.</desc>
+ <desc>Specifies the measurement unit to be used when the non-metric system is selected.</desc>
+ <label>Measurement unit</label>
</info>
- <prop oor:name="ServiceName" oor:type="xs:string">
+ <constraints>
+ <enumeration oor:value="1">
+ <info>
+ <desc>Millimeter</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="2">
<info>
- <desc>The service name of the factory. This service is not the factory itself.
- It is expected to create and register a set of factories when an instance of
- the service is created.</desc>
+ <desc>Centimeter</desc>
</info>
- </prop>
- <set oor:name="ResourceList" oor:node-type="Resource">
+ </enumeration>
+ <enumeration oor:value="6">
<info>
- <desc>List of URLs of the resources that are created by the factory.</desc>
+ <desc>Point</desc>
</info>
- </set>
- </group>
- <group oor:name="StartupService">
- <info>
- <desc>A service that is instantiated when a framework is initializd for a
- Draw or Impress document.</desc>
- </info>
- <prop oor:name="ServiceName" oor:type="xs:string">
- <info>
- <desc>The name of the startup service.</desc>
- </info>
- </prop>
- </group>
- </templates>
- <component>
- <group oor:name="Layout">
- <info>
- <desc>Contains general properties of the graphical object representation.</desc>
- </info>
- <group oor:name="Display">
- <info>
- <desc>Contains general properties of the graphical object representation of screen displays.</desc>
- </info>
- <prop oor:name="Ruler" oor:type="xs:boolean">
- <!-- OldPath: Impress/Layout/Display -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation - Layout - [Section] Display -->
- <info>
- <desc>Indicates whether to show the rulers at the left and at the top of the working area.</desc>
- <label>Rulers visible</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="Helpline" oor:type="xs:boolean">
- <!-- OldPath: Impress/Layout/Display -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation - Layout - [Section] Display -->
- <info>
- <desc>Indicates whether to show help-lines that can be created by dragging them from the rulers.</desc>
- <label>Helplines visible</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="Guide" oor:type="xs:boolean">
- <!-- OldPath: Impress/Layout/Display -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation - Layout - [Section] Display -->
- <info>
- <desc>Indicates whether to show help-lines when moving an object.</desc>
- <label>Guides when moving</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="Bezier" oor:type="xs:boolean">
- <!-- OldPath: Impress/Layout/Display -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation - Layout - [Section] Display -->
- <info>
- <desc>Indicates whether to show all control points in the Bezier curve editor.</desc>
- <label>All control points in Bezier editor</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="Contour" oor:type="xs:boolean">
- <!-- OldPath: Impress/Layout/Display -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation - Layout - [Section] Display -->
- <info>
- <desc>Indicates whether to show the outline of all moved objects when moving more then one object at the same time.</desc>
- <label>Contour of each individual object</label>
- </info>
- <value>true</value>
- </prop>
- </group>
- <group oor:name="Other">
- <info>
- <desc>Specifies other layout options that do not fit into any other group.</desc>
- <label>Other Layout Options</label>
- </info>
- <group oor:name="TabStop">
- <!-- OldPath: Impress/Layout -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation - Layout - [Section] Tab stops -->
- <!-- Notice: Default-Nonmetric Value: 1270 1/100 mm-->
- <info>
- <desc>Specifies the distance between adjacent tab stops with regard to whether the metric or the non-metric system is currently selected.</desc>
- <label>Tab stops</label>
- </info>
- <prop oor:name="Metric" oor:type="xs:int">
- <info>
- <desc>Specifies the distance between adjacent tab stops in 1/100 mm when the metric system is selected.</desc>
- <label/>
- </info>
- <value>1250</value>
- </prop>
- <prop oor:name="NonMetric" oor:type="xs:int">
- <info>
- <desc>Specifies the distance between adjacent tab stops in 1/100 mm when the non-metric system is selected.</desc>
- <label/>
- </info>
- <value>1270</value>
- </prop>
- </group>
- <group oor:name="MeasureUnit">
- <!-- OldPath: Impress/Layout -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation- Layout - [Section] Meas. units -->
- <info>
- <desc>Specifies the measurement unit to be used with respect to whether the metric or the non-metric system is selected.</desc>
- <label>Measurement unit</label>
- </info>
- <prop oor:name="Metric" oor:type="xs:int">
- <info>
- <desc>Specifies the measurement unit to be used when the metric system is selected.</desc>
- <label>Measurement unit</label>
- </info>
- <constraints>
- <enumeration oor:value="1">
- <info>
- <desc>Millimeter</desc>
- </info>
- </enumeration>
- <enumeration oor:value="2">
- <info>
- <desc>Centimeter</desc>
- </info>
- </enumeration>
- <enumeration oor:value="6">
- <info>
- <desc>Point</desc>
- </info>
- </enumeration>
- <enumeration oor:value="7">
- <info>
- <desc>Pica</desc>
- </info>
- </enumeration>
- <enumeration oor:value="8">
- <info>
- <desc>Inch</desc>
- </info>
- </enumeration>
- </constraints>
- <value>2</value>
- </prop>
- <prop oor:name="NonMetric" oor:type="xs:int">
- <info>
- <desc>Specifies the measurement unit to be used when the non-metric system is selected.</desc>
- <label>Measurement unit</label>
- </info>
- <constraints>
- <enumeration oor:value="1">
- <info>
- <desc>Millimeter</desc>
- </info>
- </enumeration>
- <enumeration oor:value="2">
- <info>
- <desc>Centimeter</desc>
- </info>
- </enumeration>
- <enumeration oor:value="6">
- <info>
- <desc>Point</desc>
- </info>
- </enumeration>
- <enumeration oor:value="7">
- <info>
- <desc>Pica</desc>
- </info>
- </enumeration>
- <enumeration oor:value="8">
- <info>
- <desc>Inch</desc>
- </info>
- </enumeration>
- </constraints>
- <value>8</value>
- </prop>
- </group>
- </group>
- </group>
- <group oor:name="Content">
- <info>
- <desc>Contains content related configuration items.</desc>
- </info>
- <group oor:name="Display">
- <info>
- <desc>Contains configuration items related to the display of Impress documents.</desc>
- </info>
- <prop oor:name="PicturePlaceholder" oor:type="xs:boolean">
- <!-- OldPath: Impress/Contents/Display -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation - Contents - [Section] Alternative display -->
- <info>
- <desc>Indicates whether to show only the bounding box of graphic-objects like bitmaps and drawings.</desc>
- <label>Picture placeholders</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="ContourMode" oor:type="xs:boolean">
- <!-- OldPath: Impress/Contents/Display -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation - Contents - [Section] Alternative display -->
- <info>
- <desc>Indicates whether to show only outlines of objects such as filled rectangles and filled ellipses.</desc>
- <label>Contour mode</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="TextPlaceholder" oor:type="xs:boolean">
- <!-- OldPath: Impress/Contents/Display -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation - Contents - [Section] Alternative display -->
- <info>
- <desc>Indicates whether to show only a placeholder for text in graphical objects.</desc>
- <label>Text placeholders</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="LineContour" oor:type="xs:boolean">
- <!-- OldPath: Impress/Contents/Display -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation - Contents - [Section] Alternative display -->
- <info>
- <desc>Indicates whether to show only hairlines instead of the true line styles.</desc>
- <label>Line contour only</label>
- </info>
- <value>false</value>
- </prop>
- </group>
- </group>
- <group oor:name="Misc">
- <info>
- <desc>Contains a collection of configuration items for the Impress application that do not fit into another category.</desc>
- </info>
- <prop oor:name="BackgroundCache" oor:type="xs:boolean">
- <!-- OldPath: Impress/Other -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Other [Section] Other -->
- <info>
- <desc>Indicates whether to store master pages in a cache to speed up drawing.</desc>
- <label>Use background cache</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="CopyWhileMoving" oor:type="xs:boolean">
- <!-- OldPath: Impress/Other -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Other [Section] Other -->
- <info>
- <desc>Indicates whether moving while holding the Control key makes a copy of the moved object.</desc>
- <label>Copy while moving</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="ObjectMoveable" oor:type="xs:boolean">
- <!-- OldPath: Impress/Other -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Other [Section] Other -->
- <info>
- <desc>Indicates whether objects can still be moved while in rotating mode.</desc>
- <label>Objects always moveable</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="NoDistort" oor:type="xs:boolean">
- <!-- OldPath: Impress/Other -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Other [Section] Other -->
- <info>
- <desc>Indicates whether objects that are placed on a circle keep their original form, i.e. may be moved and rotated but not resized or otherwise distorted.</desc>
- <label>Don&apos;t distort objects in curve</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="DclickTextedit" oor:type="xs:boolean">
- <!-- OldPath: Impress/Other -->
- <!-- OldLocation: soffice.cfg -->
- <!-- UIHints: Option Bar -->
- <info>
- <desc>Indicates whether a double-click on a text object activates the edit mode.</desc>
- <label>Double-Click Text to Edit</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="RotateClick" oor:type="xs:boolean">
- <!-- OldPath: Impress/Other -->
- <!-- OldLocation: soffice.cfg -->
- <!-- UIHints: Option Bar -->
- <info>
- <desc>Indicates whether a double-click on an object activates the rotation mode.</desc>
- <label>Rotation Mode after clicking object</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="Preview" oor:type="xs:double">
- <!-- OldPath: Impress/Other -->
- <!-- OldLocation: soffice.cfg -->
- <!-- UIHints: Menu: view - preview mode -->
- <info>
- <desc>Specifies the color quality of the preview: 0 - Color, 868 - Grayscale, 5381 - Black/White.</desc>
- <label>Preview-Mode</label>
- </info>
- <constraints>
- <enumeration oor:value="0">
- <info>
- <desc>Color</desc>
- </info>
- </enumeration>
- <enumeration oor:value="868">
- <info>
- <desc>Grayscale</desc>
- </info>
- </enumeration>
- <enumeration oor:value="5381">
- <info>
- <desc>Black/White</desc>
- </info>
- </enumeration>
- </constraints>
- <value>0</value>
- </prop>
+ </enumeration>
+ <enumeration oor:value="7">
+ <info>
+ <desc>Pica</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="8">
+ <info>
+ <desc>Inch</desc>
+ </info>
+ </enumeration>
+ </constraints>
+ <value>8</value>
+ </prop>
+ </group>
+ </group>
+ </group>
+ <group oor:name="Content">
+ <info>
+ <desc>Contains content related configuration items.</desc>
+ </info>
+ <group oor:name="Display">
+ <info>
+ <desc>Contains configuration items related to the display of Impress documents.</desc>
+ </info>
+ <prop oor:name="PicturePlaceholder" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Contents/Display -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation - Contents - [Section] Alternative display -->
+ <info>
+ <desc>Indicates whether to show only the bounding box of graphic-objects like bitmaps and drawings.</desc>
+ <label>Picture placeholders</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="ContourMode" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Contents/Display -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation - Contents - [Section] Alternative display -->
+ <info>
+ <desc>Indicates whether to show only outlines of objects such as filled rectangles and filled ellipses.</desc>
+ <label>Contour mode</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="TextPlaceholder" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Contents/Display -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation - Contents - [Section] Alternative display -->
+ <info>
+ <desc>Indicates whether to show only a placeholder for text in graphical objects.</desc>
+ <label>Text placeholders</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="LineContour" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Contents/Display -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation - Contents - [Section] Alternative display -->
+ <info>
+ <desc>Indicates whether to show only hairlines instead of the true line styles.</desc>
+ <label>Line contour only</label>
+ </info>
+ <value>false</value>
+ </prop>
+ </group>
+ </group>
+ <group oor:name="Misc">
+ <info>
+ <desc>Contains a collection of configuration items for the Impress application that do not fit into another category.</desc>
+ </info>
+ <prop oor:name="BackgroundCache" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Other -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Other [Section] Other -->
+ <info>
+ <desc>Indicates whether to store master pages in a cache to speed up drawing.</desc>
+ <label>Use background cache</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="CopyWhileMoving" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Other -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Other [Section] Other -->
+ <info>
+ <desc>Indicates whether moving while holding the Control key makes a copy of the moved object.</desc>
+ <label>Copy while moving</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="ObjectMoveable" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Other -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Other [Section] Other -->
+ <info>
+ <desc>Indicates whether objects can still be moved while in rotating mode.</desc>
+ <label>Objects always moveable</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="NoDistort" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Other -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Other [Section] Other -->
+ <info>
+ <desc>Indicates whether objects that are placed on a circle keep their original form, i.e. may be moved and rotated but not resized or otherwise distorted.</desc>
+ <label>Don&apos;t distort objects in curve</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="DclickTextedit" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Other -->
+ <!-- OldLocation: soffice.cfg -->
+ <!-- UIHints: Option Bar -->
+ <info>
+ <desc>Indicates whether a double-click on a text object activates the edit mode.</desc>
+ <label>Double-Click Text to Edit</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="RotateClick" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Other -->
+ <!-- OldLocation: soffice.cfg -->
+ <!-- UIHints: Option Bar -->
+ <info>
+ <desc>Indicates whether a double-click on an object activates the rotation mode.</desc>
+ <label>Rotation Mode after clicking object</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="Preview" oor:type="xs:double">
+ <!-- OldPath: Impress/Other -->
+ <!-- OldLocation: soffice.cfg -->
+ <!-- UIHints: Menu: view - preview mode -->
+ <info>
+ <desc>Specifies the color quality of the preview: 0 - Color, 868 - Grayscale, 5381 - Black/White.</desc>
+ <label>Preview-Mode</label>
+ </info>
+ <constraints>
+ <enumeration oor:value="0">
+ <info>
+ <desc>Color</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="868">
+ <info>
+ <desc>Grayscale</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="5381">
+ <info>
+ <desc>Black/White</desc>
+ </info>
+ </enumeration>
+ </constraints>
+ <value>0</value>
+ </prop>
<prop oor:name="ShowComments" oor:type="xs:boolean">
<info>
<author>CL</author>
@@ -404,774 +409,778 @@
<value>true</value>
</prop>
<prop oor:name="SimpleHandles" oor:type="xs:boolean">
- <!-- OldPath: Impress/Other -->
- <!-- OldLocation: soffice.cfg -->
- <!-- UIHints: Optionbar -->
- <info>
- <desc>Indicates whether to show simple (true) or 3D-handles (false).</desc>
- <label>Simple Handles</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="BigHandles" oor:type="xs:boolean">
- <!-- OldPath: Impress/Other -->
- <!-- OldLocation: soffice.cfg -->
- <!-- UIHints: Optionbar -->
- <info>
- <desc>Indicates whether to show big (true) or small (false) handles.</desc>
- <label>Big Handles</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="ModifyWithAttributes" oor:type="xs:boolean">
- <!-- OldPath: Impress/Other -->
- <!-- OldLocation: soffice.cfg -->
- <!-- UIHints: Optionbar -->
- <info>
+ <!-- OldPath: Impress/Other -->
+ <!-- OldLocation: soffice.cfg -->
+ <!-- UIHints: Optionbar -->
+ <info>
+ <desc>Indicates whether to show simple (true) or 3D-handles (false).</desc>
+ <label>Simple Handles</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="BigHandles" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Other -->
+ <!-- OldLocation: soffice.cfg -->
+ <!-- UIHints: Optionbar -->
+ <info>
+ <desc>Indicates whether to show big (true) or small (false) handles.</desc>
+ <label>Big Handles</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="ModifyWithAttributes" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Other -->
+ <!-- OldLocation: soffice.cfg -->
+ <!-- UIHints: Optionbar -->
+ <info>
<author>AF</author>
<desc>Indicates whether the object creation and modification will be visualized using the full object attribute set or wireframe.</desc>
<label>Modify with attributes</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="ShowUndoDeleteWarning" oor:type="xs:boolean">
- <!-- OldPath: -->
- <!-- OldLocation: -->
- <!-- UIHints: UNDO stack delete warnng dialog -->
- <info>
- <author>AW</author>
- <desc>Indicates whether the warning dialog appears when setting a new standard page layout.</desc>
- <label>Show Undo-Stack Delete Warning</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="SlideshowRespectZOrder" oor:type="xs:boolean">
- <!-- OldPath: -->
- <!-- OldLocation: -->
- <!-- UIHints: Slideshow Z order for animations -->
- <info>
- <author>THB</author>
- <desc>Indicates whether the slideshow should respect shape z-order while animating shapes. Disabling this can improve slideshow performance</desc>
- <label>Enable shape z-order during slideshow animations</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="TransitionFiles" oor:type="oor:string-list">
- <!-- OldPath: -->
- <!-- OldLocation: -->
- <!-- UIHints: List of files containing transition effects -->
- <info>
- <author>THB</author>
- <desc>Contains a list of odf files, that define
- slideshow transitions. Values are put through
- macro expansion, so, vnd.sun.star.expand prefix
- is allowed. </desc>
- <label>List of files containing transition effects</label>
- </info>
- <value oor:separator=";">vnd.sun.star.expand:$OOO_BASE_DIR/share/config/soffice.cfg/simpress/transitions.xml</value>
- </prop>
- <prop oor:name="EffectFiles" oor:type="oor:string-list">
- <!-- OldPath: -->
- <!-- OldLocation: -->
- <!-- UIHints: List of files containing object effects -->
- <info>
- <author>THB</author>
- <desc>Contains a list of odf files, that define
- slideshow shape effects. Values are put through
- macro expansion, so, vnd.sun.star.expand prefix
- is allowed.</desc>
- <label>List of files containing object effects</label>
- </info>
- <value oor:separator=";">vnd.sun.star.expand:$OOO_BASE_DIR/share/config/soffice.cfg/simpress/effects.xml</value>
- </prop>
- <prop oor:name="PreviewNewEffects" oor:type="xs:boolean">
- <!-- OldPath: -->
- <!-- OldLocation: -->
- <!-- UIHints: automatic preview checkbox in create new effect dialog -->
- <info>
- <author>CL</author>
- <desc>Indicates whether a selected effect in the custom animation create dialog should be previewed.</desc>
- <label>Automatic preview for new custom animation</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="PreviewChangedEffects" oor:type="xs:boolean">
- <!-- OldPath: -->
- <!-- OldLocation: -->
- <!-- UIHints: automatic preview in custom animation panel -->
- <info>
- <author>CL</author>
- <desc>Indicates whether changes in the custom animation panel should be previewed.</desc>
- <label>Automatic preview for custom animation panel</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="PreviewTransitions" oor:type="xs:boolean">
- <!-- OldPath: -->
- <!-- OldLocation: -->
- <!-- UIHints: automatic preview in slide transtion panel -->
- <info>
- <author>CL</author>
- <desc>Indicates whether changes in the slide transition panel should be previewed.</desc>
- <label>Automatic preview for slide transition panel</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="Display" oor:type="xs:int">
- <!-- OldPath: -->
- <!-- OldLocation: -->
- <!-- UIHints: slide show settings display listbox -->
- <info>
- <author>CL</author>
- <desc>Number of the display used for full screen slide show mode.</desc>
- <label>Display for full screen slide show mode</label>
- </info>
- <value>0</value>
- </prop>
- <group oor:name="TextObject">
- <info>
- <desc>Contains text editing related configuration items.</desc>
- </info>
- <prop oor:name="QuickEditing" oor:type="xs:boolean">
- <!-- OldPath: Impress/Other/Text_Objects -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Other [Section] Text objects -->
- <info>
- <desc>Indicates whether a simple click on a text object changes it to edit mode.</desc>
- <label>Allow quick editing</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="Selectable" oor:type="xs:boolean">
- <!-- OldPath: Impress/Other/Text_Objects -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Other [Section] Text objects -->
- <info>
- <desc>Indicates whether a text frame can only be selected by clicking on the text or by clicking somewhere in the frame.</desc>
- <label>Only text area selectable</label>
- </info>
- <value>true</value>
- </prop>
- </group>
- <group oor:name="NewDoc">
- <info>
- <desc>Specifies configuration items governing the behavior when creating a new document or a new page.</desc>
- <label>Start with AutoPilots</label>
- </info>
- <prop oor:name="AutoPilot" oor:type="xs:boolean">
- <!-- OldPath: Impress/Other/New_Doc -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Other [Section] New document -->
- <info>
- <desc>Indicates whether to show the autopilot when creating a new presentation.</desc>
- <label>Start with AutoPilots</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="Layout" oor:type="xs:boolean">
- <!-- OldPath: Impress/Other/New_Doc -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Other [Section] New document -->
- <info>
- <desc>Indicates whether to show the layout dialog when creating a new page.</desc>
- <label>Start with AutoPilots</label>
- </info>
- <value>true</value>
- </prop>
- </group>
- <group oor:name="Start">
- <info>
- <desc>Specifies configuration items governing behavior when starting a presentation.</desc>
- </info>
- <prop oor:name="CurrentPage" oor:type="xs:boolean">
- <!-- OldPath: Impress/Other/Start -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Other [Section] Start presentation -->
- <info>
- <desc>Indicates whether to start the presentation with the current (true) or the first (false) page.</desc>
- <label>Always with current page</label>
- </info>
- <value>true</value>
- </prop>
- </group>
- <group oor:name="Compatibility">
- <info>
- <desc>Contains the group of options that control the compatibility to other applications.</desc>
- <label>Compatibility options.</label>
- </info>
- <prop oor:name="AddBetween" oor:type="xs:boolean">
- <!-- OldPath: Writer/Other/Compatibility -->
- <!-- UIHints: Tools - Options - Presentation - Other - [Section] Compatibility -->
- <info>
- <author>SJ</author>
- <desc>Specifies if spacing between paragraphs should be added to ensure compatibility to MS Word documents</desc>
- <label>Add spacing between paragraphs</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="PrinterIndependentLayout" oor:type="xs:short">
- <!-- UIHints: Tools - Options - Presentation - Other - [Section] Compatibility -->
- <info>
- <author>AF</author>
- <desc>Indicates whether to use printer independent metrics for document formatting (2) or to use metrics derived from the current printer (1). Refer to com::sun::star::document::PrinterIndependentLayout for valid values.</desc>
- <label>Use printer independent metrics for document formatting</label>
- </info>
- <value>2</value>
- </prop>
- </group>
- <group oor:name="DefaultObjectSize">
- <!-- OldPath: -->
- <!-- OldLocation: -->
- <!-- UIHints: Default size for newly created objects when using CTRL-Return or CTRL-Klick -->
- <info>
- <author>AW</author>
- <desc>Defines the default size of newly created objects using CTRL-Return or CTRL-Click at a object creating Button.</desc>
- <label>Default Object Size</label>
- </info>
- <prop oor:name="Width" oor:type="xs:int">
- <info>
- <desc>[UNIT=1/100 mm]</desc>
- <label/>
- </info>
- <value>8000</value>
- </prop>
- <prop oor:name="Height" oor:type="xs:int">
- <info>
- <desc>[UNIT=1/100 mm]</desc>
- <label/>
- </info>
- <value>5000</value>
- </prop>
- </group>
- </group>
- <group oor:name="Snap">
- <info>
- <desc>Specifies how to force object positions and sizes to the snap grid or to align with other objects.</desc>
- </info>
- <group oor:name="Object">
- <info>
- <desc>Specifies how to force object positions and sizes to predefined locations in relation to other objects.</desc>
- </info>
- <prop oor:name="Grid" oor:type="xs:boolean">
- <!-- OldPath: Impress/Snap/Objects -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap to -->
- <info>
- <desc>Indicates whether to snap an object when moved to the next grid point.</desc>
- <label>Grid lines</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="SnapLine" oor:type="xs:boolean">
- <!-- OldPath: Impress/Snap/Objects -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap to -->
- <info>
- <desc>Indicates whether to snap at snap lines.</desc>
- <label>Snap lines</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="PageMargin" oor:type="xs:boolean">
- <!-- OldPath: Impress/Snap/Objects -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap to -->
- <info>
- <desc>Indicates whether the outline of an object is justified with adjacent page margins.</desc>
- <label>Page margins</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="ObjectFrame" oor:type="xs:boolean">
- <!-- OldPath: Impress/Snap/Objects -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap to -->
- <info>
- <desc>Indicates whether to justify the outline of an object to that of an adjacent object.</desc>
- <label>Object frame</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="ObjectPoint" oor:type="xs:boolean">
- <!-- OldPath: Impress/Snap/Objects -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap to -->
- <info>
- <desc>Indicates whether to snap corner points of adjacent objects.</desc>
- <label>Object points</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="Range" oor:type="xs:int">
- <!-- OldPath: Impress/Snap/Objects -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap to -->
- <info>
- <desc>Specifies the maximal range in pixels along the coordinate axes at which snapping becomes active.</desc>
- <label>Snap range</label>
- </info>
- <constraints>
- <minInclusive oor:value="1">
- <info>
- <desc>Specifies that the minimum snap range is 1.</desc>
- </info>
- </minInclusive>
- <maxInclusive oor:value="50">
- <info>
- <desc>Specifies that the maximal snap range is 50.</desc>
- </info>
- </maxInclusive>
- </constraints>
- <value>5</value>
- </prop>
- </group>
- <group oor:name="Position">
- <info>
- <desc>Specifies constraints regarding the creation and modification of graphical objects.</desc>
- </info>
- <prop oor:name="CreatingMoving" oor:type="xs:boolean">
- <!-- OldPath: Impress/Snap/Position -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap position -->
- <info>
- <desc>Indicates whether to restrict the creation of objects to squares, circles, etc. and to retain the x/y ratio when resizing.</desc>
- <label>When creating or moving objects</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="ExtendEdges" oor:type="xs:boolean">
- <!-- OldPath: Impress/Snap/Position -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap position -->
- <info>
- <desc>Indicates whether to use the longer (true) or the shorter (false) of the two distances along the coordinates axes from the initial to the current position to determine a new square&apos;s edge length or a new circle&apos;s diameter.</desc>
- <label>Extend edges</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="Rotating" oor:type="xs:boolean">
- <!-- OldPath: Impress/Snap/Position -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap position -->
- <info>
- <desc>Indicates whether to use snapping while rotating an object.</desc>
- <label>When rotating</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="RotatingValue" oor:type="xs:int">
- <!-- OldPath: Impress/Snap/Position -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap position -->
- <info>
- <desc>Specifies the rotation angle when snapping for rotation is enabled. [UNIT=Degree/100]</desc>
- <label>When rotating</label>
- </info>
- <constraints>
- <minInclusive oor:value="0">
- <info>
- <desc>Specifies that the minimum rotation angle is 0/100 degrees.</desc>
- </info>
- </minInclusive>
- <maxInclusive oor:value="18000">
- <info>
- <desc>Specifies that the maximum rotation angle is 18000/100 degrees.</desc>
- </info>
- </maxInclusive>
- </constraints>
- <value>1500</value>
- </prop>
- <prop oor:name="PointReduction" oor:type="xs:int">
- <!-- OldPath: Impress/Snap/Position -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap position -->
- <info>
- <desc>Specifies the maximum angle that you can move a line before it snaps into place in the point editor that connects two points [UNIT=Degree/100].</desc>
- <label>Point reduction</label>
- </info>
- <constraints>
- <minInclusive oor:value="100">
- <info>
- <desc>Specifies that the minimum angle is 100/100 degrees.</desc>
- </info>
- </minInclusive>
- <maxInclusive oor:value="9000">
- <info>
- <desc>Specifies that the maximum angle is 9000/100 degrees.</desc>
- </info>
- </maxInclusive>
- </constraints>
- <value>1500</value>
- </prop>
- </group>
- </group>
- <group oor:name="Grid">
- <info>
- <desc>Defines the handling and display of the snap grid.</desc>
- </info>
- <group oor:name="Option">
- <info>
- <desc>Specifies switches regarding use and display of the snap grid.</desc>
- </info>
- <prop oor:name="SnapToGrid" oor:type="xs:boolean">
- <!-- OldPath: Impress/Grid/Options -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Grid - [Section] Options -->
- <info>
- <desc>Indicates whether to force frames and drawing elements on grid points.</desc>
- <label>Snap to grid</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="VisibleGrid" oor:type="xs:boolean">
- <!-- OldPath: Impress/Grid/Options -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Grid - [Section] Options -->
- <info>
- <desc>Indicates whether to show the grid.</desc>
- <label>Visible grid</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="Synchronize" oor:type="xs:boolean">
- <!-- OldPath: Impress/Grid/Options -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Grid - [Section] Options -->
- <info>
- <desc>Indicates whether to synchronize the resolutions of x- and y-grids.</desc>
- <label>Synchronize axes</label>
- </info>
- <value>false</value>
- </prop>
- </group>
- <group oor:name="Resolution">
- <info>
- <desc>Specifies grid resolution.</desc>
- </info>
- <group oor:name="XAxis">
- <!-- OldPath: Impress/Grid/Resolution -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Grid - [Section] Grid -->
- <!-- Notice: Default-nonmetrical value: 1270 1/100 mm. -->
- <info>
- <desc>Defines the horizontal distance between adjacent grid points.</desc>
- <label>X Axis Resolution</label>
- </info>
- <prop oor:name="Metric" oor:type="xs:int">
- <info>
- <desc>Defines the horizontal distance between adjacent grid points in 1/100 mm, used when the metric system is active.</desc>
- <label/>
- </info>
- <value>1000</value>
- </prop>
- <prop oor:name="NonMetric" oor:type="xs:int">
- <info>
- <desc>Defines the horizontal distance between adjacent grid points in 1/100 mm, used when the non-metric system is active.</desc>
- <label/>
- </info>
- <value>1270</value>
- </prop>
- </group>
- <group oor:name="YAxis">
- <!-- OldPath: Impress/Grid/Resolution -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Grid - [Section] Grid -->
- <!-- Notice: Default- nonmerical value: 1270 1/100 mm. -->
- <info>
- <desc>Defines the vertical distance between adjacent grid points.</desc>
- <label>Y Axis Resolution</label>
- </info>
- <prop oor:name="Metric" oor:type="xs:int">
- <info>
- <desc>Defines the vertical distance between adjacent grid points in 1/100 mm, used when the metric system is active.</desc>
- <label/>
- </info>
- <value>1000</value>
- </prop>
- <prop oor:name="NonMetric" oor:type="xs:int">
- <info>
- <desc>Defines the vertical distance between adjacent grid points in 1/100 mm, used when the non-metric system is active.</desc>
- <label/>
- </info>
- <value>1270</value>
- </prop>
- </group>
- </group>
- <group oor:name="Subdivision">
- <info>
- <desc>Specifies the subdivision of the grid.</desc>
- </info>
- <prop oor:name="XAxis" oor:type="xs:double">
- <!-- OldPath: Impress/Grid/Subdivision -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Grid - [Section] Grid -->
- <!-- Notice: Default value for English Version only: 254 Points) -->
- <info>
- <desc>Specifies the number of points between two adjacent grid points on the X axis.</desc>
- <label>X Axis Subdivision</label>
- </info>
- <value>1</value>
- </prop>
- <prop oor:name="YAxis" oor:type="xs:double">
- <!-- OldPath: Impress/Grid/Subdivision -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Grid - [Section] Grid -->
- <!-- Notice: Default value for English Version only: 254 Points) -->
- <info>
- <desc>Specifies the number of intervals between two adjacent grid points on the Y axis</desc>
- <label>Y Axis Subdivision</label>
- </info>
- <value>1</value>
- </prop>
- </group>
- <group oor:name="SnapGrid">
- <info>
- <desc>Contains the specifications of the snap grid.</desc>
- </info>
- <prop oor:name="Size" oor:type="xs:boolean">
- <!-- OldPath: Impress/Grid/Snap_Grid -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Grid - [Section] Snap grid -->
- <info>
- <desc>Indicates whether to synchronize grid and snap-grid.</desc>
- <label>Size to grid</label>
- </info>
- <value>true</value>
- </prop>
- <group oor:name="XAxis">
- <!-- OldPath: Impress/Grid/Snap_Grid -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Grid - [Section] Snap grid -->
- <!-- Notice: Default-nonmetrical value: 1270 1/100 mm. -->
- <info>
- <desc>Defines the horizontal distance between adjacent points of the snap grid.</desc>
- <label>X axis</label>
- </info>
- <prop oor:name="Metric" oor:type="xs:int">
- <info>
- <desc>Defines the horizontal distance between adjacent points of the snap grid in 1/100 mm, used when the metric system is selected.</desc>
- <label/>
- </info>
- <value>1000</value>
- </prop>
- <prop oor:name="NonMetric" oor:type="xs:int">
- <info>
- <desc>Defines the horizontal distance between adjacent points of the snap grid in 1/100 mm, used when the non-metric system is selected.</desc>
- <label/>
- </info>
- <value>1270</value>
- </prop>
- </group>
- <group oor:name="YAxis">
- <!-- OldPath: Impress/Grid/Snap_Grid -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Grid - [Section] Snap grid -->
- <!-- Notice: Default-Default-nonmetrical value: 1270 1/100 mm. -->
- <info>
- <desc>Defines the vertical distance between adjacent points of the snap grid.</desc>
- <label>Y axis</label>
- </info>
- <prop oor:name="Metric" oor:type="xs:int">
- <info>
- <desc>Defines the vertical distance between adjacent points of the snap grid in 1/100 mm, used when the metric system is selected.</desc>
- <label/>
- </info>
- <value>1000</value>
- </prop>
- <prop oor:name="NonMetric" oor:type="xs:int">
- <info>
- <desc>Defines the vertical distance between adjacent points of the snap grid in 1/100 mm, used when the non-metric system is selected.</desc>
- <label/>
- </info>
- <value>1270</value>
- </prop>
- </group>
- </group>
- </group>
- <group oor:name="Print">
- <info>
- <desc>Defines options regarding the printing of Impress documents.</desc>
- </info>
- <group oor:name="Content">
- <info>
- <desc>Defines options regarding the printing of document content.</desc>
- </info>
- <prop oor:name="Presentation" oor:type="xs:boolean">
- <!-- OldPath: Impress/Print/Contents -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Print - [Section] Contents -->
- <info>
- <desc>Indicates whether the presentation will be printed.</desc>
- <label>Presentation</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="Note" oor:type="xs:boolean">
- <!-- OldPath: Impress/Print/Contents -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Print - [Section] Contents -->
- <info>
- <desc>Indicates whether the notes will be printed.</desc>
- <label>Notes</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="Handout" oor:type="xs:boolean">
- <!-- OldPath: Impress/Print/Contents -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Print - [Section] Contents -->
- <info>
- <desc>Indicates whether the handouts will be printed.</desc>
- <label>Handouts</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="Outline" oor:type="xs:boolean">
- <!-- OldPath: Impress/Print/Contents -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Print - [Section] Contents -->
- <info>
- <desc>Indicates whether the outlines will be printed.</desc>
- <label>Outline</label>
- </info>
- <value>false</value>
- </prop>
- </group>
- <group oor:name="Page">
- <info>
- <desc>Specifies how and which pages will be printed.</desc>
- </info>
- <prop oor:name="PageSize" oor:type="xs:boolean">
- <!-- OldPath: Impress/Print/Page -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Print - [Section] Page options -->
- <info>
- <desc>Indicates whether to enlarge or shrink a document&apos;s page size while printing to fit the physical paper size.</desc>
- <label>Fit to page</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="PageTile" oor:type="xs:boolean">
- <!-- OldPath: Impress/Print/Page -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Print - [Section] Page options -->
- <info>
- <desc>Indicates whether to print the pages&apos; titles at the top of every page.</desc>
- <label>Tile pages</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="Booklet" oor:type="xs:boolean">
- <!-- OldPath: Impress/Print/Page -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Print - [Section] Page options -->
- <info>
- <desc>Indicates whether to print a document in the form of a brochure.</desc>
- <label>Brochure</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="BookletFront" oor:type="xs:boolean">
- <!-- OldPath: Impress/Print/Page -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Print - [Section] Page options -->
- <info>
- <desc>Indicates whether to print the front side pages of a brochure.</desc>
- <label>Front side</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="BookletBack" oor:type="xs:boolean">
- <!-- OldPath: Impress/Print/Page -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Print - [Section] Page options -->
- <info>
- <desc>Indicates whether to print the back side pages of a brochure.</desc>
- <label>Back side</label>
- </info>
- <value>true</value>
- </prop>
- </group>
- <group oor:name="Other">
- <info>
- <desc>Specifies general printing related issues.</desc>
- </info>
- <prop oor:name="PageName" oor:type="xs:boolean">
- <!-- OldPath: Impress/Print -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Print - [Section] Print -->
- <info>
- <desc>Indicates whether to print page names.</desc>
- <label>Page name</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="Date" oor:type="xs:boolean">
- <!-- OldPath: Impress/Print -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Print - [Section] Print -->
- <info>
- <desc>Indicates whether to print the current date at the top of every page.</desc>
- <label>Date</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="Time" oor:type="xs:boolean">
- <!-- OldPath: Impress/Print -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Print - [Section] Print -->
- <info>
- <desc>Indicates whether to print the current time at the top of every page.</desc>
- <label>Time</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="HiddenPage" oor:type="xs:boolean">
- <!-- OldPath: Impress/Print -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Print - [Section] Print -->
- <info>
- <desc>Indicates whether to print hidden pages.</desc>
- <label>Hidden pages</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="Quality" oor:type="xs:int">
- <!-- OldPath: Impress/Print -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Print - [Section] Quality -->
- <info>
- <desc>Specifies the quality of the printed colors.</desc>
- </info>
- <constraints>
- <enumeration oor:value="0">
- <info>
- <desc>Color</desc>
- </info>
- </enumeration>
- <enumeration oor:value="1">
- <info>
- <desc>Grayscale</desc>
- </info>
- </enumeration>
- <enumeration oor:value="2">
- <info>
- <desc>Black/White</desc>
- </info>
- </enumeration>
- </constraints>
- <value>0</value>
- </prop>
- <prop oor:name="FromPrinterSetup" oor:type="xs:boolean">
- <!-- OldPath: Impress/Print -->
- <!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: Tools - Options - Presentation Print [Check box] From printer setup -->
- <info>
- <desc>Indicates whether to use the system settings of the printer to choose the paper tray.</desc>
- <label>From printer setup</label>
- </info>
- <value>false</value>
- </prop>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="ShowUndoDeleteWarning" oor:type="xs:boolean">
+ <!-- OldPath: -->
+ <!-- OldLocation: -->
+ <!-- UIHints: UNDO stack delete warnng dialog -->
+ <info>
+ <author>AW</author>
+ <desc>Indicates whether the warning dialog appears when setting a new standard page layout.</desc>
+ <label>Show Undo-Stack Delete Warning</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="SlideshowRespectZOrder" oor:type="xs:boolean">
+ <!-- OldPath: -->
+ <!-- OldLocation: -->
+ <!-- UIHints: Slideshow Z order for animations -->
+ <info>
+ <author>THB</author>
+ <desc>Indicates whether the slideshow should respect shape z-order while animating shapes. Disabling this can improve slideshow performance</desc>
+ <label>Enable shape z-order during slideshow animations</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="TransitionFiles" oor:type="oor:string-list">
+ <!-- OldPath: -->
+ <!-- OldLocation: -->
+ <!-- UIHints: List of files containing transition effects -->
+ <info>
+ <author>THB</author>
+ <desc>
+ Contains a list of odf files, that define
+ slideshow transitions. Values are put through
+ macro expansion, so, vnd.sun.star.expand prefix
+ is allowed.
+ </desc>
+ <label>List of files containing transition effects</label>
+ </info>
+ <value oor:separator=";">vnd.sun.star.expand:$OOO_BASE_DIR/share/config/soffice.cfg/simpress/transitions.xml</value>
+ </prop>
+ <prop oor:name="EffectFiles" oor:type="oor:string-list">
+ <!-- OldPath: -->
+ <!-- OldLocation: -->
+ <!-- UIHints: List of files containing object effects -->
+ <info>
+ <author>THB</author>
+ <desc>
+ Contains a list of odf files, that define
+ slideshow shape effects. Values are put through
+ macro expansion, so, vnd.sun.star.expand prefix
+ is allowed.
+ </desc>
+ <label>List of files containing object effects</label>
+ </info>
+ <value oor:separator=";">vnd.sun.star.expand:$OOO_BASE_DIR/share/config/soffice.cfg/simpress/effects.xml</value>
+ </prop>
+ <prop oor:name="PreviewNewEffects" oor:type="xs:boolean">
+ <!-- OldPath: -->
+ <!-- OldLocation: -->
+ <!-- UIHints: automatic preview checkbox in create new effect dialog -->
+ <info>
+ <author>CL</author>
+ <desc>Indicates whether a selected effect in the custom animation create dialog should be previewed.</desc>
+ <label>Automatic preview for new custom animation</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="PreviewChangedEffects" oor:type="xs:boolean">
+ <!-- OldPath: -->
+ <!-- OldLocation: -->
+ <!-- UIHints: automatic preview in custom animation panel -->
+ <info>
+ <author>CL</author>
+ <desc>Indicates whether changes in the custom animation panel should be previewed.</desc>
+ <label>Automatic preview for custom animation panel</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="PreviewTransitions" oor:type="xs:boolean">
+ <!-- OldPath: -->
+ <!-- OldLocation: -->
+ <!-- UIHints: automatic preview in slide transtion panel -->
+ <info>
+ <author>CL</author>
+ <desc>Indicates whether changes in the slide transition panel should be previewed.</desc>
+ <label>Automatic preview for slide transition panel</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="Display" oor:type="xs:int">
+ <!-- OldPath: -->
+ <!-- OldLocation: -->
+ <!-- UIHints: slide show settings display listbox -->
+ <info>
+ <author>CL</author>
+ <desc>Number of the display used for full screen slide show mode.</desc>
+ <label>Display for full screen slide show mode</label>
+ </info>
+ <value>0</value>
+ </prop>
+ <group oor:name="TextObject">
+ <info>
+ <desc>Contains text editing related configuration items.</desc>
+ </info>
+ <prop oor:name="QuickEditing" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Other/Text_Objects -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Other [Section] Text objects -->
+ <info>
+ <desc>Indicates whether a simple click on a text object changes it to edit mode.</desc>
+ <label>Allow quick editing</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="Selectable" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Other/Text_Objects -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Other [Section] Text objects -->
+ <info>
+ <desc>Indicates whether a text frame can only be selected by clicking on the text or by clicking somewhere in the frame.</desc>
+ <label>Only text area selectable</label>
+ </info>
+ <value>true</value>
+ </prop>
+ </group>
+ <group oor:name="NewDoc">
+ <info>
+ <desc>Specifies configuration items governing the behavior when creating a new document or a new page.</desc>
+ <label>Start with AutoPilots</label>
+ </info>
+ <prop oor:name="AutoPilot" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Other/New_Doc -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Other [Section] New document -->
+ <info>
+ <desc>Indicates whether to show the autopilot when creating a new presentation.</desc>
+ <label>Start with AutoPilots</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="Layout" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Other/New_Doc -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Other [Section] New document -->
+ <info>
+ <desc>Indicates whether to show the layout dialog when creating a new page.</desc>
+ <label>Start with AutoPilots</label>
+ </info>
+ <value>true</value>
+ </prop>
+ </group>
+ <group oor:name="Start">
+ <info>
+ <desc>Specifies configuration items governing behavior when starting a presentation.</desc>
+ </info>
+ <prop oor:name="CurrentPage" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Other/Start -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Other [Section] Start presentation -->
+ <info>
+ <desc>Indicates whether to start the presentation with the current (true) or the first (false) page.</desc>
+ <label>Always with current page</label>
+ </info>
+ <value>true</value>
+ </prop>
+ </group>
+ <group oor:name="Compatibility">
+ <info>
+ <desc>Contains the group of options that control the compatibility to other applications.</desc>
+ <label>Compatibility options.</label>
+ </info>
+ <prop oor:name="AddBetween" oor:type="xs:boolean">
+ <!-- OldPath: Writer/Other/Compatibility -->
+ <!-- UIHints: Tools - Options - Presentation - Other - [Section] Compatibility -->
+ <info>
+ <author>SJ</author>
+ <desc>Specifies if spacing between paragraphs should be added to ensure compatibility to MS Word documents</desc>
+ <label>Add spacing between paragraphs</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="PrinterIndependentLayout" oor:type="xs:short">
+ <!-- UIHints: Tools - Options - Presentation - Other - [Section] Compatibility -->
+ <info>
+ <author>AF</author>
+ <desc>Indicates whether to use printer independent metrics for document formatting (2) or to use metrics derived from the current printer (1). Refer to com::sun::star::document::PrinterIndependentLayout for valid values.</desc>
+ <label>Use printer independent metrics for document formatting</label>
+ </info>
+ <value>2</value>
+ </prop>
+ </group>
+ <group oor:name="DefaultObjectSize">
+ <!-- OldPath: -->
+ <!-- OldLocation: -->
+ <!-- UIHints: Default size for newly created objects when using CTRL-Return or CTRL-Klick -->
+ <info>
+ <author>AW</author>
+ <desc>Defines the default size of newly created objects using CTRL-Return or CTRL-Click at a object creating Button.</desc>
+ <label>Default Object Size</label>
+ </info>
+ <prop oor:name="Width" oor:type="xs:int">
+ <info>
+ <desc>[UNIT=1/100 mm]</desc>
+ <label/>
+ </info>
+ <value>8000</value>
+ </prop>
+ <prop oor:name="Height" oor:type="xs:int">
+ <info>
+ <desc>[UNIT=1/100 mm]</desc>
+ <label/>
+ </info>
+ <value>5000</value>
+ </prop>
+ </group>
+ </group>
+ <group oor:name="Snap">
+ <info>
+ <desc>Specifies how to force object positions and sizes to the snap grid or to align with other objects.</desc>
+ </info>
+ <group oor:name="Object">
+ <info>
+ <desc>Specifies how to force object positions and sizes to predefined locations in relation to other objects.</desc>
+ </info>
+ <prop oor:name="Grid" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Snap/Objects -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap to -->
+ <info>
+ <desc>Indicates whether to snap an object when moved to the next grid point.</desc>
+ <label>Grid lines</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="SnapLine" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Snap/Objects -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap to -->
+ <info>
+ <desc>Indicates whether to snap at snap lines.</desc>
+ <label>Snap lines</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="PageMargin" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Snap/Objects -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap to -->
+ <info>
+ <desc>Indicates whether the outline of an object is justified with adjacent page margins.</desc>
+ <label>Page margins</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="ObjectFrame" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Snap/Objects -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap to -->
+ <info>
+ <desc>Indicates whether to justify the outline of an object to that of an adjacent object.</desc>
+ <label>Object frame</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="ObjectPoint" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Snap/Objects -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap to -->
+ <info>
+ <desc>Indicates whether to snap corner points of adjacent objects.</desc>
+ <label>Object points</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="Range" oor:type="xs:int">
+ <!-- OldPath: Impress/Snap/Objects -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap to -->
+ <info>
+ <desc>Specifies the maximal range in pixels along the coordinate axes at which snapping becomes active.</desc>
+ <label>Snap range</label>
+ </info>
+ <constraints>
+ <minInclusive oor:value="1">
+ <info>
+ <desc>Specifies that the minimum snap range is 1.</desc>
+ </info>
+ </minInclusive>
+ <maxInclusive oor:value="50">
+ <info>
+ <desc>Specifies that the maximal snap range is 50.</desc>
+ </info>
+ </maxInclusive>
+ </constraints>
+ <value>5</value>
+ </prop>
+ </group>
+ <group oor:name="Position">
+ <info>
+ <desc>Specifies constraints regarding the creation and modification of graphical objects.</desc>
+ </info>
+ <prop oor:name="CreatingMoving" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Snap/Position -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap position -->
+ <info>
+ <desc>Indicates whether to restrict the creation of objects to squares, circles, etc. and to retain the x/y ratio when resizing.</desc>
+ <label>When creating or moving objects</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="ExtendEdges" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Snap/Position -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap position -->
+ <info>
+ <desc>Indicates whether to use the longer (true) or the shorter (false) of the two distances along the coordinates axes from the initial to the current position to determine a new square&apos;s edge length or a new circle&apos;s diameter.</desc>
+ <label>Extend edges</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="Rotating" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Snap/Position -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap position -->
+ <info>
+ <desc>Indicates whether to use snapping while rotating an object.</desc>
+ <label>When rotating</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="RotatingValue" oor:type="xs:int">
+ <!-- OldPath: Impress/Snap/Position -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap position -->
+ <info>
+ <desc>Specifies the rotation angle when snapping for rotation is enabled. [UNIT=Degree/100]</desc>
+ <label>When rotating</label>
+ </info>
+ <constraints>
+ <minInclusive oor:value="0">
+ <info>
+ <desc>Specifies that the minimum rotation angle is 0/100 degrees.</desc>
+ </info>
+ </minInclusive>
+ <maxInclusive oor:value="18000">
+ <info>
+ <desc>Specifies that the maximum rotation angle is 18000/100 degrees.</desc>
+ </info>
+ </maxInclusive>
+ </constraints>
+ <value>1500</value>
+ </prop>
+ <prop oor:name="PointReduction" oor:type="xs:int">
+ <!-- OldPath: Impress/Snap/Position -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Snap to Grid - [Section] Snap position -->
+ <info>
+ <desc>Specifies the maximum angle that you can move a line before it snaps into place in the point editor that connects two points [UNIT=Degree/100].</desc>
+ <label>Point reduction</label>
+ </info>
+ <constraints>
+ <minInclusive oor:value="100">
+ <info>
+ <desc>Specifies that the minimum angle is 100/100 degrees.</desc>
+ </info>
+ </minInclusive>
+ <maxInclusive oor:value="9000">
+ <info>
+ <desc>Specifies that the maximum angle is 9000/100 degrees.</desc>
+ </info>
+ </maxInclusive>
+ </constraints>
+ <value>1500</value>
+ </prop>
+ </group>
+ </group>
+ <group oor:name="Grid">
+ <info>
+ <desc>Defines the handling and display of the snap grid.</desc>
+ </info>
+ <group oor:name="Option">
+ <info>
+ <desc>Specifies switches regarding use and display of the snap grid.</desc>
+ </info>
+ <prop oor:name="SnapToGrid" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Grid/Options -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Grid - [Section] Options -->
+ <info>
+ <desc>Indicates whether to force frames and drawing elements on grid points.</desc>
+ <label>Snap to grid</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="VisibleGrid" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Grid/Options -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Grid - [Section] Options -->
+ <info>
+ <desc>Indicates whether to show the grid.</desc>
+ <label>Visible grid</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="Synchronize" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Grid/Options -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Grid - [Section] Options -->
+ <info>
+ <desc>Indicates whether to synchronize the resolutions of x- and y-grids.</desc>
+ <label>Synchronize axes</label>
+ </info>
+ <value>false</value>
+ </prop>
+ </group>
+ <group oor:name="Resolution">
+ <info>
+ <desc>Specifies grid resolution.</desc>
+ </info>
+ <group oor:name="XAxis">
+ <!-- OldPath: Impress/Grid/Resolution -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Grid - [Section] Grid -->
+ <!-- Notice: Default-nonmetrical value: 1270 1/100 mm. -->
+ <info>
+ <desc>Defines the horizontal distance between adjacent grid points.</desc>
+ <label>X Axis Resolution</label>
+ </info>
+ <prop oor:name="Metric" oor:type="xs:int">
+ <info>
+ <desc>Defines the horizontal distance between adjacent grid points in 1/100 mm, used when the metric system is active.</desc>
+ <label/>
+ </info>
+ <value>1000</value>
+ </prop>
+ <prop oor:name="NonMetric" oor:type="xs:int">
+ <info>
+ <desc>Defines the horizontal distance between adjacent grid points in 1/100 mm, used when the non-metric system is active.</desc>
+ <label/>
+ </info>
+ <value>1270</value>
+ </prop>
+ </group>
+ <group oor:name="YAxis">
+ <!-- OldPath: Impress/Grid/Resolution -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Grid - [Section] Grid -->
+ <!-- Notice: Default- nonmerical value: 1270 1/100 mm. -->
+ <info>
+ <desc>Defines the vertical distance between adjacent grid points.</desc>
+ <label>Y Axis Resolution</label>
+ </info>
+ <prop oor:name="Metric" oor:type="xs:int">
+ <info>
+ <desc>Defines the vertical distance between adjacent grid points in 1/100 mm, used when the metric system is active.</desc>
+ <label/>
+ </info>
+ <value>1000</value>
+ </prop>
+ <prop oor:name="NonMetric" oor:type="xs:int">
+ <info>
+ <desc>Defines the vertical distance between adjacent grid points in 1/100 mm, used when the non-metric system is active.</desc>
+ <label/>
+ </info>
+ <value>1270</value>
+ </prop>
+ </group>
+ </group>
+ <group oor:name="Subdivision">
+ <info>
+ <desc>Specifies the subdivision of the grid.</desc>
+ </info>
+ <prop oor:name="XAxis" oor:type="xs:double">
+ <!-- OldPath: Impress/Grid/Subdivision -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Grid - [Section] Grid -->
+ <!-- Notice: Default value for English Version only: 254 Points) -->
+ <info>
+ <desc>Specifies the number of points between two adjacent grid points on the X axis.</desc>
+ <label>X Axis Subdivision</label>
+ </info>
+ <value>1</value>
+ </prop>
+ <prop oor:name="YAxis" oor:type="xs:double">
+ <!-- OldPath: Impress/Grid/Subdivision -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Grid - [Section] Grid -->
+ <!-- Notice: Default value for English Version only: 254 Points) -->
+ <info>
+ <desc>Specifies the number of intervals between two adjacent grid points on the Y axis</desc>
+ <label>Y Axis Subdivision</label>
+ </info>
+ <value>1</value>
+ </prop>
+ </group>
+ <group oor:name="SnapGrid">
+ <info>
+ <desc>Contains the specifications of the snap grid.</desc>
+ </info>
+ <prop oor:name="Size" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Grid/Snap_Grid -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Grid - [Section] Snap grid -->
+ <info>
+ <desc>Indicates whether to synchronize grid and snap-grid.</desc>
+ <label>Size to grid</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <group oor:name="XAxis">
+ <!-- OldPath: Impress/Grid/Snap_Grid -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Grid - [Section] Snap grid -->
+ <!-- Notice: Default-nonmetrical value: 1270 1/100 mm. -->
+ <info>
+ <desc>Defines the horizontal distance between adjacent points of the snap grid.</desc>
+ <label>X axis</label>
+ </info>
+ <prop oor:name="Metric" oor:type="xs:int">
+ <info>
+ <desc>Defines the horizontal distance between adjacent points of the snap grid in 1/100 mm, used when the metric system is selected.</desc>
+ <label/>
+ </info>
+ <value>1000</value>
+ </prop>
+ <prop oor:name="NonMetric" oor:type="xs:int">
+ <info>
+ <desc>Defines the horizontal distance between adjacent points of the snap grid in 1/100 mm, used when the non-metric system is selected.</desc>
+ <label/>
+ </info>
+ <value>1270</value>
+ </prop>
+ </group>
+ <group oor:name="YAxis">
+ <!-- OldPath: Impress/Grid/Snap_Grid -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Grid - [Section] Snap grid -->
+ <!-- Notice: Default-Default-nonmetrical value: 1270 1/100 mm. -->
+ <info>
+ <desc>Defines the vertical distance between adjacent points of the snap grid.</desc>
+ <label>Y axis</label>
+ </info>
+ <prop oor:name="Metric" oor:type="xs:int">
+ <info>
+ <desc>Defines the vertical distance between adjacent points of the snap grid in 1/100 mm, used when the metric system is selected.</desc>
+ <label/>
+ </info>
+ <value>1000</value>
+ </prop>
+ <prop oor:name="NonMetric" oor:type="xs:int">
+ <info>
+ <desc>Defines the vertical distance between adjacent points of the snap grid in 1/100 mm, used when the non-metric system is selected.</desc>
+ <label/>
+ </info>
+ <value>1270</value>
+ </prop>
+ </group>
+ </group>
+ </group>
+ <group oor:name="Print">
+ <info>
+ <desc>Defines options regarding the printing of Impress documents.</desc>
+ </info>
+ <group oor:name="Content">
+ <info>
+ <desc>Defines options regarding the printing of document content.</desc>
+ </info>
+ <prop oor:name="Presentation" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Print/Contents -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Print - [Section] Contents -->
+ <info>
+ <desc>Indicates whether the presentation will be printed.</desc>
+ <label>Presentation</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="Note" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Print/Contents -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Print - [Section] Contents -->
+ <info>
+ <desc>Indicates whether the notes will be printed.</desc>
+ <label>Notes</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="Handout" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Print/Contents -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Print - [Section] Contents -->
+ <info>
+ <desc>Indicates whether the handouts will be printed.</desc>
+ <label>Handouts</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="Outline" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Print/Contents -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Print - [Section] Contents -->
+ <info>
+ <desc>Indicates whether the outlines will be printed.</desc>
+ <label>Outline</label>
+ </info>
+ <value>false</value>
+ </prop>
+ </group>
+ <group oor:name="Page">
+ <info>
+ <desc>Specifies how and which pages will be printed.</desc>
+ </info>
+ <prop oor:name="PageSize" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Print/Page -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Print - [Section] Page options -->
+ <info>
+ <desc>Indicates whether to enlarge or shrink a document&apos;s page size while printing to fit the physical paper size.</desc>
+ <label>Fit to page</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="PageTile" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Print/Page -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Print - [Section] Page options -->
+ <info>
+ <desc>Indicates whether to print the pages&apos; titles at the top of every page.</desc>
+ <label>Tile pages</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="Booklet" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Print/Page -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Print - [Section] Page options -->
+ <info>
+ <desc>Indicates whether to print a document in the form of a brochure.</desc>
+ <label>Brochure</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="BookletFront" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Print/Page -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Print - [Section] Page options -->
+ <info>
+ <desc>Indicates whether to print the front side pages of a brochure.</desc>
+ <label>Front side</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="BookletBack" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Print/Page -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Print - [Section] Page options -->
+ <info>
+ <desc>Indicates whether to print the back side pages of a brochure.</desc>
+ <label>Back side</label>
+ </info>
+ <value>true</value>
+ </prop>
+ </group>
+ <group oor:name="Other">
+ <info>
+ <desc>Specifies general printing related issues.</desc>
+ </info>
+ <prop oor:name="PageName" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Print -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Print - [Section] Print -->
+ <info>
+ <desc>Indicates whether to print page names.</desc>
+ <label>Page name</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="Date" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Print -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Print - [Section] Print -->
+ <info>
+ <desc>Indicates whether to print the current date at the top of every page.</desc>
+ <label>Date</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="Time" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Print -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Print - [Section] Print -->
+ <info>
+ <desc>Indicates whether to print the current time at the top of every page.</desc>
+ <label>Time</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="HiddenPage" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Print -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Print - [Section] Print -->
+ <info>
+ <desc>Indicates whether to print hidden pages.</desc>
+ <label>Hidden pages</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="Quality" oor:type="xs:int">
+ <!-- OldPath: Impress/Print -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Print - [Section] Quality -->
+ <info>
+ <desc>Specifies the quality of the printed colors.</desc>
+ </info>
+ <constraints>
+ <enumeration oor:value="0">
+ <info>
+ <desc>Color</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="1">
+ <info>
+ <desc>Grayscale</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="2">
+ <info>
+ <desc>Black/White</desc>
+ </info>
+ </enumeration>
+ </constraints>
+ <value>0</value>
+ </prop>
+ <prop oor:name="FromPrinterSetup" oor:type="xs:boolean">
+ <!-- OldPath: Impress/Print -->
+ <!-- OldLocation: Soffice.cfg -->
+ <!-- UIHints: Tools - Options - Presentation Print [Check box] From printer setup -->
+ <info>
+ <desc>Indicates whether to use the system settings of the printer to choose the paper tray.</desc>
+ <label>From printer setup</label>
+ </info>
+ <value>false</value>
+ </prop>
<prop oor:name="HandoutHorizontal" oor:type="xs:boolean">
<!-- UIHints: File - Print - [Section] Print content - [Radio buttons] Horizontal(TRUE)/Vertical(FALSE) -->
<info>
@@ -1179,7 +1188,8 @@
<label>Handout orientation</label>
</info>
<value>false</value>
- </prop> <prop oor:name="PagesPerHandout" oor:type="xs:int">
+ </prop>
+ <prop oor:name="PagesPerHandout" oor:type="xs:int">
<!-- UIHints: File - Print - [Section] Print content - [ListBox] Slides per page -->
<info>
<desc>Specifies the number of slide thumbnails printed on each handout page.</desc>
@@ -1219,274 +1229,292 @@
</constraints>
<value>0</value>
</prop>
- </group>
- </group>
- <group oor:name="Filter">
- <info>
- <desc>Contains the group of options that control the behavior of filters.</desc>
- <label>Filter Options</label>
- </info>
- <group oor:name="Import">
- <info>
- <desc>Contains the group of options that control the behavior of the import filters.</desc>
- <label>Import Filter</label>
- </info>
- <group oor:name="VBA">
- <info>
- <desc>Contains the group of options that control the behavior of the VBA filter.</desc>
- <label>VBA Filter</label>
- </info>
- <prop oor:name="Load" oor:type="xs:boolean">
- <!-- OldPath: Filter/MS_Office/Basic/PowerPoint -->
- <!-- OldLocation: soffice.cfg -->
- <!-- UIHints: Tools Options - Filter Settings Microsoft Office [Section] Microsoft PowerPoint 97/2000 -->
- <info>
- <author>OS</author>
- <desc>Converts VBA Basic into Office Basic as commands (True).</desc>
- <label>Load Basic Code to edit</label>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="Save" oor:type="xs:boolean">
- <!-- OldPath: Filter/MS_Office/Basic/PowerPoint -->
- <!-- OldLocation: soffice.cfg -->
- <!-- UIHints: Tools Options - Filter Settings Microsoft Office [Section] Microsoft PowerPoint 97/2000 -->
- <info>
- <author>OS</author>
- <desc>Holds original VBA storage for saving in the memory (True).</desc>
- <label>Save Original Basic Code again</label>
- </info>
- <value>true</value>
- </prop>
- </group>
- </group>
- <group oor:name="Export">
- <info>
- <desc>Exports related configuration items.</desc>
- </info>
- <prop oor:name="LastUsed" oor:type="xs:string">
- <!-- OldPath: STARIMPRESS -->
- <!-- OldLocation: soffice.ini -->
- <!-- UIHints: Set after export -->
- <info>
- <desc>Specifies the filter last used to export an Impress document.</desc>
- </info>
- <constraints>
- <enumeration oor:value="HTML">
- <info>
- <desc>HTML</desc>
- </info>
- </enumeration>
- <enumeration oor:value="BMP - MS Windows">
- <info>
- <desc>MS Windows bitmap</desc>
- </info>
- </enumeration>
- <enumeration oor:value="PNG - Portable Network Graphic">
- <info>
- <desc>Portable Network Graphic</desc>
- </info>
- </enumeration>
- <enumeration oor:value="EPS - Encapsulated PostScript">
- <info>
- <desc>Encapsulated PostScript</desc>
- </info>
- </enumeration>
- <enumeration oor:value="GIF - Graphic Interchange">
- <info>
- <desc>Graphic Interchange Format</desc>
- </info>
- </enumeration>
- <enumeration oor:value="JPG - JPEG">
- <info>
- <desc>JPEG</desc>
- </info>
- </enumeration>
- <enumeration oor:value="MET - OS/2 Metafile">
- <info>
- <desc>OS/2 Metafile</desc>
- </info>
- </enumeration>
- <enumeration oor:value="PCT - Mac Pict">
- <info>
- <desc>Mac Pict</desc>
- </info>
- </enumeration>
- <enumeration oor:value="PBM - Portable Bitmap">
- <info>
- <desc>Portable Bitmap</desc>
- </info>
- </enumeration>
- <enumeration oor:value="PGM - Portable Graymap">
- <info>
- <desc>Portable Graymap</desc>
- </info>
- </enumeration>
- <enumeration oor:value="PPM - Portable Pixelmap">
- <info>
- <desc>Portable Pixelmap</desc>
- </info>
- </enumeration>
- <enumeration oor:value="RAS - Sun Rasterfile">
- <info>
- <desc>Sun Rasterfile</desc>
- </info>
- </enumeration>
- <enumeration oor:value="SVM - StarView Metafile">
- <info>
- <desc>StarView Metafile</desc>
- </info>
- </enumeration>
- <enumeration oor:value="WMF - MS Windows Metafile">
- <info>
- <desc>MS Windows Metafile</desc>
- </info>
- </enumeration>
- <enumeration oor:value="XPM">
- <info>
- <desc>XPM</desc>
- </info>
- </enumeration>
- </constraints>
- </prop>
- </group>
- </group>
- <group oor:name="MultiPaneGUI">
+ </group>
+ </group>
+ <group oor:name="Filter">
+ <info>
+ <desc>Contains the group of options that control the behavior of filters.</desc>
+ <label>Filter Options</label>
+ </info>
+ <group oor:name="Import">
+ <info>
+ <desc>Contains the group of options that control the behavior of the import filters.</desc>
+ <label>Import Filter</label>
+ </info>
+ <group oor:name="VBA">
+ <info>
+ <desc>Contains the group of options that control the behavior of the VBA filter.</desc>
+ <label>VBA Filter</label>
+ </info>
+ <prop oor:name="Load" oor:type="xs:boolean">
+ <!-- OldPath: Filter/MS_Office/Basic/PowerPoint -->
+ <!-- OldLocation: soffice.cfg -->
+ <!-- UIHints: Tools Options - Filter Settings Microsoft Office [Section] Microsoft PowerPoint 97/2000 -->
+ <info>
+ <author>OS</author>
+ <desc>Converts VBA Basic into Office Basic as commands (True).</desc>
+ <label>Load Basic Code to edit</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="Save" oor:type="xs:boolean">
+ <!-- OldPath: Filter/MS_Office/Basic/PowerPoint -->
+ <!-- OldLocation: soffice.cfg -->
+ <!-- UIHints: Tools Options - Filter Settings Microsoft Office [Section] Microsoft PowerPoint 97/2000 -->
+ <info>
+ <author>OS</author>
+ <desc>Holds original VBA storage for saving in the memory (True).</desc>
+ <label>Save Original Basic Code again</label>
+ </info>
+ <value>true</value>
+ </prop>
+ </group>
+ </group>
+ <group oor:name="Export">
+ <info>
+ <desc>Exports related configuration items.</desc>
+ </info>
+ <prop oor:name="LastUsed" oor:type="xs:string">
+ <!-- OldPath: STARIMPRESS -->
+ <!-- OldLocation: soffice.ini -->
+ <!-- UIHints: Set after export -->
+ <info>
+ <desc>Specifies the filter last used to export an Impress document.</desc>
+ </info>
+ <constraints>
+ <enumeration oor:value="HTML">
+ <info>
+ <desc>HTML</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="BMP - MS Windows">
+ <info>
+ <desc>MS Windows bitmap</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="PNG - Portable Network Graphic">
+ <info>
+ <desc>Portable Network Graphic</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="EPS - Encapsulated PostScript">
+ <info>
+ <desc>Encapsulated PostScript</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="GIF - Graphic Interchange">
+ <info>
+ <desc>Graphic Interchange Format</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="JPG - JPEG">
+ <info>
+ <desc>JPEG</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="MET - OS/2 Metafile">
+ <info>
+ <desc>OS/2 Metafile</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="PCT - Mac Pict">
+ <info>
+ <desc>Mac Pict</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="PBM - Portable Bitmap">
+ <info>
+ <desc>Portable Bitmap</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="PGM - Portable Graymap">
+ <info>
+ <desc>Portable Graymap</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="PPM - Portable Pixelmap">
+ <info>
+ <desc>Portable Pixelmap</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="RAS - Sun Rasterfile">
+ <info>
+ <desc>Sun Rasterfile</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="SVM - StarView Metafile">
+ <info>
+ <desc>StarView Metafile</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="WMF - MS Windows Metafile">
+ <info>
+ <desc>MS Windows Metafile</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="XPM">
+ <info>
+ <desc>XPM</desc>
+ </info>
+ </enumeration>
+ </constraints>
+ </prop>
+ </group>
+ </group>
+ <group oor:name="MultiPaneGUI">
+ <info>
+ <desc>Options that control the content and appearance of the multi pane GUI.</desc>
+ <label>Multi Pane GUI Options</label>
+ </info>
+ <group oor:name="ToolPanel">
+ <info>
+ <desc>Options that control the tool panel.</desc>
+ <label>Tool Panel Options</label>
+ </info>
+ <set oor:name="RecentlyUsedMasterPages" oor:node-type="MasterPageDescriptor">
+ <info>
+ <desc>List of the URLs of the most recently used master pages.</desc>
+ <label>Recently Used Master Pages</label>
+ </info>
+ </set>
+ </group>
+ <group oor:name="Framework">
+ <info>
+ <desc>Options that control the multi pane framework.</desc>
+ <label>Multi Pane Framework Options</label>
+ </info>
+ <set oor:name="ResourceFactories" oor:node-type="ResourceFactory">
+ <info>
+ <desc>Set of factories and the resources created by them.</desc>
+ <label>Multi Pane Framework Resource Factories</label>
+ </info>
+ </set>
+ <set oor:name="StartupServices" oor:node-type="StartupService">
+ <info>
+ <desc>
+ Set of services that are instantiated every time the
+ framework of a Draw or Impress document is initialized.
+ </desc>
+ <label>Multi Pane Framework Startup Services</label>
+ </info>
+ </set>
+ </group>
+ <group oor:name="SlideSorter">
+ <info>
+ <desc>Values related to the slide sorter.</desc>
+ <label>Slide Sorter Options</label>
+ </info>
+ <group oor:name="PreviewCache">
+ <info>
+ <desc>Values for tuning the preview cache of the slide sorter.</desc>
+ <label>Preview Cache Options</label>
+ </info>
+ <prop oor:name="CacheSize" oor:type="xs:int">
+ <info>
+ <desc>
+ Maximal size of the cache that stores slide
+ preview bitmaps. This size does only cover
+ previews of slides that are not currently
+ visible. Depending on the compression policy
+ this upper bound may be violated.
+ </desc>
+ <label>Preview Cache Size</label>
+ </info>
+ <value>4194304</value>
+ </prop>
+ <prop oor:name="CompactionPolicy" oor:type="xs:string">
<info>
- <desc>Options that control the content and appearance of the multi pane GUI.</desc>
- <label>Multi Pane GUI Options</label>
+ <desc>Technique of how to reduce the memory used by the cache.</desc>
+ <label>Compaction Policy</label>
</info>
- <group oor:name="ToolPanel">
+ <constraints>
+ <enumeration oor:value="None">
<info>
- <desc>Options that control the tool panel.</desc>
- <label>Tool Panel Options</label>
+ <desc>Ignore the maximal cache size.</desc>
</info>
- <set oor:name="RecentlyUsedMasterPages" oor:node-type="MasterPageDescriptor">
- <info>
- <desc>List of the URLs of the most recently used master pages.</desc>
- <label>Recently Used Master Pages</label>
- </info>
- </set>
- </group>
- <group oor:name="Framework">
+ </enumeration>
+ <enumeration oor:value="Compress">
<info>
- <desc>Options that control the multi pane framework.</desc>
- <label>Multi Pane Framework Options</label>
+ <desc>
+ Use the compression policy to compress preview bitmaps
+ that are not visible.
+ </desc>
</info>
- <set oor:name="ResourceFactories" oor:node-type="ResourceFactory">
- <info>
- <desc>Set of factories and the resources created by them.</desc>
- <label>Multi Pane Framework Resource Factories</label>
- </info>
- </set>
- <set oor:name="StartupServices" oor:node-type="StartupService">
- <info>
- <desc>Set of services that are instantiated every time the
- framework of a Draw or Impress document is initialized.</desc>
- <label>Multi Pane Framework Startup Services</label>
- </info>
- </set>
- </group>
- <group oor:name="SlideSorter">
+ </enumeration>
+ </constraints>
+ <value>Compress</value>
+ </prop>
+ <prop oor:name="CompressionPolicy" oor:type="xs:string">
+ <info>
+ <desc>
+ Technique of how to compress preview bitmaps for
+ slides that are moved out of the visible area in
+ order to save cache space.
+ </desc>
+ <label>Compression Policy</label>
+ </info>
+ <constraints>
+ <enumeration oor:value="None">
+ <info>
+ <desc>
+ Keep bitmaps unmodified in cache. This effectively
+ ignores the maximal cache size.
+ </desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="Erase">
+ <info>
+ <desc>Remove preview from cache</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="ResolutionReduction">
+ <info>
+ <desc>
+ Reduce the resolution to a width
+ of 100 Pixels
+ </desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="PNGCompression">
<info>
- <desc>Values related to the slide sorter.</desc>
- <label>Slide Sorter Options</label>
+ <desc>Store preview as compressed PNG bitmap</desc>
</info>
- <group oor:name="PreviewCache">
- <info>
- <desc>Values for tuning the preview cache of the slide sorter.</desc>
- <label>Preview Cache Options</label>
- </info>
- <prop oor:name="CacheSize" oor:type="xs:int">
- <info>
- <desc>Maximal size of the cache that stores slide
- preview bitmaps. This size does only cover
- previews of slides that are not currently
- visible. Depending on the compression policy
- this upper bound may be violated.</desc>
- <label>Preview Cache Size</label>
- </info>
- <value>4194304</value>
- </prop>
- <prop oor:name="CompactionPolicy" oor:type="xs:string">
- <info>
- <desc>Technique of how to reduce the memory used by the cache.</desc>
- <label>Compaction Policy</label>
- </info>
- <constraints>
- <enumeration oor:value="None">
- <info>
- <desc>Ignore the maximal cache size.</desc>
- </info>
- </enumeration>
- <enumeration oor:value="Compress">
- <info>
- <desc>Use the compression policy to compress preview bitmaps
- that are not visible.</desc>
- </info>
- </enumeration>
- </constraints>
- <value>Compress</value>
- </prop>
- <prop oor:name="CompressionPolicy" oor:type="xs:string">
- <info>
- <desc>Technique of how to compress preview bitmaps for
- slides that are moved out of the visible area in
- order to save cache space.</desc>
- <label>Compression Policy</label>
- </info>
- <constraints>
- <enumeration oor:value="None">
- <info>
- <desc>Keep bitmaps unmodified in cache. This effectively
- ignores the maximal cache size.</desc>
- </info>
- </enumeration>
- <enumeration oor:value="Erase">
- <info>
- <desc>Remove preview from cache</desc>
- </info>
- </enumeration>
- <enumeration oor:value="ResolutionReduction">
- <info>
- <desc>Reduce the resolution to a width
- of 100 Pixels</desc>
- </info>
- </enumeration>
- <enumeration oor:value="PNGCompression">
- <info>
- <desc>Store preview as compressed PNG bitmap</desc>
- </info>
- </enumeration>
- </constraints>
- <value>ResolutionReduction</value>
- </prop>
- <prop oor:name="TimeBetweenHighPriorityRequests" oor:type="xs:int">
- <info>
- <desc>Time in milli seconds to wait between processing
- preview creation requests with high priority.</desc>
- <label>Time Between High Priority Requests</label>
- </info>
- <value>10</value>
- </prop>
- <prop oor:name="TimeBetweenLowPriorityRequests" oor:type="xs:int">
- <info>
- <desc>Time in milli seconds to wait between processing
- preview creation requests with low priority.</desc>
- <label>Time Between Low Priority Requests</label>
- </info>
- <value>100</value>
- </prop>
- <prop oor:name="TimeBetweenRequestsDuringShow" oor:type="xs:int">
- <info>
- <desc>Time in milli seconds to wait between processing
- preview creation requestsest when show is running.</desc>
- <label>Time Between Requests During Show</label>
- </info>
- <value>1000</value>
- </prop>
- </group>
- </group>
- </group>
- </component>
+ </enumeration>
+ </constraints>
+ <value>ResolutionReduction</value>
+ </prop>
+ <prop oor:name="TimeBetweenHighPriorityRequests" oor:type="xs:int">
+ <info>
+ <desc>
+ Time in milli seconds to wait between processing
+ preview creation requests with high priority.
+ </desc>
+ <label>Time Between High Priority Requests</label>
+ </info>
+ <value>10</value>
+ </prop>
+ <prop oor:name="TimeBetweenLowPriorityRequests" oor:type="xs:int">
+ <info>
+ <desc>
+ Time in milli seconds to wait between processing
+ preview creation requests with low priority.
+ </desc>
+ <label>Time Between Low Priority Requests</label>
+ </info>
+ <value>100</value>
+ </prop>
+ <prop oor:name="TimeBetweenRequestsDuringShow" oor:type="xs:int">
+ <info>
+ <desc>
+ Time in milli seconds to wait between processing
+ preview creation requestsest when show is running.
+ </desc>
+ <label>Time Between Requests During Show</label>
+ </info>
+ <value>1000</value>
+ </prop>
+ </group>
+ </group>
+ </group>
+ </component>
</oor:component-schema>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Linguistic.xcs b/officecfg/registry/schema/org/openoffice/Office/Linguistic.xcs
index 220d94c89da6..8762f839b781 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Linguistic.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Linguistic.xcs
@@ -121,6 +121,31 @@
<label>Spell and grammar context menu dictionary image</label>
</info>
</prop>
+ <prop oor:name="ThesaurusDialogImage" oor:type="xs:string">
+ <info>
+ <desc>The path to the image for the thesaurus dialog.</desc>
+ <label>Thesaurus dialog image</label>
+ </info>
+ </prop>
+ <prop oor:name="ThesaurusDialogImage_HC" oor:type="xs:string">
+ <info>
+ <desc>The path to the image for the thesaurus dialog in high contrast mode.</desc>
+ <label>Thesaurus dialog image</label>
+ </info>
+ </prop>
+ <prop oor:name="SynonymsContextMenuImage" oor:type="xs:string">
+ <info>
+ <desc>The path to the image for the synonyms context menu.</desc>
+ <label>Synonyms context menu image</label>
+ </info>
+ </prop>
+ <prop oor:name="SynonymsContextMenuImage_HC" oor:type="xs:string">
+ <info>
+ <desc>The path to the image for the synonyms context menu in high contrast mode.</desc>
+ <label>Synonyms context menu image</label>
+ </info>
+ </prop>
+
</group>
<group oor:name="GrammarCheckerEntry">
@@ -227,7 +252,7 @@
<desc>Specifies the custom dictionaries to be used. The Ignore list (IgnoreAllList (All)) is administered in the RAM only for the current spellcheck.</desc>
<label>Custom dictionaries</label>
</info>
- <value oor:separator=";">IgnoreAllList;soffice.dic;standard.dic;sun.dic</value>
+ <value oor:separator=";">IgnoreAllList;soffice.dic;standard.dic;oracle.dic</value>
</prop>
<prop oor:name="IsUseDictionaryList" oor:type="xs:boolean">
<!-- OldLocation: NEW -->
diff --git a/officecfg/registry/schema/org/openoffice/Office/Math.xcs b/officecfg/registry/schema/org/openoffice/Office/Math.xcs
index c1f9e8aa96b2..caa8726b7c72 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Math.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Math.xcs
@@ -351,7 +351,7 @@
<prop oor:name="ToolboxVisible" oor:type="xs:boolean">
<!-- OldPath: Math/View -->
<!-- OldLocation: Soffice.cfg -->
- <!-- UIHints: View - Formula Elements -->
+ <!-- UIHints: View - Elements -->
<info>
<author>TL</author>
<desc>Toggles the visibility of the ToolBox (Selection Box).</desc>
diff --git a/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs b/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs
index 7ff91464727d..7b0b221f15a9 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>1</value>
+ <value>2</value>
</prop>
<prop oor:name="InvitationAccepted" oor:type="xs:boolean">
<info>
diff --git a/officecfg/registry/schema/org/openoffice/Office/UI/Commands.xcs b/officecfg/registry/schema/org/openoffice/Office/UI/Commands.xcs
index 38ee3a2e4c4f..71efdab1b636 100644
--- a/officecfg/registry/schema/org/openoffice/Office/UI/Commands.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/UI/Commands.xcs
@@ -52,6 +52,7 @@
Bit 0 = Command has an image.
Bit 1 = Image must be mirrored (CTL/vertical text).
Bit 2 = Image must be rotated (CTL/vertical text).
+ Bit 3 = Command supports a toggle state (Accessibility).
</desc>
</info>
<value>0</value>
diff --git a/officecfg/registry/schema/org/openoffice/Office/UI/WindowState.xcs b/officecfg/registry/schema/org/openoffice/Office/UI/WindowState.xcs
index 39545cab2391..b56629aca2eb 100644
--- a/officecfg/registry/schema/org/openoffice/Office/UI/WindowState.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/UI/WindowState.xcs
@@ -95,6 +95,21 @@
<desc>Specifies the user interface element name. It is used for floating user interface elements to set the title and for the bubble help.</desc>
</info>
</prop>
+ <prop oor:name="ImageURL" oor:type="xs:string">
+ <info>
+ <desc>Specifies the URL of an image to associate with the user interface element. Any URL scheme supported by the com.sun.star.graphic.GraphicProvider service
+ is suitable here.</desc>
+ </info>
+ <value></value>
+ </prop>
+ <prop oor:name="HelpURL" oor:type="xs:string">
+ <info>
+ <desc>
+ Specifies the help URL of the tool panel.
+ </desc>
+ </info>
+ <value></value>
+ </prop>
<prop oor:name="InternalState" oor:type="xs:int">
<info>
<desc>Specifies an internal state for the user interface element. Please don't change this value it describes an internal value.</desc>
diff --git a/officecfg/registry/schema/org/openoffice/Setup.xcs b/officecfg/registry/schema/org/openoffice/Setup.xcs
index de8a64e2b0d8..76c4bb17782b 100644
--- a/officecfg/registry/schema/org/openoffice/Setup.xcs
+++ b/officecfg/registry/schema/org/openoffice/Setup.xcs
@@ -53,11 +53,6 @@
<desc>an optional uno service that is called after files and nodes have been copied in order to perform custom migration actions. The service needs to support XInitializable and XJob interfaces according do http://specs.openoffice.org/appwide/migration/spec_migration.sxw</desc>
</info>
</prop>
- <prop oor:name="ServiceConfigComponents" oor:type="oor:string-list">
- <info>
- <desc>a list of config components that are to be passed to service</desc>
- </info>
- </prop>
<prop oor:name="IncludedFiles" oor:type="oor:string-list">
<info>
<desc>a list of wildcards relative to the old userdata origin that are to be copied</desc>
@@ -160,6 +155,12 @@
<desc>Specifies the name of the standard template file for the factory.</desc>
</info>
</prop>
+ <prop oor:name="ooSetupFactorySystemDefaultTemplateChanged" oor:type="xs:boolean">
+ <!-- UIHints: setup -->
+ <info>
+ <desc>Indicates if the system default template has been changed.</desc>
+ </info>
+ </prop>
<prop oor:name="ooSetupFactoryWindowAttributes" oor:type="xs:string">
<!-- UIHints: setup -->
<info>
@@ -266,7 +267,15 @@
</info>
<value/>
</prop>
- <prop oor:name="ooSetupExtension" oor:type="xs:string">
+ <prop oor:name="ooVendor" oor:type="xs:string">
+ <info>
+ <author>IHI</author>
+ <desc>Specifies the vendor who build the product.</desc>
+ </info>
+ <value/>
+ </prop>
+
+ <prop oor:name="ooSetupExtension" oor:type="xs:string">
<info>
<desc>Specifies the version number that appears on the user interface.</desc>
</info>
diff --git a/officecfg/util/alllang.xsl b/officecfg/util/alllang.xsl
index 339c6685fa0e..dafb45c85c11 100644
--- a/officecfg/util/alllang.xsl
+++ b/officecfg/util/alllang.xsl
@@ -100,7 +100,7 @@
<xsl:if test="@xml:lang=$locale and not(@install:module)">
<xsl:copy>
<xsl:apply-templates select = "@*" mode="locale"/>
- <xsl:value-of select="."/>
+ <xsl:copy-of select="node()"/>
</xsl:copy>
</xsl:if>
</xsl:template>
@@ -275,7 +275,7 @@
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select = "@*"/>
- <xsl:value-of select="."/>
+ <xsl:copy-of select="node()"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
@@ -285,7 +285,7 @@
<xsl:if test="@xml:lang=$fallback-locale and not(@install:module)">
<xsl:copy>
<xsl:apply-templates select = "@*"/>
- <xsl:value-of select="."/>
+ <xsl:copy-of select="node()"/>
</xsl:copy>
</xsl:if>
</xsl:template>
diff --git a/officecfg/util/makefile.mk b/officecfg/util/makefile.mk
index d6c6ddf16f5c..332ac90fe2ea 100644
--- a/officecfg/util/makefile.mk
+++ b/officecfg/util/makefile.mk
@@ -41,9 +41,7 @@ $(MISC)$/$(TARGET)_delzip :
$(BIN)$/registry_{$(alllangiso)}.zip : $(MISC)$/$(TARGET)_delzip
cd $(MISC)$/registry$/res$/$(@:b:s/registry_//) && zip -ru ..$/..$/..$/..$/bin$/registry_$(@:b:s/registry_//).zip org/*
-.IF "$(USE_SHELL)"!="4nt"
$(PERL) -w $(SOLARENV)$/bin$/cleanzip.pl $@
-.ENDIF # "$(USE_SHELL)"!="4nt"
ALLTAR: \
$(MISC)$/$(TARGET)_delzip \
diff --git a/oovbaapi/genconstidl/makefile.mk b/oovbaapi/genconstidl/makefile.mk
index be9fc931f30a..078f4d09049e 100644
--- a/oovbaapi/genconstidl/makefile.mk
+++ b/oovbaapi/genconstidl/makefile.mk
@@ -34,11 +34,6 @@ PRJNAME=oovbaapi
.IF "$(L10N_framework)"==""
-.IF "$(ENABLE_VBA)"!="YES"
-dummy:
- @echo "not building vba..."
-.ENDIF
-
# symbol files of Microsoft API
MYSYMFILES = access.api vba.api adodb.api msforms.api word.api dao.api powerpoint.api excel.api stdole.api
diff --git a/oovbaapi/ooo/vba/XApplicationBase.idl b/oovbaapi/ooo/vba/XApplicationBase.idl
index b42e456bd7eb..7f59ddb75247 100644
--- a/oovbaapi/ooo/vba/XApplicationBase.idl
+++ b/oovbaapi/ooo/vba/XApplicationBase.idl
@@ -38,19 +38,27 @@
module ooo { module vba {
//=============================================================================
+
+
interface XApplicationBase
{
interface ::ooo::vba::XHelperInterface;
[attribute] boolean ScreenUpdating;
[attribute] boolean DisplayStatusBar;
+ [attribute] boolean Interactive;
[attribute, readonly] string Version;
+ //mbn
+ [attribute, readonly] any VBE;
+ [attribute, readonly] any VBProjects;
void Quit();
any CommandBars( [in] any aIndex );
void Run([in] string MacroName, [in] /*Optional*/ any varg1, [in] /*Optional*/ any varg2, [in] /*Optional*/ any varg3, [in] /*Optional*/ any varg4, [in] /*Optional*/ any varg5, [in] /*Optional*/ any varg6, [in] /*Optional*/ any varg7, [in] /*Optional*/ any varg8, [in] /*Optional*/ any varg9, [in] /*Optional*/ any varg10, [in] /*Optional*/ any varg11, [in] /*Optional*/ any varg12, [in] /*Optional*/ any varg13, [in] /*Optional*/ any varg14, [in] /*Optional*/ any varg15, [in] /*Optional*/ any varg16, [in] /*Optional*/ any varg17, [in] /*Optional*/ any varg18, [in] /*Optional*/ any varg19, [in] /*Optional*/ any varg20, [in] /*Optional*/ any varg21, [in] /*Optional*/ any varg22, [in] /*Optional*/ any varg23, [in] /*Optional*/ any varg24, [in] /*Optional*/ any varg25, [in] /*Optional*/ any varg26, [in] /*Optional*/ any varg27, [in] /*Optional*/ any varg28, [in] /*Optional*/ any varg29, [in] /*Optional*/ any varg30);
+ void OnTime( [in] any aEarliestTime, [in] string aFunction, [in] any aLatestTime, [in] any aSchedule );
float CentimetersToPoints([in] float Centimeters );
+ void Undo();
};
}; };
diff --git a/oovbaapi/ooo/vba/XCollection.idl b/oovbaapi/ooo/vba/XCollection.idl
index 60971034bb5d..63982aab36d6 100644
--- a/oovbaapi/ooo/vba/XCollection.idl
+++ b/oovbaapi/ooo/vba/XCollection.idl
@@ -52,6 +52,7 @@ interface XCollection
interface ::com::sun::star::container::XEnumerationAccess;
[attribute, readonly] long Count;
+
any Item( [in] any Index1, [in] any Index2 );
};
diff --git a/oovbaapi/ooo/vba/XCommandBarControl.idl b/oovbaapi/ooo/vba/XCommandBarControl.idl
index 2f89959cdaa0..7f20a6bf2c3f 100644
--- a/oovbaapi/ooo/vba/XCommandBarControl.idl
+++ b/oovbaapi/ooo/vba/XCommandBarControl.idl
@@ -48,6 +48,7 @@ interface XCommandBarControl
[attribute] boolean Visible;
[attribute, readonly] long Type;
[attribute] boolean Enabled;
+ [attribute] boolean BeginGroup;
void Delete() raises ( com::sun::star::script::BasicErrorException );
any Controls( [in] any Index ) raises ( com::sun::star::script::BasicErrorException );
diff --git a/oovbaapi/ooo/vba/XDocumentBase.idl b/oovbaapi/ooo/vba/XDocumentBase.idl
index 12cb931987d6..a4ee8b4366c6 100644
--- a/oovbaapi/ooo/vba/XDocumentBase.idl
+++ b/oovbaapi/ooo/vba/XDocumentBase.idl
@@ -38,6 +38,8 @@
module ooo { module vba {
//=============================================================================
+
+
interface XDocumentBase
{
interface ::ooo::vba::XHelperInterface;
@@ -46,6 +48,7 @@ interface XDocumentBase
[attribute, readonly] string Path;
[attribute, readonly] string FullName;
[attribute] boolean Saved;
+ [attribute, readonly] any VBProject; // Michael E. Bohn
void Close([in] any SaveChanges, [in] any FileName, [in] any RouteWorkBook);
void Save();
diff --git a/oovbaapi/ooo/vba/XVBAAppService.idl b/oovbaapi/ooo/vba/XVBAAppService.idl
new file mode 100755
index 000000000000..1c4a0920fbf8
--- /dev/null
+++ b/oovbaapi/ooo/vba/XVBAAppService.idl
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: XWorkbook.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_appservice_idl__
+#define __ooo_vba_appservice_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __com_sun_star_uno_XComponentContext_idl__
+#include <com/sun/star/uno/XComponentContext.idl>
+#endif
+
+#ifndef __com_sun_star_frame_XModel_idl__
+#include <com/sun/star/frame/XModel.idl>
+#endif
+
+#ifndef __com_sun_star_script_XLibraryContainer_idl__
+#include <com/sun/star/script/XLibraryContainer.idl>
+#endif
+
+//=============================================================================
+
+module ooo { module vba {
+
+//=============================================================================
+
+
+interface XHelperInterface;
+interface XComponentContext;
+interface XModel;
+
+interface XVBAAppService
+{
+ interface ::com::sun::star::uno::XInterface;
+
+ any getVBE([in] XHelperInterface xParent, [in] ::com::sun::star::uno::XComponentContext xContext, [in] ::com::sun::star::frame::XModel xModel);
+ any getVBProjects([in] XHelperInterface xParent, [in] ::com::sun::star::uno::XComponentContext xContext, [in] ::com::sun::star::frame::XModel xModel, [in] ::com::sun::star::script::XLibraryContainer xMacroLibraryContainer, [in] com::sun::star::script::XLibraryContainer xDialogLibraryContainer);
+
+
+};
+
+ }; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/XVBADocService.idl b/oovbaapi/ooo/vba/XVBADocService.idl
new file mode 100755
index 000000000000..6500f028934b
--- /dev/null
+++ b/oovbaapi/ooo/vba/XVBADocService.idl
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: XVBADocService.idl,v $
+ * $Revision: 1.4 $
+ *
+ * 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 __ooo_vba_socservice_idl__
+#define __ooo_vba_appservice_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __com_sun_star_uno_XComponentContext_idl__
+#include <com/sun/star/uno/XComponentContext.idl>
+#endif
+
+#ifndef __com_sun_star_frame_XModel_idl__
+#include <com/sun/star/frame/XModel.idl>
+#endif
+
+#ifndef __com_sun_star_script_XLibraryContainer_idl__
+#include <com/sun/star/script/XLibraryContainer.idl>
+#endif
+
+//=============================================================================
+
+module ooo { module vba {
+
+//=============================================================================
+
+
+interface XHelperInterface;
+interface XComponentContext;
+interface XModel;
+
+interface XVBADocService
+{
+ interface ::com::sun::star::uno::XInterface;
+
+
+ any getVBProject([in] XHelperInterface xParent, [in] ::com::sun::star::uno::XComponentContext xContext, [in] ::com::sun::star::frame::XModel xModel, [in] ::com::sun::star::script::XLibraryContainer xMacroLibraryContainer, [in] com::sun::star::script::XLibraryContainer xDialogLibraryContainer);
+
+
+};
+
+ }; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/constants/makefile.mk b/oovbaapi/ooo/vba/constants/makefile.mk
index a41f6e98a2ba..a731574363be 100644
--- a/oovbaapi/ooo/vba/constants/makefile.mk
+++ b/oovbaapi/ooo/vba/constants/makefile.mk
@@ -35,11 +35,6 @@ PACKAGE=org$/vba$/constants
.INCLUDE : $(PRJ)$/util$/makefile.pmk
-.IF "$(ENABLE_VBA)"!="YES"
-dummy:
- @echo "not building vba..."
-.ELSE
-
.IF "$(L10N_framework)"==""
# ------------------------------------------------------------------------
# I tried to use the IDLFILES target but it failed dismally
@@ -64,4 +59,3 @@ $(MYDBTARGET) : $(MYURDFILES) $(MYIDLFILES)
$(REGMERGE) $(OUT)$/ucr/constants.db /UCR @$(mktmp $(MYURDFILES))
.ENDIF
-.ENDIF
diff --git a/oovbaapi/ooo/vba/excel/SheetObject.idl b/oovbaapi/ooo/vba/excel/SheetObject.idl
new file mode 100755
index 000000000000..e4037e69b84d
--- /dev/null
+++ b/oovbaapi/ooo/vba/excel/SheetObject.idl
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * 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 __ooo_vba_excel_SheetObject_idl__
+#define __ooo_vba_excel_SheetObject_idl__
+
+#include <ooo/vba/excel/XCharacters.idl>
+
+//=============================================================================
+
+/* Note: This file collects all compatibility interfaces for drawing objects
+ and drawing controls embedded in sheets. All these symbols are deprecated
+ in VBA and kept for compatibility with old VBA scripts. */
+
+//=============================================================================
+
+module ooo { module vba { module excel {
+
+//=============================================================================
+
+/** Base interface for graphic objects and drawing controls in a single sheet.
+
+ <p>The objects supporting this interface are now deprecated in VBA in
+ favour of the Shapes and OLEObjects collections, but are kept for
+ compatibility with old VBA scripts. All form control objects do NOT belong
+ to ActiveX form controls but to the old-style drawing controls.</p>
+ */
+interface XSheetObject : ooo::vba::XHelperInterface
+{
+ /** Left coordinate of the drawing object, in points. */
+ [attribute] double Left;
+
+ /** Top coordinate of the drawing object, in points. */
+ [attribute] double Top;
+
+ /** Width of the drawing object, in points. */
+ [attribute] double Width;
+
+ /** Height of the drawing object, in points. */
+ [attribute] double Height;
+
+ /** The name of the drawing object, used as collection key. */
+ [attribute] string Name;
+
+ /** Name of a macro that will be executed when the drawing object is clicked. */
+ [attribute] string OnAction;
+
+ /** Anchor mode of the object (fixed or variable position and size). Must
+ be a value from <type>ooo::vba::excel::XlPlacement</type>. */
+ [attribute] long Placement;
+
+ /** True = print object, false = skip object on printing. */
+ [attribute] boolean PrintObject;
+};
+
+//=============================================================================
+
+/** Additional attributes for all drawing controls (this interface does not
+ belong to ActiveX form controls).
+ */
+interface XControlObject : com::sun::star::uno::XInterface
+{
+ [attribute] boolean AutoSize;
+};
+
+//=============================================================================
+
+/** Additional attributes for a push button drawing control (this interface
+ does not belong to ActiveX form controls).
+ */
+interface XButton : com::sun::star::uno::XInterface
+{
+ /** Visible caption of the button. */
+ [attribute] string Caption;
+
+ /** Font settings for the entire caption text. */
+ [attribute] XFont Font;
+
+ /** Horizontal alignment of the caption. */
+ [attribute] long HorizontalAlignment;
+
+ /** Vertical alignment of the caption. */
+ [attribute] long VerticalAlignment;
+
+ /** Orientation (rotation) of the text. Must be a value from
+ <type>ooo::vba::excel::XlOrientation</type>. */
+ [attribute] long Orientation;
+
+ /** Access to text and text formatting of the button caption. */
+ XCharacters Characters( [in] any aStart, [in] any aLength );
+};
+
+//=============================================================================
+
+/** Represents a drawing button control in a spreadsheet. */
+service Button
+{
+ interface XSheetObject;
+ interface XControlObject;
+ interface XButton;
+};
+
+//=============================================================================
+
+}; }; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/excel/SheetObjects.idl b/oovbaapi/ooo/vba/excel/SheetObjects.idl
new file mode 100755
index 000000000000..0339059e1231
--- /dev/null
+++ b/oovbaapi/ooo/vba/excel/SheetObjects.idl
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * 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 __ooo_vba_excel_SheetObjects_idl__
+#define __ooo_vba_excel_SheetObjects_idl__
+
+#include <ooo/vba/XCollection.idl>
+
+//=============================================================================
+
+/* Note: This file collects all compatibility interfaces for collections of
+ drawing objects and drawing controls embedded in sheets. All these symbols
+ are deprecated in VBA and kept for compatibility with old VBA scripts. */
+
+//=============================================================================
+
+module ooo { module vba { module excel {
+
+//=============================================================================
+
+/** Collections that implement this interface provide access to a specific type
+ of drawing objects in a single sheet.
+
+ <p>The following sheet symbols represent collections of graphic objects,
+ and therefore implement this interface:</p>
+ <ul><li>Buttons: push button (command button) controls,</li>
+ <li>ChartObjects: chart objects embedded in the sheet,</li>
+ <li>CheckBoxes: check box controls,</li>
+ <li>DropDowns: drop-down listbox controls,</li>
+ <li>EditBoxes: text edit controls (dialog sheets only),</li>
+ <li>GroupBoxes: group frame controls,</li>
+ <li>GroupObjects: group objects containing other child objects,</li>
+ <li>Labels: fixed text controls,</li>
+ <li>ListBoxes: plain listbox controls,</li>
+ <li>OptionButtons: option button (radio button) controls,</li>
+ <li>Ovals: simple ovals and circles,</li>
+ <li>Pictures: picture objects,</li>
+ <li>Rectangles: simple rectangle objects,</li>
+ <li>ScrollBars: scrollbar controls,</li>
+ <li>Spinners: spinner (spin button) controls,</li>
+ <li>TextBoxes: rectangle objects with embedded text.</li></ul>
+
+ <p>These symbols are now deprecated in VBA but kept for compatibility with
+ old VBA scripts. All symbols representing collections of form controls do
+ NOT belong to ActiveX form controls but to the old-style drawing controls.
+ </p>
+ */
+interface XGraphicObjects : com::sun::star::uno::XInterface
+{
+ /** Adds a new graphic object to the sheet this collection belongs to. The
+ type of the object is determined by the type of the collection.
+
+ @param fLeft Position of the left border in points (1/72 inch).
+ @param fTop Position of the top border in points (1/72 inch).
+ @param fWidth Width of the object in points (1/72 inch).
+ @param fHeight Height of the object in points (1/72 inch).
+
+ @return The created graphic object.
+ */
+ any Add( [in] any fLeft, [in] any fTop, [in] any fWidth, [in] any fHeight );
+};
+
+//=============================================================================
+
+/** Collections that implement this interface provide access to a specific type
+ of drawing objects in a single sheet.
+
+ <p>The following sheet symbols represent collections of line objects, and
+ therefore implement this interface:</p>
+ <ul><li>Arcs: arc objects, and</li>
+ <li>Lines: straight line ojects.</li></ul>
+
+ <p>These symbols are now deprecated in VBA but kept for compatibility with
+ old VBA scripts.</p>
+ */
+interface XLineObjects : com::sun::star::uno::XInterface
+{
+ /** Adds a new line object to the sheet this collection belongs to. The
+ type of the object is determined by the type of the collection.
+
+ @param fX1 Position of the first X coordinate in points (1/72 inch).
+ @param fY1 Position of the first Y coordinate in points (1/72 inch).
+ @param fX2 Position of the last X coordinate in points (1/72 inch).
+ @param fY2 Position of the last Y coordinate in points (1/72 inch).
+
+ @return The created line object.
+ */
+ any Add( [in] any fX1, [in] any fY1, [in] any fX2, [in] any fY2 );
+};
+
+//=============================================================================
+
+/** A collection providing access to all polygon objects in a single sheet.
+
+ <p>This symbol is now deprecated in VBA but kept for compatibility with old
+ VBA scripts.</p>
+ */
+interface XDrawings : com::sun::star::uno::XInterface
+{
+ /** Adds a new polygon object to the sheet this collection belongs to.
+
+ @param fX1 Position of the first X coordinate in points (1/72 inch).
+ @param fY1 Position of the first Y coordinate in points (1/72 inch).
+ @param fX2 Position of the last X coordinate in points (1/72 inch).
+ @param fY2 Position of the last Y coordinate in points (1/72 inch).
+ @param bClosed True = outline closed (last and first point connected).
+
+ @return The created polygon object.
+ */
+ any Add( [in] any fX1, [in] any fY1, [in] any fX2, [in] any fY2, [in] any bClosed );
+};
+
+//=============================================================================
+
+/** Represents the collection of drawing button controls in a spreadsheet. */
+service Buttons
+{
+ interface ooo::vba::XCollection;
+ interface XGraphicObjects;
+};
+
+//=============================================================================
+
+}; }; };
+
+#endif
diff --git a/oovbaapi/ooo/vba/excel/XApplication.idl b/oovbaapi/ooo/vba/excel/XApplication.idl
index 1a29a0d0c459..39693a37511c 100644
--- a/oovbaapi/ooo/vba/excel/XApplication.idl
+++ b/oovbaapi/ooo/vba/excel/XApplication.idl
@@ -27,17 +27,10 @@
#ifndef __ooo_vba_excel_XApplication_idl__
#define __ooo_vba_excel_XApplication_idl__
-#ifndef __com_sun_star_uno_XInterface_idl__
-#include <com/sun/star/uno/XInterface.idl>
-#endif
-
-#ifndef __ooo_vba_XHelperInterface_idl__
+#include <com/sun/star/beans/XExactName.idl>
+#include <com/sun/star/script/XInvocation.idl>
#include <ooo/vba/XHelperInterface.idl>
-#endif
-
-#ifndef __ooo_vba_XAssistant_idl__
#include <ooo/vba/XAssistant.idl>
-#endif
module ooo { module vba { module excel {
@@ -49,8 +42,11 @@ interface XWorksheetFunction;
interface XWindow;
interface XWorksheet;
-interface XApplication : com::sun::star::uno::XInterface
+interface XApplication
{
+ // Application serves as WorksheetFunction object with little differences
+ interface ::com::sun::star::beans::XExactName;
+ interface ::com::sun::star::script::XInvocation;
// interface ::ooo::vba::XHelperInterface;
@@ -61,10 +57,6 @@ interface XApplication : com::sun::star::uno::XInterface
[attribute, readonly] XWorksheet ActiveSheet;
[attribute, readonly] ooo::vba::XAssistant Assistant;
[attribute] long Calculation;
- //#TODO #FIXME this is more of a placeholder, will return
- // the value of activeworkbook, in xl 'ThisWorkbook' should return the
- // workbook in which the 'calling' macro is running. Should be possible
- // to determine this
[attribute, readonly] XWorkbook ThisWorkbook;
[attribute, readonly] string Name;
[attribute] boolean DisplayAlerts;
@@ -90,8 +82,7 @@ interface XApplication : com::sun::star::uno::XInterface
any Range( [in] any Cell1, [in] any Cell2 );
any Names( [in] any Index );
void GoTo( [in] any Reference, [in] any Scroll );
- // #FIXME #TODO up to 30 args needed
- double CountA( [in] any arg1 );
+
void wait( [in] double time );
void Calculate() raises(com::sun::star::script::BasicErrorException);
XRange Intersect([in] XRange Arg1, [in] XRange Arg2, [in] /*Optional*/ any Arg3, [in] /*Optional*/ any Arg4, [in] /*Optional*/ any Arg5, [in] /*Optional*/ any Arg6, [in] /*Optional*/ any Arg7, [in] /*Optional*/ any Arg8, [in] /*Optional*/ any Arg9, [in] /*Optional*/ any Arg10, [in] /*Optional*/ any Arg11, [in] /*Optional*/ any Arg12, [in] /*Optional*/ any Arg13, [in] /*Optional*/ any Arg14, [in] /*Optional*/ any Arg15, [in] /*Optional*/ any Arg16, [in] /*Optional*/ any Arg17, [in] /*Optional*/ any Arg18, [in] /*Optional*/ any Arg19, [in] /*Optional*/ any Arg20, [in] /*Optional*/ any Arg21, [in] /*Optional*/ any Arg22, [in] /*Optional*/ any Arg23, [in] /*Optional*/ any Arg24, [in] /*Optional*/ any Arg25, [in] /*Optional*/ any Arg26, [in] /*Optional*/ any Arg27, [in] /*Optional*/ any Arg28, [in] /*Optional*/ any Arg29, [in] /*Optional*/ any Arg30)
diff --git a/oovbaapi/ooo/vba/excel/XComment.idl b/oovbaapi/ooo/vba/excel/XComment.idl
index 9f333cfd9542..8b811f31cc41 100644
--- a/oovbaapi/ooo/vba/excel/XComment.idl
+++ b/oovbaapi/ooo/vba/excel/XComment.idl
@@ -27,15 +27,8 @@
#ifndef __ooo_vba_excel_XComment_idl__
#define __ooo_vba_excel_XComment_idl__
-#ifndef __com_sun_star_uno_XInterface_idl__
-#include <com/sun/star/uno/XInterface.idl>
-#endif
-#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
-#include <com/sun/star/lang/IllegalArgumentException.idl>
-#endif
-#ifndef __ooo_vba_XHelperInterface_idl__
-#include <ooo/vba/XHelperInterface.idl>
-#endif
+#include <ooo/vba/msforms/XShape.idl>
+
//=============================================================================
module ooo { module vba { module excel {
@@ -48,7 +41,7 @@ interface XComment
interface ::ooo::vba::XHelperInterface;
[attribute] string Author;
-// [attribute, readonly] Shape Shape;
+ [attribute, readonly] ooo::vba::msforms::XShape Shape;
[attribute] boolean Visible;
void Delete();
diff --git a/oovbaapi/ooo/vba/excel/XHyperlink.idl b/oovbaapi/ooo/vba/excel/XHyperlink.idl
index 32fd985a4a37..1f6f9d23bfa6 100644
--- a/oovbaapi/ooo/vba/excel/XHyperlink.idl
+++ b/oovbaapi/ooo/vba/excel/XHyperlink.idl
@@ -27,31 +27,38 @@
#ifndef __ooo_vba_excel_XHyperlink_idl__
#define __ooo_vba_excel_XHyperlink_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 msforms {
+ interface XShape;
+}; }; };
+
module ooo { module vba { module excel {
-//=============================================================================
interface XRange;
+
+//=============================================================================
+
interface XHyperlink
{
interface ::ooo::vba::XHelperInterface;
- [attribute] string Address;
[attribute] string Name;
+ [attribute] string Address;
+ [attribute] string SubAddress;
+ [attribute] string ScreenTip;
[attribute] string TextToDisplay;
-
- XRange Range();
+ [attribute, readonly] long Type;
+ [attribute, readonly] XRange Range;
+ [attribute, readonly] ooo::vba::msforms::XShape Shape;
};
+//=============================================================================
+
}; }; };
+//=============================================================================
+
#endif
diff --git a/oovbaapi/ooo/vba/excel/XHyperlinks.idl b/oovbaapi/ooo/vba/excel/XHyperlinks.idl
new file mode 100755
index 000000000000..dbaab84568e8
--- /dev/null
+++ b/oovbaapi/ooo/vba/excel/XHyperlinks.idl
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * 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 __ooo_vba_excel_XHyperlinks_idl__
+#define __ooo_vba_excel_XHyperlinks_idl__
+
+#include <ooo/vba/XCollection.idl>
+
+//=============================================================================
+
+module ooo { module vba { module excel {
+
+//=============================================================================
+
+interface XHyperlink;
+
+interface XHyperlinks
+{
+ // ------------------------------------------------------------------------
+
+ interface ::ooo::vba::XCollection;
+
+ // ------------------------------------------------------------------------
+
+ XHyperlink Add(
+ [in] any aAnchor,
+ [in] any aAddress,
+ [in] any aSubAddress,
+ [in] any aScreenTip,
+ [in] any aTextToDisplay );
+
+ // ------------------------------------------------------------------------
+
+ void Delete();
+
+ // ------------------------------------------------------------------------
+
+};
+
+//=============================================================================
+
+}; }; };
+
+//=============================================================================
+
+#endif
diff --git a/oovbaapi/ooo/vba/excel/XPane.idl b/oovbaapi/ooo/vba/excel/XPane.idl
index acc5520bb9ea..ac9ec2e3ca08 100644
--- a/oovbaapi/ooo/vba/excel/XPane.idl
+++ b/oovbaapi/ooo/vba/excel/XPane.idl
@@ -27,9 +27,7 @@
#ifndef __com_sun_star_helper_XPane_idl__
#define __com_sun_star_helper_XPane_idl__
-#ifndef __com_sun_star_uno_XInterface_idl__
#include <com/sun/star/uno/XInterface.idl>
-#endif
//============================================================================
@@ -37,10 +35,13 @@ module ooo { module vba { module excel {
//============================================================================
-interface XPane: com::sun::star::uno::XInterface
+interface XRange;
+
+interface XPane : com::sun::star::uno::XInterface
{
[attribute] long ScrollColumn;
[attribute] long ScrollRow;
+ [attribute, readonly] XRange VisibleRange;
void SmallScroll([in] /*Optional*/ any Down, [in] /*Optional*/ any Up, [in] /*Optional*/ any ToRight, [in] /*Optional*/ any ToLeft);
void LargeScroll([in] /*Optional*/ any Down, [in] /*Optional*/ any Up, [in] /*Optional*/ any ToRight, [in] /*Optional*/ any ToLeft);
diff --git a/oovbaapi/ooo/vba/excel/XRange.idl b/oovbaapi/ooo/vba/excel/XRange.idl
index 5eb1913fc40a..3820911f2c96 100644
--- a/oovbaapi/ooo/vba/excel/XRange.idl
+++ b/oovbaapi/ooo/vba/excel/XRange.idl
@@ -98,6 +98,7 @@ interface XRange
[attribute, readonly ] any Left;
[attribute] any PageBreak;
[attribute, readonly] XValidation Validation;
+ [attribute, readonly] any PrefixCharacter;
[attribute] any Style;
[attribute] any AddIndent;
[attribute] any ShowDetail;
@@ -164,7 +165,7 @@ interface XRange
void RemoveSubtotal() raises ( com::sun::star::script::BasicErrorException );
void Subtotal( [in] long GroupBy, [in] long Function, [in] /*Optional*/ sequence<long> TotalList, [in] /*Optional*/ any Replace, [in] /*Optional*/ any PageBreaks, [in] any SummaryBelowData ) raises ( com::sun::star::script::BasicErrorException );
XRange MergeArea( ) raises ( com::sun::star::script::BasicErrorException );
-
+ any Hyperlinks( [in] any aIndex );
};
//=============================================================================
diff --git a/oovbaapi/ooo/vba/excel/XWindow.idl b/oovbaapi/ooo/vba/excel/XWindow.idl
index 0ac2271a32d6..dde7818ebda7 100644
--- a/oovbaapi/ooo/vba/excel/XWindow.idl
+++ b/oovbaapi/ooo/vba/excel/XWindow.idl
@@ -27,22 +27,18 @@
#ifndef __ooo_vba_excel_XWindow_idl__
#define __ooo_vba_excel_XWindow_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 excel {
//=============================================================================
+
interface XRange;
interface XWorksheet;
interface XPane;
+
interface XWindow : com::sun::star::uno::XInterface
{
[attribute] any Caption;
@@ -61,6 +57,7 @@ interface XWindow : com::sun::star::uno::XInterface
[attribute] any ScrollColumn;
[attribute] any ScrollRow;
[attribute] any View;
+ [attribute, readonly] XRange VisibleRange;
[attribute] any WindowState;
[attribute] any Zoom;
any SelectedSheets( [in] any aIndex );
@@ -71,6 +68,7 @@ interface XWindow : com::sun::star::uno::XInterface
void Close([in] any SaveChanges, [in] any FileName, [in] any RouteWorkBook);
XRange ActiveCell() raises(com::sun::star::script::BasicErrorException);
any Selection() raises(com::sun::star::script::BasicErrorException);
+ XRange RangeSelection() raises(com::sun::star::script::BasicErrorException);
long PointsToScreenPixelsX([in] long Points) raises(com::sun::star::script::BasicErrorException);
long PointsToScreenPixelsY([in] long Points) raises(com::sun::star::script::BasicErrorException);
void PrintOut([in] /*optional short*/ any From,
diff --git a/oovbaapi/ooo/vba/excel/XWorksheet.idl b/oovbaapi/ooo/vba/excel/XWorksheet.idl
index 2f66b7d0826f..271cd81d4d0e 100644
--- a/oovbaapi/ooo/vba/excel/XWorksheet.idl
+++ b/oovbaapi/ooo/vba/excel/XWorksheet.idl
@@ -39,6 +39,9 @@
#include <com/sun/star/script/XInvocation.idl>
#endif
+#ifndef __com_sun_star_container_XNamed_idl__
+#include <com/sun/star/container/XNamed.idl>
+#endif
//=============================================================================
module ooo { module vba { module excel {
@@ -55,8 +58,8 @@ interface XWorksheet
{
interface ::ooo::vba::XHelperInterface;
interface ::com::sun::star::script::XInvocation;
+ interface ::com::sun::star::container::XNamed;
- [attribute] string Name;
[attribute] boolean Visible;
[attribute, readonly] long StandardHeight;
[attribute, readonly] long StandardWidth;
@@ -80,6 +83,8 @@ interface XWorksheet
void Protect([in] any Password,[in] any DrawingObjects ,[in] any Contents,[in] any Scenarios,[in] any UserInterfaceOnly);
void Unprotect([in] any Password );
void CheckSpelling([in] any CustomDictionary,[in] any IgnoreUppercase, [in] any AlwaysSuggest,[in] any SpellingLang );
+ void ShowDataForm();
+
XRange Range([in] any Cell1, [in] any Cell2 );
any ChartObjects([in] any Index);
any PivotTables([in] any Index);
@@ -89,23 +94,32 @@ interface XWorksheet
any HPageBreaks([in] any Index);
any VPageBreaks([in] any Index);
any OLEObjects([in] any Index);
- void ShowDataForm();
any Shapes([in] any Index);
+ /* The following form control related symbols do not refer to ActiveX form
+ controls embedded in the sheet, but to the old-style drawing controls
+ of Excel. This is an Excel-only feature. */
+ any Buttons( [in] any aIndex );
+ any CheckBoxes( [in] any aIndex );
+ any DropDowns( [in] any aIndex );
+ any GroupBoxes( [in] any aIndex );
+ any Labels( [in] any aIndex );
+ any ListBoxes( [in] any aIndex );
+ any OptionButtons( [in] any aIndex );
+ any ScrollBars( [in] any aIndex );
+ any Spinners( [in] any aIndex );
// FIXME: should prolly inherit from Range somehow...
XRange Cells([in] any RowIndex, [in] any ColumnIndex);
XRange Rows([in] any aIndex);
XRange Columns([in] any aIndex);
+ any Hyperlinks( [in] any aIndex );
any Evaluate( [in] string Name);
-
void setEnableCalculation([in] boolean EnableCalculation) raises(com::sun::star::script::BasicErrorException);
boolean getEnableCalculation() raises(com::sun::star::script::BasicErrorException);
void PrintOut( [in] any From, [in] any To, [in] any Copies, [in] any Preview, [in] any ActivePrinter, [in] any PrintToFile, [in] any Collate, [in] any PrToFileName, [in] any IgnorePrintAreas );
-
-
};
//=============================================================================
@@ -113,5 +127,3 @@ interface XWorksheet
}; }; };
#endif
-
-
diff --git a/oovbaapi/ooo/vba/excel/makefile.mk b/oovbaapi/ooo/vba/excel/makefile.mk
index c31531af8349..12dcf025e489 100644
--- a/oovbaapi/ooo/vba/excel/makefile.mk
+++ b/oovbaapi/ooo/vba/excel/makefile.mk
@@ -34,16 +34,13 @@ PACKAGE=ooo$/vba$/Excel
# --- Settings -----------------------------------------------------
.INCLUDE : $(PRJ)$/util$/makefile.pmk
-.IF "$(ENABLE_VBA)"!="YES"
-dummy:
- @echo "not building vba..."
-.ENDIF
-
# ------------------------------------------------------------------------
IDLFILES= XGlobals.idl\
Globals.idl\
+ SheetObject.idl\
+ SheetObjects.idl\
XApplication.idl\
XComment.idl\
XComments.idl\
@@ -97,6 +94,7 @@ IDLFILES= XGlobals.idl\
Window.idl \
XHyperlink.idl \
Hyperlink.idl \
+ XHyperlinks.idl \
XPageSetup.idl \
XPageBreak.idl \
XHPageBreak.idl \
diff --git a/oovbaapi/ooo/vba/makefile.mk b/oovbaapi/ooo/vba/makefile.mk
index e79d3481169c..75f6465bf4c0 100644
--- a/oovbaapi/ooo/vba/makefile.mk
+++ b/oovbaapi/ooo/vba/makefile.mk
@@ -1,4 +1,4 @@
-#*************************************************************************
+ #*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
@@ -34,11 +34,6 @@ PACKAGE=ooo$/vba
# --- Settings -----------------------------------------------------
.INCLUDE : $(PRJ)$/util$/makefile.pmk
-.IF "$(ENABLE_VBA)"!="YES"
-dummy:
- @echo "not building vba..."
-.ELSE
-
# ------------------------------------------------------------------------
.IF "$(L10N_framework)"=""
IDLFILES=\
@@ -67,8 +62,8 @@ IDLFILES=\
XDialogsBase.idl\
XDialogBase.idl\
XPageSetupBase.idl \
-
+ XVBAAppService.idl\
+ XVBADocService.idl\
# ------------------------------------------------------------------
.ENDIF
.INCLUDE : target.mk
-.ENDIF
diff --git a/oovbaapi/ooo/vba/msforms/XControl.idl b/oovbaapi/ooo/vba/msforms/XControl.idl
index 867fd564c9af..97ca9d152716 100644
--- a/oovbaapi/ooo/vba/msforms/XControl.idl
+++ b/oovbaapi/ooo/vba/msforms/XControl.idl
@@ -45,13 +45,16 @@ interface XControl
{
interface ::ooo::vba::XHelperInterface;
void SetFocus();
+ void Move( [in] double Left, [in] double Top, [in] any Width, [in] any Height );
+
[attribute, readonly ] com::sun::star::uno::XInterface Object;
[attribute] string ControlSource;
[attribute] string RowSource;
[attribute] boolean Enabled;
[attribute] boolean Visible;
//Size. there are some defferent between Mso and OOo.
- //Mso use double but OOo use long. OOo 1 = 1/100mm but Mso use pt
+ //Mso use double but OOo use long. OOo 1 = 1/100mm but Mso use pt.
+ //in Dialogs Mso uses pixels
[attribute] double Height;
[attribute] double Width;
//Postion
@@ -59,6 +62,7 @@ interface XControl
[attribute] double Top;
[attribute] string Name;
[attribute] string ControlTipText;
+ [attribute] string Tag;
};
//=============================================================================
diff --git a/oovbaapi/ooo/vba/msforms/XControls.idl b/oovbaapi/ooo/vba/msforms/XControls.idl
index 00d8f16f9dd9..11325303d56c 100644
--- a/oovbaapi/ooo/vba/msforms/XControls.idl
+++ b/oovbaapi/ooo/vba/msforms/XControls.idl
@@ -41,6 +41,13 @@ interface XControls
{
interface ooo::vba::XCollection;
void Move( [in] double cx, [in] double cy );
+
+ // the following two methods should be actually part of XCollection, but at least Add conflicts with
+ // methods in the derived from XCollection interfaces
+ // thus the methods are declared in the top-level interface
+ any Add( [in] any Object, [in] any StringKey, [in] any Before, [in] any After );
+ void Remove( [in] any StringKeyOrIndex );
+
};
}; }; };
diff --git a/oovbaapi/ooo/vba/msforms/makefile.mk b/oovbaapi/ooo/vba/msforms/makefile.mk
index 61d2675af7fc..56ac4caf87cb 100644
--- a/oovbaapi/ooo/vba/msforms/makefile.mk
+++ b/oovbaapi/ooo/vba/msforms/makefile.mk
@@ -34,11 +34,6 @@ PACKAGE=ooo$/vba$/msforms
# --- Settings -----------------------------------------------------
.INCLUDE : $(PRJ)$/util$/makefile.pmk
-.IF "$(ENABLE_VBA)"!="YES"
-dummy:
- @echo "not building vba..."
-.ENDIF
-
# ------------------------------------------------------------------------
IDLFILES=\
diff --git a/oovbaapi/prj/d.lst b/oovbaapi/prj/d.lst
index 1acd2acd5b4b..ac5924e2d684 100644
--- a/oovbaapi/prj/d.lst
+++ b/oovbaapi/prj/d.lst
@@ -1 +1,15 @@
+mkdir: %COMMON_DEST%\idl%_EXT%\ooo
+
+mkdir: %COMMON_DEST%\idl%_EXT%\ooo\vba
+mkdir: %COMMON_DEST%\idl%_EXT%\ooo\vba\constants
+mkdir: %COMMON_DEST%\idl%_EXT%\ooo\vba\excel
+mkdir: %COMMON_DEST%\idl%_EXT%\ooo\vba\msforms
+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\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
+..\ooo\vba\word\*.idl %COMMON_DEST%\idl%_EXT%\ooo\vba\word
diff --git a/oovbaapi/util/makefile.mk b/oovbaapi/util/makefile.mk
index 9c33577abfa9..5100327b4b7d 100644
--- a/oovbaapi/util/makefile.mk
+++ b/oovbaapi/util/makefile.mk
@@ -36,11 +36,6 @@ TARGET=oovbaapi_db
.INCLUDE : makefile.pmk
-.IF "$(ENABLE_VBA)"!="YES"
-dummy:
- @echo "not building vba..."
-.ENDIF
-
.IF "$(L10N_framework)"==""
# ------------------------------------------------------------------
UNOIDLDBFILES= \
diff --git a/readlicense_oo/docs/readme.xsl b/readlicense_oo/docs/readme.xsl
index 2c98b011c315..4e77fa522c3d 100755..100644
--- a/readlicense_oo/docs/readme.xsl
+++ b/readlicense_oo/docs/readme.xsl
@@ -1,232 +1,173 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:output method="html" doctype-public="-//W3C//DTD HTML 3.2//EN" />
-
- <!-- inputvariable declaration -->
- <xsl:param name="os1"/>
- <xsl:param name="gui1"/>
- <xsl:param name="cp1" />
- <xsl:param name="com1"/>
- <xsl:param name="lang1"/>
- <xsl:param name="type"/>
- <xsl:param name="file"/>
- <xsl:strip-space elements="*"/>
-<xsl:template match="/Readme">
- <!-- creates the HTML-output-->
- <xsl:if test="$type='html'">
- <!-- the outputname for htlm-files-->
- <html>
- <!-- HTML utf-8 encoding enable -->
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- </head>
- <body>
- <xsl:apply-templates/>
- </body>
- </html>
+<!-- <xsl:output method="text" doctype-public="-//W3C//DTD HTML 3.2//EN" omit-xml-declaration="yes"/> -->
- </xsl:if>
- <!-- creates the Textoutput -->
- <xsl:if test="$type='text'">
- <!-- the outputfilename for Textfiles -->
- <xsl:apply-templates/>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match="Section">
- <xsl:apply-templates/>
-</xsl:template>
-
-
-<xsl:template match="Paragraph">
- <!-- match the given parameters one of the xmlattributes? -->
- <xsl:if test="@os=$os1 or @os='all'">
- <xsl:if test="@cpuname=$cp1 or @cpuname='all'">
- <xsl:if test="@gui=$gui1 or @gui='all'">
- <xsl:if test="@com=$com1 or @com='all'">
- <!--html-output -->
- <xsl:if test="$type='html'">
- <xsl:element name="{@style}">
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:if>
- <!--text-output -->
- <xsl:if test="$type='text'">
- <xsl:if test="@style='h1' or @style='h2' or @style='h3' or @style='H1' or @style='H2' or @style='H3'">
- <xsl:choose>
- <xsl:when test='$os1="WNT"'>
- <xsl:text>&#xD;&#xA;------------------------------------------------------------&#xD;&#xA;</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&#xA;------------------------------------------------------------&#xA;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <!-- enter an carriage return line feed -->
- <xsl:if test="@style='p' or @style='P'">
- <xsl:choose>
- <xsl:when test='$os1="WNT"'>
- <xsl:text>&#xD;&#xA;</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&#xA;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:apply-templates/>
- <xsl:if test="@style='h1' or @style='h2' or @style='h3' or @style='hr' or @style='H1' or @style='H2' or @style='H3' or @style='HR'">
- <xsl:choose>
- <xsl:when test='$os1="WNT"'>
- <xsl:text>------------------------------------------------------------&#xD;&#xA;</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>------------------------------------------------------------&#xA;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:if>
- </xsl:if>
- </xsl:if>
- </xsl:if>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match="List">
- <!-- creates the listoutput, the html-tags will be ignored if textoutput is choosen -->
- <xsl:choose>
- <xsl:when test="@Enum='false'">
- <ul type="circle">
- <xsl:apply-templates/>
- </ul>
- </xsl:when>
- <xsl:when test="@Enum='true'">
- <ol>
- <xsl:apply-templates/>
- </ol>
- </xsl:when>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="List//Text">
- <!-- create the list -->
- <xsl:if test="$type='html'">
- <xsl:if test="@xml:lang=$lang1">
- <li><xsl:apply-templates/></li>
- </xsl:if>
- </xsl:if>
- <xsl:if test="$type='text'">
- <xsl:if test="@xml:lang=$lang1">
- <xsl:text>- </xsl:text>
- <xsl:apply-templates/>
- <xsl:choose>
- <xsl:when test='$os1="WNT"'>
- <xsl:text>&#xD;&#xA;</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&#xA;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:if>
-</xsl:template>
-
-<!-- the textoutput of normal paragraph nodes -->
-<!-- these template will be used if an attribute xml:lang exists -->
-<xsl:template match="Section/Paragraph/Text[@xml:lang]">
- <xsl:if test="@xml:lang=$lang1">
- <!-- make the output with the given template -->
- <xsl:call-template name="out"/>
- </xsl:if>
-</xsl:template>
-
-<!-- these template will be used if no attribute xml:lang exists -->
-<xsl:template match="Section/Paragraph/Text[not (@xml:lang)]">
- <xsl:call-template name="out"/>
-</xsl:template>
-
-<!-- creates the outputtemplate out -->
-<xsl:template name="out">
- <!-- creates output with an extra CR/LF -->
- <xsl:if test="@Wrap='true'">
- <xsl:if test="$type='html'">
- <xsl:element name="br"/>
- <xsl:call-template name="prelinked"/>
+ <!-- inputvariable declaration -->
+ <xsl:param name="os1"/>
+ <xsl:param name="gui1"/>
+ <xsl:param name="cp1"/>
+ <xsl:param name="com1"/>
+ <xsl:param name="lang1"/>
+ <xsl:param name="type"/>
+ <xsl:param name="file"/>
+ <xsl:strip-space elements="*"/>
+
+ <xsl:param name="platform">
+ <xsl:if test="$os1='LINUX'">
+ <xsl:value-of select="'LINUX'"/>
</xsl:if>
- <xsl:if test="$type='text'">
- <xsl:choose>
- <xsl:when test='$os1="WNT"'>
- <xsl:text>&#xD;&#xA;</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&#xA;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:call-template name="linked"/>
+ <xsl:if test="$os1='WNT'">
+ <xsl:value-of select="'WIN'"/>
</xsl:if>
- </xsl:if>
-
- <!-- here without the extra CR/LF-->
- <xsl:if test="@Wrap='false'">
- <xsl:if test="$type='html'">
- <xsl:call-template name="prelinked"/>
+ <xsl:if test="$os1='SOLARIS'">
+ <xsl:if test="$cp1='SPARC'">
+ <xsl:value-of select="'SOLSPARC'"/>
+ </xsl:if>
+ <xsl:if test="$cp1='INTEL'">
+ <xsl:value-of select="'SOLX86'"/>
+ </xsl:if>
</xsl:if>
- <xsl:if test="$type='text'">
- <xsl:call-template name="linked"/>
+ <xsl:if test="$os1='MACOSX'">
+ <xsl:value-of select="'MAC'"/>
</xsl:if>
- </xsl:if>
-</xsl:template>
+ </xsl:param>
+
+ <xsl:template match="/">
+ <xsl:choose>
+ <xsl:when test="$type='html'">
+
+ <xsl:document method="html" href="{$file}" doctype-public="-//W3C//DTD HTML 3.2//EN">
+ <xsl:apply-templates mode="html"/>
+ </xsl:document>
+
+ </xsl:when>
+ <xsl:when test="$type='text'">
+
+ <xsl:document method="text" href="{$file}">
+ <xsl:call-template name="textout" />
+ </xsl:document>
+
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="*" mode="html">
+ <xsl:choose>
+ <xsl:when test="(contains(@class,$platform) or not(@class) or (name(.)='p'))">
+ <xsl:if test="(@xml:lang=$lang1 or not(@xml:lang))"> <!-- check for correct language -->
+ <xsl:element name="{name(.)}">
+ <xsl:if test="(name(.)='a')">
+ <xsl:attribute name="href">
+ <xsl:value-of select="@href"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="(name(.)='p') and (@class)">
+ <xsl:attribute name="class">
+ <xsl:value-of select="@class"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="name(.)='div'">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates mode="html"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="textout">
+ <xsl:apply-templates />
+ </xsl:template>
+
+ <xsl:template match="*">
+ <xsl:if test="(@xml:lang=$lang1 or not(@xml:lang))"> <!-- check for correct language -->
+ <xsl:choose>
+ <xsl:when test="name(.)='html'">
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:when test="name(.)='body'">
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:when test="name(.)='hr'">
+ <xsl:text>
+
+----------------------------------------------------------------------------------------------------------
-<xsl:template name="prelinked">
- <xsl:if test=" @style='b ' or @style='B ' or @style='i ' or @style='I ' or @style='u ' or @style='U '">
- <xsl:element name="{@style}">
- <xsl:call-template name="linked"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="@style='none'">
- <xsl:call-template name="linked"/>
- </xsl:if>
-</xsl:template>
+</xsl:text>
+ </xsl:when>
+ <xsl:when test="name(.)='div'">
+ <xsl:if test="(contains(@class,$platform) or not(@class))">
+ <xsl:apply-templates/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="name(.)='a'">
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:when test="name(.)='tt'">
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:when test="name(.)='li'">
+ <xsl:text>
+</xsl:text>* <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:when test="name(.)='ul'">
+ <xsl:text>
+</xsl:text>
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:when test="name(.)='ol'">
+ <xsl:text>
+</xsl:text>
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:when test="name(.)='p'">
+ <xsl:if test="(not(name(..)='li') and (count(a) = 0))">
+ <xsl:text>
-<xsl:template name="linked">
- <xsl:if test="$type='html'">
- <!--this template creates a link if the url attribute is true -->
- <xsl:if test="@url='false'">
- <xsl:apply-templates/>
- </xsl:if>
- <xsl:if test="@url='true'">
- <xsl:if test="@path='none'">
- <a><xsl:attribute name="href"> <xsl:apply-templates/></xsl:attribute><xsl:apply-templates/></a>
- </xsl:if>
- <xsl:if test="@path='file'">
- <a><xsl:attribute name="href"><xsl:text>file://localhost/</xsl:text><xsl:apply-templates/></xsl:attribute><xsl:apply-templates/></a>
- </xsl:if>
- <xsl:if test="@path='url'">
- <a><xsl:attribute name="href"><xsl:text>http://</xsl:text><xsl:apply-templates/></xsl:attribute><xsl:apply-templates/></a>
- </xsl:if>
- </xsl:if>
- <!-- this code is needed for the line before an link, if not an <p> will be added-->
- <xsl:if test="@url='ahead'">
- <xsl:apply-templates/>
- </xsl:if>
- </xsl:if>
- <xsl:if test="$type='text'">
- <xsl:if test="@url='false'">
- <xsl:apply-templates/>
- <xsl:choose>
- <xsl:when test='$os1="WNT"'>
- <xsl:text>&#xD;&#xA;</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&#xA;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="@url='true' or @url='ahead'">
- <xsl:apply-templates/>
- </xsl:if>
+</xsl:text>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:when test="name(.)='h1'">
+ <xsl:text>
+
+======================================================================
+</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>
+======================================================================</xsl:text>
+ </xsl:when>
+ <xsl:when test="name(.)='h2'">
+ <xsl:text>
+
+----------------------------------------------------------------------
+</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>
+----------------------------------------------------------------------</xsl:text>
+
+ </xsl:when>
+ <xsl:when test="name(.)='h3'">
+ <xsl:text>
+
+</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>
+----------------------------------------------------------------------</xsl:text>
+
+ </xsl:when>
+ </xsl:choose>
</xsl:if>
-</xsl:template>
+ </xsl:template>
+
+
</xsl:stylesheet>
diff --git a/readlicense_oo/docs/readme/readme.xrm b/readlicense_oo/docs/readme/readme.xrm
index 2a8a409b4eff..78716869e822 100755
--- a/readlicense_oo/docs/readme/readme.xrm
+++ b/readlicense_oo/docs/readme/readme.xrm
@@ -1,524 +1,309 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE Readme SYSTEM "../readme.dtd"><!-- A paragraph id has to be unique within one section -->
-<Readme name="ooo_readme" col-span="0">
-
- <Section id="Welcome"> <!-- ALL PLATFORMS -->
-
- <Paragraph id="Welcome" style="H1">
- <Text id="a" xml:lang="en-US">Welcome</Text>
- </Paragraph>
-
- <Paragraph id="ReadMeTitle" style="H1">
- <Text id="a" xml:lang="en-US">${PRODUCTNAME} ${PRODUCTVERSION} ReadMe</Text>
- </Paragraph>
-
- <Paragraph id="LaterstUpdates">
- <Text id="a" xml:lang="en-US" url="ahead">For latest updates to this readme file, see </Text>
- <Text id="b" xml:lang="en-US" url="true">http://www.openoffice.org/welcome/readme.html</Text>
- </Paragraph>
-
- <Paragraph id="A5">
- <Text id="c" xml:lang="en-US">Dear User</Text>
- </Paragraph>
-
- <Paragraph id="A6">
- <Text id="d" xml:lang="en-US">This file contains important information about this program. Please read this information very carefully before starting work.</Text>
- </Paragraph>
-
- <Paragraph id="A7">
- <Text id="a" xml:lang="en-US" url="ahead">The OpenOffice.org Community, responsible for the development of this product, would like to invite you to participate as a community member. As a new user, you can check out the ${PRODUCTNAME} site with helpful user information at </Text>
- </Paragraph>
-
- <Paragraph id="A8">
- <Text id="empty" xml:lang="en-US"/>
- <Text id="b" xml:lang="en-US" url="true">http://www.openoffice.org/about_us/introduction.html </Text>
- </Paragraph>
-
- <Paragraph id="A9">
- <Text id="empty" xml:lang="en-US"/>
- <Text id="c" xml:lang="en-US">Also read the sections below about getting involved in the OpenOffice.org project. </Text>
- </Paragraph>
-
- <Paragraph id="A10" style="H3">
- <Text id="c" xml:lang="en-US">Is ${PRODUCTNAME} really free for any user? </Text>
- </Paragraph>
-
- <Paragraph id="A11">
- <Text id="empty" xml:lang="en-US"/>
- <Text id="a" xml:lang="en-US" url="ahead">${PRODUCTNAME} is free for use by everybody. You may take this copy of ${PRODUCTNAME} and install it on as many computers as you like, and use it for any purpose you like (including commercial, government, public administration and educational use). For further details see the license text delivered together with ${PRODUCTNAME} or </Text>
- <Text id="b" xml:lang="en-US" url="true">http://www.openoffice.org/license.html </Text>
- <Text id="d" xml:lang="en-US"></Text>
- </Paragraph>
-
- <Paragraph id="A12" style="H3">
- <Text id="A12a" xml:lang="en-US">Why is ${PRODUCTNAME} free for any user?</Text>
- </Paragraph>
-
- <Paragraph id="A13">
- <Text id="empty" xml:lang="en-US"/>
- <Text id="A13a" xml:lang="en-US">
- You can use this copy of ${PRODUCTNAME} today free of charge because individual contributors and corporate sponsors have designed, developed, tested, translated, documented, supported, marketed, and helped in many other ways to make ${PRODUCTNAME} what it is today - the world's leading open-source office software.</Text>
- <Text id="A13b" xml:lang="en-US" url="ahead">If you appreciate their efforts, and would like to ensure OpenOffice.org continues into the future, please consider contributing to the project - see </Text>
- <Text id="A13c" xml:lang="en-US" url="true">http://contributing.openoffice.org</Text>
- <Text id="A13d" xml:lang="en-US"> for details. Everyone has a contribution to make.</Text>
- </Paragraph>
-
- </Section>
-
- <Section id="Installation">
-
- <Paragraph id="Header" style="H2">
- <Text id="rr3fgf42r" xml:lang="en-US">Notes on Installation</Text>
- </Paragraph>
-
- <Paragraph id="All">
- <Text id="sdfsdfgf42r" xml:lang="en-US">System Requirements:</Text>
- </Paragraph>
-
- <Paragraph id="MacX_INTEL" os="MACOSX" cpuname="INTEL"><!-- MAC -->
- <List>
- <Text id="macxiOSX" xml:lang="en-US">MacOSX 10.4 (Tiger) or higher</Text>
- <Text id="macxicpu" xml:lang="en-US">Intel processor</Text>
- <Text id="macxiRAM" xml:lang="en-US">512 MB RAM</Text>
- <Text id="macxHardDiksSpace" xml:lang="en-US">500 MB available hard disk space</Text>
- <Text id="macxHardDiksSpaceCJK" xml:lang="en-US">Chinese, Japanese and Korean versions: 600 MB (multi-language version: 800 MB) available hard disk space)</Text>
- <Text id="macxivideo" xml:lang="en-US">1024 x 768 graphic device with 256 colors (higher resolution recommended)</Text>
- </List>
- </Paragraph>
-
- <Paragraph id="WNT2" os="WNT"><!-- WINDOWS -->
- <List>
- <Text id="s2s3sdf2" xml:lang="en-US">Microsoft Windows 2000 (Service Pack 4 or higher), XP, or Vista</Text>
- <Text id="utzu6" xml:lang="en-US">Pentium compatible PC (Pentium III or Athlon recommended)</Text>
- <Text id="ghuj67" xml:lang="en-US">256 MB RAM (512 MB RAM recommended)</Text>
- <Text id="jzjtzu6" xml:lang="en-US">370 MB available hard disk space</Text>
- <Text id="WinHDCJK" xml:lang="en-US">Chinese, Japanese and Korean versions: 650 MB available hard disk space</Text>
- <Text id="jtzu56" xml:lang="en-US">1024x768 resolution (higher resolution recommended), at least 256 colors</Text>
- </List>
- </Paragraph>
-
- <Paragraph id="Sols2" os="SOLARIS" cpuname="SPARC"><!-- SOLARIS SPARC-->
- <List>
- <Text id="s2335" xml:lang="en-US">Solaris 10 operating system (SPARC platform) or higher</Text>
- <Text id="s253" xml:lang="en-US">256 MB RAM (512 MB RAM recommended)</Text>
- <Text id="s23seg" xml:lang="en-US">480 MB available hard disk space</Text>
- <Text id="SolsHDCJK" xml:lang="en-US">Chinese, Japanese and Korean versions: 480 MB available hard disk space</Text>
- <Text id="s2s43gfe" xml:lang="en-US">X Server with 1024x768 resolution (higher resolution recommended), with at least 256 colors</Text>
- <Text id="n4234rw" xml:lang="en-US">Window Manager</Text>
- <Text id="wd2dff" xml:lang="en-US">Gnome 2.6 or higher, with the gail 1.8.6 and the at-spi 1.7 packages, required for support of assistive technology tools (AT tools)</Text>
- </List>
- </Paragraph>
-
- <Paragraph id="Solia2" os="SOLARIS" cpuname="INTEL"><!-- SOLARIS INTEL -->
- <List>
- <Text id="s23h" xml:lang="en-US">Solaris 10 operating system (x86 platform) or higher</Text>
- <Text id="s24f" xml:lang="en-US">256 MB RAM (512 MB RAM recommended)</Text>
- <Text id="fgheg" xml:lang="en-US">480 MB available hard disk space</Text>
- <Text id="SoliHDCJK" xml:lang="en-US">Chinese, Japanese and Korean versions: 480 MB available hard disk space</Text>
- <Text id="fghfgh" xml:lang="en-US">X Server with 1024x768 resolution (higher resolution recommended), with at least 256 colors</Text>
- <Text id="mgjfg" xml:lang="en-US">Window Manager</Text>
- <Text id="wd2dff" xml:lang="en-US">Gnome 2.6 or higher, with the gail 1.8.6 and the at-spi 1.7 packages, required for support of assistive technology tools (AT tools)</Text>
- </List>
- </Paragraph>
-
- <Paragraph id="Linuxi2" os="LINUX" cpuname="INTEL"><!-- LINUX -->
- <List>
- <Text id="s2we35" xml:lang="en-US">Linux Kernel version 2.4 or higher</Text>
- <Text id="s253we" xml:lang="en-US">glibc2 version 2.3.2 or higher</Text>
- <Text id="s256we" xml:lang="en-US">gtk version 2.2.0 or higher</Text>
- <Text id="s2etfseg" xml:lang="en-US">Pentium compatible PC (Pentium III or Athlon recommended)</Text>
- <Text id="s2ssdfe" xml:lang="en-US">256 MB RAM (512 MB RAM recommended)</Text>
- <Text id="n42dfgf" xml:lang="en-US">440 MB available hard disk space</Text>
- <Text id="LinHDCJK" xml:lang="en-US">Chinese, Japanese and Korean versions: 440 MB available hard disk space</Text>
- <Text id="ghjhhr" xml:lang="en-US">X Server with 1024x768 resolution (higher resolution recommended), with at least 256 colors</Text>
- <Text id="fhrtz5" xml:lang="en-US">Window Manager</Text>
- <Text id="wd2dff" xml:lang="en-US">Gnome 2.6 or higher, with the gail 1.8.6 and the at-spi 1.7 packages, required for support of assistive technology tools (AT tools)</Text>
- </List>
- </Paragraph>
-
- <Paragraph id="Linuxi3" os="LINUX">
- <Text id="Linuxi3a" xml:lang="en-US">There is a wide variety of Linux distributions, and even within the same distribution there may be different installation options (KDE vs Gnome, etc.). Some distributions ship with their own ‘native’ version of ${PRODUCTNAME}, which may have different features from this Community ${PRODUCTNAME}. Sometimes you can install the Community ${PRODUCTNAME} alongside the ‘native’ version. However, it’s usually safer to remove the ‘native’ version before installing this Community version. Consult the documentation for your distribution for details of how to do this. </Text>
- </Paragraph>
-
- <Paragraph id="Linuxi4" os="LINUX">
- <Text id="Linuxi4a" xml:lang="en-US">It is recommended that you always backup your system before you remove or install software.</Text>
- </Paragraph>
-
- <Paragraph id="MSOReg" os="WNT">
- <Text id="MSOReg1" xml:lang="en-US">Registration of ${PRODUCTNAME} as default application for Microsoft Office formats can be forced or suppressed by using the following command line switches with the installer:</Text>
- <List>
- <Text id="MSOReg2" xml:lang="en-US">/msoreg=1 will force registration of ${PRODUCTNAME} as default application for Microsoft Office formats.</Text>
- <Text id="MSOReg3" xml:lang="en-US">/msoreg=0 will suppress registration of ${PRODUCTNAME} as default application for Microsoft Office formats.</Text>
- </List>
- </Paragraph>
-
- <Paragraph id="DLLA" os="WNT">
- <Text id="DLLA1" xml:lang="en-US" url="ahead">If you perform an administrative installation using setup /a, you need to make sure that the file msvc90.dll is installed on the system. This file is required for ${PRODUCTNAME} to start after an administrative installation. You can get the file from </Text>
- <Text id="DLLA2" xml:lang="en-US" url="true">http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF </Text>
- <Text id="DLLA3" xml:lang="en-US"></Text>
- </Paragraph>
-
- <Section id="BerkeleyDB">
- <Paragraph id="BDB1" style="H2">
- <Text id="BDB11" xml:lang="en-US">Extension Database Incompatibility</Text>
- </Paragraph>
- </Section>
-
- <Paragraph id="BDB2">
- <Text id="BDB2a" xml:lang="en-US">The Berkeley database engine has been upgraded in this version of ${PRODUCTNAME}. The database engine upgrade introduces an incompatibility with user data for installed extensions for ${PRODUCTNAME} versions prior to 3.2 that may require your action if you downgrade your version of ${PRODUCTNAME}.</Text>
- </Paragraph>
-
- <Paragraph id="BDB3">
- <Text id="BDB3a" xml:lang="en-US">This version of ${PRODUCTNAME} will convert your extension database to the new Berkeley database format when extensions are installed or removed. After this conversion, the database can no longer be read by earlier versions of ${PRODUCTNAME}. Downgrading to an earlier version may result in a dysfunctional installation.</Text>
- </Paragraph>
-
- <Paragraph id="BDB4">
- <Text id="BDB4a" xml:lang="en-US">If you downgrade to an earlier version of ${PRODUCTNAME}, you must remove the user data directory {user data}/uno_packages, for example ~/.openoffice.org/3/user/uno_packages, and reinstall all extensions.</Text>
- </Paragraph>
-
-
- <Paragraph id="StartupProblemsHeader" style="H2" os="all">
- <Text id="naso" xml:lang="en-US">Problems During Program Startup</Text>
- </Paragraph>
-
- <Paragraph id="GnomeStartupProblems" os="LINUX">
- <Text id="naso2" xml:lang="en-US">If you experience ${PRODUCTNAME} startup problems (most notably while using Gnome) please &apos;unset&apos; the SESSION_MANAGER environment variable inside the shell you use to start ${PRODUCTNAME}. This can be done by adding the line &quot;unset SESSION_MANAGER&quot; to the beginning of the soffice shell script found in the &quot;[office folder]/program&quot; directory.</Text>
- </Paragraph>
-
- <Paragraph id="GraphicsCardDriverWIN" os="WNT">
- <Text id="abcdef" xml:lang="en-US">Difficulties starting ${PRODUCTNAME} (e.g. applications hang) as well as problems with the screen display are often caused by the graphics card driver. If these problems occur, please update your graphics card driver or try using the graphics driver delivered with your operating system. Difficulties displaying 3D objects can often be solved by deactivating the option &quot;Use OpenGL&quot; under &apos;Tools - Options - ${PRODUCTNAME} - View - 3D view&apos;.</Text>
- </Paragraph>
-
- <Paragraph id="GraphicsCardDriver" os="LINUX">
- <Text id="abcdef" xml:lang="en-US">Difficulties starting ${PRODUCTNAME} (e.g. applications hang) as well as problems with the screen display are often caused by the graphics card driver. If these problems occur, please update your graphics card driver or try using the graphics driver delivered with your operating system. Difficulties displaying 3D objects can often be solved by deactivating the option &quot;Use OpenGL&quot; under &apos;Tools - Options - ${PRODUCTNAME} - View - 3D view&apos;.</Text>
- </Paragraph>
-
- <!--
- <Paragraph id="PatchSolaris" os="SOLARIS">
- <Text id="ghtz5" xml:lang="en-US">Before installing ${PRODUCTNAME}, one or more operating system patches from SUN Microsystems must be installed. You can find them on the program CD in the following directories or download them at http://sunsolve.sun.com</Text>
- </Paragraph>
-
- <Paragraph id="ListOfPatchesSolaris" os="SOLARIS">
- <Text id="dfg4tr" xml:lang="en-US">Operating system patches required:</Text>
- </Paragraph>
-
- <Paragraph id="SolS_PatchList" os="SOLARIS" cpuname="SPARC">
- <List>
- <Text id="SPatches2" xml:lang="en-US">for Solaris 9: 111711-04, 111712-10 (64 bit), and 113713-03</Text>
- </List>
- </Paragraph>
-
- <Paragraph id="SolI_PatchList" os="SOLARIS" cpuname="INTEL">
- <List>
- <Text id="IPatches2" xml:lang="en-US">for Solaris 9: 111713-02, 114568-02</Text>
- </List>
- </Paragraph>
-
- <Paragraph id="SOLPatch_Note" os="SOLARIS">
- <Text id="Note" xml:lang="en-US">The versions mentioned above are the minimum requirements, newer (higher) version numbers are also allowed.</Text>
- </Paragraph>
-
- //-->
-
- <!--
- <Paragraph id="ParallelInstall" os="WNT">
- <Text id="Parallel" xml:lang="en-US">You can install ${PRODUCTNAME} ${PRODUCTVERSION} alongside of an older version of ${PRODUCTNAME}. If you later choose to deinstall the older version of ${PRODUCTNAME}, you must call the installation program of the newer version and choose &apos;Repair&apos;. This ensures that the new version is correctly registered in your system.</Text>
- </Paragraph>
- //-->
-
- <Paragraph id="CopyProblem">
- <Text id="CopyProblemsV1toV2" xml:lang="en-US">Please note that copy and paste via clipboard between ${PRODUCTNAME} 1.x and ${PRODUCTNAME} ${PRODUCTVERSION} might not work in OpenOffice.org format. If that happens, choose &apos;Edit - Paste Special&apos; and choose a format other than ${PRODUCTNAME}, or open the document in ${PRODUCTNAME} ${PRODUCTVERSION} directly.</Text>
- </Paragraph>
-
- <Paragraph id="GlobalPrecautions">
- <Text id="Precautions" xml:lang="en-US">Please make sure you have enough free memory in the temporary directory on your system and that read, write and run access rights have been granted. Close all other programs before starting the installation.</Text>
- </Paragraph>
-
- <Paragraph id="AdminNeededWIN" os="WNT">
- <Text id="AdminNeeded" xml:lang="en-US">Note: Please be aware that administrator rights are needed for the installation process.</Text>
- </Paragraph>
-
- </Section>
-
- <Section id="Scroll">
-
- <Paragraph id="F1a" style="H2" gui="WNT">
- <Text id="naso" xml:lang="en-US">ALPS/Synaptics notebook touchpads in Windows</Text>
- </Paragraph>
-
- <Paragraph id="F1b" gui="WNT">
- <Text id="naso2" xml:lang="en-US">Due to a Windows driver issue, you cannot scroll through ${PRODUCTNAME} documents when you slide your finger across an ALPS/Synaptics touchpad.</Text>
- </Paragraph>
-
- <Paragraph id="F1c" gui="WNT">
- <Text id="naso2" xml:lang="en-US">To enable touchpad scrolling, add the following lines to the &quot;C:\Program Files\Synaptics\SynTP\SynTPEnh.ini&quot; configuration file, and restart your computer:</Text>
- </Paragraph>
-
- <Paragraph id="F1d" gui="WNT">
- <Text id="naso2" xml:lang="en-US">[${PRODUCTNAME}]</Text>
- <Text id="naso3" xml:lang="en-US">FC = &quot;SALFRAME&quot;</Text>
- <Text id="naso4" xml:lang="en-US">SF = 0x10000000</Text>
- <Text id="naso5" xml:lang="en-US">SF |= 0x00004000</Text>
- </Paragraph>
-
- <Paragraph id="F1e" gui="WNT">
- <Text id="naso2" xml:lang="en-US">Note: The location of the configuration file might vary on different versions of Windows.</Text>
- </Paragraph>
- </Section>
-
- <Section id="NetscapeAdressBook">
-
- <Paragraph id="AdressBookHeader" style="H2" os="SOLARIS">
- <Text id="sdfsd32asrc" xml:lang="en-US">Mozilla Address Book Driver</Text>
- </Paragraph>
-
- <Paragraph id="AdressBookDriver" os="SOLARIS">
- <Text id="sdcc32asrc" xml:lang="en-US">The Mozilla address book driver requires the SUNWzlib package. This package is not part of the minimum Solaris operating system installation. If you require access to the Mozilla address book, then add this package to your Solaris operating system using the command &quot;pkgadd&quot; from the installation CD.</Text>
- </Paragraph>
- </Section>
-
- <Section id="Keyboard">
-
- <Paragraph id="abc2" style="H2">
- <Text id="awe1" xml:lang="en-US">Shortcut Keys</Text>
- </Paragraph>
-
- <Paragraph id="abc12">
- <Text id="w32e1" xml:lang="en-US">Only shortcut keys (key combinations) not used by the operating system can be used in ${PRODUCTNAME}. If a key combination in ${PRODUCTNAME} does not work as described in the ${PRODUCTNAME} Help, check if that shortcut is already used by the operating system. To rectify such conflicts, you can change the keys assigned by your operating system. Alternatively, you can change almost any key assignment in ${PRODUCTNAME}. For more information on this topic, refer to the ${PRODUCTNAME} Help or the Help documentation of your operating system.</Text>
- </Paragraph>
-
- <Paragraph id="MACKeysBETA" os="MACOSX">
- <Text id="mackeys1" xml:lang="en-US">The application help of ${PRODUCTNAME} may use shortcut combinations for PC keyboards only.</Text>
- </Paragraph>
-
- <Paragraph id="KeysChanged">
- <Text id="KeysChanged1" xml:lang="en-US">Due to a conflict with input method switching on multiple platforms, the following shortcut keys required to be changed at last minute:</Text>
- </Paragraph>
-
- <Paragraph id="KeysChangedMAC" os="MACOSX">
- <List>
- <Text id="KeysChangedMAC2" xml:lang="en-US">Cmd-Space is now Cmd-Shift-Space</Text>
- <Text id="KeysChangedMAC3" xml:lang="en-US">Cmd-Shift-Space is now Cmd-M</Text>
- </List>
- </Paragraph>
-
- <Paragraph id="KeysChangedWNT" os="WNT">
- <List>
- <Text id="KeysChangedWNT2" xml:lang="en-US">Ctrl-Space is now Ctrl-Shift-Space</Text>
- <Text id="KeysChangedWNT3" xml:lang="en-US">Ctrl-Shift-Space is now Ctrl-M</Text>
- </List>
- </Paragraph>
-
- <Paragraph id="KeysChangedLIN" os="LINUX">
- <List>
- <Text id="KeysChangedLIN2" xml:lang="en-US">Ctrl-Space is now Ctrl-Shift-Space</Text>
- <Text id="KeysChangedLIN" xml:lang="en-US">Ctrl-Shift-Space is now Ctrl-M</Text>
- </List>
- </Paragraph>
-
- <Paragraph id="KeysChangedSOL" os="SOLARIS">
- <List>
- <Text id="KeysChangedSOL2" xml:lang="en-US">Ctrl-Space is now Ctrl-Shift-Space</Text>
- <Text id="KeysChangedSOL3" xml:lang="en-US">Ctrl-Shift-Space is now Ctrl-M</Text>
- </List>
- </Paragraph>
-
- </Section>
-
- <Section id="FileLocking">
-
- <Paragraph id="G1" style="H2" gui="UNX">
- <Text id="gfh6w" xml:lang="en-US">File Locking</Text>
- </Paragraph>
-
- <Paragraph id="G2" gui="UNX">
- <Text id="pji76w" xml:lang="en-US">In the default setting, file locking is turned on in ${PRODUCTNAME}. To deactivate it, you have to set the appropriate environment variables SAL_ENABLE_FILE_LOCKING=0 and export SAL_ENABLE_FILE_LOCKING. These entries are already in enabled form in the soffice script file.</Text>
- </Paragraph>
-
- <Paragraph id="G3" gui="UNX">
- <Text id="pji76wsdf" xml:lang="en-US">Warning: The activated file locking feature can cause problems with Solaris 2.5.1 and 2.7 used in conjunction with Linux NFS 2.0. If your system environment has these parameters, we strongly recommend that you avoid using the file locking feature. Otherwise, ${PRODUCTNAME} will hang when you try to open a file from a NFS mounted directory from a Linux computer.</Text>
- </Paragraph>
- </Section>
-
- <Section id="Mapi">
-
- <Paragraph id="G1a" style="H2" gui="WNT">
- <Text id="gfh6w" xml:lang="en-US">Problems When Sending Documents as E-mails From ${PRODUCTNAME}</Text>
- </Paragraph>
-
- <Paragraph id="G2a" gui="WNT">
- <Text id="pji76w" xml:lang="en-US">When sending a document via &apos;File - Send - Document as E-mail&apos; or &apos;Document as PDF Attachment&apos; problems might occur (program crashes or hangs). This is due to the Windows system file &quot;Mapi&quot; (Messaging Application Programming Interface) which causes problems in some file versions. Unfortunately, the problem cannot be narrowed down to a certain version number. For more information visit http://www.microsoft.com to search the Microsoft Knowledge Base for &quot;mapi dll&quot;.</Text>
- </Paragraph>
- </Section>
-
- <Section id="A11y">
- <Paragraph id="aw44" style="H2">
- <Text id="aw22" xml:lang="en-US">Important Accessibility Notes</Text>
- </Paragraph>
-
- <Paragraph id="F2c" os="all">
- <Text id="access7" xml:lang="en-US">For information on the accessibility features in ${PRODUCTNAME}, see </Text>
- <Text id="abdfs2b" url="true" xml:lang="en-US">http://www.openoffice.org/access/</Text>
- <Text id="abdfs2c" xml:lang="en-US">.</Text>
- </Paragraph>
-
- </Section>
-
- <Section id="Registration"> <!-- ALL PLATFORMS -->
-
- <Paragraph id="A1" style="H2">
- <Text id="a" xml:lang="en-US">Registration </Text>
- </Paragraph>
-
- <Paragraph id="A2">
- <Text id="a" xml:lang="en-US" url="ahead">Please take a little time to complete the minimal Product Registration process when you install the software. While registration is optional, we encourage you to register, since the information enables the community to make an even better software suite and address user needs directly. Through its Privacy Policy, the ${PRODUCTNAME} Community takes every precaution to safeguard your personal data. If you missed the registration at installation, you can return and register at any time at by choosing "Help > Registration" from the main menu.</Text>
- </Paragraph>
- </Section>
-
- <Section id="UserSurvey">
-
- <Paragraph id="A1" style="H2">
- <Text id="a" xml:lang="en-US">User Survey </Text>
- </Paragraph>
-
- <Paragraph id="A2">
- <Text id="a" xml:lang="en-US">There is also a User Survey located online which we encourage you to fill out. The User Survey results will help ${PRODUCTNAME} move more rapidly in setting new standards for the creation of the next-generation office suite. Through its Privacy Policy, the ${PRODUCTNAME} Community takes every precaution to safeguard your personal data.</Text>
- </Paragraph>
- </Section>
-
- <Section id="UserSupport"> <!-- ALL PLATFORMS -->
-
- <Paragraph id="A1" style="H2">
- <Text id="a" xml:lang="en-US">User Support</Text>
- </Paragraph>
-
- <Paragraph id="A2">
- <Text id="a" xml:lang="en-US" url="ahead">The main support page </Text>
- <Text id="b" xml:lang="en-US" url="true">http://support.openoffice.org/</Text>
- <Text id="c" xml:lang="en-US" url="ahead">offers various possibilities for help with ${PRODUCTNAME}. Your question may have already been answered - check the Community Forum.</Text>
- <Text id="d" xml:lang="en-US" url="true">http://user.services.openoffice.org</Text>
- <Text id="e" xml:lang="en-US" url="ahead"> or search the archives of the 'users@openoffice.org' mailing list at </Text>
- <Text id="f" xml:lang="en-US" url="true">http://www.openoffice.org/mail_list.html</Text>
- <Text id="g" xml:lang="en-US" url="ahead">. Alternatively, you can send in your questions to </Text>
- <Text id="h" xml:lang="en-US" url="true">users@openoffice.org</Text>
- <Text id="i" xml:lang="en-US" url="ahead">. How to subscribe to the list (to get an email response) is explained on this page: </Text>
- <Text id="j" xml:lang="en-US" url="true">http://wiki.services.openoffice.org/wiki/Website/Content/help/mailinglists</Text>
- <Text id="k" xml:lang="en-US">.</Text>
- </Paragraph>
-
- <Paragraph id="A3">
- <Text id="a" xml:lang="en-US" url="ahead">Also check the FAQ section at </Text>
- <Text id="b" xml:lang="en-US" url="true">http://wiki.services.openoffice.org/wiki/Documentation/FAQ</Text>
- <Text id="c" xml:lang="en-US">.</Text>
- </Paragraph>
- </Section>
-
- <Section id="ReportBugsIssues"> <!-- ALL PLATFORMS -->
-
- <Paragraph id="A1" style="H2">
- <Text id="a" xml:lang="en-US">Report Bugs &amp; Issues </Text>
- </Paragraph>
-
- <Paragraph id="A2">
- <Text id="a" xml:lang="en-US">The ${PRODUCTNAME} Web site hosts IssueZilla, our mechanism for reporting, tracking and solving bugs and issues. We encourage all users to feel entitled and welcome to report issues that may arise on your particular platform. Energetic reporting of issues is one of the most important contributions that the user community can make to the ongoing development and improvement of the suite. </Text>
- </Paragraph>
- </Section>
-
- <Section id="GettingInvolved"> <!-- ALL PLATFORMS -->
-
- <Paragraph id="A1" style="H2">
- <Text id="a" xml:lang="en-US">Getting Involved </Text>
- </Paragraph>
-
- <Paragraph id="A2">
- <Text id="a" xml:lang="en-US">The ${PRODUCTNAME} Community would very much benefit from your active participation in the development of this important open source project.</Text>
- </Paragraph>
-
- <Paragraph id="A3">
- <Text id="a" xml:lang="en-US" url="ahead">As a user, you are already a valuable part of the suite&apos;s development process and we would like to encourage you to take an even more active role with a view to being a long-term contributor to the community. Please join and check out the user page at: </Text>
- <Text id="b" xml:lang="en-US" url="true">http://www.openoffice.org </Text>
- </Paragraph>
-
- <Paragraph id="emptyparagraph" localized="false" />
-
- <Paragraph id="A4" style="H3">
- <Text id="a" xml:lang="en-US">Way to Start</Text>
- </Paragraph>
-
- <Paragraph id="A5">
- <Text id="a" xml:lang="en-US" url="ahead">The best way to start contributing is to subscribe to one or more of the mailing lists, lurk for a while, and gradually use the mail archives to familiarize yourself with many of the topics covered since the ${PRODUCTNAME} source code was released back in October 2000. When you&apos;re comfortable, all you need to do is send an email self-introduction and jump right in. If you are familiar with Open Source Projects, check out our To-Dos list and see if there is anything you would like to help with at </Text>
- <Text id="b" xml:lang="en-US" url="true">http://development.openoffice.org/todo.html</Text>
- <Text id="c" xml:lang="en-US">.</Text>
- </Paragraph>
-
-
- <Paragraph id="A6" style="H3">
- <Text id="a" xml:lang="en-US">Subscribe</Text>
- </Paragraph>
-
- <Paragraph id="A7">
- <Text id="a" xml:lang="en-US" url="ahead">Here are a few of the Project mailing lists to which you can subscribe at </Text>
- <Text id="b" xml:lang="en-US" url="true">http://www.openoffice.org/mail_list.html</Text>
- </Paragraph>
-
- <Paragraph id="A8">
- <List>
- <Text id="a" xml:lang="en-US">News: announce@openoffice.org *recommended to all users* (light traffic) </Text>
- <Text id="c" xml:lang="en-US">Main user forum: user@openoffice.org *easy way to lurk on discussions* (heavy traffic) </Text>
- <Text id="d" xml:lang="en-US">Marketing project: dev@marketing.openoffice.org *beyond development* (getting heavy) </Text>
- <Text id="e" xml:lang="en-US">General code contributor list: dev@openoffice.org (moderate/heavy) </Text>
- </List>
- </Paragraph>
-
-
- <Paragraph id="A9" style="H3">
- <Text id="a" xml:lang="en-US">Join one or more Projects</Text>
- </Paragraph>
-
- <Paragraph id="A10">
- <Text id="a" xml:lang="en-US">You can make major contributions to this important open source project even if you have limited software design or coding experience. Yes, you!</Text>
- </Paragraph>
-
- <Paragraph id="A11">
- <Text id="a" xml:lang="en-US" url="ahead">At </Text>
- <Text id="b" xml:lang="en-US" url="true">http://projects.openoffice.org/index.html</Text>
- <Text id="c" xml:lang="en-US"> you will find projects ranging from Localization, Porting and Groupware to some real core coding projects. If you are not a developer, try the Documentation or the Marketing Project. The OpenOffice.org Marketing Project is applying both guerrilla and traditional commercial techniques to marketing open source software, and we are doing it across language and cultural barriers, so you can help just by spreading the word and telling a friend about this office suite.</Text>
- </Paragraph>
-
- <Paragraph id="A12">
- <Text id="a" xml:lang="en-US" url="ahead">You can help by joining the Marketing Communications &amp; Information Network here: </Text>
- <Text id="b" xml:lang="en-US" url="true">http://marketing.openoffice.org/contacts.html </Text>
- <Text id="c" xml:lang="en-US"> where you can provide point communication contact with press, media, government agencies, consultants, schools, Linux Users Groups and developers in your country and local community.</Text>
- </Paragraph>
- </Section>
-
-
- <Section id="Credits"> <!-- ALL PLATFORMS -->
-
- <Paragraph id="emptyparagraph" localized="false" />
-
- <Paragraph id="A1">
- <Text id="a" xml:lang="en-US">We hope you enjoy working with the new ${PRODUCTNAME} ${PRODUCTVERSION} and will join us online.</Text>
- </Paragraph>
-
- <Paragraph id="A2">
- <Text id="a" xml:lang="en-US">The OpenOffice.org Community</Text>
- </Paragraph>
-
- <Paragraph id="A3" localized="false">
- <Text id="a" xml:lang="en-US" />
- <Text id="b" xml:lang="en-US" />
- </Paragraph>
- </Section>
-
- <Section id="ModifiedSourceCode"> <!-- ALL PLATFORMS -->
-
- <Paragraph id="HH1" style="H2">
- <Text id="sdffd23r3cefwefew" xml:lang="en-US">Used / Modified Source Code</Text>
- </Paragraph>
-
- <Paragraph id="HH2">
- <Text id="sdffd23red32efew" xml:lang="en-US">Portions Copyright 1998, 1999 James Clark. Portions Copyright 1996, 1998 Netscape Communications Corporation.</Text>
- </Paragraph>
- </Section>
-</Readme>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
+
+ <title id="title" xml:lang="en-US">${PRODUCTNAME} Readme File</title>
+
+ <style type="text/css">
+ #Copyright_Trademark * {font-size: .7em;}
+ .note {border: 1px solid #993333; padding: 3px;}
+ p { margin-top: .1em; margin-bottom: .1em;}
+ .code {font-family: monospace;}
+ </style>
+ </head>
+
+ <body>
+ <div id="Intro">
+ <h1 id="Welcome" xml:lang="en-US">${PRODUCTNAME} ${PRODUCTVERSION} ReadMe</h1>
+ <p id="LatestUpdates" xml:lang="en-US">For latest updates to this readme file, see <a href="http://www.openoffice.org/welcome/readme.html">http://www.openoffice.org/welcome/readme.html</a></p>
+ <p id="A6" xml:lang="en-US">This file contains important information about this program. Please read this information very carefully before starting work.</p>
+ <p id="A7" xml:lang="en-US">The OpenOffice.org Community, responsible for the development of this product, would like to invite you to participate as a community member. As a new user, you can check out the ${PRODUCTNAME} site with helpful user information at <a href="http://www.openoffice.org/about_us/introduction.html">http://www.openoffice.org/about_us/introduction.html</a></p>
+ <p id="A9" xml:lang="en-US">Also read the sections below about getting involved in the OpenOffice.org project.</p>
+ <h3 id="A10" xml:lang="en-US">Is ${PRODUCTNAME} really free for any user? </h3>
+ <p id="A11" xml:lang="en-US">${PRODUCTNAME} is free for use by everybody. You may take this copy of ${PRODUCTNAME} and install it on as many computers as you like, and use it for any purpose you like (including commercial, government, public administration and educational use). For further details see the license text delivered together with ${PRODUCTNAME} or <a href="http://www.openoffice.org/license.html">http://www.openoffice.org/license.html</a></p>
+ <h3 id="A12" xml:lang="en-US">Why is ${PRODUCTNAME} free for any user?</h3>
+ <p id="A13" xml:lang="en-US">You can use this copy of ${PRODUCTNAME} today free of charge because individual contributors and corporate sponsors have designed, developed, tested, translated, documented, supported, marketed, and helped in many other ways to make ${PRODUCTNAME} what it is today - the world's leading open-source office software.</p>
+ <p id="A13b" xml:lang="en-US">If you appreciate their efforts, and would like to ensure OpenOffice.org continues into the future, please consider contributing to the project - see <a href="http://contributing.openoffice.org">http://contributing.openoffice.org</a> for details. Everyone has a contribution to make.</p>
+ </div>
+
+ <div id="Installation">
+ <h2 id="rr3fgf42r" xml:lang="en-US">Notes on Installation</h2>
+ <h3 id="sdfsdfgf42r" xml:lang="en-US">System Requirements</h3>
+ <div class="MAC" id="SystemRequirements_OSX">
+ <ul>
+ <li>
+ <p id="macxiOSX" xml:lang="en-US">MacOSX 10.4 (Tiger) or higher</p>
+ </li>
+
+ <li>
+ <p id="macxicpu" xml:lang="en-US">Intel processor</p>
+ </li>
+
+ <li>
+ <p id="macxiRAM" xml:lang="en-US">512 MB RAM</p>
+ </li>
+
+ <li>
+ <p id="macxHardDiksSpace" xml:lang="en-US">Up to 1.5 GB available hard disk space</p>
+ </li>
+
+ <li>
+ <p id="macxivideo" xml:lang="en-US">1024 x 768 graphic device with 256 colors (higher resolution recommended)</p>
+ </li>
+ </ul>
+ </div>
+ <div class="WIN" id="SystemRequirements_WIN">
+ <ul>
+ <li>
+ <p id="s2s3sdf2" xml:lang="en-US">Microsoft Windows 2000 (Service Pack 4 or higher), XP, Vista, or Windows 7</p>
+ </li>
+
+ <li>
+ <p id="utzu6" xml:lang="en-US">Pentium compatible PC (Pentium III or Athlon recommended)</p>
+ </li>
+
+ <li>
+ <p id="ghuj67" xml:lang="en-US">256 MB RAM (512 MB RAM recommended)</p>
+ </li>
+
+ <li>
+ <p id="jzjtzu6" xml:lang="en-US">Up to 1.5 GB available hard disk space</p>
+ </li>
+
+ <li>
+ <p id="jtzu56" xml:lang="en-US">1024x768 resolution (higher resolution recommended), at least 256 colors</p>
+ </li>
+ </ul>
+ <p class="note" id="edssc3d" xml:lang="en-US">Please be aware that administrator rights are needed for the installation process.</p>
+ <p id="MSOReg1" xml:lang="en-US">Registration of ${PRODUCTNAME} as default application for Microsoft Office formats can be forced or suppressed by using the following command line switches with the installer:</p>
+ <ul>
+ <li>
+ <p id="MSOReg2" xml:lang="en-US"><tt>/msoreg=1</tt> will force registration of ${PRODUCTNAME} as default application for Microsoft Office formats.</p>
+ </li>
+
+ <li>
+ <p id="MSOReg3" xml:lang="en-US"><tt>/msoreg=0</tt> will suppress registration of ${PRODUCTNAME} as default application for Microsoft Office formats.</p>
+ </li>
+ </ul>
+ <p id="DLLA1" xml:lang="en-US">If you perform an administrative installation using setup /a, you need to make sure that the file msvc90.dll is installed on the system. This file is required for ${PRODUCTNAME} to start after an administrative installation. You can get the file from <a href="http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF">http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF</a></p>
+ <p class="note" id="AdminNeeded" xml:lang="en-US">Please be aware that administrator rights are needed for the installation process.</p>
+ </div>
+ <div class="SOLSPARC" id="Sols2">
+ <ul>
+ <li>
+ <p id="s2335" xml:lang="en-US">Solaris 10 operating system (SPARC platform) or higher</p>
+ </li>
+
+ <li>
+ <p id="s253" xml:lang="en-US">256 MB RAM (512 MB RAM recommended)</p>
+ </li>
+
+ <li>
+ <p id="s23seg" xml:lang="en-US">Up to 1.55 GB available hard disk space</p>
+ </li>
+
+ <li>
+ <p id="s2s43gfe" xml:lang="en-US">X Server with 1024x768 resolution (higher resolution recommended), with at least 256 colors</p>
+ </li>
+
+ <li>
+ <p id="n4234rw" xml:lang="en-US">Window Manager</p>
+ </li>
+
+ <li>
+ <p id="wd2dff2" xml:lang="en-US">Gnome 2.6 or higher, with the gail 1.8.6 and the at-spi 1.7 packages, required for support of assistive technology tools (AT tools)</p>
+ </li>
+ </ul>
+ </div>
+ <div class="SOLX86" id="Solia2">
+ <ul>
+ <li>
+ <p id="s23h" xml:lang="en-US">Solaris 10 operating system (x86 platform) or higher</p>
+ </li>
+
+ <li>
+ <p id="s24f" xml:lang="en-US">256 MB RAM (512 MB RAM recommended)</p>
+ </li>
+
+ <li>
+ <p id="fgheg" xml:lang="en-US">Up to 1.55 GB available hard disk space</p>
+ </li>
+
+ <li>
+ <p id="fghfgh" xml:lang="en-US">X Server with 1024x768 resolution (higher resolution recommended), with at least 256 colors</p>
+ </li>
+
+ <li>
+ <p id="mgjfg" xml:lang="en-US">Window Manager</p>
+ </li>
+
+ <li>
+ <p id="wd2dff1" xml:lang="en-US">Gnome 2.6 or higher, with the gail 1.8.6 and the at-spi 1.7 packages, required for support of assistive technology tools (AT tools)</p>
+ </li>
+ </ul>
+ </div>
+ <div class="LINUX" id="Linuxi2">
+ <ul>
+ <li>
+ <p id="s2we35" xml:lang="en-US">Linux Kernel version 2.6.18 or higher</p>
+ </li>
+
+ <li>
+ <p id="s253we" xml:lang="en-US">glibc2 version 2.5 or higher</p>
+ </li>
+
+ <li>
+ <p id="s256we" xml:lang="en-US">gtk version 2.10.4 or higher</p>
+ </li>
+
+ <li>
+ <p id="s2etfseg" xml:lang="en-US">Pentium compatible PC (Pentium III or Athlon recommended)</p>
+ </li>
+
+ <li>
+ <p id="s2ssdfe" xml:lang="en-US">256 MB RAM (512 MB RAM recommended)</p>
+ </li>
+
+ <li>
+ <p id="n42dfgf" xml:lang="en-US">Up to 1.55 GB available hard disk space</p>
+ </li>
+
+ <li>
+ <p id="ghjhhr" xml:lang="en-US">X Server with 1024x768 resolution (higher resolution recommended), with at least 256 colors</p>
+ </li>
+
+ <li>
+ <p id="fhrtz5" xml:lang="en-US">Window Manager</p>
+ </li>
+
+ <li>
+ <p id="wd2dff" xml:lang="en-US">Gnome 2.16 or higher, with the gail 1.8.6 and the at-spi 1.7 packages, required for support of assistive technology tools (AT tools)</p>
+ </li>
+ </ul>
+ <p id="Linuxi3a" xml:lang="en-US">There is a wide variety of Linux distributions, and even within the same distribution there may be different installation options (KDE vs Gnome, etc.). Some distributions ship with their own ‘native’ version of ${PRODUCTNAME}, which may have different features from this Community ${PRODUCTNAME}. Sometimes you can install the Community ${PRODUCTNAME} alongside the ‘native’ version. However, it’s usually safer to remove the ‘native’ version before installing this Community version. Consult the documentation for your distribution for details of how to do this.</p>
+ <p class="note" id="Linuxi4a" xml:lang="en-US">It is recommended that you always backup your system before you remove or install software.</p>
+ </div>
+ <p id="Precautions" xml:lang="en-US">Please make sure you have enough free memory in the temporary directory on your system and that read, write and run access rights have been granted. Close all other programs before starting the installation.</p>
+ </div>
+
+ <div id="BerkeleyDB">
+ <h2 id="BDB11" xml:lang="en-US">Extension Database Incompatibility</h2>
+ <p id="BDB2a" xml:lang="en-US">The Berkeley database engine has been upgraded in this version of ${PRODUCTNAME}. The database engine upgrade introduces an incompatibility with user data for installed extensions for ${PRODUCTNAME} versions prior to 3.2 that may require your action if you downgrade your version of ${PRODUCTNAME}.</p>
+ <p id="BDB3a" xml:lang="en-US">This version of ${PRODUCTNAME} will convert your extension database to the new Berkeley database format when extensions are installed or removed. After this conversion, the database can no longer be read by earlier versions of ${PRODUCTNAME}. Downgrading to an earlier version may result in a dysfunctional installation.</p>
+ <p id="BDB4a" xml:lang="en-US">If you downgrade to an earlier version of ${PRODUCTNAME}, you must remove the user data directory <tt>{user data}/uno_packages</tt>, for example <tt>~/.openoffice.org/3/user/uno_packages</tt>, and reinstall all extensions.</p>
+ </div>
+
+ <div class="LINUX WIN" id="StartupProblems">
+ <h2 id="naso01" xml:lang="en-US">Problems During Program Startup</h2>
+ <div class="LINUX" id="GnomeStartupProblems">
+ <p id="naso02" xml:lang="en-US">If you experience ${PRODUCTNAME} startup problems (most notably while using Gnome) please 'unset' the <tt>SESSION_MANAGER</tt> environment variable inside the shell you use to start ${PRODUCTNAME}. This can be done by adding the line "<tt>unset SESSION_MANAGER</tt>" to the beginning of the soffice shell script found in the "<tt>[office folder]/program</tt>" directory.</p>
+ </div>
+ <p id="abcdef" xml:lang="en-US">Difficulties starting ${PRODUCTNAME} (e.g. applications hang) as well as problems with the screen display are often caused by the graphics card driver. If these problems occur, please update your graphics card driver or try using the graphics driver delivered with your operating system. Difficulties displaying 3D objects can often be solved by deactivating the option "Use OpenGL" under 'Tools - Options - ${PRODUCTNAME} - View - 3D view'.</p>
+ </div>
+
+ <div class="WIN" id="Scroll">
+ <h2 id="naso" xml:lang="en-US">ALPS/Synaptics notebook touchpads in Windows</h2>
+ <p id="naso2" xml:lang="en-US">Due to a Windows driver issue, you cannot scroll through ${PRODUCTNAME} documents when you slide your finger across an ALPS/Synaptics touchpad.</p>
+ <p id="naso6" xml:lang="en-US">To enable touchpad scrolling, add the following lines to the "<tt>C:\Program Files\Synaptics\SynTP\SynTPEnh.ini</tt>" configuration file, and restart your computer:</p>
+ <p class="code" id="naso7">[${PRODUCTNAME}]</p>
+ <p class="code" id="naso3">FC = "SALFRAME"</p>
+ <p class="code" id="naso4">SF = 0x10000000</p>
+ <p class="code" id="naso5">SF |= 0x00004000</p>
+ <p class="note" id="naso8" xml:lang="en-US">The location of the configuration file might vary on different versions of Windows.</p>
+ </div>
+
+ <div class="SOLSPARC SOLX86" id="NetscapeAdressBook">
+ <h2 id="sdfsd32asrc" xml:lang="en-US">Mozilla Address Book Driver</h2>
+ <p id="sdcc32asrc" xml:lang="en-US">The Mozilla address book driver requires the <tt>SUNWzlib</tt> package. This package is not part of the minimum Solaris operating system installation. If you require access to the Mozilla address book, then add this package to your Solaris operating system using the command "<tt>pkgadd</tt>" from the installation CD.</p>
+ </div>
+
+ <div id="Keyboard">
+ <h2 id="awe1" xml:lang="en-US">Shortcut Keys</h2>
+ <p id="w32e1" xml:lang="en-US">Only shortcut keys (key combinations) not used by the operating system can be used in ${PRODUCTNAME}. If a key combination in ${PRODUCTNAME} does not work as described in the ${PRODUCTNAME} Help, check if that shortcut is already used by the operating system. To rectify such conflicts, you can change the keys assigned by your operating system. Alternatively, you can change almost any key assignment in ${PRODUCTNAME}. For more information on this topic, refer to the ${PRODUCTNAME} Help or the Help documention of your operating system.</p>
+ <div class="MAC" id="MACKeysBETA">
+ <p id="mackeys1" xml:lang="en-US">The application help of ${PRODUCTNAME} may use shortcut combinations for PC keyboards only.</p>
+ </div>
+ </div>
+
+ <div class="LINUX MAC SOLSPARC SOLX86" id="FileLocking">
+ <h2 id="gfh6w" xml:lang="en-US">File Locking</h2>
+ <p id="pji76w" xml:lang="en-US">File locking is enabled by default in ${PRODUCTNAME}. On a network that uses the Network File System protocol (NFS), the locking daemon for NFS clients must be active. To disable file locking, edit the <tt>soffice</tt> script and change the line "<tt>export SAL_ENABLE_FILE_LOCKING</tt>" to "<tt># export SAL_ENABLE_FILE_LOCKING</tt>". If you disable file locking, the write access of a document is not restricted to the user who first opens the document.</p>
+ <p class="note" id="pji76wsdf" xml:lang="en-US">Warning: The activated file locking feature can cause problems with Solaris 2.5.1 and 2.7 used in conjunction with Linux NFS 2.0. If your system environment has these parameters, we strongly recommend that you avoid using the file locking feature. Otherwise, ${PRODUCTNAME} will hang when you try to open a file from a NFS mounted directory from a Linux computer.</p>
+ </div>
+
+ <div class="WIN" id="Mapi">
+ <h2 id="gfh6w1" xml:lang="en-US">Problems When Sending Documents as E-mails From ${PRODUCTNAME}</h2>
+ <p id="pji76w1" xml:lang="en-US">When sending a document via 'File - Send - Document as E-mail' or 'Document as PDF Attachment' problems might occur (program crashes or hangs). This is due to the Windows system file "Mapi" (Messaging Application Programming Interface) which causes problems in some file versions. Unfortunately, the problem cannot be narrowed down to a certain version number. For more information visit <a href="http://www.microsoft.com">http://www.microsoft.com</a> to search the Microsoft Knowledge Base for "mapi dll".</p>
+ </div>
+
+ <div id="A11y">
+ <h2 id="aw22" xml:lang="en-US">Important Accessibility Notes</h2>
+ <p id="access7" xml:lang="en-US">For more information on the accessibility features in ${PRODUCTNAME}, see <a href="http://www.openoffice.org/access/">http://www.openoffice.org/access/</a></p>
+ </div>
+
+ <div id="Registration">
+ <h2 id="reg1" xml:lang="en-US">Registration </h2>
+ <p id="reg2" xml:lang="en-US">Please take a little time to complete the minimal Product Registration process when you install the software. While registration is optional, we encourage you to register, since the information enables the community to make an even better software suite and address user needs directly. Through its Privacy Policy, the ${PRODUCTNAME} Community takes every precaution to safeguard your personal data. If you missed the registration at installation, you can return and register at any time at by choosing "Help - Registration" from the main menu.</p>
+ </div>
+
+ <div id="UserSurvey">
+ <h2 id="survey" xml:lang="en-US">User Survey</h2>
+ <p id="survey1" xml:lang="en-US">There is also a User Survey located online which we encourage you to fill out. The User Survey results will help ${PRODUCTNAME} move more rapidly in setting new standards for the creation of the next-generation office suite. Through its Privacy Policy, the ${PRODUCTNAME} Community takes every precaution to safeguard your personal data.</p>
+ </div>
+
+ <div id="UserSupport">
+ <h2 id="support" xml:lang="en-US">User Support</h2>
+ <p id="support1" xml:lang="en-US">The main support page <a href="http://support.openoffice.org/">http://support.openoffice.org/</a> offers various possibilities for help with ${PRODUCTNAME}. Your question may have already been answered - check the Community Forum at <a href="http://user.services.openoffice.org">http://user.services.openoffice.org</a> or search the archives of the 'users@openoffice.org' mailing list at <a href="http://www.openoffice.org/mail_list.html">http://www.openoffice.org/mail_list.html</a>. Alternatively, you can send in your questions to <a href="mailto:users@openoffice.org">users@openoffice.org</a>. How to subscribe to the list (to get an email response) is explained on this page: <a href="http://wiki.services.openoffice.org/wiki/Website/Content/help/mailinglists">http://wiki.services.openoffice.org/wiki/Website/Content/help/mailinglists</a>.</p>
+ <p id="faq" url="ahead" xml:lang="en-US">Also check the FAQ section at <a href="http://wiki.services.openoffice.org/wiki/Documentation/FAQ">http://wiki.services.openoffice.org/wiki/Documentation/FAQ.</a></p>
+ </div>
+
+ <div id="ReportBugsIssues">
+ <h2 id="reportbugs" xml:lang="en-US">Reporting Bugs &amp; Issues</h2>
+ <p id="reportbugs1" xml:lang="en-US">The ${PRODUCTNAME} Web site hosts IssueZilla, our mechanism for reporting, tracking and solving bugs and issues. We encourage all users to feel entitled and welcome to report issues that may arise on your particular platform. Energetic reporting of issues is one of the most important contributions that the user community can make to the ongoing development and improvement of the suite.</p>
+ </div>
+
+ <div id="GettingInvolved">
+ <h2 id="gettinginvolved1" xml:lang="en-US">Getting Involved</h2>
+ <p id="gettinginvolved2" xml:lang="en-US">The ${PRODUCTNAME} Community would very much benefit from your active participation in the development of this important open source project.</p>
+ <p id="gettingimvolved3" xml:lang="en-US">As a user, you are already a valuable part of the suite's development process and we would like to encourage you to take an even more active role with a view to being a long-term contributor to the community. Please join and check out the user page at <a href="http://www.openoffice.org">http://www.openoffice.org</a></p>
+ <h3 id="howtostart" xml:lang="en-US">How to Start</h3>
+ <p id="howtostart1" xml:lang="en-US">The best way to start contributing is to subscribe to one or more of the mailing lists, lurk for a while, and gradually use the mail archives to familiarize yourself with many of the topics covered since the ${PRODUCTNAME} source code was released back in October 2000. When you're comfortable, all you need to do is send an email self-introduction and jump right in. If you are familiar with Open Source Projects, check out our To-Dos list and see if there is anything you would like to help with at <a href="http://development.openoffice.org/todo.html">http://development.openoffice.org/todo.html</a>.</p>
+ <h3 id="subscribe" xml:lang="en-US">Subscribe</h3>
+ <p id="subscribe1" xml:lang="en-US">Here are a few of the Project mailing lists to which you can subscribe at <a href="http://www.openoffice.org/mail_list.html">http://www.openoffice.org/mail_list.html</a></p>
+ <ul>
+ <li>
+ <p id="subscribelist1" xml:lang="en-US">News: announce@openoffice.org *recommended to all users* (light traffic)</p>
+ </li>
+
+ <li>
+ <p id="subscribelist2" xml:lang="en-US">Main user forum: user@openoffice.org *easy way to lurk on discussions* (heavy traffic)</p>
+ </li>
+
+ <li>
+ <p id="subscribelist3" xml:lang="en-US">Marketing project: dev@marketing.openoffice.org *beyond development* (getting heavy)</p>
+ </li>
+
+ <li>
+ <p id="subscribelist4" xml:lang="en-US">General code contributor list: dev@openoffice.org (moderate/heavy)</p>
+ </li>
+ </ul>
+ <h3 xml:lang="en-US">Joining one or more Projects</h3>
+ <p id="joining" xml:lang="en-US">You can make major contributions to this important open source project even if you have limited software design or coding experience. Yes, you!</p>
+ <p id="joining1" url="ahead" xml:lang="en-US">At <a href="http://projects.openoffice.org/index.html">http://projects.openoffice.org/index.html</a> you will find projects ranging from Localization, Porting and Groupware to some real core coding projects. If you are not a developer, try the Documentation or the Marketing Project. The OpenOffice.org Marketing Project is applying both guerilla and traditional commercial techniques to marketing open source software, and we are doing it across language and cultural barriers, so you can help just by spreading the word and telling a friend about this office suite.</p>
+ <p id="joining3" xml:lang="en-US">You can help by joining the Marketing Communications &amp; Information Network on <a href="http://marketing.openoffice.org/contacts.html">http://marketing.openoffice.org/contacts.html</a> where you can provide point communication contact with press, media, government agencies, consultants, schools, Linux Users Groups and developers in your country and local community.</p>
+ </div>
+
+ <div id="Credits">
+ <p id="credits" xml:lang="en-US">We hope you enjoy working with the new ${PRODUCTNAME} ${PRODUCTVERSION} and will join us online.</p>
+ <p id="credits2" xml:lang="en-US">The OpenOffice.org Community</p>
+ </div>
+
+ <div id="ModifiedSourceCode">
+ <h2 id="sdffd23r3cefwefew" xml:lang="en-US">Used / Modified Source Code</h2>
+ <p id="sdffd23red32efew">Portions Copyright 1998, 1999 James Clark. Portions Copyright 1996, 1998 Netscape Communications Corporation.</p>
+ </div>
+ </body>
+</html>
diff --git a/readlicense_oo/source/license/license_en-US.html b/readlicense_oo/source/license/license_en-US.html
index 58ff87790434..d11c348ee9a9 100644
--- a/readlicense_oo/source/license/license_en-US.html
+++ b/readlicense_oo/source/license/license_en-US.html
@@ -19,10 +19,10 @@ in the THIRDPARTYLICENSEREADME.html file.</p>
<p>All trademarks and registered trademarks mentioned herein are the
property of their respective owners.</p>
<hr>
-<p>Copyright 2002-2008 Sun Microsystems, Inc.</p>
+<p>Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.</p>
<p>This product has been created with contributions from the
-OpenOffice.org community, of which Sun Microsystems Inc. is the
-founding member. OpenOffice.org acknowledges all community members,
+OpenOffice.org community, of which Oracle is a
+principal member. OpenOffice.org acknowledges all community members,
especially those mentioned at
http://www.openoffice.org/welcome/credits.html.</p>
<hr>
diff --git a/readlicense_oo/source/license/license_en-US.rtf b/readlicense_oo/source/license/license_en-US.rtf
index 1a8ef275f9d8..56792a79cd5f 100644
--- a/readlicense_oo/source/license/license_en-US.rtf
+++ b/readlicense_oo/source/license/license_en-US.rtf
@@ -1,271 +1,374 @@
-{\rtf1\ansi\ansicpg1252\deff0\deftab709{\fonttbl{\f0\fswiss\fprq2\fcharset0 Tahoma;}{\f1\froman\fprq2\fcharset0 Thorndale;}}
-{\colortbl ;\red0\green0\blue255;\red0\green0\blue0;\red0\green0\blue128;\red128\green128\blue128;}
-{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\lang1033\b\i\f0\fs24 License\par
-\pard\sa283\b0\i0\f1 This product is made available subject to the terms of GNU Lesser General Public License Version 3. A copy of the LGPL license can be found at http://www.openoffice.org/license.html\par
-\pard\brdrb\brdrdb\brdrw15\brdrcf4 \sa283\fs12\par
-\pard\sa283\fs24 Third Party Code. Additional copyright notices and license terms applicable to portions of the Software are set forth in the THIRDPARTYLICENSEREADME.html file.\par
-\pard\brdrb\brdrdb\brdrw15\brdrcf4 \sa283\fs12\par
-\pard\sa283\fs24 All trademarks and registered trademarks mentioned herein are the property of their respective owners.\par
-\pard\brdrb\brdrdb\brdrw15\brdrcf4 \sa283\fs12\par
-\pard\sa283\fs24 Copyright 2002,2008 Sun Microsystems, Inc.\par
-\cf2 This product has been created with contributions from the OpenOffice.org community, of which Sun Microsystems Inc. is the founding member. OpenOffice.org acknowledges all community members, especially those mentioned at\cf3\ul \cf0\ulnone http://www.openoffice.org/welcome/credits.html\par
-\par
-GNU LESSER GENERAL PUBLIC LICENSE\par
-\par
-Version 3, 29 June 2007\par
-\par
-Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\par
-\par
-Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\par
-\par
-This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.\par
-0. Additional Definitions.\par
-\par
-As used herein, \ldblquote this License\rdblquote refers to version 3 of the GNU Lesser General Public License, and the \ldblquote GNU GPL\rdblquote refers to version 3 of the GNU General Public License.\par
-\par
-\ldblquote The Library\rdblquote refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.\par
-\par
-An \ldblquote Application\rdblquote is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.\par
-\par
-A \ldblquote Combined Work\rdblquote is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the \ldblquote Linked Version\rdblquote .\par
-\par
-The \ldblquote Minimal Corresponding Source\rdblquote for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.\par
-\par
-The \ldblquote Corresponding Application Code\rdblquote for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.\par
-1. Exception to Section 3 of the GNU GPL.\par
-\par
-You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.\par
-2. Conveying Modified Versions.\par
-\par
-If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:\par
-\par
- * a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or\par
- * b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.\par
-\par
-3. Object Code Incorporating Material from Library Header Files.\par
-\par
-The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:\par
-\par
- * a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.\par
- * b) Accompany the object code with a copy of the GNU GPL and this license document.\par
-\par
-4. Combined Works.\par
-\par
-You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:\par
-\par
- * a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.\par
- * b) Accompany the Combined Work with a copy of the GNU GPL and this license document.\par
- * c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.\par
- * d) Do one of the following:\par
- o 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.\par
- o 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.\par
- * e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)\par
-\par
-5. Combined Libraries.\par
-\par
-You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:\par
-\par
- * a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.\par
- * b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.\par
-\par
-6. Revised Versions of the GNU Lesser General Public License.\par
-\par
-The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\par
-\par
-Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License \ldblquote or any later version\rdblquote applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation.\par
-\par
-If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.\par
-\par
-GNU GENERAL PUBLIC LICENSE\par
-\par
-Version 3, 29 June 2007\par
-\par
-Copyright \'a9 2007 Free Software Foundation, Inc. <http://fsf.org/>\par
-\par
-Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\par
-Preamble\par
-\par
-The GNU General Public License is a free, copyleft license for software and other kinds of works.\par
-\par
-The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.\par
-\par
-When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.\par
-\par
-To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.\par
-\par
-For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.\par
-\par
-Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.\par
-\par
-For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.\par
-\par
-Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.\par
-\par
-Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.\par
-\par
-The precise terms and conditions for copying, distribution and modification follow.\par
-TERMS AND CONDITIONS\par
-0. Definitions.\par
-\par
-\ldblquote This License\rdblquote refers to version 3 of the GNU General Public License.\par
-\par
-\ldblquote Copyright\rdblquote also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.\par
-\par
-\ldblquote The Program\rdblquote refers to any copyrightable work licensed under this License. Each licensee is addressed as \ldblquote you\rdblquote . \ldblquote Licensees\rdblquote and \ldblquote recipients\rdblquote may be individuals or organizations.\par
-\par
-To \ldblquote modify\rdblquote a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a \ldblquote modified version\rdblquote of the earlier work or a work \ldblquote based on\rdblquote the earlier work.\par
-\par
-A \ldblquote covered work\rdblquote means either the unmodified Program or a work based on the Program.\par
-\par
-To \ldblquote propagate\rdblquote a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.\par
-\par
-To \ldblquote convey\rdblquote a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.\par
-\par
-An interactive user interface displays \ldblquote Appropriate Legal Notices\rdblquote to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.\par
-1. Source Code.\par
-\par
-The \ldblquote source code\rdblquote for a work means the preferred form of the work for making modifications to it. \ldblquote Object code\rdblquote means any non-source form of a work.\par
-\par
-A \ldblquote Standard Interface\rdblquote means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.\par
-\par
-The \ldblquote System Libraries\rdblquote of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A \ldblquote Major Component\rdblquote , in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.\par
-\par
-The \ldblquote Corresponding Source\rdblquote for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.\par
-\par
-The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.\par
-\par
-The Corresponding Source for a work in source code form is that same work.\par
-2. Basic Permissions.\par
-\par
-All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.\par
-\par
-You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.\par
-\par
-Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.\par
-3. Protecting Users' Legal Rights From Anti-Circumvention Law.\par
-\par
-No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.\par
-\par
-When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.\par
-4. Conveying Verbatim Copies.\par
-\par
-You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.\par
-\par
-You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.\par
-5. Conveying Modified Source Versions.\par
-\par
-You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:\par
-\par
- * a) The work must carry prominent notices stating that you modified it, and giving a relevant date.\par
- * b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to \ldblquote keep intact all notices\rdblquote .\par
- * c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.\par
- * d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.\par
-\par
-A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an \ldblquote aggregate\rdblquote if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.\par
-6. Conveying Non-Source Forms.\par
-\par
-You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:\par
-\par
- * a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.\par
- * b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.\par
- * c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.\par
- * d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.\par
- * e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.\par
-\par
-A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.\par
-\par
-A \ldblquote User Product\rdblquote is either (1) a \ldblquote consumer product\rdblquote , which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, \ldblquote normally used\rdblquote refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.\par
-\par
-\ldblquote Installation Information\rdblquote for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.\par
-\par
-If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).\par
-\par
-The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.\par
-\par
-Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.\par
-7. Additional Terms.\par
-\par
-\ldblquote Additional permissions\rdblquote are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.\par
-\par
-When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.\par
-\par
-Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:\par
-\par
- * a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or\par
- * b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or\par
- * c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or\par
- * d) Limiting the use for publicity purposes of names of licensors or authors of the material; or\par
- * e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or\par
- * f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.\par
-\par
-All other non-permissive additional terms are considered \ldblquote further restrictions\rdblquote within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.\par
-\par
-If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.\par
-\par
-Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.\par
-8. Termination.\par
-\par
-You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).\par
-\par
-However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.\par
-\par
-Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.\par
-\par
-Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.\par
-9. Acceptance Not Required for Having Copies.\par
-\par
-You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.\par
-10. Automatic Licensing of Downstream Recipients.\par
-\par
-Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.\par
-\par
-An \ldblquote entity transaction\rdblquote is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.\par
-\par
-You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.\par
-11. Patents.\par
-\par
-A \ldblquote contributor\rdblquote is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's \ldblquote contributor version\rdblquote .\par
-\par
-A contributor's \ldblquote essential patent claims\rdblquote are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, \ldblquote control\rdblquote includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.\par
-\par
-Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.\par
-\par
-In the following three paragraphs, a \ldblquote patent license\rdblquote is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To \ldblquote grant\rdblquote such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.\par
-\par
-If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. \ldblquote Knowingly relying\rdblquote means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.\par
-\par
-If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.\par
-\par
-A patent license is \ldblquote discriminatory\rdblquote if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.\par
-\par
-Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.\par
-12. No Surrender of Others' Freedom.\par
-\par
-If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.\par
-13. Use with the GNU Affero General Public License.\par
-\par
-Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.\par
-14. Revised Versions of this License.\par
-\par
-The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\par
-\par
-Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License \ldblquote or any later version\rdblquote applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.\par
-\par
-If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.\par
-\par
-Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.\par
-15. Disclaimer of Warranty.\par
-\par
-THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \ldblquote AS IS\rdblquote WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\par
-16. Limitation of Liability.\par
-\par
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\par
-17. Interpretation of Sections 15 and 16.\par
-\par
-If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.\par
-\par
-END OF TERMS AND CONDITIONS\par
-\pard\brdrb\brdrdb\brdrw15\brdrcf4 \sa283\fs12\par
-\par
-}
-
+{\rtf1\ansi\deff1\adeflang1025
+{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\fswiss\fprq2\fcharset0 Tahoma;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq2\fcharset0 Tahoma;}{\f4\froman\fprq2\fcharset0 Thorndale{\*\falt Times New Roman};}{\f5\fnil\fprq2\fcharset0 HG Mincho Light J{\*\falt msmincho};}{\f6\fnil\fprq2\fcharset0 LucidaSans;}{\f7\fnil\fprq0\fcharset0 LucidaSans;}}
+{\colortbl;\red0\green0\blue0;\red0\green0\blue128;\red128\green128\blue128;}
+{\stylesheet{\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\snext1 Normal;}
+{\s2\sb240\sa120\keepn\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af6\afs28\lang255\ltrch\dbch\af5\langfe255\hich\f2\fs28\lang1033\loch\f2\fs28\lang1033\sbasedon1\snext3 Heading;}
+{\s3\sa120\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon1\snext3 Body Text;}
+{\s4\sa120\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af7\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon3\snext4 List;}
+{\s5\sb120\sa120\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af7\afs24\lang255\ai\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\i\loch\f1\fs24\lang1033\i\sbasedon1\snext5 caption;}
+{\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af7\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon1\snext6 Index;}
+}
+{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment StarWriter}{\vern3100}}\deftab709
+{\*\pgdsctbl
+{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}}
+{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
+\pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ai\ab\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\i\b\loch\f1\fs24\lang1033\i\b {\rtlch \ltrch\loch\f1\fs24\lang1033\i\b License}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af4\afs24\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs24\lang1033\loch\f4\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 This product is made available subject to the terms of GNU Lesser General Public License Version 3. A copy of the LGPL license can be found at http://www.openoffice.org/license.html}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\brdrb\brdrdb\brdrw15\brdrcf3\brsp0{\*\brdrb\brdlncol3\brdlnin1\brdlnout1\brdlndist20}\brsp0\rtlch\af4\afs12\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs12\lang1033\loch\f4\fs12\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af4\afs24\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs24\lang1033\loch\f4\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Third Party Code. Additional copyright notices and license terms applicable to portions of the Software are set forth in the THIRDPARTYLICENSEREADME.html file.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\brdrb\brdrdb\brdrw15\brdrcf3\brsp0{\*\brdrb\brdlncol3\brdlnin1\brdlnout1\brdlndist20}\brsp0\rtlch\af4\afs12\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs12\lang1033\loch\f4\fs12\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af4\afs24\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs24\lang1033\loch\f4\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 All trademarks and registered trademarks mentioned herein are the property of their respective owners.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\brdrb\brdrdb\brdrw15\brdrcf3\brsp0{\*\brdrb\brdlncol3\brdlnin1\brdlnout1\brdlndist20}\brsp0\rtlch\af4\afs12\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs12\lang1033\loch\f4\fs12\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af4\afs24\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs24\lang1033\loch\f4\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Copyright \'a9 2000,2010 Oracle and/or its affiliates.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\cf1\rtlch\ltrch\dbch\hich\f4\loch\f4 This product has been created with contributions from the OpenOffice.org community, of which Oracle is a principal member. OpenOffice.org acknowledges all community members, especially those mentioned at}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\cf2\ul\ulc0\rtlch\ltrch\dbch\hich\f4\loch\f4 }{\rtlch\ltrch\dbch\hich\f4\loch\f4 http://www.openoffice.org/welcome/credits.html}}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af4\afs24\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs24\lang1033\loch\f4\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 GNU LESSER GENERAL PUBLIC LICENSE}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Version 3, 29 June 2007}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 0. Additional Definitions.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 As used herein, \'93this License\'94 refers to version 3 of the GNU Lesser General Public License, and the \'93GNU GPL\'94 refers to version 3 of the GNU General Public License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Library\'94 refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 An \'93Application\'94 is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A \'93Combined Work\'94 is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the \'93Linked Version\'94.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The \'93Minimal Corresponding Source\'94 for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Vers
+ion.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The \'93Corresponding Application Code\'94 for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries
+ of the Combined Work.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 1. Exception to Section 3 of the GNU GPL.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 2. Conveying Modified Versions.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of
+the modified version:}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 3. Object Code Incorporating Material from Library Header Files.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters,
+data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) Accompany the object code with a copy of the GNU GPL and this license document.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 4. Combined Works.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do
+each of the following:}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) Accompany the Combined Work with a copy of the GNU GPL and this license document.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * d) Do one of the following:}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 o 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of t
+he Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 o 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified ve
+rsion of the Library that is interface-compatible with the Linked Version.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Co
+mbined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you
+use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 5. Combined Libraries.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of y
+our choice, if you do both of the following:}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 6. Revised Versions of the GNU Lesser General Public License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concern
+s.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License \'93or any later version\'94 applies to it, you have the option of following the terms and
+ conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the
+GNU Lesser General Public License ever published by the Free Software Foundation.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that v
+ersion for the Library.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 GNU GENERAL PUBLIC LICENSE}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Version 3, 29 June 2007}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Copyright \'a9 2007 Free Software Foundation, Inc. <http://fsf.org/>}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Preamble}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The GNU General Public License is a free, copyleft license for software and other kinds of works.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--
+to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, t
+oo.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or
+ can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect t
+he freedom of others.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them thes
+e terms so they know their rights.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attr
+ibuted erroneously to authors of previous versions.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The sy
+stematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise
+substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to
+ a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The precise terms and conditions for copying, distribution and modification follow.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 TERMS AND CONDITIONS}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 0. Definitions.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 This License\'94 refers to version 3 of the GNU General Public License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Copyright\'94 also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Program\'94 refers to any copyrightable work licensed under this License. Each licensee is addressed as \'93you\'94. \'93Licensees\'94 and \'93recipients\'94 may be individuals or organizations.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 To \'93modify\'94 a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a \'93modified version\'94 of the earlier work or a work \'93based on\'94 the earli
+er work.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A \'93covered work\'94 means either the unmodified Program or a work based on the Program.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 To \'93propagate\'94 a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes
+copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 To \'93convey\'94 a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 An interactive user interface displays \'93Appropriate Legal Notices\'94 to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work
+(except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list m
+eets this criterion.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 1. Source Code.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The \'93source code\'94 for a work means the preferred form of the work for making modifications to it. \'93Object code\'94 means any non-source form of a work.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A \'93Standard Interface\'94 means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that la
+nguage.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The \'93System Libraries\'94 of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the w
+ork with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A \'93Major Component\'94, in this context, means a major essential component (kernel, window system, and so on) of th
+e specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The \'93Corresponding Source\'94 for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not in
+clude the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition fi
+les associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms a
+nd other parts of the work.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Corresponding Source for a work in source code form is that same work.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 2. Basic Permissions.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from
+ running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you,
+or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively
+on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 3. Protecting Users' Legal Rights From Anti-Circumvention Law.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention o
+f such measures.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intentio
+n to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 4. Conveying Verbatim Copies.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 5. Conveying Modified Source Versions.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) The work must carry prominent notices stating that you modified it, and giving a relevant date.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to \'93keep intact all notices\'94.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, r
+egardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution med
+ium, is called an \'93aggregate\'94 if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause thi
+s License to apply to the other parts of the aggregate.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 6. Conveying Non-Source Forms.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that pr
+oduct model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price
+ no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in ac
+cord with subsection 6b.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to cop
+y the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided
+you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requir
+ements.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A \'93User Product\'94 is either (1) a \'93consumer product\'94, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a
+ product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, \'93normally used\'94 refers to a typical or common use of that class of product, regardless of the status of the parti
+cular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such u
+ses represent the only significant mode of use of the product.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Installation Information\'94 for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Sour
+ce. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in
+perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third
+party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been mo
+dified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password
+ or key for unpacking, reading or copying.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 7. Additional Terms.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Additional permissions\'94 are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this Lic
+ense, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to t
+he additional permissions.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You m
+ay place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * d) Limiting the use for publicity purposes of names of licensors or authors of the material; or}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions di
+rectly impose on those licensors and authors.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 All other non-permissive additional terms are considered \'93further restrictions\'94 within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is
+a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided t
+hat the further restriction does not survive such relicensing or conveying.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 8. Termination.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted
+under the third paragraph of section 11).}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the cop
+yright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work)
+from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new l
+icenses for the same material under section 10.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 9. Acceptance Not Required for Having Copies.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptanc
+e. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptan
+ce of this License to do so.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 10. Automatic Licensing of Downstream Recipients.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this Li
+cense.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 An \'93entity transaction\'94 is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party
+to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the
+predecessor in interest, if the predecessor has it or can get it with reasonable efforts.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not ini
+tiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 11. Patents.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A \'93contributor\'94 is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's \'93contributor version\'94.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A contributor's \'93essential patent claims\'94 are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its cont
+ributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, \'93control\'94 includes the right to grant patent sublicenses in a manner consistent wi
+th the requirements of this License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
+}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 In the following three paragraphs, a \'93patent license\'94 is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To \'93grant\'94 such
+a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other read
+ily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements
+ of this License, to extend the patent license to downstream recipients. \'93Knowingly relying\'94 means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a co
+untry, would infringe one or more identifiable patents in that country that you have reason to believe are valid.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate,
+ modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A patent license is \'93discriminatory\'94 if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey
+ a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third
+party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection wi
+th specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 12. No Surrender of Others' Freedom.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneousl
+y your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the
+ Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 13. Use with the GNU Affero General Public License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The te
+rms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 14. Revised Versions of this License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License \'93or any later version\'94 applies to it, you have the option of following the terms and conditions either of that
+ numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 15. Disclaimer of Warranty.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \'93AS IS\'94 WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLU
+DING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
+ SERVICING, REPAIR OR CORRECTION.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 16. Limitation of Liability.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONS
+EQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS
+), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 17. Interpretation of Sections 15 and 16.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connect
+ion with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 END OF TERMS AND CONDITIONS}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\brdrb\brdrdb\brdrw15\brdrcf3\brsp0{\*\brdrb\brdlncol3\brdlnin1\brdlnout1\brdlndist20}\brsp0\rtlch\af4\afs12\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs12\lang1033\loch\f4\fs12\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par } \ No newline at end of file
diff --git a/readlicense_oo/source/license/license_en-US.txt b/readlicense_oo/source/license/license_en-US.txt
index 6e806102600c..52fd9d1cfc16 100644
--- a/readlicense_oo/source/license/license_en-US.txt
+++ b/readlicense_oo/source/license/license_en-US.txt
@@ -7,9 +7,9 @@ Third Party Code. Additional copyright notices and license terms applicable to p
All trademarks and registered trademarks mentioned herein are the property of their respective owners.
------------------------------------
-Copyright 2002,2008 Sun Microsystems, Inc.
+Copyright (c) 2000,2010 Oracle and/or it affiliates. All rights reserved.
-This product has been created with contributions from the OpenOffice.org community, of which Sun Microsystems Inc. is the founding member. OpenOffice.org acknowledges all community members, especially those mentioned at http://www.openoffice.org/welcome/credits.html.
+This product has been created with contributions from the OpenOffice.org community, of which Oracle is a principal member. OpenOffice.org acknowledges all community members, especially those mentioned at http://www.openoffice.org/welcome/credits.html.
------------------------------------
diff --git a/readlicense_oo/util/makefile.pmk b/readlicense_oo/util/makefile.pmk
index 88974113e612..30e07779457b 100755
--- a/readlicense_oo/util/makefile.pmk
+++ b/readlicense_oo/util/makefile.pmk
@@ -53,11 +53,7 @@ $(COMMONMISC)$/readme.dtd : ..$/readme.dtd
virtual : $(MERGEDXRM) $(COMMONMISC)$/readme.dtd $(PRJ)$/docs/readme.xsl
$(MISC)$/readme_text.xsl : virtual
-.IF "$(USE_SHELL)"!="4nt"
- $(SED) 's#method="html".*>#method="text"/>#' < ..$/readme.xsl > $@
-.ELSE # "$(USE_SHELL)"!="4nt"
- $(SED) "s/method=\"html\".*>/method=\"text\"\/>/" < ..$/readme.xsl > $@
-.ENDIF # "$(USE_SHELL)"!="4nt"
+ $(SED) '' < ..$/readme.xsl > $@
$(MISC)$/$(GUI)$/$(eq,$(GUI),WNT readme README)_%.html : 'virtual'
@@-$(MKDIRHIER) $(@:d)
@@ -83,6 +79,7 @@ $(SYSTEXTDOCS) : $(MISC)$/readme_text.xsl
--stringparam os1 $(OS) --stringparam gui1 $(GUI) --stringparam com1 $(COM) \
--stringparam cp1 $(CPUNAME) --stringparam type text --stringparam lang1 $(@:b:s/readme_//:s/README_//) \
$< $(MERGEDXRM)
+
.IF "$(GUI)"=="UNX"
chmod g+w $(MISC)$/$(GUI)
.ENDIF # "$(GUI)"=="UNX"
diff --git a/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java b/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java
index 3b9e04a27210..edf6a2d806b7 100644
--- a/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java
+++ b/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java
@@ -44,15 +44,21 @@ import com.sun.star.io.XOutputStream;
import com.sun.star.io.XTruncate;
import com.sun.star.deployment.XPackage;
+import com.sun.star.deployment.ExtensionRemovedException;
public class UnoPkgContainer extends ParcelContainer
{
private Map registeredPackages = new HashMap();
+ protected String extensionDb;
+ protected String extensionRepository;
- public UnoPkgContainer( XComponentContext xCtx, String locationURL, String language ) throws com.sun.star.lang.IllegalArgumentException, com.sun.star.lang.WrappedTargetException
+ public UnoPkgContainer( XComponentContext xCtx, String locationURL,
+ String _extensionDb, String _extensionRepository, String language ) throws com.sun.star.lang.IllegalArgumentException, com.sun.star.lang.WrappedTargetException
{
super( xCtx, locationURL, language, false );
+ extensionDb = _extensionDb;
+ extensionRepository = _extensionRepository;
init();
}
@@ -217,8 +223,8 @@ public class UnoPkgContainer extends ParcelContainer
DeployedUnoPackagesDB dp = null;
try
{
- String path = containerUrl.substring( 0, containerUrl.lastIndexOf("/") );
- String packagesUrl = PathUtils.make_url( path, "Scripts/unopkg-desc.xml" );
+// String path = containerUrl.substring( 0, containerUrl.lastIndexOf("/") );
+ String packagesUrl = PathUtils.make_url( extensionDb, "/Scripts/" + extensionRepository + "-extension-desc.xml" );
LogUtils.DEBUG("getUnoPackagesDB() looking for existing db in " + packagesUrl );
if ( m_xSFA.exists( packagesUrl ) )
{
@@ -276,8 +282,8 @@ public class UnoPkgContainer extends ParcelContainer
OutputStream os = null;
try
{
- String path = containerUrl.substring( 0, containerUrl.lastIndexOf("/") );
- String packagesUrl = PathUtils.make_url( path, "Scripts/unopkg-desc.xml" );
+// String path = containerUrl.substring( 0, containerUrl.lastIndexOf("/") );
+ String packagesUrl = PathUtils.make_url( extensionDb, "/Scripts/" + extensionRepository + "-extension-desc.xml" );
xos = m_xSFA.openFileWrite( packagesUrl );
XTruncate xTrc = (XTruncate) UnoRuntime.queryInterface( XTruncate.class, xos );
if ( xTrc != null )
@@ -336,7 +342,15 @@ public class UnoPkgContainer extends ParcelContainer
LogUtils.DEBUG("** processUnoPackage getURL() -> " + uri );
LogUtils.DEBUG("** processUnoPackage getName() -> " + dPackage.getName() );
LogUtils.DEBUG("** processUnoPackage getMediaType() -> " + dPackage.getPackageType().getMediaType() );
- LogUtils.DEBUG("** processUnoPackage getDisplayName() -> " + dPackage.getDisplayName() );
+ try
+ {
+ LogUtils.DEBUG("** processUnoPackage getDisplayName() -> " + dPackage.getDisplayName() );
+ }
+ catch (com.sun.star.deployment.ExtensionRemovedException e)
+ {
+ throw new com.sun.star.lang.WrappedTargetException(e.toString(), this, e);
+ }
+
processUnoPackage( uri, language );
db = getUnoPackagesDB();
@@ -366,7 +380,10 @@ public class UnoPkgContainer extends ParcelContainer
String parentUrl = uri;
if ( uri.indexOf( "%2Funo_packages%2F" ) > -1 ||
- uri.indexOf( "/uno_packages/" ) > -1 )
+ uri.indexOf( "/uno_packages/" ) > -1 ||
+ uri.indexOf("$UNO_USER_PACKAGES_CACHE/") > -1 ||
+ uri.indexOf("$UNO_SHARED_PACKAGES_CACHE/") > -1 ||
+ uri.indexOf("$BUNDLED_EXTENSIONS/") > -1 )
{
//its in a bundle need to determine the uno-package file its in
LogUtils.DEBUG("processUnoPackage - is part of a uno bundle");
diff --git a/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java b/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java
index c43756072ba3..e83410f3f35c 100755
--- a/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java
+++ b/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java
@@ -213,26 +213,40 @@ public abstract class ScriptProvider
}
else
{
+ String extensionDb = null;
+ String extensionRepository = null;
+ if ( originalContextURL.startsWith( "bundled" ) )
+ {
+ contextUrl = "vnd.sun.star.expand:$BUNDLED_EXTENSIONS";
+ extensionDb = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::UserInstallation}/user";
+ extensionRepository = "bundled";
+ }
+
if ( originalContextURL.startsWith( "share" ) )
{
contextUrl = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::BaseInstallation}/share";
+ extensionDb = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::UserInstallation}/user";
+ extensionRepository = "shared";
}
else if ( originalContextURL.startsWith( "user" ) )
{
contextUrl = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::UserInstallation}/user";
+ extensionDb = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::UserInstallation}/user";
+ extensionRepository = "user";
}
if ( originalContextURL.endsWith( "uno_packages") )
{
isPkgProvider = true;
}
- if ( originalContextURL.endsWith( "uno_packages") && !originalContextURL.equals( contextUrl ) )
+ if ( originalContextURL.endsWith( "uno_packages") && !originalContextURL.equals( contextUrl )
+ && !extensionRepository.equals("bundled"))
{
contextUrl = PathUtils.make_url( contextUrl, "uno_packages" );
}
if ( isPkgProvider )
{
- m_container = new UnoPkgContainer( m_xContext, contextUrl, language );
+ m_container = new UnoPkgContainer( m_xContext, contextUrl, extensionDb, extensionRepository, language );
}
else
{
diff --git a/scripting/java/org/openoffice/netbeans/modules/office/filesystem/Bundle.properties b/scripting/java/org/openoffice/netbeans/modules/office/filesystem/Bundle.properties
index 3137b89dde94..f776ff9e7933 100644
--- a/scripting/java/org/openoffice/netbeans/modules/office/filesystem/Bundle.properties
+++ b/scripting/java/org/openoffice/netbeans/modules/office/filesystem/Bundle.properties
@@ -1,5 +1,6 @@
# Filesystems API
# {0} - root path
+# x-no-translate
LAB_invalid_file_system=invalid OpenOffice.org document {0}
# {0} - root path
LAB_valid_file_system={0}
diff --git a/scripting/java/org/openoffice/netbeans/modules/office/loader/Bundle.properties b/scripting/java/org/openoffice/netbeans/modules/office/loader/Bundle.properties
index a3bf47447607..eab2fa1f3fbc 100644
--- a/scripting/java/org/openoffice/netbeans/modules/office/loader/Bundle.properties
+++ b/scripting/java/org/openoffice/netbeans/modules/office/loader/Bundle.properties
@@ -3,6 +3,7 @@
#HINT_myProp=<description of my property>
#LBL_DataNode_exec_sheet=Execution
#HINT_DataNode_exec_sheet=Properties pertaining to compiling, running, and debugging.
+# x-no-translate
LBL_loaderName=<display name of the data loader>
# Datasystems API
#PROP_myProp=<name of my property>
diff --git a/scripting/java/org/openoffice/netbeans/modules/office/options/Bundle.properties b/scripting/java/org/openoffice/netbeans/modules/office/options/Bundle.properties
index b823204cb227..6a9112e8c768 100644
--- a/scripting/java/org/openoffice/netbeans/modules/office/options/Bundle.properties
+++ b/scripting/java/org/openoffice/netbeans/modules/office/options/Bundle.properties
@@ -1,4 +1,5 @@
# Options API
+# x-no-translate
LBL_settings=Office Settings
PROP_OfficeDirectory=Path to Office installation
HINT_OfficeDirectory=Path to the Office installation
diff --git a/scripting/java/org/openoffice/netbeans/modules/office/resources/Bundle.properties b/scripting/java/org/openoffice/netbeans/modules/office/resources/Bundle.properties
index 58989c2506b7..22aea6525f3d 100644
--- a/scripting/java/org/openoffice/netbeans/modules/office/resources/Bundle.properties
+++ b/scripting/java/org/openoffice/netbeans/modules/office/resources/Bundle.properties
@@ -1,3 +1,4 @@
+# x-no-translate
Templates/OfficeScripting=Office Scripting
Templates/OfficeScripting/parcel.xml=Script Parcel Descriptor
Services/MIMEResolver/org-netbeans-modules-office-mime-resolver.xml=Script Parcel Descriptor File
diff --git a/scripting/java/org/openoffice/netbeans/modules/office/wizard/Bundle.properties b/scripting/java/org/openoffice/netbeans/modules/office/wizard/Bundle.properties
index 0e4f2bd100c7..a40b4b373959 100644
--- a/scripting/java/org/openoffice/netbeans/modules/office/wizard/Bundle.properties
+++ b/scripting/java/org/openoffice/netbeans/modules/office/wizard/Bundle.properties
@@ -1,4 +1,5 @@
# Window System API
+# x-no-translate
# TopComponent
LBL_component_name=<name of component>
diff --git a/scripting/prj/build.lst b/scripting/prj/build.lst
index fc332384e047..7d5162173eae 100644..100755
--- a/scripting/prj/build.lst
+++ b/scripting/prj/build.lst
@@ -1,4 +1,4 @@
-tc scripting : oovbaapi bridges rdbmaker vcl xmlscript basic sfx2 rhino BSH:beanshell javaunohelper NULL
+tc scripting : oovbaapi vbahelper bridges rdbmaker vcl xmlscript basic sfx2 rhino BSH:beanshell javaunohelper NULL
tc scripting usr1 - all tc1_mkout NULL
tc scripting\inc nmake - all tc1_inc NULL
tc scripting\source\provider nmake - all tc1_scriptingprovider tc1_inc NULL
diff --git a/scripting/source/basprov/basprov.map b/scripting/source/basprov/basprov.map
deleted file mode 100644
index 737cddbfe3df..000000000000
--- a/scripting/source/basprov/basprov.map
+++ /dev/null
@@ -1,9 +0,0 @@
-OOO_1.1 {
- global:
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/scripting/source/basprov/makefile.mk b/scripting/source/basprov/makefile.mk
index 1555a74926e2..5001e5db288e 100644
--- a/scripting/source/basprov/makefile.mk
+++ b/scripting/source/basprov/makefile.mk
@@ -50,7 +50,7 @@ SLOFILES= \
SHL1TARGET= $(TARGET)$(DLLPOSTFIX).uno
SHL1IMPLIB= i$(TARGET)
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx
index fedbce79b218..6c3694ea237d 100644
--- a/scripting/source/dlgprov/dlgevtatt.cxx
+++ b/scripting/source/dlgprov/dlgevtatt.cxx
@@ -50,9 +50,9 @@
#include <com/sun/star/beans/MethodConcept.hpp>
#include <com/sun/star/beans/XMaterialHolder.hpp>
-#ifdef FAKE_VBA_EVENT_SUPPORT
#include <ooo/vba/XVBAToOOEventDescGen.hpp>
-#endif
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <vbahelper/vbaaccesshelper.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::awt;
@@ -104,7 +104,6 @@ namespace dlgprov
};
-#ifdef FAKE_VBA_EVENT_SUPPORT
class DialogVBAScriptListenerImpl : public DialogScriptListenerImpl
{
protected:
@@ -157,7 +156,6 @@ namespace dlgprov
}
}
}
-#endif
//.........................................................................
@@ -166,7 +164,7 @@ namespace dlgprov
// =============================================================================
DialogEventsAttacherImpl::DialogEventsAttacherImpl( const Reference< XComponentContext >& rxContext, const Reference< frame::XModel >& rxModel, const Reference< awt::XControl >& rxControl, const Reference< XInterface >& rxHandler, const Reference< beans::XIntrospectionAccess >& rxIntrospect, bool bProviderMode, const Reference< script::XScriptListener >& rxRTLListener )
- :m_xContext( rxContext )
+ :mbUseFakeVBAEvents( false ), m_xContext( rxContext )
{
// key listeners by protocol when ScriptType = 'Script'
// otherwise key is the ScriptType e.g. StarBasic
@@ -177,9 +175,22 @@ namespace dlgprov
// handler for Script & ::rtl::OUString::createFromAscii( "vnd.sun.star.UNO:" )
listernersForTypes[ rtl::OUString::createFromAscii("vnd.sun.star.UNO") ] = new DialogUnoScriptListenerImpl( rxContext, rxModel, rxControl, rxHandler, rxIntrospect, bProviderMode );
listernersForTypes[ rtl::OUString::createFromAscii("vnd.sun.star.script") ] = new DialogSFScriptListenerImpl( rxContext, rxModel );
-#ifdef FAKE_VBA_EVENT_SUPPORT
- listernersForTypes[ rtl::OUString::createFromAscii("VBAInterop") ] = new DialogVBAScriptListenerImpl( rxContext, rxControl, rxModel );
-#endif
+ // Note: in a future cws ( npower13_ObjectModule ) it will be possible
+ // to determine the vba mode from the basiclibrary container, the tunnel hack
+ // below can then be replaced
+ SfxObjectShell* pFoundShell = NULL;
+ if ( rxModel.is() )
+ {
+ uno::Reference< lang::XUnoTunnel > xObjShellTunnel( rxModel, uno::UNO_QUERY );
+ if ( xObjShellTunnel.is() )
+ {
+ pFoundShell = reinterpret_cast<SfxObjectShell*>( xObjShellTunnel->getSomething(SfxObjectShell::getUnoTunnelId()));
+ if ( pFoundShell )
+ mbUseFakeVBAEvents = ooo::vba::isAlienExcelDoc( *pFoundShell );
+ }
+ }
+ if ( mbUseFakeVBAEvents )
+ listernersForTypes[ rtl::OUString::createFromAscii("VBAInterop") ] = new DialogVBAScriptListenerImpl( rxContext, rxControl, rxModel );
}
// -----------------------------------------------------------------------------
@@ -197,7 +208,6 @@ namespace dlgprov
throw RuntimeException(); // more text info here please
return it->second;
}
-#ifdef FAKE_VBA_EVENT_SUPPORT
Reference< XScriptEventsSupplier > DialogEventsAttacherImpl::getFakeVbaEventsSupplier( const Reference< XControl >& xControl, rtl::OUString& sControlName )
{
Reference< XScriptEventsSupplier > xEventsSupplier;
@@ -210,7 +220,6 @@ namespace dlgprov
}
return xEventsSupplier;
}
-#endif
// -----------------------------------------------------------------------------
void SAL_CALL DialogEventsAttacherImpl::attachEventsToControl( const Reference< XControl>& xControl, const Reference< XScriptEventsSupplier >& xEventsSupplier, const Any& Helper )
@@ -312,7 +321,6 @@ namespace dlgprov
// go over all objects
const Reference< XInterface >* pObjects = Objects.getConstArray();
sal_Int32 nObjCount = Objects.getLength();
-#ifdef FAKE_VBA_EVENT_SUPPORT
Reference< awt::XControl > xDlgControl( Objects[ nObjCount - 1 ], uno::UNO_QUERY ); // last object is the dialog
rtl::OUString sDialogCodeName;
if ( xDlgControl.is() )
@@ -324,7 +332,6 @@ namespace dlgprov
}
catch( Exception& ){}
}
-#endif
for ( sal_Int32 i = 0; i < nObjCount; ++i )
{
@@ -339,10 +346,11 @@ namespace dlgprov
Reference< XControlModel > xControlModel = xControl->getModel();
Reference< XScriptEventsSupplier > xEventsSupplier( xControlModel, UNO_QUERY );
attachEventsToControl( xControl, xEventsSupplier, Helper );
-#ifdef FAKE_VBA_EVENT_SUPPORT
- xEventsSupplier.set( getFakeVbaEventsSupplier( xControl, sDialogCodeName ) );
- attachEventsToControl( xControl, xEventsSupplier, Helper );
-#endif
+ if ( mbUseFakeVBAEvents )
+ {
+ xEventsSupplier.set( getFakeVbaEventsSupplier( xControl, sDialogCodeName ) );
+ attachEventsToControl( xControl, xEventsSupplier, Helper );
+ }
}
}
diff --git a/scripting/source/dlgprov/dlgevtatt.hxx b/scripting/source/dlgprov/dlgevtatt.hxx
index 4b9028718a55..85b0bfcd087d 100644
--- a/scripting/source/dlgprov/dlgevtatt.hxx
+++ b/scripting/source/dlgprov/dlgevtatt.hxx
@@ -44,8 +44,6 @@
#include <hash_map>
-#define FAKE_VBA_EVENT_SUPPORT 1
-
//.........................................................................
namespace dlgprov
{
@@ -66,13 +64,12 @@ namespace dlgprov
class DialogEventsAttacherImpl : public DialogEventsAttacherImpl_BASE
{
private:
+ bool mbUseFakeVBAEvents;
ListenerHash listernersForTypes;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
::com::sun::star::uno::Reference< ::com::sun::star::script::XEventAttacher > m_xEventAttacher;
::com::sun::star::uno::Reference< ::com::sun::star::script::XScriptListener > getScriptListenerForKey( const rtl::OUString& sScriptName ) throw ( ::com::sun::star::uno::RuntimeException );
-#ifdef FAKE_VBA_EVENT_SUPPORT
::com::sun::star::uno::Reference< ::com::sun::star::script::XScriptEventsSupplier > getFakeVbaEventsSupplier( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& xControl, rtl::OUString& sCodeName );
-#endif
void SAL_CALL attachEventsToControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& xControl, const ::com::sun::star::uno::Reference< ::com::sun::star::script::XScriptEventsSupplier >& events, const ::com::sun::star::uno::Any& Helper );
public:
DialogEventsAttacherImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index c372e1f660af..aa6c6cfb966a 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -28,26 +28,22 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_scripting.hxx"
-#ifndef SCRIPTING_DLGPROV_HXX
#include "dlgprov.hxx"
-#endif
#include "dlgevtatt.hxx"
#include <com/sun/star/awt/XControlContainer.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
-#ifndef _COM_SUN_STAR_IO_XINPUTSTREAMPROVIDER_HXX_
#include <com/sun/star/io/XInputStreamProvider.hpp>
-#endif
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
+#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <com/sun/star/script/XLibraryContainer.hpp>
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
#include <cppuhelper/implementationentry.hxx>
-#endif
+#include <cppuhelper/exc_hlp.hxx>
#include <com/sun/star/beans/XIntrospection.hpp>
#include <com/sun/star/resource/XStringResourceSupplier.hpp>
#include <com/sun/star/resource/XStringResourceManager.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
-#include "com/sun/star/resource/XStringResourceWithLocation.hpp"
+#include <com/sun/star/resource/XStringResourceWithLocation.hpp>
#include <com/sun/star/document/XEmbeddedScripts.hpp>
#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
@@ -691,13 +687,22 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs
//Reference< XDialog > xDialog;
Reference< XControl > xCtrl;
Reference< XControlModel > xCtrlMod;
- // add support for basic RTL_FUNCTION
- if ( m_BasicInfo.get() )
- xCtrlMod = createDialogModelForBasic();
- else
+ try
+ {
+ // add support for basic RTL_FUNCTION
+ if ( m_BasicInfo.get() )
+ xCtrlMod = createDialogModelForBasic();
+ else
+ {
+ OSL_ENSURE( URL.getLength(), "DialogProviderImpl::getDialog: no URL!" );
+ xCtrlMod = createDialogModel( URL );
+ }
+ }
+ catch ( const RuntimeException& ) { throw; }
+ catch ( const Exception& )
{
- OSL_ENSURE( URL.getLength(), "DialogProviderImpl::getDialog: no URL!" );
- xCtrlMod = createDialogModel( URL );
+ const Any aError( ::cppu::getCaughtException() );
+ throw WrappedTargetRuntimeException( ::rtl::OUString(), *this, aError );
}
if ( xCtrlMod.is() )
{
diff --git a/scripting/source/dlgprov/dlgprov.map b/scripting/source/dlgprov/dlgprov.map
deleted file mode 100644
index 737cddbfe3df..000000000000
--- a/scripting/source/dlgprov/dlgprov.map
+++ /dev/null
@@ -1,9 +0,0 @@
-OOO_1.1 {
- global:
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/scripting/source/dlgprov/makefile.mk b/scripting/source/dlgprov/makefile.mk
index 0ad861d5c281..6c8ec298c760 100644
--- a/scripting/source/dlgprov/makefile.mk
+++ b/scripting/source/dlgprov/makefile.mk
@@ -46,7 +46,7 @@ SLOFILES= \
SHL1TARGET= $(TARGET)$(DLLPOSTFIX).uno
SHL1IMPLIB= i$(TARGET)
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
@@ -59,6 +59,7 @@ SHL1STDLIBS= \
$(COMPHELPERLIB) \
$(UCBHELPERLIB) \
$(CPPULIB) \
+ $(BASICLIB) \
$(SALLIB)
SHL1DEPN=
diff --git a/scripting/source/provider/ActiveMSPList.cxx b/scripting/source/provider/ActiveMSPList.cxx
index f8400ed77950..3c6206d8d051 100644
--- a/scripting/source/provider/ActiveMSPList.cxx
+++ b/scripting/source/provider/ActiveMSPList.cxx
@@ -59,6 +59,7 @@ ActiveMSPList::ActiveMSPList( const Reference< XComponentContext > & xContext )
{
userDirString = ::rtl::OUString::createFromAscii("user");
shareDirString = ::rtl::OUString::createFromAscii("share");
+ bundledDirString = ::rtl::OUString::createFromAscii("bundled");
}
ActiveMSPList::~ActiveMSPList()
@@ -307,6 +308,12 @@ ActiveMSPList::createNonDocMSPs()
Reference< provider::XScriptProvider > shareMsp( m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext( serviceName, args, m_xContext ), UNO_QUERY );
// should check if provider reference is valid
m_hMsps[ shareDirString ] = shareMsp;
+
+ args[ 0 ] <<= bundledDirString;
+ Reference< provider::XScriptProvider > bundledMsp( m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext( serviceName, args, m_xContext ), UNO_QUERY );
+ // should check if provider reference is valid
+ m_hMsps[ bundledDirString ] = bundledMsp;
+
created = true;
}
diff --git a/scripting/source/provider/ActiveMSPList.hxx b/scripting/source/provider/ActiveMSPList.hxx
index 5adf2fc5a961..b127f3c41b16 100644
--- a/scripting/source/provider/ActiveMSPList.hxx
+++ b/scripting/source/provider/ActiveMSPList.hxx
@@ -107,6 +107,7 @@ private:
osl::Mutex m_mutex;
::rtl::OUString userDirString;
::rtl::OUString shareDirString;
+ ::rtl::OUString bundledDirString;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
};
} // func_provider
diff --git a/scripting/source/pyprov/mailmerge.py b/scripting/source/pyprov/mailmerge.py
index f9c2f0f70b09..55c204f87dbf 100644
--- a/scripting/source/pyprov/mailmerge.py
+++ b/scripting/source/pyprov/mailmerge.py
@@ -16,6 +16,8 @@ import uno
import re
#to implement com::sun::star::mail::XMailServiceProvider
+#and
+#to implement com.sun.star.mail.XMailMessage
from com.sun.star.mail import XMailServiceProvider
from com.sun.star.mail import XMailService
@@ -37,7 +39,7 @@ from email import Encoders
from email.Header import Header
from email.MIMEMultipart import MIMEMultipart
from email.Utils import formatdate
-from email.Utils import formataddr
+from email.Utils import parseaddr
import sys, smtplib, imaplib, poplib
@@ -118,30 +120,46 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
print >> sys.stderr, "PyMailSMPTService sendMailMessage"
recipients = xMailMessage.getRecipients()
sendermail = xMailMessage.SenderAddress
- sendername = xMailMessage.SenderName
+ sendername = xMailMessage.SenderName
subject = xMailMessage.Subject
ccrecipients = xMailMessage.getCcRecipients()
bccrecipients = xMailMessage.getBccRecipients()
if dbg:
print >> sys.stderr, "PyMailSMPTService subject", subject
- print >> sys.stderr, "PyMailSMPTService from", sendername.encode('utf-8'), sendermail
- print >> sys.stderr, "PyMailSMTPService from", formataddr((sendername.encode('utf-8'), sendermail))
+ print >> sys.stderr, "PyMailSMPTService from", sendername.encode('utf-8')
+ print >> sys.stderr, "PyMailSMTPService from", sendermail
print >> sys.stderr, "PyMailSMPTService send to", recipients
attachments = xMailMessage.getAttachments()
+ textmsg = Message()
+
content = xMailMessage.Body
flavors = content.getTransferDataFlavors()
- flavor = flavors[0]
if dbg:
- print >> sys.stderr, "PyMailSMPTService mimetype is", flavor.MimeType
- textbody = content.getTransferData(flavor)
+ print >> sys.stderr, "PyMailSMPTService flavors len", len(flavors)
- textmsg = Message()
- mimeEncoding = re.sub("charset=.*", "charset=UTF-8", flavor.MimeType)
- textmsg['Content-Type'] = mimeEncoding
- textmsg['MIME-Version'] = '1.0'
- textmsg.set_payload(textbody.encode('utf-8'))
+ #Use first flavor that's sane for an email body
+ for flavor in flavors:
+ if flavor.MimeType.find('text/html') != -1 or flavor.MimeType.find('text/plain') != -1:
+ if dbg:
+ print >> sys.stderr, "PyMailSMPTService mimetype is", flavor.MimeType
+ textbody = content.getTransferData(flavor)
+ try:
+ textbody = textbody.value
+ except:
+ pass
+ textbody = textbody.encode('utf-8')
+
+ if len(textbody):
+ mimeEncoding = re.sub("charset=.*", "charset=UTF-8", flavor.MimeType)
+ 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)
+
+ break
if (len(attachments)):
msg = MIMEMultipart()
@@ -150,15 +168,31 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
else:
msg = textmsg
- msg['Subject'] = subject
- msg['From'] = formataddr((sendername.encode('utf-8'), sendermail))
+ hdr = Header(sendername, 'utf-8')
+ hdr.append('<'+sendermail+'>','us-ascii')
+ msg['Subject'] = subject
+ msg['From'] = hdr
msg['To'] = COMMASPACE.join(recipients)
if len(ccrecipients):
msg['Cc'] = COMMASPACE.join(ccrecipients)
if xMailMessage.ReplyToAddress != '':
msg['Reply-To'] = xMailMessage.ReplyToAddress
- msg['X-Mailer'] = "OpenOffice.org 2.0 via Caolan's mailmerge component"
+ mailerstring = "OpenOffice.org 2.0 via Caolan's mailmerge component"
+ try:
+ ctx = uno.getComponentContext()
+ aConfigProvider = ctx.ServiceManager.createInstance("com.sun.star.configuration.ConfigurationProvider")
+ prop = uno.createUnoStruct('com.sun.star.beans.PropertyValue')
+ prop.Name = "nodepath"
+ prop.Value = "/org.openoffice.Setup/Product"
+ aSettings = aConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess",
+ (prop,))
+ mailerstring = aSettings.getByName("ooName") + " " + \
+ aSettings.getByName("ooSetupVersion") + " via Caolan's mailmerge component"
+ except:
+ pass
+
+ msg['X-Mailer'] = mailerstring
msg['Date'] = formatdate(localtime=True)
for attachment in attachments:
@@ -344,9 +378,63 @@ class PyMailServiceProvider(unohelper.Base, XMailServiceProvider):
else:
print >> sys.stderr, "PyMailServiceProvider, unknown TYPE", aType
+class PyMailMessage(unohelper.Base, XMailMessage):
+ def __init__( self, ctx, sTo='', sFrom='', Subject='', Body=None, aMailAttachment=None ):
+ if dbg:
+ print >> sys.stderr, "PyMailMessage init"
+ self.ctx = ctx
+
+ self.recipients = sTo,
+ self.ccrecipients = ()
+ self.bccrecipients = ()
+ self.aMailAttachments = ()
+ if aMailAttachment != None:
+ self.aMailAttachments = aMailAttachment,
+
+ self.SenderName, self.SenderAddress = parseaddr(sFrom)
+ self.ReplyToAddress = sFrom
+ self.Subject = Subject
+ self.Body = Body
+ if dbg:
+ print >> sys.stderr, "post PyMailMessage init"
+ def addRecipient( self, recipient ):
+ if dbg:
+ print >> sys.stderr, "PyMailMessage.addRecipient", recipient
+ self.recipients = self.recipients, recipient
+ def addCcRecipient( self, ccrecipient ):
+ if dbg:
+ print >> sys.stderr, "PyMailMessage.addCcRecipient", ccrecipient
+ self.ccrecipients = self.ccrecipients, ccrecipient
+ def addBccRecipient( self, bccrecipient ):
+ if dbg:
+ print >> sys.stderr, "PyMailMessage.addBccRecipient", bccrecipient
+ self.bccrecipients = self.bccrecipients, bccrecipient
+ def getRecipients( self ):
+ if dbg:
+ print >> sys.stderr, "PyMailMessage.getRecipients", self.recipients
+ return self.recipients
+ def getCcRecipients( self ):
+ if dbg:
+ print >> sys.stderr, "PyMailMessage.getCcRecipients", self.ccrecipients
+ return self.ccrecipients
+ def getBccRecipients( self ):
+ if dbg:
+ print >> sys.stderr, "PyMailMessage.getBccRecipients", self.bccrecipients
+ return self.bccrecipients
+ def addAttachment( self, aMailAttachment ):
+ if dbg:
+ print >> sys.stderr, "PyMailMessage.addAttachment"
+ self.aMailAttachments = self.aMailAttachments, aMailAttachment
+ def getAttachments( self ):
+ if dbg:
+ print >> sys.stderr, "PyMailMessage.getAttachments"
+ return self.aMailAttachments
+
# pythonloader looks for a static g_ImplementationHelper variable
g_ImplementationHelper = unohelper.ImplementationHelper()
g_ImplementationHelper.addImplementation( \
PyMailServiceProvider, "org.openoffice.pyuno.MailServiceProvider",
("com.sun.star.mail.MailServiceProvider",),)
-
+g_ImplementationHelper.addImplementation( \
+ PyMailMessage, "org.openoffice.pyuno.MailMessage",
+ ("com.sun.star.mail.MailMessage",),)
diff --git a/scripting/source/stringresource/makefile.mk b/scripting/source/stringresource/makefile.mk
index afb07fddfa2f..dfc2d1979190 100644
--- a/scripting/source/stringresource/makefile.mk
+++ b/scripting/source/stringresource/makefile.mk
@@ -44,7 +44,7 @@ SLOFILES= \
SHL1TARGET= $(TARGET)$(DLLPOSTFIX).uno
SHL1IMPLIB= i$(TARGET)
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/scripting/source/stringresource/stringresource.map b/scripting/source/stringresource/stringresource.map
deleted file mode 100644
index 737cddbfe3df..000000000000
--- a/scripting/source/stringresource/stringresource.map
+++ /dev/null
@@ -1,9 +0,0 @@
-OOO_1.1 {
- global:
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx
index 7e4626e31c00..838d89d49c89 100644
--- a/scripting/source/vbaevents/eventhelper.cxx
+++ b/scripting/source/vbaevents/eventhelper.cxx
@@ -349,8 +349,8 @@ static TranslatePropMap aTranslatePropMap_Impl[] =
{ MAP_CHAR_LEN("mouseDragged"), { MAP_CHAR_LEN("_MouseMove"), ooMouseEvtToVBAMouseEvt, DenyMouseDrag, NULL } }, //liuchen, add to support VBA MouseMove event when the "Shift" key is pressed
// keyPressed ooo event
- { MAP_CHAR_LEN("keyPressed"), { MAP_CHAR_LEN("_KeyDown"), ooKeyPressedToVBAKeyUpDown, ApproveAll, NULL } },
- { MAP_CHAR_LEN("keyPressed"), { MAP_CHAR_LEN("_KeyPress"), ooKeyPressedToVBAKeyUpDown, ApproveAll, NULL } }
+ { MAP_CHAR_LEN("keyPressed"), { MAP_CHAR_LEN("_KeyDown"), ooKeyPressedToVBAKeyPressed, ApproveAll, NULL } },
+ { MAP_CHAR_LEN("keyPressed"), { MAP_CHAR_LEN("_KeyPress"), ooKeyPressedToVBAKeyPressed, ApproveAll, NULL } }
};
EventInfoHash& getEventTransInfo()
@@ -929,9 +929,12 @@ EventListener::firing_Impl(const ScriptEvent& evt, Any* /*pRet*/ ) throw(Runtime
Sequence< Any > aOutArgs;
try
{
- uno::Reference< script::provider::XScript > xScript = xScriptProvider->getScript( url );
- if ( xScript.is() )
- xScript->invoke( aArguments, aOutArgsIndex, aOutArgs );
+ if ( mpShell )
+ {
+ uno::Any aRet;
+ mpShell->CallXScript( url,
+ aArguments, aRet, aOutArgsIndex, aOutArgs, false );
+ }
}
catch ( uno::Exception& e )
{
diff --git a/scripting/source/vbaevents/makefile.mk b/scripting/source/vbaevents/makefile.mk
index 227da45f9f08..1946c61d1e0b 100644
--- a/scripting/source/vbaevents/makefile.mk
+++ b/scripting/source/vbaevents/makefile.mk
@@ -60,7 +60,7 @@ SLOFILES= \
SHL1TARGET= $(TARGET)$(DLLPOSTFIX).uno
SHL1IMPLIB= i$(TARGET)
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/scripting/source/vbaevents/vbaevents.map b/scripting/source/vbaevents/vbaevents.map
deleted file mode 100644
index 737cddbfe3df..000000000000
--- a/scripting/source/vbaevents/vbaevents.map
+++ /dev/null
@@ -1,9 +0,0 @@
-OOO_1.1 {
- global:
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/sfx2/Library_sfx2.mk b/sfx2/Library_sfx2.mk
index 9c1dc852e69c..238360da3dd4 100644
--- a/sfx2/Library_sfx2.mk
+++ b/sfx2/Library_sfx2.mk
@@ -168,14 +168,16 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/dialog/passwd \
sfx2/source/dialog/printopt \
sfx2/source/dialog/recfloat \
+ sfx2/source/dialog/securitypage \
sfx2/source/dialog/sfxdlg \
- sfx2/source/dialog/sfxurl \
sfx2/source/dialog/splitwin \
sfx2/source/dialog/srchdlg \
sfx2/source/dialog/styfitem \
sfx2/source/dialog/styledlg \
sfx2/source/dialog/tabdlg \
+ sfx2/source/dialog/taskpane \
sfx2/source/dialog/templdlg \
+ sfx2/source/dialog/titledockwin \
sfx2/source/dialog/tplcitem \
sfx2/source/dialog/tplpitem \
sfx2/source/dialog/versdlg \
@@ -209,7 +211,6 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/doc/objuno \
sfx2/source/doc/objxtor \
sfx2/source/doc/oleprops \
- sfx2/source/doc/opostponedtruncationstream \
sfx2/source/doc/ownsubfilterservice \
sfx2/source/doc/plugin \
sfx2/source/doc/printhelper \
@@ -217,11 +218,13 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/doc/sfxacldetect \
sfx2/source/doc/sfxbasemodel \
sfx2/source/doc/sfxmodelfactory \
+ sfx2/source/doc/syspath \
sfx2/source/explorer/nochaos \
sfx2/source/inet/inettbc \
sfx2/source/menu/mnuitem \
sfx2/source/menu/mnumgr \
sfx2/source/menu/objmnctl \
+ sfx2/source/menu/thessubmenu \
sfx2/source/menu/virtmenu \
sfx2/source/notify/eventsupplier \
sfx2/source/notify/hintpost \
diff --git a/sfx2/inc/pch/precompiled_sfx2.hxx b/sfx2/inc/pch/precompiled_sfx2.hxx
index 8cd8f9d8561f..b43dba7d6673 100644
--- a/sfx2/inc/pch/precompiled_sfx2.hxx
+++ b/sfx2/inc/pch/precompiled_sfx2.hxx
@@ -566,7 +566,7 @@
#include "svl/svdde.hxx"
#include "svl/svstdarr.hxx"
#include "svtools/svtdata.hxx"
-#include "svl/svtools.hrc"
+#include "svtools/svtools.hrc"
#include "unotools/syslocale.hxx"
#include "unotools/syslocaleoptions.hxx"
#include "svl/szitem.hxx"
diff --git a/sfx2/inc/sfx2/Metadatable.hxx b/sfx2/inc/sfx2/Metadatable.hxx
index 068a6c4a4544..273eb1afef87 100644
--- a/sfx2/inc/sfx2/Metadatable.hxx
+++ b/sfx2/inc/sfx2/Metadatable.hxx
@@ -98,8 +98,8 @@ public:
const bool i_bCopyPrecedesSource = false);
/** create an Undo Metadatable, which remembers this' reference */
- ::boost::shared_ptr<MetadatableUndo> CreateUndo(
- const bool i_isDelete = false);
+ ::boost::shared_ptr<MetadatableUndo> CreateUndo() const;
+ ::boost::shared_ptr<MetadatableUndo> CreateUndoForDelete();
/** restore this from Undo Metadatable */
void RestoreMetadata(::boost::shared_ptr<MetadatableUndo> const& i_pUndo);
diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx
index 17b2dee417cd..980eec04cfa6 100644
--- a/sfx2/inc/sfx2/app.hxx
+++ b/sfx2/inc/sfx2/app.hxx
@@ -33,6 +33,7 @@
#include <tools/solar.h>
#include <svl/smplhint.hxx>
#include <svl/poolitem.hxx>
+#include <vcl/image.hxx>
#include <tools/ref.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/script/XLibraryContainer.hpp>
@@ -258,7 +259,7 @@ public:
void ResetLastDir();
//#if 0 // _SOLAR__PRIVATE
- SAL_DLLPRIVATE static SfxApplication* Is_Impl() { return pApp;}
+ SAL_DLLPRIVATE static SfxApplication* Get() { return pApp;}
SAL_DLLPRIVATE SfxDispatcher* GetAppDispatcher_Impl();
SAL_DLLPRIVATE SfxDispatcher* GetDispatcher_Impl();
@@ -316,6 +317,9 @@ public:
SAL_DLLPRIVATE SfxModule* GetModule_Impl();
SAL_DLLPRIVATE ResMgr* GetOffResManager_Impl();
//#endif
+
+ /** loads the application logo as used in the about dialog and impress slideshow pause screen */
+ static Image GetApplicationLogo();
};
#define SFX_APP() SfxGetpApp()
diff --git a/sfx2/inc/sfx2/basmgr.hxx b/sfx2/inc/sfx2/basmgr.hxx
index 7156be8f8327..0227ad6515ec 100644
--- a/sfx2/inc/sfx2/basmgr.hxx
+++ b/sfx2/inc/sfx2/basmgr.hxx
@@ -28,8 +28,7 @@
#ifndef _SFX_BASMGR_HXX
#define _SFX_BASMGR_HXX
-#ifndef _BASMGR_HXX_
#include <basic/basmgr.hxx>
-#endif
+#include <svtools/svtools.hrc>
#endif //_SFX_BASMGR_HXX
diff --git a/sfx2/inc/sfx2/brokenpackageint.hxx b/sfx2/inc/sfx2/brokenpackageint.hxx
index 5186e875a6ea..5186e875a6ea 100644..100755
--- a/sfx2/inc/sfx2/brokenpackageint.hxx
+++ b/sfx2/inc/sfx2/brokenpackageint.hxx
diff --git a/sfx2/inc/sfx2/childwin.hxx b/sfx2/inc/sfx2/childwin.hxx
index cac0b72f13cf..fd1eb65d54df 100644
--- a/sfx2/inc/sfx2/childwin.hxx
+++ b/sfx2/inc/sfx2/childwin.hxx
@@ -87,13 +87,13 @@ struct SfxChildWinInfo
};
// Factory-Methode eines ChildWindows
-typedef SfxChildWindow* (*SfxChildWinCtor)( Window *pParentWindow,
+typedef SfxChildWindow* (*SfxChildWinCtor)( ::Window *pParentWindow,
sal_uInt16 nId,
SfxBindings *pBindings,
SfxChildWinInfo *pInfo);
// Factory-Methode eines ChildWindowsContexts
-typedef SfxChildWindowContext* (*SfxChildWinContextCtor)( Window *pParentWindow,
+typedef SfxChildWindowContext* (*SfxChildWinContextCtor)( ::Window *pParentWindow,
SfxBindings *pBindings,
SfxChildWinInfo *pInfo);
struct SfxChildWinContextFactory
@@ -143,8 +143,8 @@ struct SfxChildWindow_Impl;
class SFX2_DLLPUBLIC SfxChildWindowContext
{
friend class SfxChildWindow;
- Window* pWindow;
- sal_uInt16 nContextId;
+ ::Window* pWindow;
+ sal_uInt16 nContextId;
protected:
SfxChildWindowContext( sal_uInt16 nId );
@@ -152,9 +152,9 @@ protected:
public:
virtual ~SfxChildWindowContext();
- void SetWindow( Window* pWin )
+ void SetWindow( ::Window* pWin )
{ pWindow=pWin; }
- Window* GetWindow() const
+ ::Window* GetWindow() const
{ return pWindow; }
sal_uInt16 GetContextId() const
{ return nContextId; }
@@ -169,12 +169,12 @@ public:
class SFX2_DLLPUBLIC SfxChildWindow
{
- Window* pParent; // parent window ( Topwindow )
- sal_uInt16 nType; // ChildWindow-Id
+ ::Window* pParent; // parent window ( Topwindow )
+ sal_uInt16 nType; // ChildWindow-Id
protected:
SfxChildAlignment eChildAlignment;// aktuelles ::com::sun::star::drawing::Alignment
- Window* pWindow; // eigentlicher Inhalt
+ ::Window* pWindow; // eigentlicher Inhalt
SfxChildWindow_Impl* pImp; // Imp-Daten
private:
@@ -185,14 +185,14 @@ private:
{ return pContext; }
protected:
- SfxChildWindow(Window *pParentWindow, sal_uInt16 nId);
+ SfxChildWindow(::Window *pParentWindow, sal_uInt16 nId);
public:
virtual ~SfxChildWindow();
void Destroy();
- Window* GetWindow() const
+ ::Window* GetWindow() const
{ return pWindow; }
- Window* GetParent() const
+ ::Window* GetParent() const
{ return pParent; }
SfxChildAlignment GetAlignment() const
{ return eChildAlignment; }
@@ -217,17 +217,17 @@ public:
sal_uInt16 GetContextId() const
{ return pContext ? pContext->GetContextId(): 0; }
- Window* GetContextWindow() const
+ ::Window* GetContextWindow() const
{ return pContext ? pContext->GetWindow(): 0; }
- Window* GetContextWindow( SfxModule *pModule ) const;
+ ::Window* GetContextWindow( SfxModule *pModule ) const;
virtual SfxChildWinInfo GetInfo() const;
void SaveStatus(const SfxChildWinInfo& rInfo);
static void RegisterChildWindow(SfxModule*, SfxChildWinFactory*);
- static SfxChildWindow* CreateChildWindow( sal_uInt16, Window*, SfxBindings*, SfxChildWinInfo&);
+ static SfxChildWindow* CreateChildWindow( sal_uInt16, ::Window*, SfxBindings*, SfxChildWinInfo&);
void SetHideNotDelete( sal_Bool bOn );
sal_Bool IsHideNotDelete() const;
void SetHideAtToggle( sal_Bool bOn );
@@ -258,19 +258,19 @@ public:
//------------------------------------------------------------------
//! demn"achst hinf"allig !
#define SFX_DECL_CHILDWINDOW_CONTEXT(Class) \
- static SfxChildWindowContext* CreateImpl(Window *pParent, \
+ static SfxChildWindowContext* CreateImpl(::Window *pParent, \
SfxBindings *pBindings, SfxChildWinInfo* pInfo ); \
static void RegisterChildWindowContext(SfxModule *pMod=0); \
//! Das Macro der Zukunft ...
#define SFX_DECL_CHILDWINDOWCONTEXT(Class) \
- static SfxChildWindowContext* CreateImpl(Window *pParent, \
+ static SfxChildWindowContext* CreateImpl(::Window *pParent, \
SfxBindings *pBindings, SfxChildWinInfo* pInfo ); \
static void RegisterChildWindowContext(sal_uInt16, SfxModule *pMod=0); \
//! demn"achst hinf"allig !
#define SFX_IMPL_CHILDWINDOW_CONTEXT(Class, MyID, ShellClass) \
- SfxChildWindowContext* __EXPORT Class::CreateImpl( Window *pParent, \
+ SfxChildWindowContext* __EXPORT Class::CreateImpl( ::Window *pParent, \
SfxBindings *pBindings, SfxChildWinInfo* pInfo ) \
{ \
SfxChildWindowContext *pContext = new Class(pParent, \
@@ -290,7 +290,7 @@ public:
// CreateImpl mu\s noch als Parameter die Factory mitbekommen wg. ContextId
// Solange wird diese Id auf 0 gesetzt und in SfxChildWindow::CreateContext gepatched
#define SFX_IMPL_CHILDWINDOWCONTEXT(Class, MyID) \
- SfxChildWindowContext* __EXPORT Class::CreateImpl( Window *pParent, \
+ SfxChildWindowContext* __EXPORT Class::CreateImpl( ::Window *pParent, \
SfxBindings *pBindings, SfxChildWinInfo* pInfo ) \
{ \
SfxChildWindowContext *pContext = new Class(pParent,0,pBindings,pInfo);\
@@ -305,7 +305,7 @@ public:
#define SFX_DECL_CHILDWINDOW(Class) \
public : \
- static SfxChildWindow* CreateImpl(Window *pParent, sal_uInt16 nId, \
+ static SfxChildWindow* CreateImpl(::Window *pParent, sal_uInt16 nId, \
SfxBindings *pBindings, SfxChildWinInfo* pInfo ); \
static void RegisterChildWindow (sal_Bool bVisible=sal_False, SfxModule *pMod=NULL, sal_uInt16 nFlags=0); \
static sal_uInt16 GetChildWindowId ();\
@@ -315,7 +315,7 @@ public:
SFX_IMPL_POS_CHILDWINDOW(Class, MyID, CHILDWIN_NOPOS)
#define SFX_IMPL_POS_CHILDWINDOW(Class, MyID, Pos) \
- SfxChildWindow* __EXPORT Class::CreateImpl( Window *pParent, \
+ SfxChildWindow* __EXPORT Class::CreateImpl( ::Window *pParent, \
sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo* pInfo ) \
{ \
SfxChildWindow *pWin = new Class(pParent, nId, pBindings, pInfo);\
diff --git a/sfx2/inc/sfx2/docfac.hxx b/sfx2/inc/sfx2/docfac.hxx
index 3cc3eecc7ce7..7468394d2617 100644
--- a/sfx2/inc/sfx2/docfac.hxx
+++ b/sfx2/inc/sfx2/docfac.hxx
@@ -101,6 +101,7 @@ public:
const SfxFilter* GetTemplateFilter() const;
static String GetStandardTemplate( const String& rServiceName );
static void SetStandardTemplate( const String& rServiceName, const String& rTemplateName );
+ static void SetSystemTemplate( const String& rServiceName, const String& rTemplateName );
void SetDocumentServiceName( const rtl::OUString& rServiceName );
const rtl::OUString& GetDocumentServiceName() const;
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index 074f74cb0e72..e4d3ff023b3b 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -154,6 +154,7 @@ public:
const SfxFilter * GetFilter() const { return pFilter; }
const SfxFilter * GetOrigFilter( sal_Bool bNotCurrent = sal_False ) const;
const String& GetOrigURL() const;
+
SfxItemSet * GetItemSet() const;
void SetItemSet(SfxItemSet *pSet);
void Close();
@@ -327,6 +328,7 @@ public:
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 );
static sal_Bool SetWritableForUserOnly( const ::rtl::OUString& aURL );
+ static sal_uInt32 CreatePasswordToModifyHash( const ::rtl::OUString& aPasswd, sal_Bool bWriter );
};
SV_DECL_IMPL_REF( SfxMedium )
diff --git a/sfx2/inc/sfx2/docfilt.hxx b/sfx2/inc/sfx2/docfilt.hxx
index b4118272bb88..f024fdb07c06 100644
--- a/sfx2/inc/sfx2/docfilt.hxx
+++ b/sfx2/inc/sfx2/docfilt.hxx
@@ -37,6 +37,7 @@
#include <com/sun/star/uno/RuntimeException.hpp>
#include <tools/wldcrd.hxx>
+// TODO/LATER: The flags should be part of the UNO specification
#define SFX_FILTER_IMPORT 0x00000001L
#define SFX_FILTER_EXPORT 0x00000002L
#define SFX_FILTER_TEMPLATE 0x00000004L
@@ -45,13 +46,13 @@
#define SFX_FILTER_OWN 0x00000020L
#define SFX_FILTER_ALIEN 0x00000040L
#define SFX_FILTER_USESOPTIONS 0x00000080L
-#define SFX_FILTER_NOTINFILEDLG 0x00001000L
-#define SFX_FILTER_NOTINCHOOSER 0x00002000L
#define SFX_FILTER_DEFAULT 0x00000100L
#define SFX_FILTER_EXECUTABLE 0x00000200L
#define SFX_FILTER_SUPPORTSSELECTION 0x00000400L
#define SFX_FILTER_MAPTOAPPPLUG 0x00000800L
+#define SFX_FILTER_NOTINFILEDLG 0x00001000L
+#define SFX_FILTER_NOTINCHOOSER 0x00002000L
#define SFX_FILTER_ASYNC 0x00004000L
// Legt Objekt nur an, kein Laden
#define SFX_FILTER_CREATOR 0x00008000L
@@ -64,6 +65,10 @@
#define SFX_FILTER_SILENTEXPORT 0x00200000L
#define SFX_FILTER_BROWSERPREFERED 0x00400000L
+
+#define SFX_FILTER_ENCRYPTION 0x01000000L
+#define SFX_FILTER_PASSWORDTOMODIFY 0x02000000L
+
#define SFX_FILTER_PREFERED 0x10000000L
#define SFX_FILTER_VERSION_NONE 0
@@ -72,20 +77,6 @@
#include <sfx2/sfxdefs.hxx>
//========================================================================
-
-namespace sfx2 {
-
-/** Returns true if the passed string is the name of a Microsoft Office file
- format filter supporting export of password protected documents.
-
- This function is just a hack for #i105076# is fixed and needs to be removed
- then.
- */
-SFX2_DLLPUBLIC bool CheckMSPasswordCapabilityForExport( const String& rFilterName );
-
-} // namespace sfx2
-
-//========================================================================
class SfxFilterContainer;
class SotStorage;
class SFX2_DLLPUBLIC SfxFilter
diff --git a/sfx2/inc/sfx2/filedlghelper.hxx b/sfx2/inc/sfx2/filedlghelper.hxx
index d17553e2b2d0..9b775f8e827d 100644
--- a/sfx2/inc/sfx2/filedlghelper.hxx
+++ b/sfx2/inc/sfx2/filedlghelper.hxx
@@ -102,30 +102,6 @@ class Window;
#define FILE_OPEN_SERVICE_NAME_SYSTEM "com.sun.star.ui.dialogs.SystemFilePicker"
#define FILE_OPEN_SERVICE_NAME_OOO "com.sun.star.ui.dialogs.OfficeFilePicker"
-//*****************************************************************************
-// SfxUrlDialog
-//*****************************************************************************
-
-//#if 0 // _SOLAR__PRIVATE
-#ifndef DONT_USE_FILE_DIALOG_SERVICE
-
-class SfxUrlDialog : public ModalDialog
-{
-private:
- Edit aEdit;
- OKButton aOk;
- CancelButton aCancel;
-
-public:
- SfxUrlDialog( Window* pParent );
-
- String GetUrl() const { return aEdit.GetText(); }
- void SetUrl( const String& rUrl ) { aEdit.SetText( rUrl ); }
-};
-
-#endif
-//#endif
-
//-----------------------------------------------------------------------------
namespace sfx2 {
diff --git a/sfx2/inc/sfx2/htmlmode.hxx b/sfx2/inc/sfx2/htmlmode.hxx
new file mode 100644
index 000000000000..51f341c5c3c0
--- /dev/null
+++ b/sfx2/inc/sfx2/htmlmode.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 _SFX_HTMLMODE_HXX_
+#define _SFX_HTMLMODE_HXX_
+
+
+#define HTMLMODE_ON 0x0001
+#define HTMLMODE_PARA_BORDER 0x0002 /* Absatzumrandungen */
+#define HTMLMODE_PARA_DISTANCE 0x0004 /* bestimmte Absatzabstaende */
+#define HTMLMODE_SMALL_CAPS 0x0008 /* Kapitaelchen */
+#define HTMLMODE_FRM_COLUMNS 0x0010 /* spaltige Rahmen */
+#define HTMLMODE_SOME_STYLES 0x0020 /* mind. MS IE */
+#define HTMLMODE_FULL_STYLES 0x0040 /* == SW */
+#define HTMLMODE_BLINK 0x0080 /* blinkende Zeichen*/
+#define HTMLMODE_PARA_BLOCK 0x0100 /* Blocksatz */
+#define HTMLMODE_DROPCAPS 0x0200 /* Initialen*/
+#define HTMLMODE_FIRSTLINE 0x0400 /* Erstzeileneinzug mit Spacer == NS 3.0 */
+#define HTMLMODE_GRAPH_POS 0x0800 /* Grafikpositionen Hintergrund */
+#define HTMLMODE_FULL_ABS_POS 0x1000 /* abs. Rahmenpositionierung */
+#define HTMLMODE_SOME_ABS_POS 0x2000 /* abs. Rahmenpositionierung vollst.*/
+#define HTMLMODE_RESERVED1 0x4000
+#define HTMLMODE_RESERVED0 0x8000
+
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sfx2/inc/sfx2/imagemgr.hxx b/sfx2/inc/sfx2/imagemgr.hxx
index ead9b6988cea..79dc724210c4 100644
--- a/sfx2/inc/sfx2/imagemgr.hxx
+++ b/sfx2/inc/sfx2/imagemgr.hxx
@@ -33,4 +33,4 @@
#include <rtl/ustring.hxx>
#include <vcl/image.hxx>
-SFX2_DLLPUBLIC Image SAL_CALL GetImage( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, BOOL bBig, BOOL bHiContrast );
+SFX2_DLLPUBLIC Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, BOOL bBig, BOOL bHiContrast );
diff --git a/sfx2/inc/sfx2/mnumgr.hxx b/sfx2/inc/sfx2/mnumgr.hxx
index ee1c81daa603..9c9b566d9d9d 100644
--- a/sfx2/inc/sfx2/mnumgr.hxx
+++ b/sfx2/inc/sfx2/mnumgr.hxx
@@ -102,22 +102,34 @@ private:
DECL_LINK( SelectHdl, void * );
Menu* pSVMenu;
-private:
- // only declared, but not defined: don't allow copying
- SfxPopupMenuManager( const SfxPopupMenuManager& );
- SfxPopupMenuManager& operator=( const SfxPopupMenuManager& );
+ // when #i107205 gets fixed this one should be superfluous.
+ // But right now we want to avoid the memory leak that would otherwise occur,
+ // if we don't delete the pointer that got created in SfxPopupMenuManager::Popup
+ static PopupMenu * pStaticThesSubMenu;
+
+ // only declared, but not defined: don't allow copying
+ SfxPopupMenuManager( const SfxPopupMenuManager& );
+ SfxPopupMenuManager& operator=( const SfxPopupMenuManager& );
public:
SfxPopupMenuManager( const ResId&, SfxBindings& );
SfxPopupMenuManager( PopupMenu*, SfxBindings& );
~SfxPopupMenuManager();
static void ExecutePopup( const ResId&, SfxViewFrame* pViewFrame, const Point& rPoint, Window* pWindow );
+ // @deprecated!!
+ // Don't use this method any longer. The whole class will be removed in the future.
+ // Changing code which relies on Popup would need much more effort.
+ // Please contact cd@openoffice.org if you have questions or need help
static SfxPopupMenuManager* Popup( const ResId& rResId, SfxViewFrame* pFrame,const Point& rPoint, Window* pWindow );
USHORT Execute( const Point& rPos, Window *pWindow );
USHORT Execute( const Point& rPoint, Window* pWindow, va_list pArgs, const SfxPoolItem *pArg1 );
USHORT Execute( const Point& rPoint, Window* pWindow, const SfxPoolItem *pArg1 ... );
+ // @deprecated (start)!!
+ // Don't use these methods any longer. The whole class will be removed in the future.
+ // Changing code which relies on these methods would need much more effort!
+ // Please contact cd@openoffice.org if you have questions or need help
void StartInsert();
void EndInsert();
void CheckItem( USHORT, BOOL );
@@ -125,6 +137,8 @@ public:
void InsertItem( USHORT, const String&, MenuItemBits,
USHORT nPos = MENU_APPEND );
void InsertSeparator( USHORT nPos = MENU_APPEND );
+ // @deprecated (end)
+
void RemoveDisabledEntries();
void AddClipboardFunctions();
Menu* GetSVMenu();
diff --git a/sfx2/inc/sfx2/module.hxx b/sfx2/inc/sfx2/module.hxx
index 793dd8f76cab..ad83bb4a7418 100644
--- a/sfx2/inc/sfx2/module.hxx
+++ b/sfx2/inc/sfx2/module.hxx
@@ -93,6 +93,8 @@ public:
virtual void Invalidate(USHORT nId = 0);
BOOL IsActive() const;
+ /*virtual*/ bool IsChildWindowAvailable( const USHORT i_nId, const SfxViewFrame* i_pViewFrame ) const;
+
static SfxModule* GetActiveModule( SfxViewFrame* pFrame=NULL );
static FieldUnit GetCurrentFieldUnit();
FieldUnit GetFieldUnit() const;
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index 5fc5a641fd44..63eb9e8c876f 100644..100755
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -286,6 +286,7 @@ public:
sal_Bool HasName() const { return bHasName; }
virtual String GetAPIName() const;
void SetHasName( sal_Bool bSet = sal_True ) { bHasName = bSet; }
+ void SetReadOnly();
sal_Bool IsReadOnly() const;
sal_Bool IsReadOnlyMedium() const;
void SetReadOnlyUI( sal_Bool bReadOnly = sal_True );
@@ -398,7 +399,8 @@ public:
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aParams,
::com::sun::star::uno::Any& aRet,
::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex,
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam,
+ bool bRaiseError = true
);
static ErrCode CallXScript(
@@ -407,7 +409,8 @@ public:
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aParams,
::com::sun::star::uno::Any& aRet,
::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex,
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam,
+ bool bRaiseError = true
);
/** adjusts the internal macro mode, according to the current security settings
@@ -436,6 +439,13 @@ public:
void SetSaveVersionOnClose( sal_Bool bSet );
void ResetFromTemplate( const String& rTemplateName, const String& rFileName );
+ // TODO/LATER: the following two methods should be replaced by Get/SetModifPasswordInfo in future
+ sal_uInt32 GetModifyPasswordHash() const;
+ sal_Bool SetModifyPasswordHash( sal_uInt32 nHash );
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > GetModifyPasswordInfo() const;
+ sal_Bool SetModifyPasswordInfo( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aInfo );
+
static sal_uInt32 HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDoc );
virtual void ViewAssigned();
@@ -683,6 +693,15 @@ public:
sal_Int32 nVersion,
sal_Bool bTemplate = sal_False) const = 0;
+ // change recording and respective passwword protection for Writer and Calc
+ // slots available for Writer: FN_REDLINE_ON, FN_REDLINE_ON
+ // slots used for Calc: FID_CHG_RECORD, SID_CHG_PROTECT
+ virtual bool IsChangeRecording() const;
+ virtual bool HasChangeRecordProtection() const;
+ virtual void SetChangeRecording( bool bActivate );
+ virtual bool SetProtectionPassword( const String &rPassword );
+ virtual bool GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal_Int8 > &rPasswordHash );
+
// =================================
//#if 0 // _SOLAR__PRIVATE
@@ -711,6 +730,8 @@ public:
SAL_DLLPRIVATE sal_uInt16 ImplCheckSignaturesInformation(
const ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation >& aInfos );
SAL_DLLPRIVATE void CheckEncryption_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler );
+ SAL_DLLPRIVATE void SetModifyPasswordEntered( sal_Bool bEntered = sal_True );
+ SAL_DLLPRIVATE sal_Bool IsModifyPasswordEntered();
SAL_DLLPRIVATE void InitBasicManager_Impl();
SAL_DLLPRIVATE SfxObjectShell_Impl* Get_Impl() { return pImp; }
diff --git a/svx/source/svdraw/svdoimp.cxx b/sfx2/inc/sfx2/securitypage.hxx
index 7b7fa2652017..d25f0ee0b967 100644..100755
--- a/svx/source/svdraw/svdoimp.cxx
+++ b/sfx2/inc/sfx2/securitypage.hxx
@@ -24,10 +24,35 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#ifndef _SECURITYPAGE_HXX_
+#define _SECURITYPAGE_HXX_
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <svdoimp.hxx>
+#include "sfx2/tabdlg.hxx"
+#include "sfx2/htmlmode.hxx"
+
+#include <memory>
+
+
+//////////////////////////////////////////////////////////////////////
+
+struct SfxSecurityPage_Impl;
+
+class SfxSecurityPage : public SfxTabPage
+{
+ std::auto_ptr< SfxSecurityPage_Impl > m_pImpl;
+
+protected:
+ SfxSecurityPage( Window* pParent, const SfxItemSet& );
+ virtual ~SfxSecurityPage();
+
+ virtual BOOL FillItemSet( SfxItemSet& );
+ virtual void Reset( const SfxItemSet& );
+
+public:
+ static SfxTabPage* Create( Window* pParent, const SfxItemSet& );
+};
+
+//////////////////////////////////////////////////////////////////////
+
+#endif // #ifndef _SECURITYPAGE_HXX_
-///////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc
index 9feaab49cb63..44c00cc93018 100644..100755
--- a/sfx2/inc/sfx2/sfx.hrc
+++ b/sfx2/inc/sfx2/sfx.hrc
@@ -229,10 +229,15 @@
#define TP_DOCINFOUSER (RID_SFX_START+5)
#define TP_DOCINFORELOAD (RID_SFX_START+13)
#define TP_CUSTOMPROPERTIES (RID_SFX_START+14)
+#define TP_DOCINFOSECURITY (RID_SFX_START+215)
#define DLG_DOCINFO_EDT (RID_SFX_START+6)
#define TP_MANAGE_STYLES (RID_SFX_START+7)
#define DLG_STYLE_DESIGNER (RID_SFX_START+8)
+#define RID_SFX_PROTECT_RECORDS (RID_SFX_START+216)
+#define RID_SFX_UNPROTECT_RECORDS (RID_SFX_START+217)
+#define RID_SFX_INCORRECT_PASSWORD (RID_SFX_START+218)
+
#define STR_STYLE_FILTER_AUTO (RID_SFX_START+9)
#define STR_STYLE_FILTER_USED (RID_SFX_START+10)
#define STR_STYLE_FILTER_USERDEF (RID_SFX_START+11)
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index bc4c11b53184..26e1991c24b8 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -155,6 +155,7 @@
#define SID_RELOAD (SID_SFX_START + 508)
#define SID_PRINTDOCDIRECT (SID_SFX_START + 509)
#define SID_PICKLIST (SID_SFX_START + 510)
+#define SID_ATTR_XWINDOW (SID_SFX_START + 777)
#define SID_PLUGIN_MODE (SID_SFX_START + 827)
#define SID_EXPORTDOC (SID_SFX_START + 829)
#define SID_EXPORTDOCASPDF (SID_SFX_START + 1673)
@@ -306,7 +307,9 @@
#define SID_ACTIVATE_STYLE_APPLY (SID_SFX_START + 1715)
#define SID_FONT_NAME (SID_SFX_START + 1716)
#define SID_DEFAULTFILENAME (SID_SFX_START + 1717)
-#define SID_SFX_free_START (SID_SFX_START + 1718)
+#define SID_MODIFYPASSWORDINFO (SID_SFX_START + 1718)
+#define SID_RECOMMENDREADONLY (SID_SFX_START + 1719)
+#define SID_SFX_free_START (SID_SFX_START + 1720)
#define SID_SFX_free_END (SID_SFX_START + 3999)
#define SID_OPEN_NEW_VIEW (SID_SFX_START + 520)
@@ -477,6 +480,9 @@
#define SID_CAPTION (SID_SFX_START + 641)
#define SID_STATUSBARTEXT (SID_SFX_START + 642)
+// id for thesaurs entry in context menu
+#define SID_THES (SID_SFX_START + 698)
+
// default-ids for editing, cursor travellung and selection
#define SID_REDO (SID_SFX_START + 700)
#define SID_UNDO (SID_SFX_START + 701)
@@ -867,6 +873,7 @@
#define SID_HYPERLINK_GETLINK (SID_SVX_START + 361)
#define SID_HYPERLINK_SETLINK (SID_SVX_START + 362)
#define SID_NAVIGATOR (SID_SVX_START + 366)
+#define SID_TASKPANE (SID_SVX_START + 370)
#define SID_ZOOM_NEXT (SID_SVX_START + 402)
#define SID_ZOOM_PREV (SID_SVX_START + 403)
#define SID_INET_DLG (SID_SVX_START + 416)
@@ -998,5 +1005,30 @@
#endif // #ifndef _SFXSIDS_HRC
+//-----------------------------------------------------------------------
+// SfxSecurityPage related stuff
+
+#define FN_EDIT2 (SID_SW_START + 1800)
+#define FN_REDLINE_PROTECT (FN_EDIT2 + 23)
+#define FN_REDLINE_ON (FN_EDIT2 + 25)
+
+#define SID_HTML_MODE (SID_SVX_START + 414)
+
+// Calc-Id's used for SfxSecurityPage
+#ifndef SC_FUNCTION_START
+#define SC_FUNCTION_START (SID_SC_START + 200)
+#endif
+#ifndef FILE_MENU_END
+#define FILE_MENU_END (SC_FUNCTION_START + 20)
+#endif
+#ifndef EDIT_MENU_START
+#define EDIT_MENU_START (FILE_MENU_END)
+#endif
+#ifndef SC_VIEW_START
+#define SC_VIEW_START (SID_SC_START)
+#endif
+#define FID_CHG_RECORD (EDIT_MENU_START + 18)
+#define SID_CHG_PROTECT (SC_VIEW_START + 84)
+
// eof ------------------------------------------------------------------------
diff --git a/sfx2/inc/sfx2/taskpane.hxx b/sfx2/inc/sfx2/taskpane.hxx
new file mode 100644
index 000000000000..69ebd866a50b
--- /dev/null
+++ b/sfx2/inc/sfx2/taskpane.hxx
@@ -0,0 +1,245 @@
+/*************************************************************************
+ * 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 SFX_TASKPANE_HXX
+#define SFX_TASKPANE_HXX
+
+#include "sfx2/dllapi.h"
+#include "sfx2/childwin.hxx"
+#include "sfx2/titledockwin.hxx"
+
+#include <svtools/toolpanel/tabalignment.hxx>
+#include <svtools/toolpanel/tabitemcontent.hxx>
+
+#include <boost/scoped_ptr.hpp>
+#include <boost/optional.hpp>
+
+namespace svt
+{
+ class ToolPanelDeck;
+}
+
+//......................................................................................................................
+namespace sfx2
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= ITaskPaneToolPanelAccess
+ //==================================================================================================================
+ class SAL_NO_VTABLE ITaskPaneToolPanelAccess
+ {
+ public:
+ virtual void ActivateToolPanel( const ::rtl::OUString& i_rPanelURL ) = 0;
+ };
+
+ //==================================================================================================================
+ //= TaskPaneWrapper
+ //==================================================================================================================
+ class SFX2_DLLPUBLIC TaskPaneWrapper :public SfxChildWindow
+ ,public ITaskPaneToolPanelAccess
+ {
+ public:
+ TaskPaneWrapper(
+ Window* i_pParent,
+ USHORT i_nId,
+ SfxBindings* i_pBindings,
+ SfxChildWinInfo* i_pInfo
+ );
+
+ SFX_DECL_CHILDWINDOW( TaskPaneWrapper );
+
+ // ITaskPaneToolPanelAccess
+ virtual void ActivateToolPanel( const ::rtl::OUString& i_rPanelURL );
+ };
+
+ //==================================================================================================================
+ //= IToolPanelCompare
+ //==================================================================================================================
+ class SFX2_DLLPUBLIC SAL_NO_VTABLE IToolPanelCompare
+ {
+ public:
+ /** compares to tool panel URLs
+ @return
+ <ul>
+ <li>-1 if the tool panel described by i_rLHS should precede the one described by i_rRHS</li>
+ <li>0 if the two panels have no particular relative order</li>
+ <li>1 if the tool panel described by i_rLHS should succeed the one described by i_rRHS</li>
+
+ */
+ virtual short compareToolPanelsURLs(
+ const ::rtl::OUString& i_rLHS,
+ const ::rtl::OUString& i_rRHS
+ ) const = 0;
+ };
+
+ //==================================================================================================================
+ //= ModuleTaskPane
+ //==================================================================================================================
+ class ModuleTaskPane_Impl;
+ /** SFX-less version of a module dependent task pane, filled with tool panels as specified in the respective
+ module's configuration
+ */
+ class SFX2_DLLPUBLIC ModuleTaskPane : public Window
+ {
+ public:
+ /** creates a new instance
+ @param i_rParentWindow
+ the parent window
+ @param i_rDocumentFrame
+ the frame to which the task pane belongs. Will be passed to any custom tool panels created
+ via an XUIElementFactory. Also, it is used to determine the module which the task pane is
+ responsible for, thus controlling which tool panels are actually available.
+ */
+ ModuleTaskPane(
+ Window& i_rParentWindow,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rDocumentFrame
+ );
+ /** creates a new instance
+ @param i_rParentWindow
+ the parent window
+ @param i_rDocumentFrame
+ the frame to which the task pane belongs. Will be passed to any custom tool panels created
+ via an XUIElementFactory. Also, it is used to determine the module which the task pane is
+ responsible for, thus controlling which tool panels are actually available.
+ @param i_rCompare
+ a comparator for tool panel URLs, which allows controlling the order in which the panels are
+ added to the tool panel deck.
+ */
+ ModuleTaskPane(
+ Window& i_rParentWindow,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rDocumentFrame,
+ const IToolPanelCompare& i_rCompare
+ );
+ ~ModuleTaskPane();
+
+ /** determines whether a given module has any registered tool panels
+ */
+ static bool ModuleHasToolPanels( const ::rtl::OUString& i_rModuleIdentifier );
+ /** determines whether a given module has any registered tool panels
+ */
+ static bool ModuleHasToolPanels( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rDocumentFrame );
+
+ /** provides access to the Window aspect of the PanelDeck
+
+ Be careful with this method. For instance, you're not allowed to insert arbitrary IToolPanel implementations
+ into the deck, as the ModuleTaskPane has certain assumptions about the panel implementations. However,
+ you're allowed to remove and re-insert panels, which have originally been created by the ModuleTaskPane
+ itself.
+ */
+ ::svt::ToolPanelDeck& GetPanelDeck();
+ const ::svt::ToolPanelDeck& GetPanelDeck() const;
+
+ /** returns the position of the panel with the given resource URL
+ */
+ ::boost::optional< size_t >
+ GetPanelPos( const ::rtl::OUString& i_rResourceURL );
+
+ /** returns the resource URL of the panel at the specified position
+ */
+ ::rtl::OUString
+ GetPanelResourceURL( const size_t i_nPanelPos ) const;
+
+ /// sets the "classical" layout of the tool panel deck, using drawers
+ void SetDrawersLayout();
+ /// sets the new layout of the tool panel deck, using tabs
+ void SetTabsLayout( const ::svt::TabAlignment i_eTabAlignment, const ::svt::TabItemContent i_eTabContent );
+
+ protected:
+ // Window overridables
+ virtual void Resize();
+ virtual void GetFocus();
+
+ private:
+ ::boost::scoped_ptr< ModuleTaskPane_Impl > m_pImpl;
+ };
+
+ //==================================================================================================================
+ //= TaskPaneController
+ //==================================================================================================================
+ class TaskPaneController_Impl;
+ /** is a helper class for connecting a ModuleTaskPane and a TitledDockingWindow, for clients of the ModuleTaskPane
+ which do not use the TaskPaneDockingWindow
+
+ The controller will add a drop down menu to the docking window which contains one item for each panel in the
+ panel deck, and allows toggling their visibility.
+ */
+ class SFX2_DLLPUBLIC TaskPaneController
+ {
+ public:
+ TaskPaneController(
+ ModuleTaskPane& i_rTaskPane,
+ TitledDockingWindow& i_rDockingWindow
+ );
+ ~TaskPaneController();
+
+ /** sets the default title to be used for the TitledDockingWindow
+
+ When the controller switches the docking window to "tabbed" mode, then the title of the docking window
+ will contain the name of the currently active panel (since this name isn't to be seen elsewhere).
+ When the controller switches the docking window to "drawer" mode, then the title of the docking window
+ contains the default title as given here (since in this mode, the names of the panels are shown in
+ the drawers).
+ */
+ void SetDefaultTitle( const String& i_rTitle );
+
+ /// activates the panel with the given URL
+ void ActivateToolPanel( const ::rtl::OUString& i_rPanelURL );
+
+ private:
+ ::boost::scoped_ptr< TaskPaneController_Impl > m_pImpl;
+ };
+
+ //==================================================================================================================
+ //= TaskPaneDockingWindow
+ //==================================================================================================================
+ class TaskPaneDockingWindow :public TitledDockingWindow
+ ,public ITaskPaneToolPanelAccess
+ {
+ public:
+ TaskPaneDockingWindow( SfxBindings* i_pBindings, TaskPaneWrapper& i_rWrapper,
+ Window* i_pParent, WinBits i_nBits );
+
+ // ITaskPaneToolPanelAccess
+ virtual void ActivateToolPanel( const ::rtl::OUString& i_rPanelURL );
+
+ protected:
+ // Window overridables
+ virtual void GetFocus();
+
+ // TitledDockingWindow overridables
+ virtual void onLayoutDone();
+
+ private:
+ ModuleTaskPane m_aTaskPane;
+ TaskPaneController m_aPaneController;
+ };
+
+//......................................................................................................................
+} // namespace sfx2
+//......................................................................................................................
+
+#endif // SFX_TASKPANE_HXX
diff --git a/sfx2/inc/sfx2/tbxctrl.hxx b/sfx2/inc/sfx2/tbxctrl.hxx
index d618051e4063..30d82c854642 100644
--- a/sfx2/inc/sfx2/tbxctrl.hxx
+++ b/sfx2/inc/sfx2/tbxctrl.hxx
@@ -243,6 +243,7 @@ protected:
virtual void SAL_CALL release() throw();
// XEventListener
+ using ::cppu::OPropertySetHelper::disposing;
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& aEvent ) throw( ::com::sun::star::uno::RuntimeException );
// XComponent
diff --git a/sfx2/inc/sfx2/titledockwin.hxx b/sfx2/inc/sfx2/titledockwin.hxx
new file mode 100644
index 000000000000..ebb4497a0ba2
--- /dev/null
+++ b/sfx2/inc/sfx2/titledockwin.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 SFX_TITLEDOCKWIN_HXX
+#define SFX_TITLEDOCKWIN_HXX
+
+#include "sfx2/dllapi.h"
+#include "sfx2/dockwin.hxx"
+
+#include <vcl/toolbox.hxx>
+#include <tools/svborder.hxx>
+
+//......................................................................................................................
+namespace sfx2
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= TitledDockingWindow
+ //==================================================================================================================
+ class SFX2_DLLPUBLIC TitledDockingWindow : public SfxDockingWindow
+ {
+ public:
+ TitledDockingWindow(
+ SfxBindings* i_pBindings, SfxChildWindow* i_pChildWindow,
+ Window* i_pParent, WinBits i_nStyle = 0
+ );
+
+ TitledDockingWindow( SfxBindings* i_pBindings, SfxChildWindow* i_pChildWindow,
+ Window* i_pParent, const ResId& i_rResId
+ );
+
+ virtual ~TitledDockingWindow();
+
+ /** sets a title to be displayed in the docking window
+ */
+ void SetTitle( const String& i_rTitle );
+ /** returns the current title displayed in the docking window
+
+ Note that if you never called SetTitle before, then this method will not return an empty string,
+ but the window text (Window::GetText), since this is what is displayed as title then.
+ */
+ String GetTitle() const;
+
+ /** adds a drop down item to the toolbox. Usually, this is used to add some kind of menu to the toolbox.
+
+ @param i_rItemText
+ the text to display for the item
+ @param i_nHelpId
+ the help ID for the new toolbox item
+ @param i_rCallback
+ the callback to invoke when the drop item has been clicked
+ @return
+ the ID of the newly created toolbox item
+ */
+ USHORT AddDropDownToolBoxItem( const String& i_rItemText, ULONG i_nHelpId, const Link& i_rCallback )
+ {
+ return impl_addDropDownToolBoxItem( i_rItemText, i_nHelpId, i_rCallback );
+ }
+
+ void SetEndDockingHdl( const Link& i_rEndDockingHdl ) { m_aEndDockingHdl = i_rEndDockingHdl; }
+ const Link& GetEndDockingHdl() const { return m_aEndDockingHdl; }
+
+ /** resets the toolbox. Upon return, the only item in the toolbox is the closer.
+ */
+ void ResetToolBox()
+ {
+ impl_resetToolBox();
+ }
+
+ /** returns the content window, which is to be used as parent window for any content to be displayed
+ in the docking window.
+ */
+ ::Window& GetContentWindow() { return m_aContentWindow; }
+ const ::Window& GetContentWindow() const { return m_aContentWindow; }
+
+ ToolBox& GetToolBox() { return m_aToolbox; }
+ const ToolBox& GetToolBox() const { return m_aToolbox; }
+
+ protected:
+ // Window overridables
+ virtual void Paint( const Rectangle& i_rArea );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType i_nType );
+ virtual void DataChanged( const DataChangedEvent& i_rDataChangedEvent );
+ virtual void SetText( const String& i_rText );
+
+ // DockingWindow overridables
+ void EndDocking( const Rectangle& rRect, BOOL bFloatMode );
+
+ // own overridables
+ virtual void onLayoutDone();
+
+ protected:
+ /** internal version of ResetToolBox
+ */
+ void impl_resetToolBox();
+
+ /** internal version of AddDropDownToolBoxItem
+ */
+ USHORT impl_addDropDownToolBoxItem( const String& i_rItemText, ULONG i_nHelpId, const Link& i_rCallback );
+
+ /** returns the current title.
+
+ If no title has been set via SetTitle, then the window text (Window::GetText) is returned.
+ */
+ String impl_getTitle() const;
+
+ private:
+ DECL_LINK( OnToolboxItemSelected, ToolBox* );
+
+ void impl_construct();
+ void impl_layout();
+ void impl_scheduleLayout();
+
+ private:
+ String m_sTitle;
+ ToolBox m_aToolbox;
+ Window m_aContentWindow;
+
+ Link m_aEndDockingHdl;
+
+ /** The border that is painted arround the inner window. The bevel
+ shadow lines are part of the border, so where the border is 0 no
+ such line is painted.
+ */
+ SvBorder m_aBorder;
+
+ /** Remember that a layout is pending, i.e. Resize() has been called
+ since the last Paint().
+ */
+ bool m_bLayoutPending;
+ };
+
+//......................................................................................................................
+} // namespace sfx2
+//......................................................................................................................
+
+#endif // SFX_TITLEDOCKWIN_HXX
diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx
index 8350bc5f0f9d..d376236bf830 100644
--- a/sfx2/inc/sfx2/viewfrm.hxx
+++ b/sfx2/inc/sfx2/viewfrm.hxx
@@ -40,6 +40,8 @@
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XController2.hpp>
+#include <tools/svborder.hxx>
+
class SfxMacro;
class SvBorder;
class SfxDispatcher;
@@ -70,67 +72,6 @@ SV_DECL_REF(SfxObjectShell)
#endif
//========================================================================
-#include <tools/gen.hxx>
-class SvBorder
-{
- long nTop, nRight, nBottom, nLeft;
-public:
- SvBorder()
- { nTop = nRight = nBottom = nLeft = 0; }
- SvBorder( const Size & rSz )
- { nTop = nBottom = rSz.Height(); nRight = nLeft = rSz.Width(); }
- SvBorder( const Rectangle & rOuter, const Rectangle & rInner );
- SvBorder( long nLeftP, long nTopP, long nRightP, long nBottomP )
- { nLeft = nLeftP; nTop = nTopP; nRight = nRightP; nBottom = nBottomP; }
- BOOL operator == ( const SvBorder & rObj ) const
- {
- return nTop == rObj.nTop && nRight == rObj.nRight &&
- nBottom == rObj.nBottom && nLeft == rObj.nLeft;
- }
- BOOL operator != ( const SvBorder & rObj ) const
- { return !(*this == rObj); }
- SvBorder & operator = ( const SvBorder & rBorder )
- {
- Left() = rBorder.Left();
- Top() = rBorder.Top();
- Right() = rBorder.Right();
- Bottom() = rBorder.Bottom();
- return *this;
- }
- SvBorder & operator += ( const SvBorder & rBorder )
- {
- Left() += rBorder.Left();
- Top() += rBorder.Top();
- Right() += rBorder.Right();
- Bottom() += rBorder.Bottom();
- return *this;
- }
- SvBorder & operator -= ( const SvBorder & rBorder )
- {
- Left() -= rBorder.Left();
- Top() -= rBorder.Top();
- Right() -= rBorder.Right();
- Bottom() -= rBorder.Bottom();
- return *this;
- }
- BOOL IsInside( const SvBorder & rInside )
- {
- return nTop >= rInside.nTop && nRight >= rInside.nRight &&
- nBottom >= rInside.nBottom && nLeft >= rInside.nLeft;
- }
- long & Top() { return nTop; }
- long & Right() { return nRight; }
- long & Bottom() { return nBottom; }
- long & Left() { return nLeft; }
- long Top() const { return nTop; }
- long Right() const { return nRight; }
- long Bottom() const { return nBottom; }
- long Left() const { return nLeft; }
-};
-Rectangle & operator += ( Rectangle & rRect, const SvBorder & rBorder );
-Rectangle & operator -= ( Rectangle & rRect, const SvBorder & rBorder );
-
-
DBG_NAMEEX(SfxViewFrame)
class SFX2_DLLPUBLIC SfxViewFrame: public SfxShell, public SfxListener
{
@@ -228,6 +169,8 @@ public:
String UpdateTitle();
+ static void ActivateToolPanel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, const ::rtl::OUString& i_rPanelURL );
+
// interne Handler
SAL_DLLPRIVATE virtual BOOL SetBorderPixelImpl( const SfxViewShell *pSh, const SvBorder &rBorder );
SAL_DLLPRIVATE virtual const SvBorder& GetBorderPixelImpl( const SfxViewShell *pSh ) const;
@@ -304,6 +247,7 @@ public:
SAL_DLLPRIVATE void INetState_Impl(SfxItemSet &);
SAL_DLLPRIVATE void SetCurViewId_Impl( const USHORT i_nID );
+ SAL_DLLPRIVATE void ActivateToolPanel_Impl( const ::rtl::OUString& i_rPanelURL );
//#endif
private:
diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx
index dcb2e87530ea..eee2868c2352 100644
--- a/sfx2/inc/sfx2/viewsh.hxx
+++ b/sfx2/inc/sfx2/viewsh.hxx
@@ -59,6 +59,7 @@ class SfxTabPage;
class SfxPrintMonitor;
class SfxFrameSetDescriptor;
class PrintDialog;
+class Printer;
class SfxPrinter;
class SfxProgress;
class SvStringsDtor;
@@ -149,6 +150,7 @@ class SFX2_DLLPUBLIC SfxViewShell: public SfxShell, public SfxListener
friend class SfxViewFrame;
friend class SfxPlugInFrame;
friend class SfxBaseController;
+friend class SfxPrinterController;
#endif
struct SfxViewShell_Impl* pImp;
@@ -188,10 +190,6 @@ public:
SfxViewShell( SfxViewFrame *pFrame, USHORT nFlags = 0 );
virtual ~SfxViewShell();
- // In-Place
- // should be superfluous
- //virtual SfxInPlaceClient* CreateIPClient( WorkWindow * pTop, WorkWindow * pDoc, Window * pDraw );
-
SfxInPlaceClient* GetIPClient() const;
SfxInPlaceClient* GetUIActiveClient() const;
SfxInPlaceClient* FindIPClient( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj, Window *pObjParentWin ) const;
@@ -250,6 +248,7 @@ public:
void LockPrinter( BOOL bLock = TRUE );
BOOL IsPrinterLocked() const;
virtual JobSetup GetJobSetup() const;
+ Printer* GetActivePrinter() const;
// Workingset
virtual void WriteUserData( String&, BOOL bBrowse = FALSE );
diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst
index 7dc2a95cb994..f27d5944c772 100644
--- a/sfx2/prj/build.lst
+++ b/sfx2/prj/build.lst
@@ -1,4 +1,4 @@
-sf sfx2 : l10n idl basic xmlscript framework shell setup_native sax SYSTRAY_GTK:libegg LIBXML2:libxml2 NULL
+sf sfx2 : l10n idl basic xmlscript framework readlicense_oo shell setup_native sax SYSTRAY_GTK:libegg LIBXML2:libxml2 NULL
sf sfx2 usr1 - all sf_mkout NULL
sf sfx2\prj nmake - all sf_prj NULL
diff --git a/sfx2/qa/complex/DocumentMetadataAccessTest.java b/sfx2/qa/complex/DocumentMetadataAccessTest.java
index 05dc523d6f8b..a61280c45fe5 100644
--- a/sfx2/qa/complex/DocumentMetadataAccessTest.java
+++ b/sfx2/qa/complex/DocumentMetadataAccessTest.java
@@ -42,6 +42,7 @@ import com.sun.star.lang.WrappedTargetException;
import com.sun.star.lang.WrappedTargetRuntimeException;
import com.sun.star.beans.XPropertySet;
import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.Pair;
import com.sun.star.beans.StringPair;
import com.sun.star.container.XEnumerationAccess;
import com.sun.star.container.XEnumeration;
@@ -689,23 +690,25 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
log.println("Checking RDFa in loaded test document...");
XMetadatable xPara;
- Statement[] stmts;
+ Pair<Statement[], Boolean> result;
Statement x_FooBarLit1 = new Statement(foo, bar, mkLit("1"), null);
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
+ result = xRep.getStatementRDFa(xPara);
assure("RDFa: 1",
- eq(stmts, new Statement[] {
+ !result.Second &&
+ eq(result.First, new Statement[] {
x_FooBarLit1
}));
Statement x_FooBarLit2 = new Statement(foo, bar, mkLit("2"), null);
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
+ result = xRep.getStatementRDFa(xPara);
assure("RDFa: 2",
- eq(stmts, new Statement[] {
+ !result.Second &&
+ eq(result.First, new Statement[] {
x_FooBarLit2
}));
@@ -713,37 +716,40 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
new Statement(blank1, bar, mkLit("3"), null);
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
+ result = xRep.getStatementRDFa(xPara);
assure("RDFa: 3",
- eq(stmts, new Statement[] {
+ !result.Second &&
+ eq(result.First, new Statement[] {
x_BlankBarLit3
}));
XBlankNode b3 = (XBlankNode) UnoRuntime.queryInterface(
- XBlankNode.class, stmts[0].Subject);
+ XBlankNode.class, result.First[0].Subject);
Statement x_BlankBarLit4 =
new Statement(blank2, bar, mkLit("4"), null);
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
+ result = xRep.getStatementRDFa(xPara);
assure("RDFa: 4",
- eq(stmts, new Statement[] {
+ !result.Second &&
+ eq(result.First, new Statement[] {
x_BlankBarLit4
}));
XBlankNode b4 = (XBlankNode) UnoRuntime.queryInterface(
- XBlankNode.class, stmts[0].Subject);
+ XBlankNode.class, result.First[0].Subject);
Statement x_BlankBarLit5 =
new Statement(blank1, bar, mkLit("5"), null);
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
+ result = xRep.getStatementRDFa(xPara);
assure("RDFa: 5",
- eq(stmts, new Statement[] {
+ !result.Second &&
+ eq(result.First, new Statement[] {
x_BlankBarLit5
}));
XBlankNode b5 = (XBlankNode) UnoRuntime.queryInterface(
- XBlankNode.class, stmts[0].Subject);
+ XBlankNode.class, result.First[0].Subject);
assure("RDFa: 3 != 4",
!b3.getStringValue().equals(b4.getStringValue()));
@@ -754,9 +760,10 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
Statement x_FooBazLit6 = new Statement(foo, baz, mkLit("6"), null);
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
+ result = xRep.getStatementRDFa(xPara);
assure("RDFa: 6",
- eq(stmts, new Statement[] {
+ !result.Second &&
+ eq(result.First, new Statement[] {
x_FooBarLit6, x_FooBazLit6
}));
@@ -765,9 +772,10 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
Statement x_FooFooLit7 = new Statement(foo, foo, mkLit("7"), null);
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
+ result = xRep.getStatementRDFa(xPara);
assure("RDFa: 7",
- eq(stmts, new Statement[] {
+ !result.Second &&
+ eq(result.First, new Statement[] {
x_FooBarLit7, x_FooBazLit7, x_FooFooLit7
}));
@@ -776,43 +784,41 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
Statement x_FooBarLit = new Statement(foo, bar, lit, null);
Statement x_FooBarLittype = new Statement(foo, bar, lit_type, null);
- Statement x_FooLabelLit8 =
- new Statement(foo, rdfs_label, mkLit("8"), null);
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
+ result = xRep.getStatementRDFa(xPara);
assure("RDFa: 8",
- eq(stmts, new Statement[] {
- x_FooBarLit, x_FooLabelLit8
+ result.Second &&
+ eq(result.First, new Statement[] {
+ x_FooBarLit
}));
- Statement x_FooLabelLit9 =
- new Statement(foo, rdfs_label, mkLit("9"), null);
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
+ result = xRep.getStatementRDFa(xPara);
assure("RDFa: 9",
- eq(stmts, new Statement[] {
- x_FooBarLit, x_FooLabelLit9
+ result.Second &&
+ eq(result.First, new Statement[] {
+ x_FooBarLit
}));
- Statement x_FooLabelLit10 =
- new Statement(foo, rdfs_label, mkLit("10"), null);
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
+ result = xRep.getStatementRDFa(xPara);
assure("RDFa: 10",
- eq(stmts, new Statement[] {
- x_FooBarLittype, x_FooLabelLit10
+ result.Second &&
+ eq(result.First, new Statement[] {
+ x_FooBarLittype
}));
Statement x_FooBarLit11
= new Statement(foo, bar, mkLit("11", bar), null);
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
+ result = xRep.getStatementRDFa(xPara);
assure("RDFa: 11",
- eq(stmts, new Statement[] {
+ !result.Second &&
+ eq(result.First, new Statement[] {
x_FooBarLit11
}));
@@ -821,66 +827,67 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
new Statement(xFile, bar, mkLit("12"), null);
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
+ result = xRep.getStatementRDFa(xPara);
assure("RDFa: 12",
- eq(stmts, new Statement[] {
+ !result.Second &&
+ eq(result.First, new Statement[] {
x_FileBarLit12
}));
- Statement x_FooLabelLit13 =
- new Statement(foo, rdfs_label, mkLit("13"), null);
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
+ result = xRep.getStatementRDFa(xPara);
assure("RDFa: 13",
- eq(stmts, new Statement[] {
- x_FooBarLit, x_FooLabelLit13
+ result.Second &&
+ eq(result.First, new Statement[] {
+ x_FooBarLit
}));
Statement x_FooLabelLit14 =
new Statement(foo, rdfs_label, mkLit("14"), null);
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
+ result = xRep.getStatementRDFa(xPara);
assure("RDFa: 14",
- eq(stmts, new Statement[] {
- x_FooBarLit, x_FooLabelLit14
+ result.Second &&
+ eq(result.First, new Statement[] {
+ x_FooBarLit
}));
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
- assure("RDFa: 15", eq(stmts, new Statement[] { } ));
+ result = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 15", eq(result.First, new Statement[] { } ));
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
- assure("RDFa: 16", eq(stmts, new Statement[] { } ));
+ result = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 16", eq(result.First, new Statement[] { } ));
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
- assure("RDFa: 17", eq(stmts, new Statement[] { } ));
+ result = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 17", eq(result.First, new Statement[] { } ));
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
- assure("RDFa: 18", eq(stmts, new Statement[] { } ));
+ result = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 18", eq(result.First, new Statement[] { } ));
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
- assure("RDFa: 19", eq(stmts, new Statement[] { } ));
+ result = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 19", eq(result.First, new Statement[] { } ));
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
- assure("RDFa: 20", eq(stmts, new Statement[] { } ));
+ result = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 20", eq(result.First, new Statement[] { } ));
xPara = (XMetadatable) UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- stmts = xRep.getStatementRDFa(xPara);
- assure("RDFa: 21", eq(stmts, new Statement[] { } ));
+ result = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 21", eq(result.First, new Statement[] { } ));
log.println("...done");
diff --git a/sfx2/qa/complex/docinfo/makefile.mk b/sfx2/qa/complex/docinfo/makefile.mk
index 18cfdb534450..8c3525541062 100644
--- a/sfx2/qa/complex/docinfo/makefile.mk
+++ b/sfx2/qa/complex/docinfo/makefile.mk
@@ -53,4 +53,4 @@ JARCOMPRESS = TRUE
run:
- $(JAVAI) -cp $(CLASSPATH) org.openoffice.Runner -TestBase java_complex -o $(PACKAGE:s#$/#.#).$(JAVAFILES:b)
+ $(JAVAI) $(JAVAIFLAGS) -cp $(CLASSPATH) org.openoffice.Runner -TestBase java_complex -o $(PACKAGE:s#$/#.#).$(JAVAFILES:b)
diff --git a/sfx2/qa/cppunit/makefile.mk b/sfx2/qa/cppunit/makefile.mk
new file mode 100644
index 000000000000..2794c2ae92bb
--- /dev/null
+++ b/sfx2/qa/cppunit/makefile.mk
@@ -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.
+#
+#*************************************************************************
+
+PRJ=../..
+PRJNAME=sfx2
+TARGET=qa_cppunit
+
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+CFLAGSCXX += $(CPPUNIT_CFLAGS)
+DLLPRE = # no leading "lib" on .so files
+
+# --- Libs ---------------------------------------------------------
+
+SHL1OBJS= \
+ $(SLO)/test_metadatable.obj \
+
+
+SHL1STDLIBS= \
+ $(CPPUNITLIB) \
+ $(SALLIB) \
+ $(CPPULIB) \
+ $(CPPUHELPERLIB) \
+ $(VCLLIB) \
+ $(SFXLIB) \
+
+
+SHL1TARGET= test_metadatable
+SHL1RPATH = NONE
+SHL1IMPLIB= i$(SHL1TARGET)
+# SHL1DEF= $(MISC)/$(SHL1TARGET).def
+DEF1NAME=$(SHL1TARGET)
+# DEF1EXPORTFILE= export.exp
+SHL1VERSIONMAP= version.map
+
+# --- All object files ---------------------------------------------
+
+SLOFILES= \
+ $(SHL1OBJS) \
+
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+.INCLUDE : _cppunit.mk
+
diff --git a/sfx2/qa/cppunit/test_metadatable.cxx b/sfx2/qa/cppunit/test_metadatable.cxx
new file mode 100644
index 000000000000..903be6920327
--- /dev/null
+++ b/sfx2/qa/cppunit/test_metadatable.cxx
@@ -0,0 +1,280 @@
+/*************************************************************************
+ *
+ * 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_sfx2.hxx"
+
+#include <cppunit/TestAssert.h>
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/plugin/TestPlugIn.h>
+
+#include <rtl/ustrbuf.hxx>
+
+#include <com/sun/star/util/DateTime.hpp>
+#include <com/sun/star/util/Date.hpp>
+#include <com/sun/star/util/Duration.hpp>
+
+#include <sfx2/Metadatable.hxx>
+#include <sfx2/XmlIdRegistry.hxx>
+
+
+using namespace ::com::sun::star;
+
+
+namespace {
+
+class MetadatableTest
+ : public ::CppUnit::TestFixture
+{
+public:
+ virtual void setUp();
+ virtual void tearDown();
+
+ void test();
+
+ CPPUNIT_TEST_SUITE(MetadatableTest);
+ CPPUNIT_TEST(test);
+ CPPUNIT_TEST_SUITE_END();
+
+private:
+};
+
+void MetadatableTest::setUp()
+{
+}
+
+void MetadatableTest::tearDown()
+{
+}
+
+
+class MockMetadatable
+ : public ::sfx2::Metadatable
+{
+private:
+ ::sfx2::IXmlIdRegistry & m_rRegistry;
+
+public:
+ MockMetadatable(::sfx2::IXmlIdRegistry & i_rReg,
+ bool const i_isInClip = false)
+ : m_rRegistry(i_rReg)
+ , m_bInClipboard(i_isInClip), m_bInUndo(false), m_bInContent(true) {}
+ bool m_bInClipboard;
+ bool m_bInUndo;
+ bool m_bInContent;
+ virtual bool IsInClipboard() const { return m_bInClipboard; }
+ virtual bool IsInUndo() const { return m_bInUndo; }
+ virtual bool IsInContent() const { return m_bInContent; }
+ virtual ::sfx2::IXmlIdRegistry& GetRegistry() { return m_rRegistry; }
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XMetadatable > MakeUnoObject() { return 0; }
+};
+
+static bool operator==(beans::StringPair p1, beans::StringPair p2)
+{
+ return p1.First == p2.First && p1.Second == p2.Second;
+}
+
+void MetadatableTest::test()
+{
+ OSL_TRACE("SwMetadatable test(): start\n");
+ ::std::auto_ptr< ::sfx2::IXmlIdRegistry > const pReg(
+ ::sfx2::createXmlIdRegistry(false) );
+ ::std::auto_ptr< ::sfx2::IXmlIdRegistry > const pRegClip(
+ ::sfx2::createXmlIdRegistry(true) );
+
+ MockMetadatable m1(*pReg);
+ MockMetadatable m2(*pReg);
+ MockMetadatable m3(*pReg);
+ MockMetadatable m4(*pReg);
+ MockMetadatable m5(*pReg);
+ ::rtl::OUString empty;
+ ::rtl::OUString content( ::rtl::OUString::createFromAscii("content.xml") );
+ ::rtl::OUString styles ( ::rtl::OUString::createFromAscii("styles.xml") );
+ ::rtl::OUString sid1( ::rtl::OUString::createFromAscii("id1") );
+ ::rtl::OUString sid2( ::rtl::OUString::createFromAscii("id2") );
+ ::rtl::OUString sid3( ::rtl::OUString::createFromAscii("id3") );
+ ::rtl::OUString sid4( ::rtl::OUString::createFromAscii("id4") );
+ beans::StringPair id1(content, sid1);
+ beans::StringPair id2(content, sid2);
+ beans::StringPair id3(content, sid3);
+ beans::StringPair id4(styles, sid4);
+ beans::StringPair id3e(empty, sid3);
+ beans::StringPair id4e(empty, sid4);
+ m1.SetMetadataReference(id1);
+ CPPUNIT_ASSERT_MESSAGE("set failed", m1.GetMetadataReference() == id1);
+ try {
+ m2.SetMetadataReference(id1);
+ CPPUNIT_ASSERT_MESSAGE("set duplicate succeeded", false);
+ } catch (lang::IllegalArgumentException) { }
+ m1.SetMetadataReference(id1);
+ CPPUNIT_ASSERT_MESSAGE("set failed (existing)",
+ m1.GetMetadataReference() == id1);
+ m1.EnsureMetadataReference();
+ CPPUNIT_ASSERT_MESSAGE("ensure failed (existing)",
+ m1.GetMetadataReference() == id1);
+
+ m2.EnsureMetadataReference();
+ beans::StringPair m2id(m2.GetMetadataReference());
+ CPPUNIT_ASSERT_MESSAGE("ensure failed", m2id.Second.getLength());
+ m2.EnsureMetadataReference();
+ CPPUNIT_ASSERT_MESSAGE("ensure failed (idempotent)",
+ m2.GetMetadataReference() == m2id);
+
+ m1.m_bInUndo = true;
+ CPPUNIT_ASSERT_MESSAGE("move to undo failed",
+ !m1.GetMetadataReference().Second.getLength());
+
+ m1.m_bInUndo = false;
+ CPPUNIT_ASSERT_MESSAGE("move from undo failed",
+ m1.GetMetadataReference() == id1);
+
+ m1.m_bInUndo = true;
+ try {
+ m2.SetMetadataReference(id1); // steal!
+ } catch (lang::IllegalArgumentException &) {
+ CPPUNIT_FAIL("set duplicate to undo failed");
+ }
+ m1.m_bInUndo = false;
+ CPPUNIT_ASSERT_MESSAGE("move from undo: duplicate",
+ !m1.GetMetadataReference().Second.getLength());
+
+ m3.RegisterAsCopyOf(m2);
+ CPPUNIT_ASSERT_MESSAGE("copy: source", m2.GetMetadataReference() == id1);
+ CPPUNIT_ASSERT_MESSAGE("copy: duplicate",
+ !m3.GetMetadataReference().Second.getLength());
+ m4.RegisterAsCopyOf(m3);
+ CPPUNIT_ASSERT_MESSAGE("copy: source", m2.GetMetadataReference() == id1);
+ CPPUNIT_ASSERT_MESSAGE("copy: duplicate",
+ !m3.GetMetadataReference().Second.getLength());
+ CPPUNIT_ASSERT_MESSAGE("copy: duplicate",
+ !m4.GetMetadataReference().Second.getLength());
+ m2.m_bInUndo = true;
+ CPPUNIT_ASSERT_MESSAGE("duplicate to undo",
+ m3.GetMetadataReference() == id1);
+ CPPUNIT_ASSERT_MESSAGE("duplicate to undo",
+ !m2.GetMetadataReference().Second.getLength());
+ m2.m_bInUndo = false;
+ CPPUNIT_ASSERT_MESSAGE("duplicate from undo",
+ m2.GetMetadataReference() == id1);
+ CPPUNIT_ASSERT_MESSAGE("duplicate from undo",
+ !m3.GetMetadataReference().Second.getLength());
+
+ m4.EnsureMetadataReference(); // new!
+ beans::StringPair m4id(m4.GetMetadataReference());
+ CPPUNIT_ASSERT_MESSAGE("ensure on duplicate",
+ m4id.Second.getLength() && !(m4id == id1));
+
+ MockMetadatable mc1(*pRegClip, true); // in clipboard
+ MockMetadatable mc2(*pRegClip, true);
+ MockMetadatable mc3(*pRegClip, true);
+ MockMetadatable mc4(*pRegClip, true);
+ MockMetadatable m2p(*pReg);
+ MockMetadatable m3p(*pReg);
+
+ mc1.SetMetadataReference(id2);
+ CPPUNIT_ASSERT_MESSAGE("set failed", mc1.GetMetadataReference() == id2);
+ try {
+ mc2.SetMetadataReference(id2);
+ CPPUNIT_FAIL("set duplicate succeeded");
+ } catch (lang::IllegalArgumentException) { }
+ mc1.SetMetadataReference(id2);
+ CPPUNIT_ASSERT_MESSAGE("set failed (existing)",
+ mc1.GetMetadataReference() == id2);
+ mc1.EnsureMetadataReference();
+ CPPUNIT_ASSERT_MESSAGE("ensure failed (existing)",
+ mc1.GetMetadataReference() == id2);
+ mc2.EnsureMetadataReference();
+ beans::StringPair mc2id(mc2.GetMetadataReference());
+ CPPUNIT_ASSERT_MESSAGE("ensure failed", mc2id.Second.getLength());
+ mc2.EnsureMetadataReference();
+ CPPUNIT_ASSERT_MESSAGE("ensure failed (idempotent)",
+ mc2.GetMetadataReference() == mc2id);
+ mc2.RemoveMetadataReference();
+ CPPUNIT_ASSERT_MESSAGE("remove failed",
+ !mc2.GetMetadataReference().Second.getLength());
+
+ // set up mc2 as copy of m2 and mc3 as copy of m3
+ mc3.RegisterAsCopyOf(m3);
+ CPPUNIT_ASSERT_MESSAGE("copy to clipboard (latent)",
+ !mc3.GetMetadataReference().Second.getLength() );
+ mc2.RegisterAsCopyOf(m2);
+ CPPUNIT_ASSERT_MESSAGE("copy to clipboard (non-latent)",
+ mc2.GetMetadataReference() == id1);
+ // paste mc2 to m2p and mc3 to m3p
+ m2p.RegisterAsCopyOf(mc2);
+ CPPUNIT_ASSERT_MESSAGE("paste from clipboard (non-latent)",
+ !m2p.GetMetadataReference().Second.getLength() );
+ m3p.RegisterAsCopyOf(mc3);
+ CPPUNIT_ASSERT_MESSAGE("paste from clipboard (latent)",
+ !m3p.GetMetadataReference().Second.getLength() );
+ // delete m2, m2p, m3
+ m2.RemoveMetadataReference();
+ CPPUNIT_ASSERT_MESSAGE("remove failed",
+ !m2.GetMetadataReference().Second.getLength());
+ CPPUNIT_ASSERT_MESSAGE("paste-remove (non-latent)",
+ m2p.GetMetadataReference() == id1);
+ m2p.RemoveMetadataReference();
+ CPPUNIT_ASSERT_MESSAGE("remove failed",
+ !m2p.GetMetadataReference().Second.getLength());
+ CPPUNIT_ASSERT_MESSAGE("paste-remove2 (non-latent)",
+ m3.GetMetadataReference() == id1);
+ m3.RemoveMetadataReference();
+ CPPUNIT_ASSERT_MESSAGE("remove failed",
+ !m3.GetMetadataReference().Second.getLength());
+ CPPUNIT_ASSERT_MESSAGE("paste-remove (latent)",
+ m3p.GetMetadataReference() == id1);
+ // delete mc2
+ mc2.SetMetadataReference(beans::StringPair());
+ CPPUNIT_ASSERT_MESSAGE("in clipboard becomes non-latent",
+ !mc3.GetMetadataReference().Second.getLength() );
+ // paste mc2
+ m2p.RegisterAsCopyOf(mc2);
+ CPPUNIT_ASSERT_MESSAGE("remove-paste",
+ !m2p.GetMetadataReference().Second.getLength());
+ CPPUNIT_ASSERT_MESSAGE("remove-paste (stolen)",
+ m3p.GetMetadataReference() == id1);
+
+ // auto-detect stream
+ m5.SetMetadataReference(id3e);
+ CPPUNIT_ASSERT_MESSAGE("auto-detect (content)",
+ m5.GetMetadataReference() == id3);
+ m5.m_bInContent = false;
+ m5.SetMetadataReference(id4e);
+ CPPUNIT_ASSERT_MESSAGE("auto-detect (styles)",
+ m5.GetMetadataReference() == id4);
+
+ OSL_TRACE("sfx2::Metadatable test(): finished\n");
+}
+
+
+CPPUNIT_TEST_SUITE_REGISTRATION(MetadatableTest);
+
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
diff --git a/desktop/source/deployment/migration/makefile.mk b/sfx2/qa/cppunit/version.map
index a37b7e5bebf8..3308588ef6f8 100644
--- a/desktop/source/deployment/migration/makefile.mk
+++ b/sfx2/qa/cppunit/version.map
@@ -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,17 +25,10 @@
#
#*************************************************************************
-PRJ = ..$/..$/..
-
-PRJNAME = desktop
-TARGET = deployment_migration
-ENABLE_EXCEPTIONS = TRUE
-
-.INCLUDE : settings.mk
-
-SLOFILES = \
- $(SLO)$/dp_migration.obj
-
-.INCLUDE : ..$/target.pmk
-.INCLUDE : target.mk
+UDK_3_0_0 {
+ global:
+ cppunitTestPlugIn;
+ local:
+ *;
+};
diff --git a/sfx2/qa/unoapi/Test.java b/sfx2/qa/unoapi/Test.java
new file mode 100644
index 000000000000..4263985c133f
--- /dev/null
+++ b/sfx2/qa/unoapi/Test.java
@@ -0,0 +1,51 @@
+/*************************************************************************
+* 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.
+************************************************************************/
+
+package org.openoffice.sfx2.qa.unoapi;
+
+import org.openoffice.Runner;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+public final class Test {
+ @org.junit.Before public void setUp() throws Exception {
+ connection.setUp();
+ }
+
+ @org.junit.After public void tearDown()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ connection.tearDown();
+ }
+
+ @org.junit.Test public void test() {
+ assertTrue(
+ Runner.run(
+ "-sce", "sfx.sce", "-xcl", "knownissues.xcl", "-tdoc",
+ "testdocuments", "-cs", connection.getDescription()));
+ }
+
+ private final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/sfx2/qa/unoapi/makefile.mk b/sfx2/qa/unoapi/makefile.mk
index 3b078237f163..ea91ba4d1c44 100644
--- a/sfx2/qa/unoapi/makefile.mk
+++ b/sfx2/qa/unoapi/makefile.mk
@@ -1,7 +1,6 @@
#*************************************************************************
-#
# 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
@@ -22,19 +21,28 @@
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
+#***********************************************************************/
-PRJ=..$/..
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-PRJNAME=sfx2
-TARGET=qa_unoapi
+PRJ = ../..
+PRJNAME = sfx2
+TARGET = qa_unoapi
-.INCLUDE: settings.mk
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/sfx2/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-ALLTAR : UNOAPI_TEST
+ALLTAR : javatest
-UNOAPI_TEST:
- +$(SOLARENV)$/bin$/checkapi -sce sfx.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments
+.END
diff --git a/sfx2/qa/unoapi/sfx.sce b/sfx2/qa/unoapi/sfx.sce
index 2aaf12c25950..6176c0668731 100644
--- a/sfx2/qa/unoapi/sfx.sce
+++ b/sfx2/qa/unoapi/sfx.sce
@@ -2,4 +2,4 @@
-o sfx.DocumentTemplates
-o sfx.FrameLoader
-o sfx.SfxMacroLoader
--o sfx.StandaloneDocumentInfo
+#i111283 -o sfx.StandaloneDocumentInfo
diff --git a/sfx2/sdi/frmslots.sdi b/sfx2/sdi/frmslots.sdi
index c4210b801bf6..dbf9267448e1 100644
--- a/sfx2/sdi/frmslots.sdi
+++ b/sfx2/sdi/frmslots.sdi
@@ -50,6 +50,11 @@ interface Window
ExecMethod = ChildWindowExecute ;
StateMethod = ChildWindowState ;
]
+ SID_TASKPANE // status(final|play)
+ [
+ ExecMethod = ChildWindowExecute ;
+ StateMethod = ChildWindowState ;
+ ]
SID_SHOW_BROWSER // ole(no) api(final/play/rec)
[
ExecMethod = ChildWindowExecute ;
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 10a920852848..8ca8645a05ff 100644..100755
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -3594,6 +3594,34 @@ SfxVoidItem MacroOrganizer SID_MACROORGANIZER
]
//--------------------------------------------------------------------------
+SfxBoolItem ReccomendReadonly SID_RECOMMENDREADONLY
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ Readonly = TRUE,
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+
+//--------------------------------------------------------------------------
SfxVoidItem RunMacro SID_RUNMACRO
()
[
@@ -3931,6 +3959,33 @@ SfxBoolItem Navigator SID_NAVIGATOR
ToolBoxConfig = TRUE,
GroupId = GID_NAVIGATOR;
]
+
+//--------------------------------------------------------------------------
+SfxBoolItem TaskPane SID_TASKPANE
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ Readonly = FALSE,
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
//--------------------------------------------------------------------------
SfxVoidItem RestoreEditingView SID_RESTORE_EDITING_VIEW
@@ -8194,3 +8249,29 @@ SfxInt16Item PasteUnformatted SID_PASTE_UNFORMATTED
GroupId = GID_EDIT;
]
+//--------------------------------------------------------------------------
+// call thesaurus dialog from context menu
+SfxInt16Item ThesaurusFromContext SID_THES
+(SfxStringItem WordReplace SID_THES)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_TEXT;
+]
+
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 56181846840b..a260df92bc92 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -311,6 +311,7 @@ SfxApplication* SfxApplication::GetOrCreate()
::framework::SetStatusBarControllerCreator( SfxStatusBarControllerFactory );
::framework::SetDockingWindowCreator( SfxDockingWindowFactory );
::framework::SetIsDockingWindowVisible( IsDockingWindowVisible );
+ ::framework::SetActivateToolPanel( &SfxViewFrame::ActivateToolPanel );
SfxHelp* pSfxHelp = new SfxHelp;
Application::SetHelp( pSfxHelp );
diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx
index 15805526bd87..32b56717293c 100644
--- a/sfx2/source/appl/appdata.cxx
+++ b/sfx2/source/appl/appdata.cxx
@@ -89,7 +89,7 @@ void SfxBasicManagerCreationListener::onBasicManagerCreated( const Reference< XM
m_rAppData.OnApplicationBasicManagerCreated( _rBasicManager );
}
-SfxAppData_Impl::SfxAppData_Impl( SfxApplication* pApp ) :
+SfxAppData_Impl::SfxAppData_Impl( SfxApplication* ) :
pDdeService( 0 ),
pDocTopics( 0 ),
pTriggerTopic(0),
@@ -116,8 +116,7 @@ SfxAppData_Impl::SfxAppData_Impl( SfxApplication* pApp ) :
nRescheduleLocks(0),
nInReschedule(0),
nAsynchronCalls(0),
- m_xImeStatusWindow(new sfx2::appl::ImeStatusWindow(
- *pApp, comphelper::getProcessServiceFactory()))
+ m_xImeStatusWindow(new sfx2::appl::ImeStatusWindow(comphelper::getProcessServiceFactory()))
, pTbxCtrlFac(0)
, pStbCtrlFac(0)
, pViewFrames(0)
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index 84b75bfa3d15..ddec7341f4c5 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -35,7 +35,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <svtools/soerr.hxx>
-#include <svl/svtools.hrc>
+#include <svtools/svtools.hrc>
#include <unotools/saveopt.hxx>
#include <unotools/localisationoptions.hxx>
#include <tools/config.hxx>
diff --git a/sfx2/source/appl/appmain.cxx b/sfx2/source/appl/appmain.cxx
index a6d89edf301d..546b6b1c6558 100644
--- a/sfx2/source/appl/appmain.cxx
+++ b/sfx2/source/appl/appmain.cxx
@@ -93,9 +93,6 @@ static SfxItemInfo __READONLY_DATA aItemInfos[] =
//===================================================================
-typedef Link* LinkPtr;
-SV_DECL_PTRARR(SfxInitLinkList, LinkPtr, 4, 4)
-
TYPEINIT2(SfxApplication,SfxShell,SfxBroadcaster);
//--------------------------------------------------------------------
diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx
index 9b88feb5d8ab..2ce4eac67295 100644
--- a/sfx2/source/appl/appquit.cxx
+++ b/sfx2/source/appl/appquit.cxx
@@ -74,57 +74,11 @@
using ::basic::BasicManagerRepository;
-#ifdef DBG_UTIL
-DECLARE_LIST( SfxFrameWindowFactoryArray_Impl, SfxFrameWindowFactory* )
-SV_DECL_PTRARR(SfxInitLinkList, Link*, 2, 2)
-#endif
-
//===================================================================
BOOL SfxApplication::QueryExit_Impl()
{
BOOL bQuit = TRUE;
-/*
- BOOL bPrinting = FALSE;
- for ( SfxViewShell *pViewSh = SfxViewShell::GetFirst();
- !bPrinting && pViewSh;
- pViewSh = SfxViewShell::GetNext(*pViewSh) )
- {
- SfxPrinter *pPrinter = pViewSh->GetPrinter();
- bPrinting = pPrinter && pPrinter->IsPrinting();
- }
-
- if ( bPrinting )
- {
- // Benutzer fragen, ob abgebrochen werden soll
- if ( RET_OK == QueryBox( 0, SfxResId( MSG_ISPRINTING_QUERYABORT ) ).Execute() )
- {
- // alle Jobs canceln
- for ( SfxViewShell *pViewSh = SfxViewShell::GetFirst();
- !bPrinting && pViewSh;
- pViewSh = SfxViewShell::GetNext(*pViewSh) )
- {
- SfxPrinter *pPrinter = pViewSh->GetPrinter();
- if ( pPrinter && pPrinter->IsPrinting() )
- pPrinter->AbortJob();
- }
-
- // da das Canceln asynchron ist, Quit erstmal wieder verlassen
- GetDispatcher_Impl()->Execute( SID_QUITAPP, SFX_CALLMODE_ASYNCHRON );
- DBG_TRACE( "QueryExit => FALSE (printing)" );
- return FALSE;
- }
- }
-*/
-/*
- SfxObjectShell *pLastDocSh = SfxObjectShell::GetFirst();
- if ( bQuit )
- {
- // Jetzt zur Sicherheit auch hidden Frames abr"aumen
- SfxViewFrame::CloseHiddenFrames_Impl();
- pLastDocSh = SfxObjectShell::GetFirst();
- }
-*/
// will trotzdem noch jemand, den man nicht abschiessen kann, die App haben?
if ( !bQuit )
{
@@ -197,22 +151,18 @@ void SfxApplication::Deinitialize()
delete pAppData_Impl->pLabelResMgr;
-#ifdef DBG_UTIL
DELETEX(pAppData_Impl->pSlotPool);
DELETEX(pAppData_Impl->pEventConfig);
SfxMacroConfig::Release_Impl();
DELETEX(pAppData_Impl->pFactArr);
DELETEX(pAppData_Impl->pInitLinkList);
-#endif
-#ifdef DBG_UTIL
DELETEX(pAppData_Impl->pTbxCtrlFac);
DELETEX(pAppData_Impl->pStbCtrlFac);
DELETEX(pAppData_Impl->pMenuCtrlFac);
DELETEX(pAppData_Impl->pViewFrames);
DELETEX(pAppData_Impl->pViewShells);
DELETEX(pAppData_Impl->pObjShells);
-#endif
//TODO/CLEANTUP
//ReleaseArgs could be used instead!
diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx
index 6af0ad9feff2..9fd2dfc696d3 100644
--- a/sfx2/source/appl/appreg.cxx
+++ b/sfx2/source/appl/appreg.cxx
@@ -42,6 +42,7 @@
#include "inettbc.hxx"
#include "sfx2/stbitem.hxx"
#include <sfx2/navigat.hxx>
+#include <sfx2/taskpane.hxx>
#include <sfx2/module.hxx>
#include <sfx2/viewfrm.hxx>
#include "partwnd.hxx"
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 6f90aa848ba9..1387317f7581 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -51,20 +51,15 @@
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/system/SystemShellExecuteException.hpp>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
#include <comphelper/processfactory.hxx>
-#endif
#include <comphelper/storagehelper.hxx>
+#include "comphelper/configurationhelper.hxx"
-#ifndef _SVT_DOC_ADDRESSTEMPLATE_HXX_
#include <svtools/addresstemplate.hxx>
-#endif
#include <svl/visitem.hxx>
#include <unotools/intlwrapper.hxx>
-#ifndef _UNOTOOLS_CONFIGMGR_HXX_
#include <unotools/configmgr.hxx>
-#endif
#include <tools/config.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/msgbox.hxx>
@@ -90,6 +85,7 @@
#include <vos/process.hxx>
#include <rtl/bootstrap.hxx>
#include <cppuhelper/exc_hlp.hxx>
+#include <rtl/ustrbuf.hxx>
#include <com/sun/star/script/provider/XScriptProviderFactory.hpp>
#include <com/sun/star/frame/XModuleManager.hpp>
@@ -879,6 +875,31 @@ namespace
}
}
+static ::rtl::OUString getConfigurationStringValue(
+ const ::rtl::OUString& rPackage,
+ const ::rtl::OUString& rRelPath,
+ const ::rtl::OUString& rKey,
+ const ::rtl::OUString& rDefaultValue )
+{
+ ::rtl::OUString aDefVal( rDefaultValue );
+
+ try
+ {
+ ::comphelper::ConfigurationHelper::readDirectKey(
+ comphelper::getProcessServiceFactory(),
+ rPackage,
+ rRelPath,
+ rKey,
+ ::comphelper::ConfigurationHelper::E_READONLY) >>= aDefVal;
+ }
+ catch(const com::sun::star::uno::RuntimeException& exRun)
+ { throw exRun; }
+ catch(const com::sun::star::uno::Exception&)
+ {}
+
+ return aDefVal;
+}
+
void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
{
DBG_MEMTEST();
@@ -924,8 +945,34 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
uno::Reference< css::system::XSystemShellExecute > xSystemShell(
xSMGR->createInstance( DEFINE_CONST_UNICODE("com.sun.star.system.SystemShellExecute" ) ),
uno::UNO_QUERY_THROW );
- if ( xSystemShell.is() )
- xSystemShell->execute( DEFINE_CONST_UNICODE("http://extensions.services.openoffice.org/dictionary?cid=926385"), ::rtl::OUString(), css::system::SystemShellExecuteFlags::DEFAULTS );
+
+ // read repository URL from configuration
+ ::rtl::OUString sTemplRepoURL =
+ getConfigurationStringValue(
+ ::rtl::OUString::createFromAscii("org.openoffice.Office.Common"),
+ ::rtl::OUString::createFromAscii("Dictionaries"),
+ ::rtl::OUString::createFromAscii("RepositoryURL"),
+ ::rtl::OUString());
+
+ if ( xSystemShell.is() && sTemplRepoURL.getLength() > 0 )
+ {
+ ::rtl::OUStringBuffer aURLBuf( sTemplRepoURL );
+ aURLBuf.appendAscii( "?" );
+ aURLBuf.appendAscii( "lang=" );
+
+ // read locale from configuration
+ ::rtl::OUString sLocale = getConfigurationStringValue(
+ ::rtl::OUString::createFromAscii("org.openoffice.Setup"),
+ ::rtl::OUString::createFromAscii("L10N"),
+ ::rtl::OUString::createFromAscii("ooLocale"),
+ ::rtl::OUString::createFromAscii("en-US"));
+
+ aURLBuf.append( sLocale );
+ xSystemShell->execute(
+ aURLBuf.makeStringAndClear(),
+ ::rtl::OUString(),
+ css::system::SystemShellExecuteFlags::DEFAULTS );
+ }
}
catch( const ::com::sun::star::uno::Exception& )
{
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 24a1725aa99c..24a1725aa99c 100644..100755
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
diff --git a/sfx2/source/appl/imagemgr.cxx b/sfx2/source/appl/imagemgr.cxx
index d9b678677dc6..b9f4404d5555 100644
--- a/sfx2/source/appl/imagemgr.cxx
+++ b/sfx2/source/appl/imagemgr.cxx
@@ -71,7 +71,7 @@ static WeakReference< XModuleUIConfigurationManagerSupplier > m_xModuleCfgMgrSup
static WeakReference< XURLTransformer > m_xURLTransformer;
static ModuleIdToImagegMgr m_aModuleIdToImageMgrMap;
-Image SAL_CALL GetImage( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, BOOL bBig, BOOL bHiContrast )
+Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, BOOL bBig, BOOL bHiContrast )
{
// TODO/LATeR: shouldn't this become a method at SfxViewFrame?! That would save the UnoTunnel
if ( !rFrame.is() )
diff --git a/sfx2/source/appl/imestatuswindow.cxx b/sfx2/source/appl/imestatuswindow.cxx
index 3cdc3064fb81..07eb47bd92ad 100644
--- a/sfx2/source/appl/imestatuswindow.cxx
+++ b/sfx2/source/appl/imestatuswindow.cxx
@@ -57,10 +57,8 @@ namespace css = com::sun::star;
using sfx2::appl::ImeStatusWindow;
ImeStatusWindow::ImeStatusWindow(
- SfxApplication & rApplication,
css::uno::Reference< css::lang::XMultiServiceFactory > const &
rServiceFactory):
- m_rApplication(rApplication),
m_xServiceFactory(rServiceFactory),
m_bDisposed(false)
{}
@@ -161,7 +159,9 @@ ImeStatusWindow::propertyChange(css::beans::PropertyChangeEvent const & )
throw (css::uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
- m_rApplication.Invalidate(SID_SHOW_IME_STATUS_WINDOW);
+ SfxApplication* pApp = SfxApplication::Get();
+ if (pApp)
+ pApp->Invalidate(SID_SHOW_IME_STATUS_WINDOW);
}
css::uno::Reference< css::beans::XPropertySet > ImeStatusWindow::getConfig()
diff --git a/sfx2/source/appl/imestatuswindow.hxx b/sfx2/source/appl/imestatuswindow.hxx
index 71c0b371f796..4edba523ed30 100644
--- a/sfx2/source/appl/imestatuswindow.hxx
+++ b/sfx2/source/appl/imestatuswindow.hxx
@@ -37,7 +37,6 @@ namespace com { namespace sun { namespace star {
namespace beans { class XPropertySet; }
namespace lang { class XMultiServiceFactory; }
} } }
-class SfxApplication;
namespace sfx2 { namespace appl {
@@ -56,10 +55,7 @@ ImeStatusWindow_Impl;
class ImeStatusWindow: private ImeStatusWindow_Impl
{
public:
- ImeStatusWindow(SfxApplication & rApplication,
- com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory > const &
- rServiceFactory);
+ ImeStatusWindow( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > const& rServiceFactory );
/** Set up VCL according to the configuration.
@@ -115,7 +111,6 @@ private:
com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >
getConfig();
- SfxApplication & m_rApplication;
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
m_xServiceFactory;
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index f0abf079f58e..ba91d9c1117b 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -49,6 +49,8 @@
#include <sfx2/objface.hxx>
#include <sfx2/viewfrm.hxx>
#include <svl/intitem.hxx>
+#include "sfx2/taskpane.hxx"
+#include <tools/diagnose_ex.h>
#define SfxModule
#include "sfxslots.hxx"
@@ -400,6 +402,17 @@ BOOL SfxModule::IsActive() const
return FALSE;
}
+bool SfxModule::IsChildWindowAvailable( const USHORT i_nId, const SfxViewFrame* i_pViewFrame ) const
+{
+ if ( i_nId != SID_TASKPANE )
+ // by default, assume it is
+ return true;
+
+ const SfxViewFrame* pViewFrame = i_pViewFrame ? i_pViewFrame : GetFrame();
+ ENSURE_OR_RETURN( pViewFrame, "SfxModule::IsChildWindowAvailable: no frame to ask for the module identifier!", false );
+ return ::sfx2::ModuleTaskPane::ModuleHasToolPanels( pViewFrame->GetFrame().GetFrameInterface() );
+}
+
SfxModule* SfxModule::GetActiveModule( SfxViewFrame* pFrame )
{
if ( !pFrame )
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index f8ce2023a205..a1183019e8d1 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -714,9 +714,6 @@ String SfxHelp::CreateHelpURL_Impl( const String& aCommandURL, const String& rM
return aHelpURL;
}
-static ::rtl::OUString OFFICE_HELP_TASK = ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK"));
-static ::rtl::OUString OFFICE_HELP = ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP" ));
-
SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask ,
Reference< XFrame >& rHelpContent)
{
@@ -725,7 +722,7 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask ,
// otherwhise - create new help task
Reference< XFrame > xHelpTask = xDesktop->findFrame(
- OFFICE_HELP_TASK,
+ ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK")),
FrameSearchFlag::TASKS | FrameSearchFlag::CREATE);
if (!xHelpTask.is())
return 0;
@@ -740,7 +737,7 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask ,
if (xHelpTask->setComponent( xHelpWindow, Reference< XController >() ))
{
// Customize UI ...
- xHelpTask->setName( OFFICE_HELP_TASK );
+ xHelpTask->setName( ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK")) );
Reference< XPropertySet > xProps(xHelpTask, UNO_QUERY);
if (xProps.is())
@@ -754,13 +751,13 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask ,
// This sub frame is created internaly (if we called new SfxHelpWindow_Impl() ...)
// It should exist :-)
- xHelpContent = xHelpTask->findFrame(OFFICE_HELP, FrameSearchFlag::CHILDREN);
+ xHelpContent = xHelpTask->findFrame(::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP")), FrameSearchFlag::CHILDREN);
}
if (!xHelpContent.is())
delete pHelpWindow;
- xHelpContent->setName(OFFICE_HELP);
+ xHelpContent->setName(::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP")));
rHelpTask = xHelpTask;
rHelpContent = xHelpContent;
@@ -830,10 +827,10 @@ BOOL SfxHelp::Start( const String& rURL, const Window* pWindow )
// in both cases)!
Reference< XFrame > xHelp = xDesktop->findFrame(
- OFFICE_HELP_TASK,
+ ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK")),
FrameSearchFlag::CHILDREN);
Reference< XFrame > xHelpContent = xDesktop->findFrame(
- OFFICE_HELP,
+ ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP")),
FrameSearchFlag::CHILDREN);
SfxHelpWindow_Impl* pHelpWindow = 0;
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index b533ffb55d7e..04d9ce06aa9c 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -33,6 +33,7 @@
#include <sfx2/app.hxx>
#include <vos/mutex.hxx>
#include <svtools/imagemgr.hxx>
+#include <svtools/miscopt.hxx>
// #include <cmdlineargs.hxx>
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/frame/XDispatchResultListener.hpp>
@@ -239,6 +240,7 @@ ShutdownIcon::ShutdownIcon( Reference< XMultiServiceFactory > aSMgr ) :
ShutdownIconServiceBase( m_aMutex ),
m_bVeto ( false ),
m_bListenForTermination ( false ),
+ m_bSystemDialogs( false ),
m_pResMgr( NULL ),
m_pFileDlg( NULL ),
m_xServiceManager( aSMgr ),
@@ -247,6 +249,7 @@ ShutdownIcon::ShutdownIcon( Reference< XMultiServiceFactory > aSMgr ) :
m_pPlugin( 0 ),
m_bInitialized( false )
{
+ m_bSystemDialogs = SvtMiscOptions().UseSystemFileDialog();
}
ShutdownIcon::~ShutdownIcon()
@@ -380,6 +383,16 @@ void ShutdownIcon::StartFileDialog()
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
+ bool bDirty = ( m_bSystemDialogs != static_cast<bool>(SvtMiscOptions().UseSystemFileDialog()) );
+
+ if ( m_pFileDlg && bDirty )
+ {
+ // Destroy instance as changing the system file dialog setting
+ // forces us to create a new FileDialogHelper instance!
+ delete m_pFileDlg;
+ m_pFileDlg = NULL;
+ }
+
if ( !m_pFileDlg )
m_pFileDlg = new FileDialogHelper( WB_OPEN | SFXWB_MULTISELECTION, String() );
m_pFileDlg->StartExecuteModal( STATIC_LINK( this, ShutdownIcon, DialogClosedHdl_Impl ) );
@@ -516,8 +529,14 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR
#ifdef WNT
// #103346 Destroy dialog to prevent problems with custom controls
- delete pThis->m_pFileDlg;
- pThis->m_pFileDlg = NULL;
+ // This fix is dependent on the dialog settings. Destroying the dialog here will
+ // crash the non-native dialog implementation! Therefore make this dependent on
+ // the settings.
+ if ( SvtMiscOptions().UseSystemFileDialog() )
+ {
+ delete pThis->m_pFileDlg;
+ pThis->m_pFileDlg = NULL;
+ }
#endif
LeaveModalMode();
diff --git a/sfx2/source/appl/shutdownicon.hxx b/sfx2/source/appl/shutdownicon.hxx
index 4e7cc6ecc247..d702f2a50977 100644
--- a/sfx2/source/appl/shutdownicon.hxx
+++ b/sfx2/source/appl/shutdownicon.hxx
@@ -52,6 +52,7 @@ class SFX2_DLLPUBLIC ShutdownIcon : public ShutdownIconServiceBase
::osl::Mutex m_aMutex;
bool m_bVeto;
bool m_bListenForTermination;
+ bool m_bSystemDialogs;
ResMgr* m_pResMgr;
sfx2::FileDialogHelper* m_pFileDlg;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx
index c334fd750fc6..26fd35272a51 100644
--- a/sfx2/source/appl/shutdowniconw32.cxx
+++ b/sfx2/source/appl/shutdowniconw32.cxx
@@ -109,7 +109,7 @@ using namespace ::osl;
#define ICON_TEMPLATE 16
#define ICON_MACROLIBRARY 17
#define ICON_CONFIGURATION 18
-#define ICON_OPEN 19
+#define ICON_OPEN 5 // See index of open folder icon in shell32.dll
#define ICON_SETUP 500
#define SFX_TASKBAR_NOTIFICATION WM_USER+1
@@ -124,6 +124,7 @@ static void OnDrawItem(HWND hwnd, LPDRAWITEMSTRUCT lpdis);
typedef struct tagMYITEM
{
OUString text;
+ OUString module;
UINT iconId;
} MYITEM;
@@ -152,7 +153,7 @@ static bool isNT()
// -------------------------------
-static void addMenuItem( HMENU hMenu, UINT id, UINT iconId, const OUString& text, int& pos, int bOwnerdraw )
+static void addMenuItem( HMENU hMenu, UINT id, UINT iconId, const OUString& text, int& pos, int bOwnerdraw, const OUString& module )
{
MENUITEMINFOW mi;
memset( &mi, 0, sizeof( MENUITEMINFOW ) );
@@ -175,6 +176,7 @@ static void addMenuItem( HMENU hMenu, UINT id, UINT iconId, const OUString& text
MYITEM *pMyItem = new MYITEM;
pMyItem->text = text;
pMyItem->iconId = iconId;
+ pMyItem->module = module;
mi.dwItemData = (DWORD) pMyItem;
}
else
@@ -245,6 +247,8 @@ static HMENU createSystrayMenu( )
{ SvtModuleOptions::E_SMATH, IDM_MATH, ICON_MATH_DOCUMENT, MATH_URL },
};
+ OUString aEmpty;
+
// insert the menu entries for launching the applications
for ( size_t i = 0; i < sizeof( aMenuItems ) / sizeof( aMenuItems[0] ); ++i )
{
@@ -260,19 +264,21 @@ static HMENU createSystrayMenu( )
continue;
addMenuItem( hMenu, aMenuItems[i].nMenuItemID, aMenuItems[i].nMenuIconID,
- pShutdownIcon->GetUrlDescription( sURL ), pos, true );
+ pShutdownIcon->GetUrlDescription( sURL ), pos, true, aEmpty );
}
+
+
// insert the remaining menu entries
addMenuItem( hMenu, IDM_TEMPLATE, ICON_TEMPLATE,
- pShutdownIcon->GetResString( STR_QUICKSTART_FROMTEMPLATE ), pos, true);
- addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false );
- addMenuItem( hMenu, IDM_OPEN, ICON_OPEN, pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ), pos, true );
- addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false );
+ pShutdownIcon->GetResString( STR_QUICKSTART_FROMTEMPLATE ), pos, true, aEmpty);
+ addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty );
+ addMenuItem( hMenu, IDM_OPEN, ICON_OPEN, pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ), pos, true, OUString::createFromAscii( "SHELL32" ));
+ addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty );
#endif
- addMenuItem( hMenu, IDM_INSTALL,0, pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH ), pos, false );
- addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false );
- addMenuItem( hMenu, IDM_EXIT, 0, pShutdownIcon->GetResString( STR_QUICKSTART_EXIT ), pos, false );
+ addMenuItem( hMenu, IDM_INSTALL,0, pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH ), pos, false, aEmpty );
+ addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty );
+ addMenuItem( hMenu, IDM_EXIT, 0, pShutdownIcon->GetResString( STR_QUICKSTART_EXIT ), pos, false, aEmpty );
// indicate status of autostart folder
CheckMenuItem( hMenu, IDM_INSTALL, MF_BYCOMMAND | (ShutdownIcon::GetAutostart() ? MF_CHECKED : MF_UNCHECKED) );
@@ -736,11 +742,25 @@ void OnDrawItem(HWND /*hwnd*/, LPDRAWITEMSTRUCT lpdis)
x = aRect.left;
y = aRect.top;
- int cx = GetSystemMetrics( SM_CXSMICON );
- int cy = GetSystemMetrics( SM_CYSMICON );
- HICON hIcon = (HICON) LoadImageA( GetModuleHandle( NULL ), MAKEINTRESOURCE( pMyItem->iconId ),
- IMAGE_ICON, cx, cy,
- LR_DEFAULTCOLOR | LR_SHARED );
+ int cx = GetSystemMetrics( SM_CXSMICON );
+ int cy = GetSystemMetrics( SM_CYSMICON );
+ HICON hIcon( 0 );
+ HMODULE hModule( GetModuleHandle( NULL ) );
+
+ if ( pMyItem->module.getLength() > 0 )
+ {
+ LPCWSTR pModuleName = reinterpret_cast<LPCWSTR>( pMyItem->module.getStr() );
+ hModule = GetModuleHandleW( pModuleName );
+ if ( hModule == NULL )
+ {
+ LoadLibraryW( pModuleName );
+ hModule = GetModuleHandleW( pModuleName );
+ }
+ }
+
+ hIcon = (HICON) LoadImageA( hModule, MAKEINTRESOURCE( pMyItem->iconId ),
+ IMAGE_ICON, cx, cy,
+ LR_DEFAULTCOLOR | LR_SHARED );
// DrawIconEx( lpdis->hDC, x, y+(height-cy)/2, hIcon, cx, cy, 0, NULL, DI_NORMAL );
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 0051cee06841..2224643bc88f 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -53,6 +53,7 @@
#include <vcl/taskpanelist.hxx>
#include <vcl/toolbox.hxx>
#include <tools/rcid.h>
+#include <tools/diagnose_ex.h>
#include <toolkit/helper/vclunohelper.hxx>
#include <svl/itempool.hxx>
#include <svl/itemiter.hxx>
@@ -1538,6 +1539,16 @@ void SfxWorkWindow::UpdateObjectBars_Impl()
}
}
+bool SfxWorkWindow::AllowChildWindowCreation_Impl( const SfxChildWin_Impl& i_rCW ) const
+{
+ // or checking the availability of child windows, we need access to the module
+ const SfxViewFrame* pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
+ const SfxObjectShell* pShell = pViewFrame ? pViewFrame->GetObjectShell() : NULL;
+ const SfxModule* pModule = pShell ? pShell->GetModule() : NULL;
+ ENSURE_OR_RETURN( pModule, "SfxWorkWindow::UpdateChildWindows_Impl: did not find an SfxModule to ask for the child win availability!", true );
+ return pModule->IsChildWindowAvailable( i_rCW.nId, pViewFrame );
+}
+
void SfxWorkWindow::UpdateChildWindows_Impl()
{
// alle vorhandenen oder in den Kontext gekommenen ChildWindows
@@ -1550,7 +1561,7 @@ void SfxWorkWindow::UpdateChildWindows_Impl()
{
// Im Kontext ist ein geeignetes ChildWindow erlaubt;
// ist es auch eingeschaltet ?
- if ( pChildWin == 0 && pCW->bCreate )
+ if ( pChildWin == NULL && pCW->bCreate )
{
// Internal docking is only used for embedding into another
// container. We force the floating state of all floatable
@@ -1571,6 +1582,9 @@ void SfxWorkWindow::UpdateChildWindows_Impl()
else
bCreate = TRUE;
+ if ( bCreate )
+ bCreate = AllowChildWindowCreation_Impl( *pCW );
+
// Momentan kein Fenster da, aber es ist eingeschaltet; Fenster
// und ggf. Context erzeugen
if ( bCreate )
@@ -1588,19 +1602,25 @@ void SfxWorkWindow::UpdateChildWindows_Impl()
if ( ( !bIsFullScreen || pChildWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT ) && bAllChildsVisible )
{
// Updatemode ist kompatibel; auf jeden Fall wieder einschalten
- bCreate = TRUE;
- if ( pCW->pCli )
+ bCreate = AllowChildWindowCreation_Impl( *pCW );
+ if ( bCreate )
{
- // Fenster ist direktes Child
- if ( bAllChildsVisible && ( (IsDockingAllowed() && bInternalDockingAllowed) || pCW->pCli->eAlign == SFX_ALIGN_NOALIGNMENT ) )
- pCW->pCli->nVisible |= CHILD_NOT_HIDDEN;
+ if ( pCW->pCli )
+ {
+ // Fenster ist direktes Child
+ if ( bAllChildsVisible && ( (IsDockingAllowed() && bInternalDockingAllowed) || pCW->pCli->eAlign == SFX_ALIGN_NOALIGNMENT ) )
+ pCW->pCli->nVisible |= CHILD_NOT_HIDDEN;
+ }
+ else
+ {
+ if ( pCW->bCreate && IsDockingAllowed() && bInternalDockingAllowed )
+ // Fenster liegt in einem SplitWindow
+ ((SfxDockingWindow*)pChildWin->GetWindow())->Reappear_Impl();
+ }
+
+ if ( pCW->nInterfaceId != pChildWin->GetContextId() )
+ pChildWin->CreateContext( pCW->nInterfaceId, GetBindings() );
}
- else if ( pCW->bCreate && IsDockingAllowed() && bInternalDockingAllowed )
- // Fenster liegt in einem SplitWindow
- ((SfxDockingWindow*)pChildWin->GetWindow())->Reappear_Impl();
-
- if ( pCW->nInterfaceId != pChildWin->GetContextId() )
- pChildWin->CreateContext( pCW->nInterfaceId, GetBindings() );
}
}
}
@@ -2225,7 +2245,7 @@ void SfxWorkWindow::ToggleChildWindow_Impl(USHORT nId, BOOL bSetFocus)
SfxChildWin_Impl *pCW = (*pChildWins)[n];
SfxChildWindow *pChild = pCW->pWin;
- bool bCreationAllowed( sal_True );
+ bool bCreationAllowed( true );
if ( !bInternalDockingAllowed )
{
// Special case for all non-floatable child windows. We have
@@ -2233,43 +2253,51 @@ void SfxWorkWindow::ToggleChildWindow_Impl(USHORT nId, BOOL bSetFocus)
bCreationAllowed = !( pCW->aInfo.nFlags & SFX_CHILDWIN_FORCEDOCK );
}
- if ( pChild && pCW->bCreate && bCreationAllowed )
+ if ( bCreationAllowed )
{
- if ( pChild->QueryClose() )
+ if ( pCW->bCreate )
{
- if ( pChild && pChild->IsHideAtToggle() )
+ if ( pChild )
{
- pCW->bCreate = !pCW->bCreate;
- ShowChildWindow_Impl( nId, pCW->bCreate, bSetFocus );
+ if ( pChild->QueryClose() )
+ {
+ pCW->bCreate = FALSE;
+ if ( pChild->IsHideAtToggle() )
+ {
+ ShowChildWindow_Impl( nId, FALSE, bSetFocus );
+ }
+ else
+ {
+ // Fenster soll ausgeschaltet werdem
+ pChild->SetVisible_Impl( FALSE );
+ RemoveChildWin_Impl( pCW );
+ }
+ }
}
else
{
- // Fenster soll ausgeschaltet werdem
+ // no actual Window exists, yet => just remember the "switched off" state
pCW->bCreate = FALSE;
- pChild->SetVisible_Impl( FALSE );
- RemoveChildWin_Impl( pCW );
}
}
- }
- else if ( pCW->bCreate && bCreationAllowed )
- {
- pCW->bCreate = FALSE;
- }
- else if ( bCreationAllowed )
- {
- pCW->bCreate = TRUE;
-
- if ( pChild )
- {
- ShowChildWindow_Impl( nId, pCW->bCreate, bSetFocus );
- }
else
{
- // Fenster erzeugen
- CreateChildWin_Impl( pCW, bSetFocus );
- if ( !pCW->pWin )
- // Erzeugung war erfolglos
- pCW->bCreate = FALSE;
+ pCW->bCreate = AllowChildWindowCreation_Impl( *pCW );
+ if ( pCW->bCreate )
+ {
+ if ( pChild )
+ {
+ ShowChildWindow_Impl( nId, TRUE, bSetFocus );
+ }
+ else
+ {
+ // create actual Window
+ CreateChildWin_Impl( pCW, bSetFocus );
+ if ( !pCW->pWin )
+ // no success
+ pCW->bCreate = FALSE;
+ }
+ }
}
}
@@ -2488,7 +2516,6 @@ void SfxWorkWindow::ShowChildWindow_Impl(USHORT nId, BOOL bVisible, BOOL bSetFoc
SfxChildWindow *pChildWin = pCW->pWin;
if ( pChildWin )
{
-// pCW->bCreate = bVisible;
if ( bVisible )
{
if ( pCW->pCli )
diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx
index 1398cf6f55a8..9650c8155d84 100644
--- a/sfx2/source/bastyp/progress.cxx
+++ b/sfx2/source/bastyp/progress.cxx
@@ -706,7 +706,7 @@ SfxProgress* SfxProgress::GetActiveProgress
*/
{
- if ( !SfxApplication::Is_Impl() )
+ if ( !SfxApplication::Get() )
return 0;
SfxProgress *pProgress = 0;
diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx
index 6132e958b900..8a4b434f460b 100644
--- a/sfx2/source/bastyp/sfxhtml.cxx
+++ b/sfx2/source/bastyp/sfxhtml.cxx
@@ -62,11 +62,7 @@ sal_Char __FAR_DATA sHTML_MIME_application[] = "application/";
sal_Char __FAR_DATA sHTML_MIME_experimental[] = "x-";
// <INPUT TYPE=xxx>
-#ifdef __MINGW32__ // for runtime pseudo reloc
-static HTMLOptionEnum aAreaShapeOptEnums[] =
-#else
static HTMLOptionEnum __READONLY_DATA aAreaShapeOptEnums[] =
-#endif
{
{ OOO_STRING_SVTOOLS_HTML_SH_rect, IMAP_OBJ_RECTANGLE },
{ OOO_STRING_SVTOOLS_HTML_SH_rectangle, IMAP_OBJ_RECTANGLE },
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 114db6385b76..f85d0d8e9e49 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -823,7 +823,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util
pItem = pDispatcher->Execute( GetId(), nCall, 0, &aInternalSet, nModifier );
// no bindings, no invalidate ( usually done in SfxDispatcher::Call_Impl()! )
- if ( SfxApplication::Is_Impl() )
+ if ( SfxApplication::Get() )
{
SfxDispatcher* pAppDispat = SFX_APP()->GetAppDispatcher_Impl();
if ( pAppDispat )
diff --git a/sfx2/source/dialog/about.cxx b/sfx2/source/dialog/about.cxx
index 15f9452fd903..39f59cb775d9 100644
--- a/sfx2/source/dialog/about.cxx
+++ b/sfx2/source/dialog/about.cxx
@@ -29,8 +29,16 @@
#include "precompiled_sfx2.hxx"
// include ---------------------------------------------------------------
+
+#ifndef _SV_APP_HXX
#include <vcl/svapp.hxx>
+#endif
+#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
+#endif
+#ifndef GCC
+#endif
+
#include <tools/stream.hxx>
#include <tools/urlobj.hxx>
#include <rtl/bootstrap.hxx>
@@ -40,11 +48,13 @@
#include <unotools/configmgr.hxx>
#include <vcl/graph.hxx>
#include <svtools/filter.hxx>
+
#include <sfx2/sfxuno.hxx>
#include "about.hxx"
-#include "sfx2/sfxresid.hxx"
+#include "sfxresid.hxx"
#include <sfx2/sfxdefs.hxx>
#include <sfx2/app.hxx>
+
#include "dialog.hrc"
// defines ---------------------------------------------------------------
@@ -98,49 +108,12 @@ static bool impl_loadBitmap(
return false;
}
-AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerStr ) :
-
- SfxModalDialog ( pParent, rId ),
-
- aOKButton ( this, ResId( ABOUT_BTN_OK, *rId.GetResMgr() ) ),
- aVersionText ( this, ResId( ABOUT_FTXT_VERSION, *rId.GetResMgr() ) ),
- aCopyrightText ( this, ResId( ABOUT_FTXT_COPYRIGHT, *rId.GetResMgr() ) ),
- aBuildData ( this ),
- aDeveloperAry ( ResId( ABOUT_STR_DEVELOPER_ARY, *rId.GetResMgr() ) ),
- aDevVersionStr ( rVerStr ),
- aAccelStr ( ResId( ABOUT_STR_ACCEL, *rId.GetResMgr() ) ),
- aCopyrightTextStr( ResId( ABOUT_STR_COPYRIGHT, *rId.GetResMgr() ) ),
- aTimer (),
- nOff ( 0 ),
- m_nDeltaWidth ( 0 ),
- m_nPendingScrolls( 0 ),
- bNormal ( TRUE )
+/** loads the application logo as used in the about dialog and impress slideshow pause screen */
+Image SfxApplication::GetApplicationLogo()
{
- rtl::OUString sProduct;
- utl::ConfigManager::GetDirectConfigProperty(utl::ConfigManager::PRODUCTNAME) >>= sProduct;
-
- if ( sProduct.equals( rtl::OUString::createFromAscii("StarOffice") ) ||
- sProduct.equals( rtl::OUString::createFromAscii("StarSuite") ) )
- {
- // --> PB 2004-11-18 #118455# new copyright text (only in french version show a french text)
- ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
- ::rtl::OUString sFrenchLang( DEFINE_CONST_OUSTRING( "fr" ) );
- if ( aLocale.Language.equals( sFrenchLang ) )
- {
- String sNewCopyrightText( ResId( ABOUT_STR_FRENCH_COPYRIGHT, *rId.GetResMgr() ) );
- aCopyrightText.SetText( sNewCopyrightText );
- }
- // <--
- }
+ Image aAppLogo;
- // load image from module path
-// rtl::OUString aAbouts( RTL_CONSTASCII_USTRINGPARAM( ABOUT_BITMAP_STRINGLIST ) );
-#ifdef ABOUTBMPNAMES
- rtl::OUString aAbouts( RTL_CONSTASCII_USTRINGPARAM( "ABOUTBMPNAMES" ) );
-#else
rtl::OUString aAbouts;
-#endif
-
bool bLoaded = false;
sal_Int32 nIndex = 0;
do
@@ -174,6 +147,33 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS
rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo );
}
+ return aAppLogo;
+}
+
+AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerStr ) :
+
+ SfxModalDialog ( pParent, rId ),
+
+ aOKButton ( this, ResId( ABOUT_BTN_OK, *rId.GetResMgr() ) ),
+ aVersionText ( this, ResId( ABOUT_FTXT_VERSION, *rId.GetResMgr() ) ),
+ aCopyrightText ( this, ResId( ABOUT_FTXT_COPYRIGHT, *rId.GetResMgr() ) ),
+ aBuildData ( this ),
+ aDeveloperAry ( ResId( ABOUT_STR_DEVELOPER_ARY, *rId.GetResMgr() ) ),
+ aDevVersionStr ( rVerStr ),
+ aAccelStr ( ResId( ABOUT_STR_ACCEL, *rId.GetResMgr() ) ),
+ aCopyrightTextStr( ResId( ABOUT_STR_COPYRIGHT, *rId.GetResMgr() ) ),
+ aTimer (),
+ nOff ( 0 ),
+ m_nDeltaWidth ( 0 ),
+ m_nPendingScrolls( 0 ),
+ bNormal ( TRUE )
+{
+ rtl::OUString sProduct;
+ utl::ConfigManager::GetDirectConfigProperty(utl::ConfigManager::PRODUCTNAME) >>= sProduct;
+
+ // load image from module path
+ aAppLogo = SfxApplication::GetApplicationLogo();
+
// Transparenter Font
Font aFont = GetFont();
aFont.SetTransparent( TRUE );
@@ -284,22 +284,6 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS
// explizite Help-Id
SetHelpId( SID_ABOUT );
-
- //#112429# replace occurences of "StarOffice" in the "StarSuite" version
- String sCopyright( aCopyrightText.GetText() );
- if(sProduct.equals(rtl::OUString::createFromAscii("StarSuite")))
- {
- String sSO(String::CreateFromAscii("StarOffice"));
- sCopyright.SearchAndReplaceAll(sSO, sProduct);
- }
-
- String sNewYear( DEFINE_CONST_UNICODE("2005") );
- xub_StrLen nIdx = sCopyright.SearchAndReplace( DEFINE_CONST_UNICODE("2002"), sNewYear );
- if ( STRING_NOTFOUND == nIdx )
- nIdx = sCopyright.SearchAndReplace( DEFINE_CONST_UNICODE("2003"), sNewYear );
- if ( STRING_NOTFOUND == nIdx )
- nIdx = sCopyright.SearchAndReplace( DEFINE_CONST_UNICODE("2004"), sNewYear );
- aCopyrightText.SetText( sCopyright );
}
// -----------------------------------------------------------------------
diff --git a/sfx2/source/dialog/dialog.hrc b/sfx2/source/dialog/dialog.hrc
index f1e100e17cf5..7f03bf416431 100644
--- a/sfx2/source/dialog/dialog.hrc
+++ b/sfx2/source/dialog/dialog.hrc
@@ -39,54 +39,24 @@
#define RID_DLG_ALIEN_WARNING ( RC_DIALOG_BEGIN + 0)
#define STR_RESET ( RC_DIALOG_BEGIN + 0)
-#define STR_BASEFMT ( RC_DIALOG_BEGIN + 1)
-#define CB_USE_PASSWD ( RC_DIALOG_BEGIN + 2)
-#define CB_READ_ONLY ( RC_DIALOG_BEGIN + 3)
-#define BTN_MANAGER ( RC_DIALOG_BEGIN + 4)
-#define BTN_STANDARD ( RC_DIALOG_BEGIN + 5)
#define DLG_PASSWD ( RC_DIALOG_BEGIN + 8)
-#define STR_FILEDLG_INSERT ( RC_DIALOG_BEGIN + 10)
#define STR_TABPAGE_MANAGESTYLES ( RC_DIALOG_BEGIN + 12)
#define MSG_TABPAGE_INVALIDNAME ( RC_DIALOG_BEGIN + 13)
#define MSG_TABPAGE_INVALIDSTYLE ( RC_DIALOG_BEGIN + 14)
#define DLG_NEW_STYLE_BY_EXAMPLE ( RC_DIALOG_BEGIN + 15)
#define MSG_POOL_STYLE_NAME ( RC_DIALOG_BEGIN + 16)
-#define MSG_OVERWRITE_STYLE ( RC_DIALOG_BEGIN + 17)
#define MSG_TABPAGE_INVALIDPARENT ( RC_DIALOG_BEGIN + 18)
#define STR_DELETE_STYLE ( RC_DIALOG_BEGIN + 18)
#define STR_DELETE_STYLE_USED ( RC_DIALOG_BEGIN + 20)
-#define LOGO_IMAGELIST ( RC_DIALOG_BEGIN + 45)
#define MN_CONTEXT_TEMPLDLG ( RC_DIALOG_BEGIN + 46)
-#define MSG_LAYOUT_NOT_LOADING ( RC_DIALOG_BEGIN + 49)
-#define ACC_LAYOUT_NOT_LOADING ( RC_DIALOG_BEGIN + 50)
-
-#define MSG_ERR_CANT_EDIT_OLD_FORMAT ( RC_DIALOG_BEGIN + 60 )
-#define MSG_ERR_CANT_EDIT_OPEN_DOCS ( RC_DIALOG_BEGIN + 61 )
-
-#define RID_URLOPEN ( RC_DIALOG_BEGIN + 62 )
-#define RID_URLOPEN_OK 1
-#define RID_URLOPEN_CANCEL 2
-#define RID_URLOPEN_URL 3
-
-#define CB_FILE ( RC_DIALOG_BEGIN + 63 )
-#define CB_URL ( RC_DIALOG_BEGIN + 64 )
-
-#define STR_INTERNET ( RC_DIALOG_BEGIN + 65 )
-#define RID_AUTOHIDE ( RC_DIALOG_BEGIN + 66 )
-
-#define DLG_ONLINE_REGISTER ( RC_DIALOG_BEGIN + 68 )
#define DLG_VERSIONS ( RC_DIALOG_BEGIN + 69 )
#define DLG_COMMENTS ( RC_DIALOG_BEGIN + 70 )
-#define RID_REGISTER_DLG ( RC_DIALOG_BEGIN + 73 )
-#define DLG_PHONE_CONFIGURATION ( RC_DIALOG_BEGIN + 74 )
-#define DLG_RECOGNIZER_ENGINEMODE ( RC_DIALOG_BEGIN + 75 )
#define MSG_ERROR_WRONG_CONFIRM ( RC_DIALOG_BEGIN + 76 )
-#define DLG_RECOGNIZER_SPEAKER ( RC_DIALOG_BEGIN + 77 )
#define STR_APPLY ( RC_DIALOG_BEGIN + 87 )
@@ -104,7 +74,6 @@
#define RID_DLG_SEARCH ( RC_DIALOG_BEGIN + 109 )
#define STR_PDF_EXPORT_SEND ( RC_DIALOG_BEGIN + 120 )
-#define STR_RECHECK_DOCUMENT ( RC_DIALOG_BEGIN + 121 )
#define IMG_INFO ( RC_DIALOG_BEGIN + 122 )
#define RID_EDIT_DURATIONS ( RC_DIALOG_BEGIN + 123 )
#define SFX_PB_EDIT ( RC_DIALOG_BEGIN + 124 )
diff --git a/sfx2/source/dialog/dialog.src b/sfx2/source/dialog/dialog.src
index a54d2c340d04..c39425510ae2 100644
--- a/sfx2/source/dialog/dialog.src
+++ b/sfx2/source/dialog/dialog.src
@@ -31,30 +31,6 @@
#include "helpid.hrc"
#include "sfxlocal.hrc"
- // Imageliste fuer die AboutBox
-ImageList LOGO_IMAGELIST
-{
- Prefix = "an";
- MaskColor = Color
- {
- Red = 0xFFFF ;
- Green = 0x0000 ;
- Blue = 0xFFFF ;
- };
- IdList =
- {
- 1 ;
- 2 ;
- 3 ;
- 4 ;
- 5 ;
- 6 ;
- };
- IdCount =
- {
- 6 ;
- };
-};
String STR_RESET
{
Text [ en-US ] = "~Reset" ;
@@ -63,48 +39,6 @@ String STR_APPLY
{
Text [ en-US ] = "Apply";
};
-String STR_INTERNET
-{
- Text [ en-US ] = "(Internet)" ;
-};
-String STR_BASEFMT
-{
- Text [ en-US ] = "Base format" ;
-};
-CheckBox CB_USE_PASSWD
-{
- HelpId = HID_FILEDLG_USE_PASSWD ;
- Text [ en-US ] = "~Password" ;
-};
-CheckBox CB_READ_ONLY
-{
- HelpId = HID_FILEDLG_READ_ONLY ;
- Text [ en-US ] = "~Read-only" ;
-};
-PushButton CB_FILE
-{
- HelpId = HID_FILEDLG_FILE ;
- Text [ en-US ] = "~File System" ;
-};
-PushButton CB_URL
-{
- HelpId = HID_FILEDLG_URL ;
- Text [ en-US ] = "Int~ernet" ;
-};
-PushButton BTN_MANAGER
-{
- HelpId = HID_FILEDLG_MANAGER ;
- Text [ en-US ] = "~Manager..." ;
-};
-PushButton BTN_STANDARD
-{
- HelpId = HID_FILEDLG_STANDARD ;
- Text [ en-US ] = "~Home" ;
-};
-String STR_FILEDLG_INSERT
-{
- Text [ en-US ] = "Insert File" ;
-};
String STR_TABPAGE_MANAGESTYLES
{
Text [ en-US ] = "Organizer" ;
@@ -131,12 +65,6 @@ InfoBox MSG_POOL_STYLE_NAME
{
Message [ en-US ] = "Name already exists as a default Style.\nPlease choose another name." ;
};
-QueryBox MSG_OVERWRITE_STYLE
-{
- Buttons = WB_YES_NO ;
- DefButton = WB_DEF_NO ;
- Message [ en-US ] = "Style already exists. Overwrite?" ;
-};
String STR_DELETE_STYLE
{
Text [ en-US ] = "Do you really want to delete Style $1?" ;
@@ -170,87 +98,15 @@ Menu MN_CONTEXT_TEMPLDLG
};
};
-InfoBox MSG_LAYOUT_NOT_LOADING
-{
- BUTTONS = WB_OK ;
- DEFBUTTON = WB_DEF_OK ;
- Message [ en-US ] = "Loading document without layout." ;
-};
-Accelerator ACC_LAYOUT_NOT_LOADING
-{
- ItemList =
- {
- AcceleratorItem
- {
- Key = KeyCode
- {
- Code = KEY_L ;
- Shift = FALSE ; Modifier1 = TRUE ; Modifier2 = TRUE ;
- };
- Identifier = 1 ;
- };
- };
-};
//------------------------------------------------------------------------
-ErrorBox MSG_ERR_CANT_EDIT_OLD_FORMAT
-{
- Message [ en-US ] = "Cannot edit document info for documents\n in this file format." ;
-};
- //------------------------------------------------------------------------
-ErrorBox MSG_ERR_CANT_EDIT_OPEN_DOCS
-{
- Message [ en-US ] = "Document info of documents\n being currently edited cannot be modified from within the document manager." ;
-};
-ModalDialog RID_URLOPEN
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 204 , 44 ) ;
- Moveable = TRUE ;
- Text [ en-US ] = "Enter URL" ;
- Moveable = TRUE ;
- OKButton RID_URLOPEN_OK
- {
- Pos = MAP_APPFONT ( 148 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton RID_URLOPEN_CANCEL
- {
- Pos = MAP_APPFONT ( 148 , 24 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- Edit RID_URLOPEN_URL
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 16 ) ;
- Size = MAP_APPFONT ( 138 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- };
-};
-Menu RID_AUTOHIDE
-{
- ItemList =
- {
- MenuItem
- {
- Identifier = SID_AUTOHIDE ;
- HelpID = SID_AUTOHIDE ;
- Text [ en-US ] = "Hide" ;
- };
- };
-};
-String RID_AUTOHIDE
-{
- Text [ en-US ] = "Don't Hide" ;
-};
String SID_NAVIGATOR
{
Text [ en-US ] = "Navigator";
};
+String SID_TASKPANE
+{
+ Text [ en-US ] = "Task Pane";
+};
ErrorBox MSG_ERROR_WRONG_CONFIRM
{
@@ -264,11 +120,6 @@ String STR_PDF_EXPORT_SEND
Text [ en-US ] = "Send" ;
};
-String STR_RECHECK_DOCUMENT
-{
- Text [ en-US ] = "Recheck Document" ;
-};
-
Image IMG_INFO
{
ImageBitmap = Bitmap
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 80ad4ee7ae22..0ad62ae1eec1 100644..100755
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -27,12 +27,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sfx2.hxx"
+
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
#include <svl/eitem.hxx>
#include <vcl/svapp.hxx>
#include <sfx2/filedlghelper.hxx>
#include <unotools/localedatawrapper.hxx>
+#include <unotools/cmdoptions.hxx>
#include <comphelper/processfactory.hxx>
#include <svl/urihelper.hxx>
#include <unotools/useroptions.hxx>
@@ -58,9 +60,10 @@
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <vcl/timer.hxx>
-#include <sfx2/dinfdlg.hxx>
-#include "sfx2/sfxresid.hxx"
-#include "sfx2/dinfedt.hxx"
+#include "sfx2/dinfdlg.hxx"
+#include "sfx2/securitypage.hxx"
+#include "sfxresid.hxx"
+#include "dinfedt.hxx"
#include <sfx2/frame.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/request.hxx>
@@ -119,6 +122,8 @@ const USHORT HI_TYPE = 2;
const USHORT HI_VALUE = 3;
const USHORT HI_ACTION = 4;
+static const char DOCUMENT_SIGNATURE_MENU_CMD[] = "Signature";
+
//------------------------------------------------------------------------
String CreateSizeText( ULONG nSize, BOOL bExtraBytes = TRUE, BOOL bSmartExtraBytes = FALSE );
String CreateSizeText( ULONG nSize, BOOL bExtraBytes, BOOL bSmartExtraBytes )
@@ -858,6 +863,13 @@ SfxDocumentPage::SfxDocumentPage( Window* pParent, const SfxItemSet& rItemSet )
aNewSize.Width() -= nDelta;
aUseUserDataCB.SetSizePixel( aNewSize );
}
+ // See i96288
+ // Check if the document signature command is enabled
+ // on the main list enable/disable the pushbutton accordingly
+ SvtCommandOptions aCmdOptions;
+ if ( aCmdOptions.Lookup( SvtCommandOptions::CMDOPTION_DISABLED,
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( DOCUMENT_SIGNATURE_MENU_CMD ) ) ) )
+ aSignatureBtn.Disable();
}
//------------------------------------------------------------------------
@@ -1554,6 +1566,7 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( Window* pParent,
AddTabPage(TP_DOCINFODOC, SfxDocumentPage::Create, 0);
AddTabPage(TP_CUSTOMPROPERTIES, SfxCustomPropertiesPage::Create, 0);
AddTabPage(TP_DOCINFORELOAD, SfxInternetPage::Create, 0);
+ AddTabPage(TP_DOCINFOSECURITY, SfxSecurityPage::Create, 0);
}
// -----------------------------------------------------------------------
diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src
index 99a062c4aecf..53b0f35685cb 100644..100755
--- a/sfx2/source/dialog/dinfdlg.src
+++ b/sfx2/source/dialog/dinfdlg.src
@@ -27,11 +27,11 @@
// include ---------------------------------------------------------------
-#include <sfx2/sfx.hrc>
+#include "sfx2/sfx.hrc"
#include "helpid.hrc"
#include "sfxlocal.hrc"
#include "dinfdlg.hrc"
-#include <dialog.hrc>
+#include "dialog.hrc"
// TP_DOCINFODESC --------------------------------------------------------
String STR_SFX_NEWOFFICEDOC
@@ -685,8 +685,6 @@ QueryBox SFX_QB_WRONG_TYPE
Message [ en-US ] = "The value entered does not match the specified type.\nThe value will be stored as text." ;
};
- // SID_DOCINFO -----------------------------------------------------------
-
TabDialog SID_DOCINFO
{
OutputSize = TRUE ;
@@ -718,6 +716,11 @@ TabDialog SID_DOCINFO
Identifier = TP_DOCINFORELOAD ;
Text [ en-US ] = "Internet" ;
};
+ PageItem
+ {
+ Identifier = TP_DOCINFOSECURITY ;
+ Text [ en-US ] = "Security" ;
+ };
};
};
};
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 98834e93f912..2112a03dd63f 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -57,6 +57,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/types.hxx>
#include <comphelper/sequenceashashmap.hxx>
+#include <comphelper/stillreadwriteinteraction.hxx>
#include <tools/urlobj.hxx>
#include <vcl/help.hxx>
#include <unotools/ucbstreamhelper.hxx>
@@ -80,11 +81,13 @@
#include <svtools/helpid.hrc>
#include <svl/pickerhelper.hxx>
#include <comphelper/docpasswordrequest.hxx>
+#include <comphelper/docpasswordhelper.hxx>
#include <ucbhelper/content.hxx>
#include <ucbhelper/commandenvironment.hxx>
#include <comphelper/storagehelper.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <sfx2/app.hxx>
+#include <sfx2/frame.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/docfac.hxx>
#include "openflag.hxx"
@@ -464,31 +467,6 @@ sal_Bool FileDialogHelper_Impl::isInOpenMode() const
// ------------------------------------------------------------------------
-namespace {
-
-bool lclCheckODFPasswordCapability( const SfxFilter* pFilter )
-{
- return pFilter && pFilter->IsOwnFormat() && pFilter->UsesStorage() && (pFilter->GetVersion() >= SOFFICE_FILEFORMAT_60);
-}
-
-bool lclCheckMSPasswordCapability( const SfxFilter* pFilter )
-{
- // TODO #i105076# this should be in the filter configuration!!!
- return pFilter && CheckMSPasswordCapabilityForExport( pFilter->GetFilterName() );
-}
-
-bool lclCheckPasswordCapability( const SfxFilter* pFilter )
-{
- return
- lclCheckODFPasswordCapability( pFilter ) ||
- // TODO #i105076# this should be in the filter configuration!!!
- lclCheckMSPasswordCapability( pFilter );
-}
-
-}
-
-// ------------------------------------------------------------------------
-
void FileDialogHelper_Impl::updateFilterOptionsBox()
{
if ( !m_bHaveFilterOptions )
@@ -542,11 +520,11 @@ void FileDialogHelper_Impl::updateExportButton()
// ------------------------------------------------------------------------
void FileDialogHelper_Impl::updateSelectionBox()
{
- if ( !mbExport )
+ if ( !mbHasSelectionBox )
return;
// Does the selection box exist?
- bool bSelectionBoxFound = false;
+ sal_Bool bSelectionBoxFound = sal_False;
uno::Reference< XControlInformation > xCtrlInfo( mxFileDlg, UNO_QUERY );
if ( xCtrlInfo.is() )
{
@@ -555,7 +533,7 @@ void FileDialogHelper_Impl::updateSelectionBox()
for ( sal_uInt32 nCtrl = 0; nCtrl < nCount; ++nCtrl )
if ( aCtrlList[ nCtrl ].equalsAscii("SelectionBox") )
{
- bSelectionBoxFound = true;
+ bSelectionBoxFound = sal_False;
break;
}
}
@@ -563,7 +541,7 @@ void FileDialogHelper_Impl::updateSelectionBox()
if ( bSelectionBoxFound )
{
const SfxFilter* pFilter = getCurentSfxFilter();
- updateExtendedControl(
+ mbSelectionFltrEnabled = updateExtendedControl(
ExtendedFilePickerElementIds::CHECKBOX_SELECTION,
( mbSelectionEnabled && pFilter && ( pFilter->GetFilterFlags() & SFX_FILTER_SUPPORTSSELECTION ) != 0 ) );
uno::Reference< XFilePickerControlAccess > xCtrlAccess( mxFileDlg, UNO_QUERY );
@@ -579,9 +557,10 @@ void FileDialogHelper_Impl::enablePasswordBox( sal_Bool bInit )
sal_Bool bWasEnabled = mbIsPwdEnabled;
+ const SfxFilter* pCurrentFilter = getCurentSfxFilter();
mbIsPwdEnabled = updateExtendedControl(
ExtendedFilePickerElementIds::CHECKBOX_PASSWORD,
- lclCheckPasswordCapability( getCurentSfxFilter() )
+ pCurrentFilter && ( pCurrentFilter->GetFilterFlags() & SFX_FILTER_ENCRYPTION )
);
if( bInit )
@@ -956,6 +935,8 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
mbPwdCheckBoxState = sal_False;
mbSelection = sal_False;
mbSelectionEnabled = sal_True;
+ mbHasSelectionBox = sal_False;
+ mbSelectionFltrEnabled = sal_False;
// default settings
m_nDontFlags = SFX_FILTER_INTERNAL | SFX_FILTER_NOTINFILEDLG | SFX_FILTER_NOTINSTALLED;
@@ -1025,6 +1006,7 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
nTemplateDescription = TemplateDescription::FILESAVE_AUTOEXTENSION_SELECTION;
mbHasAutoExt = sal_True;
mbIsSaveDlg = sal_True;
+ mbHasSelectionBox = sal_True;
if ( mbExport && !mxFilterCFG.is() && xFactory.is() )
{
mxFilterCFG = uno::Reference< XNameAccess >(
@@ -1550,6 +1532,10 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
{
SFX_ITEMSET_ARG( rpSet, pPassItem, SfxStringItem, SID_PASSWORD, FALSE );
mbPwdCheckBoxState = ( pPassItem != NULL );
+
+ // in case the document has password to modify, the dialog should be shown
+ SFX_ITEMSET_ARG( rpSet, pPassToModifyItem, SfxUnoAnyItem, SID_MODIFYPASSWORDINFO, FALSE );
+ mbPwdCheckBoxState |= ( pPassToModifyItem && pPassToModifyItem->GetValue().hasValue() );
}
SFX_ITEMSET_ARG( rpSet, pSelectItem, SfxBoolItem, SID_SELECTION, FALSE );
@@ -1560,6 +1546,9 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
// the password will be set in case user decide so
rpSet->ClearItem( SID_PASSWORD );
+ rpSet->ClearItem( SID_RECOMMENDREADONLY );
+ rpSet->ClearItem( SID_MODIFYPASSWORDINFO );
+
}
if ( mbHasPassword && !mbPwdCheckBoxState )
@@ -1636,13 +1625,15 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
// set the filter
getRealFilter( rFilter );
+ const SfxFilter* pCurrentFilter = getCurentSfxFilter();
+
// fill the rpURLList
- implGetAndCacheFiles(mxFileDlg, rpURLList, getCurentSfxFilter());
+ implGetAndCacheFiles( mxFileDlg, rpURLList, pCurrentFilter );
if ( rpURLList == NULL || rpURLList->GetObject(0) == NULL )
return ERRCODE_ABORT;
// check, wether or not we have to display a password box
- if ( mbHasPassword && mbIsPwdEnabled && xCtrlAccess.is() )
+ if ( pCurrentFilter && mbHasPassword && mbIsPwdEnabled && xCtrlAccess.is() )
{
try
{
@@ -1656,18 +1647,38 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
if( xInteractionHandler.is() )
{
// TODO: need a save way to distinguish MS filters from other filters
- bool bMSType = CheckMSPasswordCapabilityForExport( rFilter );
+ // for now MS-filters are the only alien filters that support encryption
+ sal_Bool bMSType = !pCurrentFilter->IsOwnFormat();
::comphelper::DocPasswordRequestType eType = bMSType ?
::comphelper::DocPasswordRequestType_MS :
::comphelper::DocPasswordRequestType_STANDARD;
- ::comphelper::DocPasswordRequest* pPasswordRequest = new ::comphelper::DocPasswordRequest(
- eType, ::com::sun::star::task::PasswordRequestMode_PASSWORD_CREATE, *(rpURLList->GetObject(0)) );
+ ::rtl::Reference< ::comphelper::DocPasswordRequest > pPasswordRequest( new ::comphelper::DocPasswordRequest( eType, ::com::sun::star::task::PasswordRequestMode_PASSWORD_CREATE, *(rpURLList->GetObject(0)), ( pCurrentFilter->GetFilterFlags() & SFX_FILTER_PASSWORDTOMODIFY ) != 0 ) );
- uno::Reference< com::sun::star::task::XInteractionRequest > rRequest( pPasswordRequest );
+ uno::Reference< com::sun::star::task::XInteractionRequest > rRequest( pPasswordRequest.get() );
xInteractionHandler->handle( rRequest );
if ( pPasswordRequest->isPassword() )
- rpSet->Put( SfxStringItem( SID_PASSWORD, pPasswordRequest->getPassword() ) );
+ {
+ if ( pPasswordRequest->getPassword().getLength() )
+ rpSet->Put( SfxStringItem( SID_PASSWORD, pPasswordRequest->getPassword() ) );
+
+ if ( pPasswordRequest->getRecommendReadOnly() )
+ rpSet->Put( SfxBoolItem( SID_RECOMMENDREADONLY, sal_True ) );
+
+ if ( bMSType )
+ {
+ // the empty password has 0 as Hash
+ sal_Int32 nHash = SfxMedium::CreatePasswordToModifyHash( pPasswordRequest->getPasswordToModify(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ).equals( pCurrentFilter->GetServiceName() ) );
+ if ( nHash )
+ rpSet->Put( SfxUnoAnyItem( SID_MODIFYPASSWORDINFO, uno::makeAny( nHash ) ) );
+ }
+ else
+ {
+ uno::Sequence< beans::PropertyValue > aModifyPasswordInfo = ::comphelper::DocPasswordHelper::GenerateNewModifyPasswordInfo( pPasswordRequest->getPasswordToModify() );
+ if ( aModifyPasswordInfo.getLength() )
+ rpSet->Put( SfxUnoAnyItem( SID_MODIFYPASSWORDINFO, uno::makeAny( aModifyPasswordInfo ) ) );
+ }
+ }
else
return ERRCODE_ABORT;
}
@@ -2073,6 +2084,21 @@ void FileDialogHelper_Impl::saveConfig()
}
}
+ if( mbHasSelectionBox && mbSelectionFltrEnabled )
+ {
+ try
+ {
+ aValue = xDlg->getValue( ExtendedFilePickerElementIds::CHECKBOX_SELECTION, 0 );
+ sal_Bool bSelection = sal_True;
+ aValue >>= bSelection;
+ if ( aUserData.GetTokenCount(' ') < 3 )
+ aUserData.Append(' ');
+ aUserData.SetToken( 2, ' ', String::CreateFromInt32( (sal_Int32) bSelection ) );
+ bWriteConfig = sal_True;
+ }
+ catch( IllegalArgumentException ){}
+ }
+
if ( bWriteConfig )
aDlgOpt.SetUserItem( USERITEM_NAME, makeAny( OUString( aUserData ) ) );
}
@@ -2206,6 +2232,17 @@ void FileDialogHelper_Impl::loadConfig()
catch( IllegalArgumentException ){}
}
+ if( mbHasSelectionBox )
+ {
+ sal_Int32 nFlag = aUserData.GetToken( 2, ' ' ).ToInt32();
+ aValue <<= (sal_Bool) nFlag;
+ try
+ {
+ xDlg->setValue( ExtendedFilePickerElementIds::CHECKBOX_SELECTION, 0, aValue );
+ }
+ catch( IllegalArgumentException ){}
+ }
+
if ( !maPath.getLength() )
displayFolder( SvtPathOptions().GetWorkPath() );
}
@@ -2664,10 +2701,12 @@ static int impl_isFolder( const OUString& rPath )
{
}
+ ::rtl::Reference< ::comphelper::StillReadWriteInteraction > aHandler = new ::comphelper::StillReadWriteInteraction( xHandler );
+
try
{
::ucbhelper::Content aContent(
- rPath, new ::ucbhelper::CommandEnvironment( xHandler, uno::Reference< ucb::XProgressHandler >() ) );
+ rPath, new ::ucbhelper::CommandEnvironment( static_cast< task::XInteractionHandler* > ( aHandler.get() ), uno::Reference< ucb::XProgressHandler >() ) );
if ( aContent.isFolder() )
return 1;
diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx
index b023b8fb53a9..6965e14ae84d 100644
--- a/sfx2/source/dialog/filedlgimpl.hxx
+++ b/sfx2/source/dialog/filedlgimpl.hxx
@@ -107,6 +107,8 @@ namespace sfx2
sal_Bool mbPwdCheckBoxState : 1;
sal_Bool mbSelection : 1;
sal_Bool mbSelectionEnabled : 1;
+ sal_Bool mbHasSelectionBox : 1;
+ sal_Bool mbSelectionFltrEnabled : 1;
private:
void addFilters( sal_Int64 nFlags,
diff --git a/sfx2/source/dialog/makefile.mk b/sfx2/source/dialog/makefile.mk
index 5382eb92e3cd..26acd12c1413 100644..100755
--- a/sfx2/source/dialog/makefile.mk
+++ b/sfx2/source/dialog/makefile.mk
@@ -45,7 +45,8 @@ EXCEPTIONSFILES=\
$(SLO)$/recfloat.obj \
$(SLO)$/templdlg.obj \
$(SLO)$/dinfdlg.obj \
- $(SLO)$/dockwin.obj
+ $(SLO)$/dockwin.obj \
+ $(SLO)$/taskpane.obj
SLOFILES =\
$(EXCEPTIONSFILES) \
@@ -60,7 +61,6 @@ SLOFILES =\
$(SLO)$/passwd.obj \
$(SLO)$/printopt.obj \
$(SLO)$/sfxdlg.obj \
- $(SLO)$/sfxurl.obj \
$(SLO)$/splitwin.obj \
$(SLO)$/srchdlg.obj \
$(SLO)$/styfitem.obj \
@@ -68,7 +68,9 @@ SLOFILES =\
$(SLO)$/tabdlg.obj \
$(SLO)$/tplcitem.obj \
$(SLO)$/tplpitem.obj \
- $(SLO)$/versdlg.obj
+ $(SLO)$/versdlg.obj \
+ $(SLO)$/securitypage.obj \
+ $(SLO)$/titledockwin.obj
SRS1NAME=$(TARGET)
SRC1FILES =\
@@ -85,7 +87,10 @@ SRC1FILES =\
templdlg.src \
versdlg.src \
printopt.src \
- srchdlg.src
+ srchdlg.src \
+ securitypage.src \
+ titledockwin.src \
+ taskpane.src
.IF "$(BUILD_VER_STRING)"!=""
.IF "$(GUI)"=="UNX"
diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx
new file mode 100755
index 000000000000..d32ee843cbf2
--- /dev/null
+++ b/sfx2/source/dialog/securitypage.cxx
@@ -0,0 +1,523 @@
+/*************************************************************************
+ *
+ * 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_sfx2.hxx"
+
+#include "sfx2/securitypage.hxx"
+
+#include "securitypage.hrc"
+#include "sfxresid.hxx"
+
+#include <sfx2/sfx.hrc>
+#include <sfx2/sfxsids.hrc>
+#include <sfx2/objsh.hxx>
+#include <sfx2/viewsh.hxx>
+#include <sfx2/dispatch.hxx>
+#include <sfx2/passwd.hxx>
+
+#include <vcl/button.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/msgbox.hxx>
+#include <svl/eitem.hxx>
+#include <svl/poolitem.hxx>
+#include <svl/intitem.hxx>
+#include <svl/PasswordHelper.hxx>
+#include <svtools/xwindowitem.hxx>
+
+
+using namespace ::com::sun::star;
+
+//////////////////////////////////////////////////////////////////////
+
+
+namespace
+{
+ enum RedliningMode { RL_NONE, RL_WRITER, RL_CALC };
+ enum RedlineFunc { RF_ON, RF_PROTECT };
+
+/*
+ bool QueryIsEnabled( USHORT _nSlot )
+ {
+ bool bRes = false;
+ SfxViewShell* pViewSh = SfxViewShell::Current();
+ if (pViewSh)
+ {
+ const SfxPoolItem* pItem;
+ SfxDispatcher* pDisp = pViewSh->GetDispatcher();
+ SfxItemState eState = pDisp->QueryState( _nSlot, pItem );
+ bRes = (eState & SFX_ITEM_DISABLED) == 0;
+ }
+ return bRes;
+ }
+*/
+
+ bool QueryState( USHORT _nSlot, bool& _rValue )
+ {
+ bool bRet = false;
+ SfxViewShell* pViewSh = SfxViewShell::Current();
+ if (pViewSh)
+ {
+ const SfxPoolItem* pItem;
+ SfxDispatcher* pDisp = pViewSh->GetDispatcher();
+ SfxItemState nState = pDisp->QueryState( _nSlot, pItem );
+ bRet = SFX_ITEM_AVAILABLE <= nState;
+ if (bRet)
+ _rValue = ( static_cast< const SfxBoolItem* >( pItem ) )->GetValue();
+ }
+ return bRet;
+ }
+
+
+ bool QueryRecordChangesProtectionState( RedliningMode _eMode, bool& _rValue )
+ {
+ bool bRet = false;
+ if (_eMode != RL_NONE)
+ {
+ USHORT nSlot = _eMode == RL_WRITER ? FN_REDLINE_PROTECT : SID_CHG_PROTECT;
+ bRet = QueryState( nSlot, _rValue );
+ }
+ return bRet;
+ }
+
+
+ bool QueryRecordChangesState( RedliningMode _eMode, bool& _rValue )
+ {
+ bool bRet = false;
+ if (_eMode != RL_NONE)
+ {
+ USHORT nSlot = _eMode == RL_WRITER ? FN_REDLINE_ON : FID_CHG_RECORD;
+ bRet = QueryState( nSlot, _rValue );
+ }
+ return bRet;
+ }
+}
+
+
+//////////////////////////////////////////////////////////////////////
+
+
+static short lcl_GetPassword(
+ Window *pParent,
+ bool bProtect,
+ /*out*/String &rPassword )
+{
+ bool bRes = false;
+ SfxPasswordDialog aPasswdDlg( pParent );
+ const String aTitle( SfxResId( bProtect ? RID_SFX_PROTECT_RECORDS : RID_SFX_UNPROTECT_RECORDS ) );
+ aPasswdDlg.SetText( aTitle );
+ aPasswdDlg.SetMinLen( 1 );
+ if (bProtect)
+ aPasswdDlg.ShowExtras( SHOWEXTRAS_CONFIRM );
+ if (RET_OK == aPasswdDlg.Execute() && aPasswdDlg.GetPassword().Len() > 0)
+ {
+ rPassword = aPasswdDlg.GetPassword();
+ bRes = true;
+ }
+ return bRes;
+}
+
+
+static bool lcl_IsPasswordCorrect( const String &rPassword )
+{
+ bool bRes = false;
+
+ SfxObjectShell* pCurDocShell = SfxObjectShell::Current();
+ uno::Sequence< sal_Int8 > aPasswordHash;
+ pCurDocShell->GetProtectionHash( aPasswordHash );
+
+ // check if supplied password was correct
+ uno::Sequence< sal_Int8 > aNewPasswd( aPasswordHash );
+ SvPasswordHelper::GetHashPassword( aNewPasswd, rPassword );
+ if (SvPasswordHelper::CompareHashPassword( aPasswordHash, rPassword ))
+ bRes = true; // password was correct
+ else
+ InfoBox( NULL, String( SfxResId( RID_SFX_INCORRECT_PASSWORD ) ) ).Execute();
+
+ return bRes;
+}
+
+
+//////////////////////////////////////////////////////////////////////
+
+
+struct SfxSecurityPage_Impl
+{
+ SfxSecurityPage & m_rMyTabPage;
+
+ FixedLine m_aNewPasswordToOpenFL;
+ FixedText m_aNewPasswordToOpenFT;
+ Edit m_aNewPasswordToOpenED;
+ FixedText m_aConfirmPasswordToOpenFT;
+ Edit m_aConfirmPasswordToOpenED;
+ FixedText m_aNewPasswordInfoFT;
+
+ FixedLine m_aNewPasswordToModifyFL;
+ FixedText m_aNewPasswordToModifyFT;
+ Edit m_aNewPasswordToModifyED;
+ FixedText m_aConfirmPasswordToModifyFT;
+ Edit m_aConfirmPasswordToModifyED;
+
+ FixedLine m_aOptionsFL;
+ CheckBox m_aOpenReadonlyCB;
+ CheckBox m_aRecordChangesCB; // for record changes
+ PushButton m_aChangeProtectionPB; // for record changes
+ String m_aProtectSTR; // for record changes
+ String m_aUnProtectSTR; // for record changes
+ RedliningMode m_eRedlingMode; // for record changes
+
+ bool m_bOrigPasswordIsConfirmed;
+ bool m_bNewPasswordIsValid;
+ String m_aNewPassword;
+
+ String m_aEndRedliningWarning;
+ bool m_bEndRedliningWarningDone;
+
+ DECL_LINK( RecordChangesCBToggleHdl, void* );
+ DECL_LINK( ChangeProtectionPBHdl, void* );
+
+ SfxSecurityPage_Impl( SfxSecurityPage &rDlg, const SfxItemSet &rItemSet );
+ ~SfxSecurityPage_Impl();
+
+ BOOL FillItemSet_Impl( SfxItemSet & );
+ void Reset_Impl( const SfxItemSet & );
+};
+
+
+SfxSecurityPage_Impl::SfxSecurityPage_Impl( SfxSecurityPage &rTabPage, const SfxItemSet & ) :
+ m_rMyTabPage (rTabPage),
+ m_aNewPasswordToOpenFL (&rTabPage, SfxResId( PASSWORD_TO_OPEN_FL ) ),
+ m_aNewPasswordToOpenFT (&rTabPage, SfxResId( PASSWORD_TO_OPEN_FT ) ),
+ m_aNewPasswordToOpenED (&rTabPage, SfxResId( PASSWORD_TO_OPEN_ED ) ),
+ m_aConfirmPasswordToOpenFT (&rTabPage, SfxResId( CONFIRM_PASSWORD_TO_OPEN_FT ) ),
+ m_aConfirmPasswordToOpenED (&rTabPage, SfxResId( CONFIRM_PASSWORD_TO_OPEN_ED ) ),
+ m_aNewPasswordInfoFT (&rTabPage, SfxResId( PASSWORD_INFO_FT ) ),
+ m_aNewPasswordToModifyFL (&rTabPage, SfxResId( PASSWORD_TO_MODIFY_FL ) ),
+ m_aNewPasswordToModifyFT (&rTabPage, SfxResId( PASSWORD_TO_MODIFY_FT ) ),
+ m_aNewPasswordToModifyED (&rTabPage, SfxResId( PASSWORD_TO_MODIFY_ED ) ),
+ m_aConfirmPasswordToModifyFT (&rTabPage, SfxResId( CONFIRM_PASSWORD_TO_MODIFY_FT ) ),
+ m_aConfirmPasswordToModifyED (&rTabPage, SfxResId( CONFIRM_PASSWORD_TO_MODIFY_ED ) ),
+ m_aOptionsFL (&rTabPage, SfxResId( OPTIONS_FL ) ),
+ m_aOpenReadonlyCB (&rTabPage, SfxResId( OPEN_READONLY_CB ) ),
+ m_aRecordChangesCB (&rTabPage, SfxResId( RECORD_CHANGES_CB ) ),
+ m_aChangeProtectionPB (&rTabPage, SfxResId( CHANGE_PROTECTION_PB ) ),
+ m_aProtectSTR ( SfxResId( STR_PROTECT ) ),
+ m_aUnProtectSTR ( SfxResId( STR_UNPROTECT ) ),
+ m_eRedlingMode ( RL_NONE ),
+ m_bOrigPasswordIsConfirmed ( false ),
+ m_bNewPasswordIsValid ( false ),
+ m_aEndRedliningWarning ( SfxResId( STR_END_REDLINING_WARNING ) ),
+ m_bEndRedliningWarningDone ( false )
+{
+ m_aChangeProtectionPB.SetText( m_aProtectSTR );
+ // adjust button width if necessary
+ long nBtnTextWidth = 0;
+ long nTemp = m_aChangeProtectionPB.GetCtrlTextWidth( m_aChangeProtectionPB.GetText() );
+ if (nTemp > nBtnTextWidth)
+ nBtnTextWidth = nTemp;
+
+ // force toggle hdl called before visual change of checkbox
+ m_aRecordChangesCB.SetStyle( m_aRecordChangesCB.GetStyle() | WB_EARLYTOGGLE );
+ m_aRecordChangesCB.SetToggleHdl( LINK( this, SfxSecurityPage_Impl, RecordChangesCBToggleHdl ) );
+ m_aChangeProtectionPB.SetClickHdl( LINK( this, SfxSecurityPage_Impl, ChangeProtectionPBHdl ) );
+}
+
+
+SfxSecurityPage_Impl::~SfxSecurityPage_Impl()
+{
+}
+
+
+BOOL SfxSecurityPage_Impl::FillItemSet_Impl( SfxItemSet & )
+{
+ bool bModified = false;
+
+ SfxObjectShell* pCurDocShell = SfxObjectShell::Current();
+ if (pCurDocShell&& !pCurDocShell->IsReadOnly())
+ {
+ if (m_eRedlingMode != RL_NONE )
+ {
+ const bool bDoRecordChanges = m_aRecordChangesCB.IsChecked();
+ const bool bDoChangeProtection = m_aChangeProtectionPB.GetText() != m_aProtectSTR;
+
+ // sanity checks
+ DBG_ASSERT( bDoRecordChanges || !bDoChangeProtection, "no change recording should imply no change protection" );
+ DBG_ASSERT( bDoChangeProtection || !bDoRecordChanges, "no change protection should imply no change recording" );
+ DBG_ASSERT( !bDoChangeProtection || m_aNewPassword.Len() > 0, "change protection should imply password length is > 0" );
+ DBG_ASSERT( bDoChangeProtection || m_aNewPassword.Len() == 0, "no change protection should imply password length is 0" );
+
+ // change recording
+ if (bDoRecordChanges != pCurDocShell->IsChangeRecording())
+ {
+ pCurDocShell->SetChangeRecording( bDoRecordChanges );
+ bModified = true;
+ }
+
+ // change record protection
+ if (m_bNewPasswordIsValid &&
+ bDoChangeProtection != pCurDocShell->HasChangeRecordProtection())
+ {
+ DBG_ASSERT( !bDoChangeProtection || bDoRecordChanges,
+ "change protection requires record changes to be active!" );
+ pCurDocShell->SetProtectionPassword( m_aNewPassword );
+ bModified = true;
+ }
+ }
+
+ // open read-only?
+ const sal_Bool bDoOpenReadonly = m_aOpenReadonlyCB.IsChecked();
+ if (pCurDocShell->HasSecurityOptOpenReadOnly() &&
+ bDoOpenReadonly != pCurDocShell->IsSecurityOptOpenReadOnly())
+ {
+ pCurDocShell->SetSecurityOptOpenReadOnly( bDoOpenReadonly );
+ bModified = true;
+ }
+ }
+
+ return bModified;
+}
+
+
+void SfxSecurityPage_Impl::Reset_Impl( const SfxItemSet & )
+{
+ SfxObjectShell* pCurDocShell = SfxObjectShell::Current();
+
+ String sNewText = m_aProtectSTR;
+ if (!pCurDocShell)
+ {
+ // no doc -> hide document settings
+ m_aOpenReadonlyCB.Disable();
+ m_aRecordChangesCB.Disable();
+ m_aChangeProtectionPB.Disable();
+ }
+ else
+ {
+ bool bIsHTMLDoc = false;
+ SfxViewShell* pViewSh = SfxViewShell::Current();
+ if (pViewSh)
+ {
+ const SfxPoolItem* pItem;
+ SfxDispatcher* pDisp = pViewSh->GetDispatcher();
+ if (SFX_ITEM_AVAILABLE <= pDisp->QueryState( SID_HTML_MODE, pItem ))
+ {
+ USHORT nMode = static_cast< const SfxUInt16Item* >( pItem )->GetValue();
+ bIsHTMLDoc = ( ( nMode & HTMLMODE_ON ) != 0 );
+ }
+ }
+
+ sal_Bool bIsReadonly = pCurDocShell->IsReadOnly();
+ if (pCurDocShell->HasSecurityOptOpenReadOnly() && !bIsHTMLDoc)
+ {
+ m_aOpenReadonlyCB.Check( pCurDocShell->IsSecurityOptOpenReadOnly() );
+ m_aOpenReadonlyCB.Enable( !bIsReadonly );
+ }
+ else
+ m_aOpenReadonlyCB.Disable();
+
+ bool bRecordChanges;
+ if (QueryRecordChangesState( RL_WRITER, bRecordChanges ) && !bIsHTMLDoc)
+ m_eRedlingMode = RL_WRITER;
+ else if (QueryRecordChangesState( RL_CALC, bRecordChanges ))
+ m_eRedlingMode = RL_CALC;
+ else
+ m_eRedlingMode = RL_NONE;
+
+ if (m_eRedlingMode != RL_NONE)
+ {
+ bool bProtection;
+ QueryRecordChangesProtectionState( m_eRedlingMode, bProtection );
+
+ m_aChangeProtectionPB.Enable( !bIsReadonly );
+ // set the right text
+ if (bProtection)
+ sNewText = m_aUnProtectSTR;
+
+ m_aRecordChangesCB.Check( bRecordChanges );
+ m_aRecordChangesCB.Enable( /*!bProtection && */!bIsReadonly );
+
+ m_bOrigPasswordIsConfirmed = true; // default case if no password is set
+ uno::Sequence< sal_Int8 > aPasswordHash;
+ // check if password is available
+ if (pCurDocShell->GetProtectionHash( aPasswordHash ) &&
+ aPasswordHash.getLength() > 0)
+ m_bOrigPasswordIsConfirmed = false; // password found, needs to be confirmed later on
+ }
+ else
+ {
+ // A Calc document that is shared will have 'm_eRedlingMode == RL_NONE'
+ // In shared documents change recording and protection must be disabled,
+ // similar to documents that do not support change recording at all.
+ m_aRecordChangesCB.Check( FALSE );
+ m_aRecordChangesCB.Disable();
+ m_aChangeProtectionPB.Check( FALSE );
+ m_aChangeProtectionPB.Disable();
+ }
+ }
+
+ m_aChangeProtectionPB.SetText( sNewText );
+}
+
+
+IMPL_LINK( SfxSecurityPage_Impl, RecordChangesCBToggleHdl, void*, EMPTYARG )
+{
+ // when change recording gets disabled protection must be disabled as well
+ if (!m_aRecordChangesCB.IsChecked()) // the new check state is already present, thus the '!'
+ {
+ bool bAlreadyDone = false;
+ if (!m_bEndRedliningWarningDone)
+ {
+ WarningBox aBox( m_rMyTabPage.GetParent(), WinBits(WB_YES_NO | WB_DEF_NO),
+ m_aEndRedliningWarning );
+ if (aBox.Execute() != RET_YES)
+ bAlreadyDone = true;
+ else
+ m_bEndRedliningWarningDone = true;
+ }
+
+ const bool bNeedPasssword = !m_bOrigPasswordIsConfirmed
+ && m_aChangeProtectionPB.GetText() != m_aProtectSTR;
+ if (!bAlreadyDone && bNeedPasssword)
+ {
+ String aPasswordText;
+
+ // dialog canceled or no password provided
+ if (!lcl_GetPassword( m_rMyTabPage.GetParent(), false, aPasswordText ))
+ bAlreadyDone = true;
+
+ // ask for password and if dialog is canceled or no password provided return
+ if (lcl_IsPasswordCorrect( aPasswordText ))
+ m_bOrigPasswordIsConfirmed = true;
+ else
+ bAlreadyDone = true;
+ }
+
+ if (bAlreadyDone)
+ m_aRecordChangesCB.Check( true ); // restore original state
+ else
+ {
+ // remember required values to change protection and change recording in
+ // FillItemSet_Impl later on if password was correct.
+ m_bNewPasswordIsValid = true;
+ m_aNewPassword = String();
+
+ m_aChangeProtectionPB.SetText( m_aProtectSTR );
+ }
+ }
+
+ return 0;
+}
+
+
+IMPL_LINK( SfxSecurityPage_Impl, ChangeProtectionPBHdl, void*, EMPTYARG )
+{
+ if (m_eRedlingMode == RL_NONE)
+ return 0;
+
+ // the push button text is always the opposite of the current state. Thus:
+ const bool bCurrentProtection = m_aChangeProtectionPB.GetText() != m_aProtectSTR;
+
+ // ask user for password (if still necessary)
+ String aPasswordText;
+ bool bNewProtection = !bCurrentProtection;
+ const bool bNeedPassword = bNewProtection || !m_bOrigPasswordIsConfirmed;
+ if (bNeedPassword)
+ {
+ // ask for password and if dialog is canceled or no password provided return
+ if (!lcl_GetPassword( m_rMyTabPage.GetParent(), bNewProtection, aPasswordText ))
+ return 0;
+
+ // provided password still needs to be checked?
+ if (!bNewProtection && !m_bOrigPasswordIsConfirmed)
+ {
+ if (lcl_IsPasswordCorrect( aPasswordText ))
+ m_bOrigPasswordIsConfirmed = true;
+ else
+ return 0;
+ }
+ }
+ DBG_ASSERT( m_bOrigPasswordIsConfirmed, "ooops... this should not have happened!" );
+
+ // remember required values to change protection and change recording in
+ // FillItemSet_Impl later on if password was correct.
+ m_bNewPasswordIsValid = true;
+ m_aNewPassword = bNewProtection? aPasswordText : String();
+
+// // RecordChangesCB is enabled if protection is off
+// m_aRecordChangesCB.Enable( !bNewProtection );
+ m_aRecordChangesCB.Check( bNewProtection );
+ // toggle text of button "Protect" <-> "Unprotect"
+ m_aChangeProtectionPB.SetText( bNewProtection ? m_aUnProtectSTR : m_aProtectSTR );
+
+ return 0;
+}
+
+
+//////////////////////////////////////////////////////////////////////
+
+
+SfxTabPage* SfxSecurityPage::Create( Window * pParent, const SfxItemSet & rItemSet )
+{
+ return new SfxSecurityPage( pParent, rItemSet );
+}
+
+
+SfxSecurityPage::SfxSecurityPage( Window* pParent, const SfxItemSet& rItemSet ) :
+ SfxTabPage( pParent, SfxResId( TP_DOCINFOSECURITY ), rItemSet )
+{
+ m_pImpl = std::auto_ptr< SfxSecurityPage_Impl >(new SfxSecurityPage_Impl( *this, rItemSet ));
+
+ FreeResource();
+}
+
+
+SfxSecurityPage::~SfxSecurityPage()
+{
+}
+
+
+BOOL SfxSecurityPage::FillItemSet( SfxItemSet & rItemSet )
+{
+ bool bModified = false;
+ DBG_ASSERT( m_pImpl.get(), "implementation pointer is 0. Still in c-tor?" );
+ if (m_pImpl.get() != 0)
+ bModified = m_pImpl->FillItemSet_Impl( rItemSet );
+ return bModified;
+}
+
+
+void SfxSecurityPage::Reset( const SfxItemSet & rItemSet )
+{
+ DBG_ASSERT( m_pImpl.get(), "implementation pointer is 0. Still in c-tor?" );
+ if (m_pImpl.get() != 0)
+ m_pImpl->Reset_Impl( rItemSet );
+}
+
+
+//////////////////////////////////////////////////////////////////////
+
+
diff --git a/svx/source/engine3d/viewpt3d.cxx b/sfx2/source/dialog/securitypage.hrc
index ef9750781a2e..d425131b4772 100644..100755
--- a/svx/source/engine3d/viewpt3d.cxx
+++ b/sfx2/source/dialog/securitypage.hrc
@@ -24,9 +24,29 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#ifndef _SECURITYPAGE_HRC_
+#define _SECURITYPAGE_HRC_
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <svx/viewpt3d.hxx>
-// eof
+#define PASSWORD_TO_OPEN_FL 1
+#define PASSWORD_TO_OPEN_FT 2
+#define PASSWORD_TO_OPEN_ED 3
+#define CONFIRM_PASSWORD_TO_OPEN_FT 4
+#define CONFIRM_PASSWORD_TO_OPEN_ED 5
+#define PASSWORD_INFO_FT 6
+#define PASSWORD_TO_MODIFY_FL 7
+#define PASSWORD_TO_MODIFY_FT 8
+#define PASSWORD_TO_MODIFY_ED 9
+#define CONFIRM_PASSWORD_TO_MODIFY_FT 10
+#define CONFIRM_PASSWORD_TO_MODIFY_ED 11
+#define OPTIONS_FL 12
+#define OPEN_READONLY_CB 13
+#define RECORD_CHANGES_CB 14
+#define CHANGE_PROTECTION_PB 15
+
+#define STR_PROTECT 101
+#define STR_UNPROTECT 102
+#define STR_END_REDLINING_WARNING 103
+
+#endif
+
diff --git a/sfx2/source/dialog/securitypage.src b/sfx2/source/dialog/securitypage.src
new file mode 100755
index 000000000000..fee60404d01c
--- /dev/null
+++ b/sfx2/source/dialog/securitypage.src
@@ -0,0 +1,174 @@
+/*************************************************************************
+ *
+ * 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 "sfx2/sfx.hrc"
+#include "securitypage.hrc"
+#include "helpid.hrc"
+#include "dialog.hrc"
+#include "sfxlocal.hrc"
+
+#include <svtools/controldims.hrc>
+
+
+TabPage TP_DOCINFOSECURITY
+{
+ HelpId = HID_DOCINFOSECURITY ;
+ Hide = TRUE ;
+ Size = MAP_APPFONT ( 260 , 185 ) ;
+
+ FixedLine PASSWORD_TO_OPEN_FL
+ {
+ Pos = MAP_APPFONT( 6, 6 );
+ Size = MAP_APPFONT( 248, RSC_CD_FIXEDLINE_HEIGHT );
+ Text [ en-US ] = "File encryption password";
+ };
+ FixedText PASSWORD_TO_OPEN_FT
+ {
+ Pos = MAP_APPFONT( 12, 20 );
+ Size = MAP_APPFONT( 82, RSC_CD_FIXEDTEXT_HEIGHT );
+ Text [ en-US ] = "~Enter password to open";
+ };
+ Edit PASSWORD_TO_OPEN_ED
+ {
+ HelpId = HID_SECURITYTAB_PASSWORD_TO_OPEN;
+ Pos = MAP_APPFONT( 100, 18 );
+ Size = MAP_APPFONT( 88, RSC_CD_TEXTBOX_HEIGHT );
+ Border = TRUE;
+ PassWord = TRUE;
+ };
+ FixedText CONFIRM_PASSWORD_TO_OPEN_FT
+ {
+ Pos = MAP_APPFONT( 12, 34 );
+ Size = MAP_APPFONT( 82, RSC_CD_FIXEDTEXT_HEIGHT );
+ Text [ en-US ] = "~Reenter password to open";
+ };
+ Edit CONFIRM_PASSWORD_TO_OPEN_ED
+ {
+ HelpId = HID_SECURITYTAB_CONFIRM_PASSWORD_TO_OPEN;
+ Pos = MAP_APPFONT( 100, 32 );
+ Size = MAP_APPFONT( 88, RSC_CD_TEXTBOX_HEIGHT );
+ Border = TRUE;
+ PassWord = TRUE;
+ };
+ FixedText PASSWORD_INFO_FT
+ {
+ Pos = MAP_APPFONT( 12, 48 );
+ Size = MAP_APPFONT( 236, 3 * RSC_CD_FIXEDTEXT_HEIGHT );
+ Text [ en-US ] =
+ "Note: After a password has been set, the document will only open "\
+ "with the password. Should you lose the password, there will be "\
+ "no way to recover the document. Please also note that this password "\
+ "is case-sensitive.";
+ WordBreak = TRUE;
+ };
+ FixedLine PASSWORD_TO_MODIFY_FL
+ {
+ Pos = MAP_APPFONT( 6, 78 );
+ Size = MAP_APPFONT( 248, RSC_CD_FIXEDLINE_HEIGHT );
+ Text [ en-US ] = "File sharing password";
+ };
+ FixedText PASSWORD_TO_MODIFY_FT
+ {
+ Pos = MAP_APPFONT( 12, 92 );
+ Size = MAP_APPFONT( 82, RSC_CD_FIXEDTEXT_HEIGHT );
+ Text [ en-US ] = "Enter password to modify";
+ };
+ Edit PASSWORD_TO_MODIFY_ED
+ {
+ HelpId = HID_SECURITYTAB_PASSWORD_TO_MODIFY;
+ Pos = MAP_APPFONT( 100, 90 );
+ Size = MAP_APPFONT( 88, RSC_CD_TEXTBOX_HEIGHT );
+ Border = TRUE;
+ PassWord = TRUE;
+ };
+ FixedText CONFIRM_PASSWORD_TO_MODIFY_FT
+ {
+ Pos = MAP_APPFONT( 12, 106 );
+ Size = MAP_APPFONT( 82, RSC_CD_FIXEDTEXT_HEIGHT );
+ Text [ en-US ] = "Reenter password to modify";
+ };
+ Edit CONFIRM_PASSWORD_TO_MODIFY_ED
+ {
+ HelpId = HID_SECURITYTAB_CONFIRM_PASSWORD_TO_MODIFY;
+ Pos = MAP_APPFONT( 100, 104 );
+ Size = MAP_APPFONT( 88, RSC_CD_TEXTBOX_HEIGHT );
+ Border = TRUE;
+ PassWord = TRUE;
+ };
+ FixedLine OPTIONS_FL
+ {
+ Pos = MAP_APPFONT( 6, 120 );
+ Size = MAP_APPFONT( 248, RSC_CD_FIXEDLINE_HEIGHT );
+ Text [ en-US ] = "File sharing options";
+ };
+ CheckBox OPEN_READONLY_CB
+ {
+ HelpId = HID_SECURITYTAB_OPEN_FILE_READONLY;
+ Pos = MAP_APPFONT( 12, 133 );
+ Size = MAP_APPFONT( 176, RSC_CD_CHECKBOX_HEIGHT );
+ Text [ en-US ] = "~Open file read-only";
+ };
+ CheckBox RECORD_CHANGES_CB
+ {
+ HelpId = HID_SECURITYTAB_RECORD_CHANGES;
+ Pos = MAP_APPFONT( 12, 147 );
+ Size = MAP_APPFONT( 176, RSC_CD_CHECKBOX_HEIGHT );
+ Text [ en-US ] = "Record ~changes";
+ };
+ PushButton CHANGE_PROTECTION_PB
+ {
+ HelpId = HID_SECURITYTAB_PROTECTION;
+ Pos = MAP_APPFONT( 194, 145 );
+ Size = MAP_APPFONT( 60, RSC_CD_PUSHBUTTON_HEIGHT );
+ };
+ String STR_PROTECT
+ {
+ Text [ en-US ] = "~Protect...";
+ };
+ String STR_UNPROTECT
+ {
+ Text [ en-US ] = "~Unprotect...";
+ };
+ String STR_END_REDLINING_WARNING
+ {
+ Text [ en-US ] = "This action will exit the change recording mode.\nAny information about changes will be lost.\n\nExit change recording mode?\n\n" ;
+ };
+};
+
+String RID_SFX_PROTECT_RECORDS
+{
+ Text [ en-US ] = "Protect Records" ;
+};
+String RID_SFX_UNPROTECT_RECORDS
+{
+ Text [ en-US ] = "Unprotect Records" ;
+};
+String RID_SFX_INCORRECT_PASSWORD
+{
+ Text [ en-US ] = "Incorrect password" ;
+};
+
diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx
new file mode 100644
index 000000000000..f25485a1401c
--- /dev/null
+++ b/sfx2/source/dialog/taskpane.cxx
@@ -0,0 +1,1283 @@
+/*************************************************************************
+ * 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_sfx2.hxx"
+
+#include "sfx2/taskpane.hxx"
+#include "imagemgr.hxx"
+#include "sfx2/sfxsids.hrc"
+#include "sfx2/bindings.hxx"
+#include "sfx2/dispatch.hxx"
+#include "sfxresid.hxx"
+#include "sfxlocal.hrc"
+#include "helpid.hrc"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/frame/XModuleManager.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/ui/XToolPanel.hpp>
+#include <com/sun/star/ui/XUIElementFactory.hpp>
+#include <com/sun/star/awt/XWindowPeer.hpp>
+#include <com/sun/star/awt/PosSize.hpp>
+#include <com/sun/star/frame/XModuleManager.hpp>
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/types.hxx>
+#include <comphelper/processfactory.hxx>
+#include <tools/diagnose_ex.h>
+#include <svtools/toolpanel/toolpaneldeck.hxx>
+#include <svtools/toolpanel/tablayouter.hxx>
+#include <svtools/toolpanel/drawerlayouter.hxx>
+#include <unotools/confignode.hxx>
+#include <vcl/menu.hxx>
+#include <vcl/svapp.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+
+#include <boost/noncopyable.hpp>
+
+//......................................................................................................................
+namespace sfx2
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::frame::XModuleManager;
+ using ::com::sun::star::container::XNameAccess;
+ using ::com::sun::star::ui::XToolPanel;
+ using ::com::sun::star::ui::XUIElementFactory;
+ using ::com::sun::star::ui::XUIElement;
+ using ::com::sun::star::awt::XWindow;
+ using ::com::sun::star::frame::XModuleManager;
+ using ::com::sun::star::frame::XFrame;
+ using ::com::sun::star::lang::XComponent;
+ using ::com::sun::star::graphic::XGraphicProvider;
+ using ::com::sun::star::graphic::XGraphic;
+ using ::com::sun::star::accessibility::XAccessible;
+ using ::com::sun::star::awt::XControl;
+ /** === end UNO using === **/
+ namespace PosSize = ::com::sun::star::awt::PosSize;
+
+ //==================================================================================================================
+ //= helpers
+ //==================================================================================================================
+ namespace
+ {
+ //--------------------------------------------------------------------------------------------------------------
+ ::utl::OConfigurationTreeRoot lcl_getModuleUIElementStatesConfig( const ::rtl::OUString& i_rModuleIdentifier,
+ const ::rtl::OUString& i_rResourceURL = ::rtl::OUString() )
+ {
+ const ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ ::rtl::OUStringBuffer aPathComposer;
+ try
+ {
+ const Reference< XNameAccess > xModuleAccess( aContext.createComponent( "com.sun.star.frame.ModuleManager" ), UNO_QUERY_THROW );
+ const ::comphelper::NamedValueCollection aModuleProps( xModuleAccess->getByName( i_rModuleIdentifier ) );
+
+ const ::rtl::OUString sWindowStateRef( aModuleProps.getOrDefault( "ooSetupFactoryWindowStateConfigRef", ::rtl::OUString() ) );
+
+ aPathComposer.appendAscii( "org.openoffice.Office.UI." );
+ aPathComposer.append( sWindowStateRef );
+ aPathComposer.appendAscii( "/UIElements/States" );
+ if ( i_rResourceURL.getLength() )
+ {
+ aPathComposer.appendAscii( "/" );
+ aPathComposer.append( i_rResourceURL );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return ::utl::OConfigurationTreeRoot( aContext, aPathComposer.makeStringAndClear(), false );
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString lcl_identifyModule( const Reference< XFrame >& i_rDocumentFrame )
+ {
+ ::rtl::OUString sModuleName;
+ try
+ {
+ const ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ const Reference< XModuleManager > xModuleManager( aContext.createComponent( "com.sun.star.frame.ModuleManager" ), UNO_QUERY_THROW );
+ sModuleName = xModuleManager->identify( i_rDocumentFrame );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return sModuleName;
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ Reference< XFrame > lcl_getFrame( const SfxBindings* i_pBindings )
+ {
+ const SfxViewFrame* pViewFrame = i_pBindings->GetDispatcher()->GetFrame();
+ const SfxFrame& rFrame = pViewFrame->GetFrame();
+ const Reference< XFrame > xFrame( rFrame.GetFrameInterface() );
+ return xFrame;
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString lcl_getPanelHelpURL( const ::utl::OConfigurationNode& i_rPanelConfigNode )
+ {
+ const ::rtl::OUString sHelpURL( ::comphelper::getString( i_rPanelConfigNode.getNodeValue( "HelpURL" ) ) );
+ return sHelpURL;
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ Image lcl_getPanelImage( const Reference< XFrame >& i_rDocFrame, const ::utl::OConfigurationNode& i_rPanelConfigNode )
+ {
+ const ::rtl::OUString sImageURL( ::comphelper::getString( i_rPanelConfigNode.getNodeValue( "ImageURL" ) ) );
+ if ( sImageURL.getLength() )
+ {
+ try
+ {
+ ::comphelper::NamedValueCollection aMediaProperties;
+ aMediaProperties.put( "URL", sImageURL );
+
+ // special handling: if the ImageURL denotes a CommandName, then retrieve the image for that command
+ const sal_Char* pCommandImagePrefix = "private:commandimage/";
+ const sal_Int32 nCommandImagePrefixLen = strlen( pCommandImagePrefix );
+ if ( sImageURL.compareToAscii( pCommandImagePrefix, nCommandImagePrefixLen ) == 0 )
+ {
+ ::rtl::OUStringBuffer aCommandName;
+ aCommandName.appendAscii( ".uno:" );
+ aCommandName.append( sImageURL.copy( nCommandImagePrefixLen ) );
+ const ::rtl::OUString sCommandName( aCommandName.makeStringAndClear() );
+
+ const BOOL bHiContrast( Application::GetSettings().GetStyleSettings().GetHighContrastMode() );
+ const Image aPanelImage( GetImage( i_rDocFrame, sCommandName, FALSE, bHiContrast ) );
+ return aPanelImage.GetXGraphic();
+ }
+
+ // otherwise, delegate to the GraphicProvider
+ const ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ const Reference< XGraphicProvider > xGraphicProvider( aContext.createComponent( "com.sun.star.graphic.GraphicProvider" ), UNO_QUERY_THROW );
+
+ const Reference< XGraphic > xGraphic( xGraphicProvider->queryGraphic( aMediaProperties.getPropertyValues() ), UNO_SET_THROW );
+ return Image( xGraphic );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ return Image();
+ }
+ }
+
+ //==================================================================================================================
+ //= TaskPaneDockingWindow
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ TaskPaneDockingWindow::TaskPaneDockingWindow( SfxBindings* i_pBindings, TaskPaneWrapper& i_rWrapper, Window* i_pParent, WinBits i_nBits )
+ :TitledDockingWindow( i_pBindings, &i_rWrapper, i_pParent, i_nBits )
+ ,m_aTaskPane( GetContentWindow(), lcl_getFrame( i_pBindings ) )
+ ,m_aPaneController( m_aTaskPane, *this )
+ {
+ m_aTaskPane.Show();
+ SetText( String( SfxResId( SID_TASKPANE ) ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TaskPaneDockingWindow::ActivateToolPanel( const ::rtl::OUString& i_rPanelURL )
+ {
+ m_aPaneController.ActivateToolPanel( i_rPanelURL );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TaskPaneDockingWindow::GetFocus()
+ {
+ TitledDockingWindow::GetFocus();
+ m_aTaskPane.GrabFocus();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TaskPaneDockingWindow::onLayoutDone()
+ {
+ m_aTaskPane.SetPosSizePixel( Point(), GetContentWindow().GetOutputSizePixel() );
+ }
+
+ //==================================================================================================================
+ //= TaskPaneWrapper
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ SFX_IMPL_DOCKINGWINDOW( TaskPaneWrapper, SID_TASKPANE );
+
+ //------------------------------------------------------------------------------------------------------------------
+ TaskPaneWrapper::TaskPaneWrapper( Window* i_pParent, USHORT i_nId, SfxBindings* i_pBindings, SfxChildWinInfo* i_pInfo )
+ :SfxChildWindow( i_pParent, i_nId )
+ {
+ pWindow = new TaskPaneDockingWindow( i_pBindings, *this, i_pParent,
+ WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE);
+ eChildAlignment = SFX_ALIGN_RIGHT;
+
+ pWindow->SetHelpId( HID_TASKPANE_WINDOW );
+ pWindow->SetOutputSizePixel( Size( 300, 450 ) );
+ pWindow->Show();
+
+ dynamic_cast< SfxDockingWindow* >( pWindow )->Initialize( i_pInfo );
+ SetHideNotDelete( TRUE );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TaskPaneWrapper::ActivateToolPanel( const ::rtl::OUString& i_rPanelURL )
+ {
+ TaskPaneDockingWindow* pDockingWindow = dynamic_cast< TaskPaneDockingWindow* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pDockingWindow, "TaskPaneWrapper::ActivateToolPanel: invalid docking window implementation!" );
+ pDockingWindow->ActivateToolPanel( i_rPanelURL );
+ }
+
+ //==================================================================================================================
+ //= CustomPanelUIElement
+ //==================================================================================================================
+ class CustomPanelUIElement
+ {
+ public:
+ CustomPanelUIElement()
+ :m_xUIElement()
+ ,m_xToolPanel()
+ ,m_xPanelWindow()
+ {
+ }
+
+ CustomPanelUIElement( const Reference< XUIElement >& i_rUIElement )
+ :m_xUIElement( i_rUIElement, UNO_SET_THROW )
+ ,m_xToolPanel( i_rUIElement->getRealInterface(), UNO_QUERY_THROW )
+ ,m_xPanelWindow( m_xToolPanel->getWindow(), UNO_SET_THROW )
+ {
+ }
+
+ bool is() const { return m_xPanelWindow.is(); }
+
+ const Reference< XUIElement >& getUIElement() const { return m_xUIElement; }
+ const Reference< XToolPanel >& getToolPanel() const { return m_xToolPanel; }
+ const Reference< XWindow >& getPanelWindow() const { return m_xPanelWindow; }
+
+ private:
+ Reference< XUIElement > m_xUIElement;
+ Reference< XToolPanel > m_xToolPanel;
+ Reference< XWindow > m_xPanelWindow;
+ };
+
+ //==================================================================================================================
+ //= CustomToolPanel
+ //==================================================================================================================
+ class CustomToolPanel : public ::svt::ToolPanelBase
+ {
+ public:
+ CustomToolPanel( const ::utl::OConfigurationNode& i_rPanelWindowState, const Reference< XFrame >& i_rFrame );
+
+ virtual ::rtl::OUString GetDisplayName() const;
+ virtual Image GetImage() const;
+ virtual SmartId GetHelpID() const;
+ virtual void Activate( Window& i_rParentWindow );
+ virtual void Deactivate();
+ virtual void SetSizePixel( const Size& i_rPanelWindowSize );
+ virtual void GrabFocus();
+ virtual void Dispose();
+ virtual Reference< XAccessible >
+ CreatePanelAccessible( const Reference< XAccessible >& i_rParentAccessible );
+
+ const ::rtl::OUString&
+ GetResourceURL() const { return m_sResourceURL; }
+
+ protected:
+ ~CustomToolPanel();
+
+ private:
+ bool impl_ensureToolPanelWindow( Window& i_rPanelParentWindow );
+ void impl_updatePanelConfig( const bool i_bVisible ) const;
+
+ private:
+ const ::rtl::OUString m_sUIName;
+ const Image m_aPanelImage;
+ const ::rtl::OUString m_aPanelHelpURL;
+ const ::rtl::OUString m_sResourceURL;
+ const ::rtl::OUString m_sPanelConfigPath;
+ Reference< XFrame > m_xFrame;
+ CustomPanelUIElement m_aCustomPanel;
+ bool m_bAttemptedCreation;
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ CustomToolPanel::CustomToolPanel( const ::utl::OConfigurationNode& i_rPanelWindowState, const Reference< XFrame >& i_rFrame )
+ :m_sUIName( ::comphelper::getString( i_rPanelWindowState.getNodeValue( "UIName" ) ) )
+ ,m_aPanelImage( lcl_getPanelImage( i_rFrame, i_rPanelWindowState ) )
+ ,m_aPanelHelpURL( lcl_getPanelHelpURL( i_rPanelWindowState ) )
+ ,m_sResourceURL( i_rPanelWindowState.getLocalName() )
+ ,m_sPanelConfigPath( i_rPanelWindowState.getNodePath() )
+ ,m_xFrame( i_rFrame )
+ ,m_aCustomPanel()
+ ,m_bAttemptedCreation( false )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ CustomToolPanel::~CustomToolPanel()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool CustomToolPanel::impl_ensureToolPanelWindow( Window& i_rPanelParentWindow )
+ {
+ if ( m_bAttemptedCreation )
+ return m_aCustomPanel.is();
+
+ m_bAttemptedCreation = true;
+ try
+ {
+ const ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ const Reference< XUIElementFactory > xFactory( aContext.createComponent( "com.sun.star.ui.UIElementFactoryManager" ), UNO_QUERY_THROW );
+
+ ::comphelper::NamedValueCollection aCreationArgs;
+ aCreationArgs.put( "Frame", makeAny( m_xFrame ) );
+ aCreationArgs.put( "ParentWindow", makeAny( i_rPanelParentWindow.GetComponentInterface() ) );
+
+ const Reference< XUIElement > xElement(
+ xFactory->createUIElement( m_sResourceURL, aCreationArgs.getPropertyValues() ),
+ UNO_SET_THROW );
+
+ m_aCustomPanel = CustomPanelUIElement( xElement );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return m_aCustomPanel.is();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void CustomToolPanel::impl_updatePanelConfig( const bool i_bVisible ) const
+ {
+ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ ::utl::OConfigurationTreeRoot aConfig( aContext, m_sPanelConfigPath, true );
+
+ aConfig.setNodeValue( "Visible", makeAny( i_bVisible ) );
+ aConfig.commit();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString CustomToolPanel::GetDisplayName() const
+ {
+ return m_sUIName;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Image CustomToolPanel::GetImage() const
+ {
+ return m_aPanelImage;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ SmartId CustomToolPanel::GetHelpID() const
+ {
+ return SmartId( m_aPanelHelpURL );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void CustomToolPanel::Activate( Window& i_rParentWindow )
+ {
+ ENSURE_OR_RETURN_VOID( impl_ensureToolPanelWindow( i_rParentWindow ), "no panel to activate!" );
+
+ // TODO: we might need a mechanism to decide whether the panel should be destroyed/re-created, or (as it is
+ // done now) hidden/shown
+ m_aCustomPanel.getPanelWindow()->setVisible( sal_True );
+
+ // update the panel's configuration
+ impl_updatePanelConfig( true );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void CustomToolPanel::Deactivate()
+ {
+ ENSURE_OR_RETURN_VOID( m_aCustomPanel.is(), "no panel to deactivate!" );
+
+ m_aCustomPanel.getPanelWindow()->setVisible( sal_False );
+
+ // update the panel's configuration
+ impl_updatePanelConfig( false );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void CustomToolPanel::SetSizePixel( const Size& i_rPanelWindowSize )
+ {
+ ENSURE_OR_RETURN_VOID( m_aCustomPanel.is(), "no panel/window to position!" );
+
+ try
+ {
+ m_aCustomPanel.getPanelWindow()->setPosSize( 0, 0, i_rPanelWindowSize.Width(), i_rPanelWindowSize.Height(),
+ PosSize::POSSIZE );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void CustomToolPanel::GrabFocus()
+ {
+ ENSURE_OR_RETURN_VOID( m_aCustomPanel.is(), "no panel/window to focus!" );
+
+ m_aCustomPanel.getPanelWindow()->setFocus();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void CustomToolPanel::Dispose()
+ {
+ if ( !m_bAttemptedCreation )
+ // nothing to dispose
+ return;
+
+ ENSURE_OR_RETURN_VOID( m_aCustomPanel.is(), "no panel to destroy!" );
+ try
+ {
+ Reference< XComponent > xUIElementComponent( m_aCustomPanel.getUIElement(), UNO_QUERY_THROW );
+ xUIElementComponent->dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XAccessible > CustomToolPanel::CreatePanelAccessible( const Reference< XAccessible >& i_rParentAccessible )
+ {
+ ENSURE_OR_RETURN( m_aCustomPanel.is(), "no panel to ask!", NULL );
+
+ Reference< XAccessible > xPanelAccessible;
+ try
+ {
+ xPanelAccessible.set( m_aCustomPanel.getToolPanel()->createAccessible( i_rParentAccessible ), UNO_SET_THROW );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return xPanelAccessible;
+ }
+
+ //==================================================================================================================
+ //= ModuleTaskPane_Impl
+ //==================================================================================================================
+ class ModuleTaskPane_Impl : public ::boost::noncopyable
+ {
+ public:
+ ModuleTaskPane_Impl( ModuleTaskPane& i_rAntiImpl, const Reference< XFrame >& i_rDocumentFrame,
+ const IToolPanelCompare* i_pPanelCompare )
+ :m_rAntiImpl( i_rAntiImpl )
+ ,m_sModuleIdentifier( lcl_identifyModule( i_rDocumentFrame ) )
+ ,m_xFrame( i_rDocumentFrame )
+ ,m_aPanelDeck( i_rAntiImpl )
+ {
+ m_aPanelDeck.Show();
+ OnResize();
+ impl_initFromConfiguration( i_pPanelCompare );
+ }
+
+ ~ModuleTaskPane_Impl()
+ {
+ }
+
+ void OnResize();
+ void OnGetFocus();
+
+ static bool ModuleHasToolPanels( const ::rtl::OUString& i_rModuleIdentifier );
+
+ ::svt::ToolPanelDeck& GetPanelDeck() { return m_aPanelDeck; }
+ const ::svt::ToolPanelDeck& GetPanelDeck() const { return m_aPanelDeck; }
+
+ ::boost::optional< size_t >
+ GetPanelPos( const ::rtl::OUString& i_rResourceURL );
+ ::rtl::OUString
+ GetPanelResourceURL( const size_t i_nPanelPos ) const;
+
+ void SetDrawersLayout();
+ void SetTabsLayout( const ::svt::TabAlignment i_eTabAlignment, const ::svt::TabItemContent i_eTabContent );
+
+ private:
+ void impl_initFromConfiguration( const IToolPanelCompare* i_pPanelCompare );
+
+ static bool
+ impl_isToolPanelResource( const ::rtl::OUString& i_rResourceURL );
+
+ DECL_LINK( OnActivatePanel, void* );
+
+ private:
+ ModuleTaskPane& m_rAntiImpl;
+ const ::rtl::OUString m_sModuleIdentifier;
+ const Reference< XFrame > m_xFrame;
+ ::svt::ToolPanelDeck m_aPanelDeck;
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ModuleTaskPane_Impl::OnResize()
+ {
+ m_aPanelDeck.SetPosSizePixel( Point(), m_rAntiImpl.GetOutputSizePixel() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ModuleTaskPane_Impl::OnGetFocus()
+ {
+ m_aPanelDeck.GrabFocus();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ IMPL_LINK( ModuleTaskPane_Impl, OnActivatePanel, void*, i_pArg )
+ {
+ m_aPanelDeck.ActivatePanel( reinterpret_cast< size_t >( i_pArg ) );
+ return 1L;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool ModuleTaskPane_Impl::impl_isToolPanelResource( const ::rtl::OUString& i_rResourceURL )
+ {
+ return i_rResourceURL.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "private:resource/toolpanel/" ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ModuleTaskPane_Impl::impl_initFromConfiguration( const IToolPanelCompare* i_pPanelCompare )
+ {
+ const ::utl::OConfigurationTreeRoot aWindowStateConfig( lcl_getModuleUIElementStatesConfig( m_sModuleIdentifier ) );
+ if ( !aWindowStateConfig.isValid() )
+ return;
+
+ ::rtl::OUString sFirstVisiblePanelResource;
+
+ const Sequence< ::rtl::OUString > aUIElements( aWindowStateConfig.getNodeNames() );
+ for ( const ::rtl::OUString* resource = aUIElements.getConstArray();
+ resource != aUIElements.getConstArray() + aUIElements.getLength();
+ ++resource
+ )
+ {
+ if ( !impl_isToolPanelResource( *resource ) )
+ continue;
+
+ ::utl::OConfigurationNode aResourceNode( aWindowStateConfig.openNode( *resource ) );
+ ::svt::PToolPanel pCustomPanel( new CustomToolPanel( aResourceNode, m_xFrame ) );
+
+ size_t nPanelPos = m_aPanelDeck.GetPanelCount();
+ if ( i_pPanelCompare )
+ {
+ // assuming that nobody will insert hundreths of panels, a simple O(n) search should suffice here ...
+ while ( nPanelPos > 0 )
+ {
+ const short nCompare = i_pPanelCompare->compareToolPanelsURLs(
+ *resource,
+ GetPanelResourceURL( --nPanelPos )
+ );
+ if ( nCompare >= 0 )
+ {
+ ++nPanelPos;
+ break;
+ }
+ }
+ }
+ nPanelPos = m_aPanelDeck.InsertPanel( pCustomPanel, nPanelPos );
+
+ if ( ::comphelper::getBOOL( aResourceNode.getNodeValue( "Visible" ) ) )
+ sFirstVisiblePanelResource = *resource;
+ }
+
+ if ( sFirstVisiblePanelResource.getLength() )
+ {
+ ::boost::optional< size_t > aPanelPos( GetPanelPos( sFirstVisiblePanelResource ) );
+ OSL_ENSURE( !!aPanelPos, "ModuleTaskPane_Impl::impl_isToolPanelResource: just inserted it, and it's not there?!" );
+ if ( !!aPanelPos )
+ m_rAntiImpl.PostUserEvent( LINK( this, ModuleTaskPane_Impl, OnActivatePanel ), reinterpret_cast< void* >( *aPanelPos ) );
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool ModuleTaskPane_Impl::ModuleHasToolPanels( const ::rtl::OUString& i_rModuleIdentifier )
+ {
+ const ::utl::OConfigurationTreeRoot aWindowStateConfig( lcl_getModuleUIElementStatesConfig( i_rModuleIdentifier ) );
+ if ( !aWindowStateConfig.isValid() )
+ return false;
+
+ const Sequence< ::rtl::OUString > aUIElements( aWindowStateConfig.getNodeNames() );
+ for ( const ::rtl::OUString* resource = aUIElements.getConstArray();
+ resource != aUIElements.getConstArray() + aUIElements.getLength();
+ ++resource
+ )
+ {
+ if ( impl_isToolPanelResource( *resource ) )
+ return true;
+ }
+ return false;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< size_t > ModuleTaskPane_Impl::GetPanelPos( const ::rtl::OUString& i_rResourceURL )
+ {
+ ::boost::optional< size_t > aPanelPos;
+ for ( size_t i = 0; i < m_aPanelDeck.GetPanelCount(); ++i )
+ {
+ const ::svt::PToolPanel pPanel( m_aPanelDeck.GetPanel( i ) );
+ const CustomToolPanel* pCustomPanel = dynamic_cast< const CustomToolPanel* >( pPanel.get() );
+ ENSURE_OR_CONTINUE( pCustomPanel != NULL, "ModuleTaskPane_Impl::GetPanelPos: illegal panel implementation!" );
+ if ( pCustomPanel->GetResourceURL() == i_rResourceURL )
+ {
+ aPanelPos = i;
+ break;
+ }
+ }
+ return aPanelPos;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString ModuleTaskPane_Impl::GetPanelResourceURL( const size_t i_nPanelPos ) const
+ {
+ ENSURE_OR_RETURN( i_nPanelPos < m_aPanelDeck.GetPanelCount(), "ModuleTaskPane_Impl::GetPanelResourceURL: illegal panel position!", ::rtl::OUString() );
+ const ::svt::PToolPanel pPanel( m_aPanelDeck.GetPanel( i_nPanelPos ) );
+ const CustomToolPanel* pCustomPanel = dynamic_cast< const CustomToolPanel* >( pPanel.get() );
+ ENSURE_OR_RETURN( pCustomPanel != NULL, "ModuleTaskPane_Impl::GetPanelPos: illegal panel implementation!", ::rtl::OUString() );
+ return pCustomPanel->GetResourceURL();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ModuleTaskPane_Impl::SetDrawersLayout()
+ {
+ const ::svt::PDeckLayouter pLayouter( m_aPanelDeck.GetLayouter() );
+ const ::svt::DrawerDeckLayouter* pDrawerLayouter = dynamic_cast< const ::svt::DrawerDeckLayouter* >( pLayouter.get() );
+ if ( pDrawerLayouter != NULL )
+ // already have the proper layout
+ return;
+ m_aPanelDeck.SetLayouter( new ::svt::DrawerDeckLayouter( m_aPanelDeck, m_aPanelDeck ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ModuleTaskPane_Impl::SetTabsLayout( const ::svt::TabAlignment i_eTabAlignment, const ::svt::TabItemContent i_eTabContent )
+ {
+ ::svt::PDeckLayouter pLayouter( m_aPanelDeck.GetLayouter() );
+ ::svt::TabDeckLayouter* pTabLayouter = dynamic_cast< ::svt::TabDeckLayouter* >( pLayouter.get() );
+ if ( ( pTabLayouter != NULL )
+ && ( pTabLayouter->GetTabAlignment() == i_eTabAlignment )
+ && ( pTabLayouter->GetTabItemContent() == i_eTabContent )
+ )
+ // already have the requested layout
+ return;
+
+ if ( pTabLayouter && ( pTabLayouter->GetTabAlignment() == i_eTabAlignment ) )
+ {
+ // changing only the item content does not require a new layouter instance
+ pTabLayouter->SetTabItemContent( i_eTabContent );
+ return;
+ }
+
+ m_aPanelDeck.SetLayouter( new ::svt::TabDeckLayouter( m_aPanelDeck, m_aPanelDeck, i_eTabAlignment, i_eTabContent ) );
+ }
+
+ //==================================================================================================================
+ //= ModuleTaskPane
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ ModuleTaskPane::ModuleTaskPane( Window& i_rParentWindow, const Reference< XFrame >& i_rDocumentFrame )
+ :Window( &i_rParentWindow, WB_DIALOGCONTROL )
+ ,m_pImpl( new ModuleTaskPane_Impl( *this, i_rDocumentFrame, NULL ) )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ModuleTaskPane::ModuleTaskPane( Window& i_rParentWindow, const Reference< XFrame >& i_rDocumentFrame,
+ const IToolPanelCompare& i_rCompare )
+ :Window( &i_rParentWindow, WB_DIALOGCONTROL )
+ ,m_pImpl( new ModuleTaskPane_Impl( *this, i_rDocumentFrame, &i_rCompare ) )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ModuleTaskPane::~ModuleTaskPane()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool ModuleTaskPane::ModuleHasToolPanels( const ::rtl::OUString& i_rModuleIdentifier )
+ {
+ return ModuleTaskPane_Impl::ModuleHasToolPanels( i_rModuleIdentifier );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool ModuleTaskPane::ModuleHasToolPanels( const Reference< XFrame >& i_rDocumentFrame )
+ {
+ return ModuleTaskPane_Impl::ModuleHasToolPanels( lcl_identifyModule( i_rDocumentFrame ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ModuleTaskPane::Resize()
+ {
+ Window::Resize();
+ m_pImpl->OnResize();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ModuleTaskPane::GetFocus()
+ {
+ Window::GetFocus();
+ m_pImpl->OnGetFocus();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::svt::ToolPanelDeck& ModuleTaskPane::GetPanelDeck()
+ {
+ return m_pImpl->GetPanelDeck();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ const ::svt::ToolPanelDeck& ModuleTaskPane::GetPanelDeck() const
+ {
+ return m_pImpl->GetPanelDeck();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< size_t > ModuleTaskPane::GetPanelPos( const ::rtl::OUString& i_rResourceURL )
+ {
+ return m_pImpl->GetPanelPos( i_rResourceURL );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString ModuleTaskPane::GetPanelResourceURL( const size_t i_nPanelPos ) const
+ {
+ return m_pImpl->GetPanelResourceURL( i_nPanelPos );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ModuleTaskPane::SetDrawersLayout()
+ {
+ m_pImpl->SetDrawersLayout();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ModuleTaskPane::SetTabsLayout( const ::svt::TabAlignment i_eTabAlignment, const ::svt::TabItemContent i_eTabContent )
+ {
+ m_pImpl->SetTabsLayout( i_eTabAlignment, i_eTabContent );
+ }
+
+ // =====================================================================================================================
+ // = PanelSelectorLayout
+ // =====================================================================================================================
+ enum PanelSelectorLayout
+ {
+ LAYOUT_DRAWERS,
+ LAYOUT_TABS_RIGHT,
+ LAYOUT_TABS_LEFT,
+ LAYOUT_TABS_TOP,
+ LAYOUT_TABS_BOTTOM
+ };
+
+ //==================================================================================================================
+ //= helper
+ //==================================================================================================================
+ namespace
+ {
+ PanelSelectorLayout lcl_getTabLayoutFromAlignment( const SfxChildAlignment i_eAlignment )
+ {
+ switch ( i_eAlignment )
+ {
+ case SFX_ALIGN_LEFT:
+ return LAYOUT_TABS_LEFT;
+ case SFX_ALIGN_TOP:
+ return LAYOUT_TABS_TOP;
+ case SFX_ALIGN_BOTTOM:
+ return LAYOUT_TABS_BOTTOM;
+ default:
+ return LAYOUT_TABS_RIGHT;
+ }
+ }
+ }
+
+ // =====================================================================================================================
+ // = PanelDescriptor
+ // =====================================================================================================================
+ /** is a helper class for TaskPaneController_Impl, holding the details about a single panel which is not
+ contained in the IToolPanel implementation itself.
+ */
+ struct PanelDescriptor
+ {
+ ::svt::PToolPanel pPanel;
+ bool bHidden;
+
+ PanelDescriptor()
+ :pPanel()
+ ,bHidden( false )
+ {
+ }
+
+ PanelDescriptor( const ::svt::PToolPanel& i_rPanel )
+ :pPanel( i_rPanel )
+ ,bHidden( false )
+ {
+ }
+ };
+
+ //==================================================================================================================
+ //= TaskPaneController_Impl
+ //==================================================================================================================
+ class TaskPaneController_Impl :public ::boost::noncopyable
+ ,public ::svt::IToolPanelDeckListener
+ {
+ public:
+ TaskPaneController_Impl(
+ ModuleTaskPane& i_rTaskPane,
+ TitledDockingWindow& i_rDockingWindow
+ );
+ ~TaskPaneController_Impl();
+
+ void SetDefaultTitle( const String& i_rTitle );
+ void ActivateToolPanel( const ::rtl::OUString& i_rPanelURL );
+
+ protected:
+ // IToolPanelDeckListener overridables
+ virtual void PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition );
+ virtual void PanelRemoved( const size_t i_nPosition );
+ virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive );
+ virtual void LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter );
+ virtual void Dying();
+
+ private:
+ DECL_LINK( OnToolboxClicked, ToolBox* );
+ DECL_LINK( OnMenuItemSelected, Menu* );
+ DECL_LINK( DockingChanged, TitledDockingWindow* );
+ ::std::auto_ptr< PopupMenu > impl_createPopupMenu() const;
+
+ /// sets the given layout for the panel selector
+ void impl_setLayout( const PanelSelectorLayout i_eLayout, const bool i_bForce = false );
+
+ /// returns the current layout of the panel selector
+ PanelSelectorLayout
+ impl_getLayout() const { return m_eCurrentLayout; }
+
+ void impl_updateDockingWindowTitle();
+ void impl_togglePanelVisibility( const size_t i_nLogicalPanelIndex );
+ size_t impl_getLogicalPanelIndex( const size_t i_nVisibleIndex );
+
+ private:
+ enum MenuId
+ {
+ MID_UNLOCK_TASK_PANEL = 1,
+ MID_LOCK_TASK_PANEL = 2,
+ MID_LAYOUT_TABS = 3,
+ MID_LAYOUT_DRAWERS = 4,
+ MID_FIRST_PANEL = 5
+ };
+
+ private:
+ typedef ::std::vector< PanelDescriptor > PanelDescriptors;
+
+ ModuleTaskPane& m_rTaskPane;
+ TitledDockingWindow& m_rDockingWindow;
+ USHORT m_nViewMenuID;
+ PanelSelectorLayout m_eCurrentLayout;
+ PanelDescriptors m_aPanelRepository;
+ bool m_bTogglingPanelVisibility;
+ ::rtl::OUString m_sDefaultTitle;
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ TaskPaneController_Impl::TaskPaneController_Impl( ModuleTaskPane& i_rTaskPane, TitledDockingWindow& i_rDockingWindow )
+ :m_rTaskPane( i_rTaskPane )
+ ,m_rDockingWindow( i_rDockingWindow )
+ ,m_nViewMenuID( 0 )
+ ,m_eCurrentLayout( LAYOUT_DRAWERS )
+ ,m_aPanelRepository()
+ ,m_bTogglingPanelVisibility( false )
+ ,m_sDefaultTitle()
+ {
+ m_rDockingWindow.ResetToolBox();
+ m_nViewMenuID = m_rDockingWindow.AddDropDownToolBoxItem(
+ String( SfxResId( STR_SFX_TASK_PANE_VIEW ) ),
+ HID_TASKPANE_VIEW_MENU,
+ LINK( this, TaskPaneController_Impl, OnToolboxClicked )
+ );
+ m_rDockingWindow.SetEndDockingHdl( LINK( this, TaskPaneController_Impl, DockingChanged ) );
+ impl_setLayout( LAYOUT_DRAWERS, true );
+
+ m_rTaskPane.GetPanelDeck().AddListener( *this );
+
+ // initialize the panel repository
+ for ( size_t i = 0; i < m_rTaskPane.GetPanelDeck().GetPanelCount(); ++i )
+ {
+ ::svt::PToolPanel pPanel( m_rTaskPane.GetPanelDeck().GetPanel( i ) );
+ m_aPanelRepository.push_back( PanelDescriptor( pPanel ) );
+ }
+
+ SetDefaultTitle( String( SfxResId( STR_SFX_TASKS ) ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ TaskPaneController_Impl::~TaskPaneController_Impl()
+ {
+ m_rTaskPane.GetPanelDeck().RemoveListener( *this );
+
+ // remove the panels which are not under the control of the panel deck currently
+ for ( PanelDescriptors::iterator panelPos = m_aPanelRepository.begin();
+ panelPos != m_aPanelRepository.end();
+ ++panelPos
+ )
+ {
+ if ( panelPos->bHidden )
+ panelPos->pPanel->Dispose();
+ }
+ m_aPanelRepository.clear();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ void TaskPaneController_Impl::SetDefaultTitle( const String& i_rTitle )
+ {
+ m_sDefaultTitle = i_rTitle;
+ impl_updateDockingWindowTitle();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TaskPaneController_Impl::ActivateToolPanel( const ::rtl::OUString& i_rPanelURL )
+ {
+ ::boost::optional< size_t > aPanelPos( m_rTaskPane.GetPanelPos( i_rPanelURL ) );
+ ENSURE_OR_RETURN_VOID( !!aPanelPos, "TaskPaneController_Impl::ActivateToolPanel: no such panel!" );
+
+ if ( aPanelPos == m_rTaskPane.GetPanelDeck().GetActivePanel() )
+ {
+ ::svt::PToolPanel pPanel( m_rTaskPane.GetPanelDeck().GetPanel( *aPanelPos ) );
+ pPanel->GrabFocus();
+ }
+ else
+ {
+ m_rTaskPane.GetPanelDeck().ActivatePanel( aPanelPos );
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ IMPL_LINK( TaskPaneController_Impl, DockingChanged, TitledDockingWindow*, i_pDockingWindow )
+ {
+ ENSURE_OR_RETURN( i_pDockingWindow && &m_rDockingWindow, "TaskPaneController_Impl::DockingChanged: where does this come from?", 0L );
+
+ if ( impl_getLayout() == LAYOUT_DRAWERS )
+ return 0L;
+
+ impl_setLayout( lcl_getTabLayoutFromAlignment( i_pDockingWindow->GetAlignment() ) );
+ return 1L;
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ IMPL_LINK( TaskPaneController_Impl, OnToolboxClicked, ToolBox*, i_pToolBox )
+ {
+ if ( i_pToolBox->GetCurItemId() == m_nViewMenuID )
+ {
+ i_pToolBox->EndSelection();
+
+ ::std::auto_ptr< PopupMenu > pMenu = impl_createPopupMenu();
+ pMenu->SetSelectHdl( LINK( this, TaskPaneController_Impl, OnMenuItemSelected ) );
+
+ // pass toolbox button rect so the menu can stay open on button up
+ Rectangle aMenuRect( i_pToolBox->GetItemRect( m_nViewMenuID ) );
+ aMenuRect.SetPos( i_pToolBox->GetPosPixel() );
+ pMenu->Execute( &m_rDockingWindow, aMenuRect, POPUPMENU_EXECUTE_DOWN );
+ }
+
+ return 0;
+ }
+
+ // ---------------------------------------------------------------------------------------------------------------------
+ IMPL_LINK( TaskPaneController_Impl, OnMenuItemSelected, Menu*, i_pMenu )
+ {
+ ENSURE_OR_RETURN( i_pMenu, "TaskPaneController_Impl::OnMenuItemSelected: illegal menu!", 0L );
+
+ i_pMenu->Deactivate();
+ switch ( i_pMenu->GetCurItemId() )
+ {
+ case MID_UNLOCK_TASK_PANEL:
+ m_rDockingWindow.SetFloatingMode( TRUE );
+ break;
+
+ case MID_LOCK_TASK_PANEL:
+ m_rDockingWindow.SetFloatingMode( FALSE );
+ break;
+
+ case MID_LAYOUT_DRAWERS:
+ impl_setLayout( LAYOUT_DRAWERS );
+ break;
+
+ case MID_LAYOUT_TABS:
+ impl_setLayout( lcl_getTabLayoutFromAlignment( m_rDockingWindow.GetAlignment() ) );
+ break;
+
+ default:
+ {
+ size_t nPanelIndex = size_t( i_pMenu->GetCurItemId() - MID_FIRST_PANEL );
+ impl_togglePanelVisibility( nPanelIndex );
+ }
+ break;
+ }
+
+ return 1L;
+ }
+
+ // ---------------------------------------------------------------------------------------------------------------------
+ size_t TaskPaneController_Impl::impl_getLogicalPanelIndex( const size_t i_nVisibleIndex )
+ {
+ size_t nLogicalIndex = 0;
+ size_t nVisibleIndex( i_nVisibleIndex );
+ for ( size_t i=0; i < m_aPanelRepository.size(); ++i )
+ {
+ if ( !m_aPanelRepository[i].bHidden )
+ {
+ if ( !nVisibleIndex )
+ break;
+ --nVisibleIndex;
+ }
+ ++nLogicalIndex;
+ }
+ return nLogicalIndex;
+ }
+
+ // ---------------------------------------------------------------------------------------------------------------------
+ void TaskPaneController_Impl::PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition )
+ {
+ if ( m_bTogglingPanelVisibility )
+ return;
+
+ const size_t nLogicalIndex( impl_getLogicalPanelIndex( i_nPosition ) );
+ m_aPanelRepository.insert( m_aPanelRepository.begin() + nLogicalIndex, PanelDescriptor( i_pPanel ) );
+ }
+
+ // ---------------------------------------------------------------------------------------------------------------------
+ void TaskPaneController_Impl::PanelRemoved( const size_t i_nPosition )
+ {
+ if ( m_bTogglingPanelVisibility )
+ return;
+
+ const size_t nLogicalIndex( impl_getLogicalPanelIndex( i_nPosition ) );
+ m_aPanelRepository.erase( m_aPanelRepository.begin() + nLogicalIndex );
+ }
+
+ // ---------------------------------------------------------------------------------------------------------------------
+ void TaskPaneController_Impl::ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive )
+ {
+ if ( impl_getLayout() == LAYOUT_DRAWERS )
+ // no adjustment of the title when we use the classical "drawers" layout
+ return;
+
+ impl_updateDockingWindowTitle( );
+ (void)i_rOldActive;
+ (void)i_rNewActive;
+ }
+
+ // ---------------------------------------------------------------------------------------------------------------------
+ void TaskPaneController_Impl::LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter )
+ {
+ // not interested in
+ (void)i_rNewLayouter;
+ }
+
+ // ---------------------------------------------------------------------------------------------------------------------
+ void TaskPaneController_Impl::Dying()
+ {
+ OSL_ENSURE( false, "TaskPaneController_Impl::Dying: unexpected call!" );
+ // We are expected to live longer than the ToolPanelDeck we work with. Since we remove ourself, in our dtor,
+ // as listener from the panel deck, this method here should never be called.
+ }
+
+ // ---------------------------------------------------------------------------------------------------------------------
+ void TaskPaneController_Impl::impl_togglePanelVisibility( const size_t i_nLogicalPanelIndex )
+ {
+ ENSURE_OR_RETURN_VOID( i_nLogicalPanelIndex < m_aPanelRepository.size(), "illegal index" );
+
+ // get the actual panel index, within the deck
+ size_t nActualPanelIndex(0);
+ for ( size_t i=0; i < i_nLogicalPanelIndex; ++i )
+ {
+ if ( !m_aPanelRepository[i].bHidden )
+ ++nActualPanelIndex;
+ }
+
+ ::boost::optional< size_t > aActivatePanel;
+
+ m_bTogglingPanelVisibility = true;
+ if ( m_aPanelRepository[ i_nLogicalPanelIndex ].bHidden )
+ {
+ OSL_VERIFY( m_rTaskPane.GetPanelDeck().InsertPanel( m_aPanelRepository[ i_nLogicalPanelIndex ].pPanel, nActualPanelIndex ) == nActualPanelIndex );
+ // if there has not been an active panel before, activate the newly inserted one
+ ::boost::optional< size_t > aActivePanel( m_rTaskPane.GetPanelDeck().GetActivePanel() );
+ if ( !aActivePanel )
+ aActivatePanel = nActualPanelIndex;
+ }
+ else
+ {
+ OSL_VERIFY( m_rTaskPane.GetPanelDeck().RemovePanel( nActualPanelIndex ).get() == m_aPanelRepository[ i_nLogicalPanelIndex ].pPanel.get() );
+ }
+ m_bTogglingPanelVisibility = false;
+ m_aPanelRepository[ i_nLogicalPanelIndex ].bHidden = !m_aPanelRepository[ i_nLogicalPanelIndex ].bHidden;
+
+ if ( !!aActivatePanel )
+ m_rTaskPane.GetPanelDeck().ActivatePanel( *aActivatePanel );
+ }
+
+ // ---------------------------------------------------------------------------------------------------------------------
+ void TaskPaneController_Impl::impl_setLayout( const PanelSelectorLayout i_eLayout, const bool i_bForce )
+ {
+ if ( !i_bForce && ( m_eCurrentLayout == i_eLayout ) )
+ return;
+
+ switch ( i_eLayout )
+ {
+ case LAYOUT_DRAWERS:
+ m_rTaskPane.SetDrawersLayout();
+ break;
+ case LAYOUT_TABS_TOP:
+ m_rTaskPane.SetTabsLayout( ::svt::TABS_TOP, ::svt::TABITEM_IMAGE_ONLY );
+ break;
+ case LAYOUT_TABS_BOTTOM:
+ m_rTaskPane.SetTabsLayout( ::svt::TABS_BOTTOM, ::svt::TABITEM_IMAGE_ONLY );
+ break;
+ case LAYOUT_TABS_LEFT:
+ m_rTaskPane.SetTabsLayout( ::svt::TABS_LEFT, ::svt::TABITEM_IMAGE_ONLY );
+ break;
+ case LAYOUT_TABS_RIGHT:
+ m_rTaskPane.SetTabsLayout( ::svt::TABS_RIGHT, ::svt::TABITEM_IMAGE_ONLY );
+ break;
+ }
+ m_eCurrentLayout = i_eLayout;
+
+ impl_updateDockingWindowTitle();
+ }
+
+ // ---------------------------------------------------------------------------------------------------------------------
+ void TaskPaneController_Impl::impl_updateDockingWindowTitle()
+ {
+ ::boost::optional< size_t > aActivePanel( m_rTaskPane.GetPanelDeck().GetActivePanel() );
+ if ( !aActivePanel || ( impl_getLayout() == LAYOUT_DRAWERS ) )
+ m_rDockingWindow.SetTitle( m_sDefaultTitle );
+ else
+ {
+ size_t nNewActive( *aActivePanel );
+ for ( size_t i=0; i < m_aPanelRepository.size(); ++i )
+ {
+ if ( m_aPanelRepository[i].bHidden )
+ continue;
+
+ if ( !nNewActive )
+ {
+ m_rDockingWindow.SetTitle( m_aPanelRepository[i].pPanel->GetDisplayName() );
+ break;
+ }
+ --nNewActive;
+ }
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------------------------------
+ ::std::auto_ptr< PopupMenu > TaskPaneController_Impl::impl_createPopupMenu() const
+ {
+ ::std::auto_ptr<PopupMenu> pMenu( new PopupMenu );
+ FloatingWindow* pMenuWindow = static_cast< FloatingWindow* >( pMenu->GetWindow() );
+ if ( pMenuWindow != NULL )
+ {
+ pMenuWindow->SetPopupModeFlags ( pMenuWindow->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE );
+ }
+
+ // Add one entry for every tool panel element to individually make
+ // them visible or hide them.
+ USHORT nIndex = MID_FIRST_PANEL;
+ for ( size_t i=0; i<m_aPanelRepository.size(); ++i, ++nIndex )
+ {
+ const PanelDescriptor& rPanelDesc( m_aPanelRepository[i] );
+ pMenu->InsertItem( nIndex, rPanelDesc.pPanel->GetDisplayName(), MIB_CHECKABLE );
+ pMenu->CheckItem( nIndex, !rPanelDesc.bHidden );
+ }
+ pMenu->InsertSeparator();
+
+ #if OSL_DEBUG_LEVEL > 0
+ pMenu->InsertItem( MID_LAYOUT_TABS, String::CreateFromAscii( "Tab-Layout (exp.)" ), MIB_CHECKABLE );
+ pMenu->CheckItem( MID_LAYOUT_TABS, impl_getLayout() != LAYOUT_DRAWERS );
+ pMenu->InsertItem( MID_LAYOUT_DRAWERS, String::CreateFromAscii( "Drawer-Layout" ), MIB_CHECKABLE );
+ pMenu->CheckItem( MID_LAYOUT_DRAWERS, impl_getLayout() == LAYOUT_DRAWERS );
+
+ pMenu->InsertSeparator();
+ #endif
+
+ // Add entry for docking or un-docking the tool panel.
+ if ( m_rDockingWindow.IsFloatingMode() )
+ pMenu->InsertItem(
+ MID_LOCK_TASK_PANEL,
+ String( SfxResId( STR_SFX_DOCK ) )
+ );
+ else
+ pMenu->InsertItem(
+ MID_UNLOCK_TASK_PANEL,
+ String( SfxResId( STR_SFX_UNDOCK ) )
+ );
+
+ pMenu->RemoveDisabledEntries( FALSE, FALSE );
+
+ return pMenu;
+ }
+
+ //==================================================================================================================
+ //= TaskPaneController
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ TaskPaneController::TaskPaneController( ModuleTaskPane& i_rTaskPane, TitledDockingWindow& i_rDockingWindow )
+ :m_pImpl( new TaskPaneController_Impl( i_rTaskPane, i_rDockingWindow ) )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ TaskPaneController::~TaskPaneController()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TaskPaneController::SetDefaultTitle( const String& i_rTitle )
+ {
+ m_pImpl->SetDefaultTitle( i_rTitle );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TaskPaneController::ActivateToolPanel( const ::rtl::OUString& i_rPanelURL )
+ {
+ m_pImpl->ActivateToolPanel( i_rPanelURL );
+ }
+
+//......................................................................................................................
+} // namespace sfx2
+//......................................................................................................................
diff --git a/xmloff/source/core/xmlkywd.cxx b/sfx2/source/dialog/taskpane.src
index 85c3d1951807..5a955e8587d1 100644
--- a/xmloff/source/core/xmlkywd.cxx
+++ b/sfx2/source/dialog/taskpane.src
@@ -1,5 +1,4 @@
/*************************************************************************
- *
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
@@ -25,14 +24,24 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_xmloff.hxx"
-
-#ifndef _XMLOFF_XMLKYWD_HXX
-#define XML_DEFINE_KEYWORDS
-#include "xmloff/xmlkywd.hxx"
-#undef XML_DEFINE_KEYWORDS
-#endif
+#include <sfx2/sfx.hrc>
+#include "sfxlocal.hrc"
+String STR_SFX_DOCK
+{
+ Text [ en-US ] = "Dock";
+};
+String STR_SFX_UNDOCK
+{
+ Text [ en-US ] = "Undock";
+};
+String STR_SFX_TASK_PANE_VIEW
+{
+ Text [ en-US ] = "View";
+};
+String STR_SFX_TASKS
+{
+ Text [ en-US ] = "Tasks";
+};
diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx
new file mode 100644
index 000000000000..58a61d66ba8b
--- /dev/null
+++ b/sfx2/source/dialog/titledockwin.cxx
@@ -0,0 +1,364 @@
+/*************************************************************************
+ * 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_sfx2.hxx"
+
+#include "sfx2/titledockwin.hxx"
+#include "sfx2/bindings.hxx"
+#include "sfx2/dispatch.hxx"
+#include "sfxlocal.hrc"
+#include "sfxresid.hxx"
+
+#include <svl/eitem.hxx>
+
+//......................................................................................................................
+namespace sfx2
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= TitledDockingWindow
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ TitledDockingWindow::TitledDockingWindow( SfxBindings* i_pBindings, SfxChildWindow* i_pChildWindow, Window* i_pParent,
+ WinBits i_nStyle )
+ :SfxDockingWindow( i_pBindings, i_pChildWindow, i_pParent, i_nStyle )
+ ,m_sTitle()
+ ,m_aToolbox( this )
+ ,m_aContentWindow( this, WB_DIALOGCONTROL )
+ ,m_aBorder( 3, 1, 3, 3 )
+ ,m_bLayoutPending( false )
+ {
+ impl_construct();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ TitledDockingWindow::TitledDockingWindow( SfxBindings* i_pBindings, SfxChildWindow* i_pChildWindow, Window* i_pParent,
+ const ResId& i_rResId )
+ :SfxDockingWindow( i_pBindings, i_pChildWindow, i_pParent, i_rResId )
+ ,m_sTitle()
+ ,m_aToolbox( this )
+ ,m_aContentWindow( this )
+ ,m_aBorder( 3, 1, 3, 3 )
+ ,m_bLayoutPending( false )
+ {
+ impl_construct();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TitledDockingWindow::impl_construct()
+ {
+ SetBackground( Wallpaper() );
+
+ m_aToolbox.SetSelectHdl( LINK( this, TitledDockingWindow, OnToolboxItemSelected ) );
+ m_aToolbox.SetOutStyle( TOOLBOX_STYLE_FLAT );
+ m_aToolbox.SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetDialogColor() ) );
+ m_aToolbox.Show();
+ impl_resetToolBox();
+
+ m_aContentWindow.Show();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ TitledDockingWindow::~TitledDockingWindow()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TitledDockingWindow::SetTitle( const String& i_rTitle )
+ {
+ m_sTitle = i_rTitle;
+ Invalidate();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ String TitledDockingWindow::GetTitle() const
+ {
+ return impl_getTitle();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TitledDockingWindow::SetText( const String& i_rText )
+ {
+ SfxDockingWindow::SetText( i_rText );
+ if ( m_sTitle.Len() == 0 )
+ // our text is used as title, too => repaint
+ Invalidate();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TitledDockingWindow::Resize()
+ {
+ SfxDockingWindow::Resize();
+ impl_scheduleLayout();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TitledDockingWindow::onLayoutDone()
+ {
+ // not interested in
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TitledDockingWindow::impl_scheduleLayout()
+ {
+ m_bLayoutPending = true;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TitledDockingWindow::impl_layout()
+ {
+ m_bLayoutPending = false;
+
+ m_aToolbox.ShowItem( 1, !IsFloatingMode() );
+
+ const Size aToolBoxSize( m_aToolbox.CalcWindowSizePixel() );
+ Size aWindowSize( GetOutputSizePixel() );
+
+ // position the tool box
+ int nTitleBarHeight( GetSettings().GetStyleSettings().GetTitleHeight() );
+ if ( aToolBoxSize.Height() > nTitleBarHeight )
+ nTitleBarHeight = aToolBoxSize.Height();
+ m_aToolbox.SetPosSizePixel(
+ Point(
+ aWindowSize.Width() - aToolBoxSize.Width(),
+ ( nTitleBarHeight - aToolBoxSize.Height() ) / 2
+ ),
+ aToolBoxSize
+ );
+
+ // Place the content window.
+ if ( nTitleBarHeight < aToolBoxSize.Height() )
+ nTitleBarHeight = aToolBoxSize.Height();
+ aWindowSize.Height() -= nTitleBarHeight;
+ m_aContentWindow.SetPosSizePixel(
+ Point( m_aBorder.Left(), nTitleBarHeight + m_aBorder.Top() ),
+ Size(
+ aWindowSize.Width() - m_aBorder.Left() - m_aBorder.Right(),
+ aWindowSize.Height() - m_aBorder.Top() - m_aBorder.Bottom()
+ )
+ );
+
+ onLayoutDone();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TitledDockingWindow::Paint( const Rectangle& i_rArea )
+ {
+ if ( m_bLayoutPending )
+ impl_layout();
+
+ SfxDockingWindow::Paint( i_rArea );
+
+ 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();
+
+ // bold font
+ Font aFont( GetFont() );
+ aFont.SetWeight( WEIGHT_BOLD );
+ SetFont( aFont );
+
+ // Set border values.
+ Size aWindowSize( GetOutputSizePixel() );
+ int nOuterLeft = 0;
+ 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 nOuterBottom = aWindowSize.Height() - 1;
+ int nInnerBottom = nOuterBottom - m_aBorder.Bottom() + 1;
+
+ // Paint title bar background.
+ Rectangle aTitleBarBox( Rectangle(
+ nOuterLeft,
+ 0,
+ nOuterRight,
+ nInnerTop-1
+ ) );
+ DrawRect( aTitleBarBox );
+
+ if ( nInnerLeft > nOuterLeft )
+ DrawRect( Rectangle( nOuterLeft, nInnerTop, nInnerLeft, nInnerBottom ) );
+ if ( nOuterRight > nInnerRight )
+ DrawRect( Rectangle( nInnerRight, nInnerTop, nOuterRight, nInnerBottom ) );
+ if ( nInnerBottom < nOuterBottom )
+ DrawRect( Rectangle( nOuterLeft, nInnerBottom, nOuterRight, nOuterBottom ) );
+
+ // Paint bevel border.
+ SetFillColor();
+ SetLineColor( GetSettings().GetStyleSettings().GetShadowColor() );
+ if ( m_aBorder.Top() > 0 )
+ DrawLine( Point( nInnerLeft, nInnerTop ), Point( nInnerLeft, nInnerBottom ) );
+ if ( m_aBorder.Left() > 0 )
+ DrawLine( Point( nInnerLeft, nInnerTop ), Point( nInnerRight, nInnerTop ) );
+
+ SetLineColor( GetSettings().GetStyleSettings().GetLightColor() );
+ if ( m_aBorder.Bottom() > 0 )
+ DrawLine( Point( nInnerRight, nInnerBottom ), Point( nInnerLeft, nInnerBottom ) );
+ if ( m_aBorder.Right() > 0 )
+ DrawLine( Point( nInnerRight, nInnerBottom ), Point( nInnerRight, nInnerTop ) );
+
+ // Paint title bar text.
+ SetLineColor( GetSettings().GetStyleSettings().GetActiveTextColor() );
+ aTitleBarBox.Left() += 3;
+ DrawText( aTitleBarBox, impl_getTitle(), TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
+
+ // Restore original values of the output device.
+ Pop();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ String TitledDockingWindow::impl_getTitle() const
+ {
+ return m_sTitle.Len() ? m_sTitle : GetText();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TitledDockingWindow::impl_resetToolBox()
+ {
+ m_aToolbox.Clear();
+
+ // Get the closer bitmap and set it as right most button.
+ Image aImage( SfxResId( SFX_IMG_CLOSE_DOC ) );
+ Image aImageHC( SfxResId( SFX_IMG_CLOSE_DOC_HC ) );
+ m_aToolbox.InsertItem( 1,
+ GetSettings().GetStyleSettings().GetHighContrastMode()
+ ? aImageHC
+ : aImage
+ );
+ m_aToolbox.ShowItem( 1 );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ USHORT TitledDockingWindow::impl_addDropDownToolBoxItem( const String& i_rItemText, ULONG i_nHelpId, const Link& i_rCallback )
+ {
+ // Add the menu before the closer button.
+ const USHORT nItemCount( m_aToolbox.GetItemCount() );
+ const USHORT nItemId( nItemCount + 1 );
+ m_aToolbox.InsertItem( nItemId, i_rItemText, TIB_DROPDOWNONLY, nItemCount > 0 ? nItemCount - 1 : TOOLBOX_APPEND );
+ m_aToolbox.SetHelpId( nItemId, i_nHelpId );
+ m_aToolbox.SetClickHdl( i_rCallback );
+ m_aToolbox.SetDropdownClickHdl( i_rCallback );
+
+ // The tool box has likely changed its size. The title bar has to be
+ // resized.
+ impl_scheduleLayout();
+ Invalidate();
+
+ return nItemId;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ IMPL_LINK( TitledDockingWindow, OnToolboxItemSelected, ToolBox*, pToolBox )
+ {
+ const USHORT nId = pToolBox->GetCurItemId();
+
+ if ( nId == 1 )
+ {
+ // the closer
+ EndTracking();
+ const sal_uInt16 nChildWindowId( GetChildWindow_Impl()->GetType() );
+ const SfxBoolItem aVisibility( nChildWindowId, FALSE );
+ GetBindings().GetDispatcher()->Execute(
+ nChildWindowId,
+ SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
+ &aVisibility,
+ NULL
+ );
+ }
+
+ return 0;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TitledDockingWindow::StateChanged( StateChangedType i_nType )
+ {
+ switch ( i_nType )
+ {
+ case STATE_CHANGE_INITSHOW:
+ impl_scheduleLayout();
+ break;
+ }
+ SfxDockingWindow::StateChanged( i_nType );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TitledDockingWindow::EndDocking( const Rectangle& i_rRect, BOOL i_bFloatMode )
+ {
+ SfxDockingWindow::EndDocking( i_rRect, i_bFloatMode );
+
+ if ( m_aEndDockingHdl.IsSet() )
+ m_aEndDockingHdl.Call( this );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TitledDockingWindow::DataChanged( const DataChangedEvent& i_rDataChangedEvent )
+ {
+ SfxDockingWindow::DataChanged( i_rDataChangedEvent );
+
+ switch ( i_rDataChangedEvent.GetType() )
+ {
+ case DATACHANGED_SETTINGS:
+ if ( ( i_rDataChangedEvent.GetFlags() & SETTINGS_STYLE ) == 0)
+ break;
+ // else fall through.
+ case DATACHANGED_FONTS:
+ case DATACHANGED_FONTSUBSTITUTION:
+ {
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
+ // Font.
+ Font aFont = rStyleSettings.GetAppFont();
+ if ( IsControlFont() )
+ aFont.Merge( GetControlFont() );
+ SetZoomedPointFont( aFont );
+
+ // Color.
+ Color aColor;
+ if ( IsControlForeground() )
+ aColor = GetControlForeground();
+ else
+ aColor = rStyleSettings.GetButtonTextColor();
+ SetTextColor( aColor );
+ SetTextFillColor();
+
+ impl_scheduleLayout();
+ Invalidate();
+ }
+ break;
+ }
+ }
+
+//......................................................................................................................
+} // namespace sfx2
+//......................................................................................................................
diff --git a/svx/source/svdraw/svdcrtmt.hxx b/sfx2/source/dialog/titledockwin.src
index 0cf7642bf110..3f52e84ab75d 100644
--- a/svx/source/svdraw/svdcrtmt.hxx
+++ b/sfx2/source/dialog/titledockwin.src
@@ -1,5 +1,4 @@
/*************************************************************************
- *
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
@@ -25,8 +24,16 @@
*
************************************************************************/
-#ifndef _SVDCRTMT_HXX
-#define _SVDCRTMT_HXX
+#include <sfx2/sfx.hrc>
+#include "sfxlocal.hrc"
+
+Image SFX_IMG_CLOSE_DOC
+{
+ ImageBitmap = Bitmap { File = "closedoc.png" ; };
+};
-#endif //_SVDCRTMT_HXX
+Image SFX_IMG_CLOSE_DOC_HC
+{
+ ImageBitmap = Bitmap { File = "closedochc.png" ; };
+};
diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx
index b1b69e5ac74f..94c5826569f2 100644
--- a/sfx2/source/doc/Metadatable.cxx
+++ b/sfx2/source/doc/Metadatable.cxx
@@ -33,6 +33,8 @@
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx> // solarmutex
+#include <rtl/random.h>
+
#include <boost/bind.hpp>
#include <memory>
@@ -401,14 +403,16 @@ template< typename T >
/*static*/ ::rtl::OUString create_id(const
::std::hash_map< ::rtl::OUString, T, ::rtl::OUStringHash > & i_rXmlIdMap)
{
+ static rtlRandomPool s_Pool( rtl_random_createPool() );
const ::rtl::OUString prefix( ::rtl::OUString::createFromAscii(s_prefix) );
typename ::std::hash_map< ::rtl::OUString, T, ::rtl::OUStringHash >
::const_iterator iter;
::rtl::OUString id;
do
{
- const int n( rand() );
- id = prefix + ::rtl::OUString::valueOf(static_cast<sal_Int64>(n));
+ sal_Int32 n;
+ rtl_random_getBytes(s_Pool, & n, sizeof(n));
+ id = prefix + ::rtl::OUString::valueOf(static_cast<sal_Int32>(abs(n)));
iter = i_rXmlIdMap.find(id);
}
while (iter != i_rXmlIdMap.end());
@@ -1488,8 +1492,7 @@ Metadatable::RegisterAsCopyOf(Metadatable const & i_rSource,
}
}
-::boost::shared_ptr<MetadatableUndo> Metadatable::CreateUndo(
- const bool i_isDelete)
+::boost::shared_ptr<MetadatableUndo> Metadatable::CreateUndo() const
{
OSL_ENSURE(!IsInUndo(), "CreateUndo called for object in undo?");
OSL_ENSURE(!IsInClipboard(), "CreateUndo called for object in clipboard?");
@@ -1503,11 +1506,6 @@ Metadatable::RegisterAsCopyOf(Metadatable const & i_rSource,
pRegDoc->CreateUndo(*this) );
pRegDoc->RegisterCopy(*this, *pUndo, false);
pUndo->m_pReg = pRegDoc;
-
- if (i_isDelete)
- {
- RemoveMetadataReference();
- }
return pUndo;
}
}
@@ -1518,6 +1516,13 @@ Metadatable::RegisterAsCopyOf(Metadatable const & i_rSource,
return ::boost::shared_ptr<MetadatableUndo>();
}
+::boost::shared_ptr<MetadatableUndo> Metadatable::CreateUndoForDelete()
+{
+ ::boost::shared_ptr<MetadatableUndo> const pUndo( CreateUndo() );
+ RemoveMetadataReference();
+ return pUndo;
+}
+
void Metadatable::RestoreMetadata(
::boost::shared_ptr<MetadatableUndo> const& i_pUndo)
{
@@ -1624,15 +1629,16 @@ MetadatableMixin::getMetadataReference()
throw (uno::RuntimeException)
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
- Metadatable* pObject( GetCoreObject() );
- if (pObject)
- {
- return pObject->GetMetadataReference();
- }
- else
+
+ Metadatable *const pObject( GetCoreObject() );
+ if (!pObject)
{
- throw uno::RuntimeException();
+ throw uno::RuntimeException(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "MetadatableMixin: cannot get core object; not inserted?")),
+ *this);
}
+ return pObject->GetMetadataReference();
}
void SAL_CALL
@@ -1641,30 +1647,32 @@ MetadatableMixin::setMetadataReference(
throw (uno::RuntimeException, lang::IllegalArgumentException)
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
- Metadatable* pObject( GetCoreObject() );
- if (pObject)
- {
- return pObject->SetMetadataReference(i_rReference);
- }
- else
+
+ Metadatable *const pObject( GetCoreObject() );
+ if (!pObject)
{
- throw uno::RuntimeException();
+ throw uno::RuntimeException(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "MetadatableMixin: cannot get core object; not inserted?")),
+ *this);
}
+ return pObject->SetMetadataReference(i_rReference);
}
void SAL_CALL MetadatableMixin::ensureMetadataReference()
throw (uno::RuntimeException)
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
- Metadatable* pObject( GetCoreObject() );
- if (pObject)
- {
- return pObject->EnsureMetadataReference();
- }
- else
+
+ Metadatable *const pObject( GetCoreObject() );
+ if (!pObject)
{
- throw uno::RuntimeException();
+ throw uno::RuntimeException(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "MetadatableMixin: cannot get core object; not inserted?")),
+ *this);
}
+ return pObject->EnsureMetadataReference();
}
} // namespace sfx2
@@ -1674,168 +1682,6 @@ throw (uno::RuntimeException)
#if OSL_DEBUG_LEVEL > 1
-static ::sfx2::XmlIdRegistryDocument s_Reg;
-static ::sfx2::XmlIdRegistryClipboard s_RegClip;
-
-class MockMetadatable : public ::sfx2::Metadatable
-{
-public:
- MockMetadatable(bool i_isInClip = false) :
- m_bInClipboard(i_isInClip), m_bInUndo(false), m_bInContent(true) {}
- bool m_bInClipboard;
- bool m_bInUndo;
- bool m_bInContent;
- virtual bool IsInClipboard() const { return m_bInClipboard; }
- virtual bool IsInUndo() const { return m_bInUndo; }
- virtual bool IsInContent() const { return m_bInContent; }
- virtual ::sfx2::XmlIdRegistry& GetRegistry() { return m_bInClipboard ? static_cast< ::sfx2::XmlIdRegistry&>(s_RegClip) : static_cast< ::sfx2::XmlIdRegistry&>(s_Reg); }
- virtual ::com::sun::star::uno::Reference<
- ::com::sun::star::rdf::XMetadatable > MakeUnoObject() { return 0; }
-};
-
-bool operator==(beans::StringPair p1, beans::StringPair p2)
-{
- return p1.First == p2.First && p1.Second == p2.Second;
-}
-
-void test()
-{
- OSL_TRACE("SwMetadatable test(): start\n");
- MockMetadatable m1;
- MockMetadatable m2;
- MockMetadatable m3;
- MockMetadatable m4;
- MockMetadatable m5;
- ::rtl::OUString empty;
- ::rtl::OUString content( ::rtl::OUString::createFromAscii("content.xml") );
- ::rtl::OUString styles ( ::rtl::OUString::createFromAscii("styles.xml") );
- ::rtl::OUString sid1( ::rtl::OUString::createFromAscii("id1") );
- ::rtl::OUString sid2( ::rtl::OUString::createFromAscii("id2") );
- ::rtl::OUString sid3( ::rtl::OUString::createFromAscii("id3") );
- ::rtl::OUString sid4( ::rtl::OUString::createFromAscii("id4") );
- beans::StringPair id1(content, sid1);
- beans::StringPair id2(content, sid2);
- beans::StringPair id3(content, sid3);
- beans::StringPair id4(styles, sid4);
- beans::StringPair id3e(empty, sid3);
- beans::StringPair id4e(empty, sid4);
- m1.SetMetadataReference(id1);
- OSL_ENSURE(m1.GetMetadataReference() == id1, "set failed");
- try {
- m2.SetMetadataReference(id1);
- OSL_ENSURE(false, "set duplicate succeeded");
- } catch (lang::IllegalArgumentException) { }
- m1.SetMetadataReference(id1);
- OSL_ENSURE(m1.GetMetadataReference() == id1, "set failed (existing)");
- m1.EnsureMetadataReference();
- OSL_ENSURE(m1.GetMetadataReference() == id1, "ensure failed (existing)");
-
- m2.EnsureMetadataReference();
- beans::StringPair m2id(m2.GetMetadataReference());
- OSL_ENSURE(m2id.Second.getLength(), "ensure failed");
- m2.EnsureMetadataReference();
- OSL_ENSURE(m2.GetMetadataReference() == m2id, "ensure failed (idempotent)");
-
- m1.m_bInUndo = true;
- OSL_ENSURE(!m1.GetMetadataReference().Second.getLength(), "move to undo failed");
-
- m1.m_bInUndo = false;
- OSL_ENSURE(m1.GetMetadataReference() == id1, "move from undo failed");
-
- m1.m_bInUndo = true;
- try {
- m2.SetMetadataReference(id1); // steal!
- } catch (lang::IllegalArgumentException &) {
- OSL_ENSURE(false, "set duplicate to undo failed");
- }
- m1.m_bInUndo = false;
- OSL_ENSURE(!m1.GetMetadataReference().Second.getLength(), "move from undo: duplicate");
-
- m3.RegisterAsCopyOf(m2);
- OSL_ENSURE(m2.GetMetadataReference() == id1, "copy: source");
- OSL_ENSURE(!m3.GetMetadataReference().Second.getLength(), "copy: duplicate");
- m4.RegisterAsCopyOf(m3);
- OSL_ENSURE(m2.GetMetadataReference() == id1, "copy: source");
- OSL_ENSURE(!m3.GetMetadataReference().Second.getLength(), "copy: duplicate");
- OSL_ENSURE(!m4.GetMetadataReference().Second.getLength(), "copy: duplicate");
- m2.m_bInUndo = true;
- OSL_ENSURE(m3.GetMetadataReference() == id1, "duplicate to undo");
- OSL_ENSURE(!m2.GetMetadataReference().Second.getLength(), "duplicate to undo");
- m2.m_bInUndo = false;
- OSL_ENSURE(m2.GetMetadataReference() == id1, "duplicate from undo");
- OSL_ENSURE(!m3.GetMetadataReference().Second.getLength(), "duplicate from undo");
-
- m4.EnsureMetadataReference(); // new!
- beans::StringPair m4id(m4.GetMetadataReference());
- OSL_ENSURE(m4id.Second.getLength() && !(m4id == id1), "ensure on duplicate");
-
- MockMetadatable mc1(true); // in clipboard
- MockMetadatable mc2(true);
- MockMetadatable mc3(true);
- MockMetadatable mc4(true);
- MockMetadatable m2p;
- MockMetadatable m3p;
-
- mc1.SetMetadataReference(id2);
- OSL_ENSURE(mc1.GetMetadataReference() == id2, "set failed");
- try {
- mc2.SetMetadataReference(id2);
- OSL_ENSURE(false, "set duplicate succeeded");
- } catch (lang::IllegalArgumentException) { }
- mc1.SetMetadataReference(id2);
- OSL_ENSURE(mc1.GetMetadataReference() == id2, "set failed (existing)");
- mc1.EnsureMetadataReference();
- OSL_ENSURE(mc1.GetMetadataReference() == id2, "ensure failed (existing)");
- mc2.EnsureMetadataReference();
- beans::StringPair mc2id(mc2.GetMetadataReference());
- OSL_ENSURE(mc2id.Second.getLength(), "ensure failed");
- mc2.EnsureMetadataReference();
- OSL_ENSURE(mc2.GetMetadataReference() == mc2id, "ensure failed (idempotent)");
- mc2.RemoveMetadataReference();
- OSL_ENSURE(!mc2.GetMetadataReference().Second.getLength(), "remove failed");
-
- // set up mc2 as copy of m2 and mc3 as copy of m3
- mc3.RegisterAsCopyOf(m3);
- OSL_ENSURE(!mc3.GetMetadataReference().Second.getLength() , "copy to clipboard (latent)");
- mc2.RegisterAsCopyOf(m2);
- OSL_ENSURE(mc2.GetMetadataReference() == id1, "copy to clipboard (non-latent)");
- // paste mc2 to m2p and mc3 to m3p
- m2p.RegisterAsCopyOf(mc2);
- OSL_ENSURE(!m2p.GetMetadataReference().Second.getLength() , "paste from clipboard (non-latent)");
- m3p.RegisterAsCopyOf(mc3);
- OSL_ENSURE(!m3p.GetMetadataReference().Second.getLength() , "paste from clipboard (latent)");
- // delete m2, m2p, m3
- m2.RemoveMetadataReference();
- OSL_ENSURE(!m2.GetMetadataReference().Second.getLength(), "remove failed");
- OSL_ENSURE(m2p.GetMetadataReference() == id1, "paste-remove (non-latent)");
- m2p.RemoveMetadataReference();
- OSL_ENSURE(!m2p.GetMetadataReference().Second.getLength(), "remove failed");
- OSL_ENSURE(m3.GetMetadataReference() == id1, "paste-remove2 (non-latent)");
- m3.RemoveMetadataReference();
- OSL_ENSURE(!m3.GetMetadataReference().Second.getLength(), "remove failed");
- OSL_ENSURE(m3p.GetMetadataReference() == id1, "paste-remove (latent)");
- // delete mc2
- mc2.SetMetadataReference(beans::StringPair());
- OSL_ENSURE(!mc3.GetMetadataReference().Second.getLength() , "in clipboard becomes non-latent");
- // paste mc2
- m2p.RegisterAsCopyOf(mc2);
- OSL_ENSURE(!m2p.GetMetadataReference().Second.getLength(), "remove-paste");
- OSL_ENSURE(m3p.GetMetadataReference() == id1, "remove-paste (stolen)");
-
- // auto-detect stream
- m5.SetMetadataReference(id3e);
- OSL_ENSURE(m5.GetMetadataReference() == id3, "auto-detect (content)");
- m5.m_bInContent = false;
- m5.SetMetadataReference(id4e);
- OSL_ENSURE(m5.GetMetadataReference() == id4, "auto-detect (styles)");
-
- OSL_TRACE("sfx2::Metadatable test(): finished\n");
-}
-
-struct Test { Test() { test(); } };
-static Test s_test;
-
-
#include <stdio.h>
static void dump(sfx2::XmlIdList_t * pList)
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index f46f3583cfd8..14474dd2904d 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -38,7 +38,6 @@
#include "com/sun/star/util/XModifiable.hpp"
#include "com/sun/star/xml/sax/XSAXSerializable.hpp"
-#include "com/sun/star/lang/NullPointerException.hpp"
#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
#include "com/sun/star/lang/EventObject.hpp"
#include "com/sun/star/beans/XPropertySet.hpp"
@@ -248,25 +247,21 @@ public:
const css::uno::Sequence< css::beans::PropertyValue > & Medium)
throw (css::uno::RuntimeException, css::lang::IllegalArgumentException,
css::io::WrongFormatException,
- css::lang::WrappedTargetException, css::io::IOException,
- css::uno::Exception);
+ css::lang::WrappedTargetException, css::io::IOException);
virtual void SAL_CALL loadFromMedium(const ::rtl::OUString & URL,
const css::uno::Sequence< css::beans::PropertyValue > & Medium)
throw (css::uno::RuntimeException,
css::io::WrongFormatException,
- css::lang::WrappedTargetException, css::io::IOException,
- css::uno::Exception);
+ css::lang::WrappedTargetException, css::io::IOException);
virtual void SAL_CALL storeToStorage(
const css::uno::Reference< css::embed::XStorage > & Storage,
const css::uno::Sequence< css::beans::PropertyValue > & Medium)
throw (css::uno::RuntimeException, css::lang::IllegalArgumentException,
- css::lang::WrappedTargetException, css::io::IOException,
- css::uno::Exception);
+ css::lang::WrappedTargetException, css::io::IOException);
virtual void SAL_CALL storeToMedium(const ::rtl::OUString & URL,
const css::uno::Sequence< css::beans::PropertyValue > & Medium)
throw (css::uno::RuntimeException,
- css::lang::WrappedTargetException, css::io::IOException,
- css::uno::Exception);
+ css::lang::WrappedTargetException, css::io::IOException);
// ::com::sun::star::lang::XInitialization:
virtual void SAL_CALL initialize(
@@ -1869,8 +1864,7 @@ SfxDocumentMetaData::loadFromStorage(
const css::uno::Sequence< css::beans::PropertyValue > & Medium)
throw (css::uno::RuntimeException, css::lang::IllegalArgumentException,
css::io::WrongFormatException,
- css::lang::WrappedTargetException, css::io::IOException,
- css::uno::Exception)
+ css::lang::WrappedTargetException, css::io::IOException)
{
if (!xStorage.is()) throw css::lang::IllegalArgumentException(
::rtl::OUString::createFromAscii("SfxDocumentMetaData::loadFromStorage:"
@@ -1882,10 +1876,10 @@ SfxDocumentMetaData::loadFromStorage(
xStorage->openStreamElement(
::rtl::OUString::createFromAscii(s_metaXml),
css::embed::ElementModes::READ) );
- if (!xStream.is()) throw css::lang::NullPointerException();
+ if (!xStream.is()) throw css::uno::RuntimeException();
css::uno::Reference<css::io::XInputStream> xInStream =
xStream->getInputStream();
- if (!xInStream.is()) throw css::lang::NullPointerException();
+ if (!xInStream.is()) throw css::uno::RuntimeException();
// create DOM parser service
css::uno::Reference<css::lang::XMultiComponentFactory> xMsf (
@@ -1949,8 +1943,7 @@ SfxDocumentMetaData::storeToStorage(
const css::uno::Reference< css::embed::XStorage > & xStorage,
const css::uno::Sequence< css::beans::PropertyValue > & Medium)
throw (css::uno::RuntimeException, css::lang::IllegalArgumentException,
- css::lang::WrappedTargetException, css::io::IOException,
- css::uno::Exception)
+ css::lang::WrappedTargetException, css::io::IOException)
{
if (!xStorage.is()) throw css::lang::IllegalArgumentException(
::rtl::OUString::createFromAscii("SfxDocumentMetaData::storeToStorage:"
@@ -1966,7 +1959,7 @@ SfxDocumentMetaData::storeToStorage(
xStorage->openStreamElement(::rtl::OUString::createFromAscii(s_metaXml),
css::embed::ElementModes::WRITE
| css::embed::ElementModes::TRUNCATE);
- if (!xStream.is()) throw css::lang::NullPointerException();
+ if (!xStream.is()) throw css::uno::RuntimeException();
css::uno::Reference< css::beans::XPropertySet > xStreamProps(xStream,
css::uno::UNO_QUERY_THROW);
xStreamProps->setPropertyValue(
@@ -1980,7 +1973,7 @@ SfxDocumentMetaData::storeToStorage(
css::uno::makeAny(static_cast<sal_Bool> (sal_False)));
css::uno::Reference<css::io::XOutputStream> xOutStream =
xStream->getOutputStream();
- if (!xOutStream.is()) throw css::lang::NullPointerException();
+ if (!xOutStream.is()) throw css::uno::RuntimeException();
css::uno::Reference<css::lang::XMultiComponentFactory> xMsf (
m_xContext->getServiceManager());
css::uno::Reference<css::io::XActiveDataSource> xSaxWriter(
@@ -2028,8 +2021,7 @@ void SAL_CALL
SfxDocumentMetaData::loadFromMedium(const ::rtl::OUString & URL,
const css::uno::Sequence< css::beans::PropertyValue > & Medium)
throw (css::uno::RuntimeException, css::io::WrongFormatException,
- css::lang::WrappedTargetException, css::io::IOException,
- css::uno::Exception)
+ css::lang::WrappedTargetException, css::io::IOException)
{
css::uno::Reference<css::io::XInputStream> xIn;
::comphelper::MediaDescriptor md(Medium);
@@ -2063,7 +2055,7 @@ SfxDocumentMetaData::loadFromMedium(const ::rtl::OUString & URL,
css::uno::makeAny(e));
}
if (!xStorage.is()) {
- throw css::lang::NullPointerException(::rtl::OUString::createFromAscii(
+ throw css::uno::RuntimeException(::rtl::OUString::createFromAscii(
"SfxDocumentMetaData::loadFromMedium: cannot get Storage"),
*this);
}
@@ -2074,8 +2066,7 @@ void SAL_CALL
SfxDocumentMetaData::storeToMedium(const ::rtl::OUString & URL,
const css::uno::Sequence< css::beans::PropertyValue > & Medium)
throw (css::uno::RuntimeException,
- css::lang::WrappedTargetException, css::io::IOException,
- css::uno::Exception)
+ css::lang::WrappedTargetException, css::io::IOException)
{
::comphelper::MediaDescriptor md(Medium);
if (!URL.equalsAscii("")) {
@@ -2087,7 +2078,7 @@ SfxDocumentMetaData::storeToMedium(const ::rtl::OUString & URL,
if (!xStorage.is()) {
- throw css::lang::NullPointerException(::rtl::OUString::createFromAscii(
+ throw css::uno::RuntimeException(::rtl::OUString::createFromAscii(
"SfxDocumentMetaData::storeToMedium: cannot get Storage"),
*this);
}
diff --git a/sfx2/source/doc/commitlistener.hxx b/sfx2/source/doc/commitlistener.hxx
deleted file mode 100644
index 572da034cef1..000000000000
--- a/sfx2/source/doc/commitlistener.hxx
+++ /dev/null
@@ -1,57 +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 __COMMITLISTENER_HXX_
-#define __COMMITLISTENER_HXX_
-
-#include <com/sun/star/embed/XTransactionListener.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <osl/mutex.hxx>
-
-#include <sfx2/sfxbasemodel.hxx>
-
-class OChildCommitListen_Impl : public ::cppu::WeakImplHelper1 < ::com::sun::star::embed::XTransactionListener >
-{
- ::osl::Mutex m_aMutex;
- SfxBaseModel* m_pModel;
-
-public:
- OChildCommitListen_Impl( SfxBaseModel& aStorage );
- virtual ~OChildCommitListen_Impl();
-
- void OwnerIsDisposed();
-
- virtual void SAL_CALL preCommit( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL commited( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL preRevert( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL reverted( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
-};
-
-#endif
-
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index 42a57a49bbe9..5b95f09d7f5f 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -30,13 +30,19 @@
#include <com/sun/star/registry/MergeConflictException.hpp>
#include <com/sun/star/registry/XSimpleRegistry.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
+#include <com/sun/star/document/XTypeDetection.hpp>
+#include <com/sun/star/frame/XLoadable.hpp>
+#include <com/sun/star/frame/XStorable.hpp>
#include <comphelper/processfactory.hxx>
#include <tools/config.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/moduleoptions.hxx>
#include <tools/urlobj.hxx>
#include <unotools/ucbstreamhelper.hxx>
+#include <unotools/localfilehelper.hxx>
#include <comphelper/sequenceashashmap.hxx>
+#include <comphelper/configurationhelper.hxx>
#include <sfx2/sfx.hrc>
#include <sfx2/docfilt.hxx>
@@ -49,9 +55,15 @@
#include <sfx2/mnumgr.hxx>
#include "sfx2/sfxresid.hxx"
#include <sfx2/sfxuno.hxx>
+#include "syspath.hxx"
+#include <osl/file.hxx>
+#include <osl/security.hxx>
#include "doc.hrc"
+#include <assert.h>
+
namespace css = ::com::sun::star;
+using namespace ::com::sun::star;
//========================================================================
@@ -182,13 +194,130 @@ void SfxObjectFactory::SetModule_Impl( SfxModule *pMod )
pImpl->pModule = pMod;
}
+void SfxObjectFactory::SetSystemTemplate( const String& rServiceName, const String& rTemplateName )
+{
+ static const int nMaxPathSize = 16000;
+ static ::rtl::OUString SERVICE_FILTER_FACTORY = ::rtl::OUString::createFromAscii( "com.sun.star.document.FilterFactory" );
+ static ::rtl::OUString SERVICE_TYPE_DECTECTION = ::rtl::OUString::createFromAscii( "com.sun.star.document.TypeDetection" );
+ static ::rtl::OUString SERVICE_SIMPLE_ACCESS = ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" );
+
+ static ::rtl::OUString CONF_ROOT = ::rtl::OUString::createFromAscii( "/org.openoffice.Setup");
+ static ::rtl::OUString CONF_PATH = ::rtl::OUString::createFromAscii( "Office/Factories/" ) + ::rtl::OUString( rServiceName );
+ static ::rtl::OUString PROP_DEF_TEMPL_CHANGED = ::rtl::OUString::createFromAscii( "ooSetupFactorySystemDefaultTemplateChanged" );
+ static ::rtl::OUString PROP_ACTUAL_FILTER = ::rtl::OUString::createFromAscii( "ooSetupFactoryActualFilter" );
+
+ static ::rtl::OUString DEF_TPL_STR = ::rtl::OUString::createFromAscii("/soffice.");
+
+ String sURL;
+ String sPath;
+ sal_Unicode aPathBuffer[nMaxPathSize];
+ if ( SystemPath::GetUserTemplateLocation( aPathBuffer, nMaxPathSize ))
+ sPath = String( aPathBuffer );
+ ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sPath, sURL );
+
+ ::rtl::OUString aUserTemplateURL( sURL );
+ if ( aUserTemplateURL.getLength() != 0)
+ {
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
+ uno::Reference< uno::XInterface > xConfig = ::comphelper::ConfigurationHelper::openConfig(
+ xFactory, CONF_ROOT, ::comphelper::ConfigurationHelper::E_STANDARD );
+
+ ::rtl::OUString aActualFilter;
+ ::comphelper::ConfigurationHelper::readRelativeKey( xConfig, CONF_PATH, PROP_ACTUAL_FILTER ) >>= aActualFilter;
+ sal_Bool bChanged(sal_False);
+ ::comphelper::ConfigurationHelper::readRelativeKey( xConfig, CONF_PATH, PROP_DEF_TEMPL_CHANGED ) >>= bChanged;
+
+ uno::Reference< container::XNameAccess > xFilterFactory(
+ xFactory->createInstance( SERVICE_FILTER_FACTORY ), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XNameAccess > xTypeDetection(
+ xFactory->createInstance( SERVICE_TYPE_DECTECTION ), uno::UNO_QUERY_THROW );
+
+ ::rtl::OUString aActualFilterTypeName;
+ uno::Sequence< beans::PropertyValue > aActuralFilterData;
+ xFilterFactory->getByName( aActualFilter ) >>= aActuralFilterData;
+ for ( sal_Int32 nInd = 0; nInd < aActuralFilterData.getLength(); nInd++ )
+ if ( aActuralFilterData[nInd].Name.equalsAscii( "Type" ) )
+ aActuralFilterData[nInd].Value >>= aActualFilterTypeName;
+ ::comphelper::SequenceAsHashMap aProps1( xTypeDetection->getByName( aActualFilterTypeName ) );
+ uno::Sequence< ::rtl::OUString > aAllExt =
+ aProps1.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Extensions" ), uno::Sequence< ::rtl::OUString >() );
+ //To-do: check if aAllExt is empty first
+ ::rtl::OUString aExt = aAllExt[0];
+
+ aUserTemplateURL += DEF_TPL_STR;
+ aUserTemplateURL += aExt;
+
+ uno::Reference< ucb::XSimpleFileAccess > xSimpleFileAccess(
+ xFactory->createInstance( SERVICE_SIMPLE_ACCESS ), uno::UNO_QUERY_THROW );
+
+ ::rtl::OUString aBackupURL;
+ ::osl::Security().getConfigDir(aBackupURL);
+ aBackupURL += ::rtl::OUString::createFromAscii( "/temp" );
+
+ if ( !xSimpleFileAccess->exists( aBackupURL ) )
+ xSimpleFileAccess->createFolder( aBackupURL );
+
+ aBackupURL += DEF_TPL_STR;
+ aBackupURL += aExt;
+
+ if ( rTemplateName.Len() != 0 )
+ {
+ if ( xSimpleFileAccess->exists( aUserTemplateURL ) && !bChanged )
+ xSimpleFileAccess->copy( aUserTemplateURL, aBackupURL );
+
+ uno::Reference< document::XTypeDetection > xTypeDetector( xTypeDetection, uno::UNO_QUERY );
+ ::comphelper::SequenceAsHashMap aProps2( xTypeDetection->getByName( xTypeDetector->queryTypeByURL( rTemplateName ) ) );
+ ::rtl::OUString aFilterName =
+ aProps2.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii("PreferredFilter"), ::rtl::OUString() );
+
+ uno::Sequence< beans::PropertyValue > aArgs( 3 );
+ aArgs[0].Name = ::rtl::OUString::createFromAscii( "FilterName" );
+ aArgs[0].Value <<= aFilterName;
+ aArgs[1].Name = ::rtl::OUString::createFromAscii( "AsTemplate" );
+ aArgs[1].Value <<= sal_True;
+ aArgs[2].Name = ::rtl::OUString::createFromAscii( "URL" );
+ aArgs[2].Value <<= ::rtl::OUString( rTemplateName );
+
+ uno::Reference< frame::XLoadable > xLoadable( xFactory->createInstance( ::rtl::OUString( rServiceName ) ), uno::UNO_QUERY );
+ xLoadable->load( aArgs );
+
+ aArgs.realloc( 2 );
+ aArgs[1].Name = ::rtl::OUString::createFromAscii( "Overwrite" );
+ aArgs[1].Value <<= sal_True;
+
+ uno::Reference< frame::XStorable > xStorable( xLoadable, uno::UNO_QUERY );
+ xStorable->storeToURL( aUserTemplateURL, aArgs );
+ ::comphelper::ConfigurationHelper::writeRelativeKey( xConfig, CONF_PATH, PROP_DEF_TEMPL_CHANGED, uno::makeAny( sal_True ));
+ ::comphelper::ConfigurationHelper::flush( xConfig );
+ }
+ else
+ {
+ DBG_ASSERT( bChanged, "invalid ooSetupFactorySystemDefaultTemplateChanged value!" );
+
+ xSimpleFileAccess->copy( aBackupURL, aUserTemplateURL );
+ xSimpleFileAccess->kill( aBackupURL );
+ ::comphelper::ConfigurationHelper::writeRelativeKey( xConfig, CONF_PATH, PROP_DEF_TEMPL_CHANGED, uno::makeAny( sal_False ));
+ ::comphelper::ConfigurationHelper::flush( xConfig );
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+}
+
void SfxObjectFactory::SetStandardTemplate( const String& rServiceName, const String& rTemplate )
{
SvtModuleOptions::EFactory eFac = SvtModuleOptions::ClassifyFactoryByServiceName(rServiceName);
if (eFac == SvtModuleOptions::E_UNKNOWN_FACTORY)
eFac = SvtModuleOptions::ClassifyFactoryByShortName(rServiceName);
if (eFac != SvtModuleOptions::E_UNKNOWN_FACTORY)
+ {
+ SetSystemTemplate( rServiceName, rTemplate );
SvtModuleOptions().SetFactoryStandardTemplate(eFac, rTemplate);
+ }
}
String SfxObjectFactory::GetStandardTemplate( const String& rServiceName )
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index c18ad2c7016c..d33418c6fbb2 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -116,6 +116,7 @@ using namespace ::com::sun::star::io;
#include <comphelper/storagehelper.hxx>
#include <comphelper/mediadescriptor.hxx>
#include <comphelper/configurationhelper.hxx>
+#include <comphelper/docpasswordhelper.hxx>
#include <tools/urlobj.hxx>
#include <tools/inetmime.hxx>
#include <unotools/ucblockbytes.hxx>
@@ -134,7 +135,6 @@ using namespace ::com::sun::star::io;
#include <unotools/saveopt.hxx>
#include <svl/documentlockfile.hxx>
-#include "opostponedtruncationstream.hxx"
#include "helper.hxx"
#include <sfx2/request.hxx> // SFX_ITEMSET_SET
#include <sfx2/app.hxx> // GetFilterMatcher
@@ -2560,18 +2560,72 @@ void SfxMedium::SetFilter( const SfxFilter* pFilterP, sal_Bool /*bResetOrig*/ )
pFilter = pFilterP;
pImp->nFileVersion = 0;
}
+
//----------------------------------------------------------------
const SfxFilter* SfxMedium::GetOrigFilter( sal_Bool bNotCurrent ) const
{
return ( pImp->pOrigFilter || bNotCurrent ) ? pImp->pOrigFilter : pFilter;
}
+
//----------------------------------------------------------------
void SfxMedium::SetOrigFilter_Impl( const SfxFilter* pOrigFilter )
{
pImp->pOrigFilter = pOrigFilter;
}
+
+//------------------------------------------------------------------
+
+sal_uInt32 SfxMedium::CreatePasswordToModifyHash( const ::rtl::OUString& aPasswd, sal_Bool bWriter )
+{
+ sal_uInt32 nHash = 0;
+
+ if ( aPasswd.getLength() )
+ {
+ if ( bWriter )
+ {
+ nHash = ::comphelper::DocPasswordHelper::GetWordHashAsUINT32( aPasswd );
+ }
+ else
+ {
+ rtl_TextEncoding nEncoding = RTL_TEXTENCODING_UTF8;
+
+ // if the MS-filter should be used
+ // use the inconsistent algorithm to find the encoding specified by MS
+ nEncoding = osl_getThreadTextEncoding();
+ switch( nEncoding )
+ {
+ case RTL_TEXTENCODING_ISO_8859_15:
+ case RTL_TEXTENCODING_MS_874:
+ case RTL_TEXTENCODING_MS_1250:
+ case RTL_TEXTENCODING_MS_1251:
+ case RTL_TEXTENCODING_MS_1252:
+ case RTL_TEXTENCODING_MS_1253:
+ case RTL_TEXTENCODING_MS_1254:
+ case RTL_TEXTENCODING_MS_1255:
+ case RTL_TEXTENCODING_MS_1256:
+ case RTL_TEXTENCODING_MS_1257:
+ case RTL_TEXTENCODING_MS_1258:
+ case RTL_TEXTENCODING_SHIFT_JIS:
+ case RTL_TEXTENCODING_GB_2312:
+ case RTL_TEXTENCODING_BIG5:
+ // in case the system uses an encoding from the list above, it should be used
+ break;
+
+ default:
+ // in case other encoding is used, use one of the encodings from the list
+ nEncoding = RTL_TEXTENCODING_MS_1250;
+ break;
+ }
+
+ nHash = ::comphelper::DocPasswordHelper::GetXLHashAsUINT16( aPasswd, nEncoding );
+ }
+ }
+
+ return nHash;
+}
+
//------------------------------------------------------------------
void SfxMedium::Close()
diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx
index e955c43af705..1219d30d7b27 100644
--- a/sfx2/source/doc/docfilt.cxx
+++ b/sfx2/source/doc/docfilt.cxx
@@ -49,20 +49,6 @@
using namespace ::com::sun::star;
-namespace sfx2 {
-
-// TODO #i105076# this should be in the filter configuration!!!
-bool CheckMSPasswordCapabilityForExport( const String& rFilterName )
-{
- return
- rFilterName.EqualsAscii( "MS Word 97" ) ||
- rFilterName.EqualsAscii( "MS Word 97 Vorlage" ) ||
- rFilterName.EqualsAscii( "MS Excel 97" ) ||
- rFilterName.EqualsAscii( "MS Excel 97 Vorlage/Template" );
-}
-
-} // namespace sfx2
-
// STATIC DATA -----------------------------------------------------------
DBG_NAME(SfxFilter)
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index bb108ba4118d..e8c81f4b7080 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -62,6 +62,9 @@
#include <unotools/pathoptions.hxx>
#include <unotools/pathoptions.hxx>
#include <svl/itemset.hxx>
+#include <svl/eitem.hxx>
+#include <svl/stritem.hxx>
+#include <svl/intitem.hxx>
#include <unotools/useroptions.hxx>
#include <unotools/saveopt.hxx>
#include <tools/debug.hxx>
@@ -80,6 +83,7 @@
#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/dinfdlg.hxx>
+#include <sfx2/request.hxx>
#include <sfxtypes.hxx>
#include "alienwarn.hxx"
@@ -108,6 +112,7 @@ const ::rtl::OUString aFilterFlagsString = ::rtl::OUString::createFromAscii( "
using namespace ::com::sun::star;
+namespace {
//-------------------------------------------------------------------------
static sal_uInt16 getSlotIDFromMode( sal_Int8 nStoreMode )
{
@@ -168,6 +173,69 @@ static sal_Int32 getDontFlags( sal_Int8 nStoreMode )
}
//=========================================================================
+// class DocumentSettingsGuard
+//=========================================================================
+
+class DocumentSettingsGuard
+{
+ uno::Reference< beans::XPropertySet > m_xDocumentSettings;
+ sal_Bool m_bPreserveReadOnly;
+ sal_Bool m_bReadOnlySupported;
+
+ sal_Bool m_bRestoreSettings;
+public:
+ DocumentSettingsGuard( const uno::Reference< frame::XModel >& xModel, sal_Bool bReadOnly, sal_Bool bRestore )
+ : m_bPreserveReadOnly( sal_False )
+ , m_bReadOnlySupported( sal_False )
+ , m_bRestoreSettings( bRestore )
+ {
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xDocSettingsSupplier( xModel, uno::UNO_QUERY_THROW );
+ m_xDocumentSettings.set(
+ xDocSettingsSupplier->createInstance(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.Settings" ) ) ),
+ uno::UNO_QUERY_THROW );
+
+ ::rtl::OUString aLoadReadonlyString( RTL_CONSTASCII_USTRINGPARAM( "LoadReadonly" ) );
+
+ try
+ {
+ m_xDocumentSettings->getPropertyValue( aLoadReadonlyString ) >>= m_bPreserveReadOnly;
+ m_xDocumentSettings->setPropertyValue( aLoadReadonlyString, uno::makeAny( bReadOnly ) );
+ m_bReadOnlySupported = sal_True;
+ }
+ catch( uno::Exception& )
+ {}
+ }
+ catch( uno::Exception& )
+ {}
+
+ if ( ( bReadOnly && !m_bReadOnlySupported ) )
+ throw uno::RuntimeException(); // the user could provide the data, so it must be stored
+ }
+
+ ~DocumentSettingsGuard()
+ {
+ if ( m_bRestoreSettings )
+ {
+ ::rtl::OUString aLoadReadonlyString( RTL_CONSTASCII_USTRINGPARAM( "LoadReadonly" ) );
+
+ try
+ {
+ if ( m_bReadOnlySupported )
+ m_xDocumentSettings->setPropertyValue( aLoadReadonlyString, uno::makeAny( m_bPreserveReadOnly ) );
+ }
+ catch( uno::Exception& )
+ {
+ OSL_ASSERT( "Unexpected exception!" );
+ }
+ }
+ }
+};
+} // anonymous namespace
+
+//=========================================================================
// class ModelData_Impl
//=========================================================================
class ModelData_Impl
@@ -184,6 +252,8 @@ class ModelData_Impl
::comphelper::SequenceAsHashMap m_aMediaDescrHM;
+ sal_Bool m_bRecommendReadOnly;
+
public:
ModelData_Impl( SfxStoringHelper& aOwner,
const uno::Reference< frame::XModel >& xModel,
@@ -200,6 +270,8 @@ public:
::comphelper::SequenceAsHashMap& GetMediaDescr() { return m_aMediaDescrHM; }
+ sal_Bool IsRecommendReadOnly() { return m_bRecommendReadOnly; }
+
const ::comphelper::SequenceAsHashMap& GetDocProps();
::rtl::OUString GetModuleName();
@@ -252,6 +324,7 @@ ModelData_Impl::ModelData_Impl( SfxStoringHelper& aOwner,
, m_pDocumentPropsHM( NULL )
, m_pModulePropsHM( NULL )
, m_aMediaDescrHM( aMediaDescr )
+, m_bRecommendReadOnly( sal_False )
{
CheckInteractionHandler();
}
@@ -836,9 +909,16 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
::rtl::OUString aAdjustToType;
- // bSetStandardName == true means that user agreed to store document in the default (default default ;-)) format
- if ( !(( nStoreMode & EXPORT_REQUESTED ) && !( nStoreMode & WIDEEXPORT_REQUESTED )) &&
- ( bSetStandardName || GetStorable()->hasLocation() ))
+ if ( ( nStoreMode & EXPORT_REQUESTED ) && !( nStoreMode & WIDEEXPORT_REQUESTED ) )
+ {
+ // it is export, set the preselected filter
+ ::rtl::OUString aFilterUIName = aPreselectedFilterPropsHM.getUnpackedValueOrDefault(
+ ::rtl::OUString::createFromAscii( "UIName" ),
+ ::rtl::OUString() );
+ pFileDlg->SetCurrentFilter( aFilterUIName );
+ }
+ // it is no export, bSetStandardName == true means that user agreed to store document in the default (default default ;-)) format
+ else if ( bSetStandardName || GetStorable()->hasLocation() )
{
uno::Sequence< beans::PropertyValue > aOldFilterProps;
::rtl::OUString aOldFilterName = GetDocProps().getUnpackedValueOrDefault(
@@ -916,6 +996,12 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
::rtl::OUString aFilterName = aStringTypeFN;
+ // the following two arguments can not be converted in MediaDescriptor,
+ // so they should be removed from the ItemSet after retrieving
+ SFX_ITEMSET_ARG( pDialogParams, pRecommendReadOnly, SfxBoolItem, SID_RECOMMENDREADONLY, sal_False );
+ m_bRecommendReadOnly = ( pRecommendReadOnly && pRecommendReadOnly->GetValue() );
+ pDialogParams->ClearItem( SID_RECOMMENDREADONLY );
+
uno::Sequence< beans::PropertyValue > aPropsFromDialog;
TransformItems( nSlotID, *pDialogParams, aPropsFromDialog, NULL );
GetMediaDescr() << aPropsFromDialog;
@@ -1238,6 +1324,7 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
// parse the slot name
sal_Int8 nStoreMode = getStoreModeFromSlotName( aSlotName );
+ sal_Int8 nStatusSave = STATUS_NO_ACTION;
// handle the special cases
if ( nStoreMode & SAVEAS_REQUESTED )
@@ -1259,7 +1346,7 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
else if ( nStoreMode & SAVE_REQUESTED )
{
// if saving is not acceptable by the configuration the warning must be shown
- sal_Int8 nStatusSave = aModelData.CheckSaveAcceptable( STATUS_SAVE );
+ nStatusSave = aModelData.CheckSaveAcceptable( STATUS_SAVE );
if ( nStatusSave == STATUS_NO_ACTION )
throw task::ErrorCodeIOException( ::rtl::OUString(), uno::Reference< uno::XInterface >(), ERRCODE_IO_ABORT );
@@ -1273,32 +1360,7 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
{
throw task::ErrorCodeIOException( ::rtl::OUString(), uno::Reference< uno::XInterface >(), ERRCODE_IO_ABORT );
}
- else if ( nStatusSave == STATUS_SAVE )
- {
- // Document properties can contain streams that should be freed before storing
- aModelData.FreeDocumentProps();
-
- if ( aModelData.GetStorable2().is() )
- {
- try
- {
- aModelData.GetStorable2()->storeSelf( aModelData.GetMediaDescr().getAsConstPropertyValueList() );
- }
- catch( lang::IllegalArgumentException& )
- {
- OSL_ENSURE( sal_False, "ModelData didn't handle illegal parameters, all the parameters are ignored!\n" );
- aModelData.GetStorable()->store();
- }
- }
- else
- {
- OSL_ENSURE( sal_False, "XStorable2 is not supported by the model!\n" );
- aModelData.GetStorable()->store();
- }
-
- return sal_False;
- }
- else
+ else if ( nStatusSave != STATUS_SAVE )
{
// this should be a usual SaveAs operation
nStoreMode = SAVEAS_REQUESTED;
@@ -1325,6 +1387,32 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
}
}
+ if ( nStoreMode & SAVE_REQUESTED && nStatusSave == STATUS_SAVE )
+ {
+ // Document properties can contain streams that should be freed before storing
+ aModelData.FreeDocumentProps();
+
+ if ( aModelData.GetStorable2().is() )
+ {
+ try
+ {
+ aModelData.GetStorable2()->storeSelf( aModelData.GetMediaDescr().getAsConstPropertyValueList() );
+ }
+ catch( lang::IllegalArgumentException& )
+ {
+ OSL_ENSURE( sal_False, "ModelData didn't handle illegal parameters, all the parameters are ignored!\n" );
+ aModelData.GetStorable()->store();
+ }
+ }
+ else
+ {
+ OSL_ENSURE( sal_False, "XStorable2 is not supported by the model!\n" );
+ aModelData.GetStorable()->store();
+ }
+
+ return sal_False;
+ }
+
// preselect a filter for the storing process
uno::Sequence< beans::PropertyValue > aFilterProps = aModelData.GetPreselectedFilter_Impl( nStoreMode );
@@ -1419,13 +1507,13 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
::rtl::OUString aSelFilterName = aModelData.GetMediaDescr().getUnpackedValueOrDefault(
aFilterNameString,
::rtl::OUString() );
- sal_Int8 nStatusSave = aModelData.CheckFilter( aSelFilterName );
- if ( nStatusSave == STATUS_SAVEAS_STANDARDNAME )
+ sal_Int8 nStatusFilterSave = aModelData.CheckFilter( aSelFilterName );
+ if ( nStatusFilterSave == STATUS_SAVEAS_STANDARDNAME )
{
// switch to best filter
bSetStandardName = sal_True;
}
- else if ( nStatusSave == STATUS_SAVE )
+ else if ( nStatusFilterSave == STATUS_SAVE )
{
// user confirmed alien filter or "good" filter is used
bExit = sal_True;
@@ -1500,6 +1588,8 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
// store the document and handle it's docinfo
SvtSaveOptions aOptions;
+ DocumentSettingsGuard aSettingsGuard( aModelData.GetModel(), aModelData.IsRecommendReadOnly(), nStoreMode & EXPORT_REQUESTED );
+
if ( aOptions.IsDocInfoSave()
&& ( !aModelData.GetStorable()->hasLocation()
|| INetURLObject( aModelData.GetStorable()->getLocation() ) != aURL ) )
@@ -1570,8 +1660,10 @@ uno::Sequence< beans::PropertyValue > SfxStoringHelper::SearchForFilter(
uno::Reference< container::XEnumeration > xFilterEnum =
xFilterQuery->createSubSetEnumerationByProperties( aSearchRequest );
- // use the first filter that is found
+ // the first default filter will be taken,
+ // if there is no filter with flag default the first acceptable filter will be taken
if ( xFilterEnum.is() )
+ {
while ( xFilterEnum->hasMoreElements() )
{
uno::Sequence< beans::PropertyValue > aProps;
@@ -1582,11 +1674,17 @@ uno::Sequence< beans::PropertyValue > SfxStoringHelper::SearchForFilter(
(sal_Int32)0 );
if ( ( ( nFlags & nMustFlags ) == nMustFlags ) && !( nFlags & nDontFlags ) )
{
- aFilterProps = aProps;
- break;
+ if ( ( nFlags & SFX_FILTER_DEFAULT ) == SFX_FILTER_DEFAULT )
+ {
+ aFilterProps = aProps;
+ break;
+ }
+ else if ( !aFilterProps.getLength() )
+ aFilterProps = aProps;
}
}
}
+ }
return aFilterProps;
}
diff --git a/sfx2/source/doc/makefile.mk b/sfx2/source/doc/makefile.mk
index 7da456ebaa36..b1bddf82e428 100644
--- a/sfx2/source/doc/makefile.mk
+++ b/sfx2/source/doc/makefile.mk
@@ -75,7 +75,6 @@ SLOFILES = \
$(SLO)$/objembed.obj\
$(SLO)$/graphhelp.obj \
$(SLO)$/QuerySaveDocument.obj \
- $(SLO)$/opostponedtruncationstream.obj \
$(SLO)$/docinsert.obj \
$(SLO)$/docmacromode.obj \
$(SLO)$/SfxDocumentMetaData.obj \
@@ -84,7 +83,9 @@ SLOFILES = \
$(SLO)$/sfxmodelfactory.obj \
$(SLO)$/sfxacldetect.obj \
$(SLO)$/docstoragemodifylistener.obj \
- $(SLO)$/querytemplate.obj
+ $(SLO)$/querytemplate.obj \
+ $(SLO)$/syspath.obj \
+ $(SLO)$/syspathw32.obj
# $(SLO)$/applet.obj \
@@ -92,7 +93,8 @@ SLOFILES = \
#HACK TO DISABLE PCH
NOOPTFILES= \
- $(SLO)$/sfxacldetect.obj
+ $(SLO)$/sfxacldetect.obj \
+ $(SLO)$/syspathw32.obj
.ENDIF
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 890862a4de03..81a6274034ba 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -1242,3 +1242,51 @@ void SfxObjectShell::SetSaveVersionOnClose( sal_Bool bNew )
pImp->bSaveVersionOnClose = bNew;
}
+sal_uInt32 SfxObjectShell::GetModifyPasswordHash() const
+{
+ return pImp->m_nModifyPasswordHash;
+}
+
+sal_Bool SfxObjectShell::SetModifyPasswordHash( sal_uInt32 nHash )
+{
+ if ( ( !IsReadOnly() && !IsReadOnlyUI() )
+ || !(pImp->nFlagsInProgress & SFX_LOADED_MAINDOCUMENT ) )
+ {
+ // the hash can be changed only in editable documents,
+ // or during loading of document
+ pImp->m_nModifyPasswordHash = nHash;
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+uno::Sequence< beans::PropertyValue > SfxObjectShell::GetModifyPasswordInfo() const
+{
+ return pImp->m_aModifyPasswordInfo;
+}
+
+sal_Bool SfxObjectShell::SetModifyPasswordInfo( const uno::Sequence< beans::PropertyValue >& aInfo )
+{
+ if ( ( !IsReadOnly() && !IsReadOnlyUI() )
+ || !(pImp->nFlagsInProgress & SFX_LOADED_MAINDOCUMENT ) )
+ {
+ // the hash can be changed only in editable documents,
+ // or during loading of document
+ pImp->m_aModifyPasswordInfo = aInfo;
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+void SfxObjectShell::SetModifyPasswordEntered( sal_Bool bEntered )
+{
+ pImp->m_bModifyPasswordEntered = bEntered;
+}
+
+sal_Bool SfxObjectShell::IsModifyPasswordEntered()
+{
+ return pImp->m_bModifyPasswordEntered;
+}
+
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 692359ac4669..855791d6dd24 100644..100755
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -471,6 +471,32 @@ void SfxObjectShell::SetReadOnlyUI( sal_Bool bReadOnly )
//-------------------------------------------------------------------------
+void SfxObjectShell::SetReadOnly()
+{
+ // Let the document be completely readonly, means that the
+ // medium open mode is adjusted accordingly, and the write lock
+ // on the file is removed.
+
+ if ( pMedium && !IsReadOnlyMedium() )
+ {
+ sal_Bool bWasROUI = IsReadOnly();
+
+ pMedium->UnlockFile( sal_False );
+
+ // the storage-based mediums are already based on the temporary file
+ // so UnlockFile has already closed the locking stream
+ if ( !pMedium->HasStorage_Impl() && IsLoadingFinished() )
+ pMedium->CloseInStream();
+
+ pMedium->SetOpenMode( SFX_STREAM_READONLY, pMedium->IsDirect(), sal_True );
+ pMedium->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, sal_True ) );
+
+ if ( !bWasROUI )
+ Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) );
+ }
+}
+//-------------------------------------------------------------------------
+
sal_Bool SfxObjectShell::IsReadOnly() const
{
return pImp->bReadOnlyUI || IsReadOnlyMedium();
@@ -1364,6 +1390,9 @@ void SfxObjectShell::FinishedLoading( sal_uInt16 nFlags )
if( !IsAbortingImport() )
PositionView_Impl();
+ if ( ( GetModifyPasswordHash() || GetModifyPasswordInfo().getLength() ) && !IsModifyPasswordEntered() )
+ SetReadOnly();
+
// Salvage
if ( pSalvageItem )
bSetModifiedTRUE = sal_True;
@@ -1682,7 +1711,7 @@ namespace
}
ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptContext, const ::rtl::OUString& _rScriptURL,
- const Sequence< Any >& aParams, Any& aRet, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam )
+ const Sequence< Any >& aParams, Any& aRet, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam, bool bRaiseError )
{
OSL_TRACE( "in CallXScript" );
ErrCode nErr = ERRCODE_NONE;
@@ -1723,7 +1752,7 @@ ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptCon
nErr = ERRCODE_BASIC_INTERNAL_ERROR;
}
- if ( bCaughtException )
+ if ( bCaughtException && bRaiseError )
{
::std::auto_ptr< VclAbstractDialog > pScriptErrDlg;
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
@@ -1746,10 +1775,10 @@ ErrCode SfxObjectShell::CallXScript( const String& rScriptURL,
aParams,
::com::sun::star::uno::Any& aRet,
::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex,
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >&
- aOutParam)
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam
+ , bool bRaiseError )
{
- return CallXScript( GetModel(), rScriptURL, aParams, aRet, aOutParamIndex, aOutParam );
+ return CallXScript( GetModel(), rScriptURL, aParams, aRet, aOutParamIndex, aOutParam, bRaiseError );
}
//-------------------------------------------------------------------------
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index cd27740646a9..9cb475a1689b 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1332,7 +1332,6 @@ sal_Bool SfxObjectShell::SaveTo_Impl
{
if ( pFilt->GetServiceName() != rMedium.GetFilter()->GetServiceName() )
{
-//REMOVE rMedium.GetStorage()->SetClass( SvFactory::GetServerName( nFormat ), nFormat, pFilt->GetTypeName() );
datatransfer::DataFlavor aDataFlavor;
SotExchange::GetFormatDataFlavor( nFormat, aDataFlavor );
@@ -2049,9 +2048,6 @@ sal_Bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed )
}
else
{
-//REMOVE if( pFilter->UsesStorage() )
-//REMOVE pMedium->GetStorage();
-//REMOVE else if( pMedium->GetOpenMode() & STREAM_WRITE )
if( pMedium->GetOpenMode() & STREAM_WRITE )
pMedium->GetInStream();
xStorage = GetStorage();
@@ -2548,6 +2544,7 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
// is a new medium "from scratch", so no version should be stored into it
SfxItemSet* pSet = new SfxAllItemSet(*pRetrMedium->GetItemSet());
pSet->ClearItem( SID_VERSION );
+ pSet->ClearItem( SID_DOC_BASEURL );
// create a medium as a copy; this medium is only for writingm, because it uses the same name as the original one
// writing is done through a copy, that will be transferred to the target ( of course after calling HandsOff )
@@ -2588,9 +2585,6 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
SetError(pMediumTmp->GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
-//REMOVE if ( !IsHandsOff() )
-//REMOVE pMediumTmp->Close();
-
sal_Bool bOpen( sal_False );
bOpen = DoSaveCompleted( pMediumTmp );
DBG_ASSERT(bOpen,"Fehlerbehandlung fuer DoSaveCompleted nicht implementiert");
@@ -2601,13 +2595,7 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
SetError( pMediumTmp->GetError(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
// reconnect to object storage
-//REMOVE if ( IsHandsOff() )
-//REMOVE {
-//REMOVE if ( !DoSaveCompleted( pRetrMedium ) )
-//REMOVE DBG_ERROR("Case not handled - no way to get a storage!");
-//REMOVE }
-//REMOVE else
- DoSaveCompleted( 0 );
+ DoSaveCompleted( 0 );
if( pRetrMedium->GetItemSet() )
{
@@ -2833,6 +2821,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl
pMergedParams->ClearItem( SID_STREAM );
pMergedParams->ClearItem( SID_CONTENT );
pMergedParams->ClearItem( SID_DOC_READONLY );
+ pMergedParams->ClearItem( SID_DOC_BASEURL );
pMergedParams->ClearItem( SID_REPAIRPACKAGE );
@@ -2865,8 +2854,6 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl
else
pNewFile->SetFilter( GetFactory().GetFilterContainer()->GetAnyFilter( SFX_FILTER_IMPORT | SFX_FILTER_EXPORT ) );
-//REMOVE // saving is alway done using a temporary file
-//REMOVE pNewFile->CreateTempFileNoCopy();
if ( pNewFile->GetErrorCode() != ERRCODE_NONE )
{
// creating temporary file failed ( f.e. floppy disk not inserted! )
@@ -2903,18 +2890,8 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl
SetError( pNewFile->GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
// notify the document that saving was done successfully
-//REMOVE if ( bCopyTo )
-//REMOVE {
-//REMOVE if ( IsHandsOff() )
-//REMOVE bOk = DoSaveCompleted( pMedium );
-//REMOVE }
-//REMOVE else
if ( !bCopyTo )
{
- // Muss !!!
-//REMOVE if ( bToOwnFormat )
-//REMOVE SetFileName( pNewFile->GetPhysicalName() );
-
bOk = DoSaveCompleted( pNewFile );
}
else
@@ -2946,31 +2923,12 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl
// by the storage
DELETEZ( pNewFile );
}
-
- // TODO/LATER: there is no need in the following code in case HandsOff is not used,
- // hope we will not have to introduce it back
-//REMOVE String aPasswd;
-//REMOVE if ( IsOwnStorageFormat_Impl( *GetMedium() ) && GetPasswd_Impl( GetMedium()->GetItemSet(), aPasswd ) )
-//REMOVE {
-//REMOVE try
-//REMOVE {
-//REMOVE // the following code must throw an exception in case of failure
-//REMOVE ::comphelper::OStorageHelper::SetCommonStoragePassword( GetMedium->GetStorage(), aPasswd );
-//REMOVE }
-//REMOVE catch( uno::Exception& )
-//REMOVE {
-//REMOVE // TODO: handle the error
-//REMOVE }
-//REMOVE }
}
else
{
SetError( pNewFile->GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
-//REMOVE // reconnect to the old storage
-//REMOVE if ( IsHandsOff() )
-//REMOVE DoSaveCompleted( pMedium );
-//REMOVE else
+ // reconnect to the old storage
DoSaveCompleted( 0 );
DELETEZ( pNewFile );
@@ -3151,9 +3109,6 @@ sal_Bool SfxObjectShell::LoadOwnFormat( SfxMedium& rMedium )
uno::Reference< embed::XStorage > xStorage = rMedium.GetStorage();
if ( xStorage.is() )
{
-//REMOVE if ( rMedium.GetFileVersion() )
-//REMOVE xStor->SetVersion( rMedium.GetFileVersion() );
-
// Password
SFX_ITEMSET_ARG( rMedium.GetItemSet(), pPasswdItem, SfxStringItem, SID_PASSWORD, sal_False );
if ( pPasswdItem || ERRCODE_IO_ABORT != CheckPasswd_Impl( this, SFX_APP()->GetPool(), pMedium ) )
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index a4fa027805a7..3884f42088cb 100644..100755
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -247,6 +247,8 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,m_bCreateTempStor( sal_False )
,m_bIsInit( sal_False )
,m_bIncomplEncrWarnShown( sal_False )
+ ,m_nModifyPasswordHash( 0 )
+ ,m_bModifyPasswordEntered( sal_False )
{
SfxObjectShell* pDoc = &_rDocShell;
SfxObjectShellArr_Impl &rArr = SFX_APP()->GetObjectShells_Impl();
@@ -1074,3 +1076,43 @@ void SfxObjectShell::SetInitialized_Impl( const bool i_fromInitNew )
SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, GlobalEventConfig::GetEventName(STR_EVENT_LOADFINISHED), this ) );
}
}
+
+
+bool SfxObjectShell::IsChangeRecording() const
+{
+ // currently this function needs to be overwritten by Writer and Calc only
+ DBG_ASSERT( 0, "function not implemented" );
+ return false;
+}
+
+
+bool SfxObjectShell::HasChangeRecordProtection() const
+{
+ // currently this function needs to be overwritten by Writer and Calc only
+ DBG_ASSERT( 0, "function not implemented" );
+ return false;
+}
+
+
+void SfxObjectShell::SetChangeRecording( bool /*bActivate*/ )
+{
+ // currently this function needs to be overwritten by Writer and Calc only
+ DBG_ASSERT( 0, "function not implemented" );
+}
+
+
+bool SfxObjectShell::SetProtectionPassword( const String & /*rPassword*/ )
+{
+ // currently this function needs to be overwritten by Writer and Calc only
+ DBG_ASSERT( 0, "function not implemented" );
+ return false;
+}
+
+
+bool SfxObjectShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal_Int8 > & /*rPasswordHash*/ )
+{
+ // currently this function needs to be overwritten by Writer and Calc only
+ DBG_ASSERT( 0, "function not implemented" );
+ return false;
+}
+
diff --git a/sfx2/source/doc/opostponedtruncationstream.cxx b/sfx2/source/doc/opostponedtruncationstream.cxx
deleted file mode 100644
index 84b1d6a3906a..000000000000
--- a/sfx2/source/doc/opostponedtruncationstream.cxx
+++ /dev/null
@@ -1,491 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sfx2.hxx"
-#include <osl/diagnose.h>
-
-#include <opostponedtruncationstream.hxx>
-
-using namespace ::com::sun::star;
-
-// ========================================================================
-struct PTFStreamData_Impl
-{
- uno::Reference< ucb::XSimpleFileAccess > m_xFileAccess;
- sal_Bool m_bDelete;
- ::rtl::OUString m_aURL;
-
- // the streams below are not visible from outside so there is no need to remember position
-
- // original stream related members
- uno::Reference< io::XStream > m_xOrigStream;
- uno::Reference< io::XTruncate > m_xOrigTruncate;
- uno::Reference< io::XSeekable > m_xOrigSeekable;
- uno::Reference< io::XInputStream > m_xOrigInStream;
- uno::Reference< io::XOutputStream > m_xOrigOutStream;
-
- sal_Bool m_bInOpen;
- sal_Bool m_bOutOpen;
-
- sal_Bool m_bPostponedTruncate;
-
-
- PTFStreamData_Impl(
- const uno::Reference< ucb::XSimpleFileAccess >& xFileAccess,
- sal_Bool bDelete,
- const ::rtl::OUString& aURL,
- const uno::Reference< io::XStream >& xOrigStream,
- const uno::Reference< io::XTruncate >& xOrigTruncate,
- const uno::Reference< io::XSeekable >& xOrigSeekable,
- const uno::Reference< io::XInputStream >& xOrigInStream,
- const uno::Reference< io::XOutputStream >& xOrigOutStream )
- : m_xFileAccess( xFileAccess )
- , m_bDelete( bDelete )
- , m_aURL( aURL )
- , m_xOrigStream( xOrigStream )
- , m_xOrigTruncate( xOrigTruncate )
- , m_xOrigSeekable( xOrigSeekable )
- , m_xOrigInStream( xOrigInStream )
- , m_xOrigOutStream( xOrigOutStream )
- , m_bInOpen( sal_False )
- , m_bOutOpen( sal_False )
- , m_bPostponedTruncate( sal_True )
- {}
-
- void NoPostponing()
- {
- m_bDelete = sal_False;
- m_bPostponedTruncate = sal_False;
- }
-};
-
-// ========================================================================
-// ------------------------------------------------------------------------
-OPostponedTruncationFileStream::OPostponedTruncationFileStream(
- const ::rtl::OUString& aURL,
- const uno::Reference< lang::XMultiServiceFactory >& /*xFactory*/,
- const uno::Reference< ucb::XSimpleFileAccess >& xFileAccess,
- const uno::Reference< io::XStream >& xOrigStream,
- sal_Bool bDelete )
-: m_pStreamData( NULL )
-{
- if ( !xFileAccess.is() || !xOrigStream.is() )
- throw uno::RuntimeException();
-
- uno::Reference< io::XTruncate > xOrigTruncate( xOrigStream, uno::UNO_QUERY_THROW );
- uno::Reference< io::XSeekable > xOrigSeekable( xOrigStream, uno::UNO_QUERY_THROW );
- uno::Reference< io::XInputStream > xOrigInStream = xOrigStream->getInputStream();
- uno::Reference< io::XOutputStream > xOrigOutStream = xOrigStream->getOutputStream();
- if ( !xOrigInStream.is() || !xOrigOutStream.is() )
- throw uno::RuntimeException();
-
- m_pStreamData = new PTFStreamData_Impl( xFileAccess, bDelete, aURL,
- xOrigStream, xOrigTruncate, xOrigSeekable, xOrigInStream, xOrigOutStream );
-}
-
-// ------------------------------------------------------------------------
-OPostponedTruncationFileStream::~OPostponedTruncationFileStream()
-{
- CloseAll_Impl();
-}
-
-// ------------------------------------------------------------------------
-void OPostponedTruncationFileStream::CloseAll_Impl()
-{
- if ( m_pStreamData )
- {
- sal_Bool bDelete = m_pStreamData->m_bDelete;
- ::rtl::OUString aURL = m_pStreamData->m_aURL;
- uno::Reference< ucb::XSimpleFileAccess > xFileAccess = m_pStreamData->m_xFileAccess;
-
- delete m_pStreamData;
- m_pStreamData = NULL;
-
- if ( bDelete && xFileAccess.is() && aURL.getLength() )
- {
- // delete the file
- try
- {
- xFileAccess->kill( aURL );
- } catch( uno::Exception& )
- {
- OSL_ENSURE( sal_False, "Could not remove the file!" );
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------
-void OPostponedTruncationFileStream::CheckScheduledTruncation_Impl()
-{
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigTruncate.is() )
- throw uno::RuntimeException();
-
- m_pStreamData->m_xOrigTruncate->truncate();
- m_pStreamData->NoPostponing();
- }
-}
-
-// com::sun::star::io::XStream
-// ------------------------------------------------------------------------
-uno::Reference< io::XInputStream > SAL_CALL OPostponedTruncationFileStream::getInputStream( )
- throw (uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( m_pStreamData )
- m_pStreamData->m_bInOpen = sal_True;
- return static_cast< io::XInputStream* >( this );
-}
-
-
-// ------------------------------------------------------------------------
-uno::Reference< io::XOutputStream > SAL_CALL OPostponedTruncationFileStream::getOutputStream( )
- throw (uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( m_pStreamData )
- m_pStreamData->m_bOutOpen = sal_True;
- return static_cast< io::XOutputStream* >( this );
-}
-
-
-
-// com::sun::star::io::XInputStream
-// ------------------------------------------------------------------------
-::sal_Int32 SAL_CALL OPostponedTruncationFileStream::readBytes( uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nBytesToRead )
- throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- // the stream must behave as truncated one
- aData.realloc( 0 );
- return 0;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigInStream.is() )
- throw uno::RuntimeException();
-
- return m_pStreamData->m_xOrigInStream->readBytes( aData, nBytesToRead );
- }
-}
-
-
-// ------------------------------------------------------------------------
-::sal_Int32 SAL_CALL OPostponedTruncationFileStream::readSomeBytes( uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nMaxBytesToRead )
- throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- // the stream must behave as truncated one
- aData.realloc( 0 );
- return 0;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigInStream.is() )
- throw uno::RuntimeException();
-
- return m_pStreamData->m_xOrigInStream->readBytes( aData, nMaxBytesToRead );
- }
-}
-
-// ------------------------------------------------------------------------
-void SAL_CALL OPostponedTruncationFileStream::skipBytes( ::sal_Int32 nBytesToSkip )
- throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- // the stream must behave as truncated one
- if ( nBytesToSkip > 0 )
- throw io::BufferSizeExceededException();
-
- return;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigInStream.is() )
- throw uno::RuntimeException();
-
- m_pStreamData->m_xOrigInStream->skipBytes( nBytesToSkip );
- }
-}
-
-
-// ------------------------------------------------------------------------
-::sal_Int32 SAL_CALL OPostponedTruncationFileStream::available( )
- throw (io::NotConnectedException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- // the stream must behave as truncated one
- return 0;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigInStream.is() )
- throw uno::RuntimeException();
-
- return m_pStreamData->m_xOrigInStream->available();
- }
-}
-
-
-// ------------------------------------------------------------------------
-void SAL_CALL OPostponedTruncationFileStream::closeInput()
- throw (io::NotConnectedException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- m_pStreamData->m_bInOpen = sal_False;
- if ( !m_pStreamData->m_bOutOpen )
- CloseAll_Impl();
-}
-
-
-
-// com::sun::star::io::XOutputStream
-// ------------------------------------------------------------------------
-void SAL_CALL OPostponedTruncationFileStream::writeBytes( const uno::Sequence< ::sal_Int8 >& aData )
- throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- // writing method must check the truncation
- CheckScheduledTruncation_Impl();
-
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigOutStream.is() )
- throw uno::RuntimeException();
-
- m_pStreamData->m_xOrigOutStream->writeBytes( aData );
-}
-
-
-// ------------------------------------------------------------------------
-void SAL_CALL OPostponedTruncationFileStream::flush( )
- throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- {
- OSL_ENSURE( sal_False, "flush() call on closed stream!\n" );
- return;
- // in future throw exception, for now some code might call flush() on closed stream
- // since file ucp implementation allows it
- // throw io::NotConnectedException();
- }
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- // it is no writing call, thus must be ignored
- return;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigOutStream.is() )
- throw uno::RuntimeException();
-
- m_pStreamData->m_xOrigOutStream->flush();
- }
-}
-
-
-// ------------------------------------------------------------------------
-void SAL_CALL OPostponedTruncationFileStream::closeOutput( )
- throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- m_pStreamData->m_bOutOpen = sal_False;
- if ( !m_pStreamData->m_bInOpen )
- CloseAll_Impl();
-}
-
-
-
-// com::sun::star::io::XTruncate
-// ------------------------------------------------------------------------
-void SAL_CALL OPostponedTruncationFileStream::truncate( )
- throw (io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- // the truncation is already scheduled, ignore
- return;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigTruncate.is() )
- throw uno::RuntimeException();
-
- m_pStreamData->m_xOrigTruncate->truncate();
- }
-}
-
-
-
-// com::sun::star::io::XSeekable
-// ------------------------------------------------------------------------
-void SAL_CALL OPostponedTruncationFileStream::seek( ::sal_Int64 location )
- throw (lang::IllegalArgumentException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- if ( location > 0 )
- throw lang::IllegalArgumentException();
-
- return;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigSeekable.is() )
- throw uno::RuntimeException();
-
- m_pStreamData->m_xOrigSeekable->seek( location );
- }
-}
-
-
-// ------------------------------------------------------------------------
-::sal_Int64 SAL_CALL OPostponedTruncationFileStream::getPosition( )
- throw (io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- return 0;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigSeekable.is() )
- throw uno::RuntimeException();
-
- return m_pStreamData->m_xOrigSeekable->getPosition();
- }
-}
-
-
-// ------------------------------------------------------------------------
-::sal_Int64 SAL_CALL OPostponedTruncationFileStream::getLength( )
- throw (io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- return 0;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigSeekable.is() )
- throw uno::RuntimeException();
-
- return m_pStreamData->m_xOrigSeekable->getLength();
- }
-}
-
-// ------------------------------------------------------------------------
-void SAL_CALL OPostponedTruncationFileStream::waitForCompletion()
- throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
-{
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- return;
-
- uno::Reference< io::XAsyncOutputMonitor > asyncOutputMonitor( m_pStreamData->m_xOrigOutStream, uno::UNO_QUERY );
- if ( asyncOutputMonitor.is() )
- asyncOutputMonitor->waitForCompletion();
-}
-
diff --git a/sfx2/source/doc/opostponedtruncationstream.hxx b/sfx2/source/doc/opostponedtruncationstream.hxx
deleted file mode 100644
index fe67319fbbe0..000000000000
--- a/sfx2/source/doc/opostponedtruncationstream.hxx
+++ /dev/null
@@ -1,122 +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 _SFX_OPOSTPONEDTRUNCATIONFILESTREAM_HXX
-#define _SFX_OPOSTPONEDTRUNCATIONFILESTREAM_HXX
-
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/io/XOutputStream.hpp>
-#include <com/sun/star/io/XSeekable.hpp>
-#include <com/sun/star/io/XTruncate.hpp>
-#include <com/sun/star/io/XStream.hpp>
-#include <com/sun/star/embed/XTransactedObject.hpp>
-#include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
-#include <com/sun/star/io/XAsyncOutputMonitor.hpp>
-#include <osl/mutex.hxx>
-#include <cppuhelper/implbase6.hxx>
-#include "sfx2/dllapi.h"
-
-//==================================================================
-// OPostponedTruncationFileStream
-//
-// Allows to get stream access to a file, where the first truncation
-// of the file is postponed till the first writing. If no writing happens
-// after the first truncation/creation, it has no effect. ( The postponing of
-// the creation can be switched off during initialization. Here the postponing
-// of the creation means that the file will be created immediatelly, but
-// if nothing is written into it, it will be removed during destruction
-// of the object. )
-//
-// On creation of this object the target file is scheduled for
-// creation/truncation. But the action happens only during the first
-// write access. After the first write access the object behaves
-// itself as the original stream.
-//==================================================================
-
-struct PTFStreamData_Impl;
-class SFX2_DLLPUBLIC OPostponedTruncationFileStream
- : public ::cppu::WeakImplHelper6 <
- ::com::sun::star::io::XStream,
- ::com::sun::star::io::XInputStream,
- ::com::sun::star::io::XOutputStream,
- ::com::sun::star::io::XTruncate,
- ::com::sun::star::io::XSeekable,
- ::com::sun::star::io::XAsyncOutputMonitor >
-{
- ::osl::Mutex m_aMutex;
- PTFStreamData_Impl* m_pStreamData;
-
- void CloseAll_Impl();
-
- void CheckScheduledTruncation_Impl();
-
-public:
-
- OPostponedTruncationFileStream(
- const ::rtl::OUString& aURL,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
- const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess >& xFileAccess,
- const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream,
- sal_Bool bDelete );
-
- ~OPostponedTruncationFileStream();
-
-// com::sun::star::io::XStream
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > SAL_CALL getOutputStream( ) throw (::com::sun::star::uno::RuntimeException);
-
-// com::sun::star::io::XInputStream
- virtual ::sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nMaxBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL skipBytes( ::sal_Int32 nBytesToSkip ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL available( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL closeInput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
-
-// com::sun::star::io::XOutputStream
- virtual void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL flush( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL closeOutput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
-
-// com::sun::star::io::XTruncate
- virtual void SAL_CALL truncate( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
-
-// com::sun::star::io::XSeekable
- virtual void SAL_CALL seek( ::sal_Int64 location ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int64 SAL_CALL getPosition( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int64 SAL_CALL getLength( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
-
-// ::com::sun::star::io::XAsyncOutputMonitor
- virtual void SAL_CALL waitForCompletion( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
-
-};
-
-#endif //_SFX_OPOSTPONEDTRUNCATIONFILESTREAM_HXX
-
-
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index 459a142b9129..2cd195976832 100755
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -266,17 +266,23 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxPrintHelper::getPrinter() thro
// object already disposed?
::vos::OGuard aGuard( Application::GetSolarMutex() );
- // Printer beschaffen
- SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ?
- SfxViewFrame::GetFirst( m_pData->m_pObjectShell, sal_False ) : 0;
- if ( !pViewFrm )
- return uno::Sequence< beans::PropertyValue >();
+ // search for any view of this document that is currently printing
+ const Printer *pPrinter = NULL;
+ SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ? SfxViewFrame::GetFirst( m_pData->m_pObjectShell, sal_False ) : 0;
+ SfxViewFrame* pFirst = pViewFrm;
+ while ( pViewFrm && !pPrinter )
+ {
+ pPrinter = pViewFrm->GetViewShell()->GetActivePrinter();
+ pViewFrm = SfxViewFrame::GetNext( *pViewFrm, m_pData->m_pObjectShell, sal_False );
+ }
+
+ // if no view is printing currently, use the permanent SfxPrinter instance
+ if ( !pPrinter && pFirst )
+ pPrinter = pFirst->GetViewShell()->GetPrinter(sal_True);
- const SfxPrinter *pPrinter = pViewFrm->GetViewShell()->GetPrinter(sal_True);
if ( !pPrinter )
return uno::Sequence< beans::PropertyValue >();
- // Printer Eigenschaften uebertragen
uno::Sequence< beans::PropertyValue > aPrinter(8);
aPrinter.getArray()[7].Name = DEFINE_CONST_UNICODE( "CanSetPaperSize" );
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 5c746736a9ae..1bc0f1f79a6e 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -74,6 +74,7 @@
#include <svl/itemset.hxx>
#include <svl/stritem.hxx>
#include <svl/eitem.hxx>
+#include <svl/intitem.hxx>
#include <basic/sbx.hxx>
#include <basic/sbuno.hxx>
#include <tools/urlobj.hxx>
@@ -2729,6 +2730,24 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
uno::Reference< uno::XInterface >() );
}
+ sal_uInt32 nModifyPasswordHash = 0;
+ uno::Sequence< beans::PropertyValue > aModifyPasswordInfo;
+ SFX_ITEMSET_ARG( aParams, pModifyPasswordInfoItem, SfxUnoAnyItem, SID_MODIFYPASSWORDINFO, sal_False );
+ if ( pModifyPasswordInfoItem )
+ {
+ // it contains either a simple hash or a set of PropertyValues
+ // TODO/LATER: the sequence of PropertyValue should replace the hash completely in future
+ sal_Int32 nMPHTmp = 0;
+ pModifyPasswordInfoItem->GetValue() >>= nMPHTmp;
+ nModifyPasswordHash = (sal_uInt32)nMPHTmp;
+ pModifyPasswordInfoItem->GetValue() >>= aModifyPasswordInfo;
+ }
+ aParams->ClearItem( SID_MODIFYPASSWORDINFO );
+ sal_uInt32 nOldModifyPasswordHash = m_pData->m_pObjectShell->GetModifyPasswordHash();
+ m_pData->m_pObjectShell->SetModifyPasswordHash( nModifyPasswordHash );
+ uno::Sequence< beans::PropertyValue > aOldModifyPasswordInfo = m_pData->m_pObjectShell->GetModifyPasswordInfo();
+ m_pData->m_pObjectShell->SetModifyPasswordInfo( aModifyPasswordInfo );
+
// since saving a document modifies its DocumentInfo, the current
// DocumentInfo must be saved on "SaveTo", so it can be restored
// after saving
@@ -2807,10 +2826,15 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
if ( !bSaveTo )
{
m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl();
+ m_pData->m_pObjectShell->SetModifyPasswordEntered();
+
SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEASDOCDONE, GlobalEventConfig::GetEventName(STR_EVENT_SAVEASDOCDONE), m_pData->m_pObjectShell ) );
}
else
{
+ m_pData->m_pObjectShell->SetModifyPasswordHash( nOldModifyPasswordHash );
+ m_pData->m_pObjectShell->SetModifyPasswordInfo( aOldModifyPasswordInfo );
+
SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVETODOCDONE, GlobalEventConfig::GetEventName(STR_EVENT_SAVETODOCDONE), m_pData->m_pObjectShell ) );
}
}
@@ -2820,6 +2844,10 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing failed!" ) ) );
m_pData->m_pObjectShell->StoreLog();
+ m_pData->m_pObjectShell->SetModifyPasswordHash( nOldModifyPasswordHash );
+ m_pData->m_pObjectShell->SetModifyPasswordInfo( aOldModifyPasswordInfo );
+
+
SFX_APP()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOCFAILED : SFX_EVENT_SAVEASDOCFAILED, GlobalEventConfig::GetEventName( bSaveTo ? STR_EVENT_SAVETODOCFAILED : STR_EVENT_SAVEASDOCFAILED),
m_pData->m_pObjectShell ) );
diff --git a/sfx2/source/doc/syspath.cxx b/sfx2/source/doc/syspath.cxx
new file mode 100644
index 000000000000..a1025370ed24
--- /dev/null
+++ b/sfx2/source/doc/syspath.cxx
@@ -0,0 +1,48 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2008 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* $RCSfile: shutdowniconw32.cxx,v $
+* $Revision: 1.48 $
+*
+* 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
+// Comment out precompiled statement due to redefinition errors
+#include "precompiled_sfx2.hxx"
+
+#include "syspath.hxx"
+
+extern "C" bool GetUserTemplateLocation(sal_Unicode*, int nSize);
+
+bool SystemPath::GetUserTemplateLocation(sal_Unicode* pFolder, int nSize )
+{
+#ifdef WNT
+ return ::GetUserTemplateLocation( pFolder, nSize );
+#else
+ (void)pFolder;
+ (void)nSize;
+ return false;
+#endif
+}
diff --git a/configmgr/inc/configmgr/detail/configmgrdllapi.hxx b/sfx2/source/doc/syspath.hxx
index 6eb2ea7bc9d9..015c16f18d26 100644
--- a/configmgr/inc/configmgr/detail/configmgrdllapi.hxx
+++ b/sfx2/source/doc/syspath.hxx
@@ -2,10 +2,13 @@
*
* 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: shutdowniconw32.cxx,v $
+* $Revision: 1.48 $
+*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -25,17 +28,17 @@
*
************************************************************************/
-#ifndef INCLUDED_CONFIGMGR_DETAIL_CONFIGMGRDLLAPI_HXX
-#define INCLUDED_CONFIGMGR_DETAIL_CONFIGMGRDLLAPI_HXX
+#ifndef __SYSPATH_HXX__
+#define __SYSPATH_HXX__
+//#pragma warning(disable:4917)
-#include "sal/config.h"
+#include <sfx2/dllapi.h>
-#include "sal/types.h"
+class SFX2_DLLPUBLIC SystemPath
+{
+public:
+ static bool GetUserTemplateLocation(sal_Unicode*, int nSize);
+};
-#if defined OOO_DLLIMPLEMENTATION_CONFIGMGR
-#define OOO_DLLPUBLIC_CONFIGMGR SAL_DLLPUBLIC_EXPORT
-#else
-#define OOO_DLLPUBLIC_CONFIGMGR SAL_DLLPUBLIC_IMPORT
#endif
-#endif
diff --git a/sfx2/source/doc/syspathw32.cxx b/sfx2/source/doc/syspathw32.cxx
new file mode 100644
index 000000000000..73bd84f5249a
--- /dev/null
+++ b/sfx2/source/doc/syspathw32.cxx
@@ -0,0 +1,83 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2008 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* $RCSfile: shutdowniconw32.cxx,v $
+* $Revision: 1.48 $
+*
+* 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.
+*
+************************************************************************/
+
+#ifdef WNT
+#ifdef _MSC_VER
+#pragma warning(disable:4917)
+#endif
+#include <shlobj.h>
+
+static bool _SHGetSpecialFolderW32( int nFolderID, WCHAR* pszFolder, int nSize )
+{
+ LPITEMIDLIST pidl;
+ HRESULT hHdl = SHGetSpecialFolderLocation( NULL, nFolderID, &pidl );
+
+ if( hHdl == NOERROR )
+ {
+ WCHAR *lpFolder = static_cast< WCHAR* >( HeapAlloc( GetProcessHeap(), 0, 16000 ));
+
+ SHGetPathFromIDListW( pidl, lpFolder );
+ wcsncpy( pszFolder, lpFolder, nSize );
+
+ HeapFree( GetProcessHeap(), 0, lpFolder );
+ IMalloc *pMalloc;
+ if( NOERROR == SHGetMalloc(&pMalloc) )
+ {
+ pMalloc->Free( pidl );
+ pMalloc->Release();
+ }
+ }
+ return true;
+}
+
+#endif
+
+// Copied from sal/types.h to circumvent problems with precompiled headers
+// and redefinitions of BOOL, INT32 and other types. Unfortunately tools
+// also define these type incompatible with Win32 types which leads from
+// time to time to very nasty compilation errors. If someone finds a better
+// way to solve these probs please remove this copied part!
+typedef unsigned short sal_uInt16;
+#if ( defined(WIN32) && !defined(__MINGW32__) )
+ typedef wchar_t sal_Unicode;
+#else
+ typedef sal_uInt16 sal_Unicode;
+#endif
+
+extern "C" bool GetUserTemplateLocation(sal_Unicode* pFolder, int nSize)
+{
+#ifdef WNT
+ return _SHGetSpecialFolderW32( CSIDL_TEMPLATES, pFolder, nSize );
+#else
+ (void)pFolder;
+ (void)nSize;
+ return false;
+#endif
+}
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
index 91305eb95cce..bd12f3db80dc 100644
--- a/sfx2/source/inc/appdata.hxx
+++ b/sfx2/source/inc/appdata.hxx
@@ -82,6 +82,9 @@ class SfxBasicManagerCreationListener;
namespace sfx2 { namespace appl { class ImeStatusWindow; } }
+typedef Link* LinkPtr;
+SV_DECL_PTRARR(SfxInitLinkList, LinkPtr, 4, 4)
+
//=========================================================================
// SfxAppData_Impl
//=========================================================================
diff --git a/sfx2/source/inc/helpid.hrc b/sfx2/source/inc/helpid.hrc
index 29ad461d18da..79dba3208729 100644..100755
--- a/sfx2/source/inc/helpid.hrc
+++ b/sfx2/source/inc/helpid.hrc
@@ -46,6 +46,7 @@
#define HID_DOCINFODESC (HID_SFX_START + 8)
#define HID_DOCINFODOC (HID_SFX_START + 9)
#define HID_DOCINFOUSER (HID_SFX_START + 10)
+#define HID_DOCINFOSECURITY (HID_SFX_START + 11)
#define HID_BOOKMARKPROPS (HID_SFX_START + 14)
#define HID_BOOKGROUPPROPS (HID_SFX_START + 15)
#define HID_BOOKFILEPROPS (HID_SFX_START + 16)
@@ -330,7 +331,8 @@
#define HID_CONFIG_SAVE (HID_SFX_START + 310)
#define HID_SEARCHDIALOG (HID_SFX_START + 311)
-
+#define HID_TASKPANE_WINDOW (HID_SFX_START + 312)
+#define HID_TASKPANE_VIEW_MENU (HID_SFX_START + 313)
#define HID_XMLSEC_WARNING_BROKENSIGNATURE (HID_SFX_START + 314)
#define HID_XMLSEC_QUERY_LOSINGSIGNATURE (HID_SFX_START + 315)
#define HID_XMLSEC_QUERY_SAVEBEFORESIGN (HID_SFX_START + 316)
@@ -345,7 +347,15 @@
#define HID_CTRL_CUSTOMPROPS_YES_NO (HID_SFX_START + 326)
#define HID_DLG_CUSTOMPROPS_DURATION (HID_SFX_START + 327)
-#define ACT_SFX_HID_END HID_DLG_CUSTOMPROPS_DURATION
+#define HID_SECURITYTAB_PASSWORD_TO_OPEN (HID_SFX_START + 328)
+#define HID_SECURITYTAB_CONFIRM_PASSWORD_TO_OPEN (HID_SFX_START + 329)
+#define HID_SECURITYTAB_PASSWORD_TO_MODIFY (HID_SFX_START + 330)
+#define HID_SECURITYTAB_CONFIRM_PASSWORD_TO_MODIFY (HID_SFX_START + 331)
+#define HID_SECURITYTAB_OPEN_FILE_READONLY (HID_SFX_START + 332)
+#define HID_SECURITYTAB_RECORD_CHANGES (HID_SFX_START + 333)
+#define HID_SECURITYTAB_PROTECTION (HID_SFX_START + 334)
+
+#define ACT_SFX_HID_END HID_SECURITYTAB_PROTECTION
// "Uberlaufpr"ufung --------------------------------------------------------
diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx
index a882cfedd821..b5087fb46294 100644
--- a/sfx2/source/inc/objshimp.hxx
+++ b/sfx2/source/inc/objshimp.hxx
@@ -149,6 +149,10 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
sal_Bool m_bIncomplEncrWarnShown;
+ // TODO/LATER: m_aModifyPasswordInfo should completely replace m_nModifyPasswordHash in future
+ sal_uInt32 m_nModifyPasswordHash;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aModifyPasswordInfo;
+ sal_Bool m_bModifyPasswordEntered;
SfxObjectShell_Impl( SfxObjectShell& _rDocShell );
virtual ~SfxObjectShell_Impl();
diff --git a/sfx2/source/inc/sfxlocal.hrc b/sfx2/source/inc/sfxlocal.hrc
index fb21cb0ab13c..202ed6f6f00f 100644
--- a/sfx2/source/inc/sfxlocal.hrc
+++ b/sfx2/source/inc/sfxlocal.hrc
@@ -44,6 +44,10 @@
#define STR_SFX_EXPLORERFILE_BUTTONINSERT (RID_SFX_SFXLOCAL_START + 4)
#define STR_SFX_IMPORT_ALL (RID_SFX_SFXLOCAL_START + 5)
#define STR_SFX_EXPLORERFILE_EXPORT (RID_SFX_SFXLOCAL_START + 6)
+#define STR_SFX_DOCK (RID_SFX_SFXLOCAL_START + 7)
+#define STR_SFX_UNDOCK (RID_SFX_SFXLOCAL_START + 8)
+#define STR_SFX_TASK_PANE_VIEW (RID_SFX_SFXLOCAL_START + 9)
+#define STR_SFX_TASKS (RID_SFX_SFXLOCAL_START + 10)
// Controls --------------------------------------------------------------
@@ -55,13 +59,17 @@
#define SFX_PB_PROPERTY_REMOVE (RID_SFX_SFXLOCAL_START + 5)
#define SFX_WIN_PROPERTY_YESNO (RID_SFX_SFXLOCAL_START + 6)
#define SFX_QB_WRONG_TYPE (RID_SFX_SFXLOCAL_START + 7)
-#define SFX_IMG_PROPERTY_REMOVE (RID_SFX_SFXLOCAL_START + 8)
-#define SFX_IMG_PROPERTY_REMOVE_HC (RID_SFX_SFXLOCAL_START + 9)
#define SFX_FLD_DATE (RID_SFX_SFXLOCAL_START + 10)
#define SFX_FLD_TIME (RID_SFX_SFXLOCAL_START + 11)
#define SFX_FLD_DURATION (RID_SFX_SFXLOCAL_START + 12)
#define SFX_ST_DURATION_FORMAT (RID_SFX_SFXLOCAL_START + 13)
+// Images ----------------------------------------------------------------
+
+#define SFX_IMG_PROPERTY_REMOVE (RID_SFX_SFXLOCAL_START + 0)
+#define SFX_IMG_PROPERTY_REMOVE_HC (RID_SFX_SFXLOCAL_START + 1)
+#define SFX_IMG_CLOSE_DOC (RID_SFX_SFXLOCAL_START + 2)
+#define SFX_IMG_CLOSE_DOC_HC (RID_SFX_SFXLOCAL_START + 3)
#endif
diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx
index ae005d1bad88..a82b72bc2947 100644
--- a/sfx2/source/inc/workwin.hxx
+++ b/sfx2/source/inc/workwin.hxx
@@ -365,6 +365,7 @@ public:
void SetActiveChild_Impl( Window *pChild );
Window* GetActiveChild_Impl();
virtual BOOL ActivateNextChild_Impl( BOOL bForward = TRUE );
+ bool AllowChildWindowCreation_Impl( const SfxChildWin_Impl& i_rCW ) const;
// Methoden f"ur StatusBar
void SetTempStatusBar_Impl( BOOL bSet );
diff --git a/sfx2/source/menu/makefile.mk b/sfx2/source/menu/makefile.mk
index d3b209fc4a45..8b55bd0840ea 100644
--- a/sfx2/source/menu/makefile.mk
+++ b/sfx2/source/menu/makefile.mk
@@ -43,10 +43,11 @@ SRS1NAME=$(TARGET)
SRC1FILES = menu.src
SLOFILES = \
+ $(SLO)$/mnuitem.obj \
$(SLO)$/mnumgr.obj \
- $(SLO)$/virtmenu.obj \
$(SLO)$/objmnctl.obj \
- $(SLO)$/mnuitem.obj
+ $(SLO)$/thessubmenu.obj \
+ $(SLO)$/virtmenu.obj
# --- Tagets -------------------------------------------------------
diff --git a/sfx2/source/menu/menu.hrc b/sfx2/source/menu/menu.hrc
index 5017f980872b..b437f797c26e 100644
--- a/sfx2/source/menu/menu.hrc
+++ b/sfx2/source/menu/menu.hrc
@@ -64,6 +64,10 @@
#define STR_MENU_ADDONS RID_SFX_MENU_START+2
#define STR_MENU_ADDONHELP RID_SFX_MENU_START+3
+#define STR_MENU_SYNONYMS (RID_SFX_MENU_START+11)
+#define STR_MENU_NO_SYNONYM_FOUND (RID_SFX_MENU_START+12)
+#define STR_MENU_THESAURUS (RID_SFX_MENU_START+13)
+
#define MN_CLIPBOARDFUNCS RID_SFX_MENU_START+1
#endif
diff --git a/sfx2/source/menu/menu.src b/sfx2/source/menu/menu.src
index 97c9c7f640fa..a2e07a3348b0 100644
--- a/sfx2/source/menu/menu.src
+++ b/sfx2/source/menu/menu.src
@@ -72,6 +72,21 @@ String STR_MENU_ADDONHELP
Text [ en-US ] = "Add-~On Help" ;
};
+String STR_MENU_SYNONYMS
+{
+ Text [ en-US ] = "Synonyms" ;
+};
+
+String STR_MENU_NO_SYNONYM_FOUND
+{
+ Text [ en-US ] = "(none)" ;
+};
+
+String STR_MENU_THESAURUS
+{
+ Text [ en-US ] = "~Thesaurus..." ;
+};
+
// ******************************************************************* EOF
diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx
index a7fa737ecd18..eddc97eeb4af 100644
--- a/sfx2/source/menu/mnumgr.cxx
+++ b/sfx2/source/menu/mnumgr.cxx
@@ -27,8 +27,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sfx2.hxx"
+
#include <com/sun/star/embed/VerbDescriptor.hpp>
#include <com/sun/star/embed/VerbAttributes.hpp>
+#include <com/sun/star/container/XNamed.hpp>
#ifdef SOLARIS
// HACK: prevent conflict between STLPORT and Workshop headers on Solaris 8
@@ -50,9 +52,14 @@
#include <framework/addonmenu.hxx>
#include <comphelper/processfactory.hxx>
#include <unotools/ucbstreamhelper.hxx>
+#include <unotools/lingucfg.hxx>
#include <tools/urlobj.hxx>
#include <unotools/pathoptions.hxx>
+#include <svl/stritem.hxx>
#include <toolkit/helper/vclunohelper.hxx>
+#include <osl/file.hxx>
+#include <vcl/graph.hxx>
+#include <svtools/filter.hxx>
#include <sfx2/mnumgr.hxx>
@@ -76,10 +83,15 @@
#include <sfx2/viewfrm.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/objface.hxx>
+#include "thessubmenu.hxx"
+
static const USHORT nCompatVersion = 4;
static const USHORT nVersion = 5;
+// static member initialization
+PopupMenu * SfxPopupMenuManager::pStaticThesSubMenu = NULL;
+
using namespace com::sun::star;
//=========================================================================
@@ -166,6 +178,101 @@ void InsertVerbs_Impl( SfxBindings* pBindings, const com::sun::star::uno::Sequen
}
+//--------------------------------------------------------------------
+
+
+static Image lcl_GetImageFromPngUrl( const ::rtl::OUString &rFileUrl )
+{
+ Image aRes;
+
+ ::rtl::OUString aTmp;
+ osl::FileBase::getSystemPathFromFileURL( rFileUrl, aTmp );
+
+ Graphic aGraphic;
+ const String aFilterName( RTL_CONSTASCII_USTRINGPARAM( IMP_PNG ) );
+ if( GRFILTER_OK == GraphicFilter::LoadGraphic( aTmp, aFilterName, aGraphic ) )
+ {
+ aRes = Image( aGraphic.GetBitmapEx() );
+ }
+ return aRes;
+}
+
+
+PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu )
+{
+ //
+ // build thesaurus sub menu if look-up string is available
+ //
+ PopupMenu* pThesSubMenu = 0;
+ SfxPoolItem *pItem = 0;
+ pBindings->QueryState( SID_THES, pItem );
+ String aThesLookUpStr;
+ SfxStringItem *pStrItem = dynamic_cast< SfxStringItem * >(pItem);
+ xub_StrLen nDelimPos = STRING_LEN;
+ if (pStrItem)
+ {
+ aThesLookUpStr = pStrItem->GetValue();
+ nDelimPos = aThesLookUpStr.SearchBackward( '#' );
+ }
+ if (aThesLookUpStr.Len() > 0 && nDelimPos != STRING_NOTFOUND)
+ {
+ // get synonym list for sub menu
+ std::vector< ::rtl::OUString > aSynonyms;
+ SfxThesSubMenuHelper aHelper;
+ ::rtl::OUString aText( aHelper.GetText( aThesLookUpStr, nDelimPos ) );
+ lang::Locale aLocale;
+ aHelper.GetLocale( aLocale, aThesLookUpStr, nDelimPos );
+ const bool bHasMoreSynonyms = aHelper.GetMeanings( aSynonyms, aText, aLocale, 7 /*max number of synonyms to retrieve*/ );
+ (void) bHasMoreSynonyms;
+
+ pThesSubMenu = new PopupMenu;
+ pThesSubMenu->SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS);
+ const size_t nNumSynonyms = aSynonyms.size();
+ if (nNumSynonyms > 0)
+ {
+ SvtLinguConfig aCfg;
+ const bool bHC = Application::GetSettings().GetStyleSettings().GetHighContrastMode();
+
+ Image aImage;
+ String sThesImplName( aHelper.GetThesImplName( aLocale ) );
+ ::rtl::OUString aSynonymsImageUrl( aCfg.GetSynonymsContextImage( sThesImplName, bHC ) );
+ if (sThesImplName.Len() > 0 && aSynonymsImageUrl.getLength() > 0)
+ aImage = Image( lcl_GetImageFromPngUrl( aSynonymsImageUrl ) );
+
+ for (USHORT i = 0; (size_t)i < nNumSynonyms; ++i)
+ {
+ //! item ids should start with values > 0, since 0 has special meaning
+ const USHORT nId = i + 1;
+
+ String aItemText( GetThesaurusReplaceText_Impl( aSynonyms[i] ) );
+ pThesSubMenu->InsertItem( nId, aItemText );
+ ::rtl::OUString aCmd( ::rtl::OUString::createFromAscii( ".uno:ThesaurusFromContext?WordReplace:string=" ) );
+ aCmd += aItemText;
+ pThesSubMenu->SetItemCommand( nId, aCmd );
+
+ if (aSynonymsImageUrl.getLength() > 0)
+ pThesSubMenu->SetItemImage( nId, aImage );
+ }
+ }
+ else // nNumSynonyms == 0
+ {
+ const String aItemText( SfxResId( STR_MENU_NO_SYNONYM_FOUND ) );
+ pThesSubMenu->InsertItem( 1, aItemText, MIB_NOSELECT );
+ }
+ pThesSubMenu->InsertSeparator();
+ const String sThesaurus( SfxResId( STR_MENU_THESAURUS ) );
+ pThesSubMenu->InsertItem( 100, sThesaurus );
+ pThesSubMenu->SetItemCommand( 100, ::rtl::OUString::createFromAscii( ".uno:ThesaurusDialog" ) );
+
+ pSVMenu->InsertSeparator();
+ const String sSynonyms( SfxResId( STR_MENU_SYNONYMS ) );
+ pSVMenu->InsertItem( SID_THES, sSynonyms );
+ pSVMenu->SetPopupMenu( SID_THES, pThesSubMenu );
+ }
+
+ return pThesSubMenu;
+}
+
//--------------------------------------------------------------------
@@ -305,7 +412,9 @@ void SfxPopupMenuManager::RemoveDisabledEntries()
USHORT SfxPopupMenuManager::Execute( const Point& rPos, Window* pWindow )
{
DBG_MEMTEST();
- return ( (PopupMenu*) GetMenu()->GetSVMenu() )->Execute( pWindow, rPos );
+ USHORT nVal = ( (PopupMenu*) GetMenu()->GetSVMenu() )->Execute( pWindow, rPos );
+ delete pStaticThesSubMenu; pStaticThesSubMenu = NULL;
+ return nVal;
}
//--------------------------------------------------------------------
@@ -429,6 +538,10 @@ SfxPopupMenuManager* SfxPopupMenuManager::Popup( const ResId& rResId, SfxViewFra
break;
}
+ PopupMenu* pThesSubMenu = InsertThesaurusSubmenu_Impl( &pFrame->GetBindings(), pSVMenu );
+ // #i107205# (see comment in header file)
+ pStaticThesSubMenu = pThesSubMenu;
+
if ( n == nCount )
{
PopupMenu aPop( SfxResId( MN_CLIPBOARDFUNCS ) );
@@ -461,6 +574,7 @@ SfxPopupMenuManager* SfxPopupMenuManager::Popup( const ResId& rResId, SfxViewFra
aMgr->RemoveDisabledEntries();
return aMgr;
}
+
return 0;
}
@@ -475,6 +589,8 @@ void SfxPopupMenuManager::ExecutePopup( const ResId& rResId, SfxViewFrame* pFram
break;
}
+ PopupMenu* pThesSubMenu = InsertThesaurusSubmenu_Impl( &pFrame->GetBindings(), pSVMenu );
+
if ( n == nCount )
{
PopupMenu aPop( SfxResId( MN_CLIPBOARDFUNCS ) );
@@ -507,6 +623,8 @@ void SfxPopupMenuManager::ExecutePopup( const ResId& rResId, SfxViewFrame* pFram
aPop.RemoveDisabledEntries();
aPop.Execute( rPoint, pWindow );
}
+
+ delete pThesSubMenu;
}
Menu* SfxPopupMenuManager::GetSVMenu()
diff --git a/sfx2/source/menu/thessubmenu.cxx b/sfx2/source/menu/thessubmenu.cxx
new file mode 100644
index 000000000000..de1137bd6a74
--- /dev/null
+++ b/sfx2/source/menu/thessubmenu.cxx
@@ -0,0 +1,274 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: thessubmenu.cxx,v $
+ * $Revision: 1.0 $
+ *
+ * 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_sfx2.hxx"
+
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/linguistic2/XThesaurus.hpp>
+#include <com/sun/star/linguistic2/XMeaning.hpp>
+#include <com/sun/star/linguistic2/XLinguServiceManager.hpp>
+
+#include <comphelper/processfactory.hxx>
+#include <svl/stritem.hxx>
+#include <tools/debug.hxx>
+#include <vcl/graph.hxx>
+#include <svtools/filter.hxx>
+
+
+#include <vector>
+
+#include <sfx2/bindings.hxx>
+#include <sfx2/dispatch.hxx>
+#include <sfx2/viewsh.hxx>
+#include "thessubmenu.hxx"
+
+
+using namespace ::com::sun::star;
+using ::rtl::OUString;
+
+
+// STATIC DATA -----------------------------------------------------------
+
+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
+ in seinen Parent ein.
+ */
+SfxThesSubMenuControl::SfxThesSubMenuControl( USHORT nSlotId, Menu &rMenu, SfxBindings &rBindings )
+ : SfxMenuControl( nSlotId, rBindings ),
+ pMenu(new PopupMenu),
+ rParent(rMenu)
+{
+ rMenu.SetPopupMenu(nSlotId, pMenu);
+ pMenu->SetSelectHdl(LINK(this, SfxThesSubMenuControl, MenuSelect));
+ pMenu->Clear();
+ rParent.EnableItem( GetId(), FALSE );
+}
+
+
+SfxThesSubMenuControl::~SfxThesSubMenuControl()
+{
+ delete pMenu;
+}
+
+
+/*
+ Statusbenachrichtigung;
+ Ist die Funktionalit"at disabled, wird der entsprechende
+ Menueeintrag im Parentmenu disabled, andernfalls wird er enabled.
+ */
+void SfxThesSubMenuControl::StateChanged(
+ USHORT /*nSID*/,
+ SfxItemState eState,
+ const SfxPoolItem* /*pState*/ )
+{
+ rParent.EnableItem(GetId(), SFX_ITEM_AVAILABLE == eState );
+}
+
+
+/*
+ Select-Handler des Menus;
+ das selektierte Verb mit ausgef"uhrt,
+ */
+IMPL_LINK_INLINE_START( SfxThesSubMenuControl, MenuSelect, Menu *, pSelMenu )
+{
+ const USHORT nSlotId = pSelMenu->GetCurItemId();
+ if( nSlotId )
+ GetBindings().Execute(nSlotId);
+ return 1;
+}
+IMPL_LINK_INLINE_END( SfxThesSubMenuControl, MenuSelect, Menu *, pSelMenu )
+
+
+PopupMenu* SfxThesSubMenuControl::GetPopup() const
+{
+ return pMenu;
+}
+
+
+////////////////////////////////////////////////////////////
+
+OUString SfxThesSubMenuHelper::GetText(
+ const String &rLookUpString,
+ xub_StrLen nDelimPos )
+{
+ return OUString( rLookUpString.Copy( 0, nDelimPos ) );
+}
+
+
+void SfxThesSubMenuHelper::GetLocale(
+ lang::Locale /*out */ &rLocale,
+ const String &rLookUpString,
+ xub_StrLen nDelimPos )
+{
+ String aIsoLang( rLookUpString.Copy( nDelimPos + 1) );
+ const xub_StrLen nPos = aIsoLang.Search( '-' );
+ if (nPos != STRING_NOTFOUND)
+ {
+ rLocale.Language = aIsoLang.Copy( 0, nPos );
+ rLocale.Country = aIsoLang.Copy( nPos + 1 );
+ rLocale.Variant = String::EmptyString();
+ }
+}
+
+
+SfxThesSubMenuHelper::SfxThesSubMenuHelper()
+{
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+ m_xLngMgr = uno::Reference< linguistic2::XLinguServiceManager >( xMSF->createInstance(
+ OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.linguistic2.LinguServiceManager" ))), uno::UNO_QUERY_THROW );
+ m_xThesarus = m_xLngMgr->getThesaurus();
+ }
+ catch (uno::Exception &e)
+ {
+ (void) e;
+ DBG_ASSERT( 0, "failed to get thesaurus" );
+ }
+}
+
+
+SfxThesSubMenuHelper::~SfxThesSubMenuHelper()
+{
+}
+
+
+bool SfxThesSubMenuHelper::IsSupportedLocale( const lang::Locale & rLocale ) const
+{
+ return m_xThesarus.is() && m_xThesarus->hasLocale( rLocale );
+}
+
+
+bool SfxThesSubMenuHelper::GetMeanings(
+ std::vector< OUString > & rSynonyms,
+ const OUString & rWord,
+ const lang::Locale & rLocale,
+ sal_Int16 nMaxSynonms )
+{
+ bool bHasMoreSynonyms = false;
+ rSynonyms.clear();
+ if (IsSupportedLocale( rLocale ) && rWord.getLength() && nMaxSynonms > 0)
+ {
+ try
+ {
+ // get all meannings
+ const uno::Sequence< uno::Reference< linguistic2::XMeaning > > aMeaningSeq(
+ m_xThesarus->queryMeanings( rWord, rLocale, uno::Sequence< beans::PropertyValue >() ));
+ const uno::Reference< linguistic2::XMeaning > *pxMeaning = aMeaningSeq.getConstArray();
+ const sal_Int32 nMeanings = aMeaningSeq.getLength();
+
+ // iterate over all meanings until nMaxSynonms are found or all meanings are processed
+ sal_Int32 nCount = 0;
+ sal_Int32 i = 0;
+ for ( ; i < nMeanings && nCount < nMaxSynonms; ++i)
+ {
+ const uno::Sequence< OUString > aSynonymSeq( pxMeaning[i]->querySynonyms() );
+ const OUString *pSynonyms = aSynonymSeq.getConstArray();
+ const sal_Int32 nSynonyms = aSynonymSeq.getLength();
+ sal_Int32 k = 0;
+ for ( ; k < nSynonyms && nCount < nMaxSynonms; ++k)
+ {
+ rSynonyms.push_back( pSynonyms[k] );
+ ++nCount;
+ }
+ bHasMoreSynonyms = k < nSynonyms; // any synonym from this meaning skipped?
+ }
+
+ bHasMoreSynonyms |= i < nMeanings; // any meaning skipped?
+ }
+ catch (uno::Exception &e)
+ {
+ (void) e;
+ DBG_ASSERT( 0, "failed to get synonyms" );
+ }
+ }
+ return bHasMoreSynonyms;
+}
+
+
+String SfxThesSubMenuHelper::GetThesImplName( const lang::Locale &rLocale ) const
+{
+ String aRes;
+ DBG_ASSERT( m_xLngMgr.is(), "LinguServiceManager missing" );
+ if (m_xLngMgr.is())
+ {
+ uno::Sequence< OUString > aServiceNames = m_xLngMgr->getConfiguredServices(
+ OUString::createFromAscii("com.sun.star.linguistic2.Thesaurus"), rLocale );
+ // there should be at most one thesaurus configured for each language
+ DBG_ASSERT( aServiceNames.getLength() <= 1, "more than one thesaurus found. Should not be possible" );
+ if (aServiceNames.getLength() == 1)
+ aRes = aServiceNames[0];
+ }
+ return aRes;
+}
+
+////////////////////////////////////////////////////////////
+
+
diff --git a/sfx2/source/menu/thessubmenu.hxx b/sfx2/source/menu/thessubmenu.hxx
new file mode 100644
index 000000000000..14d7473cb7c0
--- /dev/null
+++ b/sfx2/source/menu/thessubmenu.hxx
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: thessubmenu.hxx,v $
+ * $Revision: 1.0 $
+ *
+ * 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 _THESSUBMENU_HXX_
+#define _THESSUBMENU_HXX_
+
+#include <com/sun/star/linguistic2/XThesaurus.hpp>
+#include <com/sun/star/linguistic2/XLinguServiceManager.hpp>
+
+#include <vcl/menu.hxx>
+#include <sfx2/mnuitem.hxx>
+
+class SfxBindings;
+class PopupMenu;
+class Menu;
+
+namespace css = ::com::sun::star;
+
+////////////////////////////////////////////////////////////
+
+String GetThesaurusReplaceText_Impl( const ::rtl::OUString &rText );
+
+////////////////////////////////////////////////////////////
+
+class SfxThesSubMenuControl : public SfxMenuControl
+{
+ PopupMenu* pMenu;
+ Menu& rParent;
+
+private:
+ virtual void StateChanged( USHORT, SfxItemState, const SfxPoolItem* pState );
+ DECL_LINK( MenuSelect, Menu * );
+
+public:
+ SfxThesSubMenuControl(USHORT, Menu&, SfxBindings&);
+ ~SfxThesSubMenuControl();
+
+ virtual PopupMenu* GetPopup() const;
+
+ SFX_DECL_MENU_CONTROL();
+};
+
+////////////////////////////////////////////////////////////
+
+class SfxThesSubMenuHelper
+{
+ css::uno::Reference< css::linguistic2::XLinguServiceManager > m_xLngMgr;
+ css::uno::Reference< css::linguistic2::XThesaurus > m_xThesarus;
+
+private:
+
+ // don't use copy c-tor and assignment operator
+ SfxThesSubMenuHelper( const SfxThesSubMenuHelper & );
+ SfxThesSubMenuHelper & operator = ( const SfxThesSubMenuHelper & );
+
+public:
+ SfxThesSubMenuHelper();
+ ~SfxThesSubMenuHelper();
+
+ static ::rtl::OUString GetText( const String &rLookUpString, xub_StrLen nDelimPos );
+
+ // returns the Locale to be used for the selected text when the thesaurus is to be called
+ static void GetLocale( css::lang::Locale /*out */ &rLocale, const String &rLookUpString, xub_StrLen nDelimPos );
+
+ // returns true if the locale is upported by the theasaurus
+ bool IsSupportedLocale( const css::lang::Locale & rLocale ) const;
+
+ // get the first nMax Synonym entries, even if different meanings need to be evaluated
+ bool GetMeanings( std::vector< ::rtl::OUString > & rSynonyms, const ::rtl::OUString & rWord, const css::lang::Locale & rLocale, sal_Int16 nMaxSynonms );
+
+ String GetThesImplName( const css::lang::Locale &rLocale ) const;
+};
+
+////////////////////////////////////////////////////////////
+
+
+#endif
+
+
diff --git a/sfx2/source/view/impviewframe.hxx b/sfx2/source/view/impviewframe.hxx
index 5460d613c7e8..abe4cb6852d9 100644
--- a/sfx2/source/view/impviewframe.hxx
+++ b/sfx2/source/view/impviewframe.hxx
@@ -31,6 +31,8 @@
#include <svtools/asynclink.hxx>
#include <vcl/window.hxx>
+#include <boost/optional.hpp>
+
struct SfxViewFrame_Impl
{
SvBorder aBorder;
@@ -56,6 +58,8 @@ struct SfxViewFrame_Impl
sal_Bool bWindowWasEnabled:1;
sal_Bool bActive;
String aFactoryName;
+ ::boost::optional< bool >
+ aHasToolPanels;
SfxViewFrame_Impl( SfxFrame& i_rFrame )
: rFrame( i_rFrame )
diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index 6d61f4182bbb..328d88d8b2b9 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -131,6 +131,8 @@ public:
, m_bResizeNoScale( sal_False )
{}
+ ~SfxInPlaceClient_Impl();
+
void SizeHasChanged();
DECL_LINK (TimerHdl, Timer*);
uno::Reference < frame::XFrame > GetFrame() const;
@@ -168,6 +170,10 @@ public:
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
};
+SfxInPlaceClient_Impl::~SfxInPlaceClient_Impl()
+{
+}
+
void SAL_CALL SfxInPlaceClient_Impl::changingState(
const ::com::sun::star::lang::EventObject& /*aEvent*/,
::sal_Int32 /*nOldState*/,
@@ -645,6 +651,7 @@ SfxInPlaceClient::SfxInPlaceClient( SfxViewShell* pViewShell, Window *pDraw, sal
m_pViewSh( pViewShell ),
m_pEditWin( pDraw )
{
+ m_pImp->acquire();
m_pImp->m_pClient = this;
m_pImp->m_nAspect = nAspect;
m_pImp->m_aScaleWidth = m_pImp->m_aScaleHeight = Fraction(1,1);
@@ -668,6 +675,7 @@ SfxInPlaceClient::~SfxInPlaceClient()
// the next call will destroy m_pImp if no other reference to it exists
m_pImp->m_xClient = uno::Reference < embed::XEmbeddedClient >();
+ m_pImp->release();
// TODO/LATER:
// the class is not intended to be used in multithreaded environment;
diff --git a/sfx2/source/view/view.hxx b/sfx2/source/view/view.hxx
deleted file mode 100644
index 20e542d90bc7..000000000000
--- a/sfx2/source/view/view.hxx
+++ /dev/null
@@ -1,27 +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.
- *
- ************************************************************************/
-
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 1cd34d41ed8b..ea2af12ab258 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -40,6 +40,7 @@
#include <vcl/splitwin.hxx>
#include <unotools/moduleoptions.hxx>
#include <svl/intitem.hxx>
+#include <svl/visitem.hxx>
#include <svl/stritem.hxx>
#include <svl/eitem.hxx>
#include <svl/slstitm.hxx>
@@ -76,6 +77,8 @@
#include <comphelper/componentcontext.hxx>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/configurationhelper.hxx>
+#include <comphelper/docpasswordrequest.hxx>
+#include <comphelper/docpasswordhelper.hxx>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/ucb/XContent.hpp>
@@ -87,9 +90,11 @@
#include <comphelper/storagehelper.hxx>
#include <svtools/asynclink.hxx>
#include <svl/sharecontrolfile.hxx>
-#include <svl/svtools.hrc>
+#include <svtools/svtools.hrc>
#include <svtools/svtdata.hxx>
+#include <boost/optional.hpp>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ucb;
@@ -104,6 +109,7 @@ namespace css = ::com::sun::star;
// wg. ViewFrame::Current
#include "appdata.hxx"
+#include <sfx2/taskpane.hxx>
#include <sfx2/app.hxx>
#include <sfx2/objface.hxx>
#include "openflag.hxx"
@@ -165,6 +171,69 @@ TYPEINIT1(SfxViewFrameItem, SfxPoolItem);
//=========================================================================
//-------------------------------------------------------------------------
+namespace
+{
+ bool moduleHasToolPanels( SfxViewFrame_Impl& i_rViewFrameImpl )
+ {
+ if ( !i_rViewFrameImpl.aHasToolPanels )
+ {
+ i_rViewFrameImpl.aHasToolPanels.reset( ::sfx2::ModuleTaskPane::ModuleHasToolPanels(
+ i_rViewFrameImpl.rFrame.GetFrameInterface() ) );
+ }
+ return *i_rViewFrameImpl.aHasToolPanels;
+ }
+}
+
+//-------------------------------------------------------------------------
+static sal_Bool AskPasswordToModify_Impl( const uno::Reference< task::XInteractionHandler >& xHandler, const ::rtl::OUString& aPath, const SfxFilter* pFilter, sal_uInt32 nPasswordHash, const uno::Sequence< beans::PropertyValue > aInfo )
+{
+ // TODO/LATER: In future the info should replace the direct hash completely
+ sal_Bool bResult = ( !nPasswordHash && !aInfo.getLength() );
+
+ OSL_ENSURE( pFilter && ( pFilter->GetFilterFlags() & SFX_FILTER_PASSWORDTOMODIFY ), "PasswordToModify feature is active for a filter that does not support it!" );
+
+ if ( pFilter && xHandler.is() )
+ {
+ sal_Bool bCancel = sal_False;
+ sal_Bool bFirstTime = sal_True;
+
+ while ( !bResult && !bCancel )
+ {
+ sal_Bool bMSType = !pFilter->IsOwnFormat();
+
+ ::rtl::Reference< ::comphelper::DocPasswordRequest > pPasswordRequest(
+ new ::comphelper::DocPasswordRequest(
+ bMSType ? ::comphelper::DocPasswordRequestType_MS : ::comphelper::DocPasswordRequestType_STANDARD,
+ bFirstTime ? ::com::sun::star::task::PasswordRequestMode_PASSWORD_ENTER : ::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER,
+ aPath,
+ sal_True ) );
+
+ uno::Reference< com::sun::star::task::XInteractionRequest > rRequest( pPasswordRequest.get() );
+ xHandler->handle( rRequest );
+
+ if ( pPasswordRequest->isPassword() )
+ {
+ if ( aInfo.getLength() )
+ {
+ bResult = ::comphelper::DocPasswordHelper::IsModifyPasswordCorrect( pPasswordRequest->getPasswordToModify(), aInfo );
+ }
+ else
+ {
+ // the binary format
+ bResult = ( SfxMedium::CreatePasswordToModifyHash( pPasswordRequest->getPasswordToModify(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ).equals( pFilter->GetServiceName() ) ) == nPasswordHash );
+ }
+ }
+ else
+ bCancel = sal_True;
+
+ bFirstTime = sal_False;
+ }
+ }
+
+ return bResult;
+}
+
+//-------------------------------------------------------------------------
void SfxViewFrame::SetDowning_Impl()
{
pImp->bIsDowning = sal_True;
@@ -303,10 +372,11 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
if( !pSh || !pSh->HasName() || !(pSh->Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ))
break;
+ SfxMedium* pMed = pSh->GetMedium();
+
SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pItem, SfxBoolItem, SID_VIEWONLY, sal_False );
if ( pItem && pItem->GetValue() )
{
- SfxMedium* pMed = pSh->GetMedium();
SfxApplication* pApp = SFX_APP();
SfxAllItemSet aSet( pApp->GetPool() );
aSet.Put( SfxStringItem( SID_FILE_NAME, pMed->GetURLObject().GetMainURL(INetURLObject::NO_DECODE) ) );
@@ -338,17 +408,38 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// Speichern und Readonly Reloaden
if( pSh->IsModified() )
{
- if ( !pSh->PrepareClose() )
+ if ( pSh->PrepareClose() )
+ {
+ // the storing could let the medium be changed
+ pMed = pSh->GetMedium();
+ bNeedsReload = sal_True;
+ }
+ else
{
rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), sal_False ) );
return;
}
- else bNeedsReload = sal_True;
}
nOpenMode = SFX_STREAM_READONLY;
}
else
{
+ if ( pSh->IsReadOnlyMedium()
+ && ( pSh->GetModifyPasswordHash() || pSh->GetModifyPasswordInfo().getLength() )
+ && !pSh->IsModifyPasswordEntered() )
+ {
+ ::rtl::OUString aDocumentName = INetURLObject( pMed->GetOrigURL() ).GetMainURL( INetURLObject::DECODE_WITH_CHARSET );
+ if( !AskPasswordToModify_Impl( pMed->GetInteractionHandler(), aDocumentName, pMed->GetOrigFilter(), pSh->GetModifyPasswordHash(), pSh->GetModifyPasswordInfo() ) )
+ {
+ // this is a read-only document, if it has "Password to modify"
+ // the user should enter password before he can edit the document
+ rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), sal_False ) );
+ return;
+ }
+
+ pSh->SetModifyPasswordEntered();
+ }
+
nOpenMode = SFX_STREAM_READWRITE;
pSh->SetReadOnlyUI( sal_False );
@@ -368,130 +459,113 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
}
// doing
- if( pSh )
+
+ String aTemp;
+ utl::LocalFileHelper::ConvertPhysicalNameToURL( pMed->GetPhysicalName(), aTemp );
+ INetURLObject aPhysObj( aTemp );
+ SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(),
+ pVersionItem, SfxInt16Item, SID_VERSION, sal_False );
+
+ INetURLObject aMedObj( pMed->GetName() );
+
+ // the logic below is following, if the document seems not to need to be reloaded and the physical name is different
+ // to the logical one, then on file system it can be checked that the copy is still newer than the original and no document reload is required
+ if ( ( !bNeedsReload && ( (aMedObj.GetProtocol() == INET_PROT_FILE &&
+ aMedObj.getFSysPath(INetURLObject::FSYS_DETECT) != aPhysObj.getFSysPath(INetURLObject::FSYS_DETECT) &&
+ !::utl::UCBContentHelper::IsYounger( aMedObj.GetMainURL( INetURLObject::NO_DECODE ), aPhysObj.GetMainURL( INetURLObject::NO_DECODE ) ))
+ || pMed->IsRemote() ) )
+ || pVersionItem )
{
- SfxMedium* pMed = pSh->GetMedium();
- String aTemp;
- utl::LocalFileHelper::ConvertPhysicalNameToURL( pMed->GetPhysicalName(), aTemp );
- INetURLObject aPhysObj( aTemp );
- SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(),
- pVersionItem, SfxInt16Item, SID_VERSION, sal_False );
-
- INetURLObject aMedObj( pMed->GetName() );
-
- // the logic below is following, if the document seems not to need to be reloaded and the physical name is different
- // to the logical one, then on file system it can be checked that the copy is still newer than the original and no document reload is required
- if ( ( !bNeedsReload && ( (aMedObj.GetProtocol() == INET_PROT_FILE &&
- aMedObj.getFSysPath(INetURLObject::FSYS_DETECT) != aPhysObj.getFSysPath(INetURLObject::FSYS_DETECT) &&
- !::utl::UCBContentHelper::IsYounger( aMedObj.GetMainURL( INetURLObject::NO_DECODE ), aPhysObj.GetMainURL( INetURLObject::NO_DECODE ) ))
- || pMed->IsRemote() ) )
- || pVersionItem )
+ sal_Bool bOK = sal_False;
+ if ( !pVersionItem )
{
- sal_Bool bOK = sal_False;
- if ( !pVersionItem )
+ sal_Bool bHasStorage = pMed->HasStorage_Impl();
+ // switching edit mode could be possible without reload
+ if ( bHasStorage && pMed->GetStorage() == pSh->GetStorage() )
{
- sal_Bool bHasStorage = pMed->HasStorage_Impl();
- // switching edit mode could be possible without reload
- if ( bHasStorage && pMed->GetStorage() == pSh->GetStorage() )
- {
- // TODO/LATER: faster creation of copy
- if ( !pSh->ConnectTmpStorage_Impl( pMed->GetStorage(), pMed ) )
- return;
- }
+ // TODO/LATER: faster creation of copy
+ if ( !pSh->ConnectTmpStorage_Impl( pMed->GetStorage(), pMed ) )
+ return;
+ }
- pMed->CloseAndRelease();
- pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & STREAM_WRITE ) ) );
- pMed->SetOpenMode( nOpenMode, pMed->IsDirect() );
+ pMed->CloseAndRelease();
+ pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & STREAM_WRITE ) ) );
+ pMed->SetOpenMode( nOpenMode, pMed->IsDirect() );
- pMed->CompleteReOpen();
- if ( nOpenMode & STREAM_WRITE )
- pMed->LockOrigFileOnDemand( sal_False, sal_True );
+ pMed->CompleteReOpen();
+ if ( nOpenMode & STREAM_WRITE )
+ pMed->LockOrigFileOnDemand( sal_False, sal_True );
- // LockOrigFileOnDemand might set the readonly flag itself, it should be set back
- pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & STREAM_WRITE ) ) );
+ // LockOrigFileOnDemand might set the readonly flag itself, it should be set back
+ pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & STREAM_WRITE ) ) );
- if ( !pMed->GetErrorCode() )
- bOK = sal_True;
- }
+ if ( !pMed->GetErrorCode() )
+ bOK = sal_True;
+ }
- if( !bOK )
+ if( !bOK )
+ {
+ ErrCode nErr = pMed->GetErrorCode();
+ if ( pVersionItem )
+ nErr = ERRCODE_IO_ACCESSDENIED;
+ else
{
- ErrCode nErr = pMed->GetErrorCode();
- if ( pVersionItem )
- nErr = ERRCODE_IO_ACCESSDENIED;
- else
- {
- pMed->ResetError();
- pMed->SetOpenMode( SFX_STREAM_READONLY, pMed->IsDirect() );
- pMed->ReOpen();
- pSh->DoSaveCompleted( pMed );
- }
+ pMed->ResetError();
+ pMed->SetOpenMode( SFX_STREAM_READONLY, pMed->IsDirect() );
+ pMed->ReOpen();
+ pSh->DoSaveCompleted( pMed );
+ }
- // r/o-Doc kann nicht in Editmode geschaltet werden?
- rReq.Done( sal_False );
+ // r/o-Doc kann nicht in Editmode geschaltet werden?
+ rReq.Done( sal_False );
- if ( nOpenMode == SFX_STREAM_READWRITE && !rReq.IsAPI() )
+ if ( nOpenMode == SFX_STREAM_READWRITE && !rReq.IsAPI() )
+ {
+ // dem ::com::sun::star::sdbcx::User anbieten, als Vorlage zu oeffnen
+ QueryBox aBox( &GetWindow(), SfxResId(MSG_QUERY_OPENASTEMPLATE) );
+ if ( RET_YES == aBox.Execute() )
{
- // dem ::com::sun::star::sdbcx::User anbieten, als Vorlage zu oeffnen
- QueryBox aBox( &GetWindow(), SfxResId(MSG_QUERY_OPENASTEMPLATE) );
- if ( RET_YES == aBox.Execute() )
+ SfxApplication* pApp = SFX_APP();
+ SfxAllItemSet aSet( pApp->GetPool() );
+ aSet.Put( SfxStringItem( SID_FILE_NAME, pMed->GetName() ) );
+ SFX_ITEMSET_ARG( pMed->GetItemSet(), pReferer, SfxStringItem, SID_REFERER, sal_False );
+ if ( pReferer )
+ aSet.Put( *pReferer );
+ aSet.Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
+ if ( pVersionItem )
+ aSet.Put( *pVersionItem );
+
+ if( pMed->GetFilter() )
{
- SfxApplication* pApp = SFX_APP();
- SfxAllItemSet aSet( pApp->GetPool() );
- aSet.Put( SfxStringItem( SID_FILE_NAME, pMed->GetName() ) );
- SFX_ITEMSET_ARG( pMed->GetItemSet(), pReferer, SfxStringItem, SID_REFERER, sal_False );
- if ( pReferer )
- aSet.Put( *pReferer );
- aSet.Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
- if ( pVersionItem )
- aSet.Put( *pVersionItem );
-
- if( pMed->GetFilter() )
- {
- aSet.Put( SfxStringItem( SID_FILTER_NAME, pMed->GetFilter()->GetFilterName() ) );
- SFX_ITEMSET_ARG( pMed->GetItemSet(), pOptions,
- SfxStringItem, SID_FILE_FILTEROPTIONS, sal_False );
- if ( pOptions )
- aSet.Put( *pOptions );
- }
-
- GetDispatcher()->Execute( SID_OPENDOC, SFX_CALLMODE_ASYNCHRON, aSet );
- return;
+ aSet.Put( SfxStringItem( SID_FILTER_NAME, pMed->GetFilter()->GetFilterName() ) );
+ SFX_ITEMSET_ARG( pMed->GetItemSet(), pOptions,
+ SfxStringItem, SID_FILE_FILTEROPTIONS, sal_False );
+ if ( pOptions )
+ aSet.Put( *pOptions );
}
- else
- nErr = 0;
- }
- ErrorHandler::HandleError( nErr );
- rReq.SetReturnValue(
- SfxBoolItem( rReq.GetSlot(), sal_False ) );
- return;
- }
- else
- {
- pSh->DoSaveCompleted( pMed );
- pSh->Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) );
- rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), sal_True ) );
- rReq.Done( sal_True );
- // if( nOpenMode == SFX_STREAM_READONLY )
- // pMed->Close();
- return;
+ GetDispatcher()->Execute( SID_OPENDOC, SFX_CALLMODE_ASYNCHRON, aSet );
+ return;
+ }
+ else
+ nErr = 0;
}
- }
- /*
- if ( !bReload )
- {
- // Es soll nicht reloaded werden
- SfxErrorContext aEc( ERRCODE_SFX_NODOCRELOAD );
- ErrorHandler::HandleError( ERRCODE_SFX_NODOCRELOAD );
+ ErrorHandler::HandleError( nErr );
rReq.SetReturnValue(
SfxBoolItem( rReq.GetSlot(), sal_False ) );
return;
}
- */
- // Ansonsten ( lokal und arbeiten auf Kopie ) muss gereloaded
- // werden.
+ else
+ {
+ pSh->DoSaveCompleted( pMed );
+ pSh->Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) );
+ rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), sal_True ) );
+ rReq.Done( sal_True );
+ // if( nOpenMode == SFX_STREAM_READONLY )
+ // pMed->Close();
+ return;
+ }
}
rReq.AppendItem( SfxBoolItem( SID_FORCERELOAD, sal_True) );
@@ -671,6 +745,10 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
}
xNewObj = SfxObjectShell::CreateObject( pFilter->GetServiceName(), SFX_CREATE_MODE_STANDARD );
+
+ if ( xOldObj->IsModifyPasswordEntered() )
+ xNewObj->SetModifyPasswordEntered();
+
uno::Sequence < beans::PropertyValue > aLoadArgs;
TransformItems( SID_OPENDOC, *pNewSet, aLoadArgs );
try
@@ -726,6 +804,12 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
}
else
{
+ if ( xNewObj->GetModifyPasswordHash() && xNewObj->GetModifyPasswordHash() != xOldObj->GetModifyPasswordHash() )
+ {
+ xNewObj->SetModifyPasswordEntered( sal_False );
+ xNewObj->SetReadOnly();
+ }
+
if ( xNewObj->IsDocShared() )
{
// the file is shared but the closing can change the sharing control file
@@ -738,10 +822,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
TransformItems( SID_OPENDOC, *xNewObj->GetMedium()->GetItemSet(), aLoadArgs );
UpdateDocument_Impl();
- }
- if ( xNewObj.Is() )
- {
try
{
while ( !aViewFrames.empty() )
@@ -934,7 +1015,7 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet )
if ( pShUndoMgr && pShUndoMgr->GetUndoActionCount() )
{
String aTmp( SvtResId( STR_UNDO ) );
- aTmp += pShUndoMgr->GetUndoActionComment(0);
+ aTmp+= pShUndoMgr->GetUndoActionComment(0);
rSet.Put( SfxStringItem( SID_UNDO, aTmp ) );
}
else
@@ -1506,7 +1587,7 @@ void SfxViewFrame::KillDispatcher_Impl()
//------------------------------------------------------------------------
SfxViewFrame* SfxViewFrame::Current()
{
- return SfxApplication::Is_Impl() ? SFX_APP()->Get_Impl()->pViewFrame : NULL;
+ return SfxApplication::Get() ? SFX_APP()->Get_Impl()->pViewFrame : NULL;
}
//--------------------------------------------------------------------
@@ -2058,9 +2139,7 @@ SfxViewShell* SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc
else
aTransformLoadArgs.remove( "Hidden" );
- ::rtl::OUString sURL( xDocument->getURL() );
- if ( !sURL.getLength() )
- sURL = i_rDoc.GetFactory().GetFactoryURL();
+ ::rtl::OUString sURL( RTL_CONSTASCII_USTRINGPARAM( "private:object" ) );
Reference< XComponentLoader > xLoader( i_rFrame, UNO_QUERY_THROW );
xLoader->loadComponentFromURL( sURL, ::rtl::OUString::createFromAscii( "_self" ), 0,
@@ -3290,6 +3369,22 @@ void SfxViewFrame::ChildWindowState( SfxItemSet& rState )
else if ( KnowsChildWindow(nSID) )
rState.Put( SfxBoolItem( nSID, HasChildWindow(nSID) ) );
}
+ else if ( nSID == SID_TASKPANE )
+ {
+ if ( !KnowsChildWindow( nSID ) )
+ {
+ OSL_ENSURE( false, "SID_TASKPANE state requested, but no task pane child window exists for this ID!" );
+ rState.DisableItem( nSID );
+ }
+ else if ( !moduleHasToolPanels( *pImp ) )
+ {
+ rState.Put( SfxVisibilityItem( nSID, sal_False ) );
+ }
+ else
+ {
+ rState.Put( SfxBoolItem( nSID, HasChildWindow( nSID ) ) );
+ }
+ }
else if ( KnowsChildWindow(nSID) )
rState.Put( SfxBoolItem( nSID, HasChildWindow(nSID) ) );
else
@@ -3377,3 +3472,37 @@ void SfxViewFrame::SetViewFrame( SfxViewFrame* pFrame )
{
SFX_APP()->SetViewFrame_Impl( pFrame );
}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void SfxViewFrame::ActivateToolPanel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, const ::rtl::OUString& i_rPanelURL )
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+
+ // look up the SfxFrame for the given XFrame
+ SfxFrame* pFrame = NULL;
+ for ( pFrame = SfxFrame::GetFirst(); pFrame; pFrame = SfxFrame::GetNext( *pFrame ) )
+ {
+ if ( pFrame->GetFrameInterface() == i_rFrame )
+ break;
+ }
+ SfxViewFrame* pViewFrame = pFrame ? pFrame->GetCurrentViewFrame() : NULL;
+ ENSURE_OR_RETURN_VOID( pViewFrame != NULL, "SfxViewFrame::ActivateToolPanel: did not find an SfxFrame for the given XFrame!" );
+
+ pViewFrame->ActivateToolPanel_Impl( i_rPanelURL );
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void SfxViewFrame::ActivateToolPanel_Impl( const ::rtl::OUString& i_rPanelURL )
+{
+ // ensure the task pane is visible
+ ENSURE_OR_RETURN_VOID( KnowsChildWindow( SID_TASKPANE ), "SfxViewFrame::ActivateToolPanel: this frame/module does not allow for a task pane!" );
+ if ( !HasChildWindow( SID_TASKPANE ) )
+ ToggleChildWindow( SID_TASKPANE );
+
+ SfxChildWindow* pTaskPaneChildWindow = GetChildWindow( SID_TASKPANE );
+ ENSURE_OR_RETURN_VOID( pTaskPaneChildWindow, "SfxViewFrame::ActivateToolPanel_Impl: just switched it on, but it is not there!" );
+
+ ::sfx2::ITaskPaneToolPanelAccess* pPanelAccess = dynamic_cast< ::sfx2::ITaskPaneToolPanelAccess* >( pTaskPaneChildWindow );
+ ENSURE_OR_RETURN_VOID( pPanelAccess, "SfxViewFrame::ActivateToolPanel_Impl: task pane child window does not implement a required interface!" );
+ pPanelAccess->ActivateToolPanel( i_rPanelURL );
+}
diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx
index 69ce837fb023..1c9e219cf180 100644
--- a/sfx2/source/view/viewimp.hxx
+++ b/sfx2/source/view/viewimp.hxx
@@ -30,20 +30,16 @@
// include ---------------------------------------------------------------
-#ifndef __SBX_SBXOBJ_HXX
#include <basic/sbxobj.hxx>
-#endif
#include <sfx2/viewsh.hxx>
#include <sfx2/viewfrm.hxx> // SvBorder
#include <osl/mutex.hxx>
#include <cppuhelper/interfacecontainer.hxx>
-
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <svtools/acceleratorexecute.hxx>
-
#include <rtl/ref.hxx>
-
+#include <vcl/print.hxx>
#include <queue>
// forward ---------------------------------------------------------------
@@ -54,24 +50,6 @@ class SfxBaseController;
typedef SfxShell* SfxShellPtr_Impl;
SV_DECL_PTRARR( SfxShellArr_Impl, SfxShellPtr_Impl, 4, 4 )
-// struct SfxViewShell_Impl ----------------------------------------------
-#if 0
-class SfxAsyncPrintExec_Impl : public SfxListener
-{
- SfxViewShell* pView;
- ::std::queue < SfxRequest*> aReqs;
-
- virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
-
-public:
- SfxAsyncPrintExec_Impl( SfxViewShell* pShell)
- : pView( pShell )
- {}
-
- void AddRequest( SfxRequest& rReq );
-};
-#endif
-
class SfxClipboardChangeListener;
struct SfxViewShell_Impl
@@ -95,9 +73,9 @@ struct SfxViewShell_Impl
USHORT nFamily;
SfxBaseController* pController;
::svt::AcceleratorExecute* pAccExec;
-// SfxAsyncPrintExec_Impl* pPrinterCommandQueue;
com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aPrintOpts;
::rtl::Reference< SfxClipboardChangeListener > xClipboardListener;
+ vcl::PrinterController* pPrinterController;
SfxViewShell_Impl();
};
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 93d6dc19faf0..8255bed82592 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -129,28 +129,6 @@ SfxPrinterController::SfxPrinterController( const Any& i_rComplete,
StartListening( *mpViewShell );
mpObjectShell = mpViewShell->GetObjectShell();
StartListening( *mpObjectShell );
- m_bOrigStatus = mpObjectShell->IsEnableSetModified();
-
- // check configuration: shall update of printing information in DocInfo set the document to "modified"?
- if ( m_bOrigStatus && !SvtPrintWarningOptions().IsModifyDocumentOnPrintingAllowed() )
- {
- mpObjectShell->EnableSetModified( sal_False );
- m_bNeedsChange = sal_True;
- }
-
- // refresh document info
- uno::Reference<document::XDocumentProperties> xDocProps(mpObjectShell->getDocProperties());
- m_aLastPrintedBy = xDocProps->getPrintedBy();
- m_aLastPrinted = xDocProps->getPrintDate();
-
- xDocProps->setPrintedBy( mpObjectShell->IsUseUserData()
- ? ::rtl::OUString( SvtUserOptions().GetFullName() )
- : ::rtl::OUString() );
- ::DateTime now;
-
- xDocProps->setPrintDate( util::DateTime(
- now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(),
- now.GetDay(), now.GetMonth(), now.GetYear() ) );
}
// initialize extra ui options
@@ -283,6 +261,29 @@ void SfxPrinterController::jobStarted()
{
if ( mpObjectShell )
{
+ m_bOrigStatus = mpObjectShell->IsEnableSetModified();
+
+ // check configuration: shall update of printing information in DocInfo set the document to "modified"?
+ if ( m_bOrigStatus && !SvtPrintWarningOptions().IsModifyDocumentOnPrintingAllowed() )
+ {
+ mpObjectShell->EnableSetModified( sal_False );
+ m_bNeedsChange = sal_True;
+ }
+
+ // refresh document info
+ uno::Reference<document::XDocumentProperties> xDocProps(mpObjectShell->getDocProperties());
+ m_aLastPrintedBy = xDocProps->getPrintedBy();
+ m_aLastPrinted = xDocProps->getPrintDate();
+
+ xDocProps->setPrintedBy( mpObjectShell->IsUseUserData()
+ ? ::rtl::OUString( SvtUserOptions().GetFullName() )
+ : ::rtl::OUString() );
+ ::DateTime now;
+
+ xDocProps->setPrintDate( util::DateTime(
+ now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(),
+ now.GetDay(), now.GetMonth(), now.GetYear() ) );
+
// FIXME: how to get all print options incl. AdditionalOptions easily?
uno::Sequence < beans::PropertyValue > aOpts;
mpObjectShell->Broadcast( SfxPrintingHint( view::PrintableState_JOB_STARTED, aOpts ) );
@@ -329,6 +330,9 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
if ( m_bNeedsChange )
mpObjectShell->EnableSetModified( m_bOrigStatus );
+
+ if ( mpViewShell )
+ mpViewShell->pImp->pPrinterController = 0;
}
}
@@ -639,6 +643,8 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro
this,
rProps
) );
+ pImp->pPrinterController = pController.get();
+
SfxObjectShell *pObjShell = GetObjectShell();
pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JobName" ) ),
makeAny( rtl::OUString( pObjShell->GetTitle(0) ) ) );
@@ -653,6 +659,11 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro
Printer::PrintJob( pController, aJobSetup );
}
+Printer* SfxViewShell::GetActivePrinter() const
+{
+ return pImp->pPrinterController ? pImp->pPrinterController->getPrinter().get() : 0;
+}
+
void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
{
// USHORT nCopies=1;
diff --git a/sfx2/util/hidother.src b/sfx2/util/hidother.src
index 72b178b2d629..38e5577a72be 100644
--- a/sfx2/util/hidother.src
+++ b/sfx2/util/hidother.src
@@ -165,3 +165,6 @@ hidspecial HID_DID_SAVE_PACKED_XML { HelpID = HID_DID_SAVE_PACKED_X
hidspecial HID_HELP_ONHELP { HelpID = HID_HELP_ONHELP; };
hidspecial HID_HELP_TEXT_SELECTION_MODE { HelpID = HID_HELP_TEXT_SELECTION_MODE; };
hidspecial HID_DLG_CHECKFORONLINEUPDATE { HelpID = HID_DLG_CHECKFORONLINEUPDATE; };
+hidspecial HID_DOCINFOSECURITY { HelpID = HID_DOCINFOSECURITY; };
+hidspecial HID_TASKPANE_VIEW_MENU { HelpID = HID_TASKPANE_VIEW_MENU; };
+
diff --git a/sfx2/win/res/expdesk.ico b/sfx2/win/res/expdesk.ico
deleted file mode 100644
index 06fb6e712e89..000000000000
--- a/sfx2/win/res/expdesk.ico
+++ /dev/null
Binary files differ
diff --git a/sfx2/win/res/expexp.ico b/sfx2/win/res/expexp.ico
deleted file mode 100644
index e0643765f605..000000000000
--- a/sfx2/win/res/expexp.ico
+++ /dev/null
Binary files differ
diff --git a/sfx2/win/res/expfld.ico b/sfx2/win/res/expfld.ico
deleted file mode 100644
index aeefecbdad51..000000000000
--- a/sfx2/win/res/expfld.ico
+++ /dev/null
Binary files differ
diff --git a/sfx2/win/res/expftp.ico b/sfx2/win/res/expftp.ico
deleted file mode 100644
index e1a442067d35..000000000000
--- a/sfx2/win/res/expftp.ico
+++ /dev/null
Binary files differ
diff --git a/sfx2/win/res/exptrash.ico b/sfx2/win/res/exptrash.ico
deleted file mode 100644
index 5c3e956863c3..000000000000
--- a/sfx2/win/res/exptrash.ico
+++ /dev/null
Binary files differ
diff --git a/sfx2/win/res/expwork.ico b/sfx2/win/res/expwork.ico
deleted file mode 100644
index 93fe39c7a492..000000000000
--- a/sfx2/win/res/expwork.ico
+++ /dev/null
Binary files differ
diff --git a/sfx2/win/res/frameset.ico b/sfx2/win/res/frameset.ico
deleted file mode 100644
index c9546f1e4d40..000000000000
--- a/sfx2/win/res/frameset.ico
+++ /dev/null
Binary files differ
diff --git a/sfx2/win/res/search.ico b/sfx2/win/res/search.ico
deleted file mode 100644
index 13e96131e3b8..000000000000
--- a/sfx2/win/res/search.ico
+++ /dev/null
Binary files differ
diff --git a/sfx2/workben/custompanel/CalcWindowState.xcu b/sfx2/workben/custompanel/CalcWindowState.xcu
new file mode 100644
index 000000000000..17629c0bf698
--- /dev/null
+++ b/sfx2/workben/custompanel/CalcWindowState.xcu
@@ -0,0 +1,21 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<oor:component-data oor:name="CalcWindowState" oor:package="org.openoffice.Office.UI" xmlns:install="http://openoffice.org/2004/installation" 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="UIElements">
+ <node oor:name="States">
+ <node oor:name="private:resource/toolpanel/org.openoffice.example.colorpanel/0000FF" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value>Soylent Blue</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="ImageURL" oor:type="xs:string">
+ <value>vnd.sun.star.extension://UPDATED_IDENTIFIER/panel.png</value>
+ </prop>
+ <prop oor:name="HelpURL" oor:type="xs:string">
+ <value>vnd.sun.star.help://UPDATED_IDENTIFIER/colorpanel</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/sfx2/workben/custompanel/DrawWindowState.xcu b/sfx2/workben/custompanel/DrawWindowState.xcu
new file mode 100644
index 000000000000..6037a3f5a083
--- /dev/null
+++ b/sfx2/workben/custompanel/DrawWindowState.xcu
@@ -0,0 +1,21 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<oor:component-data oor:name="DrawWindowState" oor:package="org.openoffice.Office.UI" xmlns:install="http://openoffice.org/2004/installation" 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="UIElements">
+ <node oor:name="States">
+ <node oor:name="private:resource/toolpanel/org.openoffice.example.colorpanel/FFFF00" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value>Soylent Yellow</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="ImageURL" oor:type="xs:string">
+ <value>vnd.sun.star.extension://UPDATED_IDENTIFIER/panel.png</value>
+ </prop>
+ <prop oor:name="HelpURL" oor:type="xs:string">
+ <value>vnd.sun.star.help://UPDATED_IDENTIFIER/colorpanel</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/sfx2/workben/custompanel/Factories.xcu b/sfx2/workben/custompanel/Factories.xcu
new file mode 100644
index 000000000000..f8df23e9f40a
--- /dev/null
+++ b/sfx2/workben/custompanel/Factories.xcu
@@ -0,0 +1,21 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<oor:component-data oor:name="Factories" 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="Registered">
+ <node oor:name="UIElementFactories">
+ <node oor:name="org.openoffice.example.CustomToolPanel" oor:op="replace">
+ <prop oor:name="Type">
+ <value>toolpanel</value>
+ </prop>
+ <prop oor:name="Name">
+ <value>org.openoffice.example.colorpanel</value>
+ </prop>
+ <prop oor:name="Module">
+ <value/>
+ </prop>
+ <prop oor:name="FactoryImplementation">
+ <value>org.openoffice.example.colorpanel.ToolPanelFactory</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/sfx2/workben/custompanel/ImpressWindowState.xcu b/sfx2/workben/custompanel/ImpressWindowState.xcu
new file mode 100644
index 000000000000..a8fea859bbab
--- /dev/null
+++ b/sfx2/workben/custompanel/ImpressWindowState.xcu
@@ -0,0 +1,21 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<oor:component-data oor:name="ImpressWindowState" oor:package="org.openoffice.Office.UI" xmlns:install="http://openoffice.org/2004/installation" 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="UIElements">
+ <node oor:name="States">
+ <node oor:name="private:resource/toolpanel/org.openoffice.example.colorpanel/FFCC99" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value>Soylent Orange</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="ImageURL" oor:type="xs:string">
+ <value>vnd.sun.star.extension://UPDATED_IDENTIFIER/panel.png</value>
+ </prop>
+ <prop oor:name="HelpURL" oor:type="xs:string">
+ <value>vnd.sun.star.help://UPDATED_IDENTIFIER/colorpanel</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/sfx2/workben/custompanel/WriterWindowState.xcu b/sfx2/workben/custompanel/WriterWindowState.xcu
new file mode 100644
index 000000000000..248a2e14a3f4
--- /dev/null
+++ b/sfx2/workben/custompanel/WriterWindowState.xcu
@@ -0,0 +1,35 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<oor:component-data oor:name="WriterWindowState" oor:package="org.openoffice.Office.UI" xmlns:install="http://openoffice.org/2004/installation" 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="UIElements">
+ <node oor:name="States">
+ <node oor:name="private:resource/toolpanel/org.openoffice.example.colorpanel/00FF00" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value>Soylent Green</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="ImageURL" oor:type="xs:string">
+ <value>vnd.sun.star.extension://UPDATED_IDENTIFIER/panel.png</value>
+ </prop>
+ <prop oor:name="HelpURL" oor:type="xs:string">
+ <value>vnd.sun.star.help://UPDATED_IDENTIFIER/colorpanel</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolpanel/org.openoffice.example.colorpanel/FF0000" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value>Soylent Red</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ <prop oor:name="ImageURL" oor:type="xs:string">
+ <value>vnd.sun.star.extension://UPDATED_IDENTIFIER/panel.png</value>
+ </prop>
+ <prop oor:name="HelpURL" oor:type="xs:string">
+ <value>vnd.sun.star.help://UPDATED_IDENTIFIER/colorpanel</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/sfx2/workben/custompanel/ctp_factory.cxx b/sfx2/workben/custompanel/ctp_factory.cxx
new file mode 100644
index 000000000000..54880cc5fcc7
--- /dev/null
+++ b/sfx2/workben/custompanel/ctp_factory.cxx
@@ -0,0 +1,167 @@
+/*************************************************************************
+ * 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_sfx2.hxx"
+
+#include "ctp_factory.hxx"
+#include "ctp_panel.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/NotInitializedException.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+/** === end UNO includes === **/
+
+//......................................................................................................................
+namespace sd { namespace colortoolpanel
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::uno::XComponentContext;
+ using ::com::sun::star::lang::NotInitializedException;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ using ::com::sun::star::lang::XComponent;
+ using ::com::sun::star::ui::XUIElement;
+ using ::com::sun::star::beans::PropertyValue;
+ using ::com::sun::star::container::NoSuchElementException;
+ using ::com::sun::star::beans::PropertyValue;
+ using ::com::sun::star::awt::XWindow;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= ToolPanelFactory
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ ToolPanelFactory::ToolPanelFactory( const Reference< XComponentContext >& i_rContext )
+ :m_xContext( i_rContext )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ToolPanelFactory::~ToolPanelFactory()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XUIElement > SAL_CALL ToolPanelFactory::createUIElement( const ::rtl::OUString& i_rResourceURL, const Sequence< PropertyValue >& i_rArgs ) throw (NoSuchElementException, IllegalArgumentException, RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ if ( !i_rResourceURL.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "private:resource/toolpanel/org.openoffice.example.colorpanel/" ) ) )
+ throw NoSuchElementException( i_rResourceURL, *this );
+
+ const ::rtl::OUString sColor( i_rResourceURL.copy( i_rResourceURL.lastIndexOf( '/' ) + 1 ) );
+ const sal_Int32 nPanelColor = sColor.toInt32( 16 );
+
+ // retrieve the parent window
+ Reference< XWindow > xParentWindow;
+ const PropertyValue* pArg = i_rArgs.getConstArray();
+ const PropertyValue* pArgEnd = i_rArgs.getConstArray() + i_rArgs.getLength();
+ for ( ; pArg != pArgEnd; ++pArg )
+ {
+ if ( pArg->Name.equalsAscii( "ParentWindow" ) )
+ {
+ xParentWindow.set( pArg->Value, UNO_QUERY );
+ break;
+ }
+ }
+ if ( !xParentWindow.is() )
+ {
+ OSL_ENSURE( false, "ToolPanelFactory::createUIElement: no parent window in the args!" );
+ throw IllegalArgumentException(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "No parent window provided in the creation arguments. Cannot create tool panel." ) ),
+ *this,
+ 2
+ );
+ }
+
+ /// create the panel
+ Reference< XUIElement > xUIElement( new PanelUIElement( m_xContext, xParentWindow, i_rResourceURL, nPanelColor ) );
+ return xUIElement;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL ToolPanelFactory::getImplementationName( ) throw (RuntimeException)
+ {
+ return getImplementationName_static();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL ToolPanelFactory::getImplementationName_static( ) throw (RuntimeException)
+ {
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.comp.example.custompanel.ToolPanelFactory" ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL ToolPanelFactory::supportsService( const ::rtl::OUString& i_rServiceName ) throw (RuntimeException)
+ {
+ const Sequence< ::rtl::OUString > aServiceNames( getSupportedServiceNames() );
+ for ( const ::rtl::OUString* serviceName = aServiceNames.getConstArray();
+ serviceName != aServiceNames.getConstArray() + aServiceNames.getLength();
+ ++serviceName
+ )
+ {
+ if ( i_rServiceName == *serviceName )
+ return sal_True;
+ }
+ return sal_False;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL ToolPanelFactory::getSupportedServiceNames() throw (RuntimeException)
+ {
+ return getSupportedServiceNames_static();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL ToolPanelFactory::getSupportedServiceNames_static() throw (RuntimeException)
+ {
+ Sequence< ::rtl::OUString > aServiceNames(1);
+ aServiceNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.example.colorpanel.ToolPanelFactory" ) );
+ return aServiceNames;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XInterface > SAL_CALL ToolPanelFactory::Create( const Reference< XComponentContext >& i_rContext ) throw (RuntimeException)
+ {
+ return *( new ToolPanelFactory( i_rContext ) );
+ }
+
+//......................................................................................................................
+} } // namespace sd::colortoolpanel
+//......................................................................................................................
diff --git a/sfx2/workben/custompanel/ctp_factory.hxx b/sfx2/workben/custompanel/ctp_factory.hxx
new file mode 100644
index 000000000000..8a359f59caaf
--- /dev/null
+++ b/sfx2/workben/custompanel/ctp_factory.hxx
@@ -0,0 +1,83 @@
+/*************************************************************************
+ * 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 SD_WORKBENCH_CTP_FACTORY_HXX
+#define SD_WORKBENCH_CTP_FACTORY_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/ui/XUIElementFactory.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/basemutex.hxx>
+
+//......................................................................................................................
+namespace sd { namespace colortoolpanel
+{
+//......................................................................................................................
+
+ class FactoryGuard;
+
+ //==================================================================================================================
+ //= ToolPanelFactory
+ //==================================================================================================================
+ typedef ::cppu::WeakImplHelper2 < ::com::sun::star::ui::XUIElementFactory
+ , ::com::sun::star::lang::XServiceInfo
+ > ToolPanelFactory_Base;
+ class ToolPanelFactory :public ::cppu::BaseMutex
+ ,public ToolPanelFactory_Base
+ {
+ public:
+ ToolPanelFactory(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext
+ );
+ ~ToolPanelFactory();
+
+ // XUIElementFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement > SAL_CALL createUIElement( const ::rtl::OUString& i_rResourceURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_rArgs ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::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);
+
+ // XServiceInfo - static versions
+ static ::rtl::OUString SAL_CALL getImplementationName_static( ) throw (::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_static( ) throw (::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext ) throw (::com::sun::star::uno::RuntimeException);
+
+ private:
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ m_xContext;
+ };
+
+//......................................................................................................................
+} } // namespace sd::colortoolpanel
+//......................................................................................................................
+
+#endif // SD_WORKBENCH_CTP_FACTORY_HXX
diff --git a/sfx2/workben/custompanel/ctp_panel.cxx b/sfx2/workben/custompanel/ctp_panel.cxx
new file mode 100644
index 000000000000..ee94287bedbf
--- /dev/null
+++ b/sfx2/workben/custompanel/ctp_panel.cxx
@@ -0,0 +1,270 @@
+/*************************************************************************
+ * 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_sfx2.hxx"
+
+#include "ctp_panel.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/awt/XWindowPeer.hpp>
+#include <com/sun/star/awt/XToolkit.hpp>
+#include <com/sun/star/awt/WindowClass.hpp>
+#include <com/sun/star/awt/WindowAttribute.hpp>
+#include <com/sun/star/awt/PosSize.hpp>
+#include <com/sun/star/awt/XDevice.hpp>
+#include <com/sun/star/awt/XGraphics.hpp>
+#include <com/sun/star/ui/UIElementType.hpp>
+/** === end UNO includes === **/
+
+#include <tools/diagnose_ex.h>
+
+//......................................................................................................................
+namespace sd { namespace colortoolpanel
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::uno::XComponentContext;
+ using ::com::sun::star::awt::XWindow;
+ using ::com::sun::star::lang::DisposedException;
+ using ::com::sun::star::awt::XWindowPeer;
+ using ::com::sun::star::lang::XMultiComponentFactory;
+ using ::com::sun::star::awt::XToolkit;
+ using ::com::sun::star::awt::WindowDescriptor;
+ using ::com::sun::star::awt::WindowClass_SIMPLE;
+ using ::com::sun::star::awt::Rectangle;
+ using ::com::sun::star::awt::PaintEvent;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::awt::XDevice;
+ using ::com::sun::star::awt::XGraphics;
+ using ::com::sun::star::accessibility::XAccessible;
+ using ::com::sun::star::frame::XFrame;
+ /** === end UNO using === **/
+ namespace WindowAttribute = ::com::sun::star::awt::WindowAttribute;
+ namespace PosSize = ::com::sun::star::awt::PosSize;
+ namespace UIElementType = ::com::sun::star::ui::UIElementType;
+
+ //==================================================================================================================
+ //= helpers
+ //==================================================================================================================
+ namespace
+ {
+ Reference< XWindow > lcl_createPlainWindow_nothrow( const Reference< XComponentContext >& i_rContext,
+ const Reference< XWindowPeer >& i_rParentWindow )
+ {
+ try
+ {
+ ENSURE_OR_THROW( i_rContext.is(), "illegal component context" );
+ Reference< XMultiComponentFactory > xFactory( i_rContext->getServiceManager(), UNO_SET_THROW );
+ Reference< XToolkit > xToolkit( xFactory->createInstanceWithContext(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ),
+ i_rContext
+ ), UNO_QUERY_THROW );
+
+ WindowDescriptor aWindow;
+ aWindow.Type = WindowClass_SIMPLE;
+ aWindow.WindowServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "window" ) );
+ aWindow.Parent = i_rParentWindow;
+ aWindow.WindowAttributes = WindowAttribute::BORDER;
+
+ Reference< XWindowPeer > xWindow( xToolkit->createWindow( aWindow ), UNO_SET_THROW );
+ return Reference< XWindow >( xWindow, UNO_QUERY_THROW );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return NULL;
+ }
+ }
+ //==================================================================================================================
+ //= class SingleColorPanel
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ SingleColorPanel::SingleColorPanel( const Reference< XComponentContext >& i_rContext, const Reference< XWindow >& i_rParentWindow, const ::sal_Int32 i_nPanelColor )
+ :SingleColorPanel_Base( m_aMutex )
+ ,m_xWindow()
+ ,m_nPanelColor( i_nPanelColor )
+ {
+ // retrieve the parent window for our to-be-created pane window
+ Reference< XWindowPeer > xParentPeer( i_rParentWindow, UNO_QUERY );
+
+ osl_incrementInterlockedCount( &m_refCount );
+ if ( xParentPeer.is() )
+ {
+ m_xWindow = lcl_createPlainWindow_nothrow( i_rContext, xParentPeer );
+ m_xWindow->addPaintListener( this );
+ if ( m_xWindow.is() )
+ {
+ const Rectangle aPanelAnchorSize( i_rParentWindow->getPosSize() );
+ m_xWindow->setPosSize( 0, 0, aPanelAnchorSize.Width, aPanelAnchorSize.Height, PosSize::POSSIZE );
+ m_xWindow->setVisible( sal_True );
+ }
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ SingleColorPanel::~SingleColorPanel()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XWindow > SAL_CALL SingleColorPanel::getWindow() throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xWindow.is() )
+ throw DisposedException( ::rtl::OUString(), *this );
+ return m_xWindow;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XAccessible > SAL_CALL SingleColorPanel::createAccessible( const Reference< XAccessible >& i_rParentAccessible ) throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xWindow.is() )
+ throw DisposedException( ::rtl::OUString(), *this );
+
+ // TODO: the following is wrong, since it doesn't respect i_rParentAccessible. In a real extension, you should
+ // implement this correctly :)
+ (void)i_rParentAccessible;
+ return Reference< XAccessible >( getWindow(), UNO_QUERY );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SingleColorPanel::windowPaint( const PaintEvent& i_rEvent ) throw (RuntimeException)
+ {
+ try
+ {
+ const Reference< XDevice > xDevice( i_rEvent.Source, UNO_QUERY_THROW );
+ const Reference< XGraphics > xGraphics( xDevice->createGraphics(), UNO_SET_THROW );
+ xGraphics->setFillColor( m_nPanelColor );
+ xGraphics->setLineColor( 0x00FFFFFF );
+
+ const Reference< XWindow > xWindow( i_rEvent.Source, UNO_QUERY_THROW );
+ const Rectangle aWindowRect( xWindow->getPosSize() );
+ xGraphics->drawRect( 0, 0, aWindowRect.Width - 1, aWindowRect.Height - 1 );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SingleColorPanel::disposing( const EventObject& i_rSource ) throw (RuntimeException)
+ {
+ (void)i_rSource;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SingleColorPanel::disposing()
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xWindow.is() )
+ // already disposed
+ return;
+ m_xWindow->removePaintListener( this );
+ try
+ {
+ Reference< XComponent > xWindowComp( m_xWindow, UNO_QUERY_THROW );
+ xWindowComp->dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ m_xWindow.clear();
+ }
+
+ //==================================================================================================================
+ //= PanelUIElement
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ PanelUIElement::PanelUIElement( const Reference< XComponentContext >& i_rContext, const Reference< XWindow >& i_rParentWindow,
+ const ::rtl::OUString& i_rResourceURL, const ::sal_Int32 i_nPanelColor )
+ :PanelUIElement_Base( m_aMutex )
+ ,m_sResourceURL( i_rResourceURL )
+ ,m_xToolPanel( new SingleColorPanel( i_rContext, i_rParentWindow, i_nPanelColor ) )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ PanelUIElement::~PanelUIElement()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XFrame > SAL_CALL PanelUIElement::getFrame() throw (RuntimeException)
+ {
+ // TODO
+ return NULL;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL PanelUIElement::getResourceURL() throw (RuntimeException)
+ {
+ return m_sResourceURL;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int16 SAL_CALL PanelUIElement::getType() throw (RuntimeException)
+ {
+ return UIElementType::TOOLPANEL;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XInterface > SAL_CALL PanelUIElement::getRealInterface( ) throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xToolPanel.is() )
+ throw DisposedException();
+ return m_xToolPanel;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL PanelUIElement::disposing()
+ {
+ Reference< XComponent > xPanelComponent( m_xToolPanel, UNO_QUERY_THROW );
+ m_xToolPanel.clear();
+ xPanelComponent->dispose();
+ }
+
+//......................................................................................................................
+} } // namespace sd::colortoolpanel
+//......................................................................................................................
diff --git a/sfx2/workben/custompanel/ctp_panel.hxx b/sfx2/workben/custompanel/ctp_panel.hxx
new file mode 100644
index 000000000000..39c46c9d93a5
--- /dev/null
+++ b/sfx2/workben/custompanel/ctp_panel.hxx
@@ -0,0 +1,124 @@
+/*************************************************************************
+ * 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 SD_WORKBENCH_CTP_PANEL_HXX
+#define SD_WORKBENCH_CTP_PANEL_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/ui/XToolPanel.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/awt/XPaintListener.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/ui/XUIElement.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/compbase2.hxx>
+#include <cppuhelper/compbase1.hxx>
+#include <cppuhelper/basemutex.hxx>
+
+#include <boost/scoped_ptr.hpp>
+
+//......................................................................................................................
+namespace sd { namespace colortoolpanel
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= SingleColorPanel
+ //==================================================================================================================
+ typedef ::cppu::WeakComponentImplHelper2 < ::com::sun::star::ui::XToolPanel
+ , ::com::sun::star::awt::XPaintListener
+ > SingleColorPanel_Base;
+ class SingleColorPanel :public ::cppu::BaseMutex
+ ,public SingleColorPanel_Base
+ {
+ public:
+ SingleColorPanel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& i_rParentWindow,
+ const ::sal_Int32 i_nPanelColor
+ );
+
+ // XToolPanel
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL getWindow() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL createAccessible( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XPaintListener
+ virtual void SAL_CALL windowPaint( const ::com::sun::star::awt::PaintEvent& e ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent equivalents
+ virtual void SAL_CALL disposing();
+
+ protected:
+ ~SingleColorPanel();
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xWindow;
+ const sal_Int32 m_nPanelColor;
+ };
+
+ //==================================================================================================================
+ //= PanelUIElement
+ //==================================================================================================================
+ typedef ::cppu::WeakComponentImplHelper1 < ::com::sun::star::ui::XUIElement
+ > PanelUIElement_Base;
+ class PanelUIElement :public ::cppu::BaseMutex
+ ,public PanelUIElement_Base
+ {
+ public:
+ PanelUIElement(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& i_rParentWindow,
+ const ::rtl::OUString& i_rResourceURL,
+ const ::sal_Int32 i_nPanelColor
+ );
+
+ // XUIElement
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SAL_CALL getFrame() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getResourceURL() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getType() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getRealInterface( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing();
+
+ protected:
+ ~PanelUIElement();
+
+ private:
+ const ::rtl::OUString m_sResourceURL;
+ ::com::sun::star::uno::Reference< ::com::sun::star::ui::XToolPanel >
+ m_xToolPanel;
+ };
+
+//......................................................................................................................
+} } // namespace sd::colortoolpanel
+//......................................................................................................................
+
+#endif // SD_WORKBENCH_CTP_PANEL_HXX
diff --git a/sfx2/workben/custompanel/ctp_services.cxx b/sfx2/workben/custompanel/ctp_services.cxx
new file mode 100644
index 000000000000..4164e8bc1629
--- /dev/null
+++ b/sfx2/workben/custompanel/ctp_services.cxx
@@ -0,0 +1,92 @@
+/*************************************************************************
+ * 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_sfx2.hxx"
+
+#include "ctp_factory.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+#include <cppuhelper/implementationentry.hxx>
+
+//......................................................................................................................
+namespace sd { namespace colortoolpanel
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= descriptors for the services implemented in this component
+ //==================================================================================================================
+ static struct ::cppu::ImplementationEntry s_aServiceEntries[] =
+ {
+ {
+ ToolPanelFactory::Create,
+ ToolPanelFactory::getImplementationName_static,
+ ToolPanelFactory::getSupportedServiceNames_static,
+ ::cppu::createSingleComponentFactory, NULL, 0
+ },
+ { 0, 0, 0, 0, 0, 0 }
+ };
+
+//......................................................................................................................
+} } // namespace sd::colortoolpanel
+//......................................................................................................................
+
+extern "C"
+{
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** )
+ {
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool SAL_CALL component_writeInfo( void * pServiceManager, void * pRegistryKey )
+ {
+ return ::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey, ::sd::colortoolpanel::s_aServiceEntries );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
+ {
+ return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , ::sd::colortoolpanel::s_aServiceEntries );
+ }
+}
diff --git a/sfx2/workben/custompanel/delzip b/sfx2/workben/custompanel/delzip
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/sfx2/workben/custompanel/delzip
diff --git a/sfx2/workben/custompanel/description.xml b/sfx2/workben/custompanel/description.xml
new file mode 100644
index 000000000000..a90aa73a77f6
--- /dev/null
+++ b/sfx2/workben/custompanel/description.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<description
+ xmlns="http://openoffice.org/extensions/description/2006"
+ xmlns:d="http://openoffice.org/extensions/description/2006"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+
+ <identifier value="UPDATED_IDENTIFIER"/>
+ <version value="0.1" />
+ <platform value="UPDATED_SUPPORTED_PLATFORM" />
+ <display-name>
+ <name>Custom Tool Panel Example</name>
+ </display-name>
+ <dependencies>
+ <OpenOffice.org-minimal-version value="3.3" d:name="OpenOffice.org 3.3"/>
+ </dependencies>
+</description>
diff --git a/sfx2/workben/custompanel/makefile.mk b/sfx2/workben/custompanel/makefile.mk
new file mode 100644
index 000000000000..1eb20ceed35d
--- /dev/null
+++ b/sfx2/workben/custompanel/makefile.mk
@@ -0,0 +1,120 @@
+#*************************************************************************
+#
+# 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=sfx2
+
+TARGET=custompanel
+ENABLE_EXCEPTIONS=TRUE
+LIBTARGET=NO
+EXTENSIONNAME:=custom-tool-panel
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+#-------------------------------------------------------------------
+
+#---- extension version
+EXTENSION_VERSION_BASE=0.1
+.IF ( "$(CWS_WORK_STAMP)" == "" ) || ( "$(UPDATER)" == "YES" )
+ EXTENSION_VERSION=$(EXTENSION_VERSION_BASE)
+.ELSE
+ EXTENSION_VERSION=$(EXTENSION_VERSION_BASE).cws.$(CWS_WORK_STAMP)
+.ENDIF
+
+#---- extension title package name
+EXTENSION_TITLE=Custom Tool Panel Example
+EXTENSION_ZIPNAME=$(EXTENSIONNAME)-$(EXTENSION_VERSION_BASE)-$(RTL_OS:l)-$(RTL_ARCH:l)
+
+#--------------------------------------------------
+
+SHL1DLLPRE=
+SHL1TARGET=$(TARGET).uno
+LIB1TARGET=$(SLB)/$(SHL1TARGET).lib
+LIB1OBJFILES= \
+ $(SLO)/ctp_factory.obj \
+ $(SLO)/ctp_services.obj \
+ $(SLO)/ctp_panel.obj
+
+SHL1STDLIBS= \
+ $(CPPULIB) \
+ $(SALLIB) \
+ $(SALHELPERLIB) \
+ $(CPPUHELPERLIB)
+
+SHL1VERSIONMAP=$(SOLARSRC)/solenv/src/component.map
+SHL1LIBS= $(LIB1TARGET)
+SHL1DEF= $(MISC)/$(SHL1TARGET).def
+SHL1RPATH= OXT
+DEF1NAME= $(SHL1TARGET)
+
+# create Extension -----------------------------
+
+COMPONENT_CONFIGDEST=.
+
+COMPONENT_XCU = \
+ $(EXTENSIONDIR)/WriterWindowState.xcu \
+ $(EXTENSIONDIR)/CalcWindowState.xcu \
+ $(EXTENSIONDIR)/DrawWindowState.xcu \
+ $(EXTENSIONDIR)/ImpressWindowState.xcu \
+ $(EXTENSIONDIR)/Factories.xcu
+
+COMPONENT_LIBRARIES = \
+ $(EXTENSIONDIR)/$(SHL1TARGET)$(DLLPOST)
+
+COMPONENT_IMAGES= \
+ $(EXTENSIONDIR)/panel.png
+
+# ........ dependencies for packaging the extension ........
+EXTENSION_PACKDEPS=makefile.mk $(COMPONENT_IMAGES)
+
+# --- Targets ------------------------------------------------------
+.INCLUDE : extension_pre.mk
+.INCLUDE : target.mk
+.INCLUDE : extension_post.mk
+
+$(EXTENSIONDIR)/%.png : ./%.png
+ @@-$(MKDIRHIER) $(@:d)
+ @$(COPY) $< $@ > $(NULLDEV)
+
+$(EXTENSIONDIR)/WriterWindowState.xcu: ./WriterWindowState.xcu
+ @@-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)$(TYPE) ./WriterWindowState.xcu | sed s/UPDATED_IDENTIFIER/$(IMPLEMENTATION_IDENTIFIER)/ > $(EXTENSIONDIR)/WriterWindowState.xcu
+
+$(EXTENSIONDIR)/CalcWindowState.xcu: ./CalcWindowState.xcu
+ @@-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)$(TYPE) ./CalcWindowState.xcu | sed s/UPDATED_IDENTIFIER/$(IMPLEMENTATION_IDENTIFIER)/ > $(EXTENSIONDIR)/CalcWindowState.xcu
+
+$(EXTENSIONDIR)/DrawWindowState.xcu: ./DrawWindowState.xcu
+ @@-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)$(TYPE) ./DrawWindowState.xcu | sed s/UPDATED_IDENTIFIER/$(IMPLEMENTATION_IDENTIFIER)/ > $(EXTENSIONDIR)/DrawWindowState.xcu
+
+$(EXTENSIONDIR)/ImpressWindowState.xcu: ./ImpressWindowState.xcu
+ @@-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)$(TYPE) ./ImpressWindowState.xcu | sed s/UPDATED_IDENTIFIER/$(IMPLEMENTATION_IDENTIFIER)/ > $(EXTENSIONDIR)/ImpressWindowState.xcu
+
diff --git a/sfx2/workben/custompanel/manifest.xml b/sfx2/workben/custompanel/manifest.xml
new file mode 100644
index 000000000000..9122d16a4189
--- /dev/null
+++ b/sfx2/workben/custompanel/manifest.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">
+<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest">
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=native"
+ manifest:full-path="custompanel.unoSHARED_EXTENSION"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
+ manifest:full-path="WriterWindowState.xcu"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
+ manifest:full-path="CalcWindowState.xcu"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
+ manifest:full-path="DrawWindowState.xcu"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
+ manifest:full-path="ImpressWindowState.xcu"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
+ manifest:full-path="Factories.xcu"/>
+ <!-- <manifest:file-entry manifest:media-type="image/png"
+ manifest:full-path="panel.png"/>-->
+</manifest:manifest>
diff --git a/sfx2/workben/custompanel/panel.png b/sfx2/workben/custompanel/panel.png
new file mode 100644
index 000000000000..2438714af8a6
--- /dev/null
+++ b/sfx2/workben/custompanel/panel.png
Binary files differ
diff --git a/shell/qa/makefile.mk b/shell/qa/makefile.mk
index a9047f97cf83..cc91a6b1ad5c 100755
--- a/shell/qa/makefile.mk
+++ b/shell/qa/makefile.mk
@@ -37,6 +37,8 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
+CFLAGSCXX += $(CPPUNIT_CFLAGS)
+
# BEGIN ----------------------------------------------------------------
# auto generated Target:testjob by codegen.pl
diff --git a/shell/source/backends/gconfbe/gconfaccess.cxx b/shell/source/backends/gconfbe/gconfaccess.cxx
index 99a5b362c161..64d0e2e94eae 100644
--- a/shell/source/backends/gconfbe/gconfaccess.cxx
+++ b/shell/source/backends/gconfbe/gconfaccess.cxx
@@ -448,7 +448,6 @@ sal_Bool SAL_CALL isDependencySatisfied( GConfClient* aClient, const Configurati
#ifdef ENABLE_LOCKDOWN
case SETTING_AUTO_SAVE:
{
- GConfClient* aClient = GconfBackend::getGconfClient();
GConfValue* aGconfValue = gconf_client_get( aClient, GCONF_AUTO_SAVE_KEY, NULL );
if( ( aGconfValue != NULL ) )
diff --git a/shell/source/backends/kdebe/makefile.mk b/shell/source/backends/kdebe/makefile.mk
index b63e2332624f..31bf77b47b54 100644
--- a/shell/source/backends/kdebe/makefile.mk
+++ b/shell/source/backends/kdebe/makefile.mk
@@ -69,7 +69,7 @@ SHL1LINKFLAGS+=$(KDE_LIBS) -lkio
SHL1STDLIBS= \
$(CPPUHELPERLIB) \
$(CPPULIB) \
- $(SALLIB) \
+ $(SALLIB)
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/shell/source/backends/localebe/exports.map b/shell/source/backends/localebe/exports.map
deleted file mode 100644
index ba501f9ae076..000000000000
--- a/shell/source/backends/localebe/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/backends/localebe/makefile.mk b/shell/source/backends/localebe/makefile.mk
index 8a05be4cb351..bd12bcdb28ce 100644
--- a/shell/source/backends/localebe/makefile.mk
+++ b/shell/source/backends/localebe/makefile.mk
@@ -62,7 +62,7 @@ SHL1STDLIBS= \
SHL1STDLIBS+= -framework CoreServices
.ENDIF
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/shell/source/backends/macbe/exports.map b/shell/source/backends/macbe/exports.map
deleted file mode 100644
index ba501f9ae076..000000000000
--- a/shell/source/backends/macbe/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/backends/macbe/makefile.mk b/shell/source/backends/macbe/makefile.mk
index 7b42c8c577ce..c3a58ec9f5c6 100644
--- a/shell/source/backends/macbe/makefile.mk
+++ b/shell/source/backends/macbe/makefile.mk
@@ -67,7 +67,7 @@ SHL1STDLIBS= \
$(SALLIB) \
-framework Cocoa -framework SystemConfiguration
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/shell/source/backends/wininetbe/exports.map b/shell/source/backends/wininetbe/exports.map
deleted file mode 100644
index ba501f9ae076..000000000000
--- a/shell/source/backends/wininetbe/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/backends/wininetbe/makefile.mk b/shell/source/backends/wininetbe/makefile.mk
index 0401cb88b7dd..9f79fa706fbf 100644
--- a/shell/source/backends/wininetbe/makefile.mk
+++ b/shell/source/backends/wininetbe/makefile.mk
@@ -58,7 +58,7 @@ SHL1STDLIBS= \
$(CPPULIB) \
$(SALLIB)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/shell/source/cmdmail/exports.map b/shell/source/cmdmail/exports.map
deleted file mode 100644
index ba501f9ae076..000000000000
--- a/shell/source/cmdmail/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/cmdmail/makefile.mk b/shell/source/cmdmail/makefile.mk
index a7eaec1f89dd..5781afe8f5dd 100644
--- a/shell/source/cmdmail/makefile.mk
+++ b/shell/source/cmdmail/makefile.mk
@@ -53,7 +53,7 @@ SHL1STDLIBS=$(CPPULIB)\
$(CPPUHELPERLIB)\
$(SALLIB)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/shell/source/tools/lngconvex/lngconvex.cxx b/shell/source/tools/lngconvex/lngconvex.cxx
index 0d716d6c568d..1d8862153230 100644
--- a/shell/source/tools/lngconvex/lngconvex.cxx
+++ b/shell/source/tools/lngconvex/lngconvex.cxx
@@ -45,6 +45,7 @@
#include "osl/thread.h"
#include "osl/process.h"
#include "osl/file.hxx"
+#include "sal/main.h"
#include "tools/config.hxx"
#include "i18npool/mslangid.hxx"
@@ -565,7 +566,7 @@ void inflate_rc_template_to_file(
#define RC_HEADER(c) MAKE_ABSOLUTE((c).get_arg("-rch"))
#define RC_FOOTER(c) MAKE_ABSOLUTE((c).get_arg("-rcf"))
-int main(int argc, char* argv[])
+SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
{
try
{
diff --git a/shell/source/unix/exec/exports.map b/shell/source/unix/exec/exports.map
deleted file mode 100644
index ba501f9ae076..000000000000
--- a/shell/source/unix/exec/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/unix/exec/makefile.mk b/shell/source/unix/exec/makefile.mk
index 2d9d5d250da4..4bf77436f668 100644
--- a/shell/source/unix/exec/makefile.mk
+++ b/shell/source/unix/exec/makefile.mk
@@ -56,7 +56,7 @@ SHL1IMPLIB=i$(TARGET)
SHL1IMPLIB=
.ENDIF
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/shell/source/unix/misc/gnome-open-url.sh b/shell/source/unix/misc/gnome-open-url.sh
index 1a52fc763783..ab730d169a49 100644
--- a/shell/source/unix/misc/gnome-open-url.sh
+++ b/shell/source/unix/misc/gnome-open-url.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-# use gnome-open utility coming with libgnome if available
-gnome-open "$1" 2>/dev/null || "$0.bin" $1
+# use xdg-open or gnome-open if available
+xdg-open "$1" 2>/dev/null || gnome-open "$1" 2>/dev/null || "$0.bin" $1
exit 0
diff --git a/shell/source/unix/misc/open-url.sh b/shell/source/unix/misc/open-url.sh
index 5a70785f89d3..449af5915ce8 100755
--- a/shell/source/unix/misc/open-url.sh
+++ b/shell/source/unix/misc/open-url.sh
@@ -46,38 +46,48 @@ run_browser() {
# special handling for mailto: uris
if echo $1 | grep '^mailto:' > /dev/null; then
+ # check for xdg-email
+ mailer=`which xdg-email`
+ if [ ! -z "$mailer" ]; then
+ $mailer "$1" &
+ exit 0
+ fi
# check $MAILER variable
if [ ! -z "$MAILER" ]; then
$MAILER "$1" &
exit 0
- else
- # mozilla derivates may need -remote semantics
- for i in thunderbird mozilla netscape; do
- mailer=`which $i`
- if [ ! -z "$mailer" ]; then
- run_mozilla "$mailer" "$1"
- exit 0
- fi
- done
- # handle all non mozilla mail clients below
- # ..
fi
+ # mozilla derivates may need -remote semantics
+ for i in thunderbird mozilla netscape; do
+ mailer=`which $i`
+ if [ ! -z "$mailer" ]; then
+ run_mozilla "$mailer" "$1"
+ exit 0
+ fi
+ done
+ # handle all non mozilla mail clients below
+ # ..
else
+ # check for xdg-open
+ browser=`which xdg-open`
+ if [ ! -z "$browser" ]; then
+ $browser "$1" &
+ exit 0
+ fi
# check $BROWSER variable
if [ ! -z "$BROWSER" ]; then
$BROWSER "$1" &
exit 0
- else
- # mozilla derivates may need -remote semantics
- for i in firefox mozilla netscape; do
- browser=`which $i`
- if [ ! -z "$browser" ]; then
- run_mozilla "$browser" "$1"
- exit 0
- fi
- done
- # handle all non mozilla browers below
- # ..
fi
+ # mozilla derivates may need -remote semantics
+ for i in firefox mozilla netscape; do
+ browser=`which $i`
+ if [ ! -z "$browser" ]; then
+ run_mozilla "$browser" "$1"
+ exit 0
+ fi
+ done
+ # handle all non mozilla browers below
+ # ..
fi
exit 1
diff --git a/shell/source/unix/sysshell/recently_used_file.cxx b/shell/source/unix/sysshell/recently_used_file.cxx
index cc4fbf75adcc..8a9de90c8b16 100644
--- a/shell/source/unix/sysshell/recently_used_file.cxx
+++ b/shell/source/unix/sysshell/recently_used_file.cxx
@@ -114,7 +114,8 @@ void recently_used_file::reset() const
//------------------------------------------------
void recently_used_file::truncate(off_t length)
{
- ftruncate(fileno(file_), length);
+ if (ftruncate(fileno(file_), length) == -1)
+ throw "I/O error: ftruncate failed";
}
//------------------------------------------------
diff --git a/shell/source/unix/sysshell/recfile.map b/shell/source/unix/sysshell/recfile.map
index fa87f39161aa..7e454f111896 100755
--- a/shell/source/unix/sysshell/recfile.map
+++ b/shell/source/unix/sysshell/recfile.map
@@ -1,4 +1,4 @@
-RECFILE_1_0_0 {
+UDK_3_0_0 {
global:
add_to_recently_used_file_list;
local:
diff --git a/shell/source/win32/shlxthandler/makefile.mk b/shell/source/win32/shlxthandler/makefile.mk
index 4452cb1a90e6..b6c9a45a9515 100644
--- a/shell/source/win32/shlxthandler/makefile.mk
+++ b/shell/source/win32/shlxthandler/makefile.mk
@@ -34,6 +34,9 @@ USE_DEFFILE=TRUE
.IF "$(BUILD_X64)"!=""
USE_DEFFILE_X64=TRUE
.ENDIF
+NO_DEFAULT_STL=TRUE
+USE_STLP_DEBUG=
+
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
@@ -134,10 +137,6 @@ SHL1STDLIBS_X64+=\
$(OLDNAMESLIB_X64) \
msvcprt.lib
-.IF "$(PRODUCT)"!="full"
-SHL1STDLIBS+=msvcrt.lib
-.ENDIF
-
SHL1LIBS_X64+=$(SLB_X64)$/util.lib\
$(SLB_X64)$/ooofilereader.lib
SHL1OBJS_X64=$(SLOFILES_X64)
diff --git a/sfx2/source/dialog/sfxurl.cxx b/svx/inc/extrusiondepthdialog.hxx
index 90c52e6e8ec4..600e646e8cb6 100644
--- a/sfx2/source/dialog/sfxurl.cxx
+++ b/svx/inc/extrusiondepthdialog.hxx
@@ -25,17 +25,36 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sfx2.hxx"
-#include <sfx2/filedlghelper.hxx>
-#include <sfx2/sfxresid.hxx>
-#include <dialog.hrc>
-
-SfxUrlDialog::SfxUrlDialog( Window *pParent )
- : ModalDialog( pParent, SfxResId( RID_URLOPEN ) ),
- aEdit( this, SfxResId(RID_URLOPEN_URL) ),
- aOk( this, SfxResId(RID_URLOPEN_OK) ),
- aCancel( this, SfxResId(RID_URLOPEN_CANCEL) )
+#ifndef _SVX_EXTRUSIONDEPTHDIALOG_HXX
+#define _SVX_EXTRUSIONDEPTHDIALOG_HXX
+
+#include "svx/svxdllapi.h"
+
+#include <vcl/fixed.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/button.hxx>
+#include <vcl/field.hxx>
+
+namespace svx {
+
+class ExtrusionDepthDialog : public ModalDialog
{
- FreeResource();
+ FixedText maFLDepth;
+ MetricField maMtrDepth;
+ OKButton maOKButton;
+ CancelButton maCancelButton;
+ HelpButton maHelpButton;
+
+ FieldUnit meDefaultUnit;
+
+public:
+ ExtrusionDepthDialog( Window* pParent, double fDepth, FieldUnit eDefaultUnit );
+ ~ExtrusionDepthDialog();
+
+ double getDepth() const;
+};
+
}
+
+#endif // _SVX_EXTRUSIONDEPTHDIALOG_HXX
+
diff --git a/svx/inc/globlmn_tmpl.hrc b/svx/inc/globlmn_tmpl.hrc
index e328a39a0707..be037a1ca3cc 100644
--- a/svx/inc/globlmn_tmpl.hrc
+++ b/svx/inc/globlmn_tmpl.hrc
@@ -1332,17 +1332,38 @@
{\
MenuItem\
{\
- Identifier = SID_TRANSLITERATE_UPPER ; \
- Command = ".uno:ChangeCaseToUpper" ; \
- HelpID = SID_TRANSLITERATE_UPPER ; \
- Text [ en-US ] = "~Uppercase";\
+ Identifier = SID_TRANSLITERATE_SENTENCE_CASE; \
+ Command = ".uno:ChangeCaseToSentenceCase" ; \
+ HelpID = SID_TRANSLITERATE_SENTENCE_CASE; \
+ Text [ en-US ] = "~Sentence case";\
};\
MenuItem\
{\
Identifier = SID_TRANSLITERATE_LOWER; \
Command = ".uno:ChangeCaseToLower" ; \
HelpID = SID_TRANSLITERATE_LOWER; \
- Text [ en-US ] = "~Lowercase";\
+ Text [ en-US ] = "~lowercase";\
+ };\
+ MenuItem\
+ {\
+ Identifier = SID_TRANSLITERATE_UPPER ; \
+ Command = ".uno:ChangeCaseToUpper" ; \
+ HelpID = SID_TRANSLITERATE_UPPER ; \
+ Text [ en-US ] = "~UPPERCASE";\
+ };\
+ MenuItem\
+ {\
+ Identifier = SID_TRANSLITERATE_TITLE_CASE; \
+ Command = ".uno:ChangeCaseToTitleCase" ; \
+ HelpID = SID_TRANSLITERATE_TITLE_CASE; \
+ Text [ en-US ] = "~Capitalize Every Word";\
+ };\
+ MenuItem\
+ {\
+ Identifier = SID_TRANSLITERATE_TOGGLE_CASE; \
+ Command = ".uno:ChangeCaseToToggleCase" ; \
+ HelpID = SID_TRANSLITERATE_TOGGLE_CASE; \
+ Text [ en-US ] = "~tOGGLE cASE";\
};\
MenuItem\
{\
diff --git a/svx/inc/helpid.hrc b/svx/inc/helpid.hrc
index 6d9153818cde..1f6fe1538a85 100644
--- a/svx/inc/helpid.hrc
+++ b/svx/inc/helpid.hrc
@@ -278,6 +278,7 @@
#define HID_SVX_SENDMENU_SIGNANDENCRYPT (HID_SVX_START + 245)
#define HID_SVX_TP_APPEARANCE (HID_SVX_START + 246)
#define HID_SVX_TP_DESKTOP (HID_SVX_START + 247)
+#define HID_CT_THES_ALTERNATIVES (HID_SVX_START + 248)
// please adjust ACT_SVX_HID_END2 below if you add entries here!
@@ -285,7 +286,7 @@
// Overrun check ---------------------------------------------------------
// -----------------------------------------------------------------------
-#define ACT_SVX_HID_END (HID_SVX_START+247)
+#define ACT_SVX_HID_END (HID_SVX_START+248)
#if ACT_SVX_HID_END > HID_SVX_END
#error Resource-Ueberlauf in #line, #file
#endif
diff --git a/svx/inc/svx/EnhancedCustomShape2d.hxx b/svx/inc/svx/EnhancedCustomShape2d.hxx
index 00df4b04f389..b3b944513e60 100644
--- a/svx/inc/svx/EnhancedCustomShape2d.hxx
+++ b/svx/inc/svx/EnhancedCustomShape2d.hxx
@@ -67,6 +67,10 @@ class SvxMSDffAdjustmentHandle;
#define HANDLE_FLAGS_RANGE_Y_MAXIMUM 0x0100
#define HANDLE_FLAGS_RADIUS_RANGE_MINIMUM 0x0200
#define HANDLE_FLAGS_RADIUS_RANGE_MAXIMUM 0x0400
+#define HANDLE_FLAGS_REFX 0x0800
+#define HANDLE_FLAGS_REFY 0x1000
+#define HANDLE_FLAGS_REFANGLE 0x2000
+#define HANDLE_FLAGS_REFR 0x4000
// MSDFF_HANDLE_FLAGS_RANGE_Y seems to be not defined in
// escher, but we are using it internally in to differentiate
@@ -145,12 +149,20 @@ class EnhancedCustomShape2d : public SfxItemSet
com::sun::star::drawing::EnhancedCustomShapeParameterPair aPosition;
com::sun::star::drawing::EnhancedCustomShapeParameterPair aPolar;
+ sal_Int32 nRefX;
+ sal_Int32 nRefY;
+ sal_Int32 nRefAngle;
+ sal_Int32 nRefR;
+
com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum;
com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum;
com::sun::star::drawing::EnhancedCustomShapeParameter aXRangeMinimum;
com::sun::star::drawing::EnhancedCustomShapeParameter aXRangeMaximum;
com::sun::star::drawing::EnhancedCustomShapeParameter aYRangeMinimum;
com::sun::star::drawing::EnhancedCustomShapeParameter aYRangeMaximum;
+
+ Handle() : bMirroredX ( sal_False ), bMirroredY ( sal_False ), bSwitched( sal_False ),
+ nRefX( -1 ), nRefY( -1 ), nRefAngle( -1 ), nRefR( -1 ) {};
};
sal_Bool IsFlipVert() { return bFlipV; };
diff --git a/svx/inc/svx/SpellDialogChildWindow.hxx b/svx/inc/svx/SpellDialogChildWindow.hxx
index 034b6372f6f1..3702b643e17e 100644
--- a/svx/inc/svx/SpellDialogChildWindow.hxx
+++ b/svx/inc/svx/SpellDialogChildWindow.hxx
@@ -69,15 +69,19 @@ protected:
@return
returns an empty vector if no error could be found
*/
- virtual SpellPortions GetNextWrongSentence (void) = 0;
+ virtual SpellPortions GetNextWrongSentence (bool bRecheck) = 0;
/** This abstract method applies the changes made in the spelling dialog
to the document.
The dialog always updates its settings when it gets the focus. The document
can rely on the fact that the methods ApplyChangedSentence() is called for the
position that the last GetNextWrongSentence() returned.
+ If 'bRecheck' is set to true then the same sentence should be rechecked once from
+ the start. This should be used too find errors that the user has introduced by
+ manual changes in the edit field, and in order to not miss the still following errors
+ in that sentence.
*/
- virtual void ApplyChangedSentence(const SpellPortions& rChanged) = 0;
+ virtual void ApplyChangedSentence(const SpellPortions& rChanged, bool bRecheck ) = 0;
/** This methods determines whether the application supports AutoCorrection
*/
virtual bool HasAutoCorrection();
diff --git a/svx/source/svdraw/svdscrol.cxx b/svx/inc/svx/extrusioncolorcontrol.hxx
index ce1d4e32bf32..ff4a53e65a41 100644
--- a/svx/source/svdraw/svdscrol.cxx
+++ b/svx/inc/svx/extrusioncolorcontrol.hxx
@@ -25,9 +25,32 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
+#ifndef _SVX_EXTRUSIONCOLORCONTROL_HXX
+#define _SVX_EXTRUSIONCOLORCONTROL_HXX
-#include "svdscrol.hxx"
+#include <sfx2/tbxctrl.hxx>
+#include "svx/svxdllapi.h"
+#include "svx/tbxcolorupdate.hxx"
+
+namespace svx {
+
+class SVX_DLLPUBLIC ExtrusionColorControl : public SfxToolBoxControl
+{
+private:
+ ToolboxButtonColorUpdater* mpBtnUpdater;
+
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ ExtrusionColorControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
+ ~ExtrusionColorControl();
+
+ virtual void StateChanged( USHORT nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+};
+
+}
+
+#endif // _SVX_EXTRUSIONCOLORCONTROL_HXX
-// eof
diff --git a/svx/inc/svx/extrusioncontrols.hxx b/svx/inc/svx/extrusioncontrols.hxx
deleted file mode 100644
index 4560c7463bc9..000000000000
--- a/svx/inc/svx/extrusioncontrols.hxx
+++ /dev/null
@@ -1,390 +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 _SVX_EXTRUSION_CONTROLS_HXX
-#define _SVX_EXTRUSION_CONTROLS_HXX
-
-#include <svtools/valueset.hxx>
-#include <svl/lstner.hxx>
-#include <sfx2/tbxctrl.hxx>
-#include <svtools/svtreebx.hxx>
-#ifndef _SV_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-#include <vcl/dialog.hxx>
-#include <vcl/field.hxx>
-#include <com/sun/star/frame/XFrame.hpp>
-#include "svx/svxdllapi.h"
-
-class SfxBindings;
-class ToolbarMenu;
-class SfxStatusForwarder;
-
-//========================================================================
-
-namespace svx
-{
-class ToolboxButtonColorUpdater;
-
-class ExtrusionDirectionWindow : public SfxPopupWindow
-{
- using FloatingWindow::StateChanged;
-
-private:
- ToolbarMenu* mpMenu;
- ValueSet* mpDirectionSet;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
-
- SfxStatusForwarder* mpDirectionForewarder;
- SfxStatusForwarder* mpProjectionForewarder;
-
- Image maImgDirection[9];
- Image maImgDirectionH[9];
-
- Image maImgPerspective;
- Image maImgPerspectiveH;
- Image maImgParallel;
- Image maImgParallelH;
-
- bool mbPopupMode;
-
- DECL_LINK( SelectHdl, void * );
- void FillValueSet();
-
- void implSetDirection( sal_Int32 nSkew, bool bEnabled = true );
- void implSetProjection( sal_Int32 nProjection, bool bEnabled = true );
- void implInit();
-
-protected:
- virtual BOOL Close();
- virtual void PopupModeEnd();
-
- /** This function is called when the window gets the focus. It grabs
- the focus to the line ends value set so that it can be controlled with
- the keyboard.
- */
- virtual void GetFocus (void);
-
-public:
- ExtrusionDirectionWindow( USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
- ExtrusionDirectionWindow( USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
- Window* pParentWindow );
- ~ExtrusionDirectionWindow();
-
- void StartSelection();
-
- virtual SfxPopupWindow* Clone() const;
-
- virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-};
-
-//========================================================================
-
-class SVX_DLLPUBLIC ExtrusionDirectionControl : public SfxToolBoxControl
-{
-public:
- SFX_DECL_TOOLBOX_CONTROL();
- ExtrusionDirectionControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
- ~ExtrusionDirectionControl();
-
- virtual void StateChanged( USHORT nSID, SfxItemState eState,
- const SfxPoolItem* pState );
- virtual SfxPopupWindowType GetPopupWindowType() const;
- virtual SfxPopupWindow* CreatePopupWindow();
-};
-
-//========================================================================
-
-class ExtrusionDepthWindow : public SfxPopupWindow
-{
- using FloatingWindow::StateChanged;
-
-private:
- ToolbarMenu* mpMenu;
-
- Image maImgDepth0;
- Image maImgDepth1;
- Image maImgDepth2;
- Image maImgDepth3;
- Image maImgDepth4;
- Image maImgDepthInfinity;
-
- Image maImgDepth0h;
- Image maImgDepth1h;
- Image maImgDepth2h;
- Image maImgDepth3h;
- Image maImgDepth4h;
- Image maImgDepthInfinityh;
-
- SfxStatusForwarder* mpDepthForewarder;
- SfxStatusForwarder* mpMetricForewarder;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
-
- bool mbPopupMode;
- FieldUnit meUnit;
- double mfDepth;
- bool mbEnabled;
-
- DECL_LINK( SelectHdl, void * );
-
- void implFillStrings( FieldUnit eUnit );
- void implSetDepth( double fDepth, bool bEnabled );
- void implInit();
-
-protected:
- virtual BOOL Close();
- virtual void PopupModeEnd();
-
- /** This function is called when the window gets the focus. It grabs
- the focus to the line ends value set so that it can be controlled with
- the keyboard.
- */
- virtual void GetFocus (void);
-
-public:
- ExtrusionDepthWindow( USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
- ExtrusionDepthWindow( USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
- Window* pParentWindow );
- ~ExtrusionDepthWindow();
-
- void StartSelection();
-
- virtual SfxPopupWindow* Clone() const;
-
- virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-};
-
-//========================================================================
-
-class SVX_DLLPUBLIC ExtrusionDepthControl : public SfxToolBoxControl
-{
-public:
- SFX_DECL_TOOLBOX_CONTROL();
- ExtrusionDepthControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
- ~ExtrusionDepthControl();
-
- virtual void StateChanged( USHORT nSID, SfxItemState eState,
- const SfxPoolItem* pState );
- virtual SfxPopupWindowType GetPopupWindowType() const;
- virtual SfxPopupWindow* CreatePopupWindow();
-};
-
-//========================================================================
-
-class ExtrusionLightingWindow : public SfxPopupWindow
-{
- using FloatingWindow::StateChanged;
-
-private:
- ToolbarMenu* mpMenu;
- ValueSet* mpLightingSet;
-
- Image maImgLightingOff[9];
- Image maImgLightingOn[9];
- Image maImgLightingPreview[9];
-
- Image maImgLightingOffh[9];
- Image maImgLightingOnh[9];
- Image maImgLightingPreviewh[9];
-
- Image maImgBright;
- Image maImgNormal;
- Image maImgDim;
- Image maImgBrighth;
- Image maImgNormalh;
- Image maImgDimh;
-
- SfxStatusForwarder* mpLightingDirectionForewarder;
- SfxStatusForwarder* mpLightingIntensityForewarder;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
-
- bool mbPopupMode;
- int mnLevel;
- bool mbLevelEnabled;
- int mnDirection;
- bool mbDirectionEnabled;
-
- void implSetIntensity( int nLevel, bool bEnabled );
- void implSetDirection( int nDirection, bool bEnabled );
- void implInit();
-
- DECL_LINK( SelectHdl, void * );
-
-protected:
- virtual BOOL Close();
- virtual void PopupModeEnd();
-
- /** This function is called when the window gets the focus. It grabs
- the focus to the line ends value set so that it can be controlled with
- the keyboard.
- */
- virtual void GetFocus (void);
-
-public:
- ExtrusionLightingWindow( USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
- ExtrusionLightingWindow( USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
- Window* pParentWindow );
- ~ExtrusionLightingWindow();
-
- void StartSelection();
-
- virtual SfxPopupWindow* Clone() const;
-
- virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-};
-
-//========================================================================
-
-class SVX_DLLPUBLIC ExtrusionLightingControl : public SfxToolBoxControl
-{
-public:
- SFX_DECL_TOOLBOX_CONTROL();
- ExtrusionLightingControl( USHORT nSlotid, USHORT nId, ToolBox& rTbx );
- ~ExtrusionLightingControl();
-
- virtual void StateChanged( USHORT nSID, SfxItemState eState,
- const SfxPoolItem* pState );
- virtual SfxPopupWindowType GetPopupWindowType() const;
- virtual SfxPopupWindow* CreatePopupWindow();
-};
-
-//========================================================================
-
-class ExtrusionSurfaceWindow : public SfxPopupWindow
-{
- using FloatingWindow::StateChanged;
-private:
- ToolbarMenu* mpMenu;
-
- Image maImgSurface1;
- Image maImgSurface2;
- Image maImgSurface3;
- Image maImgSurface4;
- Image maImgSurface1h;
- Image maImgSurface2h;
- Image maImgSurface3h;
- Image maImgSurface4h;
-
- SfxStatusForwarder* mpSurfaceForewarder;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
-
- bool mbPopupMode;
-
- DECL_LINK( SelectHdl, void * );
-
- void implSetSurface( int nSurface, bool bEnabled );
- void implInit();
-
-protected:
- virtual BOOL Close();
- virtual void PopupModeEnd();
-
- /** This function is called when the window gets the focus. It grabs
- the focus to the line ends value set so that it can be controlled with
- the keyboard.
- */
- virtual void GetFocus (void);
-
-public:
- ExtrusionSurfaceWindow( USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
- ExtrusionSurfaceWindow( USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
- Window* pParentWindow );
- ~ExtrusionSurfaceWindow();
-
- void StartSelection();
-
- virtual SfxPopupWindow* Clone() const;
-
- virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-};
-
-//========================================================================
-
-class SVX_DLLPUBLIC ExtrusionSurfaceControl : public SfxToolBoxControl
-{
-public:
- SFX_DECL_TOOLBOX_CONTROL();
- ExtrusionSurfaceControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
- ~ExtrusionSurfaceControl();
-
- virtual void StateChanged( USHORT nSID, SfxItemState eState,
- const SfxPoolItem* pState );
- virtual SfxPopupWindowType GetPopupWindowType() const;
- virtual SfxPopupWindow* CreatePopupWindow();
-};
-
-//========================================================================
-
-class SVX_DLLPUBLIC ExtrusionColorControl : public SfxToolBoxControl
-{
-private:
- ToolboxButtonColorUpdater* mpBtnUpdater;
-
-public:
- SFX_DECL_TOOLBOX_CONTROL();
- ExtrusionColorControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
- ~ExtrusionColorControl();
-
- virtual void StateChanged( USHORT nSID, SfxItemState eState,
- const SfxPoolItem* pState );
- virtual SfxPopupWindowType GetPopupWindowType() const;
- virtual SfxPopupWindow* CreatePopupWindow();
-};
-
-//========================================================================
-
-class ExtrusionDepthDialog : public ModalDialog
-{
- FixedText maFLDepth;
- MetricField maMtrDepth;
- OKButton maOKButton;
- CancelButton maCancelButton;
- HelpButton maHelpButton;
-
- FieldUnit meDefaultUnit;
-
-public:
- ExtrusionDepthDialog( Window* pParent, double fDepth, FieldUnit eDefaultUnit );
- ~ExtrusionDepthDialog();
-
- double getDepth() const;
-};
-
-}
-#endif
-
diff --git a/svx/inc/svx/fmshell.hxx b/svx/inc/svx/fmshell.hxx
index 0688beec65b3..f37eeab8c5e6 100644
--- a/svx/inc/svx/fmshell.hxx
+++ b/svx/inc/svx/fmshell.hxx
@@ -60,6 +60,11 @@ namespace com { namespace sun { namespace star { namespace form {
}
} } } }
+namespace svx
+{
+ class ISdrObjectFilter;
+}
+
//========================================================================
class SVX_DLLPUBLIC FmDesignModeChangedHint : public SfxHint
{
@@ -146,11 +151,28 @@ public:
const OutputDevice& _rDevice,
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _out_rxControl
) const;
+
::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > GetFormController(
const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm,
const SdrView& _rView,
const OutputDevice& _rDevice
) const;
+
+ /** puts the focus into the document window, if current a form control has the focus. Otherwise, moves the focus
+ to the control belonging to the given SdrUnoObj.
+ */
+ void ToggleControlFocus(
+ const SdrUnoObj& i_rNextCandidate,
+ const SdrView& i_rView,
+ OutputDevice& i_rDevice
+ ) const;
+
+ ::std::auto_ptr< ::svx::ISdrObjectFilter >
+ CreateFocusableControlFilter(
+ const SdrView& i_rView,
+ const OutputDevice& i_rDevice
+ ) const;
+
sal_Bool IsDesignMode() const { return m_bDesignMode; }
void SetDesignMode( sal_Bool _bDesignMode );
diff --git a/svx/inc/svx/fmtools.hxx b/svx/inc/svx/fmtools.hxx
index 36fa180fa348..b39f46e85d14 100644
--- a/svx/inc/svx/fmtools.hxx
+++ b/svx/inc/svx/fmtools.hxx
@@ -76,6 +76,7 @@
#include <comphelper/uno3.hxx>
#include <comphelper/stl_types.hxx>
#include <cppuhelper/implbase1.hxx>
+#include <svl/svstdarr.hxx>
#include <set>
diff --git a/svx/inc/svx/fontworkgallery.hxx b/svx/inc/svx/fontworkgallery.hxx
index 9f6b1f9f4b2f..40ac3cef966a 100644
--- a/svx/inc/svx/fontworkgallery.hxx
+++ b/svx/inc/svx/fontworkgallery.hxx
@@ -29,16 +29,16 @@
#ifndef _SVX_FONTWORK_GALLERY_DIALOG_HXX
#define _SVX_FONTWORK_GALLERY_DIALOG_HXX
-#ifndef _FIXED_HXX //autogen
+#include "svx/svxdllapi.h"
+
#include <vcl/fixed.hxx>
-#endif
-#include <svtools/valueset.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <vcl/dialog.hxx>
+#include <vcl/field.hxx>
+
+#include <svtools/valueset.hxx>
+
#include <sfx2/tbxctrl.hxx>
-#include "svx/svxdllapi.h"
#include <vector>
@@ -50,7 +50,6 @@ class SdrObject;
class SdrModel;
class SfxBindings;
-class ToolbarMenu;
class SfxStatusForwarder;
//------------------------------------------------------------------------
@@ -58,130 +57,6 @@ class SfxStatusForwarder;
namespace svx
{
-class FontWorkAlignmentWindow : public SfxPopupWindow
-{
- using FloatingWindow::StateChanged;
-private:
- ToolbarMenu* mpMenu;
-
- Image maImgAlgin1;
- Image maImgAlgin2;
- Image maImgAlgin3;
- Image maImgAlgin4;
- Image maImgAlgin5;
- Image maImgAlgin1h;
- Image maImgAlgin2h;
- Image maImgAlgin3h;
- Image maImgAlgin4h;
- Image maImgAlgin5h;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
-
- bool mbPopupMode;
-
- DECL_LINK( SelectHdl, void * );
-
- void implSetAlignment( int nAlignmentMode, bool bEnabled );
- void implInit();
-
-protected:
- virtual BOOL Close();
- virtual void PopupModeEnd();
-
- /** This function is called when the window gets the focus. It grabs
- the focus to the line ends value set so that it can be controlled with
- the keyboard.
- */
- virtual void GetFocus (void);
-
-public:
- FontWorkAlignmentWindow( USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
- FontWorkAlignmentWindow( USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
- Window* pParentWindow );
- ~FontWorkAlignmentWindow();
-
- void StartSelection();
-
- virtual SfxPopupWindow* Clone() const;
-
- virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-};
-
-class SVX_DLLPUBLIC FontWorkAlignmentControl : public SfxToolBoxControl
-{
-public:
- SFX_DECL_TOOLBOX_CONTROL();
- FontWorkAlignmentControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
- ~FontWorkAlignmentControl();
-
- virtual void StateChanged( USHORT nSID, SfxItemState eState,
- const SfxPoolItem* pState );
- virtual SfxPopupWindowType GetPopupWindowType() const;
- virtual SfxPopupWindow* CreatePopupWindow();
-};
-
-//------------------------------------------------------------------------
-
-class FontWorkCharacterSpacingWindow : public SfxPopupWindow
-{
- using FloatingWindow::StateChanged;
-private:
- ToolbarMenu* mpMenu;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
-
- bool mbPopupMode;
-
- DECL_LINK( SelectHdl, void * );
-
- void implSetCharacterSpacing( sal_Int32 nCharacterSpacing, bool bEnabled );
- void implSetKernCharacterPairs( sal_Bool bKernOnOff, bool bEnabled );
- void implInit();
-
-protected:
- virtual BOOL Close();
- virtual void PopupModeEnd();
-
- /** This function is called when the window gets the focus. It grabs
- the focus to the line ends value set so that it can be controlled with
- the keyboard.
- */
- virtual void GetFocus (void);
-
-public:
- FontWorkCharacterSpacingWindow( USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
- FontWorkCharacterSpacingWindow( USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
- Window* pParentWindow );
- ~FontWorkCharacterSpacingWindow();
-
- void StartSelection();
-
- virtual SfxPopupWindow* Clone() const;
-
- virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-};
-
-class SVX_DLLPUBLIC FontWorkCharacterSpacingControl : public SfxToolBoxControl
-{
-public:
- SFX_DECL_TOOLBOX_CONTROL();
- FontWorkCharacterSpacingControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
- ~FontWorkCharacterSpacingControl();
-
- virtual void StateChanged( USHORT nSID, SfxItemState eState,
- const SfxPoolItem* pState );
- virtual SfxPopupWindowType GetPopupWindowType() const;
- virtual SfxPopupWindow* CreatePopupWindow();
-};
-
-//------------------------------------------------------------------------
-
class SVX_DLLPUBLIC FontWorkShapeTypeControl : public SfxToolBoxControl
{
using SfxToolBoxControl::Select;
@@ -192,8 +67,6 @@ public:
~FontWorkShapeTypeControl();
virtual void Select( BOOL bMod1 = FALSE );
- virtual void StateChanged( USHORT nSID, SfxItemState eState,
- const SfxPoolItem* pState );
virtual SfxPopupWindowType GetPopupWindowType() const;
virtual SfxPopupWindow* CreatePopupWindow();
};
diff --git a/svx/inc/svx/gridctrl.hxx b/svx/inc/svx/gridctrl.hxx
index 6334137bc221..445d986b2c5e 100644
--- a/svx/inc/svx/gridctrl.hxx
+++ b/svx/inc/svx/gridctrl.hxx
@@ -29,6 +29,8 @@
#include <tools/list.hxx>
#include <com/sun/star/sdbc/XRowSet.hpp>
+#include <com/sun/star/sdbc/XRowSetListener.hpp>
+#include <com/sun/star/sdb/XRowsChangeListener.hpp>
#include <com/sun/star/beans/PropertyChangeEvent.hpp>
#include <com/sun/star/util/XNumberFormatter.hpp>
#include <com/sun/star/util/Date.hpp>
@@ -247,6 +249,8 @@ private:
// For that reason we have to listen to some properties of our data source.
::comphelper::OPropertyChangeMultiplexer* m_pDataSourcePropMultiplexer;
FmXGridSourcePropListener* m_pDataSourcePropListener;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XRowsChangeListener>
+ m_xRowSetListener; // get notification when rows were changed
void* m_pFieldListeners;
// property listeners for field values
@@ -523,15 +527,20 @@ public:
void setGridListener( FmGridListener* _pListener ) { m_pGridListener = _pListener; }
// helper class to grant access to selected methods from within the DbCellControl class
- struct GrantCellControlAccess
+ struct GrantControlAccess
{
friend class DbCellControl;
+ friend class RowSetEventListener;
protected:
- GrantCellControlAccess() { }
+ GrantControlAccess() { }
};
/// called when a controller needs to be re-initialized
- void refreshController(sal_uInt16 _nColId, GrantCellControlAccess _aAccess);
+ void refreshController(sal_uInt16 _nColId, GrantControlAccess _aAccess);
+
+ CursorWrapper* GetSeekCursor(GrantControlAccess /*_aAccess*/) const { return m_pSeekCursor; }
+ const DbGridRowRef& GetSeekRow(GrantControlAccess /*_aAccess*/) const { return m_xSeekRow; }
+ void SetSeekPos(sal_Int32 nPos,GrantControlAccess /*_aAccess*/) {m_nSeekPos = nPos;}
/**
@return
@@ -586,6 +595,7 @@ protected:
const DbGridRowRef& GetPaintRow() const { return m_xPaintRow; }
CursorWrapper* GetSeekCursor() const { return m_pSeekCursor; }
+
void ConnectToFields();
void DisconnectFromFields();
diff --git a/svx/inc/svx/htmlmode.hxx b/svx/inc/svx/htmlmode.hxx
index a1c5bf0cdf11..dab1b5b1db70 100644
--- a/svx/inc/svx/htmlmode.hxx
+++ b/svx/inc/svx/htmlmode.hxx
@@ -27,28 +27,7 @@
#ifndef _SVX_HTMLMODE_HXX
#define _SVX_HTMLMODE_HXX
-// include ---------------------------------------------------------------
-
-// define ----------------------------------------------------------------
-
-#define HTMLMODE_ON 0x0001
-#define HTMLMODE_PARA_BORDER 0x0002 /* Absatzumrandungen */
-#define HTMLMODE_PARA_DISTANCE 0x0004 /* bestimmte Absatzabstaende */
-#define HTMLMODE_SMALL_CAPS 0x0008 /* Kapitaelchen */
-#define HTMLMODE_FRM_COLUMNS 0x0010 /* spaltige Rahmen */
-#define HTMLMODE_SOME_STYLES 0x0020 /* mind. MS IE */
-#define HTMLMODE_FULL_STYLES 0x0040 /* == SW */
-#define HTMLMODE_BLINK 0x0080 /* blinkende Zeichen*/
-#define HTMLMODE_PARA_BLOCK 0x0100 /* Blocksatz */
-#define HTMLMODE_DROPCAPS 0x0200 /* Initialen*/
-#define HTMLMODE_FIRSTLINE 0x0400 /* Erstzeileneinzug mit Spacer == NS 3.0 */
-#define HTMLMODE_GRAPH_POS 0x0800 /* Grafikpositionen Hintergrund */
-#define HTMLMODE_FULL_ABS_POS 0x1000 /* abs. Rahmenpositionierung */
-#define HTMLMODE_SOME_ABS_POS 0x2000 /* abs. Rahmenpositionierung vollst.*/
-#define HTMLMODE_RESERVED1 0x4000
-#define HTMLMODE_RESERVED0 0x8000
-
-
+#include <sfx2/htmlmode.hxx>
#endif
diff --git a/svx/inc/svx/sdr/overlay/overlaybitmapex.hxx b/svx/inc/svx/sdr/overlay/overlaybitmapex.hxx
index aa52efd03c41..1fbf0b6add3d 100644
--- a/svx/inc/svx/sdr/overlay/overlaybitmapex.hxx
+++ b/svx/inc/svx/sdr/overlay/overlaybitmapex.hxx
@@ -47,13 +47,16 @@ namespace sdr
sal_uInt16 mnCenterX;
sal_uInt16 mnCenterY;
+ // optional transparency
+ double mfAlpha;
+
virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
public:
OverlayBitmapEx(
const basegfx::B2DPoint& rBasePos,
const BitmapEx& rBitmapEx,
- sal_uInt16 nCenX = 0, sal_uInt16 nCenY = 0);
+ sal_uInt16 nCenX = 0, sal_uInt16 nCenY = 0, double fAlpha = 0.0 );
virtual ~OverlayBitmapEx();
const BitmapEx& getBitmapEx() const { return maBitmapEx; }
diff --git a/svx/inc/svx/sdrmasterpagedescriptor.hxx b/svx/inc/svx/sdrmasterpagedescriptor.hxx
index 8325d2a57fa1..612f2ab927ec 100644
--- a/svx/inc/svx/sdrmasterpagedescriptor.hxx
+++ b/svx/inc/svx/sdrmasterpagedescriptor.hxx
@@ -89,8 +89,6 @@ namespace sdr
// operators
sal_Bool operator==(const MasterPageDescriptor& rCandidate) const;
sal_Bool operator!=(const MasterPageDescriptor& rCandidate) const;
-
- const SfxItemSet& getCorrectFillAttributes() const;
};
} // end of namespace sdr
diff --git a/svx/inc/svx/sdrobjectfilter.hxx b/svx/inc/svx/sdrobjectfilter.hxx
new file mode 100644
index 000000000000..55eda09c99af
--- /dev/null
+++ b/svx/inc/svx/sdrobjectfilter.hxx
@@ -0,0 +1,58 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+#ifndef SDROBJECTFILTER_HXX
+#define SDROBJECTFILTER_HXX
+
+#include "svx/svxdllapi.h"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+class SdrObject;
+
+//........................................................................
+namespace svx
+{
+//........................................................................
+
+ //====================================================================
+ //= SdrObjectFilter
+ //====================================================================
+ /** specifies a boolean predicate on the set of all SdrObjects - vulgo a filter.
+ */
+ class SVX_DLLPUBLIC SAL_NO_VTABLE ISdrObjectFilter
+ {
+ public:
+ virtual bool includeObject( const SdrObject& i_rObject ) const = 0;
+
+ virtual ~ISdrObjectFilter() = 0;
+ };
+
+//........................................................................
+} // namespace svx
+//........................................................................
+
+#endif // SDROBJECTFILTER_HXX
diff --git a/svx/inc/svx/svddef.hxx b/svx/inc/svx/svddef.hxx
index a758e9c1dba7..a9e5d175680c 100644
--- a/svx/inc/svx/svddef.hxx
+++ b/svx/inc/svx/svddef.hxx
@@ -203,7 +203,8 @@
#define SDRATTR_TRANSFORMREF2X (SDRATTR_NOTPERSIST_FIRST+32) /* 1212 long, def=0 */
#define SDRATTR_TRANSFORMREF2Y (SDRATTR_NOTPERSIST_FIRST+33) /* 1213 long, def=0 */
#define SDRATTR_TEXTDIRECTION (SDRATTR_NOTPERSIST_FIRST+34) /* 1214 V4+++ long, def=0 */
-#define SDRATTR_NOTPERSIST_LAST (SDRATTR_TEXTDIRECTION) /* 1228 V4+++*/ /* 1213*/ /* 1085 */ /* 1040 */ /* 1123 */ /* Pool V1: 1065 */
+#define SDRATTR_OBJVISIBLE (SDRATTR_NOTPERSIST_FIRST+35)
+#define SDRATTR_NOTPERSIST_LAST (SDRATTR_OBJVISIBLE) /* 1228 V4+++*/ /* 1213*/ /* 1085 */ /* 1040 */ /* 1123 */ /* Pool V1: 1065 */
// kein SetItem hierfuer
#define SDRATTR_GRAF_FIRST (SDRATTR_NOTPERSIST_LAST+1) /* 1229 V4+++*/
diff --git a/svx/inc/svx/svdhdl.hxx b/svx/inc/svx/svdhdl.hxx
index d4b4d5d3369e..f96b650d2be4 100644
--- a/svx/inc/svx/svdhdl.hxx
+++ b/svx/inc/svx/svdhdl.hxx
@@ -55,6 +55,7 @@ class SdrHdlList;
class SdrMarkView;
class SdrObject;
class SdrPageView;
+class MouseEvent;
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -184,6 +185,9 @@ protected:
// cleanup marker if one exists
void GetRidOfIAObject();
+private:
+ bool mbMouseOver; // is true if the mouse is over this handle
+
protected:
::sdr::overlay::OverlayObject* CreateOverlayObject(
const basegfx::B2DPoint& rPos,
@@ -241,6 +245,16 @@ public:
virtual BOOL IsFocusHdl() const;
void SetMoveOutside( bool bMoveOutside );
+
+ /** is called when the mouse enters the area of this handle. If the handle changes his
+ visualisation during mouse over it must override this method and call Touch(). */
+ virtual void onMouseEnter(const MouseEvent& rMEvt);
+
+ /** is called when the mouse leaves the area of this handle. If the handle changes his
+ visualisation during mouse over it must override this method and call Touch(). */
+ virtual void onMouseLeave();
+
+ bool isMouseOver() const;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/svx/inc/svx/svdmrkv.hxx b/svx/inc/svx/svdmrkv.hxx
index eecbc1f2c4f3..fc136b8e5a3c 100644
--- a/svx/inc/svx/svdmrkv.hxx
+++ b/svx/inc/svx/svdmrkv.hxx
@@ -169,6 +169,7 @@ protected:
virtual void SetMarkRects(); // Rects an den PageViews
virtual void CheckMarked(); // MarkList nach Del und Lock Layer durchsuchen...
virtual void AddDragModeHdl(SdrDragMode eMode);
+ virtual BOOL MouseMove(const MouseEvent& rMEvt, Window* pWin);
// add custom handles (used by other apps, e.g. AnchorPos)
virtual void AddCustomHdl();
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index 7acc69ab5b9f..40cc992e96d9 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -283,6 +283,7 @@ public:
BOOL bSizProt;
BOOL bNoPrint;
BOOL bClosedObj;
+ bool mbVisible;
SdrLayerID mnLayerID;
public:
@@ -469,10 +470,10 @@ protected:
unsigned bGrouped : 1; // Member eines GroupObjektes?
// Die folgende Flags werden gestreamt
- unsigned bMovProt : 1; // Position geschuetzt
- unsigned bSizProt : 1; // Groesse geschuetzt
- unsigned bNoPrint : 1; // Nicht drucken
-
+ unsigned bMovProt : 1; // If true, the position is protected
+ unsigned bSizProt : 1; // If true, the size is protected
+ unsigned bNoPrint : 1; // If true, the object is not printed.
+ unsigned mbVisible : 1; // If false, the object is not visible on screen (but maybe on printer, depending on bNoprint
// Wenn bEmptyPresObj TRUE ist, handelt es sich um ein
// Praesentationsobjekt, dem noch kein Inhalt zugewiesen
// wurde. Default ist das Flag auf FALSE. Die Verwaltung
@@ -810,6 +811,14 @@ public:
virtual void SetLogicRect(const Rectangle& rRect);
virtual void NbcSetLogicRect(const Rectangle& rRect);
+ /** the defaul is to set the logic rect to the given rectangle rMaxRect. If the shape
+ has an intrinsic aspect ratio it may set the logic rect so the aspect
+ ratio is kept but still inside the rectangle rMaxRect.
+
+ If bShrinkOnly is set to true, the size of the current logic rect will not
+ be changed if it is smaller than the given rectangle rMaxRect. */
+ virtual void AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly = false );
+
// Drehwinkel und Shear
virtual long GetRotateAngle() const;
virtual long GetShearAngle(FASTBOOL bVertical=FALSE) const;
@@ -1012,6 +1021,8 @@ public:
sal_Bool IsResizeProtect() const { return bSizProt; }
void SetPrintable(sal_Bool bPrn);
sal_Bool IsPrintable() const { return !bNoPrint; }
+ void SetVisible(sal_Bool bVisible);
+ sal_Bool IsVisible() const { return mbVisible; }
void SetEmptyPresObj(sal_Bool bEpt) { bEmptyPresObj=bEpt; }
sal_Bool IsEmptyPresObj() const { return bEmptyPresObj; }
void SetNotVisibleAsMaster(sal_Bool bFlg) { bNotVisibleAsMaster=bFlg; }
diff --git a/svx/inc/svx/svdograf.hxx b/svx/inc/svx/svdograf.hxx
index 89e2d35c9220..23d9204ca891 100644
--- a/svx/inc/svx/svdograf.hxx
+++ b/svx/inc/svx/svdograf.hxx
@@ -202,7 +202,7 @@ public:
virtual SdrObject* DoConvertToPolyObj(BOOL bBezier) const;
- void AdjustToMaxRect( const Rectangle& rMaxRect, BOOL bShrinkOnly );
+ virtual void AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly = false );
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
diff --git a/svx/inc/svx/svdomedia.hxx b/svx/inc/svx/svdomedia.hxx
index b572bb989451..5b0980d8bb30 100644
--- a/svx/inc/svx/svdomedia.hxx
+++ b/svx/inc/svx/svdomedia.hxx
@@ -63,6 +63,8 @@ public:
virtual void operator=(const SdrObject& rObj);
+ virtual void AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly = false );
+
public:
void setURL( const ::rtl::OUString& rURL );
diff --git a/svx/inc/svx/svdotable.hxx b/svx/inc/svx/svdotable.hxx
index a40b33c3ad18..02044f0dbc25 100644
--- a/svx/inc/svx/svdotable.hxx
+++ b/svx/inc/svx/svdotable.hxx
@@ -234,6 +234,7 @@ public:
virtual const Rectangle& GetLogicRect() const;
virtual void NbcSetLogicRect(const Rectangle& rRect);
+ virtual void AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly = false );
virtual sal_uInt32 GetSnapPointCount() const;
virtual Point GetSnapPoint(sal_uInt32 i) const;
diff --git a/svx/inc/svx/svdpage.hxx b/svx/inc/svx/svdpage.hxx
index 29cf17ec9180..c601fddef181 100644
--- a/svx/inc/svx/svdpage.hxx
+++ b/svx/inc/svx/svdpage.hxx
@@ -376,7 +376,6 @@ private:
public:
// construct/destruct
SdrPageProperties(SdrPage& rSdrPage);
- SdrPageProperties(const SdrPageProperties& rCandidate);
virtual ~SdrPageProperties();
// Notify(...) from baseclass SfxListener
diff --git a/svx/inc/svx/svdstr.hrc b/svx/inc/svx/svdstr.hrc
index f1c19b4e0895..f1bc8cfdae19 100644
--- a/svx/inc/svx/svdstr.hrc
+++ b/svx/inc/svx/svdstr.hrc
@@ -674,7 +674,7 @@
#define SIP_SA_CIRCRESERVE1 (SIP_Begin + 177)
#define SIP_SA_CIRCRESERVE2 (SIP_Begin + 178)
#define SIP_SA_CIRCRESERVE3 (SIP_Begin + 179)
-//BFS01#define SIP_SDRATTRSET_CIRC (SIP_Begin + 180)
+#define SIP_SA_OBJVISIBLE (SIP_Begin + 180)
#define SIP_SA_OBJMOVEPROTECT (SIP_Begin + 181)
#define SIP_SA_OBJSIZEPROTECT (SIP_Begin + 182)
#define SIP_SA_OBJPRINTABLE (SIP_Begin + 183)
diff --git a/svx/inc/svx/svxids.hrc b/svx/inc/svx/svxids.hrc
index b53b5f6dac26..1cdfc9fb2b9e 100644..100755
--- a/svx/inc/svx/svxids.hrc
+++ b/svx/inc/svx/svxids.hrc
@@ -342,18 +342,19 @@
// Calc-Id's
// --------------------------------------------------------------------------
-#ifndef SC_FUNCTION_START
-#define SC_FUNCTION_START (SID_SC_START + 200)
-#endif
-#ifndef FILE_MENU_END
-#define FILE_MENU_END (SC_FUNCTION_START + 20)
-#endif
-#ifndef EDIT_MENU_START
-#define EDIT_MENU_START (FILE_MENU_END)
-#endif
-#ifndef SC_VIEW_START
-#define SC_VIEW_START (SID_SC_START)
-#endif
+//! moved to sfx2, still in use:
+//#ifndef SC_FUNCTION_START
+//#define SC_FUNCTION_START (SID_SC_START + 200)
+//#endif
+//#ifndef FILE_MENU_END
+//#define FILE_MENU_END (SC_FUNCTION_START + 20)
+//#endif
+//#ifndef EDIT_MENU_START
+//#define EDIT_MENU_START (FILE_MENU_END)
+//#endif
+//#ifndef SC_VIEW_START
+//#define SC_VIEW_START (SID_SC_START)
+//#endif
#define SID_OUTLINE_HIDE (SID_SC_START + 329)
#define SID_OUTLINE_SHOW (SID_SC_START + 330)
@@ -365,8 +366,9 @@
#define SID_ATTR_SECIALCHAR (SID_SC_START + 581)
#define SID_ATTR_SPECIALCHAR (SID_SC_START + 581)
-#define FID_CHG_RECORD (EDIT_MENU_START + 18)
-#define SID_CHG_PROTECT (SC_VIEW_START + 84)
+//! moved to sfx2, still in use:
+//#define FID_CHG_RECORD (EDIT_MENU_START + 18)
+//#define SID_CHG_PROTECT (SC_VIEW_START + 84)
// --------------------------------------------------------------------------
// Writer-Id's
@@ -383,6 +385,7 @@
#define FN_INSERT_HARD_SPACE (FN_INSERT + 44) /* hard space */
#define FN_INSERT_HARDHYPHEN (FN_INSERT + 85) /* hyphen withou break*/
+//!! be aware to not overwrite something that is used in sw/inc/cmdid.h already !!
#define FN_FORMAT (SID_SW_START + 400)
#define FN_SET_JUSTIFY_PARA (FN_FORMAT + 21)
#define FN_FORMAT_RESET (FN_FORMAT + 69)
@@ -401,9 +404,10 @@
#define FN_PGPREVIEW (SID_SW_START + 1250)
#define FN_SHOW_MULTIPLE_PAGES (FN_PGPREVIEW + 2)
-#define FN_EDIT2 (SID_SW_START + 1800)
-#define FN_REDLINE_PROTECT (FN_EDIT2 + 23)
-#define FN_REDLINE_ON (FN_EDIT2 + 25)
+//! moved to sfx2, still in use:
+//#define FN_EDIT2 (SID_SW_START + 1800)
+//#define FN_REDLINE_PROTECT (FN_EDIT2 + 23)
+//#define FN_REDLINE_ON (FN_EDIT2 + 25)
// --------------------------------------------------------------------------
// Svx-Id's
@@ -706,6 +710,7 @@
#define SID_ATTR_TEXT_FITTOSIZE ( SID_SVX_START + 367 )
#define SID_ATTR_BRUSH_ROW ( SID_SVX_START + 368 )
#define SID_OPTFILTER_MSOFFICE ( SID_SVX_START + 369 )
+//#define SID_TASKPANE ( SID_SVX_START + 370 ) -> sfxsids.hrc
#define SID_IMAP ( SID_SVX_START + 371 )
#define SID_IMAP_DLG ( SID_SVX_START + 372 )
#define SID_IMAP_SELECT ( SID_SVX_START + 373 )
@@ -747,7 +752,10 @@
#define SID_ATTR_3D_AMBIENTINTENSITY ( SID_SVX_START + 410 ) /* --> Slots mit --> koennen demnaechst entfallen ( heute 12.03.1998 ) */
#define SID_ATTR_3D_AMBIENTCOLOR ( SID_SVX_START + 411 )
#define SID_IMPORT_GRAPH_LINK ( SID_SVX_START + 412 )
-#define SID_HTML_MODE ( SID_SVX_START + 414 )
+
+//! moved to sfx2, still in use:
+//#define SID_HTML_MODE ( SID_SVX_START + 414 )
+
#define SID_RULER_PROTECT ( SID_SVX_START + 415 )
//#define SID_INET_DLG ( SID_SVX_START + 416 ) -> sfxsids.hrc
#define SID_COLOR_CONTROL ( SID_SVX_START + 417 )
@@ -1026,7 +1034,7 @@
#define SID_DSBROWSER_EXPLORER ( SID_SVX_START + 764 )
#define SID_FM_CREATE_FIELDCONTROL ( SID_SVX_START + 765 )
#define SID_FM_DATACCESS_DESCRIPTOR ( SID_SVX_START + 766 )
-#define SID_FM_GRABCONTROLFOCUS ( SID_SVX_START + 767 )
+#define SID_FM_TOGGLECONTROLFOCUS ( SID_SVX_START + 767 )
#define SID_FM_SCROLLBAR ( SID_SVX_START + 768 )
#define SID_FM_SPINBUTTON ( SID_SVX_START + 769 )
#define SID_FM_CONVERTTO_SCROLLBAR ( SID_SVX_START + 770 )
@@ -1238,6 +1246,7 @@
#define SID_TABLE_STYLE_SETTINGS (SID_SVX_START+1089)
#define SID_CHAR_DLG_PREVIEW_STRING (SID_SVX_START+1090)
#define SID_RECHECK_DOCUMENT (SID_SVX_START+1091)
+
#define SID_OBJECT_MIRROR (SID_SVX_START+1093)
#define SID_DELETE_POSTIT (SID_SVX_START+1094)
@@ -1249,8 +1258,12 @@
#define SID_DELETEALLBYAUTHOR_POSTIT (SID_SVX_START+1100)
#define SID_INSERT_POSTIT (SID_SVX_START+1101)
+#define SID_TRANSLITERATE_SENTENCE_CASE (SID_SVX_START+1102)
+#define SID_TRANSLITERATE_TITLE_CASE (SID_SVX_START+1103)
+#define SID_TRANSLITERATE_TOGGLE_CASE (SID_SVX_START+1104)
+
// IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
-#define SID_SVX_FIRSTFREE SID_INSERT_POSTIT + 1
+#define SID_SVX_FIRSTFREE (SID_TRANSLITERATE_TOGGLE_CASE + 1)
// --------------------------------------------------------------------------
// Overflow check for slot IDs
diff --git a/svx/inc/svx/sxopitm.hxx b/svx/inc/svx/sxopitm.hxx
index 947660e71cc0..dd402c3a0915 100644
--- a/svx/inc/svx/sxopitm.hxx
+++ b/svx/inc/svx/sxopitm.hxx
@@ -39,4 +39,10 @@ public:
SdrObjPrintableItem(SvStream& rIn): SdrYesNoItem(SDRATTR_OBJPRINTABLE,rIn) {}
};
+class SdrObjVisibleItem: public SdrYesNoItem {
+public:
+ SdrObjVisibleItem(bool bOn=true): SdrYesNoItem(SDRATTR_OBJVISIBLE,bOn) {}
+ SdrObjVisibleItem(SvStream& rIn): SdrYesNoItem(SDRATTR_OBJVISIBLE,rIn) {}
+};
+
#endif
diff --git a/svx/inc/svx/unoshprp.hxx b/svx/inc/svx/unoshprp.hxx
index 27196079db07..232708d9a14a 100644
--- a/svx/inc/svx/unoshprp.hxx
+++ b/svx/inc/svx/unoshprp.hxx
@@ -160,7 +160,7 @@
#define OWN_ATTR_PAGE_NUMBER (OWN_ATTR_VALUE_START+65)
#define OWN_ATTR_THUMBNAIL (OWN_ATTR_VALUE_START+66)
#define OWN_ATTR_PERSISTNAME (OWN_ATTR_VALUE_START+67)
-//#define OWN_ATTR_HASLEVELS (OWN_ATTR_VALUE_START+68)
+#define OWN_ATTR_OLE_EMBEDDED_OBJECT_NONEWCLIENT (OWN_ATTR_VALUE_START+68)
#define OWN_ATTR_MEDIA_URL (OWN_ATTR_VALUE_START+69)
#define OWN_ATTR_MEDIA_PREFERREDSIZE (OWN_ATTR_VALUE_START+70)
#define OWN_ATTR_MEDIA_LOOP (OWN_ATTR_VALUE_START+71)
@@ -325,6 +325,7 @@
{ MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_MOVEPROTECT), SDRATTR_OBJMOVEPROTECT , &::getBooleanCppuType(), 0, 0}, \
{ MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_NAME), SDRATTR_OBJECTNAME , &::getCppuType((const ::rtl::OUString*)0), 0, 0}, \
{ MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_PRINTABLE), SDRATTR_OBJPRINTABLE , &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN("Visible"), SDRATTR_OBJVISIBLE , &::getBooleanCppuType(), 0, 0}, \
{ MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_SIZEPROTECT), SDRATTR_OBJSIZEPROTECT , &::getBooleanCppuType(), 0, 0},\
{ MAP_CHAR_LEN("UINameSingular"), OWN_ATTR_UINAME_SINGULAR , &::getCppuType((const ::rtl::OUString*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0}, \
{ MAP_CHAR_LEN("UINamePlural"), OWN_ATTR_UINAME_PLURAL , &::getCppuType((const ::rtl::OUString*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0}, \
diff --git a/svx/inc/tbunocontroller.hxx b/svx/inc/tbunocontroller.hxx
index fa7329a525e1..266dc917f33e 100644
--- a/svx/inc/tbunocontroller.hxx
+++ b/svx/inc/tbunocontroller.hxx
@@ -75,6 +75,7 @@ class FontHeightToolBoxControl : public svt::ToolboxController,
virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& Parent ) throw (::com::sun::star::uno::RuntimeException);
void dispatchCommand( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs );
+ using svt::ToolboxController::dispatchCommand;
private:
SvxFontSizeBox_Impl* m_pBox;
diff --git a/svx/inc/tbunosearchcontrollers.hxx b/svx/inc/tbunosearchcontrollers.hxx
new file mode 100644
index 000000000000..aec07042e1fc
--- /dev/null
+++ b/svx/inc/tbunosearchcontrollers.hxx
@@ -0,0 +1,282 @@
+/*************************************************************************
+ *
+ * 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 __TBUNOSEARCHCONTROLLERS_HXX_
+#define __TBUNOSEARCHCONTROLLERS_HXX_
+
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/frame/DispatchDescriptor.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XDispatchHelper.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+
+#include <comphelper/sequenceasvector.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/weak.hxx>
+#include <svtools/toolboxcontroller.hxx>
+#include <vcl/combobox.hxx>
+#include <vcl/window.hxx>
+
+#include <map>
+
+namespace css = ::com::sun::star ;
+namespace svx
+{
+
+class FindTextFieldControl : public ComboBox
+{
+public:
+ FindTextFieldControl( Window* pParent, WinBits nStyle,
+ css::uno::Reference< css::frame::XFrame >& xFrame,
+ css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager );
+ virtual ~FindTextFieldControl();
+
+ virtual void Modify();
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+ void InitControls_Impl();
+ void Remember_Impl(const String& rStr);
+
+private:
+
+ css::uno::Reference< css::frame::XFrame > m_xFrame;
+ css::uno::Reference< css::lang::XMultiServiceFactory > m_xServiceManager;
+ sal_Bool m_bToClearTextField;
+
+};
+
+class SearchToolbarControllersManager
+{
+public:
+
+ SearchToolbarControllersManager();
+ ~SearchToolbarControllersManager();
+
+ static SearchToolbarControllersManager* createControllersManager();
+
+ void registryController( const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Reference< css::frame::XStatusListener >& xStatusListener, const ::rtl::OUString& sCommandURL );
+ void freeController ( const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Reference< css::frame::XStatusListener >& xStatusListener, const ::rtl::OUString& sCommandURL );
+ css::uno::Reference< css::frame::XStatusListener > findController( const css::uno::Reference< css::frame::XFrame >& xFrame, const ::rtl::OUString& sCommandURL );
+
+private:
+
+ static SearchToolbarControllersManager* m_pInstance;
+
+ typedef ::comphelper::SequenceAsVector< css::beans::PropertyValue > SearchToolbarControllersVec;
+ typedef ::std::map< css::uno::Reference< css::frame::XFrame >, SearchToolbarControllersVec > SearchToolbarControllersMap;
+ SearchToolbarControllersMap aSearchToolbarControllersMap;
+
+};
+
+class FindTextToolbarController : public svt::ToolboxController,
+ public css::lang::XServiceInfo
+{
+public:
+
+ FindTextToolbarController( const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager );
+ ~FindTextToolbarController();
+
+ // XInterface
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException );
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw( css::uno::RuntimeException );
+ virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException );
+
+ static ::rtl::OUString getImplementationName_Static() throw()
+ {
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.svx.FindTextToolboxController" ));
+ }
+
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw();
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException );
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException );
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw ( css::uno::RuntimeException);
+ virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException );
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) throw ( css::uno::RuntimeException );
+
+ DECL_LINK(EditModifyHdl, void*);
+
+private:
+
+ FindTextFieldControl* m_pFindTextFieldControl;
+
+ USHORT m_nDownSearchId; // item position of findbar
+ USHORT m_nUpSearchId; // item position of findbar
+
+};
+
+class DownSearchToolboxController : public svt::ToolboxController,
+ public css::lang::XServiceInfo
+{
+public:
+
+ DownSearchToolboxController( const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager );
+ ~DownSearchToolboxController();
+
+ // XInterface
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException );
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw( css::uno::RuntimeException );
+ virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException );
+
+ static ::rtl::OUString getImplementationName_Static() throw()
+ {
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.svx.DownSearchToolboxController" ));
+ }
+
+ static css::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw();
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException );
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException );
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw ( css::uno::RuntimeException);
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException );
+
+};
+
+class UpSearchToolboxController : public svt::ToolboxController,
+ public css::lang::XServiceInfo
+{
+public:
+
+ UpSearchToolboxController( const css::uno::Reference< css::lang::XMultiServiceFactory >& rServiceManager );
+ ~UpSearchToolboxController();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException );
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw( css::uno::RuntimeException );
+ virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException );
+
+ static ::rtl::OUString getImplementationName_Static() throw()
+ {
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.svx.UpSearchToolboxController" ));
+ }
+
+ static css::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw();
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException );
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException);
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw ( css::uno::RuntimeException );
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException );
+
+};
+
+// protocol handler for "vnd.sun.star.findbar:*" URLs
+// The dispatch object will be used for shortcut commands for findbar
+class FindbarDispatcher : public css::lang::XServiceInfo,
+ public css::lang::XInitialization,
+ public css::frame::XDispatchProvider,
+ public css::frame::XDispatch,
+ public ::cppu::OWeakObject
+{
+public:
+
+ FindbarDispatcher( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory );
+ virtual ~FindbarDispatcher();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException );
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw( css::uno::RuntimeException );
+ virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException );
+
+ static ::rtl::OUString getImplementationName_Static() throw()
+ {
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.Impl.FindbarDispatcher" ));
+ }
+
+ static css::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw();
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException );
+
+ // XDispatchProvider
+ virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& aURL, const ::rtl::OUString& sTargetFrameName , sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException );
+ virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptions ) throw( css::uno::RuntimeException );
+
+ // XDispatch
+ virtual void SAL_CALL dispatch( const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw( css::uno::RuntimeException );
+ virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener, const css::util::URL& aURL ) throw( css::uno::RuntimeException );
+ virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener, const css::util::URL& aURL ) throw( css::uno::RuntimeException );
+
+private:
+
+ css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory;
+ css::uno::Reference< css::frame::XFrame > m_xFrame;
+
+};
+
+// createInstance
+css::uno::Reference< css::uno::XInterface > SAL_CALL FindTextToolbarController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr );
+css::uno::Reference< css::uno::XInterface > SAL_CALL DownSearchToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr );
+css::uno::Reference< css::uno::XInterface > SAL_CALL UpSearchToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr );
+css::uno::Reference< css::uno::XInterface > SAL_CALL FindbarDispatcher_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr );
+
+}
+
+#endif // __TBUNOSEARCHCONTROLLERS_HXX_
diff --git a/svx/prj/build.lst b/svx/prj/build.lst
index 5b99711edaa2..9f7597488644 100644
--- a/svx/prj/build.lst
+++ b/svx/prj/build.lst
@@ -30,8 +30,10 @@ sx svx\source\unodraw nmake - all sx_undrw sx_inc NULL
sx svx\source\unogallery nmake - all sx_ungal sx_inc NULL
sx svx\source\gallery2 nmake - all sx_gall sx_inc NULL
sx svx\source\xml nmake - all sx_xml sx_inc NULL
+sx svx\source\core nmake - all sx_core sx_inc NULL
sx svx\source\accessibility nmake - all sx_accessibility sx_inc NULL
sx svx\source\customshapes nmake - all sx_customshapes sx_inc NULL
sx svx\source\toolbars nmake - all sx_toolbars sx_inc NULL
-sx svx\util nmake - all sx_util sx_3deng sx_dlg sx_draw sx_attribute sx_properties sx_contact sx_event sx_animation sx_primitive2d sx_primitive3d sx_overlay sx_fmcmp sx_form sx_gall sx_items sx_mnuc sx_sdi sx_stbc sx_tbxc sx_undrw sx_ungal sx_xml sx_xout sx_accessibility sx_intro sx_customshapes sx_toolbars sx_table sx_smarttags NULL
+sx svx\util nmake - all sx_util sx_3deng sx_dlg sx_draw sx_attribute sx_properties sx_contact sx_event sx_animation sx_primitive2d sx_primitive3d sx_overlay sx_fmcmp sx_form sx_gall sx_items sx_mnuc sx_sdi sx_stbc sx_tbxc sx_undrw sx_ungal sx_xml sx_core sx_xout sx_accessibility sx_intro sx_customshapes sx_toolbars sx_table sx_smarttags NULL
sx svx\source\gengal nmake - all sx_gengal sx_util NULL
+sx svx\qa\unoapi nmake - all sx_qa_unoapi NULL
diff --git a/svx/qa/unoapi/Test.java b/svx/qa/unoapi/Test.java
new file mode 100644
index 000000000000..90abd12776d0
--- /dev/null
+++ b/svx/qa/unoapi/Test.java
@@ -0,0 +1,51 @@
+/*************************************************************************
+* 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.
+************************************************************************/
+
+package org.openoffice.svx.qa.unoapi;
+
+import org.openoffice.Runner;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+public final class Test {
+ @org.junit.Before public void setUp() throws Exception {
+ connection.setUp();
+ }
+
+ @org.junit.After public void tearDown()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ connection.tearDown();
+ }
+
+ @org.junit.Test public void test() {
+ assertTrue(
+ Runner.run(
+ "-sce", "svx.sce", "-xcl", "knownissues.xcl", "-tdoc",
+ "testdocuments", "-cs", connection.getDescription()));
+ }
+
+ private final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/svx/qa/unoapi/knownissues.xcl b/svx/qa/unoapi/knownissues.xcl
index 6d59511b75e0..89369160bb45 100644
--- a/svx/qa/unoapi/knownissues.xcl
+++ b/svx/qa/unoapi/knownissues.xcl
@@ -78,4 +78,10 @@ svx.GraphicExporter
### i98339 ###
svx.AccessibleControlShape
-# -> disbaled in svx.sce \ No newline at end of file
+# -> disbaled in svx.sce
+
+### i111114 ###
+svx.AccessiblePresentationOLEShape::com::sun::star::accessibility::XAccessibleComponent
+
+### i111169 ###
+svx.AccessiblePageShape::com::sun::star::accessibility::XAccessibleComponent
diff --git a/svx/qa/unoapi/makefile.mk b/svx/qa/unoapi/makefile.mk
index a64401995a51..133e9a3458e4 100644
--- a/svx/qa/unoapi/makefile.mk
+++ b/svx/qa/unoapi/makefile.mk
@@ -1,7 +1,6 @@
#*************************************************************************
-#
# 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
@@ -22,19 +21,28 @@
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
+#***********************************************************************/
-PRJ=..$/..
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-PRJNAME=svx
-TARGET=qa_unoapi
+PRJ = ../..
+PRJNAME = svx
+TARGET = qa_unoapi
-.INCLUDE: settings.mk
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/svx/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-ALLTAR : UNOAPI_TEST
+ALLTAR : javatest
-UNOAPI_TEST:
- +$(SOLARENV)$/bin$/checkapi -sce svx.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments
+.END
diff --git a/svx/qa/unoapi/svx.sce b/svx/qa/unoapi/svx.sce
index 84237f3c6f4b..82ee2ea6b193 100644
--- a/svx/qa/unoapi/svx.sce
+++ b/svx/qa/unoapi/svx.sce
@@ -1,11 +1,11 @@
#i98339 -o svx.AccessibleControlShape
--o svx.AccessibleEditableTextPara
--o svx.AccessibleGraphicShape
+#i111278 -o svx.AccessibleEditableTextPara
+#i111252 -o svx.AccessibleGraphicShape
#i46736 -o svx.AccessibleImageBullet
--o svx.AccessibleOLEShape
--o svx.AccessiblePageShape
--o svx.AccessiblePresentationGraphicShape
--o svx.AccessiblePresentationOLEShape
+#i111252 -o svx.AccessibleOLEShape
+#i111252 -o svx.AccessiblePageShape
+#i111216 -o svx.AccessiblePresentationGraphicShape
+#i111216 -o svx.AccessiblePresentationOLEShape
#i85539 -o svx.AccessiblePresentationShape
-o svx.AccessibleShape
#i90294 -o svx.GraphicExporter
diff --git a/svx/sdi/fmslots.sdi b/svx/sdi/fmslots.sdi
index 83803b2bdaf6..1a368920ab9a 100644
--- a/svx/sdi/fmslots.sdi
+++ b/svx/sdi/fmslots.sdi
@@ -657,7 +657,7 @@ shell FmFormShell
[
ExecMethod = Execute ;
]
- SID_FM_GRABCONTROLFOCUS
+ SID_FM_TOGGLECONTROLFOCUS
[
ExecMethod = Execute ;
]
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 5f243b90067d..240ca9cbd4e1 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -1455,6 +1455,81 @@ SfxVoidItem ChangeCaseToKatakana SID_TRANSLITERATE_KATAGANA
]
//--------------------------------------------------------------------------
+SfxVoidItem ChangeCaseToSentenceCase SID_TRANSLITERATE_SENTENCE_CASE
+()
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_FORMAT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ChangeCaseToTitleCase SID_TRANSLITERATE_TITLE_CASE
+()
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_FORMAT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ChangeCaseToToggleCase SID_TRANSLITERATE_TOGGLE_CASE
+()
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_FORMAT;
+]
+
+//--------------------------------------------------------------------------
SfxVoidItem ChangeCaseToLower SID_TRANSLITERATE_LOWER
()
[
@@ -10834,7 +10909,7 @@ SdrTextFitToSizeTypeItem TextFitToSize SID_ATTR_TEXT_FITTOSIZE
]
//--------------------------------------------------------------------------
-SfxVoidItem Thesaurus SID_THESAURUS
+SfxVoidItem ThesaurusDialog SID_THESAURUS
()
[
/* flags: */
@@ -10843,7 +10918,7 @@ SfxVoidItem Thesaurus SID_THESAURUS
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = TRUE,
- ReadOnlyDoc = TRUE,
+ ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
@@ -11700,7 +11775,7 @@ SfxVoidItem ZoomVisArea SID_SIZE_VISAREA
]
//--------------------------------------------------------------------------
-SfxVoidItem GrabControlFocus SID_FM_GRABCONTROLFOCUS
+SfxVoidItem ToggleControlFocus SID_FM_TOGGLECONTROLFOCUS
()
[
/* flags: */
diff --git a/svx/source/core/coreservices.cxx b/svx/source/core/coreservices.cxx
new file mode 100644
index 000000000000..1f1d69781756
--- /dev/null
+++ b/svx/source/core/coreservices.cxx
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+/** this file contains the uno service registrations for all services in the svxcore lib */
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+
+#include "sal/types.h"
+#include "osl/diagnose.h"
+#include "cppuhelper/factory.hxx"
+#include "uno/lbnames.h"
+
+using rtl::OUString;
+
+using namespace com::sun::star::uno;
+using namespace com::sun::star::lang;
+using namespace com::sun::star::registry;
+
+namespace svx
+{
+extern OUString SAL_CALL ExtrusionDepthController_getImplementationName();
+extern Reference< XInterface > SAL_CALL ExtrusionDepthController_createInstance(const Reference< XMultiServiceFactory > &) throw( RuntimeException );
+extern Sequence< OUString > SAL_CALL ExtrusionDepthController_getSupportedServiceNames() throw( RuntimeException );
+
+extern OUString SAL_CALL ExtrusionDirectionControl_getImplementationName();
+extern Reference< XInterface > SAL_CALL ExtrusionDirectionControl_createInstance(const Reference< XMultiServiceFactory > &) throw( RuntimeException );
+extern Sequence< OUString > SAL_CALL ExtrusionDirectionControl_getSupportedServiceNames() throw( RuntimeException );
+
+extern OUString SAL_CALL ExtrusionLightingControl_getImplementationName();
+extern Reference< XInterface > SAL_CALL ExtrusionLightingControl_createInstance(const Reference< XMultiServiceFactory > &) throw( RuntimeException );
+extern Sequence< OUString > SAL_CALL ExtrusionLightingControl_getSupportedServiceNames() throw( RuntimeException );
+
+extern OUString SAL_CALL ExtrusionSurfaceControl_getImplementationName();
+extern Reference< XInterface > SAL_CALL ExtrusionSurfaceControl_createInstance(const Reference< XMultiServiceFactory > &) throw( RuntimeException );
+extern Sequence< OUString > SAL_CALL ExtrusionSurfaceControl_getSupportedServiceNames() throw( RuntimeException );
+
+extern OUString SAL_CALL FontWorkAlignmentControl_getImplementationName();
+extern Reference< XInterface > SAL_CALL FontWorkAlignmentControl_createInstance(const Reference< XMultiServiceFactory > &) throw( RuntimeException );
+extern Sequence< OUString > SAL_CALL FontWorkAlignmentControl_getSupportedServiceNames() throw( RuntimeException );
+
+extern OUString SAL_CALL FontWorkCharacterSpacingControl_getImplementationName();
+extern Reference< XInterface > SAL_CALL FontWorkCharacterSpacingControl_createInstance(const Reference< XMultiServiceFactory > &) throw( RuntimeException );
+extern Sequence< OUString > SAL_CALL FontWorkCharacterSpacingControl_getSupportedServiceNames() throw( RuntimeException );
+}
+
+extern "C"
+{
+
+SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
+ const sal_Char ** ppEnvTypeName, uno_Environment ** )
+{
+ *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 * )
+{
+ void * pRet = 0;
+ if( pServiceManager )
+ {
+ Reference< XSingleServiceFactory > xFactory;
+
+ if( ::svx::ExtrusionDepthController_getImplementationName().equalsAscii( pImplName ) )
+ {
+ xFactory = ::cppu::createSingleFactory(
+ reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
+ ::svx::ExtrusionDepthController_getImplementationName(),
+ ::svx::ExtrusionDepthController_createInstance,
+ ::svx::ExtrusionDepthController_getSupportedServiceNames() );
+ }
+ else if( ::svx::ExtrusionDirectionControl_getImplementationName().equalsAscii( pImplName ) )
+ {
+ xFactory = ::cppu::createSingleFactory(
+ reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
+ ::svx::ExtrusionDirectionControl_getImplementationName(),
+ ::svx::ExtrusionDirectionControl_createInstance,
+ ::svx::ExtrusionDirectionControl_getSupportedServiceNames() );
+ }
+ else if( ::svx::ExtrusionLightingControl_getImplementationName().equalsAscii( pImplName ) )
+ {
+ xFactory = ::cppu::createSingleFactory(
+ reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
+ ::svx::ExtrusionLightingControl_getImplementationName(),
+ ::svx::ExtrusionLightingControl_createInstance,
+ ::svx::ExtrusionLightingControl_getSupportedServiceNames() );
+ }
+ else if( ::svx::ExtrusionSurfaceControl_getImplementationName().equalsAscii( pImplName ) )
+ {
+ xFactory = ::cppu::createSingleFactory(
+ reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
+ ::svx::ExtrusionSurfaceControl_getImplementationName(),
+ ::svx::ExtrusionSurfaceControl_createInstance,
+ ::svx::ExtrusionSurfaceControl_getSupportedServiceNames() );
+ }
+ else if( ::svx::FontWorkAlignmentControl_getImplementationName().equalsAscii( pImplName ) )
+ {
+ xFactory = ::cppu::createSingleFactory(
+ reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
+ ::svx::FontWorkAlignmentControl_getImplementationName(),
+ ::svx::FontWorkAlignmentControl_createInstance,
+ ::svx::FontWorkAlignmentControl_getSupportedServiceNames() );
+ }
+ else if( ::svx::FontWorkCharacterSpacingControl_getImplementationName().equalsAscii( pImplName ) )
+ {
+ xFactory = ::cppu::createSingleFactory(
+ reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
+ ::svx::FontWorkCharacterSpacingControl_getImplementationName(),
+ ::svx::FontWorkCharacterSpacingControl_createInstance,
+ ::svx::FontWorkCharacterSpacingControl_getSupportedServiceNames() );
+ } if( xFactory.is())
+ {
+ xFactory->acquire();
+ pRet = xFactory.get();
+ }
+ }
+
+ return pRet;
+}
+
+}
diff --git a/svx/source/core/makefile.mk b/svx/source/core/makefile.mk
new file mode 100644
index 000000000000..da874894bae6
--- /dev/null
+++ b/svx/source/core/makefile.mk
@@ -0,0 +1,47 @@
+#*************************************************************************
+#
+# 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=svx
+TARGET=core
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+
+# --- Files --------------------------------------------------------
+
+SLOFILES = \
+ $(SLO)$/coreservices.obj
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 9ae86971a432..6224373f9a15 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -468,6 +468,10 @@ sal_Bool EnhancedCustomShape2d::ConvertSequenceToEnhancedCustomShape2dHandle(
const rtl::OUString sSwitched ( RTL_CONSTASCII_USTRINGPARAM( "Switched" ) );
const rtl::OUString sPolar ( RTL_CONSTASCII_USTRINGPARAM( "Polar" ) );
// const rtl::OUString sMap ( RTL_CONSTASCII_USTRINGPARAM( "Map" ) );
+ const rtl::OUString sRefX ( RTL_CONSTASCII_USTRINGPARAM( "RefX" ) );
+ const rtl::OUString sRefY ( RTL_CONSTASCII_USTRINGPARAM( "RefY" ) );
+ const rtl::OUString sRefAngle ( RTL_CONSTASCII_USTRINGPARAM( "RefAngle" ) );
+ const rtl::OUString sRefR ( RTL_CONSTASCII_USTRINGPARAM( "RefR" ) );
const rtl::OUString sRadiusRangeMinimum ( RTL_CONSTASCII_USTRINGPARAM( "RadiusRangeMinimum" ) );
const rtl::OUString sRadiusRangeMaximum ( RTL_CONSTASCII_USTRINGPARAM( "RadiusRangeMaximum" ) );
const rtl::OUString sRangeXMinimum ( RTL_CONSTASCII_USTRINGPARAM( "RangeXMinimum" ) );
@@ -526,6 +530,26 @@ sal_Bool EnhancedCustomShape2d::ConvertSequenceToEnhancedCustomShape2dHandle(
}
}
*/
+ else if ( rPropVal.Name.equals( sRefX ) )
+ {
+ if ( rPropVal.Value >>= rDestinationHandle.nRefX )
+ rDestinationHandle.nFlags |= HANDLE_FLAGS_REFX;
+ }
+ else if ( rPropVal.Name.equals( sRefY ) )
+ {
+ if ( rPropVal.Value >>= rDestinationHandle.nRefY )
+ rDestinationHandle.nFlags |= HANDLE_FLAGS_REFY;
+ }
+ else if ( rPropVal.Name.equals( sRefAngle ) )
+ {
+ if ( rPropVal.Value >>= rDestinationHandle.nRefAngle )
+ rDestinationHandle.nFlags |= HANDLE_FLAGS_REFANGLE;
+ }
+ else if ( rPropVal.Name.equals( sRefR ) )
+ {
+ if ( rPropVal.Value >>= rDestinationHandle.nRefR )
+ rDestinationHandle.nFlags |= HANDLE_FLAGS_REFR;
+ }
else if ( rPropVal.Name.equals( sRadiusRangeMinimum ) )
{
if ( rPropVal.Value >>= rDestinationHandle.aRadiusRangeMinimum )
@@ -1182,131 +1206,141 @@ sal_Bool EnhancedCustomShape2d::SetHandleControllerPosition( const sal_uInt32 nI
Handle aHandle;
if ( ConvertSequenceToEnhancedCustomShape2dHandle( seqHandles[ nIndex ], aHandle ) )
{
- sal_Bool bAdjFirst = aHandle.aPosition.First.Type == EnhancedCustomShapeParameterType::ADJUSTMENT;
- sal_Bool bAdjSecond= aHandle.aPosition.Second.Type == EnhancedCustomShapeParameterType::ADJUSTMENT;
- if ( bAdjFirst || bAdjSecond )
+ Point aP( rPosition.X, rPosition.Y );
+ // apply the negative object rotation to the controller position
+
+ aP.Move( -aLogicRect.Left(), -aLogicRect.Top() );
+ if ( bFlipH )
+ aP.X() = aLogicRect.GetWidth() - aP.X();
+ if ( bFlipV )
+ aP.Y() = aLogicRect.GetHeight() - aP.Y();
+ if ( nRotateAngle )
{
- Point aP( rPosition.X, rPosition.Y );
- // apply the negative object rotation to the controller position
-
- aP.Move( -aLogicRect.Left(), -aLogicRect.Top() );
- if ( bFlipH )
- aP.X() = aLogicRect.GetWidth() - aP.X();
- if ( bFlipV )
- aP.Y() = aLogicRect.GetHeight() - aP.Y();
- if ( nRotateAngle )
- {
- double a = -nRotateAngle * F_PI18000;
- RotatePoint( aP, Point( aLogicRect.GetWidth() / 2, aLogicRect.GetHeight() / 2 ), sin( a ), cos( a ) );
- }
- const GeoStat aGeoStat( ((SdrObjCustomShape*)pCustomShapeObj)->GetGeoStat() );
- if ( aGeoStat.nShearWink )
- {
- double nTan = -aGeoStat.nTan;
- if ((bFlipV&&!bFlipH )||(bFlipH&&!bFlipV))
- nTan = -nTan;
- ShearPoint( aP, Point( aLogicRect.GetWidth() / 2, aLogicRect.GetHeight() / 2 ), nTan );
- }
+ double a = -nRotateAngle * F_PI18000;
+ RotatePoint( aP, Point( aLogicRect.GetWidth() / 2, aLogicRect.GetHeight() / 2 ), sin( a ), cos( a ) );
+ }
+ const GeoStat aGeoStat( ((SdrObjCustomShape*)pCustomShapeObj)->GetGeoStat() );
+ if ( aGeoStat.nShearWink )
+ {
+ double nTan = -aGeoStat.nTan;
+ if ((bFlipV&&!bFlipH )||(bFlipH&&!bFlipV))
+ nTan = -nTan;
+ ShearPoint( aP, Point( aLogicRect.GetWidth() / 2, aLogicRect.GetHeight() / 2 ), nTan );
+ }
- double fPos1 = aP.X(); //( bFlipH ) ? aLogicRect.GetWidth() - aP.X() : aP.X();
- double fPos2 = aP.Y(); //( bFlipV ) ? aLogicRect.GetHeight() -aP.Y() : aP.Y();
- fPos1 /= fXScale;
- fPos2 /= fYScale;
+ double fPos1 = aP.X(); //( bFlipH ) ? aLogicRect.GetWidth() - aP.X() : aP.X();
+ double fPos2 = aP.Y(); //( bFlipV ) ? aLogicRect.GetHeight() -aP.Y() : aP.Y();
+ fPos1 /= fXScale;
+ fPos2 /= fYScale;
- if ( aHandle.nFlags & HANDLE_FLAGS_SWITCHED )
+ if ( aHandle.nFlags & HANDLE_FLAGS_SWITCHED )
+ {
+ if ( aLogicRect.GetHeight() > aLogicRect.GetWidth() )
{
- if ( aLogicRect.GetHeight() > aLogicRect.GetWidth() )
- {
- double fX = fPos1;
- double fY = fPos2;
- fPos1 = fY;
- fPos2 = fX;
- }
+ double fX = fPos1;
+ double fY = fPos2;
+ fPos1 = fY;
+ fPos2 = fX;
}
+ }
- sal_Int32 nFirstAdjustmentValue = 0, nSecondAdjustmentValue = 0;
+ sal_Int32 nFirstAdjustmentValue = -1, nSecondAdjustmentValue = -1;
+
+ if ( aHandle.aPosition.First.Type == EnhancedCustomShapeParameterType::ADJUSTMENT )
aHandle.aPosition.First.Value >>= nFirstAdjustmentValue;
+ if ( aHandle.aPosition.Second.Type == EnhancedCustomShapeParameterType::ADJUSTMENT )
aHandle.aPosition.Second.Value>>= nSecondAdjustmentValue;
- if ( aHandle.nFlags & HANDLE_FLAGS_POLAR )
+ if ( aHandle.nFlags & HANDLE_FLAGS_POLAR )
+ {
+ double fXRef, fYRef, fAngle;
+ GetParameter( fXRef, aHandle.aPolar.First, sal_False, sal_False );
+ GetParameter( fYRef, aHandle.aPolar.Second, sal_False, sal_False );
+ const double fDX = fPos1 - fXRef;
+ fAngle = -( atan2( -fPos2 + fYRef, ( ( fDX == 0.0L ) ? 0.000000001 : fDX ) ) / F_PI180 );
+ double fX = ( fPos1 - fXRef );
+ double fY = ( fPos2 - fYRef );
+ double fRadius = sqrt( fX * fX + fY * fY );
+ if ( aHandle.nFlags & HANDLE_FLAGS_RADIUS_RANGE_MINIMUM )
+ {
+ double fMin;
+ GetParameter( fMin, aHandle.aRadiusRangeMinimum, sal_False, sal_False );
+ if ( fRadius < fMin )
+ fRadius = fMin;
+ }
+ if ( aHandle.nFlags & HANDLE_FLAGS_RADIUS_RANGE_MAXIMUM )
+ {
+ double fMax;
+ GetParameter( fMax, aHandle.aRadiusRangeMaximum, sal_False, sal_False );
+ if ( fRadius > fMax )
+ fRadius = fMax;
+ }
+ if ( nFirstAdjustmentValue >= 0 )
+ SetAdjustValueAsDouble( fRadius, nFirstAdjustmentValue );
+ if ( nSecondAdjustmentValue >= 0 )
+ SetAdjustValueAsDouble( fAngle, nSecondAdjustmentValue );
+ }
+ else
+ {
+ if ( aHandle.nFlags & HANDLE_FLAGS_REFX )
+ {
+ nFirstAdjustmentValue = aHandle.nRefX;
+ fPos1 *= 100000.0;
+ fPos1 /= nCoordWidth;
+ }
+ if ( aHandle.nFlags & HANDLE_FLAGS_REFY )
{
- double fXRef, fYRef, fAngle;
- GetParameter( fXRef, aHandle.aPolar.First, sal_False, sal_False );
- GetParameter( fYRef, aHandle.aPolar.Second, sal_False, sal_False );
- const double fDX = fPos1 - fXRef;
- fAngle = -( atan2( -fPos2 + fYRef, ( ( fDX == 0.0L ) ? 0.000000001 : fDX ) ) / F_PI180 );
- double fX = ( fPos1 - fXRef );
- double fY = ( fPos2 - fYRef );
- double fRadius = sqrt( fX * fX + fY * fY );
- if ( aHandle.nFlags & HANDLE_FLAGS_RADIUS_RANGE_MINIMUM )
+ nSecondAdjustmentValue = aHandle.nRefY;
+ fPos2 *= 100000.0;
+ fPos2 /= nCoordHeight;
+ }
+ if ( nFirstAdjustmentValue >= 0 )
+ {
+ if ( aHandle.nFlags & HANDLE_FLAGS_RANGE_X_MINIMUM ) // check if horizontal handle needs to be within a range
{
- double fMin;
- GetParameter( fMin, aHandle.aRadiusRangeMinimum, sal_False, sal_False );
- if ( fRadius < fMin )
- fRadius = fMin;
+ double fXMin;
+ GetParameter( fXMin, aHandle.aXRangeMinimum, sal_False, sal_False );
+ if ( fPos1 < fXMin )
+ fPos1 = fXMin;
}
- if ( aHandle.nFlags & HANDLE_FLAGS_RADIUS_RANGE_MAXIMUM )
+ if ( aHandle.nFlags & HANDLE_FLAGS_RANGE_X_MAXIMUM ) // check if horizontal handle needs to be within a range
{
- double fMax;
- GetParameter( fMax, aHandle.aRadiusRangeMaximum, sal_False, sal_False );
- if ( fRadius > fMax )
- fRadius = fMax;
+ double fXMax;
+ GetParameter( fXMax, aHandle.aXRangeMaximum, sal_False, sal_False );
+ if ( fPos1 > fXMax )
+ fPos1 = fXMax;
}
- if ( bAdjFirst )
- SetAdjustValueAsDouble( fRadius, nFirstAdjustmentValue );
- if ( bAdjSecond )
- SetAdjustValueAsDouble( fAngle, nSecondAdjustmentValue );
+ SetAdjustValueAsDouble( fPos1, nFirstAdjustmentValue );
}
- else
+ if ( nSecondAdjustmentValue >= 0 )
{
- if ( bAdjFirst )
+ if ( aHandle.nFlags & HANDLE_FLAGS_RANGE_Y_MINIMUM ) // check if vertical handle needs to be within a range
{
- if ( aHandle.nFlags & HANDLE_FLAGS_RANGE_X_MINIMUM ) // check if horizontal handle needs to be within a range
- {
- double fXMin;
- GetParameter( fXMin, aHandle.aXRangeMinimum, sal_False, sal_False );
- if ( fPos1 < fXMin )
- fPos1 = fXMin;
- }
- if ( aHandle.nFlags & HANDLE_FLAGS_RANGE_X_MAXIMUM ) // check if horizontal handle needs to be within a range
- {
- double fXMax;
- GetParameter( fXMax, aHandle.aXRangeMaximum, sal_False, sal_False );
- if ( fPos1 > fXMax )
- fPos1 = fXMax;
- }
- SetAdjustValueAsDouble( fPos1, nFirstAdjustmentValue );
+ double fYMin;
+ GetParameter( fYMin, aHandle.aYRangeMinimum, sal_False, sal_False );
+ if ( fPos2 < fYMin )
+ fPos2 = fYMin;
}
- if ( bAdjSecond )
+ if ( aHandle.nFlags & HANDLE_FLAGS_RANGE_Y_MAXIMUM ) // check if vertical handle needs to be within a range
{
- if ( aHandle.nFlags & HANDLE_FLAGS_RANGE_Y_MINIMUM ) // check if vertical handle needs to be within a range
- {
- double fYMin;
- GetParameter( fYMin, aHandle.aYRangeMinimum, sal_False, sal_False );
- if ( fPos2 < fYMin )
- fPos2 = fYMin;
- }
- if ( aHandle.nFlags & HANDLE_FLAGS_RANGE_Y_MAXIMUM ) // check if vertical handle needs to be within a range
- {
- double fYMax;
- GetParameter( fYMax, aHandle.aYRangeMaximum, sal_False, sal_False );
- if ( fPos2 > fYMax )
- fPos2 = fYMax;
- }
- SetAdjustValueAsDouble( fPos2, nSecondAdjustmentValue );
+ double fYMax;
+ GetParameter( fYMax, aHandle.aYRangeMaximum, sal_False, sal_False );
+ if ( fPos2 > fYMax )
+ fPos2 = fYMax;
}
+ SetAdjustValueAsDouble( fPos2, nSecondAdjustmentValue );
}
- // and writing them back into the GeometryItem
- SdrCustomShapeGeometryItem aGeometryItem((SdrCustomShapeGeometryItem&)
- (const SdrCustomShapeGeometryItem&)pCustomShapeObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ));
- const rtl::OUString sAdjustmentValues( RTL_CONSTASCII_USTRINGPARAM ( "AdjustmentValues" ) );
- com::sun::star::beans::PropertyValue aPropVal;
- aPropVal.Name = sAdjustmentValues;
- aPropVal.Value <<= seqAdjustmentValues;
- aGeometryItem.SetPropertyValue( aPropVal );
- pCustomShapeObj->SetMergedItem( aGeometryItem );
- bRetValue = sal_True;
}
+ // and writing them back into the GeometryItem
+ SdrCustomShapeGeometryItem aGeometryItem((SdrCustomShapeGeometryItem&)
+ (const SdrCustomShapeGeometryItem&)pCustomShapeObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ));
+ const rtl::OUString sAdjustmentValues( RTL_CONSTASCII_USTRINGPARAM ( "AdjustmentValues" ) );
+ com::sun::star::beans::PropertyValue aPropVal;
+ aPropVal.Name = sAdjustmentValues;
+ aPropVal.Value <<= seqAdjustmentValues;
+ aGeometryItem.SetPropertyValue( aPropVal );
+ pCustomShapeObj->SetMergedItem( aGeometryItem );
+ bRetValue = sal_True;
}
}
return bRetValue;
diff --git a/svx/source/dialog/docrecovery.src b/svx/source/dialog/docrecovery.src
index 5bcde8bdf071..7c1532b71b55 100644
--- a/svx/source/dialog/docrecovery.src
+++ b/svx/source/dialog/docrecovery.src
@@ -370,7 +370,7 @@ TabPage RID_SVXPAGE_ERR_REP_WELCOME
Pos = MAP_APPFONT( RECOV_COL1, RECOV_ROW2 );
Size = MAP_APPFONT( RECOV_CONTROLWIDTH, (RECOV_ROW7-RECOV_ROW2-RSC_SP_CTRL_Y) );
WordBreak = TRUE;
- Text[ en-US ] = "This error report tool gathers information about how %PRODUCTNAME is working and sends it to Sun Microsystems to help improve future versions.\n\nIt's easy - just send the report without any further effort on your part by clicking 'Send' in the next dialog, or you can briefly describe how the error occurred and then click 'Send'. If you want to see the report, click the 'Show Report' button. No data will be sent if you click 'Do Not Send'.\n\nCustomer Privacy\nThe information gathered is limited to data concerning the state of %PRODUCTNAME %PRODUCTVERSION when the error occurred. Other information about passwords or document contents is not collected.\n\nThe information will only be used to improve the quality of %PRODUCTNAME and will not be shared with third parties.\nFor more information on Sun Microsystems' privacy policy, visit\nhttp://www.sun.com/privacy/";
+ Text[ en-US ] = "This error report tool gathers information about how %PRODUCTNAME is working and sends it to Oracle to help improve future versions.\n\nIt's easy - just send the report without any further effort on your part by clicking 'Send' in the next dialog, or you can briefly describe how the error occurred and then click 'Send'. If you want to see the report, click the 'Show Report' button. No data will be sent if you click 'Do Not Send'.\n\nCustomer Privacy\nThe information gathered is limited to data concerning the state of %PRODUCTNAME %PRODUCTVERSION when the error occurred. Other information about passwords or document contents is not collected.\n\nThe information will only be used to improve the quality of %PRODUCTNAME and will not be shared with third parties.\nFor more information on Oracle's privacy policy, visit\nwww.oracle.com/html/services-privacy-policy.html";
};
FixedLine FL_RECOV_BOTTOM
{
@@ -472,7 +472,7 @@ TabPage RID_SVXPAGE_ERR_REP_SEND
Pos = MAP_APPFONT( ERRSEND_COL0, ERRSEND_ROW12 );
Size = MAP_APPFONT( ERRSEND_CONTROLWIDTH2, RSC_CD_CHECKBOX_HEIGHT );
Check = FALSE;
- Text[ en-US ] = "~I allow Sun Microsystems to contact me regarding this report.";
+ Text[ en-US ] = "~I allow Oracle to contact me regarding this report.";
};
FixedText FT_ERRSEND_EMAILADDR
{
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index de6924c3147b..2da5df325dfa 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -37,6 +37,8 @@
#include <vcl/msgbox.hxx>
#include <vcl/graph.hxx>
+#include <sfx2/sfxsids.hrc>
+#include <svx/svxids.hrc>
#include <svx/dialogs.hrc>
#include "hdft.hrc"
#include <svl/intitem.hxx>
diff --git a/svx/source/dialog/makefile.mk b/svx/source/dialog/makefile.mk
index 01951caa1471..ac608fae8ec8 100644
--- a/svx/source/dialog/makefile.mk
+++ b/svx/source/dialog/makefile.mk
@@ -74,6 +74,7 @@ SRC2FILES = \
LIB1TARGET=$(SLB)$/$(TARGET)-core.lib
LIB1OBJFILES= \
+ $(SLO)$/checklbx.obj \
$(SLO)$/dialmgr.obj\
$(SLO)$/dlgutil.obj \
$(SLO)$/framelink.obj\
@@ -86,7 +87,6 @@ LIB2TARGET=$(SLB)$/$(TARGET).lib
LIB2OBJFILES= \
$(SLO)$/charmap.obj \
- $(SLO)$/checklbx.obj \
$(SLO)$/connctrl.obj \
$(SLO)$/contwnd.obj \
$(SLO)$/ctredlin.obj \
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index ccf326ca77b1..67a50363e6c3 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -831,6 +831,18 @@ void SvxSearchDialog::CalculateDelta_Impl()
pMoreBtn->AddWindow( &aNoFormatBtn );
}
+ if (bDrawApp || bImpressApp)
+ {
+ // "Find All" button is hidden--align "Find" vertically to the
+ // search listbox
+ Point aNewPt(aSearchBtn.GetPosPixel());
+ const Size aBtnSz(aSearchBtn.GetSizePixel());
+ const Size aLBSz(aSearchLB.GetSizePixel());
+ const int nOff((aLBSz.Height() - aBtnSz.Height()) / 2);
+ aNewPt.Y() = aSearchLB.GetPosPixel().Y() + nOff;
+ aSearchBtn.SetPosPixel(aNewPt);
+ }
+
if ( bDrawApp )
{
// Draw App: "Regular expressions" and "Search for Styles" check boxes are hidden
@@ -1016,6 +1028,8 @@ void SvxSearchDialog::Init_Impl( int bSearchPattern )
if ( pSearchItem->GetAppFlag() == SVX_SEARCHAPP_DRAW )
{
+ aSearchAllBtn.Hide();
+
aRegExpBtn.Hide();
aLayoutBtn.Hide();
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 36067cc78221..2e1a68723f67 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -1214,9 +1214,7 @@ void SvxRuler::UpdateTabs()
long nRightFrameMargin = GetRightFrameMargin();
//#i24363# tab stops relative to indent
- const long nParaItemTxtLeft = pRuler_Imp->bIsTabsRelativeToIndent ?
- pParaItem->GetTxtLeft() :
- 0;
+ const long nParaItemTxtLeft = pParaItem->GetTxtLeft();
const long lParaIndent = nLeftFrameMargin + nParaItemTxtLeft;
@@ -1253,7 +1251,7 @@ void SvxRuler::UpdateTabs()
const SvxTabStop *pTab = &(*pTabStopItem)[j];
pTabs[nTabCount+TAB_GAP].nPos =
ConvertHPosPixel(
- lParaIndent + pTab->GetTabPos() + lAppNullOffset);
+ (pRuler_Imp->bIsTabsRelativeToIndent ? lParaIndent : 0 ) + pTab->GetTabPos() + lAppNullOffset);
if(bRTL)
{
pTabs[nTabCount+TAB_GAP].nPos = lParaIndentPix + lRightPixMargin - pTabs[nTabCount+TAB_GAP].nPos;
@@ -1286,13 +1284,37 @@ void SvxRuler::UpdateTabs()
{
for(j = 0; j < nDefTabBuf; ++j)
{
- pTabs[nTabCount + TAB_GAP].nPos =
+ if( j == 0 )
+ {
+ //set the first default tab stop
+ if(pRuler_Imp->bIsTabsRelativeToIndent)
+ {
+ pTabs[nTabCount + TAB_GAP].nPos =
+ (pTabs[nTabCount].nPos + nDefTabDist);
+ pTabs[nTabCount + TAB_GAP].nPos -=
+ ((pTabs[nTabCount + TAB_GAP].nPos - lParaIndentPix)
+ % nDefTabDist );
+ }
+ else
+ {
+ if( pTabs[nTabCount].nPos < 0 )
+ {
+ pTabs[nTabCount + TAB_GAP].nPos = ( pTabs[nTabCount].nPos / nDefTabDist ) * nDefTabDist;
+ }
+ else
+ {
+ pTabs[nTabCount + TAB_GAP].nPos = ( pTabs[nTabCount].nPos / nDefTabDist + 1 ) * nDefTabDist;
+ }
+ }
+
+ }
+ else
+ {
+ //simply add the default distance to the last position
+ pTabs[nTabCount + TAB_GAP].nPos =
pTabs[nTabCount].nPos + nDefTabDist;
+ }
- if(j == 0 )
- pTabs[nTabCount + TAB_GAP].nPos -=
- ((pTabs[nTabCount + TAB_GAP].nPos - lParaIndentPix)
- % nDefTabDist );
if(pTabs[nTabCount+TAB_GAP].nPos >= lRightIndent)
break;
pTabs[nTabCount + TAB_GAP].nStyle = RULER_TAB_DEFAULT;
diff --git a/svx/source/engine3d/makefile.mk b/svx/source/engine3d/makefile.mk
index 6e6e3f97c550..71916df4a83c 100644
--- a/svx/source/engine3d/makefile.mk
+++ b/svx/source/engine3d/makefile.mk
@@ -64,18 +64,10 @@ LIB1OBJFILES= \
LIB2TARGET= $(SLB)$/$(TARGET).lib
LIB2OBJFILES= \
- $(SLO)$/volume3d.obj \
- $(SLO)$/viewpt3d.obj \
$(SLO)$/float3d.obj
SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
-#disable optimizer for MSCompiler and ICC
-.IF "$(COM)"=="ICC" || "$(COM)"=="MSC"
-NOOPTFILES=\
- $(SLO)$/viewpt3d.obj
-.ENDIF
-
SRS1NAME=engine3d
SRC1FILES=\
string3d.src \
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index ae81680ca5be..480d49171eb5 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -336,8 +336,18 @@ UINT16 E3dScene::GetObjIdentifier() const
void E3dScene::SetBoundRectDirty()
{
- // avoid resetting aOutRect which in case of this object is model data,
- // not re-creatable view data
+ E3dScene* pScene = GetScene();
+
+ if(pScene == this)
+ {
+ // avoid resetting aOutRect which in case of a 3D scene used as 2d object
+ // is model data,not re-creatable view data
+ }
+ else
+ {
+ // if not the outmost scene it is used as group in 3d, call parent
+ E3dObject::SetBoundRectDirty();
+ }
}
/*************************************************************************
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index cb1165267739..c69abb362754 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -75,6 +75,7 @@
#include <svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
#define ITEMVALUE(ItemSet,Id,Cast) ((const Cast&)(ItemSet).Get(Id)).GetValue()
@@ -1066,77 +1067,39 @@ void E3dView::ConvertMarkedObjTo3D(BOOL bExtrude, basegfx::B2DPoint aPnt1, baseg
struct E3dDepthNeighbour
{
- E3dDepthNeighbour* pNext;
- E3dExtrudeObj* pObj;
-
- E3dDepthNeighbour() { pNext = NULL; pObj = NULL; }
+ E3dDepthNeighbour* mpNext;
+ E3dExtrudeObj* mpObj;
+ basegfx::B2DPolyPolygon maPreparedPolyPolygon;
+
+ E3dDepthNeighbour()
+ : mpNext(0),
+ mpObj(0),
+ maPreparedPolyPolygon()
+ {
+ }
};
struct E3dDepthLayer
{
- E3dDepthLayer* pDown;
- E3dDepthNeighbour* pNext;
-
- E3dDepthLayer() { pDown = NULL; pNext = NULL; }
- ~E3dDepthLayer() { while(pNext) { E3dDepthNeighbour* pSucc = pNext->pNext; delete pNext; pNext = pSucc; }}
-};
-
-bool ImpDoesOverlap(const basegfx::B2DPolygon& rPolygonA, const basegfx::B2DPolygon& rPolygonB)
-{
- bool bRetval(false);
- const basegfx::B2DRange aRangeA(basegfx::tools::getRange(rPolygonA));
- const basegfx::B2DRange aRangeB(basegfx::tools::getRange(rPolygonB));
+ E3dDepthLayer* mpDown;
+ E3dDepthNeighbour* mpNext;
- if(aRangeA.overlaps(aRangeB))
+ E3dDepthLayer()
+ : mpDown(0),
+ mpNext(0)
{
- // A in B ?
- if(basegfx::tools::isInside(rPolygonA, rPolygonB))
- return true;
-
- // B in A ?
- if(basegfx::tools::isInside(rPolygonB, rPolygonA))
- return true;
-
- // A and B the same ?
- if(basegfx::tools::isInside(rPolygonB, rPolygonA, true))
- return true;
}
- return bRetval;
-}
-
-bool ImpDoesOverlap(const basegfx::B2DPolyPolygon& rPolyPolygonA, const basegfx::B2DPolyPolygon& rPolyPolygonB)
-{
- bool bRetval(false);
- const basegfx::B2DRange aRangeA(basegfx::tools::getRange(rPolyPolygonA));
- const basegfx::B2DRange aRangeB(basegfx::tools::getRange(rPolyPolygonB));
-
- if(aRangeA.overlaps(aRangeB))
+ ~E3dDepthLayer()
{
- const sal_uInt32 nCntA(rPolyPolygonA.count());
- const sal_uInt32 nCntB(rPolyPolygonB.count());
-
- for(sal_uInt32 a(0L); !bRetval && a < nCntA; a++)
+ while(mpNext)
{
- const basegfx::B2DPolygon aPolygonA(rPolyPolygonA.getB2DPolygon(a));
-
- if(aPolygonA.isClosed())
- {
- for(sal_uInt32 b(0L); !bRetval && b < nCntB; b++)
- {
- const basegfx::B2DPolygon aPolygonB(rPolyPolygonB.getB2DPolygon(b));
-
- if(aPolygonB.isClosed())
- {
- bRetval = ImpDoesOverlap(aPolygonA, aPolygonB);
- }
- }
- }
+ E3dDepthNeighbour* pSucc = mpNext->mpNext;
+ delete mpNext;
+ mpNext = pSucc;
}
}
-
- return bRetval;
-}
+};
void E3dView::DoDepthArrange(E3dScene* pScene, double fDepth)
{
@@ -1147,39 +1110,41 @@ void E3dView::DoDepthArrange(E3dScene* pScene, double fDepth)
E3dDepthLayer* pBaseLayer = NULL;
E3dDepthLayer* pLayer = NULL;
INT32 nNumLayers = 0;
- //SfxItemPool& rPool = pMod->GetItemPool();
while(aIter.IsMore())
{
- E3dObject* pSubObj = (E3dObject*)aIter.Next();
+ E3dExtrudeObj* pExtrudeObj = dynamic_cast< E3dExtrudeObj* >(aIter.Next());
- if(pSubObj && pSubObj->ISA(E3dExtrudeObj))
+ if(pExtrudeObj)
{
- E3dExtrudeObj* pExtrudeObj = (E3dExtrudeObj*)pSubObj;
- const basegfx::B2DPolyPolygon aExtrudePoly(pExtrudeObj->GetExtrudePolygon());
-
+ const basegfx::B2DPolyPolygon aExtrudePoly(
+ basegfx::tools::prepareForPolygonOperation(pExtrudeObj->GetExtrudePolygon()));
const SfxItemSet& rLocalSet = pExtrudeObj->GetMergedItemSet();
- XFillStyle eLocalFillStyle = ITEMVALUE(rLocalSet, XATTR_FILLSTYLE, XFillStyleItem);
- Color aLocalColor = ((const XFillColorItem&)(rLocalSet.Get(XATTR_FILLCOLOR))).GetColorValue();
+ const XFillStyle eLocalFillStyle = ITEMVALUE(rLocalSet, XATTR_FILLSTYLE, XFillStyleItem);
+ const Color aLocalColor = ((const XFillColorItem&)(rLocalSet.Get(XATTR_FILLCOLOR))).GetColorValue();
- // ExtrudeObj einordnen
+ // sort in ExtrudeObj
if(pLayer)
{
- // Gibt es eine Ueberschneidung mit einem Objekt dieses
- // Layers?
- BOOL bOverlap(FALSE);
- E3dDepthNeighbour* pAct = pLayer->pNext;
+ // do we have overlap with an object of this layer?
+ bool bOverlap(false);
+ E3dDepthNeighbour* pAct = pLayer->mpNext;
while(!bOverlap && pAct)
{
- // ueberlappen sich pAct->pObj und pExtrudeObj ?
- const basegfx::B2DPolyPolygon aActPoly(pAct->pObj->GetExtrudePolygon());
- bOverlap = ImpDoesOverlap(aExtrudePoly, aActPoly);
+ // do pAct->mpObj and pExtrudeObj overlap? Check by
+ // using logical AND clipping
+ const basegfx::B2DPolyPolygon aAndPolyPolygon(
+ basegfx::tools::solvePolygonOperationAnd(
+ aExtrudePoly,
+ pAct->maPreparedPolyPolygon));
+
+ bOverlap = (0 != aAndPolyPolygon.count());
if(bOverlap)
{
// second ciriteria: is another fillstyle or color used?
- const SfxItemSet& rCompareSet = pAct->pObj->GetMergedItemSet();
+ const SfxItemSet& rCompareSet = pAct->mpObj->GetMergedItemSet();
XFillStyle eCompareFillStyle = ITEMVALUE(rCompareSet, XATTR_FILLSTYLE, XFillStyleItem);
@@ -1201,71 +1166,74 @@ void E3dView::DoDepthArrange(E3dScene* pScene, double fDepth)
}
}
- pAct = pAct->pNext;
+ pAct = pAct->mpNext;
}
if(bOverlap)
{
- // ja, beginne einen neuen Layer
- pLayer->pDown = new E3dDepthLayer;
- pLayer = pLayer->pDown;
+ // yes, start a new layer
+ pLayer->mpDown = new E3dDepthLayer;
+ pLayer = pLayer->mpDown;
nNumLayers++;
- pLayer->pNext = new E3dDepthNeighbour;
- pLayer->pNext->pObj = pExtrudeObj;
+ pLayer->mpNext = new E3dDepthNeighbour;
+ pLayer->mpNext->mpObj = pExtrudeObj;
+ pLayer->mpNext->maPreparedPolyPolygon = aExtrudePoly;
}
else
{
- // nein, Objekt kann in aktuellen Layer
+ // no, add to current layer
E3dDepthNeighbour* pNewNext = new E3dDepthNeighbour;
- pNewNext->pObj = pExtrudeObj;
- pNewNext->pNext = pLayer->pNext;
- pLayer->pNext = pNewNext;
+ pNewNext->mpObj = pExtrudeObj;
+ pNewNext->maPreparedPolyPolygon = aExtrudePoly;
+ pNewNext->mpNext = pLayer->mpNext;
+ pLayer->mpNext = pNewNext;
}
}
else
{
- // erster Layer ueberhaupt
+ // first layer ever
pBaseLayer = new E3dDepthLayer;
pLayer = pBaseLayer;
nNumLayers++;
- pLayer->pNext = new E3dDepthNeighbour;
- pLayer->pNext->pObj = pExtrudeObj;
+ pLayer->mpNext = new E3dDepthNeighbour;
+ pLayer->mpNext->mpObj = pExtrudeObj;
+ pLayer->mpNext->maPreparedPolyPolygon = aExtrudePoly;
}
}
}
- // Anzahl Layer steht fest
+ // number of layers is done
if(nNumLayers > 1)
{
- // Arrangement ist notwendig
+ // need to be arranged
double fMinDepth = fDepth * 0.8;
double fStep = (fDepth - fMinDepth) / (double)nNumLayers;
pLayer = pBaseLayer;
while(pLayer)
{
- // an pLayer entlangspazieren
- E3dDepthNeighbour* pAct = pLayer->pNext;
+ // move along layer
+ E3dDepthNeighbour* pAct = pLayer->mpNext;
while(pAct)
{
- // Anpassen
- pAct->pObj->SetMergedItem(SfxUInt32Item(SDRATTR_3DOBJ_DEPTH, sal_uInt32(fMinDepth + 0.5)));
+ // adapt extrude value
+ pAct->mpObj->SetMergedItem(SfxUInt32Item(SDRATTR_3DOBJ_DEPTH, sal_uInt32(fMinDepth + 0.5)));
- // Naechster Eintrag
- pAct = pAct->pNext;
+ // next
+ pAct = pAct->mpNext;
}
- // naechster Layer
- pLayer = pLayer->pDown;
+ // next layer
+ pLayer = pLayer->mpDown;
fMinDepth += fStep;
}
}
- // angelegte Strukturen aufraeumen
+ // cleanup
while(pBaseLayer)
{
- pLayer = pBaseLayer->pDown;
+ pLayer = pBaseLayer->mpDown;
delete pBaseLayer;
pBaseLayer = pLayer;
}
diff --git a/svx/source/engine3d/volume3d.cxx b/svx/source/engine3d/volume3d.cxx
deleted file mode 100644
index 04a94b1705f5..000000000000
--- a/svx/source/engine3d/volume3d.cxx
+++ /dev/null
@@ -1,32 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <svx/volume3d.hxx>
-
-// eof
diff --git a/svx/source/fmcomp/dbaexchange.cxx b/svx/source/fmcomp/dbaexchange.cxx
index 672dd32d28b5..0a6e36219ed3 100644
--- a/svx/source/fmcomp/dbaexchange.cxx
+++ b/svx/source/fmcomp/dbaexchange.cxx
@@ -135,30 +135,19 @@ namespace svx
{
try
{
- // need a query composer for this
- Reference< XSQLQueryComposerFactory > xComposerFac;
- _rxForm->getPropertyValue(FM_PROP_ACTIVE_CONNECTION) >>= xComposerFac;
- Reference< XSQLQueryComposer > xComposer;
- if (xComposerFac.is())
- xComposer = xComposerFac->createQueryComposer();
-
- if (xComposer.is())
+ Reference< XTablesSupplier > xSupTab;
+ _rxForm->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SingleSelectQueryComposer"))) >>= xSupTab;
+
+ if(xSupTab.is())
{
- ::rtl::OUString sActiveCommand;
- _rxForm->getPropertyValue(FM_PROP_ACTIVECOMMAND) >>= sActiveCommand;
- xComposer->setQuery(sActiveCommand);
- Reference< XTablesSupplier > xSupTab(xComposer, UNO_QUERY);
- if(xSupTab.is())
+ Reference< XNameAccess > xNames = xSupTab->getTables();
+ if (xNames.is())
{
- Reference< XNameAccess > xNames = xSupTab->getTables();
- if (xNames.is())
+ Sequence< ::rtl::OUString > aTables = xNames->getElementNames();
+ if (1 == aTables.getLength())
{
- Sequence< ::rtl::OUString > aTables = xNames->getElementNames();
- if (1 == aTables.getLength())
- {
- sCommand = aTables[0];
- nCommandType = CommandType::TABLE;
- }
+ sCommand = aTables[0];
+ nCommandType = CommandType::TABLE;
}
}
}
@@ -457,34 +446,10 @@ namespace svx
String sObjectKind = (CommandType::TABLE == nObjectType) ? String('1') : String('0');
// check if the SQL-statement is modified
- sal_Bool bHasFilterOrSort(sal_False);
::rtl::OUString sCompleteStatement;
try
{
- ::rtl::OUString sFilter, sSort;
- if (::cppu::any2bool(_rxLivingForm->getPropertyValue(FM_PROP_APPLYFILTER)))
- _rxLivingForm->getPropertyValue(FM_PROP_FILTER) >>= sFilter;
- _rxLivingForm->getPropertyValue(FM_PROP_SORT) >>= sSort;
- bHasFilterOrSort = (sFilter.getLength()>0) || (sSort.getLength()>0);
-
_rxLivingForm->getPropertyValue(FM_PROP_ACTIVECOMMAND) >>= sCompleteStatement;
-
- // create a composer
- Reference< XSQLQueryComposerFactory > xFactory( xConnection, UNO_QUERY );
- Reference< XSQLQueryComposer > xComposer;
- if (xFactory.is())
- xComposer = xFactory->createQueryComposer();
-
- // let the composer compose
- if (xComposer.is())
- {
- xComposer->setQuery(sCompleteStatement);
- xComposer->setFilter(sFilter);
- xComposer->setOrder(sSort);
- sCompleteStatement = xComposer->getComposedQuery();
- }
- // Usually, I would expect the result of the composing to be the same as the ActiveCommand property
- // But this code here is pretty old, and I don't know wha the side effects are if I remove it now ...
}
catch(Exception&)
{
@@ -496,7 +461,7 @@ namespace svx
,sConnectionResource
,nObjectType
,sObjectName,xConnection
- ,!((CommandType::QUERY == nObjectType) && !bHasFilterOrSort)
+ ,!((CommandType::QUERY == nObjectType))
,sCompleteStatement);
}
diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx
index 82d0b538ce38..618c2135652a 100644
--- a/svx/source/fmcomp/fmgridcl.cxx
+++ b/svx/source/fmcomp/fmgridcl.cxx
@@ -210,10 +210,11 @@ void FmGridHeader::RequestHelp( const HelpEvent& rHEvt )
Reference< ::com::sun::star::container::XIndexContainer > xColumns(static_cast<FmGridControl*>(GetParent())->GetPeer()->getColumns());
try
{
- Reference< ::com::sun::star::beans::XPropertySet > xColumn;
- ::cppu::extractInterface(xColumn, xColumns->getByIndex(nPos));
+ Reference< ::com::sun::star::beans::XPropertySet > xColumn(xColumns->getByIndex(nPos),UNO_QUERY);
::rtl::OUString aHelpText;
xColumn->getPropertyValue(FM_PROP_HELPTEXT) >>= aHelpText;
+ if ( !aHelpText.getLength() )
+ xColumn->getPropertyValue(FM_PROP_DESCRIPTION) >>= aHelpText;
if ( aHelpText.getLength() )
{
if ( rHEvt.GetMode() & HELPMODE_BALLOON )
@@ -1737,11 +1738,12 @@ void FmGridControl::InitColumnByField(
_pColumn->SetObject( (sal_Int16)nFieldPos );
return;
}
-
+/*
// handle readonly columns
sal_Bool bReadOnly = sal_True;
xField->getPropertyValue( FM_PROP_ISREADONLY ) >>= bReadOnly;
_pColumn->SetReadOnly( bReadOnly );
+*/
}
// the control type is determined by the ColumnServiceName
@@ -1999,7 +2001,11 @@ namespace
{
Reference<XPropertySet> xProp(GetPeer()->getColumns(),UNO_QUERY);
if ( xProp.is() )
+ {
xProp->getPropertyValue(FM_PROP_HELPTEXT) >>= sRetText;
+ if ( !sRetText.getLength() )
+ xProp->getPropertyValue(FM_PROP_DESCRIPTION) >>= sRetText;
+ }
}
break;
case ::svt::BBTYPE_COLUMNHEADERCELL:
@@ -2008,6 +2014,13 @@ namespace
GetModelColumnPos(
sal::static_int_cast< sal_uInt16 >(_nPosition)),
FM_PROP_HELPTEXT);
+ if ( !sRetText.getLength() )
+ sRetText = getColumnPropertyFromPeer(
+ GetPeer(),
+ GetModelColumnPos(
+ sal::static_int_cast< sal_uInt16 >(_nPosition)),
+ FM_PROP_DESCRIPTION);
+
break;
default:
sRetText = DbGridControl::GetAccessibleObjectDescription(_eObjType,_nPosition);
@@ -2029,7 +2042,7 @@ void FmGridControl::Select()
// die HandleColumn wird nicht selektiert
switch (nSelectedColumn)
{
- case -1 : break; // no selection
+ case SAL_MAX_UINT16: break; // no selection
case 0 : nSelectedColumn = SAL_MAX_UINT16; break;
// handle col can't be seledted
default :
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index debc0c8da2b1..809f618b628d 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -45,6 +45,8 @@
#include <com/sun/star/form/XBoundComponent.hpp>
#include <com/sun/star/script/XEventAttacherManager.hpp>
#include <com/sun/star/sdb/XSQLQueryComposerFactory.hpp>
+#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
+#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/XStatement.hpp>
@@ -82,6 +84,7 @@ using namespace ::svt;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::form;
@@ -551,6 +554,7 @@ TYPEINIT1( DbFilterField, DbCellControl )
//------------------------------------------------------------------------------
DbCellControl::DbCellControl( DbGridColumn& _rColumn, sal_Bool /*_bText*/ )
:OPropertyChangeListener(m_aMutex)
+ ,m_pFieldChangeBroadcaster(NULL)
,m_bTransparent( sal_False )
,m_bAlignedController( sal_True )
,m_bAccessingValueProperty( sal_False )
@@ -574,6 +578,27 @@ DbCellControl::DbCellControl( DbGridColumn& _rColumn, sal_Bool /*_bText*/ )
implDoPropertyListening( FM_PROP_STATE, sal_False );
implDoPropertyListening( FM_PROP_TEXT, sal_False );
implDoPropertyListening( FM_PROP_EFFECTIVE_VALUE, sal_False );
+
+ // be listener at the bound field as well
+ try
+ {
+ Reference< XPropertySetInfo > xPSI( xColModelProps->getPropertySetInfo(), UNO_SET_THROW );
+ if ( xPSI->hasPropertyByName( FM_PROP_BOUNDFIELD ) )
+ {
+ Reference< XPropertySet > xField;
+ xColModelProps->getPropertyValue( FM_PROP_BOUNDFIELD ) >>= xField;
+ if ( xField.is() )
+ {
+ m_pFieldChangeBroadcaster = new ::comphelper::OPropertyChangeMultiplexer(this, xField);
+ m_pFieldChangeBroadcaster->acquire();
+ m_pFieldChangeBroadcaster->addProperty( FM_PROP_ISREADONLY );
+ }
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_ERROR( "DbCellControl::doPropertyListening: caught an exception!" );
+ }
}
}
@@ -605,17 +630,22 @@ void DbCellControl::doPropertyListening( const ::rtl::OUString& _rPropertyName )
{
implDoPropertyListening( _rPropertyName );
}
-
//------------------------------------------------------------------------------
-DbCellControl::~DbCellControl()
+void lcl_clearBroadCaster(::comphelper::OPropertyChangeMultiplexer*& _pBroadcaster)
{
- if ( m_pModelChangeBroadcaster )
+ if ( _pBroadcaster )
{
- m_pModelChangeBroadcaster->dispose();
- m_pModelChangeBroadcaster->release();
- m_pModelChangeBroadcaster = NULL;
+ _pBroadcaster->dispose();
+ _pBroadcaster->release();
+ _pBroadcaster = NULL;
// no delete, this is done implicitly
}
+}
+//------------------------------------------------------------------------------
+DbCellControl::~DbCellControl()
+{
+ lcl_clearBroadCaster(m_pModelChangeBroadcaster);
+ lcl_clearBroadCaster(m_pFieldChangeBroadcaster);
delete m_pWindow;
delete m_pPainter;
@@ -660,7 +690,14 @@ void DbCellControl::_propertyChanged(const PropertyChangeEvent& _rEvent) throw(R
}
else if ( _rEvent.PropertyName.equals( FM_PROP_READONLY ) )
{
- implAdjustReadOnly( xSourceProps );
+ implAdjustReadOnly( xSourceProps, true);
+ }
+ else if ( _rEvent.PropertyName.equals( FM_PROP_ISREADONLY ) )
+ {
+ sal_Bool bReadOnly = sal_True;
+ _rEvent.NewValue >>= bReadOnly;
+ m_rColumn.SetReadOnly(bReadOnly);
+ implAdjustReadOnly( xSourceProps, false);
}
else if ( _rEvent.PropertyName.equals( FM_PROP_ENABLED ) )
{
@@ -798,7 +835,7 @@ void DbCellControl::ImplInitWindow( Window& rParent, const InitWindowFacet _eIni
}
//------------------------------------------------------------------------------
-void DbCellControl::implAdjustReadOnly( const Reference< XPropertySet >& _rxModel )
+void DbCellControl::implAdjustReadOnly( const Reference< XPropertySet >& _rxModel,bool i_bReadOnly )
{
DBG_ASSERT( m_pWindow, "DbCellControl::implAdjustReadOnly: not to be called without window!" );
DBG_ASSERT( _rxModel.is(), "DbCellControl::implAdjustReadOnly: invalid model!" );
@@ -807,9 +844,12 @@ void DbCellControl::implAdjustReadOnly( const Reference< XPropertySet >& _rxMode
Edit* pEditWindow = dynamic_cast< Edit* >( m_pWindow );
if ( pEditWindow )
{
- sal_Bool bReadOnly = sal_True;
- _rxModel->getPropertyValue( FM_PROP_READONLY ) >>= bReadOnly;
- static_cast< Edit* >( m_pWindow )->SetReadOnly( m_rColumn.IsReadOnly() || bReadOnly );
+ sal_Bool bReadOnly = m_rColumn.IsReadOnly();
+ if ( !bReadOnly )
+ {
+ _rxModel->getPropertyValue( i_bReadOnly ? FM_PROP_READONLY : FM_PROP_ISREADONLY) >>= bReadOnly;
+ }
+ static_cast< Edit* >( m_pWindow )->SetReadOnly( bReadOnly );
}
}
}
@@ -846,7 +886,7 @@ void DbCellControl::Init( Window& rParent, const Reference< XRowSet >& _rxCursor
if ( xModelPSI->hasPropertyByName( FM_PROP_READONLY ) )
{
- implAdjustReadOnly( xModel );
+ implAdjustReadOnly( xModel,true );
}
if ( xModelPSI->hasPropertyByName( FM_PROP_ENABLED ) )
@@ -1003,7 +1043,7 @@ double DbCellControl::GetValue(const Reference< ::com::sun::star::sdb::XColumn >
//------------------------------------------------------------------------------
void DbCellControl::invalidatedController()
{
- m_rColumn.GetParent().refreshController(m_rColumn.GetId(), DbGridControl::GrantCellControlAccess());
+ m_rColumn.GetParent().refreshController(m_rColumn.GetId(), DbGridControl::GrantControlAccess());
}
/*************************************************************************/
@@ -3039,43 +3079,22 @@ void DbFilterField::Update()
if (!xForm.is())
return;
- Reference< XConnection > xConnection(getRowSetConnection(xForm));
- if (!xConnection.is())
- return;
-
- Reference< ::com::sun::star::sdb::XSQLQueryComposerFactory > xFactory(xConnection, UNO_QUERY);
- if (!xFactory.is())
- {
- DBG_ERROR("DbFilterField::Update : used the right place to request the ::com::sun::star::sdb::XSQLQueryComposerFactory interface ?");
- return;
- }
-
- Reference< ::com::sun::star::sdb::XSQLQueryComposer > xComposer = xFactory->createQueryComposer();
- try
- {
- Reference< ::com::sun::star::beans::XPropertySet > xFormAsSet(xForm, UNO_QUERY);
- ::rtl::OUString sStatement;
- xFormAsSet->getPropertyValue(FM_PROP_ACTIVECOMMAND) >>= sStatement;
- xComposer->setQuery(sStatement);
- }
- catch(const Exception&)
- {
- ::comphelper::disposeComponent(xComposer);
- return;
- }
+ Reference<XPropertySet> xFormProp(xForm,UNO_QUERY);
+ Reference< XTablesSupplier > xSupTab;
+ xFormProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SingleSelectQueryComposer"))) >>= xSupTab;
- Reference< ::com::sun::star::beans::XPropertySet > xComposerAsSet(xComposer, UNO_QUERY);
- if (!xComposerAsSet.is())
+ Reference< XConnection > xConnection(getRowSetConnection(xForm));
+ if (!xSupTab.is())
return;
// search the field
- Reference< ::com::sun::star::container::XNameAccess > xFieldNames;
- Reference< ::com::sun::star::container::XNameAccess > xTablesNames;
- Reference< ::com::sun::star::beans::XPropertySet > xComposerFieldAsSet;
+ Reference< XColumnsSupplier > xSupCol(xSupTab,UNO_QUERY);
+ Reference< ::com::sun::star::container::XNameAccess > xFieldNames = xSupCol->getColumns();
+ if (!xFieldNames->hasByName(aName))
+ return;
- ::cppu::extractInterface(xFieldNames, xComposerAsSet->getPropertyValue(FM_PROP_SELECTED_FIELDS));
- ::cppu::extractInterface(xTablesNames, xComposerAsSet->getPropertyValue(FM_PROP_SELECTED_TABLES));
- ::cppu::extractInterface(xComposerFieldAsSet, xFieldNames->getByName(aName));
+ Reference< ::com::sun::star::container::XNameAccess > xTablesNames = xSupTab->getTables();
+ Reference< ::com::sun::star::beans::XPropertySet > xComposerFieldAsSet(xFieldNames->getByName(aName),UNO_QUERY);
if (xComposerFieldAsSet.is() && ::comphelper::hasProperty(FM_PROP_TABLENAME, xComposerFieldAsSet) &&
::comphelper::hasProperty(FM_PROP_FIELDSOURCE, xComposerFieldAsSet))
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index fa5a407f76dc..d54b091c6bd2 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -44,6 +44,8 @@
#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/sdb/XResultSetAccess.hpp>
+#include <com/sun/star/sdb/RowChangeAction.hpp>
+#include <com/sun/star/sdb/XRowsChangeBroadcaster.hpp>
#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
#include <com/sun/star/sdbcx/Privilege.hpp>
#include <com/sun/star/container/XChild.hpp>
@@ -102,6 +104,39 @@ using namespace com::sun::star::accessibility;
| BROWSER_VLINESFULL \
| BROWSER_HEADERBAR_NEW \
+class RowSetEventListener : public ::cppu::WeakImplHelper1<XRowsChangeListener>
+{
+ DbGridControl* m_pControl;
+public:
+ RowSetEventListener(DbGridControl* i_pControl) : m_pControl(i_pControl)
+ {
+ }
+private:
+ // XEventListener
+ virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& /*i_aEvt*/) throw ( RuntimeException )
+ {
+ }
+ virtual void SAL_CALL rowsChanged(const ::com::sun::star::sdb::RowsChangeEvent& i_aEvt) throw ( RuntimeException )
+ {
+ if ( i_aEvt.Action == RowChangeAction::UPDATE )
+ {
+ ::DbGridControl::GrantControlAccess aAccess;
+ CursorWrapper* pSeek = m_pControl->GetSeekCursor(aAccess);
+ const DbGridRowRef& rSeekRow = m_pControl->GetSeekRow(aAccess);
+ const Any* pIter = i_aEvt.Bookmarks.getConstArray();
+ const Any* pEnd = pIter + i_aEvt.Bookmarks.getLength();
+ for(;pIter != pEnd;++pIter)
+ {
+ pSeek->moveToBookmark(*pIter);
+ // get the data
+ rSeekRow->SetState(pSeek, sal_True);
+ sal_Int32 nSeekPos = pSeek->getRow() - 1;
+ m_pControl->SetSeekPos(nSeekPos,aAccess);
+ m_pControl->RowModified(nSeekPos);
+ }
+ }
+ }
+};
//==============================================================================
class GridFieldValueListener;
@@ -987,6 +1022,7 @@ DbGridControl::~DbGridControl()
m_pDataSourcePropMultiplexer = NULL;
m_pDataSourcePropListener = NULL;
}
+ m_xRowSetListener.clear();
delete m_pDataCursor;
delete m_pSeekCursor;
@@ -1377,7 +1413,7 @@ sal_Bool DbGridControl::IsPermanentCursorEnabled() const
}
//------------------------------------------------------------------------------
-void DbGridControl::refreshController(sal_uInt16 _nColId, GrantCellControlAccess /*_aAccess*/)
+void DbGridControl::refreshController(sal_uInt16 _nColId, GrantControlAccess /*_aAccess*/)
{
if ((GetCurColumnId() == _nColId) && IsEditing())
{ // the controller which is currently active needs to be refreshed
@@ -1412,6 +1448,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt
m_pDataSourcePropMultiplexer = NULL;
m_pDataSourcePropListener = NULL;
}
+ m_xRowSetListener.clear();
// is the new cursor valid ?
// the cursor is only valid if it contains some columns
@@ -1503,7 +1540,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt
Reference< XPropertySet > xSet(_xCursor, UNO_QUERY);
if (xSet.is())
{
- // feststellen welche Updatem�glichkeiten bestehen
+ // feststellen welche Updatemoeglichkeiten bestehen
sal_Int32 nConcurrency = ResultSetConcurrency::READ_ONLY;
xSet->getPropertyValue(FM_PROP_RESULTSET_CONCURRENCY) >>= nConcurrency;
@@ -1565,6 +1602,12 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt
xSet->getPropertyValue(FM_PROP_ROWCOUNT) >>= nRecordCount;
m_bRecordCountFinal = ::comphelper::getBOOL(xSet->getPropertyValue(FM_PROP_ROWCOUNTFINAL));
+ m_xRowSetListener = new RowSetEventListener(this);
+ Reference< XRowsChangeBroadcaster> xChangeBroad(xSet,UNO_QUERY);
+ if ( xChangeBroad.is( ) )
+ xChangeBroad->addRowsChangeListener(m_xRowSetListener);
+
+
// insert the currently known rows
// and one row if we are able to insert rows
if (m_nOptions & OPT_INSERT)
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 015d19407cc0..47a1436edf26 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -43,7 +43,7 @@
#include <svtools/miscopt.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/viewoptions.hxx>
-#include <svl/svtools.hrc>
+#include <svtools/svtools.hrc>
#include <sfx2/app.hxx>
#include <sfx2/filedlghelper.hxx>
#include <sfx2/objitem.hxx>
@@ -3683,11 +3683,8 @@ namespace svxform
m_aURLED.DisableHistory();
m_aFilePickerBtn.SetClickHdl( LINK( this, AddInstanceDialog, FilePickerHdl ) );
- // load the filter name from svtools resource
- ByteString aResMgrName( "svt" );
- ResMgr* pSvtResMgr = ResMgr::CreateResMgr(
- aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
- m_sAllFilterName = String( ResId( STR_FILTERNAME_ALL, *pSvtResMgr ) );
+ // load the filter name from fps_office resource
+ m_sAllFilterName = String( ResId( STR_FILTERNAME_ALL, *CREATEVERSIONRESMGR(fps_office) ) );
}
AddInstanceDialog::~AddInstanceDialog()
diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx
index e554a4dbf611..e767f7c0b112 100644
--- a/svx/source/form/fmshell.cxx
+++ b/svx/source/form/fmshell.cxx
@@ -78,6 +78,7 @@
#include <svx/fmglob.hxx>
#include <svl/eitem.hxx>
#include <tools/shl.hxx>
+#include <tools/diagnose_ex.h>
#include <svx/svdpage.hxx>
#include <svx/fmmodel.hxx>
#include <svx/dialmgr.hxx>
@@ -98,6 +99,8 @@
#include <svx/svxdlg.hxx> //CHINA001
#include <svx/dialogs.hrc> //CHINA001
+#include "svx/sdrobjectfilter.hxx"
+
#define HANDLE_SQL_ERRORS( action, successflag, context, message ) \
try \
{ \
@@ -540,7 +543,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
case SID_FM_SCROLLBAR:
case SID_FM_SPINBUTTON:
{
- SFX_REQUEST_ARG( rReq, pGrabFocusItem, SfxBoolItem, SID_FM_GRABCONTROLFOCUS, sal_False );
+ SFX_REQUEST_ARG( rReq, pGrabFocusItem, SfxBoolItem, SID_FM_TOGGLECONTROLFOCUS, sal_False );
if ( pGrabFocusItem && pGrabFocusItem->GetValue() )
{ // see below
SfxViewShell* pShell = GetViewShell();
@@ -568,9 +571,9 @@ void FmFormShell::Execute(SfxRequest &rReq)
{
// #99013# if selected with control key, return focus to current view
// do this asynchron, so that the creation can be finished first
- // reusing the SID_FM_GRABCONTROLFOCUS is somewhat hacky ... which it wouldn't if it would have another
+ // reusing the SID_FM_TOGGLECONTROLFOCUS is somewhat hacky ... which it wouldn't if it would have another
// name, so I do not really have a big problem with this ....
- SfxBoolItem aGrabFocusIndicatorItem( SID_FM_GRABCONTROLFOCUS, sal_True );
+ SfxBoolItem aGrabFocusIndicatorItem( SID_FM_TOGGLECONTROLFOCUS, sal_True );
GetViewShell()->GetViewFrame()->GetDispatcher()->Execute( nSlot, SFX_CALLMODE_ASYNCHRON,
&aGrabFocusIndicatorItem, NULL );
}
@@ -591,11 +594,27 @@ void FmFormShell::Execute(SfxRequest &rReq)
}
break;
- case SID_FM_GRABCONTROLFOCUS:
+ case SID_FM_TOGGLECONTROLFOCUS:
{
FmFormView* pFormView = GetFormView();
- if ( pFormView )
+ if ( !pFormView )
+ break;
+
+ // if we execute this ourself, then either the application does not implement an own handling for this,
+ // of we're on the top of the dispatcher stack, which means a control has the focus.
+ // In the latter case, we put the focus to the document window, otherwise, we focus the first control
+ const bool bHasControlFocus = GetImpl()->HasControlFocus();
+ if ( bHasControlFocus )
+ {
+ const OutputDevice* pDevice = GetCurrentViewDevice();
+ Window* pWindow = dynamic_cast< Window* >( const_cast< OutputDevice* >( pDevice ) );
+ if ( pWindow )
+ pWindow->GrabFocus();
+ }
+ else
+ {
pFormView->GrabFirstControlFocus( );
+ }
}
break;
@@ -1349,6 +1368,78 @@ namespace
}
//------------------------------------------------------------------------
+void FmFormShell::ToggleControlFocus( const SdrUnoObj& i_rUnoObject, const SdrView& i_rView, OutputDevice& i_rDevice ) const
+{
+ try
+ {
+ // check if the focus currently is in a control
+ // Well, okay, do it the other way 'round: Check whether the current control of the active controller
+ // actually has the focus. This should be equivalent.
+ const bool bHasControlFocus = GetImpl()->HasControlFocus();
+
+ if ( bHasControlFocus )
+ {
+ Window* pWindow( dynamic_cast< Window* >( &i_rDevice ) );
+ OSL_ENSURE( pWindow, "FmFormShell::ToggleControlFocus: I need a Window, really!" );
+ if ( pWindow )
+ pWindow->GrabFocus();
+ }
+ else
+ {
+ Reference< XControl > xControl;
+ GetFormControl( i_rUnoObject.GetUnoControlModel(), i_rView, i_rDevice, xControl );
+ Reference< XWindow > xControlWindow( xControl, UNO_QUERY );
+ if ( xControlWindow.is() )
+ xControlWindow->setFocus();
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//------------------------------------------------------------------------
+namespace
+{
+ class FocusableControlsFilter : public ::svx::ISdrObjectFilter
+ {
+ public:
+ FocusableControlsFilter( const SdrView& i_rView, const OutputDevice& i_rDevice )
+ :m_rView( i_rView )
+ ,m_rDevice( i_rDevice )
+ {
+ }
+
+ public:
+ virtual bool includeObject( const SdrObject& i_rObject ) const
+ {
+ const SdrUnoObj* pUnoObj = dynamic_cast< const SdrUnoObj* >( &i_rObject );
+ if ( !pUnoObj )
+ return false;
+
+ Reference< XControl > xControl = pUnoObj->GetUnoControl( m_rView, m_rDevice );
+ return FmXFormView::isFocusable( xControl );
+ }
+
+ private:
+ const SdrView& m_rView;
+ const OutputDevice& m_rDevice;
+ };
+}
+
+//------------------------------------------------------------------------
+::std::auto_ptr< ::svx::ISdrObjectFilter > FmFormShell::CreateFocusableControlFilter( const SdrView& i_rView, const OutputDevice& i_rDevice ) const
+{
+ ::std::auto_ptr< ::svx::ISdrObjectFilter > pFilter;
+
+ if ( !i_rView.IsDesignMode() )
+ pFilter.reset( new FocusableControlsFilter( i_rView, i_rDevice ) );
+
+ return pFilter;
+}
+
+//------------------------------------------------------------------------
SdrUnoObj* FmFormShell::GetFormControl( const Reference< XControlModel >& _rxModel, const SdrView& _rView, const OutputDevice& _rDevice, Reference< XControl >& _out_rxControl ) const
{
if ( !_rxModel.is() )
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 888c30969f6b..95ce818c4a86 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -56,6 +56,7 @@
#include "svx/svxids.hrc"
/** === begin UNO includes === **/
+#include <com/sun/star/awt/XWindow2.hpp>
#include <com/sun/star/awt/XCheckBox.hpp>
#include <com/sun/star/awt/XListBox.hpp>
#include <com/sun/star/awt/XTextComponent.hpp>
@@ -941,7 +942,6 @@ void SAL_CALL FmXFormShell::formDeactivated(const EventObject& rEvent) throw( Ru
void FmXFormShell::disposing()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::disposing" );
- OSL_TRACE( "--- FmXFormShell::disposing : %p, ........, ........", this );
impl_checkDisposed();
FmXFormShell_BASE::disposing();
@@ -1579,22 +1579,25 @@ void FmXFormShell::ExecuteSearch()
return;
// filter out the forms which do not contain valid controls at all
- FmFormArray::reverse_iterator form = m_aSearchForms.rbegin();
- ::std::vector< String >::reverse_iterator contextName = aContextNames.rbegin();
- sal_Int32 i = m_aSearchForms.size();
- for ( ;
- form != m_aSearchForms.rend();
- ++form, ++contextName, --i
- )
{
- FmSearchContext aTestContext;
- aTestContext.nContext = static_cast< sal_Int16 >( i-1 );
- sal_uInt32 nValidControls = OnSearchContextRequest( &aTestContext );
- if ( nValidControls == 0 )
+ FmFormArray aValidForms;
+ ::std::vector< String > aValidContexts;
+ FmFormArray::const_iterator form = m_aSearchForms.begin();
+ ::std::vector< String >::const_iterator contextName = aContextNames.begin();
+ for ( ; form != m_aSearchForms.end(); ++form, ++contextName )
{
- m_aSearchForms.erase( form.base() - 1 );
- aContextNames.erase( contextName.base() - 1 );
+ FmSearchContext aTestContext;
+ aTestContext.nContext = static_cast< sal_Int16 >( form - m_aSearchForms.begin() );
+ sal_uInt32 nValidControls = OnSearchContextRequest( &aTestContext );
+ if ( nValidControls > 0 )
+ {
+ aValidForms.push_back( *form );
+ aValidContexts.push_back( *contextName );
+ }
}
+
+ m_aSearchForms.swap( aValidForms );
+ aContextNames.swap( aValidContexts );
}
if (m_aSearchForms.size() == 0)
@@ -1606,7 +1609,7 @@ void FmXFormShell::ExecuteSearch()
// jetzt brauche ich noch einen 'initial context'
sal_Int16 nInitialContext = 0;
Reference< XForm> xActiveForm( getActiveForm());
- for (i=0; i<(sal_Int32)m_aSearchForms.size(); ++i)
+ for ( size_t i=0; i<m_aSearchForms.size(); ++i )
{
if (m_aSearchForms.at(i) == xActiveForm)
{
@@ -2373,6 +2376,8 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere)
FmFormObj* pFormObject = FmFormObj::GetFormObject( pObject );
Reference< XControlModel > xControlModel( pFormObject ? pFormObject->GetUnoControlModel() : Reference< XControlModel >() );
DBG_ASSERT( xControlModel.is(), "FmXFormShell::OnFoundData: invalid control!" );
+ if ( !xControlModel.is() )
+ return 0;
// disable the permanent cursor for the last grid we found a record
if (m_xLastGridFound.is() && (m_xLastGridFound != xControlModel))
@@ -2390,7 +2395,7 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere)
sal_Int32 nGridColumn = m_arrRelativeGridColumn.GetObject(pfriWhere->nFieldPos);
if (nGridColumn != -1)
{ // dummer weise muss ich mir das Control erst wieder besorgen
- Reference< XControl> xControl( GetControlFromModel(xControlModel));
+ Reference< XControl> xControl( impl_getControl( xControlModel, *pFormObject ) );
Reference< XGrid> xGrid(xControl, UNO_QUERY);
DBG_ASSERT(xGrid.is(), "FmXFormShell::OnFoundData : ungueltiges Control !");
// wenn eine der Asserts anschlaegt, habe ich beim Aufbauen von m_arrSearchedControls wohl was falsch gemacht
@@ -2402,7 +2407,8 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere)
xModelSet->setPropertyValue( FM_PROP_CURSORCOLOR, makeAny( sal_Int32( COL_LIGHTRED ) ) );
m_xLastGridFound = xControlModel;
- xGrid->setCurrentColumnPosition((sal_Int16)nGridColumn);
+ if ( xGrid.is() )
+ xGrid->setCurrentColumnPosition((sal_Int16)nGridColumn);
}
// als der Cursor neu positioniert wurde, habe ich (in positioned) meine Formularleisten-Slots invalidiert, aber das greift
@@ -2510,7 +2516,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
// ... nach der ControlSource-Eigenschaft fragen
SearchableControlIterator iter( xCurrentFormComponent );
- Reference< XControl> xControlBehindModel;
+ Reference< XControl> xControl;
// das Control, das als Model xControlModel hat
// (das folgende while kann mehrmals durchlaufen werden, ohne dass das Control sich aendert, dann muss
// ich nicht jedesmal neu suchen)
@@ -2522,10 +2528,12 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
if ( sControlSource.getLength() == 0 )
{ // das aktuelle Element hat keine ControlSource, also ist es ein GridControl (das ist das einzige, was
// der SearchableControlIterator noch zulaesst)
- xControlBehindModel = GetControlFromModel(xControlModel);
- DBG_ASSERT(xControlBehindModel.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !");
+ xControl = impl_getControl( xControlModel, *pFormObject );
+ DBG_ASSERT(xControl.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !");
- Reference< XGridPeer> xGridPeer(xControlBehindModel->getPeer(), UNO_QUERY);
+ Reference< XGridPeer> xGridPeer;
+ if ( xControl.is() )
+ xGridPeer.set( xControl->getPeer(), UNO_QUERY );
do
{
if (!xGridPeer.is())
@@ -2579,13 +2587,13 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
if (sControlSource.getLength() && xValidFormFields->hasByName(sControlSource))
{
// jetzt brauche ich das Control zum SdrObject
- if (!xControlBehindModel.is())
+ if (!xControl.is())
{
- xControlBehindModel = GetControlFromModel(xControlModel);
- DBG_ASSERT(xControlBehindModel.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !");
+ xControl = impl_getControl( xControlModel, *pFormObject );
+ DBG_ASSERT(xControl.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !");
}
- if (IsSearchableControl(xControlBehindModel))
+ if (IsSearchableControl(xControl))
{ // alle Tests ueberstanden -> in die Liste mit aufnehmen
strFieldList += sControlSource.getStr();
strFieldList += ';';
@@ -2601,7 +2609,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
m_arrRelativeGridColumn.Insert(-1, m_arrRelativeGridColumn.Count());
// und fuer die formatierte Suche ...
- pfmscContextInfo->arrFields.push_back(Reference< XInterface>(xControlBehindModel, UNO_QUERY));
+ pfmscContextInfo->arrFields.push_back(Reference< XInterface>(xControl, UNO_QUERY));
}
}
}
@@ -2975,24 +2983,48 @@ void FmXFormShell::SetDesignMode(sal_Bool bDesign)
}
//------------------------------------------------------------------------------
-Reference< XControl> FmXFormShell::GetControlFromModel(const Reference< XControlModel>& xModel)
+Reference< XControl> FmXFormShell::impl_getControl( const Reference< XControlModel >& i_rxModel, const FmFormObj& i_rKnownFormObj )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::GetControlFromModel" );
if ( impl_checkDisposed() )
return NULL;
- Reference< XControlContainer> xControlContainer( getControlContainerForView() );
+ Reference< XControl > xControl;
+ try
+ {
+ Reference< XControlContainer> xControlContainer( getControlContainerForView(), UNO_SET_THROW );
+
+ Sequence< Reference< XControl > > seqControls( xControlContainer->getControls() );
+ const Reference< XControl >* pControls = seqControls.getArray();
+ // ... die ich dann durchsuchen kann
+ for (sal_Int32 i=0; i<seqControls.getLength(); ++i)
+ {
+ xControl.set( pControls[i], UNO_SET_THROW );
+ Reference< XControlModel > xCurrentModel( xControl->getModel() );
+ if ( xCurrentModel == i_rxModel )
+ break;
+ xControl.clear();
+ }
+
+ if ( !xControl.is() )
+ {
+ // fallabck (some controls might not have been created, yet, since they were never visible so far)
+ Reference< XControl > xContainerControl( xControlContainer, UNO_QUERY_THROW );
+ const Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerControl->getPeer() );
+ ENSURE_OR_THROW( pContainerWindow, "unexpected control container implementation" );
+
+ const SdrView* pSdrView = m_pShell ? m_pShell->GetFormView() : NULL;
+ ENSURE_OR_THROW( pSdrView, "no current view" );
- Sequence< Reference< XControl> > seqControls( xControlContainer->getControls() );
- Reference< XControl>* pControls = seqControls.getArray();
- // ... die ich dann durchsuchen kann
- for (int i=0; i<seqControls.getLength(); ++i)
+ xControl.set( i_rKnownFormObj.GetUnoControl( *pSdrView, *pContainerWindow ), UNO_QUERY_THROW );
+ }
+ }
+ catch( const Exception& )
{
- Reference< XControlModel> xSearchLoopModel( pControls[i]->getModel());
- if ((XControlModel*)xSearchLoopModel.get() == (XControlModel*)xModel.get())
- return pControls[i];
+ DBG_UNHANDLED_EXCEPTION();
}
- return Reference< XControl>(NULL);
+
+ OSL_ENSURE( xControl.is(), "FmXFormShell::impl_getControl: no control found!" );
+ return xControl;
}
//------------------------------------------------------------------------------
@@ -3761,7 +3793,6 @@ void FmXFormShell::SetWizardUsing(sal_Bool _bUseThem)
void FmXFormShell::viewDeactivated( FmFormView& _rCurrentView, sal_Bool _bDeactivateController /* = sal_True */ )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::viewDeactivated" );
- OSL_TRACE( "--- FmXFormShell::viewDeactivated: %p, %p, ........", this, &_rCurrentView );
if ( _rCurrentView.GetImpl() && !_rCurrentView.IsDesignMode() )
{
@@ -3796,7 +3827,6 @@ void FmXFormShell::viewDeactivated( FmFormView& _rCurrentView, sal_Bool _bDeacti
// remove callbacks at the page
if ( pPage )
{
- OSL_TRACE( "--- FmXFormShell::resetHandler : %p, ........, %p", this, pPage );
pPage->GetImpl().SetFormsCreationHdl( Link() );
}
UpdateForms( sal_True );
@@ -3835,7 +3865,6 @@ IMPL_LINK( FmXFormShell, OnFormsCreated, FmFormPage*, /*_pPage*/ )
void FmXFormShell::viewActivated( FmFormView& _rCurrentView, sal_Bool _bSyncAction /* = sal_False */ )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::viewActivated" );
- OSL_TRACE( "--- FmXFormShell::viewActivated : %p, %p, ........", this, &_rCurrentView );
FmFormPage* pPage = _rCurrentView.GetCurPage();
@@ -3865,7 +3894,6 @@ void FmXFormShell::viewActivated( FmFormView& _rCurrentView, sal_Bool _bSyncActi
// set callbacks at the page
if ( pPage )
{
- OSL_TRACE( "--- FmXFormShell::setHandler : %p, ........, %p", this, pPage );
pPage->GetImpl().SetFormsCreationHdl( LINK( this, FmXFormShell, OnFormsCreated ) );
}
@@ -4156,6 +4184,31 @@ void FmXFormShell::handleMouseButtonDown( const SdrViewEvent& _rViewEvent )
}
}
+//------------------------------------------------------------------------------
+bool FmXFormShell::HasControlFocus() const
+{
+ bool bHasControlFocus = false;
+
+ try
+ {
+ Reference< XFormController > xController( getActiveController() );
+ Reference< XControl > xCurrentControl;
+ if ( xController.is() )
+ xCurrentControl.set( xController->getCurrentControl() );
+ if ( xCurrentControl.is() )
+ {
+ Reference< XWindow2 > xPeerWindow( xCurrentControl->getPeer(), UNO_QUERY_THROW );
+ bHasControlFocus = xPeerWindow->hasFocus();
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ return bHasControlFocus;
+}
+
//==============================================================================
//==============================================================================
SearchableControlIterator::SearchableControlIterator(Reference< XInterface> xStartingPoint)
diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx
index 98eeb3927e69..19ca20dd7983 100644
--- a/svx/source/form/fmtextcontrolshell.cxx
+++ b/svx/source/form/fmtextcontrolshell.cxx
@@ -130,7 +130,6 @@ namespace svx
SID_ATTR_LRSPACE, /* 48 */
SID_ATTR_ULSPACE, /* 49 */
SID_ATTR_CHAR_AUTOKERN,
- SID_ATTR_CHAR_OVERLINE,
SID_SET_SUPER_SCRIPT,
SID_SET_SUB_SCRIPT,
SID_CHAR_DLG,
@@ -141,6 +140,7 @@ namespace svx
SID_ATTR_CHAR_RELIEF,
SID_ATTR_PARA_LEFT_TO_RIGHT, /* 950 */
SID_ATTR_PARA_RIGHT_TO_LEFT,
+ SID_ATTR_CHAR_OVERLINE,
0
};
diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx
index 068f4aa8a029..460d2e1cd787 100644
--- a/svx/source/form/fmtools.cxx
+++ b/svx/source/form/fmtools.cxx
@@ -72,6 +72,8 @@
/** === end UNO includes === **/
#include <basic/sbxvar.hxx>
+#include <svl/eitem.hxx>
+#include <svl/stritem.hxx>
#include <comphelper/container.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/processfactory.hxx>
diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx
index c777fe4da28e..e63325f710e9 100644
--- a/svx/source/form/fmundo.cxx
+++ b/svx/source/form/fmundo.cxx
@@ -90,25 +90,7 @@ class ScriptEventListenerWrapper : public ScriptEventListener_BASE
public:
ScriptEventListenerWrapper( FmFormModel& _rModel) throw ( RuntimeException ) : pModel(&_rModel)
{
- Reference < XPropertySet > xProps(
- ::comphelper::getProcessServiceFactory(), UNO_QUERY );
- if ( xProps.is() )
- {
- Reference< XComponentContext > xCtx( xProps->getPropertyValue(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY );
- if ( xCtx.is() )
- {
- Reference< XMultiComponentFactory > xMFac(
- xCtx->getServiceManager(), UNO_QUERY );
- if ( xMFac.is() )
- {
- m_vbaListener.set( xMFac->createInstanceWithContext(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "ooo.vba.EventListener" ) ), xCtx ),
- UNO_QUERY_THROW );
- }
- }
- }
+
}
// XEventListener
virtual void SAL_CALL disposing(const EventObject& ) throw( RuntimeException ){}
@@ -136,6 +118,33 @@ public:
private:
void setModel()
{
+ if ( !m_vbaListener.is() )
+ {
+ Reference < XPropertySet > xProps(
+ ::comphelper::getProcessServiceFactory(), UNO_QUERY );
+ if ( xProps.is() )
+ {
+ Reference< XComponentContext > xCtx( xProps->getPropertyValue(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY );
+ if ( xCtx.is() )
+ {
+ Reference< XMultiComponentFactory > xMFac(
+ xCtx->getServiceManager(), UNO_QUERY );
+ SfxObjectShellRef xObjSh = pModel->GetObjectShell();
+ Reference< XMultiServiceFactory > xDocFac;
+ if ( xObjSh.Is() )
+ xDocFac.set( xObjSh->GetModel(), UNO_QUERY );
+
+ if ( xMFac.is() )
+ {
+ m_vbaListener.set( xMFac->createInstanceWithContext(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "ooo.vba.EventListener" ) ), xCtx ),
+ UNO_QUERY_THROW );
+ }
+ }
+ }
+ }
Reference< XPropertySet > xProps( m_vbaListener, UNO_QUERY );
if ( xProps.is() )
{
diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx
index 462e95d38514..6804e838e602 100644
--- a/svx/source/form/fmview.cxx
+++ b/svx/source/form/fmview.cxx
@@ -339,8 +339,6 @@ void FmFormView::GrabFirstControlFocus( sal_Bool _bForceSync )
//------------------------------------------------------------------------
SdrPageView* FmFormView::ShowSdrPage(SdrPage* pPage)
{
- OSL_TRACE( "--- FmFormView::ShowSdrPage : ........, %p, %p", this, pPage );
-
SdrPageView* pPV = E3dView::ShowSdrPage(pPage);
if (pPage)
@@ -377,8 +375,6 @@ SdrPageView* FmFormView::ShowSdrPage(SdrPage* pPage)
//------------------------------------------------------------------------
void FmFormView::HideSdrPage()
{
- OSL_TRACE( "--- FmFormView::HideSdrPage : ........, %p, %p", this, GetCurPage() );
-
// --- 1. deactivate controls
if ( !IsDesignMode() )
DeactivateControls(GetSdrPageView());
diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx
index dae216753d22..31918073d669 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -823,6 +823,48 @@ void FmXFormView::AutoFocus( sal_Bool _bSync )
else
m_nAutoFocusEvent = Application::PostUserEvent(LINK(this, FmXFormView, OnAutoFocus));
}
+
+// -----------------------------------------------------------------------------
+bool FmXFormView::isFocusable( const Reference< XControl >& i_rControl )
+{
+ if ( !i_rControl.is() )
+ return false;
+
+ try
+ {
+ Reference< XPropertySet > xModelProps( i_rControl->getModel(), UNO_QUERY_THROW );
+
+ // only enabled controls are allowed to participate
+ sal_Bool bEnabled = sal_False;
+ OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_ENABLED ) >>= bEnabled );
+ if ( !bEnabled )
+ return false;
+
+ // check the class id of the control model
+ sal_Int16 nClassId = FormComponentType::CONTROL;
+ OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_CLASSID ) >>= nClassId );
+
+ // controls which are not focussable
+ if ( ( FormComponentType::CONTROL != nClassId )
+ && ( FormComponentType::IMAGEBUTTON != nClassId )
+ && ( FormComponentType::GROUPBOX != nClassId )
+ && ( FormComponentType::FIXEDTEXT != nClassId )
+ && ( FormComponentType::HIDDENCONTROL != nClassId )
+ && ( FormComponentType::IMAGECONTROL != nClassId )
+ && ( FormComponentType::SCROLLBAR != nClassId )
+ && ( FormComponentType::SPINBUTTON!= nClassId )
+ )
+ {
+ return true;
+ }
+ }
+ catch( const Exception& e )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return false;
+}
+
// -----------------------------------------------------------------------------
static Reference< XControl > lcl_firstFocussableControl( const Sequence< Reference< XControl > >& _rControls )
{
@@ -833,47 +875,19 @@ static Reference< XControl > lcl_firstFocussableControl( const Sequence< Referen
const Reference< XControl >* pControlsEnd = _rControls.getConstArray() + _rControls.getLength();
for ( ; pControls != pControlsEnd; ++pControls )
{
- try
- {
- if ( !pControls->is() )
- continue;
-
- Reference< XPropertySet > xModelProps( (*pControls)->getModel(), UNO_QUERY_THROW );
-
- // only enabled controls are allowed to participate
- sal_Bool bEnabled = sal_False;
- OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_ENABLED ) >>= bEnabled );
- if ( !bEnabled )
- continue;
-
- // check the class id of the control model
- sal_Int16 nClassId = FormComponentType::CONTROL;
- OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_CLASSID ) >>= nClassId );
-
- // controls which are not focussable
- if ( ( FormComponentType::CONTROL != nClassId )
- && ( FormComponentType::IMAGEBUTTON != nClassId )
- && ( FormComponentType::GROUPBOX != nClassId )
- && ( FormComponentType::FIXEDTEXT != nClassId )
- && ( FormComponentType::HIDDENCONTROL != nClassId )
- && ( FormComponentType::IMAGECONTROL != nClassId )
- && ( FormComponentType::SCROLLBAR != nClassId )
- && ( FormComponentType::SPINBUTTON!= nClassId )
- )
- {
- xReturn = *pControls;
- break;
- }
- }
- catch( const Exception& e )
+ if ( !pControls->is() )
+ continue;
+
+ if ( FmXFormView::isFocusable( *pControls ) )
{
- (void)e; // make compiler happy
+ xReturn = *pControls;
+ break;
}
-
- if ( !xReturn.is() && _rControls.getLength() )
- xReturn = _rControls[0];
}
+ if ( !xReturn.is() && _rControls.getLength() )
+ xReturn = _rControls[0];
+
return xReturn;
}
@@ -1008,11 +1022,6 @@ IMPL_LINK(FmXFormView, OnAutoFocus, void*, /*EMPTYTAG*/)
}
// -----------------------------------------------------------------------------
-namespace
-{
-}
-
-// -----------------------------------------------------------------------------
void FmXFormView::onCreatedFormObject( FmFormObj& _rFormObject )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::onCreatedFormObject" );
@@ -1590,7 +1599,13 @@ bool FmXFormView::createControlLabelPair( const ::comphelper::ComponentContext&
xLabelModel.set( pLabel->GetUnoControlModel(), UNO_QUERY );
if ( xLabelModel.is() )
{
- xLabelModel->setPropertyValue( FM_PROP_LABEL, makeAny( sFieldName + _rFieldPostfix ) );
+ ::rtl::OUString sLabel;
+ if ( _rxField.is() && _rxField->getPropertySetInfo()->hasPropertyByName(FM_PROP_LABEL) )
+ _rxField->getPropertyValue(FM_PROP_LABEL) >>= sLabel;
+ if ( !sLabel.getLength() )
+ sLabel = sFieldName;
+
+ xLabelModel->setPropertyValue( FM_PROP_LABEL, makeAny( sLabel + _rFieldPostfix ) );
String sObjectLabel( SVX_RES( RID_STR_OBJECT_LABEL ) );
sObjectLabel.SearchAndReplaceAllAscii( "#object#", sFieldName );
xLabelModel->setPropertyValue( FM_PROP_NAME, makeAny( ::rtl::OUString( sObjectLabel ) ) );
diff --git a/svx/source/form/formcontrolfactory.cxx b/svx/source/form/formcontrolfactory.cxx
index 32a234396c54..857bdc1b2647 100644
--- a/svx/source/form/formcontrolfactory.cxx
+++ b/svx/source/form/formcontrolfactory.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/form/XFormComponent.hpp>
#include <com/sun/star/form/FormComponentType.hpp>
#include <com/sun/star/awt/ScrollBarOrientation.hpp>
+#include <com/sun/star/awt/MouseWheelBehavior.hpp>
#include <com/sun/star/form/XGridColumnFactory.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
#include <com/sun/star/awt/LineEndFormat.hpp>
@@ -97,6 +98,7 @@ namespace svxform
/** === end UNO using === **/
namespace FormComponentType = ::com::sun::star::form::FormComponentType;
namespace ScrollBarOrientation = ::com::sun::star::awt::ScrollBarOrientation;
+ namespace MouseWheelBehavior = ::com::sun::star::awt::MouseWheelBehavior;
namespace LineEndFormat = ::com::sun::star::awt::LineEndFormat;
namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode;
namespace DataType = ::com::sun::star::sdbc::DataType;
@@ -506,6 +508,12 @@ namespace svxform
_rxControlModel->setPropertyValue( FM_PROP_STRICTFORMAT, makeAny( sal_Bool( sal_True ) ) );
}
+ // mouse wheel: don't use it for scrolling by default (i110036)
+ if ( xPSI->hasPropertyByName( FM_PROP_MOUSE_WHEEL_BEHAVIOR ) )
+ {
+ _rxControlModel->setPropertyValue( FM_PROP_MOUSE_WHEEL_BEHAVIOR, makeAny( MouseWheelBehavior::SCROLL_DISABLED ) );
+ }
+
if ( xPSI->hasPropertyByName( FM_PROP_WRITING_MODE ) )
_rxControlModel->setPropertyValue( FM_PROP_WRITING_MODE, makeAny( WritingMode2::CONTEXT ) );
}
diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx
index d4249e5fa4ec..78bbc7a533d9 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -2232,7 +2232,7 @@ namespace svxform
{
SdrPaintWindow* pPaintWindow = pFormView->GetPaintWindow( i );
OutputDevice& rOutDev = pPaintWindow->GetOutputDevice();
- if ( OUTDEV_WINDOW == rOutDev.GetOutDevType() )
+ if ( ( OUTDEV_WINDOW == rOutDev.GetOutDevType() ) && !aMarkRect.IsEmpty() )
{
pFormView->MakeVisible( aMarkRect, (Window&)rOutDev );
}
diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx
index aeb62d79f3f7..37c102cb1954 100644
--- a/svx/source/form/tabwin.cxx
+++ b/svx/source/form/tabwin.cxx
@@ -91,9 +91,46 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::form;
using namespace ::com::sun::star::container;
+using namespace ::com::sun::star;
using namespace ::svxform;
using namespace ::svx;
+
+struct ColumnInfo
+{
+ ::rtl::OUString sColumnName;
+ ::rtl::OUString sLabel;
+ bool bColumn;
+ ColumnInfo(const ::rtl::OUString& i_sColumnName,const ::rtl::OUString& i_sLabel)
+ : sColumnName(i_sColumnName)
+ , sLabel(i_sLabel)
+ , bColumn(true)
+ {
+ }
+ ColumnInfo(const ::rtl::OUString& i_sColumnName)
+ : sColumnName(i_sColumnName)
+ , bColumn(false)
+ {
+ }
+};
+
+void lcl_addToList( SvTreeListBox& _rListBox, const uno::Reference< container::XNameAccess>& i_xColumns )
+{
+ uno::Sequence< ::rtl::OUString > aEntries = i_xColumns->getElementNames();
+ const ::rtl::OUString* pEntries = aEntries.getConstArray();
+ sal_Int32 nEntries = aEntries.getLength();
+ for ( sal_Int32 i = 0; i < nEntries; ++i, ++pEntries )
+ {
+ uno::Reference< beans::XPropertySet> xColumn(i_xColumns->getByName(*pEntries),UNO_QUERY_THROW);
+ ::rtl::OUString sLabel;
+ if ( xColumn->getPropertySetInfo()->hasPropertyByName(FM_PROP_LABEL) )
+ xColumn->getPropertyValue(FM_PROP_LABEL) >>= sLabel;
+ if ( sLabel.getLength() )
+ _rListBox.InsertEntry( sLabel,NULL,FALSE,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) );
+ else
+ _rListBox.InsertEntry( *pEntries,NULL,FALSE,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) );
+ }
+}
//==================================================================
// class FmFieldWinListBox
//==================================================================
@@ -149,7 +186,8 @@ void FmFieldWinListBox::StartDrag( sal_Int8 /*_nAction*/, const Point& /*_rPosPi
aDescriptor[ daConnection ] <<= pTabWin->GetConnection().getTyped();
aDescriptor[ daCommand ] <<= pTabWin->GetObjectName();
aDescriptor[ daCommandType ]<<= pTabWin->GetObjectType();
- aDescriptor[ daColumnName ] <<= ::rtl::OUString( GetEntryText( pSelected ) );
+ ColumnInfo* pInfo = static_cast<ColumnInfo*>(pSelected->GetUserData());
+ aDescriptor[ daColumnName ] <<= pInfo->sColumnName;
TransferableHelper* pTransferColumn = new OColumnTransferable(
aDescriptor, CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR
@@ -238,7 +276,8 @@ sal_Bool FmFieldWin::createSelectionControls( )
aDescr[ daCommand ] <<= GetObjectName();
aDescr[ daCommandType ] <<= GetObjectType();
- aDescr[ daColumnName ] <<= ::rtl::OUString( pListBox->GetEntryText( pSelected) );
+ ColumnInfo* pInfo = static_cast<ColumnInfo*>(pSelected->GetUserData());
+ aDescr[ daColumnName ] <<= pInfo->sColumnName;//::rtl::OUString( pListBox->GetEntryText( pSelected) );
// transfer this to the SFX world
SfxUnoAnyItem aDescriptorItem( SID_FM_DATACCESS_DESCRIPTOR, makeAny( aDescr.createPropertyValueSequence() ) );
@@ -344,15 +383,14 @@ void FmFieldWin::UpdateContent(const ::com::sun::star::uno::Reference< ::com::su
// the place, and connectRowset should be replaced with ensureRowSetConnection
// get the fields of the object
- Sequence< ::rtl::OUString> aFieldNames;
- if ( m_aConnection.is() && m_aObjectName.getLength() )
- aFieldNames = getFieldNamesByCommandDescriptor( m_aConnection, m_nObjectType, m_aObjectName );
- // put them into the list
- const ::rtl::OUString* pFieldNames = aFieldNames.getConstArray();
- sal_Int32 nFieldsCount = aFieldNames.getLength();
- for ( sal_Int32 i = 0; i < nFieldsCount; ++i, ++pFieldNames)
- pListBox->InsertEntry( * pFieldNames);
+ if ( m_aConnection.is() && m_aObjectName.getLength() )
+ {
+ Reference< XComponent > xKeepFieldsAlive;
+ Reference< XNameAccess > xColumns = getFieldsByCommandDescriptor( m_aConnection, m_nObjectType, m_aObjectName,xKeepFieldsAlive );
+ if ( xColumns.is() )
+ lcl_addToList(*pListBox,xColumns);
+ }
// Prefix setzen
UniString aPrefix;
diff --git a/svx/source/inc/fmprop.hrc b/svx/source/inc/fmprop.hrc
index 72758a4cac4e..a0592c80b90b 100644
--- a/svx/source/inc/fmprop.hrc
+++ b/svx/source/inc/fmprop.hrc
@@ -174,5 +174,6 @@
#define FM_PROP_INPUT_REQUIRED rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InputRequired" ) )
#define FM_PROP_WRITING_MODE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WritingMode" ) )
#define FM_PROP_MOUSE_WHEEL_BEHAVIOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MouseWheelBehavior" ) )
+#define FM_PROP_DESCRIPTION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Description" ) )
#endif // _SVX_FMPROP_HRC
diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx
index a97793a64ea9..e56f9fd64a36 100644
--- a/svx/source/inc/fmshimp.hxx
+++ b/svx/source/inc/fmshimp.hxx
@@ -163,6 +163,7 @@ typedef ::utl::ConfigItem FmXFormShell_CFGBASE;
struct SdrViewEvent;
class FmFormShell;
class FmFormView;
+class FmFormObj;
class SAL_DLLPRIVATE FmXFormShell :public FmXFormShell_BASE
,public FmXFormShell_CFGBASE
,public ::svxform::OStaticDataAccessTools
@@ -349,8 +350,11 @@ protected:
void startListening();
void stopListening();
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl> GetControlFromModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel>& xModel);
- // liefert das Control, welches das angegebene Model hat
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >
+ impl_getControl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel>& i_rxModel,
+ const FmFormObj& i_rKnownFormObj
+ );
// sammelt in strNames die Namen aller Formulare
static void impl_collectFormSearchContexts_nothrow(
@@ -477,6 +481,9 @@ public:
// if the form belongs to the controller (extern) displaying a grid, the according internal form will
// be displayed, _xForm else
+ // check if the current control of the active controler has the focus
+ bool HasControlFocus() const;
+
private:
DECL_LINK(OnFoundData, FmFoundRecordInformation*);
DECL_LINK(OnCanceledNotFound, FmFoundRecordInformation*);
diff --git a/svx/source/inc/fmvwimp.hxx b/svx/source/inc/fmvwimp.hxx
index d643fc4dc403..1131209a384a 100644
--- a/svx/source/inc/fmvwimp.hxx
+++ b/svx/source/inc/fmvwimp.hxx
@@ -240,6 +240,11 @@ public:
void onCreatedFormObject( FmFormObj& _rFormObject );
+ static bool
+ isFocusable(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& i_rControl
+ );
+
private:
FmWinRecList::iterator findWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& _rxCC );
//void addWindow(const SdrPageViewWinRec*);
diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx
index c72a59294d6c..acead19ba9ee 100644
--- a/svx/source/inc/gridcell.hxx
+++ b/svx/source/inc/gridcell.hxx
@@ -219,6 +219,7 @@ class DbCellControl
{
private:
::comphelper::OPropertyChangeMultiplexer* m_pModelChangeBroadcaster;
+ ::comphelper::OPropertyChangeMultiplexer* m_pFieldChangeBroadcaster;
private:
sal_Bool m_bTransparent : 1;
@@ -348,7 +349,7 @@ private:
void implDoPropertyListening( const ::rtl::OUString& _rPropertyName, sal_Bool _bWarnIfNotExistent = sal_True );
/// updates the "readonly" setting on m_pWindow, according to the respective property value in the given model
- void implAdjustReadOnly( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
+ void implAdjustReadOnly( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel,bool i_bReadOnly );
/// updates the "enabled" setting on m_pWindow, according to the respective property value in the given model
void implAdjustEnabled( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
diff --git a/svx/source/intro/iso.src b/svx/source/intro/iso.src
index f963d95721fc..ecadfd9d4c6a 100644
--- a/svx/source/intro/iso.src
+++ b/svx/source/intro/iso.src
@@ -30,7 +30,7 @@
#endif
#ifndef _SVTOOLS_HRC
-#include <svl/svtools.hrc>
+#include <svtools/svtools.hrc>
#endif
#include "intro.hrc"
diff --git a/svx/source/intro/makefile.mk b/svx/source/intro/makefile.mk
index 3ed86b3bcda3..4d0686baac04 100644
--- a/svx/source/intro/makefile.mk
+++ b/svx/source/intro/makefile.mk
@@ -36,10 +36,6 @@ TARGET=intro
RSCLOCINC!:=$(RSCLOCINC);$(PRJ)$/RES
-# setting the compiled by $user$ string in the About box
-OOO_VENDOR*=$(USER)$(USERNAME)
-RSCDEFS+=-DOOO_VENDOR="$(OOO_VENDOR)"
-
# --- Allgemein -----------------------------------------------------------
LOCALIZE_ME=intro_tmpl.hrc
diff --git a/svx/source/intro/ooo.src b/svx/source/intro/ooo.src
index b29f3894c0c5..49f6f68fd7e4 100644
--- a/svx/source/intro/ooo.src
+++ b/svx/source/intro/ooo.src
@@ -26,7 +26,7 @@
************************************************************************/
#ifndef _SVTOOLS_HRC
-#include <svl/svtools.hrc>
+#include <svtools/svtools.hrc>
#endif
#ifndef _SVTOOLS_IMAGEMGR_HRC
@@ -93,7 +93,7 @@ ModalDialog RID_DEFAULTABOUT
};
String ABOUT_STR_COPYRIGHT
{
- Text[ en-US ] = "Copyright © 2000, 2010 Oracle and/or its affiliates. All rights reserved.\nThis product was created by " OOO_VENDOR ", based on OpenOffice.org.\nOpenOffice.org acknowledges all community members, especially those mentioned at\n http://www.openoffice.org/welcome/credits.html.";
+ Text[ en-US ] = "Copyright © 2000, 2010 Oracle and/or its affiliates. All rights reserved.\nThis product was created by %OOOVENDOR, based on OpenOffice.org.\nOpenOffice.org acknowledges all community members, especially those mentioned at\n http://www.openoffice.org/welcome/credits.html.";
};
StringArray ABOUT_STR_DEVELOPER_ARY
{
diff --git a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
index ba260e79bba9..cbe9c4a9c615 100644
--- a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
+++ b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
@@ -61,11 +61,30 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfMasterPageDescriptor::createViewIndependentPrimitive2DSequence() const
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
+ drawinglayer::attribute::SdrFillAttribute aFill;
+ const SdrPage* pCorrectPage = &GetMasterPageDescriptor().GetOwnerPage();
+ const SdrPageProperties* pCorrectProperties = &pCorrectPage->getSdrPageProperties();
- // build primitive from page fill attributes
- const SfxItemSet& rPageFillAttributes = GetMasterPageDescriptor().getCorrectFillAttributes();
- const drawinglayer::attribute::SdrFillAttribute aFill(
- drawinglayer::primitive2d::createNewSdrFillAttribute(rPageFillAttributes));
+ 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;
+ }
+
+ if(pCorrectProperties)
+ {
+ // create page fill attributes when correct properties were identified
+ aFill = drawinglayer::primitive2d::createNewSdrFillAttribute(pCorrectProperties->GetItemSet());
+ }
if(!aFill.isDefault())
{
diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
index e486f978fafb..b80b6fcbba88 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
@@ -203,10 +203,18 @@ namespace sdr
}
else
{
- // build primitive from pObject's attributes
- const SfxItemSet& rFillAttributes = rPage.getSdrPageProperties().GetItemSet();
- const drawinglayer::attribute::SdrFillAttribute aFill(
- drawinglayer::primitive2d::createNewSdrFillAttribute(rFillAttributes));
+ drawinglayer::attribute::SdrFillAttribute aFill;
+
+ // #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).
+ if(rPage.getSdrPageProperties().GetStyleSheet())
+ {
+ // create page fill attributes with correct properties
+ aFill = drawinglayer::primitive2d::createNewSdrFillAttribute(
+ rPage.getSdrPageProperties().GetItemSet());
+ }
if(!aFill.isDefault())
{
diff --git a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
index 47c2cccbd02d..392b8e923212 100644
--- a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
@@ -57,51 +57,56 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfGroup::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const
{
- const sal_uInt32 nSubHierarchyCount(GetViewContact().GetObjectCount());
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
- if(nSubHierarchyCount)
+ // check model-view visibility
+ if(isPrimitiveVisible(rDisplayInfo))
{
- const sal_Bool bDoGhostedDisplaying(
- GetObjectContact().DoVisualizeEnteredGroup()
- && !GetObjectContact().isOutputToPrinter()
- && GetObjectContact().getActiveViewContact() == &GetViewContact());
+ const sal_uInt32 nSubHierarchyCount(GetViewContact().GetObjectCount());
- if(bDoGhostedDisplaying)
+ if(nSubHierarchyCount)
{
- rDisplayInfo.ClearGhostedDrawMode();
- }
+ const sal_Bool bDoGhostedDisplaying(
+ GetObjectContact().DoVisualizeEnteredGroup()
+ && !GetObjectContact().isOutputToPrinter()
+ && GetObjectContact().getActiveViewContact() == &GetViewContact());
- // create object hierarchy
- drawinglayer::primitive2d::Primitive2DSequence xRetval(getPrimitive2DSequenceSubHierarchy(rDisplayInfo));
+ if(bDoGhostedDisplaying)
+ {
+ rDisplayInfo.ClearGhostedDrawMode();
+ }
- if(xRetval.hasElements())
- {
- // get ranges
- const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(GetObjectContact().getViewInformation2D());
- const ::basegfx::B2DRange aObjectRange(drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(xRetval, rViewInformation2D));
- const basegfx::B2DRange aViewRange(rViewInformation2D.getViewport());
+ // create object hierarchy
+ xRetval = getPrimitive2DSequenceSubHierarchy(rDisplayInfo);
- // check geometrical visibility
- if(!aViewRange.isEmpty() && !aViewRange.overlaps(aObjectRange))
+ if(xRetval.hasElements())
{
- // not visible, release
- xRetval.realloc(0);
+ // get ranges
+ const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(GetObjectContact().getViewInformation2D());
+ const ::basegfx::B2DRange aObjectRange(drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(xRetval, rViewInformation2D));
+ const basegfx::B2DRange aViewRange(rViewInformation2D.getViewport());
+
+ // check geometrical visibility
+ if(!aViewRange.isEmpty() && !aViewRange.overlaps(aObjectRange))
+ {
+ // not visible, release
+ xRetval.realloc(0);
+ }
}
- }
- if(bDoGhostedDisplaying)
+ if(bDoGhostedDisplaying)
+ {
+ rDisplayInfo.SetGhostedDrawMode();
+ }
+ }
+ else
{
- rDisplayInfo.SetGhostedDrawMode();
+ // draw replacement object for group. This will use ViewContactOfGroup::createViewIndependentPrimitive2DSequence
+ // which creates the replacement primitives for an empty group
+ xRetval = ViewObjectContactOfSdrObj::getPrimitive2DSequenceHierarchy(rDisplayInfo);
}
-
- return xRetval;
- }
- else
- {
- // draw replacement object for group. This will use ViewContactOfGroup::createViewIndependentPrimitive2DSequence
- // which creates the replacement primitives for an empty group
- return ViewObjectContactOfSdrObj::getPrimitive2DSequenceHierarchy(rDisplayInfo);
}
+ return xRetval;
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx
index 8447fe639a28..485afe35f9c1 100755
--- a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx
@@ -68,10 +68,17 @@ namespace sdr
return false;
}
- // Test if print output but not printable
- if(GetObjectContact().isOutputToPrinter() && !rObject.IsPrintable())
+ if(GetObjectContact().isOutputToPrinter() )
{
- return false;
+ // Test if print output but not printable
+ if( !rObject.IsPrintable())
+ return false;
+ }
+ else
+ {
+ // test is object is not visible on screen
+ if( !rObject.IsVisible() )
+ return false;
}
// Test for hidden object on MasterPage
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 81450d42a50a..3f849e92b462 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -299,10 +299,14 @@ namespace sdr { namespace contact {
//--------------------------------------------------------------------
void ControlHolder::invalidate() const
{
- Window* pWindow = VCLUnoHelper::GetWindow( m_xControl->getPeer() );
- OSL_ENSURE( pWindow, "ControlHolder::invalidate: no implementation access!" );
- if ( pWindow )
- pWindow->Invalidate();
+ Reference< XWindowPeer > xPeer( m_xControl->getPeer() );
+ if ( xPeer.is() )
+ {
+ Window* pWindow = VCLUnoHelper::GetWindow( xPeer );
+ OSL_ENSURE( pWindow, "ControlHolder::invalidate: no implementation access!" );
+ if ( pWindow )
+ pWindow->Invalidate();
+ }
}
//--------------------------------------------------------------------
@@ -1310,12 +1314,12 @@ namespace sdr { namespace contact {
{
// the layer of our object
SdrLayerID nObjectLayer = _rUnoObject.GetLayer();
- // is the layer we're residing in visible in this view?
- bool bIsObjectLayerVisible = _rPageView.isLayerVisible( nObjectLayer );
+ // is the object we're residing in visible in this view?
+ bool bIsObjectVisible = _rUnoObject.IsVisible() && _rPageView.isLayerVisible( nObjectLayer );
- if ( _bForce || ( bIsObjectLayerVisible != _bIsCurrentlyVisible ) )
+ if ( _bForce || ( bIsObjectVisible != _bIsCurrentlyVisible ) )
{
- _rControl.setVisible( bIsObjectLayerVisible );
+ _rControl.setVisible( bIsObjectVisible );
}
}
}
@@ -1689,6 +1693,9 @@ namespace sdr { namespace contact {
if ( !bHadControl && rControl.is() && rControl.isVisible() )
rControl.invalidate();
+ if ( !bHadControl && rControl.is() && rControl.isVisible() )
+ rControl.invalidate();
+
// check if we already have an XControl.
if ( !xControlModel.is() || !rControl.is() )
// use the default mechanism. This will create a ControlPrimitive2D without
@@ -1863,7 +1870,8 @@ namespace sdr { namespace contact {
if(pSdrPageView)
{
- const bool bIsLayerVisible(pSdrPageView->GetVisibleLayers().IsSet(getSdrObject().GetLayer()));
+ const SdrObject& rObject = getSdrObject();
+ const bool bIsLayerVisible( rObject.IsVisible() && pSdrPageView->GetVisibleLayers().IsSet(rObject.GetLayer()));
if(rControl.isVisible() != bIsLayerVisible)
{
diff --git a/svx/source/sdr/overlay/overlaybitmapex.cxx b/svx/source/sdr/overlay/overlaybitmapex.cxx
index ac1e5aa4ef1c..2a3a00b25b99 100644
--- a/svx/source/sdr/overlay/overlaybitmapex.cxx
+++ b/svx/source/sdr/overlay/overlaybitmapex.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <svx/sdr/overlay/overlaybitmapex.hxx>
#include <vcl/salbtype.hxx>
#include <vcl/outdev.hxx>
@@ -41,24 +42,32 @@ namespace sdr
{
drawinglayer::primitive2d::Primitive2DSequence OverlayBitmapEx::createOverlayObjectPrimitive2DSequence()
{
- const drawinglayer::primitive2d::Primitive2DReference aReference(
+ drawinglayer::primitive2d::Primitive2DReference aReference(
new drawinglayer::primitive2d::OverlayBitmapExPrimitive(
getBitmapEx(),
getBasePosition(),
getCenterX(),
getCenterY()));
+ if(basegfx::fTools::more(mfAlpha, 0.0))
+ {
+ const drawinglayer::primitive2d::Primitive2DSequence aNewTransPrimitiveVector(&aReference, 1L);
+ aReference = drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aNewTransPrimitiveVector, mfAlpha));
+ }
+
return drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
}
OverlayBitmapEx::OverlayBitmapEx(
const basegfx::B2DPoint& rBasePos,
const BitmapEx& rBitmapEx,
- sal_uInt16 nCenX, sal_uInt16 nCenY)
+ sal_uInt16 nCenX, sal_uInt16 nCenY, double fAlpha)
: OverlayObjectWithBasePosition(rBasePos, Color(COL_WHITE)),
maBitmapEx(rBitmapEx),
mnCenterX(nCenX),
- mnCenterY(nCenY)
+ mnCenterY(nCenY),
+ mfAlpha(fAlpha)
{
}
diff --git a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
index ac9b6307dd05..2ceea2c69b7d 100644
--- a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
@@ -51,13 +51,11 @@ namespace drawinglayer
if(!getSdrLFSTAttribute().getFill().isDefault()
&& getUnitPolyPolygon().isClosed())
{
- // take care for orientations
- const basegfx::B2DPolyPolygon aOrientedUnitPolyPolygon(
- basegfx::tools::correctOrientations(getUnitPolyPolygon()));
-
+ // #i108255# no need to use correctOrientations here; target is
+ // straight visualisation
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
createPolyPolygonFillPrimitive(
- aOrientedUnitPolyPolygon,
+ getUnitPolyPolygon(),
getTransform(),
getSdrLFSTAttribute().getFill(),
getSdrLFSTAttribute().getFillFloatTransGradient()));
diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx
index 15142a86b9cf..0f3325a0027e 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -259,6 +259,8 @@ namespace sdr
void AttributeProperties::MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel)
{
+ OSL_ASSERT(pNewModel!=NULL);
+
if(pSrcPool && pDestPool && (pSrcPool != pDestPool))
{
if(mpItemSet)
@@ -281,7 +283,35 @@ namespace sdr
// set stylesheet (if used)
if(pStySheet)
{
- ImpAddStyleSheet(pStySheet, sal_True);
+ // #i109515#
+ SfxItemPool* pStyleSheetPool = &pStySheet->GetPool().GetPool();
+
+ if(pStyleSheetPool == pDestPool)
+ {
+ // just re-set stylesheet
+ ImpAddStyleSheet(pStySheet, sal_True);
+ }
+ else
+ {
+ // StyleSheet is NOT from the correct pool.
+ // Look one up in the right pool with the same
+ // name or use the default.
+
+ // Look up the style in the new document.
+ OSL_ASSERT(pNewModel->GetStyleSheetPool() != NULL);
+ SfxStyleSheet* pNewStyleSheet = dynamic_cast<SfxStyleSheet*>(
+ pNewModel->GetStyleSheetPool()->Find(
+ pStySheet->GetName(),
+ SFX_STYLE_FAMILY_ALL));
+ if (pNewStyleSheet == NULL
+ || &pNewStyleSheet->GetPool().GetPool() != pDestPool)
+ {
+ // There is no copy of the style in the new
+ // document. Use the default as a fallback.
+ pNewStyleSheet = pNewModel->GetDefaultStyleSheet();
+ }
+ ImpAddStyleSheet(pNewStyleSheet, sal_True);
+ }
}
delete pOldSet;
diff --git a/svx/source/smarttags/SmartTagMgr.cxx b/svx/source/smarttags/SmartTagMgr.cxx
index b3a19ecc65bd..0070646b3330 100644
--- a/svx/source/smarttags/SmartTagMgr.cxx
+++ b/svx/source/smarttags/SmartTagMgr.cxx
@@ -35,8 +35,7 @@
#include <vcl/svapp.hxx>
#include <com/sun/star/smarttags/XSmartTagRecognizer.hpp>
#include <com/sun/star/smarttags/XSmartTagAction.hpp>
-#include <com/sun/star/deployment/XPackageManagerFactory.hpp>
-#include <com/sun/star/deployment/thePackageManagerFactory.hpp>
+#include <com/sun/star/deployment/ExtensionManager.hpp>
#include <com/sun/star/text/XTextMarkup.hpp>
#include <com/sun/star/smarttags/SmartTagRecognizerMode.hpp>
#include <com/sun/star/i18n/XBreakIterator.hpp>
@@ -472,11 +471,9 @@ void SmartTagMgr::RegisterListener()
// register as listener at package manager
try
{
- Reference<deployment::XPackageManagerFactory> xPackageManagerFactory(
- deployment::thePackageManagerFactory::get( mxContext ) );
- Reference<deployment::XPackageManager> xPackageManager(
- xPackageManagerFactory->getPackageManager( C2U("user" ) ) );
- Reference< util::XModifyBroadcaster > xMB ( xPackageManager, UNO_QUERY_THROW );
+ Reference<deployment::XExtensionManager> xExtensionManager(
+ deployment::ExtensionManager::get( mxContext ) );
+ Reference< util::XModifyBroadcaster > xMB ( xExtensionManager, UNO_QUERY_THROW );
Reference< util::XModifyListener > xListener( this );
xMB->addModifyListener( xListener );
diff --git a/svx/source/src/errtxt.src b/svx/source/src/errtxt.src
index 4d6b94dd7fc0..004885c45150 100644
--- a/svx/source/src/errtxt.src
+++ b/svx/source/src/errtxt.src
@@ -26,7 +26,7 @@
************************************************************************/
#define __RSC
-#include <svl/svtools.hrc>
+#include <svtools/svtools.hrc>
#include <svtools/sfxecode.hxx>
// pragma ----------------------------------------------------------------
diff --git a/svx/source/svdraw/makefile.mk b/svx/source/svdraw/makefile.mk
index 0108615b10dd..514c5b6d2cbc 100644
--- a/svx/source/svdraw/makefile.mk
+++ b/svx/source/svdraw/makefile.mk
@@ -113,8 +113,6 @@ LIB1OBJFILES= \
LIB2TARGET= $(SLB)$/$(TARGET).lib
LIB2OBJFILES= \
- $(SLO)$/svdoimp.obj \
- $(SLO)$/svdscrol.obj \
$(SLO)$/ActionDescriptionProvider.obj \
$(SLO)$/impgrfll.obj
diff --git a/svx/source/svdraw/sdrhittesthelper.cxx b/svx/source/svdraw/sdrhittesthelper.cxx
index 473c09b10f5d..58eef58a9fd6 100644
--- a/svx/source/svdraw/sdrhittesthelper.cxx
+++ b/svx/source/svdraw/sdrhittesthelper.cxx
@@ -60,7 +60,7 @@ SdrObject* SdrObjectPrimitiveHit(
}
else
{
- if(!pVisiLayer || pVisiLayer->IsSet(rObject.GetLayer()))
+ if( rObject.IsVisible() && (!pVisiLayer || pVisiLayer->IsSet(rObject.GetLayer())))
{
// single object, 3d object, empty scene or empty group. Check if
// it's a single 3D object
diff --git a/svx/source/svdraw/sdrmasterpagedescriptor.cxx b/svx/source/svdraw/sdrmasterpagedescriptor.cxx
index 6bcdd8f55856..67b2de8b693c 100644
--- a/svx/source/svdraw/sdrmasterpagedescriptor.cxx
+++ b/svx/source/svdraw/sdrmasterpagedescriptor.cxx
@@ -113,18 +113,6 @@ namespace sdr
|| &maUsedPage != &rCandidate.maUsedPage
|| maVisibleLayers != rCandidate.maVisibleLayers);
}
-
- const SfxItemSet& MasterPageDescriptor::getCorrectFillAttributes() const
- {
- const SfxItemSet& rOwnerPageAtributes = GetOwnerPage().getSdrPageProperties().GetItemSet();
-
- if(XFILL_NONE != ((const XFillStyleItem&)rOwnerPageAtributes.Get(XATTR_FILLSTYLE)).GetValue())
- {
- return rOwnerPageAtributes;
- }
-
- return GetUsedPage().getSdrPageProperties().GetItemSet();
- }
} // end of namespace sdr
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index b81e1c0db009..1adddfc29b2b 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -189,6 +189,7 @@ SdrItemPool::SdrItemPool(
mppLocalPoolDefaults[SDRATTR_OBJMOVEPROTECT -SDRATTR_START]=new SdrObjMoveProtectItem;
mppLocalPoolDefaults[SDRATTR_OBJSIZEPROTECT -SDRATTR_START]=new SdrObjSizeProtectItem;
mppLocalPoolDefaults[SDRATTR_OBJPRINTABLE -SDRATTR_START]=new SdrObjPrintableItem;
+ mppLocalPoolDefaults[SDRATTR_OBJVISIBLE -SDRATTR_START]=new SdrObjVisibleItem;
mppLocalPoolDefaults[SDRATTR_LAYERID -SDRATTR_START]=new SdrLayerIdItem;
mppLocalPoolDefaults[SDRATTR_LAYERNAME -SDRATTR_START]=new SdrLayerNameItem;
mppLocalPoolDefaults[SDRATTR_OBJECTNAME -SDRATTR_START]=new SdrObjectNameItem;
@@ -546,6 +547,7 @@ void SdrItemPool::TakeItemName(sal_uInt16 nWhich, String& rItemName)
case SDRATTR_OBJMOVEPROTECT : nResId = SIP_SA_OBJMOVEPROTECT;break;
case SDRATTR_OBJSIZEPROTECT : nResId = SIP_SA_OBJSIZEPROTECT;break;
case SDRATTR_OBJPRINTABLE : nResId = SIP_SA_OBJPRINTABLE;break;
+ case SDRATTR_OBJVISIBLE : nResId = SIP_SA_OBJVISIBLE;break;
case SDRATTR_LAYERID : nResId = SIP_SA_LAYERID;break;
case SDRATTR_LAYERNAME : nResId = SIP_SA_LAYERNAME;break;
case SDRATTR_OBJECTNAME : nResId = SIP_SA_OBJECTNAME;break;
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index 5e89bfbdb8f5..bc29247891d2 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -805,6 +805,12 @@ void SdrEditView::DeleteMarkedList(const SdrMarkList& rMark)
void SdrEditView::DeleteMarkedObj()
{
+ // #i110981# return when nothing is to be done at all
+ if(!GetMarkedObjectCount())
+ {
+ return;
+ }
+
// moved breaking action and undo start outside loop
BrkAction();
BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_DELETE);
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 30af84a1aebe..9e149bd8e42d 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -760,6 +760,7 @@ void SdrEditView::MergeNotPersistAttrFromMarked(SfxItemSet& rAttr, BOOL /*bOnlyH
BOOL bMovProtect=FALSE,bMovProtectDC=FALSE;
BOOL bSizProtect=FALSE,bSizProtectDC=FALSE;
BOOL bPrintable =TRUE ,bPrintableDC=FALSE;
+ BOOL bVisible = TRUE, bVisibleDC=FALSE;
SdrLayerID nLayerId=0; BOOL bLayerDC=FALSE;
XubString aObjName; BOOL bObjNameDC=FALSE,bObjNameSet=FALSE;
long nSnapPosX=0; BOOL bSnapPosXDC=FALSE;
@@ -781,6 +782,7 @@ void SdrEditView::MergeNotPersistAttrFromMarked(SfxItemSet& rAttr, BOOL /*bOnlyH
bMovProtect=pObj->IsMoveProtect();
bSizProtect=pObj->IsResizeProtect();
bPrintable =pObj->IsPrintable();
+ bVisible = pObj->IsVisible();
Rectangle aSnapRect2(pObj->GetSnapRect());
Rectangle aLogicRect2(pObj->GetLogicRect());
nSnapPosX=aSnapRect2.Left();
@@ -798,6 +800,7 @@ void SdrEditView::MergeNotPersistAttrFromMarked(SfxItemSet& rAttr, BOOL /*bOnlyH
if (!bMovProtectDC && bMovProtect!=pObj->IsMoveProtect()) bMovProtectDC=TRUE;
if (!bSizProtectDC && bSizProtect!=pObj->IsResizeProtect()) bSizProtectDC=TRUE;
if (!bPrintableDC && bPrintable !=pObj->IsPrintable()) bPrintableDC=TRUE;
+ if (!bVisibleDC && bVisible !=pObj->IsVisible()) bVisibleDC=TRUE;
if (!bRotAngleDC && nRotAngle !=pObj->GetRotateAngle()) bRotAngleDC=TRUE;
if (!bShrAngleDC && nShrAngle !=pObj->GetShearAngle()) bShrAngleDC=TRUE;
if (!bSnapWdtDC || !bSnapHgtDC || !bSnapPosXDC || !bSnapPosYDC || !bLogicWdtDiff || !bLogicHgtDiff) {
@@ -837,6 +840,7 @@ void SdrEditView::MergeNotPersistAttrFromMarked(SfxItemSet& rAttr, BOOL /*bOnlyH
rAttr.Put(SdrRotateOneItem());
rAttr.Put(SdrHorzShearOneItem());
rAttr.Put(SdrVertShearOneItem());
+
if (nMarkAnz>1) {
rAttr.Put(SdrResizeXAllItem());
rAttr.Put(SdrResizeYAllItem());
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index c49b0a8aa68f..afb81b5bc6c2 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -1090,7 +1090,16 @@ void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode)
if(!bFirstObjectComplete)
{
- aMergePolyPolygonA = aTmpPoly;
+ // #i111987# Also need to collect ORed source shape when more than
+ // a single polygon is involved
+ if(aMergePolyPolygonA.count())
+ {
+ aMergePolyPolygonA = basegfx::tools::solvePolygonOperationOr(aMergePolyPolygonA, aTmpPoly);
+ }
+ else
+ {
+ aMergePolyPolygonA = aTmpPoly;
+ }
}
else
{
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 9744e9764488..961c860567f9 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1164,7 +1164,7 @@ BOOL SdrObjEditView::KeyInput(const KeyEvent& rKEvt, Window* pWin)
#endif
if (pTextEditOutlinerView->PostKeyEvent(rKEvt))
{
- if( pMod && !pMod->IsChanged() )
+ if( pMod /* && !pMod->IsChanged() */ )
{
if( pTextEditOutliner && pTextEditOutliner->IsModified() )
pMod->SetChanged( sal_True );
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 633d82d67816..f10610317578 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -85,6 +85,11 @@ ImpSdrGDIMetaFileImport::ImpSdrGDIMetaFileImport(SdrModel& rModel):
bLastObjWasPolyWithoutLine(FALSE),bNoLine(FALSE),bNoFill(FALSE),bLastObjWasLine(FALSE)
{
aVD.EnableOutput(FALSE);
+
+ // #i111954# init to no fill and no line initially
+ aVD.SetLineColor();
+ aVD.SetFillColor();
+
aOldLineColor.SetRed( aVD.GetLineColor().GetRed() + 1 ); // invalidate old line color
pLineAttr=new SfxItemSet(rModel.GetItemPool(),XATTR_LINE_FIRST,XATTR_LINE_LAST);
pFillAttr=new SfxItemSet(rModel.GetItemPool(),XATTR_FILL_FIRST,XATTR_FILL_LAST);
@@ -380,17 +385,61 @@ void ImpSdrGDIMetaFileImport::InsertObj( SdrObject* pObj, sal_Bool bScale )
pObj->NbcMove( Size( aOfs.X(), aOfs.Y() ) );
}
- aTmpList.InsertObject( pObj );
- if ( HAS_BASE( SdrPathObj, pObj ) )
+ // #i111954# check object for visibility
+ // used are SdrPathObj, SdrRectObj, SdrCircObj, SdrGrafObj
+ bool bVisible(false);
+
+ if(pObj->HasLineStyle())
+ {
+ bVisible = true;
+ }
+
+ if(!bVisible && pObj->HasFillStyle())
+ {
+ bVisible = true;
+ }
+
+ if(!bVisible)
+ {
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(pObj);
+
+ if(pTextObj && pTextObj->HasText())
+ {
+ bVisible = true;
+ }
+ }
+
+ if(!bVisible)
{
- FASTBOOL bClosed=pObj->IsClosedObj();
- bLastObjWasPolyWithoutLine=bNoLine && bClosed;
- bLastObjWasLine=!bClosed;
+ SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >(pObj);
+
+ if(pGrafObj)
+ {
+ // this may be refined to check if the graphic really is visible. It
+ // is here to ensure that graphic objects without fill, line and text
+ // get created
+ bVisible = true;
+ }
+ }
+
+ if(!bVisible)
+ {
+ SdrObject::Free(pObj);
}
else
{
- bLastObjWasPolyWithoutLine = FALSE;
- bLastObjWasLine = FALSE;
+ aTmpList.InsertObject( pObj );
+ if ( HAS_BASE( SdrPathObj, pObj ) )
+ {
+ FASTBOOL bClosed=pObj->IsClosedObj();
+ bLastObjWasPolyWithoutLine=bNoLine && bClosed;
+ bLastObjWasLine=!bClosed;
+ }
+ else
+ {
+ bLastObjWasPolyWithoutLine = FALSE;
+ bLastObjWasLine = FALSE;
+ }
}
}
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 271c466017d0..791d0f5ca8e7 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -306,7 +306,8 @@ SdrHdl::SdrHdl():
bSelect(FALSE),
b1PixMore(FALSE),
bPlusHdl(FALSE),
- mbMoveOutside(false)
+ mbMoveOutside(false),
+ mbMouseOver(false)
{
}
@@ -324,7 +325,8 @@ SdrHdl::SdrHdl(const Point& rPnt, SdrHdlKind eNewKind):
bSelect(FALSE),
b1PixMore(FALSE),
bPlusHdl(FALSE),
- mbMoveOutside(false)
+ mbMoveOutside(false),
+ mbMouseOver(false)
{
}
@@ -946,6 +948,19 @@ BOOL SdrHdl::IsFocusHdl() const
}
}
+void SdrHdl::onMouseEnter(const MouseEvent& /*rMEvt*/)
+{
+}
+
+void SdrHdl::onMouseLeave()
+{
+}
+
+bool SdrHdl::isMouseOver() const
+{
+ return mbMouseOver;
+}
+
////////////////////////////////////////////////////////////////////////////////////////////////////
// class SdrHdlColor
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 0c29815584c0..bff815a7feb6 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -1060,6 +1060,44 @@ 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 )
+ {
+ SdrHdl* pMouseOverHdl = 0;
+ if( !rMEvt.IsLeaveWindow() && pWin )
+ {
+ Point aMDPos( pWin->PixelToLogic( rMEvt.GetPosPixel() ) );
+ pMouseOverHdl = PickHandle(aMDPos);
+ }
+
+ // notify last mouse over handle that he lost the mouse
+ for(ULONG nHdl = 0; nHdl < nHdlCount; nHdl++ )
+ {
+ SdrHdl* pCurrentHdl = GetHdl(nHdl);
+ if( pCurrentHdl->mbMouseOver )
+ {
+ if( pCurrentHdl != pMouseOverHdl )
+ {
+ pCurrentHdl->mbMouseOver = false;
+ pCurrentHdl->onMouseLeave();
+ }
+ break;
+ }
+ }
+
+ // notify current mouse over handle
+ if( pMouseOverHdl /* && !pMouseOverHdl->mbMouseOver */ )
+ {
+ pMouseOverHdl->mbMouseOver = true;
+ pMouseOverHdl->onMouseEnter(rMEvt);
+ }
+ }
+ return SdrSnapView::MouseMove(rMEvt, pWin);
+}
+
void SdrMarkView::ForceRefToMarked()
{
switch(eDragMode)
@@ -1188,6 +1226,10 @@ void SdrMarkView::CheckMarked()
}
bRaus=bRaus || pPV->GetLockedLayers().IsSet(nLay) || // Layer gesperrt?
!pPV->GetVisibleLayers().IsSet(nLay); // Layer nicht sichtbar?
+
+ if( !bRaus )
+ bRaus = !pObj->IsVisible(); // not visible objects can not be marked
+
if (!bRaus) {
// Joe am 9.3.1997: Gruppierte Objekten koennen nun auch
// markiert werden. Nach EnterGroup muessen aber die Objekte
@@ -1591,7 +1633,7 @@ void SdrMarkView::SetMarkHdlSizePixel(USHORT nSiz)
#define SDRSEARCH_IMPISMASTER 0x80000000 /* MasterPage wird gerade durchsucht */
SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, USHORT nTol, SdrObject* pObj, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay) const
{
- if((nOptions & SDRSEARCH_IMPISMASTER) && pObj->IsNotVisibleAsMaster())
+ if(((nOptions & SDRSEARCH_IMPISMASTER) && pObj->IsNotVisibleAsMaster()) || (!pObj->IsVisible()))
{
return NULL;
}
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 2f255850e811..6a8221136f7c 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -700,7 +700,10 @@ void SdrObjCustomShape::MergeDefaultAttributes( const rtl::OUString* pType )
for ( i = 0; i < nCount; i++ )
{
if ( seqAdjustmentValues[ i ].State != com::sun::star::beans::PropertyState_DIRECT_VALUE )
+ {
seqAdjustmentValues[ i ].Value <<= pDefData[ i ];
+ seqAdjustmentValues[ i ].State = com::sun::star::beans::PropertyState_DIRECT_VALUE;
+ }
}
}
aPropVal.Name = sAdjustmentValues;
@@ -2075,7 +2078,7 @@ void SdrObjCustomShape::ImpCheckCustomGluePointsAreAdded()
sal_Int32 nXDiff = aBoundRect.Left() - aRect.Left();
sal_Int32 nYDiff = aBoundRect.Top() - aRect.Top();
- if (nShearWink&&(bMirroredX&&!bMirroredY)||(bMirroredY&&!bMirroredX))
+ if (nShearWink&&((bMirroredX&&!bMirroredY)||(bMirroredY&&!bMirroredX)))
{
nShearWink = -nShearWink;
fTan = -fTan;
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 6e1660761dc0..0a0c35aec524 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -47,9 +47,8 @@
#include <svx/svdpage.hxx>
#include <svx/svdovirt.hxx> // Fuer Add/Del Ref
#include <svx/svdview.hxx> // fuer Dragging (Ortho abfragen)
-#include "svdscrol.hxx"
#include "svx/svdglob.hxx" // StringCache
-#include "svx/svdstr.hrc" // Objektname
+#include <svx/svdstr.hrc> // Objektname
#include <svx/svdogrp.hxx> // Factory
#include <svx/svdopath.hxx> // Factory
#include <svx/svdoedge.hxx> // Factory
@@ -75,7 +74,7 @@
#include <svx/xlndsit.hxx>
#include <svx/xlnclit.hxx>
#include <svx/xflclit.hxx>
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include <svx/xlntrit.hxx>
#include <svx/xfltrit.hxx>
#include <svx/xfltrit.hxx>
@@ -121,6 +120,7 @@
#include <svx/sdrhittesthelper.hxx>
#include <svx/svdundo.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <svx/sdrobjectfilter.hxx>
using namespace ::com::sun::star;
@@ -235,6 +235,7 @@ SdrObjGeoData::SdrObjGeoData():
bSizProt(FALSE),
bNoPrint(FALSE),
bClosedObj(FALSE),
+ mbVisible(true),
mnLayerID(0)
{
DBG_CTOR(SdrObjGeoData,NULL);
@@ -414,6 +415,7 @@ SdrObject::SdrObject()
bEmptyPresObj =FALSE;
bNotVisibleAsMaster=FALSE;
bClosedObj =FALSE;
+ mbVisible = true;
// #i25616#
mbLineIsOutsideGeometry = sal_False;
@@ -1049,6 +1051,7 @@ void SdrObject::operator=(const SdrObject& rObj)
bSizProt=rObj.bSizProt;
bMovProt=rObj.bMovProt;
bNoPrint=rObj.bNoPrint;
+ mbVisible=rObj.mbVisible;
bMarkProt=rObj.bMarkProt;
//EmptyPresObj wird nicht kopiert: nun doch! (25-07-1995, Joe)
bEmptyPresObj =rObj.bEmptyPresObj;
@@ -1687,6 +1690,11 @@ void SdrObject::NbcSetLogicRect(const Rectangle& rRect)
NbcSetSnapRect(rRect);
}
+void SdrObject::AdjustToMaxRect( const Rectangle& rMaxRect, bool /* bShrinkOnly = false */ )
+{
+ SetLogicRect( rMaxRect );
+}
+
void SdrObject::SetSnapRect(const Rectangle& rRect)
{
Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
@@ -1915,6 +1923,7 @@ void SdrObject::SaveGeoData(SdrObjGeoData& rGeo) const
rGeo.bMovProt =bMovProt ;
rGeo.bSizProt =bSizProt ;
rGeo.bNoPrint =bNoPrint ;
+ rGeo.mbVisible =mbVisible ;
rGeo.bClosedObj =bClosedObj ;
rGeo.mnLayerID = mnLayerID;
@@ -1941,6 +1950,7 @@ void SdrObject::RestGeoData(const SdrObjGeoData& rGeo)
bMovProt =rGeo.bMovProt ;
bSizProt =rGeo.bSizProt ;
bNoPrint =rGeo.bNoPrint ;
+ mbVisible =rGeo.mbVisible ;
bClosedObj =rGeo.bClosedObj ;
mnLayerID = rGeo.mnLayerID;
@@ -2148,6 +2158,11 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr)
SetPrintable(b);
}
+ if (rAttr.GetItemState(SDRATTR_OBJVISIBLE,TRUE,&pPoolItem)==SFX_ITEM_SET) {
+ bool b=((const SdrObjVisibleItem*)pPoolItem)->GetValue();
+ SetVisible(b);
+ }
+
SdrLayerID nLayer=SDRLAYER_NOTFOUND;
if (rAttr.GetItemState(SDRATTR_LAYERID,TRUE,&pPoolItem)==SFX_ITEM_SET) {
nLayer=((const SdrLayerIdItem*)pPoolItem)->GetValue();
@@ -2209,6 +2224,7 @@ void SdrObject::TakeNotPersistAttr(SfxItemSet& rAttr, FASTBOOL bMerge) const
lcl_SetItem(rAttr,bMerge,SdrObjMoveProtectItem(IsMoveProtect()));
lcl_SetItem(rAttr,bMerge,SdrObjSizeProtectItem(IsResizeProtect()));
lcl_SetItem(rAttr,bMerge,SdrObjPrintableItem(IsPrintable()));
+ lcl_SetItem(rAttr,bMerge,SdrObjVisibleItem(IsVisible()));
lcl_SetItem(rAttr,bMerge,SdrRotateAngleItem(GetRotateAngle()));
lcl_SetItem(rAttr,bMerge,SdrShearAngleItem(GetShearAngle()));
lcl_SetItem(rAttr,bMerge,SdrOneSizeWidthItem(rSnap.GetWidth()-1));
@@ -2687,11 +2703,29 @@ void SdrObject::SetResizeProtect(sal_Bool bProt)
void SdrObject::SetPrintable(sal_Bool bPrn)
{
- bNoPrint=!bPrn;
- SetChanged();
- if (IsInserted() && pModel!=NULL) {
- SdrHint aHint(*this);
- pModel->Broadcast(aHint);
+ if( bPrn == bNoPrint )
+ {
+ bNoPrint=!bPrn;
+ SetChanged();
+ if (IsInserted() && pModel!=NULL)
+ {
+ SdrHint aHint(*this);
+ pModel->Broadcast(aHint);
+ }
+ }
+}
+
+void SdrObject::SetVisible(sal_Bool bVisible)
+{
+ if( bVisible != mbVisible )
+ {
+ mbVisible = bVisible;
+ SetChanged();
+ if (IsInserted() && pModel!=NULL)
+ {
+ SdrHint aHint(*this);
+ pModel->Broadcast(aHint);
+ }
}
}
@@ -3266,4 +3300,11 @@ void SdrObjFactory::RemoveMakeUserDataHdl(const Link& rLink)
rLL.RemoveLink(rLink);
}
+namespace svx
+{
+ ISdrObjectFilter::~ISdrObjectFilter()
+ {
+ }
+}
+
// eof
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index 67d01159a72d..ba300c74da6d 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -239,8 +239,9 @@ basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrObjKind eCicrleKind, c
else
{
// mirror start, end for geometry creation since model coordinate system is mirrored in Y
- const double fStart(((36000 - nEnd) % 36000) * F_PI18000);
- const double fEnd(((36000 - nStart) % 36000) * F_PI18000);
+ // #i111715# increase numerical correctness by first dividing and not using F_PI1800
+ const double fStart((((36000 - nEnd) % 36000) / 18000.0) * F_PI);
+ const double fEnd((((36000 - nStart) % 36000) / 18000.0) * F_PI);
// create circle segment. This is not closed by default
aCircPolygon = basegfx::tools::createPolygonFromEllipseSegment(
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 027cca425437..c7bbc5fab761 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -1674,6 +1674,11 @@ void SdrEdgeObj::SetEdgeTrackPath( const basegfx::B2DPolyPolygon& rPoly )
*pEdgeTrack = XPolygon( rPoly.getB2DPolygon( 0 ) );
bEdgeTrackDirty = sal_False;
bEdgeTrackUserDefined = sal_True;
+
+ // #i110629# also set aRect and maSnapeRect dependent from pEdgeTrack
+ const Rectangle aPolygonBounds(pEdgeTrack->GetBoundRect());
+ aRect = aPolygonBounds;
+ maSnapRect = aPolygonBounds;
}
}
@@ -2100,7 +2105,7 @@ FASTBOOL SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV,
// Problem: Gruppenobjekt mit verschiedenen Layern liefert LayerID 0 !!!!
no--;
SdrObject* pObj=pOL->GetObj(no);
- if (rVisLayer.IsSet(pObj->GetLayer()) && // nur sichtbare Objekte
+ if (rVisLayer.IsSet(pObj->GetLayer()) && pObj->IsVisible() && // only visible objects
(pThis==NULL || pObj!=(SdrObject*)pThis) && // nicht an mich selbst connecten
pObj->IsNode())
{
@@ -2206,17 +2211,31 @@ FASTBOOL SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV,
void SdrEdgeObj::NbcSetSnapRect(const Rectangle& rRect)
{
- Rectangle aOld(GetSnapRect());
- long nMulX = rRect.Right() - rRect.Left();
- long nDivX = aOld.Right() - aOld.Left();
- long nMulY = rRect.Bottom() - rRect.Top();
- long nDivY = aOld.Bottom() - aOld.Top();
- if ( nDivX == 0 ) { nMulX = 1; nDivX = 1; }
- if ( nDivY == 0 ) { nMulY = 1; nDivY = 1; }
- Fraction aX(nMulX, nDivX);
- Fraction aY(nMulY, nDivY);
- NbcResize(aOld.TopLeft(), aX, aY);
- NbcMove(Size(rRect.Left() - aOld.Left(), rRect.Top() - aOld.Top()));
+ const Rectangle aOld(GetSnapRect());
+
+ if(aOld != rRect)
+ {
+ if(aRect.IsEmpty() && 0 == pEdgeTrack->GetPointCount())
+ {
+ // #i110629# When initializing, do not scale on empty Rectangle; this
+ // will mirror the underlying text object (!)
+ aRect = rRect;
+ maSnapRect = rRect;
+ }
+ else
+ {
+ long nMulX = rRect.Right() - rRect.Left();
+ long nDivX = aOld.Right() - aOld.Left();
+ long nMulY = rRect.Bottom() - rRect.Top();
+ long nDivY = aOld.Bottom() - aOld.Top();
+ if ( nDivX == 0 ) { nMulX = 1; nDivX = 1; }
+ if ( nDivY == 0 ) { nMulY = 1; nDivY = 1; }
+ Fraction aX(nMulX, nDivX);
+ Fraction aY(nMulY, nDivY);
+ NbcResize(aOld.TopLeft(), aX, aY);
+ NbcMove(Size(rRect.Left() - aOld.Left(), rRect.Top() - aOld.Top()));
+ }
+ }
}
void SdrEdgeObj::NbcMove(const Size& rSiz)
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index c9686eecb7db..e341a99d656b 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -1025,7 +1025,7 @@ void SdrGrafObj::ImpSetGrafInfoToAttr()
// -----------------------------------------------------------------------------
-void SdrGrafObj::AdjustToMaxRect( const Rectangle& rMaxRect, BOOL bShrinkOnly )
+void SdrGrafObj::AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly )
{
Size aSize;
Size aMaxSize( rMaxRect.GetSize() );
diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx
index fbce08fdfaa8..8d360e67bed0 100644
--- a/svx/source/svdraw/svdomedia.cxx
+++ b/svx/source/svdraw/svdomedia.cxx
@@ -28,6 +28,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
+#include <vcl/svapp.hxx>
+
#include <svx/svdomedia.hxx>
#include "svx/svdglob.hxx"
#include "svx/svdstr.hrc"
@@ -147,6 +149,53 @@ void SdrMediaObj::operator=(const SdrObject& rObj)
// ------------------------------------------------------------------------------
+void SdrMediaObj::AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly /* = false */ )
+{
+ Size aSize( Application::GetDefaultDevice()->PixelToLogic( getPreferredSize(), MAP_100TH_MM ) );
+ Size aMaxSize( rMaxRect.GetSize() );
+
+ if( aSize.Height() != 0 && aSize.Width() != 0 )
+ {
+ Point aPos( rMaxRect.TopLeft() );
+
+ // Falls Grafik zu gross, wird die Grafik
+ // in die Seite eingepasst
+ if ( (!bShrinkOnly ||
+ ( aSize.Height() > aMaxSize.Height() ) ||
+ ( aSize.Width() > aMaxSize.Width() ) )&&
+ aSize.Height() && aMaxSize.Height() )
+ {
+ float fGrfWH = (float)aSize.Width() /
+ (float)aSize.Height();
+ float fWinWH = (float)aMaxSize.Width() /
+ (float)aMaxSize.Height();
+
+ // Grafik an Pagesize anpassen (skaliert)
+ if ( fGrfWH < fWinWH )
+ {
+ aSize.Width() = (long)(aMaxSize.Height() * fGrfWH);
+ aSize.Height()= aMaxSize.Height();
+ }
+ else if ( fGrfWH > 0.F )
+ {
+ aSize.Width() = aMaxSize.Width();
+ aSize.Height()= (long)(aMaxSize.Width() / fGrfWH);
+ }
+
+ aPos = rMaxRect.Center();
+ }
+
+ if( bShrinkOnly )
+ aPos = aRect.TopLeft();
+
+ aPos.X() -= aSize.Width() / 2;
+ aPos.Y() -= aSize.Height() / 2;
+ SetLogicRect( Rectangle( aPos, aSize ) );
+ }
+}
+
+// ------------------------------------------------------------------------------
+
void SdrMediaObj::setURL( const ::rtl::OUString& rURL )
{
::avmedia::MediaItem aURLItem;
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 4973388ea6d4..216783663603 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -1714,8 +1714,8 @@ void SdrOle2Obj::ImpSetVisAreaSize()
if ( pClient || bHasOwnClient )
{
// TODO/LATER: IMHO we need to do similar things when object is UIActive or OutplaceActive?! (MBA)
- if ( (nMiscStatus & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE) &&
- svt::EmbeddedObjectRef::TryRunningState( xObjRef.GetObject() )
+ if ( ((nMiscStatus & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE) &&
+ svt::EmbeddedObjectRef::TryRunningState( xObjRef.GetObject() ))
|| xObjRef->getCurrentState() == embed::EmbedStates::INPLACE_ACTIVE
)
{
@@ -1832,11 +1832,7 @@ void SdrOle2Obj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract
// if the object needs recompose on resize
// the client site should be created before the resize will take place
// check whether there is no client site and create it if necessary
- if ( !SfxInPlaceClient::GetClient( dynamic_cast<SfxObjectShell*>(pModel->GetPersist()), xObjRef.GetObject() )
- && !( mpImpl->pLightClient && xObjRef->getClientSite() == uno::Reference< embed::XEmbeddedClient >( mpImpl->pLightClient ) ) )
- {
- AddOwnLightClient();
- }
+ AddOwnLightClient();
}
}
@@ -2197,26 +2193,32 @@ sal_Bool SdrOle2Obj::CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScal
sal_Bool SdrOle2Obj::AddOwnLightClient()
{
// The Own Light Client must be registered in object only using this method!
- Connect();
-
- if ( xObjRef.is() && mpImpl->pLightClient )
+ if ( !SfxInPlaceClient::GetClient( dynamic_cast<SfxObjectShell*>(pModel->GetPersist()), xObjRef.GetObject() )
+ && !( mpImpl->pLightClient && xObjRef->getClientSite() == uno::Reference< embed::XEmbeddedClient >( mpImpl->pLightClient ) ) )
{
- Fraction aScaleWidth;
- Fraction aScaleHeight;
- Size aObjAreaSize;
- if ( CalculateNewScaling( aScaleWidth, aScaleHeight, aObjAreaSize ) )
+ Connect();
+
+ if ( xObjRef.is() && mpImpl->pLightClient )
{
- mpImpl->pLightClient->SetSizeScale( aScaleWidth, aScaleHeight );
- try {
- xObjRef->setClientSite( mpImpl->pLightClient );
- return sal_True;
- } catch( uno::Exception& )
- {}
+ Fraction aScaleWidth;
+ Fraction aScaleHeight;
+ Size aObjAreaSize;
+ if ( CalculateNewScaling( aScaleWidth, aScaleHeight, aObjAreaSize ) )
+ {
+ mpImpl->pLightClient->SetSizeScale( aScaleWidth, aScaleHeight );
+ try {
+ xObjRef->setClientSite( mpImpl->pLightClient );
+ return sal_True;
+ } catch( uno::Exception& )
+ {}
+ }
+
}
+ return sal_False;
}
- return sal_False;
+ return sal_True;
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index dad8c1f205e3..7b9185ca7d3b 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -35,7 +35,6 @@
#include <svx/svdpage.hxx> // und fuer AnimationHandler (Laufschrift)
#include <svx/svdetc.hxx>
#include <svx/svdoutl.hxx>
-#include "svdscrol.hxx" // fuer Laufschrift
#include <svx/svdmodel.hxx> // OutlinerDefaults
#include "svx/svdglob.hxx" // Stringcache
#include "svx/svdstr.hrc" // Objektname
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index 639f4382a572..178af85d2cf4 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -107,15 +107,13 @@ namespace
maLocale(rInfo.mpLocale ? *rInfo.mpLocale : ::com::sun::star::lang::Locale()),
mbRTL(rInfo.mrFont.IsVertical() ? false : rInfo.IsRTL())
{
- if(mnTextLength)
+ if(mnTextLength && rInfo.mpDXArray)
{
maDblDXArray.reserve(mnTextLength);
- const sal_Int32 nFontWidth(0L == maFont.GetWidth() ? maFont.GetHeight() : maFont.GetWidth());
- const double fScaleFactor(0L != nFontWidth ? 1.0 / (double)nFontWidth : 1.0);
for(xub_StrLen a(0); a < mnTextLength; a++)
{
- maDblDXArray.push_back((double)rInfo.mpDXArray[a] * fScaleFactor);
+ maDblDXArray.push_back((double)rInfo.mpDXArray[a]);
}
}
}
@@ -291,7 +289,8 @@ namespace
const double fPolyLength(basegfx::tools::getLength(aPolygonCandidate));
double fPolyEnd(fPolyLength);
double fPolyStart(0.0);
- double fScaleFactor(1.0);
+ double fAutosizeScaleFactor(1.0);
+ bool bAutosizeScale(false);
if(maSdrFormTextAttribute.getFormTextMirror())
{
@@ -352,7 +351,8 @@ namespace
// if scale, prepare scale factor between curve length and text length
if(0.0 != fParagraphTextLength)
{
- fScaleFactor = (fPolyEnd - fPolyStart) / fParagraphTextLength;
+ fAutosizeScaleFactor = (fPolyEnd - fPolyStart) / fParagraphTextLength;
+ bAutosizeScale = true;
}
}
}
@@ -382,10 +382,10 @@ namespace
// prepare portion length. Takes RTL sections into account.
double fPortionLength(pCandidate->getDisplayLength(nUsedTextLength, nNextGlyphLen));
- if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust())
+ if(bAutosizeScale)
{
- // when scaling, expand portion length
- fPortionLength *= fScaleFactor;
+ // when autosize scaling, expand portion length
+ fPortionLength *= fAutosizeScaleFactor;
}
// create transformation
@@ -397,10 +397,10 @@ namespace
aNewTransformA.scale(aFontScaling.getX(), aFontScaling.getY());
// prepare scaling of text primitive
- if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust())
+ if(bAutosizeScale)
{
- // when scaling, expand text primitive scaling
- aNewTransformA.scale(fScaleFactor, fScaleFactor);
+ // when autosize scaling, expand text primitive scaling to it
+ aNewTransformA.scale(fAutosizeScaleFactor, fAutosizeScaleFactor);
}
// eventually create shadow primitives from aDecomposition and add to rDecomposition
@@ -497,17 +497,42 @@ namespace
aNewTransformB.translate(aPerpendicular.getX(), aPerpendicular.getY());
}
- // shadow primitive creation
- if(bShadow)
+ if(pCandidate->getText().Len() && nNextGlyphLen)
{
- if(pCandidate->getText().Len() && nNextGlyphLen)
+ const xub_StrLen nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen));
+ ::std::vector< double > aNewDXArray;
+
+ if(nNextGlyphLen > 1 && pCandidate->getDoubleDXArray().size())
{
+ // copy DXArray for portion
+ aNewDXArray.insert(
+ aNewDXArray.begin(),
+ pCandidate->getDoubleDXArray().begin() + nPortionIndex,
+ pCandidate->getDoubleDXArray().begin() + (nPortionIndex + nNextGlyphLen));
+
+ if(nPortionIndex > 0)
+ {
+ // adapt to portion start
+ double fDXOffset= *(pCandidate->getDoubleDXArray().begin() + (nPortionIndex - 1));
+ ::std::transform(
+ aNewDXArray.begin(), aNewDXArray.end(),
+ aNewDXArray.begin(), ::std::bind2nd(::std::minus<double>(), fDXOffset));
+ }
+
+ if(bAutosizeScale)
+ {
+ // when autosize scaling, adapt to DXArray, too
+ ::std::transform(
+ aNewDXArray.begin(), aNewDXArray.end(),
+ aNewDXArray.begin(), ::std::bind2nd(::std::multiplies<double>(), fAutosizeScaleFactor));
+ }
+ }
+
+ if(bShadow)
+ {
+ // shadow primitive creation
const Color aShadowColor(maSdrFormTextAttribute.getFormTextShdwColor());
const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor());
- const xub_StrLen nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen));
- const ::std::vector< double > aNewDXArray(
- pCandidate->getDoubleDXArray().begin() + nPortionIndex,
- pCandidate->getDoubleDXArray().begin() + nPortionIndex + nNextGlyphLen);
drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pNew =
new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
@@ -522,30 +547,25 @@ namespace
mrShadowDecomposition.push_back(pNew);
}
- }
- // primitive creation
- if(pCandidate->getText().Len() && nNextGlyphLen)
- {
- const Color aColor(pCandidate->getFont().GetColor());
- const basegfx::BColor aRGBColor(aColor.getBColor());
- const xub_StrLen nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen));
- const ::std::vector< double > aNewDXArray(
- pCandidate->getDoubleDXArray().begin() + nPortionIndex,
- pCandidate->getDoubleDXArray().begin() + nPortionIndex + nNextGlyphLen);
-
- drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pNew =
- new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
- aNewTransformB * aNewTransformA,
- pCandidate->getText(),
- nPortionIndex,
- nNextGlyphLen,
- aNewDXArray,
- aCandidateFontAttribute,
- pCandidate->getLocale(),
- aRGBColor);
-
- mrDecomposition.push_back(pNew);
+ {
+ // primitive creation
+ const Color aColor(pCandidate->getFont().GetColor());
+ const basegfx::BColor aRGBColor(aColor.getBColor());
+
+ drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pNew =
+ new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
+ aNewTransformB * aNewTransformA,
+ pCandidate->getText(),
+ nPortionIndex,
+ nNextGlyphLen,
+ aNewDXArray,
+ aCandidateFontAttribute,
+ pCandidate->getLocale(),
+ aRGBColor);
+
+ mrDecomposition.push_back(pNew);
+ }
}
// consume from portion // no += here, xub_StrLen is USHORT and the compiler will gererate a warning here
diff --git a/svx/source/svdraw/svdoutl.cxx b/svx/source/svdraw/svdoutl.cxx
index e4b27766a265..79e74a3382b8 100644
--- a/svx/source/svdraw/svdoutl.cxx
+++ b/svx/source/svdraw/svdoutl.cxx
@@ -125,5 +125,8 @@ XubString SdrOutliner::CalcFieldValue(const SvxFieldItem& rField, USHORT nPara,
const SdrTextObj* SdrOutliner::GetTextObj() const
{
- return static_cast< SdrTextObj* >( mpTextObj.get() );
+ if( mpTextObj.is() )
+ return static_cast< SdrTextObj* >( mpTextObj.get() );
+ else
+ return 0;
}
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 872d88bc180b..f388e91c4556 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -1221,18 +1221,6 @@ SdrPageProperties::SdrPageProperties(SdrPage& rSdrPage)
}
}
-SdrPageProperties::SdrPageProperties(const SdrPageProperties& rCandidate)
-: SfxListener(),
- mpSdrPage(rCandidate.mpSdrPage),
- mpStyleSheet(0),
- mpProperties(new SfxItemSet(*rCandidate.mpProperties))
-{
- if(rCandidate.GetStyleSheet())
- {
- ImpAddStyleSheet(*rCandidate.GetStyleSheet());
- }
-}
-
SdrPageProperties::~SdrPageProperties()
{
ImpRemoveStyleSheet();
@@ -1365,6 +1353,8 @@ SdrPage::SdrPage(const SdrPage& rSrcPage)
// Warning: this leads to slicing (see issue 93186) and has to be
// removed as soon as possible.
*this = rSrcPage;
+ OSL_ENSURE(mpSdrPageProperties,
+ "SdrPage::SdrPage: operator= did not create needed SdrPageProperties (!)");
// be careful and correct eListKind, a member of SdrObjList which
// will be changed by the SdrOIbjList::operator= before...
@@ -1382,8 +1372,6 @@ SdrPage::SdrPage(const SdrPage& rSrcPage)
mxUnoPage = NULL;
xComponent->dispose();
}
-
- mpSdrPageProperties = new SdrPageProperties(rSrcPage.getSdrPageProperties());
}
SdrPage::~SdrPage()
@@ -1478,8 +1466,28 @@ void SdrPage::operator=(const SdrPage& rSrcPage)
mbObjectsNotPersistent = rSrcPage.mbObjectsNotPersistent;
{
- delete mpSdrPageProperties;
- mpSdrPageProperties = new SdrPageProperties(rSrcPage.getSdrPageProperties());
+ // #i111122# delete SdrPageProperties when model is different
+ if(mpSdrPageProperties && GetModel() != rSrcPage.GetModel())
+ {
+ delete mpSdrPageProperties;
+ mpSdrPageProperties = 0;
+ }
+
+ if(!mpSdrPageProperties)
+ {
+ mpSdrPageProperties = new SdrPageProperties(*this);
+ }
+ else
+ {
+ mpSdrPageProperties->ClearItem(0);
+ }
+
+ if(!IsMasterPage())
+ {
+ mpSdrPageProperties->PutItemSet(rSrcPage.getSdrPageProperties().GetItemSet());
+ }
+
+ mpSdrPageProperties->SetStyleSheet(rSrcPage.getSdrPageProperties().GetStyleSheet());
}
// Now copy the contained obejcts (by cloning them)
@@ -1659,7 +1667,17 @@ void SdrPage::SetModel(SdrModel* pNewModel)
}
pLayerAdmin->SetModel(pNewModel);
- SdrPageProperties *pNew = new SdrPageProperties(getSdrPageProperties());
+ // create new SdrPageProperties with new model (due to SfxItemSet there)
+ // and copy ItemSet and StyleSheet
+ SdrPageProperties *pNew = new SdrPageProperties(*this);
+
+ if(!IsMasterPage())
+ {
+ pNew->PutItemSet(getSdrPageProperties().GetItemSet());
+ }
+
+ pNew->SetStyleSheet(getSdrPageProperties().GetStyleSheet());
+
delete mpSdrPageProperties;
mpSdrPageProperties = pNew;
}
diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx
index c594813f4292..6e852e72017a 100644
--- a/svx/source/svdraw/svdpagv.cxx
+++ b/svx/source/svdraw/svdpagv.cxx
@@ -754,6 +754,12 @@ sal_Bool SdrPageView::IsObjMarkable(SdrObject* pObj) const
return sal_False;
}
+ // only visible are markable
+ if( !pObj->IsVisible() )
+ {
+ return sal_False;
+ }
+
// #112440#
if(pObj->ISA(SdrObjGroup))
{
diff --git a/svx/source/svdraw/svdscrol.hxx b/svx/source/svdraw/svdscrol.hxx
deleted file mode 100644
index f44cf3d81c65..000000000000
--- a/svx/source/svdraw/svdscrol.hxx
+++ /dev/null
@@ -1,31 +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 _SVDSCROL_HXX
-#define _SVDSCROL_HXX
-
-#endif //_SVDSCROL_HXX
diff --git a/svx/source/svdraw/svdstr.src b/svx/source/svdraw/svdstr.src
index ce024291241b..5125d8f099a9 100644
--- a/svx/source/svdraw/svdstr.src
+++ b/svx/source/svdraw/svdstr.src
@@ -2395,6 +2395,11 @@ String SIP_SA_OBJPRINTABLE
Text [ en-US ] = "Object, printable";
};
+String SIP_SA_OBJVISIBLE
+{
+ Text [ en-US ] = "Object, visible";
+};
+
String SIP_SA_LAYERID
{
Text [ en-US ] = "Level ID";
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index 960c440d5973..1320aef9b17b 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -1358,6 +1358,10 @@ SdrViewContext SdrView::GetContext() const
for( ULONG nMarkNum = 0; nMarkNum < nMarkAnz && ( bGraf || bMedia ); nMarkNum++ )
{
const SdrObject* pMarkObj = GetMarkedObjectByIndex( nMarkNum );
+ DBG_ASSERT( pMarkObj, "SdrView::GetContext(), null pointer in mark list!" );
+
+ if( !pMarkObj )
+ continue;
if( !pMarkObj->ISA( SdrGrafObj ) )
bGraf = FALSE;
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 71e48ff06cb0..7f9250a90561 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -2178,6 +2178,16 @@ void SdrTableObj::NbcSetLogicRect(const Rectangle& rRect)
SetRectsDirty();
}
+
+// --------------------------------------------------------------------
+
+void SdrTableObj::AdjustToMaxRect( const Rectangle& rMaxRect, bool /* bShrinkOnly = false */ )
+{
+ Rectangle aAdjustRect( rMaxRect );
+ aAdjustRect.setHeight( GetLogicRect().getHeight() );
+ SetLogicRect( aAdjustRect );
+}
+
// --------------------------------------------------------------------
void SdrTableObj::NbcMove(const Size& rSiz)
diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx
index 45a53ee7758a..e5bc5045c7b3 100644
--- a/svx/source/tbxctrls/extrusioncontrols.cxx
+++ b/svx/source/tbxctrls/extrusioncontrols.cxx
@@ -32,9 +32,15 @@
#include <string> // HACK: prevent conflict between STLPORT and Workshop headers
-#ifndef _TOOLBOX_HXX //autogen
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/awt/MenuItemStyle.hpp>
+#include <com/sun/star/awt/XPopupMenuExtended.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
+
+#include <vos/mutex.hxx>
+
+#include <svtools/toolbarmenu.hxx>
#include <vcl/toolbox.hxx>
-#endif
#include <sfx2/app.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/objsh.hxx>
@@ -42,30 +48,35 @@
#include <vcl/settings.hxx>
#include <svl/intitem.hxx>
#include <editeng/colritem.hxx>
-#include "svx/chrtitem.hxx"
#include <tools/urlobj.hxx>
#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-
#include <svx/svdtrans.hxx>
+#include <svx/sdasitm.hxx>
#include <svx/dialmgr.hxx>
-#include "svx/extrusioncontrols.hxx"
+#include "svx/extrusioncolorcontrol.hxx"
+
+//#include "chrtitem.hxx"
+#include "helpid.hrc"
+#include "extrusioncontrols.hxx"
#include "extrusioncontrols.hrc"
-#include <svx/sdasitm.hxx>
-#include "toolbarmenu.hxx"
#include "colorwindow.hxx"
-
-#include <svx/tbxcolorupdate.hxx>
+#include "extrusiondepthdialog.hxx"
////////////
-using namespace svx;
+using ::rtl::OUString;
+//using ::svtools::ToolbarMenu;
+
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::util;
+using namespace ::com::sun::star::graphic;
-SFX_IMPL_TOOLBOX_CONTROL( ExtrusionDirectionControl, SfxBoolItem );
+namespace svx
+{
/*************************************************************************
|*
@@ -75,43 +86,17 @@ SFX_IMPL_TOOLBOX_CONTROL( ExtrusionDirectionControl, SfxBoolItem );
static sal_Int32 gSkewList[] = { 135, 90, 45, 180, 0, -360, -135, -90, -45 };
-ExtrusionDirectionWindow::ExtrusionDirectionWindow(
- USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ) :
- SfxPopupWindow( nId,
- rFrame,
- SVX_RES( RID_SVXFLOAT_EXTRUSION_DIRECTION )),
- mxFrame( rFrame ),
- maImgPerspective( SVX_RES( IMG_PERSPECTIVE ) ),
- maImgPerspectiveH( SVX_RES( IMG_PERSPECTIVE_H ) ),
- maImgParallel( SVX_RES( IMG_PARALLEL ) ),
- maImgParallelH( SVX_RES( IMG_PARALLEL_H ) ),
- mbPopupMode ( TRUE )
+ExtrusionDirectionWindow::ExtrusionDirectionWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow )
+: ToolbarMenu( rFrame, pParentWindow, SVX_RES( RID_SVXFLOAT_EXTRUSION_DIRECTION ))
+, mrController( rController )
+, maImgPerspective( SVX_RES( IMG_PERSPECTIVE ) )
+, maImgPerspectiveH( SVX_RES( IMG_PERSPECTIVE_H ) )
+, maImgParallel( SVX_RES( IMG_PARALLEL ) )
+, maImgParallelH( SVX_RES( IMG_PARALLEL_H ) )
+, msExtrusionDirection( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionDirection" ) )
+, msExtrusionProjection( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionProjection" ) )
{
- implInit();
-}
-
-ExtrusionDirectionWindow::ExtrusionDirectionWindow(
- USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
- Window* pParentWindow ) :
- SfxPopupWindow( nId,
- rFrame,
- pParentWindow,
- SVX_RES( RID_SVXFLOAT_EXTRUSION_DIRECTION )),
- mxFrame( rFrame ),
- maImgPerspective( SVX_RES( IMG_PERSPECTIVE ) ),
- maImgPerspectiveH( SVX_RES( IMG_PERSPECTIVE_H ) ),
- maImgParallel( SVX_RES( IMG_PARALLEL ) ),
- maImgParallelH( SVX_RES( IMG_PARALLEL_H ) ),
- mbPopupMode ( TRUE )
-{
- implInit();
-}
-
-void ExtrusionDirectionWindow::implInit()
-{
- SetHelpId( HID_POPUP_EXTRUSION_DIRECTION );
+ SetHelpId( HID_MENU_EXTRUSION_DIRECTION );
USHORT i;
for( i = DIRECTION_NW; i <= DIRECTION_SE; i++ )
@@ -120,16 +105,10 @@ void ExtrusionDirectionWindow::implInit()
maImgDirectionH[i] = Image( SVX_RES( IMG_DIRECTION_H + i ) );
}
-// mpDirectionForewarder = new SfxStatusForwarder( SID_EXTRUSION_DIRECTION, *this );
-// mpProjectionForewarder = new SfxStatusForwarder( SID_EXTRUSION_PROJECTION, *this );
-
- mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN );
- mpMenu->SetHelpId( HID_MENU_EXTRUSION_DIRECTION );
- mpMenu->SetSelectHdl( LINK( this, ExtrusionDirectionWindow, SelectHdl ) );
- mpDirectionSet = new ValueSet( mpMenu, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT );
+ SetSelectHdl( LINK( this, ExtrusionDirectionWindow, SelectHdl ) );
+ mpDirectionSet = createEmptyValueSetControl();
mpDirectionSet->SetHelpId( HID_VALUESET_EXTRUSION_DIRECTION );
- mpDirectionSet->SetHelpId( HID_POPUP_LINEEND_CTRL );
mpDirectionSet->SetSelectHdl( LINK( this, ExtrusionDirectionWindow, SelectHdl ) );
mpDirectionSet->SetColCount( 3 );
mpDirectionSet->EnableFullItemMode( FALSE );
@@ -144,55 +123,39 @@ void ExtrusionDirectionWindow::implInit()
mpDirectionSet->SetOutputSizePixel( Size( 72, 72 ) );
- mpMenu->appendEntry( 2, mpDirectionSet );
- mpMenu->appendSeparator();
- mpMenu->appendEntry( 0, String( SVX_RES( STR_PERSPECTIVE ) ), bHighContrast ? maImgPerspectiveH : maImgPerspective );
- mpMenu->appendEntry( 1, String( SVX_RES( STR_PARALLEL ) ), bHighContrast ? maImgParallelH : maImgParallel );
-
- SetOutputSizePixel( mpMenu->getMenuSize() );
- mpMenu->SetOutputSizePixel( GetOutputSizePixel() );
+ appendEntry( 2, mpDirectionSet );
+ appendSeparator();
+ appendEntry( 0, String( SVX_RES( STR_PERSPECTIVE ) ), bHighContrast ? maImgPerspectiveH : maImgPerspective );
+ appendEntry( 1, String( SVX_RES( STR_PARALLEL ) ), bHighContrast ? maImgParallelH : maImgParallel );
- mpMenu->Show();
+ SetOutputSizePixel( getMenuSize() );
FreeResource();
- AddStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionDirection" )));
- AddStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionProjection" )));
-}
-
-SfxPopupWindow* ExtrusionDirectionWindow::Clone() const
-{
- return new ExtrusionDirectionWindow( GetId(), mxFrame );
+ AddStatusListener( msExtrusionDirection );
+ AddStatusListener( msExtrusionProjection );
}
void ExtrusionDirectionWindow::DataChanged( const DataChangedEvent& rDCEvt )
{
- SfxPopupWindow::DataChanged( rDCEvt );
+ ToolbarMenu::DataChanged( rDCEvt );
if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
{
bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
- USHORT i;
- for( i = DIRECTION_NW; i <= DIRECTION_SE; i++ )
+ for( USHORT i = DIRECTION_NW; i <= DIRECTION_SE; i++ )
{
mpDirectionSet->SetItemImage( i+1, bHighContrast ? maImgDirectionH[ i ] : maImgDirection[ i ] );
}
- mpMenu->setEntryImage( 0, bHighContrast ? maImgPerspectiveH : maImgPerspective );
- mpMenu->setEntryImage( 1, bHighContrast ? maImgParallelH : maImgParallel );
+ setEntryImage( 0, bHighContrast ? maImgPerspectiveH : maImgPerspective );
+ setEntryImage( 1, bHighContrast ? maImgParallelH : maImgParallel );
}
}
// -----------------------------------------------------------------------
-ExtrusionDirectionWindow::~ExtrusionDirectionWindow()
-{
- delete mpMenu;
-}
-
-// -----------------------------------------------------------------------
-
void ExtrusionDirectionWindow::implSetDirection( sal_Int32 nSkew, bool bEnabled )
{
if( mpDirectionSet )
@@ -213,58 +176,47 @@ void ExtrusionDirectionWindow::implSetDirection( sal_Int32 nSkew, bool bEnabled
mpDirectionSet->SetNoSelection();
}
}
- if( mpMenu )
- {
- mpMenu->enableEntry( 2, bEnabled );
- }
+ enableEntry( 2, bEnabled );
}
// -----------------------------------------------------------------------
void ExtrusionDirectionWindow::implSetProjection( sal_Int32 nProjection, bool bEnabled )
{
- if( mpMenu )
- {
- mpMenu->checkEntry( 0, (nProjection == 0) && bEnabled );
- mpMenu->checkEntry( 1, (nProjection == 1 ) && bEnabled );
- mpMenu->enableEntry( 0, bEnabled );
- mpMenu->enableEntry( 1, bEnabled );
- }
+ checkEntry( 0, (nProjection == 0) && bEnabled );
+ checkEntry( 1, (nProjection == 1 ) && bEnabled );
+ enableEntry( 0, bEnabled );
+ enableEntry( 1, bEnabled );
}
// -----------------------------------------------------------------------
-void ExtrusionDirectionWindow::StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState )
+void SAL_CALL ExtrusionDirectionWindow::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException )
{
- switch( nSID )
+ if( Event.FeatureURL.Main.equals( msExtrusionDirection ) )
{
- case SID_EXTRUSION_DIRECTION:
+ if( !Event.IsEnabled )
{
- if( eState == SFX_ITEM_DISABLED )
- {
- implSetDirection( -1, false );
- }
- else
- {
- const SfxInt32Item* pStateItem = PTR_CAST( SfxInt32Item, pState );
- if( pStateItem )
- implSetDirection( pStateItem->GetValue(), true );
- }
- break;
+ implSetDirection( -1, false );
}
- case SID_EXTRUSION_PROJECTION:
+ else
{
- if( eState == SFX_ITEM_DISABLED )
- {
- implSetProjection( -1, false );
- }
- else
- {
- const SfxInt32Item* pStateItem = PTR_CAST( SfxInt32Item, pState );
- if( pStateItem )
- implSetProjection( pStateItem->GetValue(), true );
- }
- break;
+ sal_Int32 nValue = 0;
+ if( Event.State >>= nValue )
+ implSetDirection( nValue, true );
+ }
+ }
+ else if( Event.FeatureURL.Main.equals( msExtrusionProjection ) )
+ {
+ if( !Event.IsEnabled )
+ {
+ implSetProjection( -1, false );
+ }
+ else
+ {
+ sal_Int32 nValue = 0;
+ if( Event.State >>= nValue )
+ implSetProjection( nValue, true );
}
}
}
@@ -276,48 +228,24 @@ IMPL_LINK( ExtrusionDirectionWindow, SelectHdl, void *, pControl )
if ( IsInPopupMode() )
EndPopupMode();
-// SfxDispatcher* pDisp = GetBindings().GetDispatcher();
-
if( pControl == mpDirectionSet )
{
- sal_Int32 nSkew = gSkewList[mpDirectionSet->GetSelectItemId()-1];
-
- SfxInt32Item aItem( SID_EXTRUSION_DIRECTION, nSkew );
- rtl::OUString aCommand( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionDirection" ));
-
- Any a;
- INetURLObject aObj( aCommand );
Sequence< PropertyValue > aArgs( 1 );
- aArgs[0].Name = aObj.GetURLPath();
- aItem.QueryValue( a );
- aArgs[0].Value = a;
-
- SfxToolBoxControl::Dispatch( Reference< ::com::sun::star::frame::XDispatchProvider >(
- mxFrame->getController(), UNO_QUERY ),
- aCommand,
- aArgs );
+ aArgs[0].Name = msExtrusionDirection.copy(5);
+ aArgs[0].Value <<= (sal_Int32)gSkewList[mpDirectionSet->GetSelectItemId()-1];
-// pDisp->Execute( SID_EXTRUSION_DIRECTION, SFX_CALLMODE_RECORD, &aItem, 0L , 0L );
+ mrController.dispatchCommand( msExtrusionDirection, aArgs );
}
else
{
- int nProjection = mpMenu->getSelectedEntryId();
+ int nProjection = getSelectedEntryId();
if( (nProjection >= 0) && (nProjection < 2 ) )
{
- SfxInt32Item aItem( SID_EXTRUSION_PROJECTION, nProjection );
- rtl::OUString aCommand( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionProjection" ));
-
- Any a;
- INetURLObject aObj( aCommand );
Sequence< PropertyValue > aArgs( 1 );
- aArgs[0].Name = aObj.GetURLPath();
- aItem.QueryValue( a );
- aArgs[0].Value = a;
-
- SfxToolBoxControl::Dispatch( Reference< ::com::sun::star::frame::XDispatchProvider >(
- mxFrame->getController(), UNO_QUERY ),
- aCommand,
- aArgs );
+ aArgs[0].Name = msExtrusionProjection.copy(5);
+ aArgs[0].Value <<= (sal_Int32)nProjection;
+
+ mrController.dispatchCommand( msExtrusionProjection, aArgs );
implSetProjection( nProjection, true );
}
}
@@ -325,94 +253,59 @@ IMPL_LINK( ExtrusionDirectionWindow, SelectHdl, void *, pControl )
return 0;
}
-// -----------------------------------------------------------------------
+// =======================================================================
+// ExtrusionDirectionControl
+// =======================================================================
-void ExtrusionDirectionWindow::FillValueSet()
+ExtrusionDirectionControl::ExtrusionDirectionControl( const Reference< lang::XMultiServiceFactory >& rServiceManager )
+: svt::PopupWindowController( rServiceManager, Reference< frame::XFrame >(), OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionDirectionFloater" ) ) )
{
}
// -----------------------------------------------------------------------
-void ExtrusionDirectionWindow::StartSelection()
+::Window* ExtrusionDirectionControl::createPopupWindow( ::Window* pParent )
{
- mpDirectionSet->StartSelection();
+ return new ExtrusionDirectionWindow( *this, m_xFrame, pParent );
}
// -----------------------------------------------------------------------
-
-BOOL ExtrusionDirectionWindow::Close()
-{
- return SfxPopupWindow::Close();
-}
-
-// -----------------------------------------------------------------------
-
-void ExtrusionDirectionWindow::PopupModeEnd()
-{
- if ( IsVisible() )
- {
- mbPopupMode = FALSE;
- }
- SfxPopupWindow::PopupModeEnd();
-}
-
+// XServiceInfo
// -----------------------------------------------------------------------
-void ExtrusionDirectionWindow::GetFocus (void)
-{
- SfxPopupWindow::GetFocus();
- // Grab the focus to the line ends value set so that it can be controlled
- // with the keyboard.
- if( mpDirectionSet )
- mpDirectionSet->GrabFocus();
-}
-
-/*************************************************************************
-|*
-|* SvxLineEndToolBoxControl
-|*
-\************************************************************************/
-
-ExtrusionDirectionControl::ExtrusionDirectionControl(
- USHORT nSlotId, USHORT nId, ToolBox &rTbx )
-: SfxToolBoxControl( nSlotId, nId, rTbx )
+OUString SAL_CALL ExtrusionDirectionControl_getImplementationName()
{
- rTbx.SetItemBits( nId, TIB_DROPDOWNONLY | rTbx.GetItemBits( nId ) );
+ return OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.ExtrusionDirectionController" ));
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-ExtrusionDirectionControl::~ExtrusionDirectionControl()
+Sequence< OUString > SAL_CALL ExtrusionDirectionControl_getSupportedServiceNames() throw( RuntimeException )
{
+ Sequence< OUString > aSNS( 1 );
+ aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ));
+ return aSNS;
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-SfxPopupWindowType ExtrusionDirectionControl::GetPopupWindowType() const
+Reference< XInterface > SAL_CALL SAL_CALL ExtrusionDirectionControl_createInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( RuntimeException )
{
- return SFX_POPUPWINDOW_ONCLICK;
+ return *new ExtrusionDirectionControl( rSMgr );
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-SfxPopupWindow* ExtrusionDirectionControl::CreatePopupWindow()
+OUString SAL_CALL ExtrusionDirectionControl::getImplementationName( ) throw (RuntimeException)
{
- ExtrusionDirectionWindow* pWin = new ExtrusionDirectionWindow( GetId(), m_xFrame, &GetToolBox() );
- pWin->StartPopupMode( &GetToolBox(), TRUE );
- pWin->StartSelection();
- SetPopupWindow( pWin );
- return pWin;
+ return ExtrusionDirectionControl_getImplementationName();
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-void ExtrusionDirectionControl::StateChanged( USHORT, SfxItemState eState, const SfxPoolItem* )
+Sequence< OUString > SAL_CALL ExtrusionDirectionControl::getSupportedServiceNames( ) throw (RuntimeException)
{
- USHORT nId = GetId();
- ToolBox& rTbx = GetToolBox();
-
- rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState );
- rTbx.SetItemState( nId, ( SFX_ITEM_DONTCARE == eState ) ? STATE_DONTKNOW : STATE_NOCHECK );
+ return ExtrusionDirectionControl_getSupportedServiceNames();
}
// ####################################################################
@@ -444,135 +337,66 @@ double ExtrusionDepthDialog::getDepth() const
// ####################################################################
-SFX_IMPL_TOOLBOX_CONTROL( ExtrusionDepthControl, SfxBoolItem );
-
-ExtrusionDepthWindow::ExtrusionDepthWindow(
- USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ) :
- SfxPopupWindow( nId,
- rFrame,
- SVX_RES( RID_SVXFLOAT_EXTRUSION_DEPTH )),
- maImgDepth0( SVX_RES( IMG_DEPTH_0 ) ),
- maImgDepth1( SVX_RES( IMG_DEPTH_1 ) ),
- maImgDepth2( SVX_RES( IMG_DEPTH_2 ) ),
- maImgDepth3( SVX_RES( IMG_DEPTH_3 ) ),
- maImgDepth4( SVX_RES( IMG_DEPTH_4 ) ),
- maImgDepthInfinity( SVX_RES( IMG_DEPTH_INFINITY ) ),
- maImgDepth0h( SVX_RES( IMG_DEPTH_0_H ) ),
- maImgDepth1h( SVX_RES( IMG_DEPTH_1_H ) ),
- maImgDepth2h( SVX_RES( IMG_DEPTH_2_H ) ),
- maImgDepth3h( SVX_RES( IMG_DEPTH_3_H ) ),
- maImgDepth4h( SVX_RES( IMG_DEPTH_4_H ) ),
- maImgDepthInfinityh( SVX_RES( IMG_DEPTH_INFINITY_H ) ),
- mxFrame( rFrame ),
- mbPopupMode ( true ),
- mfDepth( -1.0 ),
- mbEnabled( false )
-{
- implInit();
-}
-
-ExtrusionDepthWindow::ExtrusionDepthWindow( USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
- Window* pParentWindow ) :
- SfxPopupWindow( nId,
- rFrame,
- pParentWindow,
- SVX_RES( RID_SVXFLOAT_EXTRUSION_DEPTH )),
- maImgDepth0( SVX_RES( IMG_DEPTH_0 ) ),
- maImgDepth1( SVX_RES( IMG_DEPTH_1 ) ),
- maImgDepth2( SVX_RES( IMG_DEPTH_2 ) ),
- maImgDepth3( SVX_RES( IMG_DEPTH_3 ) ),
- maImgDepth4( SVX_RES( IMG_DEPTH_4 ) ),
- maImgDepthInfinity( SVX_RES( IMG_DEPTH_INFINITY ) ),
- maImgDepth0h( SVX_RES( IMG_DEPTH_0_H ) ),
- maImgDepth1h( SVX_RES( IMG_DEPTH_1_H ) ),
- maImgDepth2h( SVX_RES( IMG_DEPTH_2_H ) ),
- maImgDepth3h( SVX_RES( IMG_DEPTH_3_H ) ),
- maImgDepth4h( SVX_RES( IMG_DEPTH_4_H ) ),
- maImgDepthInfinityh( SVX_RES( IMG_DEPTH_INFINITY_H ) ),
- mxFrame( rFrame ),
- mbPopupMode ( true ),
- mfDepth( -1.0 ),
- mbEnabled( false )
-{
- implInit();
-}
-
-void ExtrusionDepthWindow::implInit()
-{
- SetHelpId( HID_POPUP_EXTRUSION_DEPTH );
-
-// mpDepthForewarder = new SfxStatusForwarder( SID_EXTRUSION_DEPTH, *this );
-// mpMetricForewarder = new SfxStatusForwarder( SID_ATTR_METRIC, *this );
-
- mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN );
- mpMenu->SetHelpId( HID_MENU_EXTRUSION_DEPTH );
+double aDepthListInch[] = { 0, 1270,2540,5080,10160 };
+double aDepthListMM[] = { 0, 1000, 2500, 5000, 10000 };
- mpMenu->SetSelectHdl( LINK( this, ExtrusionDepthWindow, SelectHdl ) );
+ExtrusionDepthWindow::ExtrusionDepthWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow )
+: ToolbarMenu( rFrame, pParentWindow, SVX_RES( RID_SVXFLOAT_EXTRUSION_DEPTH ))
+, mrController( rController )
+, maImgDepth0( SVX_RES( IMG_DEPTH_0 ) )
+, maImgDepth1( SVX_RES( IMG_DEPTH_1 ) )
+, maImgDepth2( SVX_RES( IMG_DEPTH_2 ) )
+, maImgDepth3( SVX_RES( IMG_DEPTH_3 ) )
+, maImgDepth4( SVX_RES( IMG_DEPTH_4 ) )
+, maImgDepthInfinity( SVX_RES( IMG_DEPTH_INFINITY ) )
+, maImgDepth0h( SVX_RES( IMG_DEPTH_0_H ) )
+, maImgDepth1h( SVX_RES( IMG_DEPTH_1_H ) )
+, maImgDepth2h( SVX_RES( IMG_DEPTH_2_H ) )
+, maImgDepth3h( SVX_RES( IMG_DEPTH_3_H ) )
+, maImgDepth4h( SVX_RES( IMG_DEPTH_4_H ) )
+, maImgDepthInfinityh( SVX_RES( IMG_DEPTH_INFINITY_H ) )
+, mfDepth( -1.0 )
+, msExtrusionDepth( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionDepth" ) )
+, msMetricUnit( RTL_CONSTASCII_USTRINGPARAM( ".uno:MetricUnit" ) )
+{
+ SetHelpId( HID_MENU_EXTRUSION_DEPTH );
+
+ SetSelectHdl( LINK( this, ExtrusionDepthWindow, SelectHdl ) );
bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
String aEmpty;
- mpMenu->appendEntry( 0, aEmpty, bHighContrast ? maImgDepth0h : maImgDepth0 );
- mpMenu->appendEntry( 1, aEmpty, bHighContrast ? maImgDepth1h : maImgDepth1 );
- mpMenu->appendEntry( 2, aEmpty, bHighContrast ? maImgDepth2h : maImgDepth2 );
- mpMenu->appendEntry( 3, aEmpty, bHighContrast ? maImgDepth3h : maImgDepth3 );
- mpMenu->appendEntry( 4, aEmpty, bHighContrast ? maImgDepth4h : maImgDepth4 );
- mpMenu->appendEntry( 5, String( SVX_RES( STR_INFINITY ) ), bHighContrast ? maImgDepthInfinityh : maImgDepthInfinity );
- mpMenu->appendEntry( 6, String( SVX_RES( STR_CUSTOM ) ) );
+ appendEntry( 0, aEmpty, bHighContrast ? maImgDepth0h : maImgDepth0 );
+ appendEntry( 1, aEmpty, bHighContrast ? maImgDepth1h : maImgDepth1 );
+ appendEntry( 2, aEmpty, bHighContrast ? maImgDepth2h : maImgDepth2 );
+ appendEntry( 3, aEmpty, bHighContrast ? maImgDepth3h : maImgDepth3 );
+ appendEntry( 4, aEmpty, bHighContrast ? maImgDepth4h : maImgDepth4 );
+ appendEntry( 5, String( SVX_RES( STR_INFINITY ) ), bHighContrast ? maImgDepthInfinityh : maImgDepthInfinity );
+ appendEntry( 6, String( SVX_RES( STR_CUSTOM ) ) );
- SetOutputSizePixel( mpMenu->getMenuSize() );
- mpMenu->SetOutputSizePixel( GetOutputSizePixel() );
-
- mpMenu->Show();
+ SetOutputSizePixel( getMenuSize() );
FreeResource();
- AddStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionDepth" )));
- AddStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:MetricUnit" )));
-// rBindings.Update( SID_ATTR_METRIC );
-// rBindings.Update( SID_EXTRUSION_DEPTH );
-}
-
-SfxPopupWindow* ExtrusionDepthWindow::Clone() const
-{
- return new ExtrusionDepthWindow( GetId(), mxFrame );
+ AddStatusListener( msExtrusionDepth );
+ AddStatusListener( msMetricUnit );
}
// -----------------------------------------------------------------------
-ExtrusionDepthWindow::~ExtrusionDepthWindow()
+void ExtrusionDepthWindow::implSetDepth( double fDepth )
{
-// delete mpDepthForewarder;
-// delete mpMetricForewarder;
-
- delete mpMenu;
-}
-
-// -----------------------------------------------------------------------
-
-double aDepthListInch[] = { 0, 1270,2540,5080,10160 };
-double aDepthListMM[] = { 0, 1000, 2500, 5000, 10000 };
-
-void ExtrusionDepthWindow::implSetDepth( double fDepth, bool bEnabled )
-{
- mbEnabled = bEnabled;
mfDepth = fDepth;
- if( mpMenu )
+ int i;
+ for( i = 0; i < 7; i++ )
{
- int i;
- for( i = 0; i < 7; i++ )
+ if( i == 5 )
{
- if( i == 5 )
- {
- mpMenu->checkEntry( i, (fDepth >= 338666) && bEnabled );
- }
- else if( i != 6 )
- {
- mpMenu->checkEntry( i, (fDepth == (IsMetric( meUnit ) ? aDepthListMM[i] : aDepthListInch[i]) && bEnabled ) );
- }
- mpMenu->enableEntry( i, bEnabled );
+ checkEntry( i, fDepth >= 338666 );
+ }
+ else if( i != 6 )
+ {
+ checkEntry( i, (fDepth == (IsMetric( meUnit ) ? aDepthListMM[i] : aDepthListInch[i]) ) );
}
}
}
@@ -587,38 +411,37 @@ void ExtrusionDepthWindow::implFillStrings( FieldUnit eUnit )
for( int i = 0; i < 5; i++ )
{
String aStr( SVX_RES( nResource + i ) );
- mpMenu->setEntryText( i, aStr );
+ setEntryText( i, aStr );
};
}
// -----------------------------------------------------------------------
-void ExtrusionDepthWindow::StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState )
+void SAL_CALL ExtrusionDepthWindow::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException )
{
- switch( nSID )
+ if( Event.FeatureURL.Main.equals( msExtrusionDepth ) )
{
- case SID_EXTRUSION_DEPTH:
+ if( !Event.IsEnabled )
{
- if( eState == SFX_ITEM_DISABLED )
- {
- implSetDepth( 0, false );
- }
- else
- {
- const SvxDoubleItem* pStateItem = PTR_CAST( SvxDoubleItem, pState );
- if( pStateItem )
- implSetDepth( pStateItem->GetValue(), true );
- }
- break;
+ implSetDepth( 0 );
}
- case SID_ATTR_METRIC:
+ else
+ {
+ double fValue = 0.0;
+ if( Event.State >>= fValue )
+ implSetDepth( fValue );
+ }
+ }
+ else if( Event.FeatureURL.Main.equals( msMetricUnit ) )
+ {
+ if( Event.IsEnabled )
{
- const SfxUInt16Item* pStateItem = PTR_CAST( SfxUInt16Item, pState );
- if( pStateItem )
+ sal_Int32 nValue = 0;
+ if( Event.State >>= nValue )
{
- implFillStrings( (FieldUnit)pStateItem->GetValue() );
+ implFillStrings( static_cast<FieldUnit>(nValue) );
if( mfDepth >= 0.0 )
- implSetDepth( mfDepth, mbEnabled );
+ implSetDepth( mfDepth );
}
}
}
@@ -628,18 +451,18 @@ void ExtrusionDepthWindow::StateChanged( USHORT nSID, SfxItemState eState, const
void ExtrusionDepthWindow::DataChanged( const DataChangedEvent& rDCEvt )
{
- SfxPopupWindow::DataChanged( rDCEvt );
+ ToolbarMenu::DataChanged( rDCEvt );
if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
{
bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
- mpMenu->setEntryImage( 0, bHighContrast ? maImgDepth0h : maImgDepth0 );
- mpMenu->setEntryImage( 1, bHighContrast ? maImgDepth1h : maImgDepth1 );
- mpMenu->setEntryImage( 2, bHighContrast ? maImgDepth2h : maImgDepth2 );
- mpMenu->setEntryImage( 3, bHighContrast ? maImgDepth3h : maImgDepth3 );
- mpMenu->setEntryImage( 4, bHighContrast ? maImgDepth4h : maImgDepth4 );
- mpMenu->setEntryImage( 5, bHighContrast ? maImgDepthInfinityh : maImgDepthInfinity );
+ setEntryImage( 0, bHighContrast ? maImgDepth0h : maImgDepth0 );
+ setEntryImage( 1, bHighContrast ? maImgDepth1h : maImgDepth1 );
+ setEntryImage( 2, bHighContrast ? maImgDepth2h : maImgDepth2 );
+ setEntryImage( 3, bHighContrast ? maImgDepth3h : maImgDepth3 );
+ setEntryImage( 4, bHighContrast ? maImgDepth4h : maImgDepth4 );
+ setEntryImage( 5, bHighContrast ? maImgDepthInfinityh : maImgDepthInfinity );
}
}
@@ -648,9 +471,7 @@ void ExtrusionDepthWindow::DataChanged( const DataChangedEvent& rDCEvt )
IMPL_LINK( ExtrusionDepthWindow, SelectHdl, void *, EMPTYARG )
{
-// SfxDispatcher* pDisp = GetBindings().GetDispatcher();
-
- int nSelected = mpMenu->getSelectedEntryId();
+ int nSelected = getSelectedEntryId();
if( nSelected != -1 )
{
if( nSelected == 6 )
@@ -658,24 +479,16 @@ IMPL_LINK( ExtrusionDepthWindow, SelectHdl, void *, EMPTYARG )
if ( IsInPopupMode() )
EndPopupMode();
- SvxDoubleItem aDepthItem( mfDepth, SID_EXTRUSION_DEPTH );
- SfxUInt16Item aMetricItem(
- SID_ATTR_METRIC, sal::static_int_cast< UINT16 >( meUnit ) );
- rtl::OUString aCommand( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionDepthDialog" ));
+ const rtl::OUString aCommand( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionDepthDialog" ));
Any a;
Sequence< PropertyValue > aArgs( 2 );
aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Depth" ));
- aDepthItem.QueryValue( a );
- aArgs[0].Value = a;
+ aArgs[0].Value <<= mfDepth;
aArgs[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Metric" ));
- aMetricItem.QueryValue( a );
- aArgs[1].Value = a;
+ aArgs[1].Value <<= static_cast<sal_Int32>( meUnit );
- SfxToolBoxControl::Dispatch( Reference< ::com::sun::star::frame::XDispatchProvider >(
- mxFrame->getController(), UNO_QUERY ),
- aCommand,
- aArgs );
+ mrController.dispatchCommand( aCommand, aArgs );
}
else
{
@@ -690,21 +503,12 @@ IMPL_LINK( ExtrusionDepthWindow, SelectHdl, void *, EMPTYARG )
fDepth = IsMetric( meUnit ) ? aDepthListMM[nSelected] : aDepthListInch[nSelected];
}
- SvxDoubleItem aItem( fDepth, SID_EXTRUSION_DEPTH );
- rtl::OUString aCommand( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionDepth" ));
-
- Any a;
- INetURLObject aObj( aCommand );
Sequence< PropertyValue > aArgs( 1 );
- aArgs[0].Name = aObj.GetURLPath();
- aItem.QueryValue( a );
- aArgs[0].Value = a;
+ aArgs[0].Name = msExtrusionDepth.copy(5);
+ aArgs[0].Value <<= fDepth;
- SfxToolBoxControl::Dispatch( Reference< ::com::sun::star::frame::XDispatchProvider >(
- mxFrame->getController(), UNO_QUERY ),
- aCommand,
- aArgs );
- implSetDepth( fDepth, true );
+ mrController.dispatchCommand( msExtrusionDepth, aArgs );
+ implSetDepth( fDepth );
if ( IsInPopupMode() )
EndPopupMode();
@@ -713,143 +517,83 @@ IMPL_LINK( ExtrusionDepthWindow, SelectHdl, void *, EMPTYARG )
return 0;
}
-// -----------------------------------------------------------------------
+// =======================================================================
+// ExtrusionDirectionControl
+// =======================================================================
-void ExtrusionDepthWindow::StartSelection()
+ExtrusionDepthController::ExtrusionDepthController( const Reference< lang::XMultiServiceFactory >& rServiceManager )
+: svt::PopupWindowController( rServiceManager, Reference< frame::XFrame >(), OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionDepthFloater" ) ) )
{
}
// -----------------------------------------------------------------------
-BOOL ExtrusionDepthWindow::Close()
+::Window* ExtrusionDepthController::createPopupWindow( ::Window* pParent )
{
- return SfxPopupWindow::Close();
+ return new ExtrusionDepthWindow( *this, m_xFrame, pParent );
}
-// -----------------------------------------------------------------------
-
-void ExtrusionDepthWindow::PopupModeEnd()
-{
- if ( IsVisible() )
- {
- mbPopupMode = FALSE;
- }
- SfxPopupWindow::PopupModeEnd();
-}
// -----------------------------------------------------------------------
-
-void ExtrusionDepthWindow::GetFocus (void)
-{
- SfxPopupWindow::GetFocus();
- // Grab the focus to the line ends value set so that it can be controlled
- // with the keyboard.
- if( mpMenu )
- mpMenu->GrabFocus();
-}
-
-// ========================================================================
-
-ExtrusionDepthControl::ExtrusionDepthControl(
- USHORT nSlotId, USHORT nId, ToolBox &rTbx )
-: SfxToolBoxControl( nSlotId, nId, rTbx )
-{
- rTbx.SetItemBits( nId, TIB_DROPDOWNONLY | rTbx.GetItemBits( nId ) );
-}
-
+// XServiceInfo
// -----------------------------------------------------------------------
-ExtrusionDepthControl::~ExtrusionDepthControl()
+OUString SAL_CALL ExtrusionDepthController_getImplementationName()
{
+ return OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.ExtrusionDepthController" ));
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-SfxPopupWindowType ExtrusionDepthControl::GetPopupWindowType() const
+Sequence< OUString > SAL_CALL ExtrusionDepthController_getSupportedServiceNames() throw( RuntimeException )
{
- return SFX_POPUPWINDOW_ONCLICK;
+ Sequence< OUString > aSNS( 1 );
+ aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.PopupMenuController" ));
+ return aSNS;
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-SfxPopupWindow* ExtrusionDepthControl::CreatePopupWindow()
+Reference< XInterface > SAL_CALL SAL_CALL ExtrusionDepthController_createInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( RuntimeException )
{
- ExtrusionDepthWindow* pWin = new ExtrusionDepthWindow( GetId(), m_xFrame, &GetToolBox() );
- pWin->StartPopupMode( &GetToolBox(), TRUE );
- pWin->StartSelection();
- SetPopupWindow( pWin );
- return pWin;
+ return *new ExtrusionDepthController( rSMgr );
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-void ExtrusionDepthControl::StateChanged( USHORT, SfxItemState eState, const SfxPoolItem* )
+OUString SAL_CALL ExtrusionDepthController::getImplementationName( ) throw (RuntimeException)
{
- USHORT nId = GetId();
- ToolBox& rTbx = GetToolBox();
-
- rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState );
- rTbx.SetItemState( nId, ( SFX_ITEM_DONTCARE == eState ) ? STATE_DONTKNOW : STATE_NOCHECK );
+ return ExtrusionDepthController_getImplementationName();
}
-// ####################################################################
+// --------------------------------------------------------------------
-SFX_IMPL_TOOLBOX_CONTROL( ExtrusionLightingControl, SfxBoolItem );
-
-ExtrusionLightingWindow::ExtrusionLightingWindow(
- USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ) :
- SfxPopupWindow( nId,
- rFrame,
- SVX_RES( RID_SVXFLOAT_EXTRUSION_LIGHTING ) ),
- maImgBright( SVX_RES( IMG_LIGHTING_BRIGHT ) ),
- maImgNormal( SVX_RES( IMG_LIGHTING_NORMAL ) ),
- maImgDim( SVX_RES( IMG_LIGHTING_DIM ) ),
- maImgBrighth( SVX_RES( IMG_LIGHTING_BRIGHT_H ) ),
- maImgNormalh( SVX_RES( IMG_LIGHTING_NORMAL_H ) ),
- maImgDimh( SVX_RES( IMG_LIGHTING_DIM_H ) ),
- mxFrame( rFrame ),
- mbPopupMode( true ),
- mnLevel( 0 ),
- mbLevelEnabled( false ),
- mnDirection( FROM_FRONT ),
- mbDirectionEnabled( false )
+Sequence< OUString > SAL_CALL ExtrusionDepthController::getSupportedServiceNames( ) throw (RuntimeException)
{
- implInit();
+ return ExtrusionDepthController_getSupportedServiceNames();
}
-// -----------------------------------------------------------------------
-ExtrusionLightingWindow::ExtrusionLightingWindow(
- USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
- Window* pParentWindow ) :
- SfxPopupWindow( nId,
- rFrame,
- pParentWindow,
- SVX_RES( RID_SVXFLOAT_EXTRUSION_LIGHTING ) ),
- maImgBright( SVX_RES( IMG_LIGHTING_BRIGHT ) ),
- maImgNormal( SVX_RES( IMG_LIGHTING_NORMAL ) ),
- maImgDim( SVX_RES( IMG_LIGHTING_DIM ) ),
- maImgBrighth( SVX_RES( IMG_LIGHTING_BRIGHT_H ) ),
- maImgNormalh( SVX_RES( IMG_LIGHTING_NORMAL_H ) ),
- maImgDimh( SVX_RES( IMG_LIGHTING_DIM_H ) ),
- mxFrame( rFrame ),
- mbPopupMode( true ),
- mnLevel( 0 ),
- mbLevelEnabled( false ),
- mnDirection( FROM_FRONT ),
- mbDirectionEnabled( false )
-{
- implInit();
-}
-
-// -----------------------------------------------------------------------
+// ####################################################################
-void ExtrusionLightingWindow::implInit()
+// -------------------------------------------------------------------------
+
+ExtrusionLightingWindow::ExtrusionLightingWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow )
+: ToolbarMenu( rFrame, pParentWindow, SVX_RES( RID_SVXFLOAT_EXTRUSION_LIGHTING ))
+, mrController( rController )
+, maImgBright( SVX_RES( IMG_LIGHTING_BRIGHT ) )
+, maImgNormal( SVX_RES( IMG_LIGHTING_NORMAL ) )
+, maImgDim( SVX_RES( IMG_LIGHTING_DIM ) )
+, maImgBrighth( SVX_RES( IMG_LIGHTING_BRIGHT_H ) )
+, maImgNormalh( SVX_RES( IMG_LIGHTING_NORMAL_H ) )
+, maImgDimh( SVX_RES( IMG_LIGHTING_DIM_H ) )
+, mnLevel( 0 )
+, mbLevelEnabled( false )
+, mnDirection( FROM_FRONT )
+, mbDirectionEnabled( false )
+, msExtrusionLightingDirection( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionLightingDirection" ))
+, msExtrusionLightingIntensity( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionLightingIntensity" ))
{
- SetHelpId( HID_POPUP_EXTRUSION_LIGHTING );
-
USHORT i;
for( i = FROM_TOP_LEFT; i <= FROM_BOTTOM_RIGHT; i++ )
{
@@ -864,17 +608,12 @@ void ExtrusionLightingWindow::implInit()
maImgLightingPreviewh[i] = Image( SVX_RES( IMG_LIGHT_PREVIEW_H + i ) );
}
-// mpLightingDirectionForewarder = new SfxStatusForwarder( SID_EXTRUSION_LIGHTING_DIRECTION, *this );
-// mpLightingIntensityForewarder = new SfxStatusForwarder( SID_EXTRUSION_LIGHTING_INTENSITY, *this );
-
- mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN );
- mpMenu->SetHelpId( HID_MENU_EXTRUSION_LIGHTING );
- mpMenu->SetSelectHdl( LINK( this, ExtrusionLightingWindow, SelectHdl ) );
+ SetHelpId( HID_MENU_EXTRUSION_LIGHTING );
+ SetSelectHdl( LINK( this, ExtrusionLightingWindow, SelectHdl ) );
- mpLightingSet = new ValueSet( mpMenu, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT );
+ mpLightingSet = createEmptyValueSetControl();
mpLightingSet->SetHelpId( HID_VALUESET_EXTRUSION_LIGHTING );
- mpLightingSet->SetHelpId( HID_POPUP_LINEEND_CTRL );
mpLightingSet->SetSelectHdl( LINK( this, ExtrusionLightingWindow, SelectHdl ) );
mpLightingSet->SetColCount( 3 );
mpLightingSet->EnableFullItemMode( FALSE );
@@ -894,35 +633,18 @@ void ExtrusionLightingWindow::implInit()
}
mpLightingSet->SetOutputSizePixel( Size( 72, 72 ) );
- mpMenu->appendEntry( 3, mpLightingSet );
- mpMenu->appendSeparator();
- mpMenu->appendEntry( 0, String( SVX_RES( STR_BRIGHT ) ), bHighContrast ? maImgBrighth : maImgBright );
- mpMenu->appendEntry( 1, String( SVX_RES( STR_NORMAL ) ), bHighContrast ? maImgNormalh : maImgNormal );
- mpMenu->appendEntry( 2, String( SVX_RES( STR_DIM ) ), bHighContrast ? maImgDimh : maImgDim );
-
- SetOutputSizePixel( mpMenu->getMenuSize() );
- mpMenu->SetOutputSizePixel( GetOutputSizePixel() );
+ appendEntry( 3, mpLightingSet );
+ appendSeparator();
+ appendEntry( 0, String( SVX_RES( STR_BRIGHT ) ), bHighContrast ? maImgBrighth : maImgBright );
+ appendEntry( 1, String( SVX_RES( STR_NORMAL ) ), bHighContrast ? maImgNormalh : maImgNormal );
+ appendEntry( 2, String( SVX_RES( STR_DIM ) ), bHighContrast ? maImgDimh : maImgDim );
- mpMenu->Show();
+ SetOutputSizePixel( getMenuSize() );
FreeResource();
- AddStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionLightingDirection" )));
- AddStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionLightingIntensity" )));
-}
-
-// -----------------------------------------------------------------------
-
-SfxPopupWindow* ExtrusionLightingWindow::Clone() const
-{
- return new ExtrusionLightingWindow( GetId(), mxFrame );
-}
-
-// -----------------------------------------------------------------------
-
-ExtrusionLightingWindow::~ExtrusionLightingWindow()
-{
- delete mpMenu;
+ AddStatusListener( msExtrusionLightingDirection );
+ AddStatusListener( msExtrusionLightingIntensity );
}
// -----------------------------------------------------------------------
@@ -934,8 +656,8 @@ void ExtrusionLightingWindow::implSetIntensity( int nLevel, bool bEnabled )
int i = 0;
for( i = 0; i < 3; i++ )
{
- mpMenu->checkEntry( i, (i == nLevel) && bEnabled );
- mpMenu->enableEntry( i, bEnabled );
+ checkEntry( i, (i == nLevel) && bEnabled );
+ enableEntry( i, bEnabled );
}
}
@@ -971,42 +693,37 @@ void ExtrusionLightingWindow::implSetDirection( int nDirection, bool bEnabled )
}
}
- mpMenu->enableEntry( 3, bEnabled );
+ enableEntry( 3, bEnabled );
}
// -----------------------------------------------------------------------
-void ExtrusionLightingWindow::StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState )
+void SAL_CALL ExtrusionLightingWindow::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException )
{
- switch( nSID )
+ if( Event.FeatureURL.Main.equals( msExtrusionLightingIntensity ) )
{
- case SID_EXTRUSION_LIGHTING_INTENSITY:
+ if( !Event.IsEnabled )
{
- if( eState == SFX_ITEM_DISABLED )
- {
- implSetIntensity( 0, false );
- }
- else
- {
- const SfxInt32Item* pStateItem = PTR_CAST( SfxInt32Item, pState );
- if( pStateItem )
- implSetIntensity( pStateItem->GetValue(), true );
- }
- break;
+ implSetIntensity( 0, false );
}
- case SID_EXTRUSION_LIGHTING_DIRECTION:
+ else
{
- if( eState == SFX_ITEM_DISABLED )
- {
- implSetDirection( 0, false );
- }
- else
- {
- const SfxInt32Item* pStateItem = PTR_CAST( SfxInt32Item, pState );
- if( pStateItem )
- implSetDirection( pStateItem->GetValue(), true );
- }
- break;
+ sal_Int32 nValue = 0;
+ if( Event.State >>= nValue )
+ implSetIntensity( nValue, true );
+ }
+ }
+ else if( Event.FeatureURL.Main.equals( msExtrusionLightingDirection ) )
+ {
+ if( !Event.IsEnabled )
+ {
+ implSetDirection( 0, false );
+ }
+ else
+ {
+ sal_Int32 nValue = 0;
+ if( Event.State >>= nValue )
+ implSetDirection( nValue, true );
}
}
}
@@ -1015,16 +732,16 @@ void ExtrusionLightingWindow::StateChanged( USHORT nSID, SfxItemState eState, co
void ExtrusionLightingWindow::DataChanged( const DataChangedEvent& rDCEvt )
{
- SfxPopupWindow::DataChanged( rDCEvt );
+ ToolbarMenu::DataChanged( rDCEvt );
if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
{
bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
implSetDirection( mnDirection, mbDirectionEnabled );
- mpMenu->setEntryImage( 0, bHighContrast ? maImgBrighth : maImgBright );
- mpMenu->setEntryImage( 1, bHighContrast ? maImgNormalh : maImgNormal );
- mpMenu->setEntryImage( 2, bHighContrast ? maImgDimh : maImgDim );
+ setEntryImage( 0, bHighContrast ? maImgBrighth : maImgBright );
+ setEntryImage( 1, bHighContrast ? maImgNormalh : maImgNormal );
+ setEntryImage( 2, bHighContrast ? maImgDimh : maImgDim );
}
}
@@ -1035,31 +752,19 @@ IMPL_LINK( ExtrusionLightingWindow, SelectHdl, void *, pControl )
if ( IsInPopupMode() )
EndPopupMode();
-// SfxDispatcher* pDisp = GetBindings().GetDispatcher();
-
- if( pControl == mpMenu )
+ if( pControl == this )
{
- int nLevel = mpMenu->getSelectedEntryId();
+ int nLevel = getSelectedEntryId();
if( nLevel >= 0 )
{
if( nLevel != 3 )
{
- SfxInt32Item aItem( SID_EXTRUSION_LIGHTING_INTENSITY, nLevel );
- rtl::OUString aCommand( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionLightingIntensity" ));
-
- Any a;
- INetURLObject aObj( aCommand );
Sequence< PropertyValue > aArgs( 1 );
- aArgs[0].Name = aObj.GetURLPath();
- aItem.QueryValue( a );
- aArgs[0].Value = a;
+ aArgs[0].Name = msExtrusionLightingIntensity.copy(5);
+ aArgs[0].Value <<= (sal_Int32)nLevel;
- SfxToolBoxControl::Dispatch( Reference< ::com::sun::star::frame::XDispatchProvider >(
- mxFrame->getController(), UNO_QUERY ),
- aCommand,
- aArgs );
+ mrController.dispatchCommand( msExtrusionLightingIntensity, aArgs );
-// pDisp->Execute( SID_EXTRUSION_LIGHTING_INTENSITY, SFX_CALLMODE_RECORD, &aItem, 0L , 0L );
implSetIntensity( nLevel, true );
}
}
@@ -1072,21 +777,11 @@ IMPL_LINK( ExtrusionLightingWindow, SelectHdl, void *, pControl )
{
nDirection--;
- SfxInt32Item aItem( SID_EXTRUSION_LIGHTING_DIRECTION, nDirection );
- rtl::OUString aCommand( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionLightingDirection" ));
-
- Any a;
- INetURLObject aObj( aCommand );
Sequence< PropertyValue > aArgs( 1 );
- aArgs[0].Name = aObj.GetURLPath();
- aItem.QueryValue( a );
- aArgs[0].Value = a;
+ aArgs[0].Name = msExtrusionLightingDirection.copy(5);
+ aArgs[0].Value <<= (sal_Int32)nDirection;
- SfxToolBoxControl::Dispatch( Reference< ::com::sun::star::frame::XDispatchProvider >(
- mxFrame->getController(), UNO_QUERY ),
- aCommand,
- aArgs );
-// pDisp->Execute( SID_EXTRUSION_LIGHTING_DIRECTION, SFX_CALLMODE_RECORD, &aItem, 0L , 0L );
+ mrController.dispatchCommand( msExtrusionLightingDirection, aArgs );
implSetDirection( nDirection, true );
}
@@ -1096,229 +791,122 @@ IMPL_LINK( ExtrusionLightingWindow, SelectHdl, void *, pControl )
return 0;
}
-// -----------------------------------------------------------------------
+// ========================================================================
-void ExtrusionLightingWindow::StartSelection()
+ExtrusionLightingControl::ExtrusionLightingControl( const Reference< lang::XMultiServiceFactory >& rServiceManager )
+: svt::PopupWindowController( rServiceManager, Reference< frame::XFrame >(), OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionDirectionFloater" ) ) )
{
}
// -----------------------------------------------------------------------
-BOOL ExtrusionLightingWindow::Close()
+::Window* ExtrusionLightingControl::createPopupWindow( ::Window* pParent )
{
- return SfxPopupWindow::Close();
+ return new ExtrusionLightingWindow( *this, m_xFrame, pParent );
}
// -----------------------------------------------------------------------
-
-void ExtrusionLightingWindow::PopupModeEnd()
-{
- if ( IsVisible() )
- {
- mbPopupMode = FALSE;
- }
- SfxPopupWindow::PopupModeEnd();
-}
-
+// XServiceInfo
// -----------------------------------------------------------------------
-void ExtrusionLightingWindow::GetFocus (void)
-{
- SfxPopupWindow::GetFocus();
- // Grab the focus to the line ends value set so that it can be controlled
- // with the keyboard.
- if( mpMenu )
- mpMenu->GrabFocus();
-}
-
-// ========================================================================
-
-ExtrusionLightingControl::ExtrusionLightingControl( USHORT nSlotId, USHORT nId, ToolBox &rTbx )
-: SfxToolBoxControl( nSlotId, nId, rTbx )
+OUString SAL_CALL ExtrusionLightingControl_getImplementationName()
{
- rTbx.SetItemBits( nId, TIB_DROPDOWNONLY | rTbx.GetItemBits( nId ) );
+ return OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.ExtrusionLightingController" ));
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-ExtrusionLightingControl::~ExtrusionLightingControl()
+Sequence< OUString > SAL_CALL ExtrusionLightingControl_getSupportedServiceNames() throw( RuntimeException )
{
+ Sequence< OUString > aSNS( 1 );
+ aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ));
+ return aSNS;
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-SfxPopupWindowType ExtrusionLightingControl::GetPopupWindowType() const
+Reference< XInterface > SAL_CALL SAL_CALL ExtrusionLightingControl_createInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( RuntimeException )
{
- return SFX_POPUPWINDOW_ONCLICK;
+ return *new ExtrusionLightingControl( rSMgr );
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-SfxPopupWindow* ExtrusionLightingControl::CreatePopupWindow()
+OUString SAL_CALL ExtrusionLightingControl::getImplementationName( ) throw (RuntimeException)
{
- ExtrusionLightingWindow* pWin = new ExtrusionLightingWindow( GetId(), m_xFrame, &GetToolBox() );
- pWin->StartPopupMode( &GetToolBox(), TRUE );
- pWin->StartSelection();
- SetPopupWindow( pWin );
- return pWin;
+ return ExtrusionLightingControl_getImplementationName();
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-void ExtrusionLightingControl::StateChanged( USHORT, SfxItemState eState, const SfxPoolItem* )
+Sequence< OUString > SAL_CALL ExtrusionLightingControl::getSupportedServiceNames( ) throw (RuntimeException)
{
- USHORT nId = GetId();
- ToolBox& rTbx = GetToolBox();
-
- rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState );
- rTbx.SetItemState( nId, ( SFX_ITEM_DONTCARE == eState ) ? STATE_DONTKNOW : STATE_NOCHECK );
+ return ExtrusionLightingControl_getSupportedServiceNames();
}
// ####################################################################
-SFX_IMPL_TOOLBOX_CONTROL( ExtrusionSurfaceControl, SfxBoolItem );
-
-ExtrusionSurfaceWindow::ExtrusionSurfaceWindow(
- USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ) :
-
- SfxPopupWindow( nId,
- rFrame,
- SVX_RES( RID_SVXFLOAT_EXTRUSION_SURFACE )),
- maImgSurface1( SVX_RES( IMG_WIRE_FRAME ) ),
- maImgSurface2( SVX_RES( IMG_MATTE ) ),
- maImgSurface3( SVX_RES( IMG_PLASTIC ) ),
- maImgSurface4( SVX_RES( IMG_METAL ) ),
- maImgSurface1h( SVX_RES( IMG_WIRE_FRAME_H ) ),
- maImgSurface2h( SVX_RES( IMG_MATTE_H ) ),
- maImgSurface3h( SVX_RES( IMG_PLASTIC_H ) ),
- maImgSurface4h( SVX_RES( IMG_METAL_H ) ),
- mxFrame( rFrame ),
- mbPopupMode( true )
+ExtrusionSurfaceWindow::ExtrusionSurfaceWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow )
+: ToolbarMenu( rFrame, pParentWindow, SVX_RES( RID_SVXFLOAT_EXTRUSION_SURFACE ))
+, mrController( rController )
+, maImgSurface1( SVX_RES( IMG_WIRE_FRAME ) )
+, maImgSurface2( SVX_RES( IMG_MATTE ) )
+, maImgSurface3( SVX_RES( IMG_PLASTIC ) )
+, maImgSurface4( SVX_RES( IMG_METAL ) )
+, maImgSurface1h( SVX_RES( IMG_WIRE_FRAME_H ) )
+, maImgSurface2h( SVX_RES( IMG_MATTE_H ) )
+, maImgSurface3h( SVX_RES( IMG_PLASTIC_H ) )
+, maImgSurface4h( SVX_RES( IMG_METAL_H ) )
+, msExtrusionSurface( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionSurface" ))
{
- implInit();
-}
-
-ExtrusionSurfaceWindow::ExtrusionSurfaceWindow(
- USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
- Window* pParentWindow ) :
-
- SfxPopupWindow( nId,
- rFrame,
- pParentWindow,
- SVX_RES( RID_SVXFLOAT_EXTRUSION_SURFACE )),
- maImgSurface1( SVX_RES( IMG_WIRE_FRAME ) ),
- maImgSurface2( SVX_RES( IMG_MATTE ) ),
- maImgSurface3( SVX_RES( IMG_PLASTIC ) ),
- maImgSurface4( SVX_RES( IMG_METAL ) ),
- maImgSurface1h( SVX_RES( IMG_WIRE_FRAME_H ) ),
- maImgSurface2h( SVX_RES( IMG_MATTE_H ) ),
- maImgSurface3h( SVX_RES( IMG_PLASTIC_H ) ),
- maImgSurface4h( SVX_RES( IMG_METAL_H ) ),
- mxFrame( rFrame ),
- mbPopupMode( true )
-{
- implInit();
-}
-
-// -----------------------------------------------------------------------
-
-void ExtrusionSurfaceWindow::implInit()
-{
- SetHelpId( HID_POPUP_EXTRUSION_SURFACE );
-
bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
-// mpSurfaceForewarder = new SfxStatusForwarder( SID_EXTRUSION_SURFACE, *this );
-
- mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN );
- mpMenu->SetHelpId( HID_MENU_EXTRUSION_SURFACE );
- mpMenu->SetSelectHdl( LINK( this, ExtrusionSurfaceWindow, SelectHdl ) );
+ SetHelpId( HID_MENU_EXTRUSION_SURFACE );
+ SetSelectHdl( LINK( this, ExtrusionSurfaceWindow, SelectHdl ) );
- mpMenu->appendEntry( 0, String( SVX_RES( STR_WIREFRAME ) ), bHighContrast ? maImgSurface1h : maImgSurface1 );
- mpMenu->appendEntry( 1, String( SVX_RES( STR_MATTE ) ), bHighContrast ? maImgSurface2h : maImgSurface2 );
- mpMenu->appendEntry( 2, String( SVX_RES( STR_PLASTIC ) ), bHighContrast ? maImgSurface3h : maImgSurface3 );
- mpMenu->appendEntry( 3, String( SVX_RES( STR_METAL ) ), bHighContrast ? maImgSurface4h : maImgSurface4 );
+ appendEntry( 0, String( SVX_RES( STR_WIREFRAME ) ), bHighContrast ? maImgSurface1h : maImgSurface1 );
+ appendEntry( 1, String( SVX_RES( STR_MATTE ) ), bHighContrast ? maImgSurface2h : maImgSurface2 );
+ appendEntry( 2, String( SVX_RES( STR_PLASTIC ) ), bHighContrast ? maImgSurface3h : maImgSurface3 );
+ appendEntry( 3, String( SVX_RES( STR_METAL ) ), bHighContrast ? maImgSurface4h : maImgSurface4 );
- SetOutputSizePixel( mpMenu->getMenuSize() );
- mpMenu->SetOutputSizePixel( GetOutputSizePixel() );
-
- mpMenu->Show();
+ SetOutputSizePixel( getMenuSize() );
FreeResource();
- AddStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionSurface" )));
-// rBindings.Update( SID_EXTRUSION_SURFACE );
-}
-
-// -----------------------------------------------------------------------
-
-SfxPopupWindow* ExtrusionSurfaceWindow::Clone() const
-{
- return new ExtrusionSurfaceWindow( GetId(), mxFrame );
-}
-
-// -----------------------------------------------------------------------
-
-ExtrusionSurfaceWindow::~ExtrusionSurfaceWindow()
-{
-// delete mpSurfaceForewarder;
- delete mpMenu;
+ AddStatusListener( msExtrusionSurface );
}
// -----------------------------------------------------------------------
void ExtrusionSurfaceWindow::implSetSurface( int nSurface, bool bEnabled )
{
- if( mpMenu )
+// if( mpMenu )
{
int i;
for( i = 0; i < 4; i++ )
{
- mpMenu->checkEntry( i, (i == nSurface) && bEnabled );
- mpMenu->enableEntry( i, bEnabled );
+ checkEntry( i, (i == nSurface) && bEnabled );
+ enableEntry( i, bEnabled );
}
}
}
// -----------------------------------------------------------------------
-void ExtrusionSurfaceWindow::StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState )
+void SAL_CALL ExtrusionSurfaceWindow::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException )
{
- switch( nSID )
+ if( Event.FeatureURL.Main.equals( msExtrusionSurface ) )
{
- case SID_EXTRUSION_SURFACE:
+ if( !Event.IsEnabled )
{
- if( eState == SFX_ITEM_DISABLED )
- {
- implSetSurface( 0, false );
- }
- else
- {
- const SfxInt32Item* pStateItem = PTR_CAST( SfxInt32Item, pState );
- if( pStateItem )
- implSetSurface( pStateItem->GetValue(), true );
- }
- break;
+ implSetSurface( 0, false );
+ }
+ else
+ {
+ sal_Int32 nValue = 0;
+ if( Event.State >>= nValue )
+ implSetSurface( nValue, true );
}
- }
-}
-
-// -----------------------------------------------------------------------
-
-void ExtrusionSurfaceWindow::DataChanged( const DataChangedEvent& rDCEvt )
-{
- SfxPopupWindow::DataChanged( rDCEvt );
-
- if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
- {
- bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
-
- mpMenu->appendEntry( 0, String( SVX_RES( STR_WIREFRAME ) ), bHighContrast ? maImgSurface1h : maImgSurface1 );
- mpMenu->appendEntry( 1, String( SVX_RES( STR_MATTE ) ), bHighContrast ? maImgSurface2h : maImgSurface2 );
- mpMenu->appendEntry( 2, String( SVX_RES( STR_PLASTIC ) ), bHighContrast ? maImgSurface3h : maImgSurface3 );
- mpMenu->appendEntry( 3, String( SVX_RES( STR_METAL ) ), bHighContrast ? maImgSurface4h : maImgSurface4 );
}
}
@@ -1329,26 +917,14 @@ IMPL_LINK( ExtrusionSurfaceWindow, SelectHdl, void *, EMPTYARG )
if ( IsInPopupMode() )
EndPopupMode();
-// SfxDispatcher* pDisp = GetBindings().GetDispatcher();
-
- sal_Int32 nSurface = mpMenu->getSelectedEntryId();
+ sal_Int32 nSurface = getSelectedEntryId();
if( nSurface >= 0 )
{
- SfxInt32Item aItem( SID_EXTRUSION_SURFACE, nSurface );
- rtl::OUString aCommand( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionSurface" ));
-
- Any a;
- INetURLObject aObj( aCommand );
Sequence< PropertyValue > aArgs( 1 );
- aArgs[0].Name = aObj.GetURLPath();
- aItem.QueryValue( a );
- aArgs[0].Value = a;
+ aArgs[0].Name = msExtrusionSurface.copy(5);
+ aArgs[0].Value <<= (sal_Int32)nSurface;
- SfxToolBoxControl::Dispatch( Reference< ::com::sun::star::frame::XDispatchProvider >(
- mxFrame->getController(), UNO_QUERY ),
- aCommand,
- aArgs );
-// pDisp->Execute( SID_EXTRUSION_SURFACE, SFX_CALLMODE_RECORD, &aItem, 0L , 0L );
+ mrController.dispatchCommand( msExtrusionSurface, aArgs );
implSetSurface( nSurface, true );
}
@@ -1356,83 +932,57 @@ IMPL_LINK( ExtrusionSurfaceWindow, SelectHdl, void *, EMPTYARG )
return 0;
}
-// -----------------------------------------------------------------------
+// ========================================================================
-void ExtrusionSurfaceWindow::StartSelection()
+ExtrusionSurfaceControl::ExtrusionSurfaceControl( const Reference< lang::XMultiServiceFactory >& rServiceManager )
+: svt::PopupWindowController( rServiceManager, Reference< frame::XFrame >(), OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionSurfaceFloater" ) ) )
{
}
// -----------------------------------------------------------------------
-BOOL ExtrusionSurfaceWindow::Close()
+::Window* ExtrusionSurfaceControl::createPopupWindow( ::Window* pParent )
{
- return SfxPopupWindow::Close();
+ return new ExtrusionSurfaceWindow( *this, m_xFrame, pParent );
}
// -----------------------------------------------------------------------
-
-void ExtrusionSurfaceWindow::PopupModeEnd()
-{
- if ( IsVisible() )
- {
- mbPopupMode = FALSE;
- }
- SfxPopupWindow::PopupModeEnd();
-}
-
+// XServiceInfo
// -----------------------------------------------------------------------
-void ExtrusionSurfaceWindow::GetFocus (void)
+OUString SAL_CALL ExtrusionSurfaceControl_getImplementationName()
{
- SfxPopupWindow::GetFocus();
- // Grab the focus to the line ends value set so that it can be controlled
- // with the keyboard.
- if( mpMenu )
- mpMenu->GrabFocus();
+ return OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.ExtrusionSurfaceController" ));
}
-// ========================================================================
+// --------------------------------------------------------------------
-ExtrusionSurfaceControl::ExtrusionSurfaceControl(
- USHORT nSlotId, USHORT nId, ToolBox &rTbx )
-: SfxToolBoxControl( nSlotId, nId, rTbx )
+Sequence< OUString > SAL_CALL ExtrusionSurfaceControl_getSupportedServiceNames() throw( RuntimeException )
{
- rTbx.SetItemBits( nId, TIB_DROPDOWNONLY | rTbx.GetItemBits( nId ) );
+ Sequence< OUString > aSNS( 1 );
+ aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ));
+ return aSNS;
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-ExtrusionSurfaceControl::~ExtrusionSurfaceControl()
+Reference< XInterface > SAL_CALL SAL_CALL ExtrusionSurfaceControl_createInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( RuntimeException )
{
+ return *new ExtrusionSurfaceControl( rSMgr );
}
-// -----------------------------------------------------------------------
-
-SfxPopupWindowType ExtrusionSurfaceControl::GetPopupWindowType() const
-{
- return SFX_POPUPWINDOW_ONCLICK;
-}
-
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-SfxPopupWindow* ExtrusionSurfaceControl::CreatePopupWindow()
+OUString SAL_CALL ExtrusionSurfaceControl::getImplementationName( ) throw (RuntimeException)
{
- ExtrusionSurfaceWindow* pWin = new ExtrusionSurfaceWindow( GetId(), m_xFrame, &GetToolBox() );
- pWin->StartPopupMode( &GetToolBox(), TRUE );
- pWin->StartSelection();
- SetPopupWindow( pWin );
- return pWin;
+ return ExtrusionSurfaceControl_getImplementationName();
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-void ExtrusionSurfaceControl::StateChanged( USHORT, SfxItemState eState, const SfxPoolItem* )
+Sequence< OUString > SAL_CALL ExtrusionSurfaceControl::getSupportedServiceNames( ) throw (RuntimeException)
{
- USHORT nId = GetId();
- ToolBox& rTbx = GetToolBox();
-
- rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState );
- rTbx.SetItemState( nId, ( SFX_ITEM_DONTCARE == eState ) ? STATE_DONTKNOW : STATE_NOCHECK );
+ return ExtrusionSurfaceControl_getSupportedServiceNames();
}
//========================================================================
@@ -1498,3 +1048,5 @@ void ExtrusionColorControl::StateChanged( USHORT nSID, SfxItemState eState, cons
rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState );
rTbx.SetItemState( nId, ( SFX_ITEM_DONTCARE == eState ) ? STATE_DONTKNOW : STATE_NOCHECK );
}
+
+}
diff --git a/svx/source/tbxctrls/extrusioncontrols.hxx b/svx/source/tbxctrls/extrusioncontrols.hxx
new file mode 100644
index 000000000000..3dd8272b6940
--- /dev/null
+++ b/svx/source/tbxctrls/extrusioncontrols.hxx
@@ -0,0 +1,260 @@
+/*************************************************************************
+ *
+ * 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 _SVX_EXTRUSION_CONTROLS_HXX
+#define _SVX_EXTRUSION_CONTROLS_HXX
+
+#include "svx/svxdllapi.h"
+
+#include <svtools/valueset.hxx>
+#include <svtools/svtreebx.hxx>
+#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/field.hxx>
+#include <vcl/fixed.hxx>
+
+#include <svtools/toolbarmenu.hxx>
+#include <svtools/popupwindowcontroller.hxx>
+#include <svtools/popupmenucontrollerbase.hxx>
+
+class SfxBindings;
+class SfxStatusForwarder;
+
+//========================================================================
+
+namespace svx
+{
+class ToolboxButtonColorUpdater;
+
+class ExtrusionDirectionWindow : public svtools::ToolbarMenu
+{
+public:
+ ExtrusionDirectionWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow );
+
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+private:
+ svt::ToolboxController& mrController;
+ ValueSet* mpDirectionSet;
+
+ Image maImgDirection[9];
+ Image maImgDirectionH[9];
+
+ Image maImgPerspective;
+ Image maImgPerspectiveH;
+ Image maImgParallel;
+ Image maImgParallelH;
+
+ const rtl::OUString msExtrusionDirection;
+ const rtl::OUString msExtrusionProjection;
+
+ DECL_LINK( SelectHdl, void * );
+ void FillValueSet();
+
+ void implSetDirection( sal_Int32 nSkew, bool bEnabled = true );
+ void implSetProjection( sal_Int32 nProjection, bool bEnabled = true );
+
+};
+
+//========================================================================
+
+class ExtrusionDirectionControl : public svt::PopupWindowController
+{
+public:
+ ExtrusionDirectionControl( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
+
+ virtual ::Window* createPopupWindow( ::Window* pParent );
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
+
+ using svt::PopupWindowController::createPopupWindow;
+};
+
+//========================================================================
+
+class ExtrusionDepthWindow : public svtools::ToolbarMenu
+{
+private:
+ svt::ToolboxController& mrController;
+
+ Image maImgDepth0;
+ Image maImgDepth1;
+ Image maImgDepth2;
+ Image maImgDepth3;
+ Image maImgDepth4;
+ Image maImgDepthInfinity;
+
+ Image maImgDepth0h;
+ Image maImgDepth1h;
+ Image maImgDepth2h;
+ Image maImgDepth3h;
+ Image maImgDepth4h;
+ Image maImgDepthInfinityh;
+
+ FieldUnit meUnit;
+ double mfDepth;
+
+ const rtl::OUString msExtrusionDepth;
+ const rtl::OUString msMetricUnit;
+
+ DECL_LINK( SelectHdl, void * );
+
+ void implFillStrings( FieldUnit eUnit );
+ void implSetDepth( double fDepth );
+
+public:
+ ExtrusionDepthWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow );
+
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+};
+
+//========================================================================
+
+class ExtrusionDepthController : public svt::PopupWindowController
+{
+public:
+ ExtrusionDepthController( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
+
+ virtual ::Window* createPopupWindow( ::Window* pParent );
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
+
+ using svt::PopupWindowController::createPopupWindow;
+};
+
+//========================================================================
+
+class ExtrusionLightingWindow : public svtools::ToolbarMenu
+{
+private:
+ svt::ToolboxController& mrController;
+ ValueSet* mpLightingSet;
+
+ Image maImgLightingOff[9];
+ Image maImgLightingOn[9];
+ Image maImgLightingPreview[9];
+
+ Image maImgLightingOffh[9];
+ Image maImgLightingOnh[9];
+ Image maImgLightingPreviewh[9];
+
+ Image maImgBright;
+ Image maImgNormal;
+ Image maImgDim;
+ Image maImgBrighth;
+ Image maImgNormalh;
+ Image maImgDimh;
+
+ int mnLevel;
+ bool mbLevelEnabled;
+ int mnDirection;
+ bool mbDirectionEnabled;
+
+ const rtl::OUString msExtrusionLightingDirection;
+ const rtl::OUString msExtrusionLightingIntensity;
+
+ void implSetIntensity( int nLevel, bool bEnabled );
+ void implSetDirection( int nDirection, bool bEnabled );
+
+ DECL_LINK( SelectHdl, void * );
+public:
+ ExtrusionLightingWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow );
+
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+};
+
+//========================================================================
+
+class ExtrusionLightingControl : public svt::PopupWindowController
+{
+public:
+ ExtrusionLightingControl( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
+
+ virtual ::Window* createPopupWindow( ::Window* pParent );
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
+
+ using svt::PopupWindowController::createPopupWindow;
+};
+
+//========================================================================
+
+class ExtrusionSurfaceWindow : public svtools::ToolbarMenu
+{
+private:
+ svt::ToolboxController& mrController;
+
+ Image maImgSurface1;
+ Image maImgSurface2;
+ Image maImgSurface3;
+ Image maImgSurface4;
+ Image maImgSurface1h;
+ Image maImgSurface2h;
+ Image maImgSurface3h;
+ Image maImgSurface4h;
+
+ const rtl::OUString msExtrusionSurface;
+
+ DECL_LINK( SelectHdl, void * );
+
+ void implSetSurface( int nSurface, bool bEnabled );
+
+public:
+ ExtrusionSurfaceWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow );
+
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+};
+
+//========================================================================
+
+class ExtrusionSurfaceControl : public svt::PopupWindowController
+{
+public:
+ ExtrusionSurfaceControl( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
+
+ virtual ::Window* createPopupWindow( ::Window* pParent );
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
+
+ using svt::PopupWindowController::createPopupWindow;
+};
+
+//========================================================================
+
+}
+#endif
+
diff --git a/svx/source/tbxctrls/extrusioncontrols.src b/svx/source/tbxctrls/extrusioncontrols.src
index 0cf4cafdc58c..084606439cc3 100644
--- a/svx/source/tbxctrls/extrusioncontrols.src
+++ b/svx/source/tbxctrls/extrusioncontrols.src
@@ -30,9 +30,9 @@
#define MASKCOLOR MaskColor = Color { Red=0xFFFF; Green=0x0000; Blue=0xFFFF; };
-FloatingWindow RID_SVXFLOAT_EXTRUSION_DIRECTION
+DockingWindow RID_SVXFLOAT_EXTRUSION_DIRECTION
{
- Border = TRUE ;
+ Border = FALSE ;
Hide = TRUE ;
SVLook = TRUE ;
Sizeable = FALSE ;
@@ -200,9 +200,9 @@ FloatingWindow RID_SVXFLOAT_EXTRUSION_DIRECTION
};
};
-FloatingWindow RID_SVXFLOAT_EXTRUSION_DEPTH
+DockingWindow RID_SVXFLOAT_EXTRUSION_DEPTH
{
- Border = TRUE ;
+ Border = FALSE ;
Hide = TRUE ;
SVLook = TRUE ;
Sizeable = FALSE ;
@@ -289,9 +289,10 @@ FloatingWindow RID_SVXFLOAT_EXTRUSION_DEPTH
};
};
-FloatingWindow RID_SVXFLOAT_EXTRUSION_LIGHTING
+
+DockingWindow RID_SVXFLOAT_EXTRUSION_LIGHTING
{
- Border = TRUE ;
+ Border = FALSE ;
Hide = TRUE ;
SVLook = TRUE ;
Sizeable = FALSE ;
@@ -605,9 +606,9 @@ FloatingWindow RID_SVXFLOAT_EXTRUSION_LIGHTING
};
};
-FloatingWindow RID_SVXFLOAT_EXTRUSION_SURFACE
+DockingWindow RID_SVXFLOAT_EXTRUSION_SURFACE
{
- Border = TRUE ;
+ Border = FALSE ;
Hide = TRUE ;
SVLook = TRUE ;
Sizeable = FALSE ;
@@ -703,7 +704,7 @@ ModalDialog RID_SVX_MDLG_EXTRUSION_DEPTH
MetricField MTR_DEPTH
{
//HelpId = HID_SD_CTL_FAVORITES ;
- Border = TRUE ;
+ Border = FALSE ;
Pos = MAP_APPFONT ( 3 , 14 ) ;
Size = MAP_APPFONT ( WIDTH - 50 - 12, 12 ) ;
TabStop = TRUE ;
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index c1dd5443e610..23f2241ab235 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -27,40 +27,53 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
+
#include <com/sun/star/text/WritingMode.hpp>
-#include <sfx2/app.hxx>
+
+#include <vcl/toolbox.hxx>
+
#include <svl/itempool.hxx>
-#include <svx/fmmodel.hxx>
+
+#include <svtools/toolbarmenu.hxx>
+#include <svtools/popupwindowcontroller.hxx>
+#include <svtools/popupmenucontrollerbase.hxx>
+
+#include <sfx2/app.hxx>
#include <sfx2/dispatch.hxx>
-#include <svx/dlgutil.hxx>
+#include <editeng/eeitem.hxx>
+#include <editeng/frmdiritem.hxx>
+
+#include <svx/fmmodel.hxx>
#include <svx/svxids.hrc>
#include <svx/dialmgr.hxx>
#include <svx/dialogs.hrc>
-#include "svx/gallery.hxx"
#include <svx/svdpage.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdview.hxx>
#include <svx/svdoutl.hxx>
-#include <editeng/eeitem.hxx>
-#include <editeng/frmdiritem.hxx>
-#include "toolbarmenu.hxx"
-#include "svx/fontworkgallery.hxx"
+#include "svx/gallery.hxx"
+#include <svx/dlgutil.hxx>
+
+#include <svx/fontworkgallery.hxx>
#include "fontworkgallery.hrc"
#include <algorithm>
-#ifndef _TOOLBOX_HXX //autogen
-#include <vcl/toolbox.hxx>
-#endif
-#ifndef _SVX_HELPID_HRC
#include "helpid.hrc"
-#endif
-using namespace svx;
+
+using ::rtl::OUString;
+using ::svtools::ToolbarMenu;
+
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::frame;
+
+namespace svx
+{
const int nColCount = 4;
const int nLineCount = 4;
@@ -291,7 +304,7 @@ IMPL_LINK( FontWorkGalleryDialog, DoubleClickFavoriteHdl, void*, EMPTYARG )
return( 0L );
}
-// -----------------------------------------------------------------------
+//------------------------------------------------------------------------
SFX_IMPL_TOOLBOX_CONTROL( FontWorkShapeTypeControl, SfxStringItem );
FontWorkShapeTypeControl::FontWorkShapeTypeControl( USHORT nSlotId, USHORT nId, ToolBox &rTbx )
@@ -325,143 +338,104 @@ SfxPopupWindow* FontWorkShapeTypeControl::CreatePopupWindow()
// -----------------------------------------------------------------------
-void FontWorkShapeTypeControl::StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState )
-{
- SfxToolBoxControl::StateChanged( nSID, eState, pState );
-}
-
-// -----------------------------------------------------------------------
-
void FontWorkShapeTypeControl::Select( BOOL )
{
}
-// ####################################################################
+// ========================================================================
+// FontWorkAlignmentWindow
+// ========================================================================
-SFX_IMPL_TOOLBOX_CONTROL( FontWorkAlignmentControl, SfxBoolItem );
-
-FontWorkAlignmentWindow::FontWorkAlignmentWindow(
- USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ) :
-
- SfxPopupWindow( nId,
- rFrame,
- SVX_RES( RID_SVXFLOAT_FONTWORK_ALIGNMENT )),
- maImgAlgin1( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16 ) ),
- maImgAlgin2( SVX_RES( IMG_FONTWORK_ALIGN_CENTER_16 ) ),
- maImgAlgin3( SVX_RES( IMG_FONTWORK_ALIGN_RIGHT_16 ) ),
- maImgAlgin4( SVX_RES( IMG_FONTWORK_ALIGN_WORD_16 ) ),
- maImgAlgin5( SVX_RES( IMG_FONTWORK_ALIGN_STRETCH_16 ) ),
- maImgAlgin1h( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16_H ) ),
- maImgAlgin2h( SVX_RES( IMG_FONTWORK_ALIGN_CENTER_16_H ) ),
- maImgAlgin3h( SVX_RES( IMG_FONTWORK_ALIGN_RIGHT_16_H ) ),
- maImgAlgin4h( SVX_RES( IMG_FONTWORK_ALIGN_WORD_16_H ) ),
- maImgAlgin5h( SVX_RES( IMG_FONTWORK_ALIGN_STRETCH_16_H ) ),
- mxFrame( rFrame ),
- mbPopupMode( true )
-{
- SetHelpId( HID_WIN_FONTWORK_ALIGN );
- implInit();
-}
-
-FontWorkAlignmentWindow::FontWorkAlignmentWindow(
- USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
- Window* /*pParentWindow*/ ) :
-
- SfxPopupWindow( nId,
- rFrame,
- SVX_RES( RID_SVXFLOAT_FONTWORK_ALIGNMENT )),
- maImgAlgin1( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16 ) ),
- maImgAlgin2( SVX_RES( IMG_FONTWORK_ALIGN_CENTER_16 ) ),
- maImgAlgin3( SVX_RES( IMG_FONTWORK_ALIGN_RIGHT_16 ) ),
- maImgAlgin4( SVX_RES( IMG_FONTWORK_ALIGN_WORD_16 ) ),
- maImgAlgin5( SVX_RES( IMG_FONTWORK_ALIGN_STRETCH_16 ) ),
- maImgAlgin1h( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16_H ) ),
- maImgAlgin2h( SVX_RES( IMG_FONTWORK_ALIGN_CENTER_16_H ) ),
- maImgAlgin3h( SVX_RES( IMG_FONTWORK_ALIGN_RIGHT_16_H ) ),
- maImgAlgin4h( SVX_RES( IMG_FONTWORK_ALIGN_WORD_16_H ) ),
- maImgAlgin5h( SVX_RES( IMG_FONTWORK_ALIGN_STRETCH_16_H ) ),
- mxFrame( rFrame ),
- mbPopupMode( true )
-{
- SetHelpId( HID_WIN_FONTWORK_ALIGN );
- implInit();
-}
-
-void FontWorkAlignmentWindow::implInit()
+class FontWorkAlignmentWindow : public ToolbarMenu
+{
+public:
+ FontWorkAlignmentWindow( svt::ToolboxController& rController, const Reference< XFrame >& rFrame, Window* pParentWindow );
+
+ virtual void SAL_CALL statusChanged( const frame::FeatureStateEvent& Event ) throw ( RuntimeException );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+private:
+ svt::ToolboxController& mrController;
+
+ Image maImgAlgin1;
+ Image maImgAlgin2;
+ Image maImgAlgin3;
+ Image maImgAlgin4;
+ Image maImgAlgin5;
+ Image maImgAlgin1h;
+ Image maImgAlgin2h;
+ Image maImgAlgin3h;
+ Image maImgAlgin4h;
+ Image maImgAlgin5h;
+
+ const rtl::OUString msFontworkAlignment;
+
+ DECL_LINK( SelectHdl, void * );
+
+ void implSetAlignment( int nAlignmentMode, bool bEnabled );
+};
+
+FontWorkAlignmentWindow::FontWorkAlignmentWindow( svt::ToolboxController& rController, const Reference< XFrame >& rFrame, Window* pParentWindow )
+: ToolbarMenu( rFrame, pParentWindow, SVX_RES( RID_SVXFLOAT_FONTWORK_ALIGNMENT ))
+, mrController( rController )
+, maImgAlgin1( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16 ) )
+, maImgAlgin2( SVX_RES( IMG_FONTWORK_ALIGN_CENTER_16 ) )
+, maImgAlgin3( SVX_RES( IMG_FONTWORK_ALIGN_RIGHT_16 ) )
+, maImgAlgin4( SVX_RES( IMG_FONTWORK_ALIGN_WORD_16 ) )
+, maImgAlgin5( SVX_RES( IMG_FONTWORK_ALIGN_STRETCH_16 ) )
+, maImgAlgin1h( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16_H ) )
+, maImgAlgin2h( SVX_RES( IMG_FONTWORK_ALIGN_CENTER_16_H ) )
+, maImgAlgin3h( SVX_RES( IMG_FONTWORK_ALIGN_RIGHT_16_H ) )
+, maImgAlgin4h( SVX_RES( IMG_FONTWORK_ALIGN_WORD_16_H ) )
+, maImgAlgin5h( SVX_RES( IMG_FONTWORK_ALIGN_STRETCH_16_H ) )
+, msFontworkAlignment( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkAlignment" ) )
{
- SetHelpId( HID_POPUP_FONTWORK_ALIGN );
-
bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
- mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN );
- mpMenu->SetHelpId( HID_POPUP_FONTWORK_ALIGN );
- mpMenu->SetSelectHdl( LINK( this, FontWorkAlignmentWindow, SelectHdl ) );
-
- mpMenu->appendEntry( 0, String( SVX_RES( STR_ALIGN_LEFT ) ), bHighContrast ? maImgAlgin1h : maImgAlgin1 );
- mpMenu->appendEntry( 1, String( SVX_RES( STR_ALIGN_CENTER ) ), bHighContrast ? maImgAlgin2h : maImgAlgin2 );
- mpMenu->appendEntry( 2, String( SVX_RES( STR_ALIGN_RIGHT ) ), bHighContrast ? maImgAlgin3h : maImgAlgin3 );
- mpMenu->appendEntry( 3, String( SVX_RES( STR_ALIGN_WORD ) ), bHighContrast ? maImgAlgin4h : maImgAlgin4 );
- mpMenu->appendEntry( 4, String( SVX_RES( STR_ALIGN_STRETCH ) ), bHighContrast ? maImgAlgin5h : maImgAlgin5 );
+ SetHelpId( HID_POPUP_FONTWORK_ALIGN );
+ SetSelectHdl( LINK( this, FontWorkAlignmentWindow, SelectHdl ) );
- SetOutputSizePixel( mpMenu->getMenuSize() );
- mpMenu->SetOutputSizePixel( GetOutputSizePixel() );
+ appendEntry( 0, String( SVX_RES( STR_ALIGN_LEFT ) ), bHighContrast ? maImgAlgin1h : maImgAlgin1 );
+ appendEntry( 1, String( SVX_RES( STR_ALIGN_CENTER ) ), bHighContrast ? maImgAlgin2h : maImgAlgin2 );
+ appendEntry( 2, String( SVX_RES( STR_ALIGN_RIGHT ) ), bHighContrast ? maImgAlgin3h : maImgAlgin3 );
+ appendEntry( 3, String( SVX_RES( STR_ALIGN_WORD ) ), bHighContrast ? maImgAlgin4h : maImgAlgin4 );
+ appendEntry( 4, String( SVX_RES( STR_ALIGN_STRETCH ) ), bHighContrast ? maImgAlgin5h : maImgAlgin5 );
- mpMenu->Show();
+ SetOutputSizePixel( getMenuSize() );
FreeResource();
- AddStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkAlignment" )));
-}
-
-SfxPopupWindow* FontWorkAlignmentWindow::Clone() const
-{
- return new FontWorkAlignmentWindow( GetId(), mxFrame );
-}
-
-// -----------------------------------------------------------------------
-
-FontWorkAlignmentWindow::~FontWorkAlignmentWindow()
-{
- delete mpMenu;
+ AddStatusListener( msFontworkAlignment );
}
// -----------------------------------------------------------------------
void FontWorkAlignmentWindow::implSetAlignment( int nSurface, bool bEnabled )
{
- if( mpMenu )
+ int i;
+ for( i = 0; i < 5; i++ )
{
- int i;
- for( i = 0; i < 5; i++ )
- {
- mpMenu->checkEntry( i, (i == nSurface) && bEnabled );
- mpMenu->enableEntry( i, bEnabled );
- }
+ checkEntry( i, (i == nSurface) && bEnabled );
+ enableEntry( i, bEnabled );
}
}
// -----------------------------------------------------------------------
-void FontWorkAlignmentWindow::StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState )
+void SAL_CALL FontWorkAlignmentWindow::statusChanged( const frame::FeatureStateEvent& Event ) throw ( RuntimeException )
{
- switch( nSID )
+ if( Event.FeatureURL.Main.equals( msFontworkAlignment ) )
{
- case SID_FONTWORK_ALIGNMENT:
+ if( !Event.IsEnabled )
{
- if( eState == SFX_ITEM_DISABLED )
- {
- implSetAlignment( 0, false );
- }
- else
- {
- const SfxInt32Item* pStateItem = PTR_CAST( SfxInt32Item, pState );
- if( pStateItem )
- implSetAlignment( pStateItem->GetValue(), true );
- }
- break;
+ implSetAlignment( 0, false );
+ }
+ else
+ {
+ sal_Int32 nValue = 0;
+ if( Event.State >>= nValue )
+ implSetAlignment( nValue, true );
}
}
}
@@ -470,17 +444,17 @@ void FontWorkAlignmentWindow::StateChanged( USHORT nSID, SfxItemState eState, co
void FontWorkAlignmentWindow::DataChanged( const DataChangedEvent& rDCEvt )
{
- SfxPopupWindow::DataChanged( rDCEvt );
+ ToolbarMenu::DataChanged( rDCEvt );
if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
{
bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
- mpMenu->appendEntry( 0, String( SVX_RES( STR_ALIGN_LEFT ) ), bHighContrast ? maImgAlgin1h : maImgAlgin1 );
- mpMenu->appendEntry( 1, String( SVX_RES( STR_ALIGN_CENTER ) ), bHighContrast ? maImgAlgin2h : maImgAlgin2 );
- mpMenu->appendEntry( 2, String( SVX_RES( STR_ALIGN_RIGHT ) ), bHighContrast ? maImgAlgin3h : maImgAlgin3 );
- mpMenu->appendEntry( 3, String( SVX_RES( STR_ALIGN_WORD ) ), bHighContrast ? maImgAlgin4h : maImgAlgin4 );
- mpMenu->appendEntry( 4, String( SVX_RES( STR_ALIGN_STRETCH ) ), bHighContrast ? maImgAlgin5h : maImgAlgin5 );
+ appendEntry( 0, String( SVX_RES( STR_ALIGN_LEFT ) ), bHighContrast ? maImgAlgin1h : maImgAlgin1 );
+ appendEntry( 1, String( SVX_RES( STR_ALIGN_CENTER ) ), bHighContrast ? maImgAlgin2h : maImgAlgin2 );
+ appendEntry( 2, String( SVX_RES( STR_ALIGN_RIGHT ) ), bHighContrast ? maImgAlgin3h : maImgAlgin3 );
+ appendEntry( 3, String( SVX_RES( STR_ALIGN_WORD ) ), bHighContrast ? maImgAlgin4h : maImgAlgin4 );
+ appendEntry( 4, String( SVX_RES( STR_ALIGN_STRETCH ) ), bHighContrast ? maImgAlgin5h : maImgAlgin5 );
}
}
@@ -491,25 +465,14 @@ IMPL_LINK( FontWorkAlignmentWindow, SelectHdl, void *, EMPTYARG )
if ( IsInPopupMode() )
EndPopupMode();
-// SfxDispatcher* pDisp = GetBindings().GetDispatcher();
-
- sal_Int32 nAlignment = mpMenu->getSelectedEntryId();
+ sal_Int32 nAlignment = getSelectedEntryId();
if( nAlignment >= 0 )
{
- SfxInt32Item aItem( SID_FONTWORK_ALIGNMENT, nAlignment );
- rtl::OUString aCommand( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkAlignment" ));
-
- Any a;
- INetURLObject aObj( aCommand );
Sequence< PropertyValue > aArgs( 1 );
- aArgs[0].Name = aObj.GetURLPath();
- aItem.QueryValue( a );
- aArgs[0].Value = a;
+ aArgs[0].Name = msFontworkAlignment.copy(5);
+ aArgs[0].Value <<= (sal_Int32)nAlignment;
- SfxToolBoxControl::Dispatch( Reference< ::com::sun::star::frame::XDispatchProvider >(
- mxFrame->getController(), UNO_QUERY ),
- aCommand,
- aArgs );
+ mrController.dispatchCommand( msFontworkAlignment, aArgs );
implSetAlignment( nAlignment, true );
}
@@ -517,250 +480,191 @@ IMPL_LINK( FontWorkAlignmentWindow, SelectHdl, void *, EMPTYARG )
return 0;
}
-// -----------------------------------------------------------------------
+// ========================================================================
+// FontWorkAlignmentControl
+// ========================================================================
-void FontWorkAlignmentWindow::StartSelection()
+class FontWorkAlignmentControl : public svt::PopupWindowController
{
-}
+public:
+ FontWorkAlignmentControl( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
-// -----------------------------------------------------------------------
+ virtual ::Window* createPopupWindow( ::Window* pParent );
-BOOL FontWorkAlignmentWindow::Close()
-{
- return SfxPopupWindow::Close();
-}
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
-// -----------------------------------------------------------------------
+ using svt::PopupWindowController::createPopupWindow;
+};
-void FontWorkAlignmentWindow::PopupModeEnd()
-{
- if ( IsVisible() )
- {
- mbPopupMode = FALSE;
- }
- SfxPopupWindow::PopupModeEnd();
-}
// -----------------------------------------------------------------------
-void FontWorkAlignmentWindow::GetFocus (void)
+FontWorkAlignmentControl::FontWorkAlignmentControl( const Reference< lang::XMultiServiceFactory >& rServiceManager )
+: svt::PopupWindowController( rServiceManager, Reference< frame::XFrame >(), OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkAlignment" ) ) )
{
- SfxPopupWindow::GetFocus();
- // Grab the focus to the line ends value set so that it can be controlled
- // with the keyboard.
- if( mpMenu )
- mpMenu->GrabFocus();
}
-// ========================================================================
+// -----------------------------------------------------------------------
-FontWorkAlignmentControl::FontWorkAlignmentControl(
- USHORT nSlotId, USHORT nId, ToolBox &rTbx )
-: SfxToolBoxControl( nSlotId, nId, rTbx )
+::Window* FontWorkAlignmentControl::createPopupWindow( ::Window* pParent )
{
- rTbx.SetItemBits( nId, TIB_DROPDOWNONLY | rTbx.GetItemBits( nId ) );
+ return new FontWorkAlignmentWindow( *this, m_xFrame, pParent );
}
// -----------------------------------------------------------------------
+// XServiceInfo
+// -----------------------------------------------------------------------
-FontWorkAlignmentControl::~FontWorkAlignmentControl()
+OUString SAL_CALL FontWorkAlignmentControl_getImplementationName()
{
+ return OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.FontWorkAlignmentController" ));
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-SfxPopupWindowType FontWorkAlignmentControl::GetPopupWindowType() const
+Sequence< OUString > SAL_CALL FontWorkAlignmentControl_getSupportedServiceNames() throw( RuntimeException )
{
- return SFX_POPUPWINDOW_ONCLICK;
+ Sequence< OUString > aSNS( 1 );
+ aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ));
+ return aSNS;
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-SfxPopupWindow* FontWorkAlignmentControl::CreatePopupWindow()
+Reference< XInterface > SAL_CALL SAL_CALL FontWorkAlignmentControl_createInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( RuntimeException )
{
- FontWorkAlignmentWindow* pWin = new FontWorkAlignmentWindow( GetId(), m_xFrame, &GetToolBox() );
- pWin->StartPopupMode( &GetToolBox(), TRUE );
- pWin->StartSelection();
- SetPopupWindow( pWin );
- return pWin;
+ return *new FontWorkAlignmentControl( rSMgr );
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-void FontWorkAlignmentControl::StateChanged( USHORT /*nSID*/, SfxItemState eState, const SfxPoolItem* /*pState*/ )
+OUString SAL_CALL FontWorkAlignmentControl::getImplementationName( ) throw (RuntimeException)
{
- USHORT nId = GetId();
- ToolBox& rTbx = GetToolBox();
-
- rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState );
- rTbx.SetItemState( nId, ( SFX_ITEM_DONTCARE == eState ) ? STATE_DONTKNOW : STATE_NOCHECK );
+ return FontWorkAlignmentControl_getImplementationName();
}
-// ####################################################################
-
-SFX_IMPL_TOOLBOX_CONTROL( FontWorkCharacterSpacingControl, SfxBoolItem );
+// --------------------------------------------------------------------
-FontWorkCharacterSpacingWindow::FontWorkCharacterSpacingWindow(
- USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ) :
-
- SfxPopupWindow( nId,
- rFrame,
- SVX_RES( RID_SVXFLOAT_FONTWORK_CHARSPACING )),
- mxFrame( rFrame ),
- mbPopupMode( true )
+Sequence< OUString > SAL_CALL FontWorkAlignmentControl::getSupportedServiceNames( ) throw (RuntimeException)
{
- SetHelpId( HID_WIN_FONTWORK_CHARSPACE );
- implInit();
+ return FontWorkAlignmentControl_getSupportedServiceNames();
}
-FontWorkCharacterSpacingWindow::FontWorkCharacterSpacingWindow(
- USHORT nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
- Window* pParentWindow ) :
- SfxPopupWindow( nId,
- rFrame,
- pParentWindow,
- SVX_RES( RID_SVXFLOAT_FONTWORK_CHARSPACING )),
- mxFrame( rFrame ),
- mbPopupMode( true )
-{
- SetHelpId( HID_WIN_FONTWORK_CHARSPACE );
- implInit();
-}
+// ####################################################################
-void FontWorkCharacterSpacingWindow::implInit()
+class FontWorkCharacterSpacingWindow : public ToolbarMenu
{
- SetHelpId( HID_POPUP_FONTWORK_CHARSPACE );
+public:
+ FontWorkCharacterSpacingWindow( svt::ToolboxController& rController, const Reference< XFrame >& rFrame, Window* pParentWindow );
-// bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+private:
+ svt::ToolboxController& mrController;
- mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN );
- mpMenu->SetHelpId( HID_POPUP_FONTWORK_CHARSPACE );
- mpMenu->SetSelectHdl( LINK( this, FontWorkCharacterSpacingWindow, SelectHdl ) );
+ const rtl::OUString msFontworkCharacterSpacing;
+ const rtl::OUString msFontworkKernCharacterPairs;
- mpMenu->appendEntry( 0, String( SVX_RES( STR_CHARS_SPACING_VERY_TIGHT ) ), MIB_RADIOCHECK );
- mpMenu->appendEntry( 1, String( SVX_RES( STR_CHARS_SPACING_TIGHT ) ), MIB_RADIOCHECK );
- mpMenu->appendEntry( 2, String( SVX_RES( STR_CHARS_SPACING_NORMAL ) ), MIB_RADIOCHECK );
- mpMenu->appendEntry( 3, String( SVX_RES( STR_CHARS_SPACING_LOOSE ) ), MIB_RADIOCHECK );
- mpMenu->appendEntry( 4, String( SVX_RES( STR_CHARS_SPACING_VERY_LOOSE ) ), MIB_RADIOCHECK );
- mpMenu->appendEntry( 5, String( SVX_RES( STR_CHARS_SPACING_CUSTOM ) ), MIB_RADIOCHECK );
- mpMenu->appendSeparator();
- mpMenu->appendEntry( 6, String( SVX_RES( STR_CHARS_SPACING_KERN_PAIRS ) ), MIB_CHECKABLE );
+ DECL_LINK( SelectHdl, void * );
- SetOutputSizePixel( mpMenu->getMenuSize() );
- mpMenu->SetOutputSizePixel( GetOutputSizePixel() );
+ void implSetCharacterSpacing( sal_Int32 nCharacterSpacing, bool bEnabled );
+ void implSetKernCharacterPairs( sal_Bool bKernOnOff, bool bEnabled );
- mpMenu->Show();
-
- FreeResource();
+};
- AddStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkCharacterSpacing" )));
-}
+// -----------------------------------------------------------------------
-SfxPopupWindow* FontWorkCharacterSpacingWindow::Clone() const
+FontWorkCharacterSpacingWindow::FontWorkCharacterSpacingWindow( svt::ToolboxController& rController, const Reference< XFrame >& rFrame, Window* pParentWindow )
+: ToolbarMenu( rFrame, pParentWindow, SVX_RES( RID_SVXFLOAT_FONTWORK_CHARSPACING ))
+, mrController( rController )
+, msFontworkCharacterSpacing( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkCharacterSpacing" ) )
+, msFontworkKernCharacterPairs( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkKernCharacterPairs" ) )
{
- return new FontWorkCharacterSpacingWindow( GetId(), mxFrame );
-}
+ SetHelpId( HID_POPUP_FONTWORK_CHARSPACE );
+ SetSelectHdl( LINK( this, FontWorkCharacterSpacingWindow, SelectHdl ) );
-// -----------------------------------------------------------------------
+ appendEntry( 0, String( SVX_RES( STR_CHARS_SPACING_VERY_TIGHT ) ), MIB_RADIOCHECK );
+ appendEntry( 1, String( SVX_RES( STR_CHARS_SPACING_TIGHT ) ), MIB_RADIOCHECK );
+ appendEntry( 2, String( SVX_RES( STR_CHARS_SPACING_NORMAL ) ), MIB_RADIOCHECK );
+ appendEntry( 3, String( SVX_RES( STR_CHARS_SPACING_LOOSE ) ), MIB_RADIOCHECK );
+ appendEntry( 4, String( SVX_RES( STR_CHARS_SPACING_VERY_LOOSE ) ), MIB_RADIOCHECK );
+ appendEntry( 5, String( SVX_RES( STR_CHARS_SPACING_CUSTOM ) ), MIB_RADIOCHECK );
+ appendSeparator();
+ appendEntry( 6, String( SVX_RES( STR_CHARS_SPACING_KERN_PAIRS ) ), MIB_CHECKABLE );
-FontWorkCharacterSpacingWindow::~FontWorkCharacterSpacingWindow()
-{
- delete mpMenu;
+ SetOutputSizePixel( getMenuSize() );
+
+ FreeResource();
+
+ AddStatusListener( msFontworkCharacterSpacing );
+ AddStatusListener( msFontworkKernCharacterPairs );
}
// -----------------------------------------------------------------------
void FontWorkCharacterSpacingWindow::implSetCharacterSpacing( sal_Int32 nCharacterSpacing, bool bEnabled )
{
- if( mpMenu )
+ sal_Int32 i;
+ for ( i = 0; i < 6; i++ )
{
- sal_Int32 i;
- for ( i = 0; i < 6; i++ )
- {
- mpMenu->checkEntry( i, sal_False );
- mpMenu->enableEntry( i, bEnabled );
- }
- if ( nCharacterSpacing != -1 )
+ checkEntry( i, sal_False );
+ enableEntry( i, bEnabled );
+ }
+ if ( nCharacterSpacing != -1 )
+ {
+ sal_Int32 nEntry;
+ switch( nCharacterSpacing )
{
- sal_Int32 nEntry;
- switch( nCharacterSpacing )
- {
- case 80 : nEntry = 0; break;
- case 90 : nEntry = 1; break;
- case 100 : nEntry = 2; break;
- case 120 : nEntry = 3; break;
- case 150 : nEntry = 4; break;
- default : nEntry = 5; break;
- }
- mpMenu->checkEntry( nEntry, bEnabled );
+ case 80 : nEntry = 0; break;
+ case 90 : nEntry = 1; break;
+ case 100 : nEntry = 2; break;
+ case 120 : nEntry = 3; break;
+ case 150 : nEntry = 4; break;
+ default : nEntry = 5; break;
}
+ checkEntry( nEntry, bEnabled );
}
}
+// -----------------------------------------------------------------------
+
void FontWorkCharacterSpacingWindow::implSetKernCharacterPairs( sal_Bool, bool bEnabled )
{
- if( mpMenu )
- {
- mpMenu->enableEntry( 6, bEnabled );
- mpMenu->checkEntry( 6, bEnabled );
- }
+ enableEntry( 6, bEnabled );
+ checkEntry( 6, bEnabled );
}
// -----------------------------------------------------------------------
-void FontWorkCharacterSpacingWindow::StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState )
+void SAL_CALL FontWorkCharacterSpacingWindow::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException )
{
- switch( nSID )
+ if( Event.FeatureURL.Main.equals( msFontworkCharacterSpacing ) )
{
- case SID_FONTWORK_CHARACTER_SPACING:
+ if( !Event.IsEnabled )
{
- if( eState == SFX_ITEM_DISABLED )
- implSetCharacterSpacing( 0, false );
- else
- {
- const SfxInt32Item* pStateItem = PTR_CAST( SfxInt32Item, pState );
- if( pStateItem )
- implSetCharacterSpacing( pStateItem->GetValue(), true );
- }
+ implSetCharacterSpacing( 0, false );
}
- break;
-
- case SID_FONTWORK_KERN_CHARACTER_PAIRS :
+ else
{
- if( eState == SFX_ITEM_DISABLED )
- implSetKernCharacterPairs( 0, false );
- else
- {
- const SfxBoolItem* pStateItem = PTR_CAST( SfxBoolItem, pState );
- if( pStateItem )
- implSetKernCharacterPairs( pStateItem->GetValue(), true );
- }
+ sal_Int32 nValue = 0;
+ if( Event.State >>= nValue )
+ implSetCharacterSpacing( nValue, true );
}
- break;
}
-}
-
-// -----------------------------------------------------------------------
-
-void FontWorkCharacterSpacingWindow::DataChanged( const DataChangedEvent& rDCEvt )
-{
- SfxPopupWindow::DataChanged( rDCEvt );
-
- if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
+ else if( Event.FeatureURL.Main.equals( msFontworkKernCharacterPairs ) )
{
-// bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
-
- mpMenu->appendEntry( 0, String( SVX_RES( STR_CHARS_SPACING_VERY_TIGHT ) ), MIB_CHECKABLE );
- mpMenu->appendEntry( 1, String( SVX_RES( STR_CHARS_SPACING_TIGHT ) ), MIB_CHECKABLE );
- mpMenu->appendEntry( 2, String( SVX_RES( STR_CHARS_SPACING_NORMAL ) ), MIB_CHECKABLE );
- mpMenu->appendEntry( 3, String( SVX_RES( STR_CHARS_SPACING_LOOSE ) ), MIB_CHECKABLE );
- mpMenu->appendEntry( 4, String( SVX_RES( STR_CHARS_SPACING_VERY_LOOSE ) ), MIB_CHECKABLE );
- mpMenu->appendEntry( 5, String( SVX_RES( STR_CHARS_SPACING_CUSTOM ) ), MIB_CHECKABLE );
- mpMenu->appendSeparator();
- mpMenu->appendEntry( 6, String( SVX_RES( STR_CHARS_SPACING_KERN_PAIRS ) ), MIB_CHECKABLE );
+ if( !Event.IsEnabled )
+ {
+ implSetKernCharacterPairs( 0, false );
+ }
+ else
+ {
+ sal_Bool bValue = sal_False;
+ if( Event.State >>= bValue )
+ implSetKernCharacterPairs( bValue, true );
+ }
}
}
@@ -771,7 +675,7 @@ IMPL_LINK( FontWorkCharacterSpacingWindow, SelectHdl, void *, EMPTYARG )
if ( IsInPopupMode() )
EndPopupMode();
- sal_Int32 nSelection = mpMenu->getSelectedEntryId();
+ sal_Int32 nSelection = getSelectedEntryId();
sal_Int32 nCharacterSpacing;
switch( nSelection )
{
@@ -784,53 +688,31 @@ IMPL_LINK( FontWorkCharacterSpacingWindow, SelectHdl, void *, EMPTYARG )
}
if ( nSelection == 5 ) // custom spacing
{
- SfxInt32Item aItem( SID_FONTWORK_CHARACTER_SPACING, nCharacterSpacing );
- rtl::OUString aCommand( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkCharacterSpacingDialog" ));
-
- Any a;
Sequence< PropertyValue > aArgs( 1 );
- aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FontworkCharacterSpacing" ));
- aItem.QueryValue( a );
- aArgs[0].Value = a;
- SfxToolBoxControl::Dispatch( Reference< ::com::sun::star::frame::XDispatchProvider >(
- mxFrame->getController(), UNO_QUERY ),
- aCommand,
- aArgs );
+ aArgs[0].Name = msFontworkCharacterSpacing.copy(5);
+ aArgs[0].Value <<= (sal_Int32)nCharacterSpacing;
+
+ mrController.dispatchCommand( OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkCharacterSpacingDialog" )), aArgs );
}
else if ( nSelection == 6 ) // KernCharacterPairs
{
- sal_Bool bOnOff = sal_True;
- SfxBoolItem aItem( SID_FONTWORK_KERN_CHARACTER_PAIRS, bOnOff );
rtl::OUString aCommand( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkKernCharacterPairs" ));
- Any a;
Sequence< PropertyValue > aArgs( 1 );
- aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FontworkKernCharacterPairs" ));
- aItem.QueryValue( a );
- aArgs[0].Value = a;
- SfxToolBoxControl::Dispatch( Reference< ::com::sun::star::frame::XDispatchProvider >(
- mxFrame->getController(), UNO_QUERY ),
- aCommand,
- aArgs );
-
- implSetKernCharacterPairs( bOnOff, true );
+ aArgs[0].Name = msFontworkKernCharacterPairs.copy(5);
+ aArgs[0].Value <<= (sal_Bool) sal_True;
+
+ mrController.dispatchCommand( msFontworkKernCharacterPairs, aArgs );
+
+ implSetKernCharacterPairs( sal_True, true );
}
else if( nSelection >= 0 )
{
- SfxInt32Item aItem( SID_FONTWORK_CHARACTER_SPACING, nCharacterSpacing );
- rtl::OUString aCommand( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkCharacterSpacing" ));
-
- Any a;
- INetURLObject aObj( aCommand );
Sequence< PropertyValue > aArgs( 1 );
- aArgs[0].Name = aObj.GetURLPath();
- aItem.QueryValue( a );
- aArgs[0].Value = a;
+ aArgs[0].Name = msFontworkCharacterSpacing.copy(5);
+ aArgs[0].Value <<=( sal_Int32)nCharacterSpacing;
- SfxToolBoxControl::Dispatch( Reference< ::com::sun::star::frame::XDispatchProvider >(
- mxFrame->getController(), UNO_QUERY ),
- aCommand,
- aArgs );
+ mrController.dispatchCommand( msFontworkCharacterSpacing, aArgs );
implSetCharacterSpacing( nCharacterSpacing, true );
}
@@ -838,86 +720,79 @@ IMPL_LINK( FontWorkCharacterSpacingWindow, SelectHdl, void *, EMPTYARG )
return 0;
}
-// -----------------------------------------------------------------------
+// ========================================================================
+// FontWorkCharacterSpacingControl
+// ========================================================================
-void FontWorkCharacterSpacingWindow::StartSelection()
+class FontWorkCharacterSpacingControl : public svt::PopupWindowController
{
-}
+public:
+ FontWorkCharacterSpacingControl( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
-// -----------------------------------------------------------------------
+ virtual ::Window* createPopupWindow( ::Window* pParent );
-BOOL FontWorkCharacterSpacingWindow::Close()
-{
- return SfxPopupWindow::Close();
-}
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
+
+ using svt::PopupWindowController::createPopupWindow;
+};
-// -----------------------------------------------------------------------
-void FontWorkCharacterSpacingWindow::PopupModeEnd()
+FontWorkCharacterSpacingControl::FontWorkCharacterSpacingControl( const Reference< lang::XMultiServiceFactory >& rServiceManager )
+: svt::PopupWindowController( rServiceManager, Reference< frame::XFrame >(), OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkCharacterSpacingFloater" ) ) )
{
- if ( IsVisible() )
- {
- mbPopupMode = FALSE;
- }
- SfxPopupWindow::PopupModeEnd();
}
// -----------------------------------------------------------------------
-void FontWorkCharacterSpacingWindow::GetFocus (void)
+::Window* FontWorkCharacterSpacingControl::createPopupWindow( ::Window* pParent )
{
- SfxPopupWindow::GetFocus();
- // Grab the focus to the line ends value set so that it can be controlled
- // with the keyboard.
- if( mpMenu )
- mpMenu->GrabFocus();
+ return new FontWorkCharacterSpacingWindow( *this, m_xFrame, pParent );
}
-// ========================================================================
+// -----------------------------------------------------------------------
+// XServiceInfo
+// -----------------------------------------------------------------------
-FontWorkCharacterSpacingControl::FontWorkCharacterSpacingControl(
- USHORT nSlotId, USHORT nId, ToolBox &rTbx )
-: SfxToolBoxControl( nSlotId, nId, rTbx )
+OUString SAL_CALL FontWorkCharacterSpacingControl_getImplementationName()
{
- rTbx.SetItemBits( nId, TIB_DROPDOWNONLY | rTbx.GetItemBits( nId ) );
+ return OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.FontWorkCharacterSpacingController" ));
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-FontWorkCharacterSpacingControl::~FontWorkCharacterSpacingControl()
+Sequence< OUString > SAL_CALL FontWorkCharacterSpacingControl_getSupportedServiceNames() throw( RuntimeException )
{
+ Sequence< OUString > aSNS( 1 );
+ aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ));
+ return aSNS;
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-SfxPopupWindowType FontWorkCharacterSpacingControl::GetPopupWindowType() const
+Reference< XInterface > SAL_CALL SAL_CALL FontWorkCharacterSpacingControl_createInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( RuntimeException )
{
- return SFX_POPUPWINDOW_ONCLICK;
+ return *new FontWorkCharacterSpacingControl( rSMgr );
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-SfxPopupWindow* FontWorkCharacterSpacingControl::CreatePopupWindow()
+OUString SAL_CALL FontWorkCharacterSpacingControl::getImplementationName( ) throw (RuntimeException)
{
- FontWorkCharacterSpacingWindow* pWin = new FontWorkCharacterSpacingWindow( GetId(), m_xFrame, &GetToolBox() );
- pWin->StartPopupMode( &GetToolBox(), TRUE );
- pWin->StartSelection();
- SetPopupWindow( pWin );
- return pWin;
+ return FontWorkCharacterSpacingControl_getImplementationName();
}
-// -----------------------------------------------------------------------
+// --------------------------------------------------------------------
-void FontWorkCharacterSpacingControl::StateChanged( USHORT, SfxItemState eState, const SfxPoolItem* )
+Sequence< OUString > SAL_CALL FontWorkCharacterSpacingControl::getSupportedServiceNames( ) throw (RuntimeException)
{
- USHORT nId = GetId();
- ToolBox& rTbx = GetToolBox();
-
- rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState );
- rTbx.SetItemState( nId, ( SFX_ITEM_DONTCARE == eState ) ? STATE_DONTKNOW : STATE_NOCHECK );
+ return FontWorkCharacterSpacingControl_getSupportedServiceNames();
}
-// -----------------------------------------------------------------------
+// ========================================================================
+// FontworkCharacterSpacingDialog
+// ========================================================================
FontworkCharacterSpacingDialog::FontworkCharacterSpacingDialog( Window* pParent, sal_Int32 nScale )
: ModalDialog( pParent, SVX_RES( RID_SVX_MDLG_FONTWORK_CHARSPACING ) ),
@@ -939,3 +814,5 @@ sal_Int32 FontworkCharacterSpacingDialog::getScale() const
{
return (sal_Int32)maMtrScale.GetValue();
}
+
+}
diff --git a/svx/source/tbxctrls/fontworkgallery.src b/svx/source/tbxctrls/fontworkgallery.src
index 88c294407860..e5f52158b4b6 100644
--- a/svx/source/tbxctrls/fontworkgallery.src
+++ b/svx/source/tbxctrls/fontworkgallery.src
@@ -55,7 +55,7 @@ ModalDialog RID_SVX_MDLG_FONTWORK_GALLERY
Control CTL_FAVORITES
{
HelpId = HID_CTL_FONTWORK_FAVORITES ;
- Border = TRUE ;
+ Border = FALSE ;
Pos = MAP_APPFONT ( 3 , 14 ) ;
Size = MAP_APPFONT ( WIDTH - 6,
HEIGHT - RSC_CD_PUSHBUTTON_HEIGHT -
@@ -92,9 +92,9 @@ ModalDialog RID_SVX_MDLG_FONTWORK_GALLERY
};
};
-FloatingWindow RID_SVXFLOAT_FONTWORK_ALIGNMENT
+DockingWindow RID_SVXFLOAT_FONTWORK_ALIGNMENT
{
- Border = TRUE ;
+ Border = FALSE ;
Hide = TRUE ;
SVLook = TRUE ;
Sizeable = FALSE ;
@@ -227,9 +227,9 @@ FloatingWindow RID_SVXFLOAT_FONTWORK_ALIGNMENT
};
};
-FloatingWindow RID_SVXFLOAT_FONTWORK_CHARSPACING
+DockingWindow RID_SVXFLOAT_FONTWORK_CHARSPACING
{
- Border = TRUE ;
+ Border = FALSE ;
Hide = TRUE ;
SVLook = TRUE ;
Sizeable = FALSE ;
@@ -306,7 +306,7 @@ ModalDialog RID_SVX_MDLG_FONTWORK_CHARSPACING
};
MetricField MF_VALUE
{
- Border = TRUE ;
+ Border = FALSE ;
Pos = MAP_APPFONT ( 6 , 17 ) ;
Size = MAP_APPFONT ( 32 , 12 ) ;
TabStop = TRUE ;
diff --git a/svx/source/tbxctrls/makefile.mk b/svx/source/tbxctrls/makefile.mk
index 47da008e87a3..73a178d97594 100644
--- a/svx/source/tbxctrls/makefile.mk
+++ b/svx/source/tbxctrls/makefile.mk
@@ -44,7 +44,6 @@ LIB1OBJFILES= \
$(SLO)$/fontworkgallery.obj\
$(SLO)$/extrusioncontrols.obj \
$(SLO)$/tbcontrl.obj \
- $(SLO)$/toolbarmenu.obj \
$(SLO)$/tbxcolorupdate.obj
LIB2TARGET= $(SLB)$/$(TARGET).lib
@@ -62,7 +61,8 @@ LIB2OBJFILES= \
$(SLO)$/verttexttbxctrl.obj \
$(SLO)$/subtoolboxcontrol.obj \
$(SLO)$/tbxcolor.obj \
- $(SLO)$/tbunocontroller.obj
+ $(SLO)$/tbunocontroller.obj \
+ $(SLO)$/tbunosearchcontrollers.obj
SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
new file mode 100644
index 000000000000..f4f03170a90f
--- /dev/null
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -0,0 +1,867 @@
+/*************************************************************************
+ *
+ * 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_svx.hxx"
+
+#include "tbunosearchcontrollers.hxx"
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <com/sun/star/ui/XUIElement.hpp>
+#include <com/sun/star/util/URL.hpp>
+
+#include <toolkit/helper/vclunohelper.hxx>
+#include <vcl/toolbox.hxx>
+#include <vcl/svapp.hxx>
+#include <vos/mutex.hxx>
+
+namespace svx
+{
+
+static const ::rtl::OUString SEARCHITEM_SEARCHSTRING = ::rtl::OUString::createFromAscii("SearchItem.SearchString");
+static const ::rtl::OUString SEARCHITEM_SEARCHBACKWARD = ::rtl::OUString::createFromAscii("SearchItem.Backward");
+
+static const ::rtl::OUString COMMAND_EXECUTESEARCH = ::rtl::OUString::createFromAscii(".uno:ExecuteSearch");
+static const ::rtl::OUString COMMAND_FINDTEXT = ::rtl::OUString::createFromAscii(".uno:FindText") ;
+static const ::rtl::OUString COMMAND_DOWNSEARCH = ::rtl::OUString::createFromAscii(".uno:DownSearch");
+static const ::rtl::OUString COMMAND_UPSEARCH = ::rtl::OUString::createFromAscii(".uno:UpSearch") ;
+static const ::rtl::OUString COMMAND_APPENDSEARCHHISTORY = ::rtl::OUString::createFromAscii("AppendSearchHistory");
+
+static const ::rtl::OUString SERVICENAME_URLTRANSFORMER = ::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer");
+static const sal_Int32 REMEMBER_SIZE = 10;
+
+void impl_executeSearch( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr, const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Sequence< css::beans::PropertyValue >& lArgs )
+{
+ css::uno::Reference< css::util::XURLTransformer > xURLTransformer( rSMgr->createInstance(SERVICENAME_URLTRANSFORMER), css::uno::UNO_QUERY );
+ if ( xURLTransformer.is() )
+ {
+ css::util::URL aURL;
+ aURL.Complete = COMMAND_EXECUTESEARCH;
+ xURLTransformer->parseStrict(aURL);
+
+ css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider(xFrame, css::uno::UNO_QUERY);
+ if ( xDispatchProvider.is() )
+ {
+ css::uno::Reference< css::frame::XDispatch > xDispatch = xDispatchProvider->queryDispatch( aURL, ::rtl::OUString(), 0 );
+ if ( xDispatch.is() && aURL.Complete.getLength() > 0 )
+ xDispatch->dispatch( aURL, lArgs );
+ }
+ }
+}
+
+FindTextFieldControl::FindTextFieldControl( Window* pParent, WinBits nStyle,
+ css::uno::Reference< css::frame::XFrame >& xFrame,
+ css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager) :
+ ComboBox( pParent, nStyle ),
+ m_xFrame(xFrame),
+ m_xServiceManager(xServiceManager),
+ m_bToClearTextField(sal_True)
+{
+ InitControls_Impl();
+}
+
+FindTextFieldControl::~FindTextFieldControl()
+{
+}
+
+void FindTextFieldControl::InitControls_Impl()
+{
+ SetText( String( ::rtl::OUString::createFromAscii("Find") ) );
+ SetControlForeground(COL_GRAY);
+
+ EnableAutocomplete(TRUE, TRUE);
+}
+
+void FindTextFieldControl::Remember_Impl(const String& rStr)
+{
+ USHORT nCount = GetEntryCount();
+
+ for (USHORT i=0; i<nCount; ++i)
+ {
+ if ( rStr == GetEntry(i))
+ return;
+ }
+
+ if (nCount == REMEMBER_SIZE)
+ RemoveEntry(REMEMBER_SIZE-1);
+
+ InsertEntry(rStr, 0);
+}
+
+void FindTextFieldControl::Modify()
+{
+ ComboBox::Modify();
+
+ SetControlForeground( Color( COL_BLACK ) );
+}
+
+long FindTextFieldControl::PreNotify( NotifyEvent& rNEvt )
+{
+ long nRet= ComboBox::PreNotify( rNEvt );
+
+ switch ( rNEvt.GetType() )
+ {
+ case EVENT_KEYINPUT:
+ {
+ const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
+ sal_Bool bCtrl = pKeyEvent->GetKeyCode().IsMod1();
+ sal_Bool bAlt = pKeyEvent->GetKeyCode().IsMod2();
+ sal_Bool bShift = pKeyEvent->GetKeyCode().IsShift();
+ sal_uInt16 nCode = pKeyEvent->GetKeyCode().GetCode();
+
+ if ( (bCtrl && bAlt && KEY_F == nCode) || KEY_ESCAPE == nCode )
+ GrabFocusToDocument();
+
+ if ( KEY_RETURN == nCode )
+ {
+ Remember_Impl(GetText());
+
+ ::rtl::OUString sFindText = GetText();
+ css::uno::Sequence< css::beans::PropertyValue > lArgs(2);
+
+ lArgs[0].Name = SEARCHITEM_SEARCHSTRING;
+ lArgs[0].Value <<= sFindText;
+
+ lArgs[1].Name = SEARCHITEM_SEARCHBACKWARD;
+ if (bShift)
+ lArgs[1].Value <<= sal_True;
+ else
+ lArgs[1].Value <<= sal_False;
+
+ impl_executeSearch(m_xServiceManager, m_xFrame, lArgs);
+ }
+ break;
+ }
+
+ case EVENT_GETFOCUS:
+ if ( m_bToClearTextField )
+ {
+ SetText( String() );
+ m_bToClearTextField = sal_False;
+ }
+ SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
+ break;
+
+ case EVENT_LOSEFOCUS:
+ if ( GetText().Len() == 0 )
+ {
+ SetText( String( ::rtl::OUString::createFromAscii("Find") ) );
+ SetControlForeground(COL_GRAY);
+ m_bToClearTextField = sal_True;
+ }
+ break;
+ }
+
+ return nRet;
+}
+
+
+//-----------------------------------------------------------------------------------------------------------
+// SearchToolbarControllersManager
+
+SearchToolbarControllersManager* SearchToolbarControllersManager::m_pInstance = 0;
+
+SearchToolbarControllersManager::SearchToolbarControllersManager()
+{
+}
+
+SearchToolbarControllersManager::~SearchToolbarControllersManager()
+{
+}
+
+SearchToolbarControllersManager* SearchToolbarControllersManager::createControllersManager()
+{
+ if (!m_pInstance)
+ m_pInstance = new SearchToolbarControllersManager();
+
+ return m_pInstance;
+}
+
+void SearchToolbarControllersManager::registryController( const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Reference< css::frame::XStatusListener >& xStatusListener, const ::rtl::OUString& sCommandURL )
+{
+ SearchToolbarControllersMap::iterator pIt = aSearchToolbarControllersMap.find(xFrame);
+ if (pIt == aSearchToolbarControllersMap.end())
+ {
+ SearchToolbarControllersVec lControllers(1);
+ lControllers[0].Name = sCommandURL;
+ lControllers[0].Value <<= xStatusListener;
+ aSearchToolbarControllersMap.insert(SearchToolbarControllersMap::value_type(xFrame, lControllers));
+ }
+ else
+ {
+ sal_Int32 nSize = pIt->second.size();
+ for (sal_Int32 i=0; i<nSize; ++i)
+ {
+ if (pIt->second[i].Name.equals(sCommandURL))
+ return;
+ }
+
+ pIt->second.resize(nSize+1);
+ pIt->second[nSize].Name = sCommandURL;
+ pIt->second[nSize].Value <<= xStatusListener;
+ }
+}
+
+void SearchToolbarControllersManager::freeController( const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Reference< css::frame::XStatusListener >& /*xStatusListener*/, const ::rtl::OUString& sCommandURL )
+{
+ SearchToolbarControllersMap::iterator pIt = aSearchToolbarControllersMap.find(xFrame);
+ if (pIt != aSearchToolbarControllersMap.end())
+ {
+ for (SearchToolbarControllersVec::iterator pItCtrl=pIt->second.begin(); pItCtrl!=pIt->second.end(); ++pItCtrl)
+ {
+ if (pItCtrl->Name.equals(sCommandURL))
+ {
+ pIt->second.erase(pItCtrl);
+ break;
+ }
+ }
+
+ if (pIt->second.empty())
+ aSearchToolbarControllersMap.erase(pIt);
+ }
+}
+
+css::uno::Reference< css::frame::XStatusListener > SearchToolbarControllersManager::findController( const css::uno::Reference< css::frame::XFrame >& xFrame, const ::rtl::OUString& sCommandURL )
+{
+ css::uno::Reference< css::frame::XStatusListener > xStatusListener;
+
+ SearchToolbarControllersMap::iterator pIt = aSearchToolbarControllersMap.find(xFrame);
+ if (pIt != aSearchToolbarControllersMap.end())
+ {
+ for (SearchToolbarControllersVec::iterator pItCtrl =pIt->second.begin(); pItCtrl != pIt->second.end(); ++pItCtrl)
+ {
+ if (pItCtrl->Name.equals(sCommandURL))
+ {
+ pItCtrl->Value >>= xStatusListener;
+ break;
+ }
+ }
+ }
+
+ return xStatusListener;
+}
+
+//-----------------------------------------------------------------------------------------------------------
+// FindTextToolbarController
+
+FindTextToolbarController::FindTextToolbarController( const css::uno::Reference< css::lang::XMultiServiceFactory >& rServiceManager )
+ :svt::ToolboxController( rServiceManager,
+ css::uno::Reference< css::frame::XFrame >(),
+ COMMAND_FINDTEXT )
+{
+}
+
+FindTextToolbarController::~FindTextToolbarController()
+{
+}
+
+// XInterface
+css::uno::Any SAL_CALL FindTextToolbarController::queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException )
+{
+ css::uno::Any a = ToolboxController::queryInterface( aType );
+ if ( a.hasValue() )
+ return a;
+
+ return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
+}
+
+void SAL_CALL FindTextToolbarController::acquire() throw ()
+{
+ ToolboxController::acquire();
+}
+
+void SAL_CALL FindTextToolbarController::release() throw ()
+{
+ ToolboxController::release();
+}
+
+// XServiceInfo
+::rtl::OUString SAL_CALL FindTextToolbarController::getImplementationName() throw( css::uno::RuntimeException )
+{
+ return getImplementationName_Static();
+}
+
+sal_Bool SAL_CALL FindTextToolbarController::supportsService( const ::rtl::OUString& ServiceName ) throw( css::uno::RuntimeException )
+{
+ const css::uno::Sequence< ::rtl::OUString > aSNL( getSupportedServiceNames() );
+ const ::rtl::OUString * pArray = aSNL.getConstArray();
+
+ for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
+ if( pArray[i] == ServiceName )
+ return true;
+
+ return false;
+}
+
+css::uno::Sequence< ::rtl::OUString > SAL_CALL FindTextToolbarController::getSupportedServiceNames() throw( css::uno::RuntimeException )
+{
+ return getSupportedServiceNames_Static();
+}
+
+css::uno::Sequence< ::rtl::OUString > FindTextToolbarController::getSupportedServiceNames_Static() throw()
+{
+ css::uno::Sequence< ::rtl::OUString > aSNS( 1 );
+ aSNS.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ) );
+ return aSNS;
+}
+
+// XComponent
+void SAL_CALL FindTextToolbarController::dispose() throw ( css::uno::RuntimeException )
+{
+ vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+
+ SearchToolbarControllersManager::createControllersManager()->freeController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
+
+ svt::ToolboxController::dispose();
+ delete m_pFindTextFieldControl;
+ m_pFindTextFieldControl = 0;
+}
+
+// XInitialization
+void SAL_CALL FindTextToolbarController::initialize( const css::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException)
+{
+ svt::ToolboxController::initialize(aArguments);
+
+ Window* pWindow = VCLUnoHelper::GetWindow( getParent() );
+ ToolBox* pToolBox = (ToolBox*)pWindow;
+ if ( pToolBox )
+ {
+ USHORT nItemCount = pToolBox->GetItemCount();
+ for ( USHORT i=0; i<nItemCount; ++i )
+ {
+ ::rtl::OUString sItemCommand = pToolBox->GetItemCommand(i);
+ if ( sItemCommand.equals( COMMAND_DOWNSEARCH ) )
+ m_nDownSearchId = i;
+ else if (sItemCommand.equals( COMMAND_UPSEARCH ))
+ m_nUpSearchId = i;
+ }
+ }
+
+ SearchToolbarControllersManager::createControllersManager()->registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
+}
+
+// XToolbarController
+void SAL_CALL FindTextToolbarController::execute( sal_Int16 /*KeyModifier*/ ) throw ( css::uno::RuntimeException )
+{
+}
+
+css::uno::Reference< css::awt::XWindow > SAL_CALL FindTextToolbarController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException )
+{
+ css::uno::Reference< css::awt::XWindow > xItemWindow;
+
+ css::uno::Reference< css::awt::XWindow > xParent( Parent );
+ Window* pParent = VCLUnoHelper::GetWindow( xParent );
+ if ( pParent )
+ {
+ ToolBox* pToolbar = ( ToolBox* )pParent;
+ m_pFindTextFieldControl = new FindTextFieldControl( pToolbar, WinBits( WB_DROPDOWN | WB_VSCROLL), m_xFrame, m_xServiceManager );
+
+ Size aSize(100, m_pFindTextFieldControl->GetTextHeight() + 200);
+ m_pFindTextFieldControl->SetSizePixel( aSize );
+ m_pFindTextFieldControl->SetModifyHdl(LINK(this, FindTextToolbarController, EditModifyHdl));
+ }
+ xItemWindow = VCLUnoHelper::GetInterface( m_pFindTextFieldControl );
+
+ return xItemWindow;
+}
+
+// XStatusListener
+void SAL_CALL FindTextToolbarController::statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException )
+{
+ vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+ if ( m_bDisposed )
+ return;
+
+ ::rtl::OUString aFeatureURL = rEvent.FeatureURL.Complete;
+ if (aFeatureURL.equalsAscii("AppendSearchHistory"))
+ {
+ m_pFindTextFieldControl->Remember_Impl(m_pFindTextFieldControl->GetText());
+ }
+}
+
+IMPL_LINK( FindTextToolbarController, EditModifyHdl, void *, EMPTYARG )
+{
+ // enable or disable item DownSearch/UpSearch of findbar
+ Window* pWindow = VCLUnoHelper::GetWindow( getParent() );
+ ToolBox* pToolBox = (ToolBox*)pWindow;
+ if ( pToolBox && m_pFindTextFieldControl )
+ {
+ if (m_pFindTextFieldControl->GetText().Len()>0)
+ {
+ if ( !pToolBox->IsItemEnabled(m_nDownSearchId) )
+ pToolBox->EnableItem(m_nDownSearchId, sal_True);
+ if ( !pToolBox->IsItemEnabled(m_nUpSearchId) )
+ pToolBox->EnableItem(m_nUpSearchId, sal_True);
+ }
+ else
+ {
+ if ( pToolBox->IsItemEnabled(m_nDownSearchId) )
+ pToolBox->EnableItem(m_nDownSearchId, sal_False);
+ if ( pToolBox->IsItemEnabled(m_nUpSearchId) )
+ pToolBox->EnableItem(m_nUpSearchId, sal_False);
+ }
+ }
+
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------
+// class DownSearchToolboxController
+
+DownSearchToolboxController::DownSearchToolboxController(const css::uno::Reference< css::lang::XMultiServiceFactory >& rServiceManager )
+ : svt::ToolboxController( rServiceManager,
+ css::uno::Reference< css::frame::XFrame >(),
+ COMMAND_DOWNSEARCH )
+{
+}
+
+DownSearchToolboxController::~DownSearchToolboxController()
+{
+}
+
+// XInterface
+css::uno::Any SAL_CALL DownSearchToolboxController::queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException )
+{
+ css::uno::Any a = ToolboxController::queryInterface( aType );
+ if ( a.hasValue() )
+ return a;
+
+ return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
+}
+
+void SAL_CALL DownSearchToolboxController::acquire() throw ()
+{
+ ToolboxController::acquire();
+}
+
+void SAL_CALL DownSearchToolboxController::release() throw ()
+{
+ ToolboxController::release();
+}
+
+// XServiceInfo
+::rtl::OUString SAL_CALL DownSearchToolboxController::getImplementationName() throw( css::uno::RuntimeException )
+{
+ return getImplementationName_Static();
+}
+
+sal_Bool SAL_CALL DownSearchToolboxController::supportsService( const ::rtl::OUString& ServiceName ) throw( css::uno::RuntimeException )
+{
+ const css::uno::Sequence< ::rtl::OUString > aSNL( getSupportedServiceNames() );
+ const ::rtl::OUString * pArray = aSNL.getConstArray();
+
+ for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
+ if( pArray[i] == ServiceName )
+ return true;
+
+ return false;
+}
+
+css::uno::Sequence< ::rtl::OUString > SAL_CALL DownSearchToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException )
+{
+ return getSupportedServiceNames_Static();
+}
+
+css::uno::Sequence< ::rtl::OUString > DownSearchToolboxController::getSupportedServiceNames_Static() throw()
+{
+ css::uno::Sequence< ::rtl::OUString > aSNS( 1 );
+ aSNS.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ));
+ return aSNS;
+}
+
+// XComponent
+void SAL_CALL DownSearchToolboxController::dispose() throw ( css::uno::RuntimeException )
+{
+ vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+
+ SearchToolbarControllersManager::createControllersManager()->freeController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
+
+ svt::ToolboxController::dispose();
+}
+
+// XInitialization
+void SAL_CALL DownSearchToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException )
+{
+ svt::ToolboxController::initialize( aArguments );
+ SearchToolbarControllersManager::createControllersManager()->registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
+}
+
+// XToolbarController
+void SAL_CALL DownSearchToolboxController::execute( sal_Int16 /*KeyModifier*/ ) throw ( css::uno::RuntimeException)
+{
+ if ( m_bDisposed )
+ throw css::lang::DisposedException();
+
+ ::rtl::OUString sFindText;
+ Window* pWindow = VCLUnoHelper::GetWindow( getParent() );
+ ToolBox* pToolBox = (ToolBox*)pWindow;
+ if ( pToolBox )
+ {
+ USHORT nItemCount = pToolBox->GetItemCount();
+ for ( USHORT i=0; i<nItemCount; ++i )
+ {
+ ::rtl::OUString sItemCommand = pToolBox->GetItemCommand(i);
+ if ( sItemCommand.equals( COMMAND_FINDTEXT ) )
+ {
+ Window* pItemWin = pToolBox->GetItemWindow(i);
+ if (pItemWin)
+ sFindText = pItemWin->GetText();
+ break;
+ }
+ }
+ }
+
+ css::uno::Sequence< css::beans::PropertyValue > lArgs(2);
+ lArgs[0].Name = SEARCHITEM_SEARCHSTRING;
+ lArgs[0].Value <<= sFindText;
+ lArgs[1].Name = SEARCHITEM_SEARCHBACKWARD;
+ lArgs[1].Value <<= sal_False;
+
+ impl_executeSearch(m_xServiceManager, m_xFrame, lArgs);
+
+ css::frame::FeatureStateEvent aEvent;
+ aEvent.FeatureURL.Complete = COMMAND_APPENDSEARCHHISTORY;
+ css::uno::Reference< css::frame::XStatusListener > xStatusListener = SearchToolbarControllersManager::createControllersManager()->findController(m_xFrame, COMMAND_FINDTEXT);
+ if (xStatusListener.is())
+ xStatusListener->statusChanged( aEvent );
+}
+
+// XStatusListener
+void SAL_CALL DownSearchToolboxController::statusChanged( const css::frame::FeatureStateEvent& /*rEvent*/ ) throw ( css::uno::RuntimeException )
+{
+ vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+ if ( m_bDisposed )
+ return;
+}
+
+//-----------------------------------------------------------------------------------------------------------
+// class UpSearchToolboxController
+
+UpSearchToolboxController::UpSearchToolboxController( const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager )
+ :svt::ToolboxController( rServiceManager,
+ css::uno::Reference< css::frame::XFrame >(),
+ COMMAND_UPSEARCH )
+{
+}
+
+UpSearchToolboxController::~UpSearchToolboxController()
+{
+}
+
+// XInterface
+css::uno::Any SAL_CALL UpSearchToolboxController::queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException )
+{
+ css::uno::Any a = ToolboxController::queryInterface( aType );
+ if ( a.hasValue() )
+ return a;
+
+ return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
+}
+
+void SAL_CALL UpSearchToolboxController::acquire() throw ()
+{
+ ToolboxController::acquire();
+}
+
+void SAL_CALL UpSearchToolboxController::release() throw ()
+{
+ ToolboxController::release();
+}
+
+// XServiceInfo
+::rtl::OUString SAL_CALL UpSearchToolboxController::getImplementationName() throw( css::uno::RuntimeException )
+{
+ return getImplementationName_Static();
+}
+
+sal_Bool SAL_CALL UpSearchToolboxController::supportsService( const ::rtl::OUString& ServiceName ) throw( css::uno::RuntimeException )
+{
+ const css::uno::Sequence< ::rtl::OUString > aSNL( getSupportedServiceNames() );
+ const ::rtl::OUString * pArray = aSNL.getConstArray();
+
+ for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
+ if( pArray[i] == ServiceName )
+ return true;
+
+ return false;
+}
+
+css::uno::Sequence< ::rtl::OUString > SAL_CALL UpSearchToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException )
+{
+ return getSupportedServiceNames_Static();
+}
+
+css::uno::Sequence< ::rtl::OUString > UpSearchToolboxController::getSupportedServiceNames_Static() throw()
+{
+ css::uno::Sequence< ::rtl::OUString > aSNS( 1 );
+ aSNS.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ) );
+ return aSNS;
+}
+
+// XComponent
+void SAL_CALL UpSearchToolboxController::dispose() throw ( css::uno::RuntimeException )
+{
+ vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+
+ SearchToolbarControllersManager::createControllersManager()->freeController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
+
+ svt::ToolboxController::dispose();
+}
+
+// XInitialization
+void SAL_CALL UpSearchToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException )
+{
+ svt::ToolboxController::initialize( aArguments );
+ SearchToolbarControllersManager::createControllersManager()->registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
+}
+
+// XToolbarController
+void SAL_CALL UpSearchToolboxController::execute( sal_Int16 /*KeyModifier*/ ) throw ( css::uno::RuntimeException )
+{
+ if ( m_bDisposed )
+ throw css::lang::DisposedException();
+
+ ::rtl::OUString sFindText;
+ Window* pWindow = VCLUnoHelper::GetWindow( getParent() );
+ ToolBox* pToolBox = (ToolBox*)pWindow;
+ if ( pToolBox )
+ {
+ USHORT nItemCount = pToolBox->GetItemCount();
+ for ( USHORT i=0; i<nItemCount; ++i )
+ {
+ ::rtl::OUString sItemCommand = pToolBox->GetItemCommand(i);
+ if ( sItemCommand.equals( COMMAND_FINDTEXT ) )
+ {
+ Window* pItemWin = pToolBox->GetItemWindow(i);
+ if (pItemWin)
+ sFindText = pItemWin->GetText();
+ break;
+ }
+ }
+ }
+
+ css::uno::Sequence< css::beans::PropertyValue > lArgs(2);
+ lArgs[0].Name = SEARCHITEM_SEARCHSTRING;
+ lArgs[0].Value <<= sFindText;
+ lArgs[1].Name = SEARCHITEM_SEARCHBACKWARD;
+ lArgs[1].Value <<= sal_True;
+
+ impl_executeSearch(m_xServiceManager, m_xFrame, lArgs);
+
+ css::frame::FeatureStateEvent aEvent;
+ aEvent.FeatureURL.Complete = COMMAND_APPENDSEARCHHISTORY;
+ css::uno::Reference< css::frame::XStatusListener > xStatusListener = SearchToolbarControllersManager::createControllersManager()->findController(m_xFrame, COMMAND_FINDTEXT);
+ if (xStatusListener.is())
+ xStatusListener->statusChanged( aEvent );
+}
+
+// XStatusListener
+void SAL_CALL UpSearchToolboxController::statusChanged( const css::frame::FeatureStateEvent& /*rEvent*/ ) throw ( css::uno::RuntimeException )
+{
+ vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+ if ( m_bDisposed )
+ return;
+}
+
+//-----------------------------------------------------------------------------------------------------------
+// class FindbarDispatcher
+
+FindbarDispatcher::FindbarDispatcher(const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory)
+ : m_xFactory( xFactory )
+{
+}
+
+FindbarDispatcher::~FindbarDispatcher()
+{
+ m_xFactory = NULL;
+ m_xFrame = NULL;
+}
+
+// XInterface
+css::uno::Any SAL_CALL FindbarDispatcher::queryInterface( const css::uno::Type& aType ) throw( css::uno::RuntimeException )
+{
+ css::uno::Any aReturn( ::cppu::queryInterface( aType,
+ static_cast< css::lang::XServiceInfo* >(this),
+ static_cast< css::lang::XInitialization* >(this),
+ static_cast< css::frame::XDispatchProvider* >(this),
+ static_cast< css::frame::XDispatch* >(this)) );
+
+ if ( aReturn.hasValue() )
+ return aReturn;
+
+ return OWeakObject::queryInterface( aType );
+}
+
+void SAL_CALL FindbarDispatcher::acquire() throw()
+{
+ OWeakObject::acquire();
+}
+
+void SAL_CALL FindbarDispatcher::release() throw()
+{
+ OWeakObject::release();
+}
+
+// XServiceInfo
+::rtl::OUString SAL_CALL FindbarDispatcher::getImplementationName() throw( css::uno::RuntimeException )
+{
+ return getImplementationName_Static();
+}
+
+sal_Bool SAL_CALL FindbarDispatcher::supportsService( const ::rtl::OUString& ServiceName ) throw( css::uno::RuntimeException )
+{
+ return (
+ ServiceName.equalsAscii("com.sun.star.comp.svx.FindbarDispatcher") ||
+ ServiceName.equalsAscii("com.sun.star.frame.ProtocolHandler")
+ );
+}
+
+css::uno::Sequence< ::rtl::OUString > SAL_CALL FindbarDispatcher::getSupportedServiceNames() throw( css::uno::RuntimeException )
+{
+ return getSupportedServiceNames_Static();
+}
+
+css::uno::Sequence< ::rtl::OUString > FindbarDispatcher::getSupportedServiceNames_Static() throw()
+{
+ css::uno::Sequence< ::rtl::OUString > aSNS( 2 );
+ aSNS.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.FindbarDispatcher" ));
+ aSNS.getArray()[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ProtocolHandler" ));
+ return aSNS;
+}
+
+// XInitialization
+void SAL_CALL FindbarDispatcher::initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException )
+{
+ if ( aArguments.getLength() )
+ aArguments[0] >>= m_xFrame;
+}
+
+// XDispatchProvider
+css::uno::Reference< css::frame::XDispatch > SAL_CALL FindbarDispatcher::queryDispatch( const css::util::URL& aURL, const ::rtl::OUString& /*sTargetFrameName*/, sal_Int32 /*nSearchFlags*/ ) throw( css::uno::RuntimeException )
+{
+ css::uno::Reference< css::frame::XDispatch > xDispatch;
+
+ if ( aURL.Protocol.equalsAscii("vnd.sun.star.findbar:") )
+ xDispatch = this;
+
+ return xDispatch;
+}
+
+css::uno::Sequence < css::uno::Reference< css::frame::XDispatch > > SAL_CALL FindbarDispatcher::queryDispatches( const css::uno::Sequence < css::frame::DispatchDescriptor >& seqDescripts ) throw( css::uno::RuntimeException )
+{
+ sal_Int32 nCount = seqDescripts.getLength();
+ css::uno::Sequence < css::uno::Reference < XDispatch > > lDispatcher( nCount );
+
+ for( sal_Int32 i=0; i<nCount; ++i )
+ lDispatcher[i] = queryDispatch( seqDescripts[i].FeatureURL, seqDescripts[i].FrameName, seqDescripts[i].SearchFlags );
+
+ return lDispatcher;
+}
+
+// XDispatch
+void SAL_CALL FindbarDispatcher::dispatch( const css::util::URL& aURL, const css::uno::Sequence < css::beans::PropertyValue >& /*lArgs*/ ) throw( css::uno::RuntimeException )
+{
+ //vnd.sun.star.findbar:FocusToFindbar - set cursor to the FindTextFieldControl of the findbar
+ if ( aURL.Path.equalsAscii("FocusToFindbar") )
+ {
+ css::uno::Reference< css::beans::XPropertySet > xPropSet(m_xFrame, css::uno::UNO_QUERY);
+ if(!xPropSet.is())
+ return;
+
+ css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
+ css::uno::Any aValue = xPropSet->getPropertyValue( ::rtl::OUString::createFromAscii("LayoutManager") );
+ aValue >>= xLayoutManager;
+ if (!xLayoutManager.is())
+ return;
+
+ const ::rtl::OUString sResourceURL = ::rtl::OUString::createFromAscii("private:resource/toolbar/findbar");
+ css::uno::Reference< css::ui::XUIElement > xUIElement = xLayoutManager->getElement(sResourceURL);
+ if (!xUIElement.is())
+ return;
+
+ css::uno::Reference< css::awt::XWindow > xWindow(xUIElement->getRealInterface(), css::uno::UNO_QUERY);
+ Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
+ ToolBox* pToolBox = (ToolBox*)pWindow;
+ if ( pToolBox )
+ {
+ USHORT nItemCount = pToolBox->GetItemCount();
+ for ( USHORT i=0; i<nItemCount; ++i )
+ {
+ ::rtl::OUString sItemCommand = pToolBox->GetItemCommand(i);
+ if ( sItemCommand.equalsAscii(".uno:FindText") )
+ {
+ Window* pItemWin = pToolBox->GetItemWindow( i );
+ if ( pItemWin )
+ {
+ pItemWin->GrabFocus();
+ return;
+ }
+ }
+ }
+ }
+
+ }
+}
+
+void SAL_CALL FindbarDispatcher::addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& /*xControl*/, const css::util::URL& /*aURL*/ ) throw ( css::uno::RuntimeException )
+{
+}
+
+void SAL_CALL FindbarDispatcher::removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& /*xControl*/, const css::util::URL& /*aURL*/ ) throw ( css::uno::RuntimeException )
+{
+}
+
+//-----------------------------------------------------------------------------------------------------------
+// create Instance
+
+css::uno::Reference< css::uno::XInterface > SAL_CALL FindTextToolbarController_createInstance(
+ const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr )
+{
+ return *new FindTextToolbarController( rSMgr );
+}
+
+css::uno::Reference< css::uno::XInterface > SAL_CALL DownSearchToolboxController_createInstance(
+ const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr )
+{
+ return *new DownSearchToolboxController( rSMgr );
+}
+
+css::uno::Reference< css::uno::XInterface > SAL_CALL UpSearchToolboxController_createInstance(
+ const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr )
+{
+ return *new UpSearchToolboxController( rSMgr );
+}
+
+css::uno::Reference< css::uno::XInterface > SAL_CALL FindbarDispatcher_createInstance(
+ const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr )
+{
+ return *new FindbarDispatcher( rSMgr );
+}
+
+//-----------------------------------------------------------------------------------------------------------
+}
diff --git a/svx/source/tbxctrls/toolbarmenu.cxx b/svx/source/tbxctrls/toolbarmenu.cxx
deleted file mode 100644
index 3875e0471c7d..000000000000
--- a/svx/source/tbxctrls/toolbarmenu.cxx
+++ /dev/null
@@ -1,1029 +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.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <vcl/menu.hxx>
-#include <vcl/decoview.hxx>
-#include <vcl/image.hxx>
-
-#include "toolbarmenu.hxx"
-
-const int EXTRAITEMHEIGHT = 4;
-const int SEPARATOR_HEIGHT = 8;
-
-class ToolbarMenuEntry
-{
-public:
- int mnEntryId;
- MenuItemBits mnBits;
- Size maSize;
-
- bool mbHasText;
- bool mbHasImage;
- bool mbHasControl;
- bool mbChecked;
- bool mbEnabled;
-
- String maText;
- Image maImage;
- Control* mpControl;
-
-public:
- ToolbarMenuEntry( int nEntryId, const String& rText, MenuItemBits nBits );
- ToolbarMenuEntry( int nEntryId, const Image& rImage, MenuItemBits nBits );
- ToolbarMenuEntry( int nEntryId, const Image& rImage, const String& rText, MenuItemBits nBits );
- ToolbarMenuEntry( int nEntryId, Control* pControl, MenuItemBits nBits );
- ToolbarMenuEntry( int nEntryId, const String& rText, Control* pControl, MenuItemBits nBits );
- ~ToolbarMenuEntry();
-
- void init( int nEntryId, MenuItemBits nBits );
-};
-
-void ToolbarMenuEntry::init( int nEntryId, MenuItemBits nBits )
-{
- mnEntryId = nEntryId;
- mnBits = nBits;
-
- mbHasText = false;
- mbHasImage = false;
- mbHasControl = false;
- mbChecked = false;
- mbEnabled = true;
-
- mpControl = NULL;
-}
-
-ToolbarMenuEntry::ToolbarMenuEntry( int nEntryId, const String& rText, MenuItemBits nBits )
-{
- init( nEntryId, nBits );
-
- maText = rText;
- mbHasText = true;
-}
-
-ToolbarMenuEntry::ToolbarMenuEntry( int nEntryId, const Image& rImage, MenuItemBits nBits )
-{
- init( nEntryId, nBits );
-
- maImage = rImage;
- mbHasImage = true;
-}
-
-ToolbarMenuEntry::ToolbarMenuEntry( int nEntryId, const Image& rImage, const String& rText, MenuItemBits nBits )
-{
- init( nEntryId, nBits );
-
- maText = rText;
- mbHasText = true;
-
- maImage = rImage;
- mbHasImage = true;
-}
-
-ToolbarMenuEntry::ToolbarMenuEntry( int nEntryId, Control* pControl, MenuItemBits nBits )
-{
- init( nEntryId, nBits );
-
- if( pControl )
- {
- mpControl = pControl;
- mpControl->Show();
- }
-}
-
-ToolbarMenuEntry::ToolbarMenuEntry( int nEntryId, const String& rText, Control* pControl, MenuItemBits nBits )
-{
- init( nEntryId, nBits );
-
- maText = rText;
- mbHasText = true;
-
- if( pControl )
- {
- mpControl = pControl;
- mpControl->Show();
- }
-}
-
-ToolbarMenuEntry::~ToolbarMenuEntry()
-{
- delete mpControl;
-}
-
-ToolbarMenu::ToolbarMenu( Window* pParent, WinBits nStyle ) :
- Control( pParent, nStyle )
-{
- mnCheckPos = 0;
- mnImagePos = 0;
- mnTextPos = 0;
-
- mnHighlightedEntry = -1;
- mnSelectedEntry = -1;
- initWindow();
-}
-
-ToolbarMenu::~ToolbarMenu()
-{
- // delete all menu entries
- const int nEntryCount = maEntryVector.size();
- int nEntry;
- for( nEntry = 0; nEntry < nEntryCount; nEntry++ )
- {
- delete maEntryVector[nEntry];
- }
-}
-
-int ToolbarMenu::getSelectedEntryId() const
-{
- ToolbarMenuEntry* pEntry = implGetEntry( mnSelectedEntry );
- return pEntry ? pEntry->mnEntryId : -1;
-}
-
-int ToolbarMenu::getHighlightedEntryId() const
-{
- ToolbarMenuEntry* pEntry = implGetEntry( mnHighlightedEntry );
- return pEntry ? pEntry->mnEntryId : -1;
-}
-
-void ToolbarMenu::checkEntry( int nEntryId, bool bChecked )
-{
- ToolbarMenuEntry* pEntry = implSearchEntry( nEntryId );
- if( pEntry && pEntry->mbChecked != bChecked )
- {
- pEntry->mbChecked = bChecked;
- Invalidate();
- }
-}
-
-bool ToolbarMenu::isEntryChecked( int nEntryId ) const
-{
- ToolbarMenuEntry* pEntry = implSearchEntry( nEntryId );
- return pEntry && pEntry->mbChecked;
-}
-
-void ToolbarMenu::enableEntry( int nEntryId, bool bEnable )
-{
- ToolbarMenuEntry* pEntry = implSearchEntry( nEntryId );
- if( pEntry && pEntry->mbEnabled != bEnable )
- {
- pEntry->mbEnabled = bEnable;
- if( pEntry->mpControl )
- {
- pEntry->mpControl->Enable( bEnable );
-
- // hack for the valueset to make it paint itself anew
- pEntry->mpControl->Resize();
- }
- Invalidate();
- }
-}
-
-bool ToolbarMenu::isEntryEnabled( int nEntryId ) const
-{
- ToolbarMenuEntry* pEntry = implSearchEntry( nEntryId );
- return pEntry && pEntry->mbEnabled;
-}
-
-void ToolbarMenu::setEntryText( int nEntryId, const String& rStr )
-{
- ToolbarMenuEntry* pEntry = implSearchEntry( nEntryId );
- if( pEntry && pEntry->maText != rStr )
- {
- pEntry->maText = rStr;
- maSize = implCalcSize();
- if( IsVisible() )
- Invalidate();
- }
-}
-
-const String& ToolbarMenu::getEntryText( int nEntryId ) const
-{
- ToolbarMenuEntry* pEntry = implSearchEntry( nEntryId );
- if( pEntry )
- return pEntry->maText;
- else
- {
- static String aEmptyStr;
- return aEmptyStr;
- }
-}
-
-void ToolbarMenu::setEntryImage( int nEntryId, const Image& rImage )
-{
- ToolbarMenuEntry* pEntry = implSearchEntry( nEntryId );
- if( pEntry && pEntry->maImage != rImage )
- {
- pEntry->maImage = rImage;
- maSize = implCalcSize();
- if( IsVisible() )
- Invalidate();
- }
-}
-
-const Image& ToolbarMenu::getEntryImage( int nEntryId ) const
-{
- ToolbarMenuEntry* pEntry = implSearchEntry( nEntryId );
- if( pEntry )
- return pEntry->maImage;
- else
- {
- static Image aEmptyImage;
- return aEmptyImage;
- }
-}
-
-void ToolbarMenu::initWindow()
-{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-
- SetPointFont( rStyleSettings.GetMenuFont() );
- SetBackground( Wallpaper( rStyleSettings.GetMenuColor() ) );
- SetTextColor( rStyleSettings.GetMenuTextColor() );
- SetTextFillColor();
- SetLineColor();
-
- maSize = implCalcSize();
-}
-
-Size ToolbarMenu::implCalcSize()
-{
- const long nFontHeight = GetTextHeight();
- long nExtra = nFontHeight/4;
-
- Size aSz;
- Size aMaxImgSz;
- long nMaxTextWidth = 0;
- long nMinMenuItemHeight = nFontHeight;
- sal_Bool bCheckable = sal_False;
-
- const int nEntryCount = maEntryVector.size();
- int nEntry;
-
- const StyleSettings& rSettings = GetSettings().GetStyleSettings();
- if ( rSettings.GetUseImagesInMenus() )
- {
- nMinMenuItemHeight = 16;
-
- for( nEntry = 0; nEntry < nEntryCount; nEntry++ )
- {
- ToolbarMenuEntry* pEntry = maEntryVector[nEntry];
- if( pEntry && pEntry->mbHasImage )
- {
- Size aImgSz = pEntry->maImage.GetSizePixel();
- if ( aImgSz.Height() > aMaxImgSz.Height() )
- aMaxImgSz.Height() = aImgSz.Height();
- if ( aImgSz.Height() > nMinMenuItemHeight )
- nMinMenuItemHeight = aImgSz.Height();
- break;
- }
- }
- }
-
- for( nEntry = 0; nEntry < nEntryCount; nEntry++ )
- {
- ToolbarMenuEntry* pEntry = maEntryVector[nEntry];
-
- if( pEntry )
- {
- pEntry->maSize.Height() = 0;
- pEntry->maSize.Width() = 0;
-
-
- if ( ( pEntry->mnBits ) & ( MIB_RADIOCHECK | MIB_CHECKABLE ) )
- bCheckable = sal_True;
-
- // Image:
- if( pEntry->mbHasImage )
- {
- Size aImgSz = pEntry->maImage.GetSizePixel();
- if ( (aImgSz.Width() + 4) > aMaxImgSz.Width() )
- aMaxImgSz.Width() = aImgSz.Width() + 4;
- if ( (aImgSz.Height() + 4) > aMaxImgSz.Height() )
- aMaxImgSz.Height() = aImgSz.Height() + 4;
- if ( (aImgSz.Height() + 4) > pEntry->maSize.Height() )
- pEntry->maSize.Height() = aImgSz.Height() + 4;
- }
- }
- }
-
- int gfxExtra = Max( nExtra, 7L );
-
- mnCheckPos = nExtra;
-// mnImagePos = mnCheckPos + nFontHeight/2 + gfxExtra;
- mnImagePos = nExtra;
- mnTextPos = mnImagePos + aMaxImgSz.Width();
-
- for( nEntry = 0; nEntry < nEntryCount; nEntry++ )
- {
- ToolbarMenuEntry* pEntry = maEntryVector[nEntry];
-
- if( pEntry )
- {
- // Text:
- if( pEntry->mbHasText )
- {
- long nTextWidth = GetCtrlTextWidth( pEntry->maText );
- if ( nTextWidth > nMaxTextWidth )
- nMaxTextWidth = nTextWidth;
- long nTextHeight = GetTextHeight();
-
- pEntry->maSize.Height() = Max( Max( nTextHeight, pEntry->maSize.Height() ), nMinMenuItemHeight );
- }
-
- // Control:
- if( pEntry->mpControl )
- {
- long nTextWidth = pEntry->mbHasText ? GetCtrlTextWidth( pEntry->maText ) : -mnTextPos;
-
- Size aControlSize( pEntry->mpControl->GetOutputSizePixel() );
-
- if( nTextWidth )
- nTextWidth += nExtra;
-
- nTextWidth += aControlSize.Width();
-
- if ( nTextWidth > nMaxTextWidth )
- nMaxTextWidth = nTextWidth;
-
- if ( aControlSize.Height() > pEntry->maSize.Height() )
- pEntry->maSize.Height() = aControlSize.Height();
- }
-
- pEntry->maSize.Height() += EXTRAITEMHEIGHT;
-
- aSz.Height() += pEntry->maSize.Height();
- }
- else
- {
- aSz.Height() += SEPARATOR_HEIGHT;
- }
- }
-
- if ( aMaxImgSz.Width() )
- mnTextPos += gfxExtra;
- if ( bCheckable )
- mnTextPos += 16;
-
-
- aSz.Width() = mnTextPos + nMaxTextWidth;
- aSz.Width() += 2*nExtra;
-
- // positionate controls
- int nY = 0;
- for( nEntry = 0; nEntry < nEntryCount; nEntry++ )
- {
- ToolbarMenuEntry* pEntry = maEntryVector[nEntry];
-
- if( pEntry )
- {
- if( pEntry->mpControl )
- {
- Size aControlSize( pEntry->mpControl->GetOutputSizePixel() );
- Point aControlPos( pEntry->mbHasText ? mnTextPos : ( aSz.Width() - aControlSize.Width() ) / 2, nY);
- if( pEntry->mbHasText )
- aControlPos.X() += GetCtrlTextWidth( pEntry->maText ) + 4*gfxExtra;
-
- pEntry->mpControl->SetPosPixel( aControlPos );
- }
-
- nY += pEntry->maSize.Height();
- }
- else
- {
- nY += SEPARATOR_HEIGHT;
- }
- }
-
- return aSz;
-}
-
-void ToolbarMenu::GetFocus()
-{
-/*
- if( mnHighlightedEntry == -1 )
- {
- implChangeHighlightEntry( 0 );
- }
-*/
- Control::GetFocus();
-}
-
-void ToolbarMenu::LoseFocus()
-{
- if( mnHighlightedEntry != -1 )
- {
- implChangeHighlightEntry( -1 );
- }
- Control::LoseFocus();
-}
-
-void ToolbarMenu::appendEntry( int nEntryId, const String& rStr, MenuItemBits nItemBits )
-{
- appendEntry( new ToolbarMenuEntry( nEntryId, rStr, nItemBits ) );
-}
-
-void ToolbarMenu::appendEntry( int nEntryId, const Image& rImage, MenuItemBits nItemBits )
-{
- appendEntry( new ToolbarMenuEntry( nEntryId, rImage, nItemBits ) );
-}
-
-void ToolbarMenu::appendEntry( int nEntryId, const String& rStr, const Image& rImage, MenuItemBits nItemBits )
-{
- appendEntry( new ToolbarMenuEntry( nEntryId, rImage, rStr, nItemBits ) );
-}
-
-void ToolbarMenu::appendEntry( int nEntryId, Control* pControl, MenuItemBits nItemBits )
-{
- appendEntry( new ToolbarMenuEntry( nEntryId, pControl, nItemBits ) );
-}
-
-void ToolbarMenu::appendEntry( int nEntryId, const String& rStr, Control* pControl, MenuItemBits nItemBits )
-{
- appendEntry( new ToolbarMenuEntry( nEntryId, rStr, pControl, nItemBits ) );
-}
-
-void ToolbarMenu::appendEntry( ToolbarMenuEntry* pEntry )
-{
- maEntryVector.push_back( pEntry );
- maSize = implCalcSize();
- if( IsVisible() )
- Invalidate();
-}
-
-void ToolbarMenu::appendSeparator()
-{
- appendEntry( 0 );
-}
-
-void ToolbarMenu::Resize()
-{
- Window::Resize();
-}
-
-ToolbarMenuEntry* ToolbarMenu::implGetEntry( int nEntry ) const
-{
- if( (nEntry < 0) || (nEntry >= (int)maEntryVector.size() ) )
- return NULL;
-
- return maEntryVector[nEntry];
-}
-
-ToolbarMenuEntry* ToolbarMenu::implSearchEntry( int nEntryId ) const
-{
- const int nEntryCount = maEntryVector.size();
- int nEntry;
- for( nEntry = 0; nEntry < nEntryCount; nEntry++ )
- {
- ToolbarMenuEntry* p = maEntryVector[nEntry];
- if( p && p->mnEntryId == nEntryId )
- {
- return p;
- }
- }
-
- return NULL;
-}
-
-void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight )
-{
- Size aSz = GetOutputSizePixel();
- long nY = 0;
- long nX = 0;
-
- const int nEntryCount = maEntryVector.size();
- int nEntry;
- for( nEntry = 0; nEntry < nEntryCount; nEntry++ )
- {
- ToolbarMenuEntry* p = maEntryVector[nEntry];
- if( p )
- {
- if(nEntry == nHighlightEntry)
- {
-// bool bRestoreLineColor = false;
- Color oldLineColor;
-/*
- if( bHighlight && ((p->mpControl == NULL) || (p->mbHasText)) )
- {
- if( p->mbEnabled )
- {
- SetFillColor( GetSettings().GetStyleSettings().GetMenuHighlightColor() );
- }
- else
- {
- SetFillColor();
- oldLineColor = GetLineColor();
- SetLineColor( GetSettings().GetStyleSettings().GetMenuHighlightColor() );
- bRestoreLineColor = true;
- }
- }
- else
-*/
- SetFillColor( GetSettings().GetStyleSettings().GetMenuColor() );
-
- Rectangle aRect( Point( nX, nY ), Size( aSz.Width(), p->maSize.Height() ) );
- if( p->mnBits & MIB_POPUPSELECT )
- {
- long nFontHeight = GetTextHeight();
- aRect.Right() -= nFontHeight + nFontHeight/4;
- }
- DrawRect( aRect );
- implPaint( p, bHighlight );
-
- if( bHighlight && ((p->mpControl == NULL) || (p->mbHasText)) )
- {
- aRect.nLeft += 1;
- aRect.nTop += 1;
- aRect.nBottom -= 1;
- aRect.nRight -= 1;
- DrawSelectionBackground( aRect, true, false, TRUE, TRUE );
- }
-/*
- if( bRestoreLineColor )
- SetLineColor( oldLineColor );
-*/
- maHighlightHdl.Call( this );
- break;
- }
-
- nY += p->maSize.Height();
- }
- else
- {
- nY += SEPARATOR_HEIGHT;
- }
- }
-}
-
-void ToolbarMenu::implSelectEntry( int nSelectedEntry )
-{
- mnSelectedEntry = nSelectedEntry;
-
- ToolbarMenuEntry* pEntry = NULL;
- if( nSelectedEntry != -1 )
- pEntry = maEntryVector[ nSelectedEntry ];
-
- if( pEntry )
- maSelectHdl.Call( this );
-}
-
-void ToolbarMenu::MouseButtonDown( const MouseEvent& rMEvt )
-{
- implHighlightEntry( rMEvt, true );
-
- implSelectEntry( mnHighlightedEntry );
-}
-
-void ToolbarMenu::MouseButtonUp( const MouseEvent& )
-{
-}
-
-void ToolbarMenu::MouseMove( const MouseEvent& rMEvt )
-{
- if ( !IsVisible() )
- return;
-
- implHighlightEntry( rMEvt, false );
-}
-
-void ToolbarMenu::implHighlightEntry( const MouseEvent& rMEvt, bool bMBDown )
-{
- long nY = 0;
- long nMouseY = rMEvt.GetPosPixel().Y();
- Size aOutSz = GetOutputSizePixel();
- if ( ( nMouseY >= 0 ) && ( nMouseY < aOutSz.Height() ) )
- {
- bool bHighlighted = FALSE;
-
- const int nEntryCount = maEntryVector.size();
- int nEntry;
- for( nEntry = 0; nEntry < nEntryCount; nEntry++ )
- {
- ToolbarMenuEntry* pEntry = maEntryVector[nEntry];
- if( pEntry )
- {
- long nOldY = nY;
- nY += pEntry->maSize.Height();
- if ( ( nOldY <= nMouseY ) && ( nY > nMouseY ) )
- {
- if( bMBDown )
- {
- if( nEntry != mnHighlightedEntry )
- {
- implChangeHighlightEntry( nEntry );
- }
- }
- else
- {
- if ( nEntry != mnHighlightedEntry )
- {
- implChangeHighlightEntry( nEntry );
- }
- }
- bHighlighted = true;
- }
- }
- else
- {
- nY += SEPARATOR_HEIGHT;
- }
- }
- if ( !bHighlighted )
- implChangeHighlightEntry( -1 );
- }
- else
- {
- implChangeHighlightEntry( -1 );
- }
-}
-
-void ToolbarMenu::implChangeHighlightEntry( int nEntry )
-{
- if( mnHighlightedEntry != -1 )
- {
- implHighlightEntry( mnHighlightedEntry, false );
- }
-
- mnHighlightedEntry = nEntry;
- if( mnHighlightedEntry != -1 )
- {
- implHighlightEntry( mnHighlightedEntry, true );
- }
-}
-
-ToolbarMenuEntry* ToolbarMenu::implCursorUpDown( bool bUp, bool bHomeEnd )
-{
- int n = mnHighlightedEntry;
- if( n == -1 )
- {
- if( bUp )
- n = 0;
- else
- n = maEntryVector.size()-1;
- }
-
- int nLoop = n;
-
- if( bHomeEnd )
- {
- // absolute positioning
- if( bUp )
- {
- n = maEntryVector.size();
- nLoop = n-1;
- }
- else
- {
- n = -1;
- nLoop = n+1;
- }
- }
-
- do
- {
- if( bUp )
- {
- if ( n )
- n--;
- else
- if( mnHighlightedEntry == -1 )
- n = maEntryVector.size()-1;
-// else
-// break;
- }
- else
- {
- if( n < ((int)maEntryVector.size()-1) )
- n++;
- else
- if( mnHighlightedEntry == -1 )
- n = 0;
-// else
-// break;
- }
-
- ToolbarMenuEntry* pData = maEntryVector[n];
- if( pData )
- {
- implChangeHighlightEntry( n );
- return pData;
- }
- } while ( n != nLoop );
-
- return 0;
-}
-
-void ToolbarMenu::KeyInput( const KeyEvent& rKEvent )
-{
- USHORT nCode = rKEvent.GetKeyCode().GetCode();
- switch ( nCode )
- {
- case KEY_UP:
- case KEY_DOWN:
- {
- int nOldEntry = mnHighlightedEntry;
- ToolbarMenuEntry*p = implCursorUpDown( nCode == KEY_UP, false );
- if( p && p->mpControl && !p->mbHasText )
- {
- p->mpControl->GrabFocus();
- if( nOldEntry != mnHighlightedEntry )
- {
- KeyCode aKeyCode( (nCode == KEY_UP) ? KEY_END : KEY_HOME );
- KeyEvent aKeyEvent( 0, aKeyCode );
- p->mpControl->KeyInput( aKeyEvent );
- }
- }
- }
- break;
- case KEY_END:
- case KEY_HOME:
- {
- ToolbarMenuEntry* p = implCursorUpDown( nCode == KEY_END, true );
- if( p && p->mpControl && !p->mbHasText )
- {
- p->mpControl->GrabFocus();
- KeyCode aKeyCode( KEY_HOME );
- KeyEvent aKeyEvent( 0, aKeyCode );
- p->mpControl->KeyInput( aKeyEvent );
- }
- }
- break;
- case KEY_F6:
- case KEY_ESCAPE:
- {
- // Ctrl-F6 acts like ESC here, the menu bar however will then put the focus in the document
- if( nCode == KEY_F6 && !rKEvent.GetKeyCode().IsMod1() )
- break;
-
- implSelectEntry( -1 );
-/*
- if ( !pMenu->pStartedFrom )
- {
- StopExecute();
- KillActivePopup();
- }
- else if ( pMenu->pStartedFrom->bIsMenuBar )
- {
- // Forward...
- ((MenuBarWindow*)((MenuBar*)pMenu->pStartedFrom)->ImplGetWindow())->KeyInput( rKEvent );
- }
- else
- {
- StopExecute();
- ToolbarMenu* pFloat = ((PopupMenu*)pMenu->pStartedFrom)->ImplGetFloatingWindow();
- pFloat->GrabFocus();
- pFloat->KillActivePopup();
- }
-*/
- }
- break;
-
- case KEY_RETURN:
- {
- ToolbarMenuEntry* pEntry = implGetEntry( mnHighlightedEntry );
- if ( pEntry && pEntry->mbEnabled )
- {
- if( pEntry->mpControl )
- {
- pEntry->mpControl->GrabFocus();
- }
- else
- {
- implSelectEntry( mnHighlightedEntry );
- }
- }
- // else
- // StopExecute();
- }
- break;
- default:
- {
-/*
- xub_Unicode nCharCode = rKEvent.GetCharCode();
- USHORT nPos;
- USHORT nDuplicates = 0;
- MenuItemData* pData = nCharCode ? pMenu->GetItemList()->SearchItem( nCharCode, nPos, nDuplicates, nHighlightedItem ) : NULL;
- if ( pData )
- {
- if ( pData->pSubMenu || nDuplicates > 1 )
- {
- implChangeHighlightEntry( nPos );
- HighlightChanged( 0 );
- }
- else
- {
- nHighlightedItem = nPos;
- EndExecute();
- }
- }
- else
- {
- // Bei ungueltigen Tasten Beepen, aber nicht bei HELP und F-Tasten
- if ( !rKEvent.GetKeyCode().IsControlMod() && ( nCode != KEY_HELP ) && ( rKEvent.GetKeyCode().GetGroup() != KEYGROUP_FKEYS ) )
- Sound::Beep();
- FloatingWindow::KeyInput( rKEvent );
- }
- */
- }
- }
-}
-
-void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted )
-{
- const long nFontHeight = GetTextHeight();
- const long nExtra = nFontHeight/4;
-
- DecorationView aDecoView( this );
- const StyleSettings& rSettings = GetSettings().GetStyleSettings();
-
- const Size aOutSz( GetOutputSizePixel() );
-// const long nMaxY = aOutSz.Height();
-
- Point aTopLeft, aTmpPos;
-
- const int nEntryCount = maEntryVector.size();
- int nEntry;
- for( nEntry = 0; nEntry < nEntryCount; nEntry++ )
- {
- ToolbarMenuEntry* pEntry = maEntryVector[nEntry];
- Point aPos( aTopLeft );
-
- USHORT nTextStyle = 0;
- USHORT nSymbolStyle = 0;
- USHORT nImageStyle = 0;
- if( pEntry && !pEntry->mbEnabled )
- {
- nTextStyle |= TEXT_DRAW_DISABLE;
- nSymbolStyle |= SYMBOL_DRAW_DISABLE;
- nImageStyle |= IMAGE_DRAW_DISABLE;
- }
-
- // Separator
- if( pEntry == NULL )
- {
- if( pThisOnly == NULL )
- {
- aTmpPos.Y() = aPos.Y() + ((SEPARATOR_HEIGHT-2)/2);
- aTmpPos.X() = aPos.X() + 2;
-
- SetLineColor( rSettings.GetShadowColor() );
- DrawLine( aTmpPos, Point( aOutSz.Width() - 3, aTmpPos.Y() ) );
- aTmpPos.Y()++;
- SetLineColor( rSettings.GetLightColor() );
- DrawLine( aTmpPos, Point( aOutSz.Width() - 3, aTmpPos.Y() ) );
- SetLineColor();
- }
-
- aTopLeft.Y() += SEPARATOR_HEIGHT;
- }
- else
- {
- if( !pThisOnly || ( pEntry == pThisOnly ) )
- {
- if( pThisOnly && bHighlighted )
- SetTextColor( rSettings.GetMenuHighlightTextColor() );
-
- long nTextOffsetY = ((pEntry->maSize.Height()-nFontHeight)/2);
-
- // Image
- if( pEntry->mbHasImage )
- {
- aTmpPos.X() = aPos.X() + mnImagePos;
- aTmpPos.Y() = aPos.Y();
- aTmpPos.Y() += (pEntry->maSize.Height()-pEntry->maImage.GetSizePixel().Height())/2;
- DrawImage( aTmpPos, pEntry->maImage, nImageStyle );
- }
- // Text:
- if( pEntry->mbHasText )
- {
- aTmpPos.X() = aPos.X() + mnTextPos;
- aTmpPos.Y() = aPos.Y();
- aTmpPos.Y() += nTextOffsetY;
- USHORT nStyle = nTextStyle|TEXT_DRAW_MNEMONIC;
-
- DrawCtrlText( aTmpPos, pEntry->maText, 0, pEntry->maText.Len(), nStyle );
- }
- // CheckMark
- if( pEntry->mbChecked )
- {
- if( pEntry->mbHasImage )
- {
- aTmpPos.X() = aPos.X() + mnImagePos;
- aTmpPos.Y() = aPos.Y();
- aTmpPos.Y() += (pEntry->maSize.Height()-pEntry->maImage.GetSizePixel().Height())/2;
-
- Rectangle aRect( aTmpPos, pEntry->maImage.GetSizePixel() );
- aRect.nLeft -= 2;
- aRect.nTop -= 2;
- aRect.nRight += 2;
- aRect.nBottom += 2;
- DrawSelectionBackground( aRect, false, true, TRUE, TRUE );
- }
- else
- {
- Rectangle aRect;
- SymbolType eSymbol;
- aTmpPos.Y() = aPos.Y();
- aTmpPos.Y() += nExtra/2;
- aTmpPos.Y() += pEntry->maSize.Height() / 2;
- if ( pEntry->mnBits & MIB_RADIOCHECK )
- {
- aTmpPos.X() = aPos.X() + mnCheckPos;
- eSymbol = SYMBOL_RADIOCHECKMARK;
- aTmpPos.Y() -= nFontHeight/4;
- aRect = Rectangle( aTmpPos, Size( nFontHeight/2, nFontHeight/2 ) );
- }
- else
- {
- aTmpPos.X() = aPos.X() + mnCheckPos;
- eSymbol = SYMBOL_CHECKMARK;
- aTmpPos.Y() -= nFontHeight/4;
- aRect = Rectangle( aTmpPos, Size( (nFontHeight*25)/40, nFontHeight/2 ) );
- }
- aDecoView.DrawSymbol( aRect, eSymbol, GetTextColor(), nSymbolStyle );
- }
- }
-
- if( pThisOnly && bHighlighted )
- SetTextColor( rSettings.GetMenuTextColor() );
- }
-
- aTopLeft.Y() += pEntry->maSize.Height();
- }
- }
-}
-
-void ToolbarMenu::Paint( const Rectangle& )
-{
- implPaint();
-
- if( mnHighlightedEntry != -1 )
- implHighlightEntry( mnHighlightedEntry, true );
-}
-
-void ToolbarMenu::RequestHelp( const HelpEvent& rHEvt )
-{
- Window::RequestHelp( rHEvt );
-}
-
-void ToolbarMenu::StateChanged( StateChangedType nType )
-{
- Control::StateChanged( nType );
-
- if ( ( nType == STATE_CHANGE_CONTROLFOREGROUND ) || ( nType == STATE_CHANGE_CONTROLBACKGROUND ) )
- {
- initWindow();
- Invalidate();
- }
-}
-
-void ToolbarMenu::DataChanged( const DataChangedEvent& rDCEvt )
-{
- Control::DataChanged( rDCEvt );
-
- if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
- (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
- ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
- (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
- {
- initWindow();
- Invalidate();
- }
-}
-
-void ToolbarMenu::Command( const CommandEvent& rCEvt )
-{
- if ( rCEvt.GetCommand() == COMMAND_WHEEL )
- {
- const CommandWheelData* pData = rCEvt.GetWheelData();
- if( !pData->GetModifier() && ( pData->GetMode() == COMMAND_WHEEL_SCROLL ) )
- {
- implCursorUpDown( pData->GetDelta() > 0L, false );
- }
- }
-}
diff --git a/svx/source/tbxctrls/toolbarmenu.hxx b/svx/source/tbxctrls/toolbarmenu.hxx
deleted file mode 100644
index 30f56c92b943..000000000000
--- a/svx/source/tbxctrls/toolbarmenu.hxx
+++ /dev/null
@@ -1,90 +0,0 @@
-#include <vcl/ctrl.hxx>
-
-#include <vector>
-
-class ToolbarMenuEntry;
-typedef std::vector< ToolbarMenuEntry * > ToolbarMenuEntryVector;
-
-class ToolbarMenu : public Control
-{
-private:
- ToolbarMenuEntryVector maEntryVector;
-
- int mnCheckPos;
- int mnImagePos;
- int mnTextPos;
-
- int mnHighlightedEntry;
- int mnSelectedEntry;
-
- Size maSize;
-
- Link maHighlightHdl;
- Link maSelectHdl;
-
- void StateChanged( StateChangedType nType );
- void DataChanged( const DataChangedEvent& rDCEvt );
-
- void initWindow();
-
- Size implCalcSize();
-
- void appendEntry( ToolbarMenuEntry* pEntry );
-
- void implPaint( ToolbarMenuEntry* pThisOnly = NULL, bool bHighlight = false );
-
- void implHighlightEntry( int nHighlightEntry, bool bHighlight );
- void implHighlightEntry( const MouseEvent& rMEvt, bool bMBDown );
-
- void implChangeHighlightEntry( int nEntry );
- void implSelectEntry( int nSelectedEntry );
-
- ToolbarMenuEntry* implCursorUpDown( bool bUp, bool bHomeEnd );
- ToolbarMenuEntry* implGetEntry( int nEntry ) const;
- ToolbarMenuEntry* implSearchEntry( int nEntryId ) const;
-
-public:
- ToolbarMenu( Window* pParent, WinBits nStyle );
- ~ToolbarMenu();
-
- virtual void MouseMove( const MouseEvent& rMEvt );
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual void MouseButtonUp( const MouseEvent& rMEvt );
- virtual void KeyInput( const KeyEvent& rKEvent );
- virtual void Command( const CommandEvent& rCEvt );
- virtual void Paint( const Rectangle& rRect );
- virtual void RequestHelp( const HelpEvent& rHEvt );
- virtual void Resize();
- virtual void GetFocus();
- virtual void LoseFocus();
-
- void appendEntry( int nEntryId, const String& rStr, MenuItemBits nItemBits = 0 );
- void appendEntry( int nEntryId, const Image& rImage, MenuItemBits nItemBits = 0 );
- void appendEntry( int nEntryId, const String& rStr, const Image& rImage, MenuItemBits nItemBits = 0 );
- void appendEntry( int nEntryId, Control* pControl, MenuItemBits nItemBits = 0 );
- void appendEntry( int nEntryId, const String& rStr, Control* pControl, MenuItemBits nItemBits = 0 );
- void appendSeparator();
-
- void checkEntry( int nEntryId, bool bCheck = true );
- bool isEntryChecked( int nEntryId ) const;
-
- void enableEntry( int nEntryId, bool bEnable = true );
- bool isEntryEnabled( int nEntryId ) const;
-
- void setEntryText( int nEntryId, const String& rStr );
- const String& getEntryText( int nEntryId ) const;
-
- void setEntryImage( int nEntryId, const Image& rImage );
- const Image& getEntryImage( int nEntryId ) const;
-
- const Size& getMenuSize() const { return maSize; }
-
- void SetHighlightHdl( const Link& rLink ) { maHighlightHdl = rLink; }
- const Link& GetHighlightHdl() const { return maHighlightHdl; }
-
- void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
- const Link& GetSelectHdl() const { return maSelectHdl; }
-
- int getSelectedEntryId() const;
- int getHighlightedEntryId() const;
-};
diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx
index cf1c7dd50e3e..74a00bd431c6 100644
--- a/svx/source/toolbars/extrusionbar.cxx
+++ b/svx/source/toolbars/extrusionbar.cxx
@@ -53,7 +53,8 @@
#include "svx/chrtitem.hxx"
#include <svx/extrusionbar.hxx>
-#include "svx/extrusioncontrols.hxx"
+#include "extrusiondepthdialog.hxx"
+
using namespace ::svx;
using namespace ::rtl;
diff --git a/svx/source/unodialogs/textconversiondlgs/export.map b/svx/source/unodialogs/textconversiondlgs/export.map
deleted file mode 100644
index ff4971857d69..000000000000
--- a/svx/source/unodialogs/textconversiondlgs/export.map
+++ /dev/null
@@ -1,8 +0,0 @@
-EXTDBI_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/svx/source/unodialogs/textconversiondlgs/makefile.mk b/svx/source/unodialogs/textconversiondlgs/makefile.mk
index 6cdec3906c9a..b5013ca9d165 100644
--- a/svx/source/unodialogs/textconversiondlgs/makefile.mk
+++ b/svx/source/unodialogs/textconversiondlgs/makefile.mk
@@ -59,7 +59,7 @@ SHL1TARGET= txcnvdlg
.ELSE
SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
.ENDIF
-SHL1VERSIONMAP= export.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1STDLIBS= \
$(CPPULIB) \
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index 31e8dbc49c35..8e782eef8347 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -39,6 +39,7 @@
#include "recoveryui.hxx"
#include "svx/xmlgrhlp.hxx"
#include "tbunocontroller.hxx"
+#include "tbunosearchcontrollers.hxx"
using namespace ::com::sun::star;
using namespace ::rtl;
@@ -233,9 +234,7 @@ uno::Reference< uno::XInterface > SAL_CALL create_EnhancedCustomShapeEngine( con
// export this service
//
-#ifndef SVX_LIGHT
#include "UnoGraphicExporter.hxx"
-#endif
#include "unogalthemeprovider.hxx"
#include <com/sun/star/registry/XRegistryKey.hpp>
#include "sal/types.h"
@@ -244,6 +243,15 @@ uno::Reference< uno::XInterface > SAL_CALL create_EnhancedCustomShapeEngine( con
#include "uno/lbnames.h"
#include <svx/sdr/primitive2d/primitiveFactory2d.hxx>
+/*
+namespace svx
+{
+extern OUString SAL_CALL ExtrusionDepthController_getImplementationName();
+extern uno::Reference< uno::XInterface > SAL_CALL ExtrusionDepthController_createInstance(const uno::Reference< lang::XMultiServiceFactory > &) throw( uno::RuntimeException );
+extern uno::Sequence< OUString > SAL_CALL ExtrusionDepthController_getSupportedServiceNames() throw( uno::RuntimeException );
+}
+*/
+
extern "C"
{
@@ -279,10 +287,14 @@ SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
writeInfo( pKey, SvxUnoColorTable::getImplementationName_Static(), SvxUnoColorTable::getSupportedServiceNames_Static() );
writeInfo( pKey, EnhancedCustomShapeEngine_getImplementationName(), EnhancedCustomShapeEngine_getSupportedServiceNames() );
writeInfo( pKey, svx::RecoveryUI::st_getImplementationName(), svx::RecoveryUI::st_getSupportedServiceNames() );
-#ifndef SVX_LIGHT
writeInfo( pKey, svx::GraphicExporter_getImplementationName(), svx::GraphicExporter_getSupportedServiceNames() );
-#endif
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
@@ -292,6 +304,7 @@ SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
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 &)
{
@@ -338,7 +351,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
svx::RecoveryUI::st_createInstance,
svx::RecoveryUI::st_getSupportedServiceNames() );
}
-#ifndef SVX_LIGHT
else if( svx::GraphicExporter_getImplementationName().equalsAscii( pImplName ) )
{
xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
@@ -346,7 +358,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
svx::GraphicExporter_createInstance,
svx::GraphicExporter_getSupportedServiceNames() );
}
-#endif
else if ( svx::FontHeightToolBoxControl::getImplementationName_Static().equalsAscii( pImplName ) )
{
xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
@@ -354,6 +365,34 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
svx::FontHeightToolBoxControl_createInstance,
svx::FontHeightToolBoxControl::getSupportedServiceNames_Static() );
}
+ else if ( svx::FindTextToolbarController::getImplementationName_Static().equalsAscii( pImplName ) )
+ {
+ xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
+ svx::FindTextToolbarController::getImplementationName_Static(),
+ svx::FindTextToolbarController_createInstance,
+ svx::FindTextToolbarController::getSupportedServiceNames_Static() );
+ }
+ else if ( svx::DownSearchToolboxController::getImplementationName_Static().equalsAscii( pImplName ) )
+ {
+ xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
+ svx::DownSearchToolboxController::getImplementationName_Static(),
+ svx::DownSearchToolboxController_createInstance,
+ svx::DownSearchToolboxController::getSupportedServiceNames_Static() );
+ }
+ else if ( svx::UpSearchToolboxController::getImplementationName_Static().equalsAscii( pImplName ) )
+ {
+ xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
+ svx::UpSearchToolboxController::getImplementationName_Static(),
+ svx::UpSearchToolboxController_createInstance,
+ svx::UpSearchToolboxController::getSupportedServiceNames_Static() );
+ }
+ else if ( svx::FindbarDispatcher::getImplementationName_Static().equalsAscii( pImplName ) )
+ {
+ xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
+ svx::FindbarDispatcher::getImplementationName_Static(),
+ svx::FindbarDispatcher_createInstance,
+ svx::FindbarDispatcher::getSupportedServiceNames_Static() );
+ }
else if( ::unogallery::GalleryThemeProvider_getImplementationName().equalsAscii( pImplName ) )
{
xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
@@ -385,7 +424,16 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
::svx::SvXMLGraphicExportHelper_createInstance,
::svx::SvXMLGraphicExportHelper_getSupportedServiceNames() );
}
-
+/*
+ else if( ::svx::ExtrusionDepthController_getImplementationName().equalsAscii( pImplName ) )
+ {
+ xFactory = ::cppu::createSingleFactory(
+ reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
+ ::svx::ExtrusionDepthController_getImplementationName(),
+ ::svx::ExtrusionDepthController_createInstance,
+ ::svx::ExtrusionDepthController_getSupportedServiceNames() );
+ }
+*/
if( xFactory.is())
{
xFactory->acquire();
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index 294d621b8ff8..a905aa0fd2f4 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -654,11 +654,17 @@ void SvxDrawPage::GetTypeAndInventor( sal_uInt16& rType, sal_uInt32& rInventor,
if( nTempType == UHASHMAP_NOTFOUND )
{
- if( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.TableShape")) )
+ if( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.TableShape")) ||
+ aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.presentation.TableShape")) )
{
rInventor = SdrInventor;
rType = OBJ_TABLE;
}
+ else if( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.presentation.MediaShape" )) )
+ {
+ rInventor = SdrInventor;
+ rType = OBJ_MEDIA;
+ }
}
else if(nTempType & E3D_INVENTOR_FLAG)
{
diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index b682d19dd1af..1116501414cf 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -478,6 +478,7 @@ SfxItemPropertyMapEntry* ImplGetSvxOle2PropertyMap()
{ MAP_CHAR_LEN("ThumbnailGraphicURL"), OWN_ATTR_THUMBNAIL , &::getCppuType(( const ::rtl::OUString*)0), 0, 0 },
{ MAP_CHAR_LEN("Model"), OWN_ATTR_OLEMODEL , &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0},
{ MAP_CHAR_LEN("EmbeddedObject"), OWN_ATTR_OLE_EMBEDDED_OBJECT , &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0},
+ { MAP_CHAR_LEN("EmbeddedObjectNoNewClient"),OWN_ATTR_OLE_EMBEDDED_OBJECT_NONEWCLIENT, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0},
{ MAP_CHAR_LEN("OriginalSize"), OWN_ATTR_OLESIZE , &::getCppuType(( const ::com::sun::star::awt::Size*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0},
{ MAP_CHAR_LEN("CLSID"), OWN_ATTR_CLSID , &::getCppuType(( const ::rtl::OUString*)0), 0, 0 },
{ MAP_CHAR_LEN("IsInternal"), OWN_ATTR_INTERNAL_OLE , &::getBooleanCppuType() , ::com::sun::star::beans::PropertyAttribute::READONLY, 0},
diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx
index 5085dd72fe57..79d5b7c5dec9 100644
--- a/svx/source/unodraw/unoshap4.cxx
+++ b/svx/source/unodraw/unoshap4.cxx
@@ -355,22 +355,26 @@ bool SvxOle2Shape::getPropertyValueImpl( const ::rtl::OUString& rName, const Sfx
case OWN_ATTR_OLEMODEL:
case OWN_ATTR_OLE_EMBEDDED_OBJECT:
+ case OWN_ATTR_OLE_EMBEDDED_OBJECT_NONEWCLIENT:
{
SdrOle2Obj* pObj = dynamic_cast<SdrOle2Obj*>( mpObj.get() );
if( pObj )
{
uno::Reference < embed::XEmbeddedObject > xObj( pObj->GetObjRef() );
if ( xObj.is()
- && ( pProperty->nWID == OWN_ATTR_OLE_EMBEDDED_OBJECT || svt::EmbeddedObjectRef::TryRunningState( xObj ) ) )
+ && ( pProperty->nWID == OWN_ATTR_OLE_EMBEDDED_OBJECT || pProperty->nWID == OWN_ATTR_OLE_EMBEDDED_OBJECT_NONEWCLIENT || svt::EmbeddedObjectRef::TryRunningState( xObj ) ) )
{
// Discussed with CL fue to the before GetPaintingPageView
// usage. Removed it, former fallback is used now
+ if ( pProperty->nWID == OWN_ATTR_OLEMODEL || pProperty->nWID == OWN_ATTR_OLE_EMBEDDED_OBJECT )
+ {
#ifdef DBG_UTIL
- const sal_Bool bSuccess(pObj->AddOwnLightClient());
- OSL_ENSURE( bSuccess, "An object without client is provided!" );
+ const sal_Bool bSuccess(pObj->AddOwnLightClient());
+ OSL_ENSURE( bSuccess, "An object without client is provided!" );
#else
- pObj->AddOwnLightClient();
+ pObj->AddOwnLightClient();
#endif
+ }
if ( pProperty->nWID == OWN_ATTR_OLEMODEL )
rValue <<= pObj->GetObjRef()->getComponent();
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 99a378f0ceb4..17b9b6c3326e 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -577,6 +577,37 @@ void SvxShape::ForceMetricToItemPoolMetric(Pair& rPoint) const throw()
}
//----------------------------------------------------------------------
+// --> OD 2010-02-19 #i108851# - reintroduction of fix for issue i59051
+void SvxShape::ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon) const throw()
+{
+ DBG_TESTSOLARMUTEX();
+ if(mpModel)
+ {
+ SfxMapUnit eMapUnit = mpModel->GetItemPool().GetMetric(0);
+ if(eMapUnit != SFX_MAPUNIT_100TH_MM)
+ {
+ switch(eMapUnit)
+ {
+ case SFX_MAPUNIT_TWIP :
+ {
+ basegfx::B2DHomMatrix aTransform;
+ const double fMMToTWIPS(72.0 / 127.0);
+
+ aTransform.scale(fMMToTWIPS, fMMToTWIPS);
+ rPolyPolygon.transform(aTransform);
+ break;
+ }
+ default:
+ {
+ DBG_ERROR("Missing unit translation to PoolMetric!");
+ }
+ }
+ }
+ }
+}
+// <--
+
+//----------------------------------------------------------------------
void SvxShape::ForceMetricTo100th_mm(Pair& rPoint) const throw()
{
DBG_TESTSOLARMUTEX();
@@ -604,6 +635,38 @@ void SvxShape::ForceMetricTo100th_mm(Pair& rPoint) const throw()
}
//----------------------------------------------------------------------
+// --> OD 2010-02-19 #i108851# - reintroduction of fix for issue i59051
+void SvxShape::ForceMetricTo100th_mm(basegfx::B2DPolyPolygon& rPolyPolygon) const throw()
+{
+ DBG_TESTSOLARMUTEX();
+ SfxMapUnit eMapUnit = SFX_MAPUNIT_100TH_MM;
+ if(mpModel)
+ {
+ eMapUnit = mpModel->GetItemPool().GetMetric(0);
+ if(eMapUnit != SFX_MAPUNIT_100TH_MM)
+ {
+ switch(eMapUnit)
+ {
+ case SFX_MAPUNIT_TWIP :
+ {
+ basegfx::B2DHomMatrix aTransform;
+ const double fTWIPSToMM(127.0 / 72.0);
+ aTransform.scale(fTWIPSToMM, fTWIPSToMM);
+ rPolyPolygon.transform(aTransform);
+ break;
+ }
+ default:
+ {
+ DBG_ERROR("Missing unit translation to 100th mm!");
+ }
+ }
+ }
+ }
+}
+// <--
+//----------------------------------------------------------------------
+
+
//----------------------------------------------------------------------
void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet,
SfxItemSet& rSet, uno::Reference< beans::XPropertySet > xSet, const SfxItemPropertyMap* pMap )
@@ -635,7 +698,6 @@ void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemPropertySet&
{
if(rSet.GetPool()->IsWhich(pEntry->nWID))
rSet.Put(rSet.GetPool()->GetDefaultItem(pEntry->nWID));
-
// setzen
SvxItemPropertySet_setPropertyValue(rPropSet, pEntry, *pUsrAny, rSet);
}
@@ -650,7 +712,6 @@ void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemPropertySet&
}
-
void SvxShape::ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet)
{
DBG_TESTSOLARMUTEX();
@@ -2505,10 +2566,15 @@ bool SvxShape::setPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper
if( rValue >>= aUnoPoint )
{
Point aPoint( aUnoPoint.X, aUnoPoint.Y );
+
+ // --> OD 2010-02-19 #i108851# - reintroduction of fix for issue i59051
+ // perform metric change before applying anchor position,
+ // because the anchor position is in pool metric.
+ ForceMetricToItemPoolMetric( aPoint );
+ // <--
if( mpModel->IsWriter() )
aPoint += mpObj->GetAnchorPos();
- ForceMetricToItemPoolMetric( aPoint );
pEdgeObj->SetTailPoint( pProperty->nWID == OWN_ATTR_EDGE_START_POS, aPoint );
return true;
}
@@ -2532,6 +2598,9 @@ bool SvxShape::setPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper
if ( rValue >>= aPolyPoly )
{
basegfx::B2DPolyPolygon aNewPolyPolygon( SvxConvertPolyPolygonBezierToB2DPolyPolygon( &aPolyPoly ) );
+ // --> OD 2010-02-19 #i108851# - reintroduction of fix for issue i59051
+ ForceMetricToItemPoolMetric( aNewPolyPolygon );
+ // <--
if( mpModel->IsWriter() )
{
Point aPoint( mpObj->GetAnchorPos() );
@@ -2554,6 +2623,9 @@ bool SvxShape::setPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper
{
Point aPoint( aUnoPoint.X, aUnoPoint.Y );
+ // --> OD 2010-02-19 #i108851# - reintroduction of fix for issue i59051
+ ForceMetricToItemPoolMetric( aPoint );
+ // <--
if( mpModel->IsWriter() )
aPoint += mpObj->GetAnchorPos();
@@ -2699,6 +2771,16 @@ bool SvxShape::setPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper
}
break;
}
+ case SDRATTR_OBJVISIBLE:
+ {
+ sal_Bool bVisible = sal_Bool();
+ if( rValue >>= bVisible )
+ {
+ mpObj->SetVisible(bVisible);
+ return true;
+ }
+ break;
+ }
case SDRATTR_OBJSIZEPROTECT:
{
sal_Bool bResizeProtect = sal_Bool();
@@ -2970,6 +3052,9 @@ bool SvxShape::getPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper
Point aPoint( mpObj->GetAnchorPos() );
aPolyPoly.transform(basegfx::tools::createTranslateB2DHomMatrix(-aPoint.X(), -aPoint.Y()));
}
+ // --> OD 2010-02-19 #i108851# - reintroduction of fix for issue 59051
+ ForceMetricTo100th_mm( aPolyPoly );
+ // <--
drawing::PolyPolygonBezierCoords aRetval;
SvxConvertB2DPolyPolygonToPolyPolygonBezier( aPolyPoly, aRetval);
rValue <<= aRetval;
@@ -2990,6 +3075,9 @@ bool SvxShape::getPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper
if( mpModel->IsWriter() )
aPoint -= mpObj->GetAnchorPos();
+ // --> OD 2010-02-19 #i108851# - reintroduction of fix for issue 59051
+ ForceMetricTo100th_mm( aPoint );
+ // <--
awt::Point aUnoPoint( aPoint.X(), aPoint.Y() );
rValue <<= aUnoPoint;
@@ -3069,11 +3157,15 @@ bool SvxShape::getPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper
}
case SDRATTR_OBJPRINTABLE:
- rValue = uno::makeAny( (sal_Bool) mpObj->IsPrintable() );
+ rValue <<= static_cast<sal_Bool>( mpObj->IsPrintable() );
+ break;
+
+ case SDRATTR_OBJVISIBLE:
+ rValue <<= static_cast<sal_Bool>( mpObj->IsVisible() );
break;
case SDRATTR_OBJSIZEPROTECT:
- rValue = uno::makeAny( (sal_Bool)mpObj->IsResizeProtect() );
+ rValue <<= static_cast<sal_Bool>( mpObj->IsResizeProtect() );
break;
case OWN_ATTR_PAGE_NUMBER:
diff --git a/svx/uiconfig/accelerator/default.xml b/svx/uiconfig/accelerator/default.xml
deleted file mode 100644
index dafd9e022f12..000000000000
--- a/svx/uiconfig/accelerator/default.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink">
- <accel:item accel:code="KEY_S" accel:shift="true" accel:mod1="true" xlink:href=".uno:SaveAs"/>
- <accel:item accel:code="KEY_Y" accel:shift="true" accel:mod1="true" xlink:href=".uno:Repeat"/>
-</accel:acceleratorlist>
diff --git a/svx/uiconfig/accelerator/en-US/default.xml b/svx/uiconfig/accelerator/en-US/default.xml
deleted file mode 100644
index 67a6e9127c8a..000000000000
--- a/svx/uiconfig/accelerator/en-US/default.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink">
- <accel:item accel:code="KEY_Q" accel:mod1="true" xlink:href=".uno:Quit"/>
- <accel:item accel:code="KEY_N" accel:shift="true" accel:mod1="true" xlink:href=".uno:NewDoc"/>
- <accel:item accel:code="KEY_O" accel:mod1="true" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_OPEN" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_P" accel:mod1="true" xlink:href=".uno:Print"/>
- <accel:item accel:code="KEY_S" accel:mod1="true" xlink:href=".uno:Save"/>
- <accel:item accel:code="KEY_N" accel:mod1="true" xlink:href=".uno:AddDirect"/>
- <accel:item accel:code="KEY_W" accel:mod1="true" xlink:href=".uno:CloseWin"/>
- <accel:item accel:code="KEY_F4" accel:mod1="true" xlink:href=".uno:CloseWin"/>
- <accel:item accel:code="KEY_X" accel:mod1="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_DELETE" accel:shift="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_CUT" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_C" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_INSERT" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_COPY" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_V" accel:mod1="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_INSERT" accel:shift="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_PASTE" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_DELETE" xlink:href=".uno:Delete"/>
- <accel:item accel:code="KEY_A" accel:mod1="true" xlink:href=".uno:SelectAll"/>
- <accel:item accel:code="KEY_F" accel:mod1="true" xlink:href=".uno:SearchDialog"/>
- <accel:item accel:code="KEY_Q" accel:shift="true" accel:mod1="true" xlink:href=".uno:BasicBreak"/>
- <accel:item accel:code="KEY_F4" xlink:href=".uno:ViewDataSourceBrowser"/>
- <accel:item accel:code="KEY_F5" accel:mod1="true" xlink:href=".uno:GrabControlFocus"/>
- <accel:item accel:code="KEY_F7" accel:shift="true" accel:mod1="true" xlink:href=".uno:HangulHanjaConversion"/>
- <accel:item accel:code="KEY_F11" accel:mod2="true" xlink:href=".uno:MacroDialog"/>
-</accel:acceleratorlist>
diff --git a/svx/uiconfig/accelerator/es/default.xml b/svx/uiconfig/accelerator/es/default.xml
deleted file mode 100644
index 71ba6212d275..000000000000
--- a/svx/uiconfig/accelerator/es/default.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink">
- <accel:item accel:code="KEY_Q" accel:mod1="true" xlink:href=".uno:Quit"/>
- <accel:item accel:code="KEY_N" accel:shift="true" accel:mod1="true" xlink:href=".uno:NewDoc"/>
- <accel:item accel:code="KEY_A" accel:mod1="true" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_OPEN" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_P" accel:mod1="true" xlink:href=".uno:Print"/>
- <accel:item accel:code="KEY_G" accel:mod1="true" xlink:href=".uno:Save"/>
- <accel:item accel:code="KEY_U" accel:mod1="true" xlink:href=".uno:AddDirect"/>
- <accel:item accel:code="KEY_W" accel:mod1="true" xlink:href=".uno:CloseWin"/>
- <accel:item accel:code="KEY_F4" accel:mod1="true" xlink:href=".uno:CloseWin"/>
- <accel:item accel:code="KEY_X" accel:mod1="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_DELETE" accel:shift="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_CUT" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_C" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_INSERT" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_COPY" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_V" accel:mod1="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_INSERT" accel:shift="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_PASTE" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_DELETE" xlink:href=".uno:Delete"/>
- <accel:item accel:code="KEY_E" accel:mod1="true" xlink:href=".uno:SelectAll"/>
- <accel:item accel:code="KEY_B" accel:mod1="true" xlink:href=".uno:SearchDialog"/>
- <accel:item accel:code="KEY_Q" accel:shift="true" accel:mod1="true" xlink:href=".uno:BasicBreak"/>
- <accel:item accel:code="KEY_F4" xlink:href=".uno:ViewDataSourceBrowser"/>
- <accel:item accel:code="KEY_F5" accel:mod1="true" xlink:href=".uno:GrabControlFocus"/>
- <accel:item accel:code="KEY_F7" accel:shift="true" accel:mod1="true" xlink:href=".uno:HangulHanjaConversion"/>
- <accel:item accel:code="KEY_F11" accel:mod2="true" xlink:href=".uno:MacroDialog"/>
-</accel:acceleratorlist>
diff --git a/svx/util/makefile.mk b/svx/util/makefile.mk
index 464ec894e350..b5359d74f538 100644
--- a/svx/util/makefile.mk
+++ b/svx/util/makefile.mk
@@ -45,6 +45,10 @@ SHL1TARGET= svxcore$(DLLPOSTFIX)
SHL1IMPLIB= isvxcore
SHL1USE_EXPORTS=name
+SHL1OBJS= \
+ $(SLO)$/coreservices.obj
+
+
SHL1LIBS= \
$(SLB)$/animation.lib \
$(SLB)$/attribute.lib \
diff --git a/svx/workben/msview/msview.cxx b/svx/workben/msview/msview.cxx
index 32d556b31626..baee57ad75dc 100644
--- a/svx/workben/msview/msview.cxx
+++ b/svx/workben/msview/msview.cxx
@@ -34,7 +34,7 @@
#include <boost/shared_ptr.hpp>
#include <sot/storage.hxx>
#ifndef _SVTOOLS_HRC
-#include <svl/svtools.hrc>
+#include <svtools/svtools.hrc>
#endif
#include <sal/main.h>
diff --git a/sysui/desktop/freedesktop/freedesktop-menus.spec b/sysui/desktop/freedesktop/freedesktop-menus.spec
index 501f8432d940..1649971dad99 100644
--- a/sysui/desktop/freedesktop/freedesktop-menus.spec
+++ b/sysui/desktop/freedesktop/freedesktop-menus.spec
@@ -14,6 +14,8 @@ Conflicts: %pkgprefix-redhat-menus
Conflicts: %pkgprefix-mandriva-menus
BuildArch: noarch
AutoReqProv: no
+%define _binary_filedigest_algorithm 1
+%define _binary_payload w9.gzdio
%description
%productname desktop integration for desktop-environments that implement
diff --git a/sysui/desktop/icons/hicolor/128x128/apps/startcenter.png b/sysui/desktop/icons/hicolor/128x128/apps/startcenter.png
index b009ee2b9277..1b51a60bddea 100644
--- a/sysui/desktop/icons/hicolor/128x128/apps/startcenter.png
+++ b/sysui/desktop/icons/hicolor/128x128/apps/startcenter.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/apps/printeradmin.png b/sysui/desktop/icons/hicolor/16x16/apps/printeradmin.png
index 4e8eb0e49dd8..399076c9934d 100644..100755
--- a/sysui/desktop/icons/hicolor/16x16/apps/printeradmin.png
+++ b/sysui/desktop/icons/hicolor/16x16/apps/printeradmin.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/apps/startcenter.png b/sysui/desktop/icons/hicolor/16x16/apps/startcenter.png
index c81fc95d4770..3aa8f08a8c5d 100644
--- a/sysui/desktop/icons/hicolor/16x16/apps/startcenter.png
+++ b/sysui/desktop/icons/hicolor/16x16/apps/startcenter.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/apps/printeradmin.png b/sysui/desktop/icons/hicolor/32x32/apps/printeradmin.png
index 2c7a0c03f8fd..b09999c7d083 100644..100755
--- a/sysui/desktop/icons/hicolor/32x32/apps/printeradmin.png
+++ b/sysui/desktop/icons/hicolor/32x32/apps/printeradmin.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/apps/startcenter.png b/sysui/desktop/icons/hicolor/32x32/apps/startcenter.png
index 22bdd4a7fef9..296c6f4c58b1 100644
--- a/sysui/desktop/icons/hicolor/32x32/apps/startcenter.png
+++ b/sysui/desktop/icons/hicolor/32x32/apps/startcenter.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/apps/printeradmin.png b/sysui/desktop/icons/hicolor/48x48/apps/printeradmin.png
index 41971c9652a2..a11cbe5ab107 100644..100755
--- a/sysui/desktop/icons/hicolor/48x48/apps/printeradmin.png
+++ b/sysui/desktop/icons/hicolor/48x48/apps/printeradmin.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/apps/startcenter.png b/sysui/desktop/icons/hicolor/48x48/apps/startcenter.png
index f67dc976750b..86bcf599553f 100644
--- a/sysui/desktop/icons/hicolor/48x48/apps/startcenter.png
+++ b/sysui/desktop/icons/hicolor/48x48/apps/startcenter.png
Binary files differ
diff --git a/sysui/desktop/icons/makefile.mk b/sysui/desktop/icons/makefile.mk
index 1af3f4367fee..ac32cdbe453b 100644
--- a/sysui/desktop/icons/makefile.mk
+++ b/sysui/desktop/icons/makefile.mk
@@ -114,6 +114,7 @@ all: \
$(MISC)$/ooo3_math_doc.ico \
$(MISC)$/ooo3_writer_tem.ico \
$(MISC)$/ooo3_empty_tem.ico \
+ $(MISC)$/ooo3_open.ico \
$(MISC)$/ooo11-base-doc.ico \
$(MISC)$/ooo11-calc-doc.ico \
$(MISC)$/ooo11-calc-tem.ico \
@@ -176,6 +177,7 @@ all: \
$(MISC)$/so9_chart_doc.ico \
$(MISC)$/so9_writer_app.ico \
$(MISC)$/so9_draw_app.ico \
+ $(MISC)$/so9_open.ico \
$(MISC)$/so7-base-doc.ico \
$(MISC)$/so7-calc-doc.ico \
$(MISC)$/so7-calc-tem.ico \
diff --git a/sysui/desktop/icons/ooo3_open.ico b/sysui/desktop/icons/ooo3_open.ico
new file mode 100755
index 000000000000..98fcea3748a9
--- /dev/null
+++ b/sysui/desktop/icons/ooo3_open.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_open.ico b/sysui/desktop/icons/so9_open.ico
new file mode 100755
index 000000000000..90f193d80dd9
--- /dev/null
+++ b/sysui/desktop/icons/so9_open.ico
Binary files differ
diff --git a/sysui/desktop/macosx/Info.plist b/sysui/desktop/macosx/Info.plist
index 029e479a3ffc..cf04e8086afe 100644
--- a/sysui/desktop/macosx/Info.plist
+++ b/sysui/desktop/macosx/Info.plist
@@ -622,7 +622,7 @@
</dict>
</dict>
- <!--- Microsoft Excel XML -->
+ <!-- Microsoft Excel XML -->
<dict>
<key>UTTypeConformsTo</key>
<array>
@@ -1384,7 +1384,7 @@
<key>CFBundleExecutable</key>
<string>%EXECUTABLE</string>
<key>CFBundleGetInfoString</key>
- <string>${PRODUCTNAME} ${ABOUTBOXPRODUCTVERSION} %SOURCE</string>
+ <string>${PRODUCTNAME} ${ABOUTBOXPRODUCTVERSION} ${BUILDIDCWS}</string>
<key>CFBundleIconFile</key>
<string>main.icns</string>
<key>CFBundleShortVersionString</key>
diff --git a/sysui/desktop/macosx/makefile.mk b/sysui/desktop/macosx/makefile.mk
index 8a4a4705e99d..059b3b87bb46 100644
--- a/sysui/desktop/macosx/makefile.mk
+++ b/sysui/desktop/macosx/makefile.mk
@@ -54,12 +54,6 @@ CREATOR_TYPE=OOO2
EXECUTABLE=soffice
.ENDIF
-SOURCE=$(RSCREVISION)
-
-.IF "$(CWS_WORK_STAMP)" != ""
-CWS=[CWS:$(CWS_WORK_STAMP)]
-.ENDIF
-
.IF "$(WITH_LANG)"!=""
ULFDIR:=$(COMMONMISC)$/desktopshare
.ELSE # "$(WITH_LANG)"!=""
@@ -79,7 +73,7 @@ $(COMMONMISC)$/PkgInfo :
$(COMMONMISC)$/Info.plist : $$(@:f)
- sed -e "s|\%EXECUTABLE|${EXECUTABLE}|g" -e "s|\%SOURCE|[$(SOURCE)$(CWS)]|g" $< > $@
+ sed -e "s|\%EXECUTABLE|${EXECUTABLE}|g" $< > $@
$(COMMONBIN)$/InfoPlist_{$(alllangiso)}.zip : $(COMMONMISC)$/$$(@:b)/InfoPlist.strings
cd $(<:d) && zip ../$(@:f).$(INPATH) $(<:f)
diff --git a/sysui/desktop/mandriva/mandriva-menus.spec b/sysui/desktop/mandriva/mandriva-menus.spec
index 5be889e3924e..4c02c70d90c1 100644
--- a/sysui/desktop/mandriva/mandriva-menus.spec
+++ b/sysui/desktop/mandriva/mandriva-menus.spec
@@ -16,6 +16,8 @@ Requires: mandrake-release
Provides: openoffice.org3-desktop-integration
%define _unpackaged_files_terminate_build 0
+%define _binary_filedigest_algorithm 1
+%define _binary_payload w9.gzdio
%define menuversion %(echo %version|cut -d'.' -f 1-2)
%{?!update_menus:%define update_menus if [ -x /usr/bin/update-menus ]; then /usr/bin/update-menus || true ; fi}
diff --git a/sysui/desktop/menus/base.desktop b/sysui/desktop/menus/base.desktop
index 89d0a20adb00..9497666691fe 100644
--- a/sysui/desktop/menus/base.desktop
+++ b/sysui/desktop/menus/base.desktop
@@ -9,3 +9,4 @@ MimeType=application/vnd.oasis.opendocument.database;application/vnd.sun.xml.bas
Name=%PRODUCTNAME Base
GenericName=Database Development
Comment=Manage databases, create queries and reports to track and manage your information by using Base.
+InitialPreference=5
diff --git a/sysui/desktop/menus/calc.desktop b/sysui/desktop/menus/calc.desktop
index e49b114b0954..bc0c9ee8b618 100644
--- a/sysui/desktop/menus/calc.desktop
+++ b/sysui/desktop/menus/calc.desktop
@@ -9,3 +9,4 @@ MimeType=application/vnd.oasis.opendocument.spreadsheet;application/vnd.oasis.op
Name=%PRODUCTNAME Calc
GenericName=Spreadsheet
Comment=Perform calculation, analyze information and manage lists in spreadsheets by using Calc.
+InitialPreference=5
diff --git a/sysui/desktop/menus/draw.desktop b/sysui/desktop/menus/draw.desktop
index 438d603e06a2..42db7c6f84a0 100644
--- a/sysui/desktop/menus/draw.desktop
+++ b/sysui/desktop/menus/draw.desktop
@@ -9,3 +9,4 @@ MimeType=application/vnd.oasis.opendocument.graphics;application/vnd.oasis.opend
Name=%PRODUCTNAME Draw
GenericName=Drawing Program
Comment=Create and edit drawings, flow charts, and logos by using Draw.
+InitialPreference=5
diff --git a/sysui/desktop/menus/impress.desktop b/sysui/desktop/menus/impress.desktop
index 0aa3cdecdc04..90df11ac54f1 100644
--- a/sysui/desktop/menus/impress.desktop
+++ b/sysui/desktop/menus/impress.desktop
@@ -9,3 +9,4 @@ MimeType=application/vnd.oasis.opendocument.presentation;application/vnd.oasis.o
Name=%PRODUCTNAME Impress
GenericName=Presentation
Comment=Create and edit presentations for slideshows, meeting and Web pages by using Impress.
+InitialPreference=5
diff --git a/sysui/desktop/menus/math.desktop b/sysui/desktop/menus/math.desktop
index 15a6d42efc2c..f97536d6ef04 100644
--- a/sysui/desktop/menus/math.desktop
+++ b/sysui/desktop/menus/math.desktop
@@ -9,3 +9,4 @@ MimeType=application/vnd.oasis.opendocument.formula;application/vnd.sun.xml.math
Name=%PRODUCTNAME Math
GenericName=Formula Editor
Comment=Create and edit scientific formulas and equations by using Math.
+InitialPreference=5
diff --git a/sysui/desktop/menus/startcenter.desktop b/sysui/desktop/menus/startcenter.desktop
index b6067494a68c..6302a5b16289 100644
--- a/sysui/desktop/menus/startcenter.desktop
+++ b/sysui/desktop/menus/startcenter.desktop
@@ -5,7 +5,7 @@ Icon=startcenter
Type=Application
Categories=Office;X-Red-Hat-Base;X-SuSE-Core-Office;X-MandrivaLinux-Office-Other;
Exec=openoffice %U
-MimeType=
+MimeType=application/vnd.openofficeorg.extension;
Name=%PRODUCTNAME
GenericName=Office
Comment=The office productivity suite compatible to the open and standardized ODF document format. Supported by Sun Microsystems.
diff --git a/sysui/desktop/menus/writer.desktop b/sysui/desktop/menus/writer.desktop
index 0184d916e2ab..1509de0fb402 100644
--- a/sysui/desktop/menus/writer.desktop
+++ b/sysui/desktop/menus/writer.desktop
@@ -9,3 +9,4 @@ MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocum
Name=%PRODUCTNAME Writer
GenericName=Word Processor
Comment=Create and edit text and graphics in letters, reports, documents and Web pages by using Writer.
+InitialPreference=5
diff --git a/sysui/desktop/mimetypes/extension.desktop b/sysui/desktop/mimetypes/extension.desktop
index 795e82871414..80cadae7e9cb 100644
--- a/sysui/desktop/mimetypes/extension.desktop
+++ b/sysui/desktop/mimetypes/extension.desktop
@@ -6,4 +6,4 @@ Icon=extension
Type=MimeType
Patterns=*.oxt
MimeType=application/vnd.openofficeorg.extension
-Comment=Extension
+Comment=%PRODUCTNAME Extension
diff --git a/sysui/desktop/redhat/redhat-menus.spec b/sysui/desktop/redhat/redhat-menus.spec
index e153b55c3fd4..85e0a6a5d72c 100644
--- a/sysui/desktop/redhat/redhat-menus.spec
+++ b/sysui/desktop/redhat/redhat-menus.spec
@@ -11,6 +11,8 @@ BuildArch: noarch
Requires: redhat-release
Provides: openoffice.org3-desktop-integration
%define _unpackaged_files_terminate_build 0
+%define _binary_filedigest_algorithm 1
+%define _binary_payload w9.gzdio
%description
%productname desktop integration
diff --git a/sysui/desktop/share/launcher_comment.ulf b/sysui/desktop/share/launcher_comment.ulf
index e3abc7c7ead2..6aeab6d94c36 100644
--- a/sysui/desktop/share/launcher_comment.ulf
+++ b/sysui/desktop/share/launcher_comment.ulf
@@ -17,5 +17,5 @@ en-US = "Create and edit scientific formulas and equations by using Math."
en-US = "Manage databases, create queries and reports to track and manage your information by using Base."
[startcenter]
-en-US = "The office productivity suite compatible to the open and standardized ODF document format. Supported by Sun Microsystems."
+en-US = "The office productivity suite compatible to the open and standardized ODF document format. Supported by Oracle."
diff --git a/sysui/desktop/slackware/makefile.mk b/sysui/desktop/slackware/makefile.mk
index 7327aa469fa6..6fde1caf6528 100644
--- a/sysui/desktop/slackware/makefile.mk
+++ b/sysui/desktop/slackware/makefile.mk
@@ -42,10 +42,6 @@ TARGET=slackware
MENUFILES=$(PKGDIR)$/{$(PRODUCTLIST)}3.3-$(TARGET)-menus-$(PKGVERSION)-noarch-$(PKGREV).tgz
-.IF "$(USE_SHELL)"=="bash"
-ECHOPARAM=-e
-.ENDIF
-
# --- Targets -------------------------------------------------------
.INCLUDE : target.mk
@@ -74,7 +70,7 @@ $(MISC)/$(TARGET)/usr/share/applications/ :
@echo "( cd etc ; ln -snf /opt/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//):s/-//) $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//)) )" >> $@
@echo "( cd usr/bin ; rm -rf soffice )" >> $@
@echo "( cd usr/bin ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))/program/soffice soffice )" >> $@
- @echo $(ECHOPARAM) $(foreach,i,$(shell @cat $(COMMONMISC)$/$(*:b:s/-/ /:1:s/3.3//)/launcherlist) "\n( cd usr/share/applications ; rm -rf $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))-$i )\n( cd usr/share/applications ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))/share/xdg/$i $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))-$i )") >> $@
+ @echo -e $(foreach,i,$(shell @cat $(COMMONMISC)$/$(*:b:s/-/ /:1:s/3.3//)/launcherlist) "\n( cd usr/share/applications ; rm -rf $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))-$i )\n( cd usr/share/applications ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))/share/xdg/$i $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))-$i )") >> $@
@cat $< >> $@
%$/install$/slack-desc : slack-desc
diff --git a/sysui/desktop/suse/suse-menus.spec b/sysui/desktop/suse/suse-menus.spec
index 7280d9dbae8b..14dbcde0f5e2 100644
--- a/sysui/desktop/suse/suse-menus.spec
+++ b/sysui/desktop/suse/suse-menus.spec
@@ -14,6 +14,8 @@ Requires: /etc/SuSE-release
Conflicts: SunDesktopVersion
Provides: openoffice.org3-desktop-integration
%define _unpackaged_files_terminate_build 0
+%define _binary_filedigest_algorithm 1
+%define _binary_payload w9.gzdio
%description
%productname desktop integration
diff --git a/ucb/prj/build.lst b/ucb/prj/build.lst
index f0eb0da8395e..dad79213047e 100644
--- a/ucb/prj/build.lst
+++ b/ucb/prj/build.lst
@@ -1,4 +1,4 @@
-uc ucb : cppuhelper CURL:curl OPENSSL:openssl NEON:neon LIBXML2:libxml2 offapi sal salhelper ucbhelper udkapi comphelper NULL
+uc ucb : cppuhelper CURL:curl OPENSSL:openssl NEON:neon LIBXML2:libxml2 offapi sal salhelper ucbhelper udkapi comphelper tools NULL
uc ucb usr1 - all uc_mkout NULL
uc ucb\inc nmake - all uc_inc NULL
uc ucb\source\regexp nmake - all uc_regexp uc_inc NULL
@@ -14,3 +14,5 @@ uc ucb\source\ucp\webdav nmake - all uc_webdav uc_inc NULL
uc ucb\source\ucp\package nmake - all uc_package uc_inc NULL
uc ucb\source\ucp\tdoc nmake - all uc_tdoc uc_inc NULL
uc ucb\source\ucp\expand nmake - all uc_expand uc_inc NULL
+uc ucb\source\ucp\ext nmake - all uc_ext uc_inc NULL
+uc ucb\qa\unoapi nmake - all uc_qa_unoapi NULL
diff --git a/ucb/qa/unoapi/Test.java b/ucb/qa/unoapi/Test.java
new file mode 100644
index 000000000000..145716d871d4
--- /dev/null
+++ b/ucb/qa/unoapi/Test.java
@@ -0,0 +1,51 @@
+/*************************************************************************
+* 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.
+************************************************************************/
+
+package org.openoffice.ucb.qa.unoapi;
+
+import org.openoffice.Runner;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+public final class Test {
+ @org.junit.Before public void setUp() throws Exception {
+ connection.setUp();
+ }
+
+ @org.junit.After public void tearDown()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ connection.tearDown();
+ }
+
+ @org.junit.Test public void test() {
+ assertTrue(
+ Runner.run(
+ "-sce", "ucb.sce", "-xcl", "knownissues.xcl", "-cs",
+ connection.getDescription()));
+ }
+
+ private final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/ucb/qa/unoapi/makefile.mk b/ucb/qa/unoapi/makefile.mk
index 1ceb8eb64112..80c7caae73b7 100644
--- a/ucb/qa/unoapi/makefile.mk
+++ b/ucb/qa/unoapi/makefile.mk
@@ -1,7 +1,6 @@
#*************************************************************************
-#
# 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
@@ -22,19 +21,28 @@
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
+#***********************************************************************/
-PRJ=..$/..
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-PRJNAME=ucb
-TARGET=qa_unoapi
+PRJ = ../..
+PRJNAME = ucb
+TARGET = qa_unoapi
-.INCLUDE: settings.mk
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/ucb/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-ALLTAR : UNOAPI_TEST
+ALLTAR : javatest
-UNOAPI_TEST:
- +$(SOLARENV)$/bin$/checkapi -sce ucb.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments
+.END
diff --git a/ucb/source/cacher/exports.map b/ucb/source/cacher/exports.map
deleted file mode 100644
index bd32ad4747a6..000000000000
--- a/ucb/source/cacher/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-CAC_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/cacher/makefile.mk b/ucb/source/cacher/makefile.mk
index 20179f8ce7a2..600fefc174f7 100644
--- a/ucb/source/cacher/makefile.mk
+++ b/ucb/source/cacher/makefile.mk
@@ -59,7 +59,7 @@ SHL1STDLIBS=\
SHL1LIBS=$(LIB1TARGET)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
DEF1NAME=$(SHL1TARGET)
.ENDIF # L10N_framework
diff --git a/ucb/source/core/exports.map b/ucb/source/core/exports.map
deleted file mode 100644
index 5ab48b9e42c0..000000000000
--- a/ucb/source/core/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UCB_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/core/makefile.mk b/ucb/source/core/makefile.mk
index 5095dbef947d..34765eb74289 100644
--- a/ucb/source/core/makefile.mk
+++ b/ucb/source/core/makefile.mk
@@ -65,7 +65,7 @@ SHL1IMPLIB=i$(TARGET)
.IF "$(GUI)" == "OS2"
DEF1EXPORTFILE=exports2.dxp
.ELSE
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
.ENDIF
DEF1NAME=$(SHL1TARGET)
diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx
index 76c33f45a548..c13ec9d367c8 100644
--- a/ucb/source/core/ucb.cxx
+++ b/ucb/source/core/ucb.cxx
@@ -40,7 +40,11 @@
#include <com/sun/star/ucb/XCommandInfo.hpp>
#include <com/sun/star/ucb/XContentProvider.hpp>
#include <com/sun/star/ucb/XContentProviderSupplier.hpp>
-#include <ucbhelper/configureucb.hxx>
+#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/XNameAccess.hpp>
+#include <com/sun/star/uno/Any.hxx>
#include <ucbhelper/cancelcommandexecution.hxx>
#include "identify.hxx"
#include "ucbcmds.hxx"
@@ -59,6 +63,126 @@ using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::ucb;
using namespace ucb_impl;
+using namespace com::sun::star;
+using namespace ucbhelper;
+
+
+#define CONFIG_CONTENTPROVIDERS_KEY \
+ "/org.openoffice.ucb.Configuration/ContentProviders"
+
+
+namespace {
+
+bool fillPlaceholders(rtl::OUString const & rInput,
+ uno::Sequence< uno::Any > const & rReplacements,
+ rtl::OUString * pOutput)
+{
+ sal_Unicode const * p = rInput.getStr();
+ sal_Unicode const * pEnd = p + rInput.getLength();
+ sal_Unicode const * pCopy = p;
+ rtl::OUStringBuffer aBuffer;
+ while (p != pEnd)
+ switch (*p++)
+ {
+ case '&':
+ if (pEnd - p >= 4
+ && p[0] == 'a' && p[1] == 'm' && p[2] == 'p'
+ && p[3] == ';')
+ {
+ aBuffer.append(pCopy, p - 1 - pCopy);
+ aBuffer.append(sal_Unicode('&'));
+ p += 4;
+ pCopy = p;
+ }
+ else if (pEnd - p >= 3
+ && p[0] == 'l' && p[1] == 't' && p[2] == ';')
+ {
+ aBuffer.append(pCopy, p - 1 - pCopy);
+ aBuffer.append(sal_Unicode('<'));
+ p += 3;
+ pCopy = p;
+ }
+ else if (pEnd - p >= 3
+ && p[0] == 'g' && p[1] == 't' && p[2] == ';')
+ {
+ aBuffer.append(pCopy, p - 1 - pCopy);
+ aBuffer.append(sal_Unicode('>'));
+ p += 3;
+ pCopy = p;
+ }
+ break;
+
+ case '<':
+ sal_Unicode const * q = p;
+ while (q != pEnd && *q != '>')
+ ++q;
+ if (q == pEnd)
+ break;
+ rtl::OUString aKey(p, q - p);
+ rtl::OUString aValue;
+ bool bFound = false;
+ for (sal_Int32 i = 2; i + 1 < rReplacements.getLength();
+ i += 2)
+ {
+ rtl::OUString aReplaceKey;
+ if ((rReplacements[i] >>= aReplaceKey)
+ && aReplaceKey == aKey
+ && (rReplacements[i + 1] >>= aValue))
+ {
+ bFound = true;
+ break;
+ }
+ }
+ if (!bFound)
+ return false;
+ aBuffer.append(pCopy, p - 1 - pCopy);
+ aBuffer.append(aValue);
+ p = q + 1;
+ pCopy = p;
+ break;
+ }
+ aBuffer.append(pCopy, pEnd - pCopy);
+ *pOutput = aBuffer.makeStringAndClear();
+ return true;
+}
+
+void makeAndAppendXMLName(
+ rtl::OUStringBuffer & rBuffer, const rtl::OUString & rIn )
+{
+ sal_Int32 nCount = rIn.getLength();
+ for ( sal_Int32 n = 0; n < nCount; ++n )
+ {
+ const sal_Unicode c = rIn.getStr()[ n ];
+ switch ( c )
+ {
+ case '&':
+ rBuffer.appendAscii( "&amp;" );
+ break;
+
+ case '"':
+ rBuffer.appendAscii( "&quot;" );
+ break;
+
+ case '\'':
+ rBuffer.appendAscii( "&apos;" );
+ break;
+
+ case '<':
+ rBuffer.appendAscii( "&lt;" );
+ break;
+
+ case '>':
+ rBuffer.appendAscii( "&gt;" );
+ break;
+
+ default:
+ rBuffer.append( c );
+ break;
+ }
+ }
+}
+
+}
//=========================================================================
//
@@ -132,6 +256,9 @@ void SAL_CALL UniversalContentBroker::dispose()
aEvt.Source = SAL_STATIC_CAST( XComponent*, this );
m_pDisposeEventListeners->disposeAndClear( aEvt );
}
+
+ if ( m_xNotifier.is() )
+ m_xNotifier->removeChangesListener( this );
}
//=========================================================================
@@ -193,9 +320,11 @@ void SAL_CALL UniversalContentBroker::initialize(
//@@@ At the moment, there's a problem when one (non-one-instance) factory
// 'wraps' another (one-instance) factory, causing this method to be
// called several times:
+ m_aArguments = aArguments;
+
oslInterlockedCount nCount = osl_incrementInterlockedCount(&m_nInitCount);
if (nCount == 1)
- ::ucbhelper::configureUcb(this, m_xSMgr, aArguments, 0);
+ configureUcb();
else
osl_decrementInterlockedCount(&m_nInitCount);
// make the possibility of overflow less likely...
@@ -508,6 +637,80 @@ void SAL_CALL UniversalContentBroker::abort( sal_Int32 )
//=========================================================================
//
+// XChangesListener methods
+//
+//=========================================================================
+// virtual
+void SAL_CALL UniversalContentBroker::changesOccurred( const util::ChangesEvent& Event )
+ throw( uno::RuntimeException )
+{
+ 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 );
+
+ const util::ElementChange* pElementChanges
+ = Event.Changes.getConstArray();
+
+ ContentProviderDataList aData;
+ for ( sal_Int32 n = 0; n < nCount; ++n )
+ {
+ const util::ElementChange& rElem = pElementChanges[ n ];
+ rtl::OUString aKey;
+ rElem.Accessor >>= aKey;
+
+ ContentProviderData aInfo;
+
+ createContentProviderData(aKey, xHierNameAccess, aInfo);
+
+ aData.push_back(aInfo);
+ }
+
+ prepareAndRegister(aData);
+ }
+}
+
+//=========================================================================
+//
+// XEventListener methods
+//
+//=========================================================================
+// virtual
+void SAL_CALL UniversalContentBroker::disposing(const lang::EventObject&)
+ throw( uno::RuntimeException )
+{
+ if ( m_xNotifier.is() )
+ {
+ osl::Guard< osl::Mutex > aGuard( m_aMutex );
+
+ if ( m_xNotifier.is() )
+ m_xNotifier.clear();
+ }
+}
+
+//=========================================================================
+//
// Non-interface methods
//
//=========================================================================
@@ -524,6 +727,212 @@ Reference< XContentProvider > UniversalContentBroker::queryContentProvider(
: Reference< XContentProvider >();
}
+bool UniversalContentBroker::configureUcb()
+ throw (uno::RuntimeException)
+{
+ rtl::OUString aKey1;
+ rtl::OUString aKey2;
+ if (m_aArguments.getLength() < 2
+ || !(m_aArguments[0] >>= aKey1) || !(m_aArguments[1] >>= aKey2))
+ {
+ OSL_ENSURE(false, "UniversalContentBroker::configureUcb(): Bad arguments");
+ return false;
+ }
+
+ ContentProviderDataList aData;
+ if (!getContentProviderData(aKey1, aKey2, aData))
+ {
+ OSL_ENSURE(false, "UniversalContentBroker::configureUcb(): No configuration");
+ return false;
+ }
+
+ prepareAndRegister(aData);
+
+ return true;
+}
+
+void UniversalContentBroker::prepareAndRegister(
+ const ContentProviderDataList& rData)
+{
+ ContentProviderDataList::const_iterator aEnd(rData.end());
+ for (ContentProviderDataList::const_iterator aIt(rData.begin());
+ aIt != aEnd; ++aIt)
+ {
+ rtl::OUString aProviderArguments;
+ if (fillPlaceholders(aIt->Arguments,
+ m_aArguments,
+ &aProviderArguments))
+ {
+ registerAtUcb(this,
+ m_xSMgr,
+ aIt->ServiceName,
+ aProviderArguments,
+ aIt->URLTemplate,
+ 0);
+
+ }
+ else
+ OSL_ENSURE(false,
+ "UniversalContentBroker::prepareAndRegister(): Bad argument placeholders");
+ }
+}
+
+//=========================================================================
+bool UniversalContentBroker::getContentProviderData(
+ const rtl::OUString & rKey1,
+ const rtl::OUString & rKey2,
+ ContentProviderDataList & rListToFill )
+{
+ if ( !m_xSMgr.is() || !rKey1.getLength() || !rKey2.getLength() )
+ {
+ OSL_ENSURE( false,
+ "UniversalContentBroker::getContentProviderData - Invalid argument!" );
+ return false;
+ }
+
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xConfigProv(
+ m_xSMgr->createInstance(
+ rtl::OUString::createFromAscii(
+ "com.sun.star.configuration.ConfigurationProvider" ) ),
+ uno::UNO_QUERY_THROW );
+
+ rtl::OUStringBuffer aFullPath;
+ aFullPath.appendAscii( CONFIG_CONTENTPROVIDERS_KEY "/['" );
+ makeAndAppendXMLName( aFullPath, rKey1 );
+ aFullPath.appendAscii( "']/SecondaryKeys/['" );
+ makeAndAppendXMLName( aFullPath, rKey2 );
+ aFullPath.appendAscii( "']/ProviderData" );
+
+ uno::Sequence< uno::Any > aArguments( 1 );
+ beans::PropertyValue aProperty;
+ aProperty.Name
+ = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) );
+ aProperty.Value <<= aFullPath.makeStringAndClear();
+ aArguments[ 0 ] <<= aProperty;
+
+ uno::Reference< uno::XInterface > xInterface(
+ xConfigProv->createInstanceWithArguments(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationAccess" ) ),
+ aArguments ) );
+
+ if ( !m_xNotifier.is() )
+ {
+ m_xNotifier = uno::Reference< util::XChangesNotifier >(
+ xInterface, uno::UNO_QUERY_THROW );
+
+ m_xNotifier->addChangesListener( this );
+ }
+
+ uno::Reference< container::XNameAccess > xNameAccess(
+ xInterface, uno::UNO_QUERY_THROW );
+
+ uno::Sequence< rtl::OUString > aElems = xNameAccess->getElementNames();
+ const rtl::OUString* pElems = aElems.getConstArray();
+ sal_Int32 nCount = aElems.getLength();
+
+ if ( nCount > 0 )
+ {
+ uno::Reference< container::XHierarchicalNameAccess >
+ xHierNameAccess( xInterface, uno::UNO_QUERY_THROW );
+
+ // Iterate over children.
+ for ( sal_Int32 n = 0; n < nCount; ++n )
+ {
+
+ try
+ {
+
+ ContentProviderData aInfo;
+
+ rtl::OUStringBuffer aElemBuffer;
+ aElemBuffer.appendAscii( "['" );
+ makeAndAppendXMLName( aElemBuffer, pElems[ n ] );
+ aElemBuffer.appendAscii( "']" );
+
+ createContentProviderData(aElemBuffer.makeStringAndClear(), xHierNameAccess, aInfo);
+
+ rListToFill.push_back( aInfo );
+ }
+ catch ( container::NoSuchElementException& )
+ {
+ // getByHierarchicalName
+ OSL_ENSURE( false,
+ "UniversalContentBroker::getContentProviderData - "
+ "caught NoSuchElementException!" );
+ }
+ }
+ }
+ }
+ catch ( uno::RuntimeException& )
+ {
+ OSL_ENSURE( false,
+ "UniversalContentBroker::getContentProviderData - caught RuntimeException!" );
+ return false;
+ }
+ catch ( uno::Exception& )
+ {
+ // createInstance, createInstanceWithArguments
+
+ OSL_ENSURE( false,
+ "UniversalContentBroker::getContentProviderData - caught Exception!" );
+ return false;
+ }
+
+ 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.
@@ -545,4 +954,3 @@ Reference< XContentProvider > ProviderListEntry_Impl::resolveProvider() const
return m_xResolvedProvider;
}
-
diff --git a/ucb/source/core/ucb.hxx b/ucb/source/core/ucb.hxx
index 12bb730f27bb..0e44c5bc99b5 100644
--- a/ucb/source/core/ucb.hxx
+++ b/ucb/source/core/ucb.hxx
@@ -37,13 +37,20 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
+#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>
#include <osl/mutex.hxx>
#include <osl/interlck.h>
#include <ucbhelper/macros.hxx>
#include "providermap.hxx"
+#include <ucbhelper/registerucb.hxx>
+#include <vector>
//=========================================================================
#define UCB_SERVICE_NAME "com.sun.star.ucb.UniversalContentBroker"
@@ -66,7 +73,8 @@ class UniversalContentBroker :
public com::sun::star::ucb::XContentProviderManager,
public com::sun::star::ucb::XContentProvider,
public com::sun::star::ucb::XContentIdentifierFactory,
- public com::sun::star::ucb::XCommandProcessor
+ public com::sun::star::ucb::XCommandProcessor,
+ public com::sun::star::util::XChangesListener
{
public:
UniversalContentBroker( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rXSMgr );
@@ -162,6 +170,14 @@ public:
abort( sal_Int32 CommandId )
throw( com::sun::star::uno::RuntimeException );
+ // XChangesListener
+ virtual void SAL_CALL changesOccurred( const com::sun::star::util::ChangesEvent& Event )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XEventListener ( base of XChangesLisetenr )
+ virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source )
+ throw( com::sun::star::uno::RuntimeException );
+
private:
com::sun::star::uno::Reference< com::sun::star::ucb::XContentProvider >
queryContentProvider( const rtl::OUString& Identifier,
@@ -177,8 +193,29 @@ private:
com::sun::star::ucb::XCommandEnvironment >& xEnv )
throw( com::sun::star::uno::Exception );
+
+ bool configureUcb()
+ throw ( com::sun::star::uno::RuntimeException);
+
+ bool getContentProviderData(
+ const rtl::OUString & rKey1,
+ const rtl::OUString & rKey2,
+ ucbhelper::ContentProviderDataList & rListToFill);
+
+ 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;
+
+ com::sun::star::uno::Reference<
+ com::sun::star::util::XChangesNotifier > m_xNotifier;
+
+ com::sun::star::uno::Sequence< com::sun::star::uno::Any > m_aArguments;
ProviderMap_Impl m_aProviders;
osl::Mutex m_aMutex;
cppu::OInterfaceContainerHelper* m_pDisposeEventListeners;
diff --git a/ucb/source/sorter/exports.map b/ucb/source/sorter/exports.map
deleted file mode 100644
index 953380b4a923..000000000000
--- a/ucb/source/sorter/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-SRT_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/sorter/makefile.mk b/ucb/source/sorter/makefile.mk
index 5077be80b411..68a9959589d2 100644
--- a/ucb/source/sorter/makefile.mk
+++ b/ucb/source/sorter/makefile.mk
@@ -54,7 +54,7 @@ SHL1STDLIBS=\
SHL1LIBS=$(LIB1TARGET)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
DEF1NAME=$(SHL1TARGET)
.ENDIF # L10N_framework
diff --git a/ucb/source/ucp/expand/makefile.mk b/ucb/source/ucp/expand/makefile.mk
index aaa7b85edbf1..32de160318f2 100644
--- a/ucb/source/ucp/expand/makefile.mk
+++ b/ucb/source/ucp/expand/makefile.mk
@@ -46,7 +46,7 @@ SHL1STDLIBS = \
$(CPPULIB) \
$(SALLIB)
-SHL1VERSIONMAP = $(TARGET).map
+SHL1VERSIONMAP = $(SOLARENV)/src/component.map
SHL1TARGET = $(TARGET)
SHL1DEPN =
diff --git a/ucb/source/ucp/expand/ucpexpand1.uno.map b/ucb/source/ucp/expand/ucpexpand1.uno.map
deleted file mode 100644
index 563b3d86a5d0..000000000000
--- a/ucb/source/ucp/expand/ucpexpand1.uno.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/ext/makefile.mk b/ucb/source/ucp/ext/makefile.mk
new file mode 100644
index 000000000000..23c30b3bda5b
--- /dev/null
+++ b/ucb/source/ucp/ext/makefile.mk
@@ -0,0 +1,65 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.4 $
+#
+# 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 = ucb
+TARGET = ucpext.uno
+ENABLE_EXCEPTIONS = TRUE
+
+.INCLUDE : settings.mk
+DLLPRE =
+
+SLOFILES= \
+ $(SLO)$/ucpext_provider.obj \
+ $(SLO)$/ucpext_content.obj \
+ $(SLO)$/ucpext_services.obj \
+ $(SLO)$/ucpext_resultset.obj \
+ $(SLO)$/ucpext_datasupplier.obj
+
+SHL1STDLIBS = \
+ $(UCBHELPERLIB) \
+ $(COMPHELPERLIB) \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(SALLIB) \
+ $(SALHELPERLIB)
+
+SHL1VERSIONMAP = $(SOLARENV)/src/component.map
+SHL1TARGET = $(TARGET)
+
+SHL1DEPN =
+SHL1IMPLIB = i$(TARGET)
+SHL1LIBS = $(SLB)$/$(TARGET).lib
+SHL1DEF = $(MISC)$/$(SHL1TARGET).def
+
+DEF1NAME = $(SHL1TARGET)
+
+.INCLUDE : target.mk
diff --git a/ucb/source/ucp/ext/ucpext_content.cxx b/ucb/source/ucp/ext/ucpext_content.cxx
new file mode 100644
index 000000000000..7b7ada742840
--- /dev/null
+++ b/ucb/source/ucp/ext/ucpext_content.cxx
@@ -0,0 +1,672 @@
+/*************************************************************************
+ * 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_ucb.hxx"
+
+#include "ucpext_content.hxx"
+
+#include "ucpext_content.hxx"
+#include "ucpext_provider.hxx"
+#include "ucpext_resultset.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/beans/XPropertyAccess.hpp>
+#include <com/sun/star/lang/IllegalAccessException.hpp>
+#include <com/sun/star/sdbc/XRow.hpp>
+#include <com/sun/star/ucb/XCommandInfo.hpp>
+#include <com/sun/star/ucb/XPersistentPropertySet.hpp>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/io/XActiveDataSink.hpp>
+#include <com/sun/star/ucb/OpenCommandArgument2.hpp>
+#include <com/sun/star/ucb/OpenMode.hpp>
+#include <com/sun/star/ucb/UnsupportedDataSinkException.hpp>
+#include <com/sun/star/ucb/UnsupportedOpenModeException.hpp>
+#include <com/sun/star/ucb/OpenCommandArgument2.hpp>
+#include <com/sun/star/ucb/OpenMode.hpp>
+#include <com/sun/star/ucb/XDynamicResultSet.hpp>
+#include <com/sun/star/lang/IllegalAccessException.hpp>
+#include <com/sun/star/deployment/XPackageInformationProvider.hpp>
+/** === end UNO includes === **/
+
+#include <ucbhelper/contentidentifier.hxx>
+#include <ucbhelper/propertyvalueset.hxx>
+#include <ucbhelper/cancelcommandexecution.hxx>
+#include <ucbhelper/content.hxx>
+#include <tools/diagnose_ex.h>
+#include <comphelper/string.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <rtl/uri.hxx>
+
+#include <algorithm>
+
+//......................................................................................................................
+namespace ucb { namespace ucp { namespace ext
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::lang::XMultiServiceFactory;
+ using ::com::sun::star::ucb::XContentIdentifier;
+ using ::com::sun::star::ucb::IllegalIdentifierException;
+ using ::com::sun::star::ucb::XContent;
+ using ::com::sun::star::ucb::XCommandEnvironment;
+ using ::com::sun::star::ucb::Command;
+ using ::com::sun::star::ucb::CommandAbortedException;
+ using ::com::sun::star::beans::Property;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ using ::com::sun::star::beans::PropertyValue;
+ using ::com::sun::star::ucb::OpenCommandArgument2;
+ using ::com::sun::star::ucb::XDynamicResultSet;
+ using ::com::sun::star::ucb::UnsupportedOpenModeException;
+ using ::com::sun::star::io::XOutputStream;
+ using ::com::sun::star::io::XActiveDataSink;
+ using ::com::sun::star::io::XInputStream;
+ using ::com::sun::star::ucb::UnsupportedDataSinkException;
+ using ::com::sun::star::ucb::UnsupportedCommandException;
+ using ::com::sun::star::sdbc::XRow;
+ using ::com::sun::star::beans::XPropertySet;
+ using ::com::sun::star::beans::PropertyChangeEvent;
+ using ::com::sun::star::lang::IllegalAccessException;
+ using ::com::sun::star::ucb::CommandInfo;
+ using ::com::sun::star::deployment::XPackageInformationProvider;
+ /** === end UNO using === **/
+ namespace OpenMode = ::com::sun::star::ucb::OpenMode;
+ namespace PropertyAttribute = ::com::sun::star::beans::PropertyAttribute;
+
+ //==================================================================================================================
+ //= helper
+ //==================================================================================================================
+ namespace
+ {
+ //--------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString lcl_compose( const ::rtl::OUString& i_rBaseURL, const ::rtl::OUString& i_rRelativeURL )
+ {
+ ENSURE_OR_RETURN( i_rBaseURL.getLength(), "illegal base URL", i_rRelativeURL );
+
+ ::rtl::OUStringBuffer aComposer( i_rBaseURL );
+ if ( i_rBaseURL.getStr()[ i_rBaseURL.getLength() - 1 ] != '/' )
+ aComposer.append( sal_Unicode( '/' ) );
+ aComposer.append( i_rRelativeURL );
+ return aComposer.makeStringAndClear();
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ struct SelectPropertyName : public ::std::unary_function< Property, ::rtl::OUString >
+ {
+ const ::rtl::OUString& operator()( const Property& i_rProperty ) const
+ {
+ return i_rProperty.Name;
+ }
+ };
+ }
+
+ //==================================================================================================================
+ //= Content
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ Content::Content( const Reference< XMultiServiceFactory >& i_rORB, ::ucbhelper::ContentProviderImplHelper* i_pProvider,
+ const Reference< XContentIdentifier >& i_rIdentifier )
+ :Content_Base( i_rORB, i_pProvider, i_rIdentifier )
+ ,m_eExtContentType( E_UNKNOWN )
+ ,m_aIsFolder()
+ ,m_aContentType()
+ ,m_sExtensionId()
+ ,m_sPathIntoExtension()
+ {
+ const ::rtl::OUString sURL( getIdentifier()->getContentIdentifier() );
+ if ( denotesRootContent( sURL ) )
+ {
+ m_eExtContentType = E_ROOT;
+ }
+ else
+ {
+ const ::rtl::OUString sRelativeURL( sURL.copy( ContentProvider::getRootURL().getLength() ) );
+ const sal_Int32 nSepPos = sRelativeURL.indexOf( '/' );
+ if ( ( nSepPos == -1 ) || ( nSepPos == sRelativeURL.getLength() - 1 ) )
+ {
+ m_eExtContentType = E_EXTENSION_ROOT;
+ }
+ else
+ {
+ m_eExtContentType = E_EXTENSION_CONTENT;
+ }
+ }
+
+ if ( m_eExtContentType != E_ROOT )
+ {
+ const ::rtl::OUString sRootURL = ContentProvider::getRootURL();
+ m_sExtensionId = sURL.copy( sRootURL.getLength() );
+
+ const sal_Int32 nNextSep = m_sExtensionId.indexOf( '/' );
+ if ( nNextSep > -1 )
+ {
+ m_sPathIntoExtension = m_sExtensionId.copy( nNextSep + 1 );
+ m_sExtensionId = m_sExtensionId.copy( 0, nNextSep );
+ }
+ m_sExtensionId = Content::decodeIdentifier( m_sExtensionId );
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Content::~Content()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL Content::getImplementationName() throw( RuntimeException )
+ {
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.comp.ucp.ext.Content" ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL Content::getSupportedServiceNames() throw( RuntimeException )
+ {
+ Sequence< ::rtl::OUString > aServiceNames(2);
+ aServiceNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.Content" ) );
+ aServiceNames[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.ExtensionContent" ) );
+ return aServiceNames;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL Content::getContentType() throw( RuntimeException )
+ {
+ impl_determineContentType();
+ return *m_aContentType;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Any SAL_CALL Content::execute( const Command& aCommand, sal_Int32 /* CommandId */, const Reference< XCommandEnvironment >& i_rEvironment )
+ throw( Exception, CommandAbortedException, RuntimeException )
+ {
+ Any aRet;
+
+ if ( aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "getPropertyValues" ) ) )
+ {
+ Sequence< Property > Properties;
+ if ( !( aCommand.Argument >>= Properties ) )
+ {
+ ::ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException(
+ ::rtl::OUString(), *this, -1 ) ),
+ i_rEvironment );
+ // unreachable
+ }
+
+ aRet <<= getPropertyValues( Properties, i_rEvironment );
+ }
+ else if ( aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "setPropertyValues" ) ) )
+ {
+ Sequence< PropertyValue > aProperties;
+ if ( !( aCommand.Argument >>= aProperties ) )
+ {
+ ::ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException(
+ ::rtl::OUString(), *this, -1 ) ),
+ i_rEvironment );
+ // unreachable
+ }
+
+ if ( !aProperties.getLength() )
+ {
+ ::ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException(
+ ::rtl::OUString(), *this, -1 ) ),
+ i_rEvironment );
+ // unreachable
+ }
+
+ aRet <<= setPropertyValues( aProperties, i_rEvironment );
+ }
+ else if ( aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "getPropertySetInfo" ) ) )
+ {
+ // implemented by base class.
+ aRet <<= getPropertySetInfo( i_rEvironment );
+ }
+ else if ( aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "getCommandInfo" ) ) )
+ {
+ // implemented by base class.
+ aRet <<= getCommandInfo( i_rEvironment );
+ }
+ else if ( aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "open" ) ) )
+ {
+ OpenCommandArgument2 aOpenCommand;
+ if ( !( aCommand.Argument >>= aOpenCommand ) )
+ {
+ ::ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException(
+ ::rtl::OUString(), *this, -1 ) ),
+ i_rEvironment );
+ // unreachable
+ }
+
+ sal_Bool bOpenFolder =
+ ( ( aOpenCommand.Mode == OpenMode::ALL ) ||
+ ( aOpenCommand.Mode == OpenMode::FOLDERS ) ||
+ ( aOpenCommand.Mode == OpenMode::DOCUMENTS ) );
+
+
+ if ( bOpenFolder && impl_isFolder() )
+ {
+ Reference< XDynamicResultSet > xSet = new ResultSet(
+ m_xSMgr, this, aOpenCommand, i_rEvironment );
+ aRet <<= xSet;
+ }
+
+ if ( aOpenCommand.Sink.is() )
+ {
+ const ::rtl::OUString sPhysicalContentURL( getPhysicalURL() );
+ ::ucbhelper::Content aRequestedContent( sPhysicalContentURL, i_rEvironment );
+ aRet = aRequestedContent.executeCommand( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ), makeAny( aOpenCommand ) );
+ }
+ }
+
+ else
+ {
+ ::ucbhelper::cancelCommandExecution( makeAny( UnsupportedCommandException(
+ ::rtl::OUString(), *this ) ),
+ i_rEvironment );
+ // unreachable
+ }
+
+ return aRet;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL Content::abort( sal_Int32 ) throw( RuntimeException )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString Content::encodeIdentifier( const ::rtl::OUString& i_rIdentifier )
+ {
+ return ::rtl::Uri::encode( i_rIdentifier, rtl_UriCharClassRegName, rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8 );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString Content::decodeIdentifier( const ::rtl::OUString& i_rIdentifier )
+ {
+ return ::rtl::Uri::decode( i_rIdentifier, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool Content::denotesRootContent( const ::rtl::OUString& i_rContentIdentifier )
+ {
+ const ::rtl::OUString sRootURL( ContentProvider::getRootURL() );
+ if ( i_rContentIdentifier == sRootURL )
+ return true;
+
+ // the root URL contains only two trailing /, but we also recognize 3 of them as denoting the root URL
+ if ( i_rContentIdentifier.match( sRootURL )
+ && ( i_rContentIdentifier.getLength() == sRootURL.getLength() + 1 )
+ && ( i_rContentIdentifier[ i_rContentIdentifier.getLength() - 1 ] == '/' )
+ )
+ return true;
+
+ return false;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString Content::getParentURL()
+ {
+ const ::rtl::OUString sRootURL( ContentProvider::getRootURL() );
+
+ switch ( m_eExtContentType )
+ {
+ case E_ROOT:
+ // don't have a parent
+ return sRootURL;
+
+ case E_EXTENSION_ROOT:
+ // our parent is the root itself
+ return sRootURL;
+
+ case E_EXTENSION_CONTENT:
+ {
+ const ::rtl::OUString sURL = m_xIdentifier->getContentIdentifier();
+
+ // cut the root URL
+ ENSURE_OR_BREAK( sURL.match( sRootURL, 0 ), "illegal URL structure - no root" );
+ ::rtl::OUString sRelativeURL( sURL.copy( sRootURL.getLength() ) );
+
+ // cut the extension ID
+ const ::rtl::OUString sSeparatedExtensionId( encodeIdentifier( m_sExtensionId ) + ::rtl::OUString( sal_Unicode( '/' ) ) );
+ ENSURE_OR_BREAK( sRelativeURL.match( sSeparatedExtensionId ), "illegal URL structure - no extension ID" );
+ sRelativeURL = sRelativeURL.copy( sSeparatedExtensionId.getLength() );
+
+ // cut the final slash (if any)
+ ENSURE_OR_BREAK( sRelativeURL.getLength(), "illegal URL structure - ExtensionContent should have a level below the extension ID" );
+ if ( sRelativeURL.getStr()[ sRelativeURL.getLength() - 1 ] == '/' )
+ sRelativeURL = sRelativeURL.copy( 0, sRelativeURL.getLength() - 1 );
+
+ // remove the last segment
+ const sal_Int32 nLastSep = sRelativeURL.lastIndexOf( '/' );
+ sRelativeURL = sRelativeURL.copy( 0, nLastSep != -1 ? nLastSep : 0 );
+
+ ::rtl::OUStringBuffer aComposer;
+ aComposer.append( sRootURL );
+ aComposer.append( sSeparatedExtensionId );
+ aComposer.append( sRelativeURL );
+ return aComposer.makeStringAndClear();
+ }
+
+ default:
+ OSL_ENSURE( false, "Content::getParentURL: unhandled case!" );
+ break;
+ }
+ return ::rtl::OUString();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XRow > Content::getArtificialNodePropertyValues( const Reference< XMultiServiceFactory >& i_rORB,
+ const Sequence< Property >& i_rProperties, const ::rtl::OUString& i_rTitle )
+ {
+ // note: empty sequence means "get values of all supported properties".
+ ::rtl::Reference< ::ucbhelper::PropertyValueSet > xRow = new ::ucbhelper::PropertyValueSet( i_rORB );
+
+ const sal_Int32 nCount = i_rProperties.getLength();
+ if ( nCount )
+ {
+ Reference< XPropertySet > xAdditionalPropSet;
+
+ const Property* pProps = i_rProperties.getConstArray();
+ for ( sal_Int32 n = 0; n < nCount; ++n )
+ {
+ const Property& rProp = pProps[ n ];
+
+ // Process Core properties.
+ if ( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ContentType" ) ) )
+ {
+ xRow->appendString ( rProp, ContentProvider::getArtificialNodeContentType() );
+ }
+ else if ( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Title" ) ) )
+ {
+ xRow->appendString ( rProp, i_rTitle );
+ }
+ else if ( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) )
+ {
+ xRow->appendBoolean( rProp, sal_False );
+ }
+ else if ( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) )
+ {
+ xRow->appendBoolean( rProp, sal_True );
+ }
+ else
+ {
+ // append empty entry.
+ xRow->appendVoid( rProp );
+ }
+ }
+ }
+ else
+ {
+ // Append all Core Properties.
+ xRow->appendString ( Property( ::rtl::OUString::createFromAscii( "ContentType" ),
+ -1,
+ getCppuType( static_cast< const ::rtl::OUString * >( 0 ) ),
+ PropertyAttribute::BOUND | PropertyAttribute::READONLY ),
+ ContentProvider::getArtificialNodeContentType() );
+ xRow->appendString ( Property( ::rtl::OUString::createFromAscii( "Title" ),
+ -1,
+ getCppuType( static_cast< const ::rtl::OUString * >( 0 ) ),
+ PropertyAttribute::BOUND | PropertyAttribute::READONLY ),
+ i_rTitle );
+ xRow->appendBoolean( Property( ::rtl::OUString::createFromAscii( "IsDocument" ),
+ -1,
+ getCppuBooleanType(),
+ PropertyAttribute::BOUND | PropertyAttribute::READONLY ),
+ sal_False );
+ xRow->appendBoolean( Property( ::rtl::OUString::createFromAscii( "IsFolder" ),
+ -1,
+ getCppuBooleanType(),
+ PropertyAttribute::BOUND | PropertyAttribute::READONLY ),
+ sal_True );
+ }
+
+ return Reference< XRow >( xRow.get() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString Content::getPhysicalURL() const
+ {
+ ENSURE_OR_RETURN( m_eExtContentType != E_ROOT, "illegal call", ::rtl::OUString() );
+
+ // create an ucb::XContent for the physical file within the deployed extension
+ const ::comphelper::ComponentContext aContext( m_xSMgr );
+ const Reference< XPackageInformationProvider > xPackageInfo(
+ aContext.getSingleton( "com.sun.star.deployment.PackageInformationProvider" ), UNO_QUERY_THROW );
+ const ::rtl::OUString sPackageLocation( xPackageInfo->getPackageLocation( m_sExtensionId ) );
+
+ if ( m_sPathIntoExtension.getLength() == 0 )
+ return sPackageLocation;
+ return lcl_compose( sPackageLocation, m_sPathIntoExtension );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XRow > Content::getPropertyValues( const Sequence< Property >& i_rProperties, const Reference< XCommandEnvironment >& i_rEnv )
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( m_aMutex );
+
+ switch ( m_eExtContentType )
+ {
+ case E_ROOT:
+ return getArtificialNodePropertyValues( m_xSMgr, i_rProperties, ContentProvider::getRootURL() );
+ case E_EXTENSION_ROOT:
+ return getArtificialNodePropertyValues( m_xSMgr, i_rProperties, m_sExtensionId );
+ case E_EXTENSION_CONTENT:
+ {
+ const ::rtl::OUString sPhysicalContentURL( getPhysicalURL() );
+ ::ucbhelper::Content aRequestedContent( sPhysicalContentURL, i_rEnv );
+
+ // translate the property request
+ Sequence< ::rtl::OUString > aPropertyNames( i_rProperties.getLength() );
+ ::std::transform(
+ i_rProperties.getConstArray(),
+ i_rProperties.getConstArray() + i_rProperties.getLength(),
+ aPropertyNames.getArray(),
+ SelectPropertyName()
+ );
+ const Sequence< Any > aPropertyValues = aRequestedContent.getPropertyValues( aPropertyNames );
+ const ::rtl::Reference< ::ucbhelper::PropertyValueSet > xValueRow = new ::ucbhelper::PropertyValueSet( m_xSMgr );
+ sal_Int32 i=0;
+ for ( const Any* value = aPropertyValues.getConstArray();
+ value != aPropertyValues.getConstArray() + aPropertyValues.getLength();
+ ++value, ++i
+ )
+ {
+ xValueRow->appendObject( aPropertyNames[i], *value );
+ }
+ return xValueRow.get();
+ }
+
+ default:
+ OSL_ENSURE( false, "Content::getPropertyValues: unhandled case!" );
+ break;
+ }
+
+ OSL_ENSURE( false, "Content::getPropertyValues: unreachable!" );
+ return NULL;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< Any > Content::setPropertyValues( const Sequence< PropertyValue >& i_rValues, const Reference< XCommandEnvironment >& /* xEnv */)
+ {
+ ::osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex );
+
+ Sequence< Any > aRet( i_rValues.getLength() );
+ Sequence< PropertyChangeEvent > aChanges( i_rValues.getLength() );
+
+ PropertyChangeEvent aEvent;
+ aEvent.Source = static_cast< cppu::OWeakObject * >( this );
+ aEvent.Further = sal_False;
+ aEvent.PropertyHandle = -1;
+
+ const PropertyValue* pValues = i_rValues.getConstArray();
+ const sal_Int32 nCount = i_rValues.getLength();
+
+ for ( sal_Int32 n = 0; n < nCount; ++n, ++pValues )
+ {
+ // all our properties are read-only ...
+ aRet[ n ] <<= IllegalAccessException( ::rtl::OUString::createFromAscii( "property is read-only." ), *this );
+ }
+
+ return aRet;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< CommandInfo > Content::getCommands( const Reference< XCommandEnvironment > & /*xEnv*/ )
+ {
+ sal_uInt32 nCommandCount = 5;
+ static const CommandInfo aCommandInfoTable[] =
+ {
+ ///////////////////////////////////////////////////////////////
+ // Mandatory commands
+ ///////////////////////////////////////////////////////////////
+ CommandInfo(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
+ -1,
+ getCppuVoidType()
+ ),
+ CommandInfo(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
+ -1,
+ getCppuVoidType()
+ ),
+ CommandInfo(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
+ -1,
+ getCppuType(
+ static_cast< Sequence< Property > * >( 0 ) )
+ ),
+ CommandInfo(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
+ -1,
+ getCppuType(
+ static_cast< Sequence< PropertyValue > * >( 0 ) )
+ )
+ ///////////////////////////////////////////////////////////////
+ // Optional standard commands
+ ///////////////////////////////////////////////////////////////
+ , CommandInfo(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
+ -1,
+ getCppuType( static_cast< OpenCommandArgument2 * >( 0 ) )
+ )
+ };
+
+ return Sequence< CommandInfo >( aCommandInfoTable, nCommandCount );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< Property > Content::getProperties( const Reference< XCommandEnvironment > & /*xEnv*/ )
+ {
+ static Property aProperties[] =
+ {
+ Property(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ),
+ -1,
+ getCppuType( static_cast< const ::rtl::OUString * >( 0 ) ),
+ PropertyAttribute::BOUND | PropertyAttribute::READONLY
+ ),
+ Property(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ),
+ -1,
+ getCppuBooleanType(),
+ PropertyAttribute::BOUND | PropertyAttribute::READONLY
+ ),
+ Property(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ),
+ -1,
+ getCppuBooleanType(),
+ PropertyAttribute::BOUND | PropertyAttribute::READONLY
+ ),
+ Property(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
+ -1,
+ getCppuType( static_cast< const ::rtl::OUString * >( 0 ) ),
+ PropertyAttribute::BOUND | PropertyAttribute::READONLY
+ )
+ };
+ return Sequence< Property >( aProperties, sizeof( aProperties ) / sizeof( aProperties[0] ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool Content::impl_isFolder()
+ {
+ if ( !!m_aIsFolder )
+ return *m_aIsFolder;
+
+ bool bIsFolder = false;
+ try
+ {
+ Sequence< Property > aProps(1);
+ aProps[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) );
+ Reference< XRow > xRow( getPropertyValues( aProps, NULL ), UNO_SET_THROW );
+ bIsFolder = xRow->getBoolean(1);
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ m_aIsFolder.reset( bIsFolder );
+ return *m_aIsFolder;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void Content::impl_determineContentType()
+ {
+ if ( !!m_aContentType )
+ return;
+
+ m_aContentType.reset( ContentProvider::getArtificialNodeContentType() );
+ if ( m_eExtContentType == E_EXTENSION_CONTENT )
+ {
+ try
+ {
+ Sequence< Property > aProps(1);
+ aProps[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) );
+ Reference< XRow > xRow( getPropertyValues( aProps, NULL ), UNO_SET_THROW );
+ m_aContentType.reset( xRow->getString(1) );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
+
+//......................................................................................................................
+} } } // namespace ucp::ext
+//......................................................................................................................
diff --git a/ucb/source/ucp/ext/ucpext_content.hxx b/ucb/source/ucp/ext/ucpext_content.hxx
new file mode 100644
index 000000000000..36380d8a7d68
--- /dev/null
+++ b/ucb/source/ucp/ext/ucpext_content.hxx
@@ -0,0 +1,154 @@
+/*************************************************************************
+ * 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 UCB_UCPEXT_CONTENT_HXX
+#define UCB_UCPEXT_CONTENT_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/sdbc/XRow.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+/** === end UNO includes === **/
+
+#include <rtl/ref.hxx>
+#include <ucbhelper/contenthelper.hxx>
+
+#include <list>
+#include <boost/optional.hpp>
+
+//......................................................................................................................
+namespace ucb { namespace ucp { namespace ext
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= ExtensionContentType
+ //==================================================================================================================
+ enum ExtensionContentType
+ {
+ E_ROOT,
+ E_EXTENSION_ROOT,
+ E_EXTENSION_CONTENT,
+
+ E_UNKNOWN
+ };
+
+ //==================================================================================================================
+ //= ContentProvider
+ //==================================================================================================================
+ typedef ::ucbhelper::ContentImplHelper Content_Base;
+ class Content : public Content_Base
+ {
+ public:
+ Content(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+ ::ucbhelper::ContentProviderImplHelper* pProvider,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier >& Identifier
+ );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >
+ getArtificialNodePropertyValues(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSMgr,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& rProperties,
+ const ::rtl::OUString& rTitle
+ );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >
+ getPropertyValues(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& rProperties,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& xEnv
+ );
+
+ static ::rtl::OUString
+ encodeIdentifier( const ::rtl::OUString& i_rIdentifier );
+ static ::rtl::OUString
+ decodeIdentifier( const ::rtl::OUString& i_rIdentifier );
+
+ virtual ::rtl::OUString getParentURL();
+
+ ExtensionContentType getExtensionContentType() const { return m_eExtContentType; }
+
+ /** retrieves the URL of the underlying physical content. Not to be called when getExtensionContentType()
+ returns E_ROOT.
+ */
+ ::rtl::OUString getPhysicalURL() const;
+
+ protected:
+ virtual ~Content();
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XContent
+ virtual rtl::OUString SAL_CALL getContentType() throw( com::sun::star::uno::RuntimeException );
+
+ // XCommandProcessor
+ virtual com::sun::star::uno::Any SAL_CALL
+ execute(
+ const com::sun::star::ucb::Command& aCommand,
+ sal_Int32 CommandId,
+ const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& Environment
+ )
+ throw ( ::com::sun::star::uno::Exception
+ , ::com::sun::star::ucb::CommandAbortedException
+ , ::com::sun::star::uno::RuntimeException
+ );
+
+ virtual void SAL_CALL
+ abort(
+ sal_Int32 CommandId
+ )
+ throw ( ::com::sun::star::uno::RuntimeException
+ );
+
+ private:
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > getProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& i_rEnv );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::CommandInfo > getCommands( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& i_rEnv );
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
+ setPropertyValues(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rValues,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& xEnv
+ );
+
+ static bool denotesRootContent( const ::rtl::OUString& i_rContentIdentifier );
+
+ bool impl_isFolder();
+ void impl_determineContentType();
+
+ private:
+ ExtensionContentType m_eExtContentType;
+ ::boost::optional< bool > m_aIsFolder;
+ ::boost::optional< ::rtl::OUString > m_aContentType;
+ ::rtl::OUString m_sExtensionId;
+ ::rtl::OUString m_sPathIntoExtension;
+ };
+
+//......................................................................................................................
+} } } // namespace ucb::ucp::ext
+//......................................................................................................................
+
+#endif // UCB_UCPEXT_CONTENT_HXX
diff --git a/ucb/source/ucp/ext/ucpext_datasupplier.cxx b/ucb/source/ucp/ext/ucpext_datasupplier.cxx
new file mode 100644
index 000000000000..a3a9cc6876ff
--- /dev/null
+++ b/ucb/source/ucp/ext/ucpext_datasupplier.cxx
@@ -0,0 +1,375 @@
+/*************************************************************************
+ * 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_ucb.hxx"
+
+#include "ucpext_datasupplier.hxx"
+#include "ucpext_content.hxx"
+#include "ucpext_provider.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/deployment/XPackageInformationProvider.hpp>
+/** === end UNO includes === **/
+
+#include <ucbhelper/contentidentifier.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <ucbhelper/providerhelper.hxx>
+#include <ucbhelper/content.hxx>
+#include <ucbhelper/propertyvalueset.hxx>
+#include <tools/diagnose_ex.h>
+#include <rtl/ustrbuf.hxx>
+
+#include <vector>
+#include <boost/shared_ptr.hpp>
+
+//......................................................................................................................
+namespace ucb { namespace ucp { namespace ext
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::ucb::XContent;
+ using ::com::sun::star::ucb::XContentIdentifier;
+ using ::com::sun::star::sdbc::XRow;
+ using ::com::sun::star::lang::XMultiServiceFactory;
+ using ::com::sun::star::ucb::IllegalIdentifierException;
+ using ::com::sun::star::ucb::ResultSetException;
+ using ::com::sun::star::deployment::XPackageInformationProvider;
+ using ::com::sun::star::beans::Property;
+ using ::com::sun::star::sdbc::XResultSet;
+ using ::com::sun::star::sdbc::XRow;
+ using ::com::sun::star::ucb::XCommandEnvironment;
+ /** === end UNO using === **/
+ //==================================================================================================================
+ //= ResultListEntry
+ //==================================================================================================================
+ struct ResultListEntry
+ {
+ ::rtl::OUString sId;
+ Reference< XContentIdentifier > xId;
+ ::rtl::Reference< Content > pContent;
+ Reference< XRow > xRow;
+ };
+
+ typedef ::std::vector< ResultListEntry > ResultList;
+
+ //==================================================================================================================
+ //= DataSupplier_Impl
+ //==================================================================================================================
+ struct DataSupplier_Impl
+ {
+ ::osl::Mutex m_aMutex;
+ ResultList m_aResults;
+ ::rtl::Reference< Content > m_xContent;
+ Reference< XMultiServiceFactory > m_xSMgr;
+ sal_Int32 m_nOpenMode;
+
+ DataSupplier_Impl( const Reference< XMultiServiceFactory >& i_rORB, const ::rtl::Reference< Content >& i_rContent,
+ const sal_Int32 i_nOpenMode )
+ :m_xContent( i_rContent )
+ ,m_xSMgr( i_rORB )
+ ,m_nOpenMode( i_nOpenMode )
+ {
+ }
+ ~DataSupplier_Impl();
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ DataSupplier_Impl::~DataSupplier_Impl()
+ {
+ }
+
+ //==================================================================================================================
+ //= helper
+ //==================================================================================================================
+ namespace
+ {
+ ::rtl::OUString lcl_compose( const ::rtl::OUString& i_rBaseURL, const ::rtl::OUString& i_rRelativeURL )
+ {
+ ENSURE_OR_RETURN( i_rBaseURL.getLength(), "illegal base URL", i_rRelativeURL );
+
+ ::rtl::OUStringBuffer aComposer( i_rBaseURL );
+ if ( i_rBaseURL.getStr()[ i_rBaseURL.getLength() - 1 ] != '/' )
+ aComposer.append( sal_Unicode( '/' ) );
+ aComposer.append( i_rRelativeURL );
+ return aComposer.makeStringAndClear();
+ }
+ }
+
+
+ //==================================================================================================================
+ //= DataSupplier
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ DataSupplier::DataSupplier( const Reference< XMultiServiceFactory >& i_rORB,
+ const ::rtl::Reference< Content >& i_rContent,
+ const sal_Int32 i_nOpenMode )
+ :m_pImpl( new DataSupplier_Impl( i_rORB, i_rContent, i_nOpenMode ) )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void DataSupplier::fetchData()
+ {
+ try
+ {
+ const ::comphelper::ComponentContext aContext( m_pImpl->m_xSMgr );
+ const Reference< XPackageInformationProvider > xPackageInfo(
+ aContext.getSingleton( "com.sun.star.deployment.PackageInformationProvider" ), UNO_QUERY_THROW );
+
+ const ::rtl::OUString sContentIdentifier( m_pImpl->m_xContent->getIdentifier()->getContentIdentifier() );
+
+ switch ( m_pImpl->m_xContent->getExtensionContentType() )
+ {
+ case E_ROOT:
+ {
+ Sequence< Sequence< ::rtl::OUString > > aExtensionInfo( xPackageInfo->getExtensionList() );
+ for ( const Sequence< ::rtl::OUString >* pExtInfo = aExtensionInfo.getConstArray();
+ pExtInfo != aExtensionInfo.getConstArray() + aExtensionInfo.getLength();
+ ++pExtInfo
+ )
+ {
+ ENSURE_OR_CONTINUE( pExtInfo->getLength() > 0, "illegal extension info" );
+
+ const ::rtl::OUString& rLocalId = (*pExtInfo)[0];
+ ResultListEntry aEntry;
+ aEntry.sId = ContentProvider::getRootURL() + Content::encodeIdentifier( rLocalId ) + ::rtl::OUString( sal_Unicode( '/' ) );
+ m_pImpl->m_aResults.push_back( aEntry );
+ }
+ }
+ break;
+ case E_EXTENSION_ROOT:
+ case E_EXTENSION_CONTENT:
+ {
+ const ::rtl::OUString sPackageLocation( m_pImpl->m_xContent->getPhysicalURL() );
+ ::ucbhelper::Content aWrappedContent( sPackageLocation, getResultSet()->getEnvironment() );
+
+ // obtain the properties which our result set is set up for from the wrapped content
+ Sequence< ::rtl::OUString > aPropertyNames(1);
+ aPropertyNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) );
+
+ const Reference< XResultSet > xFolderContent( aWrappedContent.createCursor( aPropertyNames ), UNO_SET_THROW );
+ const Reference< XRow > xContentRow( xFolderContent, UNO_QUERY_THROW );
+ while ( xFolderContent->next() )
+ {
+ ResultListEntry aEntry;
+ aEntry.sId = lcl_compose( sContentIdentifier, xContentRow->getString( 1 ) );
+ m_pImpl->m_aResults.push_back( aEntry );
+ }
+ }
+ break;
+ default:
+ OSL_ENSURE( false, "DataSupplier::fetchData: unimplemented content type!" );
+ break;
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ DataSupplier::~DataSupplier()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString DataSupplier::queryContentIdentifierString( sal_uInt32 i_nIndex )
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( m_pImpl->m_aMutex );
+
+ if ( i_nIndex < m_pImpl->m_aResults.size() )
+ {
+ const ::rtl::OUString sId = m_pImpl->m_aResults[ i_nIndex ].sId;
+ if ( sId.getLength() )
+ return sId;
+ }
+
+ OSL_ENSURE( false, "DataSupplier::queryContentIdentifierString: illegal index, or illegal result entry id!" );
+ return ::rtl::OUString();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XContentIdentifier > DataSupplier::queryContentIdentifier( sal_uInt32 i_nIndex )
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( m_pImpl->m_aMutex );
+
+ if ( i_nIndex < m_pImpl->m_aResults.size() )
+ {
+ Reference< XContentIdentifier > xId( m_pImpl->m_aResults[ i_nIndex ].xId );
+ if ( xId.is() )
+ return xId;
+ }
+
+ ::rtl::OUString sId = queryContentIdentifierString( i_nIndex );
+ if ( sId.getLength() )
+ {
+ Reference< XContentIdentifier > xId = new ::ucbhelper::ContentIdentifier( sId );
+ m_pImpl->m_aResults[ i_nIndex ].xId = xId;
+ return xId;
+ }
+
+ return Reference< XContentIdentifier >();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XContent > DataSupplier::queryContent( sal_uInt32 i_nIndex )
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( m_pImpl->m_aMutex );
+ ENSURE_OR_RETURN( i_nIndex < m_pImpl->m_aResults.size(), "illegal index!", NULL );
+
+
+ ::rtl::Reference< Content > pContent( m_pImpl->m_aResults[ i_nIndex ].pContent );
+ if ( pContent.is() )
+ return pContent.get();
+
+ Reference< XContentIdentifier > xId( queryContentIdentifier( i_nIndex ) );
+ if ( xId.is() )
+ {
+ try
+ {
+ Reference< XContent > xContent( m_pImpl->m_xContent->getProvider()->queryContent( xId ) );
+ pContent.set( dynamic_cast< Content* >( xContent.get() ) );
+ OSL_ENSURE( pContent.is() || !xContent.is(), "DataSupplier::queryContent: invalid content implementation!" );
+ m_pImpl->m_aResults[ i_nIndex ].pContent = pContent;
+ return pContent.get();
+
+ }
+ catch ( const IllegalIdentifierException& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ return Reference< XContent >();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool DataSupplier::getResult( sal_uInt32 i_nIndex )
+ {
+ ::osl::ClearableGuard< ::osl::Mutex > aGuard( m_pImpl->m_aMutex );
+
+ if ( m_pImpl->m_aResults.size() > i_nIndex )
+ // result already present.
+ return sal_True;
+
+ return sal_False;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_uInt32 DataSupplier::totalCount()
+ {
+ ::osl::ClearableGuard< ::osl::Mutex > aGuard( m_pImpl->m_aMutex );
+ return m_pImpl->m_aResults.size();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_uInt32 DataSupplier::currentCount()
+ {
+ return m_pImpl->m_aResults.size();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool DataSupplier::isCountFinal()
+ {
+ return sal_True;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XRow > DataSupplier::queryPropertyValues( sal_uInt32 i_nIndex )
+ {
+ ::osl::MutexGuard aGuard( m_pImpl->m_aMutex );
+ ENSURE_OR_RETURN( i_nIndex < m_pImpl->m_aResults.size(), "DataSupplier::queryPropertyValues: illegal index!", NULL );
+
+ Reference< XRow > xRow = m_pImpl->m_aResults[ i_nIndex ].xRow;
+ if ( xRow.is() )
+ return xRow;
+
+ ENSURE_OR_RETURN( queryContent( i_nIndex ).is(), "could not retrieve the content", NULL );
+
+ switch ( m_pImpl->m_xContent->getExtensionContentType() )
+ {
+ case E_ROOT:
+ {
+ const ::rtl::OUString& rId( m_pImpl->m_aResults[ i_nIndex ].sId );
+ const ::rtl::OUString sRootURL( ContentProvider::getRootURL() );
+ ::rtl::OUString sTitle = Content::decodeIdentifier( rId.copy( sRootURL.getLength() ) );
+ if ( ( sTitle.getLength() > 0 ) && ( sTitle[ sTitle.getLength() - 1 ] == '/' ) )
+ sTitle = sTitle.copy( 0, sTitle.getLength() - 1 );
+ xRow = Content::getArtificialNodePropertyValues( m_pImpl->m_xSMgr, getResultSet()->getProperties(), sTitle );
+ }
+ break;
+
+ case E_EXTENSION_ROOT:
+ case E_EXTENSION_CONTENT:
+ {
+ xRow = m_pImpl->m_aResults[ i_nIndex ].pContent->getPropertyValues(
+ getResultSet()->getProperties(), getResultSet()->getEnvironment() );
+ }
+ break;
+ default:
+ OSL_ENSURE( false, "DataSupplier::queryPropertyValues: unhandled case!" );
+ break;
+ }
+
+ m_pImpl->m_aResults[ i_nIndex ].xRow = xRow;
+ return xRow;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void DataSupplier::releasePropertyValues( sal_uInt32 i_nIndex )
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( m_pImpl->m_aMutex );
+
+ if ( i_nIndex < m_pImpl->m_aResults.size() )
+ m_pImpl->m_aResults[ i_nIndex ].xRow.clear();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void DataSupplier::close()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void DataSupplier::validate() throw( ResultSetException )
+ {
+ }
+
+//......................................................................................................................
+} } } // namespace ucp::ext
+//......................................................................................................................
diff --git a/ucb/source/ucp/ext/ucpext_datasupplier.hxx b/ucb/source/ucp/ext/ucpext_datasupplier.hxx
new file mode 100644
index 000000000000..526491cd678b
--- /dev/null
+++ b/ucb/source/ucp/ext/ucpext_datasupplier.hxx
@@ -0,0 +1,86 @@
+/*************************************************************************
+ * 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 UCB_UCPEXT_DATA_SUPPLIER_HXX
+#define UCB_UCPEXT_DATA_SUPPLIER_HXX
+
+#include <rtl/ref.hxx>
+#include <ucbhelper/resultset.hxx>
+
+#include <boost/scoped_ptr.hpp>
+
+//......................................................................................................................
+namespace ucb { namespace ucp { namespace ext
+{
+//......................................................................................................................
+
+ struct DataSupplier_Impl;
+ class Content;
+
+ //==================================================================================================================
+ //= DataSupplier
+ //==================================================================================================================
+ typedef ::ucbhelper::ResultSetDataSupplier DataSupplier_Base;
+ class DataSupplier : public ::ucbhelper::ResultSetDataSupplier
+ {
+ public:
+ DataSupplier(
+ const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& i_rORB,
+ const rtl::Reference< Content >& rContent,
+ const sal_Int32 nOpenMode
+ );
+
+ void fetchData();
+
+ protected:
+ virtual ~DataSupplier();
+
+ virtual rtl::OUString queryContentIdentifierString( sal_uInt32 nIndex );
+ virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > queryContentIdentifier( sal_uInt32 nIndex );
+ virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContent > queryContent( sal_uInt32 nIndex );
+
+ virtual sal_Bool getResult( sal_uInt32 nIndex );
+
+ virtual sal_uInt32 totalCount();
+ virtual sal_uInt32 currentCount();
+ virtual sal_Bool isCountFinal();
+
+ virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XRow > queryPropertyValues( sal_uInt32 nIndex );
+ virtual void releasePropertyValues( sal_uInt32 nIndex );
+
+ virtual void close();
+
+ virtual void validate() throw( com::sun::star::ucb::ResultSetException );
+
+ private:
+ ::boost::scoped_ptr< DataSupplier_Impl > m_pImpl;
+ };
+
+//......................................................................................................................
+} } } // namespace ucp::ext
+//......................................................................................................................
+
+#endif // UCB_UCPEXT_DATA_SUPPLIER_HXX
diff --git a/ucb/source/ucp/ext/ucpext_provider.cxx b/ucb/source/ucp/ext/ucpext_provider.cxx
new file mode 100644
index 000000000000..0fbad1d8cf17
--- /dev/null
+++ b/ucb/source/ucp/ext/ucpext_provider.cxx
@@ -0,0 +1,208 @@
+/*************************************************************************
+ * 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_ucb.hxx"
+
+#include "ucpext_provider.hxx"
+#include "ucpext_content.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+#include <ucbhelper/contentidentifier.hxx>
+#include <osl/diagnose.h>
+#include <osl/mutex.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <rtl/ustrbuf.hxx>
+
+//......................................................................................................................
+namespace ucb { namespace ucp { namespace ext
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::lang::XMultiServiceFactory;
+ using ::com::sun::star::ucb::XContentIdentifier;
+ using ::com::sun::star::ucb::IllegalIdentifierException;
+ using ::com::sun::star::ucb::XContent;
+ using ::com::sun::star::uno::XComponentContext;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= ContentProvider
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ ContentProvider::ContentProvider( const Reference< XMultiServiceFactory >& i_rServiceManager )
+ :ContentProvider_Base( i_rServiceManager )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ContentProvider::~ContentProvider()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL ContentProvider::getImplementationName_static() throw (RuntimeException)
+ {
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.comp.ucp.ext.ContentProvider" ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL ContentProvider::getImplementationName() throw (RuntimeException)
+ {
+ return getImplementationName_static();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL ContentProvider::getSupportedServiceNames_static( ) throw (RuntimeException)
+ {
+ Sequence< ::rtl::OUString > aServiceNames(2);
+ aServiceNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.ContentProvider" ) );
+ aServiceNames[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.ExtensionContentProvider" ) );
+ return aServiceNames;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL ContentProvider::getSupportedServiceNames( ) throw (RuntimeException)
+ {
+ return getSupportedServiceNames_static();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XInterface > ContentProvider::Create( const Reference< XComponentContext >& i_rContext )
+ {
+ const ::comphelper::ComponentContext aContext( i_rContext );
+ return *( new ContentProvider( aContext.getLegacyServiceFactory() ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString ContentProvider::getRootURL()
+ {
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.extension://" ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString ContentProvider::getArtificialNodeContentType()
+ {
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/vnd.sun.star.extension-content" ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ void lcl_ensureAndTransfer( ::rtl::OUString& io_rIdentifierFragment, ::rtl::OUStringBuffer& o_rNormalization, const sal_Unicode i_nLeadingChar )
+ {
+ if ( ( io_rIdentifierFragment.getLength() == 0 ) || ( io_rIdentifierFragment[0] != i_nLeadingChar ) )
+ throw IllegalIdentifierException();
+ io_rIdentifierFragment = io_rIdentifierFragment.copy( 1 );
+ o_rNormalization.append( i_nLeadingChar );
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XContent > SAL_CALL ContentProvider::queryContent( const Reference< XContentIdentifier >& i_rIdentifier )
+ throw( IllegalIdentifierException, RuntimeException )
+ {
+ // Check URL scheme...
+ const ::rtl::OUString sScheme( rtl::OUString::createFromAscii( "vnd.sun.star.extension" ) );
+ if ( !i_rIdentifier->getContentProviderScheme().equalsIgnoreAsciiCase( sScheme ) )
+ throw IllegalIdentifierException();
+
+ // normalize the identifier
+ const ::rtl::OUString sIdentifier( i_rIdentifier->getContentIdentifier() );
+
+ // the scheme needs to be lower-case
+ ::rtl::OUStringBuffer aComposer;
+ aComposer.append( sIdentifier.copy( 0, sScheme.getLength() ).toAsciiLowerCase() );
+
+ // one : is required after the scheme
+ ::rtl::OUString sRemaining( sIdentifier.copy( sScheme.getLength() ) );
+ lcl_ensureAndTransfer( sRemaining, aComposer, ':' );
+
+ // and at least one /
+ lcl_ensureAndTransfer( sRemaining, aComposer, '/' );
+
+ // the normalized form requires one additional /, but we also accept identifiers which don't have it
+ if ( sRemaining.getLength() == 0 )
+ {
+ // the root content is a special case, it requires ///
+ aComposer.appendAscii( "//" );
+ }
+ else
+ {
+ if ( sRemaining[0] != '/' )
+ {
+ aComposer.append( sal_Unicode( '/' ) );
+ aComposer.append( sRemaining );
+ }
+ else
+ {
+ lcl_ensureAndTransfer( sRemaining, aComposer, '/' );
+ // by now, we moved "vnd.sun.star.extension://" from the URL to aComposer
+ if ( sRemaining.getLength() == 0 )
+ {
+ // again, it's the root content, but one / is missing
+ aComposer.append( sal_Unicode( '/' ) );
+ }
+ else
+ {
+ aComposer.append( sRemaining );
+ }
+ }
+ }
+ const Reference< XContentIdentifier > xNormalizedIdentifier( new ::ucbhelper::ContentIdentifier( m_xSMgr, aComposer.makeStringAndClear() ) );
+
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ // check if a content with given id already exists...
+ Reference< XContent > xContent( queryExistingContent( xNormalizedIdentifier ).get() );
+ if ( xContent.is() )
+ return xContent;
+
+ // create a new content
+ xContent = new Content( m_xSMgr, this, xNormalizedIdentifier );
+ if ( !xContent->getIdentifier().is() )
+ throw IllegalIdentifierException();
+
+ registerNewContent( xContent );
+ return xContent;
+ }
+
+//......................................................................................................................
+} } } // namespace ucb::ucp::ext
+//......................................................................................................................
diff --git a/ucb/source/ucp/ext/ucpext_provider.hxx b/ucb/source/ucp/ext/ucpext_provider.hxx
new file mode 100644
index 000000000000..1f41fdd0f084
--- /dev/null
+++ b/ucb/source/ucp/ext/ucpext_provider.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 UCB_UCPEXT_CONTENT_PROVIDER_HXX
+#define UCB_UCPEXT_CONTENT_PROVIDER_HXX
+
+#include <ucbhelper/providerhelper.hxx>
+
+//......................................................................................................................
+namespace ucb { namespace ucp { namespace ext
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= ContentProvider
+ //==================================================================================================================
+ typedef ::ucbhelper::ContentProviderImplHelper ContentProvider_Base;
+ class ContentProvider : public ContentProvider_Base
+ {
+ public:
+ ContentProvider( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_rServiceManager );
+ virtual ~ContentProvider();
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo - static versions
+ static ::rtl::OUString SAL_CALL getImplementationName_static( ) throw (::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_static() throw (::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext );
+
+ // XContentProvider
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent > SAL_CALL queryContent( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier >& Identifier ) throw (::com::sun::star::ucb::IllegalIdentifierException, ::com::sun::star::uno::RuntimeException);
+
+ public:
+ static ::rtl::OUString getRootURL();
+ static ::rtl::OUString getArtificialNodeContentType();
+ };
+
+//......................................................................................................................
+} } } // namespace ucb::ucp::ext
+//......................................................................................................................
+
+#endif // UCB_UCPEXT_CONTENT_PROVIDER_HXX
diff --git a/ucb/source/ucp/ext/ucpext_resultset.cxx b/ucb/source/ucp/ext/ucpext_resultset.cxx
new file mode 100644
index 000000000000..d8a2eb8e9914
--- /dev/null
+++ b/ucb/source/ucp/ext/ucpext_resultset.cxx
@@ -0,0 +1,99 @@
+/*************************************************************************
+ * 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_ucb.hxx"
+
+#include "ucpext_resultset.hxx"
+#include "ucpext_content.hxx"
+#include "ucpext_datasupplier.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+#include <ucbhelper/resultset.hxx>
+
+//......................................................................................................................
+namespace ucb { namespace ucp { namespace ext
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::lang::XMultiServiceFactory;
+ using ::com::sun::star::ucb::XContentIdentifier;
+ using ::com::sun::star::ucb::OpenCommandArgument2;
+ using ::com::sun::star::ucb::XCommandEnvironment;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= ResultSet
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ ResultSet::ResultSet( const Reference< XMultiServiceFactory >& i_rORB, const ::rtl::Reference< Content >& i_rContent,
+ const OpenCommandArgument2& i_rCommand, const Reference< XCommandEnvironment >& i_rEnv )
+ :ResultSetImplHelper( i_rORB, i_rCommand )
+ ,m_xEnvironment( i_rEnv )
+ ,m_xContent( i_rContent )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ResultSet::initStatic()
+ {
+ ::rtl::Reference< DataSupplier > pDataSupplier( new DataSupplier(
+ m_xSMgr,
+ m_xContent,
+ m_aCommand.Mode
+ ) );
+ m_xResultSet1 = new ::ucbhelper::ResultSet(
+ m_xSMgr,
+ m_aCommand.Properties,
+ pDataSupplier.get(),
+ m_xEnvironment
+ );
+ pDataSupplier->fetchData();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ResultSet::initDynamic()
+ {
+ initStatic();
+ m_xResultSet2 = m_xResultSet1;
+ }
+
+//......................................................................................................................
+} } } // namespace ucp::ext
+//......................................................................................................................
diff --git a/ucb/source/ucp/ext/ucpext_resultset.hxx b/ucb/source/ucp/ext/ucpext_resultset.hxx
new file mode 100644
index 000000000000..2924197a0fdc
--- /dev/null
+++ b/ucb/source/ucp/ext/ucpext_resultset.hxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+ * 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 UCB_UCPEXT_RESULT_SET_HXX
+#define UCB_UCPEXT_RESULT_SET_HXX
+
+#include <rtl/ref.hxx>
+#include <ucbhelper/resultsethelper.hxx>
+
+//......................................................................................................................
+namespace ucb { namespace ucp { namespace ext
+{
+//......................................................................................................................
+
+ class Content;
+
+ //==================================================================================================================
+ //= ResultSet
+ //==================================================================================================================
+ class ResultSet : public ::ucbhelper::ResultSetImplHelper
+ {
+ public:
+ ResultSet(
+ const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& i_rORB,
+ const rtl::Reference< Content >& i_rContent,
+ const com::sun::star::ucb::OpenCommandArgument2& i_rCommand,
+ const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& i_rEnv
+ );
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > m_xEnvironment;
+ ::rtl::Reference< Content > m_xContent;
+
+ private:
+ virtual void initStatic();
+ virtual void initDynamic();
+ };
+
+//......................................................................................................................
+} } } // namespace ucp::ext
+//......................................................................................................................
+
+#endif // UCB_UCPEXT_RESULT_SET_HXX
diff --git a/ucb/source/ucp/ext/ucpext_services.cxx b/ucb/source/ucp/ext/ucpext_services.cxx
new file mode 100644
index 000000000000..8daa33f5cf8c
--- /dev/null
+++ b/ucb/source/ucp/ext/ucpext_services.cxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ * 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_ucb.hxx"
+
+#include "ucpext_provider.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+#include <cppuhelper/implementationentry.hxx>
+
+//......................................................................................................................
+namespace ucb { namespace ucp { namespace ext
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::lang::XSingleComponentFactory;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= descriptors for the services implemented in this component
+ //==================================================================================================================
+ static struct ::cppu::ImplementationEntry s_aServiceEntries[] =
+ {
+ {
+ ContentProvider::Create,
+ ContentProvider::getImplementationName_static,
+ ContentProvider::getSupportedServiceNames_static,
+ ::cppu::createOneInstanceComponentFactory, NULL, 0
+ },
+ { 0, 0, 0, 0, 0, 0 }
+ };
+
+//......................................................................................................................
+} } } // namespace ucb::ucp::ext
+//......................................................................................................................
+
+extern "C"
+{
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** )
+ {
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ 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/exports.map b/ucb/source/ucp/file/exports.map
deleted file mode 100644
index a8bd267fc9e9..000000000000
--- a/ucb/source/ucp/file/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-FIL_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/file/makefile.mk b/ucb/source/ucp/file/makefile.mk
index b11fdd8081dc..8007a2492399 100644
--- a/ucb/source/ucp/file/makefile.mk
+++ b/ucb/source/ucp/file/makefile.mk
@@ -67,7 +67,7 @@ SHL1STDLIBS=\
$(SALLIB) \
$(UCBHELPERLIB)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
.IF "$(GUI)" == "OS2"
DEF1EXPORTFILE=exports2.dxp
diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx
index 769e58c08819..f324c93b878f 100644
--- a/ucb/source/ucp/file/shell.cxx
+++ b/ucb/source/ucp/file/shell.cxx
@@ -33,6 +33,7 @@
#endif
#include "osl/diagnose.h"
+#include <rtl/uri.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/time.h>
#include <osl/file.hxx>
@@ -2054,9 +2055,14 @@ shell::copy_recursive( const rtl::OUString& srcUnqPath,
rtl::OUString newDstUnqPath = dstUnqPath;
rtl::OUString tit;
if( aFileStatus.isValid( FileStatusMask_FileName ) )
- tit = aFileStatus.getFileName();
+ tit = rtl::Uri::encode( aFileStatus.getFileName(),
+ rtl_UriCharClassPchar,
+ rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8 );
+
if( newDstUnqPath.lastIndexOf( sal_Unicode('/') ) != newDstUnqPath.getLength()-1 )
newDstUnqPath += rtl::OUString::createFromAscii( "/" );
+
newDstUnqPath += tit;
if ( newSrcUnqPath != dstUnqPath )
diff --git a/ucb/source/ucp/ftp/makefile.mk b/ucb/source/ucp/ftp/makefile.mk
index d9b674b78604..a0f141004089 100644
--- a/ucb/source/ucp/ftp/makefile.mk
+++ b/ucb/source/ucp/ftp/makefile.mk
@@ -68,7 +68,7 @@ LIB1OBJFILES=$(SLOFILES1)
SHL1TARGET=$(TARGET)$(UCPFTP_MAJOR)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1STDLIBS=\
$(CPPUHELPERLIB) \
diff --git a/ucb/source/ucp/ftp/ucpftp.map b/ucb/source/ucp/ftp/ucpftp.map
deleted file mode 100644
index 0ce3cd3ad8cc..000000000000
--- a/ucb/source/ucp/ftp/ucpftp.map
+++ /dev/null
@@ -1,8 +0,0 @@
-FTP_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/gio/exports.map b/ucb/source/ucp/gio/exports.map
deleted file mode 100644
index 5ec50ad779c1..000000000000
--- a/ucb/source/ucp/gio/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/gio/makefile.mk b/ucb/source/ucp/gio/makefile.mk
index e6ebe2413e44..86b32fbc0739 100644
--- a/ucb/source/ucp/gio/makefile.mk
+++ b/ucb/source/ucp/gio/makefile.mk
@@ -73,7 +73,7 @@ SHL1STDLIBS=\
SHL1STDLIBS+=$(PKGCONFIG_LIBS)
-SHL1VERSIONMAP= exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
.ENDIF # "$(ENABLE_GIO)"!=""
.ENDIF # L10N_framework
diff --git a/ucb/source/ucp/gvfs/exports.map b/ucb/source/ucp/gvfs/exports.map
deleted file mode 100644
index 5ec50ad779c1..000000000000
--- a/ucb/source/ucp/gvfs/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/gvfs/makefile.mk b/ucb/source/ucp/gvfs/makefile.mk
index b69455777c62..a0e8a0bda3bb 100644
--- a/ucb/source/ucp/gvfs/makefile.mk
+++ b/ucb/source/ucp/gvfs/makefile.mk
@@ -77,7 +77,7 @@ SHL1STDLIBS=\
SHL1STDLIBS+=$(PKGCONFIG_LIBS)
-SHL1VERSIONMAP= exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
.ENDIF # "$(ENABLE_GNOMEVFS)"!=""
.ENDIF # L10N_framework
diff --git a/ucb/source/ucp/hierarchy/makefile.mk b/ucb/source/ucp/hierarchy/makefile.mk
index a968537873dc..00b481b5e7a1 100644
--- a/ucb/source/ucp/hierarchy/makefile.mk
+++ b/ucb/source/ucp/hierarchy/makefile.mk
@@ -61,7 +61,7 @@ LIB1OBJFILES=$(SLOFILES)
SHL1TARGET=$(TARGET)$(UCPHIER_MAJOR)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1STDLIBS=\
$(CPPUHELPERLIB) \
diff --git a/ucb/source/ucp/hierarchy/ucphier.map b/ucb/source/ucp/hierarchy/ucphier.map
deleted file mode 100644
index 319e7b11a9a7..000000000000
--- a/ucb/source/ucp/hierarchy/ucphier.map
+++ /dev/null
@@ -1,8 +0,0 @@
-HIER_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/odma/exports.map b/ucb/source/ucp/odma/exports.map
deleted file mode 100644
index 14a2531f23ad..000000000000
--- a/ucb/source/ucp/odma/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-VERS_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/odma/makefile.mk b/ucb/source/ucp/odma/makefile.mk
index d9ddcbfdf01b..14a7d3d45c3d 100644
--- a/ucb/source/ucp/odma/makefile.mk
+++ b/ucb/source/ucp/odma/makefile.mk
@@ -64,7 +64,7 @@ LIB1OBJFILES=$(SLOFILES)
SHL1TARGET=$(TARGET)$(UCP_VERSION)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1STDLIBS=\
$(CPPUHELPERLIB) \
diff --git a/ucb/source/ucp/package/exports.map b/ucb/source/ucp/package/exports.map
deleted file mode 100644
index 7e12f34d1b86..000000000000
--- a/ucb/source/ucp/package/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-PKG_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/package/makefile.mk b/ucb/source/ucp/package/makefile.mk
index bd4707ccccc9..8c6dcda31829 100644
--- a/ucb/source/ucp/package/makefile.mk
+++ b/ucb/source/ucp/package/makefile.mk
@@ -65,7 +65,7 @@ LIB1OBJFILES=$(SLOFILES)
SHL1TARGET=$(TARGET)$(UCP_VERSION)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1STDLIBS=\
$(CPPUHELPERLIB) \
diff --git a/ucb/source/ucp/tdoc/exports.map b/ucb/source/ucp/tdoc/exports.map
deleted file mode 100644
index 5ec50ad779c1..000000000000
--- a/ucb/source/ucp/tdoc/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/tdoc/makefile.mk b/ucb/source/ucp/tdoc/makefile.mk
index 2c85514ef91f..83e9599eed72 100644
--- a/ucb/source/ucp/tdoc/makefile.mk
+++ b/ucb/source/ucp/tdoc/makefile.mk
@@ -66,7 +66,7 @@ LIB1OBJFILES=$(SLOFILES)
SHL1TARGET=$(TARGET)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP= exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1STDLIBS=\
$(COMPHELPERLIB) \
diff --git a/ucb/source/ucp/webdav/DAVAuthListener.hxx b/ucb/source/ucp/webdav/DAVAuthListener.hxx
index c092f9fd311f..71bed1c0a14d 100644
--- a/ucb/source/ucp/webdav/DAVAuthListener.hxx
+++ b/ucb/source/ucp/webdav/DAVAuthListener.hxx
@@ -30,9 +30,7 @@
#include <salhelper/simplereferenceobject.hxx>
#include <rtl/ustring.hxx>
-#ifndef _COM_SUN_STAR_UCB_XREFERENCE_HPP_
#include <com/sun/star/uno/XReference.hpp>
-#endif
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
namespace webdav_ucp
@@ -46,7 +44,6 @@ class DAVAuthListener : public salhelper::SimpleReferenceObject
const ::rtl::OUString & inHostName,
::rtl::OUString & inoutUserName,
::rtl::OUString & outPassWord,
- sal_Bool bAllowPersistentStoring,
sal_Bool bCanUseSystemCredentials ) = 0;
};
diff --git a/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx b/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx
index 3d03cc63952b..c0c9968613af 100644
--- a/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx
+++ b/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx
@@ -61,7 +61,6 @@ namespace webdav_ucp
const ::rtl::OUString & inHostName,
::rtl::OUString & inoutUserName,
::rtl::OUString & outPassWord,
- sal_Bool bAllowPersistentStoring,
sal_Bool bCanUseSystemCredentials );
private:
diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
index 4ffc8dd88cf5..872d45405735 100644
--- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx
+++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
@@ -57,7 +57,6 @@ int DAVAuthListener_Impl::authenticate(
const ::rtl::OUString & inHostName,
::rtl::OUString & inoutUserName,
::rtl::OUString & outPassWord,
- sal_Bool bAllowPersistentStoring,
sal_Bool bCanUseSystemCredentials )
{
if ( m_xEnv.is() )
@@ -79,7 +78,8 @@ int DAVAuthListener_Impl::authenticate(
= new ucbhelper::SimpleAuthenticationRequest(
m_aURL, inHostName, inRealm, inoutUserName,
outPassWord, ::rtl::OUString(),
- bAllowPersistentStoring, bCanUseSystemCredentials );
+ true /*bAllowPersistentStoring*/,
+ bCanUseSystemCredentials );
xIH->handle( xRequest.get() );
rtl::Reference< ucbhelper::InteractionContinuation > xSelection
diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx
index 8fc1730ba018..254fae546940 100644
--- a/ucb/source/ucp/webdav/NeonSession.cxx
+++ b/ucb/source/ucp/webdav/NeonSession.cxx
@@ -60,7 +60,6 @@
#include <com/sun/star/security/CertificateContainerStatus.hpp>
#include <com/sun/star/security/CertificateContainer.hpp>
#include <com/sun/star/security/XCertificateContainer.hpp>
-#include <com/sun/star/task/XMasterPasswordHandling.hpp>
#include <com/sun/star/ucb/Lock.hpp>
#include <com/sun/star/xml/crypto/XSEInitializer.hpp>
@@ -330,31 +329,11 @@ extern "C" int NeonSession_NeonAuth( void * inUserData,
( ne_strcasecmp( inAuthProtocol, "Negotiate" ) == 0 ) );
#endif
- // #i97003# (tkr): Ask XMasterPasswordHandling if we should store the
- // credentials persistently and give this information to the auth listener
- uno::Reference< task::XMasterPasswordHandling > xMasterPasswordHandling;
- try
- {
- xMasterPasswordHandling =
- uno::Reference< task::XMasterPasswordHandling >(
- theSession->getMSF()->createInstance(
- rtl::OUString::createFromAscii(
- "com.sun.star.task.PasswordContainer" ) ),
- uno::UNO_QUERY );
- }
- catch ( uno::Exception const & )
- {
- }
-
int theRetVal = pListener->authenticate(
rtl::OUString::createFromAscii( inRealm ),
theSession->getHostName(),
theUserName,
thePassWord,
- xMasterPasswordHandling.is()
- ? xMasterPasswordHandling->
- isPersistentStoringAllowed()
- : sal_False,
bCanUseSystemCreds);
rtl::OString aUser(
diff --git a/ucb/source/ucp/webdav/exports.map b/ucb/source/ucp/webdav/exports.map
deleted file mode 100644
index 73671aa97840..000000000000
--- a/ucb/source/ucp/webdav/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-DAV_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/webdav/makefile.mk b/ucb/source/ucp/webdav/makefile.mk
index 551efb6f06b8..73ee298697e8 100644
--- a/ucb/source/ucp/webdav/makefile.mk
+++ b/ucb/source/ucp/webdav/makefile.mk
@@ -113,7 +113,7 @@ LIB1OBJFILES=$(SLOFILES)
SHL1TARGET=$(TARGET)$(UCP_VERSION)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1STDLIBS=\
$(CPPUHELPERLIB) \
diff --git a/uui/prj/build.lst b/uui/prj/build.lst
index 0ebacfcb814f..dbe31cb1b57e 100644
--- a/uui/prj/build.lst
+++ b/uui/prj/build.lst
@@ -1,4 +1,4 @@
-uu uui : l10n svtools NULL
+uu uui : l10n vcl svtools NULL
uu uui usr1 - all uu_mkout NULL
uu uui\source nmake - all uu_source NULL
uu uui\util nmake - all uu_util uu_source NULL
diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx
index f31397f1ef92..73fa61f31ff4 100644..100755
--- a/uui/source/iahndl-authentication.cxx
+++ b/uui/source/iahndl-authentication.cxx
@@ -26,18 +26,23 @@
************************************************************************/
#include "com/sun/star/task/DocumentPasswordRequest.hpp"
+#include "com/sun/star/task/DocumentPasswordRequest2.hpp"
#include "com/sun/star/task/DocumentMSPasswordRequest.hpp"
+#include "com/sun/star/task/DocumentMSPasswordRequest2.hpp"
#include "com/sun/star/task/MasterPasswordRequest.hpp"
#include "com/sun/star/task/XInteractionAbort.hpp"
#include "com/sun/star/task/XInteractionPassword.hpp"
+#include "com/sun/star/task/XInteractionPassword2.hpp"
#include "com/sun/star/task/XInteractionRetry.hpp"
#include "com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp"
#include "com/sun/star/ucb/URLAuthenticationRequest.hpp"
+#include "osl/diagnose.h"
#include "rtl/digest.h"
#include "vos/mutex.hxx"
#include "tools/errcode.hxx"
#include "vcl/msgbox.hxx"
+#include "vcl/abstdlg.hxx"
#include "vcl/svapp.hxx"
#include "ids.hrc"
@@ -67,10 +72,8 @@ executeLoginDialog(
{
vos::OGuard aGuard(Application::GetSolarMutex());
- bool bAccount = (rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_ACCOUNT)
- != 0;
- bool bSavePassword = rInfo.GetIsPersistentPassword()
- || rInfo.GetIsSavePassword();
+ bool bAccount = (rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_ACCOUNT) != 0;
+ bool bSavePassword = rInfo.GetCanRememberPassword();
bool bCanUseSysCreds = rInfo.GetCanUseSystemCredentials();
sal_uInt16 nFlags = 0;
@@ -89,15 +92,10 @@ executeLoginDialog(
if (!bCanUseSysCreds)
nFlags |= LF_NO_USESYSCREDS;
- std::auto_ptr< ResMgr > xManager(
- ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
+ std::auto_ptr< ResMgr > xManager( ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
UniString aRealm(rRealm);
std::auto_ptr< LoginDialog > xDialog(
- new LoginDialog(pParent,
- nFlags,
- rInfo.GetServer(),
- &aRealm,
- xManager.get()));
+ new LoginDialog( pParent, nFlags, rInfo.GetServer(), &aRealm, xManager.get()));
if (rInfo.GetErrorText().Len() != 0)
xDialog->SetErrorText(rInfo.GetErrorText());
xDialog->SetName(rInfo.GetUserName());
@@ -109,24 +107,24 @@ executeLoginDialog(
if (bSavePassword)
{
- xDialog->
- SetSavePasswordText(ResId(rInfo.GetIsPersistentPassword() ?
- RID_SAVE_PASSWORD :
- RID_KEEP_PASSWORD,
- *xManager.get()));
- xDialog->SetSavePassword(rInfo.GetIsSavePassword());
+ xDialog->SetSavePasswordText(
+ ResId(rInfo.GetIsRememberPersistent()
+ ? RID_SAVE_PASSWORD
+ : RID_KEEP_PASSWORD,
+ *xManager.get()));
+
+ xDialog->SetSavePassword(rInfo.GetIsRememberPassword());
}
if ( bCanUseSysCreds )
- xDialog->SetUseSystemCredentials(
- rInfo.GetIsUseSystemCredentials() );
+ xDialog->SetUseSystemCredentials( rInfo.GetIsUseSystemCredentials() );
rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK :
ERRCODE_BUTTON_CANCEL);
rInfo.SetUserName(xDialog->GetName());
rInfo.SetPassword(xDialog->GetPassword());
rInfo.SetAccount(xDialog->GetAccount());
- rInfo.SetSavePassword(xDialog->IsSavePassword());
+ rInfo.SetIsRememberPassword(xDialog->IsSavePassword());
if ( bCanUseSysCreds )
rInfo.SetIsUseSystemCredentials( xDialog->IsUseSystemCredentials() );
@@ -139,6 +137,60 @@ executeLoginDialog(
}
}
+void getRememberModes(
+ uno::Sequence< ucb::RememberAuthentication > const & rRememberModes,
+ ucb::RememberAuthentication & rPreferredMode,
+ ucb::RememberAuthentication & rAlternateMode )
+{
+ sal_Int32 nCount = rRememberModes.getLength();
+ OSL_ENSURE( (nCount > 0) && (nCount < 4),
+ "ucb::RememberAuthentication sequence size mismatch!" );
+ if ( nCount == 1 )
+ {
+ rPreferredMode = rAlternateMode = rRememberModes[ 0 ];
+ return;
+ }
+ else
+ {
+ //bool bHasRememberModeNo = false;
+ bool bHasRememberModeSession = false;
+ bool bHasRememberModePersistent = false;
+
+ for (sal_Int32 i = 0; i < nCount; ++i)
+ {
+ switch ( rRememberModes[i] )
+ {
+ case ucb::RememberAuthentication_NO:
+ //bHasRememberModeNo = true;
+ break;
+ case ucb::RememberAuthentication_SESSION:
+ bHasRememberModeSession = true;
+ break;
+ case ucb::RememberAuthentication_PERSISTENT:
+ bHasRememberModePersistent = true;
+ break;
+ default:
+ OSL_TRACE( "Unsupported RememberAuthentication value" );
+ break;
+ }
+ }
+
+ if (bHasRememberModePersistent)
+ {
+ rPreferredMode = ucb::RememberAuthentication_PERSISTENT;
+ if (bHasRememberModeSession)
+ rAlternateMode = ucb::RememberAuthentication_SESSION;
+ else
+ rAlternateMode = ucb::RememberAuthentication_NO;
+ }
+ else
+ {
+ rPreferredMode = ucb::RememberAuthentication_SESSION;
+ rAlternateMode = ucb::RememberAuthentication_NO;
+ }
+ }
+}
+
void
handleAuthenticationRequest_(
Window * pParent,
@@ -161,7 +213,7 @@ handleAuthenticationRequest_(
xSupplyAuthentication2.set(xSupplyAuthentication, uno::UNO_QUERY);
//////////////////////////
- // First, try to obatin credentials from password container service.
+ // First, try to obtain credentials from password container service.
uui::PasswordContainerHelper aPwContainerHelper(xServiceFactory);
if (aPwContainerHelper.handleAuthenticationRequest(rRequest,
xSupplyAuthentication,
@@ -174,26 +226,20 @@ handleAuthenticationRequest_(
//////////////////////////
// Second, try to obtain credentials from user via password dialog.
- bool bRemember;
- bool bRememberPersistent;
+ ucb::RememberAuthentication eDefaultRememberMode
+ = ucb::RememberAuthentication_SESSION;
+ ucb::RememberAuthentication ePreferredRememberMode
+ = eDefaultRememberMode;
+ ucb::RememberAuthentication eAlternateRememberMode
+ = ucb::RememberAuthentication_NO;
+
if (xSupplyAuthentication.is())
{
- ucb::RememberAuthentication eDefault;
- uno::Sequence< ucb::RememberAuthentication >
- aModes(xSupplyAuthentication->getRememberPasswordModes(eDefault));
- bRemember = eDefault != ucb::RememberAuthentication_NO;
- bRememberPersistent = false;
- for (sal_Int32 i = 0; i < aModes.getLength(); ++i)
- if (aModes[i] == ucb::RememberAuthentication_PERSISTENT)
- {
- bRememberPersistent = true;
- break;
- }
- }
- else
- {
- bRemember = false;
- bRememberPersistent = false;
+ getRememberModes(
+ xSupplyAuthentication->getRememberPasswordModes(
+ eDefaultRememberMode),
+ ePreferredRememberMode,
+ eAlternateRememberMode);
}
sal_Bool bCanUseSystemCredentials;
@@ -220,8 +266,14 @@ handleAuthenticationRequest_(
if (rRequest.HasPassword)
aInfo.SetPassword(rRequest.Password);
aInfo.SetErrorText(rRequest.Diagnostic);
- aInfo.SetPersistentPassword(bRememberPersistent);
- aInfo.SetSavePassword(bRemember);
+
+ aInfo.SetCanRememberPassword(
+ ePreferredRememberMode != eAlternateRememberMode);
+ aInfo.SetIsRememberPassword(
+ eDefaultRememberMode != ucb::RememberAuthentication_NO);
+ aInfo.SetIsRememberPersistent(
+ ePreferredRememberMode == ucb::RememberAuthentication_PERSISTENT);
+
aInfo.SetCanUseSystemCredentials(bCanUseSystemCredentials);
aInfo.SetIsUseSystemCredentials( bDefaultUseSystemCredentials );
aInfo.SetModifyAccount(rRequest.HasAccount
@@ -242,13 +294,24 @@ handleAuthenticationRequest_(
xSupplyAuthentication->setUserName(aInfo.GetUserName());
if (xSupplyAuthentication->canSetPassword())
xSupplyAuthentication->setPassword(aInfo.GetPassword());
- xSupplyAuthentication->
- setRememberPassword(
- aInfo.GetIsSavePassword() ?
- bRememberPersistent ?
- ucb::RememberAuthentication_PERSISTENT :
- ucb::RememberAuthentication_SESSION :
- ucb::RememberAuthentication_NO);
+
+ if (ePreferredRememberMode != eAlternateRememberMode)
+ {
+ // user had te choice.
+ if (aInfo.GetIsRememberPassword())
+ xSupplyAuthentication->setRememberPassword(
+ ePreferredRememberMode);
+ else
+ xSupplyAuthentication->setRememberPassword(
+ eAlternateRememberMode);
+ }
+ else
+ {
+ // user had no choice.
+ xSupplyAuthentication->setRememberPassword(
+ ePreferredRememberMode);
+ }
+
if (rRequest.HasRealm)
{
if (xSupplyAuthentication->canSetRealm())
@@ -267,38 +330,76 @@ handleAuthenticationRequest_(
//////////////////////////
// Third, store credentials in password container.
- if ( aInfo.GetIsUseSystemCredentials() )
- {
- if (aInfo.GetIsSavePassword())
- {
- aPwContainerHelper.addRecord(
- rURL.getLength() ? rURL : rRequest.ServerName,
- rtl::OUString(), // empty u/p -> sys creds
- uno::Sequence< rtl::OUString >(),
- xIH,
- bRememberPersistent);
- }
- }
- // Empty user name can not be valid:
- else if (aInfo.GetUserName().Len() != 0)
- {
- if (aInfo.GetIsSavePassword())
- {
- uno::Sequence< rtl::OUString >
- aPassList(aInfo.GetAccount().Len() == 0 ? 1 : 2);
- aPassList[0] = aInfo.GetPassword();
- if (aInfo.GetAccount().Len() != 0)
- aPassList[1] = aInfo.GetAccount();
-
- aPwContainerHelper.addRecord(
- rURL.getLength() ? rURL : rRequest.ServerName,
- aInfo.GetUserName(),
- aPassList,
- xIH,
- bRememberPersistent);
- }
- }
- break;
+ if ( aInfo.GetIsUseSystemCredentials() )
+ {
+ if (aInfo.GetIsRememberPassword())
+ {
+ if (!aPwContainerHelper.addRecord(
+ rURL.getLength() ? rURL : rRequest.ServerName,
+ rtl::OUString(), // empty u/p -> sys creds
+ uno::Sequence< rtl::OUString >(),
+ xIH,
+ ePreferredRememberMode
+ == ucb::RememberAuthentication_PERSISTENT))
+ {
+ xSupplyAuthentication->setRememberPassword(
+ ucb::RememberAuthentication_NO);
+ }
+ }
+ else if (eAlternateRememberMode
+ == ucb::RememberAuthentication_SESSION)
+ {
+ if (!aPwContainerHelper.addRecord(
+ rURL.getLength() ? rURL : rRequest.ServerName,
+ rtl::OUString(), // empty u/p -> sys creds
+ uno::Sequence< rtl::OUString >(),
+ xIH,
+ false /* SESSION */))
+ {
+ xSupplyAuthentication->setRememberPassword(
+ ucb::RememberAuthentication_NO);
+ }
+ }
+ }
+ // Empty user name can not be valid:
+ else if (aInfo.GetUserName().Len() != 0)
+ {
+ uno::Sequence< rtl::OUString >
+ aPassList(aInfo.GetAccount().Len() == 0 ? 1 : 2);
+ aPassList[0] = aInfo.GetPassword();
+ if (aInfo.GetAccount().Len() != 0)
+ aPassList[1] = aInfo.GetAccount();
+
+ if (aInfo.GetIsRememberPassword())
+ {
+ if (!aPwContainerHelper.addRecord(
+ rURL.getLength() ? rURL : rRequest.ServerName,
+ aInfo.GetUserName(),
+ aPassList,
+ xIH,
+ ePreferredRememberMode
+ == ucb::RememberAuthentication_PERSISTENT))
+ {
+ xSupplyAuthentication->setRememberPassword(
+ ucb::RememberAuthentication_NO);
+ }
+ }
+ else if (eAlternateRememberMode
+ == ucb::RememberAuthentication_SESSION)
+ {
+ if (!aPwContainerHelper.addRecord(
+ rURL.getLength() ? rURL : rRequest.ServerName,
+ aInfo.GetUserName(),
+ aPassList,
+ xIH,
+ false /* SESSION */))
+ {
+ xSupplyAuthentication->setRememberPassword(
+ ucb::RememberAuthentication_NO);
+ }
+ }
+ }
+ break;
case ERRCODE_BUTTON_RETRY:
if (xRetry.is())
@@ -418,7 +519,8 @@ executePasswordDialog(
LoginErrorInfo & rInfo,
task::PasswordRequestMode nMode,
::rtl::OUString aDocName,
- bool bMSCryptoMode)
+ bool bMSCryptoMode,
+ bool bIsPasswordToModify )
SAL_THROW((uno::RuntimeException))
{
try
@@ -429,23 +531,25 @@ executePasswordDialog(
ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
if( nMode == task::PasswordRequestMode_PASSWORD_CREATE )
{
- std::auto_ptr< PasswordCreateDialog > xDialog(
- new PasswordCreateDialog(pParent,
- xManager.get(),
- bMSCryptoMode));
+ const sal_uInt16 nMaxPasswdLen = bMSCryptoMode ? 15 : 0; // 0 -> allow any length
- rInfo.SetResult(xDialog->Execute()
- == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL);
- rInfo.SetPassword( xDialog->GetPassword() );
+ 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() );
}
else
{
- std::auto_ptr< PasswordDialog > xDialog(
- new PasswordDialog(pParent, nMode, xManager.get(), aDocName));
+ std::auto_ptr< PasswordDialog > pDialog(
+ new PasswordDialog( pParent, nMode, xManager.get(), aDocName, bIsPasswordToModify ) );
- rInfo.SetResult(xDialog->Execute()
- == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL);
- rInfo.SetPassword( xDialog->GetPassword() );
+ rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL );
+ rInfo.SetPassword( bIsPasswordToModify ? String() : pDialog->GetPassword() );
+ rInfo.SetPasswordToModify( bIsPasswordToModify ? pDialog->GetPassword() : String() );
}
}
catch (std::bad_alloc const &)
@@ -463,26 +567,36 @@ handlePasswordRequest_(
uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
rContinuations,
::rtl::OUString aDocumentName,
- bool bMSCryptoMode )
+ bool bMSCryptoMode,
+ bool bIsPasswordToModify )
SAL_THROW((uno::RuntimeException))
{
uno::Reference< task::XInteractionRetry > xRetry;
uno::Reference< task::XInteractionAbort > xAbort;
uno::Reference< task::XInteractionPassword > xPassword;
- getContinuations(rContinuations, &xRetry, &xAbort, &xPassword);
+ uno::Reference< task::XInteractionPassword2 > xPassword2;
+ getContinuations(rContinuations, &xRetry, &xAbort, &xPassword2, &xPassword);
+
+ if ( xPassword2.is() && !xPassword.is() )
+ xPassword.set( xPassword2, uno::UNO_QUERY_THROW );
+
LoginErrorInfo aInfo;
- executePasswordDialog(pParent,
- aInfo,
- nMode,
- aDocumentName,
- bMSCryptoMode);
+ executePasswordDialog( pParent, aInfo, nMode,
+ aDocumentName, bMSCryptoMode, bIsPasswordToModify );
switch (aInfo.GetResult())
{
case ERRCODE_BUTTON_OK:
+ OSL_ENSURE( !bIsPasswordToModify || xPassword2.is(), "PasswordToModify is requested, but there is no Interaction!" );
if (xPassword.is())
{
+ if (xPassword2.is())
+ {
+ xPassword2->setPasswordToModify( aInfo.GetPasswordToModify() );
+ xPassword2->setRecommendReadOnly( aInfo.IsRecommendToOpenReadonly() );
+ }
+
xPassword->setPassword(aInfo.GetPassword());
xPassword->select();
}
@@ -558,28 +672,81 @@ UUIInteractionHelper::handlePasswordRequest(
uno::Reference< task::XInteractionRequest > const & rRequest)
SAL_THROW((uno::RuntimeException))
{
+ // parameters to be filled for the call to handlePasswordRequest_
+ Window * pParent = getParentProperty();
+ task::PasswordRequestMode nMode = task::PasswordRequestMode_PASSWORD_ENTER;
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & rContinuations = rRequest->getContinuations();
+ ::rtl::OUString aDocumentName;
+ bool bMSCryptoMode = false;
+ bool bIsPasswordToModify = false;
+
+ bool bDoHandleRequest = false;
+
uno::Any aAnyRequest(rRequest->getRequest());
+ task::DocumentPasswordRequest2 aDocumentPasswordRequest2;
+ if (!bDoHandleRequest && (aAnyRequest >>= aDocumentPasswordRequest2))
+ {
+ nMode = aDocumentPasswordRequest2.Mode;
+ aDocumentName = aDocumentPasswordRequest2.Name;
+ OSL_ENSURE( bMSCryptoMode == false, "bMSCryptoMode should be false" );
+ bIsPasswordToModify = aDocumentPasswordRequest2.IsRequestPasswordToModify;
+
+ bDoHandleRequest = true;
+ }
+
task::DocumentPasswordRequest aDocumentPasswordRequest;
- if (aAnyRequest >>= aDocumentPasswordRequest)
+ if (!bDoHandleRequest && (aAnyRequest >>= aDocumentPasswordRequest))
{
- handlePasswordRequest_(getParentProperty(),
- aDocumentPasswordRequest.Mode,
- rRequest->getContinuations(),
- aDocumentPasswordRequest.Name,
- false /* bool bMSCryptoMode */);
- return true;
+ nMode = aDocumentPasswordRequest.Mode;
+ aDocumentName = aDocumentPasswordRequest.Name;
+ OSL_ENSURE( bMSCryptoMode == false, "bMSCryptoMode should be false" );
+ OSL_ENSURE( bIsPasswordToModify == false, "bIsPasswordToModify should be false" );
+
+ bDoHandleRequest = true;
+ }
+
+ task::DocumentMSPasswordRequest2 aDocumentMSPasswordRequest2;
+ if (!bDoHandleRequest && (aAnyRequest >>= aDocumentMSPasswordRequest2))
+ {
+ nMode = aDocumentMSPasswordRequest2.Mode;
+ aDocumentName = aDocumentMSPasswordRequest2.Name;
+ bMSCryptoMode = true;
+ bIsPasswordToModify = aDocumentMSPasswordRequest2.IsRequestPasswordToModify;
+
+ bDoHandleRequest = true;
}
task::DocumentMSPasswordRequest aDocumentMSPasswordRequest;
- if (aAnyRequest >>= aDocumentMSPasswordRequest)
+ if (!bDoHandleRequest && (aAnyRequest >>= aDocumentMSPasswordRequest))
+ {
+ nMode = aDocumentMSPasswordRequest.Mode;
+ aDocumentName = aDocumentMSPasswordRequest.Name;
+ bMSCryptoMode = true;
+ OSL_ENSURE( bIsPasswordToModify == false, "bIsPasswordToModify should be false" );
+
+ bDoHandleRequest = true;
+ }
+
+ if (bDoHandleRequest)
+ {
+ handlePasswordRequest_( pParent, nMode, rContinuations,
+ aDocumentName, bMSCryptoMode, bIsPasswordToModify );
+ return true;
+ }
+
+ task::PasswordRequest aPasswordRequest;
+ if( aAnyRequest >>= aPasswordRequest )
{
handlePasswordRequest_(getParentProperty(),
- aDocumentMSPasswordRequest.Mode,
+ aPasswordRequest.Mode,
rRequest->getContinuations(),
- aDocumentMSPasswordRequest.Name,
- true /* bool bMSCryptoMode */);
+ rtl::OUString(),
+ false /* bool bMSCryptoMode */,
+ false /* bool bIsPasswordToModify */);
return true;
}
+
return false;
}
+
diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx
index d37376abdd00..3176171c4865 100644
--- a/uui/source/iahndl-errorhandler.cxx
+++ b/uui/source/iahndl-errorhandler.cxx
@@ -37,7 +37,7 @@
#include "com/sun/star/task/XInteractionRetry.hpp"
#include "tools/errinf.hxx" // ErrorHandler, ErrorContext, ...
-#include "svl/svtools.hrc" // RID_ERRHDL
+#include "svtools/svtools.hrc" // RID_ERRHDL
#include "ids.hrc"
#include "getcontinuations.hxx"
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index e883bd60848d..0879e3574da3 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -868,14 +868,15 @@ UUIInteractionHelper::handleRequest_impl(
return true;
// @@@ Todo #i29340#: activate!
-// ucb::NameClashResolveRequest aNameClashResolveRequest;
-// if (aAnyRequest >>= aNameClashResolveRequest)
-// {
-// handleNameClashResolveRequest(aNameClashResolveRequest,
-// rRequest->getContinuations());
-// return true;
-// }
-
+#if 0
+ ucb::NameClashResolveRequest aNameClashResolveRequest;
+ if (aAnyRequest >>= aNameClashResolveRequest)
+ {
+ handleNameClashResolveRequest(aNameClashResolveRequest,
+ rRequest->getContinuations());
+ return true;
+ }
+#endif
if ( handleMasterPasswordRequest( rRequest ) )
return true;
@@ -1187,6 +1188,8 @@ executeMessageBox(
return aResult;
}
+// @@@ Todo #i29340#: activate!
+#if 0
enum NameClashResolveDialogResult { ABORT, RENAME, OVERWRITE };
NameClashResolveDialogResult
@@ -1214,9 +1217,11 @@ executeSimpleNameClashResolveDialog(
"executeSimpleNameClashResolveDialog not yet implemented!" );
return ABORT;
}
-
+#endif
} // namespace
+// @@@ Todo #i29340#: activate!
+#if 0
void
UUIInteractionHelper::handleNameClashResolveRequest(
ucb::NameClashResolveRequest const & rRequest,
@@ -1284,6 +1289,7 @@ UUIInteractionHelper::handleNameClashResolveRequest(
break;
}
}
+#endif
void
UUIInteractionHelper::handleGenericErrorRequest(
diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx
index 6402653d3bda..581099462845 100644
--- a/uui/source/iahndl.hxx
+++ b/uui/source/iahndl.hxx
@@ -215,6 +215,8 @@ 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,
@@ -223,6 +225,7 @@ 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 9bf5856bc270..796186fd5140 100644..100755
--- a/uui/source/ids.hrc
+++ b/uui/source/ids.hrc
@@ -35,126 +35,129 @@
#include "tools/errcode.hxx"
#endif
-#define RID_KEEP_PASSWORD (RID_UUI_START + 0)
-#define RID_SAVE_PASSWORD (RID_UUI_START + 1)
-#define DLG_UUI_LOGIN (RID_UUI_START + 2)
-#define DLG_COOKIES (RID_UUI_START + 3)
-#define STR_COOKIES_RECV_START (RID_UUI_START + 4)
-#define STR_COOKIES_RECV_COOKIES (RID_UUI_START + 5)
-#define STR_COOKIES_RECV_TITLE (RID_UUI_START + 6)
-#define STR_COOKIES_SEND_START (RID_UUI_START + 7)
-#define STR_COOKIES_SEND_COOKIES (RID_UUI_START + 8)
-#define STR_COOKIES_SEND_TITLE (RID_UUI_START + 9)
-#define DLG_FILTER_SELECT (RID_UUI_START + 10)
+#define RID_KEEP_PASSWORD (RID_UUI_START + 0)
+#define RID_SAVE_PASSWORD (RID_UUI_START + 1)
+#define DLG_UUI_LOGIN (RID_UUI_START + 2)
+#define DLG_COOKIES (RID_UUI_START + 3)
+#define STR_COOKIES_RECV_START (RID_UUI_START + 4)
+#define STR_COOKIES_RECV_COOKIES (RID_UUI_START + 5)
+#define STR_COOKIES_RECV_TITLE (RID_UUI_START + 6)
+#define STR_COOKIES_SEND_START (RID_UUI_START + 7)
+#define STR_COOKIES_SEND_COOKIES (RID_UUI_START + 8)
+#define STR_COOKIES_SEND_TITLE (RID_UUI_START + 9)
+#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 STR_ERROR_PASSWORDS_NOT_IDENTICAL (RID_UUI_START + 13)
-#define STR_ERROR_MASTERPASSWORD_WRONG (RID_UUI_START + 14)
+#define DLG_UUI_MASTERPASSWORD (RID_UUI_START + 12)
+#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_PASSWORD_WRONG (RID_UUI_START + 24)
-#define STR_WARNING_BROKENSIGNATURE_TITLE (RID_UUI_START + 25)
-#define DLG_UUI_UNKNOWNAUTH (RID_UUI_START + 26)
-#define DLG_UUI_UNKNOWNAUTH_CRT (RID_UUI_START + 27)
-#define DLG_UUI_SSLWARN (RID_UUI_START + 28)
-#define DLG_UUI_SSLWARN_CRT (RID_UUI_START + 29)
-#define RID_XMLSECDLG_MACROWARN (RID_UUI_START + 30)
-#define STR_UNKNOWNUSER (RID_UUI_START + 31)
-#define STR_OPENLOCKED_TITLE (RID_UUI_START + 32)
-#define STR_OPENLOCKED_MSG (RID_UUI_START + 33)
-#define STR_OPENLOCKED_OPENREADONLY_BTN (RID_UUI_START + 34)
-#define STR_OPENLOCKED_OPENCOPY_BTN (RID_UUI_START + 35)
-#define STR_FILECHANGED_TITLE (RID_UUI_START + 36)
-#define STR_FILECHANGED_MSG (RID_UUI_START + 37)
-#define STR_FILECHANGED_SAVEANYWAY_BTN (RID_UUI_START + 38)
-#define STR_ALREADYOPEN_TITLE (RID_UUI_START + 39)
-#define STR_ALREADYOPEN_MSG (RID_UUI_START + 40)
-#define STR_ALREADYOPEN_READONLY_BTN (RID_UUI_START + 41)
-#define STR_ALREADYOPEN_OPEN_BTN (RID_UUI_START + 42)
-#define STR_LOCKFAILED_TITLE (RID_UUI_START + 43)
-#define STR_LOCKFAILED_MSG (RID_UUI_START + 44)
-#define STR_LOCKFAILED_DONTSHOWAGAIN (RID_UUI_START + 45)
-#define STR_TRYLATER_TITLE (RID_UUI_START + 46)
-#define STR_TRYLATER_MSG (RID_UUI_START + 47)
-#define STR_TRYLATER_RETRYSAVING_BTN (RID_UUI_START + 48)
-#define STR_TRYLATER_SAVEAS_BTN (RID_UUI_START + 49)
-#define STR_ALREADYOPEN_SAVE_MSG (RID_UUI_START + 50)
-#define STR_ALREADYOPEN_RETRY_SAVE_BTN (RID_UUI_START + 51)
-#define STR_ALREADYOPEN_SAVE_BTN (RID_UUI_START + 52)
-#define RID_DLG_NEWER_VERSION_WARNING (RID_UUI_START + 53)
-#define STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE (RID_UUI_START + 54)
+#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_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)
+#define DLG_UUI_UNKNOWNAUTH_CRT (RID_UUI_START + 27)
+#define DLG_UUI_SSLWARN (RID_UUI_START + 28)
+#define DLG_UUI_SSLWARN_CRT (RID_UUI_START + 29)
+#define RID_XMLSECDLG_MACROWARN (RID_UUI_START + 30)
+#define STR_UNKNOWNUSER (RID_UUI_START + 31)
+#define STR_OPENLOCKED_TITLE (RID_UUI_START + 32)
+#define STR_OPENLOCKED_MSG (RID_UUI_START + 33)
+#define STR_OPENLOCKED_OPENREADONLY_BTN (RID_UUI_START + 34)
+#define STR_OPENLOCKED_OPENCOPY_BTN (RID_UUI_START + 35)
+#define STR_FILECHANGED_TITLE (RID_UUI_START + 36)
+#define STR_FILECHANGED_MSG (RID_UUI_START + 37)
+#define STR_FILECHANGED_SAVEANYWAY_BTN (RID_UUI_START + 38)
+#define STR_ALREADYOPEN_TITLE (RID_UUI_START + 39)
+#define STR_ALREADYOPEN_MSG (RID_UUI_START + 40)
+#define STR_ALREADYOPEN_READONLY_BTN (RID_UUI_START + 41)
+#define STR_ALREADYOPEN_OPEN_BTN (RID_UUI_START + 42)
+#define STR_LOCKFAILED_TITLE (RID_UUI_START + 43)
+#define STR_LOCKFAILED_MSG (RID_UUI_START + 44)
+#define STR_LOCKFAILED_DONTSHOWAGAIN (RID_UUI_START + 45)
+#define STR_TRYLATER_TITLE (RID_UUI_START + 46)
+#define STR_TRYLATER_MSG (RID_UUI_START + 47)
+#define STR_TRYLATER_RETRYSAVING_BTN (RID_UUI_START + 48)
+#define STR_TRYLATER_SAVEAS_BTN (RID_UUI_START + 49)
+#define STR_ALREADYOPEN_SAVE_MSG (RID_UUI_START + 50)
+#define STR_ALREADYOPEN_RETRY_SAVE_BTN (RID_UUI_START + 51)
+#define STR_ALREADYOPEN_SAVE_BTN (RID_UUI_START + 52)
+#define RID_DLG_NEWER_VERSION_WARNING (RID_UUI_START + 53)
+#define STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE (RID_UUI_START + 54)
+#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 ERRCODE_UUI_IO_ABORT (ERRCODE_AREA_UUI + 0)
-#define ERRCODE_UUI_IO_ACCESSDENIED (ERRCODE_AREA_UUI + 1)
-#define ERRCODE_UUI_IO_ALREADYEXISTS (ERRCODE_AREA_UUI + 2)
-#define ERRCODE_UUI_IO_BADCRC (ERRCODE_AREA_UUI + 3)
-#define ERRCODE_UUI_IO_CANTCREATE (ERRCODE_AREA_UUI + 4)
-#define ERRCODE_UUI_IO_CANTREAD (ERRCODE_AREA_UUI + 5)
-#define ERRCODE_UUI_IO_CANTSEEK (ERRCODE_AREA_UUI + 6)
-#define ERRCODE_UUI_IO_CANTTELL (ERRCODE_AREA_UUI + 7)
-#define ERRCODE_UUI_IO_CANTWRITE (ERRCODE_AREA_UUI + 8)
-#define ERRCODE_UUI_IO_CURRENTDIR (ERRCODE_AREA_UUI + 9)
-#define ERRCODE_UUI_IO_NOTREADY (ERRCODE_AREA_UUI + 10)
-#define ERRCODE_UUI_IO_NOTSAMEDEVICE (ERRCODE_AREA_UUI + 11)
-#define ERRCODE_UUI_IO_GENERAL (ERRCODE_AREA_UUI + 12)
-#define ERRCODE_UUI_IO_INVALIDACCESS (ERRCODE_AREA_UUI + 13)
-#define ERRCODE_UUI_IO_INVALIDCHAR (ERRCODE_AREA_UUI + 14)
-#define ERRCODE_UUI_IO_INVALIDDEVICE (ERRCODE_AREA_UUI + 15)
-#define ERRCODE_UUI_IO_INVALIDLENGTH (ERRCODE_AREA_UUI + 16)
-#define ERRCODE_UUI_IO_INVALIDPARAMETER (ERRCODE_AREA_UUI + 17)
-#define ERRCODE_UUI_IO_ISWILDCARD (ERRCODE_AREA_UUI + 18)
-#define ERRCODE_UUI_IO_LOCKVIOLATION (ERRCODE_AREA_UUI + 19)
-#define ERRCODE_UUI_IO_MISPLACEDCHAR (ERRCODE_AREA_UUI + 20)
-#define ERRCODE_UUI_IO_NAMETOOLONG (ERRCODE_AREA_UUI + 21)
-#define ERRCODE_UUI_IO_NOTEXISTS (ERRCODE_AREA_UUI + 22)
-#define ERRCODE_UUI_IO_NOTEXISTSPATH (ERRCODE_AREA_UUI + 23)
-#define ERRCODE_UUI_IO_NOTSUPPORTED (ERRCODE_AREA_UUI + 24)
-#define ERRCODE_UUI_IO_NOTADIRECTORY (ERRCODE_AREA_UUI + 25)
-#define ERRCODE_UUI_IO_NOTAFILE (ERRCODE_AREA_UUI + 26)
-#define ERRCODE_UUI_IO_OUTOFSPACE (ERRCODE_AREA_UUI + 27)
-#define ERRCODE_UUI_IO_TOOMANYOPENFILES (ERRCODE_AREA_UUI + 28)
-#define ERRCODE_UUI_IO_OUTOFMEMORY (ERRCODE_AREA_UUI + 29)
-#define ERRCODE_UUI_IO_PENDING (ERRCODE_AREA_UUI + 30)
-#define ERRCODE_UUI_IO_RECURSIVE (ERRCODE_AREA_UUI + 31)
-#define ERRCODE_UUI_IO_UNKNOWN (ERRCODE_AREA_UUI + 32)
-#define ERRCODE_UUI_IO_WRITEPROTECTED (ERRCODE_AREA_UUI + 33)
-#define ERRCODE_UUI_IO_WRONGFORMAT (ERRCODE_AREA_UUI + 34)
-#define ERRCODE_UUI_IO_WRONGVERSION (ERRCODE_AREA_UUI + 35)
-#define ERRCODE_UUI_IO_NOTEXISTS_VOLUME (ERRCODE_AREA_UUI + 36)
-#define ERRCODE_UUI_IO_NOTEXISTS_FOLDER (ERRCODE_AREA_UUI + 37)
-#define ERRCODE_UUI_WRONGJAVA (ERRCODE_AREA_UUI + 38)
-#define ERRCODE_UUI_WRONGJAVA_VERSION (ERRCODE_AREA_UUI + 39)
-#define ERRCODE_UUI_WRONGJAVA_MIN (ERRCODE_AREA_UUI + 40)
-#define ERRCODE_UUI_WRONGJAVA_VERSION_MIN (ERRCODE_AREA_UUI + 41)
-#define ERRCODE_UUI_BADPARTNERSHIP (ERRCODE_AREA_UUI + 42)
-#define ERRCODE_UUI_BADPARTNERSHIP_NAME (ERRCODE_AREA_UUI + 43)
-#define ERRCODE_UUI_IO_NOTREADY_VOLUME (ERRCODE_AREA_UUI + 44)
-#define ERRCODE_UUI_IO_NOTREADY_REMOVABLE (ERRCODE_AREA_UUI + 45)
-#define ERRCODE_UUI_IO_NOTREADY_VOLUME_REMOVABLE (ERRCODE_AREA_UUI + 46)
-#define ERRCODE_UUI_WRONGMEDIUM (ERRCODE_AREA_UUI + 47)
-#define ERRCODE_UUI_IO_CANTCREATE_NONAME (ERRCODE_AREA_UUI + 48)
-#define ERRCODE_UUI_IO_TARGETALREADYEXISTS (ERRCODE_AREA_UUI + 49)
-#define ERRCODE_UUI_IO_UNSUPPORTEDOVERWRITE (ERRCODE_AREA_UUI + 50)
-#define ERRCODE_UUI_IO_BROKENPACKAGE (ERRCODE_AREA_UUI + 51)
-#define ERRCODE_UUI_IO_BROKENPACKAGE_CANTREPAIR (ERRCODE_AREA_UUI + 52)
-#define ERRCODE_UUI_CONFIGURATION_BROKENDATA_NOREMOVE (ERRCODE_AREA_UUI + 53)
-#define ERRCODE_UUI_CONFIGURATION_BROKENDATA_WITHREMOVE (ERRCODE_AREA_UUI + 54)
-#define ERRCODE_UUI_CONFIGURATION_BACKENDMISSING (ERRCODE_AREA_UUI + 55)
-#define ERRCODE_UUI_CONFIGURATION_BACKENDMISSING_WITHRECOVER (ERRCODE_AREA_UUI + 56)
-#define ERRCODE_UUI_INVALID_XFORMS_SUBMISSION_DATA (ERRCODE_AREA_UUI + 57)
-#define ERRCODE_UUI_IO_MODULESIZEEXCEEDED (ERRCODE_AREA_UUI + 58)
-#define ERRCODE_UUI_LOCKING_LOCKED (ERRCODE_AREA_UUI + 59)
-#define ERRCODE_UUI_LOCKING_LOCKED_SELF (ERRCODE_AREA_UUI + 60)
-#define ERRCODE_UUI_LOCKING_NOT_LOCKED (ERRCODE_AREA_UUI + 61)
-#define ERRCODE_UUI_LOCKING_LOCK_EXPIRED (ERRCODE_AREA_UUI + 62)
+#define ERRCODE_UUI_IO_ABORT (ERRCODE_AREA_UUI + 0)
+#define ERRCODE_UUI_IO_ACCESSDENIED (ERRCODE_AREA_UUI + 1)
+#define ERRCODE_UUI_IO_ALREADYEXISTS (ERRCODE_AREA_UUI + 2)
+#define ERRCODE_UUI_IO_BADCRC (ERRCODE_AREA_UUI + 3)
+#define ERRCODE_UUI_IO_CANTCREATE (ERRCODE_AREA_UUI + 4)
+#define ERRCODE_UUI_IO_CANTREAD (ERRCODE_AREA_UUI + 5)
+#define ERRCODE_UUI_IO_CANTSEEK (ERRCODE_AREA_UUI + 6)
+#define ERRCODE_UUI_IO_CANTTELL (ERRCODE_AREA_UUI + 7)
+#define ERRCODE_UUI_IO_CANTWRITE (ERRCODE_AREA_UUI + 8)
+#define ERRCODE_UUI_IO_CURRENTDIR (ERRCODE_AREA_UUI + 9)
+#define ERRCODE_UUI_IO_NOTREADY (ERRCODE_AREA_UUI + 10)
+#define ERRCODE_UUI_IO_NOTSAMEDEVICE (ERRCODE_AREA_UUI + 11)
+#define ERRCODE_UUI_IO_GENERAL (ERRCODE_AREA_UUI + 12)
+#define ERRCODE_UUI_IO_INVALIDACCESS (ERRCODE_AREA_UUI + 13)
+#define ERRCODE_UUI_IO_INVALIDCHAR (ERRCODE_AREA_UUI + 14)
+#define ERRCODE_UUI_IO_INVALIDDEVICE (ERRCODE_AREA_UUI + 15)
+#define ERRCODE_UUI_IO_INVALIDLENGTH (ERRCODE_AREA_UUI + 16)
+#define ERRCODE_UUI_IO_INVALIDPARAMETER (ERRCODE_AREA_UUI + 17)
+#define ERRCODE_UUI_IO_ISWILDCARD (ERRCODE_AREA_UUI + 18)
+#define ERRCODE_UUI_IO_LOCKVIOLATION (ERRCODE_AREA_UUI + 19)
+#define ERRCODE_UUI_IO_MISPLACEDCHAR (ERRCODE_AREA_UUI + 20)
+#define ERRCODE_UUI_IO_NAMETOOLONG (ERRCODE_AREA_UUI + 21)
+#define ERRCODE_UUI_IO_NOTEXISTS (ERRCODE_AREA_UUI + 22)
+#define ERRCODE_UUI_IO_NOTEXISTSPATH (ERRCODE_AREA_UUI + 23)
+#define ERRCODE_UUI_IO_NOTSUPPORTED (ERRCODE_AREA_UUI + 24)
+#define ERRCODE_UUI_IO_NOTADIRECTORY (ERRCODE_AREA_UUI + 25)
+#define ERRCODE_UUI_IO_NOTAFILE (ERRCODE_AREA_UUI + 26)
+#define ERRCODE_UUI_IO_OUTOFSPACE (ERRCODE_AREA_UUI + 27)
+#define ERRCODE_UUI_IO_TOOMANYOPENFILES (ERRCODE_AREA_UUI + 28)
+#define ERRCODE_UUI_IO_OUTOFMEMORY (ERRCODE_AREA_UUI + 29)
+#define ERRCODE_UUI_IO_PENDING (ERRCODE_AREA_UUI + 30)
+#define ERRCODE_UUI_IO_RECURSIVE (ERRCODE_AREA_UUI + 31)
+#define ERRCODE_UUI_IO_UNKNOWN (ERRCODE_AREA_UUI + 32)
+#define ERRCODE_UUI_IO_WRITEPROTECTED (ERRCODE_AREA_UUI + 33)
+#define ERRCODE_UUI_IO_WRONGFORMAT (ERRCODE_AREA_UUI + 34)
+#define ERRCODE_UUI_IO_WRONGVERSION (ERRCODE_AREA_UUI + 35)
+#define ERRCODE_UUI_IO_NOTEXISTS_VOLUME (ERRCODE_AREA_UUI + 36)
+#define ERRCODE_UUI_IO_NOTEXISTS_FOLDER (ERRCODE_AREA_UUI + 37)
+#define ERRCODE_UUI_WRONGJAVA (ERRCODE_AREA_UUI + 38)
+#define ERRCODE_UUI_WRONGJAVA_VERSION (ERRCODE_AREA_UUI + 39)
+#define ERRCODE_UUI_WRONGJAVA_MIN (ERRCODE_AREA_UUI + 40)
+#define ERRCODE_UUI_WRONGJAVA_VERSION_MIN (ERRCODE_AREA_UUI + 41)
+#define ERRCODE_UUI_BADPARTNERSHIP (ERRCODE_AREA_UUI + 42)
+#define ERRCODE_UUI_BADPARTNERSHIP_NAME (ERRCODE_AREA_UUI + 43)
+#define ERRCODE_UUI_IO_NOTREADY_VOLUME (ERRCODE_AREA_UUI + 44)
+#define ERRCODE_UUI_IO_NOTREADY_REMOVABLE (ERRCODE_AREA_UUI + 45)
+#define ERRCODE_UUI_IO_NOTREADY_VOLUME_REMOVABLE (ERRCODE_AREA_UUI + 46)
+#define ERRCODE_UUI_WRONGMEDIUM (ERRCODE_AREA_UUI + 47)
+#define ERRCODE_UUI_IO_CANTCREATE_NONAME (ERRCODE_AREA_UUI + 48)
+#define ERRCODE_UUI_IO_TARGETALREADYEXISTS (ERRCODE_AREA_UUI + 49)
+#define ERRCODE_UUI_IO_UNSUPPORTEDOVERWRITE (ERRCODE_AREA_UUI + 50)
+#define ERRCODE_UUI_IO_BROKENPACKAGE (ERRCODE_AREA_UUI + 51)
+#define ERRCODE_UUI_IO_BROKENPACKAGE_CANTREPAIR (ERRCODE_AREA_UUI + 52)
+#define ERRCODE_UUI_CONFIGURATION_BROKENDATA_NOREMOVE (ERRCODE_AREA_UUI + 53)
+#define ERRCODE_UUI_CONFIGURATION_BROKENDATA_WITHREMOVE (ERRCODE_AREA_UUI + 54)
+#define ERRCODE_UUI_CONFIGURATION_BACKENDMISSING (ERRCODE_AREA_UUI + 55)
+#define ERRCODE_UUI_CONFIGURATION_BACKENDMISSING_WITHRECOVER (ERRCODE_AREA_UUI + 56)
+#define ERRCODE_UUI_INVALID_XFORMS_SUBMISSION_DATA (ERRCODE_AREA_UUI + 57)
+#define ERRCODE_UUI_IO_MODULESIZEEXCEEDED (ERRCODE_AREA_UUI + 58)
+#define ERRCODE_UUI_LOCKING_LOCKED (ERRCODE_AREA_UUI + 59)
+#define ERRCODE_UUI_LOCKING_LOCKED_SELF (ERRCODE_AREA_UUI + 60)
+#define ERRCODE_UUI_LOCKING_NOT_LOCKED (ERRCODE_AREA_UUI + 61)
+#define ERRCODE_UUI_LOCKING_LOCK_EXPIRED (ERRCODE_AREA_UUI + 62)
-#define ERRCODE_AREA_UUI_UNKNOWNAUTH 25000
-#define SSLWARN_TYPE_DOMAINMISMATCH 10
-#define SSLWARN_TYPE_EXPIRED 20
-#define SSLWARN_TYPE_INVALID 30
+#define ERRCODE_AREA_UUI_UNKNOWNAUTH 25000
+#define SSLWARN_TYPE_DOMAINMISMATCH 10
+#define SSLWARN_TYPE_EXPIRED 20
+#define SSLWARN_TYPE_INVALID 30
#define ERRCODE_UUI_UNKNOWNAUTH_UNTRUSTED (ERRCODE_AREA_UUI_UNKNOWNAUTH + 1)
@@ -167,17 +170,25 @@
#define ERRCODE_UUI_SSLWARN_INVALID_1 (ERRCODE_AREA_UUI_UNKNOWNAUTH + SSLWARN_TYPE_INVALID + 1)
#define TITLE_UUI_SSLWARN_INVALID (ERRCODE_AREA_UUI_UNKNOWNAUTH + SSLWARN_TYPE_INVALID + 3)
-#define HID_DLG_LOGIN (HID_UUI_START + 0)
-#define HID_DLG_COOKIES (HID_UUI_START + 1)
-#define HID_DLG_MASTERPASSWORD_UUI (HID_UUI_START+2)
-#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)
-#define HID_DLG_NEWERVERSIONWARNING (HID_UUI_START+10)
+#define HID_DLG_LOGIN (HID_UUI_START + 0)
+#define HID_DLG_COOKIES (HID_UUI_START + 1)
+#define HID_DLG_MASTERPASSWORD_UUI (HID_UUI_START + 2)
+#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)
+#define HID_DLG_NEWERVERSIONWARNING (HID_UUI_START +10)
+
+#define HID_LOGIN_DLG_PATH (HID_UUI_START +11)
+#define HID_LOGIN_DLG_BROWSE (HID_UUI_START +12)
+#define HID_LOGIN_DLG_USER_NAME (HID_UUI_START +13)
+#define HID_LOGIN_DLG_PASSWORD (HID_UUI_START +14)
+#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)
// HID_UUI_END (aka HID_CHAOS_NEW_DATABASE) is reserved in
// sfx2/util/hidother.src
diff --git a/uui/source/logindlg.cxx b/uui/source/logindlg.cxx
index 53ea243c9577..d7ded58b5dde 100644..100755
--- a/uui/source/logindlg.cxx
+++ b/uui/source/logindlg.cxx
@@ -47,12 +47,20 @@
//............................................................................
//............................................................................
+static void lcl_Move( Window &rWin, long nOffset )
+{
+ Point aTmp( rWin.GetPosPixel() );
+ aTmp.Y() -= nOffset;
+ rWin.SetPosPixel( aTmp );
+}
+
+
void LoginDialog::HideControls_Impl( USHORT nFlags )
{
- FASTBOOL bPathHide = FALSE;
- FASTBOOL bErrorHide = FALSE;
- FASTBOOL bAccountHide = FALSE;
- FASTBOOL bUseSysCredsHide = FALSE;
+ bool bPathHide = FALSE;
+ bool bErrorHide = FALSE;
+ bool bAccountHide = FALSE;
+ bool bUseSysCredsHide = FALSE;
if ( ( nFlags & LF_NO_PATH ) == LF_NO_PATH )
{
@@ -63,9 +71,8 @@ void LoginDialog::HideControls_Impl( USHORT nFlags )
}
else if ( ( nFlags & LF_PATH_READONLY ) == LF_PATH_READONLY )
{
- aPathED.Hide();
- aPathInfo.Show();
- aPathBtn.Hide();
+ aPathED.Enable( FALSE );
+ aPathBtn.Enable( FALSE );
}
if ( ( nFlags & LF_NO_USERNAME ) == LF_NO_USERNAME )
@@ -75,8 +82,7 @@ void LoginDialog::HideControls_Impl( USHORT nFlags )
}
else if ( ( nFlags & LF_USERNAME_READONLY ) == LF_USERNAME_READONLY )
{
- aNameED.Hide();
- aNameInfo.Show();
+ aNameED.Enable( FALSE );
}
if ( ( nFlags & LF_NO_PASSWORD ) == LF_NO_PASSWORD )
@@ -91,7 +97,8 @@ void LoginDialog::HideControls_Impl( USHORT nFlags )
if ( ( nFlags & LF_NO_ERRORTEXT ) == LF_NO_ERRORTEXT )
{
aErrorInfo.Hide();
- aErrorGB.Hide();
+ aErrorFT.Hide();
+ aLogin1FL.Hide();
bErrorHide = TRUE;
}
@@ -110,53 +117,26 @@ void LoginDialog::HideControls_Impl( USHORT nFlags )
if ( bErrorHide )
{
- long nOffset = aLoginGB.GetPosPixel().Y() -
- aErrorGB.GetPosPixel().Y();
- Point aNewPnt = aRequestInfo.GetPosPixel();
- aNewPnt.Y() -= nOffset;
- aRequestInfo.SetPosPixel( aNewPnt );
- aNewPnt = aPathFT.GetPosPixel();
- aNewPnt.Y() -= nOffset;
- aPathFT.SetPosPixel( aNewPnt );
- aNewPnt = aPathED.GetPosPixel();
- aNewPnt.Y() -= nOffset;
- aPathED.SetPosPixel( aNewPnt );
- aNewPnt = aPathInfo.GetPosPixel();
- aNewPnt.Y() -= nOffset;
- aPathInfo.SetPosPixel( aNewPnt );
- aNewPnt = aPathBtn.GetPosPixel();
- aNewPnt.Y() -= nOffset;
- aPathBtn.SetPosPixel( aNewPnt );
- aNewPnt = aNameFT.GetPosPixel();
- aNewPnt.Y() -= nOffset;
- aNameFT.SetPosPixel( aNewPnt );
- aNewPnt = aNameED.GetPosPixel();
- aNewPnt.Y() -= nOffset;
- aNameED.SetPosPixel( aNewPnt );
- aNewPnt = aNameInfo.GetPosPixel();
- aNewPnt.Y() -= nOffset;
- aNameInfo.SetPosPixel( aNewPnt );
- aNewPnt = aPasswordFT.GetPosPixel();
- aNewPnt.Y() -= nOffset;
- aPasswordFT.SetPosPixel( aNewPnt );
- aNewPnt = aPasswordED.GetPosPixel();
- aNewPnt.Y() -= nOffset;
- aPasswordED.SetPosPixel( aNewPnt );
- aNewPnt = aAccountFT.GetPosPixel();
- aNewPnt.Y() -= nOffset;
- aAccountFT.SetPosPixel( aNewPnt );
- aNewPnt = aAccountED.GetPosPixel();
- aNewPnt.Y() -= nOffset;
- aAccountED.SetPosPixel( aNewPnt );
- aNewPnt = aSavePasswdBtn.GetPosPixel();
- aNewPnt.Y() -= nOffset;
- aSavePasswdBtn.SetPosPixel( aNewPnt );
- aNewPnt = aUseSysCredsCB.GetPosPixel();
- aNewPnt.Y() -= nOffset;
- aUseSysCredsCB.SetPosPixel( aNewPnt );
- aNewPnt = aLoginGB.GetPosPixel();
- aNewPnt.Y() -= nOffset;
- aLoginGB.SetPosPixel( aNewPnt );
+ long nOffset = aRequestInfo.GetPosPixel().Y() -
+ aErrorFT.GetPosPixel().Y();
+ lcl_Move( aRequestInfo, nOffset );
+ lcl_Move( aLogin2FL, nOffset );
+ lcl_Move( aPathFT, nOffset );
+ lcl_Move( aPathED, nOffset );
+ lcl_Move( aPathBtn, nOffset );
+ lcl_Move( aNameFT, nOffset );
+ lcl_Move( aNameED, nOffset );
+ lcl_Move( aPasswordFT, nOffset );
+ lcl_Move( aPasswordED, nOffset );
+ lcl_Move( aAccountFT, nOffset );
+ lcl_Move( aAccountED, nOffset );
+ lcl_Move( aSavePasswdBtn, nOffset );
+ lcl_Move( aUseSysCredsCB, nOffset );
+ lcl_Move( aButtonsFL, nOffset );
+ lcl_Move( aOKBtn, nOffset );
+ lcl_Move( aCancelBtn, nOffset );
+ lcl_Move( aHelpBtn, nOffset );
+
Size aNewSiz = GetSizePixel();
aNewSiz.Height() -= nOffset;
SetSizePixel( aNewSiz );
@@ -166,24 +146,19 @@ void LoginDialog::HideControls_Impl( USHORT nFlags )
{
long nOffset = aNameED.GetPosPixel().Y() -
aPathED.GetPosPixel().Y();
+ lcl_Move( aNameFT, nOffset );
+ lcl_Move( aNameED, nOffset );
+ lcl_Move( aPasswordFT, nOffset );
+ lcl_Move( aPasswordED, nOffset );
+ lcl_Move( aAccountFT, nOffset );
+ lcl_Move( aAccountED, nOffset );
+ lcl_Move( aSavePasswdBtn, nOffset );
+ lcl_Move( aUseSysCredsCB, nOffset );
+ lcl_Move( aButtonsFL, nOffset );
+ lcl_Move( aOKBtn, nOffset );
+ lcl_Move( aCancelBtn, nOffset );
+ lcl_Move( aHelpBtn, nOffset );
- Point aTmpPnt1 = aNameFT.GetPosPixel();
- Point aTmpPnt2 = aPasswordFT.GetPosPixel();
- aNameFT.SetPosPixel( aPathFT.GetPosPixel() );
- aPasswordFT.SetPosPixel( aTmpPnt1 );
- aAccountFT.SetPosPixel( aTmpPnt2 );
- aTmpPnt1 = aNameED.GetPosPixel();
- aTmpPnt2 = aPasswordED.GetPosPixel();
- aNameED.SetPosPixel( aPathED.GetPosPixel() );
- aPasswordED.SetPosPixel( aTmpPnt1 );
- aAccountED.SetPosPixel( aTmpPnt2 );
- aNameInfo.SetPosPixel( aPathInfo.GetPosPixel() );
- aTmpPnt1 = aSavePasswdBtn.GetPosPixel();
- aTmpPnt1.Y() -= nOffset;
- aSavePasswdBtn.SetPosPixel( aTmpPnt1 );
- aTmpPnt1 = aUseSysCredsCB.GetPosPixel();
- aTmpPnt1.Y() -= nOffset;
- aUseSysCredsCB.SetPosPixel( aTmpPnt1 );
Size aNewSz = GetSizePixel();
aNewSz.Height() -= nOffset;
SetSizePixel( aNewSz );
@@ -191,14 +166,15 @@ void LoginDialog::HideControls_Impl( USHORT nFlags )
if ( bAccountHide )
{
- long nOffset = aAccountED.GetPosPixel().Y() - aPasswordED.GetPosPixel().Y();
-
- Point aTmpPnt = aSavePasswdBtn.GetPosPixel();
- aTmpPnt.Y() -= nOffset;
- aSavePasswdBtn.SetPosPixel( aTmpPnt );
- aTmpPnt = aUseSysCredsCB.GetPosPixel();
- aTmpPnt.Y() -= nOffset;
- aUseSysCredsCB.SetPosPixel( aTmpPnt );
+ long nOffset = aAccountED.GetPosPixel().Y() -
+ aPasswordED.GetPosPixel().Y();
+ lcl_Move( aSavePasswdBtn, nOffset );
+ lcl_Move( aUseSysCredsCB, nOffset );
+ lcl_Move( aButtonsFL, nOffset );
+ lcl_Move( aOKBtn, nOffset );
+ lcl_Move( aCancelBtn, nOffset );
+ lcl_Move( aHelpBtn, nOffset );
+
Size aNewSz = GetSizePixel();
aNewSz.Height() -= nOffset;
SetSizePixel( aNewSz );
@@ -208,6 +184,10 @@ void LoginDialog::HideControls_Impl( USHORT nFlags )
{
long nOffset = aUseSysCredsCB.GetPosPixel().Y() -
aSavePasswdBtn.GetPosPixel().Y();
+ lcl_Move( aButtonsFL, nOffset );
+ lcl_Move( aOKBtn, nOffset );
+ lcl_Move( aCancelBtn, nOffset );
+ lcl_Move( aHelpBtn, nOffset );
Size aNewSz = GetSizePixel();
aNewSz.Height() -= nOffset;
@@ -219,15 +199,13 @@ void LoginDialog::HideControls_Impl( USHORT nFlags )
void LoginDialog::EnableUseSysCredsControls_Impl( BOOL bUseSysCredsEnabled )
{
aErrorInfo.Enable( !bUseSysCredsEnabled );
- aErrorGB.Enable( !bUseSysCredsEnabled );
+ aErrorFT.Enable( !bUseSysCredsEnabled );
aRequestInfo.Enable( !bUseSysCredsEnabled );
aPathFT.Enable( !bUseSysCredsEnabled );
aPathED.Enable( !bUseSysCredsEnabled );
- aPathInfo.Enable( !bUseSysCredsEnabled );
aPathBtn.Enable( !bUseSysCredsEnabled );
aNameFT.Enable( !bUseSysCredsEnabled );
aNameED.Enable( !bUseSysCredsEnabled );
- aNameInfo.Enable( !bUseSysCredsEnabled );
aPasswordFT.Enable( !bUseSysCredsEnabled );
aPasswordED.Enable( !bUseSysCredsEnabled );
aAccountFT.Enable( !bUseSysCredsEnabled );
@@ -282,23 +260,23 @@ LoginDialog::LoginDialog
ModalDialog( pParent, ResId( DLG_UUI_LOGIN, *pResMgr ) ),
- aErrorInfo ( this, ResId( INFO_LOGIN_ERROR, *pResMgr ) ),
- aErrorGB ( this, ResId( GB_LOGIN_ERROR, *pResMgr ) ),
- aRequestInfo ( this, ResId( INFO_LOGIN_REQUEST, *pResMgr ) ),
+ aErrorFT ( this, ResId( FT_LOGIN_ERROR, *pResMgr ) ),
+ aErrorInfo ( this, ResId( FT_INFO_LOGIN_ERROR, *pResMgr ) ),
+ aLogin1FL ( this, ResId( FL_LOGIN_1, *pResMgr ) ),
+ aRequestInfo ( this, ResId( FT_INFO_LOGIN_REQUEST, *pResMgr ) ),
+ aLogin2FL ( this, ResId( FL_LOGIN_2, *pResMgr ) ),
aPathFT ( this, ResId( FT_LOGIN_PATH, *pResMgr ) ),
aPathED ( this, ResId( ED_LOGIN_PATH, *pResMgr ) ),
- aPathInfo ( this, ResId( INFO_LOGIN_PATH, *pResMgr ) ),
aPathBtn ( this, ResId( BTN_LOGIN_PATH, *pResMgr ) ),
aNameFT ( this, ResId( FT_LOGIN_USERNAME, *pResMgr ) ),
aNameED ( this, ResId( ED_LOGIN_USERNAME, *pResMgr ) ),
- aNameInfo ( this, ResId( INFO_LOGIN_USERNAME, *pResMgr ) ),
aPasswordFT ( this, ResId( FT_LOGIN_PASSWORD, *pResMgr ) ),
aPasswordED ( this, ResId( ED_LOGIN_PASSWORD, *pResMgr ) ),
aAccountFT ( this, ResId( FT_LOGIN_ACCOUNT, *pResMgr ) ),
aAccountED ( this, ResId( ED_LOGIN_ACCOUNT, *pResMgr ) ),
aSavePasswdBtn ( this, ResId( CB_LOGIN_SAVEPASSWORD, *pResMgr ) ),
aUseSysCredsCB ( this, ResId( CB_LOGIN_USESYSCREDS, *pResMgr ) ),
- aLoginGB ( this, ResId( GB_LOGIN_LOGIN, *pResMgr ) ),
+ aButtonsFL ( this, ResId( FL_BUTTONS, *pResMgr ) ),
aOKBtn ( this, ResId( BTN_LOGIN_OK, *pResMgr ) ),
aCancelBtn ( this, ResId( BTN_LOGIN_CANCEL, *pResMgr ) ),
aHelpBtn ( this, ResId( BTN_LOGIN_HELP, *pResMgr ) )
@@ -333,10 +311,8 @@ LoginDialog::LoginDialog
// -----------------------------------------------------------------------
-void LoginDialog::SetName( const String& rNewName )
+LoginDialog::~LoginDialog()
{
- aNameED.SetText( rNewName );
- aNameInfo.SetText( rNewName );
}
// -----------------------------------------------------------------------
diff --git a/uui/source/logindlg.hrc b/uui/source/logindlg.hrc
index 68162fb620cd..b541740bd768 100644..100755
--- a/uui/source/logindlg.hrc
+++ b/uui/source/logindlg.hrc
@@ -30,24 +30,24 @@
//============================================================================
-#define INFO_LOGIN_ERROR 10
-#define GB_LOGIN_ERROR 11
+#define FT_INFO_LOGIN_ERROR 10
+#define FT_LOGIN_ERROR 11
-#define INFO_LOGIN_REQUEST 20
+#define FT_INFO_LOGIN_REQUEST 20
#define FT_LOGIN_PATH 21
#define ED_LOGIN_PATH 22
-#define INFO_LOGIN_PATH 23
-#define BTN_LOGIN_PATH 24
-#define FT_LOGIN_USERNAME 25
-#define ED_LOGIN_USERNAME 26
-#define INFO_LOGIN_USERNAME 27
-#define FT_LOGIN_PASSWORD 28
-#define ED_LOGIN_PASSWORD 29
-#define FT_LOGIN_ACCOUNT 30
-#define ED_LOGIN_ACCOUNT 31
-#define CB_LOGIN_SAVEPASSWORD 32
-#define GB_LOGIN_LOGIN 33
-#define CB_LOGIN_USESYSCREDS 34
+#define BTN_LOGIN_PATH 23
+#define FT_LOGIN_USERNAME 24
+#define ED_LOGIN_USERNAME 25
+#define FT_LOGIN_PASSWORD 26
+#define ED_LOGIN_PASSWORD 27
+#define FT_LOGIN_ACCOUNT 28
+#define ED_LOGIN_ACCOUNT 29
+#define CB_LOGIN_SAVEPASSWORD 30
+#define CB_LOGIN_USESYSCREDS 31
+#define FL_LOGIN_1 32
+#define FL_LOGIN_2 33
+#define FL_BUTTONS 34
#define BTN_LOGIN_OK 50
#define BTN_LOGIN_CANCEL 51
diff --git a/uui/source/logindlg.hxx b/uui/source/logindlg.hxx
index 0a4637d89251..05ba8e8d55d4 100644..100755
--- a/uui/source/logindlg.hxx
+++ b/uui/source/logindlg.hxx
@@ -53,23 +53,23 @@
//============================================================================
class LoginDialog : public ModalDialog
{
+ FixedText aErrorFT;
FixedInfo aErrorInfo;
- FixedLine aErrorGB;
+ FixedLine aLogin1FL;
FixedInfo aRequestInfo;
+ FixedLine aLogin2FL;
FixedText aPathFT;
Edit aPathED;
- FixedInfo aPathInfo;
PushButton aPathBtn;
FixedText aNameFT;
Edit aNameED;
- FixedInfo aNameInfo;
FixedText aPasswordFT;
Edit aPasswordED;
FixedText aAccountFT;
Edit aAccountED;
CheckBox aSavePasswdBtn;
CheckBox aUseSysCredsCB;
- FixedLine aLoginGB;
+ FixedLine aButtonsFL;
OKButton aOKBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
@@ -85,36 +85,30 @@ public:
LoginDialog( Window* pParent, USHORT nFlags,
const String& rServer, const String* pRealm,
ResMgr * pResMgr );
+ virtual ~LoginDialog();
- String GetPath() const { return aPathED.GetText(); }
- void SetPath( const String& rNewPath )
- { aPathED.SetText( rNewPath );
- aPathInfo.SetText( rNewPath );}
- String GetName() const { return aNameED.GetText(); }
- void SetName( const String& rNewName );
- String GetPassword() const { return aPasswordED.GetText(); }
- void SetPassword( const String& rNew )
- { aPasswordED.SetText( rNew ); }
- String GetAccount() const { return aAccountED.GetText(); }
- void SetAccount( const String& rNew )
- { aAccountED.SetText( rNew ); }
- BOOL IsSavePassword() const
- { return aSavePasswdBtn.IsChecked(); }
- void SetSavePassword( BOOL bSave )
- { aSavePasswdBtn.Check( bSave ); }
- void SetSavePasswordText( const String& rTxt )
- { aSavePasswdBtn.SetText( rTxt ); }
- BOOL IsUseSystemCredentials() const
- { return aUseSysCredsCB.IsChecked(); }
+ String GetPath() const { return aPathED.GetText(); }
+ void SetPath( const String& rNewPath ) { aPathED.SetText( rNewPath ); }
+ String GetName() const { return aNameED.GetText(); }
+ void SetName( const String& rNewName ) { aNameED.SetText( rNewName ); }
+ String GetPassword() const { return aPasswordED.GetText(); }
+ void SetPassword( const String& rNew ) { aPasswordED.SetText( rNew ); }
+ String GetAccount() const { return aAccountED.GetText(); }
+ void SetAccount( const String& rNew ) { aAccountED.SetText( rNew ); }
+ BOOL IsSavePassword() const { return aSavePasswdBtn.IsChecked(); }
+ void SetSavePassword( BOOL bSave ) { aSavePasswdBtn.Check( bSave ); }
+ void SetSavePasswordText( const String& rTxt ) { aSavePasswdBtn.SetText( rTxt ); }
+ BOOL IsUseSystemCredentials() const { return aUseSysCredsCB.IsChecked(); }
void SetUseSystemCredentials( BOOL bUse );
- void SetErrorText( const String& rTxt )
- { aErrorInfo.SetText( rTxt ); }
- void SetLoginRequestText( const String& rTxt )
- { aRequestInfo.SetText( rTxt ); }
+ void SetErrorText( const String& rTxt ) { aErrorInfo.SetText( rTxt ); }
+ void SetLoginRequestText( const String& rTxt ) { aRequestInfo.SetText( rTxt ); }
void ClearPassword();
void ClearAccount();
};
+// -----------------------------------------------------------------------
+
+
//............................................................................
//............................................................................
diff --git a/uui/source/logindlg.src b/uui/source/logindlg.src
index ce998f4945be..bf6a97c3b0ff 100644..100755
--- a/uui/source/logindlg.src
+++ b/uui/source/logindlg.src
@@ -16,7 +16,7 @@
* 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).
+ *(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
@@ -42,166 +42,156 @@ ModalDialog DLG_UUI_LOGIN
Moveable = TRUE ;
OutputSize = TRUE ;
SVLook = TRUE ;
- Size = MAP_APPFONT ( 265 , 170 ) ;
- FixedText INFO_LOGIN_ERROR
+ Size = MAP_APPFONT( 177 , 247 ) ;
+ Text [ en-US ] = "Authentication Required" ;
+
+ FixedText FT_LOGIN_ERROR
{
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 185 , 18 ) ;
+ Pos = MAP_APPFONT( 6 , 6 ) ;
+ Size = MAP_APPFONT( 165 , 8 ) ;
+ Text [ en-US ] = "Message from server:" ;
+ };
+
+ FixedText FT_INFO_LOGIN_ERROR
+ {
+ Pos = MAP_APPFONT( 6 , 14 ) ;
+ Size = MAP_APPFONT( 165 , 3*8 ) ;
WordBreak = TRUE ;
};
- FixedLine GB_LOGIN_ERROR
+
+ FixedLine FL_LOGIN_1
{
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 197 , 8 ) ;
- Text [ en-US ] = "Message from server" ;
+ Pos = MAP_APPFONT( 6 , 41 ) ;
+ Size = MAP_APPFONT( 165 , 8 ) ;
};
- FixedText INFO_LOGIN_REQUEST
+
+ FixedText FT_INFO_LOGIN_REQUEST
{
- Pos = MAP_APPFONT ( 12 , 55 ) ;
- Size = MAP_APPFONT ( 185 , 18 ) ;
+ Pos = MAP_APPFONT( 6 , 52 ) ;
+ Size = MAP_APPFONT( 165 , 2*8 ) ;
WordBreak = TRUE ;
- Text [ en-US ] = "Enter the user name and password for %1 here." ;
+ Text [ en-US ] = "Enter user name and password for: \n%1" ;
};
+
+ String STR_LOGIN_REALM
+ {
+ Text [ en-US ] = "Enter user name and password for: \n\"%2\" on %1" ;
+ };
+
+ FixedLine FL_LOGIN_2
+ {
+ Pos = MAP_APPFONT( 6 , 71 ) ;
+ Size = MAP_APPFONT( 165 , 8 ) ;
+ };
+
FixedText FT_LOGIN_PATH
{
- Pos = MAP_APPFONT ( 12 , 77 ) ;
- Size = MAP_APPFONT ( 57 , 10 ) ;
+ Pos = MAP_APPFONT( 6 , 84 ) ;
+ Size = MAP_APPFONT( 112 , 8 ) ;
Text [ en-US ] = "~Path" ;
};
+
Edit ED_LOGIN_PATH
{
+ HelpId = HID_LOGIN_DLG_PATH;
Border = TRUE ;
- Pos = MAP_APPFONT ( 72 , 76 ) ;
- Size = MAP_APPFONT ( 108 , 12 ) ;
- };
- FixedText INFO_LOGIN_PATH
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 72 , 77 ) ;
- Size = MAP_APPFONT ( 125 , 10 ) ;
+ Pos = MAP_APPFONT( 6 , 95 ) ;
+ Size = MAP_APPFONT( 112 , 12 ) ;
};
PushButton BTN_LOGIN_PATH
{
- Pos = MAP_APPFONT ( 183 , 75 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- Text = "~..." ;
+ HelpId = HID_LOGIN_DLG_BROWSE;
+ Pos = MAP_APPFONT( 121 , 94 ) ;
+ Size = MAP_APPFONT( 50 , 14 ) ;
+ Text = "~Browse..." ;
};
+
FixedText FT_LOGIN_USERNAME
{
- Pos = MAP_APPFONT ( 12 , 92 ) ;
- Size = MAP_APPFONT ( 57 , 10 ) ;
+ Pos = MAP_APPFONT( 6 , 110 ) ;
+ Size = MAP_APPFONT( 165 , 8 ) ;
Text [ en-US ] = "~User name" ;
};
+
Edit ED_LOGIN_USERNAME
{
+ HelpId = HID_LOGIN_DLG_USER_NAME;
Border = TRUE ;
- Pos = MAP_APPFONT ( 72 , 91 ) ;
- Size = MAP_APPFONT ( 125 , 12 ) ;
- };
- FixedText INFO_LOGIN_USERNAME
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 72 , 92 ) ;
- Size = MAP_APPFONT ( 125 , 10 ) ;
+ Pos = MAP_APPFONT( 6 , 121 ) ;
+ Size = MAP_APPFONT( 165 , 12 ) ;
};
+
FixedText FT_LOGIN_PASSWORD
{
- Pos = MAP_APPFONT ( 12 , 107 ) ;
- Size = MAP_APPFONT ( 57 , 10 ) ;
+ Pos = MAP_APPFONT( 6 , 136 ) ;
+ Size = MAP_APPFONT( 165 , 8 ) ;
Text [ en-US ] = "Pass~word" ;
};
+
Edit ED_LOGIN_PASSWORD
{
+ HelpId = HID_LOGIN_DLG_PASSWORD;
Border = TRUE ;
- Pos = MAP_APPFONT ( 72 , 106 ) ;
- Size = MAP_APPFONT ( 125 , 12 ) ;
+ Pos = MAP_APPFONT( 6 , 147 ) ;
+ Size = MAP_APPFONT( 165 , 12 ) ;
PassWord = TRUE ;
};
+
FixedText FT_LOGIN_ACCOUNT
{
- Pos = MAP_APPFONT ( 12 , 122 ) ;
- Size = MAP_APPFONT ( 57 , 10 ) ;
+ Pos = MAP_APPFONT( 6 , 162 ) ;
+ Size = MAP_APPFONT( 165 , 8 ) ;
Text [ en-US ] = "A~ccount";
};
+
Edit ED_LOGIN_ACCOUNT
{
+ HelpId = HID_LOGIN_DLG_ACCOUNT;
Border = TRUE ;
- Pos = MAP_APPFONT ( 72 , 121 ) ;
- Size = MAP_APPFONT ( 125 , 12 ) ;
+ Pos = MAP_APPFONT( 6 , 173 ) ;
+ Size = MAP_APPFONT( 165 , 12 ) ;
PassWord = TRUE ;
};
+
CheckBox CB_LOGIN_SAVEPASSWORD
{
- Pos = MAP_APPFONT ( 12 , 136 ) ;
- Size = MAP_APPFONT ( 185 , 10 ) ;
- Text [ en-US ] = "~Save password" ;
+ HelpId = HID_LOGIN_DLG_REMEMBER_PASSWORD;
+ Pos = MAP_APPFONT( 6 , 190 ) ;
+ Size = MAP_APPFONT( 165 , 10 ) ;
+ Text [ en-US ] = "~Remember password" ;
};
+
CheckBox CB_LOGIN_USESYSCREDS
{
- Pos = MAP_APPFONT ( 12 , 148 ) ;
- Size = MAP_APPFONT ( 185 , 10 ) ;
- Text [ en-US ] = "~Use System Credentials" ;
+ HelpId = HID_LOGIN_DLG_USE_SYSTEM_CREDENTIALS;
+ Pos = MAP_APPFONT( 6 , 203 ) ;
+ Size = MAP_APPFONT( 165 , 10 ) ;
+ Text [ en-US ] = "~Use system credentials" ;
};
- FixedLine GB_LOGIN_LOGIN
+
+ FixedLine FL_BUTTONS
{
- Pos = MAP_APPFONT ( 7 , 44 ) ;
- Size = MAP_APPFONT ( 197 , 8 ) ;
- Text [ en-US ] = "Log in" ;
+ Pos = MAP_APPFONT( 0 , 216 ) ;
+ Size = MAP_APPFONT( 177 , 8 ) ;
};
+
OKButton BTN_LOGIN_OK
{
- Pos = MAP_APPFONT ( 209 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT( 6 , 227 ) ;
+ Size = MAP_APPFONT( 50 , 14 ) ;
DefButton = TRUE ;
};
+
CancelButton BTN_LOGIN_CANCEL
{
- Pos = MAP_APPFONT ( 209 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT( 66 , 227 ) ;
+ Size = MAP_APPFONT( 50 , 14 ) ;
};
+
HelpButton BTN_LOGIN_HELP
{
- Pos = MAP_APPFONT ( 209 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- String STR_LOGIN_REALM
- {
- Text [ en-US ] = "Please enter user name and password for \"%2\" on %1 here." ;
+ Pos = MAP_APPFONT( 121 , 227 ) ;
+ Size = MAP_APPFONT( 50 , 14 ) ;
};
- Text [ en-US ] = "User Name and Password Required" ;
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uui/source/loginerr.hxx b/uui/source/loginerr.hxx
index c8cbba96564b..ec1317dbd805 100644..100755
--- a/uui/source/loginerr.hxx
+++ b/uui/source/loginerr.hxx
@@ -25,131 +25,154 @@
*
************************************************************************/
-#ifndef _LOGINERR_HXX
-#define _LOGINERR_HXX
+#ifndef m_LOGINERR_HXX
+#define m_LOGINERR_HXX
#include <tools/string.hxx>
//=========================================================================
-#define LOGINERROR_FLAG_SET_SAVE_PASSWORD 1
-#define LOGINERROR_FLAG_MODIFY_ACCOUNT 2
-#define LOGINERROR_FLAG_MODIFY_USER_NAME 4
-#define LOGINERROR_FLAG_PERSISTENT_PASSWORD 8
-#define LOGINERROR_FLAG_CAN_USE_SYSCREDS 16
-#define LOGINERROR_FLAG_IS_USE_SYSCREDS 32
+#define LOGINERROR_FLAG_MODIFY_ACCOUNT 1
+#define LOGINERROR_FLAG_MODIFY_USER_NAME 2
+#define LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD 4
+#define LOGINERROR_FLAG_IS_REMEMBER_PASSWORD 8
+#define LOGINERROR_FLAG_CAN_USE_SYSCREDS 16
+#define LOGINERROR_FLAG_IS_USE_SYSCREDS 32
+#define LOGINERROR_FLAG_REMEMBER_PERSISTENT 64
class LoginErrorInfo
{
private:
- String _aTitle;
- String _aServer;
- String _aAccount;
- String _aUserName;
- String _aPassword;
- String _aPath;
- String _aErrorText;
- BYTE _nFlags;
- USHORT _nRet;
+ String m_aTitle;
+ String m_aServer;
+ String m_aAccount;
+ String m_aUserName;
+ String m_aPassword;
+ String m_aPasswordToModify;
+ String m_aPath;
+ String m_aErrorText;
+ BYTE m_nFlags;
+ USHORT m_nRet;
+ bool m_bRecommendToOpenReadonly;
public:
LoginErrorInfo()
- : _nFlags( LOGINERROR_FLAG_MODIFY_USER_NAME ),
- _nRet( ERRCODE_BUTTON_CANCEL )
+ : m_nFlags( LOGINERROR_FLAG_MODIFY_USER_NAME ),
+ m_nRet( ERRCODE_BUTTON_CANCEL )
{
}
- const String& GetTitle() const { return _aTitle; }
- const String& GetServer() const { return _aServer; }
- const String& GetAccount() const { return _aAccount; }
- const String& GetUserName() const { return _aUserName; }
- const String& GetPassword() const { return _aPassword; }
- const String& GetPath() const { return _aPath; }
- const String& GetErrorText() const { return _aErrorText; }
- BOOL GetIsPersistentPassword() const
- { return ( _nFlags & LOGINERROR_FLAG_PERSISTENT_PASSWORD ); }
- BOOL GetIsSavePassword() const
- { return ( _nFlags & LOGINERROR_FLAG_SET_SAVE_PASSWORD ); }
+ const String& GetTitle() const { return m_aTitle; }
+ const String& GetServer() const { return m_aServer; }
+ const String& GetAccount() const { return m_aAccount; }
+ const String& GetUserName() const { return m_aUserName; }
+ const String& GetPassword() const { return m_aPassword; }
+ const String& GetPasswordToModify() const { return m_aPasswordToModify; }
+ const bool IsRecommendToOpenReadonly() const { return m_bRecommendToOpenReadonly; }
+ const String& GetPath() const { return m_aPath; }
+ const String& GetErrorText() const { return m_aErrorText; }
+ BOOL GetCanRememberPassword() const { return ( m_nFlags & LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD ); }
+ BOOL GetIsRememberPersistent() const { return ( m_nFlags & LOGINERROR_FLAG_REMEMBER_PERSISTENT ); }
+ BOOL GetIsRememberPassword() const { return ( m_nFlags & LOGINERROR_FLAG_IS_REMEMBER_PASSWORD ); }
+
BOOL GetCanUseSystemCredentials() const
- { return ( _nFlags & LOGINERROR_FLAG_CAN_USE_SYSCREDS ); }
+ { return ( m_nFlags & LOGINERROR_FLAG_CAN_USE_SYSCREDS ); }
BOOL GetIsUseSystemCredentials() const
- { return ( _nFlags & LOGINERROR_FLAG_IS_USE_SYSCREDS ) ==
+ { return ( m_nFlags & LOGINERROR_FLAG_IS_USE_SYSCREDS ) ==
LOGINERROR_FLAG_IS_USE_SYSCREDS; }
- BYTE GetFlags() const { return _nFlags; }
- USHORT GetResult() const { return _nRet; }
+ BYTE GetFlags() const { return m_nFlags; }
+ USHORT GetResult() const { return m_nRet; }
void SetTitle( const String& aTitle )
- { _aTitle = aTitle; }
+ { m_aTitle = aTitle; }
void SetServer( const String& aServer )
- { _aServer = aServer; }
+ { m_aServer = aServer; }
void SetAccount( const String& aAccount )
- { _aAccount = aAccount; }
+ { m_aAccount = aAccount; }
void SetUserName( const String& aUserName )
- { _aUserName = aUserName; }
+ { m_aUserName = aUserName; }
void SetPassword( const String& aPassword )
- { _aPassword = aPassword; }
+ { m_aPassword = aPassword; }
+ void SetPasswordToModify( const String& aPassword )
+ { m_aPasswordToModify = aPassword; }
+ void SetRecommendToOpenReadonly( bool bVal )
+ { m_bRecommendToOpenReadonly = bVal; }
void SetPath( const String& aPath )
- { _aPath = aPath; }
+ { m_aPath = aPath; }
void SetErrorText( const String& aErrorText )
- { _aErrorText = aErrorText; }
+ { m_aErrorText = aErrorText; }
void SetFlags( BYTE nFlags )
- { _nFlags = nFlags; }
- inline void SetSavePassword( BOOL bSet );
- inline void SetPersistentPassword( BOOL bSet );
+ { m_nFlags = nFlags; }
+
+ inline void SetCanRememberPassword( BOOL bSet );
+ inline void SetIsRememberPassword( BOOL bSet );
+ inline void SetIsRememberPersistent( BOOL bSet );
+
inline void SetCanUseSystemCredentials( BOOL bSet );
inline void SetIsUseSystemCredentials( BOOL bSet );
inline void SetModifyAccount( BOOL bSet );
inline void SetModifyUserName( BOOL bSet );
+
void SetResult( USHORT nRet )
- { _nRet = nRet; }
+ { m_nRet = nRet; }
};
-inline void LoginErrorInfo::SetSavePassword( BOOL bSet )
+inline void LoginErrorInfo::SetCanRememberPassword( BOOL bSet )
{
if ( bSet )
- _nFlags |= LOGINERROR_FLAG_SET_SAVE_PASSWORD;
+ m_nFlags |= LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD;
else
- _nFlags &= ~LOGINERROR_FLAG_SET_SAVE_PASSWORD;
+ m_nFlags &= ~LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD;
}
-inline void LoginErrorInfo::SetPersistentPassword( BOOL bSet )
+inline void LoginErrorInfo::SetIsRememberPassword( BOOL bSet )
{
if ( bSet )
- _nFlags |= LOGINERROR_FLAG_PERSISTENT_PASSWORD;
+ m_nFlags |= LOGINERROR_FLAG_IS_REMEMBER_PASSWORD;
else
- _nFlags &= ~LOGINERROR_FLAG_PERSISTENT_PASSWORD;
+ m_nFlags &= ~LOGINERROR_FLAG_IS_REMEMBER_PASSWORD;
+}
+
+inline void LoginErrorInfo::SetIsRememberPersistent( BOOL bSet )
+{
+ if ( bSet )
+ m_nFlags |= LOGINERROR_FLAG_REMEMBER_PERSISTENT;
+ else
+ m_nFlags &= ~LOGINERROR_FLAG_REMEMBER_PERSISTENT;
}
inline void LoginErrorInfo::SetCanUseSystemCredentials( BOOL bSet )
{
if ( bSet )
- _nFlags |= LOGINERROR_FLAG_CAN_USE_SYSCREDS;
+ m_nFlags |= LOGINERROR_FLAG_CAN_USE_SYSCREDS;
else
- _nFlags &= ~LOGINERROR_FLAG_CAN_USE_SYSCREDS;
+ m_nFlags &= ~LOGINERROR_FLAG_CAN_USE_SYSCREDS;
}
inline void LoginErrorInfo::SetIsUseSystemCredentials( BOOL bSet )
{
if ( bSet )
- _nFlags |= LOGINERROR_FLAG_IS_USE_SYSCREDS;
+ m_nFlags |= LOGINERROR_FLAG_IS_USE_SYSCREDS;
else
- _nFlags &= ~LOGINERROR_FLAG_IS_USE_SYSCREDS;
+ m_nFlags &= ~LOGINERROR_FLAG_IS_USE_SYSCREDS;
}
inline void LoginErrorInfo::SetModifyAccount( BOOL bSet )
{
if ( bSet )
- _nFlags |= LOGINERROR_FLAG_MODIFY_ACCOUNT;
+ m_nFlags |= LOGINERROR_FLAG_MODIFY_ACCOUNT;
else
- _nFlags &= ~LOGINERROR_FLAG_MODIFY_ACCOUNT;
+ m_nFlags &= ~LOGINERROR_FLAG_MODIFY_ACCOUNT;
}
inline void LoginErrorInfo::SetModifyUserName( BOOL bSet )
{
if ( bSet )
- _nFlags |= LOGINERROR_FLAG_MODIFY_USER_NAME;
+ m_nFlags |= LOGINERROR_FLAG_MODIFY_USER_NAME;
else
- _nFlags &= ~LOGINERROR_FLAG_MODIFY_USER_NAME;
+ m_nFlags &= ~LOGINERROR_FLAG_MODIFY_USER_NAME;
}
#endif
+
+
diff --git a/uui/source/passwordcontainer.cxx b/uui/source/passwordcontainer.cxx
index 26d22b320d8a..0a056289c29d 100644
--- a/uui/source/passwordcontainer.cxx
+++ b/uui/source/passwordcontainer.cxx
@@ -30,6 +30,7 @@
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/task/NoMasterException.hpp"
#include "com/sun/star/task/XInteractionHandler.hpp"
+#include "com/sun/star/task/XMasterPasswordHandling.hpp"
#include "com/sun/star/task/XPasswordContainer.hpp"
#include "com/sun/star/task/XUrlContainer.hpp"
#include "com/sun/star/ucb/AuthenticationRequest.hpp"
@@ -271,10 +272,20 @@ bool PasswordContainerHelper::addRecord(
return false;
if ( bPersist )
+ {
+ uno::Reference< task::XMasterPasswordHandling > xMPH(
+ m_xPasswordContainer, uno::UNO_QUERY_THROW );
+
+ // If persistent storing of passwords is not yet
+ // allowed, enable it.
+ if ( !xMPH->isPersistentStoringAllowed() )
+ xMPH->allowPersistentStoring( sal_True );
+
m_xPasswordContainer->addPersistent( rURL,
rUsername,
rPasswords,
xIH );
+ }
else
m_xPasswordContainer->add( rURL,
rUsername,
@@ -429,7 +440,7 @@ PasswordContainerInteractionHandler::handle(
// @@@ FIXME: this not able to
// handle master pw request!
// master pw request is never
- // solvabe without UI!
+ // solvable without UI!
this ) )
{
// successfully handled
diff --git a/uui/source/passworddlg.cxx b/uui/source/passworddlg.cxx
index 4962563601c3..c89184f54bc1 100644..100755
--- a/uui/source/passworddlg.cxx
+++ b/uui/source/passworddlg.cxx
@@ -48,30 +48,34 @@ IMPL_LINK( PasswordDialog, OKHdl_Impl, OKButton *, EMPTYARG )
// -----------------------------------------------------------------------
-PasswordDialog::PasswordDialog
-(
+PasswordDialog::PasswordDialog(
Window* _pParent,
::com::sun::star::task::PasswordRequestMode nDlgMode,
ResMgr * pResMgr,
- rtl::OUString& aDocURL
- )
+ rtl::OUString& aDocURL,
+ bool bOpenToModify )
+
:ModalDialog( _pParent, ResId( DLG_UUI_PASSWORD, *pResMgr ) )
- ,aFTPassword ( this, ResId( FT_PASSWORD, *pResMgr ) )
- ,aEDPassword ( this, ResId( ED_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 ) )
- ,nDialogMode ( nDlgMode )
- ,pResourceMgr ( pResMgr )
+ ,aFTPassword( this, ResId( FT_PASSWORD, *pResMgr ))
+ ,aEDPassword( this, ResId( ED_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 ))
+ ,nDialogMode( nDlgMode )
+ ,pResourceMgr ( pResMgr )
{
if( nDialogMode == ::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER )
{
- String aErrorMsg( ResId( STR_ERROR_PASSWORD_WRONG, *pResourceMgr ));
+ USHORT nErrStrId = bOpenToModify ? STR_ERROR_PASSWORD_TO_MODIFY_WRONG : STR_ERROR_PASSWORD_TO_OPEN_WRONG;
+ String aErrorMsg( ResId( nErrStrId, *pResourceMgr ));
ErrorBox aErrorBox( _pParent, WB_OK, aErrorMsg );
aErrorBox.Execute();
}
+ USHORT nStrId = bOpenToModify ? STR_ENTER_PASSWORD_TO_MODIFY : STR_ENTER_PASSWORD_TO_OPEN;
+ aFTPassword.SetText( String( ResId( nStrId, *pResourceMgr ) ) );
+
FreeResource();
aFTPassword.SetText( aFTPassword.GetText() + aDocURL );
diff --git a/uui/source/passworddlg.hxx b/uui/source/passworddlg.hxx
index d07399012616..fe5fe7f2ef84 100644..100755
--- a/uui/source/passworddlg.hxx
+++ b/uui/source/passworddlg.hxx
@@ -50,7 +50,7 @@ class PasswordDialog : public ModalDialog
DECL_LINK( OKHdl_Impl, OKButton * );
public:
- PasswordDialog( Window* pParent, ::com::sun::star::task::PasswordRequestMode nDlgMode, ResMgr * pResMgr, ::rtl::OUString& aDocURL );
+ PasswordDialog( Window* pParent, ::com::sun::star::task::PasswordRequestMode nDlgMode, ResMgr * pResMgr, ::rtl::OUString& aDocURL, bool bOpenToModify = false );
String GetPassword() const { return aEDPassword.GetText(); }
diff --git a/uui/source/passworddlg.src b/uui/source/passworddlg.src
index 96863ad9ca32..33767057e1bd 100644..100755
--- a/uui/source/passworddlg.src
+++ b/uui/source/passworddlg.src
@@ -41,27 +41,33 @@ ModalDialog DLG_UUI_PASSWORD
Moveable = TRUE ;
OutputSize = TRUE ;
SVLook = TRUE ;
- Size = MAP_APPFONT( 145, 75 );
+ Size = MAP_APPFONT( 145, 91 );
Text [ en-US ] = "Enter password";
+
FixedText FT_PASSWORD
{
Pos = MAP_APPFONT( 3, 4 );
Size = MAP_APPFONT( 139, 28 );
- Text [ en-US ] = "Enter password to open file: \n";
WordBreak = TRUE;
};
Edit ED_PASSWORD
{
- Pos = MAP_APPFONT( 3, 35 );
+ Pos = MAP_APPFONT( 3, 51 );
Size = MAP_APPFONT( 139, 13 );
Border = TRUE ;
PassWord = TRUE ;
};
+ FixedLine FL_FIXED_LINE_1
+ {
+ Pos = MAP_APPFONT( 0, 66 );
+ Size = MAP_APPFONT( 145, 6 );
+ };
+
OKButton BTN_PASSWORD_OK
{
- Pos = MAP_APPFONT( 27, 56 );
+ Pos = MAP_APPFONT( 27, 72 );
Size = MAP_APPFONT( 37, 15 );
DefButton = TRUE ;
DefButton = TRUE;
@@ -69,20 +75,24 @@ ModalDialog DLG_UUI_PASSWORD
CancelButton BTN_PASSWORD_CANCEL
{
- Pos = MAP_APPFONT( 66, 56 );
+ Pos = MAP_APPFONT( 66, 72 );
Size = MAP_APPFONT( 37, 15 );
};
HelpButton BTN_PASSWORD_HELP
{
- Pos = MAP_APPFONT( 105, 56 );
+ Pos = MAP_APPFONT( 105, 72 );
Size = MAP_APPFONT( 37, 15 );
};
- FixedLine FL_FIXED_LINE_1
+ String STR_ENTER_PASSWORD_TO_OPEN
{
- Pos = MAP_APPFONT( 0, 50 );
- Size = MAP_APPFONT( 145, 6 );
+ Text [ en-US ] = "Enter password to open file: \n";
+ };
+
+ String STR_ENTER_PASSWORD_TO_MODIFY
+ {
+ Text [ en-US ] = "Enter password to modify file: \n";
};
};
diff --git a/uui/source/passworderrs.src b/uui/source/passworderrs.src
index fe631257c9d2..91b244ae543e 100644..100755
--- a/uui/source/passworderrs.src
+++ b/uui/source/passworderrs.src
@@ -31,9 +31,14 @@
#include <ids.hrc>
#endif
-String STR_ERROR_PASSWORD_WRONG
+String STR_ERROR_PASSWORD_TO_OPEN_WRONG
{
- Text [ en-US ] = "The password is incorrect. The document cannot be opened.";
+ Text [ en-US ] = "The password is incorrect. The file cannot be opened.";
+};
+
+String STR_ERROR_PASSWORD_TO_MODIFY_WRONG
+{
+ Text [ en-US ] = "The password is incorrect. The file cannot be modified.";
};
String STR_ERROR_MASTERPASSWORD_WRONG
diff --git a/uui/util/exports.map b/uui/util/exports.map
deleted file mode 100644
index ba501f9ae076..000000000000
--- a/uui/util/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/uui/util/makefile.mk b/uui/util/makefile.mk
index 78d726d0eec6..163a7bb5502e 100644
--- a/uui/util/makefile.mk
+++ b/uui/util/makefile.mk
@@ -38,7 +38,7 @@ NO_BSYMBOLIC = true
SHL1TARGET = $(TARGET)$(DLLPOSTFIX)
SHL1IMPLIB = i$(TARGET)
-SHL1VERSIONMAP = exports.map
+SHL1VERSIONMAP = $(SOLARENV)/src/component.map
SHL1DEF = $(MISC)$/$(SHL1TARGET).def
DEF1NAME = $(SHL1TARGET)
diff --git a/vbahelper/inc/vbahelper/msvbahelper.hxx b/vbahelper/inc/vbahelper/msvbahelper.hxx
deleted file mode 100644
index 898c44c349bc..000000000000
--- a/vbahelper/inc/vbahelper/msvbahelper.hxx
+++ /dev/null
@@ -1,55 +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 _MSVBAHELPER_HXX
-#define _MSVBAHELPER_HXX
-
-#include <sfx2/objsh.hxx>
-#include <vbahelper/vbadllapi.h>
-
-namespace ooo { namespace vba
-{
- class VBAHELPER_DLLPUBLIC VBAMacroResolvedInfo
- {
- SfxObjectShell* mpDocContext;
- bool mbFound;
- String msResolvedMacro;
- public:
- VBAMacroResolvedInfo() : mpDocContext(NULL), mbFound( false ){}
- void SetResolved( bool bRes ) { mbFound = bRes; }
- bool IsResolved() { return mbFound; }
- void SetMacroDocContext(SfxObjectShell* pShell ) { mpDocContext = pShell; }
- SfxObjectShell* MacroDocContext() { return mpDocContext; }
- String ResolvedMacro() { return msResolvedMacro; }
- void SetResolvedMacro(const String& sMacro ) { msResolvedMacro = sMacro; }
- };
-
- VBAHELPER_DLLPUBLIC String makeMacroURL( const String& sMacroName );
- VBAHELPER_DLLPUBLIC VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& sMod, bool bSearchGlobalTemplates = false );
- VBAHELPER_DLLPUBLIC sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArgs, com::sun::star::uno::Any& aRet, const com::sun::star::uno::Any& aCaller );
-} }
-
-#endif
diff --git a/vbahelper/inc/vbahelper/vbaaccesshelper.hxx b/vbahelper/inc/vbahelper/vbaaccesshelper.hxx
new file mode 100644
index 000000000000..79bb44ce30a4
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbaaccesshelper.hxx
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: vbahelper.hxx,v $
+ * $Revision: 1.5.32.1 $
+ *
+ * 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 OOVBAAPI_VBA_ACCESS_HELPER_HXX
+#define OOVBAAPI_VBA_ACCESS_HELPER_HXX
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <basic/basmgr.hxx>
+#include <sfx2/objsh.hxx>
+#include <sfx2/docfilt.hxx>
+#include <sfx2/docfile.hxx>
+#define VBAHELPER_DLLIMPLEMENTATION
+#include <vbahelper/vbadllapi.h>
+#include <memory>
+namespace css = ::com::sun::star;
+namespace ooo
+{
+ namespace vba
+ {
+
+ VBAHELPER_DLLPRIVATE inline css::uno::Reference< css::lang::XMultiServiceFactory > getVBAServiceFactory( SfxObjectShell* pShell )
+ {
+ css::uno::Any aUnoVar;
+ if ( !pShell || ! pShell->GetBasicManager()->GetGlobalUNOConstant( "VBAGlobals", aUnoVar ) )
+ throw css::lang::IllegalArgumentException();
+ css::uno::Reference< css::lang::XMultiServiceFactory > xVBAFactory( aUnoVar, css::uno::UNO_QUERY_THROW );
+ return xVBAFactory;
+ }
+
+ VBAHELPER_DLLPUBLIC inline css::uno::Reference< css::uno::XInterface > createVBAUnoAPIServiceWithArgs( SfxObjectShell* pShell, const sal_Char* _pAsciiName, const css::uno::Sequence< css::uno::Any >& aArgs ) throw (css::uno::RuntimeException)
+ {
+ OSL_PRECOND( pShell, "createVBAUnoAPIService: no shell!" );
+ ::rtl::OUString sVarName( ::rtl::OUString::createFromAscii( _pAsciiName ) );
+ css::uno::Reference< css::uno::XInterface > xIf = getVBAServiceFactory( pShell )->createInstanceWithArguments( sVarName, aArgs );
+ return xIf;
+ }
+
+
+ VBAHELPER_DLLPRIVATE inline bool isAlienDoc( SfxObjectShell& rDocShell, const char* pMimeType )
+ {
+ bool bRes( false );
+ const SfxFilter *pFilt = rDocShell.GetMedium()->GetFilter();
+ if ( pFilt && pFilt->IsAlienFormat() )
+ bRes = ( pFilt->GetMimeType().CompareToAscii( pMimeType ) == 0 );
+ return bRes;
+ }
+ VBAHELPER_DLLPUBLIC inline bool isAlienExcelDoc( SfxObjectShell& rDocShell ) { return isAlienDoc( rDocShell, "application/vnd.ms-excel" ); }
+ VBAHELPER_DLLPUBLIC inline bool isAlienWordDoc( SfxObjectShell& rDocShell ) { return isAlienDoc( rDocShell, "application/vnd.ms-word" ); }
+
+ } // openoffice
+} // org
+
+#endif
diff --git a/vbahelper/inc/vbahelper/vbaapplicationbase.hxx b/vbahelper/inc/vbahelper/vbaapplicationbase.hxx
index e72015413192..e2a5a3bff5da 100644
--- a/vbahelper/inc/vbahelper/vbaapplicationbase.hxx
+++ b/vbahelper/inc/vbahelper/vbaapplicationbase.hxx
@@ -34,8 +34,12 @@
typedef InheritedHelperInterfaceImpl1< ov::XApplicationBase > ApplicationBase_BASE;
+struct VbaApplicationBase_Impl;
+
class VBAHELPER_DLLPUBLIC VbaApplicationBase : public ApplicationBase_BASE
{
+ VbaApplicationBase_Impl* m_pImpl;
+
protected:
VbaApplicationBase( const css::uno::Reference< css::uno::XComponentContext >& xContext );
virtual ~VbaApplicationBase();
@@ -49,11 +53,18 @@ 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 ::rtl::OUString SAL_CALL getVersion() 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 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);
+
// 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 6d596c31ba53..36102116c7b3 100644
--- a/vbahelper/inc/vbahelper/vbacollectionimpl.hxx
+++ b/vbahelper/inc/vbahelper/vbacollectionimpl.hxx
@@ -24,6 +24,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+
#ifndef OOVBAAPI_VBA_COLLECTION_IMPL_HXX
#define OOVBAAPI_VBA_COLLECTION_IMPL_HXX
@@ -44,8 +45,91 @@
#include <vector>
+// ============================================================================
+
typedef ::cppu::WeakImplHelper1< css::container::XEnumeration > EnumerationHelper_BASE;
+// ============================================================================
+
+/** A wrapper that holds a com.sun.star.container.XIndexAccess and provides a
+ com.sun.star.container.XEnumeration.
+
+ Can be used to provide an enumeration from an index container that contains
+ completely constructed/initialized VBA implementation objects. CANNOT be
+ used to provide an enumeration from an index container with other objects
+ (e.g. UNO objects) where construction of the VBA objects is needed first.
+ */
+class VBAHELPER_DLLPUBLIC SimpleIndexAccessToEnumeration : public EnumerationHelper_BASE
+{
+public:
+ explicit SimpleIndexAccessToEnumeration(
+ const css::uno::Reference< css::container::XIndexAccess >& rxIndexAccess ) throw (css::uno::RuntimeException) :
+ mxIndexAccess( rxIndexAccess ), mnIndex( 0 ) {}
+
+ virtual sal_Bool SAL_CALL hasMoreElements() throw (css::uno::RuntimeException)
+ {
+ return mnIndex < mxIndexAccess->getCount();
+ }
+
+ virtual css::uno::Any SAL_CALL nextElement() throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {
+ if( !hasMoreElements() )
+ throw css::container::NoSuchElementException();
+ return mxIndexAccess->getByIndex( mnIndex++ );
+ }
+
+private:
+ css::uno::Reference< css::container::XIndexAccess > mxIndexAccess;
+ sal_Int32 mnIndex;
+};
+
+// ============================================================================
+
+/** A wrapper that holds a com.sun.star.container.XEnumeration or a
+ com.sun.star.container.XIndexAccess and provides an enumeration of VBA objects.
+
+ The method nextElement() needs to be implemented by the derived class. This
+ class can be used to convert an enumeration or an index container
+ containing UNO objects to an enumeration providing the related VBA objects.
+ */
+class VBAHELPER_DLLPUBLIC SimpleEnumerationBase : public EnumerationHelper_BASE
+{
+public:
+ explicit SimpleEnumerationBase(
+ const css::uno::Reference< ov::XHelperInterface >& rxParent,
+ const css::uno::Reference< css::uno::XComponentContext >& rxContext,
+ const css::uno::Reference< css::container::XEnumeration >& rxEnumeration ) throw (css::uno::RuntimeException) :
+ mxParent( rxParent ), mxContext( rxContext ), mxEnumeration( rxEnumeration ) {}
+
+ explicit SimpleEnumerationBase(
+ const css::uno::Reference< ov::XHelperInterface >& rxParent,
+ const css::uno::Reference< css::uno::XComponentContext >& rxContext,
+ const css::uno::Reference< css::container::XIndexAccess >& rxIndexAccess ) throw (css::uno::RuntimeException) :
+ mxParent( rxParent ), mxContext( rxContext ), mxEnumeration( new SimpleIndexAccessToEnumeration( rxIndexAccess ) ) {}
+
+ virtual sal_Bool SAL_CALL hasMoreElements() throw (css::uno::RuntimeException)
+ {
+ return mxEnumeration->hasMoreElements();
+ }
+
+ virtual css::uno::Any SAL_CALL nextElement() throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {
+ return createCollectionObject( mxEnumeration->nextElement() );
+ }
+
+ /** Derived classes implement creation of a VBA implementation object from
+ the passed container element. */
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& rSource ) = 0;
+
+protected:
+ css::uno::Reference< ov::XHelperInterface > mxParent;
+ css::uno::Reference< css::uno::XComponentContext > mxContext;
+ css::uno::Reference< css::container::XEnumeration > mxEnumeration;
+};
+
+// ============================================================================
+
+// deprecated, use SimpleEnumerationBase instead!
class VBAHELPER_DLLPUBLIC EnumerationHelperImpl : public EnumerationHelper_BASE
{
protected:
@@ -181,6 +265,14 @@ protected:
// need to adjust for vba index ( for which first element is 1 )
return createCollectionObject( m_xIndexAccess->getByIndex( nIndex - 1 ) );
}
+
+ virtual void UpdateCollectionIndex( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess )
+ {
+ css::uno::Reference< css::container::XNameAccess > xNameAccess( xIndexAccess, css::uno::UNO_QUERY_THROW );
+ m_xIndexAccess = xIndexAccess;
+ m_xNameAccess = xNameAccess;
+ }
+
public:
ScVbaCollectionBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ) : BaseColBase( xParent, xContext ), m_xIndexAccess( xIndexAccess ){ m_xNameAccess.set(m_xIndexAccess, css::uno::UNO_QUERY); }
//XCollection
diff --git a/vbahelper/inc/vbahelper/vbadocumentbase.hxx b/vbahelper/inc/vbahelper/vbadocumentbase.hxx
index 36648ff6849b..7131e1963b26 100644
--- a/vbahelper/inc/vbahelper/vbadocumentbase.hxx
+++ b/vbahelper/inc/vbahelper/vbadocumentbase.hxx
@@ -53,6 +53,9 @@ public:
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
+
+
// Methods
virtual void SAL_CALL Close( const css::uno::Any &bSaveChanges,
const css::uno::Any &aFileName,
diff --git a/vbahelper/inc/vbahelper/vbafontbase.hxx b/vbahelper/inc/vbahelper/vbafontbase.hxx
index b820804f1fe2..d1272c9dcf48 100644
--- a/vbahelper/inc/vbahelper/vbafontbase.hxx
+++ b/vbahelper/inc/vbahelper/vbafontbase.hxx
@@ -63,8 +63,15 @@ class VBAHELPER_DLLPUBLIC VbaFontBase : public VbaFontBase_BASE
protected:
css::uno::Reference< css::beans::XPropertySet > mxFont;
css::uno::Reference< css::container::XIndexAccess > mxPalette;
+ bool mbFormControl;
+
public:
- VbaFontBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xPalette, css::uno::Reference< css::beans::XPropertySet > xPropertySet ) throw ( css::uno::RuntimeException );
+ VbaFontBase(
+ const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::container::XIndexAccess >& xPalette,
+ const css::uno::Reference< css::beans::XPropertySet >& xPropertySet,
+ bool bFormControl = false ) throw ( css::uno::RuntimeException );
virtual ~VbaFontBase();// {}
// Attributes
diff --git a/vbahelper/inc/vbahelper/vbahelper.hxx b/vbahelper/inc/vbahelper/vbahelper.hxx
index 315ddb19b7ca..33613bb76091 100644
--- a/vbahelper/inc/vbahelper/vbahelper.hxx
+++ b/vbahelper/inc/vbahelper/vbahelper.hxx
@@ -35,17 +35,20 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/awt/XDevice.hpp>
+#include <com/sun/star/awt/XUnitConversion.hpp>
+#include <basic/basmgr.hxx>
#include <basic/sberrors.hxx>
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/frame/XModel.hpp>
#include <sfx2/dispatch.hxx>
-//#include <ooo/vba/msforms/XShape.hpp>
+#include <sfx2/objsh.hxx>
+#include <sfx2/docfilt.hxx>
+#include <sfx2/docfile.hxx>
#include <vcl/pointr.hxx>
-#define VBAHELPER_DLLIMPLEMENTATION
-#include <vbahelper/vbadllapi.h>
#include <memory>
-namespace css = ::com::sun::star;
+#include "vbaaccesshelper.hxx"
+namespace css = ::com::sun::star;
namespace ooo
{
namespace vba
@@ -62,16 +65,18 @@ namespace ooo
}
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);
- VBAHELPER_DLLPUBLIC css::uno::Reference< css::uno::XInterface > createVBAUnoAPIServiceWithArgs( SfxObjectShell* pShell, const sal_Char* _pAsciiName, const css::uno::Sequence< css::uno::Any >& aArgs ) throw (css::uno::RuntimeException);
+
css::uno::Reference< css::frame::XModel > getCurrentDoc( const rtl::OUString& sKey ) throw (css::uno::RuntimeException);
+ VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getThisExcelDoc( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
+ VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getThisWordDoc( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getCurrentExcelDoc( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getCurrentWordDoc( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
VBAHELPER_DLLPUBLIC css::uno::Reference< css::beans::XIntrospectionAccess > getIntrospectionAccess( const css::uno::Any& aObject ) throw (css::uno::RuntimeException);
VBAHELPER_DLLPUBLIC css::uno::Reference< css::script::XTypeConverter > getTypeConverter( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
- VBAHELPER_DLLPUBLIC void dispatchRequests (css::uno::Reference< css::frame::XModel>& xModel,rtl::OUString & aUrl) ;
- VBAHELPER_DLLPUBLIC void dispatchRequests (css::uno::Reference< css::frame::XModel>& xModel,rtl::OUString & aUrl, css::uno::Sequence< css::beans::PropertyValue >& sProps ) ;
+ VBAHELPER_DLLPUBLIC void dispatchRequests( const css::uno::Reference< css::frame::XModel>& xModel, const rtl::OUString& aUrl );
+ VBAHELPER_DLLPUBLIC void dispatchRequests( const css::uno::Reference< css::frame::XModel>& xModel, const rtl::OUString& aUrl, const css::uno::Sequence< css::beans::PropertyValue >& sProps );
VBAHELPER_DLLPUBLIC void dispatchExecute(SfxViewShell* pView, USHORT nSlot, SfxCallMode nCall = SFX_CALLMODE_SYNCHRON );
VBAHELPER_DLLPUBLIC sal_Int32 OORGBToXLRGB( sal_Int32 );
VBAHELPER_DLLPUBLIC sal_Int32 XLRGBToOORGB( sal_Int32 );
@@ -88,7 +93,9 @@ namespace ooo
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);
VBAHELPER_DLLPUBLIC double PointsToPixels( css::uno::Reference< css::awt::XDevice >& xDevice, double fPoints, sal_Bool bVertical);
- VBAHELPER_DLLPUBLIC double PixelsToPoints( css::uno::Reference< css::awt::XDevice >& xDevice, double fPoints, sal_Bool bVertical);
+ VBAHELPER_DLLPUBLIC double PixelsToPoints( css::uno::Reference< css::awt::XDevice >& xDevice, double fPixels, sal_Bool bVertical);
+ VBAHELPER_DLLPUBLIC sal_Int32 PointsToHmm( double fPoints );
+ VBAHELPER_DLLPUBLIC double HmmToPoints( sal_Int32 nHmm );
VBAHELPER_DLLPUBLIC sal_Int32 getPointerStyle( const css::uno::Reference< css::frame::XModel >& );
VBAHELPER_DLLPUBLIC void setCursorHelper( const css::uno::Reference< css::frame::XModel >& xModel, const Pointer& rPointer, sal_Bool bOverWrite );
VBAHELPER_DLLPUBLIC void setDefaultPropByIntrospection( const css::uno::Any& aObj, const css::uno::Any& aValue ) throw ( css::uno::RuntimeException );
@@ -99,8 +106,6 @@ class VBAHELPER_DLLPUBLIC Millimeter
{
//Factor to translate between points and hundredths of millimeters:
private:
- static const double factor;
-
double m_nMillimeter;
public:
@@ -174,12 +179,19 @@ public:
virtual double getWidth();
virtual void setWidth( double nWidth);
};
+
#define VBA_LEFT "PositionX"
#define VBA_TOP "PositionY"
+#define VBA_HEIGHT "Height"
+#define VBA_WIDTH "Width"
class VBAHELPER_DLLPUBLIC UserFormGeometryHelper : public AbstractGeometryAttributes
{
-
+ css::uno::Reference< css::awt::XUnitConversion > mxControlUnits;
css::uno::Reference< css::beans::XPropertySet > mxModel;
+
+ sal_Int32 ConvertLogicToPixel( sal_Int32 nValue, sal_Bool bIsPoint, sal_Bool bIsX, sal_Int16 nSourceUnit );
+ sal_Int32 ConvertPixelToLogic( sal_Int32 nValue, sal_Bool bIsPoint, sal_Bool bIsX, sal_Int16 nTargetUnit );
+
public:
UserFormGeometryHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::awt::XControl >& xControl );
virtual double getLeft();
diff --git a/vbahelper/inc/vbahelper/vbahelperinterface.hxx b/vbahelper/inc/vbahelper/vbahelperinterface.hxx
index 5695ab36b4fa..21339631e1ed 100644
--- a/vbahelper/inc/vbahelper/vbahelperinterface.hxx
+++ b/vbahelper/inc/vbahelper/vbahelperinterface.hxx
@@ -115,4 +115,57 @@ public:
InheritedHelperInterfaceImpl1< Ifc1 > ( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xParent, xContext ) {}
};
+
+// ============================================================================
+
+/** Helper macro to implement the method 'getServiceImplName()' of the
+ 'ooo.vba.XHelperInterface' interface. Will return the class name as service
+ implementation name.
+ */
+#define VBAHELPER_IMPL_GETSERVICEIMPLNAME( classname ) \
+::rtl::OUString& classname::getServiceImplName() \
+{ \
+ static ::rtl::OUString saImplName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( #classname ) ); \
+ return saImplName; \
+}
+
+// ----------------------------------------------------------------------------
+
+/** Helper macro to implement the method 'getServiceNames()' for a single
+ service name.
+ */
+#define VBAHELPER_IMPL_GETSERVICENAMES( classname, servicename ) \
+css::uno::Sequence< ::rtl::OUString > classname::getServiceNames() \
+{ \
+ static css::uno::Sequence< ::rtl::OUString > saServiceNames; \
+ if( saServiceNames.getLength() == 0 ) \
+ { \
+ saServiceNames.realloc( 1 ); \
+ saServiceNames[ 0 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( servicename ) ); \
+ } \
+ return saServiceNames; \
+}
+
+// ----------------------------------------------------------------------------
+
+/** Helper macro to declare the methods 'getServiceImplName()' and
+ 'getServiceNames()' of the 'ooo.vba.XHelperInterface' interface in a class
+ declaration.
+ */
+#define VBAHELPER_DECL_XHELPERINTERFACE \
+ virtual ::rtl::OUString& getServiceImplName(); \
+ virtual css::uno::Sequence< ::rtl::OUString > getServiceNames();
+
+// ----------------------------------------------------------------------------
+
+/** Helper macro to implement the methods 'getServiceImplName()' and
+ 'getServiceNames()' of the 'ooo.vba.XHelperInterface' interface. Will
+ return the class name as service implementation name.
+ */
+#define VBAHELPER_IMPL_XHELPERINTERFACE( classname, servicename ) \
+VBAHELPER_IMPL_GETSERVICEIMPLNAME( classname ) \
+VBAHELPER_IMPL_GETSERVICENAMES( classname, servicename )
+
+// ============================================================================
+
#endif
diff --git a/vbahelper/prj/d.lst b/vbahelper/prj/d.lst
index d7b61d1e5a61..d683e97c8b90 100644
--- a/vbahelper/prj/d.lst
+++ b/vbahelper/prj/d.lst
@@ -8,6 +8,7 @@
mkdir: %_DEST%\inc%_EXT%\basic
..\inc\vbahelper\vbacollectionimpl.hxx %_DEST%\inc%_EXT%\vbahelper\vbacollectionimpl.hxx
..\inc\vbahelper\vbahelper.hxx %_DEST%\inc%_EXT%\vbahelper\vbahelper.hxx
+..\inc\vbahelper\vbaaccesshelper.hxx %_DEST%\inc%_EXT%\vbahelper\vbaaccesshelper.hxx
..\inc\vbahelper\helperdecl.hxx %_DEST%\inc%_EXT%\vbahelper\helperdecl.hxx
..\inc\vbahelper\vbahelperinterface.hxx %_DEST%\inc%_EXT%\vbahelper\vbahelperinterface.hxx
..\inc\vbahelper\vbaapplicationbase.hxx %_DEST%\inc%_EXT%\vbahelper\vbaapplicationbase.hxx
diff --git a/vbahelper/source/msforms/makefile.mk b/vbahelper/source/msforms/makefile.mk
index da303458cdd1..40a6b8350fd4 100644
--- a/vbahelper/source/msforms/makefile.mk
+++ b/vbahelper/source/msforms/makefile.mk
@@ -34,6 +34,11 @@ VISIBILITY_HIDDEN=TRUE
# --- Settings -----------------------------------------------------
+.IF "$(ENABLE_VBA)" == "NO"
+dummy:
+ @echo "Nothing to build"
+.ENDIF
+
.INCLUDE : settings.mk
SLOFILES=\
@@ -53,6 +58,7 @@ SLOFILES=\
$(SLO)$/vbamultipage.obj \
$(SLO)$/vbalistcontrolhelper.obj \
$(SLO)$/vbaspinbutton.obj \
+ $(SLO)$/vbasystemaxcontrol.obj \
$(SLO)$/vbaimage.obj \
$(SLO)$/vbapages.obj \
$(SLO)$/vbauserform.obj \
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx
index 8cf00748c278..82b68bbd5be7 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -57,6 +57,7 @@
#include "vbaprogressbar.hxx"
#include "vbamultipage.hxx"
#include "vbaspinbutton.hxx"
+#include "vbasystemaxcontrol.hxx"
#include "vbaimage.hxx"
#include <vbahelper/helperdecl.hxx>
@@ -254,6 +255,22 @@ void SAL_CALL ScVbaControl::SetFocus() throw (uno::RuntimeException)
xWin->setFocus();
}
+void SAL_CALL ScVbaControl::Move( double Left, double Top, const uno::Any& Width, const uno::Any& Height )
+ throw ( uno::RuntimeException )
+{
+ double nWidth = 0.0;
+ double nHeight = 0.0;
+
+ setLeft( Left );
+ setTop( Top );
+
+ if ( Width >>= nWidth )
+ setWidth( nWidth );
+
+ if ( Height >>= nHeight )
+ setHeight( nHeight );
+}
+
rtl::OUString SAL_CALL
ScVbaControl::getControlSource() throw (uno::RuntimeException)
{
@@ -368,16 +385,26 @@ ScVbaControl::setControlTipText( const rtl::OUString& rsToolTip ) throw (css::un
m_xProps->setPropertyValue
(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpText" ) ), uno::makeAny( rsToolTip ) );
}
-//ScVbaControlFactory
-ScVbaControlFactory::ScVbaControlFactory( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel ): m_xContext( xContext ), m_xControl( xControl ), m_xModel( xModel )
+::rtl::OUString SAL_CALL ScVbaControl::getTag()
+ throw (css::uno::RuntimeException)
{
+ return m_aControlTag;
}
-ScVbaControl* ScVbaControlFactory::createControl() throw (uno::RuntimeException)
+void SAL_CALL ScVbaControl::setTag( const ::rtl::OUString& aTag )
+ throw (css::uno::RuntimeException)
{
- return createControl( m_xModel );
+ m_aControlTag = aTag;
}
+
+
+//ScVbaControlFactory
+
+ScVbaControlFactory::ScVbaControlFactory( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel ): m_xContext( xContext ), m_xControl( xControl ), m_xModel( xModel )
+{
+}
+
ScVbaControl* ScVbaControlFactory::createControl( const uno::Reference< uno::XInterface >& xParent ) throw (uno::RuntimeException)
{
uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY );
@@ -387,7 +414,6 @@ ScVbaControl* ScVbaControlFactory::createControl( const uno::Reference< uno::XIn
if ( !xControl.is() )
throw uno::RuntimeException(); // really we should be more informative
return createControl( xControl, xParent );
-
}
ScVbaControl* ScVbaControlFactory::createControl(const uno::Reference< drawing::XControlShape >& xControlShape, const uno::Reference< uno::XInterface >& /*xParent*/ ) throw (uno::RuntimeException)
@@ -460,6 +486,8 @@ ScVbaControl* ScVbaControlFactory::createControl( const uno::Reference< awt::XCo
pControl = new ScVbaMultiPage( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ), xParent );
else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlSpinButtonModel") ) ) )
pControl = new ScVbaSpinButton( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.custom.awt.UnoControlSystemAXContainerModel") ) ) )
+ pControl = new VbaSystemAXControl( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
else
throw uno::RuntimeException( rtl::OUString::createFromAscii("Unsupported control " ), uno::Reference< uno::XInterface >() );
return pControl;
diff --git a/vbahelper/source/msforms/vbacontrol.hxx b/vbahelper/source/msforms/vbacontrol.hxx
index b0db3c476186..992fbd94a8c5 100644
--- a/vbahelper/source/msforms/vbacontrol.hxx
+++ b/vbahelper/source/msforms/vbacontrol.hxx
@@ -48,6 +48,10 @@ class ScVbaControl : public ControlImpl_BASE
private:
com::sun::star::uno::Reference< com::sun::star::lang::XEventListener > m_xEventListener;
protected:
+ // awt control has nothing similar to Tag property of Mso controls,
+ // whether it is necessary is another question
+ ::rtl::OUString m_aControlTag;
+
std::auto_ptr< ov::AbstractGeometryAttributes > mpGeometryHelper;
css::uno::Reference< css::beans::XPropertySet > m_xProps;
css::uno::Reference< css::uno::XInterface > m_xControl;
@@ -75,6 +79,7 @@ public:
virtual double SAL_CALL getTop() throw (css::uno::RuntimeException);
virtual void SAL_CALL setTop( double _top ) throw (css::uno::RuntimeException);
virtual void SAL_CALL SetFocus( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Move( double Left, double Top, const ::com::sun::star::uno::Any& Width, const ::com::sun::star::uno::Any& Height ) throw (::com::sun::star::uno::RuntimeException);
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getObject() throw (css::uno::RuntimeException);
virtual rtl::OUString SAL_CALL getControlSource() throw (css::uno::RuntimeException);
@@ -85,6 +90,8 @@ public:
virtual void SAL_CALL setName( const rtl::OUString& _name ) throw (css::uno::RuntimeException);
virtual rtl::OUString SAL_CALL getControlTipText() throw (css::uno::RuntimeException);
virtual void SAL_CALL setControlTipText( const rtl::OUString& ) throw (css::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getTag() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setTag( const ::rtl::OUString& aTag ) throw (css::uno::RuntimeException);
//remove resouce because ooo.vba.excel.XControl is a wrapper of com.sun.star.drawing.XControlShape
virtual void removeResouce() throw( css::uno::RuntimeException );
//XHelperInterface
@@ -98,7 +105,6 @@ class ScVbaControlFactory
public:
ScVbaControlFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext,
const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel );
- ScVbaControl* createControl() throw ( css::uno::RuntimeException );
ScVbaControl* createControl( const css::uno::Reference< css::uno::XInterface >& xParent ) throw ( css::uno::RuntimeException );
private:
ScVbaControl* createControl( const css::uno::Reference< css::awt::XControl >&, const css::uno::Reference< css::uno::XInterface >& ) throw ( css::uno::RuntimeException );
diff --git a/vbahelper/source/msforms/vbacontrols.cxx b/vbahelper/source/msforms/vbacontrols.cxx
index 48ef83d60aa6..1284b36be463 100644
--- a/vbahelper/source/msforms/vbacontrols.cxx
+++ b/vbahelper/source/msforms/vbacontrols.cxx
@@ -25,9 +25,14 @@
*
************************************************************************/
+#include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/awt/XControlContainer.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/script/XInvocation.hpp>
+#include <com/sun/star/lang/WrappedTargetException.hpp>
+
#include "vbacontrols.hxx"
#include <cppuhelper/implbase2.hxx>
-#include <com/sun/star/awt/XControlContainer.hpp>
#include <ooo/vba//XControlProvider.hpp>
#include <hash_map>
@@ -48,16 +53,25 @@ class ControlArrayWrapper : public ArrayWrapImpl
ControlVec mControls;
ControlIndexMap mIndices;
- rtl::OUString getControlName( const uno::Reference< awt::XControl >& xCtrl )
+private:
+ void SetArrayElementTo( const uno::Reference< awt::XControl >& xCtrl, sal_Int32 nIndex = -1 )
{
- uno::Reference< beans::XPropertySet > xProp( xCtrl->getModel(), uno::UNO_QUERY );
- rtl::OUString sName;
- xProp->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ) ) >>= sName;
- return sName;
+ // initialize the element with specified index to the control
+ if ( xCtrl.is() )
+ {
+ if ( nIndex == -1 )
+ nIndex = msNames.getLength();
+
+ if ( nIndex >= msNames.getLength() )
+ msNames.realloc( nIndex );
+
+ msNames[ nIndex ] = getControlName( xCtrl );
+ mControls.push_back( xCtrl );
+ mIndices[ msNames[ nIndex ] ] = nIndex;
+ }
}
public:
-
ControlArrayWrapper( const uno::Reference< awt::XControl >& xDialog )
{
mxDialog.set( xDialog, uno::UNO_QUERY_THROW );
@@ -65,14 +79,21 @@ public:
msNames.realloc( sXControls.getLength() );
for ( sal_Int32 i = 0; i < sXControls.getLength(); ++i )
- {
- uno::Reference< awt::XControl > xCtrl = sXControls[ i ];
- msNames[ i ] = getControlName( xCtrl );
- mControls.push_back( xCtrl );
- mIndices[ msNames[ i ] ] = i;
- }
+ SetArrayElementTo( sXControls[ i ], i );
+ }
+
+ static rtl::OUString getControlName( const uno::Reference< awt::XControl >& xCtrl )
+ {
+ if ( !xCtrl.is() )
+ throw uno::RuntimeException();
+
+ uno::Reference< beans::XPropertySet > xProp( xCtrl->getModel(), uno::UNO_QUERY_THROW );
+ rtl::OUString sName;
+ xProp->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ) ) >>= sName;
+ return sName;
}
+
// XElementAccess
virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException)
{
@@ -204,6 +225,141 @@ ScVbaControls::Move( double cx, double cy ) throw (uno::RuntimeException)
}
}
+uno::Any SAL_CALL ScVbaControls::Add( const uno::Any& Object, const uno::Any& StringKey, const uno::Any& /*Before*/, const uno::Any& /*After*/ )
+ throw (uno::RuntimeException)
+{
+ uno::Any aResult;
+ ::rtl::OUString aComServiceName;
+
+ try
+ {
+ if ( !mxDialog.is() )
+ throw uno::RuntimeException();
+
+ uno::Reference< awt::XControl > xNewControl;
+ uno::Reference< lang::XMultiServiceFactory > xModelFactory( mxDialog->getModel(), uno::UNO_QUERY_THROW );
+
+ uno::Reference< container::XNameContainer > xDialogContainer( xModelFactory, uno::UNO_QUERY_THROW );
+
+ Object >>= aComServiceName;
+
+ // TODO: Support Before and After?
+ ::rtl::OUString aNewName;
+ StringKey >>= aNewName;
+ if ( !aNewName.getLength() )
+ {
+ aNewName = aComServiceName;
+ if ( !aNewName.getLength() )
+ aNewName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Control" ) );
+
+ sal_Int32 nInd = 0;
+ while( xDialogContainer->hasByName( aNewName ) && nInd < SAL_MAX_INT32 )
+ {
+ aNewName = aComServiceName;
+ aNewName += ::rtl::OUString::valueOf( nInd );
+ }
+ }
+
+ if ( aComServiceName.getLength() )
+ {
+ uno::Reference< awt::XControlModel > xNewModel( xModelFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.custom.awt.UnoControlSystemAXContainerModel" ) ) ), uno::UNO_QUERY_THROW );
+
+
+ xDialogContainer->insertByName( aNewName, uno::makeAny( xNewModel ) );
+ uno::Reference< awt::XControlContainer > xControlContainer( mxDialog, uno::UNO_QUERY_THROW );
+ xNewControl = xControlContainer->getControl( aNewName );
+
+ try
+ {
+ uno::Reference< script::XInvocation > xControlInvoke( xNewControl, uno::UNO_QUERY_THROW );
+
+ uno::Sequence< uno::Any > aArgs( 1 );
+ aArgs[0] <<= aComServiceName;
+ uno::Sequence< sal_Int16 > aOutIDDummy;
+ uno::Sequence< uno::Any > aOutDummy;
+ xControlInvoke->invoke( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SOAddAXControl" ) ), aArgs, aOutIDDummy, aOutDummy );
+ }
+ catch( uno::Exception& )
+ {
+ xDialogContainer->removeByName( aNewName );
+ throw;
+ }
+ }
+
+ if ( xNewControl.is() )
+ {
+ UpdateCollectionIndex( lcl_controlsWrapper( mxDialog ) );
+ aResult <<= xNewControl;
+ aResult = createCollectionObject( aResult );
+ }
+ else
+ throw uno::RuntimeException();
+ }
+ catch( uno::RuntimeException& )
+ {
+ throw;
+ }
+ catch( uno::Exception& e )
+ {
+ throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not create AXControl!" ) ),
+ uno::Reference< uno::XInterface >(),
+ uno::makeAny( e ) );
+ }
+
+ return aResult;
+}
+
+void SAL_CALL ScVbaControls::Remove( const uno::Any& StringKeyOrIndex )
+ throw (uno::RuntimeException)
+{
+ ::rtl::OUString aControlName;
+ sal_Int32 nIndex = -1;
+
+ try
+ {
+ if ( !mxDialog.is() )
+ throw uno::RuntimeException();
+
+ uno::Reference< lang::XMultiServiceFactory > xModelFactory( mxDialog->getModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XNameContainer > xDialogContainer( xModelFactory, uno::UNO_QUERY_THROW );
+
+ if ( !( ( StringKeyOrIndex >>= aControlName ) && aControlName.getLength() )
+ && !( ( StringKeyOrIndex >>= nIndex ) && nIndex >= 0 && nIndex < m_xIndexAccess->getCount() ) )
+ throw uno::RuntimeException();
+
+ uno::Reference< awt::XControl > xControl;
+ if ( aControlName.getLength() )
+ {
+ uno::Reference< awt::XControlContainer > xControlContainer( mxDialog, uno::UNO_QUERY_THROW );
+ xControl = xControlContainer->getControl( aControlName );
+ }
+ else
+ {
+ m_xIndexAccess->getByIndex( nIndex ) >>= xControl;
+ }
+
+ if ( !xControl.is() )
+ throw uno::RuntimeException();
+
+ if ( !aControlName.getLength() )
+ aControlName = ControlArrayWrapper::getControlName( xControl );
+
+ xDialogContainer->removeByName( aControlName );
+ xControl->dispose();
+ }
+ catch( uno::RuntimeException& )
+ {
+ throw;
+ }
+ catch( uno::Exception& e )
+ {
+ throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not create AXControl!" ) ),
+ uno::Reference< uno::XInterface >(),
+ uno::makeAny( e ) );
+ }
+}
+
+
uno::Type
ScVbaControls::getElementType() throw (uno::RuntimeException)
{
diff --git a/vbahelper/source/msforms/vbacontrols.hxx b/vbahelper/source/msforms/vbacontrols.hxx
index 804133dbddfa..a72506609531 100644
--- a/vbahelper/source/msforms/vbacontrols.hxx
+++ b/vbahelper/source/msforms/vbacontrols.hxx
@@ -39,14 +39,19 @@ typedef CollTestImplHelper< ov::msforms::XControls > ControlsImpl_BASE;
class ScVbaControls : public ControlsImpl_BASE
{
css::uno::Reference< css::awt::XControl > mxDialog;
+
protected:
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+
public:
ScVbaControls( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext,
const css::uno::Reference< css::awt::XControl >& xDialog );
// XControls
- virtual void SAL_CALL Move( double cx, double cy ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Move( double cx, double cy ) throw (css::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL Add( const ::com::sun::star::uno::Any& Object, const ::com::sun::star::uno::Any& StringKey, const ::com::sun::star::uno::Any& Before, const ::com::sun::star::uno::Any& After ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL Remove( const ::com::sun::star::uno::Any& StringKeyOrIndex ) throw (::com::sun::star::uno::RuntimeException);
+
// XEnumerationAccess
virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
diff --git a/vbahelper/source/msforms/vbasystemaxcontrol.cxx b/vbahelper/source/msforms/vbasystemaxcontrol.cxx
new file mode 100755
index 000000000000..ed2fc70164ac
--- /dev/null
+++ b/vbahelper/source/msforms/vbasystemaxcontrol.cxx
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * 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 "vbasystemaxcontrol.hxx"
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+//----------------------------------------------------------
+VbaSystemAXControl::VbaSystemAXControl( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper )
+: SystemAXControlImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+, m_xControlInvocation( xControl, uno::UNO_QUERY_THROW )
+{
+}
+
+//----------------------------------------------------------
+uno::Reference< beans::XIntrospectionAccess > SAL_CALL VbaSystemAXControl::getIntrospection()
+ throw ( uno::RuntimeException )
+{
+ return m_xControlInvocation->getIntrospection();
+}
+
+//----------------------------------------------------------
+uno::Any SAL_CALL VbaSystemAXControl::invoke( const ::rtl::OUString& aFunctionName, const uno::Sequence< uno::Any >& aParams, uno::Sequence< ::sal_Int16 >& aOutParamIndex, uno::Sequence< uno::Any >& aOutParam )
+ throw ( lang::IllegalArgumentException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException )
+{
+ return m_xControlInvocation->invoke( aFunctionName, aParams, aOutParamIndex, aOutParam );
+}
+
+//----------------------------------------------------------
+void SAL_CALL VbaSystemAXControl::setValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue )
+ throw ( beans::UnknownPropertyException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException )
+{
+ m_xControlInvocation->setValue( aPropertyName, aValue );
+}
+
+//----------------------------------------------------------
+uno::Any SAL_CALL VbaSystemAXControl::getValue( const ::rtl::OUString& aPropertyName )
+ throw ( beans::UnknownPropertyException, uno::RuntimeException )
+{
+ return m_xControlInvocation->getValue( aPropertyName );
+}
+
+//----------------------------------------------------------
+::sal_Bool SAL_CALL VbaSystemAXControl::hasMethod( const ::rtl::OUString& aName )
+ throw ( uno::RuntimeException )
+{
+ return m_xControlInvocation->hasMethod( aName );
+}
+
+//----------------------------------------------------------
+::sal_Bool SAL_CALL VbaSystemAXControl::hasProperty( const ::rtl::OUString& aName )
+ throw ( uno::RuntimeException )
+{
+ return m_xControlInvocation->hasProperty( aName );
+}
+
+//----------------------------------------------------------
+rtl::OUString&
+VbaSystemAXControl::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM( "VbaSystemAXControl" ) );
+ return sImplName;
+}
+
+//----------------------------------------------------------
+uno::Sequence< rtl::OUString >
+VbaSystemAXControl::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.msforms.Frame" ) );
+ }
+ return aServiceNames;
+}
+
diff --git a/vbahelper/source/msforms/vbasystemaxcontrol.hxx b/vbahelper/source/msforms/vbasystemaxcontrol.hxx
new file mode 100755
index 000000000000..bffe5b99c4f1
--- /dev/null
+++ b/vbahelper/source/msforms/vbasystemaxcontrol.hxx
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * 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 VBA_SYSTEMAXCONTROL_HXX
+#define VBA_SYSTEMAXCONTROL_HXX
+
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/script/XInvocation.hpp>
+
+#include "vbacontrol.hxx"
+#include <vbahelper/vbahelper.hxx>
+
+typedef cppu::ImplInheritanceHelper1< ScVbaControl, css::script::XInvocation > SystemAXControlImpl_BASE;
+
+class VbaSystemAXControl : public SystemAXControlImpl_BASE
+{
+ css::uno::Reference< css::script::XInvocation > m_xControlInvocation;
+
+public:
+ VbaSystemAXControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+
+ // XInvocation
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XIntrospectionAccess > SAL_CALL getIntrospection( ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Any SAL_CALL invoke( const ::rtl::OUString& aFunctionName, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aParams, ::com::sun::star::uno::Sequence< ::sal_Int16 >& aOutParamIndex, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam ) throw ( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::script::CannotConvertException, ::com::sun::star::reflection::InvocationTargetException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw ( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::script::CannotConvertException, ::com::sun::star::reflection::InvocationTargetException, ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Any SAL_CALL getValue( const ::rtl::OUString& aPropertyName ) throw ( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException );
+ virtual ::sal_Bool SAL_CALL hasMethod( const ::rtl::OUString& aName ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual ::sal_Bool SAL_CALL hasProperty( const ::rtl::OUString& aName ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif
diff --git a/vbahelper/source/vbahelper/makefile.mk b/vbahelper/source/vbahelper/makefile.mk
index cde45d262051..0b300953722e 100644
--- a/vbahelper/source/vbahelper/makefile.mk
+++ b/vbahelper/source/vbahelper/makefile.mk
@@ -33,10 +33,14 @@ ENABLE_EXCEPTIONS := TRUE
VISIBILITY_HIDDEN=TRUE
# --- Settings -----------------------------------------------------
+.IF "$(ENABLE_VBA)" == "NO"
+dummy:
+ @echo "Nothing to build"
+.ENDIF
+
.INCLUDE : settings.mk
SLOFILES=\
- $(SLO)$/msvbahelper.obj \
$(SLO)$/vbahelper.obj \
$(SLO)$/vbapropvalue.obj \
$(SLO)$/vbacommandbars.obj \
@@ -61,7 +65,6 @@ SLOFILES=\
$(SLO)$/vbashaperange.obj \
$(SLO)$/vbatextframe.obj \
$(SLO)$/vbapagesetupbase.obj \
-
# --- Targets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/vbahelper/source/vbahelper/msvbahelper.cxx b/vbahelper/source/vbahelper/msvbahelper.cxx
deleted file mode 100644
index f0d721529b2c..000000000000
--- a/vbahelper/source/vbahelper/msvbahelper.cxx
+++ /dev/null
@@ -1,381 +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 VBAHELPER_DLLIMPLEMENTATION
-#include <vbahelper/msvbahelper.hxx>
-#include <basic/sbx.hxx>
-#include <basic/sbstar.hxx>
-#include <basic/basmgr.hxx>
-#include <basic/sbmod.hxx>
-#include <basic/sbmeth.hxx>
-#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
-#include <com/sun/star/document/XDocumentProperties.hpp>
-#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
-#include <tools/urlobj.hxx>
-#include <osl/file.hxx>
-
-using namespace ::com::sun::star;
-
-const static rtl::OUString sUrlPart0 = rtl::OUString::createFromAscii( "vnd.sun.star.script:");
-const static rtl::OUString sUrlPart1 = rtl::OUString::createFromAscii( "?language=Basic&location=document");
-
-namespace ooo { namespace vba {
-
-String makeMacroURL( const String& sMacroName )
-{
- return sUrlPart0.concat( sMacroName ).concat( sUrlPart1 ) ;
-}
-
-SfxObjectShell* findShellForUrl( const rtl::OUString& sMacroURLOrPath )
-{
- SfxObjectShell* pFoundShell=NULL;
- SfxObjectShell* pShell = SfxObjectShell::GetFirst();
- INetURLObject aObj;
- aObj.SetURL( sMacroURLOrPath );
- bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
- rtl::OUString aURL;
- if ( bIsURL )
- aURL = sMacroURLOrPath;
- else
- {
- osl::FileBase::getFileURLFromSystemPath( sMacroURLOrPath, aURL );
- aObj.SetURL( aURL );
- }
- OSL_TRACE("Trying to find shell for url %s", rtl::OUStringToOString( aURL, RTL_TEXTENCODING_UTF8 ).getStr() );
- while ( pShell )
- {
-
- uno::Reference< frame::XModel > xModel = pShell->GetModel();
- // are we searching for a template? if so we have to cater for the
- // fact that in openoffice a document opened from a template is always
- // a new document :/
- if ( xModel.is() )
- {
- OSL_TRACE("shell 0x%x has model with url %s and we look for %s", pShell
- , rtl::OUStringToOString( xModel->getURL(), RTL_TEXTENCODING_UTF8 ).getStr()
- , rtl::OUStringToOString( aURL, RTL_TEXTENCODING_UTF8 ).getStr()
- );
- if ( sMacroURLOrPath.endsWithIgnoreAsciiCaseAsciiL( ".dot", 4 ) )
- {
- uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( xModel, uno::UNO_QUERY );
- if( xDocInfoSupp.is() )
- {
- uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
- rtl::OUString sCurrName = xDocProps->getTemplateName();
- if( sMacroURLOrPath.lastIndexOf( sCurrName ) >= 0 )
- {
- pFoundShell = pShell;
- break;
- }
- }
- }
- else
- {
- if ( aURL.equals( xModel->getURL() ) )
- {
- pFoundShell = pShell;
- break;
- }
- }
- }
- pShell = SfxObjectShell::GetNext( *pShell );
- }
- return pFoundShell;
-}
-
-// sMod can be empty ( but we really need the library to search in )
-// if sMod is empty and a macro is found then sMod is updated
-bool hasMacro( SfxObjectShell* pShell, const String& sLibrary, String& sMod, const String& sMacro )
-{
- bool bFound = false;
- if ( sLibrary.Len() && sMacro.Len() )
- {
- OSL_TRACE("** Searching for %s.%s in library %s"
- ,rtl::OUStringToOString( sMod, RTL_TEXTENCODING_UTF8 ).getStr()
- ,rtl::OUStringToOString( sMacro, RTL_TEXTENCODING_UTF8 ).getStr()
- ,rtl::OUStringToOString( sLibrary, RTL_TEXTENCODING_UTF8 ).getStr() );
- BasicManager* pBasicMgr = pShell-> GetBasicManager();
- if ( pBasicMgr )
- {
- StarBASIC* pBasic = pBasicMgr->GetLib( sLibrary );
- if ( !pBasic )
- {
- USHORT nId = pBasicMgr->GetLibId( sLibrary );
- pBasicMgr->LoadLib( nId );
- pBasic = pBasicMgr->GetLib( sLibrary );
- }
- if ( pBasic )
- {
- if ( sMod.Len() ) // we wish to find the macro is a specific module
- {
- SbModule* pModule = pBasic->FindModule( sMod );
- if ( pModule )
- {
- SbxArray* pMethods = pModule->GetMethods();
- if ( pMethods )
- {
- SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Find( sMacro, SbxCLASS_METHOD ) );
- if ( pMethod )
- bFound = true;
- }
- }
- }
- else if( SbMethod* pMethod = dynamic_cast< SbMethod* >( pBasic->Find( sMacro, SbxCLASS_METHOD ) ) )
- {
- if( SbModule* pModule = pMethod->GetModule() )
- {
- sMod = pModule->GetName();
- bFound = true;
- }
- }
- }
- }
- }
- return bFound;
-}
-void parseMacro( const rtl::OUString& sMacro, String& sContainer, String& sModule, String& sProcedure )
-{
- sal_Int32 nMacroDot = sMacro.lastIndexOf( '.' );
-
- if ( nMacroDot != -1 )
- {
- sProcedure = sMacro.copy( nMacroDot + 1 );
-
- sal_Int32 nContainerDot = sMacro.lastIndexOf( '.', nMacroDot - 1 );
- if ( nContainerDot != -1 )
- {
- sModule = sMacro.copy( nContainerDot + 1, nMacroDot - nContainerDot - 1 );
- sContainer = sMacro.copy( 0, nContainerDot );
- }
- else
- sModule = sMacro.copy( 0, nMacroDot );
- }
- else
- sProcedure = sMacro;
-}
-
-VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& MacroName, bool bSearchGlobalTemplates )
-{
- VBAMacroResolvedInfo aRes;
- if ( !pShell )
- return aRes;
- aRes.SetMacroDocContext( pShell );
- // parse the macro name
- sal_Int32 nDocSepIndex = MacroName.indexOfAsciiL( "!", 1 );
- String sMacroUrl = MacroName;
-
- String sContainer;
- String sModule;
- String sProcedure;
-
- if( nDocSepIndex > 0 )
- {
- // macro specified by document name
- // find document shell for document name and call ourselves
- // recursively
-
- // assume for now that the document name is *this* document
- String sDocUrlOrPath = MacroName.copy( 0, nDocSepIndex );
- sMacroUrl = MacroName.copy( nDocSepIndex + 1 );
- OSL_TRACE("doc search, current shell is 0x%x", pShell );
- SfxObjectShell* pFoundShell = findShellForUrl( sDocUrlOrPath );
- OSL_TRACE("doc search, after find, found shell is 0x%x", pFoundShell );
- aRes = resolveVBAMacro( pFoundShell, sMacroUrl );
- }
- else
- {
- // macro is contained in 'this' document ( or code imported from a template
- // where that template is a global template or perhaps the template this
- // document is created from )
-
- // macro format = Container.Module.Procedure
- parseMacro( MacroName, sContainer, sModule, sProcedure );
- uno::Reference< lang::XMultiServiceFactory> xSF( pShell->GetModel(), uno::UNO_QUERY);
- uno::Reference< container::XNameContainer > xPrjNameCache;
- if ( xSF.is() )
- xPrjNameCache.set( xSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAProjectNameProvider" ) ) ), uno::UNO_QUERY );
-
- std::vector< rtl::OUString > sSearchList;
-
- if ( sContainer.Len() > 0 )
- {
- // get the Project associated with the Container
- if ( xPrjNameCache.is() )
- {
- if ( xPrjNameCache->hasByName( sContainer ) )
- {
- rtl::OUString sProject;
- xPrjNameCache->getByName( sContainer ) >>= sProject;
- sContainer = sProject;
- }
- }
- sSearchList.push_back( sContainer ); // First Lib to search
- }
- else
- {
- // Ok, if we have no Container specified then we need to search them in order, this document, template this document created from, global templates,
- // get the name of Project/Library for 'this' document
- rtl::OUString sThisProject;
- BasicManager* pBasicMgr = pShell-> GetBasicManager();
- if ( pBasicMgr )
- {
- if ( pBasicMgr->GetName().Len() )
- sThisProject = pBasicMgr->GetName();
- else // cater for the case where VBA is not enabled
- sThisProject = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Standard") );
- }
- sSearchList.push_back( sThisProject ); // First Lib to search
- if ( xPrjNameCache.is() )
- {
- // is this document created from a template?
- uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( pShell->GetModel(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
-
- rtl::OUString sCreatedFrom = xDocProps->getTemplateURL();
- if ( sCreatedFrom.getLength() )
- {
- INetURLObject aObj;
- aObj.SetURL( sCreatedFrom );
- bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
- rtl::OUString aURL;
- if ( bIsURL )
- aURL = sCreatedFrom;
- else
- {
- osl::FileBase::getFileURLFromSystemPath( sCreatedFrom, aURL );
- aObj.SetURL( aURL );
- }
- sCreatedFrom = aObj.GetLastName();
- }
-
- sal_Int32 nIndex = sCreatedFrom.lastIndexOf( '.' );
- if ( nIndex != -1 )
- sCreatedFrom = sCreatedFrom.copy( 0, nIndex );
-
- rtl::OUString sPrj;
- if ( sCreatedFrom.getLength() && xPrjNameCache->hasByName( sCreatedFrom ) )
- {
- xPrjNameCache->getByName( sCreatedFrom ) >>= sPrj;
- // Make sure we don't double up with this project
- if ( !sPrj.equals( sThisProject ) )
- sSearchList.push_back( sPrj );
- }
-
- // get list of global template Names
- uno::Sequence< rtl::OUString > sTemplateNames = xPrjNameCache->getElementNames();
- sal_Int32 nLen = sTemplateNames.getLength();
- for ( sal_Int32 index = 0; ( bSearchGlobalTemplates && index < nLen ); ++index )
- {
-
- if ( !sCreatedFrom.equals( sTemplateNames[ index ] ) )
- {
- if ( xPrjNameCache->hasByName( sTemplateNames[ index ] ) )
- {
- xPrjNameCache->getByName( sTemplateNames[ index ] ) >>= sPrj;
- // Make sure we don't double up with this project
- if ( !sPrj.equals( sThisProject ) )
- sSearchList.push_back( sPrj );
- }
- }
-
- }
- }
- }
- std::vector< rtl::OUString >::iterator it_end = sSearchList.end();
- for ( std::vector< rtl::OUString >::iterator it = sSearchList.begin(); it != it_end; ++it )
- {
- bool bRes = hasMacro( pShell, *it, sModule, sProcedure );
- if ( bRes )
- {
- aRes.SetResolved( true );
- aRes.SetMacroDocContext( pShell );
- sContainer = *it;
- break;
- }
- }
- }
- aRes.SetResolvedMacro( sProcedure.Insert( '.', 0 ).Insert( sModule, 0).Insert( '.', 0 ).Insert( sContainer, 0 ) );
-
- return aRes;
-}
-
-// Treat the args as possible inouts ( convertion at bottom of method )
-sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, uno::Sequence< uno::Any >& aArgs, uno::Any& /*aRet*/, const uno::Any& aCaller )
-{
- sal_Bool bRes = sal_False;
- if ( !pShell )
- return bRes;
- rtl::OUString sUrl = makeMacroURL( sMacroName );
-
- uno::Sequence< sal_Int16 > aOutArgsIndex;
- uno::Sequence< uno::Any > aOutArgs;
-
- try
- {
- uno::Reference< script::provider::XScriptProvider > xScriptProvider;
- uno::Reference< script::provider::XScriptProviderSupplier > xSPS( pShell->GetModel(), uno::UNO_QUERY_THROW );
-
- xScriptProvider.set( xSPS->getScriptProvider(), uno::UNO_QUERY_THROW );
-
- uno::Reference< script::provider::XScript > xScript( xScriptProvider->getScript( sUrl ), uno::UNO_QUERY_THROW );
-
- if ( aCaller.hasValue() )
- {
- uno::Reference< beans::XPropertySet > xProps( xScript, uno::UNO_QUERY );
- if ( xProps.is() )
- {
- uno::Sequence< uno::Any > aCallerHack(1);
- aCallerHack[ 0 ] = aCaller;
- xProps->setPropertyValue( rtl::OUString::createFromAscii( "Caller" ), uno::makeAny( aCallerHack ) );
- }
- }
-
-
- xScript->invoke( aArgs, aOutArgsIndex, aOutArgs );
-
- sal_Int32 nLen = aOutArgs.getLength();
- // convert any out params to seem like they were inouts
- if ( nLen )
- {
- for ( sal_Int32 index=0; index < nLen; ++index )
- {
- sal_Int32 nOutIndex = aOutArgsIndex[ index ];
- aArgs[ nOutIndex ] = aOutArgs[ index ];
- }
- }
-
- bRes = sal_True;
- }
- catch ( uno::Exception& e )
- {
- bRes = sal_False;
- }
- return bRes;
-}
-} } // vba // ooo
diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index 7f8e563cbab6..6d2c51066ca2 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -26,15 +26,24 @@
************************************************************************/
#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/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/awt/XWindow2.hpp>
+
#include "vbacommandbars.hxx"
-#include <vbahelper/msvbahelper.hxx>
+#include <filter/msfilter/msvbahelper.hxx>
+#include <tools/datetime.hxx>
// start basic includes
#include <basic/sbx.hxx>
@@ -43,18 +52,141 @@
#include <basic/sbmeth.hxx>
#include <basic/sbmod.hxx>
// end basic includes
+
+#include <hash_map>
+
using namespace com::sun::star;
using namespace ooo::vba;
#define OFFICEVERSION "11.0"
+// ====VbaTimerInfo==================================
+typedef ::std::pair< ::rtl::OUString, ::std::pair< double, double > > VbaTimerInfo;
+
+// ====VbaTimer==================================
+class VbaTimer
+{
+ Timer m_aTimer;
+ VbaTimerInfo m_aTimerInfo;
+ ::rtl::Reference< VbaApplicationBase > m_xBase;
+
+ // the following declarations are here to prevent the usage of them
+ VbaTimer( const VbaTimer& );
+ VbaTimer& operator=( const VbaTimer& );
+
+public:
+ VbaTimer()
+ {}
+
+ virtual ~VbaTimer()
+ {
+ m_aTimer.Stop();
+ }
+
+ static double GetNow()
+ {
+ Date aDateNow;
+ Time aTimeNow;
+ Date aRefDate( 1,1,1900 );
+ long nDiffDays = (long)(aDateNow - aRefDate);
+ nDiffDays += 2; // Anpassung VisualBasic: 1.Jan.1900 == 2
+
+ long nDiffSeconds = aTimeNow.GetHour() * 3600 + aTimeNow.GetMin() * 60 + aTimeNow.GetSec();
+ return (double)nDiffDays + ((double)nDiffSeconds)/(double)(24*3600);
+ }
+
+ static sal_Int32 GetTimerMiliseconds( double nFrom, double nTo )
+ {
+ double nResult = nTo - nFrom;
+ if ( nResult > 0 )
+ nResult *= 24*3600*1000;
+ else
+ nResult = 50;
+
+ return (sal_Int32) nResult;
+ }
+
+ void Start( const ::rtl::Reference< VbaApplicationBase > xBase, const ::rtl::OUString& aFunction, double nFrom, double nTo )
+ {
+ if ( !xBase.is() || !aFunction.getLength() )
+ throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unexpected arguments!" ) ), uno::Reference< uno::XInterface >() );
+
+ m_xBase = xBase;
+ m_aTimerInfo = VbaTimerInfo( aFunction, ::std::pair< double, double >( nFrom, nTo ) );
+ m_aTimer.SetTimeoutHdl( LINK( this, VbaTimer, MacroCallHdl ) );
+ m_aTimer.SetTimeout( GetTimerMiliseconds( GetNow(), nFrom ) );
+ m_aTimer.Start();
+ }
+
+ DECL_LINK( MacroCallHdl, void* );
+};
+
+IMPL_LINK( VbaTimer, MacroCallHdl, void*, EMPTYARG )
+{
+ if ( m_aTimerInfo.second.second == 0 || GetNow() < m_aTimerInfo.second.second )
+ {
+ uno::Any aDummyArg;
+ try
+ {
+ m_xBase->Run( m_aTimerInfo.first, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg, aDummyArg );
+ }
+ catch( uno::Exception& )
+ {}
+ }
+
+ // mast be the last call in the method since it deletes the timer
+ try
+ {
+ m_xBase->OnTime( uno::makeAny( m_aTimerInfo.second.first ), m_aTimerInfo.first, uno::makeAny( m_aTimerInfo.second.second ), uno::makeAny( sal_False ) );
+ } catch( uno::Exception& )
+ {}
+
+ return 0;
+}
+
+// ====VbaTimerInfoHash==================================
+struct VbaTimerInfoHash
+{
+ size_t operator()( const VbaTimerInfo& rTimerInfo ) const
+ {
+ return (size_t)rTimerInfo.first.hashCode()
+ + (size_t)rtl_str_hashCode_WithLength( (char*)&rTimerInfo.second.first, sizeof( double ) )
+ + (size_t)rtl_str_hashCode_WithLength( (char*)&rTimerInfo.second.second, sizeof( double ) );
+ }
+};
+
+// ====VbaTimerHashMap==================================
+typedef ::std::hash_map< VbaTimerInfo, VbaTimer*, VbaTimerInfoHash, ::std::equal_to< VbaTimerInfo > > VbaTimerHashMap;
+
+// ====VbaApplicationBase_Impl==================================
+struct VbaApplicationBase_Impl
+{
+ VbaTimerHashMap m_aTimerHash;
+
+ virtual ~VbaApplicationBase_Impl()
+ {
+ // remove the remaining timers
+ for ( VbaTimerHashMap::iterator aIter = m_aTimerHash.begin();
+ aIter != m_aTimerHash.end();
+ aIter++ )
+ {
+ delete aIter->second;
+ aIter->second = NULL;
+ }
+ }
+};
+
+// ====VbaApplicationBase==================================
VbaApplicationBase::VbaApplicationBase( const uno::Reference< uno::XComponentContext >& xContext )
: ApplicationBase_BASE( uno::Reference< XHelperInterface >(), xContext )
+ , m_pImpl( new VbaApplicationBase_Impl )
{
}
VbaApplicationBase::~VbaApplicationBase()
{
+ m_pImpl = 0;
+ delete m_pImpl;
}
sal_Bool SAL_CALL
@@ -116,6 +248,26 @@ VbaApplicationBase::setDisplayStatusBar(sal_Bool bDisplayStatusBar) throw (uno::
return;
}
+::sal_Bool SAL_CALL VbaApplicationBase::getInteractive()
+ throw (uno::RuntimeException)
+{
+ uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW );
+ uno::Reference< awt::XWindow2 > xWindow( xFrame->getContainerWindow(), uno::UNO_QUERY_THROW );
+
+ return xWindow->isEnabled();
+}
+
+void SAL_CALL VbaApplicationBase::setInteractive( ::sal_Bool bInteractive )
+ throw (uno::RuntimeException)
+{
+ uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW );
+ uno::Reference< awt::XWindow > xWindow( xFrame->getContainerWindow(), uno::UNO_SET_THROW );
+
+ xWindow->setEnable( bInteractive );
+}
+
uno::Any SAL_CALL
VbaApplicationBase::CommandBars( const uno::Any& aIndex ) throw (uno::RuntimeException)
{
@@ -133,7 +285,54 @@ VbaApplicationBase::getVersion() throw (uno::RuntimeException)
void SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, const uno::Any& varg1, const uno::Any& varg2, const uno::Any& varg3, const uno::Any& varg4, const uno::Any& varg5, const uno::Any& varg6, const uno::Any& varg7, const uno::Any& varg8, const uno::Any& varg9, const uno::Any& varg10, const uno::Any& varg11, const uno::Any& varg12, const uno::Any& varg13, const uno::Any& varg14, const uno::Any& varg15, const uno::Any& varg16, const uno::Any& varg17, const uno::Any& varg18, const uno::Any& varg19, const uno::Any& varg20, const uno::Any& varg21, const uno::Any& varg22, const uno::Any& varg23, const uno::Any& varg24, const uno::Any& varg25, const uno::Any& varg26, const uno::Any& varg27, const uno::Any& varg28, const uno::Any& varg29, const uno::Any& varg30 ) throw (uno::RuntimeException)
{
- VBAMacroResolvedInfo aMacroInfo = resolveVBAMacro( getSfxObjShell( getCurrentDocument() ), MacroName );
+ ::rtl::OUString sSeparator = ::rtl::OUString::createFromAscii("/");
+ ::rtl::OUString sMacroSeparator = ::rtl::OUString::createFromAscii("!");
+ ::rtl::OUString sMacro_only_Name;
+ sal_Int32 Position_MacroSeparator = MacroName.indexOf(sMacroSeparator);
+
+ uno::Reference< frame::XModel > aMacroDocumentModel;
+ if (-1 != Position_MacroSeparator)
+ {
+ uno::Reference< container::XEnumerationAccess > xComponentEnumAccess;
+ uno::Reference< lang::XMultiComponentFactory > xServiceManager = mxContext->getServiceManager();
+ try
+ {
+ uno::Reference< frame::XDesktop > xDesktop (xServiceManager->createInstanceWithContext( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" )),mxContext ), uno::UNO_QUERY_THROW );
+ xComponentEnumAccess = xDesktop->getComponents();
+ }
+ catch(uno::Exception&)
+ {
+ }
+
+ //rem look for the name of the document in the cmpoonents collection
+ uno::Reference < container::XEnumeration > xEnum = xComponentEnumAccess->createEnumeration();
+
+ // iterate through the collection by name
+ while (xEnum->hasMoreElements())
+ {
+ // get the next element as a UNO Any
+ uno::Any aComponentHelper = xEnum->nextElement();
+ uno::Reference <frame::XModel> xDocModel( aComponentHelper, uno::UNO_QUERY_THROW );
+
+ // get the name of the sheet from its XNamed interface
+ ::rtl::OUString aName = xDocModel->getURL();
+
+
+ if (aName.match(MacroName.copy(0,Position_MacroSeparator-1),aName.lastIndexOf(sSeparator)+1))
+ {
+ aMacroDocumentModel = xDocModel;
+ sMacro_only_Name = MacroName.copy(Position_MacroSeparator+1);
+ }
+ }
+ }
+ else
+ {
+ aMacroDocumentModel = getCurrentDocument();
+ sMacro_only_Name = MacroName.copy(0);
+ }
+
+
+ VBAMacroResolvedInfo aMacroInfo = resolveVBAMacro( getSfxObjShell( aMacroDocumentModel ), sMacro_only_Name );
if( aMacroInfo.IsResolved() )
{
// handle the arguments
@@ -168,6 +367,39 @@ void SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, const u
}
}
+void SAL_CALL VbaApplicationBase::OnTime( const uno::Any& aEarliestTime, const ::rtl::OUString& aFunction, const uno::Any& aLatestTime, const uno::Any& aSchedule )
+ throw ( uno::RuntimeException )
+{
+ if ( !aFunction.getLength() )
+ throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unexpected function name!" ) ), uno::Reference< uno::XInterface >() );
+
+ double nEarliestTime = 0;
+ double nLatestTime = 0;
+ if ( !( aEarliestTime >>= nEarliestTime )
+ || ( aLatestTime.hasValue() && !( aLatestTime >>= nLatestTime ) ) )
+ throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Only double is supported as time for now!" ) ), uno::Reference< uno::XInterface >() );
+
+ sal_Bool bSetTimer = sal_True;
+ aSchedule >>= bSetTimer;
+
+ VbaTimerInfo aTimerIndex( aFunction, ::std::pair< double, double >( nEarliestTime, nLatestTime ) );
+
+ VbaTimerHashMap::iterator aIter = m_pImpl->m_aTimerHash.find( aTimerIndex );
+ if ( aIter != m_pImpl->m_aTimerHash.end() )
+ {
+ delete aIter->second;
+ aIter->second = NULL;
+ m_pImpl->m_aTimerHash.erase( aIter );
+ }
+
+ if ( bSetTimer )
+ {
+ VbaTimer* pTimer = new VbaTimer;
+ m_pImpl->m_aTimerHash[ aTimerIndex ] = pTimer;
+ pTimer->Start( this, aFunction, nEarliestTime, nLatestTime );
+ }
+}
+
float SAL_CALL VbaApplicationBase::CentimetersToPoints( float _Centimeters ) throw (uno::RuntimeException)
{
// i cm = 28.35 points
@@ -175,6 +407,57 @@ 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;
+}
+
+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;
+
+
+
+}
+
+
+
+
rtl::OUString&
VbaApplicationBase::getServiceImplName()
{
@@ -193,6 +476,13 @@ VbaApplicationBase::getServiceNames()
return aServiceNames;
}
+void SAL_CALL VbaApplicationBase::Undo()
+ throw (uno::RuntimeException)
+{
+ uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
+ dispatchRequests( xModel, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Undo" ) ) );
+}
+
void VbaApplicationBase::Quit() throw (uno::RuntimeException)
{
// need to stop basic
@@ -208,3 +498,4 @@ void VbaApplicationBase::Quit() throw (uno::RuntimeException)
}
}
}
+
diff --git a/vbahelper/source/vbahelper/vbacommandbar.cxx b/vbahelper/source/vbahelper/vbacommandbar.cxx
index 1e2911ad4f52..1e8d21d53583 100644
--- a/vbahelper/source/vbahelper/vbacommandbar.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbar.cxx
@@ -202,3 +202,85 @@ ScVbaCommandBar::getServiceNames()
}
return aServiceNames;
}
+
+
+VbaDummyCommandBar::VbaDummyCommandBar(
+ const uno::Reference< ov::XHelperInterface > xParent,
+ const uno::Reference< uno::XComponentContext > xContext,
+ const ::rtl::OUString& rName, sal_Int32 nType ) throw( uno::RuntimeException ) :
+ CommandBar_BASE( xParent, xContext ),
+ maName( rName ),
+ mnType( nType )
+{
+}
+
+::rtl::OUString SAL_CALL VbaDummyCommandBar::getName() throw ( uno::RuntimeException )
+{
+ return maName;
+}
+
+void SAL_CALL VbaDummyCommandBar::setName( const ::rtl::OUString& _name ) throw (uno::RuntimeException)
+{
+ maName = _name;
+}
+
+::sal_Bool SAL_CALL VbaDummyCommandBar::getVisible() throw (uno::RuntimeException)
+{
+ return sal_True;
+}
+
+void SAL_CALL VbaDummyCommandBar::setVisible( ::sal_Bool /*_visible*/ ) throw (uno::RuntimeException)
+{
+}
+
+::sal_Bool SAL_CALL VbaDummyCommandBar::getEnabled() throw (uno::RuntimeException)
+{
+ // emulated with Visible
+ return getVisible();
+}
+
+void SAL_CALL VbaDummyCommandBar::setEnabled( sal_Bool _enabled ) throw (uno::RuntimeException)
+{
+ // emulated with Visible
+ setVisible( _enabled );
+}
+
+void SAL_CALL VbaDummyCommandBar::Delete( ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ // no-op
+}
+
+uno::Any SAL_CALL VbaDummyCommandBar::Controls( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ uno::Reference< XCommandBarControls > xCommandBarControls( new VbaDummyCommandBarControls( this, mxContext ) );
+ if( aIndex.hasValue() )
+ return xCommandBarControls->Item( aIndex, uno::Any() );
+ return uno::Any( xCommandBarControls );
+}
+
+sal_Int32 SAL_CALL VbaDummyCommandBar::Type() throw (script::BasicErrorException, uno::RuntimeException)
+{
+ return mnType;
+}
+
+uno::Any SAL_CALL VbaDummyCommandBar::FindControl( const uno::Any& /*aType*/, const uno::Any& /*aId*/, const uno::Any& /*aTag*/, const uno::Any& /*aVisible*/, const uno::Any& /*aRecursive*/ ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ return uno::Any( uno::Reference< XCommandBarControl >() );
+}
+
+rtl::OUString& VbaDummyCommandBar::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("VbaDummyCommandBar") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString > VbaDummyCommandBar::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBar" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/vbahelper/vbacommandbar.hxx b/vbahelper/source/vbahelper/vbacommandbar.hxx
index 4f488fab6cd2..bcb5a11e9691 100644
--- a/vbahelper/source/vbahelper/vbacommandbar.hxx
+++ b/vbahelper/source/vbahelper/vbacommandbar.hxx
@@ -72,4 +72,38 @@ public:
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
+
+/** Dummy command bar implementation. Does nothing but provide its name. */
+class VbaDummyCommandBar : public CommandBar_BASE
+{
+public:
+ VbaDummyCommandBar(
+ const css::uno::Reference< ov::XHelperInterface > xParent,
+ const css::uno::Reference< css::uno::XComponentContext > xContext,
+ const ::rtl::OUString& rName,
+ sal_Int32 nType ) throw( css::uno::RuntimeException );
+
+ // Attributes
+ virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setName( const ::rtl::OUString& _name ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setEnabled( ::sal_Bool _enabled ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL Type( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL FindControl( const css::uno::Any& aType, const css::uno::Any& aId, const css::uno::Any& aTag, const css::uno::Any& aVisible, const css::uno::Any& aRecursive ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+
+private:
+ ::rtl::OUString maName;
+ sal_Int32 mnType;
+};
+
#endif//SC_VBA_COMMANDBAR_HXX
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
index e081a723db04..3f9c7ddeae89 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
@@ -27,7 +27,7 @@
#include "vbacommandbarcontrol.hxx"
#include "vbacommandbarcontrols.hxx"
#include <vbahelper/vbahelper.hxx>
-#include <vbahelper/msvbahelper.hxx>
+#include <filter/msfilter/msvbahelper.hxx>
using namespace com::sun::star;
using namespace ooo::vba;
@@ -141,6 +141,22 @@ ScVbaCommandBarControl::setEnabled( sal_Bool _enabled ) throw (uno::RuntimeExcep
}
}
+::sal_Bool SAL_CALL
+ScVbaCommandBarControl::getBeginGroup() throw (css::uno::RuntimeException)
+{
+ // TODO: need to check if the item before this item is of type 'separator'
+ return sal_False;
+}
+
+void SAL_CALL
+ScVbaCommandBarControl::setBeginGroup( ::sal_Bool _begin ) throw (css::uno::RuntimeException)
+{
+ if( getBeginGroup() != _begin )
+ {
+ // TODO: need to insert or remove an item of type 'separator' before this item
+ }
+}
+
void SAL_CALL
ScVbaCommandBarControl::Delete( ) throw (script::BasicErrorException, uno::RuntimeException)
{
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx b/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx
index 6411430bacb1..a165f8e1cccd 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx
@@ -67,6 +67,8 @@ public:
virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException);
virtual void SAL_CALL setEnabled( ::sal_Bool _enabled ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getBeginGroup() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setBeginGroup( ::sal_Bool _begin ) throw (css::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getType() throw (css::uno::RuntimeException)
{
return ov::office::MsoControlType::msoControlButton;
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
index 21e2dfb4b368..634b4a0e9395 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
@@ -34,10 +34,10 @@ typedef ::cppu::WeakImplHelper1< container::XEnumeration > CommandBarControlEnum
class CommandBarControlEnumeration : public CommandBarControlEnumeration_BASE
{
//uno::Reference< uno::XComponentContext > m_xContext;
- ScVbaCommandBarControls* m_pCommandBarControls;
+ CommandBarControls_BASE* m_pCommandBarControls;
sal_Int32 m_nCurrentPosition;
public:
- CommandBarControlEnumeration( ScVbaCommandBarControls* pCommandBarControls ) : m_pCommandBarControls( pCommandBarControls ), m_nCurrentPosition( 0 ) {}
+ CommandBarControlEnumeration( CommandBarControls_BASE* pCommandBarControls ) : m_pCommandBarControls( pCommandBarControls ), m_nCurrentPosition( 0 ) {}
virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException )
{
if( m_nCurrentPosition < m_pCommandBarControls->getCount() )
@@ -140,7 +140,7 @@ ScVbaCommandBarControls::Item( const uno::Any& aIndex, const uno::Any& /*aIndex*
{
rtl::OUString sName;
aIndex >>= sName;
- nPosition = VbaCommandBarHelper::findControlByName( m_xIndexAccess, sName );
+ nPosition = VbaCommandBarHelper::findControlByName( m_xIndexAccess, sName, m_bIsMenu );
}
else
{
@@ -246,3 +246,75 @@ ScVbaCommandBarControls::getServiceNames()
return aServiceNames;
}
+// ============================================================================
+
+class VbaDummyIndexAccess : public ::cppu::WeakImplHelper1< container::XIndexAccess >
+{
+public:
+ inline VbaDummyIndexAccess() {}
+ // XIndexAccess
+ virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException)
+ { return 0; }
+ virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 /*Index*/ ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+ { throw lang::IndexOutOfBoundsException(); }
+ // XElementAccess
+ virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException)
+ { return XCommandBarControl::static_type( 0 ); }
+ virtual ::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException)
+ { return false; }
+};
+
+// ----------------------------------------------------------------------------
+
+VbaDummyCommandBarControls::VbaDummyCommandBarControls(
+ const uno::Reference< XHelperInterface >& xParent,
+ const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException) :
+ CommandBarControls_BASE( xParent, xContext, new VbaDummyIndexAccess )
+{
+}
+
+// XEnumerationAccess
+uno::Type SAL_CALL VbaDummyCommandBarControls::getElementType() throw ( uno::RuntimeException )
+{
+ return XCommandBarControl::static_type( 0 );
+}
+
+uno::Reference< container::XEnumeration > VbaDummyCommandBarControls::createEnumeration() throw ( uno::RuntimeException )
+{
+ return uno::Reference< container::XEnumeration >( new CommandBarControlEnumeration( this ) );
+}
+
+uno::Any VbaDummyCommandBarControls::createCollectionObject( const uno::Any& /*aSource*/ )
+{
+ return uno::Any( uno::Reference< XCommandBarControl >() );
+}
+
+// Methods
+uno::Any SAL_CALL VbaDummyCommandBarControls::Item( const uno::Any& /*aIndex*/, const uno::Any& /*aIndex*/ ) throw (uno::RuntimeException)
+{
+ return uno::Any( uno::Reference< XCommandBarControl >() );
+}
+
+uno::Reference< XCommandBarControl > SAL_CALL VbaDummyCommandBarControls::Add(
+ const uno::Any& /*Type*/, const uno::Any& /*Id*/, const uno::Any& /*Parameter*/, const uno::Any& /*Before*/, const uno::Any& /*Temporary*/ ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ return uno::Reference< XCommandBarControl >();
+}
+
+// XHelperInterface
+rtl::OUString& VbaDummyCommandBarControls::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("VbaDummyCommandBarControls") );
+ return sImplName;
+}
+
+uno::Sequence<rtl::OUString> VbaDummyCommandBarControls::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBarControls" ) );
+ }
+ return aServiceNames;
+}
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx b/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx
index 534ba5a10966..0b35773660d1 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx
@@ -64,4 +64,24 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
+class VbaDummyCommandBarControls : public CommandBarControls_BASE
+{
+public:
+ VbaDummyCommandBarControls(
+ const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw( css::uno::RuntimeException );
+
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+
+ // Methods
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index, const css::uno::Any& /*Index2*/ ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::XCommandBarControl > SAL_CALL Add( const css::uno::Any& Type, const css::uno::Any& Id, const css::uno::Any& Parameter, const css::uno::Any& Before, const css::uno::Any& Temporary ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
#endif//SC_VBA_COMMANDBARCONTROLS_HXX
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
index 06b997186169..385b220d201c 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
@@ -30,11 +30,10 @@
#include <com/sun/star/ui/XModuleUIConfigurationManager.hpp>
#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
#include <com/sun/star/ui/XUIElement.hpp>
-#ifndef _COM_SUN_STAR_UI_UIElementType_HPP_
#include <com/sun/star/ui/UIElementType.hpp>
-#endif
#include <comphelper/processfactory.hxx>
#include <vbahelper/vbahelper.hxx>
+#include <rtl/ustrbuf.hxx>
#include <time.h>
#include <map>
@@ -233,7 +232,7 @@ rtl::OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference<
}
// if found, return the position of the control. if not found, return -1
-sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, const rtl::OUString& sName ) throw (css::uno::RuntimeException)
+sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, const rtl::OUString& sName, bool bMenu ) throw (css::uno::RuntimeException)
{
sal_Int32 nCount = xIndexAccess->getCount();
css::uno::Sequence< css::beans::PropertyValue > aProps;
@@ -242,17 +241,21 @@ sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css
rtl::OUString sLabel;
xIndexAccess->getByIndex( i ) >>= aProps;
getPropertyValue( aProps, rtl::OUString::createFromAscii(ITEM_DESCRIPTOR_LABEL) ) >>= sLabel;
- // handle the hotkey character '~'
- rtl::OUString sNewLabel;
+ // handle the hotkey marker '~' (remove in toolbars (?), replace by '&' in menus)
+ ::rtl::OUStringBuffer aBuffer;
sal_Int32 index = sLabel.indexOf( sal_Unicode('~') );
if( index < 0 )
- sNewLabel = sLabel;
- else if( index == 0 )
- sNewLabel = sLabel.copy( index + 1);
- else if( index == sNewLabel.getLength() - 1 )
- sNewLabel = sLabel.copy(0, index );
+ {
+ aBuffer = sLabel;
+ }
else
- sNewLabel = sLabel.copy( 0, index ) + sLabel.copy( index + 1 );
+ {
+ aBuffer.append( sLabel.copy( 0, index ) );
+ if( bMenu )
+ aBuffer.append( sal_Unicode( '&' ) );
+ aBuffer.append( sLabel.copy( index + 1 ) );
+ }
+ rtl::OUString sNewLabel = aBuffer.makeStringAndClear();
OSL_TRACE("VbaCommandBarHelper::findControlByName, control name: %s", rtl::OUStringToOString( sNewLabel, RTL_TEXTENCODING_UTF8 ).getStr() );
if( sName.equalsIgnoreAsciiCase( sNewLabel ) )
return i;
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx
index 1c18af07b3df..1fa41d7141b3 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx
@@ -95,8 +95,8 @@ public:
const rtl::OUString getModuleId(){ return maModuleId; }
rtl::OUString findToolbarByName( const css::uno::Reference< css::container::XNameAccess >& xNameAccess, const rtl::OUString& sName ) throw (css::uno::RuntimeException);
- static sal_Int32 findControlByName( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, const rtl::OUString& sName ) throw (css::uno::RuntimeException);
+ static sal_Int32 findControlByName( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, const rtl::OUString& sName, bool bMenu = false ) throw (css::uno::RuntimeException);
static rtl::OUString generateCustomURL();
};
-#endif//VBA_COMMANDBARHELPER_HXX
+#endif //VBA_COMMANDBARHELPER_HXX
diff --git a/vbahelper/source/vbahelper/vbacommandbars.cxx b/vbahelper/source/vbahelper/vbacommandbars.cxx
index 3e7bdc6d53e8..9d6cd9e2eea7 100644
--- a/vbahelper/source/vbahelper/vbacommandbars.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbars.cxx
@@ -31,6 +31,7 @@
#include <com/sun/star/ui/XUIConfigurationStorage.hpp>
#include <com/sun/star/ui/XModuleUIConfigurationManager.hpp>
#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
+#include <ooo/vba/office/MsoBarType.hpp>
#include "vbacommandbars.hxx"
#include "vbacommandbar.hxx"
@@ -45,13 +46,13 @@ class CommandBarEnumeration : public CommandBarEnumeration_BASE
{
uno::Reference< XHelperInterface > m_xParent;
uno::Reference< uno::XComponentContext > m_xContext;
- VbaCommandBarHelperRef pCBarHelper;
+ VbaCommandBarHelperRef m_pCBarHelper;
uno::Sequence< rtl::OUString > m_sNames;
sal_Int32 m_nCurrentPosition;
public:
- CommandBarEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, VbaCommandBarHelperRef pHelper) throw ( uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), pCBarHelper( pHelper ) , m_nCurrentPosition( 0 )
+ CommandBarEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, VbaCommandBarHelperRef pHelper) throw ( uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), m_pCBarHelper( pHelper ) , m_nCurrentPosition( 0 )
{
- uno::Reference< container::XNameAccess > xNameAccess = pCBarHelper->getPersistentWindowState();
+ uno::Reference< container::XNameAccess > xNameAccess = m_pCBarHelper->getPersistentWindowState();
m_sNames = xNameAccess->getElementNames();
}
virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException )
@@ -68,8 +69,8 @@ public:
rtl::OUString sResourceUrl( m_sNames[ m_nCurrentPosition++ ] );
if( sResourceUrl.indexOf( rtl::OUString::createFromAscii("private:resource/toolbar/") ) != -1 )
{
- uno::Reference< container::XIndexAccess > xCBarSetting = pCBarHelper->getSettings( sResourceUrl );
- uno::Reference< XCommandBar > xCommandBar( new ScVbaCommandBar( m_xParent, m_xContext, pCBarHelper, xCBarSetting, sResourceUrl, sal_False, sal_False ) );
+ uno::Reference< container::XIndexAccess > xCBarSetting = m_pCBarHelper->getSettings( sResourceUrl );
+ uno::Reference< XCommandBar > xCommandBar( new ScVbaCommandBar( m_xParent, m_xContext, m_pCBarHelper, xCBarSetting, sResourceUrl, sal_False, sal_False ) );
}
else
return nextElement();
@@ -82,8 +83,8 @@ public:
ScVbaCommandBars::ScVbaCommandBars( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess, const uno::Reference< frame::XModel >& xModel ) throw ( uno::RuntimeException ) : CommandBars_BASE( xParent, xContext, xIndexAccess )
{
- pCBarHelper.reset( new VbaCommandBarHelper( mxContext, xModel ) );
- m_xNameAccess = pCBarHelper->getPersistentWindowState();
+ m_pCBarHelper.reset( new VbaCommandBarHelper( mxContext, xModel ) );
+ m_xNameAccess = m_pCBarHelper->getPersistentWindowState();
}
ScVbaCommandBars::~ScVbaCommandBars()
@@ -100,7 +101,7 @@ ScVbaCommandBars::getElementType() throw ( uno::RuntimeException )
uno::Reference< container::XEnumeration >
ScVbaCommandBars::createEnumeration() throw ( uno::RuntimeException )
{
- return uno::Reference< container::XEnumeration >( new CommandBarEnumeration( this, mxContext, pCBarHelper ) );
+ return uno::Reference< container::XEnumeration >( new CommandBarEnumeration( this, mxContext, m_pCBarHelper ) );
}
uno::Any
@@ -111,28 +112,53 @@ ScVbaCommandBars::createCollectionObject( const uno::Any& aSource )
uno::Reference< container::XIndexAccess > xBarSettings;
rtl::OUString sBarName;
sal_Bool bMenu = sal_False;
+ uno::Any aRet;
+
if( aSource >>= sBarName )
{
- if( sBarName.equalsIgnoreAsciiCase( rtl::OUString::createFromAscii("Worksheet Menu Bar") )
- || sBarName.equalsIgnoreAsciiCase( rtl::OUString::createFromAscii("Menu Bar") ) )
+ // some built-in command bars
+ if( m_pCBarHelper->getModuleId().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.sheet.SpreadsheetDocument") ) )
{
- // menu bar
- sResourceUrl = rtl::OUString::createFromAscii( ITEM_MENUBAR_URL );
- bMenu = sal_True;
+ if( sBarName.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("Worksheet Menu Bar") ) )
+ {
+ // spreadsheet menu bar
+ sResourceUrl = rtl::OUString::createFromAscii( ITEM_MENUBAR_URL );
+ bMenu = sal_True;
+ }
+ else if( sBarName.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("Cell") ) )
+ {
+ // EVIL HACK (tm): spreadsheet cell context menu as dummy object without functionality
+ aRet <<= uno::Reference< XCommandBar >( new VbaDummyCommandBar( this, mxContext, sBarName, office::MsoBarType::msoBarTypePopup ) );
+ }
}
- else
+ else if( m_pCBarHelper->getModuleId().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextDocument") ) )
+ {
+ if( sBarName.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("Menu Bar") ) )
+ {
+ // text processor menu bar
+ sResourceUrl = rtl::OUString::createFromAscii( ITEM_MENUBAR_URL );
+ bMenu = sal_True;
+ }
+ }
+
+ // nothing found - try to resolve from name
+ if( !aRet.hasValue() && (sResourceUrl.getLength() == 0) )
{
- sResourceUrl = pCBarHelper->findToolbarByName( m_xNameAccess, sBarName );
+ sResourceUrl = m_pCBarHelper->findToolbarByName( m_xNameAccess, sBarName );
bMenu = sal_False;
}
}
if( sResourceUrl.getLength() )
- xBarSettings = pCBarHelper->getSettings( sResourceUrl );
- else
+ {
+ xBarSettings = m_pCBarHelper->getSettings( sResourceUrl );
+ aRet <<= uno::Reference< XCommandBar >( new ScVbaCommandBar( this, mxContext, m_pCBarHelper, xBarSettings, sResourceUrl, bMenu, sal_False ) );
+ }
+
+ if( !aRet.hasValue() )
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Toolbar do not exist") ), uno::Reference< uno::XInterface >() );
- return uno::Any( uno::Reference< XCommandBar >( new ScVbaCommandBar( this, mxContext, pCBarHelper, xBarSettings, sResourceUrl, bMenu, sal_False ) ) );
+ return aRet;
}
// XCommandBars
@@ -149,7 +175,7 @@ ScVbaCommandBars::Add( const css::uno::Any& Name, const css::uno::Any& /*Positio
rtl::OUString sResourceUrl;
if( sName.getLength() )
{
- sResourceUrl = pCBarHelper->findToolbarByName( m_xNameAccess, sName );
+ sResourceUrl = m_pCBarHelper->findToolbarByName( m_xNameAccess, sName );
if( sResourceUrl.getLength() )
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Toolbar exists") ), uno::Reference< uno::XInterface >() );
}
@@ -163,8 +189,8 @@ ScVbaCommandBars::Add( const css::uno::Any& Name, const css::uno::Any& /*Positio
Temporary >>= bTemporary;
sResourceUrl = VbaCommandBarHelper::generateCustomURL();
- uno::Reference< container::XIndexAccess > xBarSettings( pCBarHelper->getSettings( sResourceUrl ), uno::UNO_QUERY_THROW );
- uno::Reference< XCommandBar > xCBar( new ScVbaCommandBar( this, mxContext, pCBarHelper, xBarSettings, sResourceUrl, sal_False, bTemporary ) );
+ uno::Reference< container::XIndexAccess > xBarSettings( m_pCBarHelper->getSettings( sResourceUrl ), uno::UNO_QUERY_THROW );
+ uno::Reference< XCommandBar > xCBar( new ScVbaCommandBar( this, mxContext, m_pCBarHelper, xBarSettings, sResourceUrl, sal_False, bTemporary ) );
xCBar->setName( sName );
return xCBar;
}
@@ -199,9 +225,9 @@ ScVbaCommandBars::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) th
if( nIndex == 1 )
{
uno::Any aSource;
- if( pCBarHelper->getModuleId().equalsAscii( "com.sun.star.sheet.SpreadsheetDocument" ) )
+ if( m_pCBarHelper->getModuleId().equalsAscii( "com.sun.star.sheet.SpreadsheetDocument" ) )
aSource <<= rtl::OUString::createFromAscii( "Worksheet Menu Bar" );
- else if( pCBarHelper->getModuleId().equalsAscii("com.sun.star.text.TextDocument") )
+ else if( m_pCBarHelper->getModuleId().equalsAscii("com.sun.star.text.TextDocument") )
aSource <<= rtl::OUString::createFromAscii( "Menu Bar" );
if( aSource.hasValue() )
return createCollectionObject( aSource );
diff --git a/vbahelper/source/vbahelper/vbacommandbars.hxx b/vbahelper/source/vbahelper/vbacommandbars.hxx
index 698d718f7cdf..92ed1438d269 100644
--- a/vbahelper/source/vbahelper/vbacommandbars.hxx
+++ b/vbahelper/source/vbahelper/vbacommandbars.hxx
@@ -40,7 +40,7 @@ typedef CollTestImplHelper< ov::XCommandBars > CommandBars_BASE;
class ScVbaCommandBars : public CommandBars_BASE
{
private:
- VbaCommandBarHelperRef pCBarHelper;
+ VbaCommandBarHelperRef m_pCBarHelper;
public:
ScVbaCommandBars( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException);
diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx
index fb2af0687d11..f27f2de53c8a 100644
--- a/vbahelper/source/vbahelper/vbadocumentbase.cxx
+++ b/vbahelper/source/vbahelper/vbadocumentbase.cxx
@@ -33,7 +33,9 @@
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#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 <tools/urlobj.hxx>
#include <osl/file.hxx>
@@ -179,14 +181,14 @@ void
VbaDocumentBase::setSaved( sal_Bool bSave ) throw (uno::RuntimeException)
{
uno::Reference< util::XModifiable > xModifiable( getModel(), uno::UNO_QUERY_THROW );
- xModifiable->setModified( bSave );
+ xModifiable->setModified( !bSave );
}
sal_Bool
VbaDocumentBase::getSaved() throw (uno::RuntimeException)
{
uno::Reference< util::XModifiable > xModifiable( getModel(), uno::UNO_QUERY_THROW );
- return xModifiable->isModified();
+ return !xModifiable->isModified();
}
void
@@ -204,6 +206,40 @@ 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;
+
+}
+
+
+// ---- Michael E.Bohn End -----
+
+
rtl::OUString&
VbaDocumentBase::getServiceImplName()
{
diff --git a/vbahelper/source/vbahelper/vbafontbase.cxx b/vbahelper/source/vbahelper/vbafontbase.cxx
index 76e5de7761e1..065414343bd1 100644
--- a/vbahelper/source/vbahelper/vbafontbase.cxx
+++ b/vbahelper/source/vbahelper/vbafontbase.cxx
@@ -35,7 +35,20 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
-VbaFontBase::VbaFontBase( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::container::XIndexAccess >& xPalette, uno::Reference< beans::XPropertySet > xPropertySet ) throw ( uno::RuntimeException ) : VbaFontBase_BASE( xParent, xContext ), mxFont( xPropertySet, css::uno::UNO_QUERY_THROW ), mxPalette( xPalette )
+// form controls use other property name as the remaining OOo API
+#define VBAFONTBASE_PROPNAME( ascii_normal, ascii_control ) \
+ mbFormControl ? rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ascii_control ) ) : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ascii_normal ) )
+
+VbaFontBase::VbaFontBase(
+ const uno::Reference< XHelperInterface >& xParent,
+ const uno::Reference< uno::XComponentContext >& xContext,
+ const uno::Reference< css::container::XIndexAccess >& xPalette,
+ const uno::Reference< beans::XPropertySet >& xPropertySet,
+ bool bFormControl ) throw ( uno::RuntimeException ) :
+ VbaFontBase_BASE( xParent, xContext ),
+ mxFont( xPropertySet, uno::UNO_SET_THROW ),
+ mxPalette( xPalette, uno::UNO_SET_THROW ),
+ mbFormControl( bFormControl )
{
}
@@ -43,19 +56,22 @@ VbaFontBase::~VbaFontBase()
{
}
-
void SAL_CALL
VbaFontBase::setSuperscript( const uno::Any& aValue ) throw ( uno::RuntimeException )
{
+ // not supported in form controls
+ if( mbFormControl )
+ return;
+
sal_Bool bValue = sal_False;
aValue >>= bValue;
sal_Int16 nValue = NORMAL;
sal_Int8 nValue2 = NORMALHEIGHT;
- if( bValue )
+ if( bValue )
{
nValue = SUPERSCRIPT;
- nValue2 = SUPERSCRIPTHEIGHT;
+ nValue2 = SUPERSCRIPTHEIGHT;
}
mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharEscapement" ) ), ( uno::Any )nValue );
mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharEscapementHeight" ) ), ( uno::Any )nValue2 );
@@ -64,23 +80,29 @@ VbaFontBase::setSuperscript( const uno::Any& aValue ) throw ( uno::RuntimeExcept
uno::Any SAL_CALL
VbaFontBase::getSuperscript() throw ( uno::RuntimeException )
{
- short nValue = 0;
- mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharEscapement" ) ) ) >>= nValue;
+ short nValue = NORMAL;
+ // not supported in form controls
+ if( !mbFormControl )
+ mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharEscapement" ) ) ) >>= nValue;
return uno::makeAny( ( nValue == SUPERSCRIPT ) );
}
void SAL_CALL
VbaFontBase::setSubscript( const uno::Any& aValue ) throw ( uno::RuntimeException )
{
+ // not supported in form controls
+ if( mbFormControl )
+ return;
+
sal_Bool bValue = sal_False;
aValue >>= bValue;
sal_Int16 nValue = NORMAL;
sal_Int8 nValue2 = NORMALHEIGHT;
- if( bValue )
+ if( bValue )
{
nValue= SUBSCRIPT;
- nValue2 = SUBSCRIPTHEIGHT;
+ nValue2 = SUBSCRIPTHEIGHT;
}
mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharEscapementHeight" ) ), ( uno::Any )nValue2 );
@@ -92,20 +114,30 @@ uno::Any SAL_CALL
VbaFontBase::getSubscript() throw ( uno::RuntimeException )
{
short nValue = NORMAL;
- mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharEscapement" ) ) ) >>= nValue;
+ // not supported in form controls
+ if( !mbFormControl )
+ mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharEscapement" ) ) ) >>= nValue;
return uno::makeAny( ( nValue == SUBSCRIPT ) );
}
void SAL_CALL
VbaFontBase::setSize( const uno::Any& aValue ) throw( uno::RuntimeException )
{
- mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) ), aValue );
+ // form controls need a sal_Int16 containing points, other APIs need a float
+ uno::Any aVal( aValue );
+ if( mbFormControl )
+ {
+ float fVal = 0.0;
+ aVal >>= fVal;
+ aVal <<= static_cast< sal_Int16 >( fVal );
+ }
+ mxFont->setPropertyValue( VBAFONTBASE_PROPNAME( "CharHeight", "FontHeight" ), aVal );
}
uno::Any SAL_CALL
VbaFontBase::getSize() throw ( uno::RuntimeException )
{
- return mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) ) );
+ return mxFont->getPropertyValue( VBAFONTBASE_PROPNAME( "CharHeight", "FontHeight" ) );
}
void SAL_CALL
@@ -152,7 +184,7 @@ VbaFontBase::setBold( const uno::Any& aValue ) throw( uno::RuntimeException )
double fBoldValue = awt::FontWeight::NORMAL;
if( bValue )
fBoldValue = awt::FontWeight::BOLD;
- mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharWeight" ) ), ( uno::Any )fBoldValue );
+ mxFont->setPropertyValue( VBAFONTBASE_PROPNAME( "CharWeight", "FontWeight" ), uno::Any( fBoldValue ) );
}
@@ -160,7 +192,7 @@ uno::Any SAL_CALL
VbaFontBase::getBold() throw ( uno::RuntimeException )
{
double fValue = 0.0;
- mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharWeight" ) ) ) >>= fValue;
+ mxFont->getPropertyValue( VBAFONTBASE_PROPNAME( "CharWeight", "FontWeight" ) ) >>= fValue;
return uno::makeAny( fValue == awt::FontWeight::BOLD );
}
@@ -172,27 +204,28 @@ VbaFontBase::setStrikethrough( const uno::Any& aValue ) throw ( uno::RuntimeExce
short nValue = awt::FontStrikeout::NONE;
if( bValue )
nValue = awt::FontStrikeout::SINGLE;
- mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharStrikeout" ) ), ( uno::Any )nValue );
+ mxFont->setPropertyValue( VBAFONTBASE_PROPNAME( "CharStrikeout", "FontStrikeout" ), uno::Any( nValue ) );
}
uno::Any SAL_CALL
VbaFontBase::getStrikethrough() throw ( uno::RuntimeException )
{
short nValue = 0;
- mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharStrikeout" ) ) ) >>= nValue;
+ mxFont->getPropertyValue( VBAFONTBASE_PROPNAME( "CharStrikeout", "FontStrikeout" ) ) >>= nValue;
return uno::Any( nValue == awt::FontStrikeout::SINGLE );
}
void SAL_CALL
VbaFontBase::setShadow( const uno::Any& aValue ) throw ( uno::RuntimeException )
{
- mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharShadowed" ) ), aValue );
+ if( !mbFormControl )
+ mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharShadowed" ) ), aValue );
}
uno::Any SAL_CALL
VbaFontBase::getShadow() throw (uno::RuntimeException)
{
- return mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharShadowed" ) ) );
+ return mbFormControl ? uno::Any( false ) : mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharShadowed" ) ) );
}
void SAL_CALL
@@ -203,15 +236,14 @@ VbaFontBase::setItalic( const uno::Any& aValue ) throw ( uno::RuntimeException )
short nValue = awt::FontSlant_NONE;
if( bValue )
nValue = awt::FontSlant_ITALIC;
- mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharPosture" ) ), ( uno::Any )nValue );
+ mxFont->setPropertyValue( VBAFONTBASE_PROPNAME( "CharPosture", "FontSlant" ), uno::Any( nValue ) );
}
uno::Any SAL_CALL
VbaFontBase::getItalic() throw ( uno::RuntimeException )
{
-
awt::FontSlant aFS;
- mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharPosture" ) ) ) >>= aFS;
+ mxFont->getPropertyValue( VBAFONTBASE_PROPNAME( "CharPosture", "FontSlant" ) ) >>= aFS;
return uno::makeAny( aFS == awt::FontSlant_ITALIC );
}
@@ -220,26 +252,27 @@ VbaFontBase::setName( const uno::Any& aValue ) throw ( uno::RuntimeException )
{
rtl::OUString sString;
aValue >>= sString;
- mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharFontName" ) ), aValue);
+ mxFont->setPropertyValue( VBAFONTBASE_PROPNAME( "CharFontName", "FontName" ), aValue );
}
uno::Any SAL_CALL
VbaFontBase::getName() throw ( uno::RuntimeException )
{
- return mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharFontName" ) ) );
+ return mxFont->getPropertyValue( VBAFONTBASE_PROPNAME( "CharFontName", "FontName" ) );
}
+
uno::Any
VbaFontBase::getColor() throw (uno::RuntimeException)
{
uno::Any aAny;
- aAny = OORGBToXLRGB( mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharColor" ) ) ) );
+ aAny = OORGBToXLRGB( mxFont->getPropertyValue( VBAFONTBASE_PROPNAME( "CharColor", "TextColor" ) ) );
return aAny;
}
void
VbaFontBase::setColor( const uno::Any& _color ) throw (uno::RuntimeException)
{
- mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharColor" ) ) , XLRGBToOORGB(_color));
+ mxFont->setPropertyValue( VBAFONTBASE_PROPNAME( "CharColor", "TextColor" ), XLRGBToOORGB(_color) );
}
void SAL_CALL
@@ -273,7 +306,7 @@ VbaFontBase::setUnderline( const uno::Any& /*aValue*/ ) throw ( uno::RuntimeExce
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Unknown value for Underline")), uno::Reference< uno::XInterface >() );
}
- mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharUnderline" ) ), ( uno::Any )nValue );
+ mxFont->setPropertyValue( VBAFONTBASE_PROPNAME( "CharUnderline", "FontUnderline" ), uno::Any( nValue ) );
*/
}
@@ -282,7 +315,7 @@ uno::Any SAL_CALL
VbaFontBase::getUnderline() throw ( uno::RuntimeException )
{
sal_Int32 nValue = awt::FontUnderline::NONE;
- mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharUnderline" ) ) ) >>= nValue;
+ mxFont->getPropertyValue( VBAFONTBASE_PROPNAME( "CharUnderline", "FontUnderline" ) ) >>= nValue;
/*
switch ( nValue )
{
diff --git a/vbahelper/source/vbahelper/vbaglobalbase.cxx b/vbahelper/source/vbahelper/vbaglobalbase.cxx
index 4226a6bfbf53..c7c33b93b1a3 100644
--- a/vbahelper/source/vbahelper/vbaglobalbase.cxx
+++ b/vbahelper/source/vbahelper/vbaglobalbase.cxx
@@ -85,7 +85,6 @@ VbaGlobalsBase::createInstanceWithArguments( const ::rtl::OUString& ServiceSpeci
{
uno::Reference< uno::XInterface > xReturn;
-
if ( hasServiceName( ServiceSpecifier ) )
xReturn = mxContext->getServiceManager()->createInstanceWithArgumentsAndContext( ServiceSpecifier, Arguments, mxContext );
return xReturn;
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index a99b3fd47e00..1953d0772f3c 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -31,11 +31,15 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/frame/XModel2.hpp>
#include <com/sun/star/script/XDefaultProperty.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XIntrospection.hpp>
+#include <com/sun/star/util/MeasureUnit.hpp>
+
#include <ooo/vba/msforms/XShape.hpp>
#include <comphelper/processfactory.hxx>
@@ -63,8 +67,6 @@
#include <osl/file.hxx>
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-#include <com/sun/star/frame/XModel2.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <vcl/window.hxx>
#include <vcl/syswin.hxx>
#include <tools/diagnose_ex.h>
@@ -82,12 +84,6 @@
using namespace ::com::sun::star;
using namespace ::ooo::vba;
-#define NAME_HEIGHT "Height"
-#define NAME_WIDTH "Width"
-
-#define POINTTO100THMILLIMETERFACTOR 35.27778
-
-
void unoToSbxValue( SbxVariable* pVar, const uno::Any& aValue );
uno::Any sbxToUnoValue( SbxVariable* pVar );
@@ -98,14 +94,7 @@ namespace ooo
namespace vba
{
-uno::Reference< lang::XMultiServiceFactory > getVBAServiceFactory( SfxObjectShell* pShell )
-{
- uno::Any aUnoVar;
- if ( !pShell || ! pShell->GetBasicManager()->GetGlobalUNOConstant( "VBAGlobals", aUnoVar ) )
- throw lang::IllegalArgumentException();
- uno::Reference< lang::XMultiServiceFactory > xVBAFactory( aUnoVar, uno::UNO_QUERY_THROW );
- return xVBAFactory;
-}
+namespace { const double factor = 2540.0 / 72.0; }
css::uno::Reference< css::uno::XInterface > createVBAUnoAPIService( SfxObjectShell* pShell, const sal_Char* _pAsciiName ) throw (css::uno::RuntimeException)
{
@@ -114,13 +103,6 @@ css::uno::Reference< css::uno::XInterface > createVBAUnoAPIService( SfxObjectShe
return getVBAServiceFactory( pShell )->createInstance( sVarName );
}
-css::uno::Reference< css::uno::XInterface > createVBAUnoAPIServiceWithArgs( SfxObjectShell* pShell, const sal_Char* _pAsciiName, const uno::Sequence< uno::Any >& aArgs ) throw ( css::uno::RuntimeException )
-{
- OSL_PRECOND( pShell, "createVBAUnoAPIService: no shell!" );
- ::rtl::OUString sVarName( ::rtl::OUString::createFromAscii( _pAsciiName ) );
- uno::Reference< uno::XInterface > xIf = getVBAServiceFactory( pShell )->createInstanceWithArguments( sVarName, aArgs );
- return xIf;
-}
// helper method to determine if the view ( calc ) is in print-preview mode
bool isInPrintPreview( SfxViewFrame* pView )
{
@@ -287,7 +269,6 @@ getCurrentViewFrame()
};
#endif
-const double Millimeter::factor = 35.27778;
uno::Reference< beans::XIntrospectionAccess >
getIntrospectionAccess( const uno::Any& aObject ) throw (uno::RuntimeException)
@@ -330,10 +311,9 @@ void dispatchExecute(SfxViewShell* pViewShell, USHORT nSlot, SfxCallMode nCall)
}
void
-dispatchRequests (uno::Reference< frame::XModel>& xModel,rtl::OUString & aUrl, uno::Sequence< beans::PropertyValue >& sProps )
+dispatchRequests( const uno::Reference< frame::XModel>& xModel, const rtl::OUString& aUrl, const uno::Sequence< beans::PropertyValue >& sProps )
{
-
- util::URL url ;
+ util::URL url;
url.Complete = aUrl;
rtl::OUString emptyString = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "" ));
uno::Reference<frame::XController> xController = xModel->getCurrentController();
@@ -344,25 +324,22 @@ dispatchRequests (uno::Reference< frame::XModel>& xModel,rtl::OUString & aUrl, u
uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
uno::Reference<uno::XComponentContext > xContext( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
if ( !xContext.is() )
- {
- return ;
- }
+ return;
- uno::Reference<lang::XMultiComponentFactory > xServiceManager(
- xContext->getServiceManager() );
+ uno::Reference<lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
if ( !xServiceManager.is() )
- {
- return ;
- }
- uno::Reference<util::XURLTransformer> xParser( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ) )
- ,xContext), uno::UNO_QUERY_THROW );
+ return;
+
+ uno::Reference<util::XURLTransformer> xParser( xServiceManager->createInstanceWithContext(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ) ), xContext),
+ uno::UNO_QUERY_THROW );
if (!xParser.is())
return;
xParser->parseStrict (url);
}
catch ( uno::Exception & /*e*/ )
{
- return ;
+ return;
}
uno::Reference<frame::XDispatch> xDispatcher = xDispatchProvider->queryDispatch(url,emptyString,0);
@@ -376,7 +353,7 @@ dispatchRequests (uno::Reference< frame::XModel>& xModel,rtl::OUString & aUrl, u
dispatchProps.realloc( nProps + 1 );
// need to reaccquire pDest after realloc
pDest = dispatchProps.getArray();
- beans::PropertyValue* pSrc = sProps.getArray();
+ const beans::PropertyValue* pSrc = sProps.getConstArray();
for ( sal_Int32 index=0; index<nProps; ++index, ++pSrc, ++pDest )
*pDest = *pSrc;
}
@@ -389,16 +366,13 @@ dispatchRequests (uno::Reference< frame::XModel>& xModel,rtl::OUString & aUrl, u
}
void
-dispatchRequests (uno::Reference< frame::XModel>& xModel,rtl::OUString & aUrl)
+dispatchRequests( const uno::Reference< frame::XModel>& xModel, const rtl::OUString& aUrl )
{
uno::Sequence<beans::PropertyValue> dispatchProps;
dispatchRequests( xModel, aUrl, dispatchProps );
}
-
-
-
- uno::Reference< frame::XModel >
+uno::Reference< frame::XModel >
getCurrentDoc( const rtl::OUString& sKey ) throw (uno::RuntimeException)
{
uno::Reference< frame::XModel > xModel;
@@ -464,6 +438,18 @@ getCurrentDocCtx( const rtl::OUString& ctxName, const uno::Reference< uno::XComp
return xModel;
}
+uno::Reference< frame::XModel >
+getThisExcelDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException)
+{
+ return getCurrentDocCtx( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ExcelDocumentContext" ) ), xContext );
+}
+
+uno::Reference< frame::XModel >
+getThisWordDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException)
+{
+ return getCurrentDocCtx( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WordDocumentContext" ) ), xContext );
+}
+
uno::Reference< frame::XModel >
getCurrentExcelDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException)
{
@@ -475,7 +461,7 @@ getCurrentExcelDoc( const uno::Reference< uno::XComponentContext >& xContext ) t
}
catch( uno::Exception& e )
{
- xModel = getCurrentDocCtx( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ExcelDocumentContext" ) ), xContext );
+ xModel = getThisExcelDoc( xContext );
}
return xModel;
}
@@ -491,7 +477,7 @@ getCurrentWordDoc( const uno::Reference< uno::XComponentContext >& xContext ) th
}
catch( uno::Exception& e )
{
- xModel = getCurrentDocCtx( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WordDocumentContext" ) ), xContext );
+ xModel = getThisWordDoc( xContext );
}
return xModel;
}
@@ -844,12 +830,22 @@ double getPixelTo100thMillimeterConversionFactor( css::uno::Reference< css::awt:
double PointsToPixels( css::uno::Reference< css::awt::XDevice >& xDevice, double fPoints, sal_Bool bVertical)
{
double fConvertFactor = getPixelTo100thMillimeterConversionFactor( xDevice, bVertical );
- return fPoints * POINTTO100THMILLIMETERFACTOR * fConvertFactor;
+ return PointsToHmm( fPoints ) * fConvertFactor;
}
double PixelsToPoints( css::uno::Reference< css::awt::XDevice >& xDevice, double fPixels, sal_Bool bVertical)
{
double fConvertFactor = getPixelTo100thMillimeterConversionFactor( xDevice, bVertical );
- return (fPixels/fConvertFactor)/POINTTO100THMILLIMETERFACTOR;
+ return HmmToPoints( fPixels/fConvertFactor );
+}
+
+sal_Int32 PointsToHmm( double fPoints )
+{
+ return static_cast<sal_Int32>( fPoints * factor + 0.5 );
+}
+
+double HmmToPoints( sal_Int32 nHmm )
+{
+ return nHmm / factor;
}
ConcreteXShapeGeometryAttributes::ConcreteXShapeGeometryAttributes( const css::uno::Reference< css::uno::XComponentContext >& /*xContext*/, const css::uno::Reference< css::drawing::XShape >& xShape )
@@ -966,52 +962,283 @@ sal_Bool setPropertyValue( uno::Sequence< beans::PropertyValue >& aProp, const r
return sal_False;
}
-#define VBA_LEFT "PositionX"
-#define VBA_TOP "PositionY"
+// ====UserFormGeomentryHelper====
+//---------------------------------------------
UserFormGeometryHelper::UserFormGeometryHelper( const uno::Reference< uno::XComponentContext >& /*xContext*/, const uno::Reference< awt::XControl >& xControl )
{
+ if ( !xControl.is() )
+ throw uno::RuntimeException();
+
+ mxControlUnits.set( xControl->getPeer(), uno::UNO_QUERY_THROW );
mxModel.set( xControl->getModel(), uno::UNO_QUERY_THROW );
}
- double UserFormGeometryHelper::getLeft()
+
+//---------------------------------------------
+sal_Int32 UserFormGeometryHelper::ConvertPixelToLogic( sal_Int32 nValue, sal_Bool bIsPoint, sal_Bool bIsX, sal_Int16 nTargetUnit )
+{
+ sal_Int32 nResult = 0;
+ if ( bIsPoint )
+ {
+ // conversion for a point
+ awt::Point aPixelPoint( 0, 0 );
+ ( bIsX ? aPixelPoint.X : aPixelPoint.Y ) = nValue;
+ awt::Point aTargetPoint( 0, 0 );
+ aTargetPoint = mxControlUnits->convertPointToLogic( aPixelPoint, nTargetUnit );
+
+ nResult = bIsX ? aTargetPoint.X : aTargetPoint.Y;
+ }
+ else
+ {
+ // conversion for a size
+ awt::Size aPixelSize( 0, 0 );
+ ( bIsX ? aPixelSize.Width : aPixelSize.Height ) = nValue;
+ awt::Size aTargetSize( 0, 0 );
+ aTargetSize = mxControlUnits->convertSizeToLogic( aPixelSize, nTargetUnit );
+
+ nResult = bIsX ? aTargetSize.Width : aTargetSize.Height;
+ }
+
+ return nResult;
+}
+
+//---------------------------------------------
+sal_Int32 UserFormGeometryHelper::ConvertLogicToPixel( sal_Int32 nValue, sal_Bool bIsPoint, sal_Bool bIsX, sal_Int16 nSourceUnit )
+{
+ sal_Int32 nResult = 0;
+ if ( bIsPoint )
+ {
+ // conversion for a point
+ awt::Point aSourcePoint( 0, 0 );
+ ( bIsX ? aSourcePoint.X : aSourcePoint.Y ) = nValue;
+
+ awt::Point aPixelPoint( 0, 0 );
+ aPixelPoint = mxControlUnits->convertPointToPixel( aSourcePoint, nSourceUnit );
+
+ nResult = bIsX ? aPixelPoint.X : aPixelPoint.Y;
+ }
+ else
+ {
+ // conversion for a size
+ awt::Size aSourceSize( 0, 0 );
+ ( bIsX ? aSourceSize.Width : aSourceSize.Height ) = nValue;
+
+ awt::Size aPixelSize( 0, 0 );
+ aPixelSize = mxControlUnits->convertSizeToPixel( aSourceSize, nSourceUnit );
+
+ nResult = bIsX ? aPixelSize.Width : aPixelSize.Height;
+ }
+
+ return nResult;
+}
+//---------------------------------------------
+double UserFormGeometryHelper::getLeft()
+{
+ double nResult = 0;
+
+ try
+ {
+ sal_Int32 nLeft = 0;
+ mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ) ) >>= nLeft;
+ nResult = ConvertLogicToPixel( nLeft,
+ sal_True, // Point
+ sal_True, // X
+ util::MeasureUnit::APPFONT );
+ }
+ catch ( uno::RuntimeException& )
+ {
+ throw;
+ }
+ catch ( uno::Exception& e )
+ {
+ throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not get position X!" ) ),
+ uno::Reference< uno::XInterface >(),
+ uno::makeAny( e ) );
+ }
+
+ return nResult;
+}
+
+//---------------------------------------------
+void UserFormGeometryHelper::setLeft( double nLeft )
+{
+ try
+ {
+ mxModel->setPropertyValue(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ),
+ uno::makeAny( ConvertPixelToLogic( nLeft,
+ sal_True, // Point
+ sal_True, // X
+ util::MeasureUnit::APPFONT ) ) );
+ }
+ catch ( uno::RuntimeException& )
+ {
+ throw;
+ }
+ catch ( uno::Exception& e )
+ {
+ throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not set position X!" ) ),
+ uno::Reference< uno::XInterface >(),
+ uno::makeAny( e ) );
+ }
+}
+
+//---------------------------------------------
+double UserFormGeometryHelper::getTop()
+{
+ double nResult = 0;
+
+ try
+ {
+ sal_Int32 nTop = 0;
+ mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_TOP ) ) ) >>= nTop;
+ nResult = ConvertLogicToPixel( nTop,
+ sal_True, // Point
+ sal_False, // Y
+ util::MeasureUnit::APPFONT );
+ }
+ catch ( uno::RuntimeException& )
+ {
+ throw;
+ }
+ catch ( uno::Exception& e )
+ {
+ throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not get position Y!" ) ),
+ uno::Reference< uno::XInterface >(),
+ uno::makeAny( e ) );
+ }
+
+ return nResult;
+}
+
+//---------------------------------------------
+void UserFormGeometryHelper::setTop( double nTop )
+{
+ try
+ {
+ mxModel->setPropertyValue(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_TOP ) ),
+ uno::makeAny( ConvertPixelToLogic( nTop,
+ sal_True, // Point
+ sal_False, // Y
+ util::MeasureUnit::APPFONT ) ) );
+ }
+ catch ( uno::RuntimeException& )
+ {
+ throw;
+ }
+ catch ( uno::Exception& e )
+ {
+ throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not set position X!" ) ),
+ uno::Reference< uno::XInterface >(),
+ uno::makeAny( e ) );
+ }
+}
+
+//---------------------------------------------
+double UserFormGeometryHelper::getWidth()
+{
+ double nResult = 0;
+
+ try
+ {
+ sal_Int32 nWidth = 0;
+ mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_WIDTH ) ) ) >>= nWidth;
+ nResult = ConvertLogicToPixel( nWidth,
+ sal_False, // Size
+ sal_True, // X
+ util::MeasureUnit::APPFONT );
+ }
+ catch ( uno::RuntimeException& )
+ {
+ throw;
+ }
+ catch ( uno::Exception& e )
+ {
+ throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not get width!" ) ),
+ uno::Reference< uno::XInterface >(),
+ uno::makeAny( e ) );
+ }
+
+ return nResult;
+}
+
+//---------------------------------------------
+void UserFormGeometryHelper::setWidth( double nWidth)
+{
+ try
{
- sal_Int32 nLeft = 0;
- mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ) ) >>= nLeft;
- return Millimeter::getInPoints( nLeft );
+ mxModel->setPropertyValue(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_WIDTH ) ),
+ uno::makeAny( ConvertPixelToLogic( nWidth,
+ sal_False, // Size
+ sal_True, // X
+ util::MeasureUnit::APPFONT ) ) );
}
- void UserFormGeometryHelper::setLeft( double nLeft )
+ catch ( uno::RuntimeException& )
{
- mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nLeft ) ) );
+ throw;
}
- double UserFormGeometryHelper::getTop()
+ catch ( uno::Exception& e )
{
- sal_Int32 nTop = 0;
- mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_TOP ) ) ) >>= nTop;
- return Millimeter::getInPoints( nTop );
+ throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not set width!" ) ),
+ uno::Reference< uno::XInterface >(),
+ uno::makeAny( e ) );
}
- void UserFormGeometryHelper::setTop( double nTop )
+}
+
+//---------------------------------------------
+double UserFormGeometryHelper::getHeight()
+{
+ double nResult = 0;
+
+ try
{
- mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_TOP ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nTop ) ) );
+ sal_Int32 nHeight = 0;
+ mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_HEIGHT ) ) ) >>= nHeight;
+ nResult = ConvertLogicToPixel( nHeight,
+ sal_False, // Size
+ sal_False, // Y
+ util::MeasureUnit::APPFONT );
}
- double UserFormGeometryHelper::getHeight()
+ catch ( uno::RuntimeException& )
{
- sal_Int32 nHeight = 0;
- mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( NAME_HEIGHT ) ) ) >>= nHeight;
- return Millimeter::getInPoints( nHeight );
+ throw;
}
- void UserFormGeometryHelper::setHeight( double nHeight )
+ catch ( uno::Exception& e )
{
- mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( NAME_HEIGHT ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nHeight ) ) );
+ throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not get height!" ) ),
+ uno::Reference< uno::XInterface >(),
+ uno::makeAny( e ) );
}
- double UserFormGeometryHelper::getWidth()
+
+ return nResult;
+}
+
+//---------------------------------------------
+void UserFormGeometryHelper::setHeight( double nHeight )
+{
+ try
{
- sal_Int32 nWidth = 0;
- mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( NAME_WIDTH ) ) ) >>= nWidth;
- return Millimeter::getInPoints( nWidth );
+ mxModel->setPropertyValue(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_HEIGHT ) ),
+ uno::makeAny( ConvertPixelToLogic( nHeight,
+ sal_False, // Size
+ sal_False, // Y
+ util::MeasureUnit::APPFONT ) ) );
}
- void UserFormGeometryHelper::setWidth( double nWidth)
+ catch ( uno::RuntimeException& )
{
- mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( NAME_WIDTH ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nWidth ) ) );
+ throw;
}
+ catch ( uno::Exception& e )
+ {
+ throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not set height!" ) ),
+ uno::Reference< uno::XInterface >(),
+ uno::makeAny( e ) );
+ }
+}
+
+// ============
double ConcreteXShapeGeometryAttributes::getLeft()
{
@@ -1144,8 +1371,7 @@ UserFormGeometryHelper::UserFormGeometryHelper( const uno::Reference< uno::XComp
void Millimeter::set(double mm) { m_nMillimeter = mm; }
void Millimeter::setInPoints(double points)
{
- m_nMillimeter = points * 0.352777778;
- // 25.4mm / 72
+ m_nMillimeter = points * factor / 100.0;
}
void Millimeter::setInHundredthsOfOneMillimeter(double hmm)
@@ -1163,7 +1389,7 @@ UserFormGeometryHelper::UserFormGeometryHelper( const uno::Reference< uno::XComp
}
double Millimeter::getInPoints()
{
- return m_nMillimeter * 2.834645669; // 72 / 25.4mm
+ return m_nMillimeter / factor * 100.0;
}
sal_Int32 Millimeter::getInHundredthsOfOneMillimeter(double points)
diff --git a/vbahelper/util/makefile.mk b/vbahelper/util/makefile.mk
index 09f3866c5439..dda4be0cbc81 100644
--- a/vbahelper/util/makefile.mk
+++ b/vbahelper/util/makefile.mk
@@ -34,6 +34,10 @@ TARGET=vbahelper
.INCLUDE : settings.mk
+.IF "$(ENABLE_VBA)" == "NO"
+dummy:
+ @echo "Nothing to build"
+.ENDIF
TARGET_HELPER=vbahelper
@@ -56,6 +60,7 @@ SHL1STDLIBS= \
$(SVLLIB) \
$(VCLLIB) \
$(SVTOOLLIB) \
+ $(MSFILTERLIB) \
$(TKLIB)
SHL1DEPN=
@@ -72,7 +77,7 @@ TARGET_MSFORMS=msforms
SHL2TARGET=$(TARGET_MSFORMS)$(DLLPOSTFIX).uno
SHL2IMPLIB= i$(TARGET_MSFORMS)
-SHL2VERSIONMAP=$(TARGET_MSFORMS).map
+SHL2VERSIONMAP=$(SOLARENV)/src/component.map
SHL2DEF=$(MISC)$/$(SHL2TARGET).def
DEF2NAME=$(SHL2TARGET)
SHL2STDLIBS= \
diff --git a/vbahelper/util/msforms.map b/vbahelper/util/msforms.map
deleted file mode 100644
index 737cddbfe3df..000000000000
--- a/vbahelper/util/msforms.map
+++ /dev/null
@@ -1,9 +0,0 @@
-OOO_1.1 {
- global:
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/xmlhelp/prj/d.lst b/xmlhelp/prj/d.lst
index 5f208e51c20f..1cfa107f73b9 100644
--- a/xmlhelp/prj/d.lst
+++ b/xmlhelp/prj/d.lst
@@ -4,6 +4,4 @@
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.*
..\%__SRC%\class\*.jar %_DEST%\bin%_EXT%\*.*
..\util\ucpchelp.xml %_DEST%\xml%_EXT%\ucpchelp.xml
-..\inc\xmlhelp\compilehelp.hxx %_DEST%\inc%_EXT%\xmlhelp\compilehelp.hxx
-..\inc\xmlhelp\helplinkerdllapi.h %_DEST%\inc%_EXT%\xmlhelp\helplinkerdllapi.h
-..\%__SRC%\lib\ihelplinker.lib %_DEST%\lib%_EXT%\ihelplinker.lib \ No newline at end of file
+..\%__SRC%\lib\ihelplinker.lib %_DEST%\lib%_EXT%\ihelplinker.lib
diff --git a/xmlhelp/source/com/sun/star/help/makefile.mk b/xmlhelp/source/com/sun/star/help/makefile.mk
index c7c5bd44b6df..ffa08b30cfed 100644
--- a/xmlhelp/source/com/sun/star/help/makefile.mk
+++ b/xmlhelp/source/com/sun/star/help/makefile.mk
@@ -48,8 +48,8 @@ ADDFILES = $(subst,$(SOLARBINDIR)$/help,$(CLASSDIR) $(TRANSEX3FILES))
JARFILES = ridl.jar jurt.jar unoil.jar juh.jar
.IF "$(SYSTEM_LUCENE)" == "YES"
-XCLASSPATH!:=$(XCLASSPATH)$(PATH_SEPERATOR)$(LUCENE_CORE_JAR)$(PATH_SEPERATOR)$(LUCENE_ANALYZERS_JAR)
-JARCLASSPATH = file://$(LUCENE_CORE_JAR) file://$(LUCENE_ANALYZERS_JAR)
+EXTRAJARFILES = $(LUCENE_CORE_JAR) $(LUCENE_ANALYZERS_JAR)
+JARCLASSPATH = $(EXTRAJARFILES)
.ELSE
JARFILES += lucene-core-2.3.jar lucene-analyzers-2.3.jar
JARCLASSPATH = lucene-core-2.3.jar lucene-analyzers-2.3.jar
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index c5e2582b3905..f1113c1e114f 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -1162,7 +1162,8 @@ Reference< XHierarchicalNameAccess > Databases::jarFile( const rtl::OUString& ja
Reference< XHierarchicalNameAccess > Databases::findJarFileForPath
( const rtl::OUString& jar, const rtl::OUString& Language,
- const rtl::OUString& path, rtl::OUString* o_pExtensionPath )
+ const rtl::OUString& path, rtl::OUString* o_pExtensionPath,
+ rtl::OUString* o_pExtensionRegistryPath )
{
Reference< XHierarchicalNameAccess > xNA;
if( ! jar.getLength() ||
@@ -1174,7 +1175,7 @@ Reference< XHierarchicalNameAccess > Databases::findJarFileForPath
JarFileIterator aJarFileIt( m_xContext, *this, jar, Language );
Reference< XHierarchicalNameAccess > xTestNA;
Reference< deployment::XPackage > xParentPackageBundle;
- while( (xTestNA = aJarFileIt.nextJarFile( xParentPackageBundle, o_pExtensionPath )).is() )
+ while( (xTestNA = aJarFileIt.nextJarFile( xParentPackageBundle, o_pExtensionPath, o_pExtensionRegistryPath )).is() )
{
if( xTestNA.is() && xTestNA->hasByHierarchicalName( path ) )
{
@@ -1510,8 +1511,10 @@ void ExtensionIteratorBase::init()
m_bUserPackagesLoaded = false;
m_bSharedPackagesLoaded = false;
+ m_bBundledPackagesLoaded = false;
m_iUserPackage = 0;
m_iSharedPackage = 0;
+ m_iBundledPackage = 0;
}
Reference< deployment::XPackage > ExtensionIteratorBase::implGetHelpPackageFromPackage
@@ -1622,7 +1625,7 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextSharedHelpPa
if( m_iSharedPackage == m_aSharedPackagesSeq.getLength() )
{
- m_eState = END_REACHED;
+ m_eState = BUNDLED_EXTENSIONS;
}
else
{
@@ -1635,6 +1638,36 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextSharedHelpPa
return xHelpPackage;
}
+Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextBundledHelpPackage
+ ( Reference< deployment::XPackage >& o_xParentPackageBundle )
+{
+ Reference< deployment::XPackage > xHelpPackage;
+
+ if( !m_bBundledPackagesLoaded )
+ {
+ Reference< XPackageManager > xBundledManager =
+ thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("bundled") );
+ m_aBundledPackagesSeq = xBundledManager->getDeployedPackages
+ ( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
+ m_bBundledPackagesLoaded = true;
+ }
+
+ if( m_iBundledPackage == m_aBundledPackagesSeq.getLength() )
+ {
+ m_eState = END_REACHED;
+ }
+ else
+ {
+ const Reference< deployment::XPackage >* pBundledPackages =
+ m_aBundledPackagesSeq.getConstArray();
+ Reference< deployment::XPackage > xPackage = pBundledPackages[ m_iBundledPackage++ ];
+ VOS_ENSURE( xPackage.is(), "ExtensionIteratorBase::implGetNextBundledHelpPackage(): Invalid package" );
+ xHelpPackage = implGetHelpPackageFromPackage( xPackage, o_xParentPackageBundle );
+ }
+
+ return xHelpPackage;
+}
+
rtl::OUString ExtensionIteratorBase::implGetFileFromPackage(
const rtl::OUString& rFileExtension, Reference< deployment::XPackage > xPackage )
{
@@ -1646,7 +1679,7 @@ rtl::OUString ExtensionIteratorBase::implGetFileFromPackage(
for( sal_Int32 iPass = 0 ; iPass < 2 ; ++iPass )
{
rtl::OUStringBuffer aStrBuf;
- aStrBuf.append( xPackage->getURL() );
+ aStrBuf.append( xPackage->getRegistrationDataURL().Value);
aStrBuf.append( aSlash );
aStrBuf.append( aLanguage );
if( !bLangFolderOnly )
@@ -1720,7 +1753,7 @@ void ExtensionIteratorBase::implGetLanguageVectorFromPackage( ::std::vector< ::r
//===================================================================
// class DataBaseIterator
-Db* DataBaseIterator::nextDb( rtl::OUString* o_pExtensionPath )
+Db* DataBaseIterator::nextDb( rtl::OUString* o_pExtensionPath, rtl::OUString* o_pExtensionRegistryPath )
{
Db* pRetDb = NULL;
@@ -1743,7 +1776,7 @@ Db* DataBaseIterator::nextDb( rtl::OUString* o_pExtensionPath )
Reference< deployment::XPackage > xHelpPackage = implGetNextUserHelpPackage( xParentPackageBundle );
if( !xHelpPackage.is() )
break;
- pRetDb = implGetDbFromPackage( xHelpPackage, o_pExtensionPath );
+ pRetDb = implGetDbFromPackage( xHelpPackage, o_pExtensionPath, o_pExtensionRegistryPath );
break;
}
@@ -1754,9 +1787,21 @@ Db* DataBaseIterator::nextDb( rtl::OUString* o_pExtensionPath )
if( !xHelpPackage.is() )
break;
- pRetDb = implGetDbFromPackage( xHelpPackage, o_pExtensionPath );
+ pRetDb = implGetDbFromPackage( xHelpPackage, o_pExtensionPath, o_pExtensionRegistryPath );
+ break;
+ }
+
+ case BUNDLED_EXTENSIONS:
+ {
+ Reference< deployment::XPackage > xParentPackageBundle;
+ Reference< deployment::XPackage > xHelpPackage = implGetNextBundledHelpPackage( xParentPackageBundle );
+ if( !xHelpPackage.is() )
+ break;
+
+ pRetDb = implGetDbFromPackage( xHelpPackage, o_pExtensionPath, o_pExtensionRegistryPath );
break;
}
+
case END_REACHED:
VOS_ENSURE( false, "DataBaseIterator::nextDb(): Invalid case END_REACHED" );
break;
@@ -1767,38 +1812,55 @@ Db* DataBaseIterator::nextDb( rtl::OUString* o_pExtensionPath )
}
Db* DataBaseIterator::implGetDbFromPackage( Reference< deployment::XPackage > xPackage,
- rtl::OUString* o_pExtensionPath )
+ rtl::OUString* o_pExtensionPath, rtl::OUString* o_pExtensionRegistryPath )
{
- rtl::OUString aExtensionPath = xPackage->getURL();
- //if( o_pExtensionPath )
- //*o_pExtensionPath = aExtensionPath;
- aExtensionPath += aSlash;
- rtl::OUString aUsedLanguage = m_aLanguage;
- Db* pRetDb = m_rDatabases.getBerkeley( aHelpFilesBaseName, aUsedLanguage,
- m_bHelpText, &aExtensionPath );
+ beans::Optional< ::rtl::OUString> optRegData;
+ try
+ {
+ optRegData = xPackage->getRegistrationDataURL();
+ }
+ catch ( deployment::ExtensionRemovedException&)
+ {
+ return NULL;
+ }
- // Language fallback
- if( !pRetDb )
+ Db* pRetDb = NULL;
+ if (optRegData.IsPresent && optRegData.Value.getLength() > 0)
{
- ::std::vector< ::rtl::OUString > av;
- implGetLanguageVectorFromPackage( av, xPackage );
- ::std::vector< ::rtl::OUString >::const_iterator pFound = av.end();
- try
- {
- pFound = ::comphelper::Locale::getFallback( av, m_aLanguage );
- }
- catch( ::comphelper::Locale::MalFormedLocaleException& )
- {}
- if( pFound != av.end() )
+ rtl::OUString aRegDataUrl(optRegData.Value);
+ aRegDataUrl += aSlash;
+
+ rtl::OUString aUsedLanguage = m_aLanguage;
+ pRetDb = m_rDatabases.getBerkeley(
+ aHelpFilesBaseName, aUsedLanguage, m_bHelpText, &aRegDataUrl);
+
+ // Language fallback
+ if( !pRetDb )
{
- aUsedLanguage = *pFound;
- pRetDb = m_rDatabases.getBerkeley( aHelpFilesBaseName, aUsedLanguage, m_bHelpText, &aExtensionPath );
+ ::std::vector< ::rtl::OUString > av;
+ implGetLanguageVectorFromPackage( av, xPackage );
+ ::std::vector< ::rtl::OUString >::const_iterator pFound = av.end();
+ try
+ {
+ pFound = ::comphelper::Locale::getFallback( av, m_aLanguage );
+ }
+ catch( ::comphelper::Locale::MalFormedLocaleException& )
+ {}
+ if( pFound != av.end() )
+ {
+ aUsedLanguage = *pFound;
+ pRetDb = m_rDatabases.getBerkeley(
+ aHelpFilesBaseName, aUsedLanguage, m_bHelpText, &aRegDataUrl);
+ }
}
- }
- if( o_pExtensionPath )
- *o_pExtensionPath = aExtensionPath + aUsedLanguage;
+ if( o_pExtensionPath )
+ *o_pExtensionPath = aRegDataUrl + aUsedLanguage;
+
+ if( o_pExtensionRegistryPath )
+ *o_pExtensionRegistryPath = xPackage->getURL() + aSlash + aUsedLanguage;
+ }
return pRetDb;
}
@@ -1853,6 +1915,19 @@ rtl::OUString KeyDataBaseFileIterator::nextDbFile( bool& o_rbExtension )
o_rbExtension = true;
break;
}
+
+ case BUNDLED_EXTENSIONS:
+ {
+ Reference< deployment::XPackage > xParentPackageBundle;
+ Reference< deployment::XPackage > xHelpPackage = implGetNextBundledHelpPackage( xParentPackageBundle );
+ if( !xHelpPackage.is() )
+ break;
+
+ aRetFile = implGetDbFileFromPackage( xHelpPackage );
+ o_rbExtension = true;
+ break;
+ }
+
case END_REACHED:
VOS_ENSURE( false, "DataBaseIterator::nextDbFile(): Invalid case END_REACHED" );
break;
@@ -1879,7 +1954,8 @@ rtl::OUString KeyDataBaseFileIterator::implGetDbFileFromPackage
// class JarFileIterator
Reference< XHierarchicalNameAccess > JarFileIterator::nextJarFile
- ( Reference< deployment::XPackage >& o_xParentPackageBundle, rtl::OUString* o_pExtensionPath )
+ ( Reference< deployment::XPackage >& o_xParentPackageBundle,
+ rtl::OUString* o_pExtensionPath, rtl::OUString* o_pExtensionRegistryPath )
{
Reference< XHierarchicalNameAccess > xNA;
@@ -1902,7 +1978,7 @@ Reference< XHierarchicalNameAccess > JarFileIterator::nextJarFile
if( !xHelpPackage.is() )
break;
- xNA = implGetJarFromPackage( xHelpPackage, o_pExtensionPath );
+ xNA = implGetJarFromPackage( xHelpPackage, o_pExtensionPath, o_pExtensionRegistryPath );
break;
}
@@ -1912,9 +1988,20 @@ Reference< XHierarchicalNameAccess > JarFileIterator::nextJarFile
if( !xHelpPackage.is() )
break;
- xNA = implGetJarFromPackage( xHelpPackage, o_pExtensionPath );
+ xNA = implGetJarFromPackage( xHelpPackage, o_pExtensionPath, o_pExtensionRegistryPath );
break;
}
+
+ case BUNDLED_EXTENSIONS:
+ {
+ Reference< deployment::XPackage > xHelpPackage = implGetNextBundledHelpPackage( o_xParentPackageBundle );
+ if( !xHelpPackage.is() )
+ break;
+
+ xNA = implGetJarFromPackage( xHelpPackage, o_pExtensionPath, o_pExtensionRegistryPath );
+ break;
+ }
+
case END_REACHED:
VOS_ENSURE( false, "JarFileIterator::nextJarFile(): Invalid case END_REACHED" );
break;
@@ -1925,7 +2012,7 @@ Reference< XHierarchicalNameAccess > JarFileIterator::nextJarFile
}
Reference< XHierarchicalNameAccess > JarFileIterator::implGetJarFromPackage
- ( Reference< deployment::XPackage > xPackage, rtl::OUString* o_pExtensionPath )
+( Reference< deployment::XPackage > xPackage, rtl::OUString* o_pExtensionPath, rtl::OUString* o_pExtensionRegistryPath )
{
Reference< XHierarchicalNameAccess > xNA;
@@ -1970,6 +2057,15 @@ Reference< XHierarchicalNameAccess > JarFileIterator::implGetJarFromPackage
sal_Int32 nLastSlash = zipFile.lastIndexOf( '/' );
if( nLastSlash != -1 )
*o_pExtensionPath = zipFile.copy( 0, nLastSlash );
+
+ if( o_pExtensionRegistryPath != NULL )
+ {
+ rtl::OUString& rPath = *o_pExtensionPath;
+ sal_Int32 nLastSlashInPath = rPath.lastIndexOf( '/', rPath.getLength() - 1 );
+
+ *o_pExtensionRegistryPath = xPackage->getURL();
+ *o_pExtensionRegistryPath += rPath.copy( nLastSlashInPath);
+ }
}
return xNA;
@@ -2026,6 +2122,19 @@ rtl::OUString IndexFolderIterator::nextIndexFolder( bool& o_rbExtension, bool& o
o_rbExtension = true;
break;
}
+
+ case BUNDLED_EXTENSIONS:
+ {
+ Reference< deployment::XPackage > xParentPackageBundle;
+ Reference< deployment::XPackage > xHelpPackage = implGetNextBundledHelpPackage( xParentPackageBundle );
+ if( !xHelpPackage.is() )
+ break;
+
+ aIndexFolder = implGetIndexFolderFromPackage( o_rbTemporary, xHelpPackage );
+ o_rbExtension = true;
+ break;
+ }
+
case END_REACHED:
VOS_ENSURE( false, "IndexFolderIterator::nextIndexFolder(): Invalid case END_REACHED" );
break;
diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx
index 6468c5732c6b..aa80bf27405b 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.hxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.hxx
@@ -267,7 +267,8 @@ namespace chelp {
com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess >
findJarFileForPath( const rtl::OUString& jar, const rtl::OUString& Language,
- const rtl::OUString& path, rtl::OUString* o_pExtensionPath = NULL );
+ const rtl::OUString& path, rtl::OUString* o_pExtensionPath = NULL,
+ rtl::OUString* o_pExtensionRegistryPath = NULL );
/**
* Maps a given language-locale combination to language.
@@ -398,6 +399,7 @@ namespace chelp {
//SHARED_MODULE, // Later, avoids redundancies in help compiling
USER_EXTENSIONS,
SHARED_EXTENSIONS,
+ BUNDLED_EXTENSIONS,
END_REACHED
};
@@ -433,6 +435,8 @@ namespace chelp {
( com::sun::star::uno::Reference< com::sun::star::deployment::XPackage >& o_xParentPackageBundle );
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > implGetNextSharedHelpPackage
( com::sun::star::uno::Reference< com::sun::star::deployment::XPackage >& o_xParentPackageBundle );
+ com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > implGetNextBundledHelpPackage
+ ( com::sun::star::uno::Reference< com::sun::star::deployment::XPackage >& o_xParentPackageBundle );
rtl::OUString implGetFileFromPackage( const rtl::OUString& rFileExtension,
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > xPackage );
void implGetLanguageVectorFromPackage( ::std::vector< ::rtl::OUString > &rv,
@@ -456,8 +460,13 @@ namespace chelp {
< com::sun::star::deployment::XPackage > > m_aSharedPackagesSeq;
bool m_bSharedPackagesLoaded;
+ com::sun::star::uno::Sequence< com::sun::star::uno::Reference
+ < com::sun::star::deployment::XPackage > > m_aBundledPackagesSeq;
+ bool m_bBundledPackagesLoaded;
+
int m_iUserPackage;
int m_iSharedPackage;
+ int m_iBundledPackage;
}; // end class ExtensionIteratorBase
@@ -477,13 +486,13 @@ namespace chelp {
, m_bHelpText( bHelpText )
{}
- berkeleydbproxy::Db* nextDb( rtl::OUString* o_pExtensionPath = NULL );
+ berkeleydbproxy::Db* nextDb( rtl::OUString* o_pExtensionPath = NULL, rtl::OUString* o_pExtensionRegistryPath = NULL );
private:
berkeleydbproxy::Db* implGetDbFromPackage(
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > xPackage,
- rtl::OUString* o_pExtensionPath );
+ rtl::OUString* o_pExtensionPath, rtl::OUString* o_pExtensionRegistryPath );
bool m_bHelpText;
@@ -517,12 +526,12 @@ namespace chelp {
com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess >
nextJarFile( com::sun::star::uno::Reference< com::sun::star::deployment::XPackage >& o_xParentPackageBundle,
- rtl::OUString* o_pExtensionPath = NULL );
+ rtl::OUString* o_pExtensionPath = NULL, rtl::OUString* o_pExtensionRegistryPath = NULL );
private:
com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess >
implGetJarFromPackage(com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > xPackage,
- rtl::OUString* o_pExtensionPath = NULL );
+ rtl::OUString* o_pExtensionPath = NULL, rtl::OUString* o_pExtensionRegistryPath = NULL );
}; // end class JarFileIterator
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
index 9268ec19cd7f..67735c4e0a6a 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
@@ -306,9 +306,10 @@ void URLParameter::readBerkeley()
Dbt data;
DBData aDBData;
rtl::OUString aExtensionPath;
+ rtl::OUString aExtensionRegistryPath;
while( true )
{
- Db* db = aDbIt.nextDb( &aExtensionPath );
+ Db* db = aDbIt.nextDb( &aExtensionPath, &aExtensionRegistryPath );
if( !db )
break;
@@ -355,6 +356,7 @@ void URLParameter::readBerkeley()
aExtendedJarStrBuf.append( aQuestionMark );
aExtendedJarStrBuf.append( m_aJar );
m_aJar = aExtendedJarStrBuf.makeStringAndClear();
+ m_aExtensionRegistryPath = aExtensionRegistryPath;
}
m_aTag = converter.getHash();
}
@@ -1004,18 +1006,20 @@ InputStreamTransformer::InputStreamTransformer( URLParameter* urlParam,
rtl::OUString aJar = urlParam->get_jar();
bool bAddExtensionPath = false;
+ rtl::OUString aExtensionRegistryPath;
sal_Int32 nQuestionMark1 = aJar.indexOf( sal_Unicode('?') );
sal_Int32 nQuestionMark2 = aJar.lastIndexOf( sal_Unicode('?') );
if( nQuestionMark1 != -1 && nQuestionMark2 != -1 && nQuestionMark1 != nQuestionMark2 )
{
aExtensionPath = aJar.copy( nQuestionMark1 + 1, nQuestionMark2 - nQuestionMark1 - 1 );
+ aExtensionRegistryPath = urlParam->get_ExtensionRegistryPath();
bAddExtensionPath = true;
}
else
{
// Path not yet specified, search directly
Reference< XHierarchicalNameAccess > xNA = pDatabases->findJarFileForPath
- ( aJar, urlParam->get_language(), urlParam->get_path(), &aExtensionPath );
+ ( aJar, urlParam->get_language(), urlParam->get_path(), &aExtensionPath, &aExtensionRegistryPath );
if( xNA.is() && aExtensionPath.getLength() )
bAddExtensionPath = true;
}
@@ -1038,7 +1042,7 @@ InputStreamTransformer::InputStreamTransformer( URLParameter* urlParam,
Reference< XInterface >() );
}
- rtl::OUString aOUExpandedExtensionPath = Databases::expandURL( aExtensionPath, xContext );
+ rtl::OUString aOUExpandedExtensionPath = Databases::expandURL( aExtensionRegistryPath, xContext );
rtl::OString aExpandedExtensionPath = rtl::OUStringToOString( aOUExpandedExtensionPath, osl_getThreadTextEncoding() );
parString[last++] = "ExtensionPath";
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.hxx b/xmlhelp/source/cxxhelp/provider/urlparameter.hxx
index d1dbf48132a7..5f73c930dcdb 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.hxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.hxx
@@ -150,6 +150,8 @@ namespace chelp {
rtl::OUString get_jar() { return get_the_jar(); } // BerkeleyDb
+ rtl::OUString get_ExtensionRegistryPath() { return m_aExtensionRegistryPath; }
+
rtl::OUString get_module() { return m_aModule; }
rtl::OUString get_dbpar() {
@@ -203,6 +205,7 @@ namespace chelp {
rtl::OUString m_aModule;
rtl::OUString m_aTitle;
rtl::OUString m_aJar;
+ rtl::OUString m_aExtensionRegistryPath;
rtl::OUString m_aEid;
rtl::OUString m_aDbPar;
diff --git a/xmlhelp/source/treeview/makefile.mk b/xmlhelp/source/treeview/makefile.mk
index df01c8a55ec7..0c385862d772 100644
--- a/xmlhelp/source/treeview/makefile.mk
+++ b/xmlhelp/source/treeview/makefile.mk
@@ -58,7 +58,7 @@ SHL1STDLIBS=\
$(COMPHELPERLIB) \
$(EXPATASCII3RDLIB) \
$(SALLIB)
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
DEF1NAME=$(SHL1TARGET)
DEF1DES=UCB : Treeview help
diff --git a/xmlhelp/source/treeview/tvhlp.map b/xmlhelp/source/treeview/tvhlp.map
deleted file mode 100644
index d432afe36358..000000000000
--- a/xmlhelp/source/treeview/tvhlp.map
+++ /dev/null
@@ -1,9 +0,0 @@
-TVHLP_1_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-}; \ No newline at end of file
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx
index 478562fca7b7..73c413394763 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -986,8 +986,10 @@ void ExtensionIteratorBase::init()
m_bUserPackagesLoaded = false;
m_bSharedPackagesLoaded = false;
+ m_bBundledPackagesLoaded = false;
m_iUserPackage = 0;
m_iSharedPackage = 0;
+ m_iBundledPackage = 0;
}
Reference< deployment::XPackage > ExtensionIteratorBase::implGetHelpPackageFromPackage
@@ -1089,7 +1091,7 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextSharedHelpPa
if( m_iSharedPackage == m_aSharedPackagesSeq.getLength() )
{
- m_eState = END_REACHED;
+ m_eState = BUNDLED_EXTENSIONS;
}
else
{
@@ -1102,6 +1104,36 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextSharedHelpPa
return xHelpPackage;
}
+Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextBundledHelpPackage
+ ( Reference< deployment::XPackage >& o_xParentPackageBundle )
+{
+ Reference< deployment::XPackage > xHelpPackage;
+
+ if( !m_bBundledPackagesLoaded )
+ {
+ Reference< XPackageManager > xBundledManager =
+ thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("bundled") );
+ m_aBundledPackagesSeq = xBundledManager->getDeployedPackages
+ ( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
+
+ m_bBundledPackagesLoaded = true;
+ }
+
+ if( m_iBundledPackage == m_aBundledPackagesSeq.getLength() )
+ {
+ m_eState = END_REACHED;
+ }
+ else
+ {
+ const Reference< deployment::XPackage >* pBundledPackages = m_aBundledPackagesSeq.getConstArray();
+ Reference< deployment::XPackage > xPackage = pBundledPackages[ m_iBundledPackage++ ];
+ VOS_ENSURE( xPackage.is(), "ExtensionIteratorBase::implGetNextBundledHelpPackage(): Invalid package" );
+ xHelpPackage = implGetHelpPackageFromPackage( xPackage, o_xParentPackageBundle );
+ }
+
+ return xHelpPackage;
+}
+
inline bool isLetter( sal_Unicode c )
{
bool bLetter = ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
@@ -1173,7 +1205,18 @@ rtl::OUString TreeFileIterator::nextTreeFile( sal_Int32& rnFileSize )
aRetFile = implGetTreeFileFromPackage( rnFileSize, xHelpPackage );
break;
}
- case END_REACHED:
+ case BUNDLED_EXTENSIONS:
+ {
+ Reference< deployment::XPackage > xParentPackageBundle;
+ Reference< deployment::XPackage > xHelpPackage = implGetNextBundledHelpPackage( xParentPackageBundle );
+ if( !xHelpPackage.is() )
+ break;
+
+ aRetFile = implGetTreeFileFromPackage( rnFileSize, xHelpPackage );
+ break;
+ }
+
+ case END_REACHED:
VOS_ENSURE( false, "DataBaseIterator::nextTreeFile(): Invalid case END_REACHED" );
break;
}
diff --git a/xmlhelp/source/treeview/tvread.hxx b/xmlhelp/source/treeview/tvread.hxx
index 907568815568..7cc3887448be 100644
--- a/xmlhelp/source/treeview/tvread.hxx
+++ b/xmlhelp/source/treeview/tvread.hxx
@@ -328,6 +328,7 @@ namespace treeview {
{
USER_EXTENSIONS,
SHARED_EXTENSIONS,
+ BUNDLED_EXTENSIONS,
END_REACHED
};
@@ -347,6 +348,9 @@ namespace treeview {
( com::sun::star::uno::Reference< com::sun::star::deployment::XPackage >& o_xParentPackageBundle );
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > implGetNextSharedHelpPackage
( com::sun::star::uno::Reference< com::sun::star::deployment::XPackage >& o_xParentPackageBundle );
+ com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > implGetNextBundledHelpPackage
+ ( com::sun::star::uno::Reference< com::sun::star::deployment::XPackage >& o_xParentPackageBundle );
+
void implGetLanguageVectorFromPackage( ::std::vector< ::rtl::OUString > &rv,
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > xPackage );
@@ -365,8 +369,13 @@ namespace treeview {
< com::sun::star::deployment::XPackage > > m_aSharedPackagesSeq;
bool m_bSharedPackagesLoaded;
+ com::sun::star::uno::Sequence< com::sun::star::uno::Reference
+ < com::sun::star::deployment::XPackage > > m_aBundledPackagesSeq;
+ bool m_bBundledPackagesLoaded;
+
int m_iUserPackage;
int m_iSharedPackage;
+ int m_iBundledPackage;
}; // end class ExtensionIteratorBase
diff --git a/xmlhelp/util/exports.map b/xmlhelp/util/exports.map
deleted file mode 100644
index 14a2531f23ad..000000000000
--- a/xmlhelp/util/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-VERS_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/xmlhelp/util/makefile.mk b/xmlhelp/util/makefile.mk
index e6cd48d34c52..10206670b5f8 100644
--- a/xmlhelp/util/makefile.mk
+++ b/xmlhelp/util/makefile.mk
@@ -50,7 +50,7 @@ CFLAGS+=-GR
SHL1TARGET=$(TARGET)$(UCP_VERSION)
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# Add additional libs here.
SHL1STDLIBS= \
diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk
index 5a13d5053f93..8ebf82b5cf4d 100644
--- a/xmloff/Library_xo.mk
+++ b/xmloff/Library_xo.mk
@@ -347,7 +347,6 @@ $(eval $(call gb_Library_add_exception_objects,xo,\
xmloff/source/core/xmltoken \
xmloff/source/core/xmlerror \
xmloff/source/core/nmspmap \
- xmloff/source/core/xmlkywd \
xmloff/source/core/xmluconv \
xmloff/source/core/XMLBase64Export \
xmloff/source/core/DomExport \
diff --git a/xmloff/inc/RDFaExportHelper.hxx b/xmloff/inc/RDFaExportHelper.hxx
index 9dd23e230e01..f8e991060eea 100644
--- a/xmloff/inc/RDFaExportHelper.hxx
+++ b/xmloff/inc/RDFaExportHelper.hxx
@@ -53,8 +53,6 @@ private:
::com::sun::star::uno::Reference<
::com::sun::star::rdf::XDocumentRepository> m_xRepository;
- ::rtl::OUString m_RDFsLabel;
-
typedef ::std::map< ::rtl::OUString, ::rtl::OUString >
BlankNodeMap_t;
diff --git a/xmloff/inc/RDFaImportHelper.hxx b/xmloff/inc/RDFaImportHelper.hxx
index 600a8a084cf2..030e1a840b9b 100644
--- a/xmloff/inc/RDFaImportHelper.hxx
+++ b/xmloff/inc/RDFaImportHelper.hxx
@@ -28,10 +28,12 @@
#ifndef RDFAIMPORTHELPER_HXX
#define RDFAIMPORTHELPER_HXX
-#include <com/sun/star/uno/Reference.h>
-
#include <vector>
+#include <boost/shared_ptr.hpp>
+
+#include <com/sun/star/uno/Reference.h>
+
namespace rtl { class OUString; }
@@ -46,6 +48,7 @@ class SvXMLImport;
namespace xmloff {
struct RDFaEntry;
+struct ParsedRDFaAttributes;
class SAL_DLLPRIVATE RDFaImportHelper
{
@@ -65,10 +68,23 @@ public:
~RDFaImportHelper();
- /** Add a RDFa statement; parameters are XML attribute values */
+ /** Parse RDFa attributes */
+ ::boost::shared_ptr<ParsedRDFaAttributes> ParseRDFa(
+ ::rtl::OUString const & i_rAbout,
+ ::rtl::OUString const & i_rProperty,
+ ::rtl::OUString const & i_rContent,
+ ::rtl::OUString const & i_rDatatype);
+
+ /** Add a RDFa statement; must have been parsed with ParseRDFa */
void AddRDFa(
::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable>
- i_xObject,
+ const & i_xObject,
+ ::boost::shared_ptr<ParsedRDFaAttributes> & i_pRDFaAttributes);
+
+ /** Parse and add a RDFa statement; parameters are XML attribute values */
+ void ParseAndAddRDFa(
+ ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable>
+ const & i_xObject,
::rtl::OUString const & i_rAbout,
::rtl::OUString const & i_rProperty,
::rtl::OUString const & i_rContent,
diff --git a/xmloff/inc/SchXMLExport.hxx b/xmloff/inc/SchXMLExport.hxx
index d6227754a5f2..49a471a31729 100644
--- a/xmloff/inc/SchXMLExport.hxx
+++ b/xmloff/inc/SchXMLExport.hxx
@@ -81,7 +81,7 @@ public:
void SetProgress( sal_Int32 nPercentage );
- UniReference< XMLPropertySetMapper > GetPropertySetMapper() const { return maExportHelper.GetPropertySetMapper(); }
+ UniReference< XMLPropertySetMapper > GetPropertySetMapper() const;
// XServiceInfo ( : SvXMLExport )
virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
diff --git a/xmloff/inc/SchXMLImport.hxx b/xmloff/inc/SchXMLImport.hxx
index 858371a1805b..7168b2b811a8 100644
--- a/xmloff/inc/SchXMLImport.hxx
+++ b/xmloff/inc/SchXMLImport.hxx
@@ -69,6 +69,8 @@ enum SchXMLChartElemTokenMap
enum SchXMLPlotAreaElemTokenMap
{
+ XML_TOK_PA_COORDINATE_REGION_EXT,
+ XML_TOK_PA_COORDINATE_REGION,
XML_TOK_PA_AXIS,
XML_TOK_PA_SERIES,
XML_TOK_PA_WALL,
diff --git a/xmloff/inc/xmloff/SchXMLExportHelper.hxx b/xmloff/inc/xmloff/SchXMLExportHelper.hxx
index 64f579a7c252..bf60d44d63fd 100644
--- a/xmloff/inc/xmloff/SchXMLExportHelper.hxx
+++ b/xmloff/inc/xmloff/SchXMLExportHelper.hxx
@@ -40,41 +40,9 @@
#include <queue>
#include <vector>
-namespace com { namespace sun { namespace star {
- namespace chart {
- class XDiagram;
- class XChartDocument;
- struct ChartSeriesAddress;
- }
- namespace chart2 {
- class XDiagram;
- class XChartDocument;
- class XDataSeries;
- namespace data
- {
- class XDataProvider;
- class XDataSequence;
- }
- }
- namespace drawing {
- class XShape;
- class XShapes;
- }
- namespace task {
- class XStatusIndicator;
- }
- namespace frame {
- class XModel;
- }
- namespace xml {
- namespace sax {
- class XAttributeList;
-}}}}}
-
class SvXMLAutoStylePoolP;
-class XMLChartExportPropertyMapper;
class SvXMLExport;
-class XMLPropertyHandlerFactory;
+class SchXMLExportHelper_Impl;
/** With this class you can export a <chart:chart> element containing
its data as <table:table> element or without internal table. In
@@ -84,153 +52,22 @@ class XMLPropertyHandlerFactory;
class XMLOFF_DLLPUBLIC SchXMLExportHelper : public UniRefBase
{
public:
- // first: data sequence for label, second: data sequence for values.
- typedef ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >,
- ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > > tLabelValuesDataPair;
- typedef ::std::vector< tLabelValuesDataPair > tDataSequenceCont;
-
-private:
- SvXMLExport& mrExport;
- SvXMLAutoStylePoolP& mrAutoStylePool;
- UniReference< XMLPropertyHandlerFactory > mxPropertyHandlerFactory;
- UniReference< XMLPropertySetMapper > mxPropertySetMapper;
- UniReference< XMLChartExportPropertyMapper > mxExpPropMapper;
-
- rtl::OUString msTableName;
- rtl::OUStringBuffer msStringBuffer;
- rtl::OUString msString;
-
- // members filled by InitRangeSegmentationProperties (retrieved from DataProvider)
- sal_Bool mbHasSeriesLabels;
- sal_Bool mbHasCategoryLabels; //if the categories are only automatically generated this will be false
- sal_Bool mbRowSourceColumns;
- rtl::OUString msChartAddress;
- rtl::OUString msTableNumberList;
- ::com::sun::star::uno::Sequence< sal_Int32 > maSequenceMapping;
-
- rtl::OUString msCLSID;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxAdditionalShapes;
-
- tDataSequenceCont m_aDataSequencesToExport;
- rtl::OUString maCategoriesRange;
-
- /** first parseDocument: collect autostyles and store names in this queue
- second parseDocument: export content and use names from this queue
- */
- ::std::queue< ::rtl::OUString > maAutoStyleNameQueue;
- SAL_DLLPRIVATE void CollectAutoStyle(
- const std::vector< XMLPropertyState >& aStates );
- SAL_DLLPRIVATE void AddAutoStyleAttribute(
- const std::vector< XMLPropertyState >& aStates );
-
- SAL_DLLPRIVATE SvXMLAutoStylePoolP& GetAutoStylePoolP()
- { return mrAutoStylePool; }
-
- /// if bExportContent is false the auto-styles are collected
- SAL_DLLPRIVATE void parseDocument( com::sun::star::uno::Reference<
- com::sun::star::chart::XChartDocument >& rChartDoc,
- sal_Bool bExportContent,
- sal_Bool bIncludeTable = sal_False );
- SAL_DLLPRIVATE void exportTable();
- SAL_DLLPRIVATE void exportPlotArea(
- com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
- com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram,
- const ::com::sun::star::awt::Size & rPageSize,
- sal_Bool bExportContent,
- sal_Bool bIncludeTable );
- SAL_DLLPRIVATE void exportAxes( const com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > & xDiagram,
- const com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > & xNewDiagram,
- sal_Bool bExportContent );
-
- SAL_DLLPRIVATE void exportSeries(
- const com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > & xNewDiagram,
- const ::com::sun::star::awt::Size & rPageSize,
- sal_Bool bExportContent,
- sal_Bool bHasTwoYAxes );
- SAL_DLLPRIVATE void exportCandleStickSeries(
- const ::com::sun::star::uno::Sequence<
- ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XDataSeries > > & aSeriesSeq,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XDiagram > & xDiagram,
- sal_Bool bJapaneseCandleSticks,
- sal_Bool bExportContent );
- SAL_DLLPRIVATE void exportDataPoints(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet > & xSeriesProperties,
- sal_Int32 nSeriesLength,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XDiagram > & xDiagram,
- sal_Bool bExportContent );
- SAL_DLLPRIVATE void exportRegressionCurve(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XDataSeries > & xSeries,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet > & xSeriesProp,
- const ::com::sun::star::awt::Size & rPageSize,
- sal_Bool bExportContent );
-
- /// add svg position as attribute for current element
- SAL_DLLPRIVATE void addPosition( const ::com::sun::star::awt::Point & rPosition );
- SAL_DLLPRIVATE void addPosition( com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape );
- /// add svg size as attribute for current element
- SAL_DLLPRIVATE void addSize( const ::com::sun::star::awt::Size & rSize );
- SAL_DLLPRIVATE void addSize( com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape );
- /// fills the member msString with the appropriate String (i.e. "A3")
- SAL_DLLPRIVATE void getCellAddress( sal_Int32 nCol, sal_Int32 nRow );
- /// exports a string as a paragraph element
- SAL_DLLPRIVATE void exportText( const ::rtl::OUString& rText, bool bConvertTabsLFs = false );
- SAL_DLLPRIVATE void exportErrorBarRanges();
-
- SAL_DLLPRIVATE SchXMLExportHelper(SchXMLExportHelper &); // not defined
- SAL_DLLPRIVATE void operator =(SchXMLExportHelper &); // not defined
-
-public:
SchXMLExportHelper( SvXMLExport& rExport,
SvXMLAutoStylePoolP& rASPool );
virtual ~SchXMLExportHelper();
- // auto-styles
- /// parse chart and collect all auto-styles used in current pool
- void collectAutoStyles( com::sun::star::uno::Reference<
- com::sun::star::chart::XChartDocument > rChartDoc );
- /// write the styles collected into the current pool as <style:style> elements
- void exportAutoStyles();
-
- /** export the <chart:chart> element corresponding to rChartDoc
- if bIncludeTable is true, the chart data is exported as <table:table>
- element (inside the chart element).
-
- Otherwise the external references stored in the chart document are used
- for writing the corresponding attributes at series
-
- All attributes contained in xAttrList are written at the chart element,
- which ist the outer element of a chart. So these attributes can easily
- be parsed again by the container
- */
- void exportChart( com::sun::star::uno::Reference<
- com::sun::star::chart::XChartDocument > rChartDoc,
- sal_Bool bIncludeTable );
-
/// returns the string corresponding to the current FileFormat CLSID for Chart
const rtl::OUString& getChartCLSID();
- UniReference< XMLPropertySetMapper > GetPropertySetMapper() const { return mxPropertySetMapper; }
-
- void SetChartRangeAddress( const ::rtl::OUString& rAddress )
- { msChartAddress = rAddress; }
- void SetTableNumberList( const ::rtl::OUString& rList )
- { msTableNumberList = rList; }
-
- void InitRangeSegmentationProperties(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XChartDocument > & xChartDoc );
+private:
+ SchXMLExportHelper(); // not defined
+ SchXMLExportHelper(SchXMLExportHelper &); // not defined
+ void operator =(SchXMLExportHelper &); // not defined
- ::com::sun::star::awt::Size getPageSize(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XChartDocument > & xChartDoc ) const;
+private:
+ SchXMLExportHelper_Impl* m_pImpl;
+ friend class SchXMLExport;
};
#endif // _XMLOFF_SCH_XMLEXPORTHELPER_HXX_
diff --git a/xmloff/inc/xmloff/XMLEventExport.hxx b/xmloff/inc/xmloff/XMLEventExport.hxx
index 4a8a8b8d45b5..b0ec63b45b35 100644
--- a/xmloff/inc/xmloff/XMLEventExport.hxx
+++ b/xmloff/inc/xmloff/XMLEventExport.hxx
@@ -73,6 +73,8 @@ class XMLOFF_DLLPUBLIC XMLEventExport
HandlerMap aHandlerMap;
NameMap aNameTranslationMap;
+ bool bExtNamespace;
+
public:
XMLEventExport(SvXMLExport& rExport,
const XMLEventNameTranslation* pTranslationTable = NULL);
@@ -104,6 +106,12 @@ public:
::com::sun::star::container::XNameAccess> & xAccess,
sal_Bool bUseWhitespace = sal_True);
+ /// export the events, but write <officeooo:events> element
+ /// (for new file format additions)
+ void ExportExt( ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameAccess> & xAccess,
+ sal_Bool bUseWhitespace = sal_True);
+
/// export a single event (writes <office:events> element)
void ExportSingleEvent(
::com::sun::star::uno::Sequence<
diff --git a/xmloff/inc/xmloff/shapeexport.hxx b/xmloff/inc/xmloff/shapeexport.hxx
index 1b30658ef89c..e583a208fd83 100644
--- a/xmloff/inc/xmloff/shapeexport.hxx
+++ b/xmloff/inc/xmloff/shapeexport.hxx
@@ -111,7 +111,8 @@ enum XmlShapeType
XmlShapeTypePresPageShape, // "com.sun.star.presentation.PageShape"
XmlShapeTypePresOLE2Shape, // "com.sun.star.presentation.OLE2Shape"
XmlShapeTypePresChartShape, // "com.sun.star.presentation.ChartShape"
- XmlShapeTypePresSheetShape, // "com.sun.star.presentation.OLE2Shape"
+ XmlShapeTypePresSheetShape, // "com.sun.star.presentation.CalcShape"
+ XmlShapeTypePresTableShape, // "com.sun.star.presentation.TableShape"
XmlShapeTypePresOrgChartShape, // "com.sun.star.presentation.OrgChartShape"
XmlShapeTypePresNotesShape, // "com.sun.star.presentation.NotesShape"
XmlShapeTypeHandoutShape, // "com.sun.star.presentation.HandoutShape"
@@ -121,8 +122,9 @@ enum XmlShapeType
XmlShapeTypePresSlideNumberShape, // "com.sun.star.presentation.SlideNumberShape"
XmlShapeTypePresDateTimeShape, // "com.sun.star.presentation.DateTimeShape"
- XmlShapeTypeDrawCustomShape, // "com.sun.star.draw.CustomShape"
- XmlShapeTypeDrawMediaShape, // "com.sun.star.draw.MediaShape"
+ XmlShapeTypeDrawCustomShape, // "com.sun.star.drawing.CustomShape"
+ XmlShapeTypeDrawMediaShape, // "com.sun.star.drawing.MediaShape"
+ XmlShapeTypePresMediaShape, // "com.sun.star.presentation.MediaShape"
XmlShapeTypeDrawTableShape, // "com.sun.star.drawing.TableShape"
@@ -189,6 +191,9 @@ private:
SAL_DLLPRIVATE UniReference< SvXMLExportPropertyMapper > GetPropertySetMapper() const { return mxPropertySetMapper; }
const rtl::OUString msZIndex;
+ const rtl::OUString msPrintable;
+ const rtl::OUString msVisible;
+
const rtl::OUString msEmptyPres;
const rtl::OUString msModel;
const rtl::OUString msStartShape;
diff --git a/xmloff/inc/xmloff/txtimp.hxx b/xmloff/inc/xmloff/txtimp.hxx
index 664e661643d2..20be794308a3 100644
--- a/xmloff/inc/xmloff/txtimp.hxx
+++ b/xmloff/inc/xmloff/txtimp.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _XMLOFF_TEXTIMP_HXX_
-#define _XMLOFF_TEXTIMP_HXX_
+#ifndef XMLOFF_TEXTIMP_HXX
+#define XMLOFF_TEXTIMP_HXX
#include "sal/config.h"
#include "xmloff/dllapi.h"
@@ -33,13 +33,11 @@
#include <com/sun/star/uno/Reference.h>
#include <map>
-#include <vector>
#include <memory>
#include <boost/utility.hpp>
+#include <boost/shared_ptr.hpp>
#include <tools/list.hxx>
-#include <xmloff/xmlictxt.hxx>
-#include <xmloff/xmlimppr.hxx>
#include <xmloff/xmltkmap.hxx>
// xmloff/functional.hxx is obsolete and should be replaced by its comphelper
@@ -47,34 +45,44 @@
#include <comphelper/stl_types.hxx>
#include <xmloff/uniref.hxx>
+
// --> OD 2008-04-25 #refactorlists#
class XMLTextListsHelper;
// <--
-#include <com/sun/star/text/XFormField.hpp>
-
-
+class SvXMLImportContext;
+class SvXMLTokenMap;
+class SvXMLImportPropertyMapper;
+class SvXMLNamespaceMap;
class SvXMLImport;
class SvXMLStylesContext;
class XMLTextListBlockContext;
class SvxXMLListStyleContext;
class XMLPropStyleContext;
class SvI18NMap;
-class SvStringsDtor;
class XMLSectionImportContext;
class XMLFontStylesContext;
template<class A> class XMLPropertyBackpatcher;
class XMLEventsImportContext;
+namespace xmloff {
+ struct ParsedRDFaAttributes;
+}
+
namespace com { namespace sun { namespace star {
-namespace text { class XText; class XTextCursor; class XTextRange; class XTextContent; }
+namespace text {
+ class XText;
+ class XTextCursor;
+ class XTextRange;
+ class XTextContent;
+ class XFormField;
+}
namespace frame { class XModel; }
namespace container { class XNameContainer; class XIndexReplace; class XNameAccess; }
namespace beans { class XPropertySet; }
namespace xml { namespace sax { class XAttributeList; } }
namespace util { struct DateTime; }
namespace lang { class XMultiServiceFactory; }
-namespace ucb { class XAnyCompare; }
} } }
enum SwXMLTextElemTokens
@@ -254,11 +262,11 @@ enum XMLTextPAttrTokens
XML_TOK_TEXT_P_PROPERTY,
XML_TOK_TEXT_P_CONTENT,
XML_TOK_TEXT_P_DATATYPE,
+ XML_TOK_TEXT_P_TEXTID,
XML_TOK_TEXT_P_STYLE_NAME,
XML_TOK_TEXT_P_COND_STYLE_NAME,
XML_TOK_TEXT_P_LEVEL,
XML_TOK_TEXT_P_CLASS_NAMES,
- XML_TOK_TEXT_P_ID,
XML_TOK_TEXT_P_IS_LIST_HEADER,
XML_TOK_TEXT_P_RESTART_NUMBERING,
XML_TOK_TEXT_P_START_VALUE,
@@ -378,127 +386,13 @@ DECLARE_LIST( XMLSectionList_Impl, XMLSectionImportContext* )
class XMLOFF_DLLPUBLIC XMLTextImportHelper : public UniRefBase,
private boost::noncopyable
{
- ::std::auto_ptr<SvXMLTokenMap> pTextElemTokenMap;
- ::std::auto_ptr<SvXMLTokenMap> pTextPElemTokenMap;
- ::std::auto_ptr<SvXMLTokenMap> pTextPAttrTokenMap;
- ::std::auto_ptr<SvXMLTokenMap> pTextFieldAttrTokenMap;
- ::std::auto_ptr<SvXMLTokenMap> pTextNumberedParagraphAttrTokenMap;
- ::std::auto_ptr<SvXMLTokenMap> pTextListBlockAttrTokenMap;
- ::std::auto_ptr<SvXMLTokenMap> pTextListBlockElemTokenMap;
- ::std::auto_ptr<SvXMLTokenMap> pTextFrameAttrTokenMap;
- ::std::auto_ptr<SvXMLTokenMap> pTextContourAttrTokenMap;
- ::std::auto_ptr<SvXMLTokenMap> pTextHyperlinkAttrTokenMap;
- ::std::auto_ptr<SvXMLTokenMap> pTextMasterPageElemTokenMap;
- ::std::auto_ptr<SvStringsDtor> pPrevFrmNames;
- ::std::auto_ptr<SvStringsDtor> pNextFrmNames;
-
- // --> OD 2008-04-25 #refactorlists#
- ::std::auto_ptr<XMLTextListsHelper> mpTextListsHelper;
- // <--
-
- SvXMLImportContextRef xAutoStyles;
- SvXMLImportContextRef xFontDecls;
-
- XMLSectionList_Impl aSectionList;
-
- UniReference < SvXMLImportPropertyMapper > xParaImpPrMap;
- UniReference < SvXMLImportPropertyMapper > xTextImpPrMap;
- UniReference < SvXMLImportPropertyMapper > xFrameImpPrMap;
- UniReference < SvXMLImportPropertyMapper > xSectionImpPrMap;
- UniReference < SvXMLImportPropertyMapper > xRubyImpPrMap;
-
- ::std::auto_ptr<SvI18NMap> pRenameMap;
- // --> OD 2006-10-12 #i69629# - change and extend data structure:
- // - data structure contains candidates of paragraph styles, which
- // will be assigned to the outline style
- // - data structure contains more than one candidate for each list level
- // of the outline style
-// ::rtl::OUString *pOutlineStyles;
- ::std::vector< ::rtl::OUString >* mpOutlineStylesCandidates;
- // <--
-
- /// start ranges for open bookmarks
- ::std::map< ::rtl::OUString,
- // start range, xml:id
- ::std::pair<
- ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XTextRange>,
- ::rtl::OUString>,
- ::comphelper::UStringLess> aBookmarkStartRanges;
-
- typedef ::std::vector< ::rtl::OUString> BookmarkVector_t;
- BookmarkVector_t aBookmarkVector;
-
- /// backpatcher for references to footnotes and endnotes
- XMLPropertyBackpatcher<sal_Int16> * pFootnoteBackpatcher;
-
- /// backpatchers for references to sequences
- XMLPropertyBackpatcher<sal_Int16> * pSequenceIdBackpatcher;
-
- XMLPropertyBackpatcher< ::rtl::OUString> * pSequenceNameBackpatcher;
-
- /// name of the last 'open' redline that started between paragraphs
- ::rtl::OUString sOpenRedlineIdentifier;
-
- ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XText > xText;
- ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextCursor > xCursor;
- ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextRange > xCursorAsRange;
- ::com::sun::star::uno::Reference <
- ::com::sun::star::container::XNameContainer > xParaStyles;
- ::com::sun::star::uno::Reference <
- ::com::sun::star::container::XNameContainer > xTextStyles;
- ::com::sun::star::uno::Reference <
- ::com::sun::star::container::XNameContainer > xNumStyles;
- ::com::sun::star::uno::Reference <
- ::com::sun::star::container::XNameContainer > xFrameStyles;
- ::com::sun::star::uno::Reference <
- ::com::sun::star::container::XNameContainer > xPageStyles;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XIndexReplace > xChapterNumbering;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XNameAccess > xTextFrames;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XNameAccess > xGraphics;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XNameAccess > xObjects;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory;
-
- SvXMLImport& rSvXMLImport;
-
- sal_Bool bInsertMode : 1;
- sal_Bool bStylesOnlyMode : 1;
- sal_Bool bBlockMode : 1;
- sal_Bool bProgress : 1;
- sal_Bool bOrganizerMode : 1;
- sal_Bool bBodyContentStarted : 1;
-
- // #107848#
- // One more flag to remember if we are inside a deleted redline section
- sal_Bool bInsideDeleteContext : 1;
-
- SAL_DLLPRIVATE SvXMLTokenMap *_GetTextElemTokenMap();
- SAL_DLLPRIVATE SvXMLTokenMap *_GetTextPElemTokenMap();
- SAL_DLLPRIVATE SvXMLTokenMap *_GetTextPAttrTokenMap();
- SAL_DLLPRIVATE SvXMLTokenMap *_GetTextFrameAttrTokenMap();
- SAL_DLLPRIVATE SvXMLTokenMap *_GetTextContourAttrTokenMap();
- SAL_DLLPRIVATE SvXMLTokenMap *_GetTextHyperlinkAttrTokenMap();
- SAL_DLLPRIVATE SvXMLTokenMap *_GetTextMasterPageElemTokenMap();
-
- // clean up backpatchers; to be called only by destructor
- // Code is implemented in XMLPropertyBackpatcher.cxx
- SAL_DLLPRIVATE void _FinitBackpatcher();
-
- typedef ::std::pair< ::rtl::OUString, ::rtl::OUString> field_name_type_t;
- typedef ::std::pair< ::rtl::OUString, ::rtl::OUString > field_param_t;
- typedef ::std::vector< field_param_t > field_params_t;
- typedef ::std::pair< field_name_type_t, field_params_t > field_stack_item_t;
- typedef ::std::stack< field_stack_item_t > field_stack_t;
-
- field_stack_t aFieldStack;
+private:
+ struct Impl;
+ ::std::auto_ptr<Impl> m_pImpl;
+ /// ugly, but implementation of this is in XMLPropertyBackpatcher.cxx
+ struct BackpatcherImpl;
+ ::boost::shared_ptr<BackpatcherImpl> m_pBackpatcherImpl;
+ ::boost::shared_ptr<BackpatcherImpl> MakeBackpatcherImpl();
protected:
virtual SvXMLImportContext *CreateTableChildContext(
@@ -515,46 +409,13 @@ protected:
public:
- const ::rtl::OUString sParaStyleName;
- const ::rtl::OUString sCharStyleName;
- const ::rtl::OUString sHeadingStyleName;
- const ::rtl::OUString sNumberingLevel;
- const ::rtl::OUString sNumberingStartValue;
- const ::rtl::OUString sNumberingRules;
- const ::rtl::OUString sParaIsNumberingRestart;
- const ::rtl::OUString sNumberingIsNumber;
- const ::rtl::OUString sCurrentPresentation;
- const ::rtl::OUString sSequenceNumber;
- const ::rtl::OUString sSourceName;
- const ::rtl::OUString sChainNextName;
- const ::rtl::OUString sChainPrevName;
- const ::rtl::OUString sHyperLinkURL;
- const ::rtl::OUString sHyperLinkName;
- const ::rtl::OUString sHyperLinkTarget;
- const ::rtl::OUString sUnvisitedCharStyleName;
- const ::rtl::OUString sVisitedCharStyleName;
- const ::rtl::OUString sTextFrame;
- const ::rtl::OUString sPageDescName;
- const ::rtl::OUString sServerMap;
- const ::rtl::OUString sHyperLinkEvents;
- const ::rtl::OUString sContent;
- const ::rtl::OUString sServiceCombinedCharacters;
- const ::rtl::OUString sNumberingStyleName;
- // --> OD 2008-04-23 #refactorlists#
- const ::rtl::OUString sPropNameDefaultListId;
- const ::rtl::OUString sPropNameListId;
- const ::rtl::OUString sOutlineLevel; //#outline level,add by zhaojianwei
- // <--
-
- ::rtl::OUString sCellParaStyleDefault;
XMLTextImportHelper(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::frame::XModel>& rModel,
+ ::com::sun::star::uno::Reference <
+ ::com::sun::star::frame::XModel> const& rModel,
SvXMLImport& rImport,
- sal_Bool bInsertM = sal_False, sal_Bool bStylesOnlyM = sal_False,
- sal_Bool bProgress = sal_False,
- sal_Bool bBlockMode = sal_False,
- sal_Bool bOrganizerMode = sal_False );
+ bool const bInsertMode = false, bool const bStylesOnlyMode = false,
+ bool const bProgress = false, bool const bBlockMode = false,
+ bool const bOrganizerMode = false);
~XMLTextImportHelper();
@@ -575,36 +436,33 @@ public:
::com::sun::star::xml::sax::XAttributeList > & xAttrList,
XMLTextType eType = XML_TEXT_TYPE_SHAPE );
- inline const SvXMLTokenMap& GetTextElemTokenMap();
- inline const SvXMLTokenMap& GetTextPElemTokenMap();
- inline const SvXMLTokenMap& GetTextPAttrTokenMap();
- inline const SvXMLTokenMap& GetTextFrameAttrTokenMap();
- inline const SvXMLTokenMap& GetTextContourAttrTokenMap();
- inline const SvXMLTokenMap& GetTextHyperlinkAttrTokenMap();
- inline const SvXMLTokenMap& GetTextMasterPageElemTokenMap();
+ SvXMLTokenMap const& GetTextElemTokenMap();
+ SvXMLTokenMap const& GetTextPElemTokenMap();
+ SvXMLTokenMap const& GetTextPAttrTokenMap();
+ SvXMLTokenMap const& GetTextFrameAttrTokenMap();
+ SvXMLTokenMap const& GetTextContourAttrTokenMap();
+ SvXMLTokenMap const& GetTextHyperlinkAttrTokenMap();
+ SvXMLTokenMap const& GetTextMasterPageElemTokenMap();
const SvXMLTokenMap& GetTextNumberedParagraphAttrTokenMap();
const SvXMLTokenMap& GetTextListBlockAttrTokenMap();
const SvXMLTokenMap& GetTextListBlockElemTokenMap();
const SvXMLTokenMap& GetTextFieldAttrTokenMap(); // impl: txtfldi.cxx
- ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XText > & GetText() { return xText; }
- ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextCursor > & GetCursor() { return xCursor; }
- ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextRange > & GetCursorAsRange()
- {
- return xCursorAsRange;
- }
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XText > & GetText();
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XTextCursor > & GetCursor();
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XTextRange > & GetCursorAsRange();
- sal_Bool IsInsertMode() { return bInsertMode; }
- sal_Bool IsStylesOnlyMode() { return bStylesOnlyMode; }
- sal_Bool IsBlockMode() { return bBlockMode; }
- sal_Bool IsOrganizerMode() { return bOrganizerMode; }
- sal_Bool IsProgress() { return bProgress; }
+ bool IsInsertMode() const;
+ bool IsStylesOnlyMode() const;
+ bool IsBlockMode() const;
+ bool IsOrganizerMode() const;
+ bool IsProgress() const;
- XMLSectionList_Impl& GetSectionList() { return aSectionList; }
+ XMLSectionList_Impl & GetSectionList();
::rtl::OUString ConvertStarFonts( const ::rtl::OUString& rChars,
const ::rtl::OUString& rStyleName,
@@ -686,41 +544,25 @@ public:
XMLPropStyleContext* FindPageMaster(
const ::rtl::OUString& rName ) const;
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::container::XNameContainer>& GetParaStyles() const
- {
- return xParaStyles;
- }
-
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::container::XNameContainer>& GetTextStyles() const
- {
- return xTextStyles;
- }
-
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::container::XNameContainer>& GetNumberingStyles() const
- {
- return xNumStyles;
- }
-
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::container::XNameContainer>& GetFrameStyles() const
- {
- return xFrameStyles;
- }
-
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::container::XNameContainer>& GetPageStyles() const
- {
- return xPageStyles;
- }
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameContainer> & GetParaStyles() const;
+
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameContainer> & GetTextStyles() const;
+
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameContainer> &
+ GetNumberingStyles() const;
const ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XIndexReplace >& GetChapterNumbering() const
- {
- return xChapterNumbering;
- }
+ ::com::sun::star::container::XNameContainer> & GetFrameStyles() const;
+
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameContainer> & GetPageStyles() const;
+
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XIndexReplace > &
+ GetChapterNumbering() const;
sal_Bool HasFrameByName( const ::rtl::OUString& rName ) const;
void ConnectFrameChains( const ::rtl::OUString& rFrmName,
@@ -728,16 +570,17 @@ public:
const ::com::sun::star::uno::Reference <
::com::sun::star::beans::XPropertySet >& rFrmPropSet );
- const UniReference < SvXMLImportPropertyMapper >&
- GetParaImportPropertySetMapper() const { return xParaImpPrMap; }
- const UniReference < SvXMLImportPropertyMapper >&
- GetTextImportPropertySetMapper() const { return xTextImpPrMap; }
- const UniReference < SvXMLImportPropertyMapper >&
- GetFrameImportPropertySetMapper() const { return xFrameImpPrMap; }
- const UniReference < SvXMLImportPropertyMapper >&
- GetSectionImportPropertySetMapper() const { return xSectionImpPrMap; }
- const UniReference < SvXMLImportPropertyMapper >&
- GetRubyImportPropertySetMapper() const { return xRubyImpPrMap; }
+ UniReference< SvXMLImportPropertyMapper > const&
+ GetParaImportPropertySetMapper() const;
+ UniReference< SvXMLImportPropertyMapper > const&
+ GetTextImportPropertySetMapper() const;
+ UniReference< SvXMLImportPropertyMapper > const&
+ GetFrameImportPropertySetMapper() const;
+ UniReference< SvXMLImportPropertyMapper > const&
+ GetSectionImportPropertySetMapper() const;
+ UniReference< SvXMLImportPropertyMapper > const&
+ GetRubyImportPropertySetMapper() const;
+
static SvXMLImportPropertyMapper *CreateShapeExtPropMapper(SvXMLImport&);
static SvXMLImportPropertyMapper *CreateCharExtPropMapper(SvXMLImport&, XMLFontStylesContext *pFontDecls = NULL);
static SvXMLImportPropertyMapper *CreateParaExtPropMapper(SvXMLImport&, XMLFontStylesContext *pFontDecls = NULL);
@@ -757,14 +600,18 @@ public:
const ::rtl::OUString sName,
const ::com::sun::star::uno::Reference<
::com::sun::star::text::XTextRange> & rRange,
- const ::rtl::OUString & i_rXmlId);
+ ::rtl::OUString const& i_rXmlId,
+ ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > &
+ i_rpRDFaAttributes);
/// process the start of a range reference
sal_Bool FindAndRemoveBookmarkStartRange(
const ::rtl::OUString sName,
::com::sun::star::uno::Reference<
::com::sun::star::text::XTextRange> & o_rRange,
- ::rtl::OUString& o_rXmlId);
+ ::rtl::OUString & o_rXmlId,
+ ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > &
+ o_rpRDFaAttributes);
::rtl::OUString FindActiveBookmarkName();
::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > GetRangeFor(::rtl::OUString &sName);
@@ -889,13 +736,13 @@ public:
// #107848#
// Access methods to the inside_deleted_section flag (redlining)
- void SetInsideDeleteContext(sal_Bool bNew) { bInsideDeleteContext = bNew; }
- sal_Bool IsInsideDeleteContext() const { return bInsideDeleteContext; }
+ void SetInsideDeleteContext(bool const bNew);
+ bool IsInsideDeleteContext() const;
- SvXMLImport& GetXMLImport() { return rSvXMLImport;}
+ SvXMLImport & GetXMLImport();
// --> OD 2008-04-25 #refactorlists#
- XMLTextListsHelper& GetTextListHelper() { return *mpTextListsHelper; }
+ XMLTextListsHelper & GetTextListHelper();
// <--
// forwards to TextListHelper; these are used in many places
@@ -903,62 +750,9 @@ public:
void PushListContext(XMLTextListBlockContext *i_pListBlock = 0);
/// pop the list context stack
void PopListContext();
-};
-
-inline const SvXMLTokenMap& XMLTextImportHelper::GetTextElemTokenMap()
-{
- if( !pTextElemTokenMap.get() )
- pTextElemTokenMap.reset( _GetTextElemTokenMap() );
-
- return *pTextElemTokenMap;
-}
-
-inline const SvXMLTokenMap& XMLTextImportHelper::GetTextPElemTokenMap()
-{
- if( !pTextPElemTokenMap.get() )
- pTextPElemTokenMap.reset( _GetTextPElemTokenMap() );
-
- return *pTextPElemTokenMap;
-}
-
-inline const SvXMLTokenMap& XMLTextImportHelper::GetTextPAttrTokenMap()
-{
- if( !pTextPAttrTokenMap.get() )
- pTextPAttrTokenMap.reset( _GetTextPAttrTokenMap() );
-
- return *pTextPAttrTokenMap;
-}
-
-inline const SvXMLTokenMap& XMLTextImportHelper::GetTextFrameAttrTokenMap()
-{
- if( !pTextFrameAttrTokenMap.get() )
- pTextFrameAttrTokenMap.reset( _GetTextFrameAttrTokenMap() );
-
- return *pTextFrameAttrTokenMap;
-}
-
-inline const SvXMLTokenMap& XMLTextImportHelper::GetTextContourAttrTokenMap()
-{
- if( !pTextContourAttrTokenMap.get() )
- pTextContourAttrTokenMap.reset( _GetTextContourAttrTokenMap() );
-
- return *pTextContourAttrTokenMap;
-}
-inline const SvXMLTokenMap& XMLTextImportHelper::GetTextHyperlinkAttrTokenMap()
-{
- if( !pTextHyperlinkAttrTokenMap.get() )
- pTextHyperlinkAttrTokenMap.reset( _GetTextHyperlinkAttrTokenMap() );
-
- return *pTextHyperlinkAttrTokenMap;
-}
-
-inline const SvXMLTokenMap& XMLTextImportHelper::GetTextMasterPageElemTokenMap()
-{
- if( !pTextMasterPageElemTokenMap.get() )
- pTextMasterPageElemTokenMap.reset( _GetTextMasterPageElemTokenMap() );
-
- return *pTextMasterPageElemTokenMap;
-}
+ void SetCellParaStyleDefault(::rtl::OUString const& rNewValue);
+ ::rtl::OUString const& GetCellParaStyleDefault();
+};
#endif
diff --git a/xmloff/inc/xmloff/xmlexp.hxx b/xmloff/inc/xmloff/xmlexp.hxx
index 0459fcc7b13a..03903f38a331 100644
--- a/xmloff/inc/xmloff/xmlexp.hxx
+++ b/xmloff/inc/xmloff/xmlexp.hxx
@@ -590,6 +590,12 @@ public:
/// name of stream in package, e.g., "content.xml"
::rtl::OUString GetStreamName() const;
+ // FIXME: this is only for legacy stuff that has not yet been adapted
+ // to implement XMetadatable; this can write duplicate IDs!
+ /// add xml:id and legacy namespace id
+ void SAL_DLLPRIVATE AddAttributeIdLegacy(
+ sal_uInt16 const nLegacyPrefix, ::rtl::OUString const& rValue);
+
/// add xml:id attribute (for RDF metadata)
void AddAttributeXmlId(::com::sun::star::uno::Reference<
::com::sun::star::uno::XInterface> const & i_xIfc);
diff --git a/xmloff/inc/xmloff/xmlimp.hxx b/xmloff/inc/xmloff/xmlimp.hxx
index 44e5357ebbdd..871703bf9ed7 100644
--- a/xmloff/inc/xmloff/xmlimp.hxx
+++ b/xmloff/inc/xmloff/xmlimp.hxx
@@ -77,6 +77,10 @@ class XMLErrors;
class StyleMap;
class String;
+namespace xmloff {
+ class RDFaImportHelper;
+}
+
#define IMPORT_META 0x0001
#define IMPORT_STYLES 0x0002
#define IMPORT_MASTERSTYLES 0x0004
@@ -432,6 +436,9 @@ public:
::rtl::OUString const & i_rContent,
::rtl::OUString const & i_rDatatype);
+ /// do not dllexport this; only for advanced cases (bookmark-start)
+ SAL_DLLPRIVATE ::xmloff::RDFaImportHelper & GetRDFaImportHelper();
+
// #i31958# XForms helper method
// (to be implemented by applications suporting XForms)
virtual void initXForms();
diff --git a/xmloff/inc/xmloff/xmlnmspe.hxx b/xmloff/inc/xmloff/xmlnmspe.hxx
index 49c484a1ab17..7b7b7e131ec7 100644
--- a/xmloff/inc/xmloff/xmlnmspe.hxx
+++ b/xmloff/inc/xmloff/xmlnmspe.hxx
@@ -87,8 +87,10 @@ const sal_uInt16 XML_NAMESPACE_##prefix##_EXT_IDX = key;
XML_NAMESPACE_EXT( OFFICE, 37U )
XML_NAMESPACE_EXT( TABLE, 38U )
+XML_NAMESPACE_EXT( CHART, 39U )
+XML_NAMESPACE_EXT( DRAW, 40U )
-#define _XML_OLD_NAMESPACE_BASE 39U
+#define _XML_OLD_NAMESPACE_BASE 41U
// namespaces used in the technical preview (SO 5.2)
XML_OLD_NAMESPACE( FO, 0U )
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index 82dc69e59ee3..d892c10f4f5d 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -148,6 +148,9 @@ namespace xmloff { namespace token {
XML_NP_TABLE_EXT,
XML_N_TABLE_EXT,
+ XML_NP_DRAW_EXT,
+ XML_N_DRAW_EXT,
+
// units
XML_UNIT_MM,
XML_UNIT_M,
@@ -1705,6 +1708,7 @@ namespace xmloff { namespace token {
XML_SYMBOL_IMAGE_NAME,
XML_SYMBOL_WIDTH,
XML_SYSTEM,
+ XML_TAB_COLOR,
XML_TAB_STOP,
XML_TAB_STOP_DISTANCE,
XML_TAB_STOPS,
@@ -2548,6 +2552,9 @@ namespace xmloff { namespace token {
XML_DIMENSION,
XML_VALIDATION_NAME,
+ XML_SCREEN,
+ XML_PRINTER,
+
// XForms tokens
// already defined: XML_ACTION, XML_VERSION, XML_ENCODING,
// XML_REPLACE, XML_SEPARATOR, XML_TYPE, XML_ID
@@ -3095,6 +3102,11 @@ namespace xmloff { namespace token {
XML_ENDS_WITH,
XML_DOES_NOT_END_WITH,
+ //chart
+ XML_NP_CHART_EXT,
+ XML_N_CHART_EXT,
+ XML_COORDINATE_REGION,
+
XML_TOKEN_END
};
diff --git a/xmloff/qa/unoapi/Test.java b/xmloff/qa/unoapi/Test.java
new file mode 100644
index 000000000000..d66144f108e7
--- /dev/null
+++ b/xmloff/qa/unoapi/Test.java
@@ -0,0 +1,51 @@
+/*************************************************************************
+* 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.
+************************************************************************/
+
+package org.openoffice.xmloff.qa.unoapi;
+
+import org.openoffice.Runner;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+public final class Test {
+ @org.junit.Before public void setUp() throws Exception {
+ connection.setUp();
+ }
+
+ @org.junit.After public void tearDown()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ connection.tearDown();
+ }
+
+ @org.junit.Test public void test() {
+ assertTrue(
+ Runner.run(
+ "-sce", "xmloff.sce", "-xcl", "knownissues.xcl", "-tdoc",
+ "testdocuments", "-cs", connection.getDescription()));
+ }
+
+ private final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/xmloff/qa/unoapi/knownissues.xcl b/xmloff/qa/unoapi/knownissues.xcl
index 401d33d9a889..ac15aad11e71 100644
--- a/xmloff/qa/unoapi/knownissues.xcl
+++ b/xmloff/qa/unoapi/knownissues.xcl
@@ -10,17 +10,6 @@ xmloff.Impress.XMLImporter::com::sun::star::xml::sax::XDocumentHandler
xmloff.Impress.XMLMetaImporter::com::sun::star::xml::sax::XDocumentHandler
xmloff.Impress.XMLStylesImporter::com::sun::star::xml::sax::XDocumentHandler
-### i86555 ###
-xmloff.Chart.XMLExporter::com::sun::star::document::XFilter
-xmloff.Chart.XMLContentExporter::com::sun::star::document::XFilter
-xmloff.Impress.XMLSettingsExporter::com::sun::star::document::XFilter
-xmloff.Impress.XMLMetaExporter::com::sun::star::document::XFilter
-xmloff.Impress.XMLImporter::com::sun::star::document::XFilter
-xmloff.Impress.XMLExporter::com::sun::star::document::XFilter
-xmloff.Draw.XMLContentExporter::com::sun::star::document::XFilter
-xmloff.Draw.XMLMetaExporter::com::sun::star::document::XFilter
-xmloff.Draw.XMLSettingsImporter::com::sun::star::document::XFilter
-
### i87695 ###
xmloff.Draw.XMLStylesExporter
xmloff.Impress.XMLStylesExporter
diff --git a/xmloff/qa/unoapi/makefile.mk b/xmloff/qa/unoapi/makefile.mk
index 0b8d1ebf9228..3cbbc5f2a797 100644
--- a/xmloff/qa/unoapi/makefile.mk
+++ b/xmloff/qa/unoapi/makefile.mk
@@ -1,7 +1,6 @@
#*************************************************************************
-#
# 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
@@ -22,19 +21,28 @@
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
+#***********************************************************************/
-PRJ=..$/..
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-PRJNAME=xmloff
-TARGET=qa_unoapi
+PRJ = ../..
+PRJNAME = xmloff
+TARGET = qa_unoapi
-.INCLUDE: settings.mk
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/xmloff/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-ALLTAR : UNOAPI_TEST
+ALLTAR : javatest
-UNOAPI_TEST:
- +$(SOLARENV)$/bin$/checkapi -sce xmloff.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments
+.END
diff --git a/xmloff/qa/unoapi/xmloff.sce b/xmloff/qa/unoapi/xmloff.sce
index aa61a2449680..69166aec6204 100644
--- a/xmloff/qa/unoapi/xmloff.sce
+++ b/xmloff/qa/unoapi/xmloff.sce
@@ -1,26 +1,26 @@
--o xmloff.Chart.XMLContentExporter
--o xmloff.Chart.XMLContentImporter
--o xmloff.Chart.XMLExporter
--o xmloff.Chart.XMLImporter
--o xmloff.Chart.XMLStylesExporter
--o xmloff.Chart.XMLStylesImporter
+#111102# -o xmloff.Chart.XMLContentExporter
+#111102# -o xmloff.Chart.XMLContentImporter
+#111102# -o xmloff.Chart.XMLExporter
+#111102# -o xmloff.Chart.XMLImporter
+#111102# -o xmloff.Chart.XMLStylesExporter
+#111102# #i112047 -o xmloff.Chart.XMLStylesImporter
-o xmloff.Draw.XMLContentExporter
-o xmloff.Draw.XMLContentImporter
-o xmloff.Draw.XMLExporter
-o xmloff.Draw.XMLImporter
-o xmloff.Draw.XMLMetaExporter
--o xmloff.Draw.XMLMetaImporter
--o xmloff.Draw.XMLSettingsExporter
--o xmloff.Draw.XMLSettingsImporter
+#i111200 -o xmloff.Draw.XMLMetaImporter
+#i111287 -o xmloff.Draw.XMLSettingsExporter
+#i111287 -o xmloff.Draw.XMLSettingsImporter
#i87695 -o xmloff.Draw.XMLStylesExporter
-o xmloff.Draw.XMLStylesImporter
--o xmloff.Impress.XMLContentExporter
+#i111224 -o xmloff.Impress.XMLContentExporter
-o xmloff.Impress.XMLContentImporter
--o xmloff.Impress.XMLExporter
--o xmloff.Impress.XMLImporter
+#i112048 -o xmloff.Impress.XMLExporter
+#i111111# -o xmloff.Impress.XMLImporter
-o xmloff.Impress.XMLMetaExporter
-o xmloff.Impress.XMLMetaImporter
--o xmloff.Impress.XMLSettingsExporter
--o xmloff.Impress.XMLSettingsImporter
+#i111287 -o xmloff.Impress.XMLSettingsExporter
+#i111287 -o xmloff.Impress.XMLSettingsImporter
#i87695 -o xmloff.Impress.XMLStylesExporter
-o xmloff.Impress.XMLStylesImporter
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index c9d7a13d3cc5..38ac4d12ae44 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -41,9 +41,7 @@
#include <tools/globname.hxx>
#include <sot/clsids.hxx>
-#ifndef _SVTOOLS_NMSPMAP_HXX
#include <xmloff/nmspmap.hxx>
-#endif
#include "xmloff/xmlnmspe.hxx"
#include <xmloff/xmltoken.hxx>
#include <xmloff/families.hxx>
@@ -78,6 +76,7 @@
#include <com/sun/star/chart/X3DDisplay.hpp>
#include <com/sun/star/chart/XStatisticDisplay.hpp>
#include <com/sun/star/chart/XSecondAxisTitleSupplier.hpp>
+#include <com/sun/star/chart/XDiagramPositioning.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
@@ -118,6 +117,161 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Any;
using ::std::vector;
+// ========================================
+// class SchXMLExportHelper_Impl
+// ========================================
+
+class SchXMLExportHelper_Impl
+{
+public:
+ // first: data sequence for label, second: data sequence for values.
+ typedef ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >,
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > > tLabelValuesDataPair;
+ typedef ::std::vector< tLabelValuesDataPair > tDataSequenceCont;
+
+public:
+ SchXMLExportHelper_Impl( SvXMLExport& rExport,
+ SvXMLAutoStylePoolP& rASPool );
+
+ virtual ~SchXMLExportHelper_Impl();
+
+ // auto-styles
+ /// parse chart and collect all auto-styles used in current pool
+ void collectAutoStyles( com::sun::star::uno::Reference<
+ com::sun::star::chart::XChartDocument > rChartDoc );
+
+ /// write the styles collected into the current pool as <style:style> elements
+ void exportAutoStyles();
+
+ /** export the <chart:chart> element corresponding to rChartDoc
+ if bIncludeTable is true, the chart data is exported as <table:table>
+ element (inside the chart element).
+
+ Otherwise the external references stored in the chart document are used
+ for writing the corresponding attributes at series
+
+ All attributes contained in xAttrList are written at the chart element,
+ which ist the outer element of a chart. So these attributes can easily
+ be parsed again by the container
+ */
+ void exportChart( com::sun::star::uno::Reference<
+ com::sun::star::chart::XChartDocument > rChartDoc,
+ sal_Bool bIncludeTable );
+
+ UniReference< XMLPropertySetMapper > GetPropertySetMapper() const;
+
+ void SetChartRangeAddress( const ::rtl::OUString& rAddress )
+ { msChartAddress = rAddress; }
+ void SetTableNumberList( const ::rtl::OUString& rList )
+ { msTableNumberList = rList; }
+
+ void InitRangeSegmentationProperties(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartDocument > & xChartDoc );
+
+ ::com::sun::star::awt::Size getPageSize(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartDocument > & xChartDoc ) const;
+
+ /** first parseDocument: collect autostyles and store names in this queue
+ second parseDocument: export content and use names from this queue
+ */
+ ::std::queue< ::rtl::OUString > maAutoStyleNameQueue;
+ void CollectAutoStyle(
+ const std::vector< XMLPropertyState >& aStates );
+ void AddAutoStyleAttribute(
+ const std::vector< XMLPropertyState >& aStates );
+
+ SvXMLAutoStylePoolP& GetAutoStylePoolP()
+ { return mrAutoStylePool; }
+
+ /// if bExportContent is false the auto-styles are collected
+ void parseDocument( com::sun::star::uno::Reference<
+ com::sun::star::chart::XChartDocument >& rChartDoc,
+ sal_Bool bExportContent,
+ sal_Bool bIncludeTable = sal_False );
+ void exportTable();
+ void exportPlotArea(
+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram,
+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram,
+ const ::com::sun::star::awt::Size & rPageSize,
+ sal_Bool bExportContent,
+ sal_Bool bIncludeTable );
+ void exportCoordinateRegion( const com::sun::star::uno::Reference< com::sun::star::chart::XDiagram >& xDiagram );
+ void exportAxes( const com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > & xDiagram,
+ const com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > & xNewDiagram,
+ sal_Bool bExportContent );
+
+ void exportSeries(
+ const com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > & xNewDiagram,
+ const ::com::sun::star::awt::Size & rPageSize,
+ sal_Bool bExportContent,
+ sal_Bool bHasTwoYAxes );
+ void exportCandleStickSeries(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDataSeries > > & aSeriesSeq,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDiagram > & xDiagram,
+ sal_Bool bJapaneseCandleSticks,
+ sal_Bool bExportContent );
+ void exportDataPoints(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > & xSeriesProperties,
+ sal_Int32 nSeriesLength,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDiagram > & xDiagram,
+ sal_Bool bExportContent );
+ void exportRegressionCurve(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDataSeries > & xSeries,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > & xSeriesProp,
+ const ::com::sun::star::awt::Size & rPageSize,
+ sal_Bool bExportContent );
+
+ /// add svg position as attribute for current element
+ void addPosition( const ::com::sun::star::awt::Point & rPosition );
+ void addPosition( com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape );
+ /// add svg size as attribute for current element
+ void addSize( const ::com::sun::star::awt::Size & rSize );
+ void addSize( com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape );
+ /// fills the member msString with the appropriate String (i.e. "A3")
+ void getCellAddress( sal_Int32 nCol, sal_Int32 nRow );
+ /// exports a string as a paragraph element
+ void exportText( const ::rtl::OUString& rText, bool bConvertTabsLFs = false );
+ void exportErrorBarRanges();
+
+ SchXMLExportHelper_Impl(SchXMLExportHelper_Impl &); // not defined
+ void operator =(SchXMLExportHelper_Impl &); // not defined
+
+public:
+ SvXMLExport& mrExport;
+ SvXMLAutoStylePoolP& mrAutoStylePool;
+ UniReference< XMLPropertyHandlerFactory > mxPropertyHandlerFactory;
+ UniReference< XMLPropertySetMapper > mxPropertySetMapper;
+ UniReference< XMLChartExportPropertyMapper > mxExpPropMapper;
+
+ rtl::OUString msTableName;
+ rtl::OUStringBuffer msStringBuffer;
+ rtl::OUString msString;
+
+ // members filled by InitRangeSegmentationProperties (retrieved from DataProvider)
+ sal_Bool mbHasSeriesLabels;
+ sal_Bool mbHasCategoryLabels; //if the categories are only automatically generated this will be false
+ sal_Bool mbRowSourceColumns;
+ rtl::OUString msChartAddress;
+ rtl::OUString msTableNumberList;
+ ::com::sun::star::uno::Sequence< sal_Int32 > maSequenceMapping;
+
+ rtl::OUString msCLSID;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxAdditionalShapes;
+
+ tDataSequenceCont m_aDataSequencesToExport;
+ rtl::OUString maCategoriesRange;
+};
+
namespace
{
Reference< uno::XComponentContext > lcl_getComponentContext()
@@ -356,7 +510,7 @@ tLabelAndValueRange lcl_getLabelAndValueRangeByRole(
const Sequence< Reference< chart2::data::XLabeledDataSequence > > & aSeqCnt,
const OUString & rRole,
const Reference< chart2::XChartDocument > & xDoc,
- SchXMLExportHelper::tDataSequenceCont & rOutSequencesToExport )
+ SchXMLExportHelper_Impl::tDataSequenceCont & rOutSequencesToExport )
{
tLabelAndValueRange aResult;
@@ -373,7 +527,7 @@ tLabelAndValueRange lcl_getLabelAndValueRangeByRole(
aResult.second = lcl_ConvertRange( xValueSeq->getSourceRangeRepresentation(), xDoc );
if( xLabelSeq.is() || xValueSeq.is())
- rOutSequencesToExport.push_back( SchXMLExportHelper::tLabelValuesDataPair( xLabelSeq, xValueSeq ));
+ rOutSequencesToExport.push_back( SchXMLExportHelper_Impl::tLabelValuesDataPair( xLabelSeq, xValueSeq ));
}
return aResult;
@@ -455,10 +609,10 @@ OUString lcl_getLabelString( const Reference< chart2::data::XDataSequence > & xL
}
sal_Int32 lcl_getMaxSequenceLength(
- const SchXMLExportHelper::tDataSequenceCont & rContainer )
+ const SchXMLExportHelper_Impl::tDataSequenceCont & rContainer )
{
sal_Int32 nResult = 0;
- for( SchXMLExportHelper::tDataSequenceCont::const_iterator aIt( rContainer.begin());
+ for( SchXMLExportHelper_Impl::tDataSequenceCont::const_iterator aIt( rContainer.begin());
aIt != rContainer.end(); ++aIt )
{
if( aIt->second.is())
@@ -573,7 +727,7 @@ template< class T >
};
-typedef ::std::map< sal_Int32, SchXMLExportHelper::tLabelValuesDataPair >
+typedef ::std::map< sal_Int32, SchXMLExportHelper_Impl::tLabelValuesDataPair >
lcl_DataSequenceMap;
struct lcl_SequenceToMapElement :
@@ -596,7 +750,7 @@ struct lcl_SequenceToMapElement :
};
void lcl_ReorderInternalSequencesAccordingToTheirRangeName(
- SchXMLExportHelper::tDataSequenceCont & rInOutSequences )
+ SchXMLExportHelper_Impl::tDataSequenceCont & rInOutSequences )
{
lcl_DataSequenceMap aIndexSequenceMap;
::std::transform( rInOutSequences.begin(), rInOutSequences.end(),
@@ -613,7 +767,7 @@ void lcl_ReorderInternalSequencesAccordingToTheirRangeName(
// fill empty columns
for( ; nIndex < aIt->first; ++nIndex )
rInOutSequences.push_back(
- SchXMLExportHelper::tDataSequenceCont::value_type( 0, 0 ));
+ SchXMLExportHelper_Impl::tDataSequenceCont::value_type( 0, 0 ));
OSL_ASSERT( nIndex == aIt->first );
rInOutSequences.push_back( aIt->second );
}
@@ -621,7 +775,7 @@ void lcl_ReorderInternalSequencesAccordingToTheirRangeName(
lcl_TableData lcl_getDataForLocalTable(
- const SchXMLExportHelper::tDataSequenceCont & aSequencesToExport,
+ const SchXMLExportHelper_Impl::tDataSequenceCont & aSequencesToExport,
const Reference< chart::XComplexDescriptionAccess >& xComplexDescriptionAccess,
const OUString& rCategoriesRange,
bool bSeriesFromColumns,
@@ -643,13 +797,18 @@ lcl_TableData lcl_getDataForLocalTable(
aResult.aComplexRowDescriptions = xComplexDescriptionAccess->getComplexRowDescriptions();
}
- SchXMLExportHelper::tDataSequenceCont::size_type nNumSequences = aSequencesToExport.size();
- SchXMLExportHelper::tDataSequenceCont::const_iterator aBegin( aSequencesToExport.begin());
- SchXMLExportHelper::tDataSequenceCont::const_iterator aEnd( aSequencesToExport.end());
- SchXMLExportHelper::tDataSequenceCont::const_iterator aIt( aBegin );
+ SchXMLExportHelper_Impl::tDataSequenceCont::size_type nNumSequences = aSequencesToExport.size();
+ SchXMLExportHelper_Impl::tDataSequenceCont::const_iterator aBegin( aSequencesToExport.begin());
+ SchXMLExportHelper_Impl::tDataSequenceCont::const_iterator aEnd( aSequencesToExport.end());
+ SchXMLExportHelper_Impl::tDataSequenceCont::const_iterator aIt( aBegin );
size_t nMaxSequenceLength( lcl_getMaxSequenceLength( aSequencesToExport ));
- nMaxSequenceLength = std::max( nMaxSequenceLength, size_t( aSimpleCategories.getLength() ) );
+ size_t nCategoriesLength( aSimpleCategories.getLength() );
+ if( nCategoriesLength > nMaxSequenceLength )
+ {
+ aSimpleCategories.realloc(nMaxSequenceLength);//#i110617#
+ nCategoriesLength = nMaxSequenceLength;
+ }
size_t nNumColumns( bSeriesFromColumns ? nNumSequences : nMaxSequenceLength );
size_t nNumRows( bSeriesFromColumns ? nMaxSequenceLength : nNumSequences );
@@ -829,7 +988,53 @@ struct SchXMLDataPointStruct
// class SchXMLExportHelper
// ========================================
-SchXMLExportHelper::SchXMLExportHelper(
+SchXMLExportHelper::SchXMLExportHelper( SvXMLExport& rExport, SvXMLAutoStylePoolP& rASPool )
+ : m_pImpl( new SchXMLExportHelper_Impl( rExport, rASPool ) )
+{
+}
+
+SchXMLExportHelper::~SchXMLExportHelper()
+{
+ delete m_pImpl;
+}
+
+const OUString& SchXMLExportHelper::getChartCLSID()
+{
+ return m_pImpl->msCLSID;
+}
+
+UniReference< XMLPropertySetMapper > SchXMLExportHelper_Impl::GetPropertySetMapper() const
+{
+ return mxPropertySetMapper;
+}
+
+void SchXMLExportHelper_Impl::exportAutoStyles()
+{
+ if( mxExpPropMapper.is())
+ {
+ //ToDo: when embedded in calc/writer this is not necessary because the
+ // numberformatter is shared between both documents
+ mrExport.exportAutoDataStyles();
+
+ // export chart auto styles
+ mrAutoStylePool.exportXML(
+ XML_STYLE_FAMILY_SCH_CHART_ID
+ , mrExport.GetDocHandler(),
+ mrExport.GetMM100UnitConverter(),
+ mrExport.GetNamespaceMap()
+ );
+
+ // export auto styles for additional shapes
+ mrExport.GetShapeExport()->exportAutoStyles();
+ // and for text in additional shapes
+ mrExport.GetTextParagraphExport()->exportTextAutoStyles();
+ }
+}
+
+// private methods
+// ---------------
+
+SchXMLExportHelper_Impl::SchXMLExportHelper_Impl(
SvXMLExport& rExport,
SvXMLAutoStylePoolP& rASPool ) :
mrExport( rExport ),
@@ -898,56 +1103,22 @@ SchXMLExportHelper::SchXMLExportHelper(
String( 'T' ));
}
-SchXMLExportHelper::~SchXMLExportHelper() {}
-
-const OUString& SchXMLExportHelper::getChartCLSID()
+SchXMLExportHelper_Impl::~SchXMLExportHelper_Impl()
{
- return msCLSID;
-}
-
-void SchXMLExportHelper::exportAutoStyles()
-{
- if( mxExpPropMapper.is())
- {
- //ToDo: when embedded in calc/writer this is not necessary because the
- // numberformatter is shared between both documents
- mrExport.exportAutoDataStyles();
-
- // export chart auto styles
- mrAutoStylePool.exportXML(
- XML_STYLE_FAMILY_SCH_CHART_ID
- , mrExport.GetDocHandler(),
- mrExport.GetMM100UnitConverter(),
- mrExport.GetNamespaceMap()
- );
-
- // export auto styles for additional shapes
- mrExport.GetShapeExport()->exportAutoStyles();
- // and for text in additional shapes
- mrExport.GetTextParagraphExport()->exportTextAutoStyles();
- }
}
-void SchXMLExportHelper::collectAutoStyles( Reference< chart::XChartDocument > rChartDoc )
+void SchXMLExportHelper_Impl::collectAutoStyles( Reference< chart::XChartDocument > rChartDoc )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogContext, "xmloff", "bm", "::SchXMLExportHelper::collectAutoStyles" );
-
parseDocument( rChartDoc, sal_False );
}
-void SchXMLExportHelper::exportChart( Reference< chart::XChartDocument > rChartDoc,
+void SchXMLExportHelper_Impl::exportChart( Reference< chart::XChartDocument > rChartDoc,
sal_Bool bIncludeTable )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogContext, "xmloff", "bm", "::SchXMLExportHelper::exportChart" );
-
parseDocument( rChartDoc, sal_True, bIncludeTable );
DBG_ASSERT( maAutoStyleNameQueue.empty(), "There are still remaining autostyle names in the queue" );
}
-
-// private methods
-// ---------------
-
::rtl::OUString lcl_GetStringFromNumberSequence( const ::com::sun::star::uno::Sequence< sal_Int32 >& rSequenceMapping, bool bRemoveOneFromEachIndex /*should be true if having categories*/ )
{
const sal_Int32* pArray = rSequenceMapping.getConstArray();
@@ -972,7 +1143,7 @@ void SchXMLExportHelper::exportChart( Reference< chart::XChartDocument > rChartD
}
/// if bExportContent is false the auto-styles are collected
-void SchXMLExportHelper::parseDocument( Reference< chart::XChartDocument >& rChartDoc,
+void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& rChartDoc,
sal_Bool bExportContent,
sal_Bool bIncludeTable )
{
@@ -1084,6 +1255,7 @@ void SchXMLExportHelper::parseDocument( Reference< chart::XChartDocument >& rCha
aDataProviderURL = OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) );
}
mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aDataProviderURL );
+ mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
}
OUString sChartType( xDiagram->getDiagramType() );
@@ -1421,7 +1593,7 @@ void lcl_exportComplexLabel( const Sequence< OUString >& rComplexLabel, SvXMLExp
}
}
-void SchXMLExportHelper::exportTable()
+void SchXMLExportHelper_Impl::exportTable()
{
// table element
// -------------
@@ -1520,8 +1692,11 @@ void SchXMLExportHelper::exportTable()
// to allow a correct re-association when copying via clipboard
if( !bHasOwnData && aColumnDescriptions_RangeIter != aColumnDescriptions_RangeEnd )
{
- if( (*aColumnDescriptions_RangeIter).getLength())
- mrExport.AddAttribute( XML_NAMESPACE_TEXT, XML_ID, *aColumnDescriptions_RangeIter );
+ if ((*aColumnDescriptions_RangeIter).getLength())
+ {
+ mrExport.AddAttributeIdLegacy(XML_NAMESPACE_TEXT,
+ *aColumnDescriptions_RangeIter);
+ }
++aColumnDescriptions_RangeIter;
}
exportText( *aIt );
@@ -1553,7 +1728,10 @@ void SchXMLExportHelper::exportTable()
// 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.AddAttribute( XML_NAMESPACE_TEXT, XML_ID, *aRowDescriptions_RangeIter++ );
+ {
+ mrExport.AddAttributeIdLegacy(XML_NAMESPACE_TEXT,
+ *aRowDescriptions_RangeIter++);
+ }
exportText( *aRowDescriptionsIter );
++aRowDescriptionsIter;
if( nC < nComplexCount )
@@ -1575,8 +1753,11 @@ void SchXMLExportHelper::exportTable()
if( ( !bHasOwnData && aDataRangeIter != aDataRangeEndIter ) &&
( mbRowSourceColumns || (aColIt == aRowIt->begin())) )
{
- if( (*aDataRangeIter).getLength())
- mrExport.AddAttribute( XML_NAMESPACE_TEXT, XML_ID, *aDataRangeIter );
+ if ((*aDataRangeIter).getLength())
+ {
+ mrExport.AddAttributeIdLegacy(XML_NAMESPACE_TEXT,
+ *aDataRangeIter);
+ }
++aDataRangeIter;
}
exportText( msString, false ); // do not convert tabs and lfs
@@ -1589,7 +1770,7 @@ void SchXMLExportHelper::exportTable()
OSL_ASSERT( bHasOwnData || (aRowDescriptions_RangeIter == aRowDescriptions_RangeEnd) );
}
-void SchXMLExportHelper::exportPlotArea(
+void SchXMLExportHelper_Impl::exportPlotArea(
Reference< chart::XDiagram > xDiagram,
Reference< chart2::XDiagram > xNewDiagram,
const awt::Size & rPageSize,
@@ -1749,9 +1930,12 @@ void SchXMLExportHelper::exportPlotArea(
}
}
- // element
+ // plot-area element
pElPlotArea = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_PLOT_AREA, sal_True, sal_True );
+ //inner position rectangle element
+ exportCoordinateRegion( xDiagram );
+
// light sources (inside plot area element)
if( bIs3DChart &&
rShapeExport.is())
@@ -1912,7 +2096,27 @@ void SchXMLExportHelper::exportPlotArea(
delete pElPlotArea;
}
-void SchXMLExportHelper::exportAxes(
+void SchXMLExportHelper_Impl::exportCoordinateRegion( const uno::Reference< chart::XDiagram >& xDiagram )
+{
+ const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() );
+ if( nCurrentODFVersion <= SvtSaveOptions::ODFVER_012 )//do not export to ODF 1.2 or older
+ return;
+ if( nCurrentODFVersion != SvtSaveOptions::ODFVER_LATEST )//export only if extensions are enabled //#i100778# todo: change this dependent on fileformat evolution
+ return;
+
+ Reference< chart::XDiagramPositioning > xDiaPos( xDiagram, uno::UNO_QUERY );
+ DBG_ASSERT( xDiaPos.is(), "Invalid xDiaPos as parameter" );
+ if( !xDiaPos.is() )
+ return;
+
+ awt::Rectangle aRect( xDiaPos->calculateDiagramPositionExcludingAxes() );
+ addPosition( awt::Point(aRect.X,aRect.Y) );
+ addSize( awt::Size(aRect.Width,aRect.Height) );
+
+ SvXMLElementExport aCoordinateRegion( mrExport, XML_NAMESPACE_CHART_EXT, XML_COORDINATE_REGION, sal_True, sal_True );//#i100778# todo: change to chart namespace in future - dependent on fileformat
+}
+
+void SchXMLExportHelper_Impl::exportAxes(
const Reference< chart::XDiagram > & xDiagram,
const Reference< chart2::XDiagram > & xNewDiagram,
sal_Bool bExportContent )
@@ -2514,7 +2718,7 @@ void SchXMLExportHelper::exportAxes(
}
}
-void SchXMLExportHelper::exportSeries(
+void SchXMLExportHelper_Impl::exportSeries(
const Reference< chart2::XDiagram > & xNewDiagram,
const awt::Size & rPageSize,
sal_Bool bExportContent,
@@ -2883,7 +3087,7 @@ void SchXMLExportHelper::exportSeries(
}
}
-void SchXMLExportHelper::exportRegressionCurve(
+void SchXMLExportHelper_Impl::exportRegressionCurve(
const Reference< chart2::XDataSeries > & xSeries,
const Reference< beans::XPropertySet > & xSeriesProp,
const awt::Size & rPageSize,
@@ -2990,7 +3194,7 @@ void SchXMLExportHelper::exportRegressionCurve(
}
}
-void SchXMLExportHelper::exportCandleStickSeries(
+void SchXMLExportHelper_Impl::exportCandleStickSeries(
const Sequence< Reference< chart2::XDataSeries > > & aSeriesSeq,
const Reference< chart2::XDiagram > & xDiagram,
sal_Bool bJapaneseCandleSticks,
@@ -3108,7 +3312,7 @@ void SchXMLExportHelper::exportCandleStickSeries(
}
}
-void SchXMLExportHelper::exportDataPoints(
+void SchXMLExportHelper_Impl::exportDataPoints(
const uno::Reference< beans::XPropertySet > & xSeriesProperties,
sal_Int32 nSeriesLength,
const uno::Reference< chart2::XDiagram > & xDiagram,
@@ -3356,7 +3560,7 @@ void SchXMLExportHelper::exportDataPoints(
}
-void SchXMLExportHelper::getCellAddress( sal_Int32 nCol, sal_Int32 nRow )
+void SchXMLExportHelper_Impl::getCellAddress( sal_Int32 nCol, sal_Int32 nRow )
{
msStringBuffer.append( (sal_Unicode)'.' );
if( nCol < 26 )
@@ -3376,7 +3580,7 @@ void SchXMLExportHelper::getCellAddress( sal_Int32 nCol, sal_Int32 nRow )
msStringBuffer.append( nRow + (sal_Int32)1 );
}
-void SchXMLExportHelper::addPosition( const awt::Point & rPosition )
+void SchXMLExportHelper_Impl::addPosition( const awt::Point & rPosition )
{
mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, rPosition.X );
msString = msStringBuffer.makeStringAndClear();
@@ -3387,13 +3591,13 @@ void SchXMLExportHelper::addPosition( const awt::Point & rPosition )
mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_Y, msString );
}
-void SchXMLExportHelper::addPosition( Reference< drawing::XShape > xShape )
+void SchXMLExportHelper_Impl::addPosition( Reference< drawing::XShape > xShape )
{
if( xShape.is())
addPosition( xShape->getPosition());
}
-void SchXMLExportHelper::addSize( const awt::Size & rSize )
+void SchXMLExportHelper_Impl::addSize( const awt::Size & rSize )
{
mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, rSize.Width );
msString = msStringBuffer.makeStringAndClear();
@@ -3404,13 +3608,13 @@ void SchXMLExportHelper::addSize( const awt::Size & rSize )
mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT, msString );
}
-void SchXMLExportHelper::addSize( Reference< drawing::XShape > xShape )
+void SchXMLExportHelper_Impl::addSize( Reference< drawing::XShape > xShape )
{
if( xShape.is())
addSize( xShape->getSize() );
}
-awt::Size SchXMLExportHelper::getPageSize( const Reference< chart2::XChartDocument > & xChartDoc ) const
+awt::Size SchXMLExportHelper_Impl::getPageSize( const Reference< chart2::XChartDocument > & xChartDoc ) const
{
awt::Size aSize( 8000, 7000 );
uno::Reference< embed::XVisualObject > xVisualObject( xChartDoc, uno::UNO_QUERY );
@@ -3421,13 +3625,13 @@ awt::Size SchXMLExportHelper::getPageSize( const Reference< chart2::XChartDocume
return aSize;
}
-void SchXMLExportHelper::CollectAutoStyle( const std::vector< XMLPropertyState >& aStates )
+void SchXMLExportHelper_Impl::CollectAutoStyle( const std::vector< XMLPropertyState >& aStates )
{
if( !aStates.empty() )
maAutoStyleNameQueue.push( GetAutoStylePoolP().Add( XML_STYLE_FAMILY_SCH_CHART_ID, aStates ));
}
-void SchXMLExportHelper::AddAutoStyleAttribute( const std::vector< XMLPropertyState >& aStates )
+void SchXMLExportHelper_Impl::AddAutoStyleAttribute( const std::vector< XMLPropertyState >& aStates )
{
if( !aStates.empty() )
{
@@ -3438,7 +3642,7 @@ void SchXMLExportHelper::AddAutoStyleAttribute( const std::vector< XMLPropertySt
}
}
-void SchXMLExportHelper::exportText( const OUString& rText, bool bConvertTabsLFs )
+void SchXMLExportHelper_Impl::exportText( const OUString& rText, bool bConvertTabsLFs )
{
SchXMLTools::exportText( mrExport, rText, bConvertTabsLFs );
}
@@ -3455,6 +3659,8 @@ SchXMLExport::SchXMLExport(
maAutoStylePool( *this ),
maExportHelper( *this, maAutoStylePool )
{
+ if( getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST )
+ _GetNamespaceMap().Add( GetXMLToken(XML_NP_CHART_EXT), GetXMLToken(XML_N_CHART_EXT), XML_NAMESPACE_CHART_EXT);
}
@@ -3471,7 +3677,7 @@ SchXMLExport::~SchXMLExport()
sal_uInt32 SchXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
{
Reference< chart2::XChartDocument > xChartDoc( GetModel(), uno::UNO_QUERY );
- maExportHelper.InitRangeSegmentationProperties( xChartDoc );
+ maExportHelper.m_pImpl->InitRangeSegmentationProperties( xChartDoc );
return SvXMLExport::exportDoc( eClass );
}
@@ -3494,8 +3700,8 @@ void SchXMLExport::_ExportAutoStyles()
Reference< chart::XChartDocument > xChartDoc( GetModel(), uno::UNO_QUERY );
if( xChartDoc.is())
{
- maExportHelper.collectAutoStyles( xChartDoc );
- maExportHelper.exportAutoStyles();
+ maExportHelper.m_pImpl->collectAutoStyles( xChartDoc );
+ maExportHelper.m_pImpl->exportAutoStyles();
}
else
{
@@ -3544,13 +3750,13 @@ void SchXMLExport::_ExportContent()
aAny = xProp->getPropertyValue(
OUString::createFromAscii( "ChartRangeAddress" ));
aAny >>= sChartAddress;
- maExportHelper.SetChartRangeAddress( sChartAddress );
+ maExportHelper.m_pImpl->SetChartRangeAddress( sChartAddress );
OUString sTableNumberList;
aAny = xProp->getPropertyValue(
OUString::createFromAscii( "TableNumberList" ));
aAny >>= sTableNumberList;
- maExportHelper.SetTableNumberList( sTableNumberList );
+ maExportHelper.m_pImpl->SetTableNumberList( sTableNumberList );
// do not include own table if there are external addresses
bIncludeTable = (sChartAddress.getLength() == 0);
@@ -3563,7 +3769,7 @@ void SchXMLExport::_ExportContent()
}
}
}
- maExportHelper.exportChart( xChartDoc, bIncludeTable );
+ maExportHelper.m_pImpl->exportChart( xChartDoc, bIncludeTable );
}
else
{
@@ -3578,7 +3784,12 @@ void SchXMLExport::SetProgress( sal_Int32 nPercentage )
mxStatusIndicator->setValue( nPercentage );
}
-void SchXMLExportHelper::InitRangeSegmentationProperties( const Reference< chart2::XChartDocument > & xChartDoc )
+UniReference< XMLPropertySetMapper > SchXMLExport::GetPropertySetMapper() const
+{
+ return maExportHelper.m_pImpl->GetPropertySetMapper();
+}
+
+void SchXMLExportHelper_Impl::InitRangeSegmentationProperties( const Reference< chart2::XChartDocument > & xChartDoc )
{
if( xChartDoc.is())
try
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index 84c712187233..338b9c23a004 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -281,6 +281,8 @@ const SvXMLTokenMap& SchXMLImportHelper::GetPlotAreaElemTokenMap()
{
static __FAR_DATA SvXMLTokenMapEntry aPlotAreaElemTokenMap[] =
{
+ { XML_NAMESPACE_CHART_EXT, XML_COORDINATE_REGION, XML_TOK_PA_COORDINATE_REGION_EXT },
+ { XML_NAMESPACE_CHART, XML_COORDINATE_REGION, XML_TOK_PA_COORDINATE_REGION },
{ XML_NAMESPACE_CHART, XML_AXIS, XML_TOK_PA_AXIS },
{ XML_NAMESPACE_CHART, XML_SERIES, XML_TOK_PA_SERIES },
{ XML_NAMESPACE_CHART, XML_WALL, XML_TOK_PA_WALL },
@@ -657,6 +659,7 @@ SchXMLImport::SchXMLImport(
SvXMLImport( xServiceFactory, nImportFlags )
{
GetNamespaceMap().Add( GetXMLToken(XML_NP_XLINK), GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK );
+ GetNamespaceMap().Add( GetXMLToken(XML_NP_CHART_EXT), GetXMLToken(XML_N_CHART_EXT), XML_NAMESPACE_CHART_EXT);
mbIsGraphicLoadOnDemandSupported = false;
}
@@ -670,6 +673,7 @@ SchXMLImport::SchXMLImport(
: SvXMLImport( xServiceFactory, xModel, rGrfContainer )
{
GetNamespaceMap().Add( GetXMLToken(XML_NP_XLINK), GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK );
+ GetNamespaceMap().Add( GetXMLToken(XML_NP_CHART_EXT), GetXMLToken(XML_N_CHART_EXT), XML_NAMESPACE_CHART_EXT);
// get status indicator (if requested)
if( bShowProgress )
diff --git a/xmloff/source/chart/SchXMLParagraphContext.cxx b/xmloff/source/chart/SchXMLParagraphContext.cxx
index 2ccf0e2c02f2..bcd201153b7f 100644
--- a/xmloff/source/chart/SchXMLParagraphContext.cxx
+++ b/xmloff/source/chart/SchXMLParagraphContext.cxx
@@ -60,6 +60,7 @@ void SchXMLParagraphContext::StartElement( const uno::Reference< xml::sax::XAttr
{
sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
rtl::OUString aValue;
+ bool bHaveXmlId( false );
for( sal_Int16 i = 0; i < nAttrCount; i++ )
{
@@ -67,11 +68,20 @@ void SchXMLParagraphContext::StartElement( const uno::Reference< xml::sax::XAttr
rtl::OUString aLocalName;
USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- if( nPrefix == XML_NAMESPACE_TEXT &&
- IsXMLToken( aLocalName, XML_ID ) )
+ if (IsXMLToken(aLocalName, XML_ID))
{
- (*mpId) = xAttrList->getValueByIndex( i );
- break; // we only need this attribute
+ if (nPrefix == XML_NAMESPACE_XML)
+ {
+ (*mpId) = xAttrList->getValueByIndex( i );
+ bHaveXmlId = true;
+ }
+ if (nPrefix == XML_NAMESPACE_TEXT)
+ { // text:id shall be ignored if xml:id exists
+ if (!bHaveXmlId)
+ {
+ (*mpId) = xAttrList->getValueByIndex( i );
+ }
+ }
}
}
}
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index 4f3e654e8d15..ef1544b4a280 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -61,6 +61,7 @@
#include <com/sun/star/chart/ChartDataRowSource.hpp>
#include <com/sun/star/chart/X3DDisplay.hpp>
#include <com/sun/star/chart/XStatisticDisplay.hpp>
+#include <com/sun/star/chart/XDiagramPositioning.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
@@ -199,8 +200,8 @@ SchXMLPlotAreaContext::SchXMLPlotAreaContext(
mnSeries( 0 ),
m_aGlobalSeriesImportInfo( rAllRangeAddressesAvailable ),
maSceneImportHelper( rImport ),
- mbHasSize(false),
- mbHasPosition(false),
+ m_aOuterPositioning( rImport ),
+ m_aInnerPositioning( rImport ),
mbPercentStacked(false),
m_bAxisPositionAttributeImported(false),
m_rXLinkHRefAttributeToIndicateDataProvider(rXLinkHRefAttributeToIndicateDataProvider),
@@ -296,15 +297,6 @@ SchXMLPlotAreaContext::~SchXMLPlotAreaContext()
void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
{
- uno::Any aTransMatrixAny;
-
- // initialize size and position
- uno::Reference< drawing::XShape > xDiaShape( mxDiagram, uno::UNO_QUERY );
- bool bHasSizeWidth = false;
- bool bHasSizeHeight = false;
- bool bHasPositionX = false;
- bool bHasPositionY = false;
-
// parse attributes
sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetPlotAreaAttrTokenMap();
@@ -320,20 +312,10 @@ void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttri
switch( rAttrTokenMap.Get( nPrefix, aLocalName ))
{
case XML_TOK_PA_X:
- GetImport().GetMM100UnitConverter().convertMeasure( maPosition.X, aValue );
- bHasPositionX = true;
- break;
case XML_TOK_PA_Y:
- GetImport().GetMM100UnitConverter().convertMeasure( maPosition.Y, aValue );
- bHasPositionY = true;
- break;
case XML_TOK_PA_WIDTH:
- GetImport().GetMM100UnitConverter().convertMeasure( maSize.Width, aValue );
- bHasSizeWidth = true;
- break;
case XML_TOK_PA_HEIGHT:
- GetImport().GetMM100UnitConverter().convertMeasure( maSize.Height, aValue );
- bHasSizeHeight = true;
+ m_aOuterPositioning.readPositioningAttribute( nPrefix, aLocalName, aValue );
break;
case XML_TOK_PA_STYLE_NAME:
msAutoStyleName = aValue;
@@ -369,9 +351,6 @@ void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttri
}
}
- mbHasSize = bHasSizeWidth && bHasSizeHeight;
- mbHasPosition = bHasPositionX && bHasPositionY;
-
if( ! mxNewDoc.is())
{
uno::Reference< beans::XPropertySet > xDocProp( mrImportHelper.GetChartDocument(), uno::UNO_QUERY );
@@ -426,14 +405,7 @@ void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttri
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Lines")), pPropStyleContext, pStylesCtxt );
//handle automatic position and size
- bool bAutoSize = false;
- bool bAutoPosition = false;
- SchXMLTools::getPropertyFromContext(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutomaticSize")), pPropStyleContext, pStylesCtxt ) >>= bAutoSize;
- SchXMLTools::getPropertyFromContext(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutomaticPosition")), pPropStyleContext, pStylesCtxt ) >>= bAutoPosition;
- mbHasSize = mbHasSize && !bAutoSize;
- mbHasPosition = mbHasPosition && !bAutoPosition;
+ m_aOuterPositioning.readAutomaticPositioningProperties( pPropStyleContext, pStylesCtxt );
//correct default starting angle for old 3D pies
if( SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan3_0( GetImport().GetModel() ) )
@@ -548,6 +520,13 @@ SvXMLImportContext* SchXMLPlotAreaContext::CreateChildContext(
switch( rTokenMap.Get( nPrefix, rLocalName ))
{
+ case XML_TOK_PA_COORDINATE_REGION_EXT:
+ case XML_TOK_PA_COORDINATE_REGION:
+ {
+ pContext = new SchXMLCoordinateRegionContext( GetImport(), nPrefix, rLocalName, m_aInnerPositioning );
+ }
+ break;
+
case XML_TOK_PA_AXIS:
{
bool bAddMissingXAxisForNetCharts = false;
@@ -711,13 +690,22 @@ void SchXMLPlotAreaContext::EndElement()
}
// set changed size and position after properties (esp. 3d)
- uno::Reference< drawing::XShape > xDiaShape( mxDiagram, uno::UNO_QUERY );
- if( xDiaShape.is())
+
+ uno::Reference< chart::XDiagramPositioning > xDiaPos( mxDiagram, uno::UNO_QUERY );
+ if( xDiaPos.is())
{
- if( mbHasSize )
- xDiaShape->setSize( maSize );
- if( mbHasPosition )
- xDiaShape->setPosition( maPosition );
+ if( !m_aOuterPositioning.isAutomatic() )
+ {
+ if( m_aInnerPositioning.hasPosSize() )
+ xDiaPos->setDiagramPositionExcludingAxes( m_aInnerPositioning.getRectangle() );
+ else if( m_aOuterPositioning.hasPosSize() )
+ {
+ if( SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan3_3( GetImport().GetModel() ) ) //old version of OOo did write a wrong rectangle for the diagram size
+ xDiaPos->setDiagramPositionIncludingAxesAndAxisTitles( m_aOuterPositioning.getRectangle() );
+ else
+ xDiaPos->setDiagramPositionIncludingAxes( m_aOuterPositioning.getRectangle() );
+ }
+ }
}
CorrectAxisPositions();
@@ -1249,18 +1237,23 @@ void SchXMLAxisContext::CreateAxis()
case SCH_XML_AXIS_Z:
{
+ bool bSettingZAxisSuccedded = false;
try
{
- xDiaProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasZAxis" ), aTrueBool );
+ rtl::OUString sHasZAxis( rtl::OUString::createFromAscii( "HasZAxis" ) );
+ xDiaProp->setPropertyValue( sHasZAxis, aTrueBool );
+ xDiaProp->getPropertyValue( sHasZAxis ) >>= bSettingZAxisSuccedded;
}
catch( beans::UnknownPropertyException & )
{
DBG_ERROR( "Couldn't turn on z axis" );
}
- uno::Reference< chart::XAxisZSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is())
- xProp = xSuppl->getZAxis();
+ if( bSettingZAxisSuccedded )
+ {
+ uno::Reference< chart::XAxisZSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
+ if( xSuppl.is())
+ xProp = xSuppl->getZAxis();
+ }
}
break;
case SCH_XML_AXIS_UNDEF:
@@ -1271,6 +1264,10 @@ void SchXMLAxisContext::CreateAxis()
// set properties
if( xProp.is())
{
+ // #i109879# the line color is black as default, in the model it is a light gray
+ xProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LineColor" )),
+ uno::makeAny( COL_BLACK ));
+
xProp->setPropertyValue( rtl::OUString::createFromAscii( "DisplayLabels" ), aFalseBool );
// #88077# AutoOrigin 'on' is default
@@ -1677,6 +1674,134 @@ void SchXMLCategoriesContext::StartElement( const uno::Reference< xml::sax::XAtt
// ========================================
+SchXMLPositonAttributesHelper::SchXMLPositonAttributesHelper( SvXMLImport& rImporter )
+ : m_rImport( rImporter )
+ , m_aPosition(0,0)
+ , m_aSize(0,0)
+ , m_bHasSizeWidth( false )
+ , m_bHasSizeHeight( false )
+ , m_bHasPositionX( false )
+ , m_bHasPositionY( false )
+ , m_bAutoSize( false )
+ , m_bAutoPosition( false )
+{
+}
+
+SchXMLPositonAttributesHelper::~SchXMLPositonAttributesHelper()
+{
+}
+
+bool SchXMLPositonAttributesHelper::hasSize() const
+{
+ return m_bHasSizeWidth && m_bHasSizeHeight;
+}
+bool SchXMLPositonAttributesHelper::hasPosition() const
+{
+ return m_bHasPositionX && m_bHasPositionY;
+}
+bool SchXMLPositonAttributesHelper::hasPosSize() const
+{
+ return hasPosition() && hasSize();
+}
+bool SchXMLPositonAttributesHelper::isAutomatic() const
+{
+ return m_bAutoSize || m_bAutoPosition;
+}
+awt::Point SchXMLPositonAttributesHelper::getPosition() const
+{
+ return m_aPosition;
+}
+awt::Size SchXMLPositonAttributesHelper::getSize() const
+{
+ return m_aSize;
+}
+awt::Rectangle SchXMLPositonAttributesHelper::getRectangle() const
+{
+ return awt::Rectangle( m_aPosition.X, m_aPosition.Y, m_aSize.Width, m_aSize.Height );
+}
+
+bool SchXMLPositonAttributesHelper::readPositioningAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
+{
+ //returns true if the attribute was proccessed
+ bool bReturn = true;
+
+ if( XML_NAMESPACE_SVG == nPrefix )
+ {
+ if( IsXMLToken( rLocalName, XML_X ) )
+ {
+ m_rImport.GetMM100UnitConverter().convertMeasure( m_aPosition.X, rValue );
+ m_bHasPositionX = true;
+ }
+ else if( IsXMLToken( rLocalName, XML_Y ) )
+ {
+ m_rImport.GetMM100UnitConverter().convertMeasure( m_aPosition.Y, rValue );
+ m_bHasPositionY = true;
+ }
+ else if( IsXMLToken( rLocalName, XML_WIDTH ) )
+ {
+ m_rImport.GetMM100UnitConverter().convertMeasure( m_aSize.Width, rValue );
+ m_bHasSizeWidth = true;
+ }
+ else if( IsXMLToken( rLocalName, XML_HEIGHT ) )
+ {
+ m_rImport.GetMM100UnitConverter().convertMeasure( m_aSize.Height, rValue );
+ m_bHasSizeHeight = true;
+ }
+ else
+ bReturn = false;
+ }
+ else
+ bReturn = false;
+
+ return bReturn;
+}
+
+
+void SchXMLPositonAttributesHelper::readAutomaticPositioningProperties( XMLPropStyleContext* pPropStyleContext, const SvXMLStylesContext* pStylesCtxt )
+{
+ if( pPropStyleContext && pStylesCtxt )
+ {
+ //handle automatic position and size
+ SchXMLTools::getPropertyFromContext(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutomaticSize")), pPropStyleContext, pStylesCtxt ) >>= m_bAutoSize;
+ SchXMLTools::getPropertyFromContext(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutomaticPosition")), pPropStyleContext, pStylesCtxt ) >>= m_bAutoPosition;
+ }
+}
+
+// ========================================
+
+SchXMLCoordinateRegionContext::SchXMLCoordinateRegionContext(
+ SvXMLImport& rImport
+ , sal_uInt16 nPrefix
+ , const rtl::OUString& rLocalName
+ , SchXMLPositonAttributesHelper& rPositioning )
+ : SvXMLImportContext( rImport, nPrefix, rLocalName )
+ , m_rPositioning( rPositioning )
+{
+}
+
+SchXMLCoordinateRegionContext::~SchXMLCoordinateRegionContext()
+{
+}
+
+void SchXMLCoordinateRegionContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
+{
+ // parse attributes
+ sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
+
+ for( sal_Int16 i = 0; i < nAttrCount; i++ )
+ {
+ rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
+ rtl::OUString aLocalName;
+ rtl::OUString aValue = xAttrList->getValueByIndex( i );
+ USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
+ m_rPositioning.readPositioningAttribute( nPrefix, aLocalName, aValue );
+ }
+}
+
+// ========================================
+
SchXMLWallFloorContext::SchXMLWallFloorContext(
SchXMLImportHelper& rImpHelper,
SvXMLImport& rImport,
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.hxx b/xmloff/source/chart/SchXMLPlotAreaContext.hxx
index 56aa3e78c814..1f0de466dcb1 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.hxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.hxx
@@ -66,6 +66,43 @@ private:
SchXML3DSceneAttributesHelper();
};
+// ----------------------------------------
+
+class SchXMLPositonAttributesHelper
+{
+public:
+ SchXMLPositonAttributesHelper( SvXMLImport& rImporter );
+ ~SchXMLPositonAttributesHelper();
+
+ bool readPositioningAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
+ void readAutomaticPositioningProperties( XMLPropStyleContext* pPropStyleContext, const SvXMLStylesContext* pStylesCtxt );
+
+ bool hasPosSize() const;
+ bool isAutomatic() const;
+ ::com::sun::star::awt::Rectangle getRectangle() const;
+
+
+private:
+ bool hasSize() const;
+ bool hasPosition() const;
+ ::com::sun::star::awt::Size getSize() const;
+ ::com::sun::star::awt::Point getPosition() const;
+
+ SvXMLImport& m_rImport;
+
+ ::com::sun::star::awt::Point m_aPosition;
+ ::com::sun::star::awt::Size m_aSize;
+
+ bool m_bHasSizeWidth;
+ bool m_bHasSizeHeight;
+ bool m_bHasPositionX;
+ bool m_bHasPositionY;
+ sal_Bool m_bAutoSize;
+ sal_Bool m_bAutoPosition;
+};
+
+// ----------------------------------------
+
class SchXMLPlotAreaContext : public SvXMLImportContext
{
public:
@@ -110,10 +147,8 @@ private:
GlobalSeriesImportInfo m_aGlobalSeriesImportInfo;
SchXML3DSceneAttributesHelper maSceneImportHelper;
- ::com::sun::star::awt::Size maSize;
- ::com::sun::star::awt::Point maPosition;
- bool mbHasSize;
- bool mbHasPosition;
+ SchXMLPositonAttributesHelper m_aOuterPositioning;//including axes and axes titles
+ SchXMLPositonAttributesHelper m_aInnerPositioning;//excluding axes and axes titles
bool mbPercentStacked;
bool m_bAxisPositionAttributeImported;
::rtl::OUString msAutoStyleName;
@@ -216,6 +251,23 @@ public:
// ----------------------------------------
+class SchXMLCoordinateRegionContext : public SvXMLImportContext
+{
+public:
+ SchXMLCoordinateRegionContext(
+ SvXMLImport& rImport
+ , sal_uInt16 nPrefix
+ , const rtl::OUString& rLocalName
+ , SchXMLPositonAttributesHelper& rPositioning );
+ virtual ~SchXMLCoordinateRegionContext();
+ virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+
+private:
+ SchXMLPositonAttributesHelper& m_rPositioning;
+};
+
+// ----------------------------------------
+
class SchXMLWallFloorContext : public SvXMLImportContext
{
public:
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index a10faf4fb463..b3b322568ea6 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -39,7 +39,6 @@
#include <com/sun/star/chart2/XRegressionCurve.hpp>
#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
-#include <com/sun/star/chart2/data/XRangeXMLConversion.hpp>
#include <com/sun/star/chart/ChartAxisAssign.hpp>
#include <com/sun/star/chart/ChartSymbolType.hpp>
@@ -78,15 +77,6 @@ using ::rtl::OUStringBuffer;
namespace
{
-OUString lcl_ConvertRange( const ::rtl::OUString & rRange, const Reference< chart2::data::XDataProvider >& xDataProvider )
-{
- OUString aResult = rRange;
- Reference< chart2::data::XRangeXMLConversion > xConversion( xDataProvider, uno::UNO_QUERY );
- if( xConversion.is())
- aResult = xConversion->convertRangeFromXML( rRange );
- return aResult;
-}
-
class SchXMLDomain2Context : public SvXMLImportContext
{
private:
@@ -232,7 +222,7 @@ void lcl_insertErrorBarLSequencesToMap(
Reference< chart2::data::XLabeledDataSequence > lcl_createAndAddSequenceToSeries( const rtl::OUString& rRole
, const rtl::OUString& rRange
- , const Reference< chart2::data::XDataProvider >& xDataProvider
+ , const Reference< chart2::XChartDocument >& xChartDoc
, const Reference< chart2::XDataSeries >& xSeries )
{
Reference< chart2::data::XLabeledDataSequence > xLabeledSeq;
@@ -240,27 +230,14 @@ Reference< chart2::data::XLabeledDataSequence > lcl_createAndAddSequenceToSeries
Reference< chart2::data::XDataSource > xSeriesSource( xSeries,uno::UNO_QUERY );
Reference< chart2::data::XDataSink > xSeriesSink( xSeries, uno::UNO_QUERY );
- if( !(rRange.getLength() && xDataProvider.is() && xSeriesSource.is() && xSeriesSink.is()) )
+ if( !(rRange.getLength() && xChartDoc.is() && xSeriesSource.is() && xSeriesSink.is()) )
return xLabeledSeq;
// create a new sequence
xLabeledSeq = SchXMLTools::GetNewLabeledDataSequence();
// set values at the new sequence
- Reference< chart2::data::XDataSequence > xSeq;
- try
- {
- xSeq.set( xDataProvider->createDataSequenceByRangeRepresentation( lcl_ConvertRange( rRange, xDataProvider )));
- SchXMLTools::setXMLRangePropertyAtDataSequence( xSeq, rRange );
- }
- catch( const lang::IllegalArgumentException & ex )
- {
- (void)ex; // avoid warning for pro build
- OSL_ENSURE( false, ::rtl::OUStringToOString(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IllegalArgumentException caught, Message: " )) +
- ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr());
- }
-
+ Reference< chart2::data::XDataSequence > xSeq = SchXMLTools::CreateDataSequence( rRange, xChartDoc );
Reference< beans::XPropertySet > xSeqProp( xSeq, uno::UNO_QUERY );
if( xSeqProp.is())
xSeqProp->setPropertyValue(OUString::createFromAscii("Role"), uno::makeAny( rRole));
@@ -336,10 +313,6 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
bool bHasRange = false;
bool bHasLabelRange = false;
- Reference< chart2::data::XRangeXMLConversion > xRangeConversion;
- if( mxNewDoc.is())
- xRangeConversion.set( mxNewDoc->getDataProvider(), uno::UNO_QUERY );
-
for( sal_Int16 i = 0; i < nAttrCount; i++ )
{
rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
@@ -401,123 +374,93 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
try
{
OSL_ASSERT( mxNewDoc.is());
- if( mxNewDoc.is())
- {
- if( m_rGlobalSeriesImportInfo.rbAllRangeAddressesAvailable && ! bHasRange )
- m_rGlobalSeriesImportInfo.rbAllRangeAddressesAvailable = sal_False;
+ if( m_rGlobalSeriesImportInfo.rbAllRangeAddressesAvailable && ! bHasRange )
+ m_rGlobalSeriesImportInfo.rbAllRangeAddressesAvailable = sal_False;
- Reference< chart2::data::XDataProvider > xDataProvider( mxNewDoc->getDataProvider() );
- if( xDataProvider.is())
+ bool bIsCandleStick = maGlobalChartTypeName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.CandleStickChartType"));
+ if( maSeriesChartTypeName.getLength() )
+ {
+ bIsCandleStick = maSeriesChartTypeName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.CandleStickChartType"));
+ }
+ else
+ {
+ if( bIsCandleStick
+ && m_bStockHasVolume
+ && mnSeriesIndex == 0 )
{
- bool bIsCandleStick = maGlobalChartTypeName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.CandleStickChartType"));
- if( maSeriesChartTypeName.getLength() )
- {
- bIsCandleStick = maSeriesChartTypeName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.CandleStickChartType"));
- }
- else
- {
- if( bIsCandleStick
- && m_bStockHasVolume
- && mnSeriesIndex == 0 )
- {
- maSeriesChartTypeName = OUString::createFromAscii( "com.sun.star.chart2.ColumnChartType" );
- bIsCandleStick = false;
- }
- else
- {
- maSeriesChartTypeName = maGlobalChartTypeName;
- }
- }
- if( ! mrGlobalChartTypeUsedBySeries )
- mrGlobalChartTypeUsedBySeries = (maSeriesChartTypeName.equals( maGlobalChartTypeName ));
- sal_Int32 nCoordinateSystemIndex = 0;//so far we can only import one coordinate system
- m_xSeries.set(
- mrImportHelper.GetNewDataSeries( mxNewDoc, nCoordinateSystemIndex, maSeriesChartTypeName, ! mrGlobalChartTypeUsedBySeries ));
- Reference< chart2::data::XLabeledDataSequence > xLabeledSeq(
- SchXMLTools::GetNewLabeledDataSequence());
-
- if( bIsCandleStick )
- {
- // set default color for range-line to black (before applying styles)
- Reference< beans::XPropertySet > xSeriesProp( m_xSeries, uno::UNO_QUERY );
- if( xSeriesProp.is())
- xSeriesProp->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Color")),
- uno::makeAny( sal_Int32( 0x000000 ))); // black
- }
- else if( maSeriesChartTypeName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.PieChartType")))
- {
- //@todo: this property should be saved
- Reference< beans::XPropertySet > xSeriesProp( m_xSeries, uno::UNO_QUERY );
- if( xSeriesProp.is())
- xSeriesProp->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VaryColorsByPoint")),
- uno::makeAny( true ));
- }
+ maSeriesChartTypeName = OUString::createFromAscii( "com.sun.star.chart2.ColumnChartType" );
+ bIsCandleStick = false;
+ }
+ else
+ {
+ maSeriesChartTypeName = maGlobalChartTypeName;
+ }
+ }
+ if( ! mrGlobalChartTypeUsedBySeries )
+ mrGlobalChartTypeUsedBySeries = (maSeriesChartTypeName.equals( maGlobalChartTypeName ));
+ sal_Int32 nCoordinateSystemIndex = 0;//so far we can only import one coordinate system
+ m_xSeries.set(
+ mrImportHelper.GetNewDataSeries( mxNewDoc, nCoordinateSystemIndex, maSeriesChartTypeName, ! mrGlobalChartTypeUsedBySeries ));
+ Reference< chart2::data::XLabeledDataSequence > xLabeledSeq(
+ SchXMLTools::GetNewLabeledDataSequence());
+
+ if( bIsCandleStick )
+ {
+ // set default color for range-line to black (before applying styles)
+ Reference< beans::XPropertySet > xSeriesProp( m_xSeries, uno::UNO_QUERY );
+ if( xSeriesProp.is())
+ xSeriesProp->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Color")),
+ uno::makeAny( sal_Int32( 0x000000 ))); // black
+ }
+ else if( maSeriesChartTypeName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.PieChartType")))
+ {
+ //@todo: this property should be saved
+ Reference< beans::XPropertySet > xSeriesProp( m_xSeries, uno::UNO_QUERY );
+ if( xSeriesProp.is())
+ xSeriesProp->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VaryColorsByPoint")),
+ uno::makeAny( true ));
+ }
- // values
- Reference< chart2::data::XDataSequence > xSeq;
- if( bHasRange )
- try
- {
- xSeq.set( xDataProvider->createDataSequenceByRangeRepresentation( lcl_ConvertRange( m_aSeriesRange, xDataProvider )));
- SchXMLTools::setXMLRangePropertyAtDataSequence( xSeq, m_aSeriesRange );
- }
- catch( const lang::IllegalArgumentException & ex )
- {
- (void)ex; // avoid warning for pro build
- OSL_ENSURE( false, ::rtl::OUStringToOString(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IllegalArgumentException caught, Message: " )) +
- ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr());
- }
+ // values
+ Reference< chart2::data::XDataSequence > xSeq;
+ if( bHasRange )
+ xSeq = SchXMLTools::CreateDataSequence( m_aSeriesRange, mxNewDoc );
- Reference< beans::XPropertySet > xSeqProp( xSeq, uno::UNO_QUERY );
- if( xSeqProp.is())
- {
- OUString aMainRole( OUString::createFromAscii("values-y") );
- if( maSeriesChartTypeName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.BubbleChartType") ) )
- aMainRole = OUString::createFromAscii("values-size");
- xSeqProp->setPropertyValue(OUString::createFromAscii("Role"), uno::makeAny( aMainRole ));
- }
- xLabeledSeq->setValues( xSeq );
+ Reference< beans::XPropertySet > xSeqProp( xSeq, uno::UNO_QUERY );
+ if( xSeqProp.is())
+ {
+ OUString aMainRole( OUString::createFromAscii("values-y") );
+ if( maSeriesChartTypeName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.BubbleChartType") ) )
+ aMainRole = OUString::createFromAscii("values-size");
+ xSeqProp->setPropertyValue(OUString::createFromAscii("Role"), uno::makeAny( aMainRole ));
+ }
+ xLabeledSeq->setValues( xSeq );
- // register for setting local data if external data provider is not present
- maPostponedSequences.insert(
- tSchXMLLSequencesPerIndex::value_type(
- tSchXMLIndexWithPart( m_rGlobalSeriesImportInfo.nCurrentDataIndex, SCH_XML_PART_VALUES ), xLabeledSeq ));
+ // register for setting local data if external data provider is not present
+ maPostponedSequences.insert(
+ tSchXMLLSequencesPerIndex::value_type(
+ tSchXMLIndexWithPart( m_rGlobalSeriesImportInfo.nCurrentDataIndex, SCH_XML_PART_VALUES ), xLabeledSeq ));
- // label
- if( bHasLabelRange )
- {
- try
- {
- Reference< chart2::data::XDataSequence > xLabelSequence(
- xDataProvider->createDataSequenceByRangeRepresentation(
- lcl_ConvertRange( m_aSeriesLabelRange, xDataProvider )));
- xLabeledSeq->setLabel( xLabelSequence );
- SchXMLTools::setXMLRangePropertyAtDataSequence( xLabelSequence, m_aSeriesLabelRange );
- }
- catch( const lang::IllegalArgumentException & ex )
- {
- (void)ex; // avoid warning for pro build
- OSL_ENSURE( false, ::rtl::OUStringToOString(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IllegalArgumentException caught, Message: " )) +
- ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr());
- }
- }
+ // label
+ if( bHasLabelRange )
+ {
+ Reference< chart2::data::XDataSequence > xLabelSequence =
+ SchXMLTools::CreateDataSequence( m_aSeriesLabelRange, mxNewDoc );
+ xLabeledSeq->setLabel( xLabelSequence );
+ }
- // Note: Even if we have no label, we have to register the label
- // for creation, because internal data always has labels. If
- // they don't exist in the original, auto-generated labels are
- // used for the internal data.
- maPostponedSequences.insert(
- tSchXMLLSequencesPerIndex::value_type(
- tSchXMLIndexWithPart( m_rGlobalSeriesImportInfo.nCurrentDataIndex, SCH_XML_PART_LABEL ), xLabeledSeq ));
+ // Note: Even if we have no label, we have to register the label
+ // for creation, because internal data always has labels. If
+ // they don't exist in the original, auto-generated labels are
+ // used for the internal data.
+ maPostponedSequences.insert(
+ tSchXMLLSequencesPerIndex::value_type(
+ tSchXMLIndexWithPart( m_rGlobalSeriesImportInfo.nCurrentDataIndex, SCH_XML_PART_LABEL ), xLabeledSeq ));
- Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeq( &xLabeledSeq, 1 );
- Reference< chart2::data::XDataSink > xSink( m_xSeries, uno::UNO_QUERY_THROW );
- xSink->setData( aSeq );
- }
- }
+ Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeq( &xLabeledSeq, 1 );
+ Reference< chart2::data::XDataSink > xSink( m_xSeries, uno::UNO_QUERY_THROW );
+ xSink->setData( aSeq );
}
catch( uno::Exception & ex )
{
@@ -662,15 +605,11 @@ void SchXMLSeries2Context::EndElement()
}
}
- Reference< chart2::data::XDataProvider > xDataProvider;
- if ( mxNewDoc.is() ) {
- xDataProvider = mxNewDoc->getDataProvider();
- }
for( std::vector< DomainInfo >::reverse_iterator aIt( aDomainInfos.rbegin() ); aIt!= aDomainInfos.rend(); ++aIt )
{
DomainInfo aDomainInfo( *aIt );
Reference< chart2::data::XLabeledDataSequence > xLabeledSeq =
- lcl_createAndAddSequenceToSeries( aDomainInfo.aRole, aDomainInfo.aRange, xDataProvider, m_xSeries );
+ lcl_createAndAddSequenceToSeries( aDomainInfo.aRole, aDomainInfo.aRange, mxNewDoc, m_xSeries );
if( xLabeledSeq.is() )
{
// register for setting local data if external data provider is not present
diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index 6b3c7f6953b0..aaca4300623b 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -161,6 +161,11 @@ struct lcl_ApplyCellToData : public ::std::unary_function< SchXMLCell, void >
++m_nIndex;
}
+ sal_Int32 getCurrentIndex() const
+ {
+ return m_nIndex;
+ }
+
private:
Sequence< double > & m_rData;
sal_Int32 m_nIndex;
@@ -865,7 +870,12 @@ void SchXMLTableHelper::applyTableToInternalDataProvider(
lcl_ApplyCellToComplexLabel( rRow.front(), aComplexRowDescriptions[nRow] );
// values
- ::std::for_each( rRow.begin() + nColOffset, rRow.end(), lcl_ApplyCellToData( aDataInRows[nRow] ));
+ Sequence< double >& rTargetRow = aDataInRows[nRow];
+ lcl_ApplyCellToData aApplyCellToData = ::std::for_each( rRow.begin() + nColOffset, rRow.end(), lcl_ApplyCellToData( rTargetRow ) );
+ double fNaN = 0.0;
+ ::rtl::math::setNan( &fNaN );
+ for( sal_Int32 nCurrentIndex = aApplyCellToData.getCurrentIndex(); nCurrentIndex<nNumColumns; nCurrentIndex++ )
+ rTargetRow[nCurrentIndex] = fNaN;//#i110615#
}
}
}
diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx
index 8b673076939d..1d66c013c5af 100644
--- a/xmloff/source/chart/SchXMLTools.cxx
+++ b/xmloff/source/chart/SchXMLTools.cxx
@@ -133,20 +133,25 @@ sal_Int32 lcl_getBuildIDFromGenerator( const ::rtl::OUString& rGenerator )
return nBuildId;
}
+OUString lcl_ConvertRange( const ::rtl::OUString & rRange, const Reference< chart2::data::XDataProvider >& xDataProvider )
+{
+ OUString aResult = rRange;
+ Reference< chart2::data::XRangeXMLConversion > xRangeConversion( xDataProvider, uno::UNO_QUERY );
+ if( xRangeConversion.is())
+ aResult = xRangeConversion->convertRangeFromXML( rRange );
+ return aResult;
+}
+
Reference< chart2::data::XDataSequence > lcl_createNewSequenceFromCachedXMLRange( const Reference< chart2::data::XDataSequence >& xSeq, const Reference< chart2::data::XDataProvider >& xDataProvider )
{
Reference< chart2::data::XDataSequence > xRet;
OUString aRange;
- Reference< chart2::data::XRangeXMLConversion > xRangeConversion( xDataProvider, uno::UNO_QUERY );
- if( xRangeConversion.is() )
+ if( xSeq.is() && SchXMLTools::getXMLRangePropertyFromDataSequence( xSeq, aRange, /* bClearProp = */ true ) )
{
- if( xSeq.is() && SchXMLTools::getXMLRangePropertyFromDataSequence( xSeq, aRange, /* bClearProp = */ true ) )
- {
- xRet.set( xDataProvider->createDataSequenceByRangeRepresentation(
- xRangeConversion->convertRangeFromXML( aRange )) );
- SchXMLTools::copyProperties( Reference< beans::XPropertySet >( xSeq, uno::UNO_QUERY ),
- Reference< beans::XPropertySet >( xRet, uno::UNO_QUERY ));
- }
+ xRet.set( xDataProvider->createDataSequenceByRangeRepresentation(
+ lcl_ConvertRange( aRange, xDataProvider )) );
+ SchXMLTools::copyProperties( Reference< beans::XPropertySet >( xSeq, uno::UNO_QUERY ),
+ Reference< beans::XPropertySet >( xRet, uno::UNO_QUERY ));
}
return xRet;
}
@@ -385,6 +390,53 @@ Reference< chart2::data::XLabeledDataSequence > GetNewLabeledDataSequence()
return xResult;
}
+Reference< chart2::data::XDataSequence > CreateDataSequence(
+ const OUString & rRange,
+ const Reference< chart2::XChartDocument >& xChartDoc )
+{
+ Reference< chart2::data::XDataSequence > xRet;
+
+ if( !xChartDoc.is() )
+ {
+ DBG_ERROR( "need a chart document" );
+ return xRet;
+ }
+
+ Reference< chart2::data::XDataProvider > xDataProvider( xChartDoc->getDataProvider() );
+ if( !xDataProvider.is() )
+ {
+ DBG_ERROR( "need a data provider" );
+ return xRet;
+ }
+
+ try
+ {
+ xRet.set( xDataProvider->createDataSequenceByRangeRepresentation( lcl_ConvertRange( rRange, xDataProvider )));
+ SchXMLTools::setXMLRangePropertyAtDataSequence( xRet, rRange );
+ }
+ catch( const lang::IllegalArgumentException & )
+ {
+ DBG_ERROR( "could not create data sequence" );
+ }
+
+ if( !xRet.is() && !xChartDoc->hasInternalDataProvider() )
+ {
+ //#i103911# switch to internal data in case the parent cannot provide the requested data
+ xChartDoc->createInternalDataProvider( sal_True /* bCloneExistingData */ );
+ xDataProvider = xChartDoc->getDataProvider();
+ try
+ {
+ xRet.set( xDataProvider->createDataSequenceByRangeRepresentation( lcl_ConvertRange( rRange, xDataProvider )));
+ SchXMLTools::setXMLRangePropertyAtDataSequence( xRet, rRange );
+ }
+ catch( const lang::IllegalArgumentException & )
+ {
+ DBG_ERROR( "could not create data sequence" );
+ }
+ }
+ return xRet;
+}
+
void CreateCategories(
const uno::Reference< chart2::data::XDataProvider > & xDataProvider,
const uno::Reference< chart2::XChartDocument > & xNewDoc,
@@ -705,6 +757,29 @@ void setBuildIDAtImportInfo( uno::Reference< frame::XModel > xModel, Reference<
SvXMLMetaDocumentContext::setBuildId( aGenerator, xImportInfo );
}
+bool isDocumentGeneratedWithOpenOfficeOlderThan3_3( const uno::Reference< frame::XModel >& xChartModel )
+{
+ bool bResult = isDocumentGeneratedWithOpenOfficeOlderThan3_0( xChartModel );
+ if( !bResult )
+ {
+ ::rtl::OUString aGenerator( lcl_getGeneratorFromModel(xChartModel) );
+ if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/3") ) ) != -1 )
+ {
+ if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/300m") ) ) != -1 )
+ {
+ sal_Int32 nBuilId = lcl_getBuildIDFromGenerator( lcl_getGeneratorFromModel(xChartModel) );
+ if( nBuilId>0 && nBuilId<9491 ) //9491 is build id of dev300m76
+ bResult= true;
+ }
+ else if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/310m") ) ) != -1 )
+ bResult= true;
+ else if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/320m") ) ) != -1 )
+ bResult= true;
+ }
+ }
+ return bResult;
+}
+
bool isDocumentGeneratedWithOpenOfficeOlderThan3_0( const uno::Reference< frame::XModel >& xChartModel )
{
bool bResult = isDocumentGeneratedWithOpenOfficeOlderThan2_3( xChartModel );
diff --git a/xmloff/source/chart/SchXMLTools.hxx b/xmloff/source/chart/SchXMLTools.hxx
index 35ac3ff72f1b..bcc39ae3d114 100644
--- a/xmloff/source/chart/SchXMLTools.hxx
+++ b/xmloff/source/chart/SchXMLTools.hxx
@@ -54,6 +54,7 @@ namespace SchXMLTools
bool isDocumentGeneratedWithOpenOfficeOlderThan2_3( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel);
bool isDocumentGeneratedWithOpenOfficeOlderThan2_4( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel);
bool isDocumentGeneratedWithOpenOfficeOlderThan3_0( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel);
+ bool isDocumentGeneratedWithOpenOfficeOlderThan3_3( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel);
void setBuildIDAtImportInfo( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel
, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xImportInfo );
@@ -87,6 +88,11 @@ namespace SchXMLTools
::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XLabeledDataSequence > GetNewLabeledDataSequence();
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > CreateDataSequence(
+ const ::rtl::OUString& rRange,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartDocument >& xChartDoc );
+
void CreateCategories(
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider > & xDataProvider,
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > & xNewDoc,
diff --git a/xmloff/source/core/RDFaExportHelper.cxx b/xmloff/source/core/RDFaExportHelper.cxx
index 758969db7045..593047a8b46c 100644
--- a/xmloff/source/core/RDFaExportHelper.cxx
+++ b/xmloff/source/core/RDFaExportHelper.cxx
@@ -95,11 +95,6 @@ RDFaExportHelper::RDFaExportHelper(SvXMLExport & i_rExport)
OSL_ENSURE(xRS.is(), "AddRDFa: model is no rdf::XRepositorySupplier");
if (!xRS.is()) throw uno::RuntimeException();
m_xRepository.set(xRS->getRDFRepository(), uno::UNO_QUERY_THROW);
-
- const uno::Reference<rdf::XURI> xLabel(
- rdf::URI::createKnown(m_rExport.GetComponentContext(),
- rdf::URIs::RDFS_LABEL));
- m_RDFsLabel = xLabel->getStringValue();
}
::rtl::OUString
@@ -128,19 +123,21 @@ RDFaExportHelper::AddRDFa(
{
try
{
- uno::Sequence<rdf::Statement> stmts(
- m_xRepository->getStatementRDFa(i_xMetadatable) );
+ beans::Pair< uno::Sequence<rdf::Statement>, sal_Bool > const
+ RDFaResult( m_xRepository->getStatementRDFa(i_xMetadatable) );
+
+ uno::Sequence<rdf::Statement> const & rStatements( RDFaResult.First );
- if (0 == stmts.getLength())
+ if (0 == rStatements.getLength())
{
return; // no RDFa
}
// all stmts have the same subject, so we only handle first one
- const uno::Reference<rdf::XURI> xSubjectURI(stmts[0].Subject,
- uno::UNO_QUERY);
- const uno::Reference<rdf::XBlankNode> xSubjectBNode(stmts[0].Subject,
+ const uno::Reference<rdf::XURI> xSubjectURI(rStatements[0].Subject,
uno::UNO_QUERY);
+ const uno::Reference<rdf::XBlankNode> xSubjectBNode(
+ rStatements[0].Subject, uno::UNO_QUERY);
if (!xSubjectURI.is() && !xSubjectBNode.is())
{
throw uno::RuntimeException();
@@ -154,47 +151,31 @@ RDFaExportHelper::AddRDFa(
.makeStringAndClear()
);
- rdf::Statement* const iter
- ( ::std::partition( ::comphelper::stl_begin(stmts),
- ::comphelper::stl_end(stmts),
- ::boost::bind(&::rtl::OUString::equals, m_RDFsLabel,
- ::boost::bind(&rdf::XNode::getStringValue,
- ::boost::bind(&rdf::Statement::Predicate, _1))) ) );
-
- if (iter != ::comphelper::stl_end(stmts))
+ const uno::Reference<rdf::XLiteral> xContent(
+ rStatements[0].Object, uno::UNO_QUERY_THROW );
+ const uno::Reference<rdf::XURI> xDatatype(xContent->getDatatype());
+ if (xDatatype.is())
{
- // from iter to end, all stmts should have same object
- const uno::Reference<rdf::XLiteral> xContent(
- (*iter).Object, uno::UNO_QUERY_THROW );
- const uno::Reference<rdf::XURI> xDatatype(xContent->getDatatype());
- if (xDatatype.is())
- {
- const ::rtl::OUString datatype(
- makeCURIE(&m_rExport, xDatatype) );
- m_rExport.AddAttribute(XML_NAMESPACE_XHTML,
- token::XML_DATATYPE, datatype);
- }
- if (iter != ::comphelper::stl_begin(stmts)) // there is rdfs:label
- {
- m_rExport.AddAttribute(XML_NAMESPACE_XHTML, token::XML_CONTENT,
- xContent->getValue());
- }
+ const ::rtl::OUString datatype(
+ makeCURIE(&m_rExport, xDatatype) );
+ m_rExport.AddAttribute(XML_NAMESPACE_XHTML,
+ token::XML_DATATYPE, datatype);
}
- else
+ if (RDFaResult.Second) // there is xhtml:content
{
- OSL_ENSURE(false,"invalid RDFa: every property is rdfs:label");
- return;
+ m_rExport.AddAttribute(XML_NAMESPACE_XHTML, token::XML_CONTENT,
+ xContent->getValue());
}
::rtl::OUStringBuffer property;
::comphelper::intersperse(
::boost::make_transform_iterator(
- iter, // omit RDFsLabel predicates!
+ ::comphelper::stl_begin(rStatements),
::boost::bind(&makeCURIE, &m_rExport,
::boost::bind(&rdf::Statement::Predicate, _1))),
// argh, this must be the same type :(
::boost::make_transform_iterator(
- ::comphelper::stl_end(stmts),
+ ::comphelper::stl_end(rStatements),
::boost::bind(&makeCURIE, &m_rExport,
::boost::bind(&rdf::Statement::Predicate, _1))),
::comphelper::OUStringBufferAppender(property),
diff --git a/xmloff/source/core/RDFaImportHelper.cxx b/xmloff/source/core/RDFaImportHelper.cxx
index 4dbf840fd343..611889497812 100644
--- a/xmloff/source/core/RDFaImportHelper.cxx
+++ b/xmloff/source/core/RDFaImportHelper.cxx
@@ -126,28 +126,39 @@ public:
void InsertRDFaEntry(struct RDFaEntry const & i_rEntry);
};
-/** store metadatable object and its RDFa attributes */
-struct SAL_DLLPRIVATE RDFaEntry
+/** store parsed RDFa attributes */
+struct SAL_DLLPRIVATE ParsedRDFaAttributes
{
- uno::Reference<rdf::XMetadatable> m_xObject;
::rtl::OUString m_About;
::std::vector< ::rtl::OUString > m_Properties;
::rtl::OUString m_Content;
::rtl::OUString m_Datatype;
- RDFaEntry(uno::Reference<rdf::XMetadatable> i_xObject,
+ ParsedRDFaAttributes(
::rtl::OUString const & i_rAbout,
::std::vector< ::rtl::OUString > const & i_rProperties,
::rtl::OUString const & i_rContent,
::rtl::OUString const & i_rDatatype)
- : m_xObject(i_xObject)
- , m_About(i_rAbout)
+ : m_About(i_rAbout)
, m_Properties(i_rProperties)
, m_Content(i_rContent)
, m_Datatype(i_rDatatype)
{ }
};
+/** store metadatable object and its RDFa attributes */
+struct SAL_DLLPRIVATE RDFaEntry
+{
+ uno::Reference<rdf::XMetadatable> m_xObject;
+ ::boost::shared_ptr<ParsedRDFaAttributes> m_pRDFaAttributes;
+
+ RDFaEntry(uno::Reference<rdf::XMetadatable> const & i_xObject,
+ ::boost::shared_ptr<ParsedRDFaAttributes> const& i_pRDFaAttributes)
+ : m_xObject(i_xObject)
+ , m_pRDFaAttributes(i_pRDFaAttributes)
+ { }
+};
+
////////////////////////////////////////////////////////////////////////////
@@ -344,7 +355,7 @@ void RDFaInserter::InsertRDFaEntry(
if (!i_rEntry.m_xObject.is()) return;
const uno::Reference< rdf::XResource > xSubject(
- MakeResource( i_rEntry.m_About ) );
+ MakeResource( i_rEntry.m_pRDFaAttributes->m_About ) );
if (!xSubject.is())
{
return; // invalid
@@ -352,13 +363,15 @@ void RDFaInserter::InsertRDFaEntry(
::comphelper::SequenceAsVector< uno::Reference< rdf::XURI > > predicates;
- predicates.reserve(i_rEntry.m_Properties.size());
+ predicates.reserve(i_rEntry.m_pRDFaAttributes->m_Properties.size());
::std::remove_copy_if(
- ::boost::make_transform_iterator(i_rEntry.m_Properties.begin(),
+ ::boost::make_transform_iterator(
+ i_rEntry.m_pRDFaAttributes->m_Properties.begin(),
::boost::bind(&RDFaInserter::MakeURI, this, _1)),
// argh, this must be the same type :(
- ::boost::make_transform_iterator(i_rEntry.m_Properties.end(),
+ ::boost::make_transform_iterator(
+ i_rEntry.m_pRDFaAttributes->m_Properties.end(),
::boost::bind(&RDFaInserter::MakeURI, this, _1)),
::std::back_inserter(predicates),
ref_is_null() );
@@ -375,9 +388,9 @@ void RDFaInserter::InsertRDFaEntry(
}
uno::Reference<rdf::XURI> xDatatype;
- if (i_rEntry.m_Datatype.getLength())
+ if (i_rEntry.m_pRDFaAttributes->m_Datatype.getLength())
{
- xDatatype = MakeURI( i_rEntry.m_Datatype );
+ xDatatype = MakeURI( i_rEntry.m_pRDFaAttributes->m_Datatype );
}
try
@@ -386,7 +399,8 @@ void RDFaInserter::InsertRDFaEntry(
// this must be done _after_ importing the whole XML file,
// to prevent collision between generated ids and ids in the file
m_xRepository->setStatementRDFa(xSubject, predicates.getAsConstList(),
- i_rEntry.m_xObject, i_rEntry.m_Content, xDatatype);
+ i_rEntry.m_xObject,
+ i_rEntry.m_pRDFaAttributes->m_Content, xDatatype);
}
catch (uno::Exception &)
{
@@ -405,9 +419,8 @@ RDFaImportHelper::~RDFaImportHelper()
{
}
-void
-RDFaImportHelper::AddRDFa(
- uno::Reference<rdf::XMetadatable> i_xObject,
+::boost::shared_ptr<ParsedRDFaAttributes>
+RDFaImportHelper::ParseRDFa(
::rtl::OUString const & i_rAbout,
::rtl::OUString const & i_rProperty,
::rtl::OUString const & i_rContent,
@@ -416,25 +429,58 @@ RDFaImportHelper::AddRDFa(
if (!i_rProperty.getLength())
{
OSL_TRACE("AddRDFa: invalid input: xhtml:property empty");
- return;
- }
- if (!i_xObject.is())
- {
- OSL_ENSURE(false, "AddRDFa: invalid arg: null textcontent");
- return;
+ return ::boost::shared_ptr<ParsedRDFaAttributes>();
}
// must parse CURIEs here: need namespace declaration context
RDFaReader reader(GetImport());
const ::rtl::OUString about( reader.ReadURIOrSafeCURIE(i_rAbout) );
- if (!about.getLength()) return;
+ if (!about.getLength()) {
+ return ::boost::shared_ptr<ParsedRDFaAttributes>();
+ }
const ::std::vector< ::rtl::OUString > properties(
reader.ReadCURIEs(i_rProperty) );
- if (!properties.size()) return;
+ if (!properties.size()) {
+ return ::boost::shared_ptr<ParsedRDFaAttributes>();
+ }
const ::rtl::OUString datatype( i_rDatatype.getLength()
? reader.ReadCURIE(i_rDatatype)
: ::rtl::OUString() );
- m_RDFaEntries.push_back(RDFaEntry(i_xObject,
- about, properties, i_rContent, datatype));
+ return ::boost::shared_ptr<ParsedRDFaAttributes>(
+ new ParsedRDFaAttributes(about, properties, i_rContent, datatype));
+}
+
+void
+RDFaImportHelper::AddRDFa(
+ uno::Reference<rdf::XMetadatable> const & i_xObject,
+ ::boost::shared_ptr<ParsedRDFaAttributes> & i_pRDFaAttributes)
+{
+ if (!i_xObject.is())
+ {
+ OSL_ENSURE(false, "AddRDFa: invalid arg: null textcontent");
+ return;
+ }
+ if (!i_pRDFaAttributes.get())
+ {
+ OSL_ENSURE(false, "AddRDFa: invalid arg: null RDFa attributes");
+ return;
+ }
+ m_RDFaEntries.push_back(RDFaEntry(i_xObject, i_pRDFaAttributes));
+}
+
+void
+RDFaImportHelper::ParseAndAddRDFa(
+ uno::Reference<rdf::XMetadatable> const & i_xObject,
+ ::rtl::OUString const & i_rAbout,
+ ::rtl::OUString const & i_rProperty,
+ ::rtl::OUString const & i_rContent,
+ ::rtl::OUString const & i_rDatatype)
+{
+ ::boost::shared_ptr<ParsedRDFaAttributes> pAttributes(
+ ParseRDFa(i_rAbout, i_rProperty, i_rContent, i_rDatatype) );
+ if (pAttributes.get())
+ {
+ AddRDFa(i_xObject, pAttributes);
+ }
}
void RDFaImportHelper::InsertRDFa(
diff --git a/xmloff/source/core/makefile.mk b/xmloff/source/core/makefile.mk
index b881f9610fbc..4d663d3218d8 100644
--- a/xmloff/source/core/makefile.mk
+++ b/xmloff/source/core/makefile.mk
@@ -38,12 +38,6 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
.INCLUDE: $(PRJ)$/util$/makefile.pmk
-# --- to build xmlkywd.obj in obj, too -----------------------------
-
-OBJFILES = $(OBJ)$/xmlkywd.obj
-LIB2TARGET =$(LB)$/xmlkywd.lib
-LIB2OBJFILES =$(OBJFILES)
-
# --- Files --------------------------------------------------------
SLOFILES = \
@@ -59,7 +53,6 @@ SLOFILES = \
$(SLO)$/xmlexp.obj \
$(SLO)$/xmlictxt.obj \
$(SLO)$/xmlimp.obj \
- $(SLO)$/xmlkywd.obj \
$(SLO)$/xmltkmap.obj \
$(SLO)$/xmltoken.obj \
$(SLO)$/xmluconv.obj \
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 058a57516b13..2e54ab978c9a 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -387,7 +387,7 @@ void SvXMLExport::_InitCtor()
mpNamespaceMap->Add( GetXMLToken(XML_NP_OOOC), GetXMLToken(XML_N_OOOC), XML_NAMESPACE_OOOC );
mpNamespaceMap->Add( GetXMLToken(XML_NP_OF), GetXMLToken(XML_N_OF), XML_NAMESPACE_OF );
- if (getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST)
+ if (getDefaultVersion() > SvtSaveOptions::ODFVER_012)
{
mpNamespaceMap->Add(
GetXMLToken(XML_NP_TABLE_EXT), GetXMLToken(XML_N_TABLE_EXT), XML_NAMESPACE_TABLE_EXT);
@@ -1314,6 +1314,23 @@ void SvXMLExport::SetBodyAttributes()
{
}
+static void
+lcl_AddGrddl(SvXMLExport & rExport, const sal_Int32 nExportMode)
+{
+ // check version >= 1.2
+ switch (rExport.getDefaultVersion()) {
+ case SvtSaveOptions::ODFVER_011: // fall thru
+ case SvtSaveOptions::ODFVER_010: return;
+ default: break;
+ }
+
+ if (EXPORT_SETTINGS != nExportMode) // meta, content, styles
+ {
+ rExport.AddAttribute( XML_NAMESPACE_GRDDL, XML_TRANSFORMATION,
+ OUString::createFromAscii(s_grddl_xsl) );
+ }
+}
+
sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
{
bool bOwnGraphicResolver = false;
@@ -1449,11 +1466,7 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
enum XMLTokenEnum eRootService = XML_TOKEN_INVALID;
const sal_Int32 nExportMode = mnExportFlags & (EXPORT_META|EXPORT_STYLES|EXPORT_CONTENT|EXPORT_SETTINGS);
- if ( EXPORT_SETTINGS != nExportMode ) // meta, content, styles
- {
- AddAttribute( XML_NAMESPACE_GRDDL, XML_TRANSFORMATION,
- OUString::createFromAscii(s_grddl_xsl) );
- }
+ lcl_AddGrddl(*this, nExportMode);
if( EXPORT_META == nExportMode )
{
@@ -2522,6 +2535,22 @@ SvtSaveOptions::ODFDefaultVersion SvXMLExport::getDefaultVersion() const
}
void
+SvXMLExport::AddAttributeIdLegacy(
+ sal_uInt16 const nLegacyPrefix, ::rtl::OUString const& rValue)
+{
+ switch (getDefaultVersion()) {
+ case SvtSaveOptions::ODFVER_011: // fall thru
+ case SvtSaveOptions::ODFVER_010: break;
+ default: // ODF 1.2: xml:id
+ AddAttribute(XML_NAMESPACE_XML, XML_ID, rValue);
+ }
+ // in ODF 1.1 this was form:id, anim:id, draw:id, or text:id
+ // backward compatibility: in ODF 1.2 write _both_ id attrs
+ AddAttribute(nLegacyPrefix, XML_ID, rValue);
+ // FIXME: this function simply assumes that rValue is unique
+}
+
+void
SvXMLExport::AddAttributeXmlId(uno::Reference<uno::XInterface> const & i_xIfc)
{
// check version >= 1.2
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 1ce4aeaff9da..f75eec83dbd3 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -38,7 +38,6 @@
#include <xmloff/nmspmap.hxx>
#include <xmloff/xmluconv.hxx>
#include "xmloff/xmlnmspe.hxx"
-#include "xmloff/xmlkywd.hxx"
#include <xmloff/xmltoken.hxx>
#include <xmloff/XMLFontStylesContext.hxx>
#include <xmloff/xmlictxt.hxx>
@@ -100,6 +99,7 @@ sal_Char __READONLY_DATA sXML_np__text[] = "_text";
sal_Char __READONLY_DATA sXML_np__table[] = "_table";
sal_Char __READONLY_DATA sXML_np__table_ext[] = "_table_ooo";
sal_Char __READONLY_DATA sXML_np__draw[] = "_draw";
+sal_Char __READONLY_DATA sXML_np__draw_ext[] = "_draw_ooo";
sal_Char __READONLY_DATA sXML_np__dr3d[] = "_dr3d";
sal_Char __READONLY_DATA sXML_np__fo[] = "_fo";
sal_Char __READONLY_DATA sXML_np__xlink[] = "_xlink";
@@ -110,6 +110,7 @@ sal_Char __READONLY_DATA sXML_np__number[] = "_number";
sal_Char __READONLY_DATA sXML_np__svg[] = "_svg";
sal_Char __READONLY_DATA sXML_np__chart[] = "_chart";
sal_Char __READONLY_DATA sXML_np__math[] = "_math";
+sal_Char __READONLY_DATA sXML_np__form[] = "_form";
sal_Char __READONLY_DATA sXML_np__script[] = "_script";
sal_Char __READONLY_DATA sXML_np__config[] = "_config";
sal_Char __READONLY_DATA sXML_np__db[] = "_db";
@@ -263,6 +264,9 @@ void SvXMLImport::_InitCtor()
mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__draw ) ),
GetXMLToken(XML_N_DRAW),
XML_NAMESPACE_DRAW );
+ mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__draw_ext ) ),
+ GetXMLToken(XML_N_DRAW_EXT),
+ XML_NAMESPACE_DRAW_EXT );
mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM (sXML_np__dr3d ) ),
GetXMLToken(XML_N_DR3D),
XML_NAMESPACE_DR3D );
@@ -293,7 +297,7 @@ void SvXMLImport::_InitCtor()
mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__math) ),
GetXMLToken(XML_N_MATH),
XML_NAMESPACE_MATH );
- mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_namespace_form) ),
+ mpNamespaceMap->Add(OUString(RTL_CONSTASCII_USTRINGPARAM( sXML_np__form )),
GetXMLToken(XML_N_FORM),
XML_NAMESPACE_FORM );
mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__script) ),
@@ -675,7 +679,7 @@ void SAL_CALL SvXMLImport::startElement( const OUString& rName,
}
}
else if( ( rAttrName.getLength() >= 5 ) &&
- ( rAttrName.compareToAscii( sXML_xmlns, 5 ) == 0 ) &&
+ ( rAttrName.compareTo( GetXMLToken(XML_XMLNS), 5 ) == 0 ) &&
( rAttrName.getLength() == 5 || ':' == rAttrName[5] ) )
{
if( !pRewindMap )
@@ -1985,6 +1989,16 @@ void SvXMLImport::SetXmlId(uno::Reference<uno::XInterface> const & i_xIfc,
}
}
+SAL_DLLPRIVATE ::xmloff::RDFaImportHelper &
+SvXMLImport::GetRDFaImportHelper()
+{
+ if (!mpImpl->mpRDFaHelper.get())
+ {
+ mpImpl->mpRDFaHelper.reset( new ::xmloff::RDFaImportHelper(*this) );
+ }
+ return *mpImpl->mpRDFaHelper;
+}
+
void
SvXMLImport::AddRDFa(uno::Reference<rdf::XMetadatable> i_xObject,
::rtl::OUString const & i_rAbout,
@@ -1994,11 +2008,8 @@ SvXMLImport::AddRDFa(uno::Reference<rdf::XMetadatable> i_xObject,
{
// N.B.: we only get called if i_xObject had xhtml:about attribute
// (an empty attribute value is valid)
- if (!mpImpl->mpRDFaHelper.get())
- {
- mpImpl->mpRDFaHelper.reset( new ::xmloff::RDFaImportHelper(*this) );
- }
- mpImpl->mpRDFaHelper->AddRDFa(i_xObject,
+ ::xmloff::RDFaImportHelper & rRDFaHelper( GetRDFaImportHelper() );
+ rRDFaHelper.ParseAndAddRDFa(i_xObject,
i_rAbout, i_rProperty, i_rContent, i_rDatatype);
}
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 9b2fb9eea891..2e92c4a6a97d 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -156,6 +156,9 @@ namespace xmloff { namespace token {
TOKEN( "tableooo", XML_NP_TABLE_EXT ),
TOKEN( "http://openoffice.org/2009/table", XML_N_TABLE_EXT ),
+ TOKEN( "drawooo", XML_NP_DRAW_EXT ),
+ TOKEN( "http://openoffice.org/2010/draw", XML_N_DRAW_EXT ),
+
// units
TOKEN( "mm", XML_UNIT_MM ),
TOKEN( "m", XML_UNIT_M ),
@@ -1713,6 +1716,7 @@ namespace xmloff { namespace token {
TOKEN( "symbol-image-name", XML_SYMBOL_IMAGE_NAME ),
TOKEN( "symbol-width", XML_SYMBOL_WIDTH ),
TOKEN( "system", XML_SYSTEM ),
+ TOKEN( "tab-color", XML_TAB_COLOR ),
TOKEN( "tab-stop", XML_TAB_STOP ),
TOKEN( "tab-stop-distance", XML_TAB_STOP_DISTANCE ),
TOKEN( "tab-stops", XML_TAB_STOPS ),
@@ -2552,6 +2556,9 @@ namespace xmloff { namespace token {
TOKEN( "dimension", XML_DIMENSION ),
TOKEN( "validation-name", XML_VALIDATION_NAME ),
+ TOKEN( "screen", XML_SCREEN ),
+ TOKEN( "printer", XML_PRINTER ),
+
// XForms token
TOKEN( "model", XML_MODEL ),
TOKEN( "schema", XML_SCHEMA ),
@@ -3096,6 +3103,10 @@ namespace xmloff { namespace token {
TOKEN( "ends-with", XML_ENDS_WITH ),
TOKEN( "does-not-end-with", XML_DOES_NOT_END_WITH ),
+ TOKEN( "chartooo", XML_NP_CHART_EXT ),
+ TOKEN( "http://openoffice.org/2010/chart", XML_N_CHART_EXT ),
+ TOKEN( "coordinate-region", XML_COORDINATE_REGION ),
+
#if OSL_DEBUG_LEVEL > 0
{ 0, NULL, NULL, XML_TOKEN_END }
#else
diff --git a/xmloff/source/draw/XMLReplacementImageContext.cxx b/xmloff/source/draw/XMLReplacementImageContext.cxx
index 1b3c0b25d0ad..d1591a10448e 100644
--- a/xmloff/source/draw/XMLReplacementImageContext.cxx
+++ b/xmloff/source/draw/XMLReplacementImageContext.cxx
@@ -33,7 +33,6 @@
#include <xmloff/xmlimp.hxx>
#include <xmloff/xmltoken.hxx>
#include "xmloff/xmlnmspe.hxx"
-#include "xmloff/xmlkywd.hxx"
#include <xmloff/nmspmap.hxx>
#include <xmloff/XMLBase64ImportContext.hxx>
#include "XMLReplacementImageContext.hxx"
diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx
index 520964e2ec2f..f4dfb71a2de4 100644
--- a/xmloff/source/draw/animationexport.cxx
+++ b/xmloff/source/draw/animationexport.cxx
@@ -28,24 +28,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
-#ifndef _COM_SUN_STAR_ANIMATIONS_XAnimateColor_HPP_
#include <com/sun/star/animations/XAnimateColor.hpp>
-#endif
-#ifndef _COM_SUN_STAR_ANIMATIONS_XAnimateSet_HPP_
#include <com/sun/star/animations/XAnimateSet.hpp>
-#endif
#include <com/sun/star/animations/XCommand.hpp>
#include <com/sun/star/animations/Timing.hpp>
#include <com/sun/star/animations/Event.hpp>
-#ifndef _COM_SUN_STAR_ANIMATIONS_XAnimateMotion_HPP_
#include <com/sun/star/animations/XAnimateMotion.hpp>
-#endif
-#ifndef _COM_SUN_STAR_ANIMATIONS_XAnimateTransform_HPP_
#include <com/sun/star/animations/XAnimateTransform.hpp>
-#endif
-#ifndef _COM_SUN_STAR_ANIMATIONS_XTransitionFilter_HPP_
#include <com/sun/star/animations/XTransitionFilter.hpp>
-#endif
#include <com/sun/star/animations/XIterateContainer.hpp>
#include <com/sun/star/animations/XAudio.hpp>
#include <com/sun/star/animations/AnimationColorSpace.hpp>
@@ -64,19 +54,12 @@
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/presentation/EffectNodeType.hpp>
-#ifndef _COM_SUN_STAR_PRESENTATION_EffectPresetClass_HPP_
#include <com/sun/star/presentation/EffectPresetClass.hpp>
-#endif
-#ifndef _COM_SUN_STAR_PRESENTATION_ParagraphTarget_HPP_
#include <com/sun/star/presentation/ParagraphTarget.hpp>
-#endif
#include <com/sun/star/presentation/TextAnimationType.hpp>
#include <com/sun/star/presentation/ShapeAnimationSubType.hpp>
#include <com/sun/star/presentation/EffectCommands.hpp>
-
-#ifndef _COM_SUN_STAR_DRAWING_XShape_HPP_
#include <com/sun/star/drawing/XShape.hpp>
-#endif
#include <tools/debug.hxx>
#include <tools/time.hxx>
@@ -780,7 +763,10 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod
const OUString& rExportIdentifier = mrExport.getInterfaceToIdentifierMapper().getIdentifier( xNode );
if( rExportIdentifier.getLength() )
- mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_ID, rExportIdentifier );
+ {
+ mrExport.AddAttributeIdLegacy(
+ XML_NAMESPACE_ANIMATION, rExportIdentifier);
+ }
Any aTemp( xNode->getBegin() );
if( aTemp.hasValue() )
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx
index d4d5dc2ce264..0920ef4f0992 100644
--- a/xmloff/source/draw/animationimport.cxx
+++ b/xmloff/source/draw/animationimport.cxx
@@ -47,18 +47,14 @@
#include <com/sun/star/animations/XAudio.hpp>
#include <com/sun/star/animations/ValuePair.hpp>
#include <com/sun/star/animations/AnimationColorSpace.hpp>
-#ifndef _COM_SUN_STAR_PRESENTATION_EffectPresetClass_HPP_
#include <com/sun/star/presentation/EffectPresetClass.hpp>
-#endif
#include <com/sun/star/animations/Timing.hpp>
#include <com/sun/star/animations/Event.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <com/sun/star/text/XTextCursor.hpp>
#include <com/sun/star/text/XTextRangeCompare.hpp>
-#ifndef _COM_SUN_STAR_PRESENTATION_ParagraphTarget_HPP_
#include <com/sun/star/presentation/ParagraphTarget.hpp>
-#endif
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/animations/EventTrigger.hpp>
@@ -237,7 +233,8 @@ enum AnimationNodeAttributes
ANA_IterateType,
ANA_IterateInterval,
ANA_Formula,
- ANA_ID,
+ ANA_ANIMID,
+ ANA_XMLID,
ANA_Group_Id,
ANA_Command,
ANA_Volume
@@ -294,8 +291,8 @@ const SvXMLTokenMap& AnimationsImportHelperImpl::getAnimationNodeAttributeTokenM
{ XML_NAMESPACE_ANIMATION, XML_ITERATE_TYPE, (sal_uInt16)ANA_IterateType },
{ XML_NAMESPACE_ANIMATION, XML_ITERATE_INTERVAL, (sal_uInt16)ANA_IterateInterval },
{ XML_NAMESPACE_ANIMATION, XML_FORMULA, (sal_uInt16)ANA_Formula },
- { XML_NAMESPACE_ANIMATION, XML_ID, (sal_uInt16)ANA_ID },
- { XML_NAMESPACE_XML, XML_ID, (sal_uInt16)ANA_ID },
+ { XML_NAMESPACE_ANIMATION, XML_ID, (sal_uInt16)ANA_ANIMID },
+ { XML_NAMESPACE_XML, XML_ID, (sal_uInt16)ANA_XMLID },
{ XML_NAMESPACE_PRESENTATION, XML_GROUP_ID, (sal_uInt16)ANA_Group_Id },
{ XML_NAMESPACE_ANIMATION, XML_AUDIO_LEVEL, (sal_uInt16)ANA_Volume },
{ XML_NAMESPACE_ANIMATION, XML_COMMAND, (sal_uInt16)ANA_Command },
@@ -808,6 +805,8 @@ void AnimationNodeContext::init_node( const ::com::sun::star::uno::Reference< :
std::list< NamedValue > aUserData;
XMLTokenEnum meAttributeName = XML_TOKEN_INVALID;
OUString aFrom, aBy, aTo, aValues;
+ bool bHaveXmlId( false );
+ OUString sXmlId;
const sal_Int16 nCount = xAttrList.is() ? xAttrList->getLength() : 0;
sal_uInt16 nEnum;
@@ -1054,13 +1053,15 @@ void AnimationNodeContext::init_node( const ::com::sun::star::uno::Reference< :
}
break;
- case ANA_ID:
+ case ANA_ANIMID:
{
- if( rValue.getLength() )
- {
- Reference< XInterface > xRef( mxNode, UNO_QUERY );
- GetImport().getInterfaceToIdentifierMapper().registerReference( rValue, xRef );
- }
+ if (!bHaveXmlId) { sXmlId = rValue; }
+ }
+ break;
+ case ANA_XMLID:
+ {
+ sXmlId = rValue;
+ bHaveXmlId = true;
}
break;
@@ -1251,6 +1252,13 @@ void AnimationNodeContext::init_node( const ::com::sun::star::uno::Reference< :
}
}
+ if (sXmlId.getLength())
+ {
+ Reference< XInterface > const xRef( mxNode, UNO_QUERY );
+ GetImport().getInterfaceToIdentifierMapper().registerReference(
+ sXmlId, xRef );
+ }
+
sal_Int32 nUserDataCount = aUserData.size();
if( nUserDataCount )
{
diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx
index 8b8e67519728..b2dae2f23274 100644
--- a/xmloff/source/draw/sdpropls.cxx
+++ b/xmloff/source/draw/sdpropls.cxx
@@ -323,8 +323,9 @@ const XMLPropertyMapEntry aXMLSDPresPageProps[] =
DPMAP( "FillStyle", XML_NAMESPACE_DRAW, XML_FILL, XML_SD_TYPE_FILLSTYLE, 0 ),
DPMAP( "FillColor", XML_NAMESPACE_DRAW, XML_FILL_COLOR, XML_TYPE_COLOR, 0 ),
DPMAP( "FillGradientName", XML_NAMESPACE_DRAW, XML_FILL_GRADIENT_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_FILLGRADIENTNAME ),
- DPMAP( "FillGradientStepCount", XML_NAMESPACE_DRAW, XML_GRADIENT_STEP_COUNT, XML_TYPE_NUMBER16, 0 ),
+ DPMAP( "FillGradientStepCount", XML_NAMESPACE_DRAW, XML_GRADIENT_STEP_COUNT, XML_TYPE_NUMBER, 0 ),
DPMAP( "FillHatchName", XML_NAMESPACE_DRAW, XML_FILL_HATCH_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_FILLHATCHNAME ),
+ GMAP( "FillBackground", XML_NAMESPACE_DRAW, XML_FILL_HATCH_SOLID, XML_TYPE_BOOL, 0 ),
DPMAP( "FillBitmapName", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_FILLBITMAPNAME ),
DPMAP( "FillTransparenceGradientName", XML_NAMESPACE_DRAW, XML_OPACITY_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_FILLTRANSNAME ),
DPMAP( "FillBitmapSizeX", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH, XML_SD_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, 0 ),
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index a2eb138483cd..68b324df08b8 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -641,12 +641,17 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent
GetXMLToken(XML_N_ANIMATION),
XML_NAMESPACE_ANIMATION);
- if( getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST )
+ if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 )
{
_GetNamespaceMap().Add(
GetXMLToken(XML_NP_OFFICE_EXT),
GetXMLToken(XML_N_OFFICE_EXT),
XML_NAMESPACE_OFFICE_EXT);
+
+ _GetNamespaceMap().Add(
+ GetXMLToken(XML_NP_DRAW_EXT),
+ GetXMLToken(XML_N_DRAW_EXT),
+ XML_NAMESPACE_DRAW_EXT);
}
GetShapeExport()->enableLayerExport();
@@ -2011,7 +2016,9 @@ void SdXMLExport::_ExportContent()
// write draw:id
const OUString aPageId = getInterfaceToIdentifierMapper().getIdentifier( xDrawPage );
if( aPageId.getLength() != 0 )
- AddAttribute ( XML_NAMESPACE_DRAW, XML_ID, aPageId );
+ {
+ AddAttributeIdLegacy(XML_NAMESPACE_DRAW, aPageId);
+ }
// write page
SvXMLElementExport aDPG(*this, XML_NAMESPACE_DRAW, XML_PAGE, sal_True, sal_True);
@@ -2806,7 +2813,7 @@ void SdXMLExport::collectAnnotationAutoStyles( const Reference<XDrawPage>& xDraw
void SdXMLExport::exportAnnotations( const Reference<XDrawPage>& xDrawPage )
{
// do not export in ODF 1.2 or older
- if( getDefaultVersion() != SvtSaveOptions::ODFVER_LATEST )
+ if( getDefaultVersion() <= SvtSaveOptions::ODFVER_012 )
return;
Reference< XAnnotationAccess > xAnnotationAccess( xDrawPage, UNO_QUERY );
diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx
index 21fd1eb0e55c..c1bad9d11e61 100644
--- a/xmloff/source/draw/sdxmlimp.cxx
+++ b/xmloff/source/draw/sdxmlimp.cxx
@@ -665,8 +665,8 @@ const SvXMLTokenMap& SdXMLImport::GetDrawPageAttrTokenMap()
{ XML_NAMESPACE_DRAW, XML_STYLE_NAME, XML_TOK_DRAWPAGE_STYLE_NAME },
{ XML_NAMESPACE_DRAW, XML_MASTER_PAGE_NAME, XML_TOK_DRAWPAGE_MASTER_PAGE_NAME },
{ XML_NAMESPACE_PRESENTATION, XML_PRESENTATION_PAGE_LAYOUT_NAME, XML_TOK_DRAWPAGE_PAGE_LAYOUT_NAME },
- { XML_NAMESPACE_DRAW, XML_ID, XML_TOK_DRAWPAGE_ID },
- { XML_NAMESPACE_XML, XML_ID, XML_TOK_DRAWPAGE_ID },
+ { XML_NAMESPACE_DRAW, XML_ID, XML_TOK_DRAWPAGE_DRAWID },
+ { XML_NAMESPACE_XML, XML_ID, XML_TOK_DRAWPAGE_XMLID },
{ XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_DRAWPAGE_HREF },
{ XML_NAMESPACE_PRESENTATION, XML_USE_HEADER_NAME, XML_TOK_DRAWPAGE_USE_HEADER_NAME },
{ XML_NAMESPACE_PRESENTATION, XML_USE_FOOTER_NAME, XML_TOK_DRAWPAGE_USE_FOOTER_NAME },
diff --git a/xmloff/source/draw/sdxmlimp_impl.hxx b/xmloff/source/draw/sdxmlimp_impl.hxx
index 1c0b883c9b59..d1cd0df80563 100644
--- a/xmloff/source/draw/sdxmlimp_impl.hxx
+++ b/xmloff/source/draw/sdxmlimp_impl.hxx
@@ -130,7 +130,8 @@ enum SdXMLDrawPageAttrTokenMap
XML_TOK_DRAWPAGE_STYLE_NAME,
XML_TOK_DRAWPAGE_MASTER_PAGE_NAME,
XML_TOK_DRAWPAGE_PAGE_LAYOUT_NAME,
- XML_TOK_DRAWPAGE_ID,
+ XML_TOK_DRAWPAGE_DRAWID,
+ XML_TOK_DRAWPAGE_XMLID,
XML_TOK_DRAWPAGE_HREF,
XML_TOK_DRAWPAGE_USE_HEADER_NAME,
XML_TOK_DRAWPAGE_USE_FOOTER_NAME,
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 67602b0e70d7..e76d5bf9b9c9 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -27,7 +27,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
+
+#include <memory>
+
#include "unointerfacetouniqueidentifiermapper.hxx"
+#include <com/sun/star/presentation/ClickAction.hpp>
#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/text/XText.hpp>
@@ -43,9 +47,7 @@
#include <xmloff/xmluconv.hxx>
#include "PropertySetMerger.hxx"
-#ifndef _XMLOFF_SHAPEEXPORT_HXX
#include <xmloff/shapeexport.hxx>
-#endif
#include "sdpropls.hxx"
#include "sdxmlexp_impl.hxx"
#include <xmloff/families.hxx>
@@ -75,10 +77,14 @@ XMLShapeExport::XMLShapeExport(SvXMLExport& rExp,
SvXMLExportPropertyMapper *pExtMapper )
: mrExport( rExp ),
mnNextUniqueShapeId(1),
+ maShapesInfos(),
+ maCurrentShapesIter(maShapesInfos.end()),
mbExportLayer( sal_False ),
// #88546# init to FALSE
mbHandleProgressBar( sal_False ),
msZIndex( RTL_CONSTASCII_USTRINGPARAM("ZOrder") ),
+ msPrintable( RTL_CONSTASCII_USTRINGPARAM("Printable") ),
+ msVisible( RTL_CONSTASCII_USTRINGPARAM("Visible") ),
msEmptyPres( RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ),
msModel( RTL_CONSTASCII_USTRINGPARAM("Model") ),
msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ),
@@ -467,6 +473,7 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap
mrExport.getInterfaceToIdentifierMapper().registerReference( xConnection );
break;
}
+ case XmlShapeTypePresTableShape:
case XmlShapeTypeDrawTableShape:
{
try
@@ -538,6 +545,38 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape
}
sal_Int32 nZIndex = 0;
uno::Reference< beans::XPropertySet > xSet( xShape, uno::UNO_QUERY );
+
+
+ ::std::auto_ptr< SvXMLElementExport > mpHyperlinkElement;
+
+ // export hyperlinks with <a><shape/></a>. Currently only in draw since draw
+ // does not support document events
+ if( xSet.is() && (GetExport().GetModelType() == SvtModuleOptions::E_DRAW) ) try
+ {
+ presentation::ClickAction eAction = presentation::ClickAction_NONE;
+ xSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("OnClick"))) >>= eAction;
+
+ if( (eAction == presentation::ClickAction_DOCUMENT) ||
+ (eAction == presentation::ClickAction_BOOKMARK) )
+ {
+ OUString sURL;
+ xSet->getPropertyValue(msBookmark) >>= sURL;
+
+ if( sURL.getLength() )
+ {
+ mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sURL );
+ mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
+ mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED );
+ mpHyperlinkElement.reset( new SvXMLElementExport(mrExport, XML_NAMESPACE_DRAW, XML_A, sal_True, sal_True) );
+ }
+ }
+ }
+ catch( uno::Exception& )
+ {
+ DBG_ERROR("XMLShapeExport::exportShape(): exception during hyperlink export");
+ }
+
+
if( xSet.is() )
xSet->getPropertyValue(msZIndex) >>= nZIndex;
@@ -639,7 +678,9 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape
uno::Reference< uno::XInterface > xRef( xShape, uno::UNO_QUERY );
const OUString& rShapeId = mrExport.getInterfaceToIdentifierMapper().getIdentifier( xRef );
if( rShapeId.getLength() )
- mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_ID, rShapeId );
+ {
+ mrExport.AddAttributeIdLegacy(XML_NAMESPACE_DRAW, rShapeId);
+ }
}
// --------------------------
@@ -666,6 +707,39 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape
}
}
+ // export draw:display (do not export in ODF 1.2 or older)
+ if( xSet.is() && ( mrExport.getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) )
+ {
+ if( aShapeInfo.meShapeType != XmlShapeTypeDrawPageShape && aShapeInfo.meShapeType != XmlShapeTypePresPageShape &&
+ aShapeInfo.meShapeType != XmlShapeTypeHandoutShape )
+
+ try
+ {
+ sal_Bool bVisible = sal_True;
+ sal_Bool bPrintable = sal_True;
+
+ xSet->getPropertyValue(msVisible) >>= bVisible;
+ xSet->getPropertyValue(msPrintable) >>= bPrintable;
+
+ XMLTokenEnum eDisplayToken = XML_TOKEN_INVALID;
+ const unsigned short nDisplay = (bVisible ? 2 : 0) | (bPrintable ? 1 : 0);
+ switch( nDisplay )
+ {
+ case 0: eDisplayToken = XML_NONE; break;
+ case 1: eDisplayToken = XML_PRINTER; break;
+ case 2: eDisplayToken = XML_SCREEN; break;
+ // case 3: eDisplayToken = XML_ALWAYS break; this is the default
+ }
+
+ if( eDisplayToken != XML_TOKEN_INVALID )
+ mrExport.AddAttribute(XML_NAMESPACE_DRAW_EXT, XML_DISPLAY, eDisplayToken );
+ }
+ catch( uno::Exception& )
+ {
+ DBG_ERROR( "XMLShapeExport::exportShape(), exception caught!" );
+ }
+ }
+
// #82003# test export count
// #91587# ALWAYS increment since now ALL to be exported shapes are counted.
if(mrExport.GetShapeExport()->IsHandleProgressBarEnabled())
@@ -759,6 +833,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape
break;
}
+ case XmlShapeTypePresTableShape:
case XmlShapeTypeDrawTableShape:
{
ImpExportTableShape( xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
@@ -828,6 +903,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape
break;
}
+ case XmlShapeTypePresMediaShape:
case XmlShapeTypeDrawMediaShape:
{
ImpExportMediaShape( xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
@@ -845,6 +921,8 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape
}
}
+ mpHyperlinkElement.reset();
+
// #97489# #97111#
// if there was an error and no element for the shape was exported
// we need to clear the attribute list or the attributes will be
@@ -1085,7 +1163,7 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x
// get info about presentation shape
uno::Reference <beans::XPropertySet> xPropSet(xShape, uno::UNO_QUERY);
- if(xPropSet.is())
+ if(xPropSet.is()) try
{
rtl::OUString sCLSID;
if(xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("CLSID"))) >>= sCLSID)
@@ -1097,16 +1175,22 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x
}
}
}
+ catch( uno::Exception& )
+ {
+ DBG_ERROR( "XMLShapeExport::ImpCalcShapeType(), expected ole shape to have the CLSID property?" );
+ }
}
else if(aType.EqualsAscii("Chart", 26, 5)) { eShapeType = XmlShapeTypePresChartShape; }
else if(aType.EqualsAscii("OrgChart", 26, 8)) { eShapeType = XmlShapeTypePresOrgChartShape; }
- else if(aType.EqualsAscii("TableShape", 26, 10)) { eShapeType = XmlShapeTypePresSheetShape; }
+ else if(aType.EqualsAscii("CalcShape", 26, 9)) { eShapeType = XmlShapeTypePresSheetShape; }
+ else if(aType.EqualsAscii("TableShape", 26, 10)) { eShapeType = XmlShapeTypePresTableShape; }
else if(aType.EqualsAscii("Notes", 26, 5)) { eShapeType = XmlShapeTypePresNotesShape; }
else if(aType.EqualsAscii("HandoutShape", 26, 12)) { eShapeType = XmlShapeTypeHandoutShape; }
else if(aType.EqualsAscii("HeaderShape", 26, 11)) { eShapeType = XmlShapeTypePresHeaderShape; }
else if(aType.EqualsAscii("FooterShape", 26, 11)) { eShapeType = XmlShapeTypePresFooterShape; }
else if(aType.EqualsAscii("SlideNumberShape", 26, 16)) { eShapeType = XmlShapeTypePresSlideNumberShape; }
else if(aType.EqualsAscii("DateTimeShape", 26, 13)) { eShapeType = XmlShapeTypePresDateTimeShape; }
+ else if(aType.EqualsAscii("MediaShape", 26, 10)) { eShapeType = XmlShapeTypePresMediaShape; }
}
}
}
diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx
index 874332c071c1..1295da204db9 100644
--- a/xmloff/source/draw/shapeexport2.cxx
+++ b/xmloff/source/draw/shapeexport2.cxx
@@ -31,7 +31,6 @@
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
-#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/drawing/CircleKind.hpp>
#include <com/sun/star/drawing/ConnectorType.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
@@ -1247,27 +1246,6 @@ void XMLShapeExport::ImpExportChartShape(
SvXMLAttributeList* pAttrList )
{
ImpExportOLE2Shape( xShape, eShapeType, nFeatures, pRefPoint, pAttrList );
-/*
- // Transformation
- ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
-
- uno::Reference< chart::XChartDocument > xChartDoc;
- if( !bIsEmptyPresObj )
- xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Model") ) ) >>= xChartDoc;
-
- if( xChartDoc.is() )
- {
- // export chart data if the flag is not set (default)
- sal_Bool bExportOwnData = ( nFeatures & SEF_EXPORT_NO_CHART_DATA ) == 0;
- mrExport.GetChartExport()->exportChart( xChartDoc, bExportOwnData );
- }
- else
- {
- // write chart object (fake for now, replace later)
- SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_CHART, XML_CHART, sal_True, sal_True);
- }
- }
-*/
}
//////////////////////////////////////////////////////////////////////////////
@@ -1996,7 +1974,7 @@ void XMLShapeExport::ImpExportPluginShape(
void XMLShapeExport::ImpExportMediaShape(
const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint)
+ XmlShapeType eShapeType, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint)
{
const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
if(xPropSet.is())
@@ -2004,6 +1982,9 @@ void XMLShapeExport::ImpExportMediaShape(
// Transformation
ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
+ if(eShapeType == XmlShapeTypePresMediaShape)
+ ImpExportPresentationAttributes( xPropSet, GetXMLToken(XML_PRESENTATION_OBJECT) );
+
sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
SvXMLElementExport aElem( mrExport, XML_NAMESPACE_DRAW,
XML_FRAME, bCreateNewline, sal_True );
diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx
index 44e822442161..f72e30dbeb86 100644
--- a/xmloff/source/draw/shapeexport4.cxx
+++ b/xmloff/source/draw/shapeexport4.cxx
@@ -1095,7 +1095,7 @@ void XMLShapeExport::ImpExportCustomShape(
}
}
-void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape >& xShape, XmlShapeType /*eShapeType*/, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint )
+void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint )
{
uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
uno::Reference< container::XNamed > xNamed(xShape, uno::UNO_QUERY);
@@ -1109,8 +1109,8 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape
sal_Bool bIsEmptyPresObj = sal_False;
// presentation settings
-// if(eShapeType == XmlShapeTypePresTableShape)
-// bIsEmptyPresObj = ImpExportPresentationAttributes( xPropSet, GetXMLToken(XML_PRESENTATION_TABLE) );
+ if(eShapeType == XmlShapeTypePresTableShape)
+ bIsEmptyPresObj = ImpExportPresentationAttributes( xPropSet, GetXMLToken(XML_PRESENTATION_TABLE) );
const bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 );
const bool bExportEmbedded(0 != (mrExport.getExportFlags() & EXPORT_EMBEDDED));
diff --git a/xmloff/source/draw/ximpbody.cxx b/xmloff/source/draw/ximpbody.cxx
index 9b5290254b46..af5fef0ff9dc 100644
--- a/xmloff/source/draw/ximpbody.cxx
+++ b/xmloff/source/draw/ximpbody.cxx
@@ -62,6 +62,9 @@ SdXMLDrawPageContext::SdXMLDrawPageContext( SdXMLImport& rImport,
: SdXMLGenericPageContext( rImport, nPrfx, rLocalName, xAttrList, rShapes )
, mbHadSMILNodes( false )
{
+ bool bHaveXmlId( false );
+ OUString sXmlId;
+
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
for(sal_Int16 i=0; i < nAttrCount; i++)
@@ -109,13 +112,17 @@ SdXMLDrawPageContext::SdXMLDrawPageContext( SdXMLImport& rImport,
maUseDateTimeDeclName = sValue;
break;
}
-
- case XML_TOK_DRAWPAGE_ID:
+ case XML_TOK_DRAWPAGE_DRAWID:
{
- uno::Reference< uno::XInterface > xRef( rShapes.get() );
- GetImport().getInterfaceToIdentifierMapper().registerReference( sValue, xRef );
- break;
+ if (!bHaveXmlId) { sXmlId = sValue; }
}
+ break;
+ case XML_TOK_DRAWPAGE_XMLID:
+ {
+ sXmlId = sValue;
+ bHaveXmlId = true;
+ }
+ break;
case XML_TOK_DRAWPAGE_HREF:
{
maHREF = sValue;
@@ -124,6 +131,12 @@ SdXMLDrawPageContext::SdXMLDrawPageContext( SdXMLImport& rImport,
}
}
+ if (sXmlId.getLength())
+ {
+ uno::Reference< uno::XInterface > const xRef( rShapes.get() );
+ GetImport().getInterfaceToIdentifierMapper().registerReference(
+ sXmlId, xRef );
+ }
GetImport().GetShapeImport()->startPage( rShapes );
uno::Reference< drawing::XDrawPage > xShapeDrawPage(rShapes, uno::UNO_QUERY);
diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx
index 7c0319e11b8c..29aa839c2b9e 100644
--- a/xmloff/source/draw/ximppage.cxx
+++ b/xmloff/source/draw/ximppage.cxx
@@ -339,6 +339,9 @@ void SdXMLGenericPageContext::EndElement()
else if( aDateTimeFormat.getLength() )
{
const SdXMLStylesContext* pStyles = dynamic_cast< const SdXMLStylesContext* >( GetSdImport().GetShapeImport()->GetStylesContext() );
+ if( !pStyles )
+ pStyles = dynamic_cast< const SdXMLStylesContext* >( GetSdImport().GetShapeImport()->GetAutoStylesContext() );
+
if( pStyles )
{
const SdXMLNumberFormatImportContext* pSdNumStyle =
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index c6832f94da3b..2eeab30ba532 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -167,6 +167,8 @@ SdXMLShapeContext::SdXMLShapeContext(
, mnZOrder(-1)
, maSize(1, 1)
, maPosition(0, 0)
+, mbVisible(true)
+, mbPrintable(true)
{
}
@@ -372,31 +374,46 @@ void SdXMLShapeContext::EndElement()
if( msHyperlink.getLength() != 0 ) try
{
- Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY_THROW );
- Reference< XNameReplace > xEvents( xEventsSupplier->getEvents(), UNO_QUERY_THROW );
+ const OUString sBookmark( RTL_CONSTASCII_USTRINGPARAM( "Bookmark" ) );
- uno::Sequence< beans::PropertyValue > aProperties( 3 );
- aProperties[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
- aProperties[0].Handle = -1;
- aProperties[0].Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM("Presentation") );
- aProperties[0].State = beans::PropertyState_DIRECT_VALUE;
+ Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY );
+ if( xEventsSupplier.is() )
+ {
+ const OUString sEventType( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
+ const OUString sClickAction( RTL_CONSTASCII_USTRINGPARAM( "ClickAction" ) );
+
+ Reference< XNameReplace > xEvents( xEventsSupplier->getEvents(), UNO_QUERY_THROW );
+
+ uno::Sequence< beans::PropertyValue > aProperties( 3 );
+ aProperties[0].Name = sEventType;
+ aProperties[0].Handle = -1;
+ aProperties[0].Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM("Presentation") );
+ aProperties[0].State = beans::PropertyState_DIRECT_VALUE;
- aProperties[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "ClickAction" ) );
- aProperties[1].Handle = -1;
- aProperties[1].Value <<= ::com::sun::star::presentation::ClickAction_DOCUMENT;
- aProperties[1].State = beans::PropertyState_DIRECT_VALUE;
+ aProperties[1].Name = sClickAction;
+ aProperties[1].Handle = -1;
+ aProperties[1].Value <<= ::com::sun::star::presentation::ClickAction_DOCUMENT;
+ aProperties[1].State = beans::PropertyState_DIRECT_VALUE;
- aProperties[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Bookmark" ) );
- aProperties[2].Handle = -1;
- aProperties[2].Value <<= msHyperlink;
- aProperties[2].State = beans::PropertyState_DIRECT_VALUE;
+ aProperties[2].Name = sBookmark;
+ aProperties[2].Handle = -1;
+ aProperties[2].Value <<= msHyperlink;
+ aProperties[2].State = beans::PropertyState_DIRECT_VALUE;
- const OUString sAPIEventName( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) );
- xEvents->replaceByName( sAPIEventName, Any( aProperties ) );
+ const OUString sAPIEventName( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) );
+ xEvents->replaceByName( sAPIEventName, Any( aProperties ) );
+ }
+ else
+ {
+ // in draw use the Bookmark property
+ Reference< beans::XPropertySet > xSet( mxShape, UNO_QUERY_THROW );
+ xSet->setPropertyValue( sBookmark, Any( msHyperlink ) );
+ xSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) ), Any( ::com::sun::star::presentation::ClickAction_DOCUMENT ) );
+ }
}
catch( Exception& )
{
- DBG_ERROR("xmloff::SdXMLShapeContext::EndElement(), exception caught!");
+ DBG_ERROR("xmloff::SdXMLShapeContext::EndElement(), exception caught while setting hyperlink!");
}
if( mxLockable.is() )
@@ -429,6 +446,20 @@ void SdXMLShapeContext::AddShape(uno::Reference< drawing::XShape >& xShape)
xMultiPropertyStates->setAllPropertiesToDefault();
}
+ if( !mbVisible || !mbPrintable ) try
+ {
+ uno::Reference< beans::XPropertySet > xSet( xShape, uno::UNO_QUERY_THROW );
+ if( !mbVisible )
+ xSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) ), uno::Any( sal_False ) );
+
+ if( !mbPrintable )
+ xSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Printable" ) ), uno::Any( sal_False ) );
+ }
+ catch( Exception& )
+ {
+ DBG_ERROR( "SdXMLShapeContext::AddShape(), exception caught!" );
+ }
+
// #107848#
if(!mbTemporaryShape && (!GetImport().HasTextImport()
|| !GetImport().GetTextImport()->IsInsideDeleteContext()))
@@ -761,7 +792,8 @@ void SdXMLShapeContext::SetThumbnail()
// this is called from the parent group for each unparsed attribute in the attribute list
void SdXMLShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
{
- if( XML_NAMESPACE_DRAW == nPrefix )
+ bool bHaveXmlId( false );
+ if( (XML_NAMESPACE_DRAW == nPrefix) || (XML_NAMESPACE_DRAW_EXT == nPrefix) )
{
if( IsXMLToken( rLocalName, XML_ZINDEX ) )
{
@@ -769,7 +801,7 @@ void SdXMLShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUStr
}
else if( IsXMLToken( rLocalName, XML_ID ) )
{
- maShapeId = rValue;
+ if (!bHaveXmlId) { maShapeId = rValue; };
}
else if( IsXMLToken( rLocalName, XML_NAME ) )
{
@@ -791,6 +823,11 @@ void SdXMLShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUStr
{
mnTransform.SetString(rValue, GetImport().GetMM100UnitConverter());
}
+ else if( IsXMLToken( rLocalName, XML_DISPLAY ) )
+ {
+ mbVisible = IsXMLToken( rValue, XML_ALWAYS ) || IsXMLToken( rValue, XML_SCREEN );
+ mbPrintable = IsXMLToken( rValue, XML_ALWAYS ) || IsXMLToken( rValue, XML_PRINTER );
+ }
}
else if( XML_NAMESPACE_PRESENTATION == nPrefix )
{
@@ -862,6 +899,7 @@ void SdXMLShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUStr
if( IsXMLToken( rLocalName, XML_ID ) )
{
maShapeId = rValue;
+ bHaveXmlId = true;
}
}
}
@@ -2548,7 +2586,7 @@ void SdXMLObjectShapeContext::StartElement( const ::com::sun::star::uno::Referen
}
else if( IsXMLToken( maPresentationClass, XML_PRESENTATION_TABLE ) )
{
- pService = "com.sun.star.presentation.TableShape";
+ pService = "com.sun.star.presentation.CalcShape";
}
else if( IsXMLToken( maPresentationClass, XML_PRESENTATION_OBJECT ) )
{
@@ -2905,8 +2943,21 @@ void SdXMLPluginShapeContext::StartElement( const ::com::sun::star::uno::Referen
const char* pService;
+ sal_Bool bIsPresShape = sal_False;
+
if( mbMedia )
+ {
pService = "com.sun.star.drawing.MediaShape";
+
+ bIsPresShape = maPresentationClass.getLength() && GetImport().GetShapeImport()->IsPresentationShapesSupported();
+ if( bIsPresShape )
+ {
+ if( IsXMLToken( maPresentationClass, XML_PRESENTATION_OBJECT ) )
+ {
+ pService = "com.sun.star.presentation.MediaShape";
+ }
+ }
+ }
else
pService = "com.sun.star.drawing.PluginShape";
@@ -2916,6 +2967,23 @@ void SdXMLPluginShapeContext::StartElement( const ::com::sun::star::uno::Referen
{
SetLayer();
+ if(bIsPresShape)
+ {
+ uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
+ if(xProps.is())
+ {
+ uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
+ if( xPropsInfo.is() )
+ {
+ if( !mbIsPlaceholder && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") )))
+ xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ), ::cppu::bool2any( sal_False ) );
+
+ if( mbIsUserTransformed && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsPlaceholderDependent") )))
+ xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsPlaceholderDependent") ), ::cppu::bool2any( sal_False ) );
+ }
+ }
+ }
+
// set pos, size, shear and rotate
SetTransformation();
GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
@@ -3539,8 +3607,7 @@ void SdXMLTableShapeContext::StartElement( const ::com::sun::star::uno::Referenc
{
const char* pService = "com.sun.star.drawing.TableShape";
- sal_Bool bIsPresShape = sal_False; //maPresentationClass.getLength() && GetImport().GetShapeImport()->IsPresentationShapesSupported();
-/*
+ sal_Bool bIsPresShape = maPresentationClass.getLength() && GetImport().GetShapeImport()->IsPresentationShapesSupported();
if( bIsPresShape )
{
if( IsXMLToken( maPresentationClass, XML_PRESENTATION_TABLE ) )
@@ -3548,7 +3615,7 @@ void SdXMLTableShapeContext::StartElement( const ::com::sun::star::uno::Referenc
pService = "com.sun.star.presentation.TableShape";
}
}
-*/
+
AddShape( pService );
if( mxShape.is() )
@@ -3668,7 +3735,7 @@ void SdXMLTableShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::
SvXMLImportContext* SdXMLTableShapeContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList )
{
- if( mxTableImportContext.Is() )
+ if( mxTableImportContext.Is() && (nPrefix == XML_NAMESPACE_TABLE) )
return mxTableImportContext->CreateChildContext(nPrefix, rLocalName, xAttrList);
else
return SdXMLShapeContext::CreateChildContext(nPrefix, rLocalName, xAttrList);
diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx
index 18453a8936af..bf15534fc260 100644
--- a/xmloff/source/draw/ximpshap.hxx
+++ b/xmloff/source/draw/ximpshap.hxx
@@ -83,6 +83,9 @@ protected:
com::sun::star::awt::Size maSize;
com::sun::star::awt::Point maPosition;
+ bool mbVisible;
+ bool mbPrintable;
+
/** if bSupportsStyle is false, auto styles will be set but not a style */
void SetStyle( bool bSupportsStyle = true );
void SetLayer();
diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx
index 847a6d9f8e8c..661353404389 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -313,10 +313,8 @@ namespace xmloff
if (CCA_CONTROL_ID & m_nIncludeCommon)
{
OSL_ENSURE(m_sControlId.getLength(), "OControlExport::exportInnerAttributes: have no control id for the control!");
- AddAttribute(
- OAttributeMetaData::getCommonControlAttributeNamespace(CCA_CONTROL_ID),
- OAttributeMetaData::getCommonControlAttributeName(CCA_CONTROL_ID),
- m_sControlId);
+ m_rContext.getGlobalContext().AddAttributeIdLegacy(
+ XML_NAMESPACE_FORM, m_sControlId);
#if OSL_DEBUG_LEVEL > 0
// reset the bit for later checking
m_nIncludeCommon = m_nIncludeCommon & ~CCA_CONTROL_ID;
@@ -693,7 +691,7 @@ namespace xmloff
if (m_nIncludeCommon & CCA_TARGET_LOCATION)
{
- exportTargetLocationAttribute();
+ exportTargetLocationAttribute(false);
#if OSL_DEBUG_LEVEL > 0
// reset the bit for later checking
m_nIncludeCommon = m_nIncludeCommon & ~CCA_TARGET_LOCATION;
@@ -2035,6 +2033,9 @@ namespace xmloff
OAttributeMetaData::getFormAttributeNamespace(eStringPropertyIds[i]),
OAttributeMetaData::getFormAttributeName(eStringPropertyIds[i]),
aStringPropertyNames[i]);
+
+ // #i112082# xlink:type is added as part of exportTargetLocationAttribute
+
// now export the data source name or databaselocation or connection resource
::rtl::OUString sPropValue;
m_xProps->getPropertyValue( PROPERTY_DATASOURCENAME ) >>= sPropValue;
@@ -2134,7 +2135,7 @@ namespace xmloff
// the target frame
exportTargetFrameAttribute();
// the target URL
- exportTargetLocationAttribute();
+ exportTargetLocationAttribute(true); // #i110911# add type attribute (for form, but not for control)
// master fields
exportStringSequenceAttribute(
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index 2c569f330b77..23fb003c6d34 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -586,12 +586,21 @@ namespace xmloff
//---------------------------------------------------------------------
void OControlImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
{
- static const sal_Char* pControlIdAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCA_CONTROL_ID);
static const sal_Char* pLinkedCellAttributeName = OAttributeMetaData::getBindingAttributeName(BA_LINKED_CELL);
- if ( !m_sControlId.getLength() && _rLocalName.equalsAscii( pControlIdAttributeName ) )
+ if (IsXMLToken(_rLocalName, XML_ID))
{ // it's the control id
- m_sControlId = _rValue;
+ if (XML_NAMESPACE_XML == _nNamespaceKey)
+ {
+ m_sControlId = _rValue;
+ }
+ else if (XML_NAMESPACE_FORM == _nNamespaceKey)
+ {
+ if (!m_sControlId.getLength())
+ {
+ m_sControlId = _rValue;
+ }
+ }
}
else if ( _rLocalName.equalsAscii( pLinkedCellAttributeName ) )
{ // it's the address of a spreadsheet cell
diff --git a/xmloff/source/forms/formattributes.cxx b/xmloff/source/forms/formattributes.cxx
index 3b4eaba8713c..e27f03f01de9 100644
--- a/xmloff/source/forms/formattributes.cxx
+++ b/xmloff/source/forms/formattributes.cxx
@@ -53,7 +53,7 @@ namespace xmloff
case CCA_NAME: return "name";
case CCA_SERVICE_NAME: return "control-implementation";
case CCA_BUTTON_TYPE: return "button-type";
- case CCA_CONTROL_ID: return "id";
+// disabled(AddAttributeIdLegacy) case CCA_CONTROL_ID: return "id";
case CCA_CURRENT_SELECTED: return "current-selected";
case CCA_CURRENT_VALUE: return "current-value";
case CCA_DISABLED: return "disabled";
diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx
index a3ddcdc8d3e7..665fdf0dae68 100644
--- a/xmloff/source/forms/propertyexport.cxx
+++ b/xmloff/source/forms/propertyexport.cxx
@@ -420,7 +420,7 @@ namespace xmloff
}
//---------------------------------------------------------------------
- void OPropertyExport::exportRelativeTargetLocation(const ConstAsciiString& _sPropertyName,sal_Int32 _nProperty)
+ void OPropertyExport::exportRelativeTargetLocation(const ConstAsciiString& _sPropertyName,sal_Int32 _nProperty,bool _bAddType)
{
DBG_CHECK_PROPERTY( _sPropertyName, ::rtl::OUString );
@@ -433,6 +433,10 @@ namespace xmloff
,OAttributeMetaData::getCommonControlAttributeName(_nProperty)
, sTargetLocation);
+ // #i110911# add xlink:type="simple" if required
+ if (_bAddType)
+ AddAttribute(XML_NAMESPACE_XLINK, token::XML_TYPE, token::XML_SIMPLE);
+
exportedProperty(_sPropertyName);
}
//---------------------------------------------------------------------
diff --git a/xmloff/source/forms/propertyexport.hxx b/xmloff/source/forms/propertyexport.hxx
index 5e1f683e339d..ab17912e4df4 100644
--- a/xmloff/source/forms/propertyexport.hxx
+++ b/xmloff/source/forms/propertyexport.hxx
@@ -69,7 +69,7 @@ namespace xmloff
StringSet m_aRemainingProps;
// see examinePersistence
- void exportRelativeTargetLocation(const ConstAsciiString& _sPropertyName,sal_Int32 _nProperty);
+ void exportRelativeTargetLocation(const ConstAsciiString& _sPropertyName,sal_Int32 _nProperty,bool _bAddType);
protected:
IFormsExportContext& m_rContext;
@@ -230,8 +230,10 @@ namespace xmloff
<p>The value of this attribute is extracted from the TargetURL property of the object given.</p>
<p>The property needs a special handling because the URL's need to be made relative</p>
+
+ <p>If _bAddType is set, an additional xlink:type="simple" attribute is also added.</p>
*/
- inline void exportTargetLocationAttribute() { exportRelativeTargetLocation(PROPERTY_TARGETURL,CCA_TARGET_LOCATION); }
+ inline void exportTargetLocationAttribute(bool _bAddType) { exportRelativeTargetLocation(PROPERTY_TARGETURL,CCA_TARGET_LOCATION,_bAddType); }
/** add the form:image attribute to the export context.
@@ -239,7 +241,7 @@ namespace xmloff
<p>The property needs a special handling because the URL's need to be made relative</p>
*/
- inline void exportImageDataAttribute() { exportRelativeTargetLocation(PROPERTY_IMAGEURL,CCA_IMAGE_DATA); }
+ inline void exportImageDataAttribute() { exportRelativeTargetLocation(PROPERTY_IMAGEURL,CCA_IMAGE_DATA,false); }
/** flag the style properties as 'already exported'
diff --git a/xmloff/source/forms/propertyimport.cxx b/xmloff/source/forms/propertyimport.cxx
index 67c8d06677fc..96b18e737543 100644
--- a/xmloff/source/forms/propertyimport.cxx
+++ b/xmloff/source/forms/propertyimport.cxx
@@ -363,7 +363,7 @@ void OPropertyImport::handleAttribute(sal_uInt16 /*_nNamespaceKey*/, const ::rtl
implPushBackPropertyValue( aNewValue );
}
#if OSL_DEBUG_LEVEL > 0
- else
+ else if (!token::IsXMLToken(_rLocalName, token::XML_TYPE)) // xlink:type is valid but ignored for <form:form>
{
::rtl::OString sMessage( "OPropertyImport::handleAttribute: Can't handle the following:\n" );
sMessage += ::rtl::OString( " Attribute name: " );
diff --git a/xmloff/source/forms/valueproperties.cxx b/xmloff/source/forms/valueproperties.cxx
index 3515dcf96010..1c44db963944 100644
--- a/xmloff/source/forms/valueproperties.cxx
+++ b/xmloff/source/forms/valueproperties.cxx
@@ -116,7 +116,7 @@ namespace xmloff
void OValuePropertiesMetaData::getValueLimitPropertyNames(sal_Int16 _nFormComponentType,
sal_Char const * & _rpMinValuePropertyName, sal_Char const * & _rpMaxValuePropertyName)
{
- _rpMinValuePropertyName = _rpMinValuePropertyName = NULL;
+ _rpMinValuePropertyName = _rpMaxValuePropertyName = NULL;
switch (_nFormComponentType)
{
case FormComponentType::DATEFIELD:
diff --git a/xmloff/source/meta/xmlmetae.cxx b/xmloff/source/meta/xmlmetae.cxx
index 70b06e8409c2..55e7cd97f810 100644
--- a/xmloff/source/meta/xmlmetae.cxx
+++ b/xmloff/source/meta/xmlmetae.cxx
@@ -475,7 +475,9 @@ SvXMLMetaExport::startElement(const ::rtl::OUString & i_rName,
}
// finally, start the element
- mrExport.StartElement(i_rName, sal_True); //FIXME:whitespace?
+ // #i107240# no whitespace here, because the DOM may already contain
+ // whitespace, which is not cleared when loading and thus accumulates.
+ mrExport.StartElement(i_rName, (m_level > 1) ? sal_False : sal_True);
++m_level;
}
diff --git a/xmloff/source/script/XMLEventExport.cxx b/xmloff/source/script/XMLEventExport.cxx
index e42db4dc164e..2675ecb4b98f 100644
--- a/xmloff/source/script/XMLEventExport.cxx
+++ b/xmloff/source/script/XMLEventExport.cxx
@@ -62,7 +62,8 @@ using ::xmloff::token::XML_EVENT_LISTENERS;
XMLEventExport::XMLEventExport(SvXMLExport& rExp,
const XMLEventNameTranslation* pTranslationTable) :
sEventType(RTL_CONSTASCII_USTRINGPARAM("EventType")),
- rExport(rExp)
+ rExport(rExp),
+ bExtNamespace(false)
{
AddTranslationTable(pTranslationTable);
}
@@ -175,6 +176,16 @@ void XMLEventExport::Export( Reference<XNameAccess> & rAccess,
}
}
+void XMLEventExport::ExportExt( Reference<XNameAccess> & rAccess,
+ sal_Bool bWhitespace )
+{
+ // set bExtNamespace flag to use XML_NAMESPACE_OFFICE_EXT namespace
+ // for events element (not for child elements)
+ bExtNamespace = true;
+ Export(rAccess, bWhitespace);
+ bExtNamespace = false; // reset for future Export calls
+}
+
/// export a singular event and wirte <office:events> container
void XMLEventExport::ExportSingleEvent(
Sequence<PropertyValue>& rEventValues,
@@ -270,13 +281,17 @@ void XMLEventExport::StartElement(sal_Bool bWhitespace)
{
rExport.IgnorableWhitespace();
}
- rExport.StartElement( XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS,
+ sal_uInt16 nNamespace = bExtNamespace ? XML_NAMESPACE_OFFICE_EXT
+ : XML_NAMESPACE_OFFICE;
+ rExport.StartElement( nNamespace, XML_EVENT_LISTENERS,
bWhitespace);
}
void XMLEventExport::EndElement(sal_Bool bWhitespace)
{
- rExport.EndElement(XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, bWhitespace);
+ sal_uInt16 nNamespace = bExtNamespace ? XML_NAMESPACE_OFFICE_EXT
+ : XML_NAMESPACE_OFFICE;
+ rExport.EndElement(nNamespace, XML_EVENT_LISTENERS, bWhitespace);
if (bWhitespace)
{
rExport.IgnorableWhitespace();
@@ -343,6 +358,10 @@ const XMLEventNameTranslation aStandardEventTable[] =
{ "OnFieldMerge", XML_NAMESPACE_OFFICE, "field-merge" },
{ "OnFieldMergeFinished", XML_NAMESPACE_OFFICE, "field-merge-finished" },
{ "OnLayoutFinished", XML_NAMESPACE_OFFICE, "layout-finished" },
+ { "OnDoubleClick", XML_NAMESPACE_OFFICE, "dblclick" },
+ { "OnRightClick", XML_NAMESPACE_OFFICE, "contextmenu" },
+ { "OnChange", XML_NAMESPACE_OFFICE, "content-changed" },
+ { "OnCalculate", XML_NAMESPACE_OFFICE, "calculated" },
{ NULL, 0, 0 }
};
diff --git a/xmloff/source/script/XMLScriptExportHandler.cxx b/xmloff/source/script/XMLScriptExportHandler.cxx
index 6f0b6bebc7ac..9cfc7211f3b9 100644
--- a/xmloff/source/script/XMLScriptExportHandler.cxx
+++ b/xmloff/source/script/XMLScriptExportHandler.cxx
@@ -75,6 +75,9 @@ void XMLScriptExportHandler::Export(
OUString sTmp;
rValues[i].Value >>= sTmp;
rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, sTmp);
+
+ // #i110911# xlink:type="simple" is required
+ rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE);
}
// else: disregard
}
diff --git a/xmloff/source/style/WordWrapPropertyHdl.cxx b/xmloff/source/style/WordWrapPropertyHdl.cxx
index 28379af945ac..f3717b95c9cd 100644
--- a/xmloff/source/style/WordWrapPropertyHdl.cxx
+++ b/xmloff/source/style/WordWrapPropertyHdl.cxx
@@ -29,7 +29,6 @@
#include "precompiled_xmloff.hxx"
#include <xmloff/xmlimp.hxx>
#include <xmloff/WordWrapPropertyHdl.hxx>
-#include "xmloff/xmlkywd.hxx"
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmluconv.hxx>
#include <comphelper/extract.hxx>
diff --git a/xmloff/source/style/XMLClipPropertyHandler.cxx b/xmloff/source/style/XMLClipPropertyHandler.cxx
index 9bec79876396..f90e3346c1ba 100644
--- a/xmloff/source/style/XMLClipPropertyHandler.cxx
+++ b/xmloff/source/style/XMLClipPropertyHandler.cxx
@@ -32,7 +32,6 @@
#include <rtl/ustrbuf.hxx>
#include <com/sun/star/text/GraphicCrop.hpp>
#include <xmloff/xmluconv.hxx>
-#include <xmloff/xmlkywd.hxx>
#include <xmloff/xmltoken.hxx>
using ::rtl::OUString;
@@ -77,7 +76,7 @@ sal_Bool XMLClipPropertyHandler::importXML( const OUString& rStrImpValue, uno::A
sal_Bool bRet = sal_False;
sal_Int32 nLen = rStrImpValue.getLength();
if( nLen > 6 &&
- 0 == rStrImpValue.compareToAscii( sXML_rect, 4 ) &&
+ 0 == rStrImpValue.compareTo( GetXMLToken(XML_RECT), 4 ) &&
rStrImpValue[4] == '(' &&
rStrImpValue[nLen-1] == ')' )
{
diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx
index 1d9d9af9c7b2..f9e5e298460d 100644
--- a/xmloff/source/style/XMLFontAutoStylePool.cxx
+++ b/xmloff/source/style/XMLFontAutoStylePool.cxx
@@ -33,12 +33,11 @@
#include "xmloff/xmlnmspe.hxx"
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmluconv.hxx>
-#ifndef _XMLOFF_PROPERTYHANDLER_FONTTYPES_HXX
#include "fonthdl.hxx"
-#endif
#include <xmloff/xmlexp.hxx>
#include <xmloff/XMLFontAutoStylePool.hxx>
+
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
diff --git a/xmloff/source/style/XMLFontStylesContext.cxx b/xmloff/source/style/XMLFontStylesContext.cxx
index b2715b1852a1..c36fd4c55fab 100644
--- a/xmloff/source/style/XMLFontStylesContext.cxx
+++ b/xmloff/source/style/XMLFontStylesContext.cxx
@@ -28,25 +28,20 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
-#ifndef _COM_SUN_STAR_AWT_FONTFAMILY_HPP
#include <com/sun/star/awt/FontFamily.hpp>
-#endif
-#ifndef _COM_SUN_STAR_AWT_FONTPITCH_HPP
#include <com/sun/star/awt/FontPitch.hpp>
-#endif
+
+#include <rtl/logfile.hxx>
+
#include <xmloff/nmspmap.hxx>
#include "xmloff/xmlnmspe.hxx"
#include <xmloff/xmltoken.hxx>
-#ifndef _XMLOFF_PROPERTYHANDLER_FONTTYPES_HXX
#include "fonthdl.hxx"
-#endif
#include <xmloff/xmlimp.hxx>
#include <xmloff/maptype.hxx>
-
-#ifndef _XMLOFF_XMLFONTSTYLESCONTEXT_HXX
#include <xmloff/XMLFontStylesContext.hxx>
-#endif
-#include <rtl/logfile.hxx>
+
+
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
diff --git a/xmloff/source/style/XMLRectangleMembersHandler.cxx b/xmloff/source/style/XMLRectangleMembersHandler.cxx
index 07334f2137db..acd53e2dfd4e 100644
--- a/xmloff/source/style/XMLRectangleMembersHandler.cxx
+++ b/xmloff/source/style/XMLRectangleMembersHandler.cxx
@@ -48,11 +48,6 @@ XMLRectangleMembersHdl::XMLRectangleMembersHdl( sal_Int32 nType )
{
}
- sal_Int32 X;
- sal_Int32 Y;
- sal_Int32 Width;
- sal_Int32 Height;
-
XMLRectangleMembersHdl::~XMLRectangleMembersHdl()
{
}
diff --git a/xmloff/source/style/adjushdl.cxx b/xmloff/source/style/adjushdl.cxx
index 7e7ceb961c36..027bebdb8075 100644
--- a/xmloff/source/style/adjushdl.cxx
+++ b/xmloff/source/style/adjushdl.cxx
@@ -35,10 +35,6 @@
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include <com/sun/star/uno/Any.hxx>
-#ifndef _XMLOFF_XMLEMENT_HXX
-#include <xmloff/xmlelement.hxx>
-#endif
-
using namespace ::com::sun::star;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
diff --git a/xmloff/source/style/backhdl.cxx b/xmloff/source/style/backhdl.cxx
index 476a9a0a97e9..df02a6504bac 100644
--- a/xmloff/source/style/backhdl.cxx
+++ b/xmloff/source/style/backhdl.cxx
@@ -34,10 +34,6 @@
#include <com/sun/star/uno/Any.hxx>
#include <rtl/ustrbuf.hxx>
-#ifndef _XMLOFF_XMLEMENT_HXX
-#include <xmloff/xmlelement.hxx>
-#endif
-
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
diff --git a/xmloff/source/style/bordrhdl.cxx b/xmloff/source/style/bordrhdl.cxx
index cddf587184b6..5611bbd1f472 100644
--- a/xmloff/source/style/bordrhdl.cxx
+++ b/xmloff/source/style/bordrhdl.cxx
@@ -34,10 +34,6 @@
#include <xmloff/xmluconv.hxx>
#include <rtl/ustrbuf.hxx>
#include <com/sun/star/uno/Any.hxx>
-
-#ifndef _XMLOFF_XMLEMENT_HXX
-#include <xmloff/xmlelement.hxx>
-#endif
#include <com/sun/star/table/BorderLine.hpp>
using ::rtl::OUString;
diff --git a/xmloff/source/style/breakhdl.cxx b/xmloff/source/style/breakhdl.cxx
index 0ebe3af8a385..d95cd2e5e91a 100644
--- a/xmloff/source/style/breakhdl.cxx
+++ b/xmloff/source/style/breakhdl.cxx
@@ -34,10 +34,6 @@
#include <com/sun/star/style/BreakType.hpp>
#include <com/sun/star/uno/Any.hxx>
-#ifndef _XMLOFF_XMLEMENT_HXX
-#include <xmloff/xmlelement.hxx>
-#endif
-
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
diff --git a/xmloff/source/style/cdouthdl.cxx b/xmloff/source/style/cdouthdl.cxx
index f314a2b813f0..c5f764cf9ac4 100644
--- a/xmloff/source/style/cdouthdl.cxx
+++ b/xmloff/source/style/cdouthdl.cxx
@@ -32,15 +32,9 @@
#include <xmloff/xmluconv.hxx>
#include <rtl/ustrbuf.hxx>
-#ifndef _COM_SUN_STAR_AWT_FONTSTRIKEOUT_HPP
#include <com/sun/star/awt/FontStrikeout.hpp>
-#endif
#include <com/sun/star/uno/Any.hxx>
-#ifndef _XMLOFF_XMLEMENT_HXX
-#include <xmloff/xmlelement.hxx>
-#endif
-
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
diff --git a/xmloff/source/style/chrhghdl.cxx b/xmloff/source/style/chrhghdl.cxx
index a3076ca4c864..1a70696583d2 100644
--- a/xmloff/source/style/chrhghdl.cxx
+++ b/xmloff/source/style/chrhghdl.cxx
@@ -35,10 +35,6 @@
#include <rtl/ustrbuf.hxx>
#include <com/sun/star/uno/Any.hxx>
-#ifndef _XMLOFF_XMLEMENT_HXX
-#include <xmloff/xmlelement.hxx>
-#endif
-
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
diff --git a/xmloff/source/style/chrlohdl.cxx b/xmloff/source/style/chrlohdl.cxx
index b1b0a01d93f8..06778d67576f 100644
--- a/xmloff/source/style/chrlohdl.cxx
+++ b/xmloff/source/style/chrlohdl.cxx
@@ -34,10 +34,6 @@
#include <xmloff/xmluconv.hxx>
#include <rtl/ustrbuf.hxx>
#include <com/sun/star/uno/Any.hxx>
-
-#ifndef _XMLOFF_XMLEMENT_HXX
-#include <xmloff/xmlelement.hxx>
-#endif
#include <com/sun/star/lang/Locale.hpp>
using ::rtl::OUString;
diff --git a/xmloff/source/style/csmaphdl.cxx b/xmloff/source/style/csmaphdl.cxx
index 023153eda552..0a29de364bce 100644
--- a/xmloff/source/style/csmaphdl.cxx
+++ b/xmloff/source/style/csmaphdl.cxx
@@ -32,14 +32,8 @@
#include <xmloff/xmluconv.hxx>
#include <rtl/ustrbuf.hxx>
#include <com/sun/star/style/CaseMap.hpp>
-
-
#include <com/sun/star/uno/Any.hxx>
-#ifndef _XMLOFF_XMLEMENT_HXX
-#include <xmloff/xmlelement.hxx>
-#endif
-
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
diff --git a/xmloff/source/style/escphdl.cxx b/xmloff/source/style/escphdl.cxx
index 337ff5cdbb60..548f867d6606 100644
--- a/xmloff/source/style/escphdl.cxx
+++ b/xmloff/source/style/escphdl.cxx
@@ -35,10 +35,6 @@
#include <rtl/ustrbuf.hxx>
#include <com/sun/star/uno/Any.hxx>
-#ifndef _XMLOFF_XMLEMENT_HXX
-#include <xmloff/xmlelement.hxx>
-#endif
-
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
diff --git a/xmloff/source/style/fonthdl.cxx b/xmloff/source/style/fonthdl.cxx
index 04e0b36609cd..89ad6e9db8b8 100644
--- a/xmloff/source/style/fonthdl.cxx
+++ b/xmloff/source/style/fonthdl.cxx
@@ -28,18 +28,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
-#ifndef _XMLOFF_PROPERTYHANDLER_FONTTYPES_HXX
#include <fonthdl.hxx>
-#endif
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmluconv.hxx>
#include <rtl/ustrbuf.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <tools/fontenum.hxx>
-#ifndef _XMLOFF_XMLEMENT_HXX
-#include <xmloff/xmlelement.hxx>
-#endif
#include <tools/string.hxx>
using ::rtl::OUString;
diff --git a/xmloff/source/style/fonthdl.hxx b/xmloff/source/style/fonthdl.hxx
index 49d027579af3..18ddae73af14 100644
--- a/xmloff/source/style/fonthdl.hxx
+++ b/xmloff/source/style/fonthdl.hxx
@@ -25,8 +25,8 @@
*
************************************************************************/
-#ifndef _XMLOFF_PROPERTYHANDLER_FONTYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_FONTTYPES_HXX
+#ifndef XMLOFF_PROPERTYHANDLER_FONTTYPES_HXX
+#define XMLOFF_PROPERTYHANDLER_FONTTYPES_HXX
#include <xmloff/xmlprhdl.hxx>
@@ -79,4 +79,4 @@ public:
};
-#endif // _XMLOFF_PROPERTYHANDLER_FONTTYPES_HXX
+#endif // XMLOFF_PROPERTYHANDLER_FONTTYPES_HXX
diff --git a/xmloff/source/style/lspachdl.cxx b/xmloff/source/style/lspachdl.cxx
index dd47749d205b..6ea6221a0b27 100644
--- a/xmloff/source/style/lspachdl.cxx
+++ b/xmloff/source/style/lspachdl.cxx
@@ -37,10 +37,6 @@
#include <com/sun/star/style/LineSpacing.hpp>
#include <com/sun/star/style/LineSpacingMode.hpp>
-#ifndef _XMLOFF_XMLEMENT_HXX
-#include <xmloff/xmlelement.hxx>
-#endif
-
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
diff --git a/xmloff/source/style/postuhdl.cxx b/xmloff/source/style/postuhdl.cxx
index 28cda4eba8b6..b0885b539d4b 100644
--- a/xmloff/source/style/postuhdl.cxx
+++ b/xmloff/source/style/postuhdl.cxx
@@ -35,10 +35,6 @@
#include <com/sun/star/awt/FontSlant.hpp>
#include <tools/fontenum.hxx>
-#ifndef _XMLOFF_XMLEMENT_HXX
-#include <xmloff/xmlelement.hxx>
-#endif
-
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
diff --git a/xmloff/source/style/prhdlfac.cxx b/xmloff/source/style/prhdlfac.cxx
index af5448040896..27af64469daf 100644
--- a/xmloff/source/style/prhdlfac.cxx
+++ b/xmloff/source/style/prhdlfac.cxx
@@ -27,10 +27,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
+
#include <com/sun/star/drawing/ColorMode.hpp>
#include <com/sun/star/text/HorizontalAdjust.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
+
#include <tools/debug.hxx>
+
#include <xmloff/prhdlfac.hxx>
#include <xmloff/xmltypes.hxx>
#include <xmloff/xmltoken.hxx>
@@ -39,9 +42,7 @@
#include <xmloff/XMLConstantsPropertyHandler.hxx>
#include "cdouthdl.hxx"
#include "csmaphdl.hxx"
-#ifndef _XMLOFF_PROPERTYHANDLER_FONTTYPES_HXX
#include "fonthdl.hxx"
-#endif
#include "kernihdl.hxx"
#include <postuhdl.hxx>
#include "shadwhdl.hxx"
diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx
index 0ae6a3ea7c6c..99bf9ce1476e 100644
--- a/xmloff/source/style/styleexp.cxx
+++ b/xmloff/source/style/styleexp.cxx
@@ -39,7 +39,6 @@
//#include "xmlitmap.hxx"
#endif
#include <xmloff/xmluconv.hxx>
-#include "xmloff/xmlkywd.hxx"
#include <xmloff/attrlist.hxx>
#include <xmloff/xmlprmap.hxx>
#include <xmloff/xmlexppr.hxx>
diff --git a/xmloff/source/style/undlihdl.cxx b/xmloff/source/style/undlihdl.cxx
index bbe9eea647b3..226ae3207e50 100644
--- a/xmloff/source/style/undlihdl.cxx
+++ b/xmloff/source/style/undlihdl.cxx
@@ -34,13 +34,7 @@
#include <com/sun/star/uno/Any.hxx>
-#ifndef _COM_SUN_STAR_AWT_FONTUNDERLINE_HPP
#include <com/sun/star/awt/FontUnderline.hpp>
-#endif
-
-#ifndef _XMLOFF_XMLEMENT_HXX
-#include <xmloff/xmlelement.hxx>
-#endif
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
diff --git a/xmloff/source/style/xmlimppr.cxx b/xmloff/source/style/xmlimppr.cxx
index 00e9acc21afd..1757e48560b9 100644
--- a/xmloff/source/style/xmlimppr.cxx
+++ b/xmloff/source/style/xmlimppr.cxx
@@ -40,7 +40,6 @@
#include <xmloff/xmlimppr.hxx>
#include <xmloff/xmlimp.hxx>
-#include "xmloff/xmlkywd.hxx"
#include "xmloff/unoatrcn.hxx"
#include "xmloff/xmlnmspe.hxx"
#include <xmloff/xmltoken.hxx>
diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx
index 4633881e66ae..448547f44717 100644
--- a/xmloff/source/style/xmlnume.cxx
+++ b/xmloff/source/style/xmlnume.cxx
@@ -27,15 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <tools/debug.hxx>
-#include <xmloff/nmspmap.hxx>
-#include "xmloff/xmlnmspe.hxx"
-#include <xmloff/xmltoken.hxx>
-#include <xmloff/xmluconv.hxx>
-#ifndef _XMLOFF_PROPERTYHANDLER_FONTTYPES_HXX
-#include "fonthdl.hxx"
-#endif
+
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/style/NumberingType.hpp>
#include <com/sun/star/style/XStyle.hpp>
@@ -52,11 +44,22 @@
// <--
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+
+#include <rtl/ustrbuf.hxx>
+
+#include <tools/debug.hxx>
+
+#include <xmloff/nmspmap.hxx>
+#include "xmloff/xmlnmspe.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmluconv.hxx>
+#include "fonthdl.hxx"
#include "xmloff/XMLTextListAutoStylePool.hxx"
#include <xmloff/xmlnume.hxx>
#include <xmloff/xmlexp.hxx>
#include <tools/fontenum.hxx>
+
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -294,9 +297,12 @@ void SvxXMLNumRuleExport::exportLevelStyle( INT32 nLevel,
OUStringBuffer sTmp;
sTmp.append( nLevel + 1 );
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_LEVEL, sTmp.makeStringAndClear() );
- if( sTextStyleName.getLength() > 0 )
+ // #i110694#: no style-name on list-level-style-image
+ if ((sTextStyleName.getLength() > 0) && (NumberingType::BITMAP != eType))
+ {
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME,
GetExport().EncodeStyleName( sTextStyleName ) );
+ }
if( sPrefix.getLength() > 0 )
GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NUM_PREFIX, sPrefix );
if( sSuffix.getLength() > 0 )
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 299e474c25f6..7ba79b221e79 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -2149,7 +2149,7 @@ sal_Bool lcl_IsAtEnd( rtl::OUStringBuffer& rBuffer, const String& rToken )
if ( nTokLen > nBufLen )
return sal_False;
- sal_Int32 nStartPos = nTokLen - nBufLen;
+ sal_Int32 nStartPos = nBufLen - nTokLen;
for ( xub_StrLen nTokPos = 0; nTokPos < nTokLen; nTokPos++ )
if ( rToken.GetChar( nTokPos ) != rBuffer.charAt( nStartPos + nTokPos ) )
return sal_False;
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index 092a96872c18..a55d65a235c6 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -27,16 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <tools/urlobj.hxx>
-#include <tools/debug.hxx>
-#include <tools/fontenum.hxx>
-#include <xmloff/xmltkmap.hxx>
-#include <xmloff/nmspmap.hxx>
-#include "xmloff/xmlnmspe.hxx"
-#include <xmloff/xmlimp.hxx>
-#include <xmloff/XMLBase64ImportContext.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/Size.hpp>
@@ -51,26 +42,33 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
+
+#include <rtl/ustrbuf.hxx>
+
+#include <tools/urlobj.hxx>
+#include <tools/debug.hxx>
+#include <tools/fontenum.hxx>
+
+#include <xmloff/xmltkmap.hxx>
+#include <xmloff/nmspmap.hxx>
+#include "xmloff/xmlnmspe.hxx"
+#include <xmloff/xmlimp.hxx>
+#include <xmloff/XMLBase64ImportContext.hxx>
#include <xmloff/xmltoken.hxx>
-#include "xmloff/i18nmap.hxx"
+#include <xmloff/i18nmap.hxx>
#include <xmloff/xmluconv.hxx>
-#ifndef _XMLOFF_PROPERTYHANDLER_FONTTYPES_HXX
#include "fonthdl.hxx"
-#endif
-#ifndef _XMLOFF_XMLFONTSTYLESCONTEXT_HXX
#include <xmloff/XMLFontStylesContext.hxx>
-#endif
-#ifndef _XMLOFF_FAMILIES_HXX
#include <xmloff/families.hxx>
-#endif
#include <xmloff/maptype.hxx>
-
#include <xmloff/xmlnumi.hxx>
#define _SVSTDARR_USHORTS
#include <svl/svstdarr.hxx>
+
+
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx
index 6e0a4ce6c3fb..6a31d7a7cc35 100644
--- a/xmloff/source/table/XMLTableExport.cxx
+++ b/xmloff/source/table/XMLTableExport.cxx
@@ -353,6 +353,8 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates )
// get the current row
Reference< XCellRange > xCellRange( xIndexAccess->getByIndex(rowIndex), UNO_QUERY_THROW );
+ OUString sDefaultCellStyle;
+
// table:style-name
if( pTableInfo.get() )
{
@@ -360,11 +362,11 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates )
const OUString sStyleName( pTableInfo->maRowStyleMap[xKey] );
if( sStyleName.getLength() )
mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_STYLE_NAME, sStyleName );
- }
- const OUString sDefaultCellStyle( pTableInfo->maDefaultRowCellStyles[rowIndex] );
- if( sDefaultCellStyle.getLength() )
- mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DEFAULT_CELL_STYLE_NAME, sDefaultCellStyle );
+ sDefaultCellStyle = pTableInfo->maDefaultRowCellStyles[rowIndex];
+ if( sDefaultCellStyle.getLength() )
+ mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DEFAULT_CELL_STYLE_NAME, sDefaultCellStyle );
+ }
// write row element
SvXMLElementExport tableRowElement( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True, sal_True );
diff --git a/xmloff/source/text/XMLChangedRegionImportContext.cxx b/xmloff/source/text/XMLChangedRegionImportContext.cxx
index 1a54614f497b..9560a8159a0e 100644
--- a/xmloff/source/text/XMLChangedRegionImportContext.cxx
+++ b/xmloff/source/text/XMLChangedRegionImportContext.cxx
@@ -68,6 +68,7 @@ void XMLChangedRegionImportContext::StartElement(
const Reference<XAttributeList> & xAttrList)
{
// process attributes: id
+ bool bHaveXmlId( false );
sal_Int16 nLength = xAttrList->getLength();
for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
{
@@ -77,11 +78,19 @@ void XMLChangedRegionImportContext::StartElement(
&sLocalName );
const OUString sValue = xAttrList->getValueByIndex(nAttr);
- if ( XML_NAMESPACE_TEXT == nPrefix )
+ if (XML_NAMESPACE_XML == nPrefix)
{
- if( IsXMLToken( sLocalName, XML_ID ) )
+ if (IsXMLToken(sLocalName, XML_ID))
{
sID = sValue;
+ bHaveXmlId = true;
+ }
+ }
+ else if (XML_NAMESPACE_TEXT == nPrefix)
+ {
+ if (IsXMLToken(sLocalName, XML_ID))
+ {
+ if (!bHaveXmlId) { sID = sValue; }
}
else if( IsXMLToken( sLocalName, XML_MERGE_LAST_PARAGRAPH ) )
{
diff --git a/xmloff/source/text/XMLIndexTOCContext.cxx b/xmloff/source/text/XMLIndexTOCContext.cxx
index 10fa0fe02073..2699111ab47a 100644
--- a/xmloff/source/text/XMLIndexTOCContext.cxx
+++ b/xmloff/source/text/XMLIndexTOCContext.cxx
@@ -50,14 +50,11 @@
#include <xmloff/txtimp.hxx>
#include <xmloff/nmspmap.hxx>
#include "xmloff/xmlnmspe.hxx"
-#include "xmloff/xmlkywd.hxx"
#include <xmloff/xmltoken.hxx>
#include <xmloff/prstylei.hxx>
#include "xmloff/xmlerror.hxx"
#include <xmloff/xmluconv.hxx>
-#include <tools/debug.hxx>
#include <rtl/ustring.hxx>
-#include <tools/debug.hxx>
using namespace ::com::sun::star::uno;
@@ -85,15 +82,15 @@ static const sal_Char* aIndexServiceMap[] =
"com.sun.star.text.IllustrationsIndex"
};
-static const sal_Char* aIndexSourceElementMap[] =
+static const XMLTokenEnum aIndexSourceElementMap[] =
{
- sXML_table_of_content_source,
- sXML_alphabetical_index_source,
- sXML_table_index_source,
- sXML_object_index_source,
- sXML_bibliography_source,
- sXML_user_index_source,
- sXML_illustration_index_source
+ XML_TABLE_OF_CONTENT_SOURCE,
+ XML_ALPHABETICAL_INDEX_SOURCE,
+ XML_TABLE_INDEX_SOURCE,
+ XML_OBJECT_INDEX_SOURCE,
+ XML_BIBLIOGRAPHY_SOURCE,
+ XML_USER_INDEX_SOURCE,
+ XML_ILLUSTRATION_INDEX_SOURCE
};
SvXMLEnumMapEntry __READONLY_DATA aIndexTypeMap[] =
@@ -117,7 +114,6 @@ XMLIndexTOCContext::XMLIndexTOCContext(
, sTitle(RTL_CONSTASCII_USTRINGPARAM("Title"))
, sIsProtected(RTL_CONSTASCII_USTRINGPARAM("IsProtected"))
, sName(RTL_CONSTASCII_USTRINGPARAM("Name"))
-, pSourceElementName(NULL)
, bValid(sal_False)
{
if (XML_NAMESPACE_TEXT == nPrfx)
@@ -126,13 +122,12 @@ XMLIndexTOCContext::XMLIndexTOCContext(
if (SvXMLUnitConverter::convertEnum(nTmp, rLocalName, aIndexTypeMap))
{
// check for array index:
- DBG_ASSERT(nTmp < (sizeof(aIndexServiceMap)/sizeof(sal_Char*)), "index out of range");
- DBG_ASSERT(sizeof(aIndexServiceMap) ==
+ OSL_ENSURE(nTmp < (sizeof(aIndexServiceMap)/sizeof(sal_Char*)), "index out of range");
+ OSL_ENSURE(sizeof(aIndexServiceMap) ==
sizeof(aIndexSourceElementMap),
"service and source element maps must be same size");
- eIndexType = (enum IndexTypeEnum)nTmp;
- pSourceElementName = aIndexSourceElementMap[eIndexType];
+ eIndexType = static_cast<IndexTypeEnum>(nTmp);
bValid = sal_True;
}
}
@@ -201,10 +196,6 @@ void XMLIndexTOCContext::StartElement(
OUString::createFromAscii(aIndexServiceMap[eIndexType]));
if( xIfc.is() )
{
-
- // xml:id for RDF metadata
- GetImport().SetXmlId(xIfc, sXmlId);
-
// get Property set
Reference<XPropertySet> xPropSet(xIfc, UNO_QUERY);
xTOCPropertySet = xPropSet;
@@ -246,6 +237,9 @@ void XMLIndexTOCContext::StartElement(
return;
}
+ // xml:id for RDF metadata
+ GetImport().SetXmlId(xIfc, sXmlId);
+
// b) insert marker and move cursor
rImport->InsertString(sMarker);
rImport->GetCursor()->goLeft(2, sal_False);
@@ -326,7 +320,7 @@ SvXMLImportContext* XMLIndexTOCContext::CreateChildContext(
xBodyContextRef = pContext;
}
}
- else if (0 == rLocalName.compareToAscii(pSourceElementName))
+ else if (IsXMLToken(rLocalName, aIndexSourceElementMap[eIndexType]))
{
// instantiate source context for the appropriate index type
switch (eIndexType)
@@ -367,7 +361,7 @@ SvXMLImportContext* XMLIndexTOCContext::CreateChildContext(
break;
default:
- DBG_ERROR("index type not implemented");
+ OSL_ENSURE(false, "index type not implemented");
break;
}
}
diff --git a/xmloff/source/text/XMLIndexTOCContext.hxx b/xmloff/source/text/XMLIndexTOCContext.hxx
index accaca5a3c53..66f045a5467d 100644
--- a/xmloff/source/text/XMLIndexTOCContext.hxx
+++ b/xmloff/source/text/XMLIndexTOCContext.hxx
@@ -73,9 +73,6 @@ class XMLIndexTOCContext : public SvXMLImportContext
enum IndexTypeEnum eIndexType;
- /** source element name (for CreateChildContext) */
- const sal_Char* pSourceElementName;
-
sal_Bool bValid;
SvXMLImportContextRef xBodyContextRef;
diff --git a/xmloff/source/text/XMLPropertyBackpatcher.cxx b/xmloff/source/text/XMLPropertyBackpatcher.cxx
index 45c5f63c6ec7..364096ad8185 100644
--- a/xmloff/source/text/XMLPropertyBackpatcher.cxx
+++ b/xmloff/source/text/XMLPropertyBackpatcher.cxx
@@ -30,9 +30,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/uno/Reference.h>
-#ifndef _RTL_USTRING
#include <rtl/ustring.hxx>
-#endif
#include <tools/debug.hxx>
#include "XMLPropertyBackpatcher.hxx"
#include <xmloff/txtimp.hxx> // XMLTextImportHelper partially implemented here
@@ -206,7 +204,34 @@ void XMLPropertyBackpatcher<A>::SetDefault()
template class XMLPropertyBackpatcher<sal_Int16>;
template class XMLPropertyBackpatcher<OUString>;
+struct SAL_DLLPRIVATE XMLTextImportHelper::BackpatcherImpl
+{
+ /// backpatcher for references to footnotes and endnotes
+ ::std::auto_ptr< XMLPropertyBackpatcher<sal_Int16> >
+ m_pFootnoteBackpatcher;
+
+ /// backpatchers for references to sequences
+ ::std::auto_ptr< XMLPropertyBackpatcher<sal_Int16> >
+ m_pSequenceIdBackpatcher;
+
+ ::std::auto_ptr< XMLPropertyBackpatcher< ::rtl::OUString> >
+ m_pSequenceNameBackpatcher;
+};
+
+::boost::shared_ptr<XMLTextImportHelper::BackpatcherImpl>
+XMLTextImportHelper::MakeBackpatcherImpl()
+{
+ // n.b.: the shared_ptr stores the dtor!
+ return ::boost::shared_ptr<BackpatcherImpl>(new BackpatcherImpl);
+}
+
+static ::rtl::OUString const& GetSequenceNumber()
+{
+ static ::rtl::OUString s_SequenceNumber(
+ RTL_CONSTASCII_USTRINGPARAM("SequenceNumber"));
+ return s_SequenceNumber;
+}
//
// XMLTextImportHelper
@@ -224,32 +249,34 @@ template class XMLPropertyBackpatcher<OUString>;
XMLPropertyBackpatcher<sal_Int16>& XMLTextImportHelper::GetFootnoteBP()
{
- if (NULL == pFootnoteBackpatcher)
+ if (!m_pBackpatcherImpl->m_pFootnoteBackpatcher.get())
{
- pFootnoteBackpatcher =
- new XMLPropertyBackpatcher<sal_Int16>(sSequenceNumber);
+ m_pBackpatcherImpl->m_pFootnoteBackpatcher.reset(
+ new XMLPropertyBackpatcher<sal_Int16>(GetSequenceNumber()));
}
- return *pFootnoteBackpatcher;
+ return *m_pBackpatcherImpl->m_pFootnoteBackpatcher;
}
XMLPropertyBackpatcher<sal_Int16>& XMLTextImportHelper::GetSequenceIdBP()
{
- if (NULL == pSequenceIdBackpatcher)
+ if (!m_pBackpatcherImpl->m_pSequenceIdBackpatcher.get())
{
- pSequenceIdBackpatcher =
- new XMLPropertyBackpatcher<sal_Int16>(sSequenceNumber);
+ m_pBackpatcherImpl->m_pSequenceIdBackpatcher.reset(
+ new XMLPropertyBackpatcher<sal_Int16>(GetSequenceNumber()));
}
- return *pSequenceIdBackpatcher;
+ return *m_pBackpatcherImpl->m_pSequenceIdBackpatcher;
}
XMLPropertyBackpatcher<OUString>& XMLTextImportHelper::GetSequenceNameBP()
{
- if (NULL == pSequenceNameBackpatcher)
+ static ::rtl::OUString s_SourceName(
+ RTL_CONSTASCII_USTRINGPARAM("SourceName"));
+ if (!m_pBackpatcherImpl->m_pSequenceNameBackpatcher.get())
{
- pSequenceNameBackpatcher =
- new XMLPropertyBackpatcher<OUString>(sSourceName);
+ m_pBackpatcherImpl->m_pSequenceNameBackpatcher.reset(
+ new XMLPropertyBackpatcher<OUString>(s_SourceName));
}
- return *pSequenceNameBackpatcher;
+ return *m_pBackpatcherImpl->m_pSequenceNameBackpatcher;
}
void XMLTextImportHelper::InsertFootnoteID(
@@ -283,9 +310,3 @@ void XMLTextImportHelper::ProcessSequenceReference(
GetSequenceNameBP().SetProperty(xPropSet, sXMLId);
}
-void XMLTextImportHelper::_FinitBackpatcher()
-{
- delete pFootnoteBackpatcher;
- delete pSequenceIdBackpatcher;
- delete pSequenceNameBackpatcher;
-}
diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx
index 4e8ea9dd42ee..7dee1ba94069 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -374,7 +374,7 @@ void XMLRedlineExport::ExportChangedRegion(
const Reference<XPropertySet> & rPropSet)
{
// Redline-ID
- rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_ID, GetRedlineID(rPropSet) );
+ rExport.AddAttributeIdLegacy(XML_NAMESPACE_TEXT, GetRedlineID(rPropSet));
// merge-last-paragraph
Any aAny = rPropSet->getPropertyValue(sMergeLastPara);
diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx
index ffd4cb32ba87..aee5f991b48e 100644
--- a/xmloff/source/text/XMLSectionExport.cxx
+++ b/xmloff/source/text/XMLSectionExport.cxx
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
#include "XMLSectionExport.hxx"
-#include <tools/debug.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
@@ -53,7 +52,6 @@
#include <com/sun/star/text/XTextFieldsSupplier.hpp>
#include <com/sun/star/text/XChapterNumberingSupplier.hpp>
#include <com/sun/star/text/ChapterFormat.hpp> //i90246
-#include "xmloff/xmlkywd.hxx"
#include <xmloff/xmltoken.hxx>
#include "xmloff/xmlnmspe.hxx"
#include <xmloff/families.hxx>
@@ -306,7 +304,7 @@ void XMLSectionExport::ExportSectionEnd(
break;
default:
- DBG_ERROR("unknown index type");
+ OSL_ENSURE(false, "unknown index type");
// default: skip index!
break;
}
@@ -332,7 +330,7 @@ void XMLSectionExport::ExportSectionEnd(
}
else
{
- DBG_ERROR("Need element name!");
+ OSL_ENSURE(false, "Need element name!");
}
}
// else: autostyles -> ignore
@@ -376,7 +374,7 @@ void XMLSectionExport::ExportIndexStart(
default:
// skip index
- DBG_ERROR("unknown index type");
+ OSL_ENSURE(false, "unknown index type");
break;
}
}
@@ -809,15 +807,15 @@ void XMLSectionExport::ExportBaseIndexStart(
GetExport().StartElement( XML_NAMESPACE_TEXT, eElement, sal_False );
}
-static const sal_Char* aTypeSourceElementNameMap[] =
+static const XMLTokenEnum aTypeSourceElementNameMap[] =
{
- sXML_table_of_content_source, // TOC
- sXML_table_index_source, // table index
- sXML_illustration_index_source, // illustration index
- sXML_object_index_source, // object index
- sXML_user_index_source, // user index
- sXML_alphabetical_index_source, // alphabetical index
- sXML_bibliography_source // bibliography
+ XML_TABLE_OF_CONTENT_SOURCE, // TOC
+ XML_TABLE_INDEX_SOURCE, // table index
+ XML_ILLUSTRATION_INDEX_SOURCE, // illustration index
+ XML_OBJECT_INDEX_SOURCE, // object index
+ XML_USER_INDEX_SOURCE, // user index
+ XML_ALPHABETICAL_INDEX_SOURCE, // alphabetical index
+ XML_BIBLIOGRAPHY_SOURCE // bibliography
};
void XMLSectionExport::ExportBaseIndexSource(
@@ -825,8 +823,8 @@ void XMLSectionExport::ExportBaseIndexSource(
const Reference<XPropertySet> & rPropertySet)
{
// check type
- DBG_ASSERT(eType >= TEXT_SECTION_TYPE_TOC, "illegal index type");
- DBG_ASSERT(eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY, "illegal index type");
+ OSL_ENSURE(eType >= TEXT_SECTION_TYPE_TOC, "illegal index type");
+ OSL_ENSURE(eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY, "illegal index type");
Any aAny;
@@ -854,8 +852,9 @@ void XMLSectionExport::ExportBaseIndexSource(
// the index source element (all indices)
SvXMLElementExport aElem(GetExport(),
XML_NAMESPACE_TEXT,
- aTypeSourceElementNameMap[
- eType - TEXT_SECTION_TYPE_TOC],
+ GetXMLToken(
+ aTypeSourceElementNameMap[
+ eType - TEXT_SECTION_TYPE_TOC]),
sal_True, sal_True);
// scope for title template (all indices)
@@ -918,15 +917,15 @@ void XMLSectionExport::ExportBaseIndexSource(
void XMLSectionExport::ExportBaseIndexBody(
SectionTypeEnum
- #ifdef DBG_UTIL
+ #if OSL_DEBUG_LEVEL > 0
eType
#endif
,
const Reference<XPropertySet> &)
{
// type not used; checked anyway.
- DBG_ASSERT(eType >= TEXT_SECTION_TYPE_TOC, "illegal index type");
- DBG_ASSERT(eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY, "illegal index type");
+ OSL_ENSURE(eType >= TEXT_SECTION_TYPE_TOC, "illegal index type");
+ OSL_ENSURE(eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY, "illegal index type");
// export start only
@@ -969,23 +968,23 @@ void XMLSectionExport::ExportTableAndIllustrationIndexSourceAttributes(
// map index of LevelFormats to attribute value;
// level 0 is always the header
-static const sal_Char* aLevelNameTOCMap[] =
- { NULL, sXML_1, sXML_2, sXML_3, sXML_4, sXML_5, sXML_6, sXML_7,
- sXML_8, sXML_9, sXML_10, NULL };
-static const sal_Char* aLevelNameTableMap[] =
- { NULL, "", NULL };
-static const sal_Char* aLevelNameAlphaMap[] =
- { NULL, sXML_separator, sXML_1, sXML_2, sXML_3, NULL };
-static const sal_Char* aLevelNameBibliographyMap[] =
- { NULL, sXML_article, sXML_book, sXML_booklet, sXML_conference,
- sXML_custom1, sXML_custom2, sXML_custom3, sXML_custom4,
- sXML_custom5, sXML_email, sXML_inbook, sXML_incollection,
- sXML_inproceedings, sXML_journal,
- sXML_manual, sXML_mastersthesis, sXML_misc, sXML_phdthesis,
- sXML_proceedings, sXML_techreport, sXML_unpublished, sXML_www,
- NULL };
-
-static const sal_Char** aTypeLevelNameMap[] =
+static const XMLTokenEnum aLevelNameTOCMap[] =
+ { XML_TOKEN_INVALID, XML_1, XML_2, XML_3, XML_4, XML_5, XML_6, XML_7,
+ XML_8, XML_9, XML_10, XML_TOKEN_INVALID };
+static const XMLTokenEnum aLevelNameTableMap[] =
+ { XML_TOKEN_INVALID, XML__EMPTY, XML_TOKEN_INVALID };
+static const XMLTokenEnum aLevelNameAlphaMap[] =
+ { XML_TOKEN_INVALID, XML_SEPARATOR, XML_1, XML_2, XML_3, XML_TOKEN_INVALID };
+static const XMLTokenEnum aLevelNameBibliographyMap[] =
+ { XML_TOKEN_INVALID, XML_ARTICLE, XML_BOOK, XML_BOOKLET, XML_CONFERENCE,
+ XML_CUSTOM1, XML_CUSTOM2, XML_CUSTOM3, XML_CUSTOM4,
+ XML_CUSTOM5, XML_EMAIL, XML_INBOOK, XML_INCOLLECTION,
+ XML_INPROCEEDINGS, XML_JOURNAL,
+ XML_MANUAL, XML_MASTERSTHESIS, XML_MISC, XML_PHDTHESIS,
+ XML_PROCEEDINGS, XML_TECHREPORT, XML_UNPUBLISHED, XML_WWW,
+ XML_TOKEN_INVALID };
+
+static const XMLTokenEnum* aTypeLevelNameMap[] =
{
aLevelNameTOCMap, // TOC
aLevelNameTableMap, // table index
@@ -1029,26 +1028,26 @@ static const sal_Char** aTypeLevelStylePropNameMap[] =
aLevelStylePropNameBibliographyMap // bibliography
};
-static const sal_Char* aTypeLevelAttrMap[] =
+static const XMLTokenEnum aTypeLevelAttrMap[] =
{
- sXML_outline_level, // TOC
- NULL, // table index
- NULL, // illustration index
- NULL, // object index
- sXML_outline_level, // user index
- sXML_outline_level, // alphabetical index
- sXML_bibliography_type // bibliography
+ XML_OUTLINE_LEVEL, // TOC
+ XML_TOKEN_INVALID, // table index
+ XML_TOKEN_INVALID, // illustration index
+ XML_TOKEN_INVALID, // object index
+ XML_OUTLINE_LEVEL, // user index
+ XML_OUTLINE_LEVEL, // alphabetical index
+ XML_BIBLIOGRAPHY_TYPE // bibliography
};
-static const sal_Char* aTypeElementNameMap[] =
+static const XMLTokenEnum aTypeElementNameMap[] =
{
- sXML_table_of_content_entry_template, // TOC
- sXML_table_index_entry_template, // table index
- sXML_illustration_index_entry_template, // illustration index
- sXML_object_index_entry_template, // object index
- sXML_user_index_entry_template, // user index
- sXML_alphabetical_index_entry_template, // alphabetical index
- sXML_bibliography_entry_template // bibliography
+ XML_TABLE_OF_CONTENT_ENTRY_TEMPLATE, // TOC
+ XML_TABLE_INDEX_ENTRY_TEMPLATE, // table index
+ XML_ILLUSTRATION_INDEX_ENTRY_TEMPLATE, // illustration index
+ XML_OBJECT_INDEX_ENTRY_TEMPLATE, // object index
+ XML_USER_INDEX_ENTRY_TEMPLATE, // user index
+ XML_ALPHABETICAL_INDEX_ENTRY_TEMPLATE, // alphabetical index
+ XML_BIBLIOGRAPHY_ENTRY_TEMPLATE // bibliography
};
@@ -1058,44 +1057,44 @@ sal_Bool XMLSectionExport::ExportIndexTemplate(
const Reference<XPropertySet> & rPropertySet,
Sequence<Sequence<PropertyValue> > & rValues)
{
- DBG_ASSERT(eType >= TEXT_SECTION_TYPE_TOC, "illegal index type");
- DBG_ASSERT(eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY, "illegal index type");
- DBG_ASSERT(nOutlineLevel >= 0, "illegal outline level");
+ OSL_ENSURE(eType >= TEXT_SECTION_TYPE_TOC, "illegal index type");
+ OSL_ENSURE(eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY, "illegal index type");
+ OSL_ENSURE(nOutlineLevel >= 0, "illegal outline level");
if ( (eType >= TEXT_SECTION_TYPE_TOC) &&
(eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY) &&
(nOutlineLevel >= 0) )
{
// get level name and level attribute name from aLevelNameMap;
- const sal_Char* pLevelAttrName =
- aTypeLevelAttrMap[eType-TEXT_SECTION_TYPE_TOC];
- const sal_Char* pLevelName =
- aTypeLevelNameMap[eType-TEXT_SECTION_TYPE_TOC][nOutlineLevel];
+ const XMLTokenEnum eLevelAttrName(
+ aTypeLevelAttrMap[eType-TEXT_SECTION_TYPE_TOC]);
+ const XMLTokenEnum eLevelName(
+ aTypeLevelNameMap[eType-TEXT_SECTION_TYPE_TOC][nOutlineLevel]);
// #92124#: some old documents may be broken, then they have
// too many template levels; we need to recognize this and
// export only as many as is legal for the respective index
// type. To do this, we simply return an error flag, which
// will then abort further template level exports.
- DBG_ASSERT(NULL != pLevelName, "can't find level name");
- if ( NULL == pLevelName )
+ OSL_ENSURE(XML_TOKEN_INVALID != eLevelName, "can't find level name");
+ if ( XML_TOKEN_INVALID == eLevelName )
{
// output level not found? Then end of templates! #91214#
return sal_False;
}
// output level name
- if ((NULL != pLevelName) && (NULL != pLevelAttrName))
+ if ((XML_TOKEN_INVALID != eLevelName) && (XML_TOKEN_INVALID != eLevelAttrName))
{
- GetExport().AddAttributeASCII(XML_NAMESPACE_TEXT,
- pLevelAttrName,
- pLevelName);
+ GetExport().AddAttribute(XML_NAMESPACE_TEXT,
+ GetXMLToken(eLevelAttrName),
+ GetXMLToken(eLevelName));
}
// paragraph level style name
- const sal_Char* pPropName =
- aTypeLevelStylePropNameMap[eType-TEXT_SECTION_TYPE_TOC][nOutlineLevel];
- DBG_ASSERT(NULL != pPropName, "can't find property name");
+ const sal_Char* pPropName(
+ aTypeLevelStylePropNameMap[eType-TEXT_SECTION_TYPE_TOC][nOutlineLevel]);
+ OSL_ENSURE(NULL != pPropName, "can't find property name");
if (NULL != pPropName)
{
Any aAny = rPropertySet->getPropertyValue(
@@ -1108,11 +1107,11 @@ sal_Bool XMLSectionExport::ExportIndexTemplate(
}
// template element
- const sal_Char* pElementName =
- aTypeElementNameMap[eType - TEXT_SECTION_TYPE_TOC];
+ const XMLTokenEnum eElementName(
+ aTypeElementNameMap[eType - TEXT_SECTION_TYPE_TOC]);
SvXMLElementExport aLevelTemplate(GetExport(),
XML_NAMESPACE_TEXT,
- pElementName,
+ GetXMLToken(eElementName),
sal_True, sal_True);
// export sequence
@@ -1353,39 +1352,46 @@ void XMLSectionExport::ExportIndexTemplateElement(
}
// convert type to token (and check validity) ...
- sal_Char* pElement = NULL;
+ XMLTokenEnum eElement(XML_TOKEN_INVALID);
switch(nTokenType)
{
case TOK_TTYPE_ENTRY_TEXT:
- pElement = sXML_index_entry_text;
+ eElement = XML_INDEX_ENTRY_TEXT;
break;
case TOK_TTYPE_TAB_STOP:
// test validity
- pElement = ( bRightAligned || bTabPositionOK || bFillCharOK )
- ? sXML_index_entry_tab_stop : NULL;
+ if ( bRightAligned || bTabPositionOK || bFillCharOK )
+ {
+ eElement = XML_INDEX_ENTRY_TAB_STOP;
+ }
break;
case TOK_TTYPE_TEXT:
// test validity
- pElement = bTextOK ? sXML_index_entry_span : NULL;
+ if (bTextOK)
+ {
+ eElement = XML_INDEX_ENTRY_SPAN;
+ }
break;
case TOK_TTYPE_PAGE_NUMBER:
- pElement = sXML_index_entry_page_number;
+ eElement = XML_INDEX_ENTRY_PAGE_NUMBER;
break;
case TOK_TTYPE_CHAPTER_INFO: // keyword index
- pElement = sXML_index_entry_chapter;
+ eElement = XML_INDEX_ENTRY_CHAPTER;
break;
case TOK_TTYPE_ENTRY_NUMBER: // table of content
- pElement = sXML_index_entry_chapter;
+ eElement = XML_INDEX_ENTRY_CHAPTER;
break;
case TOK_TTYPE_HYPERLINK_START:
- pElement = sXML_index_entry_link_start;
+ eElement = XML_INDEX_ENTRY_LINK_START;
break;
case TOK_TTYPE_HYPERLINK_END:
- pElement = sXML_index_entry_link_end;
+ eElement = XML_INDEX_ENTRY_LINK_END;
break;
case TOK_TTYPE_BIBLIOGRAPHY:
- pElement = bBibliographyDataOK
- ? sXML_index_entry_bibliography : NULL;
+ if (bBibliographyDataOK)
+ {
+ eElement = XML_INDEX_ENTRY_BIBLIOGRAPHY;
+ }
break;
default:
; // unknown/unimplemented template
@@ -1404,7 +1410,7 @@ void XMLSectionExport::ExportIndexTemplateElement(
//it's not permitted in other indexes
if (eType != TEXT_SECTION_TYPE_ALPHABETICAL)
{
- pElement = NULL; //not permitted, null the element
+ eElement = XML_TOKEN_INVALID; //not permitted, invalidate the element
}
else //maps format for 1.1 & 1.0
{
@@ -1447,7 +1453,7 @@ void XMLSectionExport::ExportIndexTemplateElement(
//<---
// ... and write Element
- if (pElement != NULL)
+ if (eElement != XML_TOKEN_INVALID)
{
// character style (for most templates)
if (bCharStyleOK)
@@ -1510,7 +1516,7 @@ void XMLSectionExport::ExportIndexTemplateElement(
// bibliography data
if (TOK_TTYPE_BIBLIOGRAPHY == nTokenType)
{
- DBG_ASSERT(bBibliographyDataOK, "need bibl data");
+ OSL_ENSURE(bBibliographyDataOK, "need bibl data");
OUStringBuffer sBuf;
if (SvXMLUnitConverter::convertEnum( sBuf, nBibliographyData,
aBibliographyDataFieldMap ) )
@@ -1524,7 +1530,7 @@ void XMLSectionExport::ExportIndexTemplateElement(
// chapter info
if (TOK_TTYPE_CHAPTER_INFO == nTokenType)
{
- DBG_ASSERT(bChapterFormatOK, "need chapter info");
+ OSL_ENSURE(bChapterFormatOK, "need chapter info");
GetExport().AddAttribute(
XML_NAMESPACE_TEXT, XML_DISPLAY,
XMLTextFieldExport::MapChapterDisplayFormat(nChapterFormat));
@@ -1550,7 +1556,9 @@ void XMLSectionExport::ExportIndexTemplateElement(
//<---
// export template
SvXMLElementExport aTemplateElement(GetExport(), XML_NAMESPACE_TEXT,
- pElement, sal_True, sal_False);
+ GetXMLToken(eElement),
+ sal_True, sal_False)
+ ;
// entry text or span element: write text
if (TOK_TTYPE_TEXT == nTokenType)
@@ -1614,7 +1622,7 @@ void XMLSectionExport::ExportBoolean(
sal_Bool bDefault,
sal_Bool bInvert)
{
- DBG_ASSERT(eAttributeName != XML_TOKEN_INVALID, "Need attribute name");
+ OSL_ENSURE(eAttributeName != XML_TOKEN_INVALID, "Need attribute name");
Any aAny = rPropSet->getPropertyValue(sPropertyName);
sal_Bool bTmp = *(sal_Bool*)aAny.getValue();
@@ -1656,7 +1664,7 @@ void XMLSectionExport::ExportBibliographyConfiguration(SvXMLExport& rExport)
Reference<XPropertySet> xPropSet;
aAny >>= xPropSet;
- DBG_ASSERT( xPropSet.is(), "field master must have XPropSet" );
+ OSL_ENSURE( xPropSet.is(), "field master must have XPropSet" );
const OUString sBracketBefore(
RTL_CONSTASCII_USTRINGPARAM("BracketBefore"));
@@ -1843,7 +1851,7 @@ sal_Bool XMLSectionExport::IsInSection(
{
// default: like default argument
sal_Bool bRet = bDefault;
- DBG_ASSERT(rEnclosingSection.is(), "enclosing section expected");
+ OSL_ENSURE(rEnclosingSection.is(), "enclosing section expected");
Reference<XPropertySet> xPropSet(rContent, UNO_QUERY);
if (xPropSet.is())
diff --git a/xmloff/source/text/XMLSectionImportContext.cxx b/xmloff/source/text/XMLSectionImportContext.cxx
index c51f18fb606a..890c55140ee4 100644
--- a/xmloff/source/text/XMLSectionImportContext.cxx
+++ b/xmloff/source/text/XMLSectionImportContext.cxx
@@ -161,9 +161,6 @@ void XMLSectionImportContext::StartElement(
// save PropertySet (for CreateChildContext)
xSectionPropertySet = xPropSet;
- // xml:id for RDF metadata
- GetImport().SetXmlId(xIfc, sXmlId);
-
// name
Reference<XNamed> xNamed(xPropSet, UNO_QUERY);
xNamed->setName(sName);
@@ -253,6 +250,9 @@ void XMLSectionImportContext::StartElement(
// finally, check for redlines that should start at
// the section start node
rHelper->RedlineAdjustStartNodeCursor(sal_True); // start ???
+
+ // xml:id for RDF metadata
+ GetImport().SetXmlId(xIfc, sXmlId);
}
}
}
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index 689113db9c6a..3216c6f05618 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -43,7 +43,6 @@
#include <xmloff/xmlimp.hxx>
#include <xmloff/xmltoken.hxx>
#include "xmloff/xmlnmspe.hxx"
-#include "xmloff/xmlkywd.hxx"
#include <xmloff/nmspmap.hxx>
#include <xmloff/xmluconv.hxx>
#include "XMLAnchorTypePropHdl.hxx"
@@ -1032,10 +1031,11 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl(
{
OUString sValue( rValue );
sValue.trim();
- const sal_Int32 nRotateLen = sizeof(sXML_rotate)-1;
+ const OUString aRotate(GetXMLToken(XML_ROTATE));
+ const sal_Int32 nRotateLen(aRotate.getLength());
sal_Int32 nLen = sValue.getLength();
if( nLen >= nRotateLen+3 &&
- 0 == sValue.compareToAscii( sXML_rotate, nRotateLen ) &&
+ 0 == sValue.compareTo( aRotate, nRotateLen ) &&
'(' == sValue[nRotateLen] &&
')' == sValue[nLen-1] )
{
@@ -1241,6 +1241,14 @@ void XMLTextFrameContext_Impl::SetHyperlink( const OUString& rHRef,
const OUString& rTargetFrameName,
sal_Bool bMap )
{
+ static ::rtl::OUString s_HyperLinkURL(
+ RTL_CONSTASCII_USTRINGPARAM("HyperLinkURL"));
+ static ::rtl::OUString s_HyperLinkName(
+ RTL_CONSTASCII_USTRINGPARAM("HyperLinkName"));
+ static ::rtl::OUString s_HyperLinkTarget(
+ RTL_CONSTASCII_USTRINGPARAM("HyperLinkTarget"));
+ static ::rtl::OUString s_ServerMap(
+ RTL_CONSTASCII_USTRINGPARAM("ServerMap"));
if( !xPropSet.is() )
return;
@@ -1248,29 +1256,29 @@ void XMLTextFrameContext_Impl::SetHyperlink( const OUString& rHRef,
Reference < XPropertySetInfo > xPropSetInfo =
xPropSet->getPropertySetInfo();
if( !xPropSetInfo.is() ||
- !xPropSetInfo->hasPropertyByName( xTxtImp->sHyperLinkURL ) )
+ !xPropSetInfo->hasPropertyByName(s_HyperLinkURL))
return;
Any aAny;
aAny <<= rHRef;
- xPropSet->setPropertyValue( xTxtImp->sHyperLinkURL, aAny );
+ xPropSet->setPropertyValue( s_HyperLinkURL, aAny );
- if( xPropSetInfo->hasPropertyByName( xTxtImp->sHyperLinkName ) )
+ if (xPropSetInfo->hasPropertyByName(s_HyperLinkName))
{
aAny <<= rName;
- xPropSet->setPropertyValue( xTxtImp->sHyperLinkName, aAny );
+ xPropSet->setPropertyValue(s_HyperLinkName, aAny);
}
- if( xPropSetInfo->hasPropertyByName( xTxtImp->sHyperLinkTarget ) )
+ if (xPropSetInfo->hasPropertyByName(s_HyperLinkTarget))
{
aAny <<= rTargetFrameName;
- xPropSet->setPropertyValue( xTxtImp->sHyperLinkTarget, aAny );
+ xPropSet->setPropertyValue( s_HyperLinkTarget, aAny );
}
- if( xPropSetInfo->hasPropertyByName( xTxtImp->sServerMap ) )
+ if (xPropSetInfo->hasPropertyByName(s_ServerMap))
{
aAny.setValue( &bMap, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( xTxtImp->sServerMap, aAny );
+ xPropSet->setPropertyValue(s_ServerMap, aAny);
}
}
diff --git a/xmloff/source/text/XMLTextListBlockContext.cxx b/xmloff/source/text/XMLTextListBlockContext.cxx
index 6645d9d7ca57..25b0ba3078ea 100644
--- a/xmloff/source/text/XMLTextListBlockContext.cxx
+++ b/xmloff/source/text/XMLTextListBlockContext.cxx
@@ -79,6 +79,8 @@ XMLTextListBlockContext::XMLTextListBlockContext(
, msContinueListId()
// <--
{
+ static ::rtl::OUString s_PropNameDefaultListId(
+ RTL_CONSTASCII_USTRINGPARAM("DefaultListId"));
{
// get the parent list block context (if any); this is a bit ugly...
XMLTextListBlockContext * pLB(0);
@@ -180,10 +182,12 @@ XMLTextListBlockContext::XMLTextListBlockContext(
{
uno::Reference< beans::XPropertySetInfo > xNumRulePropSetInfo(
xNumRuleProps->getPropertySetInfo());
- if ( xNumRulePropSetInfo.is() &&
- xNumRulePropSetInfo->hasPropertyByName( mrTxtImport.sPropNameDefaultListId) )
+ if (xNumRulePropSetInfo.is() &&
+ xNumRulePropSetInfo->hasPropertyByName(
+ s_PropNameDefaultListId))
{
- xNumRuleProps->getPropertyValue( mrTxtImport.sPropNameDefaultListId ) >>= sListStyleDefaultListId;
+ xNumRuleProps->getPropertyValue(s_PropNameDefaultListId)
+ >>= sListStyleDefaultListId;
DBG_ASSERT( sListStyleDefaultListId.getLength() != 0,
"no default list id found at numbering rules instance. Serious defect -> please inform OD." );
}
diff --git a/xmloff/source/text/XMLTextListItemContext.cxx b/xmloff/source/text/XMLTextListItemContext.cxx
index bb9d5cfae4c0..d8effc0180de 100644
--- a/xmloff/source/text/XMLTextListItemContext.cxx
+++ b/xmloff/source/text/XMLTextListItemContext.cxx
@@ -69,6 +69,8 @@ XMLTextListItemContext::XMLTextListItemContext(
mxNumRulesOverride()
// <--
{
+ static ::rtl::OUString s_NumberingRules(
+ RTL_CONSTASCII_USTRINGPARAM("NumberingRules"));
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
for( sal_Int16 i=0; i < nAttrCount; i++ )
{
@@ -105,7 +107,7 @@ XMLTextListItemContext::XMLTextListItemContext(
aAny >>= xStyle;
uno::Reference< beans::XPropertySet > xPropSet( xStyle, UNO_QUERY );
- aAny = xPropSet->getPropertyValue( rTxtImp.sNumberingRules );
+ aAny = xPropSet->getPropertyValue(s_NumberingRules);
aAny >>= mxNumRulesOverride;
}
else
diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx
index bf7ebafad744..a4af684126be 100644
--- a/xmloff/source/text/XMLTextMarkImportContext.cxx
+++ b/xmloff/source/text/XMLTextMarkImportContext.cxx
@@ -49,10 +49,13 @@
#include <com/sun/star/text/XFormField.hpp>
+#include "RDFaImportHelper.hxx"
+
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
+using namespace ::com::sun::star;
using namespace ::com::sun::star::text;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
@@ -113,7 +116,6 @@ XMLTextMarkImportContext::XMLTextMarkImportContext(
const OUString& rLocalName )
: SvXMLImportContext(rImport, nPrefix, rLocalName)
, m_rHelper(rHlp)
- , m_bHaveAbout(false)
{
}
@@ -190,13 +192,13 @@ void XMLTextMarkImportContext::EndElement()
{
SvXMLImportContext::EndElement();
- const OUString sAPI_reference_mark(
+ static const OUString sAPI_reference_mark(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.ReferenceMark"));
- const OUString sAPI_bookmark(
+ static const OUString sAPI_bookmark(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Bookmark"));
- const OUString sAPI_fieldmark(
+ static const OUString sAPI_fieldmark(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Fieldmark"));
- const OUString sAPI_formfieldmark(
+ static const OUString sAPI_formfieldmark(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.FormFieldmark"));
if (m_sBookmarkName.getLength() > 0)
@@ -228,13 +230,6 @@ void XMLTextMarkImportContext::EndElement()
m_sBookmarkName,
m_rHelper.GetCursorAsRange()->getStart(),
m_sXmlId) );
- if (m_bHaveAbout)
- {
- const Reference<com::sun::star::rdf::XMetadatable>
- xMeta( xContent, UNO_QUERY);
- GetImport().AddRDFa(xMeta,
- m_sAbout, m_sProperty, m_sContent, m_sDatatype);
- }
if ((lcl_MarkType)nTmp==TypeFieldmark) {
if (xContent.is() && bImportAsField) {
// setup fieldmark...
@@ -252,9 +247,22 @@ void XMLTextMarkImportContext::EndElement()
case TypeFieldmarkStart:
case TypeBookmarkStart:
// save XTextRange for later construction of bookmark
- m_rHelper.InsertBookmarkStartRange(
- m_sBookmarkName, m_rHelper.GetCursorAsRange()->getStart(),
- m_sXmlId);
+ {
+ ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes >
+ pRDFaAttributes;
+ if (m_bHaveAbout && (TypeBookmarkStart
+ == static_cast<lcl_MarkType>(nTmp)))
+ {
+ pRDFaAttributes =
+ GetImport().GetRDFaImportHelper().ParseRDFa(
+ m_sAbout, m_sProperty,
+ m_sContent, m_sDatatype);
+ }
+ m_rHelper.InsertBookmarkStartRange(
+ m_sBookmarkName,
+ m_rHelper.GetCursorAsRange()->getStart(),
+ m_sXmlId, pRDFaAttributes);
+ }
break;
case TypeFieldmarkEnd:
@@ -262,8 +270,11 @@ void XMLTextMarkImportContext::EndElement()
{
// get old range, and construct
Reference<XTextRange> xStartRange;
- if (m_rHelper.FindAndRemoveBookmarkStartRange(m_sBookmarkName,
- xStartRange, m_sXmlId))
+ ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes >
+ pRDFaAttributes;
+ if (m_rHelper.FindAndRemoveBookmarkStartRange(
+ m_sBookmarkName, xStartRange,
+ m_sXmlId, pRDFaAttributes))
{
Reference<XTextRange> xEndRange(
m_rHelper.GetCursorAsRange()->getStart());
@@ -295,12 +306,12 @@ void XMLTextMarkImportContext::EndElement()
m_sBookmarkName,
xInsertionRange,
m_sXmlId) );
- if (m_bHaveAbout)
+ if (pRDFaAttributes)
{
- const Reference<com::sun::star::rdf::XMetadatable>
- xMeta( xContent, UNO_QUERY);
- GetImport().AddRDFa(xMeta,
- m_sAbout, m_sProperty, m_sContent, m_sDatatype);
+ const Reference<rdf::XMetadatable>
+ xMeta(xContent, UNO_QUERY);
+ GetImport().GetRDFaImportHelper().AddRDFa(
+ xMeta, pRDFaAttributes);
}
if ((lcl_MarkType)nTmp==TypeFieldmarkEnd) {
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index c9d7e24d7a73..3a4d6e6b7749 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -212,87 +212,6 @@ const sal_Char sAPI_TextRange[] = "TextRange";
const sal_Char sAPI_true[] = "TRUE";
-static __FAR_DATA SvXMLTokenMapEntry aTextFieldAttrTokenMap[] =
-{
- { XML_NAMESPACE_TEXT, XML_FIXED, XML_TOK_TEXTFIELD_FIXED },
- { XML_NAMESPACE_TEXT, XML_DESCRIPTION, XML_TOK_TEXTFIELD_DESCRIPTION },
- { XML_NAMESPACE_TEXT, XML_HELP, XML_TOK_TEXTFIELD_HELP },
- { XML_NAMESPACE_TEXT, XML_HINT, XML_TOK_TEXTFIELD_HINT },
- { XML_NAMESPACE_TEXT, XML_PLACEHOLDER_TYPE,
- XML_TOK_TEXTFIELD_PLACEHOLDER_TYPE },
- { XML_NAMESPACE_TEXT, XML_NAME, XML_TOK_TEXTFIELD_NAME },
- { XML_NAMESPACE_TEXT, XML_FORMULA, XML_TOK_TEXTFIELD_FORMULA },
- { XML_NAMESPACE_STYLE, XML_NUM_FORMAT, XML_TOK_TEXTFIELD_NUM_FORMAT },
- { XML_NAMESPACE_STYLE, XML_NUM_LETTER_SYNC,
- XML_TOK_TEXTFIELD_NUM_LETTER_SYNC },
- { XML_NAMESPACE_TEXT, XML_DISPLAY_FORMULA,
- XML_TOK_TEXTFIELD_DISPLAY_FORMULA },
- { XML_NAMESPACE_TEXT, XML_VALUE_TYPE, XML_TOK_TEXTFIELD_VALUE_TYPE }, // #i32362#: src680m48++ saves text:value-type
- { XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_TOK_TEXTFIELD_VALUE_TYPE },
- { XML_NAMESPACE_TEXT, XML_VALUE, XML_TOK_TEXTFIELD_VALUE },
- { XML_NAMESPACE_OFFICE, XML_VALUE, XML_TOK_TEXTFIELD_VALUE },
- { XML_NAMESPACE_TEXT, XML_STRING_VALUE, XML_TOK_TEXTFIELD_STRING_VALUE },
- { XML_NAMESPACE_OFFICE, XML_STRING_VALUE, XML_TOK_TEXTFIELD_STRING_VALUE },
- { XML_NAMESPACE_TEXT, XML_DATE_VALUE, XML_TOK_TEXTFIELD_DATE_VALUE },
- { XML_NAMESPACE_OFFICE, XML_DATE_VALUE, XML_TOK_TEXTFIELD_DATE_VALUE },
- { XML_NAMESPACE_TEXT, XML_TIME_VALUE, XML_TOK_TEXTFIELD_TIME_VALUE },
- { XML_NAMESPACE_OFFICE, XML_TIME_VALUE, XML_TOK_TEXTFIELD_TIME_VALUE },
- { XML_NAMESPACE_OFFICE, XML_BOOLEAN_VALUE, XML_TOK_TEXTFIELD_BOOL_VALUE},
- { XML_NAMESPACE_OFFICE, XML_CURRENCY, XML_TOK_TEXTFIELD_CURRENCY},
- { XML_NAMESPACE_STYLE, XML_DATA_STYLE_NAME,
- XML_TOK_TEXTFIELD_DATA_STYLE_NAME },
- { XML_NAMESPACE_TEXT, XML_DISPLAY_OUTLINE_LEVEL,
- XML_TOK_TEXTFIELD_NUMBERING_LEVEL },
- { XML_NAMESPACE_TEXT, XML_SEPARATION_CHARACTER,
- XML_TOK_TEXTFIELD_NUMBERING_SEPARATOR },
- { XML_NAMESPACE_TEXT, XML_DISPLAY, XML_TOK_TEXTFIELD_DISPLAY },
- { XML_NAMESPACE_TEXT, XML_TIME_ADJUST, XML_TOK_TEXTFIELD_TIME_ADJUST },
- { XML_NAMESPACE_TEXT, XML_DATE_ADJUST, XML_TOK_TEXTFIELD_DATE_ADJUST },
- { XML_NAMESPACE_TEXT, XML_PAGE_ADJUST, XML_TOK_TEXTFIELD_PAGE_ADJUST },
- { XML_NAMESPACE_TEXT, XML_SELECT_PAGE, XML_TOK_TEXTFIELD_SELECT_PAGE },
- { XML_NAMESPACE_TEXT, XML_DATABASE_NAME, XML_TOK_TEXTFIELD_DATABASE_NAME},
- { XML_NAMESPACE_TEXT, XML_TABLE_NAME, XML_TOK_TEXTFIELD_TABLE_NAME },
- { XML_NAMESPACE_TEXT, XML_COLUMN_NAME, XML_TOK_TEXTFIELD_COLUMN_NAME },
- { XML_NAMESPACE_TEXT, XML_ROW_NUMBER, XML_TOK_TEXTFIELD_ROW_NUMBER },
- { XML_NAMESPACE_TEXT, XML_CONDITION, XML_TOK_TEXTFIELD_CONDITION },
- { XML_NAMESPACE_TEXT, XML_STRING_VALUE_IF_TRUE,
- XML_TOK_TEXTFIELD_STRING_VALUE_IF_TRUE },
- { XML_NAMESPACE_TEXT, XML_STRING_VALUE_IF_FALSE,
- XML_TOK_TEXTFIELD_STRING_VALUE_IF_FALSE },
- { XML_NAMESPACE_TEXT, XML_EDITING_CYCLES, XML_TOK_TEXTFIELD_REVISION },
- { XML_NAMESPACE_TEXT, XML_OUTLINE_LEVEL, XML_TOK_TEXTFIELD_OUTLINE_LEVEL},
- { XML_NAMESPACE_TEXT, XML_ACTIVE, XML_TOK_TEXTFIELD_ACTIVE },
- { XML_NAMESPACE_TEXT, XML_NOTE_CLASS, XML_TOK_TEXTFIELD_NOTE_CLASS },
- { XML_NAMESPACE_TEXT, XML_REFERENCE_FORMAT,
- XML_TOK_TEXTFIELD_REFERENCE_FORMAT },
- { XML_NAMESPACE_TEXT, XML_REF_NAME, XML_TOK_TEXTFIELD_REF_NAME },
- { XML_NAMESPACE_TEXT, XML_CONNECTION_NAME,
- XML_TOK_TEXTFIELD_CONNECTION_NAME },
- { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_TEXTFIELD_HREF },
- { XML_NAMESPACE_OFFICE, XML_TARGET_FRAME_NAME,
- XML_TOK_TEXTFIELD_TARGET_FRAME },
- { XML_NAMESPACE_TEXT, XML_ANNOTATION, XML_TOK_TEXTFIELD_ANNOTATION },
- { XML_NAMESPACE_SCRIPT, XML_LANGUAGE, XML_TOK_TEXTFIELD_LANGUAGE },
- { XML_NAMESPACE_TEXT, XML_KIND, XML_TOK_TEXTFIELD_MEASURE_KIND },
- { XML_NAMESPACE_TEXT, XML_IS_HIDDEN, XML_TOK_TEXTFIELD_IS_HIDDEN },
- { XML_NAMESPACE_TEXT, XML_CURRENT_VALUE,
- XML_TOK_TEXTFIELD_CURRENT_VALUE },
- { XML_NAMESPACE_TEXT, XML_TABLE_TYPE, XML_TOK_TEXTFIELD_TABLE_TYPE },
-
- XML_TOKEN_MAP_END
-};
-
-const SvXMLTokenMap& XMLTextImportHelper::GetTextFieldAttrTokenMap()
-{
- if ( !pTextFieldAttrTokenMap.get() ) {
- pTextFieldAttrTokenMap.reset(
- new SvXMLTokenMap(aTextFieldAttrTokenMap) );
- }
-
- return *pTextFieldAttrTokenMap;
-
-}
-
TYPEINIT1( XMLTextFieldImportContext, SvXMLImportContext);
XMLTextFieldImportContext::XMLTextFieldImportContext(
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index e509bc65a9fe..d3591ece238c 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -27,6 +27,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
+
+#include <vector>
+
+#include <boost/scoped_array.hpp>
+#include <boost/tuple/tuple.hpp>
+
#include <tools/solar.h>
#include <tools/debug.hxx>
#ifndef _SVSTDARR_STRINGSDTOR_DECL
@@ -45,6 +51,7 @@
#include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/XTextFrame.hpp>
+#include <com/sun/star/text/XFormField.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -56,6 +63,8 @@
#include <xmloff/families.hxx>
#include <xmloff/xmlnumfi.hxx>
#include <xmloff/xmlnumi.hxx>
+#include <xmloff/xmlictxt.hxx>
+#include <xmloff/xmlimppr.hxx>
#include "txtparai.hxx"
#include <xmloff/txtimp.hxx>
@@ -97,6 +106,7 @@ using ::rtl::OUStringBuffer;
using ::com::sun::star::ucb::XAnyCompare;
using namespace ::std;
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::text;
@@ -109,7 +119,7 @@ using namespace ::com::sun::star::lang;
using namespace ::xmloff::token;
using ::com::sun::star::util::DateTime;
using namespace ::com::sun::star::ucb;
-
+using namespace ::com::sun::star;
using ::comphelper::UStringLess;
@@ -333,11 +343,11 @@ static __FAR_DATA SvXMLTokenMapEntry aTextPAttrTokenMap[] =
{ XML_NAMESPACE_XHTML, XML_PROPERTY, XML_TOK_TEXT_P_PROPERTY },
{ XML_NAMESPACE_XHTML, XML_CONTENT, XML_TOK_TEXT_P_CONTENT },
{ XML_NAMESPACE_XHTML, XML_DATATYPE, XML_TOK_TEXT_P_DATATYPE },
+ { XML_NAMESPACE_TEXT, XML_ID, XML_TOK_TEXT_P_TEXTID },
{ XML_NAMESPACE_TEXT, XML_STYLE_NAME, XML_TOK_TEXT_P_STYLE_NAME },
{ XML_NAMESPACE_TEXT, XML_COND_STYLE_NAME,
XML_TOK_TEXT_P_COND_STYLE_NAME },
{ XML_NAMESPACE_TEXT, XML_OUTLINE_LEVEL,XML_TOK_TEXT_P_LEVEL },
- { XML_NAMESPACE_TEXT, XML_ID, XML_TOK_TEXT_P_ID },
{ XML_NAMESPACE_TEXT, XML_IS_LIST_HEADER,XML_TOK_TEXT_P_IS_LIST_HEADER },
{ XML_NAMESPACE_TEXT, XML_RESTART_NUMBERING,XML_TOK_TEXT_P_RESTART_NUMBERING },
{ XML_NAMESPACE_TEXT, XML_START_VALUE,XML_TOK_TEXT_P_START_VALUE },
@@ -444,9 +454,436 @@ static __FAR_DATA SvXMLTokenMapEntry aTextMasterPageElemTokenMap[] =
XML_TOKEN_MAP_END
};
+static __FAR_DATA SvXMLTokenMapEntry aTextFieldAttrTokenMap[] =
+{
+ { XML_NAMESPACE_TEXT, XML_FIXED, XML_TOK_TEXTFIELD_FIXED },
+ { XML_NAMESPACE_TEXT, XML_DESCRIPTION, XML_TOK_TEXTFIELD_DESCRIPTION },
+ { XML_NAMESPACE_TEXT, XML_HELP, XML_TOK_TEXTFIELD_HELP },
+ { XML_NAMESPACE_TEXT, XML_HINT, XML_TOK_TEXTFIELD_HINT },
+ { XML_NAMESPACE_TEXT, XML_PLACEHOLDER_TYPE,
+ XML_TOK_TEXTFIELD_PLACEHOLDER_TYPE },
+ { XML_NAMESPACE_TEXT, XML_NAME, XML_TOK_TEXTFIELD_NAME },
+ { XML_NAMESPACE_TEXT, XML_FORMULA, XML_TOK_TEXTFIELD_FORMULA },
+ { XML_NAMESPACE_STYLE, XML_NUM_FORMAT, XML_TOK_TEXTFIELD_NUM_FORMAT },
+ { XML_NAMESPACE_STYLE, XML_NUM_LETTER_SYNC,
+ XML_TOK_TEXTFIELD_NUM_LETTER_SYNC },
+ { XML_NAMESPACE_TEXT, XML_DISPLAY_FORMULA,
+ XML_TOK_TEXTFIELD_DISPLAY_FORMULA },
+ { XML_NAMESPACE_TEXT, XML_VALUE_TYPE, XML_TOK_TEXTFIELD_VALUE_TYPE }, // #i32362#: src680m48++ saves text:value-type
+ { XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_TOK_TEXTFIELD_VALUE_TYPE },
+ { XML_NAMESPACE_TEXT, XML_VALUE, XML_TOK_TEXTFIELD_VALUE },
+ { XML_NAMESPACE_OFFICE, XML_VALUE, XML_TOK_TEXTFIELD_VALUE },
+ { XML_NAMESPACE_TEXT, XML_STRING_VALUE, XML_TOK_TEXTFIELD_STRING_VALUE },
+ { XML_NAMESPACE_OFFICE, XML_STRING_VALUE, XML_TOK_TEXTFIELD_STRING_VALUE },
+ { XML_NAMESPACE_TEXT, XML_DATE_VALUE, XML_TOK_TEXTFIELD_DATE_VALUE },
+ { XML_NAMESPACE_OFFICE, XML_DATE_VALUE, XML_TOK_TEXTFIELD_DATE_VALUE },
+ { XML_NAMESPACE_TEXT, XML_TIME_VALUE, XML_TOK_TEXTFIELD_TIME_VALUE },
+ { XML_NAMESPACE_OFFICE, XML_TIME_VALUE, XML_TOK_TEXTFIELD_TIME_VALUE },
+ { XML_NAMESPACE_OFFICE, XML_BOOLEAN_VALUE, XML_TOK_TEXTFIELD_BOOL_VALUE},
+ { XML_NAMESPACE_OFFICE, XML_CURRENCY, XML_TOK_TEXTFIELD_CURRENCY},
+ { XML_NAMESPACE_STYLE, XML_DATA_STYLE_NAME,
+ XML_TOK_TEXTFIELD_DATA_STYLE_NAME },
+ { XML_NAMESPACE_TEXT, XML_DISPLAY_OUTLINE_LEVEL,
+ XML_TOK_TEXTFIELD_NUMBERING_LEVEL },
+ { XML_NAMESPACE_TEXT, XML_SEPARATION_CHARACTER,
+ XML_TOK_TEXTFIELD_NUMBERING_SEPARATOR },
+ { XML_NAMESPACE_TEXT, XML_DISPLAY, XML_TOK_TEXTFIELD_DISPLAY },
+ { XML_NAMESPACE_TEXT, XML_TIME_ADJUST, XML_TOK_TEXTFIELD_TIME_ADJUST },
+ { XML_NAMESPACE_TEXT, XML_DATE_ADJUST, XML_TOK_TEXTFIELD_DATE_ADJUST },
+ { XML_NAMESPACE_TEXT, XML_PAGE_ADJUST, XML_TOK_TEXTFIELD_PAGE_ADJUST },
+ { XML_NAMESPACE_TEXT, XML_SELECT_PAGE, XML_TOK_TEXTFIELD_SELECT_PAGE },
+ { XML_NAMESPACE_TEXT, XML_DATABASE_NAME, XML_TOK_TEXTFIELD_DATABASE_NAME},
+ { XML_NAMESPACE_TEXT, XML_TABLE_NAME, XML_TOK_TEXTFIELD_TABLE_NAME },
+ { XML_NAMESPACE_TEXT, XML_COLUMN_NAME, XML_TOK_TEXTFIELD_COLUMN_NAME },
+ { XML_NAMESPACE_TEXT, XML_ROW_NUMBER, XML_TOK_TEXTFIELD_ROW_NUMBER },
+ { XML_NAMESPACE_TEXT, XML_CONDITION, XML_TOK_TEXTFIELD_CONDITION },
+ { XML_NAMESPACE_TEXT, XML_STRING_VALUE_IF_TRUE,
+ XML_TOK_TEXTFIELD_STRING_VALUE_IF_TRUE },
+ { XML_NAMESPACE_TEXT, XML_STRING_VALUE_IF_FALSE,
+ XML_TOK_TEXTFIELD_STRING_VALUE_IF_FALSE },
+ { XML_NAMESPACE_TEXT, XML_EDITING_CYCLES, XML_TOK_TEXTFIELD_REVISION },
+ { XML_NAMESPACE_TEXT, XML_OUTLINE_LEVEL, XML_TOK_TEXTFIELD_OUTLINE_LEVEL},
+ { XML_NAMESPACE_TEXT, XML_ACTIVE, XML_TOK_TEXTFIELD_ACTIVE },
+ { XML_NAMESPACE_TEXT, XML_NOTE_CLASS, XML_TOK_TEXTFIELD_NOTE_CLASS },
+ { XML_NAMESPACE_TEXT, XML_REFERENCE_FORMAT,
+ XML_TOK_TEXTFIELD_REFERENCE_FORMAT },
+ { XML_NAMESPACE_TEXT, XML_REF_NAME, XML_TOK_TEXTFIELD_REF_NAME },
+ { XML_NAMESPACE_TEXT, XML_CONNECTION_NAME,
+ XML_TOK_TEXTFIELD_CONNECTION_NAME },
+ { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_TEXTFIELD_HREF },
+ { XML_NAMESPACE_OFFICE, XML_TARGET_FRAME_NAME,
+ XML_TOK_TEXTFIELD_TARGET_FRAME },
+ { XML_NAMESPACE_TEXT, XML_ANNOTATION, XML_TOK_TEXTFIELD_ANNOTATION },
+ { XML_NAMESPACE_SCRIPT, XML_LANGUAGE, XML_TOK_TEXTFIELD_LANGUAGE },
+ { XML_NAMESPACE_TEXT, XML_KIND, XML_TOK_TEXTFIELD_MEASURE_KIND },
+ { XML_NAMESPACE_TEXT, XML_IS_HIDDEN, XML_TOK_TEXTFIELD_IS_HIDDEN },
+ { XML_NAMESPACE_TEXT, XML_CURRENT_VALUE,
+ XML_TOK_TEXTFIELD_CURRENT_VALUE },
+ { XML_NAMESPACE_TEXT, XML_TABLE_TYPE, XML_TOK_TEXTFIELD_TABLE_TYPE },
+
+ XML_TOKEN_MAP_END
+};
+
+
// maximum allowed length of combined characters field
#define MAX_COMBINED_CHARACTERS 6
+struct SAL_DLLPRIVATE XMLTextImportHelper::Impl
+ : private ::boost::noncopyable
+{
+ ::std::auto_ptr<SvXMLTokenMap> m_pTextElemTokenMap;
+ ::std::auto_ptr<SvXMLTokenMap> m_pTextPElemTokenMap;
+ ::std::auto_ptr<SvXMLTokenMap> m_pTextPAttrTokenMap;
+ ::std::auto_ptr<SvXMLTokenMap> m_pTextFieldAttrTokenMap;
+ ::std::auto_ptr<SvXMLTokenMap> m_pTextNumberedParagraphAttrTokenMap;
+ ::std::auto_ptr<SvXMLTokenMap> m_pTextListBlockAttrTokenMap;
+ ::std::auto_ptr<SvXMLTokenMap> m_pTextListBlockElemTokenMap;
+ ::std::auto_ptr<SvXMLTokenMap> m_pTextFrameAttrTokenMap;
+ ::std::auto_ptr<SvXMLTokenMap> m_pTextContourAttrTokenMap;
+ ::std::auto_ptr<SvXMLTokenMap> m_pTextHyperlinkAttrTokenMap;
+ ::std::auto_ptr<SvXMLTokenMap> m_pTextMasterPageElemTokenMap;
+ ::std::auto_ptr<SvStringsDtor> m_pPrevFrmNames;
+ ::std::auto_ptr<SvStringsDtor> m_pNextFrmNames;
+
+ // --> OD 2008-04-25 #refactorlists#
+ ::std::auto_ptr<XMLTextListsHelper> m_pTextListsHelper;
+ // <--
+
+ SvXMLImportContextRef m_xAutoStyles;
+ SvXMLImportContextRef m_xFontDecls;
+
+ XMLSectionList_Impl m_SectionList;
+
+ UniReference< SvXMLImportPropertyMapper > m_xParaImpPrMap;
+ UniReference< SvXMLImportPropertyMapper > m_xTextImpPrMap;
+ UniReference< SvXMLImportPropertyMapper > m_xFrameImpPrMap;
+ UniReference< SvXMLImportPropertyMapper > m_xSectionImpPrMap;
+ UniReference< SvXMLImportPropertyMapper > m_xRubyImpPrMap;
+
+ ::std::auto_ptr<SvI18NMap> m_pRenameMap;
+ // --> OD 2006-10-12 #i69629# - change and extend data structure:
+ // - data structure contains candidates of paragraph styles, which
+ // will be assigned to the outline style
+ // - data structure contains more than one candidate for each list level
+ // of the outline style
+ ::boost::scoped_array< ::std::vector< ::rtl::OUString > >
+ m_pOutlineStylesCandidates;
+ // <--
+
+ // start range, xml:id, RDFa stuff
+ typedef ::boost::tuple<
+ uno::Reference<text::XTextRange>, ::rtl::OUString,
+ ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > >
+ BookmarkMapEntry_t;
+ /// start ranges for open bookmarks
+ ::std::map< ::rtl::OUString, BookmarkMapEntry_t,
+ ::comphelper::UStringLess> m_BookmarkStartRanges;
+
+ typedef ::std::vector< ::rtl::OUString > BookmarkVector_t;
+ BookmarkVector_t m_BookmarkVector;
+
+ /// name of the last 'open' redline that started between paragraphs
+ ::rtl::OUString m_sOpenRedlineIdentifier;
+
+ uno::Reference<text::XText> m_xText;
+ uno::Reference<text::XTextCursor> m_xCursor;
+ uno::Reference<text::XTextRange> m_xCursorAsRange;
+ uno::Reference<container::XNameContainer> m_xParaStyles;
+ uno::Reference<container::XNameContainer> m_xTextStyles;
+ uno::Reference<container::XNameContainer> m_xNumStyles;
+ uno::Reference<container::XNameContainer> m_xFrameStyles;
+ uno::Reference<container::XNameContainer> m_xPageStyles;
+ uno::Reference<container::XIndexReplace> m_xChapterNumbering;
+ uno::Reference<container::XNameAccess> m_xTextFrames;
+ uno::Reference<container::XNameAccess> m_xGraphics;
+ uno::Reference<container::XNameAccess> m_xObjects;
+ uno::Reference<lang::XMultiServiceFactory> m_xServiceFactory;
+
+ SvXMLImport & m_rSvXMLImport;
+
+ bool m_bInsertMode : 1;
+ bool m_bStylesOnlyMode : 1;
+ bool m_bBlockMode : 1;
+ bool m_bProgress : 1;
+ bool m_bOrganizerMode : 1;
+ bool m_bBodyContentStarted : 1;
+
+ // #107848#
+ // One more flag to remember if we are inside a deleted redline section
+ bool m_bInsideDeleteContext : 1;
+
+ typedef ::std::pair< ::rtl::OUString, ::rtl::OUString> field_name_type_t;
+ typedef ::std::pair< ::rtl::OUString, ::rtl::OUString > field_param_t;
+ typedef ::std::vector< field_param_t > field_params_t;
+ typedef ::std::pair< field_name_type_t, field_params_t > field_stack_item_t;
+ typedef ::std::stack< field_stack_item_t > field_stack_t;
+
+ field_stack_t m_FieldStack;
+
+ ::rtl::OUString m_sCellParaStyleDefault;
+
+ Impl( uno::Reference<frame::XModel> const& rModel,
+ SvXMLImport & rImport,
+ bool const bInsertMode, bool const bStylesOnlyMode,
+ bool const bProgress, bool const bBlockMode,
+ bool const bOrganizerMode)
+ : m_pTextElemTokenMap( 0 )
+ , m_pTextPElemTokenMap( 0 )
+ , m_pTextPAttrTokenMap( 0 )
+ , m_pTextFieldAttrTokenMap( 0 )
+ , m_pTextNumberedParagraphAttrTokenMap( 0 )
+ , m_pTextListBlockAttrTokenMap( 0 )
+ , m_pTextListBlockElemTokenMap( 0 )
+ , m_pTextFrameAttrTokenMap( 0 )
+ , m_pTextContourAttrTokenMap( 0 )
+ , m_pTextHyperlinkAttrTokenMap( 0 )
+ , m_pTextMasterPageElemTokenMap( 0 )
+ , m_pPrevFrmNames( 0 )
+ , m_pNextFrmNames( 0 )
+ // --> OD 2008-04-25 #refactorlists#
+ , m_pTextListsHelper( new XMLTextListsHelper() )
+ // <--
+ , m_pRenameMap( 0 )
+ // --> OD 2006-10-12 #i69629#
+ , m_pOutlineStylesCandidates( 0 )
+ // <--
+ , m_xServiceFactory( rModel, UNO_QUERY )
+ , m_rSvXMLImport( rImport )
+ , m_bInsertMode( bInsertMode )
+ , m_bStylesOnlyMode( bStylesOnlyMode )
+ , m_bBlockMode( bBlockMode )
+ , m_bProgress( bProgress )
+ , m_bOrganizerMode( bOrganizerMode )
+ , m_bBodyContentStarted( true )
+ // #107848# Initialize inside_deleted_section flag correctly
+ , m_bInsideDeleteContext( false )
+ {
+ }
+
+ void InitOutlineStylesCandidates()
+ {
+ if (!m_pOutlineStylesCandidates)
+ {
+ size_t const size(m_xChapterNumbering->getCount());
+ m_pOutlineStylesCandidates.reset(
+ new ::std::vector< ::rtl::OUString >[size] );
+ }
+ }
+
+};
+
+
+uno::Reference< text::XText > & XMLTextImportHelper::GetText()
+{
+ return m_pImpl->m_xText;
+}
+
+uno::Reference< text::XTextCursor > & XMLTextImportHelper::GetCursor()
+{
+ return m_pImpl->m_xCursor;
+}
+
+uno::Reference< text::XTextRange > & XMLTextImportHelper::GetCursorAsRange()
+{
+ return m_pImpl->m_xCursorAsRange;
+}
+
+bool XMLTextImportHelper::IsInsertMode() const
+{
+ return m_pImpl->m_bInsertMode;
+}
+
+bool XMLTextImportHelper::IsStylesOnlyMode() const
+{
+ return m_pImpl->m_bStylesOnlyMode;
+}
+
+bool XMLTextImportHelper::IsBlockMode() const
+{
+ return m_pImpl->m_bBlockMode;
+}
+
+bool XMLTextImportHelper::IsOrganizerMode() const
+{
+ return m_pImpl->m_bOrganizerMode;
+}
+
+bool XMLTextImportHelper::IsProgress() const
+{
+ return m_pImpl->m_bProgress;
+}
+
+XMLSectionList_Impl & XMLTextImportHelper::GetSectionList()
+{
+ return m_pImpl->m_SectionList;
+}
+
+uno::Reference<container::XNameContainer> const&
+XMLTextImportHelper::GetParaStyles() const
+{
+ return m_pImpl->m_xParaStyles;
+}
+
+uno::Reference<container::XNameContainer> const&
+XMLTextImportHelper::GetTextStyles() const
+{
+ return m_pImpl->m_xTextStyles;
+}
+
+uno::Reference<container::XNameContainer> const&
+XMLTextImportHelper::GetNumberingStyles() const
+{
+ return m_pImpl->m_xNumStyles;
+}
+
+uno::Reference<container::XNameContainer> const&
+XMLTextImportHelper::GetFrameStyles() const
+{
+ return m_pImpl->m_xFrameStyles;
+}
+
+uno::Reference<container::XNameContainer> const&
+XMLTextImportHelper::GetPageStyles() const
+{
+ return m_pImpl->m_xPageStyles;
+}
+
+uno::Reference<container::XIndexReplace> const&
+XMLTextImportHelper::GetChapterNumbering() const
+{
+ return m_pImpl->m_xChapterNumbering;
+}
+
+UniReference< SvXMLImportPropertyMapper > const&
+XMLTextImportHelper::GetParaImportPropertySetMapper() const
+{
+ return m_pImpl->m_xParaImpPrMap;
+}
+
+UniReference< SvXMLImportPropertyMapper > const&
+XMLTextImportHelper::GetTextImportPropertySetMapper() const
+{
+ return m_pImpl->m_xTextImpPrMap;
+}
+
+UniReference< SvXMLImportPropertyMapper > const&
+XMLTextImportHelper::GetFrameImportPropertySetMapper() const
+{
+ return m_pImpl->m_xFrameImpPrMap;
+}
+
+UniReference< SvXMLImportPropertyMapper > const&
+XMLTextImportHelper::GetSectionImportPropertySetMapper() const
+{
+ return m_pImpl->m_xSectionImpPrMap;
+}
+
+UniReference< SvXMLImportPropertyMapper > const&
+XMLTextImportHelper::GetRubyImportPropertySetMapper() const
+{
+ return m_pImpl->m_xRubyImpPrMap;
+}
+
+void XMLTextImportHelper::SetInsideDeleteContext(bool const bNew)
+{
+ m_pImpl->m_bInsideDeleteContext = bNew;
+}
+
+bool XMLTextImportHelper::IsInsideDeleteContext() const
+{
+ return m_pImpl->m_bInsideDeleteContext;
+}
+
+SvXMLImport & XMLTextImportHelper::GetXMLImport()
+{
+ return m_pImpl->m_rSvXMLImport;
+}
+
+XMLTextListsHelper & XMLTextImportHelper::GetTextListHelper()
+{
+ return *m_pImpl->m_pTextListsHelper;
+}
+
+const SvXMLTokenMap& XMLTextImportHelper::GetTextElemTokenMap()
+{
+ if (!m_pImpl->m_pTextElemTokenMap.get())
+ {
+ m_pImpl->m_pTextElemTokenMap.reset(
+ new SvXMLTokenMap( aTextElemTokenMap ));
+ }
+ return *m_pImpl->m_pTextElemTokenMap;
+}
+
+const SvXMLTokenMap& XMLTextImportHelper::GetTextPElemTokenMap()
+{
+ if (!m_pImpl->m_pTextPElemTokenMap.get())
+ {
+ m_pImpl->m_pTextPElemTokenMap.reset(
+ new SvXMLTokenMap( aTextPElemTokenMap ));
+ }
+ return *m_pImpl->m_pTextPElemTokenMap;
+}
+
+const SvXMLTokenMap& XMLTextImportHelper::GetTextPAttrTokenMap()
+{
+ if (!m_pImpl->m_pTextPAttrTokenMap.get())
+ {
+ m_pImpl->m_pTextPAttrTokenMap.reset(
+ new SvXMLTokenMap( aTextPAttrTokenMap ));
+ }
+ return *m_pImpl->m_pTextPAttrTokenMap;
+}
+
+const SvXMLTokenMap& XMLTextImportHelper::GetTextFrameAttrTokenMap()
+{
+ if (!m_pImpl->m_pTextFrameAttrTokenMap.get())
+ {
+ m_pImpl->m_pTextFrameAttrTokenMap.reset(
+ new SvXMLTokenMap( aTextFrameAttrTokenMap ));
+ }
+ return *m_pImpl->m_pTextFrameAttrTokenMap;
+}
+
+const SvXMLTokenMap& XMLTextImportHelper::GetTextContourAttrTokenMap()
+{
+ if (!m_pImpl->m_pTextContourAttrTokenMap.get())
+ {
+ m_pImpl->m_pTextContourAttrTokenMap.reset(
+ new SvXMLTokenMap( aTextContourAttrTokenMap ));
+ }
+ return *m_pImpl->m_pTextContourAttrTokenMap;
+}
+
+const SvXMLTokenMap& XMLTextImportHelper::GetTextHyperlinkAttrTokenMap()
+{
+ if (!m_pImpl->m_pTextHyperlinkAttrTokenMap.get())
+ {
+ m_pImpl->m_pTextHyperlinkAttrTokenMap.reset(
+ new SvXMLTokenMap( aTextHyperlinkAttrTokenMap ));
+ }
+ return *m_pImpl->m_pTextHyperlinkAttrTokenMap;
+}
+
+const SvXMLTokenMap& XMLTextImportHelper::GetTextMasterPageElemTokenMap()
+{
+ if (!m_pImpl->m_pTextMasterPageElemTokenMap.get())
+ {
+ m_pImpl->m_pTextMasterPageElemTokenMap.reset(
+ new SvXMLTokenMap( aTextMasterPageElemTokenMap ));
+ }
+ return *m_pImpl->m_pTextMasterPageElemTokenMap;
+}
+
+const SvXMLTokenMap& XMLTextImportHelper::GetTextFieldAttrTokenMap()
+{
+ if (!m_pImpl->m_pTextFieldAttrTokenMap.get())
+ {
+ m_pImpl->m_pTextFieldAttrTokenMap.reset(
+ new SvXMLTokenMap( aTextFieldAttrTokenMap ));
+ }
+ return *m_pImpl->m_pTextFieldAttrTokenMap;
+}
+
namespace
{
@@ -513,111 +950,48 @@ namespace
}
XMLTextImportHelper::XMLTextImportHelper(
- const Reference < XModel >& rModel,
+ uno::Reference<frame::XModel> const& rModel,
SvXMLImport& rImport,
- sal_Bool bInsertM, sal_Bool bStylesOnlyM,
- sal_Bool bPrg,
- sal_Bool bBlockM,
- sal_Bool bOrganizerM )
-: pTextElemTokenMap( 0 )
-, pTextPElemTokenMap( 0 )
-, pTextPAttrTokenMap( 0 )
-, pTextFieldAttrTokenMap( 0 )
-, pTextNumberedParagraphAttrTokenMap( 0 )
-, pTextListBlockAttrTokenMap( 0 )
-, pTextListBlockElemTokenMap( 0 )
-, pTextFrameAttrTokenMap( 0 )
-, pTextContourAttrTokenMap( 0 )
-, pTextHyperlinkAttrTokenMap( 0 )
-, pTextMasterPageElemTokenMap( 0 )
-, pPrevFrmNames( 0 )
-, pNextFrmNames( 0 )
-
-// --> OD 2008-04-25 #refactorlists#
-, mpTextListsHelper( new XMLTextListsHelper() )
-// <--
-
-, pRenameMap( 0 )
-// --> OD 2006-10-12 #i69629#
-, mpOutlineStylesCandidates( 0 )
-// <--
-
-, pFootnoteBackpatcher( NULL )
-, pSequenceIdBackpatcher( NULL )
-, pSequenceNameBackpatcher( NULL )
-
-, xServiceFactory( rModel, UNO_QUERY )
-
-, rSvXMLImport( rImport )
-
-, bInsertMode( bInsertM )
-, bStylesOnlyMode( bStylesOnlyM )
-, bBlockMode( bBlockM )
-, bProgress( bPrg )
-, bOrganizerMode( bOrganizerM )
-, bBodyContentStarted( sal_True )
-
- // #107848#
- // Initialize inside_deleted_section flag correctly
-, bInsideDeleteContext( sal_False )
-
-, sParaStyleName(RTL_CONSTASCII_USTRINGPARAM("ParaStyleName"))
-, sCharStyleName(RTL_CONSTASCII_USTRINGPARAM("CharStyleName"))
-, sHeadingStyleName(RTL_CONSTASCII_USTRINGPARAM("HeadingStyleName"))
-, sNumberingLevel(RTL_CONSTASCII_USTRINGPARAM("NumberingLevel"))
-, sNumberingStartValue(RTL_CONSTASCII_USTRINGPARAM("NumberingStartValue"))
-, sNumberingRules(RTL_CONSTASCII_USTRINGPARAM("NumberingRules"))
-, sParaIsNumberingRestart(RTL_CONSTASCII_USTRINGPARAM("ParaIsNumberingRestart"))
-, sNumberingIsNumber(RTL_CONSTASCII_USTRINGPARAM("NumberingIsNumber"))
-, sCurrentPresentation(RTL_CONSTASCII_USTRINGPARAM("CurrentPresentation"))
-, sSequenceNumber(RTL_CONSTASCII_USTRINGPARAM("SequenceNumber"))
-, sSourceName(RTL_CONSTASCII_USTRINGPARAM("SourceName"))
-, sChainNextName(RTL_CONSTASCII_USTRINGPARAM("ChainNextName"))
-, sChainPrevName(RTL_CONSTASCII_USTRINGPARAM("ChainPrevName"))
-, sHyperLinkURL(RTL_CONSTASCII_USTRINGPARAM("HyperLinkURL"))
-, sHyperLinkName(RTL_CONSTASCII_USTRINGPARAM("HyperLinkName"))
-, sHyperLinkTarget(RTL_CONSTASCII_USTRINGPARAM("HyperLinkTarget"))
-, sUnvisitedCharStyleName(RTL_CONSTASCII_USTRINGPARAM("UnvisitedCharStyleName"))
-, sVisitedCharStyleName(RTL_CONSTASCII_USTRINGPARAM("VisitedCharStyleName"))
-, sTextFrame(RTL_CONSTASCII_USTRINGPARAM("TextFrame"))
-, sPageDescName(RTL_CONSTASCII_USTRINGPARAM("PageDescName"))
-, sServerMap(RTL_CONSTASCII_USTRINGPARAM("ServerMap"))
-, sHyperLinkEvents(RTL_CONSTASCII_USTRINGPARAM("HyperLinkEvents"))
-, sContent(RTL_CONSTASCII_USTRINGPARAM("Content"))
-, sServiceCombinedCharacters(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextField.CombinedCharacters"))
-, sNumberingStyleName(RTL_CONSTASCII_USTRINGPARAM("NumberingStyleName"))
-// --> OD 2008-04-23 #refactorlists#
-, sPropNameDefaultListId(RTL_CONSTASCII_USTRINGPARAM("DefaultListId"))
-, sPropNameListId(RTL_CONSTASCII_USTRINGPARAM("ListId"))
-, sOutlineLevel( RTL_CONSTASCII_USTRINGPARAM("OutlineLevel")) //#outline level,add by zhaojianwei
-// <--
+ bool const bInsertMode, bool const bStylesOnlyMode,
+ bool const bProgress, bool const bBlockMode,
+ bool const bOrganizerMode)
+ : m_pImpl( new Impl(rModel, rImport, bInsertMode, bStylesOnlyMode,
+ bProgress, bBlockMode, bOrganizerMode) )
+ , m_pBackpatcherImpl( MakeBackpatcherImpl() )
{
+ static ::rtl::OUString s_PropNameDefaultListId(
+ RTL_CONSTASCII_USTRINGPARAM("DefaultListId"));
+
Reference< XChapterNumberingSupplier > xCNSupplier( rModel, UNO_QUERY );
if( xCNSupplier.is() )
{
- xChapterNumbering = xCNSupplier->getChapterNumberingRules();
+ m_pImpl->m_xChapterNumbering = xCNSupplier->getChapterNumberingRules();
// --> OD 2008-05-15 #refactorlists#
- if ( xChapterNumbering.is() )
+ if (m_pImpl->m_xChapterNumbering.is())
{
- Reference< XPropertySet > xNumRuleProps( xChapterNumbering, UNO_QUERY );
+ Reference< XPropertySet > const xNumRuleProps(
+ m_pImpl->m_xChapterNumbering, UNO_QUERY);
if ( xNumRuleProps.is() )
{
Reference< XPropertySetInfo > xNumRulePropSetInfo(
xNumRuleProps->getPropertySetInfo());
- if ( xNumRulePropSetInfo.is() &&
- xNumRulePropSetInfo->hasPropertyByName( sPropNameDefaultListId) )
+ if (xNumRulePropSetInfo.is() &&
+ xNumRulePropSetInfo->hasPropertyByName(
+ s_PropNameDefaultListId))
{
::rtl::OUString sListId;
- xNumRuleProps->getPropertyValue( sPropNameDefaultListId ) >>= sListId;
+ xNumRuleProps->getPropertyValue(s_PropNameDefaultListId)
+ >>= sListId;
DBG_ASSERT( sListId.getLength() != 0,
"no default list id found at chapter numbering rules instance. Serious defect -> please inform OD." );
if ( sListId.getLength() )
{
- Reference< XNamed > xChapterNumNamed( xChapterNumbering, UNO_QUERY );
+ Reference< XNamed > const xChapterNumNamed(
+ m_pImpl->m_xChapterNumbering, UNO_QUERY);
if ( xChapterNumNamed.is() )
{
- mpTextListsHelper->KeepListAsProcessed(
+ m_pImpl->m_pTextListsHelper->KeepListAsProcessed(
sListId,
xChapterNumNamed->getName(),
::rtl::OUString() );
@@ -639,72 +1013,81 @@ XMLTextImportHelper::XMLTextImportHelper(
const OUString aParaStyles(RTL_CONSTASCII_USTRINGPARAM("ParagraphStyles"));
if( xFamilies->hasByName( aParaStyles ) )
{
- xParaStyles.set(xFamilies->getByName( aParaStyles ), UNO_QUERY);
+ m_pImpl->m_xParaStyles.set(xFamilies->getByName(aParaStyles),
+ UNO_QUERY);
}
const OUString aCharStyles(RTL_CONSTASCII_USTRINGPARAM("CharacterStyles"));
if( xFamilies->hasByName( aCharStyles ) )
{
- xTextStyles.set(xFamilies->getByName( aCharStyles ), UNO_QUERY);
+ m_pImpl->m_xTextStyles.set(xFamilies->getByName(aCharStyles),
+ UNO_QUERY);
}
const OUString aNumStyles(RTL_CONSTASCII_USTRINGPARAM("NumberingStyles"));
if( xFamilies->hasByName( aNumStyles ) )
{
- xNumStyles.set(xFamilies->getByName( aNumStyles ), UNO_QUERY);
+ m_pImpl->m_xNumStyles.set(xFamilies->getByName(aNumStyles),
+ UNO_QUERY);
}
const OUString aFrameStyles(RTL_CONSTASCII_USTRINGPARAM("FrameStyles"));
if( xFamilies->hasByName( aFrameStyles ) )
{
- xFrameStyles.set(xFamilies->getByName( aFrameStyles ), UNO_QUERY);
+ m_pImpl->m_xFrameStyles.set(xFamilies->getByName(aFrameStyles),
+ UNO_QUERY);
}
const OUString aPageStyles(RTL_CONSTASCII_USTRINGPARAM("PageStyles"));
if( xFamilies->hasByName( aPageStyles ) )
{
- xPageStyles.set(xFamilies->getByName( aPageStyles ), UNO_QUERY);
+ m_pImpl->m_xPageStyles.set(xFamilies->getByName(aPageStyles),
+ UNO_QUERY);
}
}
Reference < XTextFramesSupplier > xTFS( rModel, UNO_QUERY );
if( xTFS.is() )
- xTextFrames.set(xTFS->getTextFrames());
+ {
+ m_pImpl->m_xTextFrames.set(xTFS->getTextFrames());
+ }
Reference < XTextGraphicObjectsSupplier > xTGOS( rModel, UNO_QUERY );
if( xTGOS.is() )
- xGraphics.set(xTGOS->getGraphicObjects());
+ {
+ m_pImpl->m_xGraphics.set(xTGOS->getGraphicObjects());
+ }
Reference < XTextEmbeddedObjectsSupplier > xTEOS( rModel, UNO_QUERY );
if( xTEOS.is() )
- xObjects.set(xTEOS->getEmbeddedObjects());
+ {
+ m_pImpl->m_xObjects.set(xTEOS->getEmbeddedObjects());
+ }
XMLPropertySetMapper *pPropMapper =
new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA );
- xParaImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport );
+ m_pImpl->m_xParaImpPrMap =
+ new XMLTextImportPropertyMapper( pPropMapper, rImport );
pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT );
- xTextImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport );
+ m_pImpl->m_xTextImpPrMap =
+ new XMLTextImportPropertyMapper( pPropMapper, rImport );
pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME );
- xFrameImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport );
+ m_pImpl->m_xFrameImpPrMap =
+ new XMLTextImportPropertyMapper( pPropMapper, rImport );
pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_SECTION );
- xSectionImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport );
+ m_pImpl->m_xSectionImpPrMap =
+ new XMLTextImportPropertyMapper( pPropMapper, rImport );
pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_RUBY );
- xRubyImpPrMap = new SvXMLImportPropertyMapper( pPropMapper, rImport );
+ m_pImpl->m_xRubyImpPrMap =
+ new SvXMLImportPropertyMapper( pPropMapper, rImport );
}
XMLTextImportHelper::~XMLTextImportHelper()
{
- // --> OD 2006-10-12 #i69629#
- delete [] mpOutlineStylesCandidates;
- // <--
-
- aBookmarkVector.clear();
-
- _FinitBackpatcher();
}
SvXMLImportPropertyMapper *XMLTextImportHelper::CreateShapeExtPropMapper(SvXMLImport& rImport)
@@ -771,75 +1154,46 @@ SvXMLImportPropertyMapper*
void XMLTextImportHelper::SetCursor( const Reference < XTextCursor > & rCursor )
{
- xCursor.set(rCursor);
- xText.set(rCursor->getText());
- xCursorAsRange.set( rCursor, UNO_QUERY );
+ m_pImpl->m_xCursor.set(rCursor);
+ m_pImpl->m_xText.set(rCursor->getText());
+ m_pImpl->m_xCursorAsRange.set( rCursor, UNO_QUERY );
}
void XMLTextImportHelper::ResetCursor()
{
- xCursor.set(0);
- xText.set(0);
- xCursorAsRange.set(0);
-}
-
-SvXMLTokenMap *XMLTextImportHelper::_GetTextElemTokenMap()
-{
- return new SvXMLTokenMap( aTextElemTokenMap );
-}
-
-SvXMLTokenMap *XMLTextImportHelper::_GetTextPElemTokenMap()
-{
- return new SvXMLTokenMap( aTextPElemTokenMap );
-}
-
-SvXMLTokenMap *XMLTextImportHelper::_GetTextPAttrTokenMap()
-{
- return new SvXMLTokenMap( aTextPAttrTokenMap );
-}
-
-SvXMLTokenMap *XMLTextImportHelper::_GetTextFrameAttrTokenMap()
-{
- return new SvXMLTokenMap( aTextFrameAttrTokenMap );
-}
-
-SvXMLTokenMap *XMLTextImportHelper::_GetTextContourAttrTokenMap()
-{
- return new SvXMLTokenMap( aTextContourAttrTokenMap );
+ m_pImpl->m_xCursor.set(0);
+ m_pImpl->m_xText.set(0);
+ m_pImpl->m_xCursorAsRange.set(0);
}
-SvXMLTokenMap *XMLTextImportHelper::_GetTextHyperlinkAttrTokenMap()
-{
- return new SvXMLTokenMap( aTextHyperlinkAttrTokenMap );
-}
-
-SvXMLTokenMap *XMLTextImportHelper::_GetTextMasterPageElemTokenMap()
-{
- return new SvXMLTokenMap( aTextMasterPageElemTokenMap );
-}
-
sal_Bool XMLTextImportHelper::HasFrameByName( const OUString& rName ) const
{
- return ( xTextFrames.is() && xTextFrames->hasByName( rName ) ) ||
- ( xGraphics.is() && xGraphics->hasByName( rName ) ) ||
- ( xObjects.is() && xObjects->hasByName( rName ) );
+ return (m_pImpl->m_xTextFrames.is() &&
+ m_pImpl->m_xTextFrames->hasByName(rName))
+ || (m_pImpl->m_xGraphics.is() &&
+ m_pImpl->m_xGraphics->hasByName(rName))
+ || (m_pImpl->m_xObjects.is() &&
+ m_pImpl->m_xObjects->hasByName(rName));
}
void XMLTextImportHelper::InsertString( const OUString& rChars )
{
- DBG_ASSERT( xText.is(), "no text" );
- DBG_ASSERT( xCursorAsRange.is(), "no range" );
- if( xText.is() )
- xText->insertString( xCursorAsRange, rChars, sal_False );
+ DBG_ASSERT(m_pImpl->m_xText.is(), "no text");
+ DBG_ASSERT(m_pImpl->m_xCursorAsRange.is(), "no range");
+ if (m_pImpl->m_xText.is())
+ {
+ m_pImpl->m_xText->insertString(m_pImpl->m_xCursorAsRange,
+ rChars, sal_False);
+ }
}
void XMLTextImportHelper::InsertString( const OUString& rChars,
sal_Bool& rIgnoreLeadingSpace )
{
- DBG_ASSERT( xText.is(), "no text" );
- DBG_ASSERT( xCursorAsRange.is(), "no range" );
- if( xText.is() )
+ DBG_ASSERT(m_pImpl->m_xText.is(), "no text");
+ DBG_ASSERT(m_pImpl->m_xCursorAsRange.is(), "no range");
+ if (m_pImpl->m_xText.is())
{
sal_Int32 nLen = rChars.getLength();
OUStringBuffer sChars( nLen );
@@ -863,35 +1217,43 @@ void XMLTextImportHelper::InsertString( const OUString& rChars,
break;
}
}
- xText->insertString( xCursorAsRange, sChars.makeStringAndClear(),
- sal_False );
+ m_pImpl->m_xText->insertString(m_pImpl->m_xCursorAsRange,
+ sChars.makeStringAndClear(), sal_False);
}
}
+
void XMLTextImportHelper::InsertControlCharacter( sal_Int16 nControl )
{
- DBG_ASSERT( xText.is(), "no text" );
- DBG_ASSERT( xCursorAsRange.is(), "no range" );
- if( xText.is() )
- xText->insertControlCharacter( xCursorAsRange, nControl, sal_False );
+ DBG_ASSERT(m_pImpl->m_xText.is(), "no text");
+ DBG_ASSERT(m_pImpl->m_xCursorAsRange.is(), "no range");
+ if (m_pImpl->m_xText.is())
+ {
+ m_pImpl->m_xText->insertControlCharacter(
+ m_pImpl->m_xCursorAsRange, nControl, sal_False);
+ }
}
void XMLTextImportHelper::InsertTextContent(
Reference < XTextContent > & xContent )
{
- DBG_ASSERT( xText.is(), "no text" );
- DBG_ASSERT( xCursorAsRange.is(), "no range" );
- if( xText.is() )
- xText->insertTextContent( xCursorAsRange, xContent, sal_False );
+ DBG_ASSERT(m_pImpl->m_xText.is(), "no text");
+ DBG_ASSERT(m_pImpl->m_xCursorAsRange.is(), "no range");
+ if (m_pImpl->m_xText.is())
+ {
+ m_pImpl->m_xText->insertTextContent(
+ m_pImpl->m_xCursorAsRange, xContent, sal_False);
+ }
}
void XMLTextImportHelper::DeleteParagraph()
{
- DBG_ASSERT( xText.is(), "no text" );
- DBG_ASSERT( xCursor.is(), "no cursor" );
- DBG_ASSERT( xCursorAsRange.is(), "no range" );
+ DBG_ASSERT(m_pImpl->m_xText.is(), "no text");
+ DBG_ASSERT(m_pImpl->m_xCursor.is(), "no cursor");
+ DBG_ASSERT(m_pImpl->m_xCursorAsRange.is(), "no range");
sal_Bool bDelete = sal_True;
- Reference < XEnumerationAccess > xEnumAccess( xCursor, UNO_QUERY );
+ Reference < XEnumerationAccess > const xEnumAccess(
+ m_pImpl->m_xCursor, UNO_QUERY);
if( xEnumAccess.is() )
{
Reference < XEnumeration > xEnum(xEnumAccess->createEnumeration());
@@ -909,10 +1271,11 @@ void XMLTextImportHelper::DeleteParagraph()
}
if( bDelete )
{
- if( xCursor->goLeft( 1, sal_True ) )
+ if (m_pImpl->m_xCursor->goLeft( 1, sal_True ))
{
OUString sEmpty;
- xText->insertString( xCursorAsRange, sEmpty, sal_True );
+ m_pImpl->m_xText->insertString(m_pImpl->m_xCursorAsRange,
+ sEmpty, sal_True);
}
}
}
@@ -935,9 +1298,10 @@ OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars,
XMLTextStyleContext *pStyle = 0;
sal_uInt16 nFamily = bPara ? XML_STYLE_FAMILY_TEXT_PARAGRAPH
: XML_STYLE_FAMILY_TEXT_TEXT;
- if( rStyleName.getLength() && xAutoStyles.Is() )
+ if (rStyleName.getLength() && m_pImpl->m_xAutoStyles.Is())
{
- const SvXMLStyleContext* pTempStyle = ((SvXMLStylesContext *)&xAutoStyles)->
+ const SvXMLStyleContext* pTempStyle =
+ ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( nFamily, rStyleName,
sal_True );
pStyle = PTR_CAST( XMLTextStyleContext,pTempStyle);
@@ -949,7 +1313,8 @@ OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars,
if( nCount )
{
UniReference < SvXMLImportPropertyMapper > xImpPrMap =
- ((SvXMLStylesContext *)&xAutoStyles)->GetImportPropertyMapper(nFamily);
+ ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)
+ ->GetImportPropertyMapper(nFamily);
if( xImpPrMap.is() )
{
UniReference<XMLPropertySetMapper> rPropMapper =
@@ -1135,13 +1500,41 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
sal_Bool bSetListAttrs )
// <--
{
+ static ::rtl::OUString s_ParaStyleName(
+ RTL_CONSTASCII_USTRINGPARAM("ParaStyleName"));
+ static ::rtl::OUString s_CharStyleName(
+ RTL_CONSTASCII_USTRINGPARAM("CharStyleName"));
+ static ::rtl::OUString s_NumberingRules(
+ RTL_CONSTASCII_USTRINGPARAM("NumberingRules"));
+ static ::rtl::OUString s_NumberingIsNumber(
+ RTL_CONSTASCII_USTRINGPARAM("NumberingIsNumber"));
+ static ::rtl::OUString s_NumberingLevel(
+ RTL_CONSTASCII_USTRINGPARAM("NumberingLevel"));
+ static ::rtl::OUString s_ParaIsNumberingRestart(
+ RTL_CONSTASCII_USTRINGPARAM("ParaIsNumberingRestart"));
+ static ::rtl::OUString s_NumberingStartValue(
+ RTL_CONSTASCII_USTRINGPARAM("NumberingStartValue"));
+ static ::rtl::OUString s_PropNameListId(
+ RTL_CONSTASCII_USTRINGPARAM("ListId"));
+ static ::rtl::OUString s_PageDescName(
+ RTL_CONSTASCII_USTRINGPARAM("PageDescName"));
+ static ::rtl::OUString s_ServiceCombinedCharacters(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.text.TextField.CombinedCharacters"));
+ static ::rtl::OUString s_Content(RTL_CONSTASCII_USTRINGPARAM("Content"));
+ static ::rtl::OUString s_OutlineLevel(
+ RTL_CONSTASCII_USTRINGPARAM("OutlineLevel"));
+ static ::rtl::OUString s_NumberingStyleName(
+ RTL_CONSTASCII_USTRINGPARAM("NumberingStyleName"));
+
const sal_uInt16 nFamily = bPara ? XML_STYLE_FAMILY_TEXT_PARAGRAPH
: XML_STYLE_FAMILY_TEXT_TEXT;
XMLTextStyleContext *pStyle = 0;
OUString sStyleName( rStyleName );
- if( sStyleName.getLength() && xAutoStyles.Is() )
+ if (sStyleName.getLength() && m_pImpl->m_xAutoStyles.Is())
{
- const SvXMLStyleContext* pTempStyle = ((SvXMLStylesContext *)&xAutoStyles)->
+ const SvXMLStyleContext* pTempStyle =
+ ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( nFamily, sStyleName, sal_True );
pStyle = PTR_CAST( XMLTextStyleContext,pTempStyle);
}
@@ -1156,9 +1549,10 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
if( sStyleName.getLength() )
{
sStyleName = rImport.GetStyleDisplayName( nFamily, sStyleName );
- const String& rPropName = bPara ? sParaStyleName : sCharStyleName;
- const Reference < XNameContainer > & rStyles = bPara ? xParaStyles
- : xTextStyles;
+ const String& rPropName = (bPara) ? s_ParaStyleName : s_CharStyleName;
+ const Reference < XNameContainer > & rStyles = (bPara)
+ ? m_pImpl->m_xParaStyles
+ : m_pImpl->m_xTextStyles;
if( rStyles.is() &&
xPropSetInfo->hasPropertyByName( rPropName ) &&
rStyles->hasByName( sStyleName ) )
@@ -1174,11 +1568,13 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
// is not inside a list and if it by default applies the outline style.
bool bApplyOutlineLevelAsListLevel( false );
// --> OD 2007-08-17 #i80724#
- if ( bSetListAttrs && bPara && xPropSetInfo->hasPropertyByName( sNumberingRules ) )
+ if (bSetListAttrs && bPara
+ && xPropSetInfo->hasPropertyByName( s_NumberingRules))
// <--
{
// Set numbering rules
- Reference < XIndexReplace > xNumRules(xPropSet->getPropertyValue( sNumberingRules ), UNO_QUERY);
+ Reference< XIndexReplace > const xNumRules(
+ xPropSet->getPropertyValue(s_NumberingRules), UNO_QUERY);
XMLTextListBlockContext * pListBlock(0);
XMLTextListItemContext * pListItem(0);
@@ -1214,7 +1610,8 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
}
// --> OD 2008-08-15 #i92811#
- sListId = mpTextListsHelper->GetListIdForListBlock( *pListBlock );
+ sListId = m_pImpl->m_pTextListsHelper->GetListIdForListBlock(
+ *pListBlock);
// <--
}
else if (pNumberedParagraph)
@@ -1268,7 +1665,8 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
// gracefully.
try
{
- xPropSet->setPropertyValue( sNumberingRules, makeAny(xNewNumRules) );
+ xPropSet->setPropertyValue(
+ s_NumberingRules, makeAny(xNewNumRules) );
}
catch( Exception e )
{
@@ -1279,37 +1677,37 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
}
if (!bNumberingIsNumber &&
- xPropSetInfo->hasPropertyByName( sNumberingIsNumber ) )
+ xPropSetInfo->hasPropertyByName(s_NumberingIsNumber))
{
- xPropSet->setPropertyValue( sNumberingIsNumber, Any(sal_False) );
+ xPropSet->setPropertyValue(s_NumberingIsNumber, Any(sal_False));
}
- xPropSet->setPropertyValue( sNumberingLevel, Any(nLevel) );
+ xPropSet->setPropertyValue( s_NumberingLevel, Any(nLevel) );
if( pListBlock && pListBlock->IsRestartNumbering() )
{
// TODO: property missing
- if( xPropSetInfo->hasPropertyByName( sParaIsNumberingRestart ) )
+ if (xPropSetInfo->hasPropertyByName(s_ParaIsNumberingRestart))
{
sal_Bool bTmp = sal_True;
- xPropSet->setPropertyValue(sParaIsNumberingRestart,
+ xPropSet->setPropertyValue(s_ParaIsNumberingRestart,
makeAny(bTmp) );
}
pListBlock->ResetRestartNumbering();
}
if ( 0 <= nStartValue &&
- xPropSetInfo->hasPropertyByName( sNumberingStartValue ) )
+ xPropSetInfo->hasPropertyByName(s_NumberingStartValue))
{
- xPropSet->setPropertyValue(sNumberingStartValue,
+ xPropSet->setPropertyValue(s_NumberingStartValue,
makeAny(nStartValue));
}
// --> OD 2008-04-23 #refactorlists#
- if ( xPropSetInfo->hasPropertyByName( sPropNameListId ) )
+ if (xPropSetInfo->hasPropertyByName(s_PropNameListId))
{
if (sListId.getLength()) {
- xPropSet->setPropertyValue( sPropNameListId,
+ xPropSet->setPropertyValue(s_PropNameListId,
makeAny(sListId) );
}
}
@@ -1338,10 +1736,11 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
if ( ( bBuildIdFound && nUPD == 680 ) ||
!pStyle || !pStyle->IsListStyleSet() )
{
- if ( xChapterNumbering.is() )
+ if (m_pImpl->m_xChapterNumbering.is())
{
Reference< XNamed > xNumNamed( xNumRules, UNO_QUERY );
- Reference< XNamed > xChapterNumNamed( xChapterNumbering, UNO_QUERY );
+ Reference< XNamed > const xChapterNumNamed (
+ m_pImpl->m_xChapterNumbering, UNO_QUERY);
if ( xNumNamed.is() && xChapterNumNamed.is() &&
xNumNamed->getName() == xChapterNumNamed->getName() )
{
@@ -1355,7 +1754,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
// <--
if ( bRemove )
{
- xPropSet->setPropertyValue( sNumberingRules, Any() );
+ xPropSet->setPropertyValue( s_NumberingRules, Any() );
}
}
// <--
@@ -1367,27 +1766,28 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
{
pStyle->FillPropertySet( xPropSet );
if( bPara && pStyle->HasMasterPageName() &&
- xPropSetInfo->hasPropertyByName( sPageDescName ) )
+ xPropSetInfo->hasPropertyByName(s_PageDescName))
{
OUString sDisplayName(
rImport.GetStyleDisplayName(
XML_STYLE_FAMILY_MASTER_PAGE,
pStyle->GetMasterPageName()) );
if( !sDisplayName.getLength() ||
- (xPageStyles.is() &&
- xPageStyles->hasByName( sDisplayName )) )
+ (m_pImpl->m_xPageStyles.is() &&
+ m_pImpl->m_xPageStyles->hasByName( sDisplayName)))
{
- xPropSet->setPropertyValue( sPageDescName, makeAny(sDisplayName) );
+ xPropSet->setPropertyValue(s_PageDescName,
+ makeAny(sDisplayName));
}
}
if( bPara && pStyle->GetDropCapStyleName().getLength() &&
- xTextStyles.is() )
+ m_pImpl->m_xTextStyles.is())
{
OUString sDisplayName(
rImport.GetStyleDisplayName(
XML_STYLE_FAMILY_TEXT_TEXT,
pStyle->GetDropCapStyleName()) );
- if( xTextStyles->hasByName( sDisplayName ) &&
+ if (m_pImpl->m_xTextStyles->hasByName(sDisplayName) &&
xPropSetInfo->hasPropertyByName( sDisplayName ) )
{
xPropSet->setPropertyValue( pStyle->sDropCapCharStyleName, makeAny(sDisplayName) );
@@ -1398,9 +1798,11 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
if (!bPara && pStyle->HasCombinedCharactersLetter())
{
// insert combined characters text field
- if( xServiceFactory.is() )
+ if (m_pImpl->m_xServiceFactory.is())
{
- Reference<XPropertySet> xTmp( xServiceFactory->createInstance(sServiceCombinedCharacters), UNO_QUERY );
+ uno::Reference<beans::XPropertySet> const xTmp(
+ m_pImpl->m_xServiceFactory->createInstance(
+ s_ServiceCombinedCharacters), UNO_QUERY);
if( xTmp.is() )
{
// fix cursor if larger than possible for
@@ -1413,15 +1815,36 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
}
// set field value (the combined character string)
- xTmp->setPropertyValue(sContent, makeAny(rCursor->getString()));
+ xTmp->setPropertyValue(s_Content,
+ makeAny(rCursor->getString()));
// insert the field over it's original text
Reference<XTextRange> xRange(rCursor, UNO_QUERY);
Reference<XTextContent> xTextContent(xTmp, UNO_QUERY);
- if (xText.is() && xRange.is())
+ if (m_pImpl->m_xText.is() && xRange.is())
{
- xText->insertTextContent( xRange, xTextContent,
- sal_True );
+ // #i107225# the combined characters need to be inserted first
+ // the selected text has to be removed afterwards
+ m_pImpl->m_xText->insertTextContent( xRange->getStart(), xTextContent, sal_True );
+
+ if( xRange->getString().getLength() )
+ {
+ try
+ {
+ uno::Reference< text::XTextCursor > xCrsr = xRange->getText()->createTextCursorByRange( xRange->getStart() );
+ xCrsr->goLeft( 1, true );
+ uno::Reference< beans::XPropertySet> xCrsrProperties( xCrsr, uno::UNO_QUERY_THROW );
+ //the hard properties of the removed text need to be applied to the combined characters field
+ pStyle->FillPropertySet( xCrsrProperties );
+ xCrsr->collapseToEnd();
+ xCrsr->gotoRange( xRange->getEnd(), true );
+ xCrsr->setString( ::rtl::OUString() );
+ }
+ catch( const uno::Exception& rEx )
+ {
+ (void)rEx;
+ }
+ }
}
}
}
@@ -1444,10 +1867,12 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
{
// --> OD 2009-08-18 #i103817#
sal_Int16 nCurrentOutlineLevelInheritedFromParagraphStyle = 0;
- const bool bHasOutlineLevelProp( xPropSetInfo->hasPropertyByName( sOutlineLevel ) );
+ const bool bHasOutlineLevelProp(
+ xPropSetInfo->hasPropertyByName(s_OutlineLevel));
if ( bHasOutlineLevelProp )
{
- xPropSet->getPropertyValue( sOutlineLevel ) >>= nCurrentOutlineLevelInheritedFromParagraphStyle;
+ xPropSet->getPropertyValue(s_OutlineLevel)
+ >>= nCurrentOutlineLevelInheritedFromParagraphStyle;
}
// <--
//if ( bPara && nOutlineLevel != -1 ) //#outline level,removed by zhaojianwei
@@ -1460,7 +1885,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
// attribute outline level, the paragraph attribute value is left unset
if ( nCurrentOutlineLevelInheritedFromParagraphStyle != nOutlineLevel )
{
- xPropSet->setPropertyValue( sOutlineLevel,
+ xPropSet->setPropertyValue( s_OutlineLevel,
makeAny( static_cast<sal_Int16>(nOutlineLevel) ) );
}
}//<-end,zhaojianwei
@@ -1469,11 +1894,11 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
if ( bApplyOutlineLevelAsListLevel )
{
sal_Int16 nNumLevel = -1;
- xPropSet->getPropertyValue( sNumberingLevel ) >>= nNumLevel;
+ xPropSet->getPropertyValue( s_NumberingLevel ) >>= nNumLevel;
if ( nNumLevel == -1 ||
nNumLevel != (nOutlineLevel - 1) )
{
- xPropSet->setPropertyValue( sNumberingLevel,
+ xPropSet->setPropertyValue( s_NumberingLevel,
makeAny( static_cast<sal_Int8>(nOutlineLevel - 1) ) );
}
}
@@ -1486,7 +1911,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
// a candidate for an assignment to the list level of the outline
// style, if it has no direct list style property and (if exists) the
// automatic paragraph style has also no direct list style set.
- if( xParaStyles->hasByName( sStyleName ) )
+ if (m_pImpl->m_xParaStyles->hasByName(sStyleName))
{
bool bOutlineStyleCandidate( false );
@@ -1538,19 +1963,19 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
// Assure that heading applies the outline style
if ( ( !pStyle || !pStyle->IsListStyleSet() ) &&
!bOutlineStyleCandidate &&
- xChapterNumbering.is() )
+ m_pImpl->m_xChapterNumbering.is())
{
OUString sEmptyStr;
if ( !lcl_HasListStyle( sStyleName,
- xParaStyles, GetXMLImport(),
- sNumberingStyleName,
+ m_pImpl->m_xParaStyles, GetXMLImport(),
+ s_NumberingStyleName,
sEmptyStr ) )
{
// heading not in a list --> apply outline style
- xPropSet->setPropertyValue( sNumberingRules,
- makeAny(xChapterNumbering) );
- xPropSet->setPropertyValue( sNumberingLevel,
- makeAny( static_cast<sal_Int8>(nOutlineLevel - 1) ) );
+ xPropSet->setPropertyValue( s_NumberingRules,
+ makeAny(m_pImpl->m_xChapterNumbering) );
+ xPropSet->setPropertyValue( s_NumberingLevel,
+ makeAny(static_cast<sal_Int8>(nOutlineLevel - 1)));
}
}
// <--
@@ -1564,7 +1989,8 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
if ( nCurrentOutlineLevelInheritedFromParagraphStyle != 0 )
{
sal_Int16 nZero = 0;
- xPropSet->setPropertyValue( sOutlineLevel, makeAny( static_cast<sal_Int16>(nZero) ) );
+ xPropSet->setPropertyValue(s_OutlineLevel,
+ makeAny( static_cast<sal_Int16>(nZero) ));
}
}//<-end,zhaojianwei
}
@@ -1576,38 +2002,39 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
void XMLTextImportHelper::FindOutlineStyleName( ::rtl::OUString& rStyleName,
sal_Int8 nOutlineLevel )
{
+ static ::rtl::OUString s_HeadingStyleName(
+ RTL_CONSTASCII_USTRINGPARAM("HeadingStyleName"));
+
// style name empty?
if( rStyleName.getLength() == 0 )
{
// Empty? Then we need o do stuff. Let's do error checking first.
- if( xChapterNumbering.is() &&
+ if (m_pImpl->m_xChapterNumbering.is() &&
( nOutlineLevel > 0 ) &&
- ( nOutlineLevel <= xChapterNumbering->getCount() ) )
+ (nOutlineLevel <= m_pImpl->m_xChapterNumbering->getCount()))
{
nOutlineLevel--; // for the remainder, the level's are 0-based
// empty style name: look-up previously used name
// if we don't have a previously used name, we'll use the default
- if ( mpOutlineStylesCandidates == NULL )
- {
- mpOutlineStylesCandidates = new ::std::vector<OUString>[xChapterNumbering->getCount()];
- }
-
- if ( mpOutlineStylesCandidates[nOutlineLevel].empty() )
+ m_pImpl->InitOutlineStylesCandidates();
+ if (m_pImpl->m_pOutlineStylesCandidates[nOutlineLevel].empty())
{
// no other name used previously? Then use default
// iterate over property value sequence to find the style name
Sequence<PropertyValue> aProperties;
- xChapterNumbering->getByIndex( nOutlineLevel ) >>= aProperties;
+ m_pImpl->m_xChapterNumbering->getByIndex( nOutlineLevel )
+ >>= aProperties;
for( sal_Int32 i = 0; i < aProperties.getLength(); i++ )
{
- if( aProperties[i].Name == sHeadingStyleName )
+ if (aProperties[i].Name == s_HeadingStyleName)
{
rtl::OUString aOutlineStyle;
aProperties[i].Value >>= aOutlineStyle;
- mpOutlineStylesCandidates[nOutlineLevel].push_back( aOutlineStyle );
+ m_pImpl->m_pOutlineStylesCandidates[nOutlineLevel]
+ .push_back( aOutlineStyle );
break; // early out, if we found it!.
}
}
@@ -1616,7 +2043,8 @@ void XMLTextImportHelper::FindOutlineStyleName( ::rtl::OUString& rStyleName,
// finally, we'll use the previously used style name for this
// format (or the default we've just put into that style)
// --> OD 2006-11-06 #i71249# - take last added one
- rStyleName = mpOutlineStylesCandidates[nOutlineLevel].back();
+ rStyleName =
+ m_pImpl->m_pOutlineStylesCandidates[nOutlineLevel].back();
// <--
}
// else: nothing we can do, so we'll leave it empty
@@ -1627,23 +2055,27 @@ void XMLTextImportHelper::FindOutlineStyleName( ::rtl::OUString& rStyleName,
void XMLTextImportHelper::AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel,
const OUString& rStyleName )
{
- if ( rStyleName.getLength() &&
- xChapterNumbering.is() &&
- nOutlineLevel > 0 && nOutlineLevel <= xChapterNumbering->getCount() )
+ if (rStyleName.getLength()
+ && m_pImpl->m_xChapterNumbering.is()
+ && (nOutlineLevel > 0)
+ && (nOutlineLevel <= m_pImpl->m_xChapterNumbering->getCount()))
{
- if( !mpOutlineStylesCandidates )
- {
- mpOutlineStylesCandidates = new ::std::vector<OUString>[xChapterNumbering->getCount()];
- }
- mpOutlineStylesCandidates[nOutlineLevel-1].push_back( rStyleName );
+ m_pImpl->InitOutlineStylesCandidates();
+ m_pImpl->m_pOutlineStylesCandidates[nOutlineLevel-1].push_back(
+ rStyleName);
}
}
void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
{
- if ( ( mpOutlineStylesCandidates != NULL || bSetEmptyLevels ) &&
- xChapterNumbering.is() &&
- !IsInsertMode() )
+ static ::rtl::OUString s_NumberingStyleName(
+ RTL_CONSTASCII_USTRINGPARAM("NumberingStyleName"));
+ static ::rtl::OUString s_HeadingStyleName(
+ RTL_CONSTASCII_USTRINGPARAM("HeadingStyleName"));
+
+ if ((m_pImpl->m_pOutlineStylesCandidates != NULL || bSetEmptyLevels) &&
+ m_pImpl->m_xChapterNumbering.is() &&
+ !IsInsertMode())
{
bool bChooseLastOne( false );
{
@@ -1666,12 +2098,13 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
OUString sOutlineStyleName;
{
- Reference<XPropertySet> xChapterNumRule( xChapterNumbering, UNO_QUERY );
+ Reference<XPropertySet> xChapterNumRule(
+ m_pImpl->m_xChapterNumbering, UNO_QUERY);
const OUString sName(RTL_CONSTASCII_USTRINGPARAM("Name"));
xChapterNumRule->getPropertyValue(sName) >>= sOutlineStyleName;
}
- const sal_Int32 nCount = xChapterNumbering->getCount();
+ const sal_Int32 nCount = m_pImpl->m_xChapterNumbering->getCount();
// --> OD 2009-11-13 #i106218#
// First collect all paragraph styles choosen for assignment to each
// list level of the outline style, then perform the intrinsic assignment.
@@ -1683,28 +2116,33 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
for( sal_Int32 i=0; i < nCount; ++i )
{
if ( bSetEmptyLevels ||
- ( mpOutlineStylesCandidates &&
- !mpOutlineStylesCandidates[i].empty() ) )
+ (m_pImpl->m_pOutlineStylesCandidates &&
+ !m_pImpl->m_pOutlineStylesCandidates[i].empty()))
{
// determine, which candidate is one to be assigned to the list
// level of the outline style
- if ( mpOutlineStylesCandidates &&
- !mpOutlineStylesCandidates[i].empty() )
+ if (m_pImpl->m_pOutlineStylesCandidates &&
+ !m_pImpl->m_pOutlineStylesCandidates[i].empty())
{
if ( bChooseLastOne )
{
- sChosenStyles[i] = mpOutlineStylesCandidates[i].back();
+ sChosenStyles[i] =
+ m_pImpl->m_pOutlineStylesCandidates[i].back();
}
else
{
- for ( sal_uInt32 j = 0; j < mpOutlineStylesCandidates[i].size(); ++j )
+ for (sal_uInt32 j = 0;
+ j < m_pImpl->m_pOutlineStylesCandidates[i].size();
+ ++j)
{
- if ( !lcl_HasListStyle( mpOutlineStylesCandidates[i][j],
- xParaStyles, GetXMLImport(),
- sNumberingStyleName,
- sOutlineStyleName ) )
+ if (!lcl_HasListStyle(
+ m_pImpl->m_pOutlineStylesCandidates[i][j],
+ m_pImpl->m_xParaStyles, GetXMLImport(),
+ s_NumberingStyleName,
+ sOutlineStyleName))
{
- sChosenStyles[i] = mpOutlineStylesCandidates[i][j];
+ sChosenStyles[i] =
+ m_pImpl->m_pOutlineStylesCandidates[i][j];
break;
}
}
@@ -1715,7 +2153,7 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
// --> OD 2009-11-13 #i106218#
Sequence < PropertyValue > aProps( 1 );
PropertyValue *pProps = aProps.getArray();
- pProps->Name = sHeadingStyleName;
+ pProps->Name = s_HeadingStyleName;
for ( sal_Int32 i = 0; i < nCount; ++i )
{
// --> OD 2009-12-11 #i107610#
@@ -1724,7 +2162,8 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
// <--
{
pProps->Value <<= sChosenStyles[i];
- xChapterNumbering->replaceByIndex( i, makeAny( aProps ) );
+ m_pImpl->m_xChapterNumbering->replaceByIndex(i,
+ makeAny( aProps ));
}
}
// <--
@@ -1741,62 +2180,79 @@ void XMLTextImportHelper::SetHyperlink(
const OUString& rVisitedStyleName,
XMLEventsImportContext* pEvents)
{
+ static ::rtl::OUString s_HyperLinkURL(
+ RTL_CONSTASCII_USTRINGPARAM("HyperLinkURL"));
+ static ::rtl::OUString s_HyperLinkName(
+ RTL_CONSTASCII_USTRINGPARAM("HyperLinkName"));
+ static ::rtl::OUString s_HyperLinkTarget(
+ RTL_CONSTASCII_USTRINGPARAM("HyperLinkTarget"));
+ static ::rtl::OUString s_UnvisitedCharStyleName(
+ RTL_CONSTASCII_USTRINGPARAM("UnvisitedCharStyleName"));
+ static ::rtl::OUString s_VisitedCharStyleName(
+ RTL_CONSTASCII_USTRINGPARAM("VisitedCharStyleName"));
+ static ::rtl::OUString s_HyperLinkEvents(
+ RTL_CONSTASCII_USTRINGPARAM("HyperLinkEvents"));
+
Reference < XPropertySet > xPropSet( rCursor, UNO_QUERY );
Reference < XPropertySetInfo > xPropSetInfo(
xPropSet->getPropertySetInfo());
- if( !xPropSetInfo.is() || !xPropSetInfo->hasPropertyByName(sHyperLinkURL) )
+ if (!xPropSetInfo.is() || !xPropSetInfo->hasPropertyByName(s_HyperLinkURL))
return;
- xPropSet->setPropertyValue( sHyperLinkURL, makeAny(rHRef) );
+ xPropSet->setPropertyValue(s_HyperLinkURL, makeAny(rHRef));
- if( xPropSetInfo->hasPropertyByName( sHyperLinkName ) )
+ if (xPropSetInfo->hasPropertyByName(s_HyperLinkName))
{
- xPropSet->setPropertyValue( sHyperLinkName, makeAny(rName) );
+ xPropSet->setPropertyValue(s_HyperLinkName, makeAny(rName));
}
- if( xPropSetInfo->hasPropertyByName( sHyperLinkTarget ) )
+ if (xPropSetInfo->hasPropertyByName(s_HyperLinkTarget))
{
- xPropSet->setPropertyValue( sHyperLinkTarget, makeAny(rTargetFrameName) );
+ xPropSet->setPropertyValue(s_HyperLinkTarget,
+ makeAny(rTargetFrameName));
}
if ( (pEvents != NULL) &&
- xPropSetInfo->hasPropertyByName( sHyperLinkEvents ))
+ xPropSetInfo->hasPropertyByName(s_HyperLinkEvents))
{
// The API treats events at hyperlinks differently from most
// other properties: You have to set a name replace with the
// events in it. The easiest way to to this is to 1) get
// events, 2) set new ones, and 3) then put events back.
- Reference<XNameReplace> xReplace(xPropSet->getPropertyValue( sHyperLinkEvents ), UNO_QUERY);
+ uno::Reference<XNameReplace> const xReplace(
+ xPropSet->getPropertyValue(s_HyperLinkEvents), UNO_QUERY);
if (xReplace.is())
{
// set events
pEvents->SetEvents(xReplace);
// put events
- xPropSet->setPropertyValue( sHyperLinkEvents, makeAny(xReplace) );
+ xPropSet->setPropertyValue(s_HyperLinkEvents, makeAny(xReplace));
}
}
- if( xTextStyles.is() )
+ if (m_pImpl->m_xTextStyles.is())
{
OUString sDisplayName(
rImport.GetStyleDisplayName(
XML_STYLE_FAMILY_TEXT_TEXT, rStyleName ) );
if( sDisplayName.getLength() &&
- xPropSetInfo->hasPropertyByName( sUnvisitedCharStyleName ) &&
- xTextStyles->hasByName( sDisplayName ) )
+ xPropSetInfo->hasPropertyByName(s_UnvisitedCharStyleName) &&
+ m_pImpl->m_xTextStyles->hasByName(sDisplayName))
{
- xPropSet->setPropertyValue( sUnvisitedCharStyleName, makeAny(sDisplayName) );
+ xPropSet->setPropertyValue(s_UnvisitedCharStyleName,
+ makeAny(sDisplayName));
}
sDisplayName =
rImport.GetStyleDisplayName(
XML_STYLE_FAMILY_TEXT_TEXT, rVisitedStyleName );
if( sDisplayName.getLength() &&
- xPropSetInfo->hasPropertyByName( sVisitedCharStyleName ) &&
- xTextStyles->hasByName( sDisplayName ) )
+ xPropSetInfo->hasPropertyByName(s_VisitedCharStyleName) &&
+ m_pImpl->m_xTextStyles->hasByName(sDisplayName))
{
- xPropSet->setPropertyValue( sVisitedCharStyleName, makeAny(sDisplayName) );
+ xPropSet->setPropertyValue(s_VisitedCharStyleName,
+ makeAny(sDisplayName));
}
}
}
@@ -1822,9 +2278,10 @@ void XMLTextImportHelper::SetRuby(
// the ruby style (ruby-adjust)
XMLPropStyleContext *pStyle = 0;
- if( rStyleName.getLength() && xAutoStyles.Is() )
+ if (rStyleName.getLength() && m_pImpl->m_xAutoStyles.Is())
{
- const SvXMLStyleContext* pTempStyle = ((SvXMLStylesContext *)&xAutoStyles)->
+ const SvXMLStyleContext* pTempStyle =
+ ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( XML_STYLE_FAMILY_TEXT_RUBY,
rStyleName, sal_True );
pStyle = PTR_CAST(XMLPropStyleContext,pTempStyle);
@@ -1834,14 +2291,14 @@ void XMLTextImportHelper::SetRuby(
}
// the ruby text character style
- if( xTextStyles.is() )
+ if (m_pImpl->m_xTextStyles.is())
{
OUString sDisplayName(
rImport.GetStyleDisplayName(
XML_STYLE_FAMILY_TEXT_TEXT, rTextStyleName ) );
if( (sDisplayName.getLength() > 0) &&
// xPropSetInfo->hasPropertyByName( sRubyCharStyleName ) &&
- xTextStyles->hasByName( sDisplayName ) )
+ m_pImpl->m_xTextStyles->hasByName( sDisplayName ))
{
xPropSet->setPropertyValue(sRubyCharStyleName, makeAny(sDisplayName));
}
@@ -1851,21 +2308,21 @@ void XMLTextImportHelper::SetRuby(
void XMLTextImportHelper::SetAutoStyles( SvXMLStylesContext *pStyles )
{
- xAutoStyles = pStyles;
+ m_pImpl->m_xAutoStyles = pStyles;
}
void XMLTextImportHelper::SetFontDecls( XMLFontStylesContext *pFontDecls )
{
- xFontDecls = pFontDecls;
- ((XMLTextImportPropertyMapper *)xParaImpPrMap.get())
+ m_pImpl->m_xFontDecls = pFontDecls;
+ ((XMLTextImportPropertyMapper *)m_pImpl->m_xParaImpPrMap.get())
->SetFontDecls( pFontDecls );
- ((XMLTextImportPropertyMapper *)xTextImpPrMap.get())
+ ((XMLTextImportPropertyMapper *)m_pImpl->m_xTextImpPrMap.get())
->SetFontDecls( pFontDecls );
}
const XMLFontStylesContext *XMLTextImportHelper::GetFontDecls() const
{
- return (XMLFontStylesContext *)&xFontDecls;
+ return (XMLFontStylesContext *)&m_pImpl->m_xFontDecls;
}
sal_Bool XMLTextImportHelper::HasDrawNameAttribute(
@@ -1910,7 +2367,7 @@ SvXMLImportContext *XMLTextImportHelper::CreateTextChildContext(
pContext = new XMLParaContext( rImport,
nPrefix, rLocalName,
xAttrList, bHeading );
- if( bProgress && XML_TEXT_TYPE_SHAPE != eType )
+ if (m_pImpl->m_bProgress && XML_TEXT_TYPE_SHAPE != eType)
{
rImport.GetProgressBarHelper()->Increment();
}
@@ -1935,7 +2392,7 @@ SvXMLImportContext *XMLTextImportHelper::CreateTextChildContext(
xAttrList );
break;
case XML_TOK_TEXT_SEQUENCE_DECLS:
- if( (XML_TEXT_TYPE_BODY == eType && bBodyContentStarted) ||
+ if ((XML_TEXT_TYPE_BODY == eType && m_pImpl->m_bBodyContentStarted) ||
XML_TEXT_TYPE_HEADER_FOOTER == eType )
{
pContext = new XMLVariableDeclsImportContext(
@@ -1945,7 +2402,7 @@ SvXMLImportContext *XMLTextImportHelper::CreateTextChildContext(
break;
case XML_TOK_TEXT_VARFIELD_DECLS:
- if( (XML_TEXT_TYPE_BODY == eType && bBodyContentStarted) ||
+ if ((XML_TEXT_TYPE_BODY == eType && m_pImpl->m_bBodyContentStarted) ||
XML_TEXT_TYPE_HEADER_FOOTER == eType )
{
pContext = new XMLVariableDeclsImportContext(
@@ -1955,7 +2412,7 @@ SvXMLImportContext *XMLTextImportHelper::CreateTextChildContext(
break;
case XML_TOK_TEXT_USERFIELD_DECLS:
- if( (XML_TEXT_TYPE_BODY == eType && bBodyContentStarted)||
+ if ((XML_TEXT_TYPE_BODY == eType && m_pImpl->m_bBodyContentStarted)||
XML_TEXT_TYPE_HEADER_FOOTER == eType )
{
pContext = new XMLVariableDeclsImportContext(
@@ -1965,7 +2422,7 @@ SvXMLImportContext *XMLTextImportHelper::CreateTextChildContext(
break;
case XML_TOK_TEXT_DDE_DECLS:
- if( (XML_TEXT_TYPE_BODY == eType && bBodyContentStarted) ||
+ if ((XML_TEXT_TYPE_BODY == eType && m_pImpl->m_bBodyContentStarted) ||
XML_TEXT_TYPE_HEADER_FOOTER == eType )
{
pContext = new XMLDdeFieldDeclsImportContext(
@@ -1975,7 +2432,7 @@ SvXMLImportContext *XMLTextImportHelper::CreateTextChildContext(
break;
case XML_TOK_TEXT_FRAME_PAGE:
- if( (XML_TEXT_TYPE_BODY == eType && bBodyContentStarted) ||
+ if ((XML_TEXT_TYPE_BODY == eType && m_pImpl->m_bBodyContentStarted) ||
XML_TEXT_TYPE_TEXTBOX == eType ||
XML_TEXT_TYPE_CHANGED_REGION == eType )
{
@@ -1990,7 +2447,7 @@ SvXMLImportContext *XMLTextImportHelper::CreateTextChildContext(
break;
case XML_TOK_DRAW_A_PAGE:
- if( (XML_TEXT_TYPE_BODY == eType && bBodyContentStarted) ||
+ if ((XML_TEXT_TYPE_BODY == eType && m_pImpl->m_bBodyContentStarted) ||
XML_TEXT_TYPE_TEXTBOX == eType ||
XML_TEXT_TYPE_CHANGED_REGION == eType)
{
@@ -2080,7 +2537,7 @@ SvXMLImportContext *XMLTextImportHelper::CreateTextChildContext(
break;
default:
- if( (XML_TEXT_TYPE_BODY == eType && bBodyContentStarted) ||
+ if ((XML_TEXT_TYPE_BODY == eType && m_pImpl->m_bBodyContentStarted) ||
XML_TEXT_TYPE_TEXTBOX == eType ||
XML_TEXT_TYPE_CHANGED_REGION == eType )
{
@@ -2103,7 +2560,9 @@ SvXMLImportContext *XMLTextImportHelper::CreateTextChildContext(
}
if( XML_TEXT_TYPE_BODY == eType && bContent )
- bBodyContentStarted = sal_False;
+ {
+ m_pImpl->m_bBodyContentStarted = sal_False;
+ }
return pContext;
}
@@ -2120,7 +2579,8 @@ SvXMLImportContext *XMLTextImportHelper::CreateTableChildContext(
sal_Int32 XMLTextImportHelper::GetDataStyleKey(const OUString& sStyleName,
sal_Bool* pIsSystemLanguage )
{
- const SvXMLStyleContext* pStyle = ((SvXMLStylesContext *)&xAutoStyles)->
+ const SvXMLStyleContext* pStyle =
+ ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( XML_STYLE_FAMILY_DATA_STYLE,
sStyleName, sal_True );
@@ -2153,9 +2613,10 @@ sal_Int32 XMLTextImportHelper::GetDataStyleKey(const OUString& sStyleName,
const SvxXMLListStyleContext *XMLTextImportHelper::FindAutoListStyle( const OUString& rName ) const
{
const SvxXMLListStyleContext *pStyle = 0;
- if( xAutoStyles.Is() )
+ if (m_pImpl->m_xAutoStyles.Is())
{
- const SvXMLStyleContext* pTempStyle = ((SvXMLStylesContext *)&xAutoStyles)->
+ const SvXMLStyleContext* pTempStyle =
+ ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( XML_STYLE_FAMILY_TEXT_LIST, rName,
sal_True );
pStyle = PTR_CAST( SvxXMLListStyleContext ,pTempStyle);
@@ -2167,9 +2628,10 @@ const SvxXMLListStyleContext *XMLTextImportHelper::FindAutoListStyle( const OUSt
XMLPropStyleContext *XMLTextImportHelper::FindAutoFrameStyle( const OUString& rName ) const
{
XMLPropStyleContext *pStyle = 0;
- if( xAutoStyles.Is() )
+ if (m_pImpl->m_xAutoStyles.Is())
{
- const SvXMLStyleContext* pTempStyle = ((SvXMLStylesContext *)&xAutoStyles)->
+ const SvXMLStyleContext* pTempStyle =
+ ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( XML_STYLE_FAMILY_SD_GRAPHICS_ID, rName,
sal_True );
pStyle = PTR_CAST( XMLPropStyleContext ,pTempStyle);
@@ -2182,9 +2644,10 @@ XMLPropStyleContext* XMLTextImportHelper::FindSectionStyle(
const OUString& rName ) const
{
XMLPropStyleContext* pStyle = NULL;
- if (xAutoStyles.Is() )
+ if (m_pImpl->m_xAutoStyles.Is())
{
- const SvXMLStyleContext* pTempStyle = ((SvXMLStylesContext *)&xAutoStyles)->
+ const SvXMLStyleContext* pTempStyle =
+ ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
FindStyleChildContext(
XML_STYLE_FAMILY_TEXT_SECTION,
rName, sal_True );
@@ -2198,9 +2661,10 @@ XMLPropStyleContext* XMLTextImportHelper::FindPageMaster(
const OUString& rName ) const
{
XMLPropStyleContext* pStyle = NULL;
- if (xAutoStyles.Is() )
+ if (m_pImpl->m_xAutoStyles.Is())
{
- const SvXMLStyleContext* pTempStyle = ((SvXMLStylesContext *)&xAutoStyles)->
+ const SvXMLStyleContext* pTempStyle =
+ ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
FindStyleChildContext(
XML_STYLE_FAMILY_PAGE_MASTER,
rName, sal_True );
@@ -2224,63 +2688,75 @@ void XMLTextImportHelper::PopListContext()
const SvXMLTokenMap& XMLTextImportHelper::GetTextNumberedParagraphAttrTokenMap()
{
- if( !pTextNumberedParagraphAttrTokenMap.get() )
- pTextNumberedParagraphAttrTokenMap.reset(
+ if (!m_pImpl->m_pTextNumberedParagraphAttrTokenMap.get())
+ {
+ m_pImpl->m_pTextNumberedParagraphAttrTokenMap.reset(
new SvXMLTokenMap( aTextNumberedParagraphAttrTokenMap ) );
-
- return *pTextNumberedParagraphAttrTokenMap;
+ }
+ return *m_pImpl->m_pTextNumberedParagraphAttrTokenMap;
}
const SvXMLTokenMap& XMLTextImportHelper::GetTextListBlockAttrTokenMap()
{
- if( !pTextListBlockAttrTokenMap.get() )
- pTextListBlockAttrTokenMap.reset(
+ if (!m_pImpl->m_pTextListBlockAttrTokenMap.get())
+ {
+ m_pImpl->m_pTextListBlockAttrTokenMap.reset(
new SvXMLTokenMap( aTextListBlockAttrTokenMap ) );
-
- return *pTextListBlockAttrTokenMap;
+ }
+ return *m_pImpl->m_pTextListBlockAttrTokenMap;
}
const SvXMLTokenMap& XMLTextImportHelper::GetTextListBlockElemTokenMap()
{
- if( !pTextListBlockElemTokenMap.get() )
- pTextListBlockElemTokenMap.reset(
+ if (!m_pImpl->m_pTextListBlockElemTokenMap.get())
+ {
+ m_pImpl->m_pTextListBlockElemTokenMap.reset(
new SvXMLTokenMap( aTextListBlockElemTokenMap ) );
-
- return *pTextListBlockElemTokenMap;
+ }
+ return *m_pImpl->m_pTextListBlockElemTokenMap;
}
SvI18NMap& XMLTextImportHelper::GetRenameMap()
{
- if( !pRenameMap.get() )
- pRenameMap.reset( new SvI18NMap() );
- return *pRenameMap;
+ if (!m_pImpl->m_pRenameMap.get())
+ {
+ m_pImpl->m_pRenameMap.reset( new SvI18NMap() );
+ }
+ return *m_pImpl->m_pRenameMap;
}
void XMLTextImportHelper::InsertBookmarkStartRange(
const OUString sName,
const Reference<XTextRange> & rRange,
- const OUString& i_rXmlId)
+ OUString const& i_rXmlId,
+ ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > & i_rpRDFaAttributes)
{
- aBookmarkStartRanges[sName] = std::make_pair(rRange, i_rXmlId);
- aBookmarkVector.push_back(sName);
+ m_pImpl->m_BookmarkStartRanges[sName] =
+ ::boost::make_tuple(rRange, i_rXmlId, i_rpRDFaAttributes);
+ m_pImpl->m_BookmarkVector.push_back(sName);
}
sal_Bool XMLTextImportHelper::FindAndRemoveBookmarkStartRange(
const OUString sName,
Reference<XTextRange> & o_rRange,
- OUString& o_rXmlId)
+ OUString & o_rXmlId,
+ ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > & o_rpRDFaAttributes)
{
- if (aBookmarkStartRanges.count(sName))
+ if (m_pImpl->m_BookmarkStartRanges.count(sName))
{
- o_rRange.set(aBookmarkStartRanges[sName].first);
- o_rXmlId = aBookmarkStartRanges[sName].second;
- aBookmarkStartRanges.erase(sName);
- BookmarkVector_t::iterator it=aBookmarkVector.begin();
- while(it!=aBookmarkVector.end() && it->compareTo(sName)!=0) {
+ Impl::BookmarkMapEntry_t & rEntry =
+ (*m_pImpl->m_BookmarkStartRanges.find(sName)).second;
+ o_rRange.set(rEntry.get<0>());
+ o_rXmlId = rEntry.get<1>();
+ o_rpRDFaAttributes = rEntry.get<2>();
+ m_pImpl->m_BookmarkStartRanges.erase(sName);
+ Impl::BookmarkVector_t::iterator it(m_pImpl->m_BookmarkVector.begin());
+ while (it != m_pImpl->m_BookmarkVector.end() && it->compareTo(sName)!=0)
+ {
it++;
}
- if (it!=aBookmarkVector.end()) {
- aBookmarkVector.erase(it);
+ if (it!=m_pImpl->m_BookmarkVector.end()) {
+ m_pImpl->m_BookmarkVector.erase(it);
}
return sal_True;
}
@@ -2292,62 +2768,68 @@ sal_Bool XMLTextImportHelper::FindAndRemoveBookmarkStartRange(
::rtl::OUString XMLTextImportHelper::FindActiveBookmarkName()
{
- if ( !aBookmarkVector.empty() ) {
- return aBookmarkVector.back();
+ if (!m_pImpl->m_BookmarkVector.empty()) {
+ return m_pImpl->m_BookmarkVector.back();
} else return ::rtl::OUString(); // return the empty string on error...
}
::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > XMLTextImportHelper::GetRangeFor(::rtl::OUString &sName)
{
- return aBookmarkStartRanges[sName].first;
+ return m_pImpl->m_BookmarkStartRanges[sName].get<0>();
}
void XMLTextImportHelper::pushFieldCtx( ::rtl::OUString name, ::rtl::OUString type )
{
- aFieldStack.push(field_stack_item_t(field_name_type_t(name, type), field_params_t()));
+ m_pImpl->m_FieldStack.push(Impl::field_stack_item_t(
+ Impl::field_name_type_t(name, type), Impl::field_params_t()));
}
void XMLTextImportHelper::popFieldCtx()
{
- aFieldStack.pop();
+ m_pImpl->m_FieldStack.pop();
}
void XMLTextImportHelper::addFieldParam( ::rtl::OUString name, ::rtl::OUString value )
{
- DBG_ASSERT(!aFieldStack.empty(), "stack is empty: not good! Do a pushFieldCtx before...");
- if (!aFieldStack.empty()) {
- field_stack_item_t &aFieldStackItem=aFieldStack.top();
- aFieldStackItem.second.push_back(field_param_t( name, value ));
+ DBG_ASSERT(!m_pImpl->m_FieldStack.empty(),
+ "stack is empty: not good! Do a pushFieldCtx before...");
+ if (!m_pImpl->m_FieldStack.empty()) {
+ Impl::field_stack_item_t & FieldStackItem(m_pImpl->m_FieldStack.top());
+ FieldStackItem.second.push_back(Impl::field_param_t( name, value ));
}
}
::rtl::OUString XMLTextImportHelper::getCurrentFieldName()
{
- DBG_ASSERT(!aFieldStack.empty(), "stack is empty: not good! Do a pushFieldCtx before...");
- if (!aFieldStack.empty()) {
- return aFieldStack.top().first.first;
+ DBG_ASSERT(!m_pImpl->m_FieldStack.empty(),
+ "stack is empty: not good! Do a pushFieldCtx before...");
+ if (!m_pImpl->m_FieldStack.empty()) {
+ return m_pImpl->m_FieldStack.top().first.first;
} else return ::rtl::OUString();
}
::rtl::OUString XMLTextImportHelper::getCurrentFieldType()
{
- DBG_ASSERT(!aFieldStack.empty(), "stack is empty: not good! Do a pushFieldCtx before...");
- if (!aFieldStack.empty()) {
- return aFieldStack.top().first.second;
+ DBG_ASSERT(!m_pImpl->m_FieldStack.empty(),
+ "stack is empty: not good! Do a pushFieldCtx before...");
+ if (!m_pImpl->m_FieldStack.empty()) {
+ return m_pImpl->m_FieldStack.top().first.second;
} else return ::rtl::OUString();
}
bool XMLTextImportHelper::hasCurrentFieldCtx()
{
- return !aFieldStack.empty();
+ return !m_pImpl->m_FieldStack.empty();
}
void XMLTextImportHelper::setCurrentFieldParamsTo(::com::sun::star::uno::Reference< ::com::sun::star::text::XFormField> &xFormField)
{
- DBG_ASSERT(!aFieldStack.empty(), "stack is empty: not good! Do a pushFieldCtx before...");
- if (!aFieldStack.empty() && xFormField.is())
+ DBG_ASSERT(!m_pImpl->m_FieldStack.empty(),
+ "stack is empty: not good! Do a pushFieldCtx before...");
+ if (!m_pImpl->m_FieldStack.empty() && xFormField.is())
{
- FieldParamImporter(&aFieldStack.top().second, xFormField->getParameters()).Import();
+ FieldParamImporter(&m_pImpl->m_FieldStack.top().second,
+ xFormField->getParameters()).Import();
}
}
@@ -2357,6 +2839,11 @@ void XMLTextImportHelper::ConnectFrameChains(
const OUString& rNextFrmName,
const Reference < XPropertySet >& rFrmPropSet )
{
+ static ::rtl::OUString s_ChainNextName(
+ RTL_CONSTASCII_USTRINGPARAM("ChainNextName"));
+ static ::rtl::OUString s_ChainPrevName(
+ RTL_CONSTASCII_USTRINGPARAM("ChainPrevName"));
+
if( !rFrmName.getLength() )
return;
@@ -2364,39 +2851,42 @@ void XMLTextImportHelper::ConnectFrameChains(
{
OUString sNextFrmName(GetRenameMap().Get( XML_TEXT_RENAME_TYPE_FRAME,
rNextFrmName ));
- if( xTextFrames.is() && xTextFrames->hasByName( sNextFrmName ) )
+ if (m_pImpl->m_xTextFrames.is()
+ && m_pImpl->m_xTextFrames->hasByName(sNextFrmName))
{
- rFrmPropSet->setPropertyValue( sChainNextName, makeAny(sNextFrmName) );
+ rFrmPropSet->setPropertyValue(s_ChainNextName,
+ makeAny(sNextFrmName));
}
else
{
- if( !pPrevFrmNames.get() )
+ if (!m_pImpl->m_pPrevFrmNames.get())
{
- pPrevFrmNames.reset( new SvStringsDtor );
- pNextFrmNames.reset( new SvStringsDtor );
+ m_pImpl->m_pPrevFrmNames.reset( new SvStringsDtor );
+ m_pImpl->m_pNextFrmNames.reset( new SvStringsDtor );
}
- pPrevFrmNames->Insert( new String( rFrmName ),
- pPrevFrmNames->Count() );
- pNextFrmNames->Insert( new String( sNextFrmName ),
- pNextFrmNames->Count() );
+ m_pImpl->m_pPrevFrmNames->Insert( new String( rFrmName ),
+ m_pImpl->m_pPrevFrmNames->Count() );
+ m_pImpl->m_pNextFrmNames->Insert( new String( sNextFrmName ),
+ m_pImpl->m_pNextFrmNames->Count() );
}
}
- if( pPrevFrmNames.get() && pPrevFrmNames->Count() )
+ if (m_pImpl->m_pPrevFrmNames.get() && m_pImpl->m_pPrevFrmNames->Count())
{
- sal_uInt16 nCount = pPrevFrmNames->Count();
+ sal_uInt16 nCount = m_pImpl->m_pPrevFrmNames->Count();
for( sal_uInt16 i=0; i<nCount; i++ )
{
- String *pNext = (*pNextFrmNames)[i];
+ String *pNext = (*m_pImpl->m_pNextFrmNames)[i];
if( OUString(*pNext) == rFrmName )
{
// The previuous frame must exist, because it existing than
// inserting the entry
- String *pPrev = (*pPrevFrmNames)[i];
+ String *pPrev = (*m_pImpl->m_pPrevFrmNames)[i];
- rFrmPropSet->setPropertyValue( sChainPrevName, makeAny(OUString( *pPrev )) );
+ rFrmPropSet->setPropertyValue(s_ChainPrevName,
+ makeAny(OUString( *pPrev )));
- pPrevFrmNames->Remove( i, 1 );
- pNextFrmNames->Remove( i, 1 );
+ m_pImpl->m_pPrevFrmNames->Remove( i, 1 );
+ m_pImpl->m_pNextFrmNames->Remove( i, 1 );
delete pPrev;
delete pNext;
@@ -2409,6 +2899,9 @@ void XMLTextImportHelper::ConnectFrameChains(
sal_Bool XMLTextImportHelper::IsInFrame() const
{
+ static ::rtl::OUString s_TextFrame(
+ RTL_CONSTASCII_USTRINGPARAM("TextFrame"));
+
sal_Bool bIsInFrame = sal_False;
// are we currently in a text frame? yes, if the cursor has a
@@ -2416,9 +2909,10 @@ sal_Bool XMLTextImportHelper::IsInFrame() const
Reference<XPropertySet> xPropSet(((XMLTextImportHelper *)this)->GetCursor(), UNO_QUERY);
if (xPropSet.is())
{
- if (xPropSet->getPropertySetInfo()->hasPropertyByName(sTextFrame))
+ if (xPropSet->getPropertySetInfo()->hasPropertyByName(s_TextFrame))
{
- Reference<XTextFrame> xFrame(xPropSet->getPropertyValue(sTextFrame), UNO_QUERY);
+ uno::Reference<XTextFrame> const xFrame(
+ xPropSet->getPropertyValue(s_TextFrame), UNO_QUERY);
if (xFrame.is())
{
@@ -2541,12 +3035,12 @@ void XMLTextImportHelper::SetChangesProtectionKey(const Sequence<sal_Int8> &)
OUString XMLTextImportHelper::GetOpenRedlineId()
{
- return sOpenRedlineIdentifier;
+ return m_pImpl->m_sOpenRedlineIdentifier;
}
void XMLTextImportHelper::SetOpenRedlineId( ::rtl::OUString& rId)
{
- sOpenRedlineIdentifier = rId;
+ m_pImpl->m_sOpenRedlineIdentifier = rId;
}
void XMLTextImportHelper::ResetOpenRedlineId()
@@ -2555,3 +3049,14 @@ void XMLTextImportHelper::ResetOpenRedlineId()
SetOpenRedlineId(sEmpty);
}
+void
+XMLTextImportHelper::SetCellParaStyleDefault(::rtl::OUString const& rNewValue)
+{
+ m_pImpl->m_sCellParaStyleDefault = rNewValue;
+}
+
+::rtl::OUString const& XMLTextImportHelper::GetCellParaStyleDefault()
+{
+ return m_pImpl->m_sCellParaStyleDefault;
+}
+
diff --git a/xmloff/source/text/txtlists.cxx b/xmloff/source/text/txtlists.cxx
index 24c09bde6e7f..ab90e2ae4000 100644
--- a/xmloff/source/text/txtlists.cxx
+++ b/xmloff/source/text/txtlists.cxx
@@ -453,6 +453,8 @@ XMLTextListsHelper::MakeNumRule(
sal_Bool* o_pRestartNumbering,
sal_Bool* io_pSetDefaults)
{
+ static ::rtl::OUString s_NumberingRules(
+ RTL_CONSTASCII_USTRINGPARAM("NumberingRules"));
uno::Reference<container::XIndexReplace> xNumRules(i_rNumRule);
if ( i_StyleName.getLength() &&
i_StyleName != i_ParentStyleName )
@@ -479,8 +481,7 @@ XMLTextListsHelper::MakeNumRule(
uno::Reference< beans::XPropertySet > xPropSet( xStyle,
uno::UNO_QUERY );
- any = xPropSet->getPropertyValue(
- i_rImport.GetTextImport()->sNumberingRules );
+ any = xPropSet->getPropertyValue(s_NumberingRules);
any >>= xNumRules;
}
else
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 00a4ba60db0d..a1418cb3524f 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -90,7 +90,6 @@
#include <com/sun/star/text/XEndnotesSupplier.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/util/DateTime.hpp>
-#include "xmloff/xmlkywd.hxx"
#include "xmloff/xmlnmspe.hxx"
#include <xmloff/xmlaustp.hxx>
#include <xmloff/families.hxx>
@@ -1999,7 +1998,18 @@ void XMLTextParagraphExport::exportParagraph(
{
const OUString& rIdentifier = GetExport().getInterfaceToIdentifierMapper().getIdentifier( xRef );
if( rIdentifier.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_ID, rIdentifier );
+ {
+ // FIXME: this is just temporary until EditEngine
+ // paragraphs implement XMetadatable.
+ // then that must be used and not the mapper, because
+ // when both can be used we get two xml:id!
+ uno::Reference<rdf::XMetadatable> const xMeta(xRef,
+ uno::UNO_QUERY);
+ OSL_ENSURE(!xMeta.is(), "paragraph that implements "
+ "XMetadatable used in interfaceToIdentifierMapper?");
+ GetExport().AddAttributeIdLegacy(XML_NAMESPACE_TEXT,
+ rIdentifier);
+ }
}
OUString sAutoStyle( sStyle );
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx
index 525184694fed..697d3e6cd069 100644
--- a/xmloff/source/text/txtparai.cxx
+++ b/xmloff/source/text/txtparai.cxx
@@ -1917,6 +1917,7 @@ XMLParaContext::XMLParaContext(
const SvXMLTokenMap& rTokenMap =
GetImport().GetTextImport()->GetTextPAttrTokenMap();
+ bool bHaveXmlId( false );
OUString aCondStyleName, sClassNames;
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
@@ -1933,6 +1934,7 @@ XMLParaContext::XMLParaContext(
{
case XML_TOK_TEXT_P_XMLID:
m_sXmlId = rValue;
+ bHaveXmlId = true;
break;
case XML_TOK_TEXT_P_ABOUT:
m_sAbout = rValue;
@@ -1947,6 +1949,9 @@ XMLParaContext::XMLParaContext(
case XML_TOK_TEXT_P_DATATYPE:
m_sDatatype = rValue;
break;
+ case XML_TOK_TEXT_P_TEXTID:
+ if (!bHaveXmlId) { m_sXmlId = rValue; }
+ break;
case XML_TOK_TEXT_P_STYLE_NAME:
sStyleName = rValue;
break;
@@ -1979,9 +1984,6 @@ XMLParaContext::XMLParaContext(
}
}
break;
- case XML_TOK_TEXT_P_ID:
- sId = rValue;
- break;
case XML_TOK_TEXT_P_RESTART_NUMBERING:
{
sal_Bool bBool;
@@ -2020,14 +2022,17 @@ XMLParaContext::~XMLParaContext()
// if we have an id set for this paragraph, get a cursor for this
// paragraph and register it with the given identifier
- if( sId.getLength() )
+ // FIXME: this is just temporary, and should be removed when
+ // EditEngine paragraphs implement XMetadatable!
+ if (m_sXmlId.getLength())
{
Reference < XTextCursor > xIdCursor( xTxtImport->GetText()->createTextCursorByRange( xStart ) );
if( xIdCursor.is() )
{
xIdCursor->gotoRange( xEnd, sal_True );
Reference< XInterface > xRef( xIdCursor, UNO_QUERY );
- GetImport().getInterfaceToIdentifierMapper().registerReference( sId, xRef );
+ GetImport().getInterfaceToIdentifierMapper().registerReference(
+ m_sXmlId, xRef);
}
}
@@ -2067,7 +2072,7 @@ XMLParaContext::~XMLParaContext()
}
}
- OUString sCellParaStyleName = xTxtImport->sCellParaStyleDefault;
+ OUString const sCellParaStyleName(xTxtImport->GetCellParaStyleDefault());
if( sCellParaStyleName.getLength() > 0 )
{
// --> OD 2007-08-16 #i80724#
diff --git a/xmloff/source/text/txtparai.hxx b/xmloff/source/text/txtparai.hxx
index 9c911a5b639c..ecd593ca3d4f 100644
--- a/xmloff/source/text/txtparai.hxx
+++ b/xmloff/source/text/txtparai.hxx
@@ -46,7 +46,6 @@ class XMLParaContext : public SvXMLImportContext
::com::sun::star::uno::Reference <
::com::sun::star::text::XTextRange > xStart; // xub_StrLen nStart;
::rtl::OUString sStyleName;
- ::rtl::OUString sId;
::rtl::OUString m_sXmlId;
::rtl::OUString m_sAbout;
::rtl::OUString m_sProperty;
diff --git a/xmloff/source/transform/makefile.mk b/xmloff/source/transform/makefile.mk
index 473cec556212..bba8deb6db2b 100644
--- a/xmloff/source/transform/makefile.mk
+++ b/xmloff/source/transform/makefile.mk
@@ -86,7 +86,7 @@ SHL1STDLIBS = \
.ELSE
SHL1STDLIBS += ixo.lib
.ENDIF
-SHL1VERSIONMAP = xof.map
+SHL1VERSIONMAP = $(SOLARENV)/src/component.map
SHL1IMPLIB = i$(SHL1TARGET)
DEF1NAME = $(SHL1TARGET)
diff --git a/xmloff/source/transform/xof.map b/xmloff/source/transform/xof.map
deleted file mode 100644
index f4ed78b9e970..000000000000
--- a/xmloff/source/transform/xof.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_0_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/xmloff/util/makefile.mk b/xmloff/util/makefile.mk
index 04c561cd4696..b8745b6b8fff 100644
--- a/xmloff/util/makefile.mk
+++ b/xmloff/util/makefile.mk
@@ -53,17 +53,8 @@ LIB1FILES= \
# --- Shared-Library -----------------------------------------------
-.IF "$(GUI)"!="UNX"
-LIB4TARGET= $(LB)$/ixo.lib
-LIB4FILES= $(LB)$/_ixo.lib
-.IF "$(GUI)"!="OS2"
-LIB4OBJFILES=\
- $(OBJ)$/xmlkywd.obj
-.ENDIF
-.ENDIF
-
SHL1TARGET= xo$(DLLPOSTFIX)
-SHL1IMPLIB= _ixo
+SHL1IMPLIB= i$(TARGET)
SHL1USE_EXPORTS=name
SHL1STDLIBS= \
diff --git a/xmlscript/inc/xmlscript/xmlmod_imexp.hxx b/xmlscript/inc/xmlscript/xmlmod_imexp.hxx
index c7c1d6d1acdc..a2873542d10c 100644
--- a/xmlscript/inc/xmlscript/xmlmod_imexp.hxx
+++ b/xmlscript/inc/xmlscript/xmlmod_imexp.hxx
@@ -45,6 +45,7 @@ struct ModuleDescriptor
::rtl::OUString aName;
::rtl::OUString aLanguage;
::rtl::OUString aCode;
+ ::rtl::OUString aModuleType; // VBA
};
void
diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx b/xmlscript/source/xmldlg_imexp/exp_share.hxx
index d32d46698003..a53d02393ae6 100644
--- a/xmlscript/source/xmldlg_imexp/exp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/exp_share.hxx
@@ -117,7 +117,7 @@ public:
inline bool readProp( T * ret, ::rtl::OUString const & rPropName );
css::uno::Any readProp( ::rtl::OUString const & rPropName );
//
- void readDefaults( bool supportPrintable = true );
+ void readDefaults( bool supportPrintable = true, bool supportVisible = true );
//
void readStringAttr(
::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName );
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
index 55b46edc1392..1d9e67d23d28 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
@@ -653,6 +653,8 @@ void ElementDescriptor::readTreeControlModel( StyleBag * all_styles )
// collect elements
readDefaults();
+ readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
readSelectionTypeAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SelectionType") ),
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":selectiontype") ) );
@@ -1138,7 +1140,7 @@ void ElementDescriptor::readDialogModel( StyleBag * all_styles )
}
// collect elements
- readDefaults( false );
+ readDefaults( false, false );
readBoolAttr(
OUString( RTL_CONSTASCII_USTRINGPARAM("Closeable") ),
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":closeable") ) );
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index 088d6e841c94..365355375808 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -972,7 +972,7 @@ void ElementDescriptor::readSelectionTypeAttr( OUString const & rPropName, OUStr
}
}
//__________________________________________________________________________________________________
-void ElementDescriptor::readDefaults( bool supportPrintable )
+void ElementDescriptor::readDefaults( bool supportPrintable, bool supportVisible )
{
Any a( _xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ) ) );
addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":id") ),
@@ -995,7 +995,7 @@ void ElementDescriptor::readDefaults( bool supportPrintable )
}
sal_Bool bVisible = sal_True;
- try
+ if (supportVisible) try
{
if (_xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("EnableVisible") ) ) >>= bVisible)
{
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index e3bce073b0b1..a0968eb007d5 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -930,6 +930,9 @@ void TreeControlElement::endElement()
}
ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
+ ctx.importBooleanProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("tabstop") ),
+ _xAttributes );
ctx.importSelectionTypeProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("SelectionType") ),
OUString( RTL_CONSTASCII_USTRINGPARAM("selectiontype") ),
_xAttributes );
diff --git a/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx b/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx
index ba23ad031f91..781d2d779dda 100644
--- a/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx
+++ b/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx
@@ -65,6 +65,9 @@ SAL_CALL exportScriptModule(
rMod.aName );
pModElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_PREFIX ":language") ),
rMod.aLanguage );
+ if( rMod.aModuleType.getLength()>0 )
+ pModElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_PREFIX ":moduleType") ),
+ rMod.aModuleType );
xOut->ignorableWhitespace( OUString() );
xOut->startElement( aModuleName, xAttributes );
diff --git a/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx b/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx
index b995817c1eb9..7f38f915aa62 100644
--- a/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx
+++ b/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx
@@ -188,11 +188,14 @@ Reference< xml::input::XElement > ModuleImport::startRootElement(
else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("module") ))
{
mrModuleDesc.aName = xAttributes->getValueByUidName(
- XMLNS_LIBRARY_UID,
+ XMLNS_SCRIPT_UID,
OUString( RTL_CONSTASCII_USTRINGPARAM("name") ) );
mrModuleDesc.aLanguage = xAttributes->getValueByUidName(
- XMLNS_XLINK_UID,
+ XMLNS_SCRIPT_UID,
OUString( RTL_CONSTASCII_USTRINGPARAM("language") ) );
+ mrModuleDesc.aModuleType = xAttributes->getValueByUidName(
+ XMLNS_SCRIPT_UID,
+ OUString( RTL_CONSTASCII_USTRINGPARAM("moduleType") ) );
return new ModuleElement( rLocalName, xAttributes, 0, this );
}