summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--avmedia/source/quicktime/makefile.mk2
-rw-r--r--basic/inc/basic/sbstar.hxx1
-rw-r--r--basic/prj/build.lst2
-rw-r--r--basic/source/classes/sb.cxx33
-rw-r--r--basic/source/classes/sb.src2
-rw-r--r--basic/source/classes/sbunoobj.cxx321
-rw-r--r--basic/source/classes/sbxmod.cxx1
-rw-r--r--basic/source/comp/dim.cxx63
-rw-r--r--basic/source/comp/exprtree.cxx6
-rw-r--r--basic/source/comp/scanner.cxx12
-rw-r--r--basic/source/inc/expr.hxx1
-rw-r--r--basic/source/inc/parser.hxx1
-rw-r--r--basic/source/inc/runtime.hxx37
-rw-r--r--basic/source/inc/sbunoobj.hxx53
-rw-r--r--basic/source/runtime/methods1.cxx7
-rw-r--r--basic/source/runtime/runtime.cxx42
-rw-r--r--basic/source/runtime/step2.cxx10
-rw-r--r--basic/source/sbx/sbxvalue.cxx18
-rw-r--r--configmgr/source/backendhelper/makefile.mk2
-rw-r--r--configmgr/source/inc/bootstrap.hxx1
-rw-r--r--configmgr/source/misc/bootstrap.cxx23
-rw-r--r--configmgr/source/platformbe/makefile.mk2
-rw-r--r--configmgr/source/tree/localizedtreeactions.cxx5
-rw-r--r--configmgr/util/makefile.mk2
-rwxr-xr-xconnectivity/inc/connectivity/DriversConfig.hxx4
-rw-r--r--connectivity/inc/connectivity/TTableHelper.hxx45
-rw-r--r--connectivity/inc/connectivity/sdbcx/VKey.hxx1
-rw-r--r--connectivity/inc/connectivity/sdbcx/VView.hxx17
-rw-r--r--connectivity/inc/connectivity/sqlnode.hxx3
-rw-r--r--connectivity/prj/build.lst2
-rwxr-xr-xconnectivity/qa/connectivity/tools/AbstractDatabase.java230
-rw-r--r--connectivity/qa/connectivity/tools/DataSource.java79
-rwxr-xr-xconnectivity/qa/connectivity/tools/DatabaseAccess.java66
-rwxr-xr-xconnectivity/qa/connectivity/tools/DbaseDatabase.java100
-rw-r--r--connectivity/qa/connectivity/tools/HsqlDatabase.java338
-rw-r--r--connectivity/qa/drivers/dbase/DBaseDateFunctions.java369
-rw-r--r--connectivity/qa/drivers/dbase/DBaseDriverTest.java65
-rw-r--r--connectivity/qa/drivers/dbase/DBaseNumericFunctions.java436
-rwxr-xr-xconnectivity/qa/drivers/dbase/DBaseSqlTests.java99
-rw-r--r--connectivity/qa/drivers/dbase/DBaseStringFunctions.java370
-rw-r--r--connectivity/qa/drivers/dbase/makefile.mk9
-rw-r--r--connectivity/source/commontools/ConnectionWrapper.cxx2
-rw-r--r--connectivity/source/commontools/DateConversion.cxx57
-rwxr-xr-xconnectivity/source/commontools/DriversConfig.cxx23
-rw-r--r--connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx2
-rw-r--r--connectivity/source/commontools/RowFunctionParser.cxx2
-rw-r--r--connectivity/source/commontools/TColumnsHelper.cxx73
-rw-r--r--connectivity/source/commontools/TDatabaseMetaDataBase.cxx4
-rw-r--r--connectivity/source/commontools/TIndexColumns.cxx2
-rw-r--r--connectivity/source/commontools/TIndexes.cxx4
-rw-r--r--connectivity/source/commontools/TKey.cxx53
-rw-r--r--connectivity/source/commontools/TPrivilegesResultSet.cxx4
-rw-r--r--connectivity/source/commontools/TTableHelper.cxx213
-rw-r--r--connectivity/source/commontools/dbconversion.cxx4
-rw-r--r--connectivity/source/commontools/dbmetadata.cxx38
-rw-r--r--connectivity/source/commontools/dbtools.cxx6
-rw-r--r--connectivity/source/commontools/dbtools2.cxx49
-rw-r--r--connectivity/source/commontools/makefile.mk2
-rw-r--r--connectivity/source/commontools/parameters.cxx2
-rw-r--r--connectivity/source/commontools/sqlerror.cxx2
-rw-r--r--connectivity/source/cpool/ZConnectionPool.cxx6
-rw-r--r--connectivity/source/cpool/ZPoolCollection.cxx4
-rw-r--r--connectivity/source/cpool/ZPooledConnection.cxx4
-rw-r--r--connectivity/source/drivers/adabas/BConnection.cxx5
-rw-r--r--connectivity/source/drivers/adabas/BDriver.cxx2
-rw-r--r--connectivity/source/drivers/adabas/BPreparedStatement.cxx4
-rw-r--r--connectivity/source/drivers/adabas/BTables.cxx2
-rw-r--r--connectivity/source/drivers/adabas/BViews.cxx2
-rw-r--r--connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx2
-rw-r--r--connectivity/source/drivers/ado/ADriver.cxx11
-rw-r--r--connectivity/source/drivers/ado/APreparedStatement.cxx8
-rw-r--r--connectivity/source/drivers/ado/AResultSet.cxx4
-rw-r--r--connectivity/source/drivers/ado/Aservices.cxx4
-rwxr-xr-xconnectivity/source/drivers/ado/ado.xcu10
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx2
-rw-r--r--connectivity/source/drivers/evoab2/NDriver.cxx2
-rw-r--r--connectivity/source/drivers/evoab2/NResultSet.cxx2
-rw-r--r--connectivity/source/drivers/evoab2/NStatement.cxx4
-rw-r--r--connectivity/source/drivers/evoab2/NTables.cxx2
-rw-r--r--connectivity/source/drivers/file/FCatalog.cxx2
-rw-r--r--connectivity/source/drivers/file/FConnection.cxx4
-rw-r--r--connectivity/source/drivers/file/FPreparedStatement.cxx4
-rw-r--r--connectivity/source/drivers/file/FResultSet.cxx14
-rw-r--r--connectivity/source/drivers/file/FStatement.cxx1
-rw-r--r--connectivity/source/drivers/file/FTables.cxx2
-rw-r--r--connectivity/source/drivers/file/fcode.cxx25
-rw-r--r--connectivity/source/drivers/file/fcomp.cxx9
-rw-r--r--connectivity/source/drivers/file/quotedstring.cxx4
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx10
-rwxr-xr-xconnectivity/source/drivers/flat/flat.xcu2
-rw-r--r--connectivity/source/drivers/hsqldb/HStorageMap.cxx8
-rw-r--r--connectivity/source/drivers/hsqldb/HTables.cxx2
-rw-r--r--connectivity/source/drivers/hsqldb/HViews.cxx2
-rw-r--r--connectivity/source/drivers/jdbc/JDriver.cxx2
-rw-r--r--connectivity/source/drivers/jdbc/ResultSet.cxx2
-rw-r--r--connectivity/source/drivers/kab/KResultSet.cxx4
-rw-r--r--connectivity/source/drivers/kab/KTables.cxx2
-rwxr-xr-xconnectivity/source/drivers/macab/MacabResultSet.cxx4
-rwxr-xr-xconnectivity/source/drivers/macab/MacabTables.cxx2
-rw-r--r--connectivity/source/drivers/mozab/MPreparedStatement.cxx2
-rw-r--r--connectivity/source/drivers/mozab/MResultSet.cxx6
-rw-r--r--connectivity/source/drivers/mozab/MResultSetMetaData.cxx2
-rw-r--r--connectivity/source/drivers/mozab/MTables.cxx2
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx7
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/makefile.mk5
-rw-r--r--connectivity/source/drivers/mozab/makefile.mk5
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/makefile.mk2
-rw-r--r--connectivity/source/drivers/mysql/YTables.cxx2
-rw-r--r--connectivity/source/drivers/mysql/YViews.cxx2
-rwxr-xr-xconnectivity/source/drivers/mysql/mysql.xcu77
-rw-r--r--connectivity/source/drivers/odbcbase/OConnection.cxx24
-rw-r--r--connectivity/source/drivers/odbcbase/ODatabaseMetaData.cxx176
-rw-r--r--connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx13
-rw-r--r--connectivity/source/drivers/odbcbase/OPreparedStatement.cxx22
-rw-r--r--connectivity/source/drivers/odbcbase/OResultSet.cxx6
-rw-r--r--connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx34
-rw-r--r--connectivity/source/drivers/odbcbase/OStatement.cxx12
-rw-r--r--connectivity/source/drivers/odbcbase/OTools.cxx14
-rw-r--r--connectivity/source/inc/OSubComponent.hxx2
-rw-r--r--connectivity/source/inc/adabas/BPreparedStatement.hxx2
-rw-r--r--connectivity/source/inc/calc/CConnection.hxx2
-rw-r--r--connectivity/source/inc/file/fcode.hxx10
-rw-r--r--connectivity/source/inc/flat/ETable.hxx1
-rw-r--r--connectivity/source/inc/odbc/OConnection.hxx6
-rw-r--r--connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx1
-rw-r--r--connectivity/source/inc/odbc/OPreparedStatement.hxx6
-rw-r--r--connectivity/source/inc/odbc/OResultSetMetaData.hxx1
-rw-r--r--connectivity/source/parse/sqlbison.y36
-rw-r--r--connectivity/source/parse/sqlflex.l2
-rw-r--r--connectivity/source/parse/sqliterator.cxx15
-rw-r--r--connectivity/source/parse/sqlnode.cxx18
-rw-r--r--connectivity/source/resource/conn_shared_res.src2
-rw-r--r--connectivity/source/sdbcx/VCatalog.cxx2
-rw-r--r--connectivity/source/sdbcx/VTable.cxx9
-rw-r--r--connectivity/source/sdbcx/VView.cxx13
-rw-r--r--desktop/inc/app.hxx1
-rw-r--r--desktop/inc/deployment.hrc3
-rw-r--r--desktop/os2/source/applauncher/launcher.cxx4
-rw-r--r--desktop/prj/build.lst6
-rw-r--r--desktop/prj/d.lst9
-rw-r--r--desktop/registry/data/org/openoffice/Office/Jobs.xcu78
-rw-r--r--desktop/registry/data/org/openoffice/Office/makefile.mk (renamed from sj2/stardiv/app/makefile.mk)64
-rw-r--r--desktop/source/app/app.cxx20
-rw-r--r--desktop/source/app/check_ext_deps.cxx256
-rw-r--r--desktop/source/app/checkinstall.cxx86
-rw-r--r--desktop/source/app/dispatchwatcher.cxx7
-rw-r--r--desktop/source/app/langselect.cxx97
-rw-r--r--desktop/source/app/langselect.hxx2
-rw-r--r--desktop/source/app/makefile.mk5
-rw-r--r--desktop/source/deployment/gui/dp_gui.h1
-rw-r--r--desktop/source/deployment/gui/dp_gui.hrc82
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog.src227
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx2050
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.hxx167
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.src64
-rw-r--r--desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx159
-rw-r--r--desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx21
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.cxx1175
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.hxx271
-rw-r--r--desktop/source/deployment/gui/dp_gui_service.cxx26
-rw-r--r--desktop/source/deployment/gui/dp_gui_theextmgr.cxx147
-rw-r--r--desktop/source/deployment/gui/dp_gui_theextmgr.hxx19
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedata.hxx15
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.cxx77
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.hxx15
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.src2
-rw-r--r--desktop/source/deployment/gui/makefile.mk1
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx43
-rw-r--r--desktop/source/deployment/registry/dp_backend.cxx11
-rw-r--r--desktop/source/deployment/registry/help/dp_help.cxx2
-rw-r--r--desktop/source/deployment/registry/help/dp_help.src2
-rw-r--r--desktop/source/deployment/registry/inc/dp_backend.h6
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx22
-rw-r--r--desktop/source/deployment/unopkg/unopkg.src9
-rw-r--r--desktop/source/inc/helpid.hrc6
-rw-r--r--desktop/source/migration/pages.cxx30
-rw-r--r--desktop/source/migration/wizard.hrc6
-rw-r--r--desktop/source/migration/wizard.src20
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_app.cxx23
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_misc.cxx11
-rw-r--r--desktop/source/registration/com/sun/star/registration/Registration.java342
-rw-r--r--desktop/source/registration/com/sun/star/registration/makefile.mk (renamed from sj2/source/jscpp/makefile.mk)32
-rw-r--r--desktop/source/registration/com/sun/star/registration/manifest2
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/BrowserSupport.java205
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/Installer.java947
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/LinuxSystemEnvironment.java194
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/RegistrationData.java473
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/RegistrationDocument.java374
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/Registry.java558
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/ServiceTag.java640
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/SolarisServiceTag.java68
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/SolarisSystemEnvironment.java159
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/SunConnection.java296
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/SysnetRegistryHelper.java380
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/SystemEnvironment.java341
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/UnauthorizedAccessException.java (renamed from xmlhelp/inc/xmlhelp/helplinkerdllapi.h)39
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/Util.java297
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/WindowsSystemEnvironment.java145
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/makefile.mk (renamed from sj2/util/makefile.mk)88
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/resources/product_registration.xsd301
-rw-r--r--desktop/source/splash/makefile.mk1
-rw-r--r--desktop/util/hidother.src4
-rw-r--r--desktop/util/makefile.mk14
-rw-r--r--desktop/win32/source/extendloaderenvironment.cxx9
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx41
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx8
-rw-r--r--drawinglayer/source/primitive2d/graphicprimitive2d.cxx33
-rw-r--r--drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx118
-rw-r--r--drawinglayer/source/primitive2d/textlayoutdevice.cxx210
-rw-r--r--drawinglayer/source/primitive2d/textprimitive2d.cxx188
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx4
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx104
-rw-r--r--drawinglayer/source/processor3d/zbufferprocessor3d.cxx16
-rw-r--r--drawinglayer/util/makefile.mk1
-rw-r--r--embeddedobj/source/commonembedding/embedobj.cxx6
-rw-r--r--embeddedobj/source/commonembedding/miscobj.cxx10
-rw-r--r--embeddedobj/source/commonembedding/persistence.cxx10
-rw-r--r--embeddedobj/source/inc/commonembobj.hxx7
-rw-r--r--eventattacher/source/eventattacher.cxx2
-rw-r--r--eventattacher/source/makefile.mk3
-rw-r--r--fileaccess/source/makefile.mk2
-rw-r--r--formula/source/core/api/token.cxx21
-rw-r--r--formula/source/ui/dlg/formula.cxx1
-rw-r--r--formula/util/makefile.mk10
-rw-r--r--fpicker/prj/build.lst1
-rw-r--r--fpicker/prj/d.lst1
-rw-r--r--fpicker/source/aqua/AquaFilePickerDelegate.hxx2
-rw-r--r--fpicker/source/aqua/AquaFilePickerDelegate.mm18
-rw-r--r--fpicker/source/aqua/ControlHelper.cxx53
-rw-r--r--fpicker/source/aqua/ControlHelper.hxx12
-rw-r--r--fpicker/source/aqua/SalAquaFilePicker.cxx39
-rw-r--r--fpicker/source/aqua/SalAquaPicker.cxx31
-rw-r--r--fpicker/source/aqua/makefile.mk3
-rw-r--r--fpicker/source/generic/fpicker.cxx2
-rw-r--r--fpicker/source/unx/kde4/FPServiceInfo.hxx74
-rw-r--r--fpicker/source/unx/kde4/KDE4FPEntry.cxx136
-rw-r--r--fpicker/source/unx/kde4/KDE4FilePicker.cxx711
-rw-r--r--fpicker/source/unx/kde4/KDE4FilePicker.hxx205
-rw-r--r--fpicker/source/unx/kde4/fps-kde4-ucd.txt6
-rw-r--r--fpicker/source/unx/kde4/fps_kde4.xml51
-rw-r--r--fpicker/source/unx/kde4/makefile.mk117
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx2
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx4
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx7
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx4
-rw-r--r--fpicker/source/win32/folderpicker/workbench/Test_fops.cxx6
-rw-r--r--fpicker/source/win32/folderpicker/workbench/makefile.mk2
-rw-r--r--fpicker/source/win32/misc/makefile.mk3
-rw-r--r--fpicker/util/makefile.pmk35
-rw-r--r--framework/collector/cmduicollector.cxx40
-rw-r--r--framework/collector/uicmdstohtml.cxx4
-rw-r--r--framework/inc/classes/addonmenu.hxx7
-rw-r--r--framework/inc/classes/bmkmenu.hxx4
-rw-r--r--framework/inc/classes/eventsconfiguration.hxx39
-rw-r--r--framework/inc/classes/eventsdocumenthandler.hxx198
-rw-r--r--framework/inc/classes/fwktabwindow.hxx4
-rwxr-xr-x[-rw-r--r--]framework/inc/classes/fwlresid.hxx (renamed from sj2/stardiv/applet/LiveConnectable.java)26
-rw-r--r--framework/inc/classes/imagesconfiguration.hxx115
-rw-r--r--framework/inc/classes/imagesdocumenthandler.hxx215
-rw-r--r--framework/inc/classes/imagewrapper.hxx18
-rw-r--r--framework/inc/classes/menuconfiguration.hxx126
-rw-r--r--framework/inc/classes/menumanager.hxx38
-rw-r--r--framework/inc/classes/statusbarconfiguration.hxx48
-rw-r--r--framework/inc/classes/statusbardocumenthandler.hxx190
-rwxr-xr-xframework/inc/classes/toolboxconfiguration.hxx96
-rw-r--r--framework/inc/classes/toolboxconfigurationdefines.hxx80
-rwxr-xr-xframework/inc/classes/toolboxdocumenthandler.hxx217
-rw-r--r--framework/inc/classes/toolboxlayoutdocumenthandler.hxx198
-rw-r--r--framework/inc/dispatch/menudispatcher.hxx2
-rw-r--r--framework/inc/helper/dockingareadefaultacceptor.hxx15
-rw-r--r--framework/inc/helper/mischelper.hxx15
-rw-r--r--framework/inc/helper/ocomponentaccess.hxx15
-rw-r--r--framework/inc/helper/ocomponentenumeration.hxx16
-rw-r--r--framework/inc/helper/oframes.hxx15
-rw-r--r--framework/inc/helper/opluginframedispatcher.hxx362
-rw-r--r--framework/inc/helper/popupmenucontrollerbase.hxx8
-rw-r--r--framework/inc/helper/uiconfigelementwrapperbase.hxx10
-rw-r--r--framework/inc/interaction/preventduplicateinteraction.hxx4
-rw-r--r--framework/inc/interaction/quietinteraction.hxx (renamed from framework/inc/interaction/stillinteraction.hxx)8
-rw-r--r--framework/inc/jobs/helponstartup.hxx14
-rw-r--r--framework/inc/jobs/shelljob.hxx13
-rw-r--r--framework/inc/macros/debug/memorymeasure.hxx2
-rw-r--r--framework/inc/macros/xserviceinfo.hxx27
-rw-r--r--framework/inc/mediadescriptor.h76
-rw-r--r--framework/inc/services.h18
-rw-r--r--framework/inc/services/desktop.hxx5
-rw-r--r--framework/inc/services/dispatchhelper.hxx12
-rw-r--r--framework/inc/services/frame.hxx7
-rw-r--r--framework/inc/services/frameloaderfactory.hxx12
-rw-r--r--framework/inc/services/layoutmanager.hxx4
-rw-r--r--framework/inc/services/license.hxx2
-rw-r--r--framework/inc/services/mediatypedetectionhelper.hxx10
-rw-r--r--framework/inc/services/menudocumenthandler.hxx317
-rw-r--r--framework/inc/services/popupmenucontrollerfactory.hxx97
-rw-r--r--framework/inc/services/saxnamespacefilter.hxx119
-rw-r--r--framework/inc/services/substitutepathvars.hxx11
-rw-r--r--framework/inc/services/uriabbreviation.hxx10
-rw-r--r--framework/inc/services/urltransformer.hxx10
-rw-r--r--framework/inc/tabwin/tabwinfactory.hxx11
-rw-r--r--framework/inc/uiconfiguration/imagemanager.hxx62
-rw-r--r--framework/inc/uiconfiguration/moduleimagemanager.hxx115
-rw-r--r--framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx92
-rw-r--r--framework/inc/uiconfiguration/uicategorydescription.hxx50
-rw-r--r--framework/inc/uiconfiguration/uiconfigurationmanager.hxx81
-rw-r--r--framework/inc/uiconfiguration/windowstateconfiguration.hxx9
-rw-r--r--framework/inc/uielement/comboboxtoolbarcontroller.hxx4
-rw-r--r--framework/inc/uielement/complextoolbarcontroller.hxx1
-rw-r--r--framework/inc/uielement/controlmenucontroller.hxx7
-rw-r--r--framework/inc/uielement/dropdownboxtoolbarcontroller.hxx4
-rw-r--r--framework/inc/uielement/edittoolbarcontroller.hxx4
-rw-r--r--framework/inc/uielement/fontmenucontroller.hxx9
-rw-r--r--framework/inc/uielement/fontsizemenucontroller.hxx12
-rw-r--r--framework/inc/uielement/footermenucontroller.hxx61
-rw-r--r--framework/inc/uielement/headermenucontroller.hxx14
-rw-r--r--framework/inc/uielement/imagebuttontoolbarcontroller.hxx3
-rw-r--r--framework/inc/uielement/itemcontainer.hxx10
-rw-r--r--framework/inc/uielement/langselectionmenucontroller.hxx9
-rw-r--r--framework/inc/uielement/langselectionstatusbarcontroller.hxx1
-rw-r--r--framework/inc/uielement/macrosmenucontroller.hxx13
-rw-r--r--framework/inc/uielement/menubarmanager.hxx19
-rw-r--r--framework/inc/uielement/menubarwrapper.hxx7
-rw-r--r--framework/inc/uielement/newmenucontroller.hxx9
-rw-r--r--framework/inc/uielement/objectmenucontroller.hxx13
-rw-r--r--framework/inc/uielement/recentfilesmenucontroller.hxx8
-rw-r--r--framework/inc/uielement/spinfieldtoolbarcontroller.hxx4
-rw-r--r--framework/inc/uielement/statusbarmanager.hxx4
-rw-r--r--framework/inc/uielement/statusbarwrapper.hxx3
-rw-r--r--framework/inc/uielement/statusindicatorinterfacewrapper.hxx12
-rw-r--r--framework/inc/uielement/togglebuttontoolbarcontroller.hxx2
-rw-r--r--framework/inc/uielement/toolbarmanager.hxx6
-rw-r--r--framework/inc/uielement/toolbarsmenucontroller.hxx4
-rw-r--r--framework/inc/uielement/toolbarwrapper.hxx9
-rw-r--r--framework/inc/uielement/uicommanddescription.hxx22
-rw-r--r--framework/inc/uifactory/addonstoolboxfactory.hxx12
-rwxr-xr-xframework/inc/uifactory/factoryconfiguration.hxx127
-rw-r--r--framework/inc/uifactory/menubarfactory.hxx24
-rw-r--r--framework/inc/uifactory/popupmenucontrollerfactory.hxx38
-rw-r--r--framework/inc/uifactory/statusbarcontrollerfactory.hxx40
-rw-r--r--framework/inc/uifactory/statusbarfactory.hxx26
-rw-r--r--framework/inc/uifactory/toolbarcontrollerfactory.hxx21
-rw-r--r--framework/inc/uifactory/toolboxfactory.hxx25
-rw-r--r--framework/inc/uifactory/uielementfactorymanager.hxx75
-rw-r--r--framework/inc/uifactory/windowcontentfactorymanager.hxx19
-rw-r--r--framework/inc/xml/eventsdocumenthandler.hxx18
-rw-r--r--framework/inc/xml/imagesdocumenthandler.hxx15
-rw-r--r--framework/inc/xml/menudocumenthandler.hxx17
-rw-r--r--framework/inc/xml/saxnamespacefilter.hxx15
-rw-r--r--framework/inc/xml/statusbardocumenthandler.hxx15
-rw-r--r--framework/inc/xml/toolboxdocumenthandler.hxx15
-rw-r--r--framework/prj/d.lst11
-rw-r--r--framework/source/accelerators/acceleratorcache.cxx4
-rw-r--r--framework/source/accelerators/acceleratorconfiguration.cxx142
-rw-r--r--framework/source/accelerators/acceleratorexecute.cxx10
-rw-r--r--framework/source/accelerators/moduleacceleratorconfiguration.cxx3
-rw-r--r--framework/source/accelerators/presethandler.cxx9
-rw-r--r--framework/source/classes/addonmenu.cxx15
-rw-r--r--framework/source/classes/addonsoptions.cxx2
-rw-r--r--framework/source/classes/bmkmenu.cxx25
-rw-r--r--framework/source/classes/framelistanalyzer.cxx6
-rw-r--r--framework/source/classes/fwktabwindow.cxx56
-rwxr-xr-xframework/source/classes/fwlresid.cxx68
-rw-r--r--framework/source/classes/imagewrapper.cxx86
-rw-r--r--framework/source/classes/makefile.mk1
-rw-r--r--framework/source/classes/menumanager.cxx559
-rw-r--r--framework/source/classes/propertysethelper.cxx3
-rw-r--r--framework/source/classes/protocolhandlercache.cxx15
-rw-r--r--framework/source/classes/taskcreator.cxx3
-rw-r--r--framework/source/dispatch/closedispatcher.cxx27
-rw-r--r--framework/source/dispatch/dispatchprovider.cxx37
-rw-r--r--framework/source/dispatch/interceptionhelper.cxx4
-rw-r--r--framework/source/dispatch/menudispatcher.cxx26
-rw-r--r--framework/source/dispatch/popupmenudispatcher.cxx8
-rwxr-xr-xframework/source/dispatch/windowcommanddispatch.cxx1
-rw-r--r--framework/source/helper/actiontriggerhelper.cxx6
-rw-r--r--framework/source/helper/dockingareadefaultacceptor.cxx13
-rw-r--r--framework/source/helper/mischelper.cxx90
-rw-r--r--framework/source/helper/ocomponentaccess.cxx15
-rw-r--r--framework/source/helper/ocomponentenumeration.cxx17
-rw-r--r--framework/source/helper/oframes.cxx19
-rw-r--r--framework/source/helper/persistentwindowstate.cxx5
-rw-r--r--framework/source/helper/popupmenucontrollerbase.cxx77
-rw-r--r--framework/source/helper/titlebarupdate.cxx3
-rw-r--r--framework/source/helper/titlehelper.cxx44
-rw-r--r--framework/source/helper/uiconfigelementwrapperbase.cxx61
-rw-r--r--framework/source/helper/uielementwrapperbase.cxx1
-rw-r--r--framework/source/inc/accelerators/acceleratorconfiguration.hxx6
-rw-r--r--framework/source/inc/accelerators/presethandler.hxx2
-rw-r--r--framework/source/inc/dispatch/uieventloghelper.hxx3
-rw-r--r--framework/source/inc/loadenv/loadenv.hxx4
-rw-r--r--framework/source/inc/pattern/frame.hxx1
-rw-r--r--framework/source/interaction/makefile.mk2
-rw-r--r--framework/source/interaction/quietinteraction.cxx (renamed from framework/source/interaction/stillinteraction.cxx)16
-rw-r--r--framework/source/jobs/helponstartup.cxx13
-rw-r--r--framework/source/jobs/job.cxx3
-rw-r--r--framework/source/jobs/jobdata.cxx9
-rw-r--r--framework/source/jobs/jobresult.cxx2
-rw-r--r--framework/source/jobs/shelljob.cxx11
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx589
-rw-r--r--framework/source/loadenv/loadenv.cxx36
-rw-r--r--framework/source/recording/dispatchrecorder.cxx2
-rw-r--r--framework/source/register/registerservices.cxx134
-rw-r--r--framework/source/register/registertemp.cxx71
-rw-r--r--framework/source/services/autorecovery.cxx8
-rw-r--r--framework/source/services/backingwindow.cxx26
-rw-r--r--framework/source/services/desktop.cxx51
-rw-r--r--framework/source/services/dispatchhelper.cxx14
-rw-r--r--framework/source/services/frame.cxx54
-rw-r--r--framework/source/services/license.cxx10
-rw-r--r--framework/source/services/mediatypedetectionhelper.cxx18
-rw-r--r--framework/source/services/modulemanager.cxx7
-rw-r--r--framework/source/services/pathsettings.cxx10
-rw-r--r--framework/source/services/substitutepathvars.cxx51
-rw-r--r--framework/source/services/uriabbreviation.cxx13
-rw-r--r--framework/source/services/urltransformer.cxx178
-rw-r--r--framework/source/tabwin/tabwindow.cxx2
-rw-r--r--framework/source/tabwin/tabwinfactory.cxx13
-rw-r--r--framework/source/threadhelp/transactionmanager.cxx2
-rw-r--r--framework/source/uiconfiguration/graphicnameaccess.cxx2
-rw-r--r--framework/source/uiconfiguration/imagemanager.cxx926
-rwxr-xr-xframework/source/uiconfiguration/imagemanagerimpl.cxx1466
-rwxr-xr-xframework/source/uiconfiguration/imagemanagerimpl.hxx225
-rw-r--r--framework/source/uiconfiguration/makefile.mk2
-rw-r--r--framework/source/uiconfiguration/moduleimagemanager.cxx1346
-rw-r--r--framework/source/uiconfiguration/moduleuicfgsupplier.cxx76
-rw-r--r--framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx1428
-rw-r--r--framework/source/uiconfiguration/uicategorydescription.cxx219
-rw-r--r--framework/source/uiconfiguration/uiconfigurationmanager.cxx1157
-rwxr-xr-xframework/source/uiconfiguration/uiconfigurationmanagerimpl.cxx1713
-rwxr-xr-xframework/source/uiconfiguration/uiconfigurationmanagerimpl.hxx221
-rw-r--r--framework/source/uiconfiguration/windowstateconfiguration.cxx19
-rw-r--r--framework/source/uielement/addonstoolbarmanager.cxx30
-rw-r--r--framework/source/uielement/addonstoolbarwrapper.cxx1
-rw-r--r--framework/source/uielement/buttontoolbarcontroller.cxx2
-rw-r--r--framework/source/uielement/comboboxtoolbarcontroller.cxx55
-rw-r--r--framework/source/uielement/complextoolbarcontroller.cxx19
-rw-r--r--framework/source/uielement/constitemcontainer.cxx12
-rw-r--r--framework/source/uielement/controlmenucontroller.cxx148
-rw-r--r--framework/source/uielement/dropdownboxtoolbarcontroller.cxx55
-rw-r--r--framework/source/uielement/edittoolbarcontroller.cxx55
-rw-r--r--framework/source/uielement/fontmenucontroller.cxx111
-rw-r--r--framework/source/uielement/fontsizemenucontroller.cxx107
-rw-r--r--framework/source/uielement/footermenucontroller.cxx250
-rw-r--r--framework/source/uielement/headermenucontroller.cxx124
-rw-r--r--framework/source/uielement/imagebuttontoolbarcontroller.cxx10
-rw-r--r--framework/source/uielement/itemcontainer.cxx37
-rw-r--r--framework/source/uielement/langselectionmenucontroller.cxx210
-rw-r--r--framework/source/uielement/langselectionstatusbarcontroller.cxx20
-rw-r--r--framework/source/uielement/logoimagestatusbarcontroller.cxx4
-rw-r--r--framework/source/uielement/logotextstatusbarcontroller.cxx4
-rw-r--r--framework/source/uielement/macrosmenucontroller.cxx169
-rw-r--r--framework/source/uielement/menubarmanager.cxx702
-rw-r--r--framework/source/uielement/menubarmerger.cxx8
-rw-r--r--framework/source/uielement/menubarwrapper.cxx91
-rw-r--r--framework/source/uielement/newmenucontroller.cxx126
-rw-r--r--framework/source/uielement/objectmenucontroller.cxx89
-rw-r--r--framework/source/uielement/recentfilesmenucontroller.cxx83
-rw-r--r--framework/source/uielement/rootitemcontainer.cxx9
-rw-r--r--framework/source/uielement/spinfieldtoolbarcontroller.cxx63
-rw-r--r--framework/source/uielement/statusbarmanager.cxx175
-rw-r--r--framework/source/uielement/statusbarwrapper.cxx50
-rw-r--r--framework/source/uielement/statusindicatorinterfacewrapper.cxx16
-rw-r--r--framework/source/uielement/togglebuttontoolbarcontroller.cxx60
-rw-r--r--framework/source/uielement/toolbar.cxx1
-rw-r--r--framework/source/uielement/toolbarmanager.cxx268
-rw-r--r--framework/source/uielement/toolbarsmenucontroller.cxx72
-rw-r--r--framework/source/uielement/toolbarwrapper.cxx74
-rw-r--r--framework/source/uielement/uicommanddescription.cxx236
-rw-r--r--framework/source/uifactory/addonstoolboxfactory.cxx17
-rwxr-xr-xframework/source/uifactory/factoryconfiguration.cxx344
-rw-r--r--framework/source/uifactory/makefile.mk1
-rw-r--r--framework/source/uifactory/menubarfactory.cxx113
-rw-r--r--framework/source/uifactory/popupmenucontrollerfactory.cxx447
-rw-r--r--framework/source/uifactory/statusbarcontrollerfactory.cxx534
-rw-r--r--framework/source/uifactory/statusbarfactory.cxx112
-rw-r--r--framework/source/uifactory/toolbarcontrollerfactory.cxx358
-rw-r--r--framework/source/uifactory/toolboxfactory.cxx116
-rw-r--r--framework/source/uifactory/uielementfactorymanager.cxx228
-rw-r--r--framework/source/uifactory/windowcontentfactorymanager.cxx292
-rw-r--r--framework/source/xml/eventsconfiguration.cxx9
-rw-r--r--framework/source/xml/eventsdocumenthandler.cxx13
-rw-r--r--framework/source/xml/imagesconfiguration.cxx9
-rw-r--r--framework/source/xml/imagesdocumenthandler.cxx13
-rw-r--r--framework/source/xml/menuconfiguration.cxx7
-rw-r--r--framework/source/xml/menudocumenthandler.cxx27
-rw-r--r--framework/source/xml/saxnamespacefilter.cxx16
-rw-r--r--framework/source/xml/statusbarconfiguration.cxx5
-rw-r--r--framework/source/xml/statusbardocumenthandler.cxx23
-rw-r--r--framework/source/xml/toolboxconfiguration.cxx5
-rw-r--r--framework/source/xml/toolboxdocumenthandler.cxx26
-rw-r--r--framework/util/makefile.mk68
-rw-r--r--idl/source/objects/bastype.cxx39
-rw-r--r--idl/source/prj/command.cxx2
-rw-r--r--idl/source/prj/globals.cxx2
-rw-r--r--linguistic/source/gciterator.cxx38
-rw-r--r--linguistic/source/lngopt.cxx18
-rw-r--r--linguistic/source/lngopt.hxx2
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Accelerators.xcu18
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Common.xcu9
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Paths.xcu9
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu16
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu572
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu11
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu71
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu16
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu17
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu18
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu4
-rw-r--r--officecfg/registry/data/org/openoffice/Office/makefile.mk2
-rw-r--r--officecfg/registry/data/org/openoffice/VCL.xcu34
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Calc.xcs4
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs60
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs19
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Draw.xcs24
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Impress.xcs10
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/UI.xcs4
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Writer.xcs16
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs8
-rw-r--r--officecfg/registry/schema/org/openoffice/Setup.xcs7
-rw-r--r--officecfg/util/alllang.xsl6
-rw-r--r--oovbaapi/genconstidl/makefile.mk6
-rw-r--r--oovbaapi/ooo/vba/constants/makefile.mk8
-rw-r--r--oovbaapi/ooo/vba/makefile.mk4
-rw-r--r--oovbaapi/util/makefile.mk2
-rwxr-xr-xreadlicense_oo/docs/readme/readme.xrm39
-rwxr-xr-xreadlicense_oo/util/makefile.pmk6
-rw-r--r--sandbox/com/sun/star/lib/sandbox/makefile.mk4
-rw-r--r--sandbox/util/makefile.mk4
-rwxr-xr-xscripting/examples/java/makefile.mk2
-rwxr-xr-xscripting/examples/makefile.mk4
-rwxr-xr-xscripting/java/makefile.mk2
-rw-r--r--scripting/source/stringresource/stringresource.cxx20
-rw-r--r--scripting/source/stringresource/stringresource.hxx3
-rw-r--r--sfx2/inc/guisaveas.hxx4
-rw-r--r--sfx2/inc/pch/precompiled_sfx2.hxx2
-rw-r--r--sfx2/inc/sfx2/dinfdlg.hxx6
-rw-r--r--sfx2/inc/sfx2/docfile.hxx25
-rw-r--r--sfx2/inc/sfx2/docfilt.hxx14
-rw-r--r--sfx2/inc/sfx2/docmacromode.hxx24
-rw-r--r--sfx2/inc/sfx2/event.hxx37
-rw-r--r--sfx2/inc/sfx2/evntconf.hxx31
-rw-r--r--sfx2/inc/sfx2/filedlghelper.hxx3
-rw-r--r--sfx2/inc/sfx2/objsh.hxx17
-rw-r--r--sfx2/inc/sfx2/sfx.hrc3
-rw-r--r--sfx2/inc/sfx2/sfxbasemodel.hxx2
-rw-r--r--sfx2/inc/sfx2/sfxsids.hrc7
-rw-r--r--sfx2/inc/sfx2/signaturestate.hxx9
-rw-r--r--sfx2/inc/sfx2/viewsh.hxx6
-rw-r--r--sfx2/sdi/appslots.sdi8
-rw-r--r--sfx2/sdi/makefile.mk3
-rw-r--r--sfx2/sdi/sfx.sdi154
-rw-r--r--sfx2/sdi/sfxslots.sdi1
-rw-r--r--sfx2/source/appl/app.cxx4
-rw-r--r--sfx2/source/appl/app.hrc16
-rw-r--r--sfx2/source/appl/app.src71
-rw-r--r--sfx2/source/appl/appcfg.cxx34
-rw-r--r--sfx2/source/appl/appdata.cxx1
-rw-r--r--sfx2/source/appl/appinit.cxx33
-rw-r--r--sfx2/source/appl/appopen.cxx106
-rw-r--r--sfx2/source/appl/appserv.cxx17
-rw-r--r--sfx2/source/appl/appuno.cxx6
-rw-r--r--sfx2/source/appl/sfxhelp.cxx9
-rw-r--r--sfx2/source/appl/shutdowniconOs2.cxx2
-rw-r--r--sfx2/source/bastyp/helper.cxx33
-rw-r--r--sfx2/source/bastyp/progress.cxx14
-rw-r--r--sfx2/source/config/evntconf.cxx418
-rw-r--r--sfx2/source/control/bindings.cxx515
-rw-r--r--sfx2/source/control/unoctitm.cxx11
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx28
-rw-r--r--sfx2/source/dialog/dockwin.cxx1
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx110
-rw-r--r--sfx2/source/dialog/templdlg.cxx6
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx153
-rw-r--r--sfx2/source/doc/docfile.cxx979
-rw-r--r--sfx2/source/doc/docfilt.cxx14
-rw-r--r--sfx2/source/doc/docmacromode.cxx197
-rw-r--r--sfx2/source/doc/doctemplates.cxx10
-rw-r--r--sfx2/source/doc/graphhelp.cxx27
-rw-r--r--sfx2/source/doc/guisaveas.cxx29
-rw-r--r--sfx2/source/doc/makefile.mk5
-rw-r--r--sfx2/source/doc/objcont.cxx48
-rw-r--r--sfx2/source/doc/objembed.cxx2
-rw-r--r--sfx2/source/doc/objmisc.cxx147
-rw-r--r--sfx2/source/doc/objserv.cxx141
-rw-r--r--sfx2/source/doc/objstor.cxx278
-rw-r--r--sfx2/source/doc/objxtor.cxx160
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx94
-rw-r--r--sfx2/source/doc/sfxbasemodel.src94
-rw-r--r--sfx2/source/inc/eventsupplier.hxx3
-rw-r--r--sfx2/source/inc/helper.hxx1
-rw-r--r--sfx2/source/inc/objshimp.hxx13
-rw-r--r--sfx2/source/notify/eventsupplier.cxx28
-rw-r--r--sfx2/source/view/frame.cxx2
-rw-r--r--sfx2/source/view/frmload.cxx139
-rw-r--r--sfx2/source/view/prnmon.cxx2
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx4
-rw-r--r--sfx2/source/view/topfrm.cxx5
-rw-r--r--sfx2/source/view/viewfrm.cxx30
-rw-r--r--sfx2/source/view/viewimp.hxx17
-rw-r--r--sfx2/source/view/viewprn.cxx51
-rw-r--r--sfx2/source/view/viewsh.cxx98
-rw-r--r--sfx2/util/makefile.mk1
-rw-r--r--shell/inc/internal/basereader.hxx2
-rw-r--r--shell/inc/internal/contentreader.hxx3
-rw-r--r--shell/inc/internal/metainforeader.hxx3
-rw-r--r--shell/inc/internal/propsheets.hxx1
-rw-r--r--shell/inc/internal/types.hxx3
-rw-r--r--shell/inc/internal/zipfile.hxx11
-rw-r--r--shell/prj/build.lst1
-rwxr-xr-xshell/source/all/makefile.mk2
-rw-r--r--shell/source/all/ooofilereader/basereader.cxx9
-rw-r--r--shell/source/all/ooofilereader/contentreader.cxx23
-rw-r--r--shell/source/all/ooofilereader/makefile.mk3
-rw-r--r--shell/source/all/ooofilereader/metainforeader.cxx42
-rw-r--r--shell/source/all/zipfile/makefile.mk7
-rw-r--r--shell/source/all/zipfile/zipfile.cxx22
-rw-r--r--shell/source/aqua/sysshell/makefile.mk1
-rw-r--r--shell/source/aqua/sysshell/systemshell.cxx36
-rw-r--r--shell/source/backends/kde4be/exports.map10
-rw-r--r--shell/source/backends/kde4be/kde4backend.cxx158
-rw-r--r--shell/source/backends/kde4be/kde4backend.hxx123
-rw-r--r--shell/source/backends/kde4be/kde4be.xml35
-rw-r--r--shell/source/backends/kde4be/kde4be1-ucd.txt6
-rw-r--r--shell/source/backends/kde4be/kde4becdef.cxx143
-rw-r--r--shell/source/backends/kde4be/kde4commonlayer.cxx157
-rw-r--r--shell/source/backends/kde4be/kde4commonlayer.hxx51
-rw-r--r--shell/source/backends/kde4be/kde4inetlayer.cxx255
-rw-r--r--shell/source/backends/kde4be/kde4inetlayer.hxx59
-rw-r--r--shell/source/backends/kde4be/kde4pathslayer.cxx124
-rw-r--r--shell/source/backends/kde4be/kde4pathslayer.hxx82
-rw-r--r--shell/source/backends/kde4be/kde4vcllayer.cxx115
-rw-r--r--shell/source/backends/kde4be/kde4vcllayer.hxx53
-rw-r--r--shell/source/backends/kde4be/makefile.mk94
-rw-r--r--shell/source/backends/macbe/makefile.mk3
-rw-r--r--shell/source/unix/exec/shellexec.cxx21
-rw-r--r--shell/source/unix/misc/makefile.mk2
-rw-r--r--shell/source/unix/misc/open-url.c40
-rw-r--r--shell/source/unix/misc/senddoc.c40
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/makefile.mk16
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx212
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx33
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx1
-rw-r--r--shell/source/win32/shlxthandler/propsheets/propsheets.cxx28
-rw-r--r--shell/source/win32/shlxthandler/util/makefile.mk1
-rw-r--r--shell/source/win32/shlxthandler/util/utilities.cxx1
-rw-r--r--shell/source/win32/simplemail/smplmailclient.cxx12
-rw-r--r--sj2/doc/Todo.txt108
-rw-r--r--sj2/doc/concepts.html844
-rw-r--r--sj2/inc/sjapplet.hxx85
-rw-r--r--sj2/prj/build.lst8
-rw-r--r--sj2/prj/d.lst9
-rw-r--r--sj2/source/inc/java_lang_object.hxx94
-rw-r--r--sj2/source/jscpp/sjapplet.cxx126
-rw-r--r--sj2/source/jscpp/sjapplet_impl.cxx617
-rw-r--r--sj2/source/jscpp/sjapplet_impl.hxx56
-rw-r--r--sj2/stardiv/app/AppletMessageHandler.java117
-rw-r--r--sj2/stardiv/app/AppletProps.java190
-rw-r--r--sj2/stardiv/app/AppletViewer.java995
-rw-r--r--sj2/stardiv/app/MsgAppletViewer.java189
-rw-r--r--sj2/stardiv/applet/AppletExecutionContext.java383
-rw-r--r--sj2/stardiv/applet/Document.java166
-rw-r--r--sj2/stardiv/applet/DocumentProxy.java194
-rw-r--r--sj2/stardiv/applet/makefile.mk78
-rw-r--r--sj2/stardiv/applet/resources/MsgAppletViewer.java135
-rw-r--r--sj2/stardiv/applet/resources/makefile.mk54
-rw-r--r--sj2/stardiv/controller/SjSettings.java179
-rw-r--r--sj2/stardiv/controller/makefile.mk58
-rw-r--r--sj2/stardiv/security/resources/MsgAppletViewer.java91
-rw-r--r--sj2/stardiv/security/resources/makefile.mk54
-rw-r--r--sj2/util/makefile.pmk46
-rw-r--r--sj2/util/target.pmk42
-rw-r--r--svx/inc/AccessibleSelectionBase.hxx76
-rw-r--r--svx/inc/AccessibleStaticTextBase.hxx4
-rw-r--r--svx/inc/ActionDescriptionProvider.hxx68
-rwxr-xr-xsvx/inc/EnhancedCustomShapeFunctionParser.hxx8
-rw-r--r--svx/inc/accessibility.hrc2
-rw-r--r--svx/inc/acorrcfg.hxx138
-rw-r--r--svx/inc/anchorid.hxx47
-rw-r--r--svx/inc/asiancfg.hxx74
-rw-r--r--svx/inc/bolnitem.hxx88
-rw-r--r--svx/inc/bulitem.hxx165
-rw-r--r--svx/inc/charhiddenitem.hxx68
-rw-r--r--svx/inc/fontitem.hxx2
-rw-r--r--svx/inc/gallery1.hxx4
-rw-r--r--svx/inc/galobj.hxx4
-rw-r--r--svx/inc/galtheme.hxx20
-rw-r--r--svx/inc/optgenrl.hrc3
-rw-r--r--svx/inc/svdglob.hxx6
-rw-r--r--svx/inc/svdstr.hrc8
-rw-r--r--svx/inc/svx/AccessibleContextBase.hxx33
-rw-r--r--svx/inc/svx/AccessibleControlShape.hxx4
-rwxr-xr-xsvx/inc/svx/AccessibleShape.hxx33
-rw-r--r--svx/inc/svx/SmartTagMgr.hxx4
-rwxr-xr-x[-rw-r--r--]svx/inc/svx/dbcharsethelper.hxx (renamed from svx/source/inc/dbcharsethelper.hxx)6
-rwxr-xr-x[-rw-r--r--]svx/inc/svx/dbtoolsclient.hxx (renamed from svx/source/inc/dbtoolsclient.hxx)7
-rw-r--r--svx/inc/svx/dialogs.hrc28
-rw-r--r--svx/inc/svx/editeng.hxx2
-rw-r--r--svx/inc/svx/escherex.hxx81
-rw-r--r--svx/inc/svx/fntctrl.hxx1
-rw-r--r--svx/inc/svx/framelink.hxx10
-rw-r--r--svx/inc/svx/langbox.hxx2
-rw-r--r--svx/inc/svx/msdffimp.hxx4
-rw-r--r--svx/inc/svx/numfmtsh.hxx4
-rw-r--r--svx/inc/svx/obj3d.hxx4
-rw-r--r--svx/inc/svx/sdasaitm.hxx8
-rw-r--r--svx/inc/svx/sdgcpitm.hxx2
-rw-r--r--svx/inc/svx/sdr/animation/objectanimator.hxx2
-rw-r--r--svx/inc/svx/sdr/animation/scheduler.hxx9
-rw-r--r--svx/inc/svx/sdr/attribute/sdrtextattribute.hxx14
-rw-r--r--svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx12
-rw-r--r--svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx2
-rw-r--r--svx/inc/svx/sdr/overlay/overlayobject.hxx5
-rw-r--r--svx/inc/svx/sdr/overlay/overlayselection.hxx98
-rw-r--r--svx/inc/svx/sdr/primitive2d/primitiveFactory2d.hxx8
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx2
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx6
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx4
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx17
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx89
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx19
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx27
-rw-r--r--svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx1
-rw-r--r--svx/inc/svx/sdtfchim.hxx20
-rw-r--r--svx/inc/svx/svdetc.hxx16
-rw-r--r--svx/inc/svx/svdfppt.hxx2
-rw-r--r--svx/inc/svx/svdhdl.hxx7
-rw-r--r--svx/inc/svx/svdmodel.hxx2
-rw-r--r--svx/inc/svx/svdoashp.hxx4
-rw-r--r--svx/inc/svx/svdoedge.hxx2
-rw-r--r--svx/inc/svx/svdoole2.hxx4
-rw-r--r--svx/inc/svx/svdotext.hxx11
-rw-r--r--svx/inc/svx/svdpntv.hxx2
-rw-r--r--svx/inc/svx/svdundo.hxx38
-rw-r--r--svx/inc/svx/svx3ditems.hxx88
-rw-r--r--svx/inc/svx/svxdlg.hxx9
-rw-r--r--svx/inc/svx/svxfont.hxx3
-rw-r--r--svx/inc/svx/svxids.hrc20
-rw-r--r--svx/inc/svx/sxfiitm.hxx2
-rw-r--r--svx/inc/svx/tstpitem.hxx12
-rw-r--r--svx/inc/svx/unoedsrc.hxx32
-rw-r--r--svx/inc/svx/unofored.hxx2
-rw-r--r--svx/inc/svx/unoforou.hxx2
-rw-r--r--svx/inc/svx/unoprov.hxx2
-rw-r--r--svx/inc/svx/unoshtxt.hxx13
-rw-r--r--svx/inc/svx/unotext.hxx10
-rw-r--r--svx/inc/svx/xflbckit.hxx8
-rw-r--r--svx/inc/svx/xflbmpit.hxx12
-rw-r--r--svx/inc/svx/xflbmsli.hxx8
-rw-r--r--svx/inc/svx/xflbmsxy.hxx20
-rw-r--r--svx/inc/svx/xflboxy.hxx16
-rw-r--r--svx/inc/svx/xflbtoxy.hxx16
-rw-r--r--svx/inc/svx/xsflclit.hxx16
-rw-r--r--svx/inc/unoapi.hxx8
-rw-r--r--svx/inc/unoedhlp.hxx2
-rw-r--r--svx/inc/unolingu.hxx2
-rw-r--r--svx/inc/xexch.hxx2
-rw-r--r--svx/inc/xmlgrhlp.hxx14
-rw-r--r--svx/inc/xoutbmp.hxx2
-rw-r--r--svx/prj/d.lst5
-rw-r--r--svx/sdi/makefile.mk4
-rw-r--r--svx/sdi/svx.sdi274
-rw-r--r--svx/sdi/svxitems.sdi2
-rw-r--r--svx/source/accessibility/AccessibleEditableTextPara.cxx150
-rw-r--r--svx/source/accessibility/AccessibleEditableTextPara.hxx19
-rw-r--r--svx/source/accessibility/AccessibleEmptyEditSource.cxx9
-rw-r--r--svx/source/accessibility/AccessibleImageBullet.cxx20
-rw-r--r--svx/source/accessibility/AccessibleStaticTextBase.cxx47
-rw-r--r--svx/source/accessibility/accessibility.src12
-rwxr-xr-xsvx/source/accessibility/makefile.mk11
-rw-r--r--svx/source/cui/autocdlg.cxx8
-rw-r--r--svx/source/cui/autocdlg.hrc2
-rw-r--r--svx/source/cui/autocdlg.hxx2
-rw-r--r--svx/source/cui/autocdlg.src4
-rw-r--r--svx/source/cui/commonlingui.src20
-rw-r--r--svx/source/cui/cuioptgenrl.hxx1
-rw-r--r--svx/source/cui/dlgfact.cxx6
-rw-r--r--svx/source/cui/dlgfact.hxx2
-rw-r--r--svx/source/cui/hangulhanjadlg.src38
-rw-r--r--svx/source/cui/insrc.cxx88
-rw-r--r--svx/source/cui/insrc.hrc (renamed from sj2/stardiv/app/AppletViewerFactory.java)29
-rw-r--r--svx/source/cui/insrc.hxx72
-rw-r--r--svx/source/cui/insrc.src118
-rw-r--r--svx/source/cui/macropg.cxx35
-rw-r--r--svx/source/cui/macropg.src97
-rwxr-xr-xsvx/source/cui/makefile.mk6
-rw-r--r--svx/source/cui/numfmt.cxx3
-rw-r--r--svx/source/cui/numfmt.hrc7
-rw-r--r--svx/source/cui/numfmt.hxx1
-rw-r--r--svx/source/cui/numfmt.src4
-rw-r--r--svx/source/cui/optaccessibility.cxx4
-rw-r--r--svx/source/cui/optgdlg.cxx189
-rw-r--r--svx/source/cui/optgdlg.hrc9
-rw-r--r--svx/source/cui/optgdlg.hxx8
-rw-r--r--svx/source/cui/optgdlg.src78
-rw-r--r--svx/source/cui/optgenrl.cxx18
-rw-r--r--svx/source/cui/optsave.cxx87
-rw-r--r--svx/source/cui/selector.cxx9
-rw-r--r--svx/source/cui/selector.hxx1
-rw-r--r--svx/source/cui/showcols.cxx8
-rw-r--r--svx/source/cui/svuidlg.src24
-rw-r--r--svx/source/cui/treeopt.cxx15
-rw-r--r--svx/source/cui/webconninfo.cxx106
-rw-r--r--svx/source/cui/webconninfo.hxx1
-rw-r--r--svx/source/cui/zoom.src44
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx270
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.hxx39
-rw-r--r--svx/source/customshapes/EnhancedCustomShape3d.hxx7
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx4
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx2
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeGeometry.cxx478
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeGeometry.hxx8
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeTypeNames.hxx10
-rw-r--r--svx/source/customshapes/makefile.mk14
-rw-r--r--svx/source/dialog/fntctrl.cxx29
-rw-r--r--svx/source/dialog/imapwnd.cxx3
-rw-r--r--svx/source/dialog/langbox.cxx28
-rw-r--r--svx/source/dialog/makefile.mk45
-rw-r--r--svx/source/dialog/srchdlg.cxx2
-rw-r--r--svx/source/dialog/txencbox.cxx2
-rw-r--r--svx/source/editeng/editeng.cxx31
-rw-r--r--svx/source/editeng/eertfpar.cxx13
-rw-r--r--svx/source/editeng/impedit.cxx2
-rw-r--r--svx/source/editeng/impedit.hxx2
-rw-r--r--svx/source/editeng/impedit2.cxx59
-rw-r--r--svx/source/engine3d/helperhittest3d.cxx32
-rw-r--r--svx/source/engine3d/makefile.mk15
-rw-r--r--svx/source/fmcomp/dbaexchange.cxx1
-rw-r--r--svx/source/fmcomp/dbaobjectex.cxx1
-rw-r--r--svx/source/fmcomp/fmgridcl.cxx23
-rw-r--r--svx/source/fmcomp/fmgridif.cxx44
-rw-r--r--svx/source/fmcomp/gridcell.cxx870
-rw-r--r--svx/source/fmcomp/gridcols.cxx19
-rw-r--r--svx/source/fmcomp/gridctrl.cxx21
-rw-r--r--svx/source/fmcomp/makefile.mk20
-rw-r--r--svx/source/form/datanavi.cxx28
-rw-r--r--svx/source/form/datanavi.src5
-rw-r--r--svx/source/form/dbcharsethelper.cxx2
-rw-r--r--svx/source/form/dbtoolsclient.cxx2
-rw-r--r--svx/source/form/fmPropBrw.cxx14
-rw-r--r--svx/source/form/fmctrler.cxx8
-rw-r--r--svx/source/form/fmdocumentclassification.cxx2
-rw-r--r--svx/source/form/fmpgeimp.cxx97
-rw-r--r--svx/source/form/fmprop.cxx195
-rw-r--r--svx/source/form/fmservs.cxx69
-rw-r--r--svx/source/form/fmshimp.cxx10
-rw-r--r--svx/source/form/fmstring.src103
-rw-r--r--svx/source/form/fmtextcontrolshell.cxx1
-rw-r--r--svx/source/form/fmtools.cxx11
-rw-r--r--svx/source/form/fmundo.cxx6
-rw-r--r--svx/source/form/fmurl.cxx74
-rw-r--r--svx/source/form/fmview.cxx4
-rw-r--r--svx/source/form/formcontrolfactory.cxx72
-rw-r--r--svx/source/form/formcontrolling.cxx1
-rw-r--r--svx/source/form/makefile.mk31
-rw-r--r--svx/source/form/navigatortree.cxx2
-rw-r--r--svx/source/form/tabwin.cxx2
-rw-r--r--svx/source/gengal/makefile.mk2
-rw-r--r--svx/source/inc/AccessibleStringWrap.hxx8
-rw-r--r--svx/source/inc/datanavi.hxx4
-rw-r--r--svx/source/inc/filtnav.hxx5
-rw-r--r--svx/source/inc/fmPropBrw.hxx1
-rw-r--r--svx/source/inc/fmctrler.hxx4
-rw-r--r--svx/source/inc/fmexch.hxx12
-rw-r--r--svx/source/inc/fmexpl.hxx4
-rw-r--r--svx/source/inc/fmobj.hxx4
-rw-r--r--svx/source/inc/fmpgeimp.hxx16
-rw-r--r--svx/source/inc/fmprop.hrc289
-rw-r--r--svx/source/inc/fmresids.hrc46
-rw-r--r--svx/source/inc/fmservs.hxx122
-rw-r--r--svx/source/inc/fmshimp.hxx12
-rw-r--r--svx/source/inc/fmstatic.hxx81
-rw-r--r--svx/source/inc/fmtools.hxx20
-rw-r--r--svx/source/inc/fmurl.hxx69
-rw-r--r--svx/source/inc/formcontrolfactory.hxx17
-rw-r--r--svx/source/inc/formtoolbars.hxx13
-rw-r--r--svx/source/inc/gridcell.hxx199
-rw-r--r--svx/source/inc/gridcols.hxx29
-rw-r--r--svx/source/inc/sqlparserclient.hxx4
-rw-r--r--svx/source/inc/stringlistresource.hxx9
-rw-r--r--svx/source/inc/tabwin.hxx2
-rw-r--r--svx/source/inc/typeconversionclient.hxx2
-rw-r--r--svx/source/inc/unoedprx.hxx6
-rw-r--r--svx/source/inc/unogalthemeprovider.hxx6
-rw-r--r--svx/source/inc/unopolyhelper.hxx4
-rw-r--r--svx/source/intro/intro_tmpl.hrc2
-rw-r--r--svx/source/items/algitem.cxx100
-rw-r--r--svx/source/items/makefile.mk37
-rw-r--r--svx/source/items/numfmtsh.cxx61
-rw-r--r--svx/source/items/numitem.cxx20
-rw-r--r--svx/source/items/paraitem.cxx13
-rw-r--r--svx/source/items/textitem.cxx7
-rw-r--r--svx/source/mnuctrls/clipboardctl.cxx10
-rw-r--r--svx/source/msfilter/escherex.cxx213
-rw-r--r--svx/source/msfilter/eschesdo.cxx21
-rw-r--r--svx/source/msfilter/makefile.mk10
-rw-r--r--svx/source/msfilter/msdffimp.cxx35
-rw-r--r--svx/source/msfilter/svxmsbas.cxx49
-rw-r--r--svx/source/msfilter/svxmsbas2.cxx88
-rw-r--r--svx/source/options/makefile.mk35
-rw-r--r--svx/source/options/optgenrl.src8
-rw-r--r--svx/source/options/optimprove.src2
-rw-r--r--svx/source/options/optsave.src8
-rw-r--r--svx/source/sdr/attribute/sdrtextattribute.cxx36
-rw-r--r--svx/source/sdr/contact/viewcontactofgraphic.cxx3
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx14
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrole2obj.cxx97
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrrectobj.cxx10
-rw-r--r--svx/source/sdr/contact/viewcontactofunocontrol.cxx4
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofgraphic.cxx17
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx291
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx64
-rw-r--r--svx/source/sdr/overlay/makefile.mk1
-rw-r--r--svx/source/sdr/overlay/overlaymanagerbuffered.cxx57
-rw-r--r--svx/source/sdr/overlay/overlayobject.cxx2
-rw-r--r--svx/source/sdr/overlay/overlayselection.cxx233
-rw-r--r--svx/source/sdr/primitive2d/makefile.mk1
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx8
-rw-r--r--svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx83
-rw-r--r--svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx10
-rw-r--r--svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx29
-rw-r--r--svx/source/sdr/primitive2d/sdrdecompositiontools.cxx111
-rw-r--r--svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx22
-rw-r--r--svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx11
-rw-r--r--svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx134
-rw-r--r--svx/source/sdr/primitive2d/sdrole2primitive2d.cxx11
-rw-r--r--svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx200
-rw-r--r--svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx47
-rw-r--r--svx/source/sdr/primitive2d/sdrprimitivetools.cxx25
-rw-r--r--svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx74
-rw-r--r--svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx81
-rw-r--r--svx/source/smarttags/SmartTagMgr.cxx18
-rw-r--r--svx/source/stbctrls/stbctrls.src7
-rw-r--r--svx/source/stbctrls/xmlsecctrl.cxx6
-rw-r--r--svx/source/svdraw/makefile.mk24
-rw-r--r--svx/source/svdraw/svdcrtv.cxx6
-rw-r--r--svx/source/svdraw/svddrgmt.cxx17
-rw-r--r--svx/source/svdraw/svddrgv.cxx6
-rw-r--r--svx/source/svdraw/svdedtv.cxx5
-rw-r--r--svx/source/svdraw/svdetc.cxx28
-rw-r--r--svx/source/svdraw/svdfmtf.cxx12
-rw-r--r--svx/source/svdraw/svdfppt.cxx169
-rw-r--r--svx/source/svdraw/svdhdl.cxx51
-rw-r--r--svx/source/svdraw/svdmodel.cxx5
-rw-r--r--svx/source/svdraw/svdmrkv.cxx6
-rw-r--r--svx/source/svdraw/svdobj.cxx74
-rw-r--r--svx/source/svdraw/svdocapt.cxx27
-rw-r--r--svx/source/svdraw/svdocirc.cxx57
-rw-r--r--svx/source/svdraw/svdoedge.cxx18
-rw-r--r--svx/source/svdraw/svdoole2.cxx17
-rw-r--r--svx/source/svdraw/svdopath.cxx106
-rw-r--r--svx/source/svdraw/svdorect.cxx47
-rw-r--r--svx/source/svdraw/svdotextdecomposition.cxx142
-rw-r--r--svx/source/svdraw/svdotextpathdecomposition.cxx57
-rw-r--r--svx/source/svdraw/svdstr.src14
-rw-r--r--svx/source/svdraw/svdundo.cxx98
-rw-r--r--svx/source/svdraw/svdxcgv.cxx15
-rw-r--r--svx/source/svrtf/makefile.mk11
-rw-r--r--svx/source/svrtf/rtfgrf.cxx13
-rw-r--r--svx/source/svrtf/rtfitem.cxx12
-rw-r--r--svx/source/svxlink/fileobj.cxx31
-rw-r--r--svx/source/table/accessiblecell.cxx11
-rw-r--r--svx/source/table/accessiblecell.hxx1
-rw-r--r--svx/source/table/accessibletableshape.cxx11
-rw-r--r--svx/source/table/cell.cxx79
-rw-r--r--svx/source/table/cell.hxx180
-rw-r--r--svx/source/table/cellcursor.cxx17
-rw-r--r--svx/source/table/celleditsource.hxx2
-rw-r--r--svx/source/table/makefile.mk17
-rw-r--r--svx/source/table/tablecontroller.cxx85
-rw-r--r--svx/source/table/tablecontroller.hxx113
-rw-r--r--svx/source/table/tablelayouter.cxx1
-rw-r--r--svx/source/table/tablemodel.cxx14
-rw-r--r--svx/source/table/viewcontactoftableobj.cxx12
-rw-r--r--svx/source/tbxctrls/makefile.mk17
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx12
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src2
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx6
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.hxx6
-rw-r--r--svx/source/unodraw/gluepts.cxx92
-rw-r--r--svx/source/unodraw/makefile.mk19
-rw-r--r--svx/source/unodraw/unomod.cxx9
-rw-r--r--svx/source/unodraw/unoshap2.cxx3
-rw-r--r--svx/source/unodraw/unoshap3.cxx34
-rw-r--r--svx/source/unodraw/unoshtxt.cxx14
-rw-r--r--svx/source/unoedit/makefile.mk17
-rw-r--r--svx/source/unoedit/unoedprx.cxx10
-rw-r--r--svx/source/unoedit/unofored.cxx11
-rw-r--r--svx/source/unoedit/unoforou.cxx12
-rw-r--r--svx/source/unoedit/unotext.cxx10
-rw-r--r--svx/source/unoedit/unoviwou.cxx1
-rwxr-xr-xsvx/source/unogallery/makefile.mk6
-rw-r--r--svx/source/unogallery/unogalthemeprovider.cxx4
-rw-r--r--svx/source/xml/xmleohlp.cxx28
-rw-r--r--svx/source/xml/xmlgrhlp.cxx99
-rw-r--r--svx/source/xml/xmlxtimp.cxx2
-rw-r--r--svx/util/hidother.src1
-rw-r--r--svx/util/makefile.mk173
-rw-r--r--svx/util/makefile.pmk8
-rw-r--r--ucb/inc/makefile.mk3
-rw-r--r--ucb/source/cacher/makefile.mk2
-rw-r--r--ucb/source/core/makefile.mk3
-rw-r--r--ucb/source/regexp/makefile.mk2
-rw-r--r--ucb/source/sorter/makefile.mk2
-rw-r--r--ucb/source/ucp/expand/makefile.mk4
-rw-r--r--ucb/source/ucp/file/makefile.mk2
-rw-r--r--ucb/source/ucp/ftp/ftpcontent.cxx1
-rw-r--r--ucb/source/ucp/ftp/makefile.mk3
-rw-r--r--ucb/source/ucp/gio/gio_mount.cxx2
-rw-r--r--ucb/source/ucp/gio/makefile.mk2
-rw-r--r--ucb/source/ucp/gvfs/content.cxx3
-rw-r--r--ucb/source/ucp/gvfs/makefile.mk2
-rw-r--r--ucb/source/ucp/hierarchy/makefile.mk2
-rw-r--r--ucb/source/ucp/package/makefile.mk2
-rw-r--r--ucb/source/ucp/tdoc/makefile.mk3
-rw-r--r--ucb/source/ucp/webdav/DAVAuthListener.hxx3
-rw-r--r--ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx13
-rw-r--r--ucb/source/ucp/webdav/DAVResourceAccess.cxx60
-rw-r--r--ucb/source/ucp/webdav/NeonSession.cxx257
-rw-r--r--ucb/source/ucp/webdav/makefile.mk2
-rw-r--r--uui/source/iahndl.cxx449
-rw-r--r--uui/source/iahndl.hxx26
-rw-r--r--uui/source/ids.hrc3
-rw-r--r--uui/source/ids.src7
-rw-r--r--uui/source/interactionhandler.cxx52
-rw-r--r--uui/source/interactionhandler.hxx8
-rw-r--r--uui/source/logindlg.cxx70
-rw-r--r--uui/source/logindlg.hrc1
-rw-r--r--uui/source/logindlg.hxx7
-rw-r--r--uui/source/logindlg.src8
-rw-r--r--uui/source/loginerr.hxx158
-rw-r--r--uui/source/masterpassworddlg.src8
-rw-r--r--uui/source/passcrtdlg.cxx3
-rw-r--r--uui/source/passcrtdlg.hrc1
-rw-r--r--uui/source/passcrtdlg.src2
-rw-r--r--uui/source/passworddlg.hrc20
-rw-r--r--uui/source/passworddlg.src3
-rw-r--r--uui/source/secmacrowarnings.cxx21
-rw-r--r--uui/source/secmacrowarnings.hxx2
-rw-r--r--xmlhelp/inc/xmlhelp/compilehelp.hxx70
-rw-r--r--xmlhelp/prj/build.lst2
-rw-r--r--xmlhelp/source/com/sun/star/help/HelpCompiler.cxx593
-rw-r--r--xmlhelp/source/com/sun/star/help/HelpCompiler.hxx320
-rw-r--r--xmlhelp/source/com/sun/star/help/HelpFileDocument.java89
-rw-r--r--xmlhelp/source/com/sun/star/help/HelpIndexer.java299
-rw-r--r--xmlhelp/source/com/sun/star/help/HelpLinker.cxx1157
-rw-r--r--xmlhelp/source/com/sun/star/help/makefile.mk68
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx20
-rw-r--r--xmlhelp/source/cxxhelp/provider/urlparameter.cxx14
-rw-r--r--xmloff/inc/txtflde.hxx2
-rw-r--r--xmloff/inc/xmlnmspe.hxx10
-rw-r--r--xmloff/inc/xmloff/nmspmap.hxx5
-rw-r--r--xmloff/inc/xmloff/txtparae.hxx23
-rw-r--r--xmloff/inc/xmloff/xmlaustp.hxx4
-rw-r--r--xmloff/inc/xmloff/xmlimp.hxx2
-rw-r--r--xmloff/inc/xmloff/xmlimppr.hxx1
-rw-r--r--xmloff/inc/xmloff/xmlmetai.hxx5
-rw-r--r--xmloff/inc/xmloff/xmltoken.hxx6
-rw-r--r--xmloff/source/chart/SchXMLChartContext.cxx25
-rw-r--r--xmloff/source/chart/SchXMLChartContext.hxx7
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx7
-rw-r--r--xmloff/source/chart/SchXMLImport.cxx5
-rw-r--r--xmloff/source/chart/SchXMLTableContext.cxx11
-rw-r--r--xmloff/source/chart/SchXMLTools.cxx77
-rw-r--r--xmloff/source/chart/SchXMLTools.hxx5
-rw-r--r--xmloff/source/core/RDFaExportHelper.cxx2
-rw-r--r--xmloff/source/core/xmlexp.cxx1
-rw-r--r--xmloff/source/core/xmlimp.cxx68
-rw-r--r--xmloff/source/core/xmltoken.cxx6
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx131
-rw-r--r--xmloff/source/draw/sdxmlexp_impl.hxx3
-rw-r--r--xmloff/source/draw/shapeexport2.cxx25
-rw-r--r--xmloff/source/draw/shapeexport4.cxx26
-rw-r--r--xmloff/source/draw/ximppage.cxx164
-rw-r--r--xmloff/source/draw/ximppage.hxx4
-rw-r--r--xmloff/source/draw/ximpshap.cxx19
-rw-r--r--xmloff/source/meta/MetaExportComponent.cxx1
-rw-r--r--xmloff/source/meta/xmlmetai.cxx15
-rw-r--r--xmloff/source/style/GradientStyle.cxx2
-rw-r--r--xmloff/source/style/HatchStyle.cxx2
-rw-r--r--xmloff/source/style/TransGradientStyle.cxx2
-rw-r--r--xmloff/source/style/impastp3.cxx40
-rw-r--r--xmloff/source/style/impastp4.cxx41
-rw-r--r--xmloff/source/style/impastpl.hxx8
-rw-r--r--xmloff/source/style/xmlaustp.cxx7
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx141
-rw-r--r--xmloff/source/text/XMLTextFrameContext.hxx3
-rw-r--r--xmloff/source/text/XMLTextMarkImportContext.cxx165
-rw-r--r--xmloff/source/text/XMLTextMarkImportContext.hxx26
-rw-r--r--xmloff/source/text/txtflde.cxx15
-rw-r--r--xmloff/source/text/txtimp.cxx332
-rw-r--r--xmloff/source/text/txtimppr.cxx13
-rw-r--r--xmloff/source/text/txtparae.cxx101
-rw-r--r--xmloff/source/text/txtparai.cxx256
-rw-r--r--xmloff/source/text/txtparaimphint.hxx23
-rw-r--r--xmloff/source/text/txtstyli.cxx24
-rw-r--r--xmloff/util/makefile.mk4
-rw-r--r--xmlscript/source/misc/makefile.mk3
-rw-r--r--xmlscript/source/xml_helper/makefile.mk4
-rw-r--r--xmlscript/source/xmldlg_imexp/makefile.mk4
-rw-r--r--xmlscript/source/xmlflat_imexp/makefile.mk4
-rw-r--r--xmlscript/source/xmllib_imexp/makefile.mk5
-rw-r--r--xmlscript/source/xmlmod_imexp/makefile.mk4
1101 files changed, 34996 insertions, 35129 deletions
diff --git a/avmedia/source/quicktime/makefile.mk b/avmedia/source/quicktime/makefile.mk
index fd472b99f041..a087e8007520 100644
--- a/avmedia/source/quicktime/makefile.mk
+++ b/avmedia/source/quicktime/makefile.mk
@@ -45,7 +45,7 @@ CDEFS+= -DVERBOSE
# --- Files ----------------------------------
-CFLAGSCXX += -x objective-c++ -fobjc-exceptions
+CFLAGSCXX+=$(OBJCXXFLAGS)
SLOFILES= \
$(SLO)$/quicktimeuno.obj \
diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx
index d75a2ada855e..3ec0803eb4a9 100644
--- a/basic/inc/basic/sbstar.hxx
+++ b/basic/inc/basic/sbstar.hxx
@@ -121,6 +121,7 @@ public:
static void Error( SbError );
static void Error( SbError, const String& rMsg );
static void FatalError( SbError );
+ static void FatalError( SbError, const String& rMsg );
static BOOL IsRunning();
static SbError GetErrBasic();
// #66536 make additional message accessible by RTL function Error
diff --git a/basic/prj/build.lst b/basic/prj/build.lst
index ec6bd0e83930..994901580c86 100644
--- a/basic/prj/build.lst
+++ b/basic/prj/build.lst
@@ -1,4 +1,4 @@
-sb basic : l10n offuh svtools sj2 xmlscript framework NULL
+sb basic : l10n offuh svtools xmlscript framework 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
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 3fbcd592e5bb..af056b884826 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -303,6 +303,33 @@ SbxObject* SbTypeFactory::cloneTypeObjectImpl( const SbxObject& rTypeObj )
if( pProp )
{
SbxProperty* pNewProp = new SbxProperty( *pProp );
+ if( pVar->GetType() & SbxARRAY )
+ {
+ SbxBase* pParObj = pVar->GetObject();
+ SbxDimArray* pSource = PTR_CAST(SbxDimArray,pParObj);
+ SbxDimArray* pDest = new SbxDimArray( pVar->GetType() );
+ INT32 lb = 0;
+ INT32 ub = 0;
+
+ pDest->setHasFixedSize( pSource->hasFixedSize() );
+ if ( pSource->GetDims() && pSource->hasFixedSize() )
+ {
+ for ( INT32 j = 1 ; j <= pSource->GetDims(); ++j )
+ {
+ pSource->GetDim32( (INT32)j, lb, ub );
+ pDest->AddDim32( lb, ub );
+ }
+ }
+ else
+ pDest->unoAddDim( 0, -1 ); // variant array
+
+ USHORT nSavFlags = pVar->GetFlags();
+ pNewProp->ResetFlag( SBX_FIXED );
+ // need to reset the FIXED flag
+ // when calling PutObject ( because the type will not match Object )
+ pNewProp->PutObject( pDest );
+ pNewProp->SetFlags( nSavFlags );
+ }
pProps->PutDirect( pNewProp, i );
}
}
@@ -1357,6 +1384,12 @@ void StarBASIC::FatalError( SbError n )
pINST->FatalError( n );
}
+void StarBASIC::FatalError( SbError _errCode, const String& _details )
+{
+ if( pINST )
+ pINST->FatalError( _errCode, _details );
+}
+
SbError StarBASIC::GetErrBasic()
{
if( pINST )
diff --git a/basic/source/classes/sb.src b/basic/source/classes/sb.src
index a17e3bce687c..214831b8da13 100644
--- a/basic/source/classes/sb.src
+++ b/basic/source/classes/sb.src
@@ -341,7 +341,7 @@ Resource RID_BASIC_START
};
String SbERR_NO_METHOD & ERRCODE_RES_MASK
{
- Text [ en-US ] = "Property or method not found." ;
+ Text [ en-US ] = "Property or method not found: $(ARG1)." ;
};
String SbERR_NEEDS_OBJECT & ERRCODE_RES_MASK
{
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index dc6fb6d13cec..a6ae8cac29af 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -68,7 +68,7 @@
#include <com/sun/star/reflection/XIdlArray.hpp>
#include <com/sun/star/reflection/XIdlReflection.hpp>
#include <com/sun/star/reflection/XIdlClassProvider.hpp>
-#include <com/sun/star/reflection/XTypeDescription.hpp>
+#include <com/sun/star/reflection/XServiceConstructorDescription.hpp>
#include <com/sun/star/bridge/oleautomation/NamedArgument.hpp>
#include <com/sun/star/bridge/oleautomation/Date.hpp>
#include <com/sun/star/bridge/oleautomation/Decimal.hpp>
@@ -104,6 +104,8 @@ TYPEINIT1(SbUnoMethod,SbxMethod)
TYPEINIT1(SbUnoProperty,SbxProperty)
TYPEINIT1(SbUnoObject,SbxObject)
TYPEINIT1(SbUnoClass,SbxObject)
+TYPEINIT1(SbUnoService,SbxObject)
+TYPEINIT1(SbUnoServiceCtor,SbxMethod)
typedef WeakImplHelper1< XAllListener > BasicAllListenerHelper;
@@ -748,7 +750,11 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue )
// SbUnoObject instanzieren
String aName;
SbUnoObject* pSbUnoObject = new SbUnoObject( aName, aValue );
- if ( SbiRuntime::isVBAEnabled() )
+ //If this is called externally e.g. from the scripting
+ //framework then there is no 'active' runtime the default property will not be set up
+ //only a vba object will have XDefaultProp set anyway so... this
+ //test seems a bit of overkill
+ //if ( SbiRuntime::isVBAEnabled() )
{
String sDfltPropName;
@@ -2496,35 +2502,7 @@ SbUnoProperty::~SbUnoProperty()
{}
-// #72732 Spezielle SbxVariable, die beim put/get prueft,
-// ob der Kontext fuer eine UnoClass sinnvoll ist. Sonst
-// liegt eventuell ein Schreibfehler im Basic-Source vor.
-BOOL UnoClassMemberVariable::Get( SbxValues& rRes ) const
-{
- // Zugriff auf den Member einer UnoClass mit Parametern ist unsinnig
- if( GetParameters() )
- {
- if( mpRuntime )
- mpRuntime->Error( SbERR_NO_METHOD );
- }
- return SbxVariable::Get( rRes );
-}
-
-BOOL UnoClassMemberVariable::Put( const SbxValues& rRes )
-{
- if( bInternalUse )
- {
- return SbxVariable::Put( rRes );
- }
- // Schreibzugriff auf den Member einer UnoClass ist immer falsch
- mpRuntime->Error( SbERR_NO_METHOD );
- return FALSE;
-}
-
-TYPEINIT1(UnoClassMemberVariable,SbxVariable)
-
-
-SbxVariable* SbUnoObject::Find( const XubString& rName, SbxClassType t )
+SbxVariable* SbUnoObject::Find( const String& rName, SbxClassType t )
{
static Reference< XIdlMethod > xDummyMethod;
static Property aDummyProp;
@@ -3201,16 +3179,16 @@ SbxVariable* getVBAConstant( const String& rName )
// Funktion, um einen globalen Bezeichner im
// UnoScope zu suchen und fuer Sbx zu wrappen
-SbxVariable* findUnoClass( const String& rName )
+SbUnoClass* findUnoClass( const String& rName )
{
// #105550 Check if module exists
SbUnoClass* pUnoClass = NULL;
Reference< XHierarchicalNameAccess > xTypeAccess = getTypeProvider_Impl();
- Reference< XTypeDescription > xTypeDesc;
if( xTypeAccess->hasByHierarchicalName( rName ) )
{
Any aRet = xTypeAccess->getByHierarchicalName( rName );
+ Reference< XTypeDescription > xTypeDesc;
aRet >>= xTypeDesc;
if( xTypeDesc.is() )
@@ -3287,7 +3265,6 @@ SbxVariable* SbUnoClass::Find( const XubString& rName, SbxClassType t )
pRes = new SbxVariable( SbxVARIANT );
SbxObjectRef xWrapper = (SbxObject*)new SbUnoClass( aNewName, xClass );
pRes->PutObject( xWrapper );
-
}
}
else
@@ -3305,15 +3282,26 @@ SbxVariable* SbUnoClass::Find( const XubString& rName, SbxClassType t )
// Sonst wieder als Klasse annehmen
if( !pRes )
{
- SbxVariable* pNewClass = findUnoClass( aNewName );
+ SbUnoClass* pNewClass = findUnoClass( aNewName );
if( pNewClass )
{
- Reference< XIdlClass > xClass;
pRes = new SbxVariable( SbxVARIANT );
SbxObjectRef xWrapper = (SbxObject*)pNewClass;
pRes->PutObject( xWrapper );
}
}
+
+ // An UNO service?
+ if( !pRes )
+ {
+ SbUnoService* pUnoService = findUnoService( aNewName );
+ if( pUnoService )
+ {
+ pRes = new SbxVariable( SbxVARIANT );
+ SbxObjectRef xWrapper = (SbxObject*)pUnoService;
+ pRes->PutObject( xWrapper );
+ }
+ }
}
}
@@ -3334,6 +3322,266 @@ SbxVariable* SbUnoClass::Find( const XubString& rName, SbxClassType t )
}
+SbUnoService* findUnoService( const String& rName )
+{
+ SbUnoService* pSbUnoService = NULL;
+
+ Reference< XHierarchicalNameAccess > xTypeAccess = getTypeProvider_Impl();
+ if( xTypeAccess->hasByHierarchicalName( rName ) )
+ {
+ Any aRet = xTypeAccess->getByHierarchicalName( rName );
+ Reference< XTypeDescription > xTypeDesc;
+ aRet >>= xTypeDesc;
+
+ if( xTypeDesc.is() )
+ {
+ TypeClass eTypeClass = xTypeDesc->getTypeClass();
+ if( eTypeClass == TypeClass_SERVICE )
+ {
+ Reference< XServiceTypeDescription2 > xServiceTypeDesc( xTypeDesc, UNO_QUERY );
+ if( xServiceTypeDesc.is() )
+ pSbUnoService = new SbUnoService( rName, xServiceTypeDesc );
+ }
+ }
+ }
+ return pSbUnoService;
+}
+
+SbxVariable* SbUnoService::Find( const String& rName, SbxClassType )
+{
+ SbxVariable* pRes = SbxObject::Find( rName, SbxCLASS_METHOD );
+
+ if( !pRes )
+ {
+ // Wenn es schon eine Klasse ist, nach einen Feld fragen
+ if( m_bNeedsInit && m_xServiceTypeDesc.is() )
+ {
+ m_bNeedsInit = false;
+
+ Sequence< Reference< XServiceConstructorDescription > > aSCDSeq = m_xServiceTypeDesc->getConstructors();
+ const Reference< XServiceConstructorDescription >* pCtorSeq = aSCDSeq.getConstArray();
+ int nCtorCount = aSCDSeq.getLength();
+ for( int i = 0 ; i < nCtorCount ; ++i )
+ {
+ Reference< XServiceConstructorDescription > xCtor = pCtorSeq[i];
+
+ String aName( xCtor->getName() );
+ if( !aName.Len() )
+ {
+ if( xCtor->isDefaultConstructor() )
+ aName = String::CreateFromAscii( "create" );
+ }
+
+ if( aName.Len() )
+ {
+ // Create and insert SbUnoServiceCtor
+ SbxVariableRef xSbCtorRef = new SbUnoServiceCtor( aName, xCtor );
+ QuickInsert( (SbxVariable*)xSbCtorRef );
+ pRes = xSbCtorRef;
+ }
+ }
+ }
+ }
+
+ return pRes;
+}
+
+void SbUnoService::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType )
+{
+ const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ if( pHint )
+ {
+ SbxVariable* pVar = pHint->GetVar();
+ SbxArray* pParams = pVar->GetParameters();
+ SbUnoServiceCtor* pUnoCtor = PTR_CAST(SbUnoServiceCtor,pVar);
+ if( pUnoCtor && pHint->GetId() == SBX_HINT_DATAWANTED )
+ {
+ // Parameter count -1 because of Param0 == this
+ UINT32 nParamCount = pParams ? ((UINT32)pParams->Count() - 1) : 0;
+ Sequence<Any> args;
+ BOOL bOutParams = FALSE;
+
+ Reference< XServiceConstructorDescription > xCtor = pUnoCtor->getServiceCtorDesc();
+ Sequence< Reference< XParameter > > aParameterSeq = xCtor->getParameters();
+ const Reference< XParameter >* pParameterSeq = aParameterSeq.getConstArray();
+ UINT32 nUnoParamCount = aParameterSeq.getLength();
+
+ // Default: Ignore not needed parameters
+ bool bParameterError = false;
+
+ // Is the last parameter a rest parameter?
+ bool bRestParameterMode = false;
+ if( nUnoParamCount > 0 )
+ {
+ Reference< XParameter > xLastParam = pParameterSeq[ nUnoParamCount - 1 ];
+ if( xLastParam.is() )
+ {
+ if( xLastParam->isRestParameter() )
+ bRestParameterMode = true;
+ }
+ }
+
+ // Too many parameters with context as first parameter?
+ USHORT nSbxParameterOffset = 1;
+ USHORT nParameterOffsetByContext = 0;
+ Reference < XComponentContext > xFirstParamContext;
+ if( nParamCount > nUnoParamCount )
+ {
+ // Check if first parameter is a context and use it
+ // then in createInstanceWithArgumentsAndContext
+ Any aArg0 = sbxToUnoValue( pParams->Get( nSbxParameterOffset ) );
+ if( (aArg0 >>= xFirstParamContext) && xFirstParamContext.is() )
+ nParameterOffsetByContext = 1;
+ }
+
+ UINT32 nEffectiveParamCount = nParamCount - nParameterOffsetByContext;
+ UINT32 nAllocParamCount = nEffectiveParamCount;
+ if( nEffectiveParamCount > nUnoParamCount )
+ {
+ if( !bRestParameterMode )
+ {
+ nEffectiveParamCount = nUnoParamCount;
+ nAllocParamCount = nUnoParamCount;
+ }
+ }
+ // Not enough parameters?
+ else if( nUnoParamCount > nEffectiveParamCount )
+ {
+ // RestParameterMode only helps if one (the last) parameter is missing
+ int nDiff = nUnoParamCount - nEffectiveParamCount;
+ if( !bRestParameterMode || nDiff > 1 )
+ {
+ bParameterError = true;
+ StarBASIC::Error( SbERR_NOT_OPTIONAL );
+ }
+ }
+
+ if( !bParameterError )
+ {
+ if( nAllocParamCount > 0 )
+ {
+ args.realloc( nAllocParamCount );
+ Any* pAnyArgs = args.getArray();
+ for( UINT32 i = 0 ; i < nEffectiveParamCount ; i++ )
+ {
+ USHORT iSbx = (USHORT)(i + nSbxParameterOffset + nParameterOffsetByContext);
+
+ // bRestParameterMode allows nEffectiveParamCount > nUnoParamCount
+ Reference< XParameter > xParam;
+ if( i < nUnoParamCount )
+ {
+ xParam = pParameterSeq[i];
+ if( !xParam.is() )
+ continue;
+
+ Reference< XTypeDescription > xParamTypeDesc = xParam->getType();
+ if( !xParamTypeDesc.is() )
+ continue;
+ com::sun::star::uno::Type aType( xParamTypeDesc->getTypeClass(), xParamTypeDesc->getName() );
+
+ // sbx paramter needs offset 1
+ pAnyArgs[i] = sbxToUnoValue( pParams->Get( iSbx ), aType );
+
+ // Check for out parameter if not already done
+ if( !bOutParams )
+ {
+ if( xParam->isOut() )
+ bOutParams = TRUE;
+ }
+ }
+ else
+ {
+ pAnyArgs[i] = sbxToUnoValue( pParams->Get( iSbx ) );
+ }
+ }
+ }
+
+ // "Call" ctor using createInstanceWithArgumentsAndContext
+ Reference < XComponentContext > xContext;
+ if( xFirstParamContext.is() )
+ {
+ xContext = xFirstParamContext;
+ }
+ else
+ {
+ Reference < XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
+ xContext.set( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" )) ), UNO_QUERY_THROW );
+ }
+ Reference< XMultiComponentFactory > xServiceMgr( xContext->getServiceManager() );
+
+ Any aRetAny;
+ if( xServiceMgr.is() )
+ {
+ String aServiceName = GetName();
+ Reference < XInterface > xRet;
+ try
+ {
+ xRet = xServiceMgr->createInstanceWithArgumentsAndContext( aServiceName, args, xContext );
+ }
+ catch( const Exception& )
+ {
+ implHandleAnyException( ::cppu::getCaughtException() );
+ }
+ aRetAny <<= xRet;
+ }
+ unoToSbxValue( pVar, aRetAny );
+
+ // Copy back out parameters?
+ if( bOutParams )
+ {
+ const Any* pAnyArgs = args.getConstArray();
+
+ for( UINT32 j = 0 ; j < nUnoParamCount ; j++ )
+ {
+ Reference< XParameter > xParam = pParameterSeq[j];
+ if( !xParam.is() )
+ continue;
+
+ if( xParam->isOut() )
+ unoToSbxValue( (SbxVariable*)pParams->Get( (USHORT)(j+1) ), pAnyArgs[ j ] );
+ }
+ }
+ }
+ }
+ else
+ SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType );
+ }
+}
+
+
+
+static SbUnoServiceCtor* pFirstCtor = NULL;
+
+void clearUnoServiceCtors( void )
+{
+ SbUnoServiceCtor* pCtor = pFirstCtor;
+ while( pCtor )
+ {
+ pCtor->SbxValue::Clear();
+ pCtor = pCtor->pNext;
+ }
+}
+
+SbUnoServiceCtor::SbUnoServiceCtor( const String& aName_, Reference< XServiceConstructorDescription > xServiceCtorDesc )
+ : SbxMethod( aName_, SbxOBJECT )
+ , m_xServiceCtorDesc( xServiceCtorDesc )
+{
+}
+
+SbUnoServiceCtor::~SbUnoServiceCtor()
+{
+}
+
+SbxInfo* SbUnoServiceCtor::GetInfo()
+{
+ SbxInfo* pRet = NULL;
+
+ return pRet;
+}
+
+
+
//========================================================================
//========================================================================
//========================================================================
@@ -3703,7 +3951,6 @@ void RTL_Impl_GetDefaultContext( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite
//========================================================================
// Creates a Basic wrapper object for a strongly typed Uno value
// 1. parameter: Uno type as full qualified type name, e.g. "byte[]"
-// void RTL_Impl_GetDefaultContext( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite )
void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite )
{
(void)pBasic;
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index a534209b0cfa..2a61557457b7 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -531,6 +531,7 @@ void ClearUnoObjectsInRTL_Impl( StarBASIC* pBasic )
{
// #67781 Rueckgabewerte der Uno-Methoden loeschen
clearUnoMethods();
+ clearUnoServiceCtors();
ClearUnoObjectsInRTL_Impl_Rek( pBasic );
diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx
index d242071784b6..54e98f401594 100644
--- a/basic/source/comp/dim.cxx
+++ b/basic/source/comp/dim.cxx
@@ -212,7 +212,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 == STATIC || eCurTok == ENUM || eCurTok == DECLARE) )
{
// Next token is read here, because !bConst
bool bPrivate = ( eFirstTok == PRIVATE );
@@ -241,6 +241,12 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic )
DefEnum( bPrivate );
return;
}
+ else if( eCurTok == DECLARE )
+ {
+ Next();
+ DefDeclare( bPrivate );
+ return;
+ }
}
#ifdef SHARED
@@ -546,7 +552,7 @@ void SbiParser::DefType( BOOL bPrivate )
SbxObject *pType = new SbxObject(aSym);
SbiSymDef* pElem;
- SbiDimList* pDim;
+ SbiDimList* pDim = NULL;
BOOL bDone = FALSE;
while( !bDone && !IsEof() )
@@ -570,13 +576,6 @@ void SbiParser::DefType( BOOL bPrivate )
pElem = VarDecl(&pDim,FALSE,FALSE);
if( !pElem )
bDone = TRUE; // Error occured
- if( pDim )
- {
- // HOT FIX, to be updated
- delete pDim;
- Error( SbERR_NO_STRINGS_ARRAYS );
- }
-
}
if( pElem )
{
@@ -586,6 +585,43 @@ void SbiParser::DefType( BOOL bPrivate )
else
{
SbxProperty *pTypeElem = new SbxProperty (pElem->GetName(),pElem->GetType());
+ if( pDim )
+ {
+ SbxDimArray* pArray = new SbxDimArray( pElem->GetType() );
+ if ( pDim->GetSize() )
+ {
+ // Dimension the target array
+
+ for ( short i=0; i<pDim->GetSize();++i )
+ {
+ INT32 ub = -1;
+ INT32 lb = nBase;
+ SbiExprNode* pNode = pDim->Get(i)->GetExprNode();
+ ub = pNode->GetNumber();
+ if ( !pDim->Get( i )->IsBased() ) // each dim is low/up
+ {
+ if ( ++i >= pDim->GetSize() ) // trouble
+ StarBASIC::FatalError( SbERR_INTERNAL_ERROR );
+ pNode = pDim->Get(i)->GetExprNode();
+ lb = ub;
+ ub = pNode->GetNumber();
+ }
+ else if ( !bCompatible )
+ ub += nBase;
+ pArray->AddDim32( lb, ub );
+ }
+ pArray->setHasFixedSize( true );
+ }
+ else
+ pArray->unoAddDim( 0, -1 ); // variant array
+ USHORT nSavFlags = pTypeElem->GetFlags();
+ // need to reset the FIXED flag
+ // when calling PutObject ( because the type will not match Object )
+ pTypeElem->ResetFlag( SBX_FIXED );
+ pTypeElem->PutObject( pArray );
+ pTypeElem->SetFlags( nSavFlags );
+ }
+ delete pDim;
pTypeMembers->Insert( pTypeElem, pTypeMembers->Count() );
}
delete pElem;
@@ -872,6 +908,11 @@ SbiProcDef* SbiParser::ProcDecl( BOOL bDecl )
void SbiParser::Declare()
{
+ DefDeclare( FALSE );
+}
+
+void SbiParser::DefDeclare( BOOL bPrivate )
+{
Next();
if( eCurTok != SUB && eCurTok != FUNCTION )
Error( SbERR_UNEXPECTED, eCurTok );
@@ -892,12 +933,16 @@ void SbiParser::Declare()
// Als Variable deklariert
Error( SbERR_BAD_DECLARATION, pDef->GetName() );
delete pDef;
+ pDef = NULL;
}
else
pDef->Match( p );
}
else
aPublics.Add( pDef );
+
+ if ( pDef )
+ pDef->SetPublic( !bPrivate );
}
}
}
diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx
index e69551f364e5..701ecdd7bc16 100644
--- a/basic/source/comp/exprtree.cxx
+++ b/basic/source/comp/exprtree.cxx
@@ -701,12 +701,6 @@ SbiExprNode* SbiExpression::Comp()
pNd = new SbiExprNode( pParser, pNd, eTok, Cat() );
nCount++;
}
- // Mehrere Operatoren hintereinander gehen nicht
- if( nCount > 1 )
- {
- pParser->Error( SbERR_SYNTAX );
- bError = TRUE;
- }
}
return pNd;
}
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index 9cde971228d9..2cc496f9cb02 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -479,7 +479,17 @@ PrevLineCommentLbl:
eoln:
if( nCol && *--pLine == '_' )
{
- pLine = NULL; return NextSym();
+ pLine = NULL;
+ bool bRes = NextSym();
+ if( bVBASupportOn && aSym.GetBuffer()[0] == '.' )
+ {
+ // object _
+ // .Method
+ // ^^^ <- spaces is legal in MSO VBA
+ OSL_TRACE("*** resetting bSpaces***");
+ bSpaces = FALSE;
+ }
+ return bRes;
}
else
{
diff --git a/basic/source/inc/expr.hxx b/basic/source/inc/expr.hxx
index 319af5cbfbc5..b66006cb639a 100644
--- a/basic/source/inc/expr.hxx
+++ b/basic/source/inc/expr.hxx
@@ -144,6 +144,7 @@ public:
SbiExprNode* GetRealNode(); // letzter Knoten in x.y.z
short GetDepth(); // Tiefe eines Baumes berechnen
const String& GetString() { return aStrVal; }
+ short GetNumber() { return (short)nVal; }
SbiExprList* GetParameters() { return aVar.pPar; }
SbiExprListVector* GetMoreParameters() { return aVar.pvMorePar; }
diff --git a/basic/source/inc/parser.hxx b/basic/source/inc/parser.hxx
index 5f2ef47080c3..379ae962834b 100644
--- a/basic/source/inc/parser.hxx
+++ b/basic/source/inc/parser.hxx
@@ -66,6 +66,7 @@ class SbiParser : public SbiTokenizer
void StmntBlock( SbiToken ); // Statement-Block abarbeiten
void DefType( BOOL bPrivate ); // Parse type declaration
void DefEnum( BOOL bPrivate ); // Parse enum declaration
+ void DefDeclare( BOOL bPrivate );
void EnableCompatibility();
public:
SbxArrayRef rTypeArray; // das Type-Array
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx
index f9629445aa9e..31f99fb93169 100644
--- a/basic/source/inc/runtime.hxx
+++ b/basic/source/inc/runtime.hxx
@@ -220,10 +220,11 @@ public:
SbiInstance( StarBASIC* );
~SbiInstance();
- void Error( SbError ); // trappable Error
+ void Error( SbError ); // trappable Error
void Error( SbError, const String& rMsg ); // trappable Error mit Message
- void FatalError( SbError ); // non-trappable Error
- void Abort(); // Abbruch mit aktuellem Fehlercode
+ void FatalError( SbError ); // non-trappable Error
+ void FatalError( SbError, const String& ); // non-trappable Error
+ void Abort(); // Abbruch mit aktuellem Fehlercode
void Stop();
SbError GetErr() { return nErr; }
@@ -270,30 +271,6 @@ struct RefSaveItem
};
-// #72732 Spezielle SbxVariable, die beim put/get prueft,
-// ob der Kontext fuer eine UnoClass sinnvoll ist. Sonst
-// liegt eventuell ein Schreibfehler im Basic-Source vor.
-class UnoClassMemberVariable : public SbxVariable
-{
- SbiRuntime* mpRuntime;
- BOOL bInternalUse;
-
-public:
- UnoClassMemberVariable( SbiRuntime* pRuntime_, const SbxObjectRef& xWrapper )
- : SbxVariable( SbxVARIANT ), mpRuntime( pRuntime_ )
- {
- bInternalUse = TRUE;
- PutObject( xWrapper );
- bInternalUse = FALSE;
- }
-
- virtual BOOL Get( SbxValues& ) const;
- virtual BOOL Put( const SbxValues& );
-
- TYPEINFO();
-};
-
-
// Eine Instanz dieser Klasse wird fuer jedes ausgefuehrte Unterprogramm
// aufgesetzt. Diese Instanz ist das Herz der BASIC-Maschine und enthaelt
// nur lokale Daten.
@@ -467,8 +444,10 @@ public:
SbiRuntime( SbModule*, SbMethod*, UINT32 );
~SbiRuntime();
- void Error( SbError ); // Fehler setzen, falls != 0
- void FatalError( SbError ); // Fehlerbehandlung=Standard, Fehler setzen
+ void Error( SbError ); // 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
void DumpPCode();
BOOL Step(); // Einzelschritt (ein Opcode)
void Stop() { bRun = FALSE; }
diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx
index ee7ac2176e41..6889aa196c54 100644
--- a/basic/source/inc/sbunoobj.hxx
+++ b/basic/source/inc/sbunoobj.hxx
@@ -43,6 +43,7 @@
#include <com/sun/star/beans/XIntrospection.hpp>
#include <com/sun/star/script/XInvocation.hpp>
#include <com/sun/star/reflection/XIdlClass.hpp>
+#include <com/sun/star/reflection/XServiceTypeDescription2.hpp>
#include <rtl/ustring.hxx>
class SbUnoObject: public SbxObject
@@ -149,7 +150,7 @@ public:
};
// Wrapper fuer eine Uno-Klasse
-class SbUnoClass: public SbxObject
+class SbUnoClass : public SbxObject
{
const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > m_xClass;
@@ -177,7 +178,55 @@ SV_DECL_IMPL_REF(SbUnoClass);
// Funktion, um einen globalen Bezeichner im
// UnoScope zu suchen und fuer Sbx zu wrappen
-SbxVariable* findUnoClass( const String& rName );
+SbUnoClass* findUnoClass( const String& rName );
+
+
+// Wrapper for UNO Service
+class SbUnoService : public SbxObject
+{
+ const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceTypeDescription2 > m_xServiceTypeDesc;
+ bool m_bNeedsInit;
+
+public:
+ TYPEINFO();
+ SbUnoService( const String& aName_,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceTypeDescription2 >& xServiceTypeDesc )
+ : SbxObject( aName_ )
+ , m_xServiceTypeDesc( xServiceTypeDesc )
+ , m_bNeedsInit( true )
+ {}
+
+ virtual SbxVariable* Find( const String&, SbxClassType );
+
+ void SFX_NOTIFY( SfxBroadcaster&, const TypeId&, const SfxHint& rHint, const TypeId& );
+};
+SV_DECL_IMPL_REF(SbUnoService);
+
+SbUnoService* findUnoService( const String& rName );
+
+
+void clearUnoServiceCtors( void );
+
+class SbUnoServiceCtor : public SbxMethod
+{
+ friend class SbUnoService;
+ friend void clearUnoServiceCtors( void );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceConstructorDescription > m_xServiceCtorDesc;
+
+ SbUnoServiceCtor* pPrev;
+ SbUnoServiceCtor* pNext;
+
+public:
+ TYPEINFO();
+
+ SbUnoServiceCtor( const String& aName_, ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceConstructorDescription > xServiceCtorDesc );
+ virtual ~SbUnoServiceCtor();
+ virtual SbxInfo* GetInfo();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceConstructorDescription > getServiceCtorDesc( void )
+ { return m_xServiceCtorDesc; }
+};
// #105565 Special Object to wrap a strongly typed Uno Any
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 2c9c22f7f44a..dbd66a61575c 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -662,12 +662,15 @@ RTLFUNC(Array)
}
// Parameter ins Array uebernehmen
- for( short i = 0 ; i < nArraySize ; i++ )
+ // ATTENTION: Using type USHORT for loop variable is
+ // mandatory to workaround a problem with the
+ // Solaris Intel compiler optimizer! See i104354
+ for( USHORT i = 0 ; i < nArraySize ; i++ )
{
SbxVariable* pVar = rPar.Get(i+1);
SbxVariable* pNew = new SbxVariable( *pVar );
pNew->SetFlag( SBX_WRITE );
- short index = i;
+ short index = static_cast< short >(i);
if ( bIncIndex )
++index;
pArray->Put( pNew, &index );
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index d81cebe60fc6..cc276eea766b 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -430,6 +430,11 @@ void SbiInstance::FatalError( SbError n )
pRun->FatalError( n );
}
+void SbiInstance::FatalError( SbError _errCode, const String& _details )
+{
+ pRun->FatalError( _errCode, _details );
+}
+
void SbiInstance::Abort()
{
// Basic suchen, in dem der Fehler auftrat
@@ -721,7 +726,7 @@ BOOL SbiRuntime::Step()
pCode = pError;
else
bLetParentHandleThis = true;
- }
+ }
else
{
bLetParentHandleThis = true;
@@ -795,12 +800,35 @@ void SbiRuntime::Error( SbError n )
nError = n;
}
+void SbiRuntime::Error( SbError _errCode, const String& _details )
+{
+ if ( _errCode )
+ {
+ OSL_ENSURE( pInst->pRun == this, "SbiRuntime::Error: can't propagate the error message details!" );
+ if ( pInst->pRun == this )
+ {
+ pInst->Error( _errCode, _details );
+ OSL_POSTCOND( nError == _errCode, "SbiRuntime::Error: the instance is expecte to propagate the error code back to me!" );
+ }
+ else
+ {
+ nError = _errCode;
+ }
+ }
+}
+
void SbiRuntime::FatalError( SbError n )
{
StepSTDERROR();
Error( n );
}
+void SbiRuntime::FatalError( SbError _errCode, const String& _details )
+{
+ StepSTDERROR();
+ Error( _errCode, _details );
+}
+
//////////////////////////////////////////////////////////////////////////
//
// Parameter, Locals, Caller
@@ -859,21 +887,13 @@ SbxVariableRef SbiRuntime::PopVar()
BOOL SbiRuntime::ClearExprStack()
{
- // #74732 Hier kann ein Fehler gesetzt werden
- BOOL bErrorSet = FALSE;
-
// Achtung: Clear() reicht nicht, da Methods geloescht werden muessen
while ( nExprLvl )
{
- SbxVariableRef xVar = PopVar();
- if( !nError && xVar->ISA( UnoClassMemberVariable ) )
- {
- Error( SbERR_NO_METHOD );
- bErrorSet = TRUE;
- }
+ PopVar();
}
refExprStk->Clear();
- return bErrorSet;
+ return FALSE;
}
// Variable auf dem Expression-Stack holen, ohne sie zu entfernen
diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx
index 2a7c69b16323..413d3a6f4def 100644
--- a/basic/source/runtime/step2.cxx
+++ b/basic/source/runtime/step2.cxx
@@ -199,7 +199,7 @@ SbxVariable* SbiRuntime::FindElement
}
// #72382 VORSICHT! Liefert jetzt wegen unbekannten
// Modulen IMMER ein Ergebnis!
- SbxVariable* pUnoClass = findUnoClass( aName );
+ SbUnoClass* pUnoClass = findUnoClass( aName );
if( pUnoClass )
{
pElem = new SbxVariable( t );
@@ -255,7 +255,7 @@ SbxVariable* SbiRuntime::FindElement
ClearArgvStack();
// Normalen Error setzen
- Error( nNotFound );
+ Error( nNotFound, aName );
}
else
{
@@ -832,6 +832,7 @@ void SbiRuntime::StepSTMNT( UINT32 nOp1, UINT32 nOp2 )
// Wenn der Expr-Stack am Anfang einen Statements eine Variable enthaelt,
// hat ein Trottel X als Funktion aufgerufen, obwohl es eine Variable ist!
BOOL bFatalExpr = FALSE;
+ String sUnknownMethodName;
if( nExprLvl > 1 )
bFatalExpr = TRUE;
else if( nExprLvl )
@@ -839,7 +840,10 @@ void SbiRuntime::StepSTMNT( UINT32 nOp1, UINT32 nOp2 )
SbxVariable* p = refExprStk->Get( 0 );
if( p->GetRefCount() > 1
&& refLocals.Is() && refLocals->Find( p->GetName(), p->GetClass() ) )
+ {
+ sUnknownMethodName = p->GetName();
bFatalExpr = TRUE;
+ }
}
// Der Expr-Stack ist nun nicht mehr notwendig
ClearExprStack();
@@ -854,7 +858,7 @@ void SbiRuntime::StepSTMNT( UINT32 nOp1, UINT32 nOp2 )
// stimmen!
if( bFatalExpr)
{
- StarBASIC::FatalError( SbERR_NO_METHOD );
+ StarBASIC::FatalError( SbERR_NO_METHOD, sUnknownMethodName );
return;
}
pStmnt = pCode - 9;
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index b0fa4ea1822f..ca21908ece78 100644
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -1470,7 +1470,7 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const
bRes = TRUE;
}
else if( GetType() == SbxEMPTY && rOp.GetType() == SbxEMPTY )
- bRes = TRUE;
+ bRes = !bVBAInterop ? TRUE : ( eOp == SbxEQ ? TRUE : FALSE );
// Sonderregel 1: Ist ein Operand Null, ist das Ergebnis FALSE
else if( GetType() == SbxNULL || rOp.GetType() == SbxNULL )
bRes = FALSE;
@@ -1572,7 +1572,10 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const
else
{
aL.eType = aR.eType = SbxDOUBLE;
- if( Get( aL ) && rOp.Get( aR ) )
+ //if( Get( aL ) && rOp.Get( aR ) )
+ bool bGetL = Get( aL );
+ bool bGetR = rOp.Get( aR );
+ if( bGetL && bGetR )
switch( eOp )
{
case SbxEQ:
@@ -1590,6 +1593,17 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const
default:
SetError( SbxERR_NOTIMP );
}
+ // at least one value was got
+ // if this is VBA then a conversion error for one
+ // side will yield a false result of an equality test
+ else if ( bGetR || bGetL )
+ {
+ if ( bVBAInterop && eOp == SbxEQ && GetError() == SbxERR_CONVERSION )
+ {
+ ResetError();
+ bRes = FALSE;
+ }
+ }
}
}
if( eOld != SbxERR_OK )
diff --git a/configmgr/source/backendhelper/makefile.mk b/configmgr/source/backendhelper/makefile.mk
index 44b502b451b4..f9a27c8167b0 100644
--- a/configmgr/source/backendhelper/makefile.mk
+++ b/configmgr/source/backendhelper/makefile.mk
@@ -39,6 +39,7 @@ ENABLE_EXCEPTIONS=TRUE
# --- Settings ---
.INCLUDE : settings.mk
+.IF "$(L10N_framework)"==""
.INCLUDE : $(PRJ)$/makefile.pmk
DLLPRE =
@@ -66,6 +67,7 @@ DEF1EXPORTFILE=exports.dxp
DEF1DES=Configuration: Backend Helper
# --- Targets ---
+.ENDIF # L10N_framework
.INCLUDE : target.mk
diff --git a/configmgr/source/inc/bootstrap.hxx b/configmgr/source/inc/bootstrap.hxx
index 5ffb2cb97756..5a9ade491ee7 100644
--- a/configmgr/source/inc/bootstrap.hxx
+++ b/configmgr/source/inc/bootstrap.hxx
@@ -34,7 +34,6 @@
#include "bootstrapcontext.hxx"
// ---------------------------------------------------------------------------------------
-#define CONFIGMGR_INIFILE SAL_CONFIGFILE("configmgr")
#define BOOTSTRAP_ITEM_INIFILE "CFG_INIFILE"
// ---------------------------------------------------------------------------------------
// standard settings
diff --git a/configmgr/source/misc/bootstrap.cxx b/configmgr/source/misc/bootstrap.cxx
index 809d992c5ec4..4e747153d32c 100644
--- a/configmgr/source/misc/bootstrap.cxx
+++ b/configmgr/source/misc/bootstrap.cxx
@@ -47,7 +47,6 @@
#include <rtl/ustrbuf.hxx>
#include <osl/file.hxx>
#include <osl/process.h>
-#include <osl/module.hxx>
#include <osl/diagnose.h>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/configuration/MissingBootstrapFileException.hpp>
@@ -238,27 +237,15 @@ void BootstrapContext::initialize()
ComponentContext::initialize(sURL);
}
-// ---------------------------------------------------------------------------
-
-static rtl::OUString getCurrentModuleDirectory() // URL including terminating slash
-{
- rtl::OUString aFileURL;
- if ( !osl::Module::getUrlFromAddress(reinterpret_cast< oslGenericFunction >( &getCurrentModuleDirectory ),aFileURL) )
- {
- OSL_TRACE(false, "Cannot locate current module - using executable instead");
-
- OSL_VERIFY(osl_Process_E_None == osl_getExecutableFile(&aFileURL.pData));
- }
-
- OSL_ENSURE(0 < aFileURL.lastIndexOf('/'), "Cannot find directory for module URL");
-
- return aFileURL.copy(0, aFileURL.lastIndexOf('/') + 1);
-}
// ---------------------------------------------------------------------------------------
rtl::OUString BootstrapContext::getDefaultConfigurationBootstrapURL()
{
- return getCurrentModuleDirectory() + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CONFIGMGR_INIFILE));
+ rtl::OUString url(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "$OOO_BASE_DIR/program/" SAL_CONFIGFILE("configmgr")));
+ rtl::Bootstrap::expandMacros(url); //TODO: detect failure
+ return url;
}
// ---------------------------------------------------------------------------------------
diff --git a/configmgr/source/platformbe/makefile.mk b/configmgr/source/platformbe/makefile.mk
index 19796b2442c2..9cbe53f5cf7d 100644
--- a/configmgr/source/platformbe/makefile.mk
+++ b/configmgr/source/platformbe/makefile.mk
@@ -42,6 +42,7 @@ SYSMGR_MAJOR=1
# --- Settings ---
.INCLUDE : settings.mk
+.IF "$(L10N_framework)"==""
.INCLUDE : $(PRJ)$/makefile.pmk
DLLPRE =
@@ -69,6 +70,7 @@ DEF1EXPORTFILE=exports.dxp
DEF1DES=Configuration: System Integration Manager
# --- Targets ---
+.ENDIF # L10N_framework
.INCLUDE : target.mk
diff --git a/configmgr/source/tree/localizedtreeactions.cxx b/configmgr/source/tree/localizedtreeactions.cxx
index 8cd40c4da79f..b2ed23a730b3 100644
--- a/configmgr/source/tree/localizedtreeactions.cxx
+++ b/configmgr/source/tree/localizedtreeactions.cxx
@@ -178,8 +178,11 @@ namespace
// -- -----------------------------
OSL_ENSURE( aValueType != uno::Type(), "VOID result type found");
- OSL_ENSURE( aValueType == parseTemplateName(_aSubtree.getElementTemplateName()),
+#if OSL_DEBUG_LEVEL > 0
+ uno::Type aTemplateType = parseTemplateName( _aSubtree.getElementTemplateName() );
+ OSL_ENSURE( ( aValueType == aTemplateType ) || ( aTemplateType.getTypeClass() == uno::TypeClass_ANY ),
"ERROR: Found Value Type doesn't match encoded value type in pseudo template name");
+#endif
OSL_POSTCOND( static_cast<ValueNode&>(*pResult).getValueType() == aValueType,
"ERROR: Resulting Value Type doesn't match original value type" );
diff --git a/configmgr/util/makefile.mk b/configmgr/util/makefile.mk
index 6fd7c63195a4..eaea5d343503 100644
--- a/configmgr/util/makefile.mk
+++ b/configmgr/util/makefile.mk
@@ -36,6 +36,7 @@ TARGET=configmgr
ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
+.IF "$(L10N_framework)"==""
.INCLUDE : $(PRJ)$/makefile.pmk
.INCLUDE : $(PRJ)$/version.mk
DLLPRE =
@@ -75,6 +76,7 @@ DEF1NAME= $(SHL1TARGET)
DEF1EXPORTFILE= exports.dxp
# --- Targets ----------------------------------
+.ENDIF # L10N_framework
.INCLUDE : target.mk
diff --git a/connectivity/inc/connectivity/DriversConfig.hxx b/connectivity/inc/connectivity/DriversConfig.hxx
index 8a33019d57ed..bd86e9ce4397 100755
--- a/connectivity/inc/connectivity/DriversConfig.hxx
+++ b/connectivity/inc/connectivity/DriversConfig.hxx
@@ -73,6 +73,10 @@ namespace connectivity
const ::comphelper::NamedValueCollection& impl_get(const ::rtl::OUString& _sURL,sal_Int32 _nProps) const;
public:
DriversConfig(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
+ ~DriversConfig();
+
+ DriversConfig( const DriversConfig& );
+ DriversConfig& operator=( const DriversConfig& );
::rtl::OUString getDriverFactoryName(const ::rtl::OUString& _sUrl) const;
::rtl::OUString getDriverTypeDisplayName(const ::rtl::OUString& _sUrl) const;
diff --git a/connectivity/inc/connectivity/TTableHelper.hxx b/connectivity/inc/connectivity/TTableHelper.hxx
index f09a1211d7dd..d1c2cd331ada 100644
--- a/connectivity/inc/connectivity/TTableHelper.hxx
+++ b/connectivity/inc/connectivity/TTableHelper.hxx
@@ -39,17 +39,50 @@
namespace connectivity
{
+ typedef sal_Int32 OrdinalPosition;
+ struct ColumnDesc
+ {
+ ::rtl::OUString sName;
+ ::rtl::OUString aField6;
+ ::rtl::OUString sField13;
+ sal_Int32 nField5
+ , nField7
+ , nField9
+ , nField11;
+
+ OrdinalPosition nOrdinalPosition;
+
+ ColumnDesc() {}
+ ColumnDesc( const ::rtl::OUString& _rName
+ , sal_Int32 _nField5
+ , const ::rtl::OUString& _aField6
+ , sal_Int32 _nField7
+ , sal_Int32 _nField9
+ , sal_Int32 _nField11
+ , const ::rtl::OUString& _sField13
+ ,OrdinalPosition _nPosition )
+ :sName( _rName )
+ ,aField6(_aField6)
+ ,sField13(_sField13)
+ ,nField5(_nField5)
+ ,nField7(_nField7)
+ ,nField9(_nField9)
+ ,nField11(_nField11)
+ ,nOrdinalPosition( _nPosition )
+ {
+ }
+ };
typedef connectivity::sdbcx::OTable OTable_TYPEDEF;
OOO_DLLPUBLIC_DBTOOLS ::rtl::OUString getTypeString(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xColProp);
DECLARE_STL_USTRINGACCESS_MAP( sdbcx::TKeyProperties , TKeyMap);
+ struct OTableHelperImpl;
+
class OOO_DLLPUBLIC_DBTOOLS OTableHelper : public OTable_TYPEDEF
{
- TKeyMap m_aKeys;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
+ ::std::auto_ptr<OTableHelperImpl> m_pImpl;
void refreshPrimaryKeys(TStringVector& _rKeys);
void refreshForgeinKeys(TStringVector& _rKeys);
@@ -83,11 +116,15 @@ namespace connectivity
*/
virtual ::rtl::OUString getRenameStart() const;
+ virtual ~OTableHelper();
+
public:
virtual void refreshColumns();
virtual void refreshKeys();
virtual void refreshIndexes();
+ const ColumnDesc* getColumnDescription(const ::rtl::OUString& _sName) const;
+
public:
OTableHelper( sdbcx::OCollection* _pTables,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
@@ -103,7 +140,7 @@ namespace connectivity
);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> getMetaData() const;
- inline ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection() const { return m_xConnection; }
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection() const;
virtual void SAL_CALL acquire() throw();
virtual void SAL_CALL release() throw();
diff --git a/connectivity/inc/connectivity/sdbcx/VKey.hxx b/connectivity/inc/connectivity/sdbcx/VKey.hxx
index 2405d995db15..d118513953fa 100644
--- a/connectivity/inc/connectivity/sdbcx/VKey.hxx
+++ b/connectivity/inc/connectivity/sdbcx/VKey.hxx
@@ -51,6 +51,7 @@ namespace connectivity
struct OOO_DLLPUBLIC_DBTOOLS KeyProperties
{
+ ::std::vector< ::rtl::OUString> m_aKeyColumnNames;
::rtl::OUString m_ReferencedTable;
sal_Int32 m_Type;
sal_Int32 m_UpdateRule;
diff --git a/connectivity/inc/connectivity/sdbcx/VView.hxx b/connectivity/inc/connectivity/sdbcx/VView.hxx
index d34d1be5495e..73639ac3cb29 100644
--- a/connectivity/inc/connectivity/sdbcx/VView.hxx
+++ b/connectivity/inc/connectivity/sdbcx/VView.hxx
@@ -42,30 +42,21 @@
#include "connectivity/sdbcx/VDescriptor.hxx"
#include "connectivity/dbtoolsdllapi.hxx"
#include <comphelper/IdPropArrayHelper.hxx>
+#include <cppuhelper/implbase2.hxx>
namespace connectivity
{
namespace sdbcx
{
- typedef ::cppu::OWeakObject OView_BASE;
+ typedef ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::container::XNamed> OView_BASE;
- class OOO_DLLPUBLIC_DBTOOLS OViewHelper
- {
- protected:
- ::osl::Mutex m_aMutex;
- ::cppu::OBroadcastHelper rBHelper;
-
- public:
- OViewHelper(): rBHelper(m_aMutex){}
- };
class OOO_DLLPUBLIC_DBTOOLS OView :
- public OViewHelper,
+ public ::comphelper::OMutexAndBroadcastHelper,
public OView_BASE,
- public ::com::sun::star::container::XNamed,
- public ::com::sun::star::lang::XServiceInfo,
public ::comphelper::OIdPropertyArrayUsageHelper<OView>,
public ODescriptor
{
diff --git a/connectivity/inc/connectivity/sqlnode.hxx b/connectivity/inc/connectivity/sqlnode.hxx
index fda3e24c09e6..0adcae01d966 100644
--- a/connectivity/inc/connectivity/sqlnode.hxx
+++ b/connectivity/inc/connectivity/sqlnode.hxx
@@ -404,7 +404,8 @@ namespace connectivity
static sal_Bool getTableComponents(const OSQLParseNode* _pTableNode,
::com::sun::star::uno::Any &_rCatalog,
::rtl::OUString &_rSchema,
- ::rtl::OUString &_rTable);
+ ::rtl::OUString &_rTable
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _xMetaData);
// susbtitute all occurences of :var or [name] into the dynamic parameter ?
// _pNode will be modified if parameters exists
diff --git a/connectivity/prj/build.lst b/connectivity/prj/build.lst
index 21326f36023a..20cb27644e29 100644
--- a/connectivity/prj/build.lst
+++ b/connectivity/prj/build.lst
@@ -1,4 +1,4 @@
-cn connectivity : l10n comphelper MOZ:moz SO:moz_prebuilt svtools UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb QADEVOOO:qadevOOo officecfg NULL
+cn connectivity : l10n comphelper MOZ:moz SO:moz_prebuilt svtools UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb QADEVOOO:qadevOOo officecfg NSS:nss NULL
cn connectivity usr1 - all cn_mkout NULL
cn connectivity\inc nmake - all cn_inc NULL
cn connectivity\com\sun\star\sdbcx\comp\hsqldb nmake - all cn_jhsqldbdb cn_hsqldb cn_inc NULL
diff --git a/connectivity/qa/connectivity/tools/AbstractDatabase.java b/connectivity/qa/connectivity/tools/AbstractDatabase.java
new file mode 100755
index 000000000000..d3150cd8aa07
--- /dev/null
+++ b/connectivity/qa/connectivity/tools/AbstractDatabase.java
@@ -0,0 +1,230 @@
+/*************************************************************************
+ *
+ * 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: RowSetEventListener.java,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.
+ *
+ ************************************************************************/
+package connectivity.tools;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.frame.XModel;
+import com.sun.star.frame.XStorable;
+import com.sun.star.io.IOException;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.XDocumentDataSource;
+import com.sun.star.sdb.XOfficeDatabaseDocument;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XCloseable;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.sdbc.XStatement;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.CloseVetoException;
+import java.io.File;
+
+/**
+ *
+ * @author oj93728
+ */
+public abstract class AbstractDatabase implements DatabaseAccess
+{
+ // the service factory
+
+ protected final XMultiServiceFactory m_orb;
+ // the URL of the temporary file used for the database document
+ protected String m_databaseDocumentFile;
+ // the database document
+ protected XOfficeDatabaseDocument m_databaseDocument;
+ // the data source belonging to the database document
+ protected DataSource m_dataSource;
+ // the default connection
+ protected XConnection m_connection;
+
+ public AbstractDatabase(final XMultiServiceFactory orb) throws Exception
+ {
+ m_orb = orb;
+ }
+
+ // --------------------------------------------------------------------------------------------------------
+ public AbstractDatabase(final XMultiServiceFactory orb, final String _existingDocumentURL ) throws Exception
+ {
+ m_orb = orb;
+ createDBDocument( _existingDocumentURL );
+ }
+
+ /** returns a connection to the database
+ *
+ * Multiple calls to this method return the same connection. The DbaseDatabase object keeps
+ * the ownership of the connection, so you don't need to (and should not) dispose/close it.
+ *
+ */
+ public XConnection defaultConnection() throws SQLException
+ {
+ if (m_connection == null)
+ {
+ m_connection = m_databaseDocument.getDataSource().getConnection("", "");
+ }
+
+ return m_connection;
+ }
+
+ /** executes the given SQL statement via the defaultConnection
+ */
+ public void executeSQL(final String statementString) throws SQLException
+ {
+ final XStatement statement = defaultConnection().createStatement();
+ statement.execute(statementString);
+ }
+
+ /** stores the database document
+ */
+ public void store() throws IOException
+ {
+ if (m_databaseDocument != null)
+ {
+ final XStorable storeDoc = (XStorable) UnoRuntime.queryInterface(XStorable.class,
+ m_databaseDocument);
+ storeDoc.store();
+ }
+ }
+
+ /** closes the database document
+ *
+ * Any CloseVetoExceptions fired by third parties are ignored, and any reference to the
+ * database document is released.
+ */
+ public void close()
+ {
+ // close connection
+ final XCloseable closeConn = (XCloseable) UnoRuntime.queryInterface(XCloseable.class,
+ m_connection);
+ if (closeConn != null)
+ {
+ try
+ {
+ closeConn.close();
+ }
+ catch (SQLException e)
+ {
+ }
+ }
+ m_connection = null;
+
+ // close document
+ final com.sun.star.util.XCloseable closeDoc = (com.sun.star.util.XCloseable) UnoRuntime.queryInterface(
+ com.sun.star.util.XCloseable.class, m_databaseDocument);
+ if (closeDoc != null)
+ {
+ try
+ {
+ closeDoc.close(true);
+ }
+ catch (CloseVetoException e)
+ {
+ }
+ }
+ m_databaseDocument = null;
+ }
+
+ /** closes the document, and deletes the underlying file
+ */
+ public void closeAndDelete()
+ {
+ close();
+
+ if (m_databaseDocumentFile != null)
+ {
+ try
+ {
+ final File file = new File(m_databaseDocumentFile);
+ file.delete();
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+
+ /** returns the underlying database document
+ */
+ public XOfficeDatabaseDocument getDatabaseDocument()
+ {
+ return m_databaseDocument;
+ }
+
+ /** returns the model interface of the underlying database document
+ */
+ public XModel getModel()
+ {
+ return (XModel) UnoRuntime.queryInterface(XModel.class, m_databaseDocument);
+ }
+
+ public XMultiServiceFactory getORB()
+ {
+ return m_orb;
+ }
+
+ // --------------------------------------------------------------------------------------------------------
+ final protected void createDBDocument(final String _docURL) throws Exception
+ {
+ m_databaseDocumentFile = _docURL;
+
+ final XNameAccess dbContext = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
+ m_orb.createInstance("com.sun.star.sdb.DatabaseContext"));
+ final XDocumentDataSource dataSource = (XDocumentDataSource) UnoRuntime.queryInterface(XDocumentDataSource.class,
+ dbContext.getByName(_docURL));
+
+ m_databaseDocument = dataSource.getDatabaseDocument();
+ m_dataSource = new DataSource(m_orb, m_databaseDocument.getDataSource());
+ }
+
+ /** returns the URL of the ODB document represented by this instance
+ */
+ public String getDocumentURL()
+ {
+ return m_databaseDocumentFile;
+ }
+
+ /** returns the data source belonging to this database
+ */
+ public DataSource getDataSource()
+ {
+ return m_dataSource;
+ }
+
+ /** creates a row set operating the database, with a given command/type
+ */
+ public RowSet createRowSet(final int _commandType, final String _command)
+ {
+ return new RowSet(m_orb, getDocumentURL(), _commandType, _command);
+ }
+
+ @Override
+ protected void finalize() throws Throwable
+ {
+ closeAndDelete();
+ super.finalize();
+ }
+}
diff --git a/connectivity/qa/connectivity/tools/DataSource.java b/connectivity/qa/connectivity/tools/DataSource.java
index 531ec70d2930..1ed8f7f98af7 100644
--- a/connectivity/qa/connectivity/tools/DataSource.java
+++ b/connectivity/qa/connectivity/tools/DataSource.java
@@ -27,10 +27,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
package connectivity.tools;
-import com.sun.star.beans.UnknownPropertyException;
import com.sun.star.container.ElementExistException;
import com.sun.star.container.NoSuchElementException;
import com.sun.star.container.XNameAccess;
@@ -51,21 +49,22 @@ import java.util.logging.Logger;
public class DataSource
{
// the service factory
- XMultiServiceFactory m_orb;
- XDataSource m_dataSource;
- public DataSource( XMultiServiceFactory _orb, String _registeredName ) throws Exception
+ private final XMultiServiceFactory m_orb;
+ private XDataSource m_dataSource;
+
+ public DataSource(final XMultiServiceFactory _orb, final String _registeredName) throws Exception
{
m_orb = _orb;
- XNameAccess dbContext = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class,
- _orb.createInstance("com.sun.star.sdb.DatabaseContext"));
+ final XNameAccess dbContext = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
+ _orb.createInstance("com.sun.star.sdb.DatabaseContext"));
- m_dataSource = (XDataSource)UnoRuntime.queryInterface(XDataSource.class,
- dbContext.getByName( _registeredName ) );
+ m_dataSource = (XDataSource) UnoRuntime.queryInterface(XDataSource.class,
+ dbContext.getByName(_registeredName));
}
- public DataSource( XMultiServiceFactory _orb, XDataSource _dataSource )
+ public DataSource(final XMultiServiceFactory _orb,final XDataSource _dataSource)
{
m_orb = _orb;
m_dataSource = _dataSource;
@@ -77,47 +76,47 @@ public class DataSource
}
/** creates a query with a given name and SQL command
- */
- public void createQuery( String _name, String _sqlCommand ) throws ElementExistException, WrappedTargetException, com.sun.star.lang.IllegalArgumentException
+ */
+ public void createQuery(final String _name, final String _sqlCommand) throws ElementExistException, WrappedTargetException, com.sun.star.lang.IllegalArgumentException
{
- createQuery( _name, _sqlCommand, true );
+ createQuery(_name, _sqlCommand, true);
}
/** creates a query with a given name, SQL command, and EscapeProcessing flag
- */
- public void createQuery( String _name, String _sqlCommand, boolean _escapeProcessing ) throws ElementExistException, WrappedTargetException, com.sun.star.lang.IllegalArgumentException
+ */
+ public void createQuery(final String _name, final String _sqlCommand, final boolean _escapeProcessing) throws ElementExistException, WrappedTargetException, com.sun.star.lang.IllegalArgumentException
{
- XSingleServiceFactory queryDefsFac = (XSingleServiceFactory)UnoRuntime.queryInterface(
- XSingleServiceFactory.class, getQueryDefinitions() );
+ final XSingleServiceFactory queryDefsFac = (XSingleServiceFactory) UnoRuntime.queryInterface(
+ XSingleServiceFactory.class, getQueryDefinitions());
XPropertySet queryDef = null;
try
{
- queryDef = (XPropertySet)UnoRuntime.queryInterface(
- XPropertySet.class, queryDefsFac.createInstance() );
- queryDef.setPropertyValue( "Command", _sqlCommand );
- queryDef.setPropertyValue( "EscapeProcessing", new Boolean( _escapeProcessing ) );
+ queryDef = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, queryDefsFac.createInstance());
+ queryDef.setPropertyValue("Command", _sqlCommand);
+ queryDef.setPropertyValue("EscapeProcessing", Boolean.valueOf(_escapeProcessing));
}
- catch( com.sun.star.uno.Exception e )
+ catch (com.sun.star.uno.Exception e)
{
- e.printStackTrace( System.err );
+ e.printStackTrace(System.err);
}
- XNameContainer queryDefsContainer = (XNameContainer)UnoRuntime.queryInterface(
- XNameContainer.class, getQueryDefinitions() );
- queryDefsContainer.insertByName( _name, queryDef );
+ final XNameContainer queryDefsContainer = (XNameContainer) UnoRuntime.queryInterface(
+ XNameContainer.class, getQueryDefinitions());
+ queryDefsContainer.insertByName(_name, queryDef);
}
/** provides the query definition with the given name
*/
- public QueryDefinition getQueryDefinition( String _name ) throws NoSuchElementException
+ public QueryDefinition getQueryDefinition(final String _name) throws NoSuchElementException
{
- XNameAccess allDefs = getQueryDefinitions();
+ final XNameAccess allDefs = getQueryDefinitions();
try
{
return new QueryDefinition(
- (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, allDefs.getByName( _name ) ) );
+ (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, allDefs.getByName(_name)));
}
- catch ( WrappedTargetException e )
+ catch (WrappedTargetException e)
{
}
throw new NoSuchElementException();
@@ -127,8 +126,8 @@ public class DataSource
*/
public XNameAccess getQueryDefinitions()
{
- XQueryDefinitionsSupplier suppQueries = (XQueryDefinitionsSupplier)UnoRuntime.queryInterface(
- XQueryDefinitionsSupplier.class, m_dataSource );
+ final XQueryDefinitionsSupplier suppQueries = (XQueryDefinitionsSupplier) UnoRuntime.queryInterface(
+ XQueryDefinitionsSupplier.class, m_dataSource);
return suppQueries.getQueryDefinitions();
}
@@ -137,12 +136,12 @@ public class DataSource
* This is usually necessary if you created tables by directly executing SQL statements,
* bypassing the SDBCX layer.
*/
- public void refreshTables( com.sun.star.sdbc.XConnection _connection )
+ public void refreshTables(final com.sun.star.sdbc.XConnection _connection)
{
- XTablesSupplier suppTables = (XTablesSupplier)UnoRuntime.queryInterface(
- XTablesSupplier.class, _connection );
- XRefreshable refreshTables = (XRefreshable)UnoRuntime.queryInterface(
- XRefreshable.class, suppTables.getTables() );
+ final XTablesSupplier suppTables = (XTablesSupplier) UnoRuntime.queryInterface(
+ XTablesSupplier.class, _connection);
+ final XRefreshable refreshTables = (XRefreshable) UnoRuntime.queryInterface(
+ XRefreshable.class, suppTables.getTables());
refreshTables.refresh();
}
@@ -158,9 +157,9 @@ public class DataSource
String name = null;
try
{
- XPropertySet dataSourceProps = (XPropertySet) UnoRuntime.queryInterface(
- XPropertySet.class, m_dataSource );
- name = (String)dataSourceProps.getPropertyValue("Name");
+ final XPropertySet dataSourceProps = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, m_dataSource);
+ name = (String) dataSourceProps.getPropertyValue("Name");
}
catch (Exception ex)
{
diff --git a/connectivity/qa/connectivity/tools/DatabaseAccess.java b/connectivity/qa/connectivity/tools/DatabaseAccess.java
new file mode 100755
index 000000000000..bc39bb099087
--- /dev/null
+++ b/connectivity/qa/connectivity/tools/DatabaseAccess.java
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * 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: RowSetEventListener.java,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.
+ *
+ ************************************************************************/
+package connectivity.tools;
+
+import com.sun.star.frame.XModel;
+import com.sun.star.io.IOException;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.XOfficeDatabaseDocument;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XConnection;
+
+/**
+ *
+ * @author oj93728
+ */
+public interface DatabaseAccess
+{
+ XConnection defaultConnection() throws SQLException;
+
+ void executeSQL(final String statementString) throws SQLException;
+
+ void store() throws IOException;
+
+ void close();
+
+ void closeAndDelete();
+
+ XOfficeDatabaseDocument getDatabaseDocument();
+
+ XModel getModel();
+
+ String getDocumentURL();
+
+ DataSource getDataSource();
+
+ RowSet createRowSet(final int _commandType, final String _command);
+
+ XMultiServiceFactory getORB();
+}
diff --git a/connectivity/qa/connectivity/tools/DbaseDatabase.java b/connectivity/qa/connectivity/tools/DbaseDatabase.java
new file mode 100755
index 000000000000..9c1d6ea47411
--- /dev/null
+++ b/connectivity/qa/connectivity/tools/DbaseDatabase.java
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * 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: DbaseDatabase.java,v $
+ * $Revision: 1.4.50.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package connectivity.tools;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XStorable;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.XOfficeDatabaseDocument;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.uno.UnoRuntime;
+
+import helper.URLHelper;
+import java.io.File;
+
+/**
+ *
+ * @author Ocke
+ */
+public class DbaseDatabase extends AbstractDatabase
+{
+ // --------------------------------------------------------------------------------------------------------
+
+ public DbaseDatabase(final XMultiServiceFactory orb) throws Exception
+ {
+ super(orb);
+ createDBDocument();
+ }
+
+ // --------------------------------------------------------------------------------------------------------
+ public DbaseDatabase(final XMultiServiceFactory orb, final String _existingDocumentURL) throws Exception
+ {
+ super(orb, _existingDocumentURL);
+ }
+
+ /** creates an empty database document in a temporary location
+ */
+ private void createDBDocument() throws Exception
+ {
+ final File documentFile = File.createTempFile("dbase", ".odb");
+ documentFile.deleteOnExit();
+ final File subPath = new File(documentFile.getParent() + File.separator + documentFile.getName().replaceAll(".odb", "") + File.separator );
+ subPath.mkdir();
+ //subPath.deleteOnExit();
+ m_databaseDocumentFile = URLHelper.getFileURLFromSystemPath(documentFile);
+ final String path = URLHelper.getFileURLFromSystemPath(subPath.getPath());
+
+ m_databaseDocument = (XOfficeDatabaseDocument) UnoRuntime.queryInterface(
+ XOfficeDatabaseDocument.class, m_orb.createInstance("com.sun.star.sdb.OfficeDatabaseDocument"));
+ m_dataSource = new DataSource(m_orb, m_databaseDocument.getDataSource());
+
+ final XPropertySet dsProperties = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, m_databaseDocument.getDataSource());
+ dsProperties.setPropertyValue("URL", "sdbc:dbase:" + path);
+
+ final XStorable storable = (XStorable) UnoRuntime.queryInterface(XStorable.class, m_databaseDocument);
+ storable.storeAsURL(m_databaseDocumentFile, new PropertyValue[]
+ {
+ });
+ }
+
+ /** drops the table with a given name
+
+ @param _name
+ the name of the table to drop
+ @param _ifExists
+ TRUE if it should be dropped only when it exists.
+ */
+ public void dropTable(final String _name,final boolean _ifExists) throws SQLException
+ {
+ String dropStatement = "DROP TABLE \"" + _name;
+ executeSQL(dropStatement);
+ }
+}
diff --git a/connectivity/qa/connectivity/tools/HsqlDatabase.java b/connectivity/qa/connectivity/tools/HsqlDatabase.java
index e532a04bab22..d27816cf4b7e 100644
--- a/connectivity/qa/connectivity/tools/HsqlDatabase.java
+++ b/connectivity/qa/connectivity/tools/HsqlDatabase.java
@@ -27,29 +27,19 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
package connectivity.tools;
import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertySet;
import com.sun.star.container.ElementExistException;
-import com.sun.star.container.XNameAccess;
import com.sun.star.frame.XStorable;
-import com.sun.star.frame.XModel;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.sdb.XOfficeDatabaseDocument;
import com.sun.star.sdbc.SQLException;
-import com.sun.star.sdbc.XCloseable;
-import com.sun.star.sdbc.XConnection;
-import com.sun.star.sdbc.XStatement;
import com.sun.star.sdbcx.XAppend;
import com.sun.star.sdbcx.XTablesSupplier;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.io.IOException;
-import com.sun.star.sdb.XDocumentDataSource;
-import java.io.File;
-import com.sun.star.util.CloseVetoException;
import helper.URLHelper;
import java.util.HashMap;
import java.util.Iterator;
@@ -60,309 +50,167 @@ import java.io.File;
*
* @author fs93730
*/
-public class HsqlDatabase
+public class HsqlDatabase extends AbstractDatabase
{
- // the service factory
- XMultiServiceFactory m_orb;
- // the URL of the temporary file used for the database document
- String m_databaseDocumentFile;
- // the database document
- XOfficeDatabaseDocument m_databaseDocument;
- // the data source belonging to the database document
- DataSource m_dataSource;
- // the default connection
- XConnection m_connection;
// --------------------------------------------------------------------------------------------------------
- public HsqlDatabase( XMultiServiceFactory orb ) throws Exception
+ public HsqlDatabase(final XMultiServiceFactory orb) throws Exception
{
- m_orb = orb;
+ super(orb);
createDBDocument();
}
// --------------------------------------------------------------------------------------------------------
- public HsqlDatabase( XMultiServiceFactory orb, String _existingDocumentURL ) throws Exception
- {
- m_orb = orb;
- createDBDocument( _existingDocumentURL );
- }
-
- // --------------------------------------------------------------------------------------------------------
- private void createDBDocument( String _docURL ) throws Exception
+ public HsqlDatabase(final XMultiServiceFactory orb, final String _existingDocumentURL) throws Exception
{
- m_databaseDocumentFile = _docURL;
-
- XNameAccess dbContext = (XNameAccess)UnoRuntime.queryInterface( XNameAccess.class,
- m_orb.createInstance( "com.sun.star.sdb.DatabaseContext" ) );
- XDocumentDataSource dataSource = (XDocumentDataSource)UnoRuntime.queryInterface( XDocumentDataSource.class,
- dbContext.getByName( _docURL ) );
-
- m_databaseDocument = dataSource.getDatabaseDocument();
- m_dataSource = new DataSource( m_orb, m_databaseDocument.getDataSource() );
+ super(orb, _existingDocumentURL);
}
/** creates an empty database document in a temporary location
*/
private void createDBDocument() throws Exception
{
- File documentFile = File.createTempFile("testdb",".odb");
+ final File documentFile = File.createTempFile("testdb", ".odb");
documentFile.deleteOnExit();
- m_databaseDocumentFile = URLHelper.getFileURLFromSystemPath( documentFile );
+ m_databaseDocumentFile = URLHelper.getFileURLFromSystemPath(documentFile);
- m_databaseDocument = (XOfficeDatabaseDocument)UnoRuntime.queryInterface(
- XOfficeDatabaseDocument.class, m_orb.createInstance( "com.sun.star.sdb.OfficeDatabaseDocument" ) );
- m_dataSource = new DataSource( m_orb, m_databaseDocument.getDataSource() );
+ m_databaseDocument = (XOfficeDatabaseDocument) UnoRuntime.queryInterface(
+ XOfficeDatabaseDocument.class, m_orb.createInstance("com.sun.star.sdb.OfficeDatabaseDocument"));
+ m_dataSource = new DataSource(m_orb, m_databaseDocument.getDataSource());
- XPropertySet dsProperties = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, m_databaseDocument.getDataSource() );
+ final XPropertySet dsProperties = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, m_databaseDocument.getDataSource());
dsProperties.setPropertyValue("URL", "sdbc:embedded:hsqldb");
- XStorable storable = (XStorable)UnoRuntime.queryInterface( XStorable.class, m_databaseDocument );
- storable.storeAsURL( m_databaseDocumentFile, new PropertyValue[]{} );
+ final XStorable storable = (XStorable) UnoRuntime.queryInterface(XStorable.class, m_databaseDocument);
+ storable.storeAsURL(m_databaseDocumentFile, new PropertyValue[]
+ {
+ });
}
- /** returns a connection to the database
- *
- * Multiple calls to this method return the same connection. The HsqlDatabase object keeps
- * the ownership of the connection, so you don't need to (and should not) dispose/close it.
- *
- */
- public XConnection defaultConnection() throws SQLException
- {
- if ( m_connection != null )
- return m_connection;
- m_connection = m_databaseDocument.getDataSource().getConnection(new String(),new String());
- return m_connection;
- }
+ /** drops the table with a given name
- /** executes the given SQL statement via the defaultConnection
+ @param _name
+ the name of the table to drop
+ @param _ifExists
+ TRUE if it should be dropped only when it exists.
*/
- public void executeSQL( String statementString ) throws SQLException
- {
- XStatement statement = defaultConnection().createStatement();
- statement.execute( statementString );
- }
-
- /** stores the database document
- */
- public void store() throws IOException
+ public void dropTable(final String _name, final boolean _ifExists) throws SQLException
{
- if ( m_databaseDocument != null )
+ final StringBuffer dropStatement = new StringBuffer("DROP TABLE \"");
+ dropStatement.append(_name);
+ if (_ifExists)
{
- XStorable storeDoc = (XStorable)UnoRuntime.queryInterface( XStorable.class,
- m_databaseDocument );
- storeDoc.store();
+ dropStatement.append("\" IF EXISTS");
}
+ executeSQL(dropStatement.toString());
}
- /** closes the database document
- *
- * Any CloseVetoExceptions fired by third parties are ignored, and any reference to the
- * database document is released.
- */
- public void close()
+ public void createTable(final HsqlTableDescriptor _tableDesc, final boolean _dropIfExists) throws SQLException
{
- // close connection
- XCloseable closeConn = (XCloseable)UnoRuntime.queryInterface( XCloseable.class,
- m_connection );
- if ( closeConn != null )
+ if (_dropIfExists)
{
- try
- {
- closeConn.close();
- }
- catch( SQLException e )
- {
- }
+ dropTable(_tableDesc.getName(), true);
}
- m_connection = null;
-
- // close document
- com.sun.star.util.XCloseable closeDoc = (com.sun.star.util.XCloseable)UnoRuntime.queryInterface(
- com.sun.star.util.XCloseable.class, m_databaseDocument );
- if ( closeDoc != null )
- {
- try
- {
- closeDoc.close( true );
- }
- catch( CloseVetoException e )
- {
- }
- }
- m_databaseDocument = null;
- }
-
- /** closes the document, and deletes the underlying file
- */
- public void closeAndDelete()
- {
- close();
-
- if ( m_databaseDocumentFile != null )
- {
- try
- {
- File file = new File(m_databaseDocumentFile);
- file.delete();
- }
- catch(Exception e)
- {
- }
- m_databaseDocumentFile = null;
- }
- }
-
- /** returns the underlying database document
- */
- public XOfficeDatabaseDocument getDatabaseDocument()
- {
- return m_databaseDocument;
- }
-
- /** returns the model interface of the underlying database document
- */
- XModel getModel()
- {
- return (XModel)UnoRuntime.queryInterface( XModel.class, m_databaseDocument );
- }
-
- /** drops the table with a given name
-
- @param _name
- the name of the table to drop
- @param _ifExists
- TRUE if it should be dropped only when it exists.
- */
- public void dropTable( String _name, boolean _ifExists ) throws SQLException
- {
- String dropStatement = "DROP TABLE \"" + _name;
- if ( _ifExists )
- dropStatement += "\" IF EXISTS";
- executeSQL( dropStatement );
- }
-
- public void createTable( HsqlTableDescriptor _tableDesc, boolean _dropIfExists ) throws SQLException
- {
- if ( _dropIfExists )
- dropTable( _tableDesc.getName(), true );
- createTable( _tableDesc );
+ createTable(_tableDesc);
}
/** creates a table
*/
- public void createTable( HsqlTableDescriptor _tableDesc ) throws SQLException
+ public void createTable(final HsqlTableDescriptor _tableDesc) throws SQLException
{
- String createStatement = "CREATE CACHED TABLE \"";
- createStatement += _tableDesc.getName();
- createStatement += "\" ( ";
+ StringBuffer createStatement = new StringBuffer("CREATE CACHED TABLE \"");
+ createStatement.append(_tableDesc.getName());
+ createStatement.append("\" ( ");
String primaryKeyList = "";
- HashMap foreignKeys = new HashMap();
- HashMap foreignKeyRefs = new HashMap();
+ final HashMap foreignKeys = new HashMap();
+ final HashMap foreignKeyRefs = new HashMap();
- HsqlColumnDescriptor[] columns = _tableDesc.getColumns();
- for ( int i=0; i<columns.length; ++i )
+ final HsqlColumnDescriptor[] columns = _tableDesc.getColumns();
+ for (int i = 0; i < columns.length; ++i)
{
- if ( i > 0 )
- createStatement += ", ";
+ if (i > 0)
+ {
+ createStatement.append(", ");
+ }
- createStatement += "\"" + columns[i].getName();
- createStatement += "\" " + columns[i].getTypeName();
+ createStatement.append("\"" + columns[i].getName());
+ createStatement.append("\" " + columns[i].getTypeName());
- if ( columns[i].isRequired() )
- createStatement += " NOT NULL";
+ if (columns[i].isRequired())
+ {
+ createStatement.append(" NOT NULL");
+ }
- if ( columns[i].isPrimaryKey() )
+ if (columns[i].isPrimaryKey())
{
- if ( primaryKeyList.length() > 0 )
+ if (primaryKeyList.length() > 0)
+ {
primaryKeyList += ", ";
+ }
primaryKeyList += "\"" + columns[i].getName() + "\"";
}
- if ( columns[i].isForeignKey() )
+ if (columns[i].isForeignKey())
{
- String foreignTable = columns[i].getForeignTable();
+ final String foreignTable = columns[i].getForeignTable();
- String foreignKeysForTable = foreignKeys.containsKey( foreignTable ) ? (String)foreignKeys.get( foreignTable ) : "";
- if ( foreignKeysForTable.length() > 0 )
+ String foreignKeysForTable = foreignKeys.containsKey(foreignTable) ? (String) foreignKeys.get(foreignTable) : "";
+ if (foreignKeysForTable.length() > 0)
+ {
foreignKeysForTable += ", ";
+ }
foreignKeysForTable += "\"" + columns[i].getName() + "\"";
- foreignKeys.put( foreignTable, foreignKeysForTable );
-
- String foreignKeyRefsForTable = foreignKeyRefs.containsKey( foreignTable ) ? (String)foreignKeyRefs.get( foreignTable ) : "";
- if ( foreignKeyRefsForTable.length() > 0 )
- foreignKeyRefsForTable += ", ";
- foreignKeyRefsForTable += "\"" + columns[i].getForeignColumn() + "\"";
- foreignKeyRefs.put( foreignTable, foreignKeyRefsForTable );
+ foreignKeys.put(foreignTable, foreignKeysForTable);
+
+ final StringBuffer foreignKeyRefsForTable = new StringBuffer(foreignKeyRefs.containsKey(foreignTable) ? (String) foreignKeyRefs.get(foreignTable) : "");
+ if (foreignKeyRefsForTable.length() > 0)
+ {
+ foreignKeyRefsForTable.append(", ");
+ }
+ foreignKeyRefsForTable.append("\"" + columns[i].getForeignColumn() + "\"");
+ foreignKeyRefs.put(foreignTable, foreignKeyRefsForTable.toString());
}
}
- if ( primaryKeyList.length() > 0 )
+ if (primaryKeyList.length() > 0)
{
- createStatement += ", PRIMARY KEY (";
- createStatement += primaryKeyList;
- createStatement += ")";
+ createStatement.append(", PRIMARY KEY (");
+ createStatement.append(primaryKeyList);
+ createStatement.append(')');
}
- Set foreignKeyTables = foreignKeys.keySet();
- for ( Iterator foreignKey = foreignKeyTables.iterator();
- foreignKey.hasNext();
- )
+ final Set foreignKeyTables = foreignKeys.keySet();
+ for (final Iterator foreignKey = foreignKeyTables.iterator();
+ foreignKey.hasNext();)
{
- String foreignTable = (String)foreignKey.next();
-
- createStatement += ", FOREIGN KEY (";
- createStatement += (String)foreignKeys.get(foreignTable);
- createStatement += ") REFERENCES \"";
- createStatement += foreignTable;
- createStatement += "\"(";
- createStatement += (String)foreignKeyRefs.get(foreignTable);
- createStatement += ")";
+ final String foreignTable = (String) foreignKey.next();
+
+ createStatement.append(", FOREIGN KEY (");
+ createStatement.append((String) foreignKeys.get(foreignTable));
+ createStatement.append(") REFERENCES \"");
+ createStatement.append(foreignTable);
+ createStatement.append("\"(");
+ createStatement.append((String) foreignKeyRefs.get(foreignTable));
+ createStatement.append(')');
}
- createStatement += ")";
+ createStatement.append(')');
//System.err.println( createStatement );
- executeSQL( createStatement );
+ executeSQL(createStatement.toString());
}
/** creates a table in the database. using the SDBCX-API
*/
- public void createTableInSDBCX( HsqlTableDescriptor _tableDesc ) throws SQLException, ElementExistException
- {
- XPropertySet sdbcxDescriptor = _tableDesc.createSdbcxDescriptor( defaultConnection() );
- XTablesSupplier suppTables = (XTablesSupplier)UnoRuntime.queryInterface(
- XTablesSupplier.class, defaultConnection() );
- XAppend appendTable = (XAppend)UnoRuntime.queryInterface(
- XAppend.class, suppTables.getTables() );
- appendTable.appendByDescriptor( sdbcxDescriptor );
- }
-
- /** returns the URL of the ODB document represented by this instance
- */
- public String getDocumentURL()
- {
- return m_databaseDocumentFile;
- }
-
- /** returns the data source belonging to this database
- */
- public DataSource getDataSource()
- {
- return m_dataSource;
- }
-
- /** creates a row set operating the database, with a given command/type
- */
- public RowSet createRowSet( int _commandType, String _command )
- {
- return new RowSet(m_orb, getDocumentURL(), _commandType, _command);
- }
-
- protected void finalize() throws Throwable
- {
- closeAndDelete();
- super.finalize();
+ public void createTableInSDBCX(final HsqlTableDescriptor _tableDesc) throws SQLException, ElementExistException
+ {
+ final XPropertySet sdbcxDescriptor = _tableDesc.createSdbcxDescriptor(defaultConnection());
+ final XTablesSupplier suppTables = (XTablesSupplier) UnoRuntime.queryInterface(
+ XTablesSupplier.class, defaultConnection());
+ final XAppend appendTable = (XAppend) UnoRuntime.queryInterface(
+ XAppend.class, suppTables.getTables());
+ appendTable.appendByDescriptor(sdbcxDescriptor);
}
}
diff --git a/connectivity/qa/drivers/dbase/DBaseDateFunctions.java b/connectivity/qa/drivers/dbase/DBaseDateFunctions.java
index 7a12866b0121..7ed50cbd9fd0 100644
--- a/connectivity/qa/drivers/dbase/DBaseDateFunctions.java
+++ b/connectivity/qa/drivers/dbase/DBaseDateFunctions.java
@@ -27,219 +27,286 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package complex.connectivity;
+package qa.drivers.dbase;
-import complex.connectivity.DBaseDriverTest;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.util.XCloseable;
import com.sun.star.sdbc.*;
-import com.sun.star.sdb.*;
-import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertySet;
import com.sun.star.lang.XMultiServiceFactory;
-import complexlib.ComplexTestCase;
+public class DBaseDateFunctions
+{
-import java.io.PrintWriter;
+ private final String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
+ private final XMultiServiceFactory m_xORB;
+ private final DBaseDriverTest testcase;
-import util.utils;
-import java.util.*;
-import java.io.*;
-
-
-public class DBaseDateFunctions {
-
- private String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
- private XMultiServiceFactory m_xORB;
- private DBaseDriverTest testcase;
- public DBaseDateFunctions(XMultiServiceFactory _xORB,DBaseDriverTest _testcase){
- m_xORB = _xORB;
- testcase = _testcase;
- }
+ public DBaseDateFunctions(final XMultiServiceFactory _xORB, final DBaseDriverTest _testcase)
+ {
+ m_xORB = _xORB;
+ testcase = _testcase;
+ }
- private void assure(String s,boolean b){
- testcase.assure2(s,b);
- }
+ private void assure(final String s, final boolean b)
+ {
+ testcase.assure2(s, b);
+ }
- public void testFunctions() throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRowSet xRowRes = (XRowSet)UnoRuntime.queryInterface(XRowSet.class,
- m_xORB.createInstance("com.sun.star.sdb.RowSet"));
+ public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class,
+ m_xORB.createInstance("com.sun.star.sdb.RowSet"));
- System.out.println("starting DateTime function test!");
+ testcase.getLog().println("starting DateTime function test!");
// set the properties needed to connect to a database
- XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
- xProp.setPropertyValue("DataSourceName","Bibliography");
+ final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+ xProp.setPropertyValue("DataSourceName", "Bibliography");
- xProp.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.COMMAND));
+ xProp.setPropertyValue("CommandType", Integer.valueOf(com.sun.star.sdb.CommandType.COMMAND));
- try {
+ try
+ {
curdate(xRowRes);
- } catch( SQLException ex){
- assure("upper " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("upper " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
curtime(xRowRes);
- } catch( SQLException ex){
- assure("lower " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("lower " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
dayname(xRowRes);
- } catch( SQLException ex){
- assure("ascii " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("ascii " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
dayofmonth(xRowRes);
- } catch( SQLException ex){
- assure("char_len " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("char_len " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
dayofweek(xRowRes);
- } catch( SQLException ex){
- assure("concat " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("concat " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
dayofyear(xRowRes);
- } catch( SQLException ex){
- assure("locate " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("locate " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
hour(xRowRes);
- } catch( SQLException ex){
- assure("substr " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("substr " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
minute(xRowRes);
- } catch( SQLException ex){
- assure("ltrim " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("ltrim " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
month(xRowRes);
- } catch( SQLException ex){
- assure("rtrim " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("rtrim " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
monthname(xRowRes);
- } catch( SQLException ex){
- assure("space " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("space " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
now(xRowRes);
- } catch( SQLException ex){
- assure("replace " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("replace " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
quarter(xRowRes);
- } catch( SQLException ex){
- assure("repeat " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("repeat " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
second(xRowRes);
- } catch( SQLException ex){
- assure("insert " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("insert " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
week(xRowRes);
- } catch( SQLException ex){
- assure("left " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("left " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
year(xRowRes);
- } catch( SQLException ex){
- assure("right " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("right " + ex.getMessage(), false);
throw ex;
}
}
- private XRow execute(XRowSet xRowRes,String sql) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
- xProp.setPropertyValue("Command","SELECT " + sql + where);
+ private XRow execute(final XRowSet xRowRes, final String sql) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+ xProp.setPropertyValue("Command", "SELECT " + sql + where);
xRowRes.execute();
- XResultSet xRes = (XResultSet)UnoRuntime.queryInterface(XResultSet.class,xRowRes);
- assure("No valid row! ",xRes.next());
-
- return (XRow)UnoRuntime.queryInterface(XRow.class, xRes);
- }
-
- private void dayofweek(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"DAYOFWEEK('1998-02-03') ");
- assure("DAYOFWEEK('1998-02-03') failed!",row.getInt(1) == 3);
- }
- private void dayofmonth(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"DAYOFMONTH('1998-02-03') ");
- assure("DAYOFMONTH('1998-02-03') failed!",row.getInt(1) == 3);
- }
- private void dayofyear(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"DAYOFYEAR('1998-02-03') ");
- assure("DAYOFYEAR('1998-02-03') failed!",row.getInt(1) == 34);
- }
- private void month(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"month('1998-02-03') ");
- assure("month('1998-02-03') failed!",row.getInt(1) == 2);
- }
- private void dayname(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"DAYNAME('1998-02-05') ");
- assure("DAYNAME('1998-02-05') failed!",row.getString(1).equals("Thursday"));
- }
- private void monthname(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"MONTHNAME('1998-02-05') ");
- assure("MONTHNAME('1998-02-05') failed!",row.getString(1).equals("February"));
- }
- private void quarter(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"QUARTER('98-01-01'),QUARTER('98-04-01'),QUARTER('98-07-01'),QUARTER('98-10-01') ");
- assure("QUARTER('98-01-01') failed!",row.getInt(1) == 1);
- assure("QUARTER('98-04-01') failed!",row.getInt(2) == 2);
- assure("QUARTER('98-07-01') failed!",row.getInt(3) == 3);
- assure("QUARTER('98-10-01') failed!",row.getInt(4) == 4);
- }
- private void week(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"WEEK('1998-02-20') ");
- assure("WEEK('1998-02-20') failed!",row.getInt(1) == 7);
- }
- private void year(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"YEAR('98-02-03') ");
- assure("YEAR('98-02-03') failed!",row.getInt(1) == 98);
- }
- private void hour(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"HOUR('10:05:03') ");
- assure("HOUR('10:05:03') failed!",row.getInt(1) == 10);
- }
- private void minute(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"MINUTE('98-02-03 10:05:03') ");
- assure("MINUTE('98-02-03 10:05:03') failed!",row.getInt(1) == 5);
- }
- private void second(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"SECOND('10:05:03') ");
- assure("SECOND('10:05:03') failed!",row.getInt(1) == 3);
- }
- private void curdate(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"CURDATE() ");
- com.sun.star.util.Date aDate = row.getDate(1);
- System.out.println("CURDATE() is '" + aDate.Year + "-" + aDate.Month + "-" + aDate.Day +"'");
- }
- private void curtime(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"CURTIME() ");
- com.sun.star.util.Time aTime = row.getTime(1);
- System.out.println("CURTIME() is '" + aTime.Hours + ":" + aTime.Minutes + ":" + aTime.Seconds + "'");
- }
- private void now(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"NOW() ");
- com.sun.star.util.DateTime aTime = row.getTimestamp(1);
- System.out.println("NOW() is '" + aTime.Year + "-" + aTime.Month + "-" + aTime.Day + "'");
- System.out.println("'" + aTime.Hours + ":" + aTime.Minutes + ":" + aTime.Seconds + "'");
+ final XResultSet xRes = (XResultSet) UnoRuntime.queryInterface(XResultSet.class, xRowRes);
+ assure("No valid row! ", xRes.next());
+
+ return (XRow) UnoRuntime.queryInterface(XRow.class, xRes);
+ }
+
+ private void dayofweek(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "DAYOFWEEK('1998-02-03') ");
+ assure("DAYOFWEEK('1998-02-03') failed!", row.getInt(1) == 3);
+ }
+
+ private void dayofmonth(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "DAYOFMONTH('1998-02-03') ");
+ assure("DAYOFMONTH('1998-02-03') failed!", row.getInt(1) == 3);
+ }
+
+ private void dayofyear(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "DAYOFYEAR('1998-02-03') ");
+ assure("DAYOFYEAR('1998-02-03') failed!", row.getInt(1) == 34);
+ }
+
+ private void month(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "month('1998-02-03') ");
+ assure("month('1998-02-03') failed!", row.getInt(1) == 2);
+ }
+
+ private void dayname(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "DAYNAME('1998-02-05') ");
+ assure("DAYNAME('1998-02-05') failed!", row.getString(1).equals("Thursday"));
+ }
+
+ private void monthname(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "MONTHNAME('1998-02-05') ");
+ assure("MONTHNAME('1998-02-05') failed!", row.getString(1).equals("February"));
+ }
+
+ private void quarter(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "QUARTER('98-01-01'),QUARTER('98-04-01'),QUARTER('98-07-01'),QUARTER('98-10-01') ");
+ assure("QUARTER('98-01-01') failed!", row.getInt(1) == 1);
+ assure("QUARTER('98-04-01') failed!", row.getInt(2) == 2);
+ assure("QUARTER('98-07-01') failed!", row.getInt(3) == 3);
+ assure("QUARTER('98-10-01') failed!", row.getInt(4) == 4);
+ }
+
+ private void week(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "WEEK('1998-02-20') ");
+ assure("WEEK('1998-02-20') failed!", row.getInt(1) == 7);
+ }
+
+ private void year(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "YEAR('98-02-03') ");
+ assure("YEAR('98-02-03') failed!", row.getInt(1) == 98);
+ }
+
+ private void hour(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "HOUR('10:05:03') ");
+ assure("HOUR('10:05:03') failed!", row.getInt(1) == 10);
+ }
+
+ private void minute(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "MINUTE('98-02-03 10:05:03') ");
+ assure("MINUTE('98-02-03 10:05:03') failed!", row.getInt(1) == 5);
+ }
+
+ private void second(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "SECOND('10:05:03') ");
+ assure("SECOND('10:05:03') failed!", row.getInt(1) == 3);
+ }
+
+ private void curdate(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "CURDATE() ");
+ final com.sun.star.util.Date aDate = row.getDate(1);
+ testcase.getLog().println("CURDATE() is '" + aDate.Year + "-" + aDate.Month + "-" + aDate.Day + "'");
+ }
+
+ private void curtime(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "CURTIME() ");
+ final com.sun.star.util.Time aTime = row.getTime(1);
+ testcase.getLog().println("CURTIME() is '" + aTime.Hours + ":" + aTime.Minutes + ":" + aTime.Seconds + "'");
+ }
+
+ private void now(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "NOW() ");
+ final com.sun.star.util.DateTime aTime = row.getTimestamp(1);
+ testcase.getLog().println("NOW() is '" + aTime.Year + "-" + aTime.Month + "-" + aTime.Day + "'");
+ testcase.getLog().println("'" + aTime.Hours + ":" + aTime.Minutes + ":" + aTime.Seconds + "'");
}
}
diff --git a/connectivity/qa/drivers/dbase/DBaseDriverTest.java b/connectivity/qa/drivers/dbase/DBaseDriverTest.java
index 6fcbfa2d9a78..fd15eee54d00 100644
--- a/connectivity/qa/drivers/dbase/DBaseDriverTest.java
+++ b/connectivity/qa/drivers/dbase/DBaseDriverTest.java
@@ -27,60 +27,71 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package complex.connectivity;
+package qa.drivers.dbase;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.util.XCloseable;
import com.sun.star.sdbc.*;
-import com.sun.star.sdb.*;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.beans.XPropertySet;
-
import com.sun.star.lang.XMultiServiceFactory;
-
import complexlib.ComplexTestCase;
-
-import java.io.PrintWriter;
-
-import util.utils;
import java.util.*;
import java.io.*;
+import share.LogWriter;
//import complex.connectivity.DBaseStringFunctions;
-public class DBaseDriverTest extends ComplexTestCase {
+public class DBaseDriverTest extends ComplexTestCase
+{
private static Properties props = new Properties();
private XDriver m_xDiver;
- private String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
+ private String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
- static {
- try {
+ static
+ {
+ try
+ {
String propsFile = "test.properties";
- props.load( new FileInputStream(propsFile) );
- } catch(Exception ex) {
+ props.load(new FileInputStream(propsFile));
+ }
+ catch (Exception ex)
+ {
throw new RuntimeException(ex);
}
}
- public String[] getTestMethodNames() {
- return new String[] { "Functions" };
+ public String[] getTestMethodNames()
+ {
+ return new String[]
+ {
+ "Functions"
+ };
}
- public String getTestObjectName() {
+ public String getTestObjectName()
+ {
return "DBaseDriverTest";
}
- public void assure2(String s,boolean b){
- assure(s,b);
+
+ public void assure2(String s, boolean b)
+ {
+ assure(s, b);
+ }
+
+ public LogWriter getLog()
+ {
+ return log;
}
- public void Functions() throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- DBaseStringFunctions aStringTest = new DBaseStringFunctions(((XMultiServiceFactory)param.getMSF()),this);
+ public void Functions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ DBaseStringFunctions aStringTest = new DBaseStringFunctions(((XMultiServiceFactory) param.getMSF()), this);
aStringTest.testFunctions();
- DBaseNumericFunctions aNumericTest = new DBaseNumericFunctions(((XMultiServiceFactory)param.getMSF()),this);
+ DBaseNumericFunctions aNumericTest = new DBaseNumericFunctions(((XMultiServiceFactory) param.getMSF()), this);
aNumericTest.testFunctions();
- DBaseDateFunctions aDateTest = new DBaseDateFunctions(((XMultiServiceFactory)param.getMSF()),this);
+ DBaseDateFunctions aDateTest = new DBaseDateFunctions(((XMultiServiceFactory) param.getMSF()), this);
aDateTest.testFunctions();
+
+ DBaseSqlTests aSqlTest = new DBaseSqlTests(((XMultiServiceFactory) param.getMSF()), this);
+ aSqlTest.testFunctions();
}
}
diff --git a/connectivity/qa/drivers/dbase/DBaseNumericFunctions.java b/connectivity/qa/drivers/dbase/DBaseNumericFunctions.java
index 3e693c35f9a0..b31e92653f71 100644
--- a/connectivity/qa/drivers/dbase/DBaseNumericFunctions.java
+++ b/connectivity/qa/drivers/dbase/DBaseNumericFunctions.java
@@ -27,285 +27,379 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package complex.connectivity;
+package qa.drivers.dbase;
-import complex.connectivity.DBaseDriverTest;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.util.XCloseable;
import com.sun.star.sdbc.*;
-import com.sun.star.sdb.*;
-import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertySet;
-
import com.sun.star.lang.XMultiServiceFactory;
-import complexlib.ComplexTestCase;
-
-import java.io.PrintWriter;
-
-import util.utils;
-import java.util.*;
-import java.io.*;
+public class DBaseNumericFunctions
+{
-public class DBaseNumericFunctions {
+ private final String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
+ private final XMultiServiceFactory m_xORB;
+ private final DBaseDriverTest testcase;
- private String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
- private XMultiServiceFactory m_xORB;
- private DBaseDriverTest testcase;
- public DBaseNumericFunctions(XMultiServiceFactory _xORB,DBaseDriverTest _testcase){
- m_xORB = _xORB;
- testcase = _testcase;
- }
+ public DBaseNumericFunctions(final XMultiServiceFactory _xORB, final DBaseDriverTest _testcase)
+ {
+ m_xORB = _xORB;
+ testcase = _testcase;
+ }
- private void assure(String s,boolean b){
- testcase.assure2(s,b);
- }
+ private void assure(final String s, final boolean b)
+ {
+ testcase.assure2(s, b);
+ }
- public void testFunctions() throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRowSet xRowRes = (XRowSet)UnoRuntime.queryInterface(XRowSet.class,
- m_xORB.createInstance("com.sun.star.sdb.RowSet"));
+ public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class,
+ m_xORB.createInstance("com.sun.star.sdb.RowSet"));
- System.out.println("starting Numeric function test");
+ testcase.getLog().println("starting Numeric function test");
// set the properties needed to connect to a database
- XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
- xProp.setPropertyValue("DataSourceName","Bibliography");
+ final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+ xProp.setPropertyValue("DataSourceName", "Bibliography");
- xProp.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.COMMAND));
+ xProp.setPropertyValue("CommandType", Integer.valueOf(com.sun.star.sdb.CommandType.COMMAND));
- try {
+ try
+ {
abs(xRowRes);
- } catch( SQLException ex){
- assure("abs " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("abs " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
acos(xRowRes);
- } catch( SQLException ex){
- assure("acos " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("acos " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
asin(xRowRes);
- } catch( SQLException ex){
- assure("asin " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("asin " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
atan(xRowRes);
- } catch( SQLException ex){
- assure("atan " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("atan " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
atan2(xRowRes);
- } catch( SQLException ex){
- assure("atan2 " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("atan2 " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
ceiling(xRowRes);
- } catch( SQLException ex){
- assure("ceiling " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("ceiling " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
cos(xRowRes);
- } catch( SQLException ex){
- assure("cos " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("cos " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
degrees(xRowRes);
- } catch( SQLException ex){
- assure("degrees " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("degrees " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
exp(xRowRes);
- } catch( SQLException ex){
- assure("exp " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("exp " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
floor(xRowRes);
- } catch( SQLException ex){
- assure("floor " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("floor " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
log(xRowRes);
- } catch( SQLException ex){
- assure("log " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("log " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
log10(xRowRes);
- } catch( SQLException ex){
- assure("log10 " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("log10 " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
mod(xRowRes);
- } catch( SQLException ex){
- assure("mod " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("mod " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
pi(xRowRes);
- } catch( SQLException ex){
- assure("pi " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("pi " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
pow(xRowRes);
- } catch( SQLException ex){
- assure("pow " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("pow " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
radians(xRowRes);
- } catch( SQLException ex){
- assure("radians " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("radians " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
round(xRowRes);
- } catch( SQLException ex){
- assure("round " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("round " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
sign(xRowRes);
- } catch( SQLException ex){
- assure("sign " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("sign " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
sin(xRowRes);
- } catch( SQLException ex){
- assure("sin " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("sin " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
sqrt(xRowRes);
- } catch( SQLException ex){
- assure("sqrt " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("sqrt " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
tan(xRowRes);
- } catch( SQLException ex){
- assure("tan " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("tan " + ex.getMessage(), false);
throw ex;
}
}
- private XRow execute(XRowSet xRowRes,String sql) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
- xProp.setPropertyValue("Command","SELECT " + sql + where);
+ private XRow execute(final XRowSet xRowRes,final String sql) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+ xProp.setPropertyValue("Command", "SELECT " + sql + where);
xRowRes.execute();
- XResultSet xRes = (XResultSet)UnoRuntime.queryInterface(XResultSet.class,xRowRes);
- assure("No valid row! ",xRes.next());
+ final XResultSet xRes = (XResultSet) UnoRuntime.queryInterface(XResultSet.class, xRowRes);
+ assure("No valid row! ", xRes.next());
- return (XRow)UnoRuntime.queryInterface(XRow.class, xRes);
+ return (XRow) UnoRuntime.queryInterface(XRow.class, xRes);
}
- private void abs(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"ABS(2),ABS(-32) ");
- assure("ABS(2) failed!",row.getInt(1) == 2);
- assure("ABS(-32) failed!",row.getInt(2) == 32);
+ private void abs(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "ABS(2),ABS(-32) ");
+ assure("ABS(2) failed!", row.getInt(1) == 2);
+ assure("ABS(-32) failed!", row.getInt(2) == 32);
}
- private void sign(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"SIGN(-32),SIGN(0),SIGN(234) ");
- assure("SIGN(-32)failed!",row.getInt(1) == -1);
- assure("SIGN(0) failed!",row.getInt(2) == 0);
- assure("SIGN(234) failed!",row.getInt(3) == 1);
+ private void sign(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "SIGN(-32),SIGN(0),SIGN(234) ");
+ assure("SIGN(-32)failed!", row.getInt(1) == -1);
+ assure("SIGN(0) failed!", row.getInt(2) == 0);
+ assure("SIGN(234) failed!", row.getInt(3) == 1);
}
- private void mod(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"MOD(234, 10) ");
- assure("MOD(234, 10) failed!",row.getInt(1) == 4);
+ private void mod(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "MOD(234, 10) ");
+ assure("MOD(234, 10) failed!", row.getInt(1) == 4);
}
- private void floor(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"FLOOR(1.23),FLOOR(-1.23) ");
- assure("FLOOR(1.23) failed!",row.getInt(1) == 1);
- assure("FLOOR(-1.23) failed!",row.getInt(2) == -2);
+ private void floor(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "FLOOR(1.23),FLOOR(-1.23) ");
+ assure("FLOOR(1.23) failed!", row.getInt(1) == 1);
+ assure("FLOOR(-1.23) failed!", row.getInt(2) == -2);
}
- private void ceiling(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"CEILING(1.23),CEILING(-1.23) ");
- assure("CEILING(1.23) failed!",row.getInt(1) == 2);
- assure("CEILING(-1.23) failed!",row.getInt(2) == -1);
+
+ private void ceiling(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "CEILING(1.23),CEILING(-1.23) ");
+ assure("CEILING(1.23) failed!", row.getInt(1) == 2);
+ assure("CEILING(-1.23) failed!", row.getInt(2) == -1);
}
- private void round(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"ROUND(-1.23),ROUND(1.298, 1) ");
- assure("ROUND(-1.23) failed!",row.getInt(1) == -1);
- assure("ROUND(1.298, 1) failed!",row.getDouble(2) == 1.3);
+
+ private void round(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "ROUND(-1.23),ROUND(1.298, 1) ");
+ assure("ROUND(-1.23) failed!", row.getInt(1) == -1);
+ assure("ROUND(1.298, 1) failed!", row.getDouble(2) == 1.3);
}
- private void exp(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"EXP(2),EXP(-2) ");
- assure("EXP(2) failed!",(float)row.getDouble(1) == (float)java.lang.Math.exp(2) );
- assure("EXP(-2) failed!",(float)row.getDouble(2) == (float)java.lang.Math.exp(-2));
+
+ private void exp(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "EXP(2),EXP(-2) ");
+ assure("EXP(2) failed!", (float) row.getDouble(1) == (float) java.lang.Math.exp(2));
+ assure("EXP(-2) failed!", (float) row.getDouble(2) == (float) java.lang.Math.exp(-2));
}
- private void log(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"LOG(2),LOG(-2) ");
- assure("LOG(2) failed!",(float)row.getDouble(1) == (float)java.lang.Math.log(2) );
+
+ private void log(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "LOG(2),LOG(-2) ");
+ assure("LOG(2) failed!", (float) row.getDouble(1) == (float) java.lang.Math.log(2));
row.getDouble(2);
- assure("LOG(-2) failed!",row.wasNull());
+ assure("LOG(-2) failed!", row.wasNull());
}
- private void log10(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"LOG10(100) ");
- assure("LOG10(100) failed!",row.getDouble(1) == 2.0 );
+
+ private void log10(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "LOG10(100) ");
+ assure("LOG10(100) failed!", row.getDouble(1) == 2.0);
}
- private void pow(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"POWER(2,2) ");
- assure("POWER(2,2) failed!",row.getDouble(1) == 4.0 );
+
+ private void pow(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "POWER(2,2) ");
+ assure("POWER(2,2) failed!", row.getDouble(1) == 4.0);
}
- private void sqrt(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"SQRT(4) ");
- assure("SQRT(4) failed!",row.getDouble(1) == 2.0 );
+
+ private void sqrt(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "SQRT(4) ");
+ assure("SQRT(4) failed!", row.getDouble(1) == 2.0);
}
- private void pi(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"PI() ");
- assure("PI() failed!",(float)row.getDouble(1) == (float)java.lang.Math.PI );
+
+ private void pi(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "PI() ");
+ assure("PI() failed!", (float) row.getDouble(1) == (float) java.lang.Math.PI);
}
- private void cos(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"COS(PI()) ");
- assure("COS(PI()) failed!",row.getDouble(1) == -1.0 );
+
+ private void cos(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "COS(PI()) ");
+ assure("COS(PI()) failed!", row.getDouble(1) == -1.0);
}
- private void sin(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"SIN(2) ");
- assure("SIN(PI()) failed!",(float)row.getDouble(1) == (float)java.lang.Math.sin( 2 ) );
+
+ private void sin(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "SIN(2) ");
+ assure("SIN(PI()) failed!", (float) row.getDouble(1) == (float) java.lang.Math.sin(2));
}
- private void tan(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"TAN(PI()+1) ");
- assure("TAN(PI()+1) failed!",(float)row.getDouble(1) == (float)java.lang.Math.tan(java.lang.Math.PI+1.0) );
+
+ private void tan(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "TAN(PI()+1) ");
+ assure("TAN(PI()+1) failed!", (float) row.getDouble(1) == (float) java.lang.Math.tan(java.lang.Math.PI + 1.0));
}
- private void acos(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"ACOS(1) ");
- assure("ACOS(1) failed!",(float)row.getDouble(1) == 0.0 );
+
+ private void acos(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "ACOS(1) ");
+ assure("ACOS(1) failed!", (float) row.getDouble(1) == 0.0);
}
- private void asin(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"ASIN(0) ");
- assure("ASIN(0) failed!",(float)row.getDouble(1) == (float)java.lang.Math.asin(0.0) );
+
+ private void asin(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "ASIN(0) ");
+ assure("ASIN(0) failed!", (float) row.getDouble(1) == (float) java.lang.Math.asin(0.0));
}
- private void atan(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"ATAN(0) ");
- assure("ATAN(0) failed!",row.getDouble(1) == 0.0 );
+
+ private void atan(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "ATAN(0) ");
+ assure("ATAN(0) failed!", row.getDouble(1) == 0.0);
}
- private void atan2(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"ATAN2(0,2) ");
- assure("ATAN2(0,2) failed!",(float)row.getDouble(1) == 0.0 );
+
+ private void atan2(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "ATAN2(0,2) ");
+ assure("ATAN2(0,2) failed!", (float) row.getDouble(1) == 0.0);
}
- private void degrees(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"DEGREES(PI()) ");
- assure("DEGREES(PI()) failed!",row.getDouble(1) == 180.0 );
+
+ private void degrees(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "DEGREES(PI()) ");
+ assure("DEGREES(PI()) failed!", row.getDouble(1) == 180.0);
}
- private void radians(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"RADIANS(90) ");
- assure("RADIANS(90) failed!",(float)row.getDouble(1) == (float)(java.lang.Math.PI / 2.0) );
+
+ private void radians(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "RADIANS(90) ");
+ assure("RADIANS(90) failed!", (float) row.getDouble(1) == (float) (java.lang.Math.PI / 2.0));
}
}
diff --git a/connectivity/qa/drivers/dbase/DBaseSqlTests.java b/connectivity/qa/drivers/dbase/DBaseSqlTests.java
new file mode 100755
index 000000000000..0151952ad76b
--- /dev/null
+++ b/connectivity/qa/drivers/dbase/DBaseSqlTests.java
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * 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: DBaseStringFunctions.java,v $
+ * $Revision: 1.6 $
+ *
+ * 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 qa.drivers.dbase;
+
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.sdbc.*;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+
+public class DBaseSqlTests
+{
+ private final XMultiServiceFactory m_xORB;
+ private final DBaseDriverTest testcase;
+
+ public DBaseSqlTests(final XMultiServiceFactory _xORB,final DBaseDriverTest _testcase)
+ {
+ m_xORB = _xORB;
+ testcase = _testcase;
+ }
+
+ private void assure(final String s,final boolean b)
+ {
+ testcase.assure2(s, b);
+ }
+
+ public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class,
+ m_xORB.createInstance("com.sun.star.sdb.RowSet"));
+
+ testcase.getLog().println("starting SQL test");
+ // set the properties needed to connect to a database
+ final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+ xProp.setPropertyValue("DataSourceName", "Bibliography");
+ xProp.setPropertyValue("CommandType", Integer.valueOf(com.sun.star.sdb.CommandType.COMMAND));
+
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where \"Identifier\" like 'B%'");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where not \"Identifier\" like 'B%'");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where not \"Identifier\" not like 'B%'");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where not(0 = 1)");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where 0 = 0");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where (0 = 0)");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where 0 <> 1");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where 0 < 1");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where 2 > 1");
+ execute(xRowRes,"1,1+1,'a' + 'b' FROM \"biblio\" \"biblio\" where 2 > 1");
+ // execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where (0 = 0) is true");
+ // execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where not (0 = 0) is not true");
+ // execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where 1 between 0 and 2");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where not \"Identifier\" is NULL");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where \"Identifier\" is not NULL");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where \"Identifier\" = \"Identifier\"");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where not(not(\"Identifier\" = \"Identifier\"))");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where (1 = 1 and 2 = 1) or 3 = 33 or 4 = 44 or ('a' = 'a' and 'b' = 'b')");
+ }
+
+ private void execute(final XRowSet xRowRes, String sql) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ try
+ {
+ final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+ xProp.setPropertyValue("Command", "SELECT " + sql);
+ xRowRes.execute();
+ }
+ catch(SQLException e)
+ {
+ testcase.getLog().println(sql + " Error: " + e.getMessage());
+ }
+ }
+
+
+}
diff --git a/connectivity/qa/drivers/dbase/DBaseStringFunctions.java b/connectivity/qa/drivers/dbase/DBaseStringFunctions.java
index 09ce4903b6a9..158a3f8e9489 100644
--- a/connectivity/qa/drivers/dbase/DBaseStringFunctions.java
+++ b/connectivity/qa/drivers/dbase/DBaseStringFunctions.java
@@ -27,244 +27,300 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package complex.connectivity;
+package qa.drivers.dbase;
-import complex.connectivity.DBaseDriverTest;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.util.XCloseable;
import com.sun.star.sdbc.*;
-import com.sun.star.sdb.*;
-import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertySet;
-
import com.sun.star.lang.XMultiServiceFactory;
-import complexlib.ComplexTestCase;
-
-import java.io.PrintWriter;
-
-import util.utils;
-import java.util.*;
-import java.io.*;
-
+public class DBaseStringFunctions
+{
+ private String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
+ private final XMultiServiceFactory m_xORB;
+ private final DBaseDriverTest testcase;
-public class DBaseStringFunctions {
-
- private String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
- private XMultiServiceFactory m_xORB;
- private DBaseDriverTest testcase;
- public DBaseStringFunctions(XMultiServiceFactory _xORB,DBaseDriverTest _testcase){
- m_xORB = _xORB;
- testcase = _testcase;
- }
+ public DBaseStringFunctions(final XMultiServiceFactory _xORB,final DBaseDriverTest _testcase)
+ {
+ m_xORB = _xORB;
+ testcase = _testcase;
+ }
- private void assure(String s,boolean b){
- testcase.assure2(s,b);
- }
+ private void assure(final String s,final boolean b)
+ {
+ testcase.assure2(s, b);
+ }
- public void testFunctions() throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRowSet xRowRes = (XRowSet)UnoRuntime.queryInterface(XRowSet.class,
- m_xORB.createInstance("com.sun.star.sdb.RowSet"));
+ public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class,
+ m_xORB.createInstance("com.sun.star.sdb.RowSet"));
- System.out.println("starting String function test");
+ testcase.getLog().println("starting String function test");
// set the properties needed to connect to a database
- XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
- xProp.setPropertyValue("DataSourceName","Bibliography");
+ final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+ xProp.setPropertyValue("DataSourceName", "Bibliography");
- xProp.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.COMMAND));
+ xProp.setPropertyValue("CommandType", Integer.valueOf(com.sun.star.sdb.CommandType.COMMAND));
- try {
- upper(xRowRes);
- } catch( SQLException ex){
- assure("upper " + ex.getMessage(),false);
+ try
+ {
+ upper(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("upper " + ex.getMessage(), false);
throw ex;
}
- try{
- lower(xRowRes);
- } catch( SQLException ex){
- assure("lower " + ex.getMessage(),false);
+ try
+ {
+ lower(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("lower " + ex.getMessage(), false);
throw ex;
}
- try{
- acsii(xRowRes);
- } catch( SQLException ex){
- assure("ascii " + ex.getMessage(),false);
+ try
+ {
+ acsii(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("ascii " + ex.getMessage(), false);
throw ex;
}
- try{
- char_length(xRowRes);
- } catch( SQLException ex){
- assure("char_len " + ex.getMessage(),false);
+ try
+ {
+ char_length(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("char_len " + ex.getMessage(), false);
throw ex;
}
- try{
- concat(xRowRes);
- } catch( SQLException ex){
- assure("concat " + ex.getMessage(),false);
+ try
+ {
+ concat(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("concat " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
chartest(xRowRes);
- } catch( SQLException ex){
- assure("char " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("char " + ex.getMessage(), false);
throw ex;
}
- try{
- locate(xRowRes);
- } catch( SQLException ex){
- assure("locate " + ex.getMessage(),false);
+ try
+ {
+ locate(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("locate " + ex.getMessage(), false);
throw ex;
}
- try{
- substring(xRowRes);
- } catch( SQLException ex){
- assure("substr " + ex.getMessage(),false);
+ try
+ {
+ substring(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("substr " + ex.getMessage(), false);
throw ex;
}
- try{
- ltrim(xRowRes);
- } catch( SQLException ex){
- assure("ltrim " + ex.getMessage(),false);
+ try
+ {
+ ltrim(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("ltrim " + ex.getMessage(), false);
throw ex;
}
- try{
- rtrim(xRowRes);
- } catch( SQLException ex){
- assure("rtrim " + ex.getMessage(),false);
+ try
+ {
+ rtrim(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("rtrim " + ex.getMessage(), false);
throw ex;
}
- try{
- space(xRowRes);
- } catch( SQLException ex){
- assure("space " + ex.getMessage(),false);
+ try
+ {
+ space(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("space " + ex.getMessage(), false);
throw ex;
}
- try{
- replace(xRowRes);
- } catch( SQLException ex){
- assure("replace " + ex.getMessage(),false);
+ try
+ {
+ replace(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("replace " + ex.getMessage(), false);
throw ex;
}
- try{
- repeat(xRowRes);
- } catch( SQLException ex){
- assure("repeat " + ex.getMessage(),false);
+ try
+ {
+ repeat(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("repeat " + ex.getMessage(), false);
throw ex;
}
- try{
- insert(xRowRes);
- } catch( SQLException ex){
- assure("insert " + ex.getMessage(),false);
+ try
+ {
+ insert(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("insert " + ex.getMessage(), false);
throw ex;
}
- try{
- left(xRowRes);
- } catch( SQLException ex){
- assure("left " + ex.getMessage(),false);
+ try
+ {
+ left(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("left " + ex.getMessage(), false);
throw ex;
}
- try{
- right(xRowRes);
- } catch( SQLException ex){
- assure("right " + ex.getMessage(),false);
+ try
+ {
+ right(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("right " + ex.getMessage(), false);
throw ex;
}
}
- private XRow execute(XRowSet xRowRes,String sql) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
- xProp.setPropertyValue("Command","SELECT " + sql + where);
+ private XRow execute(final XRowSet xRowRes, String sql) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+ xProp.setPropertyValue("Command", "SELECT " + sql + where);
xRowRes.execute();
- XResultSet xRes = (XResultSet)UnoRuntime.queryInterface(XResultSet.class,xRowRes);
- assure("No valid row! ",xRes.next());
+ final XResultSet xRes = (XResultSet) UnoRuntime.queryInterface(XResultSet.class, xRowRes);
+ assure("No valid row! ", xRes.next());
- return (XRow)UnoRuntime.queryInterface(XRow.class, xRes);
+ return (XRow) UnoRuntime.queryInterface(XRow.class, xRes);
}
- private void upper(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"upper('test'),UCASE('test') ");
- assure("upper('test') failed!",row.getString(1).equals("TEST"));
- assure("ucase('test') failed!",row.getString(2).equals("TEST"));
+ private void upper(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "upper('test'),UCASE('test') ");
+ assure("upper('test') failed!", row.getString(1).equals("TEST"));
+ assure("ucase('test') failed!", row.getString(2).equals("TEST"));
}
- private void lower(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"lower('TEST'),LCASE('TEST') ");
- assure("lower('TEST') failed!",row.getString(1).equals("test"));
- assure("lcase('TEST') failed!",row.getString(2).equals("test"));
- final String t = where;
+ private void lower(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "lower('TEST'),LCASE('TEST') ");
+ assure("lower('TEST') failed!", row.getString(1).equals("test"));
+ assure("lcase('TEST') failed!", row.getString(2).equals("test"));
+ final String temp = where;
where = "FROM \"biblio\" \"biblio\" where LOWER(\"Identifier\") like 'bor%'";
- row = execute(xRowRes,"lower('TEST'),LCASE('TEST') ");
- where = t;
+ execute(xRowRes, "lower('TEST'),LCASE('TEST') ");
+ where = temp;
}
- private void acsii(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"ASCII('2') ");
- assure("acsii('2') failed!",row.getInt(1) == 50);
+ private void acsii(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "ASCII('2') ");
+ assure("acsii('2') failed!", row.getInt(1) == 50);
}
- private void char_length(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"char_length('test'),character_length('test'),OCTET_LENGTH('test') ");
- assure("char_length('test') failed!",row.getInt(1) == 4);
- assure("character_length('test') failed!",row.getInt(2) == 4);
- assure("OCTET_LENGTH('test') failed!",row.getInt(3) == 4);
+ private void char_length(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "char_length('test'),character_length('test'),OCTET_LENGTH('test') ");
+ assure("char_length('test') failed!", row.getInt(1) == 4);
+ assure("character_length('test') failed!", row.getInt(2) == 4);
+ assure("OCTET_LENGTH('test') failed!", row.getInt(3) == 4);
}
- private void concat(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"CONCAT('Hello',' ','World') ");
- assure("CONCAT('Hello',' ',,'World') failed!",row.getString(1).equals("Hello World"));
+ private void concat(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "CONCAT('Hello',' ','World') ");
+ assure("CONCAT('Hello',' ',,'World') failed!", row.getString(1).equals("Hello World"));
}
- private void locate(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"LOCATE('bar', 'foobarbar') ");
- assure("LOCATE('bar', 'foobarbar') failed!",row.getInt(1) == 4);
+ private void locate(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "LOCATE('bar', 'foobarbar') ");
+ assure("LOCATE('bar', 'foobarbar') failed!", row.getInt(1) == 4);
}
- private void substring(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"SUBSTRING('Quadratically',5) ");
- assure("SUBSTRING('Quadratically',5) failed!",row.getString(1).equals("ratically"));
+ private void substring(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "SUBSTRING('Quadratically',5) ");
+ assure("SUBSTRING('Quadratically',5) failed!", row.getString(1).equals("ratically"));
}
- private void ltrim(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"LTRIM(' barbar') ");
- assure("LTRIM(' barbar') failed!",row.getString(1).equals("barbar"));
+ private void ltrim(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "LTRIM(' barbar') ");
+ assure("LTRIM(' barbar') failed!", row.getString(1).equals("barbar"));
}
- private void rtrim(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"RTRIM('barbar ') ");
- assure("RTRIM('barbar ') failed!",row.getString(1).equals( "barbar"));
+ private void rtrim(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "RTRIM('barbar ') ");
+ assure("RTRIM('barbar ') failed!", row.getString(1).equals("barbar"));
}
- private void space(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"space(6) ");
- assure("space(6) failed!",row.getString(1).equals(" "));
+ private void space(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "space(6) ");
+ assure("space(6) failed!", row.getString(1).equals(" "));
}
- private void replace(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"REPLACE('www.OOo.com', 'w', 'Ww') ");
- assure("REPLACE('www.OOo.com', 'w', 'Ww') failed!",row.getString(1).equals("WwWwWw.OOo.com"));
+ private void replace(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "REPLACE('www.OOo.com', 'w', 'Ww') ");
+ assure("REPLACE('www.OOo.com', 'w', 'Ww') failed!", row.getString(1).equals("WwWwWw.OOo.com"));
}
- private void repeat(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"REPEAT('OOo', 3) ");
- assure("REPEAT('OOo', 3) failed!",row.getString(1).equals("OOoOOoOOo"));
+ private void repeat(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "REPEAT('OOo', 3) ");
+ assure("REPEAT('OOo', 3) failed!", row.getString(1).equals("OOoOOoOOo"));
}
- private void insert(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"INSERT('Quadratic', 3, 4, 'What') ");
- assure("INSERT('Quadratic', 3, 4, 'What') failed!",row.getString(1).equals("QuWhattic"));
+ private void insert(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "INSERT('Quadratic', 3, 4, 'What') ");
+ assure("INSERT('Quadratic', 3, 4, 'What') failed!", row.getString(1).equals("QuWhattic"));
}
- private void left(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"LEFT('foobarbar', 5) ");
- assure("LEFT('foobarbar', 5) failed!",row.getString(1).equals("fooba"));
+ private void left(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "LEFT('foobarbar', 5) ");
+ assure("LEFT('foobarbar', 5) failed!", row.getString(1).equals("fooba"));
}
- private void right(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"RIGHT('foobarbar', 4) ");
- assure("RIGHT('foobarbar', 4) failed!",row.getString(1).equals("rbar"));
+ private void right(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "RIGHT('foobarbar', 4) ");
+ assure("RIGHT('foobarbar', 4) failed!", row.getString(1).equals("rbar"));
}
- private void chartest(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"CHAR(ascii('t'),ascii('e'),ascii('s'),ascii('t')) ");
- assure("CHAR(ascii('t'),ascii('e'),ascii('s'),ascii('t')) failed!",row.getString(1).equals("test"));
+
+ private void chartest(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "CHAR(ascii('t'),ascii('e'),ascii('s'),ascii('t')) ");
+ assure("CHAR(ascii('t'),ascii('e'),ascii('s'),ascii('t')) failed!", row.getString(1).equals("test"));
}
}
diff --git a/connectivity/qa/drivers/dbase/makefile.mk b/connectivity/qa/drivers/dbase/makefile.mk
index f7d2f79a7432..4544b2a2bc62 100644
--- a/connectivity/qa/drivers/dbase/makefile.mk
+++ b/connectivity/qa/drivers/dbase/makefile.mk
@@ -32,7 +32,7 @@
PRJ = ..$/..$/..
TARGET = DBaseDriverTest
PRJNAME = connectivity
-PACKAGE = complex$/connectivity
+PACKAGE = qa$/drivers$/dbase
# --- Settings -----------------------------------------------------
.INCLUDE: settings.mk
@@ -45,7 +45,8 @@ JAVAFILES =\
DBaseDateFunctions.java\
DBaseDriverTest.java\
DBaseNumericFunctions.java\
- DBaseStringFunctions.java
+ DBaseStringFunctions.java\
+ DBaseSqlTests.java
JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
@@ -62,6 +63,6 @@ JARCOMPRESS = TRUE
.INCLUDE : target.mk
-run:
- java -cp "$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar" org.openoffice.Runner -TestBase java_complex -o complex.connectivity.$(TARGET)
+run: $(CLASSDIR)$/$(JARTARGET)
+ java -cp "$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar" org.openoffice.Runner -TestBase java_complex -o qa.drivers.dbase.$(TARGET)
diff --git a/connectivity/source/commontools/ConnectionWrapper.cxx b/connectivity/source/commontools/ConnectionWrapper.cxx
index 450243c0295c..8a4ee0272251 100644
--- a/connectivity/source/commontools/ConnectionWrapper.cxx
+++ b/connectivity/source/commontools/ConnectionWrapper.cxx
@@ -109,7 +109,7 @@ void OConnectionWrapper::setDelegation(const Reference< XConnection >& _xConnect
// -----------------------------------------------------------------------------
void OConnectionWrapper::disposing()
{
- m_xConnection = NULL;
+m_xConnection.clear();
}
//-----------------------------------------------------------------------------
OConnectionWrapper::~OConnectionWrapper()
diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx
index 5c43e5d50cf1..010cfbcf5f34 100644
--- a/connectivity/source/commontools/DateConversion.cxx
+++ b/connectivity/source/commontools/DateConversion.cxx
@@ -45,6 +45,7 @@
#include "TConnection.hxx"
#include "diagnose_ex.h"
#include <comphelper/numbers.hxx>
+#include <rtl/ustrbuf.hxx>
using namespace ::connectivity;
@@ -63,7 +64,7 @@ using namespace ::com::sun::star::beans;
::rtl::OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, sal_Bool bQuote,
const Reference< XTypeConverter >& _rxTypeConverter)
{
- ::rtl::OUString aRet;
+ ::rtl::OUStringBuffer aRet;
if (_rVal.hasValue())
{
try
@@ -78,17 +79,22 @@ using namespace ::com::sun::star::beans;
if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_BOOLEAN)
{
if (::cppu::any2bool(_rVal))
- aRet = ::rtl::OUString::createFromAscii("1");
+ aRet.appendAscii("1");
else
- aRet = ::rtl::OUString::createFromAscii("0");
+ aRet.appendAscii("0");
}
else
- _rxTypeConverter->convertToSimpleType(_rVal, TypeClass_STRING) >>= aRet;
+ {
+ ::rtl::OUString sTemp;
+ _rxTypeConverter->convertToSimpleType(_rVal, TypeClass_STRING) >>= sTemp;
+ aRet.append(sTemp);
+ }
break;
case DataType::CHAR:
case DataType::VARCHAR:
+ case DataType::LONGVARCHAR:
if (bQuote)
- aRet += ::rtl::OUString::createFromAscii("'");
+ aRet.appendAscii("'");
{
::rtl::OUString aTemp;
_rxTypeConverter->convertToSimpleType(_rVal, TypeClass_STRING) >>= aTemp;
@@ -103,17 +109,22 @@ using namespace ::com::sun::star::beans;
aTemp = aTemp.replaceAt(nIndex,sQuot.getLength(),sQuotToReplace);
} while (nIndex != -1);
- aRet += aTemp;
+ aRet.append(aTemp);
}
if (bQuote)
- aRet += ::rtl::OUString::createFromAscii("'");
+ aRet.appendAscii("'");
break;
case DataType::REAL:
case DataType::DOUBLE:
case DataType::DECIMAL:
case DataType::NUMERIC:
case DataType::BIGINT:
- _rxTypeConverter->convertToSimpleType(_rVal, TypeClass_STRING) >>= aRet;
+ default:
+ {
+ ::rtl::OUString sTemp;
+ _rxTypeConverter->convertToSimpleType(_rVal, TypeClass_STRING) >>= sTemp;
+ aRet.append(sTemp);
+ }
break;
case DataType::TIMESTAMP:
{
@@ -122,9 +133,11 @@ using namespace ::com::sun::star::beans;
// check if this is really a timestamp or only a date
if ( _rVal >>= aDateTime )
{
- if (bQuote) aRet += ::rtl::OUString::createFromAscii("{TS '");
- aRet += DBTypeConversion::toDateTimeString(aDateTime);
- if (bQuote) aRet += ::rtl::OUString::createFromAscii("'}");
+ if (bQuote)
+ aRet.appendAscii("{TS '");
+ aRet.append(DBTypeConversion::toDateTimeString(aDateTime));
+ if (bQuote)
+ aRet.appendAscii("'}");
break;
}
break;
@@ -133,20 +146,22 @@ using namespace ::com::sun::star::beans;
{
Date aDate;
OSL_VERIFY_RES( _rVal >>= aDate, "DBTypeConversion::toSQLString: _rVal is not date!");
- if (bQuote) aRet += ::rtl::OUString::createFromAscii("{D '");
- aRet += DBTypeConversion::toDateString(aDate);;
- if (bQuote) aRet += ::rtl::OUString::createFromAscii("'}");
+ if (bQuote)
+ aRet.appendAscii("{D '");
+ aRet.append(DBTypeConversion::toDateString(aDate));
+ if (bQuote)
+ aRet.appendAscii("'}");
} break;
case DataType::TIME:
{
Time aTime;
OSL_VERIFY_RES( _rVal >>= aTime,"DBTypeConversion::toSQLString: _rVal is not time!");
- if (bQuote) aRet += ::rtl::OUString::createFromAscii("{T '");
- aRet += DBTypeConversion::toTimeString(aTime);
- if (bQuote) aRet += ::rtl::OUString::createFromAscii("'}");
+ if (bQuote)
+ aRet.appendAscii("{T '");
+ aRet.append(DBTypeConversion::toTimeString(aTime));
+ if (bQuote)
+ aRet.appendAscii("'}");
} break;
- default:
- _rxTypeConverter->convertToSimpleType(_rVal, TypeClass_STRING) >>= aRet;
}
}
catch ( const Exception& )
@@ -155,8 +170,8 @@ using namespace ::com::sun::star::beans;
}
}
else
- aRet = ::rtl::OUString::createFromAscii(" NULL ");
- return aRet;
+ aRet.appendAscii(" NULL ");
+ return aRet.makeStringAndClear();
}
// -----------------------------------------------------------------------------
Date DBTypeConversion::getNULLDate(const Reference< XNumberFormatsSupplier > &xSupplier)
diff --git a/connectivity/source/commontools/DriversConfig.cxx b/connectivity/source/commontools/DriversConfig.cxx
index 906024f452a4..a72816d6427b 100755
--- a/connectivity/source/commontools/DriversConfig.cxx
+++ b/connectivity/source/commontools/DriversConfig.cxx
@@ -139,6 +139,29 @@ DriversConfig::DriversConfig(const uno::Reference< lang::XMultiServiceFactory >&
{
m_aNode->Load(_rxORB,m_aDrivers);
}
+
+// -----------------------------------------------------------------------------
+DriversConfig::~DriversConfig()
+{
+}
+
+// -----------------------------------------------------------------------------
+DriversConfig::DriversConfig( const DriversConfig& _rhs )
+{
+ *this = _rhs;
+}
+
+// -----------------------------------------------------------------------------
+DriversConfig& DriversConfig::operator=( const DriversConfig& _rhs )
+{
+ if ( this != &_rhs )
+ {
+ m_aDrivers = _rhs.m_aDrivers;
+ m_aNode = _rhs.m_aNode;
+ }
+ return *this;
+}
+
// -----------------------------------------------------------------------------
::rtl::OUString DriversConfig::getDriverFactoryName(const ::rtl::OUString& _sURL) const
{
diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
index 9c3acfb606d5..afa53652d4e6 100644
--- a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
@@ -133,7 +133,7 @@ void ODatabaseMetaDataResultSet::disposing(void)
::osl::MutexGuard aGuard(m_aMutex);
m_aStatement = NULL;
- m_xMetaData = NULL;
+m_xMetaData.clear();
m_aRowsIter = m_aRows.end();
m_aRows.clear();
m_aRowsIter = m_aRows.end();
diff --git a/connectivity/source/commontools/RowFunctionParser.cxx b/connectivity/source/commontools/RowFunctionParser.cxx
index 541df8e6b2cc..15221ed0e260 100644
--- a/connectivity/source/commontools/RowFunctionParser.cxx
+++ b/connectivity/source/commontools/RowFunctionParser.cxx
@@ -40,7 +40,7 @@
#include <typeinfo>
#define BOOST_SPIRIT_DEBUG
#endif
-#include <boost/spirit/core.hpp>
+#include <boost/spirit/include/classic_core.hpp>
#include "RowFunctionParser.hxx"
#include <rtl/ustring.hxx>
#include <tools/fract.hxx>
diff --git a/connectivity/source/commontools/TColumnsHelper.cxx b/connectivity/source/commontools/TColumnsHelper.cxx
index 2ce570e95936..8d02cfccab4a 100644
--- a/connectivity/source/commontools/TColumnsHelper.cxx
+++ b/connectivity/source/commontools/TColumnsHelper.cxx
@@ -37,6 +37,9 @@
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/ColumnValue.hpp>
+#include <com/sun/star/sdbcx/KeyType.hpp>
+#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
+#include <com/sun/star/sdbcx/XKeysSupplier.hpp>
#include <comphelper/types.hxx>
#include "connectivity/dbtools.hxx"
#include "TConnection.hxx"
@@ -51,7 +54,7 @@ using namespace connectivity;
using namespace dbtools;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
-// using namespace ::com::sun::star::sdbcx;
+using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
@@ -114,17 +117,67 @@ sdbcx::ObjectType OColumnsHelper::createObject(const ::rtl::OUString& _rName)
bAutoIncrement = aFind->second.first.first;
bIsCurrency = aFind->second.first.second;
nDataType = aFind->second.second;
- }
+ } // if ( aFind != m_pImpl->m_aColumnInfo.end() )
+ sdbcx::ObjectType xRet;
+ const ColumnDesc* pColDesc = m_pTable->getColumnDescription(_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;++)
+ }
+ }
+ sal_Int32 nField11 = pColDesc->nField11;
+ if ( nField11 != ColumnValue::NO_NULLS && xPrimaryKeyColumns.is() && xPrimaryKeyColumns->hasByName(_rName) )
+ {
+ nField11 = ColumnValue::NO_NULLS;
+ } // if ( xKeys.is() )
+ connectivity::sdbcx::OColumn* pRet = new connectivity::sdbcx::OColumn(_rName,
+ pColDesc->aField6,
+ pColDesc->sField13,
+ nField11,
+ pColDesc->nField7,
+ pColDesc->nField9,
+ pColDesc->nField5,
+ bAutoIncrement,
+ sal_False,
+ bIsCurrency,
+ isCaseSensitive());
+
+ xRet = pRet;
+ }
+ else
+ {
- sdbcx::ObjectType xRet(::dbtools::createSDBCXColumn( m_pTable,
- xConnection,
- _rName,
- isCaseSensitive(),
- bQueryInfo,
- bAutoIncrement,
- bIsCurrency,
- nDataType),UNO_QUERY);
+ xRet.set(::dbtools::createSDBCXColumn( m_pTable,
+ xConnection,
+ _rName,
+ isCaseSensitive(),
+ bQueryInfo,
+ bAutoIncrement,
+ bIsCurrency,
+ nDataType),UNO_QUERY);
+ }
return xRet;
}
diff --git a/connectivity/source/commontools/TDatabaseMetaDataBase.cxx b/connectivity/source/commontools/TDatabaseMetaDataBase.cxx
index 5f5aaabe5c72..b3cbb4ae67c7 100644
--- a/connectivity/source/commontools/TDatabaseMetaDataBase.cxx
+++ b/connectivity/source/commontools/TDatabaseMetaDataBase.cxx
@@ -90,8 +90,8 @@ Sequence< PropertyValue > SAL_CALL ODatabaseMetaDataBase::getConnectionInfo( )
void SAL_CALL ODatabaseMetaDataBase::disposing( const EventObject& /*Source*/ ) throw(RuntimeException)
{
// cut off all references to the connection
- m_xConnection = NULL;
- m_xListenerHelper = NULL;
+m_xConnection.clear();
+m_xListenerHelper.clear();
}
// -----------------------------------------------------------------------------
Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getTypeInfo( ) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/commontools/TIndexColumns.cxx b/connectivity/source/commontools/TIndexColumns.cxx
index 00a153ceeed0..89fa282f2e74 100644
--- a/connectivity/source/commontools/TIndexColumns.cxx
+++ b/connectivity/source/commontools/TIndexColumns.cxx
@@ -85,7 +85,7 @@ sdbcx::ObjectType OIndexColumns::createObject(const ::rtl::OUString& _rName)
m_pIndex->getTable()->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)),
aSchema,aTable,_rName);
- sdbcx::ObjectType xRet = NULL;
+ sdbcx::ObjectType xRet;
if ( xResult.is() )
{
Reference< XRow > xRow(xResult,UNO_QUERY);
diff --git a/connectivity/source/commontools/TIndexes.cxx b/connectivity/source/commontools/TIndexes.cxx
index 3257f8c984c0..cf17b7a51411 100644
--- a/connectivity/source/commontools/TIndexes.cxx
+++ b/connectivity/source/commontools/TIndexes.cxx
@@ -97,8 +97,8 @@ sdbcx::ObjectType OIndexesHelper::createObject(const ::rtl::OUString& _rName)
{
sal_Int32 nClustered = xRow->getShort(7);
sal_Bool bPrimarKeyIndex = sal_False;
- xRow = NULL;
- xResult = NULL;
+ xRow.clear();
+ xResult.clear();
try
{
xResult = m_pTable->getMetaData()->getPrimaryKeys(aCatalog,aSchema,aTable);
diff --git a/connectivity/source/commontools/TKey.cxx b/connectivity/source/commontools/TKey.cxx
index c065e11cf24c..1218c752ec50 100644
--- a/connectivity/source/commontools/TKey.cxx
+++ b/connectivity/source/commontools/TKey.cxx
@@ -71,38 +71,43 @@ void OTableKeyHelper::refreshColumns()
::std::vector< ::rtl::OUString> aVector;
if ( !isNew() )
{
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- ::rtl::OUString aSchema,aTable;
- m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= aSchema;
- m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= aTable;
-
- if ( m_Name.getLength() ) // foreign key
+ aVector = m_aProps->m_aKeyColumnNames;
+ if ( aVector.empty() )
{
+ ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
+ ::rtl::OUString aSchema,aTable;
+ m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= aSchema;
+ m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= aTable;
- Reference< XResultSet > xResult = m_pTable->getMetaData()->getImportedKeys(m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)),
- aSchema,aTable);
-
- if ( xResult.is() )
+ if ( m_Name.getLength() ) // foreign key
{
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while( xResult->next() )
+
+ Reference< XResultSet > xResult = m_pTable->getMetaData()->getImportedKeys(m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)),
+ aSchema,aTable);
+
+ if ( xResult.is() )
{
- ::rtl::OUString aForeignKeyColumn = xRow->getString(8);
- if(xRow->getString(12) == m_Name)
- aVector.push_back(aForeignKeyColumn);
+ Reference< XRow > xRow(xResult,UNO_QUERY);
+ while( xResult->next() )
+ {
+ ::rtl::OUString aForeignKeyColumn = xRow->getString(8);
+ if(xRow->getString(12) == m_Name)
+ aVector.push_back(aForeignKeyColumn);
+ }
}
}
- }
- if ( aVector.empty() )
- {
- Reference< XResultSet > xResult = m_pTable->getMetaData()->getPrimaryKeys(m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)),
- aSchema,aTable);
- if ( xResult.is() )
+ if ( aVector.empty() )
{
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while( xResult->next() )
- aVector.push_back(xRow->getString(4));
+ const Reference< XResultSet > xResult = m_pTable->getMetaData()->getPrimaryKeys(m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)),
+ aSchema,aTable);
+
+ if ( xResult.is() )
+ {
+ const Reference< XRow > xRow(xResult,UNO_QUERY);
+ while( xResult->next() )
+ aVector.push_back(xRow->getString(4));
+ } // if ( xResult.is() )
}
}
}
diff --git a/connectivity/source/commontools/TPrivilegesResultSet.cxx b/connectivity/source/commontools/TPrivilegesResultSet.cxx
index 0de0c1e077b5..509d924779de 100644
--- a/connectivity/source/commontools/TPrivilegesResultSet.cxx
+++ b/connectivity/source/commontools/TPrivilegesResultSet.cxx
@@ -127,8 +127,8 @@ const ORowSetValue& OResultSetPrivileges::getValue(sal_Int32 columnIndex)
void SAL_CALL OResultSetPrivileges::disposing(void)
{
ODatabaseMetaDataResultSet::disposing();
- m_xTables = NULL;
- m_xRow = NULL;
+m_xTables.clear();
+m_xRow.clear();
}
// -----------------------------------------------------------------------------
sal_Bool SAL_CALL OResultSetPrivileges::next( ) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx
index ecec91aa6f32..477ec01c0499 100644
--- a/connectivity/source/commontools/TTableHelper.cxx
+++ b/connectivity/source/commontools/TTableHelper.cxx
@@ -38,6 +38,7 @@
#include <cppuhelper/typeprovider.hxx>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/sdbc/ColumnValue.hpp>
+#include <comphelper/implementationreference.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/types.hxx>
@@ -54,16 +55,70 @@ using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
+namespace
+{
+ /// helper class for column property change events which holds the OComponentDefinition weak
+typedef ::cppu::WeakImplHelper1 < XContainerListener > OTableContainerListener_BASE;
+class OTableContainerListener : public OTableContainerListener_BASE
+{
+ OTableHelper* m_pComponent;
+ ::std::map< ::rtl::OUString,bool> m_aRefNames;
+
+ OTableContainerListener(const OTableContainerListener&);
+ void operator =(const OTableContainerListener&);
+protected:
+ virtual ~OTableContainerListener(){}
+public:
+ OTableContainerListener(OTableHelper* _pComponent) : m_pComponent(_pComponent){}
+ virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& /*Event*/ ) throw (RuntimeException)
+ {
+ }
+ virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (RuntimeException)
+ {
+ ::rtl::OUString sName;
+ Event.Accessor >>= sName;
+ if ( m_aRefNames.find(sName) != m_aRefNames.end() )
+ m_pComponent->refreshKeys();
+ }
+ virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (RuntimeException)
+ {
+ ::rtl::OUString sOldComposedName,sNewComposedName;
+ Event.ReplacedElement >>= sOldComposedName;
+ Event.Accessor >>= sNewComposedName;
+ if ( sOldComposedName != sNewComposedName && m_aRefNames.find(sOldComposedName) != m_aRefNames.end() )
+ m_pComponent->refreshKeys();
+ }
+ // XEventListener
+ virtual void SAL_CALL disposing( const EventObject& /*_rSource*/ ) throw (RuntimeException)
+ {
+ }
+ void clear() { m_pComponent = NULL; }
+ inline void add(const ::rtl::OUString& _sRefName) { m_aRefNames.insert(::std::map< ::rtl::OUString,bool>::value_type(_sRefName,true)); }
+};
+}
+namespace connectivity
+{
+ struct OTableHelperImpl
+ {
+ TKeyMap m_aKeys;
+ Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
+ Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
+ ::comphelper::ImplementationReference< OTableContainerListener,XContainerListener>
+ m_xTablePropertyListener;
+ ::std::vector< ColumnDesc > m_aColumnDesc;
+ };
+}
OTableHelper::OTableHelper( sdbcx::OCollection* _pTables,
const Reference< XConnection >& _xConnection,
sal_Bool _bCase)
:OTable_TYPEDEF(_pTables,_bCase)
- ,m_xConnection(_xConnection)
+ ,m_pImpl(new OTableHelperImpl)
{
try
{
- m_xMetaData = m_xConnection->getMetaData();
+ m_pImpl->m_xConnection = _xConnection;
+ m_pImpl->m_xMetaData = m_pImpl->m_xConnection->getMetaData();
}
catch(const Exception&)
{
@@ -85,42 +140,41 @@ OTableHelper::OTableHelper( sdbcx::OCollection* _pTables,
_Description,
_SchemaName,
_CatalogName)
- ,m_xConnection(_xConnection)
+ ,m_pImpl(new OTableHelperImpl)
{
try
{
- m_xMetaData = m_xConnection->getMetaData();
+ m_pImpl->m_xConnection = _xConnection;
+ m_pImpl->m_xMetaData = m_pImpl->m_xConnection->getMetaData();
}
catch(const Exception&)
{
}
}
// -----------------------------------------------------------------------------
+OTableHelper::~OTableHelper()
+{
+}
+// -----------------------------------------------------------------------------
void SAL_CALL OTableHelper::disposing()
{
- OTable_TYPEDEF::disposing();
::osl::MutexGuard aGuard(m_aMutex);
- m_xConnection = NULL;
- m_xMetaData = NULL;
+ if ( m_pImpl->m_xTablePropertyListener.is() )
+ {
+ m_pTables->removeContainerListener(m_pImpl->m_xTablePropertyListener.getRef());
+ m_pImpl->m_xTablePropertyListener->clear();
+ m_pImpl->m_xTablePropertyListener.dispose();
+ }
+ OTable_TYPEDEF::disposing();
+
+ m_pImpl->m_xConnection = NULL;
+ m_pImpl->m_xMetaData = NULL;
+
}
// -------------------------------------------------------------------------
namespace
{
- typedef sal_Int32 OrdinalPosition;
- struct ColumnDesc
- {
- ::rtl::OUString sName;
- OrdinalPosition nOrdinalPosition;
-
- ColumnDesc() {}
- ColumnDesc( const ::rtl::OUString& _rName, OrdinalPosition _nPosition )
- :sName( _rName )
- ,nOrdinalPosition( _nPosition )
- {
- }
- };
-
/** collects ColumnDesc's from a resultset produced by XDatabaseMetaData::getColumns
*/
void lcl_collectColumnDescs_throw( const Reference< XResultSet >& _rxResult, ::std::vector< ColumnDesc >& _out_rColumns )
@@ -131,8 +185,14 @@ namespace
while ( _rxResult->next() )
{
sName = xRow->getString( 4 ); // COLUMN_NAME
+ sal_Int32 nField5 = xRow->getInt(5);
+ ::rtl::OUString aField6 = xRow->getString(6);
+ sal_Int32 nField7 = xRow->getInt(7)
+ , nField9 = xRow->getInt(9)
+ , nField11= xRow->getInt(11);
+ ::rtl::OUString sField13 = xRow->getString(13);
nOrdinalPosition = xRow->getInt( 17 ); // ORDINAL_POSITION
- _out_rColumns.push_back( ColumnDesc( sName, nOrdinalPosition ) );
+ _out_rColumns.push_back( ColumnDesc( sName,nField5,aField6,nField7,nField9,nField11,sField13, nOrdinalPosition ) );
}
}
@@ -201,16 +261,16 @@ void OTableHelper::refreshColumns()
) );
// collect the column names, together with their ordinal position
- ::std::vector< ColumnDesc > aColumns;
- lcl_collectColumnDescs_throw( xResult, aColumns );
+ m_pImpl->m_aColumnDesc.clear();
+ lcl_collectColumnDescs_throw( xResult, m_pImpl->m_aColumnDesc );
// ensure that the ordinal positions as obtained from the meta data do make sense
- lcl_sanitizeColumnDescs( aColumns );
+ lcl_sanitizeColumnDescs( m_pImpl->m_aColumnDesc );
// sort by ordinal position
::std::map< OrdinalPosition, ::rtl::OUString > aSortedColumns;
- for ( ::std::vector< ColumnDesc >::const_iterator copy = aColumns.begin();
- copy != aColumns.end();
+ for ( ::std::vector< ColumnDesc >::const_iterator copy = m_pImpl->m_aColumnDesc.begin();
+ copy != m_pImpl->m_aColumnDesc.end();
++copy
)
aSortedColumns[ copy->nOrdinalPosition ] = copy->sName;
@@ -229,6 +289,21 @@ void OTableHelper::refreshColumns()
else
m_pColumns = createColumns(aVector);
}
+// -----------------------------------------------------------------------------
+const ColumnDesc* OTableHelper::getColumnDescription(const ::rtl::OUString& _sName) const
+{
+ const ColumnDesc* pRet = NULL;
+ ::std::vector< ColumnDesc >::const_iterator aEnd = m_pImpl->m_aColumnDesc.end();
+ for (::std::vector< ColumnDesc >::const_iterator aIter = m_pImpl->m_aColumnDesc.begin();aIter != aEnd;++aIter)
+ {
+ if ( aIter->sName == _sName )
+ {
+ pRet = &*aIter;
+ break;
+ }
+ } // for (::std::vector< ColumnDesc >::const_iterator aIter = m_pImpl->m_aColumnDesc.begin();aIter != aEnd;++aIter)
+ return pRet;
+}
// -------------------------------------------------------------------------
void OTableHelper::refreshPrimaryKeys(TStringVector& _rNames)
{
@@ -237,14 +312,26 @@ void OTableHelper::refreshPrimaryKeys(TStringVector& _rNames)
aCatalog <<= m_CatalogName;
Reference< XResultSet > xResult = getMetaData()->getPrimaryKeys(aCatalog,m_SchemaName,m_Name);
- if ( xResult.is() && xResult->next() )
+ if ( xResult.is() )
{
- Reference< XRow > xRow(xResult,UNO_QUERY);
- const ::rtl::OUString aPkName = xRow->getString(6);
- m_aKeys.insert(TKeyMap::value_type(aPkName,sdbcx::TKeyProperties(new sdbcx::KeyProperties(::rtl::OUString(),KeyType::PRIMARY,0,0))));
+ sdbcx::TKeyProperties pKeyProps(new sdbcx::KeyProperties(::rtl::OUString(),KeyType::PRIMARY,0,0));
+ ::rtl::OUString aPkName;
+ bool bAlreadyFetched = false;
+ const Reference< XRow > xRow(xResult,UNO_QUERY);
+ while ( xResult->next() )
+ {
+ pKeyProps->m_aKeyColumnNames.push_back(xRow->getString(4));
+ if ( !bAlreadyFetched )
+ {
+ aPkName = xRow->getString(6);
+ bAlreadyFetched = true;
+ }
+ }
+
+ m_pImpl->m_aKeys.insert(TKeyMap::value_type(aPkName,pKeyProps));
_rNames.push_back(aPkName);
- ::comphelper::disposeComponent(xResult);
- }
+ } // if ( xResult.is() && xResult->next() )
+ ::comphelper::disposeComponent(xResult);
}
// -------------------------------------------------------------------------
void OTableHelper::refreshForgeinKeys(TStringVector& _rNames)
@@ -257,7 +344,8 @@ void OTableHelper::refreshForgeinKeys(TStringVector& _rNames)
if ( xRow.is() )
{
- ::rtl::OUString aName,sCatalog,aSchema;
+ sdbcx::TKeyProperties pKeyProps;
+ ::rtl::OUString aName,sCatalog,aSchema,sOldFKName;
while( xResult->next() )
{
// this must be outsid the "if" because we have to call in a right order
@@ -267,29 +355,51 @@ void OTableHelper::refreshForgeinKeys(TStringVector& _rNames)
aSchema = xRow->getString(2);
aName = xRow->getString(3);
- const sal_Int32 nKeySeq = xRow->getInt(9);
+ const ::rtl::OUString sForeignKeyColumn = xRow->getString(8);
const sal_Int32 nUpdateRule = xRow->getInt(10);
const sal_Int32 nDeleteRule = xRow->getInt(11);
+ const ::rtl::OUString sFkName = xRow->getString(12);
+
+ if ( pKeyProps.get() )
+ {
+ }
+
- if ( nKeySeq == 1 )
- { // only append when the sequnce number is 1 to forbid serveral inserting the same key name
- const ::rtl::OUString sFkName = xRow->getString(12);
- if ( sFkName.getLength() && !xRow->wasNull() )
+ if ( sFkName.getLength() && !xRow->wasNull() )
+ {
+ if ( sOldFKName != sFkName )
{
- ::rtl::OUString sReferencedName;
- sReferencedName = ::dbtools::composeTableName(getMetaData(),sCatalog,aSchema,aName,sal_False,::dbtools::eInDataManipulation);
- m_aKeys.insert(TKeyMap::value_type(sFkName,sdbcx::TKeyProperties(new sdbcx::KeyProperties(sReferencedName,KeyType::FOREIGN,nUpdateRule,nDeleteRule))));
+ if ( pKeyProps.get() )
+ m_pImpl->m_aKeys.insert(TKeyMap::value_type(sOldFKName,pKeyProps));
+
+ const ::rtl::OUString sReferencedName = ::dbtools::composeTableName(getMetaData(),sCatalog,aSchema,aName,sal_False,::dbtools::eInDataManipulation);
+ pKeyProps.reset(new sdbcx::KeyProperties(sReferencedName,KeyType::FOREIGN,nUpdateRule,nDeleteRule));
+ pKeyProps->m_aKeyColumnNames.push_back(sForeignKeyColumn);
_rNames.push_back(sFkName);
+ if ( m_pTables->hasByName(sReferencedName) )
+ {
+ if ( !m_pImpl->m_xTablePropertyListener.is() )
+ m_pImpl->m_xTablePropertyListener = ::comphelper::ImplementationReference< OTableContainerListener,XContainerListener>( new OTableContainerListener(this) );
+ m_pTables->addContainerListener(m_pImpl->m_xTablePropertyListener.getRef());
+ m_pImpl->m_xTablePropertyListener->add(sReferencedName);
+ } // if ( m_pTables->hasByName(sReferencedName) )
+ sOldFKName = sFkName;
+ } // if ( sOldFKName != sFkName )
+ else if ( pKeyProps.get() )
+ {
+ pKeyProps->m_aKeyColumnNames.push_back(sForeignKeyColumn);
}
}
- }
+ } // while( xResult->next() )
+ if ( pKeyProps.get() )
+ m_pImpl->m_aKeys.insert(TKeyMap::value_type(sOldFKName,pKeyProps));
::comphelper::disposeComponent(xResult);
}
}
// -------------------------------------------------------------------------
void OTableHelper::refreshKeys()
{
- m_aKeys.clear();
+ m_pImpl->m_aKeys.clear();
TStringVector aNames;
@@ -386,7 +496,7 @@ void SAL_CALL OTableHelper::rename( const ::rtl::OUString& newName ) throw(SQLEx
sComposedName = ::dbtools::composeTableName(getMetaData(),sCatalog,sSchema,sTable,sal_True,::dbtools::eInDataManipulation);
sSql += sComposedName;
- Reference< XStatement > xStmt = m_xConnection->createStatement( );
+ Reference< XStatement > xStmt = m_pImpl->m_xConnection->createStatement( );
if ( xStmt.is() )
{
xStmt->execute(sSql);
@@ -401,7 +511,7 @@ void SAL_CALL OTableHelper::rename( const ::rtl::OUString& newName ) throw(SQLEx
// -----------------------------------------------------------------------------
Reference< XDatabaseMetaData> OTableHelper::getMetaData() const
{
- return m_xMetaData;
+ return m_pImpl->m_xMetaData;
}
// -------------------------------------------------------------------------
void SAL_CALL OTableHelper::alterColumnByIndex( sal_Int32 index, const Reference< XPropertySet >& descriptor ) throw(SQLException, ::com::sun::star::lang::IndexOutOfBoundsException, RuntimeException)
@@ -441,8 +551,8 @@ void SAL_CALL OTableHelper::release() throw()
sdbcx::TKeyProperties OTableHelper::getKeyProperties(const ::rtl::OUString& _sName) const
{
sdbcx::TKeyProperties pKeyProps;
- TKeyMap::const_iterator aFind = m_aKeys.find(_sName);
- if ( aFind != m_aKeys.end() )
+ TKeyMap::const_iterator aFind = m_pImpl->m_aKeys.find(_sName);
+ if ( aFind != m_pImpl->m_aKeys.end() )
{
pKeyProps = aFind->second;
}
@@ -457,7 +567,7 @@ sdbcx::TKeyProperties OTableHelper::getKeyProperties(const ::rtl::OUString& _sNa
// -----------------------------------------------------------------------------
void OTableHelper::addKey(const ::rtl::OUString& _sName,const sdbcx::TKeyProperties& _aKeyProperties)
{
- m_aKeys.insert(TKeyMap::value_type(_sName,_aKeyProperties));
+ m_pImpl->m_aKeys.insert(TKeyMap::value_type(_sName,_aKeyProperties));
}
// -----------------------------------------------------------------------------
::rtl::OUString OTableHelper::getTypeCreatePattern() const
@@ -465,4 +575,7 @@ void OTableHelper::addKey(const ::rtl::OUString& _sName,const sdbcx::TKeyPropert
return ::rtl::OUString();
}
// -----------------------------------------------------------------------------
-
+Reference< XConnection> OTableHelper::getConnection() const
+{
+ return m_pImpl->m_xConnection;
+}
diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx
index 47c6143e6507..2d620018c73f 100644
--- a/connectivity/source/commontools/dbconversion.cxx
+++ b/connectivity/source/commontools/dbconversion.cxx
@@ -99,9 +99,9 @@ namespace dbtools
::rtl::OUStringBuffer aTemp(toDateString(aDate));
aTemp.appendAscii(" ");
Time aTime(0,_rDateTime.Seconds,_rDateTime.Minutes,_rDateTime.Hours);
- aTemp.append(toTimeString(aTime));
+ aTemp.append( toTimeString(aTime) );
aTemp.appendAscii(".");
- aTemp.append(static_cast<sal_Int32>(_rDateTime.HundredthSeconds));
+ aTemp.append( static_cast<sal_Int32>(_rDateTime.HundredthSeconds));
return aTemp.makeStringAndClear();
}
//------------------------------------------------------------------------------
diff --git a/connectivity/source/commontools/dbmetadata.cxx b/connectivity/source/commontools/dbmetadata.cxx
index 0d47cffce0ab..70220b1cd563 100644
--- a/connectivity/source/commontools/dbmetadata.cxx
+++ b/connectivity/source/commontools/dbmetadata.cxx
@@ -31,8 +31,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_connectivity.hxx"
-#include <connectivity/dbmetadata.hxx>
-#include <connectivity/dbexception.hxx>
+#include "connectivity/dbmetadata.hxx"
+#include "connectivity/dbexception.hxx"
+#include "connectivity/DriversConfig.hxx"
#include "resource/common_res.hrc"
#include "resource/sharedresources.hxx"
@@ -52,6 +53,7 @@
#include <tools/diagnose_ex.h>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/componentcontext.hxx>
+#include <comphelper/processfactory.hxx>
#include <boost/optional.hpp>
@@ -90,9 +92,19 @@ namespace dbtools
{
Reference< XConnection > xConnection;
Reference< XDatabaseMetaData > xConnectionMetaData;
+ ::connectivity::DriversConfig aDriverConfig;
::boost::optional< ::rtl::OUString > sCachedIdentifierQuoteString;
::boost::optional< ::rtl::OUString > sCachedCatalogSeparator;
+
+ DatabaseMetaData_Impl()
+ :xConnection()
+ ,xConnectionMetaData()
+ ,aDriverConfig( ::comphelper::getProcessServiceFactory() )
+ ,sCachedIdentifierQuoteString()
+ ,sCachedCatalogSeparator()
+ {
+ }
};
//--------------------------------------------------------------------
@@ -122,6 +134,17 @@ namespace dbtools
}
//................................................................
+ static bool lcl_getDriverSetting( const sal_Char* _asciiName, const DatabaseMetaData_Impl& _metaData, Any& _out_setting )
+ {
+ lcl_checkConnected( _metaData );
+ const ::comphelper::NamedValueCollection& rDriverMetaData = _metaData.aDriverConfig.getMetaData( _metaData.xConnectionMetaData->getURL() );
+ if ( !rDriverMetaData.has( _asciiName ) )
+ return false;
+ _out_setting = rDriverMetaData.get( _asciiName );
+ return true;
+ }
+
+ //................................................................
static bool lcl_getConnectionSetting( const sal_Char* _asciiName, const DatabaseMetaData_Impl& _metaData, Any& _out_setting )
{
try
@@ -157,10 +180,9 @@ namespace dbtools
const DatabaseMetaData_Impl& _metaData, ::boost::optional< ::rtl::OUString >& _cachedSetting,
::rtl::OUString (SAL_CALL XDatabaseMetaData::*_getter)() )
{
- lcl_checkConnected( _metaData );
-
if ( !_cachedSetting )
{
+ lcl_checkConnected( _metaData );
try
{
_cachedSetting.reset( (_metaData.xConnectionMetaData.get()->*_getter)() );
@@ -279,11 +301,11 @@ namespace dbtools
//--------------------------------------------------------------------
bool DatabaseMetaData::isAutoIncrementPrimaryKey() const
{
- bool doGenerate( true );
+ bool is( true );
Any setting;
- if ( lcl_getConnectionSetting( "AutoIncrementIsPrimaryKey", *m_pImpl, setting ) )
- OSL_VERIFY( setting >>= doGenerate );
- return doGenerate;
+ if ( lcl_getDriverSetting( "AutoIncrementIsPrimaryKey", *m_pImpl, setting ) )
+ OSL_VERIFY( setting >>= is );
+ return is;
}
//--------------------------------------------------------------------
sal_Int32 DatabaseMetaData::getBooleanComparisonMode() const
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index 6730d7beb9ce..02e6e420142f 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -842,9 +842,8 @@ static ::rtl::OUString impl_doComposeTableName( const Reference< XDatabaseMetaDa
return ::rtl::OUString();
OSL_ENSURE(_rName.getLength(), "impl_doComposeTableName : at least the name should be non-empty !");
- ::rtl::OUString sQuoteString = _rxMetaData->getIdentifierQuoteString();
-
- NameComponentSupport aNameComps( lcl_getNameComponentSupport( _rxMetaData, _eComposeRule ) );
+ const ::rtl::OUString sQuoteString = _rxMetaData->getIdentifierQuoteString();
+ const NameComponentSupport aNameComps( lcl_getNameComponentSupport( _rxMetaData, _eComposeRule ) );
::rtl::OUStringBuffer aComposedName;
@@ -1014,7 +1013,6 @@ try
Property* pResult = ::std::lower_bound(pNewProps, pNewProps + nNewLen,pOldProps[i].Name, ::comphelper::PropertyStringLessFunctor());
if ( pResult
&& ( pResult != pNewProps + nNewLen && pResult->Name == pOldProps[i].Name )
- && ( pResult->Attributes == pOldProps[i].Attributes )
&& ( (pResult->Attributes & PropertyAttribute::READONLY) == 0 )
&& ( pResult->Type.equals(pOldProps[i].Type)) )
{ // Attribute stimmen ueberein und Property ist nicht read-only
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx
index 1e1fa87cc58e..e08c3a33076d 100644
--- a/connectivity/source/commontools/dbtools2.cxx
+++ b/connectivity/source/commontools/dbtools2.cxx
@@ -384,7 +384,7 @@ namespace
}
namespace
{
- Reference<XPropertySet> lcl_createSDBCXColumn(
+ Reference<XPropertySet> lcl_createSDBCXColumn(const Reference<XNameAccess>& _xPrimaryKeyColumns,
const Reference<XConnection>& _xConnection,
const Any& _aCatalog,
const ::rtl::OUString& _aSchema,
@@ -424,8 +424,7 @@ namespace
const ::rtl::OUString sQuote = xMetaData->getIdentifierQuoteString();
::rtl::OUString sQuotedName = ::dbtools::quoteName(sQuote,_rName);
::rtl::OUString sComposedName;
- sComposedName = composeTableNameForSelect(
- _xConnection, getString( _aCatalog ), _aSchema, _aTable );
+ sComposedName = composeTableNameForSelect(_xConnection, getString( _aCatalog ), _aSchema, _aTable );
ColumnInformationMap aInfo(_bCase);
collectColumnInformation(_xConnection,sComposedName,sQuotedName,aInfo);
@@ -445,11 +444,19 @@ namespace
{
try
{
- Reference< XResultSet > xPKeys = xMetaData->getPrimaryKeys( _aCatalog, _aSchema, _aTable );
- Reference< XRow > xPKeyRow( xPKeys, UNO_QUERY_THROW );
- while( xPKeys->next() ) // there can be only one primary key
+ if ( _xPrimaryKeyColumns.is() )
+ {
+ if ( _xPrimaryKeyColumns->hasByName(_rName) )
+ nField11 = ColumnValue::NO_NULLS;
+
+ }
+ else
+ {
+ Reference< XResultSet > xPKeys = xMetaData->getPrimaryKeys( _aCatalog, _aSchema, _aTable );
+ Reference< XRow > xPKeyRow( xPKeys, UNO_QUERY_THROW );
+ while( xPKeys->next() ) // there can be only one primary key
{
- ::rtl::OUString sKeyColumn = xPKeyRow->getString(4);
+ ::rtl::OUString sKeyColumn = xPKeyRow->getString(4);
if ( aMixCompare(_rName,sKeyColumn) )
{
nField11 = ColumnValue::NO_NULLS;
@@ -457,6 +464,7 @@ namespace
}
}
}
+ }
catch(SQLException&)
{
OSL_ENSURE( false, "lcl_createSDBCXColumn: caught an exception!" );
@@ -521,10 +529,33 @@ Reference<XPropertySet> createSDBCXColumn(const Reference<XPropertySet>& _xTable
_xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= aSchema;
_xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= aTable;
- xProp = lcl_createSDBCXColumn(_xConnection,aCatalog, aSchema, aTable, _rName,_rName,_bCase,_bQueryForInfo,_bIsAutoIncrement,_bIsCurrency,_nDataType);
+ 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;++)
+ }
+ }
+
+ xProp = lcl_createSDBCXColumn(xPrimaryKeyColumns,_xConnection,aCatalog, aSchema, aTable, _rName,_rName,_bCase,_bQueryForInfo,_bIsAutoIncrement,_bIsCurrency,_nDataType);
if ( !xProp.is() )
{
- xProp = lcl_createSDBCXColumn(_xConnection,aCatalog, aSchema, aTable, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),_rName,_bCase,_bQueryForInfo,_bIsAutoIncrement,_bIsCurrency,_nDataType);
+ 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(),
diff --git a/connectivity/source/commontools/makefile.mk b/connectivity/source/commontools/makefile.mk
index ee335705e651..cb5a4ad3f7aa 100644
--- a/connectivity/source/commontools/makefile.mk
+++ b/connectivity/source/commontools/makefile.mk
@@ -49,6 +49,8 @@ ENVCFLAGS+=/FR$(SLO)$/
NOOPTFILES= $(SLO)$/RowFunctionParser.obj
.ENDIF
+ENVCFLAGS += -DBOOST_SPIRIT_USE_OLD_NAMESPACE
+
# --- Files --------------------------------------------------------
EXCEPTIONSFILES=\
$(SLO)$/predicateinput.obj \
diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx
index b2a093753804..ae55ad3f2680 100644
--- a/connectivity/source/commontools/parameters.cxx
+++ b/connectivity/source/commontools/parameters.cxx
@@ -118,7 +118,7 @@ namespace dbtools
//--------------------------------------------------------------------
void ParameterManager::clearAllParameterInformation()
{
- m_xInnerParamColumns = NULL;
+ m_xInnerParamColumns.clear();
if ( m_pOuterParameters.is() )
m_pOuterParameters->dispose();
m_pOuterParameters = NULL;
diff --git a/connectivity/source/commontools/sqlerror.cxx b/connectivity/source/commontools/sqlerror.cxx
index 84862b89dc30..825902c9e0b3 100644
--- a/connectivity/source/commontools/sqlerror.cxx
+++ b/connectivity/source/commontools/sqlerror.cxx
@@ -277,7 +277,7 @@ namespace connectivity
}
if ( !sState.getLength() )
- sState = ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "S1000" ), RTL_TEXTENCODING_ASCII_US );
+ sState = ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "S1000" ) );
return sState;
}
diff --git a/connectivity/source/cpool/ZConnectionPool.cxx b/connectivity/source/cpool/ZConnectionPool.cxx
index 69d2e1211343..3262f6630b0f 100644
--- a/connectivity/source/cpool/ZConnectionPool.cxx
+++ b/connectivity/source/cpool/ZConnectionPool.cxx
@@ -181,8 +181,8 @@ void OConnectionPool::clear(sal_Bool _bDispose)
if (xProp.is())
xProp->removePropertyChangeListener(getTimeoutNodeName(),this);
- m_xDriverNode = NULL;
- m_xDriver = NULL;
+m_xDriverNode.clear();
+m_xDriver.clear();
}
//--------------------------------------------------------------------------
Reference< XConnection > SAL_CALL OConnectionPool::getConnectionWithInfo( const ::rtl::OUString& _rURL, const Sequence< PropertyValue >& _rInfo ) throw(SQLException, RuntimeException)
@@ -223,7 +223,7 @@ void SAL_CALL OConnectionPool::disposing( const ::com::sun::star::lang::EventObj
}
else
{
- m_xDriverNode = NULL;
+ m_xDriverNode.clear();
}
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/cpool/ZPoolCollection.cxx b/connectivity/source/cpool/ZPoolCollection.cxx
index 18d0851e332f..0c812c4165f6 100644
--- a/connectivity/source/cpool/ZPoolCollection.cxx
+++ b/connectivity/source/cpool/ZPoolCollection.cxx
@@ -507,7 +507,7 @@ void SAL_CALL OPoolCollection::disposing( const EventObject& Source ) throw (Run
{
if ( xProp.is() )
xProp->removePropertyChangeListener(getEnablePoolingNodeName(),this);
- m_xConfigNode = NULL;
+ m_xConfigNode.clear();
}
else if ( xProp.is() )
xProp->removePropertyChangeListener(getEnableNodeName(),this);
@@ -577,7 +577,7 @@ void OPoolCollection::clearDesktop()
clearConnectionPools(sal_True);
if ( m_xDesktop.is() )
m_xDesktop->removeTerminateListener(this);
- m_xDesktop = NULL;
+m_xDesktop.clear();
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/cpool/ZPooledConnection.cxx b/connectivity/source/cpool/ZPooledConnection.cxx
index 1652f5f2eaf9..bbc07c0a8441 100644
--- a/connectivity/source/cpool/ZPooledConnection.cxx
+++ b/connectivity/source/cpool/ZPooledConnection.cxx
@@ -64,14 +64,14 @@ void SAL_CALL OPooledConnection::disposing(void)
MutexGuard aGuard(m_aMutex);
if (m_xComponent.is())
m_xComponent->removeEventListener(this);
- m_xComponent = NULL;
+m_xComponent.clear();
::comphelper::disposeComponent(m_xRealConnection);
}
// -----------------------------------------------------------------------------
// XEventListener
void SAL_CALL OPooledConnection::disposing( const EventObject& /*Source*/ ) throw (RuntimeException)
{
- m_xComponent = NULL;
+m_xComponent.clear();
}
// -----------------------------------------------------------------------------
//XPooledConnection
diff --git a/connectivity/source/drivers/adabas/BConnection.cxx b/connectivity/source/drivers/adabas/BConnection.cxx
index f30532cebc70..11add583ea4a 100644
--- a/connectivity/source/drivers/adabas/BConnection.cxx
+++ b/connectivity/source/drivers/adabas/BConnection.cxx
@@ -223,10 +223,7 @@ Reference< XPreparedStatement > SAL_CALL OAdabasConnection::prepareStatement( co
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OConnection_BASE2::rBHelper.bDisposed);
- if(m_aTypeInfo.empty())
- buildTypeInfo();
-
- Reference< XPreparedStatement > xReturn = new OAdabasPreparedStatement(this,m_aTypeInfo,sql);
+ Reference< XPreparedStatement > xReturn = new OAdabasPreparedStatement(this,sql);
m_aStatements.push_back(WeakReferenceHelper(xReturn));
return xReturn;
}
diff --git a/connectivity/source/drivers/adabas/BDriver.cxx b/connectivity/source/drivers/adabas/BDriver.cxx
index 4bc0cc70c430..31dd0001fc11 100644
--- a/connectivity/source/drivers/adabas/BDriver.cxx
+++ b/connectivity/source/drivers/adabas/BDriver.cxx
@@ -317,7 +317,7 @@ void SAL_CALL ODriver::disposing( const EventObject& Source ) throw(RuntimeExcep
}
}
}
- m_xORB = NULL;
+ m_xORB.clear();
}
}
// --------------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/adabas/BPreparedStatement.cxx b/connectivity/source/drivers/adabas/BPreparedStatement.cxx
index 92ccab30af77..900c50da2b6a 100644
--- a/connectivity/source/drivers/adabas/BPreparedStatement.cxx
+++ b/connectivity/source/drivers/adabas/BPreparedStatement.cxx
@@ -48,8 +48,8 @@ using namespace com::sun::star::container;
using namespace com::sun::star::io;
using namespace com::sun::star::util;
-OAdabasPreparedStatement::OAdabasPreparedStatement( OAdabasConnection* _pConnection,const ::std::vector<OTypeInfo>& _TypeInfo,const ::rtl::OUString& sql)
-: ::connectivity::odbc::OPreparedStatement( _pConnection,_TypeInfo,sql)
+OAdabasPreparedStatement::OAdabasPreparedStatement( OAdabasConnection* _pConnection,const ::rtl::OUString& sql)
+: ::connectivity::odbc::OPreparedStatement( _pConnection,sql)
{
m_aSelectColumns = _pConnection->createSelectColumns(sql);
}
diff --git a/connectivity/source/drivers/adabas/BTables.cxx b/connectivity/source/drivers/adabas/BTables.cxx
index 1f301d5fda94..86b8df2fd795 100644
--- a/connectivity/source/drivers/adabas/BTables.cxx
+++ b/connectivity/source/drivers/adabas/BTables.cxx
@@ -96,7 +96,7 @@ void OTables::impl_refresh( ) throw(RuntimeException)
// -------------------------------------------------------------------------
void OTables::disposing(void)
{
- m_xMetaData = NULL;
+m_xMetaData.clear();
OCollection::disposing();
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/adabas/BViews.cxx b/connectivity/source/drivers/adabas/BViews.cxx
index 6c8f40eaef9d..5a7fda021701 100644
--- a/connectivity/source/drivers/adabas/BViews.cxx
+++ b/connectivity/source/drivers/adabas/BViews.cxx
@@ -110,7 +110,7 @@ void OViews::impl_refresh( ) throw(RuntimeException)
// -------------------------------------------------------------------------
void OViews::disposing(void)
{
- m_xMetaData = NULL;
+m_xMetaData.clear();
OCollection::disposing();
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
index af97d312ea8e..afd050d6cda2 100644
--- a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
@@ -100,7 +100,7 @@ void ODatabaseMetaDataResultSet::disposing(void)
if(m_pRecordSet)
m_pRecordSet->Close();
m_aStatement = NULL;
- m_xMetaData = NULL;
+m_xMetaData.clear();
}
// -------------------------------------------------------------------------
Any SAL_CALL ODatabaseMetaDataResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
diff --git a/connectivity/source/drivers/ado/ADriver.cxx b/connectivity/source/drivers/ado/ADriver.cxx
index 9c8adc7aa79f..59d33f40385b 100644
--- a/connectivity/source/drivers/ado/ADriver.cxx
+++ b/connectivity/source/drivers/ado/ADriver.cxx
@@ -39,6 +39,8 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include "connectivity/dbexception.hxx"
#include "resource/ado_res.hrc"
+#include <Objbase.h>
+
#include "resource/sharedresources.hxx"
@@ -57,12 +59,19 @@ ODriver::ODriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang:
: ODriver_BASE(m_aMutex)
,m_xORB(_xORB)
{
- CoInitialize(NULL);
+ if ( FAILED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)) )
+ {
+ CoUninitialize();
+ int h = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
+ (void)h;
+ ++h;
+ }
}
// -------------------------------------------------------------------------
ODriver::~ODriver()
{
CoUninitialize();
+ CoInitialize(NULL);
}
//------------------------------------------------------------------------------
void ODriver::disposing()
diff --git a/connectivity/source/drivers/ado/APreparedStatement.cxx b/connectivity/source/drivers/ado/APreparedStatement.cxx
index ac05163d416f..1eeb59befc1f 100644
--- a/connectivity/source/drivers/ado/APreparedStatement.cxx
+++ b/connectivity/source/drivers/ado/APreparedStatement.cxx
@@ -49,6 +49,10 @@
if(!x) \
ADOS::ThrowException(*m_pConnection->getConnection(),*this);
+#ifdef max
+# undef max
+#endif
+
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
using namespace connectivity::ado;
@@ -135,7 +139,7 @@ Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData( ) thr
// -------------------------------------------------------------------------
void OPreparedStatement::disposing()
{
- m_xMetaData = NULL;
+m_xMetaData.clear();
if (m_pParameters)
{
m_pParameters->Release();
@@ -295,7 +299,7 @@ Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( ) throw(SQLE
// first clear the old things
- m_xMetaData = NULL;
+m_xMetaData.clear();
disposeResultSet();
if(m_RecordSet.IsValid())
m_RecordSet.Close();
diff --git a/connectivity/source/drivers/ado/AResultSet.cxx b/connectivity/source/drivers/ado/AResultSet.cxx
index 5326a2ba4143..1c53614bba04 100644
--- a/connectivity/source/drivers/ado/AResultSet.cxx
+++ b/connectivity/source/drivers/ado/AResultSet.cxx
@@ -139,8 +139,8 @@ void OResultSet::disposing(void)
::osl::MutexGuard aGuard(m_aMutex);
if(m_pRecordSet)
m_pRecordSet->Close();
- m_xStatement = NULL;
- m_xMetaData = NULL;
+m_xStatement.clear();
+m_xMetaData.clear();
}
// -------------------------------------------------------------------------
Any SAL_CALL OResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
diff --git a/connectivity/source/drivers/ado/Aservices.cxx b/connectivity/source/drivers/ado/Aservices.cxx
index 5a2817f628e9..e3c855f6b042 100644
--- a/connectivity/source/drivers/ado/Aservices.cxx
+++ b/connectivity/source/drivers/ado/Aservices.cxx
@@ -121,7 +121,7 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
uno_Environment ** /*ppEnv*/
)
{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ":affine";
}
//---------------------------------------------------------------------------------------
@@ -143,7 +143,7 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(
}
catch (::com::sun::star::registry::InvalidRegistryException& )
{
- OSL_ENSURE(sal_False, "ODBC::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
+ OSL_ENSURE(sal_False, "ADO::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
}
return sal_False;
diff --git a/connectivity/source/drivers/ado/ado.xcu b/connectivity/source/drivers/ado/ado.xcu
index 949d6fb86a19..236d38bd7ff7 100755
--- a/connectivity/source/drivers/ado/ado.xcu
+++ b/connectivity/source/drivers/ado/ado.xcu
@@ -147,6 +147,11 @@
<value></value>
</prop>
</node>
+ <node oor:name="BooleanComparisonMode" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:int">
+ <value>3</value>
+ </prop>
+ </node>
</node>
<node oor:name="Features">
<node oor:name="UseSQL92NamingConstraints" oor:op="replace">
@@ -216,11 +221,6 @@
<value>mdb</value>
</prop>
</node>
- <node oor:name="BooleanComparisonMode" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:int">
- <value>3</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/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index d4a83249098a..1db81262e120 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -1765,7 +1765,7 @@ BOOL ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,const
m_pColumns->getByIndex(i) >>= xCol;
OSL_ENSURE(xCol.is(),"ODbaseTable::UpdateBuffer column is null!");
xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aColName;
- xCol = NULL;
+ xCol.clear();
} // if ( !aColName.getLength() )
const ::rtl::OUString sError( getConnection()->getResources().getResourceStringWithSubstitution(
STR_DUPLICATE_VALUE_IN_COLUMN
diff --git a/connectivity/source/drivers/evoab2/NDriver.cxx b/connectivity/source/drivers/evoab2/NDriver.cxx
index fc024fa293e5..9e2eddb8750a 100644
--- a/connectivity/source/drivers/evoab2/NDriver.cxx
+++ b/connectivity/source/drivers/evoab2/NDriver.cxx
@@ -82,7 +82,7 @@ void OEvoabDriver::disposing()
xComp->dispose();
}
catch (com::sun::star::lang::DisposedException e) {
- xComp=NULL;
+ xComp.clear();
}
}
}
diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx
index ec3f9fe7e99b..d71908e0afd8 100644
--- a/connectivity/source/drivers/evoab2/NResultSet.cxx
+++ b/connectivity/source/drivers/evoab2/NResultSet.cxx
@@ -579,7 +579,7 @@ void OEvoabResultSet::disposing(void)
g_list_free(m_pContacts);
m_pContacts = NULL;
m_pStatement = NULL;
- m_xMetaData = NULL;
+m_xMetaData.clear();
}
// -------------------------------------------------------------------------
Any SAL_CALL OEvoabResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
diff --git a/connectivity/source/drivers/evoab2/NStatement.cxx b/connectivity/source/drivers/evoab2/NStatement.cxx
index 6cc1ceb11f03..2ddcd84c87a0 100644
--- a/connectivity/source/drivers/evoab2/NStatement.cxx
+++ b/connectivity/source/drivers/evoab2/NStatement.cxx
@@ -463,7 +463,7 @@ rtl::OUString OCommonStatement::getTableName()
if( m_aSQLIterator.isTableNode( pAllTableNames->getChild( 0 ) ) )
OSQLParseNode::getTableComponents( pAllTableNames->getChild( 0 ),
- aCatalog,aSchema, aTableName );
+ aCatalog,aSchema, aTableName,NULL );
else if( SQL_ISRULE( pAllTableNames->getChild( 0 ), table_ref ) )
{
@@ -472,7 +472,7 @@ rtl::OUString OCommonStatement::getTableName()
{
aTableName = OSQLParseNode::getTableRange(pAllTableNames->getChild( 0 ));
if( !aTableName.getLength() )
- OSQLParseNode::getTableComponents( pNodeForTableName, aCatalog, aSchema, aTableName);
+ OSQLParseNode::getTableComponents( pNodeForTableName, aCatalog, aSchema, aTableName,NULL);
}
else
OSL_ENSURE( false, "odd table layout" );
diff --git a/connectivity/source/drivers/evoab2/NTables.cxx b/connectivity/source/drivers/evoab2/NTables.cxx
index 21630ec62a1e..804248435ae6 100644
--- a/connectivity/source/drivers/evoab2/NTables.cxx
+++ b/connectivity/source/drivers/evoab2/NTables.cxx
@@ -101,7 +101,7 @@ void OEvoabTables::impl_refresh( ) throw(RuntimeException)
// -------------------------------------------------------------------------
void OEvoabTables::disposing(void)
{
- m_xMetaData = NULL;
+m_xMetaData.clear();
OCollection::disposing();
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/file/FCatalog.cxx b/connectivity/source/drivers/file/FCatalog.cxx
index 8f51eedc1cfe..79eb15aa6648 100644
--- a/connectivity/source/drivers/file/FCatalog.cxx
+++ b/connectivity/source/drivers/file/FCatalog.cxx
@@ -58,7 +58,7 @@ void SAL_CALL OFileCatalog::disposing()
::osl::MutexGuard aGuard(m_aMutex);
typedef connectivity::sdbcx::OCatalog OFileCatalog_BASE;
- m_xMetaData = NULL;
+m_xMetaData.clear();
OFileCatalog_BASE::disposing();
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx
index 4fb0583e281b..52d14e6498cb 100644
--- a/connectivity/source/drivers/file/FConnection.cxx
+++ b/connectivity/source/drivers/file/FConnection.cxx
@@ -383,8 +383,8 @@ void OConnection::disposing()
OConnection_BASE::disposing();
m_bClosed = sal_True;
- m_xDir = NULL;
- m_xContent = NULL;
+m_xDir.clear();
+m_xContent.clear();
m_xCatalog = WeakReference< XTablesSupplier>();
dispose_ChildImpl();
diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx b/connectivity/source/drivers/file/FPreparedStatement.cxx
index 722037ae6ea6..b55276c3b17d 100644
--- a/connectivity/source/drivers/file/FPreparedStatement.cxx
+++ b/connectivity/source/drivers/file/FPreparedStatement.cxx
@@ -98,9 +98,7 @@ void OPreparedStatement::disposing()
}
m_xParamColumns = NULL;
-
-
- m_xMetaData = NULL;
+ m_xMetaData.clear();
if(m_aParameterRow.isValid())
{
m_aParameterRow->get().clear();
diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx
index ca86fb2a3d73..dbc2162f9d73 100644
--- a/connectivity/source/drivers/file/FResultSet.cxx
+++ b/connectivity/source/drivers/file/FResultSet.cxx
@@ -174,13 +174,13 @@ void OResultSet::disposing(void)
OPropertySetHelper::disposing();
::osl::MutexGuard aGuard(m_aMutex);
- m_xStatement = NULL;
- m_xMetaData = NULL;
+ m_xStatement.clear();
+ m_xMetaData.clear();
m_pParseTree = NULL;
- m_xColNames = NULL;
- m_xColumns = NULL;
+ m_xColNames.clear();
+ m_xColumns = NULL;
m_xParamColumns = NULL;
- m_xColsIdx = NULL;
+ m_xColsIdx.clear();
Reference<XComponent> xComp = m_pTable;
if ( xComp.is() )
@@ -1303,8 +1303,9 @@ void OResultSet::sortRows()
OSL_ENSURE((sal_Int32)m_aRow->get().size() > *aOrderByIter,"Invalid Index");
switch ((*(m_aRow->get().begin()+*aOrderByIter))->getValue().getTypeKind())
{
- case DataType::CHAR:
+ case DataType::CHAR:
case DataType::VARCHAR:
+ case DataType::LONGVARCHAR:
eKeyType[i] = SQL_ORDERBYKEY_STRING;
break;
@@ -1471,6 +1472,7 @@ BOOL OResultSet::OpenImpl()
if(IsSorted())
{
aOrderbyColumnNumberSave = m_aOrderbyColumnNumber;// .assign(m_aOrderbyColumnNumber.begin(), m_aOrderbyColumnNumber.end());
+ m_aOrderbyColumnNumber.clear();
aOrderbyAscendingSave.assign(m_aOrderbyAscending.begin(), m_aOrderbyAscending.end());
bWasSorted = TRUE;
}
diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx
index 72ad91dbfa73..07cdf95d7b44 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -796,6 +796,7 @@ void OStatement_Base::SetAssignValue(const String& aColumnName,
// Kriterium je nach Typ als String oder double in die Variable packen ...
case DataType::CHAR:
case DataType::VARCHAR:
+ case DataType::LONGVARCHAR:
*(m_aAssignValues->get())[nId] = ORowSetValue(aValue);
// Zeichensatz ist bereits konvertiert, da ja das gesamte Statement konvertiert wurde
break;
diff --git a/connectivity/source/drivers/file/FTables.cxx b/connectivity/source/drivers/file/FTables.cxx
index 0862c3803b31..5da29306e475 100644
--- a/connectivity/source/drivers/file/FTables.cxx
+++ b/connectivity/source/drivers/file/FTables.cxx
@@ -68,7 +68,7 @@ void OTables::impl_refresh( ) throw(RuntimeException)
// -------------------------------------------------------------------------
void OTables::disposing(void)
{
- m_xMetaData = NULL;
+m_xMetaData.clear();
OCollection::disposing();
}
//------------------------------------------------------------------
diff --git a/connectivity/source/drivers/file/fcode.cxx b/connectivity/source/drivers/file/fcode.cxx
index 0bd0d354ba02..4b2865a67aa2 100644
--- a/connectivity/source/drivers/file/fcode.cxx
+++ b/connectivity/source/drivers/file/fcode.cxx
@@ -65,6 +65,7 @@ TYPEINIT1(OStopOperand, OOperandValue);
TYPEINIT1(OOperator, OCode);
TYPEINIT1(OBoolOperator,OOperator);
+TYPEINIT1(OOp_NOT, OBoolOperator);
TYPEINIT1(OOp_AND, OBoolOperator);
TYPEINIT1(OOp_OR, OBoolOperator);
TYPEINIT1(OOp_ISNULL, OBoolOperator);
@@ -242,6 +243,29 @@ void OBoolOperator::Exec(OCodeStack& rCodeStack)
if (IS_TYPE(OOperandResult,pRight))
delete pRight;
}
+//------------------------------------------------------------------
+sal_Bool OOp_NOT::operate(const OOperand* pLeft, const OOperand* ) const
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_AND::operate" );
+ return !pLeft->isValid();
+}
+//------------------------------------------------------------------
+void OOp_NOT::Exec(OCodeStack& rCodeStack)
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_ISNULL::Exec" );
+ OOperand* pOperand = rCodeStack.top();
+ rCodeStack.pop();
+
+ rCodeStack.push(new OOperandResultBOOL(operate(pOperand)));
+ if (IS_TYPE(OOperandResult,pOperand))
+ delete pOperand;
+}
+//------------------------------------------------------------------
+sal_uInt16 OOp_NOT::getRequestedOperands() const
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_NOT::getRequestedOperands" );
+ return 1;
+}
//------------------------------------------------------------------
sal_Bool OOp_AND::operate(const OOperand* pLeft, const OOperand* pRight) const
@@ -331,6 +355,7 @@ sal_Bool OOp_COMPARE::operate(const OOperand* pLeft, const OOperand* pRight) con
{
case DataType::CHAR:
case DataType::VARCHAR:
+ case DataType::LONGVARCHAR:
{
rtl::OUString sLH = aLH, sRH = aRH;
INT32 nRes = rtl_ustr_compareIgnoreAsciiCase_WithLength
diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx
index de243f83c71c..04d38ddfc5ee 100644
--- a/connectivity/source/drivers/file/fcomp.cxx
+++ b/connectivity/source/drivers/file/fcomp.cxx
@@ -79,7 +79,7 @@ void OPredicateCompiler::dispose()
{
Clean();
m_orgColumns = NULL;
- m_xIndexes = NULL;
+m_xIndexes.clear();
}
//------------------------------------------------------------------
// inline OCursor& OPredicateCompiler::Cursor() const {return m_rCursor;}
@@ -166,7 +166,7 @@ OOperand* OPredicateCompiler::execute(OSQLParseNode* pPredicateNode)
}
else if ((SQL_ISRULE(pPredicateNode,search_condition) || (SQL_ISRULE(pPredicateNode,boolean_term)))
&& // AND/OR-Verknuepfung:
- pPredicateNode->count() == 3)
+ pPredicateNode->count() == 3)
{
execute(pPredicateNode->getChild(0)); // Bearbeiten des linken Zweigs
execute(pPredicateNode->getChild(2)); // Bearbeiten des rechten Zweigs
@@ -183,6 +183,11 @@ OOperand* OPredicateCompiler::execute(OSQLParseNode* pPredicateNode)
DBG_ERROR("OPredicateCompiler: Fehler im Parse Tree");
}
}
+ else if (SQL_ISRULE(pPredicateNode,boolean_factor))
+ {
+ execute(pPredicateNode->getChild(1));
+ m_aCodeList.push_back(new OOp_NOT());
+ }
else if (SQL_ISRULE(pPredicateNode,comparison_predicate))
{
execute_COMPARE(pPredicateNode);
diff --git a/connectivity/source/drivers/file/quotedstring.cxx b/connectivity/source/drivers/file/quotedstring.cxx
index 5cf56aec9375..abd2d3b51e44 100644
--- a/connectivity/source/drivers/file/quotedstring.cxx
+++ b/connectivity/source/drivers/file/quotedstring.cxx
@@ -113,7 +113,7 @@ namespace connectivity
if ( nStartPos >= nLen )
return;
- sal_Unicode* pData = _rStr.AllocBuffer(nLen - nStartPos);
+ sal_Unicode* pData = _rStr.AllocBuffer( nLen - nStartPos + 1 );
const sal_Unicode* pStart = pData;
// Suche bis Stringende nach dem ersten nicht uebereinstimmenden Zeichen
for( xub_StrLen i = nStartPos; i < nLen; ++i )
@@ -135,6 +135,7 @@ namespace connectivity
{
// String-Ende
bInString = FALSE;
+ *pData = 0;
}
}
else
@@ -151,6 +152,7 @@ namespace connectivity
// Vorzeitiger Abbruch der Schleife moeglich, denn
// wir haben, was wir wollten.
nStartPos = i+1;
+ *pData = 0;
break;
}
else
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index 75a89df55bc0..fa4f281ea794 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -660,7 +660,10 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
}
return sal_True;
}
-
+void OFlatTable::refreshHeader()
+{
+ m_nRowPos = 0;
+}
// -----------------------------------------------------------------------------
sal_Bool OFlatTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos)
{
@@ -692,7 +695,7 @@ sal_Bool OFlatTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int
m_pFileStream->Seek(m_nFilePos);
if ( m_pFileStream->IsEof() || !readLine(nCurPos) /*|| !checkHeaderLine()*/)
{
- m_nMaxRowCount = m_nRowPos;
+ m_nMaxRowCount = m_nRowPos -1;
return sal_False;
} // if ( m_pFileStream->IsEof() || !readLine(nCurPos) /*|| !checkHeaderLine()*/)
@@ -797,7 +800,10 @@ sal_Bool OFlatTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int
TRowPositionsInFile::const_iterator aFind = m_aFilePosToEndLinePos.find(nOffset);
m_bNeedToReadLine = aFind != m_aFilePosToEndLinePos.end();
if ( m_bNeedToReadLine )
+ {
+ m_nFilePos = aFind->first;
nCurPos = aFind->second;
+ }
else
{
m_nFilePos = nOffset;
diff --git a/connectivity/source/drivers/flat/flat.xcu b/connectivity/source/drivers/flat/flat.xcu
index e70996e8ffa0..953d1179aa64 100755
--- a/connectivity/source/drivers/flat/flat.xcu
+++ b/connectivity/source/drivers/flat/flat.xcu
@@ -104,7 +104,7 @@
</node>
<node oor:name="MediaType" oor:op="replace">
<prop oor:name="Value" oor:type="xs:string">
- <value>application/csv</value>
+ <value>text/csv</value>
</prop>
</node>
</node>
diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
index aa03e5f1f29f..2da6e2496b0f 100644
--- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx
+++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
@@ -64,12 +64,12 @@ namespace connectivity
{
try
{
- m_xStream = NULL;
- m_xSeek = NULL;
+ m_xStream.clear();
+ m_xSeek.clear();
if ( m_xInputStream.is() )
{
m_xInputStream->closeInput();
- m_xInputStream = NULL;
+ m_xInputStream.clear();
}
if ( m_xOutputStream.is() )
{
@@ -86,7 +86,7 @@ namespace connectivity
OSL_UNUSED( e );
OSL_ENSURE(0,"Could not dispose OutputStream");
}
- m_xOutputStream = NULL;
+ m_xOutputStream.clear();
}
}
catch(Exception& )
diff --git a/connectivity/source/drivers/hsqldb/HTables.cxx b/connectivity/source/drivers/hsqldb/HTables.cxx
index 5edff4cc7944..6cf19812b9f2 100644
--- a/connectivity/source/drivers/hsqldb/HTables.cxx
+++ b/connectivity/source/drivers/hsqldb/HTables.cxx
@@ -113,7 +113,7 @@ void OTables::impl_refresh( ) throw(RuntimeException)
// -------------------------------------------------------------------------
void OTables::disposing(void)
{
- m_xMetaData = NULL;
+m_xMetaData.clear();
OCollection::disposing();
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/hsqldb/HViews.cxx b/connectivity/source/drivers/hsqldb/HViews.cxx
index 558f938a8e35..c3a07447c209 100644
--- a/connectivity/source/drivers/hsqldb/HViews.cxx
+++ b/connectivity/source/drivers/hsqldb/HViews.cxx
@@ -93,7 +93,7 @@ void HViews::impl_refresh( ) throw(RuntimeException)
// -------------------------------------------------------------------------
void HViews::disposing(void)
{
- m_xMetaData = NULL;
+m_xMetaData.clear();
OCollection::disposing();
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/jdbc/JDriver.cxx b/connectivity/source/drivers/jdbc/JDriver.cxx
index 7d2bafa0d29c..333a836e919f 100644
--- a/connectivity/source/drivers/jdbc/JDriver.cxx
+++ b/connectivity/source/drivers/jdbc/JDriver.cxx
@@ -118,7 +118,7 @@ Reference< XConnection > SAL_CALL java_sql_Driver::connect( const ::rtl::OUStrin
java_sql_Connection* pConnection = new java_sql_Connection( *this );
xOut = pConnection;
if ( !pConnection->construct(url,info) )
- xOut = NULL; // an error occured and the java driver didn't throw an exception
+ xOut.clear(); // an error occured and the java driver didn't throw an exception
else
m_aLogger.log( LogLevel::INFO, STR_LOG_DRIVER_SUCCESS );
}
diff --git a/connectivity/source/drivers/jdbc/ResultSet.cxx b/connectivity/source/drivers/jdbc/ResultSet.cxx
index 4728586ad4d0..677985ac6a90 100644
--- a/connectivity/source/drivers/jdbc/ResultSet.cxx
+++ b/connectivity/source/drivers/jdbc/ResultSet.cxx
@@ -116,7 +116,7 @@ void java_sql_ResultSet::disposing(void)
OPropertySetHelper::disposing();
::osl::MutexGuard aGuard(m_aMutex);
- m_xMetaData = NULL;
+m_xMetaData.clear();
if( object )
{
SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
diff --git a/connectivity/source/drivers/kab/KResultSet.cxx b/connectivity/source/drivers/kab/KResultSet.cxx
index 28c9877914ac..d05d757c9dac 100644
--- a/connectivity/source/drivers/kab/KResultSet.cxx
+++ b/connectivity/source/drivers/kab/KResultSet.cxx
@@ -124,8 +124,8 @@ void KabResultSet::disposing()
::osl::MutexGuard aGuard(m_aMutex);
- m_xStatement = NULL;
- m_xMetaData = NULL;
+m_xStatement.clear();
+m_xMetaData.clear();
}
// -------------------------------------------------------------------------
Any SAL_CALL KabResultSet::queryInterface(const Type & rType) throw(RuntimeException)
diff --git a/connectivity/source/drivers/kab/KTables.cxx b/connectivity/source/drivers/kab/KTables.cxx
index 88ccecc188ac..a672f983e8aa 100644
--- a/connectivity/source/drivers/kab/KTables.cxx
+++ b/connectivity/source/drivers/kab/KTables.cxx
@@ -88,6 +88,6 @@ void KabTables::impl_refresh( ) throw(RuntimeException)
// -------------------------------------------------------------------------
void KabTables::disposing(void)
{
- m_xMetaData = NULL;
+m_xMetaData.clear();
OCollection::disposing();
}
diff --git a/connectivity/source/drivers/macab/MacabResultSet.cxx b/connectivity/source/drivers/macab/MacabResultSet.cxx
index 955a3998b39a..50417b1f6a0f 100755
--- a/connectivity/source/drivers/macab/MacabResultSet.cxx
+++ b/connectivity/source/drivers/macab/MacabResultSet.cxx
@@ -151,8 +151,8 @@ void MacabResultSet::disposing()
::osl::MutexGuard aGuard(m_aMutex);
- m_xStatement = NULL;
- m_xMetaData = NULL;
+m_xStatement.clear();
+m_xMetaData.clear();
}
// -------------------------------------------------------------------------
Any SAL_CALL MacabResultSet::queryInterface(const Type & rType) throw(RuntimeException)
diff --git a/connectivity/source/drivers/macab/MacabTables.cxx b/connectivity/source/drivers/macab/MacabTables.cxx
index 9d1e4d1cbc35..1c386711e992 100755
--- a/connectivity/source/drivers/macab/MacabTables.cxx
+++ b/connectivity/source/drivers/macab/MacabTables.cxx
@@ -88,6 +88,6 @@ void MacabTables::impl_refresh( ) throw(RuntimeException)
// -------------------------------------------------------------------------
void MacabTables::disposing(void)
{
- m_xMetaData = NULL;
+m_xMetaData.clear();
OCollection::disposing();
}
diff --git a/connectivity/source/drivers/mozab/MPreparedStatement.cxx b/connectivity/source/drivers/mozab/MPreparedStatement.cxx
index 8cec9c18f635..098fc8b9e055 100644
--- a/connectivity/source/drivers/mozab/MPreparedStatement.cxx
+++ b/connectivity/source/drivers/mozab/MPreparedStatement.cxx
@@ -91,7 +91,7 @@ void SAL_CALL OPreparedStatement::disposing()
OCommonStatement::disposing();
- m_xMetaData = NULL;
+ m_xMetaData.clear();
if(m_aParameterRow.isValid())
{
m_aParameterRow->get().clear();
diff --git a/connectivity/source/drivers/mozab/MResultSet.cxx b/connectivity/source/drivers/mozab/MResultSet.cxx
index 18106375f252..8e0193f303c8 100644
--- a/connectivity/source/drivers/mozab/MResultSet.cxx
+++ b/connectivity/source/drivers/mozab/MResultSet.cxx
@@ -139,10 +139,10 @@ void OResultSet::disposing(void)
::osl::MutexGuard aGuard(m_aMutex);
- m_xStatement = NULL;
- m_xMetaData = NULL;
+ m_xStatement.clear();
+ m_xMetaData.clear();
m_pParseTree = NULL;
- m_xColumns = NULL;
+ m_xColumns = NULL;
m_xParamColumns = NULL;
m_pKeySet = NULL;
if(m_pTable)
diff --git a/connectivity/source/drivers/mozab/MResultSetMetaData.cxx b/connectivity/source/drivers/mozab/MResultSetMetaData.cxx
index 855f3580b797..aad7be864cd5 100644
--- a/connectivity/source/drivers/mozab/MResultSetMetaData.cxx
+++ b/connectivity/source/drivers/mozab/MResultSetMetaData.cxx
@@ -50,7 +50,7 @@ using namespace ::comphelper;
// -------------------------------------------------------------------------
OResultSetMetaData::~OResultSetMetaData()
{
- m_xColumns = NULL;
+ m_xColumns = NULL;
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/mozab/MTables.cxx b/connectivity/source/drivers/mozab/MTables.cxx
index 99f12ccc501c..4fa686b1c6a8 100644
--- a/connectivity/source/drivers/mozab/MTables.cxx
+++ b/connectivity/source/drivers/mozab/MTables.cxx
@@ -100,7 +100,7 @@ void OTables::impl_refresh( ) throw(RuntimeException)
// -------------------------------------------------------------------------
void OTables::disposing(void)
{
- m_xMetaData = NULL;
+m_xMetaData.clear();
OCollection::disposing();
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx
index 8c03770afd80..ee983a005920 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx
@@ -130,7 +130,12 @@ sal_Bool MNS_InitXPCOM(sal_Bool* aProfileExists)
nsCOMPtr<nsILocalFile> binDir;
// Note: if path3 construction fails, mozilla will default to using MOZILLA_FIVE_HOME in the NS_InitXPCOM2()
rtl::OUString path1(
- RTL_CONSTASCII_USTRINGPARAM("$OOO_BASE_DIR/program"));
+#if defined WNT
+ RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program")
+#else
+ RTL_CONSTASCII_USTRINGPARAM("$OOO_BASE_DIR/program")
+#endif
+ );
rtl::Bootstrap::expandMacros(path1);
rtl::OString path2;
if ((osl::FileBase::getSystemPathFromFileURL(path1, path1) ==
diff --git a/connectivity/source/drivers/mozab/bootstrap/makefile.mk b/connectivity/source/drivers/mozab/bootstrap/makefile.mk
index a22b3699760a..9b4b05868cd2 100644
--- a/connectivity/source/drivers/mozab/bootstrap/makefile.mk
+++ b/connectivity/source/drivers/mozab/bootstrap/makefile.mk
@@ -44,6 +44,11 @@ USE_DEFFILE=TRUE
ENABLE_EXCEPTIONS=TRUE
VISIBILITY_HIDDEN=TRUE
+.IF "$(OS)" == "OS2"
+all:
+ @echo " Not building under OS/2"
+.ENDIF
+
# --- Settings ----------------------------------
.IF "$(DBGUTIL_OJ)"!=""
ENVCFLAGS+=/FR$(SLO)$/
diff --git a/connectivity/source/drivers/mozab/makefile.mk b/connectivity/source/drivers/mozab/makefile.mk
index 6240ed041047..677e605096c4 100644
--- a/connectivity/source/drivers/mozab/makefile.mk
+++ b/connectivity/source/drivers/mozab/makefile.mk
@@ -35,7 +35,7 @@ TARGET=mozab
TARGET2=$(TARGET)drv
VISIBILITY_HIDDEN=TRUE
-.IF ( "$(SYSTEM_MOZILLA)" == "YES" && "$(WITH_MOZILLA)" == "YES") || "$(WITH_MOZILLA)" == "NO" || ( "$(OS)" == "MACOSX" )
+.IF ( "$(SYSTEM_MOZILLA)" == "YES" && "$(WITH_MOZILLA)" == "YES") || "$(WITH_MOZILLA)" == "NO" || ( "$(OS)" == "MACOSX" ) || ( "$(OS)" == "OS2" )
all:
@echo " Not building the mozilla address book driver"
@echo " dependency to Mozilla developer snapshots not feasable at the moment"
@@ -76,9 +76,6 @@ MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lnspr4 -lxpcom_core -lmozreg_s -lembed_base_s
.ENDIF
#End of mozilla specific stuff.
-# Disable '-z defs' due to broken libxpcom.
-LINKFLAGSDEFS=$(0)
-
USE_DEFFILE=TRUE
ENABLE_EXCEPTIONS=TRUE
VISIBILITY_HIDDEN=TRUE
diff --git a/connectivity/source/drivers/mozab/mozillasrc/makefile.mk b/connectivity/source/drivers/mozab/mozillasrc/makefile.mk
index e350365d3442..e31d4c7e412b 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/makefile.mk
+++ b/connectivity/source/drivers/mozab/mozillasrc/makefile.mk
@@ -52,7 +52,7 @@ ENVCFLAGS+=/FR$(SLO)$/
.INCLUDE : settings.mk
-.IF ("$(SYSTEM_MOZILLA)" == "YES" && "$(WITH_MOZILLA)" == "YES") || "$(WITH_MOZILLA)" == "NO"
+.IF ("$(SYSTEM_MOZILLA)" == "YES" && "$(WITH_MOZILLA)" == "YES") || "$(WITH_MOZILLA)" == "NO" || "$(OS)" == "OS2"
dummy:
@echo " Not building the mozillasrc stuff in OpenOffice.org build"
@echo " dependency to Mozilla developer snapshots not feasable at the moment"
diff --git a/connectivity/source/drivers/mysql/YTables.cxx b/connectivity/source/drivers/mysql/YTables.cxx
index b835909d2c63..d60deb22df7d 100644
--- a/connectivity/source/drivers/mysql/YTables.cxx
+++ b/connectivity/source/drivers/mysql/YTables.cxx
@@ -130,7 +130,7 @@ void OTables::impl_refresh( ) throw(RuntimeException)
// -------------------------------------------------------------------------
void OTables::disposing(void)
{
- m_xMetaData = NULL;
+m_xMetaData.clear();
OCollection::disposing();
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/mysql/YViews.cxx b/connectivity/source/drivers/mysql/YViews.cxx
index c90445718842..0f8807c91f26 100644
--- a/connectivity/source/drivers/mysql/YViews.cxx
+++ b/connectivity/source/drivers/mysql/YViews.cxx
@@ -87,7 +87,7 @@ void OViews::impl_refresh( ) throw(RuntimeException)
// -------------------------------------------------------------------------
void OViews::disposing(void)
{
- m_xMetaData = NULL;
+m_xMetaData.clear();
OCollection::disposing();
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/mysql/mysql.xcu b/connectivity/source/drivers/mysql/mysql.xcu
index c730df2af5c7..a3babe090bf4 100755
--- a/connectivity/source/drivers/mysql/mysql.xcu
+++ b/connectivity/source/drivers/mysql/mysql.xcu
@@ -80,11 +80,6 @@
<value>true</value>
</prop>
</node>
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
</node>
<node oor:name="MetaData">
<node oor:name="SupportsTableCreation" oor:op="replace">
@@ -149,19 +144,83 @@
<value>true</value>
</prop>
</node>
- <node oor:name="EscapeDateTime" oor:op="replace">
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsTableCreation" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="SupportsBrowsing" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
+ <node oor:name="Authentication" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>UserPassword</value>
+ </prop>
+ </node>
</node>
- <node oor:name="MetaData">
- <node oor:name="SupportsTableCreation" oor:op="replace">
+ </node>
+ <node oor:name="sdbc:mysql:mysqlc:*" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>org.openoffice.comp.drivers.MySQL.Driver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">MySQL (Native)</value>
+ </prop>
+ <node oor:name="Properties">
+ <node oor:name="CharSet" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="LocalSocket" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="NamedPipe" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="Features">
+ <node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
- <node oor:name="SupportsBrowsing" oor:op="replace">
+ <node oor:name="IgnoreDriverPrivileges" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="DisplayVersionColumns" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseDOSLineEnds" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="BooleanComparisonMode" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="FormsCheckRequiredFields" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsTableCreation" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
diff --git a/connectivity/source/drivers/odbcbase/OConnection.cxx b/connectivity/source/drivers/odbcbase/OConnection.cxx
index 40a14531553c..0a86ed7b9f18 100644
--- a/connectivity/source/drivers/odbcbase/OConnection.cxx
+++ b/connectivity/source/drivers/odbcbase/OConnection.cxx
@@ -69,6 +69,7 @@ OConnection::OConnection(const SQLHANDLE _pDriverHandle,ODBCDriver* _pDriver)
,m_bParameterSubstitution(sal_False)
,m_bIgnoreDriverPrivileges(sal_False)
,m_bPreventGetVersionColumns(sal_False)
+ ,m_bReadOnly(sal_True)
{
m_pDriver->acquire();
}
@@ -104,7 +105,6 @@ SQLRETURN OConnection::OpenConnection(const ::rtl::OUString& aConnectStr,sal_Int
if (m_aConnectionHandle == SQL_NULL_HANDLE)
return -1;
- sal_Bool bReadOnly; //weil Methode statisch hier noch einmal ein lokales bReadOnly
SQLRETURN nSQLRETURN = 0;
SDB_ODBC_CHAR szConnStrOut[4096];
SDB_ODBC_CHAR szConnStrIn[2048];
@@ -153,11 +153,11 @@ SQLRETURN OConnection::OpenConnection(const ::rtl::OUString& aConnectStr,sal_Int
{
::rtl::OUString aVal;
OTools::GetInfo(this,m_aConnectionHandle,SQL_DATA_SOURCE_READ_ONLY,aVal,*this,getTextEncoding());
- bReadOnly = !aVal.compareToAscii("Y");
+ m_bReadOnly = !aVal.compareToAscii("Y");
}
catch(Exception&)
{
- bReadOnly = sal_True;
+ m_bReadOnly = sal_True;
}
try
{
@@ -172,7 +172,7 @@ SQLRETURN OConnection::OpenConnection(const ::rtl::OUString& aConnectStr,sal_Int
// autocoomit ist immer default
- if (!bReadOnly)
+ if (!m_bReadOnly)
N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_AUTOCOMMIT,(SQLPOINTER)SQL_AUTOCOMMIT_ON,SQL_IS_INTEGER);
return nSQLRETURN;
@@ -299,10 +299,7 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const ::
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
- if(m_aTypeInfo.empty())
- buildTypeInfo();
-
- Reference< XPreparedStatement > xReturn = new OPreparedStatement(this,m_aTypeInfo,sql);
+ Reference< XPreparedStatement > xReturn = new OPreparedStatement(this,sql);
m_aStatements.push_back(WeakReferenceHelper(xReturn));
return xReturn;
}
@@ -399,15 +396,10 @@ void SAL_CALL OConnection::setReadOnly( sal_Bool readOnly ) throw(SQLException,
m_aConnectionHandle,SQL_HANDLE_DBC,*this);
}
// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OConnection::isReadOnly( ) throw(SQLException, RuntimeException)
+sal_Bool SAL_CALL OConnection::isReadOnly() throw(SQLException, RuntimeException)
{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- ::rtl::OUString aValue;
- OTools::GetInfo(this,m_aConnectionHandle,SQL_DATA_SOURCE_READ_ONLY,aValue,*this,getTextEncoding());
- return !aValue.compareToAscii("Y");
+ // const member which will initialized only once
+ return m_bReadOnly;
}
// --------------------------------------------------------------------------------
void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& catalog ) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/drivers/odbcbase/ODatabaseMetaData.cxx b/connectivity/source/drivers/odbcbase/ODatabaseMetaData.cxx
index 79baeac3cadc..b92206199c24 100644
--- a/connectivity/source/drivers/odbcbase/ODatabaseMetaData.cxx
+++ b/connectivity/source/drivers/odbcbase/ODatabaseMetaData.cxx
@@ -43,6 +43,7 @@
#include "stdio.h"
#include "TPrivilegesResultSet.hxx"
#include <connectivity/dbexception.hxx>
+#include <rtl/ustrbuf.hxx>
using namespace connectivity::odbc;
using namespace com::sun::star::uno;
@@ -830,9 +831,7 @@ sal_Bool SAL_CALL ODatabaseMetaData::allTablesAreSelectable( ) throw(SQLExcepti
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException)
{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DATA_SOURCE_READ_ONLY,aValue,*this,m_pConnection->getTextEncoding());
- return aValue.toChar() == 'Y';
+ return m_pConnection->isReadOnly();
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFiles( ) throw(SQLException, RuntimeException)
@@ -1324,186 +1323,197 @@ sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeExc
::rtl::OUString SAL_CALL ODatabaseMetaData::getStringFunctions( ) throw(SQLException, RuntimeException)
{
SQLUINTEGER nValue;
- ::rtl::OUString aValue;
+ ::rtl::OUStringBuffer aValue;
OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_STRING_FUNCTIONS,nValue,*this);
if(nValue & SQL_FN_STR_ASCII)
- aValue = ::rtl::OUString::createFromAscii("ASCII,");
+ aValue.appendAscii("ASCII,");
if(nValue & SQL_FN_STR_BIT_LENGTH)
- aValue += ::rtl::OUString::createFromAscii("BIT_LENGTH,");
+ aValue.appendAscii("BIT_LENGTH,");
if(nValue & SQL_FN_STR_CHAR)
- aValue += ::rtl::OUString::createFromAscii("CHAR,");
+ aValue.appendAscii("CHAR,");
if(nValue & SQL_FN_STR_CHAR_LENGTH)
- aValue += ::rtl::OUString::createFromAscii("CHAR_LENGTH,");
+ aValue.appendAscii("CHAR_LENGTH,");
if(nValue & SQL_FN_STR_CHARACTER_LENGTH)
- aValue += ::rtl::OUString::createFromAscii("CHARACTER_LENGTH,");
+ aValue.appendAscii("CHARACTER_LENGTH,");
if(nValue & SQL_FN_STR_CONCAT)
- aValue += ::rtl::OUString::createFromAscii("CONCAT,");
+ aValue.appendAscii("CONCAT,");
if(nValue & SQL_FN_STR_DIFFERENCE)
- aValue += ::rtl::OUString::createFromAscii("DIFFERENCE,");
+ aValue.appendAscii("DIFFERENCE,");
if(nValue & SQL_FN_STR_INSERT)
- aValue += ::rtl::OUString::createFromAscii("INSERT,");
+ aValue.appendAscii("INSERT,");
if(nValue & SQL_FN_STR_LCASE)
- aValue += ::rtl::OUString::createFromAscii("LCASE,");
+ aValue.appendAscii("LCASE,");
if(nValue & SQL_FN_STR_LEFT)
- aValue += ::rtl::OUString::createFromAscii("LEFT,");
+ aValue.appendAscii("LEFT,");
if(nValue & SQL_FN_STR_LENGTH)
- aValue += ::rtl::OUString::createFromAscii("LENGTH,");
+ aValue.appendAscii("LENGTH,");
if(nValue & SQL_FN_STR_LOCATE)
- aValue += ::rtl::OUString::createFromAscii("LOCATE,");
+ aValue.appendAscii("LOCATE,");
if(nValue & SQL_FN_STR_LOCATE_2)
- aValue += ::rtl::OUString::createFromAscii("LOCATE_2,");
+ aValue.appendAscii("LOCATE_2,");
if(nValue & SQL_FN_STR_LTRIM)
- aValue += ::rtl::OUString::createFromAscii("LTRIM,");
+ aValue.appendAscii("LTRIM,");
if(nValue & SQL_FN_STR_OCTET_LENGTH)
- aValue += ::rtl::OUString::createFromAscii("OCTET_LENGTH,");
+ aValue.appendAscii("OCTET_LENGTH,");
if(nValue & SQL_FN_STR_POSITION)
- aValue += ::rtl::OUString::createFromAscii("POSITION,");
+ aValue.appendAscii("POSITION,");
if(nValue & SQL_FN_STR_REPEAT)
- aValue += ::rtl::OUString::createFromAscii("REPEAT,");
+ aValue.appendAscii("REPEAT,");
if(nValue & SQL_FN_STR_REPLACE)
- aValue += ::rtl::OUString::createFromAscii("REPLACE,");
+ aValue.appendAscii("REPLACE,");
if(nValue & SQL_FN_STR_RIGHT)
- aValue += ::rtl::OUString::createFromAscii("RIGHT,");
+ aValue.appendAscii("RIGHT,");
if(nValue & SQL_FN_STR_RTRIM)
- aValue += ::rtl::OUString::createFromAscii("RTRIM,");
+ aValue.appendAscii("RTRIM,");
if(nValue & SQL_FN_STR_SOUNDEX)
- aValue += ::rtl::OUString::createFromAscii("SOUNDEX,");
+ aValue.appendAscii("SOUNDEX,");
if(nValue & SQL_FN_STR_SPACE)
- aValue += ::rtl::OUString::createFromAscii("SPACE,");
+ aValue.appendAscii("SPACE,");
if(nValue & SQL_FN_STR_SUBSTRING)
- aValue += ::rtl::OUString::createFromAscii("SUBSTRING,");
+ aValue.appendAscii("SUBSTRING,");
if(nValue & SQL_FN_STR_UCASE)
- aValue += ::rtl::OUString::createFromAscii("UCASE,");
+ aValue.appendAscii("UCASE,");
- return aValue.copy(0,aValue.lastIndexOf(','));
+ if ( aValue.getLength() )
+ aValue.setLength(aValue.getLength()-1);
+
+ return aValue.makeStringAndClear();
}
// -------------------------------------------------------------------------
::rtl::OUString SAL_CALL ODatabaseMetaData::getTimeDateFunctions( ) throw(SQLException, RuntimeException)
{
SQLUINTEGER nValue;
- ::rtl::OUString aValue;
+ ::rtl::OUStringBuffer aValue;
OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TIMEDATE_FUNCTIONS,nValue,*this);
if(nValue & SQL_FN_TD_CURRENT_DATE)
- aValue = ::rtl::OUString::createFromAscii("CURRENT_DATE,");
+ aValue.appendAscii("CURRENT_DATE,");
if(nValue & SQL_FN_TD_CURRENT_TIME)
- aValue += ::rtl::OUString::createFromAscii("CURRENT_TIME,");
+ aValue.appendAscii("CURRENT_TIME,");
if(nValue & SQL_FN_TD_CURRENT_TIMESTAMP)
- aValue += ::rtl::OUString::createFromAscii("CURRENT_TIMESTAMP,");
+ aValue.appendAscii("CURRENT_TIMESTAMP,");
if(nValue & SQL_FN_TD_CURDATE)
- aValue += ::rtl::OUString::createFromAscii("CURDATE,");
+ aValue.appendAscii("CURDATE,");
if(nValue & SQL_FN_TD_CURTIME)
- aValue += ::rtl::OUString::createFromAscii("CURTIME,");
+ aValue.appendAscii("CURTIME,");
if(nValue & SQL_FN_TD_DAYNAME)
- aValue += ::rtl::OUString::createFromAscii("DAYNAME,");
+ aValue.appendAscii("DAYNAME,");
if(nValue & SQL_FN_TD_DAYOFMONTH)
- aValue += ::rtl::OUString::createFromAscii("DAYOFMONTH,");
+ aValue.appendAscii("DAYOFMONTH,");
if(nValue & SQL_FN_TD_DAYOFWEEK)
- aValue += ::rtl::OUString::createFromAscii("DAYOFWEEK,");
+ aValue.appendAscii("DAYOFWEEK,");
if(nValue & SQL_FN_TD_DAYOFYEAR)
- aValue += ::rtl::OUString::createFromAscii("DAYOFYEAR,");
+ aValue.appendAscii("DAYOFYEAR,");
if(nValue & SQL_FN_TD_EXTRACT)
- aValue += ::rtl::OUString::createFromAscii("EXTRACT,");
+ aValue.appendAscii("EXTRACT,");
if(nValue & SQL_FN_TD_HOUR)
- aValue += ::rtl::OUString::createFromAscii("HOUR,");
+ aValue.appendAscii("HOUR,");
if(nValue & SQL_FN_TD_MINUTE)
- aValue += ::rtl::OUString::createFromAscii("MINUTE,");
+ aValue.appendAscii("MINUTE,");
if(nValue & SQL_FN_TD_MONTH)
- aValue += ::rtl::OUString::createFromAscii("MONTH,");
+ aValue.appendAscii("MONTH,");
if(nValue & SQL_FN_TD_MONTHNAME)
- aValue += ::rtl::OUString::createFromAscii("MONTHNAME,");
+ aValue.appendAscii("MONTHNAME,");
if(nValue & SQL_FN_TD_NOW)
- aValue += ::rtl::OUString::createFromAscii("NOW,");
+ aValue.appendAscii("NOW,");
if(nValue & SQL_FN_TD_QUARTER)
- aValue += ::rtl::OUString::createFromAscii("QUARTER,");
+ aValue.appendAscii("QUARTER,");
if(nValue & SQL_FN_TD_SECOND)
- aValue += ::rtl::OUString::createFromAscii("SECOND,");
+ aValue.appendAscii("SECOND,");
if(nValue & SQL_FN_TD_TIMESTAMPADD)
- aValue += ::rtl::OUString::createFromAscii("TIMESTAMPADD,");
+ aValue.appendAscii("TIMESTAMPADD,");
if(nValue & SQL_FN_TD_TIMESTAMPDIFF)
- aValue += ::rtl::OUString::createFromAscii("TIMESTAMPDIFF,");
+ aValue.appendAscii("TIMESTAMPDIFF,");
if(nValue & SQL_FN_TD_WEEK)
- aValue += ::rtl::OUString::createFromAscii("WEEK,");
+ aValue.appendAscii("WEEK,");
if(nValue & SQL_FN_TD_YEAR)
- aValue += ::rtl::OUString::createFromAscii("YEAR,");
+ aValue.appendAscii("YEAR,");
- return aValue.copy(0,aValue.lastIndexOf(','));
+ if ( aValue.getLength() )
+ aValue.setLength(aValue.getLength()-1);
+
+ return aValue.makeStringAndClear();
}
// -------------------------------------------------------------------------
::rtl::OUString SAL_CALL ODatabaseMetaData::getSystemFunctions( ) throw(SQLException, RuntimeException)
{
SQLUINTEGER nValue;
- ::rtl::OUString aValue;
+ ::rtl::OUStringBuffer aValue;
OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SYSTEM_FUNCTIONS,nValue,*this);
if(nValue & SQL_FN_SYS_DBNAME)
- aValue += ::rtl::OUString::createFromAscii("DBNAME,");
+ aValue.appendAscii("DBNAME,");
if(nValue & SQL_FN_SYS_IFNULL)
- aValue += ::rtl::OUString::createFromAscii("IFNULL,");
+ aValue.appendAscii("IFNULL,");
if(nValue & SQL_FN_SYS_USERNAME)
- aValue += ::rtl::OUString::createFromAscii("USERNAME,");
+ aValue.appendAscii("USERNAME,");
- return aValue.copy(0,aValue.lastIndexOf(','));
+ if ( aValue.getLength() )
+ aValue.setLength(aValue.getLength()-1);
+
+ return aValue.makeStringAndClear();
}
// -------------------------------------------------------------------------
::rtl::OUString SAL_CALL ODatabaseMetaData::getNumericFunctions( ) throw(SQLException, RuntimeException)
{
SQLUINTEGER nValue;
- ::rtl::OUString aValue;
+ ::rtl::OUStringBuffer aValue;
OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NUMERIC_FUNCTIONS,nValue,*this);
if(nValue & SQL_FN_NUM_ABS)
- aValue += ::rtl::OUString::createFromAscii("ABS,");
+ aValue.appendAscii("ABS,");
if(nValue & SQL_FN_NUM_ACOS)
- aValue += ::rtl::OUString::createFromAscii("ACOS,");
+ aValue.appendAscii("ACOS,");
if(nValue & SQL_FN_NUM_ASIN)
- aValue += ::rtl::OUString::createFromAscii("ASIN,");
+ aValue.appendAscii("ASIN,");
if(nValue & SQL_FN_NUM_ATAN)
- aValue += ::rtl::OUString::createFromAscii("ATAN,");
+ aValue.appendAscii("ATAN,");
if(nValue & SQL_FN_NUM_ATAN2)
- aValue += ::rtl::OUString::createFromAscii("ATAN2,");
+ aValue.appendAscii("ATAN2,");
if(nValue & SQL_FN_NUM_CEILING)
- aValue += ::rtl::OUString::createFromAscii("CEILING,");
+ aValue.appendAscii("CEILING,");
if(nValue & SQL_FN_NUM_COS)
- aValue += ::rtl::OUString::createFromAscii("COS,");
+ aValue.appendAscii("COS,");
if(nValue & SQL_FN_NUM_COT)
- aValue += ::rtl::OUString::createFromAscii("COT,");
+ aValue.appendAscii("COT,");
if(nValue & SQL_FN_NUM_DEGREES)
- aValue += ::rtl::OUString::createFromAscii("DEGREES,");
+ aValue.appendAscii("DEGREES,");
if(nValue & SQL_FN_NUM_EXP)
- aValue += ::rtl::OUString::createFromAscii("EXP,");
+ aValue.appendAscii("EXP,");
if(nValue & SQL_FN_NUM_FLOOR)
- aValue += ::rtl::OUString::createFromAscii("FLOOR,");
+ aValue.appendAscii("FLOOR,");
if(nValue & SQL_FN_NUM_LOG)
- aValue += ::rtl::OUString::createFromAscii("LOGF,");
+ aValue.appendAscii("LOGF,");
if(nValue & SQL_FN_NUM_LOG10)
- aValue += ::rtl::OUString::createFromAscii("LOG10,");
+ aValue.appendAscii("LOG10,");
if(nValue & SQL_FN_NUM_MOD)
- aValue += ::rtl::OUString::createFromAscii("MOD,");
+ aValue.appendAscii("MOD,");
if(nValue & SQL_FN_NUM_PI)
- aValue += ::rtl::OUString::createFromAscii("PI,");
+ aValue.appendAscii("PI,");
if(nValue & SQL_FN_NUM_POWER)
- aValue += ::rtl::OUString::createFromAscii("POWER,");
+ aValue.appendAscii("POWER,");
if(nValue & SQL_FN_NUM_RADIANS)
- aValue += ::rtl::OUString::createFromAscii("RADIANS,");
+ aValue.appendAscii("RADIANS,");
if(nValue & SQL_FN_NUM_RAND)
- aValue += ::rtl::OUString::createFromAscii("RAND,");
+ aValue.appendAscii("RAND,");
if(nValue & SQL_FN_NUM_ROUND)
- aValue += ::rtl::OUString::createFromAscii("ROUND,");
+ aValue.appendAscii("ROUND,");
if(nValue & SQL_FN_NUM_SIGN)
- aValue += ::rtl::OUString::createFromAscii("SIGN,");
+ aValue.appendAscii("SIGN,");
if(nValue & SQL_FN_NUM_SIN)
- aValue += ::rtl::OUString::createFromAscii("SIN,");
+ aValue.appendAscii("SIN,");
if(nValue & SQL_FN_NUM_SQRT)
- aValue += ::rtl::OUString::createFromAscii("SQRT,");
+ aValue.appendAscii("SQRT,");
if(nValue & SQL_FN_NUM_TAN)
- aValue += ::rtl::OUString::createFromAscii("TAN,");
+ aValue.appendAscii("TAN,");
if(nValue & SQL_FN_NUM_TRUNCATE)
- aValue += ::rtl::OUString::createFromAscii("TRUNCATE,");
+ aValue.appendAscii("TRUNCATE,");
+ if ( aValue.getLength() )
+ aValue.setLength(aValue.getLength()-1);
- return aValue.copy(0,aValue.lastIndexOf(','));
+ return aValue.makeStringAndClear();
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
index dd91861062b6..77ecceeaacdf 100644
--- a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
@@ -112,7 +112,7 @@ void ODatabaseMetaDataResultSet::disposing(void)
m_pConnection->freeStatementHandle(m_aStatementHandle);
m_aStatement = NULL;
- m_xMetaData = NULL;
+m_xMetaData.clear();
m_pConnection->release();
}
// -------------------------------------------------------------------------
@@ -434,7 +434,7 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex )
columnIndex = mapColumn(columnIndex);
::rtl::OUString aVal;
if(columnIndex <= m_nDriverColumnCount)
- aVal = OTools::getStringValue(m_pConnection,m_aStatementHandle,columnIndex,(SWORD)getMetaData()->getColumnType(columnIndex),m_bWasNull,**this,m_nTextEncoding);
+ aVal = OTools::getStringValue(m_pConnection,m_aStatementHandle,columnIndex,(SWORD)SQL_C_WCHAR,m_bWasNull,**this,m_nTextEncoding);
else
m_bWasNull = sal_True;
@@ -880,7 +880,8 @@ void ODatabaseMetaDataResultSet::openTables(const Any& catalog, const ::rtl::OUS
else
pSchemaPat = NULL;
- aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
+ if ( catalog.hasValue() )
+ aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
aPKO = ::rtl::OUStringToOString(schemaPattern,m_nTextEncoding);
const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
@@ -1179,8 +1180,10 @@ void ODatabaseMetaDataResultSet::openForeignKeys( const Any& catalog, const ::rt
m_bFreeHandle = sal_True;
::rtl::OString aPKQ,aPKO,aPKN, aFKQ, aFKO, aFKN;
- aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
- aFKQ = ::rtl::OUStringToOString(comphelper::getString(catalog2),m_nTextEncoding);
+ if ( catalog.hasValue() )
+ aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
+ if ( catalog2.hasValue() )
+ aFKQ = ::rtl::OUStringToOString(comphelper::getString(catalog2),m_nTextEncoding);
const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
*pPKO = schema && schema->getLength() ? ::rtl::OUStringToOString(*schema,m_nTextEncoding).getStr() : NULL,
diff --git a/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx b/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx
index 0a798092c742..655006d1f8e4 100644
--- a/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx
+++ b/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx
@@ -65,9 +65,8 @@ using namespace com::sun::star::util;
IMPLEMENT_SERVICE_INFO(OPreparedStatement,"com.sun.star.sdbcx.OPreparedStatement","com.sun.star.sdbc.PreparedStatement");
-OPreparedStatement::OPreparedStatement( OConnection* _pConnection,const TTypeInfoVector& _TypeInfo,const ::rtl::OUString& sql)
+OPreparedStatement::OPreparedStatement( OConnection* _pConnection,const ::rtl::OUString& sql)
:OStatement_BASE2(_pConnection)
- ,m_aTypeInfo(_TypeInfo)
,numParams(0)
,boundParams(NULL)
,m_bPrepared(sal_False)
@@ -80,12 +79,11 @@ OPreparedStatement::OPreparedStatement( OConnection* _pConnection,const TTypeInf
OSQLParser aParser(_pConnection->getDriver()->getORB());
::rtl::OUString sErrorMessage;
::rtl::OUString sNewSql;
- OSQLParseNode* pNode = aParser.parseTree(sErrorMessage,sql);
- if(pNode)
+ ::std::auto_ptr<OSQLParseNode> pNode( aParser.parseTree(sErrorMessage,sql) );
+ if ( pNode.get() )
{ // special handling for parameters
- OSQLParseNode::substituteParameterNames(pNode);
+ OSQLParseNode::substituteParameterNames(pNode.get());
pNode->parseNodeToStr( sNewSql, _pConnection );
- delete pNode;
m_sSqlStatement = sNewSql;
}
}
@@ -819,12 +817,18 @@ sal_Int32 OPreparedStatement::getPrecision ( sal_Int32 sqlType)
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
sal_Int32 prec = -1;
- if (m_aTypeInfo.size())
+ const TTypeInfoVector& rTypeInfo = m_pConnection->getTypeInfo();
+ if ( !rTypeInfo.empty() )
+ {
+ m_pConnection->buildTypeInfo();
+ }
+
+ if ( !rTypeInfo.empty() )
{
OTypeInfo aInfo;
aInfo.nType = (sal_Int16)sqlType;
- TTypeInfoVector::const_iterator aIter = ::std::find(m_aTypeInfo.begin(),m_aTypeInfo.end(),aInfo);
- if(aIter != m_aTypeInfo.end())
+ TTypeInfoVector::const_iterator aIter = ::std::find(rTypeInfo.begin(),rTypeInfo.end(),aInfo);
+ if(aIter != rTypeInfo.end())
prec = (*aIter).nPrecision;
}
return prec;
diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx
index 4ff581eed299..1825b94051e7 100644
--- a/connectivity/source/drivers/odbcbase/OResultSet.cxx
+++ b/connectivity/source/drivers/odbcbase/OResultSet.cxx
@@ -188,8 +188,8 @@ void OResultSet::disposing(void)
if(m_bFreeHandle)
m_pStatement->getOwnConnection()->freeStatementHandle(m_aStatementHandle);
- m_xStatement = NULL;
- m_xMetaData = NULL;
+m_xStatement.clear();
+m_xMetaData.clear();
}
// -------------------------------------------------------------------------
SQLRETURN OResultSet::unbind(sal_Bool _bUnbindHandle)
@@ -1491,7 +1491,7 @@ void OResultSet::fillRow(sal_Int32 _nToColumn)
for (; pColumn < pColumnEnd; ++nColumn, ++pColumn)
{
- sal_Int32 nType = pColumn->getTypeKind();
+ const sal_Int32 nType = pColumn->getTypeKind();
switch (nType)
{
case DataType::CHAR:
diff --git a/connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx b/connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx
index de5243c93d5a..adf77eca238c 100644
--- a/connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx
+++ b/connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx
@@ -134,32 +134,38 @@ SWORD OResultSetMetaData::getColumnODBCType(OConnection* _pConnection
{
nType = getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column,SQL_DESC_CONCISE_TYPE );
}
+
return nType;
}
// -----------------------------------------------------------------------------
sal_Int32 SAL_CALL OResultSetMetaData::getColumnType( sal_Int32 column ) throw(SQLException, RuntimeException)
{
- sal_Int32 nType = 0;
- if(!m_bUseODBC2Types)
+ ::std::map<sal_Int32,sal_Int32>::iterator aFind = m_aColumnTypes.find(column);
+ if ( aFind == m_aColumnTypes.end() )
{
- try
+ sal_Int32 nType = 0;
+ if(!m_bUseODBC2Types)
{
- nType = getNumColAttrib(column,SQL_DESC_CONCISE_TYPE);
- if(nType == SQL_UNKNOWN_TYPE)
- nType = getNumColAttrib(column, SQL_DESC_TYPE);
- nType = OTools::MapOdbcType2Jdbc(nType);
+ try
+ {
+ nType = getNumColAttrib(column,SQL_DESC_CONCISE_TYPE);
+ if(nType == SQL_UNKNOWN_TYPE)
+ nType = getNumColAttrib(column, SQL_DESC_TYPE);
+ nType = OTools::MapOdbcType2Jdbc(nType);
+ }
+ catch(SQLException& ) // in this case we have an odbc 2.0 driver
+ {
+ m_bUseODBC2Types = sal_True;
+ nType = OTools::MapOdbcType2Jdbc(getNumColAttrib(column,SQL_DESC_CONCISE_TYPE ));
+ }
}
- catch(SQLException& ) // in this case we have an odbc 2.0 driver
- {
- m_bUseODBC2Types = sal_True;
+ else
nType = OTools::MapOdbcType2Jdbc(getNumColAttrib(column,SQL_DESC_CONCISE_TYPE ));
- }
+ aFind = m_aColumnTypes.insert(::std::map<sal_Int32,sal_Int32>::value_type(column,nType)).first;
}
- else
- nType = OTools::MapOdbcType2Jdbc(getNumColAttrib(column,SQL_DESC_CONCISE_TYPE ));
- return nType;
+ return aFind->second;
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/odbcbase/OStatement.cxx b/connectivity/source/drivers/odbcbase/OStatement.cxx
index 16756052d571..3e0fdbd79c3f 100644
--- a/connectivity/source/drivers/odbcbase/OStatement.cxx
+++ b/connectivity/source/drivers/odbcbase/OStatement.cxx
@@ -94,7 +94,17 @@ OStatement_Base::OStatement_Base(OConnection* _pConnection )
osl_incrementInterlockedCount( &m_refCount );
m_pConnection->acquire();
m_aStatementHandle = m_pConnection->createStatementHandle();
- setMaxFieldSize(0);
+
+ //setMaxFieldSize(0);
+ // Don't do this. By ODBC spec, "0" is the default for the SQL_ATTR_MAX_LENGTH attribute. We once introduced
+ // this line since an PostgreSQL ODBC driver had a default other than 0. However, current drivers (at least 8.3
+ // and later) have a proper default of 0, so there should be no need anymore.
+ // On the other hand, the NotesSQL driver (IBM's ODBC driver for the Lotus Notes series) wrongly interprets
+ // "0" as "0", whereas the ODBC spec says it should in fact mean "unlimited".
+ // So, removing this line seems to be the best option for now.
+ // If we ever again encounter a ODBC driver which needs this option, then we should introduce a data source
+ // setting for it, instead of unconditionally doing it.
+
osl_decrementInterlockedCount( &m_refCount );
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/odbcbase/OTools.cxx b/connectivity/source/drivers/odbcbase/OTools.cxx
index f72aec64e7dc..a7ac4ebf4d78 100644
--- a/connectivity/source/drivers/odbcbase/OTools.cxx
+++ b/connectivity/source/drivers/odbcbase/OTools.cxx
@@ -571,9 +571,12 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
return ::rtl::OUString();
// Bei Fehler bricht der GETDATA-Makro mit return ab,
// bei NULL mit break!
- SQLINTEGER nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1);
+ SQLINTEGER nRealSize = 0;
+ if ( pcbValue > -1 )
+ nRealSize = pcbValue / sizeof(sal_Unicode);
+ SQLINTEGER nLen = pcbValue != SQL_NO_TOTAL ? std::min(nRealSize, nMaxLen) : (nMaxLen-1);
waCharArray[nLen] = 0;
- aData = ::rtl::OUString(waCharArray);
+ aData.append(waCharArray,nLen);
// Es handelt sich um Binaerdaten, um einen String, der fuer
// StarView zu lang ist oder der Treiber kann die Laenge der
@@ -598,7 +601,10 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
(SQLINTEGER)nLen+1,
&pcbValue),
_aStatementHandle,SQL_HANDLE_STMT,_xInterface);
- nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1);
+ nRealSize = 0;
+ if ( pcbValue > -1 )
+ nRealSize = pcbValue / sizeof(sal_Unicode);
+ nLen = pcbValue != SQL_NO_TOTAL ? std::min(nRealSize, nMaxLen) : (nMaxLen-1);
waCharArray[nLen] = 0;
aData.append(::rtl::OUString(waCharArray));
@@ -628,7 +634,7 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
aCharArray[nLen] = 0;
if ( ((pcbValue == SQL_NO_TOTAL) || pcbValue > nMaxLen) && aCharArray[nLen-1] == 0 && nLen > 0 )
--nLen;
- aData = ::rtl::OUString((const sal_Char*)aCharArray,nLen, _nTextEncoding);
+ aData.append(::rtl::OUString((const sal_Char*)aCharArray,nLen, _nTextEncoding));
// Es handelt sich um Binaerdaten, um einen String, der fuer
// StarView zu lang ist oder der Treiber kann die Laenge der
diff --git a/connectivity/source/inc/OSubComponent.hxx b/connectivity/source/inc/OSubComponent.hxx
index 1ea9708e5a27..7a078c346805 100644
--- a/connectivity/source/inc/OSubComponent.hxx
+++ b/connectivity/source/inc/OSubComponent.hxx
@@ -78,7 +78,7 @@ namespace connectivity
{
// avoid ambiguity
::osl::MutexGuard aGuard( m_pDerivedImplementation->WEAK::rBHelper.rMutex );
- m_xParent = NULL;
+ m_xParent.clear();
}
void relase_ChildImpl()
{
diff --git a/connectivity/source/inc/adabas/BPreparedStatement.hxx b/connectivity/source/inc/adabas/BPreparedStatement.hxx
index 14503c92fd46..ef1501d60e81 100644
--- a/connectivity/source/inc/adabas/BPreparedStatement.hxx
+++ b/connectivity/source/inc/adabas/BPreparedStatement.hxx
@@ -46,7 +46,7 @@ namespace connectivity
virtual void setResultSetType(sal_Int32 _par0) ;
virtual void setUsingBookmarks(sal_Bool _bUseBookmark) ;
public:
- OAdabasPreparedStatement( OAdabasConnection* _pConnection,const ::std::vector<OTypeInfo>& _TypeInfo,const ::rtl::OUString& sql);
+ OAdabasPreparedStatement( OAdabasConnection* _pConnection,const ::rtl::OUString& sql);
};
}
}
diff --git a/connectivity/source/inc/calc/CConnection.hxx b/connectivity/source/inc/calc/CConnection.hxx
index 4f90b8afaee3..1cf65042897d 100644
--- a/connectivity/source/inc/calc/CConnection.hxx
+++ b/connectivity/source/inc/calc/CConnection.hxx
@@ -87,7 +87,7 @@ namespace connectivity
}
~ODocHolder()
{
- m_xDoc = NULL;
+ m_xDoc.clear();
m_pConnection->releaseDoc();
}
::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument> getDoc() const { return m_xDoc; }
diff --git a/connectivity/source/inc/file/fcode.hxx b/connectivity/source/inc/file/fcode.hxx
index f916beb91aae..1869a45ca4c5 100644
--- a/connectivity/source/inc/file/fcode.hxx
+++ b/connectivity/source/inc/file/fcode.hxx
@@ -236,6 +236,16 @@ namespace connectivity
virtual sal_Bool operate(const OOperand*, const OOperand*) const;
};
+ class OOp_NOT : public OBoolOperator
+ {
+ public:
+ TYPEINFO();
+
+ protected:
+ virtual void Exec(OCodeStack&);
+ virtual sal_Bool operate(const OOperand*, const OOperand* = NULL) const;
+ virtual sal_uInt16 getRequestedOperands() const;
+ };
class OOp_AND : public OBoolOperator
{
diff --git a/connectivity/source/inc/flat/ETable.hxx b/connectivity/source/inc/flat/ETable.hxx
index b52898655111..5d34cfd75b1d 100644
--- a/connectivity/source/inc/flat/ETable.hxx
+++ b/connectivity/source/inc/flat/ETable.hxx
@@ -87,6 +87,7 @@ namespace connectivity
virtual sal_Bool seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos);
virtual sal_Bool fetchRow(OValueRefRow& _rRow,const OSQLColumns& _rCols, sal_Bool bIsTable,sal_Bool bRetrieveData);
+ virtual void refreshHeader();
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
//XTypeProvider
diff --git a/connectivity/source/inc/odbc/OConnection.hxx b/connectivity/source/inc/odbc/OConnection.hxx
index 4f70dcfe0634..c0144313ae1a 100644
--- a/connectivity/source/inc/odbc/OConnection.hxx
+++ b/connectivity/source/inc/odbc/OConnection.hxx
@@ -89,12 +89,11 @@ namespace connectivity
sal_Bool m_bParameterSubstitution;
sal_Bool m_bIgnoreDriverPrivileges;
sal_Bool m_bPreventGetVersionColumns; // #i60273#
+ sal_Bool m_bReadOnly;
SQLRETURN OpenConnection(const ::rtl::OUString& aConnectStr,sal_Int32 nTimeOut, sal_Bool bSilent);
- void buildTypeInfo() throw( ::com::sun::star::sdbc::SQLException);
-
virtual OConnection* cloneConnection(); // creates a new connection
public:
@@ -154,6 +153,9 @@ namespace connectivity
SQLHANDLE createStatementHandle();
// close and free the handle and set it to SQL_NULLHANDLE
void freeStatementHandle(SQLHANDLE& _pHandle);
+
+ void buildTypeInfo() throw( ::com::sun::star::sdbc::SQLException);
+ const TTypeInfoVector& getTypeInfo() const { return m_aTypeInfo; }
};
}
}
diff --git a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
index e077fafe1b27..6248417828ba 100644
--- a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
+++ b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
@@ -76,6 +76,7 @@ namespace connectivity
::std::map<sal_Int32, ::connectivity::TString2IntMap > m_aStrValueRange;
::std::map<sal_Int32, ::connectivity::TInt2StringMap > m_aIntValueRange;
+ ::std::map<sal_Int32,SWORD> m_aODBCColumnTypes;
SQLHANDLE m_aStatementHandle;
SQLHANDLE m_aConnectionHandle;
diff --git a/connectivity/source/inc/odbc/OPreparedStatement.hxx b/connectivity/source/inc/odbc/OPreparedStatement.hxx
index c9d8ff272163..9e6f6ca8a61f 100644
--- a/connectivity/source/inc/odbc/OPreparedStatement.hxx
+++ b/connectivity/source/inc/odbc/OPreparedStatement.hxx
@@ -73,10 +73,6 @@ namespace connectivity
//====================================================================
// Data attributes
//====================================================================
- TTypeInfoVector m_aTypeInfo; // Hashtable containing an entry
- // for each row returned by
- // DatabaseMetaData.getTypeInfo.
-
SQLSMALLINT numParams; // Number of parameter markers
// for the prepared statement
@@ -119,7 +115,7 @@ namespace connectivity
public:
DECLARE_SERVICE_INFO();
// ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- OPreparedStatement( OConnection* _pConnection,const TTypeInfoVector& _TypeInfo,const ::rtl::OUString& sql);
+ OPreparedStatement( OConnection* _pConnection,const ::rtl::OUString& sql);
//XInterface
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/connectivity/source/inc/odbc/OResultSetMetaData.hxx b/connectivity/source/inc/odbc/OResultSetMetaData.hxx
index fdf0ed93b0a4..1d9564e5d762 100644
--- a/connectivity/source/inc/odbc/OResultSetMetaData.hxx
+++ b/connectivity/source/inc/odbc/OResultSetMetaData.hxx
@@ -54,6 +54,7 @@ namespace connectivity
{
protected:
::std::vector<sal_Int32> m_vMapping; // when not every column is needed
+ ::std::map<sal_Int32,sal_Int32> m_aColumnTypes;
SQLHANDLE m_aStatementHandle;
OConnection* m_pConnection;
diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
index be1ee39d9ba2..97875dfd4de0 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -3473,30 +3473,6 @@ OSQLParseNode* OSQLParser::parseTree(::rtl::OUString& rErrorMessage,
}
//-----------------------------------------------------------------------------
-/*sal_uInt32 OSQLParser::StrToTokenID(const ::rtl::OString & rName)
-{
- ::rtl::OString aName;
- if (rName.IsAlphaNumericAscii())
- aName = rName;
- else
- {
- aName = "'";
- aName += rName;
- aName += "'";
- }
-
- // Gewuenschten Token-Namen suchen:
- for (sal_uInt32 i = 0; i < SQLyyntoken; i++)
- {
- if (aName == TokenTypes[i].name)
- return TokenTypes[i].token;
- }
-
- // Nicht gefunden
- return 0;
-}*/
-
-//-----------------------------------------------------------------------------
::rtl::OUString OSQLParser::RuleIDToStr(sal_uInt32 nRuleID)
{
OSL_ENSURE(nRuleID < (sizeof yytname/sizeof yytname[0]), "OSQLParser::RuleIDToStr: Invalid nRuleId!");
@@ -3599,17 +3575,15 @@ void OSQLParser::reduceLiteral(OSQLParseNode*& pLiteral, sal_Bool bAppendBlank)
OSL_ENSURE(pLiteral->isRule(), "This is no ::com::sun::star::chaos::Rule");
OSL_ENSURE(pLiteral->count() == 2, "OSQLParser::ReduceLiteral() Invalid count");
OSQLParseNode* pTemp = pLiteral;
- ::rtl::OUString aValue;
+ ::rtl::OUStringBuffer aValue(pLiteral->getChild(0)->getTokenValue());
if (bAppendBlank)
{
- ((aValue = pLiteral->getChild(0)->getTokenValue()) += ::rtl::OUString::createFromAscii(" ")) +=
- pLiteral->getChild(1)->getTokenValue();
+ aValue.appendAscii(" ");
}
- else
- (aValue = pLiteral->getChild(0)->getTokenValue()) +=
- pLiteral->getChild(1)->getTokenValue();
+
+ aValue.append(pLiteral->getChild(1)->getTokenValue());
- pLiteral = new OSQLInternalNode(aValue,SQL_NODE_STRING);
+ pLiteral = new OSQLInternalNode(aValue.makeStringAndClear(),SQL_NODE_STRING);
delete pTemp;
}
diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l
index 6159f79e1b28..e365fdec1eca 100644
--- a/connectivity/source/parse/sqlflex.l
+++ b/connectivity/source/parse/sqlflex.l
@@ -483,7 +483,7 @@ sal_Int32 gatherString( sal_Int32 delim, sal_Int32 nTyp)
}
}
- else if (ch == '\r' || ch == '\n')
+ else if (nTyp != 1 && (ch == '\r' || ch == '\n') )
break;
else
{
diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx
index 42778d6a7ed0..26086495be89 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -460,7 +460,7 @@ void OSQLParseTreeIterator::traverseOneTableName( OSQLTables& _rTables,const OSQ
::rtl::OUString aTableRange(rTableRange);
// Tabellenname abholen
- OSQLParseNode::getTableComponents(pTableName,aCatalog,aSchema,aTableName);
+ OSQLParseNode::getTableComponents(pTableName,aCatalog,aSchema,aTableName,m_pImpl->m_xDatabaseMetaData);
// create the composed name like DOMAIN.USER.TABLE1
aComposedName = ::dbtools::composeTableName(m_pImpl->m_xDatabaseMetaData,
@@ -1687,13 +1687,7 @@ void OSQLParseTreeIterator::setSelectColumnName(::vos::ORef<OSQLColumns>& _rColu
OSL_ENSURE(_rColumns == m_aSelectColumns,"Invalid columns used here!");
ConstOSQLTablesIterator aFind = m_pImpl->m_pTables->find(rTableRange);
- if(aFind == m_pImpl->m_pTables->end())
- {
- ::rtl::OUString strExpression = rTableRange;
- strExpression += ::rtl::OUString::createFromAscii(".");
- strExpression += rColumnName;
- }
- else
+ if(aFind != m_pImpl->m_pTables->end())
appendColumns(_rColumns,rTableRange,aFind->second);
}
else if ( !rTableRange.getLength() )
@@ -1813,11 +1807,6 @@ void OSQLParseTreeIterator::setSelectColumnName(::vos::ORef<OSQLColumns>& _rColu
// Tabelle existiert nicht oder Feld nicht vorhanden
if (bError)
{
- ::rtl::OUString strExpression = rTableRange;
- if (strExpression.getLength())
- strExpression += ::rtl::OUString::createFromAscii(".");
- strExpression += rColumnName;
-
::rtl::OUString aNewColName(getUniqueColumnName(rColumnAlias));
OParseColumn* pColumn = new OParseColumn(aNewColName,::rtl::OUString(),::rtl::OUString(),
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index e134d7a757c4..a1fd44014314 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -742,12 +742,15 @@ void OSQLParseNode::impl_parseLikeNodeToString_throw( ::rtl::OUStringBuffer& rSt
sal_Bool OSQLParseNode::getTableComponents(const OSQLParseNode* _pTableNode,
::com::sun::star::uno::Any &_rCatalog,
::rtl::OUString &_rSchema,
- ::rtl::OUString &_rTable)
+ ::rtl::OUString &_rTable,
+ const Reference< XDatabaseMetaData >& _xMetaData)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::getTableComponents" );
OSL_ENSURE(_pTableNode,"Wrong use of getTableComponents! _pTableNode is not allowed to be null!");
if(_pTableNode)
{
+ const sal_Bool bSupportsCatalog = _xMetaData.is() && _xMetaData->supportsCatalogsInDataManipulation();
+ const sal_Bool bSupportsSchema = _xMetaData.is() && _xMetaData->supportsSchemasInDataManipulation();
const OSQLParseNode* pTableNode = _pTableNode;
// clear the parameter given
_rCatalog = Any();
@@ -762,7 +765,10 @@ sal_Bool OSQLParseNode::getTableComponents(const OSQLParseNode* _pTableNode,
// check if we have schema_name rule
if(SQL_ISRULE(pTableNode,schema_name))
{
- _rSchema = pTableNode->getChild(0)->getTokenValue();
+ if ( bSupportsCatalog && !bSupportsSchema )
+ _rCatalog <<= pTableNode->getChild(0)->getTokenValue();
+ else
+ _rSchema = pTableNode->getChild(0)->getTokenValue();
pTableNode = pTableNode->getChild(2);
}
// check if we have table_name rule
@@ -1246,8 +1252,8 @@ OSQLParseNode* OSQLParser::predicateTree(::rtl::OUString& rErrorMessage, const :
if (SQLyyparse() != 0)
{
m_sFieldName= ::rtl::OUString();
- m_xField = NULL;
- m_xFormatter = NULL;
+ m_xField.clear();
+ m_xFormatter.clear();
m_nFormatKey = 0;
m_nDateFormatKey = 0;
@@ -1267,8 +1273,8 @@ OSQLParseNode* OSQLParser::predicateTree(::rtl::OUString& rErrorMessage, const :
(*s_pGarbageCollector)->clear();
m_sFieldName= ::rtl::OUString();
- m_xField = NULL;
- m_xFormatter = NULL;
+ m_xField.clear();
+ m_xFormatter.clear();
m_nFormatKey = 0;
m_nDateFormatKey = 0;
diff --git a/connectivity/source/resource/conn_shared_res.src b/connectivity/source/resource/conn_shared_res.src
index 92b3e5814f4e..d143dad1ba0f 100644
--- a/connectivity/source/resource/conn_shared_res.src
+++ b/connectivity/source/resource/conn_shared_res.src
@@ -407,7 +407,7 @@ String STR_COULD_NOT_CREATE_INDEX_NAME
};
String STR_COULD_NOT_CREATE_INDEX_KEYSIZE
{
- Text [ en-US ] = "The index could not be created. The size of the choosen column is to big.";
+ Text [ en-US ] = "The index could not be created. The size of the chosen column is to big.";
};
String STR_SQL_NAME_ERROR
diff --git a/connectivity/source/sdbcx/VCatalog.cxx b/connectivity/source/sdbcx/VCatalog.cxx
index 8d1a41a09c2d..ccafa9b9b516 100644
--- a/connectivity/source/sdbcx/VCatalog.cxx
+++ b/connectivity/source/sdbcx/VCatalog.cxx
@@ -226,7 +226,7 @@ void OCatalog::fillNames(Reference< XResultSet >& _xResult,TStringVector& _rName
{
_rNames.push_back( buildName(xRow) );
}
- xRow = NULL;
+ xRow.clear();
::comphelper::disposeComponent(_xResult);
}
}
diff --git a/connectivity/source/sdbcx/VTable.cxx b/connectivity/source/sdbcx/VTable.cxx
index 05ce12f6fc72..8725dfdd02b6 100644
--- a/connectivity/source/sdbcx/VTable.cxx
+++ b/connectivity/source/sdbcx/VTable.cxx
@@ -215,10 +215,9 @@ Reference< XIndexAccess > SAL_CALL OTable::getKeys( ) throw(RuntimeException)
try
{
- refreshKeys();
+ if ( !m_pKeys )
+ refreshKeys();
xKeys = m_pKeys;
- if(!isNew())
- m_pKeys = NULL;
}
catch( const RuntimeException& )
{
@@ -283,8 +282,8 @@ void SAL_CALL OTable::rename( const ::rtl::OUString& newName ) throw(SQLExceptio
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
- ::rtl::OUString sOldComposedName = getName();
- Reference< XDatabaseMetaData> xMetaData = getMetaData();
+ const ::rtl::OUString sOldComposedName = getName();
+ const Reference< XDatabaseMetaData> xMetaData = getMetaData();
if ( xMetaData.is() )
::dbtools::qualifiedNameComponents(xMetaData,newName,m_CatalogName,m_SchemaName,m_Name,::dbtools::eInDataManipulation);
else
diff --git a/connectivity/source/sdbcx/VView.cxx b/connectivity/source/sdbcx/VView.cxx
index e7d2b6466241..448cddc434a0 100644
--- a/connectivity/source/sdbcx/VView.cxx
+++ b/connectivity/source/sdbcx/VView.cxx
@@ -53,7 +53,7 @@ OView::OView(sal_Bool _bCase,
sal_Int32 _CheckOption,
const ::rtl::OUString& _Command,
const ::rtl::OUString& _SchemaName,
- const ::rtl::OUString& _CatalogName) : ODescriptor(OViewHelper::rBHelper,_bCase)
+ const ::rtl::OUString& _CatalogName) : ODescriptor(::comphelper::OMutexAndBroadcastHelper::m_aBHelper,_bCase)
,m_CatalogName(_CatalogName)
,m_SchemaName(_SchemaName)
,m_Command(_Command)
@@ -66,7 +66,7 @@ OView::OView(sal_Bool _bCase,
}
// -------------------------------------------------------------------------
OView::OView(sal_Bool _bCase,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _xMetaData)
- : ODescriptor(OViewHelper::rBHelper,_bCase,sal_True)
+ : ODescriptor(::comphelper::OMutexAndBroadcastHelper::m_aBHelper,_bCase,sal_True)
,m_xMetaData(_xMetaData)
{
construct();
@@ -97,17 +97,12 @@ void OView::disposing(void)
// -------------------------------------------------------------------------
Sequence< Type > SAL_CALL OView::getTypes( ) throw(RuntimeException)
{
- Sequence< Type > aTypes(2);
- aTypes.getArray()[0] = ::getCppuType(static_cast< Reference< ::com::sun::star::container::XNamed> *> (NULL));
- aTypes.getArray()[1] = ::getCppuType(static_cast< Reference< XServiceInfo> *> (NULL));
-
- return ::comphelper::concatSequences(ODescriptor::getTypes(),aTypes);
+ return ::comphelper::concatSequences(ODescriptor::getTypes(),OView_BASE::getTypes());
}
// -------------------------------------------------------------------------
Any SAL_CALL OView::queryInterface( const Type & rType ) throw(RuntimeException)
{
- Any aRet = ::cppu::queryInterface(rType,static_cast< ::com::sun::star::container::XNamed*> (this),
- static_cast< XServiceInfo*> (this));
+ Any aRet = OView_BASE::queryInterface( rType);
return aRet.hasValue() ? aRet : ODescriptor::queryInterface( rType);
}
// -------------------------------------------------------------------------
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index df875df23ad6..995c7e65e999 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -134,6 +134,7 @@ class Desktop : public Application
static rtl::OUString GetLicensePath();
static sal_Bool LicenseNeedsAcceptance();
static sal_Bool IsFirstStartWizardNeeded();
+ static sal_Bool CheckExtensionDependencies();
private:
// Bootstrap methods
diff --git a/desktop/inc/deployment.hrc b/desktop/inc/deployment.hrc
index da349b81848b..e29d1229bd18 100644
--- a/desktop/inc/deployment.hrc
+++ b/desktop/inc/deployment.hrc
@@ -72,7 +72,8 @@
#define RID_STR_UNOPKG_ACCEPT_LIC_Y (RID_DEPLOYMENT_UNOPKG_START+6)
#define RID_STR_UNOPKG_ACCEPT_LIC_NO (RID_DEPLOYMENT_UNOPKG_START+7)
#define RID_STR_UNOPKG_ACCEPT_LIC_N (RID_DEPLOYMENT_UNOPKG_START+8)
-#define RID_STR_CONCURRENTINSTANCE (RID_DEPLOYMENT_UNOPKG_START+9)
+#define RID_STR_UNOPKG_ERROR (RID_DEPLOYMENT_UNOPKG_START+9)
+#define RID_STR_CONCURRENTINSTANCE (RID_DEPLOYMENT_UNOPKG_START+10)
#define RID_DEPLOYMENT_DEPENDENCIES_START (RID_DEPLOYMENT_START + 4400)
#define RID_DEPLYOMENT_DEPENDENCIES_UNKNOWN RID_DEPLOYMENT_DEPENDENCIES_START
diff --git a/desktop/os2/source/applauncher/launcher.cxx b/desktop/os2/source/applauncher/launcher.cxx
index a17838687a0f..1d1280c71bf1 100644
--- a/desktop/os2/source/applauncher/launcher.cxx
+++ b/desktop/os2/source/applauncher/launcher.cxx
@@ -66,7 +66,11 @@ int main( int argc, char* argv[])
DosSetExtLIBPATH( (PCSZ)szLibpath, BEGIN_LIBPATH);
// make sure we load DLL from our path only, so multiple instances/versions
// can be loaded.
+#if 0
+ // YD this feature is not compatible with innowin b20,
+ // java cannot load with this flag enabled
DosSetExtLIBPATH( (PCSZ)"T", LIBPATHSTRICT);
+#endif
// adjust exe name
_splitpath( szApplicationName, szDrive, szDir, szFileName, szExt );
diff --git a/desktop/prj/build.lst b/desktop/prj/build.lst
index 3aa56e273ff3..ce2ed07f57e4 100644
--- a/desktop/prj/build.lst
+++ b/desktop/prj/build.lst
@@ -1,4 +1,4 @@
-dt desktop : l10n sfx2 stoc uui BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp NULL
+dt desktop : l10n sfx2 stoc uui BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg NULL
dt desktop usr1 - all dt_mkout NULL
dt desktop\inc nmake - all dt_inc NULL
dt desktop\prj get - all dt_prj NULL
@@ -38,3 +38,7 @@ dt desktop\source\deployment\registry\executable nmake - all dt_dp_registry_exe
dt desktop\scripts nmake - u dt_scripts dt_inc NULL
dt desktop\util nmake - all dt_util dt_app dt_so_comp dt_spl dt_wrapper.w dt_officeloader.w dt_officeloader_unx.u dt_migr dt_rebase.w NULL
dt desktop\zipintro nmake - all dt_zipintro NULL
+dt desktop\registry\data\org\openoffice\Office nmake - all sn_regconfig NULL
+dt desktop\source\registration\com\sun\star\servicetag\resources get - all sn_svctagres NULL
+dt desktop\source\registration\com\sun\star\servicetag nmake - all sn_svctag NULL
+dt desktop\source\registration\com\sun\star\registration nmake - all sn_regjob sn_svctag NULL
diff --git a/desktop/prj/d.lst b/desktop/prj/d.lst
index eb0d93886e8a..fe688e2c4b44 100644
--- a/desktop/prj/d.lst
+++ b/desktop/prj/d.lst
@@ -134,3 +134,12 @@ mkdir: %COMMON_DEST%\pck%_EXT%\broffice_nologo
..\scripts\basis-link %_DEST%\bin%_EXT%\c08\basis-link
..\scripts\so-basis-link %_DEST%\bin%_EXT%\so\basis-link
..\scripts\odf-basis-link %_DEST%\bin%_EXT%\odf4ms\basis-link
+
+mkdir: %_DEST%\xml%_EXT%\registry\spool
+mkdir: %_DEST%\xml%_EXT%\registry\spool\org
+mkdir: %_DEST%\xml%_EXT%\registry\spool\org\openoffice
+mkdir: %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office
+mkdir: %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office\Jobs
+
+..\%__SRC%\class\*.jar %_DEST%\bin%_EXT%\*.jar
+..\%__SRC%\misc\registry\spool\org\openoffice\Office\Jobs\*.xcu %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office\Jobs
diff --git a/desktop/registry/data/org/openoffice/Office/Jobs.xcu b/desktop/registry/data/org/openoffice/Office/Jobs.xcu
new file mode 100644
index 000000000000..628e3dcdf70a
--- /dev/null
+++ b/desktop/registry/data/org/openoffice/Office/Jobs.xcu
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * 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: Jobs.xcu,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * 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.
+ *
+ ************************************************************************ -->
+<oor:component-data oor:name="Jobs" oor:package="org.openoffice.Office" 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="Jobs">
+ <node oor:name="ProductRegistration" oor:op="replace">
+ <prop oor:name="Service">
+ <value>com.sun.star.comp.framework.DoRegistrationJob</value>
+ </prop>
+ <node oor:name="Arguments">
+ <prop oor:name="ProductName" oor:op="replace" oor:type="xs:string">
+ <value>${SERVICETAG_PRODUCTNAME}</value>
+ </prop>
+ <prop oor:name="ProductVersion" oor:op="replace" oor:type="xs:string">
+ <value>${SERVICETAG_PRODUCTVERSION}</value>
+ </prop>
+ <prop oor:name="ProductURN" oor:op="replace" oor:type="xs:string">
+ <value>${SERVICETAG_URN}</value>
+ </prop>
+ <prop oor:name="ProductSource" oor:op="replace" oor:type="xs:string">
+ <value>${SERVICETAG_SOURCE}</value>
+ </prop>
+ <prop oor:name="ProductParent" oor:op="replace" oor:type="xs:string">
+ <value>${SERVICETAG_PARENTNAME}</value>
+ </prop>
+ <prop oor:name="Vendor" oor:op="replace" oor:type="xs:string">
+ <value>Sun Microsystems, Inc.</value>
+ </prop>
+ <prop oor:name="RegistrationData" oor:op="replace" oor:type="xs:string">
+ <value>$(user)/registration.xml</value>
+ </prop>
+ <prop oor:name="RegistrationURL" oor:op="replace" oor:type="xs:string">
+ <value>${REGISTRATION_HOST}/register/${registry_urn}?product=${REGISTRATION_PRODUCT}&amp;locale=${locale}&amp;cid=${REGISTRATION_CID}</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ <node oor:name="Events">
+ <node oor:name="onRegisterNow" oor:op="fuse">
+ <node oor:name="JobList">
+ <node oor:name="ProductRegistration" oor:op="replace"/>
+ </node>
+ </node>
+ <node oor:name="onRegisterLater" oor:op="fuse">
+ <node oor:name="JobList">
+ <node oor:name="ProductRegistration" oor:op="replace"/>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/sj2/stardiv/app/makefile.mk b/desktop/registry/data/org/openoffice/Office/makefile.mk
index 4e4b5f36a344..651c731fa4a9 100644
--- a/sj2/stardiv/app/makefile.mk
+++ b/desktop/registry/data/org/openoffice/Office/makefile.mk
@@ -8,7 +8,7 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.4 $
+# $Revision: 1.5 $
#
# This file is part of OpenOffice.org.
#
@@ -29,41 +29,53 @@
#
#*************************************************************************
-PRJ=..$/..
+PRJ=..$/..$/..$/..$/..
+PRJNAME=setup_native
+TARGET=data_registration
+PACKAGE=org.openoffice.Office
-PRJNAME=sj2
-TARGET=app
+ABSXCSROOT=$(SOLARXMLDIR)
+XCSROOT=..
+DTDDIR=$(ABSXCSROOT)
+XSLDIR=$(ABSXCSROOT)$/processing
+PROCESSOUT=$(MISC)$/$(TARGET)
+PROCESSORDIR=$(SOLARBINDIR)
-PACKAGE=stardiv$/app
-JARFILES=sandbox.jar
+.INCLUDE : settings.mk
+.IF "$(L10N_framework)"==""
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
+# --- Files -------------------------------------------------------
-.IF "$(JDK)" == "gcj"
-all:
- @echo This dir cannot be build with gcj because of sun.net.ftp.FtpClient
-.ELSE
-# --- Files --------------------------------------------------------
+.IF "$(BUILD_SPECIAL)"!=""
-JAVAFILES= \
- AppletViewer.java \
- AppletViewerFactory.java \
- AppletProps.java \
- AppletMessageHandler.java \
- MsgAppletViewer.java
+XCUFILES= \
+ Jobs.xcu
-JAVACLASSFILES= \
- $(CLASSDIR)$/$(PACKAGE)$/AppletViewer.class \
- $(CLASSDIR)$/$(PACKAGE)$/AppletViewerFactory.class \
- $(CLASSDIR)$/$(PACKAGE)$/AppletProps.class \
- $(CLASSDIR)$/$(PACKAGE)$/AppletMessageHandler.class \
- $(CLASSDIR)$/$(PACKAGE)$/MsgAppletViewer.class
+MODULEFILES=
+LOCALIZEDFILES=
+
+PACKAGEDIR=$(subst,.,$/ $(PACKAGE))
+SPOOLDIR=$(MISC)$/registry$/spool
+
+MYXCUFILES= \
+ $(SPOOLDIR)$/$(PACKAGEDIR)$/Jobs$/Jobs-registration.xcu
+
+.ELSE # "$(BUILD_SPECIAL)"!=""
+
+dummy:
+ @echo "Nothing to build"
+
+.ENDIF # "$(BUILD_SPECIAL)"!=""
# --- Targets ------------------------------------------------------
-.ENDIF
.INCLUDE : target.mk
-.INCLUDE : $(PRJ)$/util$/target.pmk
+.ENDIF # L10N_framework
+ALLTAR : $(MYXCUFILES)
+
+$(SPOOLDIR)$/$(PACKAGEDIR)$/Jobs$/Jobs-registration.xcu : $(PROCESSOUT)$/registry$/data$/$/$(PACKAGEDIR)$/Jobs.xcu
+ @-$(MKDIRHIER) $(@:d)
+ @$(COPY) $< $@
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 8675d22e0aae..d4e0a91c1d17 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1257,6 +1257,7 @@ void Desktop::Main()
std::auto_ptr<SvtLanguageOptions> pLanguageOptions;
std::auto_ptr<SvtPathOptions> pPathOptions;
+ Reference < css::document::XEventListener > xGlobalBroadcaster;
try
{
RegisterServices( xSMgr );
@@ -1379,7 +1380,8 @@ void Desktop::Main()
}
// create service for loadin SFX (still needed in startup)
- Reference < css::document::XEventListener > xGlobalBroadcaster( xSMgr->createInstance(
+ xGlobalBroadcaster = Reference < css::document::XEventListener >
+ ( xSMgr->createInstance(
DEFINE_CONST_UNICODE( "com.sun.star.frame.GlobalEventBroadcaster" ) ), UNO_QUERY );
// initialize test-tool library (if available)
@@ -1387,6 +1389,10 @@ void Desktop::Main()
tools::InitTestToolLib();
RTL_LOGFILE_CONTEXT_TRACE( aLog, "} tools::InitTestToolLib" );
+ bool bAbort = CheckExtensionDependencies();
+ if ( bAbort )
+ return;
+
// First Start Wizard allowed ?
if ( ! pCmdLineArgs->IsNoFirstStartWizard())
{
@@ -1613,6 +1619,13 @@ void Desktop::Main()
FatalError( MakeStartupErrorMessage(exAnyCfg.Message) );
}
+ if (xGlobalBroadcaster.is())
+ {
+ css::document::EventObject aEvent;
+ aEvent.EventName = ::rtl::OUString::createFromAscii("OnCloseApp");
+ xGlobalBroadcaster->notifyEvent(aEvent);
+ }
+
delete pResMgr;
// Restore old value
@@ -1726,9 +1739,12 @@ sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& r
// Try to instanciate quickstart service. This service is not mandatory, so
// do nothing if service is not available.
- Reference < XComponent > xQuickstart( rSMgr->createInstanceWithArguments(
+ if ( bQuickstart )
+ {
+ Reference < XComponent > xQuickstart( rSMgr->createInstanceWithArguments(
DEFINE_CONST_UNICODE( "com.sun.star.office.Quickstart" ), aSeq ),
UNO_QUERY );
+ }
return sal_True;
}
catch( ::com::sun::star::uno::Exception& )
diff --git a/desktop/source/app/check_ext_deps.cxx b/desktop/source/app/check_ext_deps.cxx
new file mode 100644
index 000000000000..a66031184200
--- /dev/null
+++ b/desktop/source/app/check_ext_deps.cxx
@@ -0,0 +1,256 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_desktop.hxx"
+
+#include <rtl/bootstrap.hxx>
+#include <rtl/ustring.hxx>
+#include <unotools/configmgr.hxx>
+
+#include <comphelper/processfactory.hxx>
+#include <comphelper/sequence.hxx>
+#include <cppuhelper/bootstrap.hxx>
+
+#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/task/XJob.hpp>
+#include <com/sun/star/task/XJobExecutor.hpp>
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include <com/sun/star/util/XChangesBatch.hpp>
+
+#include "app.hxx"
+
+using rtl::OUString;
+using namespace desktop;
+using namespace com::sun::star;
+
+#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
+
+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 )
+{
+ rtl::OUString sServiceName = UNISTRING("com.sun.star.deployment.ui.UpdateRequiredDialog");
+ uno::Reference< uno::XInterface > xService;
+ sal_Int16 nRet = 0;
+
+ uno::Reference< lang::XMultiComponentFactory > xServiceManager( xContext->getServiceManager() );
+ if( !xServiceManager.is() )
+ throw uno::RuntimeException(
+ UNISTRING( "impl_showExtensionDialog(): unable to obtain service manager from component context" ), uno::Reference< uno::XInterface > () );
+
+ xService = xServiceManager->createInstanceWithContext( sServiceName, xContext );
+ uno::Reference< ui::dialogs::XExecutableDialog > xExecuteable( xService, uno::UNO_QUERY );
+ if ( xExecuteable.is() )
+ nRet = xExecuteable->execute();
+
+ return nRet;
+}
+
+//------------------------------------------------------------------------------
+// Check dependencies of all packages
+//------------------------------------------------------------------------------
+static bool impl_checkDependencies( const uno::Reference< deployment::XPackageManager > &xPackageManager )
+{
+ uno::Sequence< uno::Reference< deployment::XPackage > > packages;
+
+ try {
+ packages = xPackageManager->getDeployedPackages( uno::Reference< task::XAbortChannel >(),
+ uno::Reference< ucb::XCommandEnvironment >() );
+ }
+ catch ( deployment::DeploymentException & ) { /* handleGeneralError(e.Cause);*/ }
+ catch ( ucb::CommandFailedException & ) { /* handleGeneralError(e.Reason);*/ }
+ catch ( ucb::CommandAbortedException & ) {}
+ catch ( lang::IllegalArgumentException & e ) {
+ throw uno::RuntimeException( e.Message, e.Context );
+ }
+
+ for ( sal_Int32 i = 0; i < packages.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;
+ }
+
+ if ( bRegistered )
+ {
+ bool bDependenciesValid = false;
+ try {
+ bDependenciesValid = packages[i]->checkDependencies( uno::Reference< ucb::XCommandEnvironment >() );
+ }
+ catch ( deployment::DeploymentException & ) {}
+ if ( ! bDependenciesValid )
+ {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+//------------------------------------------------------------------------------
+// resets the 'check needed' flag (needed, if aborted)
+//------------------------------------------------------------------------------
+static void impl_setNeedsCompatCheck()
+{
+ try {
+ Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
+ // get configuration provider
+ Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
+ xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
+
+ Sequence< Any > theArgs(1);
+ beans::NamedValue v( OUString::createFromAscii("NodePath"),
+ makeAny( OUString::createFromAscii("org.openoffice.Setup/Office") ) );
+ theArgs[0] <<= v;
+ Reference< beans::XPropertySet > pset = Reference< beans::XPropertySet >(
+ theConfigProvider->createInstanceWithArguments( sAccessSrvc, theArgs ), UNO_QUERY_THROW );
+
+ Any value = makeAny( OUString::createFromAscii("never") );
+
+ pset->setPropertyValue( OUString::createFromAscii("LastCompatibilityCheckID"), value );
+ Reference< util::XChangesBatch >( pset, UNO_QUERY_THROW )->commitChanges();
+ }
+ catch (const Exception&) {}
+}
+
+//------------------------------------------------------------------------------
+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 );
+ }
+
+ short nRet = 0;
+ if ( !bDependenciesValid )
+ nRet = impl_showExtensionDialog( xContext );
+
+ if ( nRet == -1 )
+ {
+ impl_setNeedsCompatCheck();
+ return true;
+ }
+ else
+ return false;
+}
+
+//------------------------------------------------------------------------------
+// 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()
+{
+ bool bNeedsCheck = false;
+ rtl::OUString aLastCheckBuildID;
+ rtl::OUString aCurrentBuildID( UNISTRING( "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("version") ":buildid}" ) );
+ rtl::Bootstrap::expandMacros( aCurrentBuildID );
+
+ try {
+ Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
+ // get configuration provider
+ Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
+ xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
+
+ Sequence< Any > theArgs(1);
+ beans::NamedValue v( OUString::createFromAscii("NodePath"),
+ makeAny( OUString::createFromAscii("org.openoffice.Setup/Office") ) );
+ theArgs[0] <<= v;
+ Reference< beans::XPropertySet > pset = Reference< beans::XPropertySet >(
+ theConfigProvider->createInstanceWithArguments( sAccessSrvc, theArgs ), UNO_QUERY_THROW );
+
+ Any result = pset->getPropertyValue( OUString::createFromAscii("LastCompatibilityCheckID") );
+
+ result >>= aLastCheckBuildID;
+ if ( aLastCheckBuildID != aCurrentBuildID )
+ {
+ bNeedsCheck = true;
+ result <<= aCurrentBuildID;
+ pset->setPropertyValue( OUString::createFromAscii("LastCompatibilityCheckID"), result );
+ Reference< util::XChangesBatch >( pset, UNO_QUERY_THROW )->commitChanges();
+ }
+ }
+ catch (const Exception&) {}
+
+ return bNeedsCheck;
+}
+
+//------------------------------------------------------------------------------
+// Do we need to check the dependencies of the extensions?
+// When there are unresolved issues, we can't continue with startup
+sal_Bool Desktop::CheckExtensionDependencies()
+{
+ sal_Bool bAbort = false;
+
+ if ( impl_needsCompatCheck() )
+ bAbort = impl_check();
+
+ return bAbort;
+}
+
diff --git a/desktop/source/app/checkinstall.cxx b/desktop/source/app/checkinstall.cxx
index 8fd6bfab7cde..7e45d0b870f6 100644
--- a/desktop/source/app/checkinstall.cxx
+++ b/desktop/source/app/checkinstall.cxx
@@ -51,63 +51,69 @@ namespace desktop
sal_Bool CheckInstallation( OUString& rTitle )
{
- Reference< XMultiServiceFactory > xSMgr = ::comphelper::getProcessServiceFactory();
- Reference< XExactName > xExactName( xSMgr->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.desktop.Evaluation" ))),
- UNO_QUERY );
- if ( xExactName.is() )
+ try
{
- try
+ Reference< XMultiServiceFactory > xSMgr = ::comphelper::getProcessServiceFactory();
+ Reference< XExactName > xExactName( xSMgr->createInstance(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.desktop.Evaluation" ))),
+ UNO_QUERY );
+ if ( xExactName.is() )
{
- rTitle = xExactName->getExactName( rTitle );
- Reference< XMaterialHolder > xMaterialHolder( xExactName, UNO_QUERY );
- if ( xMaterialHolder.is() )
+ try
{
- com::sun::star::util::Date aExpirationDate;
- Any a = xMaterialHolder->getMaterial();
- if ( a >>= aExpirationDate )
+ rTitle = xExactName->getExactName( rTitle );
+ Reference< XMaterialHolder > xMaterialHolder( xExactName, UNO_QUERY );
+ if ( xMaterialHolder.is() )
{
- Date aToday;
- Date aTimeBombDate( aExpirationDate.Day, aExpirationDate.Month, aExpirationDate.Year );
- if ( aToday > aTimeBombDate )
+ com::sun::star::util::Date aExpirationDate;
+ Any a = xMaterialHolder->getMaterial();
+ if ( a >>= aExpirationDate )
{
- InfoBox aInfoBox( NULL, String::CreateFromAscii( "This version has expired" ) );
- aInfoBox.Execute();
- return sal_False;
+ Date aToday;
+ Date aTimeBombDate( aExpirationDate.Day, aExpirationDate.Month, aExpirationDate.Year );
+ if ( aToday > aTimeBombDate )
+ {
+ InfoBox aInfoBox( NULL, String::CreateFromAscii( "This version has expired" ) );
+ aInfoBox.Execute();
+ return sal_False;
+ }
}
- }
- return sal_True;
+ return sal_True;
+ }
+ else
+ {
+ InfoBox aInfoBox( NULL, rTitle );
+ aInfoBox.Execute();
+ return sal_False;
+ }
}
- else
+ catch ( RuntimeException& )
{
- InfoBox aInfoBox( NULL, rTitle );
- aInfoBox.Execute();
+ // Evaluation version expired!
return sal_False;
}
}
- catch ( RuntimeException& )
+ else
{
- // Evaluation version expired!
- return sal_False;
- }
- }
- else
- {
- Reference< com::sun::star::container::XContentEnumerationAccess > rContent( xSMgr , UNO_QUERY );
- if( rContent.is() )
- {
- OUString sEvalService = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.office.Evaluation" ) );
- Reference < com::sun::star::container::XEnumeration > rEnum = rContent->createContentEnumeration( sEvalService );
- if ( rEnum.is() )
+ Reference< com::sun::star::container::XContentEnumerationAccess > rContent( xSMgr , UNO_QUERY );
+ if( rContent.is() )
{
- InfoBox aInfoBox( NULL, rTitle );
- aInfoBox.Execute();
- return sal_False;
+ OUString sEvalService = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.office.Evaluation" ) );
+ Reference < com::sun::star::container::XEnumeration > rEnum = rContent->createContentEnumeration( sEvalService );
+ if ( rEnum.is() )
+ {
+ InfoBox aInfoBox( NULL, rTitle );
+ aInfoBox.Execute();
+ return sal_False;
+ }
}
}
}
+ catch(Exception)
+ {
+ }
return sal_True;
}
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index 0c6de1db2225..c1dd167ea39a 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -122,7 +122,7 @@ DispatchWatcher* DispatchWatcher::GetDispatchWatcher()
DispatchWatcher::DispatchWatcher()
- : m_nRequestCount(1)
+ : m_nRequestCount(0)
{
}
@@ -437,12 +437,13 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch
}
::osl::ClearableMutexGuard aGuard( GetMutex() );
- m_nRequestCount--;
+ bool bEmpty = (m_nRequestCount == 0);
+ aGuard.clear();
// No more asynchronous requests?
// The requests are removed from the request container after they called back to this
// implementation via statusChanged!!
- if ( !m_nRequestCount && ! bNoTerminate /*m_aRequestContainer.empty()*/ )
+ if ( bEmpty && !bNoTerminate /*m_aRequestContainer.empty()*/ )
{
// We have to check if we have an open task otherwise we have to shutdown the office.
Reference< XFramesSupplier > xTasksSupplier( xDesktop, UNO_QUERY );
diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx
index 3c6d6124d178..e9a39207cb50 100644
--- a/desktop/source/app/langselect.cxx
+++ b/desktop/source/app/langselect.cxx
@@ -104,7 +104,7 @@ bool LanguageSelection::prepareLanguage()
::rtl::OUString sWin16SysLocale;
aWin16SysLocale >>= sWin16SysLocale;
if( sWin16SysLocale.getLength())
- setDefaultLocale(sWin16SysLocale);
+ setDefaultLanguage(sWin16SysLocale);
}
catch(const Exception&)
{
@@ -116,9 +116,8 @@ bool LanguageSelection::prepareLanguage()
OUString usLocale;
Reference< XPropertySet > xLocaleProp(getConfigAccess(
"org.openoffice.System/L10N", sal_True), UNO_QUERY_THROW);
- // "org.openoffice.Office.Linguistic/General", sal_True), UNO_QUERY_THROW);
xLocaleProp->getPropertyValue(OUString::createFromAscii("Locale")) >>= usLocale;
- setDefaultLocale(usLocale);
+ setDefaultLanguage(usLocale);
}
catch (Exception&)
{
@@ -160,88 +159,32 @@ bool LanguageSelection::prepareLanguage()
// #i32939# setting of default document locale
// #i32939# this should not be based on the UI language
- setDefaultLocale(aLocaleString);
-
- // fallback: set en-US as default Western locale if no Western locale is set
- OUString usWesternName = OUString::createFromAscii("DefaultLocale");
- try
- {
- Reference< XPropertySet > xProp(getConfigAccess(
- "org.openoffice.Office.Linguistic/General/", sal_True), UNO_QUERY_THROW);
- OUString usValue;
- xProp->getPropertyValue(usWesternName) >>= usValue;
- if (usValue.getLength() == 0)
- {
- // there is no western document language selected
- // if the selected locale is a western locale, this
- // will become the default western docuemnt language
- // otherwise, fall back to en-US
- OUString usDefault = OUString::createFromAscii("en-US");
- try
- {
- xProp->setPropertyValue(usWesternName, makeAny(usDefault));
- Reference< XChangesBatch >(xProp,UNO_QUERY_THROW)->commitChanges();
- }
- catch ( PropertyVetoException )
- {
- // we are not allowed to change this
- }
- }
- }
- catch ( Exception& )
- {
- }
+ setDefaultLanguage(aLocaleString);
return bSuccess;
}
-void LanguageSelection::setDefaultLocale(const OUString& usUILocale)
+void LanguageSelection::setDefaultLanguage(const OUString& sLocale)
{
- // #i32939# setting of default document locale
- // org.openoffice.Office.Linguistic/General/DefaultLocale
- // org.openoffice.Office.Linguistic/General/DefaultLocale_CJK
- // org.openoffice.Office.Linguistic/General/DefaultLocale_CTL
+ // #i32939# setting of default document language
+ //
+ // See #i42730# for rules for determining source of settings
- // determine script type of UI locale
- LanguageType ltUILocale = MsLangId::convertIsoStringToLanguage(usUILocale);
- sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage(ltUILocale);
+ // determine script type of locale
+ LanguageType nLang = MsLangId::convertIsoStringToLanguage(sLocale);
+ sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage(nLang);
- try
- {
- Reference< XPropertySet > xProp(getConfigAccess(
- "org.openoffice.Office.Linguistic/General/", sal_True), UNO_QUERY_THROW);
- OUString usName = OUString::createFromAscii("DefaultLocale");
- switch (nScriptType)
- {
- case SCRIPTTYPE_ASIAN:
- usName = OUString::createFromAscii("DefaultLocale_CJK");
- break;
- case SCRIPTTYPE_COMPLEX:
- usName = OUString::createFromAscii("DefaultLocale_CTL");
- break;
- }
- OUString usValue;
- xProp->getPropertyValue(usName) >>= usValue;
- if (usValue.getLength() == 0)
- {
- // there is no document language set, for the script type selected
- // in the UI
- // covert the LanguageType we've got from the LanguageTable back to
- // an iso string and store it
- OUString usDefault = MsLangId::convertLanguageToIsoString(ltUILocale);
- try
- {
- xProp->setPropertyValue(usName, makeAny(usDefault));
- Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
- }
- catch ( PropertyVetoException )
- {
- // we are not allowed to change this
- }
- }
- }
- catch ( Exception& )
+ switch (nScriptType)
{
+ case SCRIPTTYPE_ASIAN:
+ MsLangId::setConfiguredAsianFallback( nLang );
+ break;
+ case SCRIPTTYPE_COMPLEX:
+ MsLangId::setConfiguredComplexFallback( nLang );
+ break;
+ default:
+ MsLangId::setConfiguredWesternFallback( nLang );
+ break;
}
}
diff --git a/desktop/source/app/langselect.hxx b/desktop/source/app/langselect.hxx
index 0a112545f38b..d0867529ab1b 100644
--- a/desktop/source/app/langselect.hxx
+++ b/desktop/source/app/langselect.hxx
@@ -60,7 +60,7 @@ private:
static rtl::OUString getUserLanguage();
static rtl::OUString getSystemLanguage();
static void resetUserLanguage();
- static void setDefaultLocale(const rtl::OUString&);
+ static void setDefaultLanguage(const rtl::OUString&);
public:
static com::sun::star::lang::Locale IsoStringToLocale(const rtl::OUString& str);
diff --git a/desktop/source/app/makefile.mk b/desktop/source/app/makefile.mk
index 18c2170d3f53..238685649cf9 100644
--- a/desktop/source/app/makefile.mk
+++ b/desktop/source/app/makefile.mk
@@ -40,10 +40,6 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
-.IF "$(GUIBASE)"=="aqua"
-CFLAGS+=-x objective-c++
-.ENDIF
-
.IF "$(ENABLE_GNOMEVFS)"=="TRUE"
CFLAGS+=-DGNOME_VFS_ENABLED
.ENDIF
@@ -56,6 +52,7 @@ SHL1OBJS = \
$(SLO)$/appsys.obj \
$(SLO)$/cfgfilter.obj \
$(SLO)$/checkinstall.obj \
+ $(SLO)$/check_ext_deps.obj \
$(SLO)$/cmdlineargs.obj \
$(SLO)$/cmdlinehelp.obj \
$(SLO)$/configinit.obj \
diff --git a/desktop/source/deployment/gui/dp_gui.h b/desktop/source/deployment/gui/dp_gui.h
index 65fc7635a6ec..7f2cb7a9626a 100644
--- a/desktop/source/deployment/gui/dp_gui.h
+++ b/desktop/source/deployment/gui/dp_gui.h
@@ -82,6 +82,7 @@ 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 ),
diff --git a/desktop/source/deployment/gui/dp_gui.hrc b/desktop/source/deployment/gui/dp_gui.hrc
index 412e6a067159..387072c98618 100644
--- a/desktop/source/deployment/gui/dp_gui.hrc
+++ b/desktop/source/deployment/gui/dp_gui.hrc
@@ -32,7 +32,8 @@
#include "helpid.hrc"
// Package Manager Dialog:
-#define RID_DLG_PACKAGE_MANAGER RID_DEPLOYMENT_GUI_START
+#define RID_DLG_EXTENSION_MANAGER RID_DEPLOYMENT_GUI_START
+#define RID_DLG_UPDATE_REQUIRED (RID_DEPLOYMENT_GUI_START + 11)
#define RID_EM_BTN_CLOSE 10
#define RID_EM_BTN_HELP 11
@@ -42,27 +43,9 @@
#define RID_EM_BTN_CANCEL 15
#define RID_EM_FT_GET_EXTENSIONS 20
#define RID_EM_FT_PROGRESS 21
+#define RID_EM_FT_MSG 22
// local RIDs:
-#define RID_FT_PACKAGES 5
-
-#define RID_BTN_CLOSE 10
-#define RID_BTN_HELP 11
-
-#define RID_BTN_ADD 20
-#define RID_BTN_REMOVE 21
-#define RID_BTN_ENABLE 22
-#define RID_BTN_DISABLE 23
-#define RID_BTN_EXPORT 24
-#define RID_BTN_CHECK_UPDATES 25
-#define RID_BTN_OPTIONS 26
-#define RID_BTN_GET_EXTENSIONS 27
-
-#define RID_IMG_PLUS 41
-#define RID_IMG_PLUS_HC 42
-#define RID_IMG_MINUS 43
-#define RID_IMG_MINUS_HC 44
-
#define PB_LICENSE_DOWN 50
#define ML_LICENSE 51
#define BTN_LICENSE_DECLINE 53
@@ -145,18 +128,10 @@
#define RID_DLG_UPDATE_NOUPDATE 30
#define RID_DLG_UPDATE_VERSION 31
-#define RID_DLG_EXTENSION_MANAGER (RID_DEPLOYMENT_GUI_START + 6)
-
#define RID_DLG_UPDATEINSTALL (RID_DEPLOYMENT_GUI_START + 20)
#define RID_INFOBOX_UPDATE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START + 21)
-#define RID_IMG_DEF_INSTALLATION (RID_DEPLOYMENT_GUI_START+50)
-#define RID_IMG_DEF_INSTALLATION_HC (RID_DEPLOYMENT_GUI_START+51)
-#define RID_IMG_DEF_DOCUMENT (RID_DEPLOYMENT_GUI_START+52)
-#define RID_IMG_DEF_DOCUMENT_HC (RID_DEPLOYMENT_GUI_START+53)
-#define RID_IMG_DEF_PACKAGE (RID_DEPLOYMENT_GUI_START+54)
-#define RID_IMG_DEF_PACKAGE_HC (RID_DEPLOYMENT_GUI_START+55)
#define RID_IMG_WARNING (RID_DEPLOYMENT_GUI_START+56)
#define RID_IMG_WARNING_HC (RID_DEPLOYMENT_GUI_START+57)
#define RID_IMG_LOCKED (RID_DEPLOYMENT_GUI_START+58)
@@ -164,39 +139,26 @@
#define RID_IMG_EXTENSION (RID_DEPLOYMENT_GUI_START+60)
#define RID_IMG_EXTENSION_HC (RID_DEPLOYMENT_GUI_START+61)
-
-#define RID_STR_USER_INSTALLATION (RID_DEPLOYMENT_GUI_START+60)
-#define RID_STR_SHARED_INSTALLATION (RID_DEPLOYMENT_GUI_START+61)
-#define RID_STR_ENABLED (RID_DEPLOYMENT_GUI_START+62)
-#define RID_STR_DISABLED (RID_DEPLOYMENT_GUI_START+63)
-#define RID_STR_UNKNOWN (RID_DEPLOYMENT_GUI_START+64)
-#define RID_STR_PACKAGE (RID_DEPLOYMENT_GUI_START+65)
-#define RID_STR_PACKAGE_STATUS (RID_DEPLOYMENT_GUI_START+66)
-#define RID_STR_EXTENSION_VERSION (RID_DEPLOYMENT_GUI_START+67)
-
-
#define RID_STR_ADD_PACKAGES (RID_DEPLOYMENT_GUI_START+70)
-#define RID_STR_EXPORT_PACKAGE (RID_DEPLOYMENT_GUI_START+71)
-#define RID_STR_EXPORT_PACKAGES (RID_DEPLOYMENT_GUI_START+72)
-
-#define RID_CTX_ITEM_ADD (RID_DEPLOYMENT_GUI_START+80)
-#define RID_CTX_ITEM_REMOVE (RID_DEPLOYMENT_GUI_START+81)
-#define RID_CTX_ITEM_ENABLE (RID_DEPLOYMENT_GUI_START+82)
-#define RID_CTX_ITEM_DISABLE (RID_DEPLOYMENT_GUI_START+83)
-#define RID_CTX_ITEM_EXPORT (RID_DEPLOYMENT_GUI_START+84)
-#define RID_CTX_ITEM_CHECK_UPDATE (RID_DEPLOYMENT_GUI_START+85)
-#define RID_CTX_ITEM_OPTIONS (RID_DEPLOYMENT_GUI_START+86)
-
-#define RID_STR_ADDING_PACKAGES (RID_DEPLOYMENT_GUI_START+90)
-#define RID_STR_REMOVING_PACKAGES (RID_DEPLOYMENT_GUI_START+91)
-#define RID_STR_ENABLING_PACKAGES (RID_DEPLOYMENT_GUI_START+92)
-#define RID_STR_DISABLING_PACKAGES (RID_DEPLOYMENT_GUI_START+93)
-#define RID_STR_EXPORTING_PACKAGES (RID_DEPLOYMENT_GUI_START+94)
-
-#define RID_STR_INSTALL_FOR_ALL (RID_DEPLOYMENT_GUI_START+95)
-#define RID_STR_INSTALL_FOR_ME (RID_DEPLOYMENT_GUI_START+96)
-#define RID_STR_PUBLISHER_LINK (RID_DEPLOYMENT_GUI_START+97)
-#define RID_STR_ERROR_UNKNOWN_STATUS (RID_DEPLOYMENT_GUI_START+98)
+
+#define RID_CTX_ITEM_REMOVE (RID_DEPLOYMENT_GUI_START+80)
+#define RID_CTX_ITEM_ENABLE (RID_DEPLOYMENT_GUI_START+81)
+#define RID_CTX_ITEM_DISABLE (RID_DEPLOYMENT_GUI_START+82)
+#define RID_CTX_ITEM_CHECK_UPDATE (RID_DEPLOYMENT_GUI_START+83)
+#define RID_CTX_ITEM_OPTIONS (RID_DEPLOYMENT_GUI_START+84)
+
+#define RID_STR_ADDING_PACKAGES (RID_DEPLOYMENT_GUI_START+85)
+#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_INSTALL_FOR_ALL (RID_DEPLOYMENT_GUI_START+90)
+#define RID_STR_INSTALL_FOR_ME (RID_DEPLOYMENT_GUI_START+91)
+#define RID_STR_ERROR_UNKNOWN_STATUS (RID_DEPLOYMENT_GUI_START+92)
+#define RID_STR_CLOSE_BTN (RID_DEPLOYMENT_GUI_START+93)
+#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 WARNINGBOX_CONCURRENTINSTANCE (RID_DEPLOYMENT_GUI_START+100)
diff --git a/desktop/source/deployment/gui/dp_gui_dialog.src b/desktop/source/deployment/gui/dp_gui_dialog.src
index d3730a12536e..e7c785c86973 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog.src
+++ b/desktop/source/deployment/gui/dp_gui_dialog.src
@@ -30,192 +30,10 @@
#include "svtools/controldims.hrc"
#include "dp_gui.hrc"
-ModelessDialog RID_DLG_PACKAGE_MANAGER
-{
- HelpId = HID_PACKAGE_MANAGER;
- Text [ en-US ] = "Extension Manager";
-
- Size = MAP_APPFONT( 300, 200 );
- OutputSize = TRUE;
- SVLook = TRUE;
- Moveable = TRUE;
- Closeable = TRUE;
- Sizeable = TRUE;
- Hide = TRUE;
-
- FixedText RID_FT_PACKAGES
- {
- Group = TRUE;
- Left = TRUE;
- NoLabel = TRUE;
- Text [ en-US ] = "Browse extensions";
- };
-
- PushButton RID_BTN_ADD
- {
- TabStop = TRUE;
- Text [ en-US ] = "~Add...";
- };
- PushButton RID_BTN_REMOVE
- {
- TabStop = TRUE;
- Text [ en-US ] = "~Remove";
- };
- PushButton RID_BTN_ENABLE
- {
- TabStop = TRUE;
- Text [ en-US ] = "~Enable";
- };
- PushButton RID_BTN_DISABLE
- {
- TabStop = TRUE;
- Text [ en-US ] = "~Disable";
- };
- PushButton RID_BTN_EXPORT
- {
- TabStop = TRUE;
- Text [ en-US ] = "E~xport...";
- };
- PushButton RID_BTN_CHECK_UPDATES
- {
- Disable = TRUE;
- TabStop = TRUE;
- Text [ en-US ] = "~Updates...";
- };
- PushButton RID_BTN_OPTIONS
- {
- Disable = TRUE;
- TabStop = TRUE;
- Text [ en-US ] = "~Options...";
- };
-
-
-
- FixedText RID_BTN_GET_EXTENSIONS
- {
- NoLabel = TRUE;
- TabStop = TRUE;
- Text [ en-US ] = "Get more extensions here...";
- };
-
- OKButton RID_BTN_CLOSE
- {
- TabStop = TRUE;
- DefButton = TRUE;
- Text [ en-US ] = "Close";
- };
- HelpButton RID_BTN_HELP
- {
- TabStop = TRUE;
- };
-
- Image RID_IMG_PLUS
- {
- ImageBitmap = Bitmap { File = "plus.bmp"; };
- MASKCOLOR
- };
-
- Image RID_IMG_PLUS_HC
- {
- ImageBitmap = Bitmap { File = "plus_sch.bmp"; };
- MASKCOLOR
- };
- Image RID_IMG_MINUS
- {
- ImageBitmap = Bitmap { File = "minus.bmp"; };
- MASKCOLOR
- };
- Image RID_IMG_MINUS_HC
- {
- ImageBitmap = Bitmap { File = "minus_sch.bmp"; };
- MASKCOLOR
- };
-};
-
-
-Image RID_IMG_DEF_INSTALLATION
-{
- ImageBitmap = Bitmap { File = "harddisk_16.bmp"; };
- MASKCOLOR
-};
-Image RID_IMG_DEF_INSTALLATION_HC
-{
- ImageBitmap = Bitmap { File = "harddisk_16_h.bmp"; };
- MASKCOLOR
-};
-
-Image RID_IMG_DEF_DOCUMENT
-{
- ImageBitmap = Bitmap { File = "sc05500.bmp"; };
- MASKCOLOR
-};
-Image RID_IMG_DEF_DOCUMENT_HC
-{
- ImageBitmap = Bitmap { File = "sch05500.bmp"; };
- MASKCOLOR
-};
-
-Image RID_IMG_DEF_PACKAGE
-{
- ImageBitmap = Bitmap { File = "puzzleslice_16.bmp"; };
- MASKCOLOR
-};
-Image RID_IMG_DEF_PACKAGE_HC
-{
- ImageBitmap = Bitmap { File = "puzzleslice_16_h.bmp"; };
- MASKCOLOR
-};
-
-
-String RID_STR_USER_INSTALLATION
-{
- Text [ en-US ] = "My Extensions";
-};
-
-String RID_STR_SHARED_INSTALLATION
-{
- Text [ en-US ] = "%PRODUCTNAME Extensions";
-};
-
-String RID_STR_PACKAGE
-{
- Text [ en-US ] = "Extension";
-};
-
-String RID_STR_PACKAGE_STATUS
-{
- Text [ en-US ] = "Status";
-};
-
-String RID_STR_EXTENSION_VERSION
-{
- Text [ en-US ] = "Version";
-};
-
String RID_STR_ADD_PACKAGES
{
Text [ en-US ] = "Add Extension(s)";
};
-
-String RID_STR_ENABLED
-{
- Text [ en-US ] = "Enabled";
-};
-
-String RID_STR_DISABLED
-{
- Text [ en-US ] = "Disabled";
-};
-
-String RID_STR_UNKNOWN
-{
- Text [ en-US ] = "Unknown";
-};
-
-String RID_CTX_ITEM_ADD
-{
- Text [ en-US ] = "~Add...";
-};
String RID_CTX_ITEM_REMOVE
{
Text [ en-US ] = "~Remove";
@@ -228,30 +46,15 @@ String RID_CTX_ITEM_DISABLE
{
Text [ en-US ] = "~Disable";
};
-String RID_CTX_ITEM_EXPORT
-{
- Text [ en-US ] = "E~xport...";
-};
String RID_CTX_ITEM_CHECK_UPDATE
{
Text [ en-US ] = "~Update...";
};
-
String RID_CTX_ITEM_OPTIONS
{
Text [ en-US ] = "~Options...";
};
-String RID_STR_EXPORT_PACKAGE
-{
- Text [ en-US ] = "Export Extension";
-};
-
-String RID_STR_EXPORT_PACKAGES
-{
- Text [ en-US ] = "Export Extensions to...";
-};
-
String RID_STR_ADDING_PACKAGES
{
Text [ en-US ] = "Adding %EXTENSION_NAME";
@@ -272,11 +75,6 @@ String RID_STR_DISABLING_PACKAGES
Text [ en-US ] = "Disabling %EXTENSION_NAME";
};
-String RID_STR_EXPORTING_PACKAGES
-{
- Text [ en-US ] = "Exporting Extension(s)";
-};
-
String RID_STR_INSTALL_FOR_ALL
{
Text [ en-US ] = "~For all users";
@@ -287,14 +85,31 @@ String RID_STR_INSTALL_FOR_ME
Text [ en-US ] = "~Only for me";
};
-String RID_STR_PUBLISHER_LINK
+String RID_STR_ERROR_UNKNOWN_STATUS
{
- Text [ en-US ] = "Publisher";
+ Text [ en-US ] = "Error: The status of this extension is unknown";
};
-String RID_STR_ERROR_UNKNOWN_STATUS
+String RID_STR_CLOSE_BTN
{
- Text [ en-US ] = "Error: The status of this extension is unknown";
+ Text [ en-US ] = "Close";
+};
+
+String RID_STR_EXIT_BTN
+{
+ Text [ en-US ] = "Quit";
+};
+
+String RID_STR_NO_ADMIN_PRIVILEGE
+{
+ Text [ en-US ] = "%PRODUCTNAME has been updated to a new version. "
+ "Some shared %PRODUCTNAME extensions are not compatible with this version and need to be updated before %PRODUCTNAME can be started.\n\n"
+ "Updating of shared extension requires administrator privileges. Contact your system administrator to update the following shared extensions:";
+};
+
+String RID_STR_ERROR_MISSING_DEPENDENCIES
+{
+ Text [ en-US ] = "The extension cannot be enabled as the following system dependencies are not fulfilled:";
};
// Dialog layout
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 47bcd507cd90..f09d906a840e 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -36,7 +36,9 @@
#include "svtools/controldims.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_misc.h"
@@ -55,7 +57,7 @@
#include "comphelper/anytostring.hxx"
#include "cppuhelper/exc_hlp.hxx"
-#include "cppuhelper/implbase1.hxx"
+#include "cppuhelper/bootstrap.hxx"
#include "comphelper/processfactory.hxx"
#include "ucbhelper/content.hxx"
@@ -76,6 +78,8 @@
#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>
@@ -91,11 +95,7 @@ using ::rtl::OUString;
namespace dp_gui {
#define ICON_OFFSET 50
-#define ICON_HEIGHT 42
-#define SMALL_ICON_SIZE 16
-#define RIGHT_ICON_OFFSET 5
#define TOP_OFFSET 3
-#define SPACE_BETWEEN 3
#define LINE_SIZE 4
#define PROGRESS_WIDTH 60
#define PROGRESS_HEIGHT 14
@@ -113,112 +113,18 @@ struct StrAllFiles : public rtl::StaticWithInit< const OUString, StrAllFiles >
};
//------------------------------------------------------------------------------
-// struct Entry_Impl
-//------------------------------------------------------------------------------
-struct Entry_Impl;
-
-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;
- PackageState m_eState;
- String m_sTitle;
- String m_sVersion;
- String m_sDescription;
- String m_sPublisher;
- String m_sPublisherURL;
- String m_sErrorText;
- Image m_aIcon;
- Image m_aIconHC;
- svt::FixedHyperlink *m_pPublisher;
-
- uno::Reference< deployment::XPackage> m_xPackage;
- uno::Reference< deployment::XPackageManager> m_xPackageManager;
-
- Entry_Impl( const uno::Reference< deployment::XPackage > &xPackage,
- const uno::Reference< deployment::XPackageManager > &xPackageManager,
- PackageState eState );
- ~Entry_Impl();
-
- StringCompare CompareTo( const CollatorWrapper *pCollator, const TEntry_Impl pEntry ) const;
-};
-
-//------------------------------------------------------------------------------
-Entry_Impl::Entry_Impl( const uno::Reference< deployment::XPackage > &xPackage,
- const uno::Reference< deployment::XPackageManager > &xPackageManager,
- PackageState eState ) :
- m_bActive( false ),
- m_bLocked( false ),
- m_bHasOptions( false ),
- m_bShared( false ),
- m_bNew( false ),
- m_bChecked( false ),
- m_eState( eState ),
- m_pPublisher( NULL ),
+UpdateListEntry::UpdateListEntry( const uno::Reference< deployment::XPackage > &xPackage,
+ const uno::Reference< deployment::XPackageManager > &xPackageManager ) :
m_xPackage( xPackage ),
m_xPackageManager( xPackageManager )
-{
- m_sTitle = xPackage->getDisplayName();
- m_sVersion = xPackage->getVersion();
- m_sDescription = xPackage->getDescription();
-
- beans::StringPair aInfo( m_xPackage->getPublisherInfo() );
- m_sPublisher = aInfo.First;
- m_sPublisherURL = aInfo.Second;
-
- // get the icons for the package if there are any
- uno::Reference< graphic::XGraphic > xGraphic = xPackage->getIcon( false );
- if ( xGraphic.is() )
- m_aIcon = Image( xGraphic );
-
- xGraphic = xPackage->getIcon( true );
- if ( xGraphic.is() )
- m_aIconHC = Image( xGraphic );
- else
- m_aIconHC = m_aIcon;
-
- m_bLocked = m_xPackageManager->isReadOnly();
-
- if ( eState == AMBIGUOUS )
- m_sErrorText = ExtMgrDialog::getResourceString( RID_STR_ERROR_UNKNOWN_STATUS );
-}
-
-//------------------------------------------------------------------------------
-Entry_Impl::~Entry_Impl()
-{
- delete m_pPublisher;
-}
+{}
//------------------------------------------------------------------------------
-StringCompare Entry_Impl::CompareTo( const CollatorWrapper *pCollator, const TEntry_Impl pEntry ) const
-{
- StringCompare eCompare = (StringCompare) pCollator->compareString( m_sTitle, pEntry->m_sTitle );
- if ( eCompare == COMPARE_EQUAL )
- {
- 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;
- }
- }
- }
- return eCompare;
-}
+UpdateListEntry::~UpdateListEntry()
+{}
//------------------------------------------------------------------------------
-// ExtensionBox_Impl
+// ExtBoxWithBtns_Impl
//------------------------------------------------------------------------------
enum MENU_COMMAND
@@ -230,63 +136,21 @@ enum MENU_COMMAND
CMD_UPDATE
};
-class ExtensionBox_Impl : public ::svt::IExtensionListBox,
- public ::cppu::WeakImplHelper1< ::com::sun::star::lang::XEventListener >
+class ExtBoxWithBtns_Impl : public ExtensionBox_Impl
{
- bool m_bHasScrollBar;
- bool m_bHasActive;
- bool m_bNeedsRecalc;
- bool m_bHasNew;
- bool m_bInCheckMode;
- bool m_bInterfaceLocked;
- //Must be guarded together with m_vEntries to ensure a valid index at all times.
- //Use m_entriesMutex as guard.
- long m_nActive;
- long m_nTopIndex;
- long m_nStdHeight;
- long m_nActiveHeight;
- long m_nBtnHeight;
Size m_aOutputSize;
- Image m_aLockedImage;
- Image m_aLockedImageHC;
- Image m_aWarningImage;
- Image m_aWarningImageHC;
- Image m_aDefaultImage;
- Image m_aDefaultImageHC;
+ bool m_bInterfaceLocked;
PushButton *m_pOptionsBtn;
PushButton *m_pEnableBtn;
PushButton *m_pRemoveBtn;
- ScrollBar *m_pScrollBar;
-
- ExtMgrDialog *m_pParent;
- TheExtensionManager *m_pManager;
- //This mutex is used for synchronizing access to m_vEntries.
- //Currently it is used to synchronize adding, removing entries and
- //functions like getItemName, getItemDescription, etc. to prevent
- //that m_vEntries is accessed at an invalid index.
- //ToDo: There are many more places where m_vEntries is read and which may
- //fail. For example the Paint method is probable called from the main thread
- //while new entries are added / removed in a separate thread.
- mutable ::osl::Mutex m_entriesMutex;
- std::vector< TEntry_Impl > m_vEntries;
-
- lang::Locale *m_pLocale;
- CollatorWrapper *m_pCollator;
-
- void CalcActiveHeight( const long nPos );
- long GetTotalHeight() const;
- Rectangle GetEntryRect( const long nPos ) const;
+
+ ExtMgrDialog *m_pParent;
+
void SetButtonPos( const Rectangle& rRect );
void SetButtonStatus( const TEntry_Impl pEntry );
- void SetupScrollBar();
- void DrawRow( const Rectangle& rRect, const TEntry_Impl pEntry );
bool HandleTabKey( bool bReverse );
- bool HandleCursorKey( USHORT nKeyCode );
MENU_COMMAND ShowPopupMenu( const Point &rPos, const long nPos );
- void RecalcAll();
- bool FindEntryPos( const TEntry_Impl pEntry, long nStart, long nEnd, long &nFound );
- bool isHCMode();
//-----------------
DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar * );
@@ -296,115 +160,29 @@ class ExtensionBox_Impl : public ::svt::IExtensionListBox,
DECL_DLLPRIVATE_LINK( HandleRemoveBtn, void * );
DECL_DLLPRIVATE_LINK( HandleHyperlink, svt::FixedHyperlink * );
- //Index starts with 1.
- //Throws an com::sun::star::lang::IllegalArgumentException, when the index is invalid.
- void checkIndex(sal_Int32 pos) const;
-
-
public:
- ExtensionBox_Impl( ExtMgrDialog* pParent, TheExtensionManager *pManager );
- ~ExtensionBox_Impl();
+ ExtBoxWithBtns_Impl( ExtMgrDialog* pParent, TheExtensionManager *pManager );
+ ~ExtBoxWithBtns_Impl();
virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual void Paint( const Rectangle &rPaintRect );
- virtual void Resize();
virtual long Notify( NotifyEvent& rNEvt );
const Size GetMinOutputSizePixel() const;
+ virtual void RecalcAll();
+ virtual void selectEntry( const long nPos );
//-----------------
- long addEntry( const uno::Reference< deployment::XPackage > &xPackage,
- const uno::Reference< deployment::XPackageManager > &xPackageManager );
- void selectEntry( const long nPos );
void enableButtons( bool bEnable );
-
- void updateEntry( const uno::Reference< deployment::XPackage > &xPackage );
-
- void prepareChecking( const uno::Reference< deployment::XPackageManager > &xPackageMgr );
- void checkEntries();
-
- TheExtensionManager* getExtensionManager() const { return m_pManager; }
-
- //===================================================================================
- //These functions are used for automatic testing
-
- /** @return The count of the entries in the list box. */
- virtual sal_Int32 getItemCount() const;
-
- /** @return The index of the first selected entry in the list box.
- When nothing is selected, which is the case when getItemCount returns '0',
- then this function returns EXTENSION_LISTBOX_ENTRY_NOTFOUND */
- virtual sal_Int32 getSelIndex() const;
-
- /** @return The item name of the entry with the given index
- The index starts with 0.
- Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
- virtual OUString getItemName( sal_Int32 index ) const;
-
- /** @return The version string of the entry with the given index
- The index starts with 0.
- Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
- virtual OUString getItemVersion( sal_Int32 index ) const;
-
- /** @return The description string of the entry with the given index
- The index starts with 0.
- Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
- virtual OUString getItemDescription( sal_Int32 index ) const;
-
- /** @return The publisher string of the entry with the given index
- The index starts with 0.
- Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
- virtual ::rtl::OUString getItemPublisher( sal_Int32 index ) const;
-
- /** @return The link behind the publisher text of the entry with the given index
- The index starts with 0.
- Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
- virtual ::rtl::OUString getItemPublisherLink( sal_Int32 index ) const;
-
- /** The entry at the given position will be selected
- Index starts with 0.
- Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
- virtual void select( sal_Int32 pos );
-
- /** The first found entry with the given name will be selected
- When there was no entry found with the name, the selection doesn't change.
- Please note that there might be more than one entry with the same
- name, because:
- 1. the name is not unique
- 2. one extension can be installed as user and shared extension.
- */
- virtual void select( const OUString & sName );
-
- //===================================================================================
- // XEventListener
- virtual void SAL_CALL disposing( ::com::sun::star::lang::EventObject const & evt )
- throw (::com::sun::star::uno::RuntimeException);
};
//------------------------------------------------------------------------------
-ExtensionBox_Impl::ExtensionBox_Impl( ExtMgrDialog* pParent, TheExtensionManager *pManager ) :
- IExtensionListBox( pParent, WB_BORDER | WB_TABSTOP | WB_CHILDDLGCTRL ),
- m_bHasScrollBar( false ),
- m_bHasActive( false ),
- m_bNeedsRecalc( true ),
- m_bHasNew( false ),
- m_bInCheckMode( false ),
+ExtBoxWithBtns_Impl::ExtBoxWithBtns_Impl( ExtMgrDialog* pParent, TheExtensionManager *pManager ) :
+ ExtensionBox_Impl( pParent, pManager ),
m_bInterfaceLocked( false ),
- m_nActive( 0 ),
- m_nTopIndex( 0 ),
- m_nActiveHeight( 0 ),
- m_aLockedImage( ExtMgrDialog::getResId( RID_IMG_LOCKED ) ),
- m_aLockedImageHC( ExtMgrDialog::getResId( RID_IMG_LOCKED_HC ) ),
- m_aWarningImage( ExtMgrDialog::getResId( RID_IMG_WARNING ) ),
- m_aWarningImageHC( ExtMgrDialog::getResId( RID_IMG_WARNING_HC ) ),
- m_aDefaultImage( ExtMgrDialog::getResId( RID_IMG_EXTENSION ) ),
- m_aDefaultImageHC( ExtMgrDialog::getResId( RID_IMG_EXTENSION_HC ) ),
m_pOptionsBtn( NULL ),
m_pEnableBtn( NULL ),
m_pRemoveBtn( NULL ),
- m_pScrollBar( NULL ),
- m_pParent( pParent ),
- m_pManager( pManager )
+ m_pParent( pParent )
{
m_pOptionsBtn = new PushButton( this, WB_TABSTOP );
m_pEnableBtn = new PushButton( this, WB_TABSTOP );
@@ -415,17 +193,13 @@ ExtensionBox_Impl::ExtensionBox_Impl( ExtMgrDialog* pParent, TheExtensionManager
m_pEnableBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_DISABLE );
m_pRemoveBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_REMOVE );
- m_pOptionsBtn->SetClickHdl( LINK( this, ExtensionBox_Impl, HandleOptionsBtn ) );
- m_pEnableBtn->SetClickHdl( LINK( this, ExtensionBox_Impl, HandleEnableBtn ) );
- m_pRemoveBtn->SetClickHdl( LINK( this, ExtensionBox_Impl, HandleRemoveBtn ) );
+ m_pOptionsBtn->SetClickHdl( LINK( this, ExtBoxWithBtns_Impl, HandleOptionsBtn ) );
+ m_pEnableBtn->SetClickHdl( LINK( this, ExtBoxWithBtns_Impl, HandleEnableBtn ) );
+ m_pRemoveBtn->SetClickHdl( LINK( this, ExtBoxWithBtns_Impl, HandleRemoveBtn ) );
- m_pScrollBar = new ScrollBar( this, WB_VERT );
- m_pScrollBar->SetScrollHdl( LINK( this, ExtensionBox_Impl, ScrollHdl ) );
- m_pScrollBar->EnableDrag();
-
- m_pOptionsBtn->SetText( ExtMgrDialog::getResourceString( RID_CTX_ITEM_OPTIONS ) );
- m_pEnableBtn->SetText( ExtMgrDialog::getResourceString( RID_CTX_ITEM_DISABLE ) );
- m_pRemoveBtn->SetText( ExtMgrDialog::getResourceString( RID_CTX_ITEM_REMOVE ) );
+ m_pOptionsBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_OPTIONS ) );
+ m_pEnableBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) );
+ m_pRemoveBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_REMOVE ) );
Size aSize = LogicToPixel( Size( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ),
MapMode( MAP_APPFONT ) );
@@ -433,288 +207,69 @@ ExtensionBox_Impl::ExtensionBox_Impl( ExtMgrDialog* pParent, TheExtensionManager
m_pEnableBtn->SetSizePixel( aSize );
m_pRemoveBtn->SetSizePixel( aSize );
- SetPaintTransparent( true );
- SetPosPixel( Point( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP ) );
- long nIconHeight = 2*TOP_OFFSET + SMALL_ICON_SIZE;
- long nTitleHeight = 2*TOP_OFFSET + GetTextHeight();
- if ( nIconHeight < nTitleHeight )
- m_nStdHeight = nTitleHeight;
- else
- m_nStdHeight = nIconHeight;
- m_nStdHeight += GetTextHeight() + TOP_OFFSET;
-
- nIconHeight = ICON_HEIGHT + 2*TOP_OFFSET + 1;
- if ( m_nStdHeight < nIconHeight )
- m_nStdHeight = nIconHeight;
-
- m_nActiveHeight = m_nStdHeight;
- m_nBtnHeight = aSize.Height() + 2 * TOP_OFFSET;
-
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- if( IsControlBackground() )
- SetBackground( GetControlBackground() );
- else
- SetBackground( rStyleSettings.GetFieldColor() );
-
- m_pLocale = new lang::Locale( Application::GetSettings().GetLocale() );
- m_pCollator = new CollatorWrapper( ::comphelper::getProcessServiceFactory() );
- m_pCollator->loadDefaultCollator( *m_pLocale, i18n::CollatorOptions::CollatorOptions_IGNORE_CASE );
+ SetExtraSize( aSize.Height() + 2 * TOP_OFFSET );
- Show();
+ SetScrollHdl( LINK( this, ExtBoxWithBtns_Impl, ScrollHdl ) );
}
//------------------------------------------------------------------------------
-ExtensionBox_Impl::~ExtensionBox_Impl()
+ExtBoxWithBtns_Impl::~ExtBoxWithBtns_Impl()
{
- typedef std::vector< TEntry_Impl >::iterator ITER;
-
-// for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
-// (*iIndex)->m_xPackage->removeEventListener( this );
-
- m_vEntries.clear();
-
delete m_pOptionsBtn;
delete m_pEnableBtn;
delete m_pRemoveBtn;
- delete m_pScrollBar;
-
- delete m_pLocale;
- delete m_pCollator;
}
//------------------------------------------------------------------------------
-sal_Int32 ExtensionBox_Impl::getItemCount() const
-{
- return static_cast< sal_Int32 >( m_vEntries.size() );
-}
-
//------------------------------------------------------------------------------
-sal_Int32 ExtensionBox_Impl::getSelIndex() const
-{
- if ( m_bHasActive )
- {
- OSL_ASSERT( m_nActive >= -1);
- return static_cast< sal_Int32 >( m_nActive );
- }
- else
- return static_cast< sal_Int32 >( EXTENSION_LISTBOX_ENTRY_NOTFOUND );
-}
-
//------------------------------------------------------------------------------
-void ExtensionBox_Impl::checkIndex( sal_Int32 nIndex ) const
+const Size ExtBoxWithBtns_Impl::GetMinOutputSizePixel() const
{
- if ( nIndex < 0 )
- throw lang::IllegalArgumentException( OUSTR("The list index starts with 0"),0, 0 );
- if ( static_cast< sal_uInt32 >( nIndex ) >= m_vEntries.size())
- throw lang::IllegalArgumentException( OUSTR("There is no element at the provided position."
- "The position exceeds the number of available list entries"),0, 0 );
-}
-
-//------------------------------------------------------------------------------
-OUString ExtensionBox_Impl::getItemName( sal_Int32 nIndex ) const
-{
- const ::osl::MutexGuard aGuard( m_entriesMutex );
- checkIndex( nIndex );
- return m_vEntries[ nIndex ]->m_sTitle;
-}
-
-//------------------------------------------------------------------------------
-OUString ExtensionBox_Impl::getItemVersion( sal_Int32 nIndex ) const
-{
- const ::osl::MutexGuard aGuard( m_entriesMutex );
- checkIndex( nIndex );
- return m_vEntries[ nIndex ]->m_sVersion;
-}
-
-//------------------------------------------------------------------------------
-OUString ExtensionBox_Impl::getItemDescription( sal_Int32 nIndex ) const
-{
- const ::osl::MutexGuard aGuard( m_entriesMutex );
- checkIndex( nIndex );
- return m_vEntries[ nIndex ]->m_sDescription;
-}
-
-//------------------------------------------------------------------------------
-OUString ExtensionBox_Impl::getItemPublisher( sal_Int32 nIndex ) const
-{
- const ::osl::MutexGuard aGuard( m_entriesMutex );
- checkIndex( nIndex );
- return m_vEntries[ nIndex ]->m_sPublisher;
-}
-
-//------------------------------------------------------------------------------
-OUString ExtensionBox_Impl::getItemPublisherLink( sal_Int32 nIndex ) const
-{
- const ::osl::MutexGuard aGuard( m_entriesMutex );
- checkIndex( nIndex );
- return m_vEntries[ nIndex ]->m_sPublisherURL;
-}
-
-//------------------------------------------------------------------------------
-void ExtensionBox_Impl::select( sal_Int32 nIndex )
-{
- const ::osl::MutexGuard aGuard( m_entriesMutex );
- checkIndex( nIndex );
- selectEntry( nIndex );
-}
-
-//------------------------------------------------------------------------------
-void ExtensionBox_Impl::select( const OUString & sName )
-{
- const ::osl::MutexGuard aGuard( m_entriesMutex );
- typedef ::std::vector< TEntry_Impl >::const_iterator It;
-
- for ( It iIter = m_vEntries.begin(); iIter < m_vEntries.end(); iIter++ )
- {
- if ( sName.equals( (*iIter)->m_sTitle ) )
- {
- long nPos = iIter - m_vEntries.begin();
- selectEntry( nPos );
- break;
- }
- }
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-// Title + description + buttons height
-void ExtensionBox_Impl::CalcActiveHeight( const long nPos )
-{
- // get title height
- long aTextHeight;
- long nIconHeight = 2*TOP_OFFSET + SMALL_ICON_SIZE;
- long nTitleHeight = 2*TOP_OFFSET + GetTextHeight();
- if ( nIconHeight < nTitleHeight )
- aTextHeight = nTitleHeight;
- else
- aTextHeight = nIconHeight;
-
- // calc description height
- Size aSize = GetOutputSizePixel();
- if ( m_bHasScrollBar )
- aSize.Width() -= m_pScrollBar->GetSizePixel().Width();
-
- aSize.Width() -= ICON_OFFSET;
- aSize.Height() = 10000;
-
- Rectangle aRect = GetTextRect( Rectangle( Point(), aSize ),
- m_vEntries[ nPos ]->m_sDescription,
- TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
- aTextHeight += aRect.GetHeight();
-
- if ( aTextHeight < m_nStdHeight )
- aTextHeight = m_nStdHeight;
-
- m_nActiveHeight = aTextHeight + m_nBtnHeight; // button bar height
-}
-
-//------------------------------------------------------------------------------
-const Size ExtensionBox_Impl::GetMinOutputSizePixel() const
-{
- long nHeight = m_nStdHeight;
+ Size aMinSize( ExtensionBox_Impl::GetMinOutputSizePixel() );
+ long nHeight = aMinSize.Height();
nHeight += m_pOptionsBtn->GetSizePixel().Height();
nHeight += 2 * TOP_OFFSET;
long nWidth = m_pOptionsBtn->GetSizePixel().Width();
nWidth *= 3;
- nWidth += 5*TOP_OFFSET;
- nWidth += m_pScrollBar->GetSizePixel().Width();
+ nWidth += 5*TOP_OFFSET + 20;
return Size( nWidth, nHeight );
}
-//------------------------------------------------------------------------------
-Rectangle ExtensionBox_Impl::GetEntryRect( const long nPos ) const
+// -----------------------------------------------------------------------
+void ExtBoxWithBtns_Impl::RecalcAll()
{
- Size aSize( GetOutputSizePixel() );
+ ExtensionBox_Impl::RecalcAll();
- if ( m_bHasScrollBar )
- aSize.Width() -= m_pScrollBar->GetSizePixel().Width();
+ const sal_Int32 nActive = getSelIndex();
- if ( m_vEntries[ nPos ]->m_bActive )
- aSize.Height() = m_nActiveHeight;
+ if ( nActive != EXTENSION_LISTBOX_ENTRY_NOTFOUND )
+ SetButtonPos( GetEntryRect( nActive ) );
else
- aSize.Height() = m_nStdHeight;
-
- Point aPos( 0, -m_nTopIndex + nPos * m_nStdHeight );
- if ( m_bHasActive && ( nPos < m_nActive ) )
- aPos.Y() += m_nActiveHeight - m_nStdHeight;
-
- return Rectangle( aPos, aSize );
+ {
+ m_pOptionsBtn->Hide();
+ m_pEnableBtn->Hide();
+ m_pRemoveBtn->Hide();
+ }
}
+
//------------------------------------------------------------------------------
//This function may be called with nPos < 0
-void ExtensionBox_Impl::selectEntry( long nPos )
+void ExtBoxWithBtns_Impl::selectEntry( const long nPos )
{
- //ToDo whe should not use the guard at such a big scope here.
- //Currently it is used to gard m_vEntries and m_nActive. m_nActive will be
- //modified in this function.
- //It would be probably best to always use a copy of m_vEntries
- //and some other state variables from ExtensionBox_Impl for
- //the whole painting operation. See issue i86993
- ::osl::ClearableMutexGuard guard(m_entriesMutex);
-
- if ( m_bInCheckMode )
+ if ( HasActive() && ( nPos == getSelIndex() ) )
return;
- if ( m_bHasActive )
- {
- if ( nPos == m_nActive )
- return;
-
- m_bHasActive = false;
- m_vEntries[ m_nActive ]->m_bActive = false;
+ ExtensionBox_Impl::selectEntry( nPos );
- if ( IsReallyVisible() )
- Invalidate();
- }
-
- if ( ( nPos >= 0 ) && ( nPos < (long) m_vEntries.size() ) )
+ if ( ( nPos >= 0 ) && ( nPos < GetEntryCount() ) )
{
- m_bHasActive = true;
- m_nActive = nPos;
- m_vEntries[ nPos ]->m_bActive = true;
-
if ( IsReallyVisible() )
{
- Invalidate();
- CalcActiveHeight( nPos );
- SetupScrollBar();
- Rectangle aEntryRect = GetEntryRect( nPos );
-
- // If the top of the selected entry isn't visible, make it visible
- if ( aEntryRect.Top() < 0 )
- {
- m_nTopIndex += aEntryRect.Top();
- aEntryRect.Move( 0, -aEntryRect.Top() );
- }
-
- // If the bottom of the selected entry isn't visible, make it visible even if now the top
- // isn't visible any longer ( the buttons are more important )
- Size aOutputSize = GetOutputSizePixel();
- if ( aEntryRect.Bottom() > aOutputSize.Height() )
- {
- m_nTopIndex += ( aEntryRect.Bottom() - aOutputSize.Height() );
- aEntryRect.Move( 0, -( aEntryRect.Bottom() - aOutputSize.Height() ) );
- }
-
- // If there is unused space below the last entry but all entries don't fit into the box,
- // move the content down to use the whole space
- const long nTotalHeight = GetTotalHeight();
- if ( m_bHasScrollBar && ( aOutputSize.Height() + m_nTopIndex > nTotalHeight ) )
- {
- long nOffset = m_nTopIndex;
- m_nTopIndex = nTotalHeight - aOutputSize.Height();
- nOffset -= m_nTopIndex;
- aEntryRect.Move( 0, nOffset );
- }
-
- if ( m_bHasScrollBar )
- m_pScrollBar->SetThumbPos( m_nTopIndex );
-
- SetButtonPos( aEntryRect );
+ SetButtonPos( GetEntryRect( nPos ) );
}
- SetButtonStatus( m_vEntries[ nPos ] ); //dv
+ SetButtonStatus( GetEntryData( nPos) );
}
else
{
@@ -722,12 +277,10 @@ void ExtensionBox_Impl::selectEntry( long nPos )
m_pEnableBtn->Hide();
m_pRemoveBtn->Hide();
}
- guard.clear();
-
}
// -----------------------------------------------------------------------
-void ExtensionBox_Impl::SetButtonPos( const Rectangle& rRect )
+void ExtBoxWithBtns_Impl::SetButtonPos( const Rectangle& rRect )
{
Size aBtnSize( m_pOptionsBtn->GetSizePixel() );
Point aBtnPos( rRect.Left() + ICON_OFFSET,
@@ -741,20 +294,20 @@ void ExtensionBox_Impl::SetButtonPos( const Rectangle& rRect )
}
// -----------------------------------------------------------------------
-void ExtensionBox_Impl::SetButtonStatus( const TEntry_Impl pEntry )
+void ExtBoxWithBtns_Impl::SetButtonStatus( const TEntry_Impl pEntry )
{
if ( ( pEntry->m_eState == REGISTERED ) || ( pEntry->m_eState == NOT_AVAILABLE ) )
{
- m_pEnableBtn->SetText( ExtMgrDialog::getResourceString( RID_CTX_ITEM_DISABLE ) );
+ m_pEnableBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) );
m_pEnableBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_DISABLE );
}
else
{
- m_pEnableBtn->SetText( ExtMgrDialog::getResourceString( RID_CTX_ITEM_ENABLE ) );
+ m_pEnableBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) );
m_pEnableBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_ENABLE );
}
- if ( pEntry->m_eState == NOT_AVAILABLE )
+ if ( ( pEntry->m_eState == NOT_AVAILABLE ) || pEntry->m_bMissingDeps )
m_pEnableBtn->Hide();
else
{
@@ -775,183 +328,23 @@ void ExtensionBox_Impl::SetButtonStatus( const TEntry_Impl pEntry )
}
// -----------------------------------------------------------------------
-void ExtensionBox_Impl::DrawRow( const Rectangle& rRect, const TEntry_Impl pEntry )
+bool ExtBoxWithBtns_Impl::HandleTabKey( bool bReverse )
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-
- if ( pEntry->m_bActive )
- SetTextColor( rStyleSettings.GetHighlightTextColor() );
- else if ( ( pEntry->m_eState != REGISTERED ) && ( pEntry->m_eState != NOT_AVAILABLE ) )
- SetTextColor( rStyleSettings.GetDisableColor() );
- else if ( IsControlForeground() )
- SetTextColor( GetControlForeground() );
- else
- SetTextColor( rStyleSettings.GetFieldTextColor() );
-
- if ( pEntry->m_bActive )
- {
- SetLineColor();
- SetFillColor( rStyleSettings.GetHighlightColor() );
- DrawRect( rRect );
- }
- else
- {
- if( IsControlBackground() )
- SetBackground( GetControlBackground() );
- else
- SetBackground( rStyleSettings.GetFieldColor() );
-
- SetTextFillColor();
- Erase( rRect );
- }
-
- // Draw extension icon
- Point aPos( rRect.TopLeft() );
- aPos += Point( TOP_OFFSET, TOP_OFFSET );
- Image aImage;
- if ( ! pEntry->m_aIcon )
- aImage = isHCMode() ? m_aDefaultImageHC : m_aDefaultImage;
- else
- aImage = isHCMode() ? pEntry->m_aIconHC : pEntry->m_aIcon;
- Size aImageSize = aImage.GetSizePixel();
- if ( ( aImageSize.Width() <= ICON_HEIGHT ) && ( aImageSize.Height() <= ICON_HEIGHT ) )
- DrawImage( Point( aPos.X()+((ICON_HEIGHT-aImageSize.Width())/2), aPos.Y()+((ICON_HEIGHT-aImageSize.Height())/2) ), aImage );
- else
- DrawImage( aPos, Size( ICON_HEIGHT, ICON_HEIGHT ), aImage );
-
- // Setup fonts
- Font aStdFont( GetFont() );
- Font aBoldFont( aStdFont );
- aBoldFont.SetWeight( WEIGHT_BOLD );
- SetFont( aBoldFont );
- long aTextHeight = GetTextHeight();
-
- // Init publisher link here
- if ( !pEntry->m_pPublisher && pEntry->m_sPublisher.Len() )
- {
- pEntry->m_pPublisher = new svt::FixedHyperlink( this );
- pEntry->m_pPublisher->SetBackground();
- pEntry->m_pPublisher->SetPaintTransparent( true );
- pEntry->m_pPublisher->SetURL( pEntry->m_sPublisherURL );
- pEntry->m_pPublisher->SetDescription( pEntry->m_sPublisher );
- Size aSize = FixedText::CalcMinimumTextSize( pEntry->m_pPublisher );
- pEntry->m_pPublisher->SetSizePixel( aSize );
- pEntry->m_pPublisher->SetClickHdl( LINK( this, ExtensionBox_Impl, HandleHyperlink ) );
- }
-
- // Get max title width
- long nMaxTitleWidth = rRect.GetWidth() - ICON_OFFSET;
- nMaxTitleWidth -= ( 2 * SMALL_ICON_SIZE ) + ( 4 * SPACE_BETWEEN );
- if ( pEntry->m_pPublisher )
- {
- nMaxTitleWidth -= pEntry->m_pPublisher->GetSizePixel().Width() + (2*SPACE_BETWEEN);
- }
-
- long aVersionWidth = GetTextWidth( pEntry->m_sVersion );
- long aTitleWidth = GetTextWidth( pEntry->m_sTitle ) + (aTextHeight / 3);
-
- aPos = rRect.TopLeft() + Point( ICON_OFFSET, TOP_OFFSET );
-
- if ( aTitleWidth > nMaxTitleWidth - aVersionWidth )
- {
- aTitleWidth = nMaxTitleWidth - aVersionWidth - (aTextHeight / 3);
- String aShortTitle = GetEllipsisString( pEntry->m_sTitle, aTitleWidth );
- DrawText( aPos, aShortTitle );
- aTitleWidth += (aTextHeight / 3);
- }
- else
- DrawText( aPos, pEntry->m_sTitle );
-
- SetFont( aStdFont );
- DrawText( Point( aPos.X() + aTitleWidth, aPos.Y() ), pEntry->m_sVersion );
-
- long nIconHeight = TOP_OFFSET + SMALL_ICON_SIZE;
- long nTitleHeight = TOP_OFFSET + GetTextHeight();
- if ( nIconHeight < nTitleHeight )
- aTextHeight = nTitleHeight;
- else
- aTextHeight = nIconHeight;
-
- // draw description
- String sDescription;
- if ( pEntry->m_sErrorText.Len() )
- {
- if ( pEntry->m_bActive )
- sDescription = pEntry->m_sErrorText + OUSTR("\n") + pEntry->m_sDescription;
- else
- sDescription = pEntry->m_sErrorText;
- }
- else
- sDescription = pEntry->m_sDescription;
-
- aPos.Y() += aTextHeight;
- if ( pEntry->m_bActive )
- {
- DrawText( Rectangle( aPos.X(), aPos.Y(), rRect.Right(), rRect.Bottom() - m_nBtnHeight ),
- sDescription, TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
- }
- else
- {
- const long nWidth = GetTextWidth( sDescription );
- if ( nWidth > rRect.GetWidth() - aPos.X() )
- sDescription = GetEllipsisString( sDescription, rRect.GetWidth() - aPos.X() );
- DrawText( aPos, sDescription );
- }
-
- // Draw publisher link
- if ( pEntry->m_pPublisher )
- {
- pEntry->m_pPublisher->Show();
- aPos = rRect.TopLeft() + Point( ICON_OFFSET + nMaxTitleWidth + (2*SPACE_BETWEEN), TOP_OFFSET );
- pEntry->m_pPublisher->SetPosPixel( aPos );
- }
+ sal_Int32 nIndex = getSelIndex();
- // Draw status icons
- if ( pEntry->m_bShared )
- {
- 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_eState == AMBIGUOUS )
- {
- 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 );
- }
-
- SetLineColor( Color( COL_LIGHTGRAY ) );
- DrawLine( rRect.BottomLeft(), rRect.BottomRight() );
-}
-
-// -----------------------------------------------------------------------
-void ExtensionBox_Impl::RecalcAll()
-{
- if ( m_bHasActive )
- CalcActiveHeight( m_nActive );
-
- SetupScrollBar();
-
- if ( m_bHasActive )
- SetButtonPos( GetEntryRect( m_nActive ) );
-
- m_bNeedsRecalc = false;
-}
-
-// -----------------------------------------------------------------------
-bool ExtensionBox_Impl::HandleTabKey( bool bReverse )
-{
- if ( ! m_bHasActive )
+ if ( nIndex == EXTENSION_LISTBOX_ENTRY_NOTFOUND )
return false;
PushButton *pNext = NULL;
if ( m_pOptionsBtn->HasFocus() ) {
- if ( !bReverse && !m_vEntries[ m_nActive ]->m_bLocked )
+ if ( !bReverse && !GetEntryData( nIndex )->m_bLocked )
pNext = m_pEnableBtn;
}
else if ( m_pEnableBtn->HasFocus() ) {
if ( !bReverse )
pNext = m_pRemoveBtn;
- else if ( m_vEntries[ m_nActive ]->m_bHasOptions )
+ else if ( GetEntryData( nIndex )->m_bHasOptions )
pNext = m_pOptionsBtn;
}
else if ( m_pRemoveBtn->HasFocus() ) {
@@ -960,14 +353,14 @@ bool ExtensionBox_Impl::HandleTabKey( bool bReverse )
}
else {
if ( !bReverse ) {
- if ( m_vEntries[ m_nActive ]->m_bHasOptions )
+ if ( GetEntryData( nIndex )->m_bHasOptions )
pNext = m_pOptionsBtn;
- else if ( ! m_vEntries[ m_nActive ]->m_bLocked )
+ else if ( ! GetEntryData( nIndex )->m_bLocked )
pNext = m_pEnableBtn;
} else {
- if ( ! m_vEntries[ m_nActive ]->m_bLocked )
+ if ( ! GetEntryData( nIndex )->m_bLocked )
pNext = m_pRemoveBtn;
- else if ( m_vEntries[ m_nActive ]->m_bHasOptions )
+ else if ( GetEntryData( nIndex )->m_bHasOptions )
pNext = m_pOptionsBtn;
}
}
@@ -982,194 +375,67 @@ bool ExtensionBox_Impl::HandleTabKey( bool bReverse )
}
// -----------------------------------------------------------------------
-bool ExtensionBox_Impl::HandleCursorKey( USHORT nKeyCode )
-{
- if ( m_vEntries.empty() )
- return true;
-
- long nSelect = 0;
-
- if ( m_bHasActive )
- {
- long nPageSize = GetOutputSizePixel().Height() / m_nStdHeight;
- if ( nPageSize < 2 )
- nPageSize = 2;
-
- if ( ( nKeyCode == KEY_DOWN ) || ( nKeyCode == KEY_RIGHT ) )
- nSelect = m_nActive + 1;
- else if ( ( nKeyCode == KEY_UP ) || ( nKeyCode == KEY_LEFT ) )
- nSelect = m_nActive - 1;
- else if ( nKeyCode == KEY_HOME )
- nSelect = 0;
- else if ( nKeyCode == KEY_END )
- nSelect = m_vEntries.size() - 1;
- else if ( nKeyCode == KEY_PAGEUP )
- nSelect = m_nActive - nPageSize + 1;
- else if ( nKeyCode == KEY_PAGEDOWN )
- nSelect = m_nActive + nPageSize - 1;
- }
- else // when there is no selected entry, we will select the first or the last.
- {
- if ( ( nKeyCode == KEY_DOWN ) || ( nKeyCode == KEY_PAGEDOWN ) || ( nKeyCode == KEY_HOME ) )
- nSelect = 0;
- else if ( ( nKeyCode == KEY_UP ) || ( nKeyCode == KEY_PAGEUP ) || ( nKeyCode == KEY_END ) )
- nSelect = m_vEntries.size() - 1;
- }
-
- if ( nSelect < 0 )
- nSelect = 0;
- if ( nSelect >= (long) m_vEntries.size() )
- nSelect = m_vEntries.size() - 1;
-
- selectEntry( nSelect );
-
- return true;
-}
-
-// -----------------------------------------------------------------------
-MENU_COMMAND ExtensionBox_Impl::ShowPopupMenu( const Point & rPos, const long nPos )
+MENU_COMMAND ExtBoxWithBtns_Impl::ShowPopupMenu( const Point & rPos, const long nPos )
{
- if ( nPos >= (long) m_vEntries.size() )
+ if ( nPos >= (long) getItemCount() )
return CMD_NONE;
PopupMenu aPopup;
- aPopup.InsertItem( CMD_UPDATE, ExtMgrDialog::getResourceString( RID_CTX_ITEM_CHECK_UPDATE ) );
+ aPopup.InsertItem( CMD_UPDATE, DialogHelper::getResourceString( RID_CTX_ITEM_CHECK_UPDATE ) );
- if ( ! m_vEntries[ nPos ]->m_bLocked )
+ if ( ! GetEntryData( nPos )->m_bLocked )
{
- if ( m_vEntries[ nPos ]->m_eState == REGISTERED )
- aPopup.InsertItem( CMD_DISABLE, ExtMgrDialog::getResourceString( RID_CTX_ITEM_DISABLE ) );
- else if ( m_vEntries[ nPos ]->m_eState != NOT_AVAILABLE )
- aPopup.InsertItem( CMD_ENABLE, ExtMgrDialog::getResourceString( RID_CTX_ITEM_ENABLE ) );
+ if ( GetEntryData( nPos )->m_eState == REGISTERED )
+ aPopup.InsertItem( CMD_DISABLE, DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) );
+ else if ( GetEntryData( nPos )->m_eState != NOT_AVAILABLE )
+ aPopup.InsertItem( CMD_ENABLE, DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) );
- aPopup.InsertItem( CMD_REMOVE, ExtMgrDialog::getResourceString( RID_CTX_ITEM_REMOVE ) );
+ aPopup.InsertItem( CMD_REMOVE, DialogHelper::getResourceString( RID_CTX_ITEM_REMOVE ) );
}
return (MENU_COMMAND) aPopup.Execute( this, rPos );
}
-// -----------------------------------------------------------------------
-void ExtensionBox_Impl::Paint( const Rectangle &/*rPaintRect*/ )
-{
- if ( m_bNeedsRecalc )
- RecalcAll();
-
- Point aStart( 0, -m_nTopIndex );
- Size aSize( GetOutputSizePixel() );
-
- if ( m_bHasScrollBar )
- aSize.Width() -= m_pScrollBar->GetSizePixel().Width();
-
- typedef std::vector< TEntry_Impl >::iterator ITER;
- for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
- {
- aSize.Height() = (*iIndex)->m_bActive ? m_nActiveHeight : m_nStdHeight;
- Rectangle aEntryRect( aStart, aSize );
-// if ( aEntryRect.IsOver( rPaintRect ) )
- DrawRow( aEntryRect, *iIndex );
- aStart.Y() += aSize.Height();
- }
-}
-
-// -----------------------------------------------------------------------
-long ExtensionBox_Impl::GetTotalHeight() const
-{
- long nHeight = m_vEntries.size() * m_nStdHeight;
-
- if ( m_bHasActive )
- {
- nHeight += m_nActiveHeight - m_nStdHeight;
- }
-
- return nHeight;
-}
-
-// -----------------------------------------------------------------------
-void ExtensionBox_Impl::SetupScrollBar()
-{
- const Size aSize = GetOutputSizePixel();
- const long nScrBarSize = GetSettings().GetStyleSettings().GetScrollBarSize();
- const long nTotalHeight = GetTotalHeight();
- const bool bNeedsScrollBar = ( nTotalHeight > aSize.Height() );
-
- if ( bNeedsScrollBar )
- {
- if ( m_nTopIndex + aSize.Height() > nTotalHeight )
- m_nTopIndex = nTotalHeight - aSize.Height();
-
- m_pScrollBar->SetPosSizePixel( Point( aSize.Width() - nScrBarSize, 0 ),
- Size( nScrBarSize, aSize.Height() ) );
- m_pScrollBar->SetRangeMax( nTotalHeight );
- m_pScrollBar->SetVisibleSize( aSize.Height() );
- m_pScrollBar->SetPageSize( ( aSize.Height() * 4 ) / 5 );
- m_pScrollBar->SetLineSize( m_nStdHeight );
- m_pScrollBar->SetThumbPos( m_nTopIndex );
-
- if ( !m_bHasScrollBar )
- m_pScrollBar->Show();
- }
- else if ( m_bHasScrollBar )
- {
- m_pScrollBar->Hide();
- m_nTopIndex = 0;
- }
-
- m_bHasScrollBar = bNeedsScrollBar;
-}
-
-// -----------------------------------------------------------------------
-void ExtensionBox_Impl::Resize()
-{
- RecalcAll();
-}
-
//------------------------------------------------------------------------------
-void ExtensionBox_Impl::MouseButtonDown( const MouseEvent& rMEvt )
+void ExtBoxWithBtns_Impl::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( m_bInterfaceLocked )
return;
const Point aMousePos( rMEvt.GetPosPixel() );
- long nPos = ( aMousePos.Y() + m_nTopIndex ) / m_nStdHeight;
- if ( m_bHasActive && ( nPos > m_nActive ) )
- {
- if ( aMousePos.Y() + m_nTopIndex <= m_nActive*m_nStdHeight + m_nActiveHeight )
- nPos = m_nActive;
- else
- nPos = ( aMousePos.Y() + m_nTopIndex - (m_nActiveHeight - m_nStdHeight) ) / m_nStdHeight;
- }
+ const long nPos = PointToPos( aMousePos );
if ( rMEvt.IsRight() )
{
switch( ShowPopupMenu( aMousePos, nPos ) )
{
case CMD_NONE: break;
- case CMD_ENABLE: m_pParent->enablePackage( m_vEntries[ nPos ]->m_xPackageManager,
- m_vEntries[ nPos ]->m_xPackage, true );
+ case CMD_ENABLE: m_pParent->enablePackage( GetEntryData( nPos )->m_xPackageManager,
+ GetEntryData( nPos )->m_xPackage, true );
break;
- case CMD_DISABLE: m_pParent->enablePackage( m_vEntries[ nPos ]->m_xPackageManager,
- m_vEntries[ nPos ]->m_xPackage, false );
+ case CMD_DISABLE: m_pParent->enablePackage( GetEntryData( nPos )->m_xPackageManager,
+ GetEntryData( nPos )->m_xPackage, false );
break;
- case CMD_UPDATE: m_pParent->updatePackage( m_vEntries[ nPos ]->m_xPackageManager,
- m_vEntries[ nPos ]->m_xPackage );
+ case CMD_UPDATE: m_pParent->updatePackage( GetEntryData( nPos )->m_xPackageManager,
+ GetEntryData( nPos )->m_xPackage );
break;
- case CMD_REMOVE: m_pParent->removePackage( m_vEntries[ nPos ]->m_xPackageManager,
- m_vEntries[ nPos ]->m_xPackage );
+ case CMD_REMOVE: m_pParent->removePackage( GetEntryData( nPos )->m_xPackageManager,
+ GetEntryData( nPos )->m_xPackage );
break;
}
}
else if ( rMEvt.IsLeft() )
{
- if ( rMEvt.IsMod1() && m_bHasActive )
- selectEntry( m_vEntries.size() ); // Selecting an not existing entry will deselect the current one
+ if ( rMEvt.IsMod1() && HasActive() )
+ selectEntry( EXTENSION_LISTBOX_ENTRY_NOTFOUND ); // Selecting an not existing entry will deselect the current one
else
selectEntry( nPos );
}
}
//------------------------------------------------------------------------------
-long ExtensionBox_Impl::Notify( NotifyEvent& rNEvt )
+long ExtBoxWithBtns_Impl::Notify( NotifyEvent& rNEvt )
{
bool bHandled = false;
@@ -1181,364 +447,259 @@ long ExtensionBox_Impl::Notify( NotifyEvent& rNEvt )
if ( nKeyCode == KEY_TAB )
bHandled = HandleTabKey( aKeyCode.IsShift() );
- else if ( aKeyCode.GetGroup() == KEYGROUP_CURSOR )
- bHandled = HandleCursorKey( nKeyCode );
- }
-
- if ( rNEvt.GetType() == EVENT_COMMAND )
- {
- if ( m_bHasScrollBar &&
- ( rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL ) )
- {
- const CommandWheelData* pData = rNEvt.GetCommandEvent()->GetWheelData();
- if ( pData->GetMode() == COMMAND_WHEEL_SCROLL )
- {
- long nThumbPos = m_pScrollBar->GetThumbPos();
- if ( pData->GetDelta() < 0 )
- m_pScrollBar->DoScroll( nThumbPos + m_nStdHeight );
- else
- m_pScrollBar->DoScroll( nThumbPos - m_nStdHeight );
- bHandled = true;
- }
- }
}
if ( !bHandled )
- return Control::Notify( rNEvt );
+ return ExtensionBox_Impl::Notify( rNEvt );
else
return true;
}
//------------------------------------------------------------------------------
-bool ExtensionBox_Impl::FindEntryPos( const TEntry_Impl pEntry, const long nStart,
- const long nEnd, long &nPos )
+void ExtBoxWithBtns_Impl::enableButtons( bool bEnable )
{
- nPos = nStart;
- if ( nStart > nEnd )
- return false;
-
- StringCompare eCompare;
+ m_bInterfaceLocked = ! bEnable;
- if ( nStart == nEnd )
+ if ( bEnable )
{
- eCompare = pEntry->CompareTo( m_pCollator, m_vEntries[ nStart ] );
- if ( eCompare == COMPARE_LESS )
- return false;
- else if ( eCompare == COMPARE_EQUAL )
- {
- //Workaround. See i86963.
- if (pEntry->m_xPackage != m_vEntries[nStart]->m_xPackage)
- return false;
-
- if ( m_bInCheckMode )
- m_vEntries[ nStart ]->m_bChecked = true;
- return true;
- }
- else
- {
- nPos = nStart + 1;
- return false;
- }
+ sal_Int32 nIndex = getSelIndex();
+ if ( nIndex != EXTENSION_LISTBOX_ENTRY_NOTFOUND )
+ SetButtonStatus( GetEntryData( nIndex ) );
}
-
- const long nMid = nStart + ( ( nEnd - nStart ) / 2 );
- eCompare = pEntry->CompareTo( m_pCollator, m_vEntries[ nMid ] );
-
- if ( eCompare == COMPARE_LESS )
- return FindEntryPos( pEntry, nStart, nMid-1, nPos );
- else if ( eCompare == COMPARE_GREATER )
- return FindEntryPos( pEntry, nMid+1, nEnd, nPos );
else
{
- //Workaround.See i86963.
- if (pEntry->m_xPackage != m_vEntries[nMid]->m_xPackage)
- return false;
-
- if ( m_bInCheckMode )
- m_vEntries[ nMid ]->m_bChecked = true;
- nPos = nMid;
- return true;
+ m_pOptionsBtn->Enable( false );
+ m_pRemoveBtn->Enable( false );
+ m_pEnableBtn->Enable( false );
}
}
-//------------------------------------------------------------------------------
-long ExtensionBox_Impl::addEntry( const uno::Reference< deployment::XPackage > &xPackage,
- const uno::Reference< deployment::XPackageManager > &xPackageManager )
+// -----------------------------------------------------------------------
+IMPL_LINK( ExtBoxWithBtns_Impl, ScrollHdl, ScrollBar*, pScrBar )
{
- long nPos = 0;
- PackageState eState = m_pManager->getPackageState( xPackage );
-
- TEntry_Impl pEntry( new Entry_Impl( xPackage, xPackageManager, eState ) );
- xPackage->addEventListener( this );
-
- ::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 )
- {
- OSL_ENSURE( 0, "ExtensionBox_Impl::addEntry(): Will not add duplicate entries" );
- }
- }
- //access to m_nActive must be guarded
- if ( !m_bInCheckMode && m_bHasActive && ( m_nActive >= nPos ) )
- m_nActive += 1;
+ long nDelta = pScrBar->GetDelta();
- guard.clear();
+ Point aNewOptPt( m_pOptionsBtn->GetPosPixel() - Point( 0, nDelta ) );
+ Point aNewRemPt( m_pRemoveBtn->GetPosPixel() - Point( 0, nDelta ) );
+ Point aNewEnPt( m_pEnableBtn->GetPosPixel() - Point( 0, nDelta ) );
- if ( IsReallyVisible() )
- Invalidate();
+ DoScroll( nDelta );
- m_bNeedsRecalc = true;
+ m_pOptionsBtn->SetPosPixel( aNewOptPt );
+ m_pRemoveBtn->SetPosPixel( aNewRemPt );
+ m_pEnableBtn->SetPosPixel( aNewEnPt );
- return nPos;
+ return 1;
}
-//------------------------------------------------------------------------------
-void ExtensionBox_Impl::updateEntry( const uno::Reference< deployment::XPackage > &xPackage )
+// -----------------------------------------------------------------------
+IMPL_LINK( ExtBoxWithBtns_Impl, HandleOptionsBtn, void*, EMPTYARG )
{
- typedef std::vector< TEntry_Impl >::iterator ITER;
- for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+ const sal_Int32 nActive = getSelIndex();
+
+ if ( nActive != EXTENSION_LISTBOX_ENTRY_NOTFOUND )
{
- if ( (*iIndex)->m_xPackage == xPackage )
+ SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
+
+ if ( pFact )
{
- PackageState eState = m_pManager->getPackageState( xPackage );
- (*iIndex)->m_bHasOptions = m_pManager->supportsOptions( xPackage );
- (*iIndex)->m_eState = eState;
- (*iIndex)->m_sTitle = xPackage->getDisplayName();
- (*iIndex)->m_sVersion = xPackage->getVersion();
- (*iIndex)->m_sDescription = xPackage->getDescription();
-
- if ( eState == AMBIGUOUS )
- (*iIndex)->m_sErrorText = ExtMgrDialog::getResourceString( RID_STR_ERROR_UNKNOWN_STATUS );
- else
- (*iIndex)->m_sErrorText = String();
+ OUString sExtensionId = GetEntryData( nActive )->m_xPackage->getIdentifier().Value;
+ VclAbstractDialog* pDlg = pFact->CreateOptionsDialog( this, sExtensionId, rtl::OUString() );
- if ( IsReallyVisible() )
- Invalidate();
- break;
+ pDlg->Execute();
+
+ delete pDlg;
}
}
+
+ return 1;
}
-//------------------------------------------------------------------------------
-void ExtensionBox_Impl::prepareChecking( const uno::Reference< deployment::XPackageManager > &xPackageMgr )
+// -----------------------------------------------------------------------
+IMPL_LINK( ExtBoxWithBtns_Impl, HandleEnableBtn, void*, EMPTYARG )
{
- m_bInCheckMode = true;
- typedef std::vector< TEntry_Impl >::iterator ITER;
- for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+ const sal_Int32 nActive = getSelIndex();
+
+ if ( nActive != EXTENSION_LISTBOX_ENTRY_NOTFOUND )
{
- if ( (*iIndex)->m_xPackageManager == xPackageMgr )
- (*iIndex)->m_bChecked = false;
- else
- (*iIndex)->m_bChecked = true;
- (*iIndex)->m_bNew = false;
+ TEntry_Impl pEntry = GetEntryData( nActive );
+ const bool bEnable( pEntry->m_eState != REGISTERED );
+
+ m_pParent->enablePackage( pEntry->m_xPackageManager,
+ pEntry->m_xPackage,
+ bEnable );
}
+
+ return 1;
}
-//------------------------------------------------------------------------------
-void ExtensionBox_Impl::checkEntries()
+// -----------------------------------------------------------------------
+IMPL_LINK( ExtBoxWithBtns_Impl, HandleRemoveBtn, void*, EMPTYARG )
{
- long nNewPos = -1;
- long nPos = 0;
- bool bNeedsUpdate = false;
+ const sal_Int32 nActive = getSelIndex();
- ::osl::ClearableMutexGuard guard(m_entriesMutex);
- typedef std::vector< TEntry_Impl >::iterator ITER;
- ITER iIndex = m_vEntries.begin();
- while ( iIndex < m_vEntries.end() )
+ if ( nActive != EXTENSION_LISTBOX_ENTRY_NOTFOUND )
{
- if ( (*iIndex)->m_bChecked == false )
- {
- bNeedsUpdate = true;
- nPos = iIndex-m_vEntries.begin();
- if ( (*iIndex)->m_bNew )
- {
- if ( nNewPos == - 1)
- nNewPos = nPos;
- if ( nPos <= m_nActive )
- m_nActive += 1;
- }
- }
- iIndex++;
+ TEntry_Impl pEntry = GetEntryData( nActive );
+ m_pParent->removePackage( pEntry->m_xPackageManager,
+ pEntry->m_xPackage );
}
- guard.clear();
-
- m_bInCheckMode = false;
- if ( nNewPos != - 1)
- selectEntry( nNewPos );
+ return 1;
+}
- if ( bNeedsUpdate )
- {
- m_bNeedsRecalc = true;
- if ( IsReallyVisible() )
- Invalidate();
- }
+//------------------------------------------------------------------------------
+// DialogHelper
+//------------------------------------------------------------------------------
+DialogHelper::DialogHelper( const uno::Reference< uno::XComponentContext > &xContext,
+ Dialog *pWindow ) :
+ m_pVCLWindow( pWindow ),
+ m_nEventID( 0 ),
+ m_bIsBusy( false )
+{
+ m_xContext = xContext;
}
+
//------------------------------------------------------------------------------
-bool ExtensionBox_Impl::isHCMode()
+DialogHelper::~DialogHelper()
{
- return (bool)GetDisplayBackground().GetColor().IsDark();
+ if ( m_nEventID )
+ Application::RemoveUserEvent( m_nEventID );
}
//------------------------------------------------------------------------------
-void ExtensionBox_Impl::enableButtons( bool bEnable )
+ResId DialogHelper::getResId( USHORT nId )
{
- m_bInterfaceLocked = ! bEnable;
+ const ::vos::OGuard guard( Application::GetSolarMutex() );
+ return ResId( nId, *DeploymentGuiResMgr::get() );
+}
- if ( bEnable )
- {
- if ( m_bHasActive )
- SetButtonStatus( m_vEntries[ m_nActive ] );
- }
- else
- {
- m_pOptionsBtn->Enable( false );
- m_pRemoveBtn->Enable( false );
- m_pEnableBtn->Enable( false );
+//------------------------------------------------------------------------------
+String DialogHelper::getResourceString( USHORT id )
+{
+ // init with non-acquired solar mutex:
+ BrandName::get();
+ const ::vos::OGuard guard( Application::GetSolarMutex() );
+ String ret( ResId( id, *DeploymentGuiResMgr::get() ) );
+ if (ret.SearchAscii( "%PRODUCTNAME" ) != STRING_NOTFOUND) {
+ ret.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
}
+ return ret;
}
//------------------------------------------------------------------------------
-// XEventListener
-void ExtensionBox_Impl::disposing( lang::EventObject const & rEvt )
- throw ( uno::RuntimeException )
+bool DialogHelper::IsSharedPkgMgr( const uno::Reference< deployment::XPackageManager > &xPackageManager )
{
- uno::Reference< deployment::XPackage > xPackage( rEvt.Source, uno::UNO_QUERY );
+ if ( xPackageManager->getContext().equals( OUSTR("shared") ) )
+ return true;
+ else
+ return false;
+}
- if ( xPackage.is() )
+//------------------------------------------------------------------------------
+bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment::XPackageManager > &xPackageManager,
+ Window *pParent,
+ const USHORT nResID,
+ bool &bHadWarning )
+{
+ if ( !bHadWarning && IsSharedPkgMgr( xPackageManager ) )
{
- ::osl::ClearableMutexGuard aGuard( m_entriesMutex );
- typedef std::vector< TEntry_Impl >::iterator ITER;
+ const ::vos::OGuard guard( Application::GetSolarMutex() );
+ WarningBox aInfoBox( pParent, getResId( nResID ) );
+ String aMsgText = aInfoBox.GetMessText();
+ aMsgText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
+ aInfoBox.SetMessText( aMsgText );
- for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
- {
- if ( (*iIndex)->m_xPackage == xPackage )
- {
- long nPos = iIndex - m_vEntries.begin();
-
- m_vEntries.erase( iIndex );
-
- if ( IsReallyVisible() )
- Invalidate();
-
- if ( m_bHasActive )
- {
- if ( nPos < m_nActive )
- m_nActive -= 1;
- else if ( ( nPos == m_nActive ) &&
- ( nPos == (long) m_vEntries.size() ) )
- m_nActive -= 1;
-
- m_bHasActive = false;
- //clear before calling out of this method
- aGuard.clear();
- selectEntry( m_nActive );
- }
- break;
- }
- }
+ bHadWarning = true;
+
+ if ( RET_OK == aInfoBox.Execute() )
+ return true;
+ else
+ return false;
}
+ else
+ return true;
}
-// -----------------------------------------------------------------------
-IMPL_LINK( ExtensionBox_Impl, ScrollHdl, ScrollBar*, pScrBar )
+//------------------------------------------------------------------------------
+void DialogHelper::openWebBrowser( const OUString & sURL, const OUString &sTitle ) const
{
- long nDelta = pScrBar->GetDelta();
+ if ( ! sURL.getLength() ) // Nothing to do, when the URL is empty
+ return;
- m_nTopIndex += nDelta;
- Point aNewOptPt( m_pOptionsBtn->GetPosPixel() - Point( 0, nDelta ) );
- Point aNewRemPt( m_pRemoveBtn->GetPosPixel() - Point( 0, nDelta ) );
- Point aNewEnPt( m_pEnableBtn->GetPosPixel() - Point( 0, nDelta ) );
- Point aNewSBPt( m_pScrollBar->GetPosPixel() );
+ try
+ {
+ uno::Reference< XSystemShellExecute > xSystemShellExecute(
+ m_xContext->getServiceManager()->createInstanceWithContext( OUSTR( "com.sun.star.system.SystemShellExecute" ), m_xContext), uno::UNO_QUERY_THROW);
+ //throws css::lang::IllegalArgumentException, css::system::SystemShellExecuteException
+ xSystemShellExecute->execute( sURL, OUString(), SystemShellExecuteFlags::DEFAULTS );
+ }
+ catch ( uno::Exception& )
+ {
+ uno::Any exc( ::cppu::getCaughtException() );
+ OUString msg( ::comphelper::anyToString( exc ) );
+ const ::vos::OGuard guard( Application::GetSolarMutex() );
+ ErrorBox aErrorBox( NULL, WB_OK, msg );
+ aErrorBox.SetText( sTitle );
+ aErrorBox.Execute();
+ }
+}
- Rectangle aScrRect( Point(), GetOutputSizePixel() );
- aScrRect.Right() -= pScrBar->GetSizePixel().Width();
- Scroll( 0, -nDelta, aScrRect );
+//------------------------------------------------------------------------------
+bool DialogHelper::installExtensionWarn( const OUString &rExtensionName ) const
+{
+ const ::vos::OGuard guard( Application::GetSolarMutex() );
+ WarningBox aInfo( m_pVCLWindow, getResId( RID_WARNINGBOX_INSTALL_EXTENSION ) );
- m_pOptionsBtn->SetPosPixel( aNewOptPt );
- m_pRemoveBtn->SetPosPixel( aNewRemPt );
- m_pEnableBtn->SetPosPixel( aNewEnPt );
- m_pScrollBar->SetPosPixel( aNewSBPt );
+ String sText( aInfo.GetMessText() );
+ sText.SearchAndReplaceAllAscii( "%NAME", rExtensionName );
+ aInfo.SetMessText( sText );
- return 1;
+ return ( RET_OK == aInfo.Execute() );
}
-// -----------------------------------------------------------------------
-IMPL_LINK( ExtensionBox_Impl, HandleOptionsBtn, void*, EMPTYARG )
+//------------------------------------------------------------------------------
+bool DialogHelper::installForAllUsers( bool &bInstallForAll ) const
{
- if ( m_bHasActive )
- {
- SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
-
- if ( pFact )
- {
- OUString sExtensionId = m_vEntries[ m_nActive ]->m_xPackage->getIdentifier().Value;
- VclAbstractDialog* pDlg = pFact->CreateOptionsDialog( this, sExtensionId, rtl::OUString() );
+ const ::vos::OGuard guard( Application::GetSolarMutex() );
+ QueryBox aQuery( m_pVCLWindow, getResId( RID_QUERYBOX_INSTALL_FOR_ALL ) );
- pDlg->Execute();
+ String sMsgText = aQuery.GetMessText();
+ sMsgText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
+ aQuery.SetMessText( sMsgText );
- delete pDlg;
- }
- }
+ USHORT nYesBtnID = aQuery.GetButtonId( 0 );
+ USHORT nNoBtnID = aQuery.GetButtonId( 1 );
- return 1;
-}
+ if ( nYesBtnID != BUTTONDIALOG_BUTTON_NOTFOUND )
+ aQuery.SetButtonText( nYesBtnID, getResourceString( RID_STR_INSTALL_FOR_ME ) );
+ if ( nNoBtnID != BUTTONDIALOG_BUTTON_NOTFOUND )
+ aQuery.SetButtonText( nNoBtnID, getResourceString( RID_STR_INSTALL_FOR_ALL ) );
-// -----------------------------------------------------------------------
-IMPL_LINK( ExtensionBox_Impl, HandleEnableBtn, void*, EMPTYARG )
-{
- if ( m_bHasActive )
- {
- const bool bEnable( m_vEntries[ m_nActive ]->m_eState != REGISTERED );
+ short nRet = aQuery.Execute();
- m_pParent->enablePackage( m_vEntries[ m_nActive ]->m_xPackageManager,
- m_vEntries[ m_nActive ]->m_xPackage,
- bEnable );
- }
+ if ( nRet == RET_CANCEL )
+ return false;
- return 1;
+ bInstallForAll = ( nRet == RET_NO );
+ return true;
}
-// -----------------------------------------------------------------------
-IMPL_LINK( ExtensionBox_Impl, HandleRemoveBtn, void*, EMPTYARG )
+//------------------------------------------------------------------------------
+void DialogHelper::PostUserEvent( const Link& rLink, void* pCaller )
{
- if ( m_bHasActive )
- {
- m_pParent->removePackage( m_vEntries[ m_nActive ]->m_xPackageManager,
- m_vEntries[ m_nActive ]->m_xPackage );
- }
+ if ( m_nEventID )
+ Application::RemoveUserEvent( m_nEventID );
- return 1;
+ m_nEventID = Application::PostUserEvent( rLink, pCaller );
}
-// -----------------------------------------------------------------------
-IMPL_LINK( ExtensionBox_Impl, HandleHyperlink, svt::FixedHyperlink*, pHyperlink )
-{
- m_pParent->openWebBrowser( pHyperlink->GetURL() );
- return 1;
-}
-
-
//------------------------------------------------------------------------------
// ExtMgrDialog
//------------------------------------------------------------------------------
ExtMgrDialog::ExtMgrDialog( Window *pParent, TheExtensionManager *pManager ) :
ModelessDialog( pParent, getResId( RID_DLG_EXTENSION_MANAGER ) ),
+ DialogHelper( pManager->getContext(), (Dialog*) this ),
m_aAddBtn( this, getResId( RID_EM_BTN_ADD ) ),
m_aUpdateBtn( this, getResId( RID_EM_BTN_CHECK_UPDATES ) ),
m_aCloseBtn( this, getResId( RID_EM_BTN_CLOSE ) ),
@@ -1557,14 +718,14 @@ ExtMgrDialog::ExtMgrDialog( Window *pParent, TheExtensionManager *pManager ) :
m_bEnableWarning( false ),
m_bDisableWarning( false ),
m_bDeleteWarning( false ),
- m_bIsBusy( false ),
m_nProgress( 0 ),
m_pManager( pManager )
{
// free local resources (RID < 256):
FreeResource();
- m_pExtensionBox = new ExtensionBox_Impl( this, pManager );
+ m_pExtensionBox = new ExtBoxWithBtns_Impl( this, pManager );
+ m_pExtensionBox->SetHyperlinkHdl( LINK( this, ExtMgrDialog, HandleHyperlink ) );
m_aAddBtn.SetClickHdl( LINK( this, ExtMgrDialog, HandleAddBtn ) );
m_aUpdateBtn.SetClickHdl( LINK( this, ExtMgrDialog, HandleUpdateBtn ) );
@@ -1608,35 +769,6 @@ ExtMgrDialog::~ExtMgrDialog()
}
//------------------------------------------------------------------------------
-ResId ExtMgrDialog::getResId( USHORT id )
-{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
- return ResId( id, *DeploymentGuiResMgr::get() );
-}
-
-//------------------------------------------------------------------------------
-String ExtMgrDialog::getResourceString( USHORT id )
-{
- // init with non-acquired solar mutex:
- BrandName::get();
- const ::vos::OGuard guard( Application::GetSolarMutex() );
- String ret( ResId( id, *DeploymentGuiResMgr::get() ) );
- if (ret.SearchAscii( "%PRODUCTNAME" ) != STRING_NOTFOUND) {
- ret.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
- }
- return ret;
-}
-
-//------------------------------------------------------------------------------
-bool ExtMgrDialog::IsSharedPkgMgr( const uno::Reference< deployment::XPackageManager > &xPackageManager )
-{
- if ( xPackageManager->getContext().equals( OUSTR("shared") ) )
- return true;
- else
- return false;
-}
-
-//------------------------------------------------------------------------------
void ExtMgrDialog::selectEntry( long nPos )
{
m_pExtensionBox->selectEntry( nPos );
@@ -1671,96 +803,6 @@ void ExtMgrDialog::checkEntries()
}
//------------------------------------------------------------------------------
-bool ExtMgrDialog::continueOnSharedExtension( const uno::Reference< deployment::XPackageManager > &xPackageManager,
- const USHORT nResID,
- bool &bHadWarning ) const
-{
- if ( IsSharedPkgMgr( xPackageManager ) && !bHadWarning )
- {
- const ::vos::OGuard guard( Application::GetSolarMutex() );
- WarningBox aInfoBox( const_cast< ExtMgrDialog* >(this), getResId( nResID ) );
- String aMsgText = aInfoBox.GetMessText();
- aMsgText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
- aInfoBox.SetMessText( aMsgText );
-
- bHadWarning = true;
-
- if ( RET_OK == aInfoBox.Execute() )
- return true;
- else
- return false;
- }
- else
- return true;
-}
-
-//------------------------------------------------------------------------------
-void ExtMgrDialog::openWebBrowser( OUString const & sURL ) const
-{
- if ( ! sURL.getLength() ) // Nothing to do, when the URL is empty
- return;
-
- try
- {
- uno::Reference< uno::XComponentContext > xContext = m_pManager->getContext();
-
- uno::Reference< XSystemShellExecute > xSystemShellExecute(
- xContext->getServiceManager()->createInstanceWithContext( OUSTR( "com.sun.star.system.SystemShellExecute" ), xContext), uno::UNO_QUERY_THROW);
- //throws css::lang::IllegalArgumentException, css::system::SystemShellExecuteException
- xSystemShellExecute->execute( sURL, OUString(), SystemShellExecuteFlags::DEFAULTS );
- }
- catch ( uno::Exception& )
- {
- uno::Any exc( ::cppu::getCaughtException() );
- OUString msg( ::comphelper::anyToString( exc ) );
- const ::vos::OGuard guard( Application::GetSolarMutex() );
- ErrorBox aErrorBox( const_cast< ExtMgrDialog* >(this), WB_OK, msg );
- aErrorBox.SetText( GetText() );
- aErrorBox.Execute();
- }
-}
-
-//------------------------------------------------------------------------------
-bool ExtMgrDialog::installForAllUsers( bool &bInstallForAll ) const
-{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
- QueryBox aQuery( const_cast< ExtMgrDialog* >(this), getResId( RID_QUERYBOX_INSTALL_FOR_ALL ) );
-
- String sMsgText = aQuery.GetMessText();
- sMsgText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
- aQuery.SetMessText( sMsgText );
-
- USHORT nYesBtnID = aQuery.GetButtonId( 0 );
- USHORT nNoBtnID = aQuery.GetButtonId( 1 );
-
- if ( nYesBtnID != BUTTONDIALOG_BUTTON_NOTFOUND )
- aQuery.SetButtonText( nYesBtnID, getResourceString( RID_STR_INSTALL_FOR_ME ) );
- if ( nNoBtnID != BUTTONDIALOG_BUTTON_NOTFOUND )
- aQuery.SetButtonText( nNoBtnID, getResourceString( RID_STR_INSTALL_FOR_ALL ) );
-
- short nRet = aQuery.Execute();
-
- if ( nRet == RET_CANCEL )
- return false;
-
- bInstallForAll = ( nRet == RET_NO );
- return true;
-}
-
-//------------------------------------------------------------------------------
-bool ExtMgrDialog::installExtensionWarn( const OUString &rExtensionName ) const
-{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
- WarningBox aInfo( const_cast< ExtMgrDialog* >(this), getResId( RID_WARNINGBOX_INSTALL_EXTENSION ) );
-
- String sText( aInfo.GetMessText() );
- sText.SearchAndReplaceAllAscii( "%NAME", rExtensionName );
- aInfo.SetMessText( sText );
-
- return ( RET_OK == aInfo.Execute() );
-}
-
-//------------------------------------------------------------------------------
bool ExtMgrDialog::removeExtensionWarn( const OUString &rExtensionName ) const
{
const ::vos::OGuard guard( Application::GetSolarMutex() );
@@ -1783,12 +825,12 @@ bool ExtMgrDialog::enablePackage( const uno::Reference< deployment::XPackageMana
if ( bEnable )
{
- if ( ! continueOnSharedExtension( xPackageManager, RID_WARNINGBOX_ENABLE_SHARED_EXTENSION, m_bEnableWarning ) )
+ if ( ! continueOnSharedExtension( xPackageManager, this, RID_WARNINGBOX_ENABLE_SHARED_EXTENSION, m_bEnableWarning ) )
return false;
}
else
{
- if ( ! continueOnSharedExtension( xPackageManager, RID_WARNINGBOX_DISABLE_SHARED_EXTENSION, m_bDisableWarning ) )
+ if ( ! continueOnSharedExtension( xPackageManager, this, RID_WARNINGBOX_DISABLE_SHARED_EXTENSION, m_bDisableWarning ) )
return false;
}
@@ -1810,7 +852,7 @@ bool ExtMgrDialog::removePackage( const uno::Reference< deployment::XPackageMana
return false;
}
- if ( ! continueOnSharedExtension( xPackageManager, RID_WARNINGBOX_REMOVE_SHARED_EXTENSION, m_bDeleteWarning ) )
+ if ( ! continueOnSharedExtension( xPackageManager, this, RID_WARNINGBOX_REMOVE_SHARED_EXTENSION, m_bDeleteWarning ) )
return false;
m_pManager->removePackage( xPackageManager, xPackage );
@@ -1825,7 +867,11 @@ bool ExtMgrDialog::updatePackage( const uno::Reference< deployment::XPackageMana
if ( !xPackageManager.is() || !xPackage.is() )
return false;
- m_pManager->updatePackage( xPackageManager, xPackage );
+ std::vector< TUpdateListEntry > vEntries;
+ TUpdateListEntry pEntry( new UpdateListEntry( xPackage, xPackageManager ) );
+ vEntries.push_back( pEntry );
+
+ m_pManager->updatePackages( vEntries );
return true;
}
@@ -1932,7 +978,7 @@ IMPL_LINK( ExtMgrDialog, startProgress, void*, _bLockInterface )
if ( m_aProgressBar.IsVisible() )
m_aProgressBar.SetValue( 100 );
m_xAbortChannel.clear();
-// bLockInterface = false;
+
OSL_TRACE( " startProgress handler: stop\n" );
}
else
@@ -1945,7 +991,8 @@ IMPL_LINK( ExtMgrDialog, startProgress, void*, _bLockInterface )
m_aUpdateBtn.Enable( !bLockInterface && m_pExtensionBox->getItemCount() );
m_pExtensionBox->enableButtons( !bLockInterface );
-// pCond->set();
+ clearEventID();
+
return 0;
}
@@ -1969,10 +1016,7 @@ void ExtMgrDialog::showProgress( bool _bStart )
OSL_TRACE( "showProgress stop!\n" );
}
- Application::PostUserEvent( LINK( this, ExtMgrDialog, startProgress ), (void*) bStart );
-// ::osl::Condition cond;
-// Application::PostUserEvent( LINK( this, ExtMgrDialog, startProgress ), &cond );
-// cond.wait();
+ DialogHelper::PostUserEvent( LINK( this, ExtMgrDialog, startProgress ), (void*) bStart );
}
// -----------------------------------------------------------------------
@@ -2003,7 +1047,7 @@ void ExtMgrDialog::updatePackageInfo( const uno::Reference< deployment::XPackage
// -----------------------------------------------------------------------
IMPL_LINK( ExtMgrDialog, HandleAddBtn, void*, EMPTYARG )
{
- m_bIsBusy = true;
+ setBusy( true );
uno::Reference< deployment::XPackageManager > xUserPkgMgr = m_pManager->getUserPkgMgr();
uno::Sequence< OUString > aFileList = raiseAddPicker( xUserPkgMgr );
@@ -2013,7 +1057,7 @@ IMPL_LINK( ExtMgrDialog, HandleAddBtn, void*, EMPTYARG )
m_pManager->installPackage( aFileList[0] );
}
- m_bIsBusy = false;
+ setBusy( false );
return 1;
}
@@ -2028,7 +1072,7 @@ IMPL_LINK( ExtMgrDialog, HandleUpdateBtn, void*, EMPTYARG )
// -----------------------------------------------------------------------
IMPL_LINK( ExtMgrDialog, HandleHyperlink, svt::FixedHyperlink*, pHyperlink )
{
- openWebBrowser( pHyperlink->GetURL() );
+ openWebBrowser( pHyperlink->GetURL(), GetText() );
return 1;
}
@@ -2191,6 +1235,554 @@ BOOL ExtMgrDialog::Close()
return bRet;
}
+//------------------------------------------------------------------------------
+// UpdateRequiredDialog
+//------------------------------------------------------------------------------
+UpdateRequiredDialog::UpdateRequiredDialog( Window *pParent, TheExtensionManager *pManager ) :
+ ModalDialog( pParent, getResId( RID_DLG_UPDATE_REQUIRED ) ),
+ DialogHelper( pManager->getContext(), (Dialog*) this ),
+ m_aUpdateNeeded( this, getResId( RID_EM_FT_MSG ) ),
+ m_aUpdateBtn( this, getResId( RID_EM_BTN_CHECK_UPDATES ) ),
+ m_aCloseBtn( this, getResId( RID_EM_BTN_CLOSE ) ),
+ m_aHelpBtn( this, getResId( RID_EM_BTN_HELP ) ),
+ m_aCancelBtn( this, getResId( RID_EM_BTN_CANCEL ) ),
+ m_aDivider( this ),
+ m_aProgressText( this, getResId( RID_EM_FT_PROGRESS ) ),
+ m_aProgressBar( this, WB_BORDER + WB_3DLOOK ),
+ m_sAddPackages( getResourceString( RID_STR_ADD_PACKAGES ) ),
+ m_sCloseText( getResourceString( RID_STR_CLOSE_BTN ) ),
+ m_bHasProgress( false ),
+ m_bProgressChanged( false ),
+ m_bStartProgress( false ),
+ m_bStopProgress( false ),
+ m_bUpdateWarning( false ),
+ m_bDisableWarning( false ),
+ m_bHasLockedEntries( false ),
+ m_nProgress( 0 ),
+ m_pManager( pManager )
+{
+ // free local resources (RID < 256):
+ FreeResource();
+
+ m_pExtensionBox = new ExtensionBox_Impl( this, pManager );
+ m_pExtensionBox->SetHyperlinkHdl( LINK( this, UpdateRequiredDialog, HandleHyperlink ) );
+
+ m_aUpdateBtn.SetClickHdl( LINK( this, UpdateRequiredDialog, HandleUpdateBtn ) );
+ m_aCloseBtn.SetClickHdl( LINK( this, UpdateRequiredDialog, HandleCloseBtn ) );
+ m_aCancelBtn.SetClickHdl( LINK( this, UpdateRequiredDialog, HandleCancelBtn ) );
+
+ String aText = m_aUpdateNeeded.GetText();
+ aText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
+ m_aUpdateNeeded.SetText( aText );
+
+ // resize update button
+ Size aBtnSize = m_aUpdateBtn.GetSizePixel();
+ String sTitle = m_aUpdateBtn.GetText();
+ long nWidth = m_aUpdateBtn.GetCtrlTextWidth( sTitle );
+ nWidth += 2 * m_aUpdateBtn.GetTextHeight();
+ if ( nWidth > aBtnSize.Width() )
+ m_aUpdateBtn.SetSizePixel( Size( nWidth, aBtnSize.Height() ) );
+
+ // resize update button
+ aBtnSize = m_aCloseBtn.GetSizePixel();
+ sTitle = m_aCloseBtn.GetText();
+ nWidth = m_aCloseBtn.GetCtrlTextWidth( sTitle );
+ nWidth += 2 * m_aCloseBtn.GetTextHeight();
+ if ( nWidth > aBtnSize.Width() )
+ m_aCloseBtn.SetSizePixel( Size( nWidth, aBtnSize.Height() ) );
+
+ // minimum size:
+ SetMinOutputSizePixel(
+ Size( // width:
+ (5 * m_aHelpBtn.GetSizePixel().Width()) +
+ (5 * RSC_SP_DLG_INNERBORDER_LEFT ),
+ // height:
+ (1 * m_aHelpBtn.GetSizePixel().Height()) +
+ (1 * m_aUpdateNeeded.GetSizePixel().Height()) +
+ (1 * m_pExtensionBox->GetMinOutputSizePixel().Height()) +
+ (3 * RSC_SP_DLG_INNERBORDER_LEFT) ) );
+
+ m_aDivider.Show();
+ m_aProgressBar.Hide();
+ m_aUpdateBtn.Enable( false );
+ m_aCloseBtn.GrabFocus();
+
+ m_aTimeoutTimer.SetTimeout( 50 ); // mSec
+ m_aTimeoutTimer.SetTimeoutHdl( LINK( this, UpdateRequiredDialog, TimeOutHdl ) );
+}
+
+//------------------------------------------------------------------------------
+UpdateRequiredDialog::~UpdateRequiredDialog()
+{
+ m_aTimeoutTimer.Stop();
+
+ delete m_pExtensionBox;
+}
+
+//------------------------------------------------------------------------------
+long UpdateRequiredDialog::addPackageToList( const uno::Reference< deployment::XPackage > &xPackage,
+ const uno::Reference< deployment::XPackageManager > &xPackageManager )
+{
+ // We will only add entries to the list with unsatisfied dependencies
+ if ( !checkDependencies( xPackage ) )
+ {
+ m_bHasLockedEntries |= (bool) xPackageManager->isReadOnly();
+ m_aUpdateBtn.Enable( true );
+ return m_pExtensionBox->addEntry( xPackage, xPackageManager );
+ }
+ return 0;
+}
+
+//------------------------------------------------------------------------------
+void UpdateRequiredDialog::prepareChecking( const uno::Reference< deployment::XPackageManager > &xPackageManager )
+{
+ if ( xPackageManager.is() )
+ m_pExtensionBox->prepareChecking( xPackageManager );
+}
+
+//------------------------------------------------------------------------------
+void UpdateRequiredDialog::checkEntries()
+{
+ const ::vos::OGuard guard( Application::GetSolarMutex() );
+ m_pExtensionBox->checkEntries();
+
+ if ( ! hasActiveEntries() )
+ {
+ m_aCloseBtn.SetText( m_sCloseText );
+ m_aCloseBtn.GrabFocus();
+ }
+}
+
+//------------------------------------------------------------------------------
+bool UpdateRequiredDialog::enablePackage( const uno::Reference< deployment::XPackageManager > &,
+ const uno::Reference< deployment::XPackage > &xPackage,
+ bool bEnable )
+{
+ m_pManager->enablePackage( xPackage, bEnable );
+
+ return true;
+}
+
+//------------------------------------------------------------------------------
+IMPL_LINK( UpdateRequiredDialog, HandleCancelBtn, void*, EMPTYARG )
+{
+ // m_dialog->m_cmdEnv->m_aborted = true;
+ if ( m_xAbortChannel.is() )
+ {
+ try
+ {
+ m_xAbortChannel->sendAbort();
+ }
+ catch ( uno::RuntimeException & )
+ {
+ OSL_ENSURE( 0, "### unexpected RuntimeException!" );
+ }
+ }
+ return 1;
+}
+
+// ------------------------------------------------------------------------------
+IMPL_LINK( UpdateRequiredDialog, startProgress, void*, _bLockInterface )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ bool bLockInterface = (bool) _bLockInterface;
+
+ if ( m_bStartProgress && !m_bHasProgress )
+ m_aTimeoutTimer.Start();
+
+ if ( m_bStopProgress )
+ {
+ if ( m_aProgressBar.IsVisible() )
+ m_aProgressBar.SetValue( 100 );
+ m_xAbortChannel.clear();
+ OSL_TRACE( " startProgress handler: stop\n" );
+ }
+ else
+ {
+ OSL_TRACE( " startProgress handler: start\n" );
+ }
+
+ m_aCancelBtn.Enable( bLockInterface );
+ m_aUpdateBtn.Enable( false );
+ clearEventID();
+
+ return 0;
+}
+
+// ------------------------------------------------------------------------------
+void UpdateRequiredDialog::showProgress( bool _bStart )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ bool bStart = _bStart;
+
+ if ( bStart )
+ {
+ m_nProgress = 0;
+ m_bStartProgress = true;
+ OSL_TRACE( "showProgress start\n" );
+ }
+ else
+ {
+ m_nProgress = 100;
+ m_bStopProgress = true;
+ OSL_TRACE( "showProgress stop!\n" );
+ }
+
+ DialogHelper::PostUserEvent( LINK( this, UpdateRequiredDialog, startProgress ), (void*) bStart );
+}
+
+// -----------------------------------------------------------------------
+void UpdateRequiredDialog::updateProgress( const long nProgress )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ m_nProgress = nProgress;
+}
+
+// -----------------------------------------------------------------------
+void UpdateRequiredDialog::updateProgress( const OUString &rText,
+ const uno::Reference< task::XAbortChannel > &xAbortChannel)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ m_xAbortChannel = xAbortChannel;
+ m_sProgressText = rText;
+ m_bProgressChanged = true;
+}
+
+//------------------------------------------------------------------------------
+void UpdateRequiredDialog::updatePackageInfo( const uno::Reference< deployment::XPackage > &xPackage )
+{
+ // We will remove all updated packages with satisfied dependencies, but
+ // we will show all disabled entries so the user sees the result
+ // of the 'disable all' button
+ if ( isEnabled( xPackage ) && checkDependencies( xPackage ) )
+ m_pExtensionBox->removeEntry( xPackage );
+ else
+ m_pExtensionBox->updateEntry( xPackage );
+
+ if ( ! hasActiveEntries() )
+ {
+ m_aCloseBtn.SetText( m_sCloseText );
+ m_aCloseBtn.GrabFocus();
+ }
+}
+
+// -----------------------------------------------------------------------
+IMPL_LINK( UpdateRequiredDialog, HandleUpdateBtn, void*, EMPTYARG )
+{
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
+
+ std::vector< TUpdateListEntry > 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 );
+ }
+
+ aGuard.clear();
+
+ m_pManager->updatePackages( vUpdateEntries );
+
+ return 1;
+}
+
+// -----------------------------------------------------------------------
+IMPL_LINK( UpdateRequiredDialog, HandleCloseBtn, void*, EMPTYARG )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ if ( !isBusy() )
+ {
+ if ( m_bHasLockedEntries )
+ EndDialog( -1 );
+ else if ( hasActiveEntries() )
+ disableAllEntries();
+ else
+ EndDialog( 0 );
+ }
+
+ return 1;
+}
+
+// -----------------------------------------------------------------------
+IMPL_LINK( UpdateRequiredDialog, HandleHyperlink, svt::FixedHyperlink*, pHyperlink )
+{
+ openWebBrowser( pHyperlink->GetURL(), GetText() );
+
+ return 1;
+}
+
+// -----------------------------------------------------------------------
+IMPL_LINK( UpdateRequiredDialog, TimeOutHdl, Timer*, EMPTYARG )
+{
+ if ( m_bStopProgress )
+ {
+ m_bHasProgress = false;
+ m_bStopProgress = false;
+ m_aProgressText.Hide();
+ m_aProgressBar.Hide();
+ m_aCancelBtn.Hide();
+ }
+ else
+ {
+ if ( m_bProgressChanged )
+ {
+ m_bProgressChanged = false;
+ m_aProgressText.SetText( m_sProgressText );
+ }
+
+ if ( m_bStartProgress )
+ {
+ m_bStartProgress = false;
+ m_bHasProgress = true;
+ m_aProgressBar.Show();
+ m_aProgressText.Show();
+ m_aCancelBtn.Enable();
+ m_aCancelBtn.Show();
+ }
+
+ if ( m_aProgressBar.IsVisible() )
+ m_aProgressBar.SetValue( (USHORT) m_nProgress );
+
+ m_aTimeoutTimer.Start();
+ }
+
+ return 1;
+}
+
+//------------------------------------------------------------------------------
+// VCL::Window / Dialog
+void UpdateRequiredDialog::Resize()
+{
+ Size aTotalSize( GetOutputSizePixel() );
+ Size aBtnSize( m_aHelpBtn.GetSizePixel() );
+
+ Point aPos( RSC_SP_DLG_INNERBORDER_LEFT,
+ aTotalSize.Height() - RSC_SP_DLG_INNERBORDER_BOTTOM - aBtnSize.Height() );
+
+ m_aHelpBtn.SetPosPixel( aPos );
+
+ aPos.X() = aTotalSize.Width() - RSC_SP_DLG_INNERBORDER_RIGHT - m_aCloseBtn.GetSizePixel().Width();
+ m_aCloseBtn.SetPosPixel( aPos );
+
+ aPos.X() -= ( RSC_SP_CTRL_X + m_aUpdateBtn.GetSizePixel().Width() );
+ m_aUpdateBtn.SetPosPixel( aPos );
+
+ Size aDivSize( aTotalSize.Width(), LINE_SIZE );
+ aPos = Point( 0, aPos.Y() - LINE_SIZE - RSC_SP_DLG_INNERBORDER_BOTTOM );
+ m_aDivider.SetPosSizePixel( aPos, aDivSize );
+
+ // Calc fixed text size
+ aPos = Point( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP );
+ Size aFTSize = m_aUpdateNeeded.CalcMinimumSize( aTotalSize.Width() - RSC_SP_DLG_INNERBORDER_RIGHT - RSC_SP_DLG_INNERBORDER_LEFT );
+ m_aUpdateNeeded.SetPosSizePixel( aPos, aFTSize );
+
+ // Calc list box size
+ Size aSize( aTotalSize.Width() - RSC_SP_DLG_INNERBORDER_LEFT - RSC_SP_DLG_INNERBORDER_RIGHT,
+ aTotalSize.Height() - 2*aBtnSize.Height() - LINE_SIZE -
+ 2*RSC_SP_DLG_INNERBORDER_TOP - 3*RSC_SP_DLG_INNERBORDER_BOTTOM - aFTSize.Height() );
+ aPos.Y() += aFTSize.Height()+RSC_SP_DLG_INNERBORDER_TOP;
+
+ m_pExtensionBox->SetPosSizePixel( aPos, aSize );
+
+ aPos.X() = aTotalSize.Width() - RSC_SP_DLG_INNERBORDER_RIGHT - aBtnSize.Width();
+ aPos.Y() += aSize.Height()+RSC_SP_DLG_INNERBORDER_TOP;
+ m_aCancelBtn.SetPosPixel( aPos );
+
+ // Calc progress height
+ aFTSize = m_aProgressText.GetSizePixel();
+ long nProgressHeight = aFTSize.Height();
+
+ if( IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
+ {
+ ImplControlValue aValue;
+ bool bNativeOK;
+ Region aControlRegion( Rectangle( (const Point&)Point(), m_aProgressBar.GetSizePixel() ) );
+ Region aNativeControlRegion, aNativeContentRegion;
+ if( (bNativeOK = GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
+ CTRL_STATE_ENABLED, aValue, rtl::OUString(),
+ aNativeControlRegion, aNativeContentRegion ) ) != FALSE )
+ {
+ nProgressHeight = aNativeControlRegion.GetBoundRect().GetHeight();
+ }
+ }
+
+ if ( nProgressHeight < PROGRESS_HEIGHT )
+ nProgressHeight = PROGRESS_HEIGHT;
+
+ aPos.X() -= ( RSC_SP_CTRL_GROUP_Y + PROGRESS_WIDTH );
+ m_aProgressBar.SetPosSizePixel( Point( aPos.X(), aPos.Y() + ((aBtnSize.Height()-nProgressHeight)/2) ),
+ Size( PROGRESS_WIDTH, nProgressHeight ) );
+
+ aFTSize.Width() = aPos.X() - 2*RSC_SP_DLG_INNERBORDER_LEFT;
+ aPos.X() = RSC_SP_DLG_INNERBORDER_LEFT;
+ aPos.Y() += ( aBtnSize.Height() - aFTSize.Height() - 1 ) / 2;
+ m_aProgressText.SetPosSizePixel( aPos, aFTSize );
+}
+
+//------------------------------------------------------------------------------
+// VCL::Dialog
+short UpdateRequiredDialog::Execute()
+{
+ if ( m_bHasLockedEntries )
+ {
+ // Set other text, disable update btn, remove not shared entries from list;
+ m_aUpdateNeeded.SetText( DialogHelper::getResourceString( RID_STR_NO_ADMIN_PRIVILEGE ) );
+ m_aCloseBtn.SetText( DialogHelper::getResourceString( RID_STR_EXIT_BTN ) );
+ m_aUpdateBtn.Enable( false );
+ m_pExtensionBox->RemoveUnlocked();
+ Resize();
+ }
+
+ return Dialog::Execute();
+}
+
+//------------------------------------------------------------------------------
+// VCL::Dialog
+BOOL UpdateRequiredDialog::Close()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ if ( !isBusy() )
+ {
+ if ( m_bHasLockedEntries )
+ EndDialog( -1 );
+ else if ( hasActiveEntries() )
+ disableAllEntries();
+ else
+ EndDialog( 0 );
+ }
+
+ return false;
+}
+
+//------------------------------------------------------------------------------
+// Check dependencies of all packages
+//------------------------------------------------------------------------------
+bool UpdateRequiredDialog::isEnabled( const uno::Reference< deployment::XPackage > &xPackage ) const
+{
+ 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() );
+ bRegistered = false;
+ }
+
+ return bRegistered;
+}
+
+//------------------------------------------------------------------------------
+bool UpdateRequiredDialog::checkDependencies( const uno::Reference< deployment::XPackage > &xPackage ) const
+{
+ if ( isEnabled( xPackage ) )
+ {
+ bool bDependenciesValid = false;
+ try {
+ bDependenciesValid = xPackage->checkDependencies( uno::Reference< ucb::XCommandEnvironment >() );
+ }
+ catch ( deployment::DeploymentException & ) {}
+ if ( ! bDependenciesValid )
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+//------------------------------------------------------------------------------
+bool UpdateRequiredDialog::hasActiveEntries()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ bool bRet = false;
+ long nCount = m_pExtensionBox->GetEntryCount();
+ for ( long nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ TEntry_Impl pEntry = m_pExtensionBox->GetEntryData( nIndex );
+
+ if ( !checkDependencies( pEntry->m_xPackage ) )
+ {
+ bRet = true;
+ break;
+ }
+ }
+
+ return bRet;
+}
+
+//------------------------------------------------------------------------------
+void UpdateRequiredDialog::disableAllEntries()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ setBusy( true );
+
+ long nCount = m_pExtensionBox->GetEntryCount();
+ for ( long nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ TEntry_Impl pEntry = m_pExtensionBox->GetEntryData( nIndex );
+ enablePackage( pEntry->m_xPackageManager, pEntry->m_xPackage, false );
+ }
+
+ setBusy( false );
+
+ if ( ! hasActiveEntries() )
+ m_aCloseBtn.SetText( m_sCloseText );
+}
+
+//=================================================================================
+// UpdateRequiredDialogService
+//=================================================================================
+UpdateRequiredDialogService::UpdateRequiredDialogService( uno::Sequence< uno::Any > const&,
+ uno::Reference< uno::XComponentContext > const& xComponentContext )
+ : m_xComponentContext( xComponentContext )
+{
+}
+
+//------------------------------------------------------------------------------
+// XExecutableDialog
+//------------------------------------------------------------------------------
+void UpdateRequiredDialogService::setTitle( OUString const & ) throw ( uno::RuntimeException )
+{
+}
+
+//------------------------------------------------------------------------------
+sal_Int16 UpdateRequiredDialogService::execute() throw ( uno::RuntimeException )
+{
+ ::rtl::Reference< ::dp_gui::TheExtensionManager > xManager( TheExtensionManager::get(
+ m_xComponentContext,
+ uno::Reference< awt::XWindow >(),
+ OUString() ) );
+ xManager->createDialog( true );
+ sal_Int16 nRet = xManager->execute();
+
+ return nRet;
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
SelectedPackage::~SelectedPackage() {}
} //namespace dp_gui
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
index bab8d52828a9..7536aa403cfe 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
@@ -46,20 +46,71 @@
#include "rtl/ref.hxx"
#include "rtl/ustring.hxx"
+#include "cppuhelper/implbase1.hxx"
+
+#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"
namespace dp_gui {
//==============================================================================
+class ExtBoxWithBtns_Impl;
class ExtensionBox_Impl;
class TheExtensionManager;
//==============================================================================
-class ExtMgrDialog : public ModelessDialog
+class DialogHelper
{
- ExtensionBox_Impl *m_pExtensionBox;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ Dialog* m_pVCLWindow;
+ ULONG m_nEventID;
+ bool m_bIsBusy;
+
+public:
+ DialogHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &,
+ Dialog *pWindow );
+ virtual ~DialogHelper();
+
+ void openWebBrowser( const ::rtl::OUString & sURL, const ::rtl::OUString & sTitle ) const;
+ Dialog* getWindow() const { return m_pVCLWindow; };
+ void PostUserEvent( const Link& rLink, void* pCaller );
+ void clearEventID() { m_nEventID = 0; }
+
+ virtual void showProgress( bool bStart ) = 0;
+ virtual void updateProgress( const ::rtl::OUString &rText,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XAbortChannel > &xAbortChannel) = 0;
+ 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 void prepareChecking( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager ) = 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 > &,
+ Window *pParent,
+ const USHORT nResID,
+ bool &bHadWarning );
+
+ void setBusy( const bool bBusy ) { m_bIsBusy = bBusy; }
+ bool isBusy() const { return m_bIsBusy; }
+ bool installExtensionWarn( const ::rtl::OUString &rExtensionURL ) const;
+ bool installForAllUsers( bool &bInstallForAll ) const;
+};
+
+//==============================================================================
+class ExtMgrDialog : public ModelessDialog,
+ public DialogHelper
+{
+ ExtBoxWithBtns_Impl *m_pExtensionBox;
PushButton m_aAddBtn;
PushButton m_aUpdateBtn;
OKButton m_aCloseBtn;
@@ -81,16 +132,12 @@ class ExtMgrDialog : public ModelessDialog
bool m_bEnableWarning;
bool m_bDisableWarning;
bool m_bDeleteWarning;
- bool m_bIsBusy;
long m_nProgress;
Timer m_aTimeoutTimer;
TheExtensionManager *m_pManager;
::com::sun::star::uno::Reference< ::com::sun::star::task::XAbortChannel > m_xAbortChannel;
- bool continueOnSharedExtension( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &,
- const USHORT nResID,
- bool &bHadWarning ) const;
bool removeExtensionWarn( const ::rtl::OUString &rExtensionTitle ) const;
DECL_DLLPRIVATE_LINK( HandleAddBtn, void * );
@@ -108,9 +155,16 @@ public:
virtual long Notify( NotifyEvent& rNEvt );
virtual BOOL Close();
+ virtual void showProgress( bool bStart );
+ virtual void updateProgress( const ::rtl::OUString &rText,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XAbortChannel > &xAbortChannel);
+ virtual void updateProgress( const long nProgress );
+
+ virtual void updatePackageInfo( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
+
void setGetExtensionsURL( const ::rtl::OUString &rURL );
void selectEntry( long nPos );
- long addPackageToList( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &,
+ 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,
@@ -120,27 +174,102 @@ public:
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 isBusy() { return m_bIsBusy; }
+ virtual void prepareChecking( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
+ virtual void checkEntries();
+
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > raiseAddPicker( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
+};
+
+//==============================================================================
+class UpdateRequiredDialog : public ModalDialog,
+ public DialogHelper
+{
+ ExtensionBox_Impl *m_pExtensionBox;
+ FixedText m_aUpdateNeeded;
+ PushButton m_aUpdateBtn;
+ PushButton m_aCloseBtn;
+ HelpButton m_aHelpBtn;
+ CancelButton m_aCancelBtn;
+ FixedLine m_aDivider;
+ FixedText m_aProgressText;
+ ProgressBar m_aProgressBar;
+ const String m_sAddPackages;
+ const String m_sCloseText;
+ String m_sProgressText;
+ ::osl::Mutex m_aMutex;
+ bool m_bHasProgress;
+ bool m_bProgressChanged;
+ bool m_bStartProgress;
+ bool m_bStopProgress;
+ bool m_bUpdateWarning;
+ bool m_bDisableWarning;
+ bool m_bHasLockedEntries;
+ long m_nProgress;
+ Timer m_aTimeoutTimer;
+ TheExtensionManager *m_pManager;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XAbortChannel > m_xAbortChannel;
+
+ DECL_DLLPRIVATE_LINK( HandleUpdateBtn, void * );
+ DECL_DLLPRIVATE_LINK( HandleCloseBtn, void * );
+ DECL_DLLPRIVATE_LINK( HandleCancelBtn, void * );
+ DECL_DLLPRIVATE_LINK( TimeOutHdl, Timer* );
+ DECL_DLLPRIVATE_LINK( startProgress, void * );
+ DECL_DLLPRIVATE_LINK( HandleHyperlink, svt::FixedHyperlink * );
- void showProgress( bool bStart );
- void updateProgress( const ::rtl::OUString &rText,
+ bool isEnabled( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage ) const;
+ bool checkDependencies( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage ) const;
+ bool hasActiveEntries();
+ void disableAllEntries();
+
+public:
+ UpdateRequiredDialog( Window * pParent, TheExtensionManager *pManager );
+ virtual ~UpdateRequiredDialog();
+
+ virtual short Execute();
+ virtual void Resize();
+ virtual BOOL Close();
+// virtual long Notify( NotifyEvent& rNEvt );
+
+ virtual void showProgress( bool bStart );
+ virtual void updateProgress( const ::rtl::OUString &rText,
const ::com::sun::star::uno::Reference< ::com::sun::star::task::XAbortChannel > &xAbortChannel);
- void updateProgress( const long nProgress );
- void updatePackageInfo( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
+ virtual void updateProgress( const long nProgress );
- void prepareChecking( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
- void checkEntries();
+ virtual void updatePackageInfo( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
- ::com::sun::star::uno::Sequence< ::rtl::OUString > raiseAddPicker( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
+ 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 );
- void openWebBrowser( ::rtl::OUString const &sURL ) const;
+ virtual void prepareChecking( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
+ virtual void checkEntries();
+
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > raiseAddPicker( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
bool installForAllUsers( bool &bInstallForAll ) const;
bool installExtensionWarn( const ::rtl::OUString &rExtensionURL ) const;
+};
- static ResId getResId( USHORT id );
- static String getResourceString( USHORT id );
- static bool IsSharedPkgMgr( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &);
+//==============================================================================
+class UpdateRequiredDialogService : public ::cppu::WeakImplHelper1< ::com::sun::star::ui::dialogs::XExecutableDialog >
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const m_xComponentContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xParent;
+ ::rtl::OUString m_sInitialTitle;
+
+public:
+ UpdateRequiredDialogService( ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > const & args,
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> const & xComponentContext );
+
+ // XExecutableDialog
+ virtual void SAL_CALL setTitle( rtl::OUString const & title ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Int16 SAL_CALL execute() throw ( ::com::sun::star::uno::RuntimeException );
};
} // namespace dp_gui
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.src b/desktop/source/deployment/gui/dp_gui_dialog2.src
index e82e8c762a9e..7e4004bca1d4 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.src
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.src
@@ -97,6 +97,66 @@ ModelessDialog RID_DLG_EXTENSION_MANAGER
};
};
+ModalDialog RID_DLG_UPDATE_REQUIRED
+{
+ HelpId = HID_PACKAGE_MANAGER_UPD_REQ;
+ Text [ en-US ] = "Extension Update Required";
+
+ Size = MAP_APPFONT( 300, 200 );
+ OutputSize = TRUE;
+ SVLook = TRUE;
+ Moveable = TRUE;
+ Closeable = TRUE;
+ Sizeable = TRUE;
+ Hide = TRUE;
+
+ FixedText RID_EM_FT_MSG
+ {
+ Text [ en-US ] = "%PRODUCTNAME has been updated to a new version. Some installed %PRODUCTNAME extensions are not compatible with this version and need to be updated before they can be used.";
+ WordBreak = TRUE;
+ NoLabel = TRUE;
+ Size = MAP_APPFONT( 280, 3*RSC_BS_CHARHEIGHT );
+ Pos = MAP_APPFONT( 5, 5 );
+ };
+
+ FixedText RID_EM_FT_PROGRESS
+ {
+ Hide = TRUE;
+ Right = TRUE;
+ Text [ en-US ] = "Adding %EXTENSION_NAME";
+ Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_FIXEDTEXT_HEIGHT );
+ };
+
+ HelpButton RID_EM_BTN_HELP
+ {
+ TabStop = TRUE;
+ Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
+ };
+
+ PushButton RID_EM_BTN_CHECK_UPDATES
+ {
+ TabStop = TRUE;
+ Text [ en-US ] = "Check for ~Updates...";
+ Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
+ };
+
+ PushButton RID_EM_BTN_CLOSE
+ {
+ TabStop = TRUE;
+ DefButton = TRUE;
+ Text [ en-US ] = "Disable all";
+ Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
+ };
+
+ CancelButton RID_EM_BTN_CANCEL
+ {
+ TabStop = TRUE;
+ Hide = TRUE;
+ Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
+ };
+
+};
+
Image RID_IMG_WARNING
{
ImageBitmap = Bitmap { File = "caution_16.png"; };
@@ -109,12 +169,12 @@ Image RID_IMG_WARNING_HC
Image RID_IMG_LOCKED
{
- ImageBitmap = Bitmap { File = "lock_16.png"; };
+ ImageBitmap = Bitmap { File = "shared_16.png"; };
};
Image RID_IMG_LOCKED_HC
{
- ImageBitmap = Bitmap { File = "lock_16_h.png"; };
+ ImageBitmap = Bitmap { File = "shared_16_h.png"; };
};
Image RID_IMG_EXTENSION
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index 5a247729082d..889fdc04c9e1 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -136,7 +136,7 @@ class ProgressCmdEnv
uno::Reference< uno::XComponentContext > m_xContext;
uno::Reference< task::XAbortChannel> m_xAbortChannel;
- ExtMgrDialog *m_pDialog;
+ DialogHelper *m_pDialogHelper;
OUString m_sTitle;
bool m_bAborted;
bool m_bWarnUser;
@@ -157,16 +157,16 @@ public:
*/
ProgressCmdEnv( const uno::Reference< uno::XComponentContext > rContext,
- ExtMgrDialog *pDialog,
+ DialogHelper *pDialogHelper,
const OUString &rTitle )
: m_xContext( rContext ),
- m_pDialog( pDialog ),
+ m_pDialogHelper( pDialogHelper ),
m_sTitle( rTitle ),
m_bAborted( false ),
m_bWarnUser( false )
{}
- Dialog * activeDialog() { return m_pDialog; }
+ Dialog * activeDialog() { return m_pDialogHelper->getWindow(); }
void setTitle( const OUString& rNewTitle ) { m_sTitle = rNewTitle; }
void startProgress();
@@ -197,14 +197,14 @@ public:
//------------------------------------------------------------------------------
struct ExtensionCmd
{
- enum E_CMD_TYPE { ADD, ENABLE, DISABLE, REMOVE, CHECK_FOR_UPDATE, CHECK_FOR_UPDATES };
+ enum E_CMD_TYPE { ADD, ENABLE, DISABLE, REMOVE, CHECK_FOR_UPDATES };
E_CMD_TYPE m_eCmdType;
bool m_bWarnUser;
OUString m_sExtensionURL;
uno::Reference< deployment::XPackageManager > m_xPackageManager;
uno::Reference< deployment::XPackage > m_xPackage;
- uno::Sequence< uno::Reference< deployment::XPackageManager > > m_xPackageManagers;
+ std::vector< TUpdateListEntry > m_vExtensionList;
ExtensionCmd( const E_CMD_TYPE eCommand,
const uno::Reference< deployment::XPackageManager > &rPackageManager,
@@ -227,10 +227,10 @@ struct ExtensionCmd
m_bWarnUser( false ),
m_xPackage( rPackage ) {};
ExtensionCmd( const E_CMD_TYPE eCommand,
- const uno::Sequence< uno::Reference< deployment::XPackageManager > > &rPackageManagers )
+ const std::vector< TUpdateListEntry > &vExtensionList )
: m_eCmdType( eCommand ),
m_bWarnUser( false ),
- m_xPackageManagers( rPackageManagers ) {};
+ m_vExtensionList( vExtensionList ) {};
};
typedef ::boost::shared_ptr< ExtensionCmd > TExtensionCmd;
@@ -239,7 +239,7 @@ typedef ::boost::shared_ptr< ExtensionCmd > TExtensionCmd;
class ExtensionCmdQueue::Thread: public dp_gui::Thread
{
public:
- Thread( ExtMgrDialog *pDialog,
+ Thread( DialogHelper *pDialogHelper,
TheExtensionManager *pManager,
const uno::Reference< uno::XComponentContext > & rContext );
@@ -250,9 +250,7 @@ public:
const uno::Reference< deployment::XPackage > &rPackage );
void enableExtension( const uno::Reference< deployment::XPackage > &rPackage,
const bool bEnable );
- void checkForUpdates( const uno::Sequence< uno::Reference< deployment::XPackageManager > > &rPackageManagers );
- void checkForUpdate( const uno::Reference< deployment::XPackageManager > &rPackageManager,
- const uno::Reference< deployment::XPackage > &rPackage );
+ void checkForUpdates( const std::vector< TUpdateListEntry > &vExtensionList );
void stop();
bool hasTerminated();
bool isBusy();
@@ -280,16 +278,14 @@ private:
const uno::Reference< deployment::XPackage > &xPackage );
void _disableExtension( ::rtl::Reference< ProgressCmdEnv > &rCmdEnv,
const uno::Reference< deployment::XPackage > &xPackage );
- void _checkForUpdates( const uno::Sequence< uno::Reference< deployment::XPackageManager > > &rPackageManagers,
- const uno::Reference< deployment::XPackageManager > &xPackageManager,
- const uno::Reference< deployment::XPackage > &xPackage );
+ void _checkForUpdates( const std::vector< TUpdateListEntry > &vExtensionList );
enum Input { NONE, START, STOP };
uno::Reference< uno::XComponentContext > m_xContext;
std::queue< TExtensionCmd > m_queue;
- ExtMgrDialog *m_pDialog;
+ DialogHelper *m_pDialogHelper;
TheExtensionManager *m_pManager;
const OUString m_sEnablingPackages;
@@ -310,13 +306,15 @@ void ProgressCmdEnv::startProgress()
{
m_nCurrentProgress = 0;
- m_pDialog->showProgress( true );
+ if ( m_pDialogHelper )
+ m_pDialogHelper->showProgress( true );
}
//------------------------------------------------------------------------------
void ProgressCmdEnv::stopProgress()
{
- m_pDialog->showProgress( false );
+ if ( m_pDialogHelper )
+ m_pDialogHelper->showProgress( false );
}
//------------------------------------------------------------------------------
@@ -327,8 +325,11 @@ void ProgressCmdEnv::progressSection( const OUString &rText,
if (! m_bAborted)
{
m_nCurrentProgress = 0;
- m_pDialog->updateProgress( rText, xAbortChannel );
- m_pDialog->updateProgress( 5 );
+ if ( m_pDialogHelper )
+ {
+ m_pDialogHelper->updateProgress( rText, xAbortChannel );
+ m_pDialogHelper->updateProgress( 5 );
+ }
}
}
@@ -338,7 +339,8 @@ void ProgressCmdEnv::updateProgress()
if ( ! m_bAborted )
{
long nProgress = ((m_nCurrentProgress*5) % 100) + 5;
- m_pDialog->updateProgress( nProgress );
+ if ( m_pDialogHelper )
+ m_pDialogHelper->updateProgress( nProgress );
}
}
@@ -434,7 +436,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
}
{
vos::OGuard guard(Application::GetSolarMutex());
- short n = DependencyDialog( m_pDialog, deps ).Execute();
+ short n = DependencyDialog( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, deps ).Execute();
// Distinguish between closing the dialog and programatically
// canceling the dialog (headless VCL):
approve = n == RET_OK
@@ -445,19 +447,19 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
ResId warnId(WARNINGBOX_NOSHAREDALLOWED, *DeploymentGuiResMgr::get());
- WarningBox warn( m_pDialog, warnId);
+ 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;
+ abort = true;
}
else if (request >>= licExc)
{
uno::Reference< ui::dialogs::XExecutableDialog > xDialog(
deployment::ui::LicenseDialog::create(
- m_xContext, VCLUnoHelper::GetInterface( m_pDialog ), licExc.Text ) );
+ m_xContext, VCLUnoHelper::GetInterface( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL ), licExc.Text ) );
sal_Int16 res = xDialog->execute();
if ( res == ui::dialogs::ExecutableDialogResults::CANCEL )
abort = true;
@@ -488,7 +490,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
verExc.Deployed->getDisplayName());
{
vos::OGuard guard(Application::GetSolarMutex());
- WarningBox box( m_pDialog, ResId(id, *DeploymentGuiResMgr::get()));
+ WarningBox box( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, ResId(id, *DeploymentGuiResMgr::get()));
String s;
if (bEqualNames)
{
@@ -526,9 +528,14 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
}
else
{
- vos::OGuard guard(Application::GetSolarMutex());
+ if ( m_pDialogHelper )
+ {
+ vos::OGuard guard(Application::GetSolarMutex());
- approve = m_pDialog->installExtensionWarn( instExc.New->getDisplayName() );
+ approve = m_pDialogHelper->installExtensionWarn( instExc.New->getDisplayName() );
+ }
+ else
+ approve = false;
abort = !approve;
}
}
@@ -537,7 +544,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
vos::OGuard guard( Application::GetSolarMutex() );
String sMsg( ResId( RID_STR_UNSUPPORTED_PLATFORM, *DeploymentGuiResMgr::get() ) );
sMsg.SearchAndReplaceAllAscii( "%Name", platExc.package->getDisplayName() );
- ErrorBox box( m_pDialog, WB_OK, sMsg );
+ ErrorBox box( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, WB_OK, sMsg );
box.Execute();
approve = true;
}
@@ -609,7 +616,7 @@ void ProgressCmdEnv::update_( uno::Any const & rStatus )
text = ::comphelper::anyToString( rStatus ); // fallback
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
- const ::std::auto_ptr< ErrorBox > aBox( new ErrorBox( m_pDialog, WB_OK, text ) );
+ const ::std::auto_ptr< ErrorBox > aBox( new ErrorBox( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, WB_OK, text ) );
aBox->Execute();
}
++m_nCurrentProgress;
@@ -631,23 +638,23 @@ void ProgressCmdEnv::pop()
}
//------------------------------------------------------------------------------
-ExtensionCmdQueue::Thread::Thread( ExtMgrDialog *pDialog,
+ExtensionCmdQueue::Thread::Thread( DialogHelper *pDialogHelper,
TheExtensionManager *pManager,
const uno::Reference< uno::XComponentContext > & rContext ) :
m_xContext( rContext ),
- m_pDialog( pDialog ),
+ m_pDialogHelper( pDialogHelper ),
m_pManager( pManager ),
- m_sEnablingPackages( ExtMgrDialog::getResourceString( RID_STR_ENABLING_PACKAGES ) ),
- m_sDisablingPackages( ExtMgrDialog::getResourceString( RID_STR_DISABLING_PACKAGES ) ),
- m_sAddingPackages( ExtMgrDialog::getResourceString( RID_STR_ADDING_PACKAGES ) ),
- m_sRemovingPackages( ExtMgrDialog::getResourceString( RID_STR_REMOVING_PACKAGES ) ),
- m_sDefaultCmd( ExtMgrDialog::getResourceString( RID_STR_ADD_PACKAGES ) ),
+ m_sEnablingPackages( DialogHelper::getResourceString( RID_STR_ENABLING_PACKAGES ) ),
+ m_sDisablingPackages( DialogHelper::getResourceString( RID_STR_DISABLING_PACKAGES ) ),
+ 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_eInput( NONE ),
m_bTerminated( false ),
m_bStopped( false ),
m_bWorking( false )
{
- OSL_ASSERT( pDialog );
+ OSL_ASSERT( pDialogHelper );
}
//------------------------------------------------------------------------------
@@ -713,41 +720,21 @@ void ExtensionCmdQueue::Thread::enableExtension( const uno::Reference< deploymen
}
//------------------------------------------------------------------------------
-void ExtensionCmdQueue::Thread::checkForUpdates( const uno::Sequence< uno::Reference< deployment::XPackageManager > > &rPackageManagers )
+void ExtensionCmdQueue::Thread::checkForUpdates( const std::vector< TUpdateListEntry > &vExtensionList )
{
::osl::MutexGuard aGuard( m_mutex );
- //If someone called stop then we do not remove the extension -> game over!
+ //If someone called stop then we do not update the extension -> game over!
if ( m_bStopped )
return;
- TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::CHECK_FOR_UPDATES, rPackageManagers ) );
+ TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::CHECK_FOR_UPDATES, vExtensionList ) );
m_queue.push( pEntry );
m_eInput = START;
m_wakeup.set();
}
//------------------------------------------------------------------------------
-void ExtensionCmdQueue::Thread::checkForUpdate( const uno::Reference< deployment::XPackageManager > &rPackageManager,
- 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 ( rPackageManager.is() && rPackage.is() )
- {
- TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::CHECK_FOR_UPDATE, rPackageManager, rPackage ) );
-
- m_queue.push( pEntry );
- m_eInput = START;
- m_wakeup.set();
- }
-}
-
-//------------------------------------------------------------------------------
//Stopping this thread will not abort the installation of extensions.
void ExtensionCmdQueue::Thread::stop()
{
@@ -779,7 +766,7 @@ void ExtensionCmdQueue::Thread::execute()
{
#ifdef WNT
//Needed for use of the service "com.sun.star.system.SystemShellExecute" in
- //ExtMgrDialog::openWebBrowser
+ //DialogHelper::openWebBrowser
CoUninitialize();
HRESULT r = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
#endif
@@ -813,7 +800,7 @@ void ExtensionCmdQueue::Thread::execute()
if ( eInput == STOP )
break;
- ::rtl::Reference< ProgressCmdEnv > currentCmdEnv( new ProgressCmdEnv( m_xContext, m_pDialog, m_sDefaultCmd ) );
+ ::rtl::Reference< ProgressCmdEnv > currentCmdEnv( new ProgressCmdEnv( m_xContext, m_pDialogHelper, m_sDefaultCmd ) );
// Do not lock the following part with addExtension. addExtension may be called in the main thread.
// If the message box "Do you want to install the extension (or similar)" is shown and then
@@ -836,8 +823,7 @@ void ExtensionCmdQueue::Thread::execute()
m_queue.pop();
}
- if ( bStartProgress && ( pEntry->m_eCmdType != ExtensionCmd::CHECK_FOR_UPDATE ) &&
- ( pEntry->m_eCmdType != ExtensionCmd::CHECK_FOR_UPDATES ) )
+ if ( bStartProgress && ( pEntry->m_eCmdType != ExtensionCmd::CHECK_FOR_UPDATES ) )
{
currentCmdEnv->startProgress();
bStartProgress = false;
@@ -856,9 +842,8 @@ void ExtensionCmdQueue::Thread::execute()
case ExtensionCmd::DISABLE :
_disableExtension( currentCmdEnv, pEntry->m_xPackage );
break;
- case ExtensionCmd::CHECK_FOR_UPDATE :
case ExtensionCmd::CHECK_FOR_UPDATES :
- _checkForUpdates( pEntry->m_xPackageManagers, pEntry->m_xPackageManager, pEntry->m_xPackage );
+ _checkForUpdates( pEntry->m_vExtensionList );
break;
}
}
@@ -908,7 +893,8 @@ void ExtensionCmdQueue::Thread::execute()
const ::vos::OGuard guard( Application::GetSolarMutex() );
::std::auto_ptr<ErrorBox> box(
new ErrorBox( currentCmdEnv->activeDialog(), WB_OK, msg ) );
- box->SetText( m_pDialog->GetText() );
+ if ( m_pDialogHelper )
+ box->SetText( m_pDialogHelper->getWindow()->GetText() );
box->Execute();
//Continue with installation of the remaining extensions
}
@@ -1009,21 +995,14 @@ void ExtensionCmdQueue::Thread::_removeExtension( ::rtl::Reference< ProgressCmdE
}
//------------------------------------------------------------------------------
-void ExtensionCmdQueue::Thread::_checkForUpdates( const uno::Sequence< uno::Reference< deployment::XPackageManager > > &rPackageManagers,
- const uno::Reference< deployment::XPackageManager > &xPackageManager,
- const uno::Reference< deployment::XPackage > &xPackage )
+void ExtensionCmdQueue::Thread::_checkForUpdates( const std::vector< TUpdateListEntry > &vExtensionList )
{
UpdateDialog* pUpdateDialog;
std::vector< UpdateData > vData;
const ::vos::OGuard guard( Application::GetSolarMutex() );
- if ( xPackageManager.is() && xPackage.is() )
- pUpdateDialog = new UpdateDialog( m_xContext, m_pDialog, new SelectedPackage( xPackage, xPackageManager ),
- uno::Sequence< uno::Reference< deployment::XPackageManager > >(), &vData );
- else
- pUpdateDialog = new UpdateDialog( m_xContext, m_pDialog, rtl::Reference< SelectedPackage >(),
- rPackageManagers, &vData );
+ pUpdateDialog = new UpdateDialog( m_xContext, m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, vExtensionList, &vData );
pUpdateDialog->notifyMenubar( true, false ); // prepare the checking, if there updates to be notified via menu bar icon
@@ -1046,7 +1025,7 @@ void ExtensionCmdQueue::Thread::_checkForUpdates( const uno::Sequence< uno::Refe
short nDialogResult = RET_OK;
if ( !dataDownload.empty() )
{
- nDialogResult = UpdateInstallDialog( m_pDialog, dataDownload, m_xContext ).Execute();
+ nDialogResult = UpdateInstallDialog( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, dataDownload, m_xContext ).Execute();
pUpdateDialog->notifyMenubar( false, true ); // Check, if there are still pending updates to be notified via menu bar icon
}
else
@@ -1057,8 +1036,8 @@ void ExtensionCmdQueue::Thread::_checkForUpdates( const uno::Sequence< uno::Refe
{
for ( cit i = vData.begin(); i < vData.end(); i++ )
{
- if ( i->sWebsiteURL.getLength() > 0 )
- m_pDialog->openWebBrowser( i->sWebsiteURL );
+ if ( m_pDialogHelper && ( i->sWebsiteURL.getLength() > 0 ) )
+ m_pDialogHelper->openWebBrowser( i->sWebsiteURL, m_pDialogHelper->getWindow()->GetText() );
}
}
}
@@ -1082,7 +1061,8 @@ void ExtensionCmdQueue::Thread::_enableExtension( ::rtl::Reference< ProgressCmdE
try
{
xPackage->registerPackage( xAbortChannel, rCmdEnv.get() );
- m_pDialog->updatePackageInfo( xPackage );
+ if ( m_pDialogHelper )
+ m_pDialogHelper->updatePackageInfo( xPackage );
}
catch ( ::ucb::CommandAbortedException & )
{}
@@ -1102,7 +1082,8 @@ void ExtensionCmdQueue::Thread::_disableExtension( ::rtl::Reference< ProgressCmd
try
{
xPackage->revokePackage( xAbortChannel, rCmdEnv.get() );
- m_pDialog->updatePackageInfo( xPackage );
+ if ( m_pDialogHelper )
+ m_pDialogHelper->updatePackageInfo( xPackage );
}
catch ( ::ucb::CommandAbortedException & )
{}
@@ -1139,10 +1120,10 @@ OUString ExtensionCmdQueue::Thread::searchAndReplaceAll( const OUString &rSource
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-ExtensionCmdQueue::ExtensionCmdQueue( ExtMgrDialog * pDialog,
+ExtensionCmdQueue::ExtensionCmdQueue( DialogHelper * pDialogHelper,
TheExtensionManager *pManager,
const uno::Reference< uno::XComponentContext > &rContext )
- : m_thread( new Thread( pDialog, pManager, rContext ) )
+ : m_thread( new Thread( pDialogHelper, pManager, rContext ) )
{
m_thread->launch();
}
@@ -1170,15 +1151,9 @@ void ExtensionCmdQueue::enableExtension( const uno::Reference< deployment::XPack
m_thread->enableExtension( rPackage, bEnable );
}
-void ExtensionCmdQueue::checkForUpdates( const uno::Sequence< uno::Reference< deployment::XPackageManager > > &rPackageManagers )
-{
- m_thread->checkForUpdates( rPackageManagers );
-}
-
-void ExtensionCmdQueue::checkForUpdate( const uno::Reference< deployment::XPackageManager > &rPackageManager,
- const uno::Reference< deployment::XPackage > &rPackage )
+void ExtensionCmdQueue::checkForUpdates( const std::vector< TUpdateListEntry > &vExtensionList )
{
- m_thread->checkForUpdate( rPackageManager, rPackage );
+ m_thread->checkForUpdates( vExtensionList );
}
void ExtensionCmdQueue::stop()
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx
index 06ecefd7749b..2d24f00e3c8e 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx
@@ -32,19 +32,14 @@
#ifndef INCLUDED_DP_GUI_EXTENSIONCMDQUEUE_HXX
#define INCLUDED_DP_GUI_EXTENSIONCMDQUEUE_HXX
-#ifndef _SAL_CONFIG_H_
#include "sal/config.h"
-#endif
-#ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_
#include "com/sun/star/uno/Reference.hxx"
-#endif
-#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
-#include "com/sun/star/uno/Sequence.hxx"
-#endif
-#ifndef _RTL_REF_HXX_
#include "rtl/ref.hxx"
-#endif
+
+#include <vector>
+
+#include "dp_gui_updatedata.hxx"
/// @HTML
@@ -56,7 +51,7 @@ namespace com { namespace sun { namespace star {
namespace dp_gui {
-class ExtMgrDialog;
+class DialogHelper;
class TheExtensionManager;
/**
@@ -79,7 +74,7 @@ public:
/**
Create an instance.
*/
- ExtensionCmdQueue( ExtMgrDialog * pDialog,
+ ExtensionCmdQueue( DialogHelper * pDialogHelper,
TheExtensionManager *pManager,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rContext);
@@ -94,9 +89,7 @@ public:
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 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > > &rPackageManagers );
- void checkForUpdate( 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 checkForUpdates( const std::vector< TUpdateListEntry > &vList );
/**
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
new file mode 100644
index 000000000000..f4473c2c6fd8
--- /dev/null
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -0,0 +1,1175 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_desktop.hxx"
+
+#include "svtools/controldims.hrc"
+
+#include "dp_gui.h"
+#include "dp_gui_extlistbox.hxx"
+#include "dp_gui_theextmgr.hxx"
+#include "dp_gui_dialog2.hxx"
+#include "dp_dependencies.hxx"
+
+#include "comphelper/processfactory.hxx"
+#include "com/sun/star/i18n/CollatorOptions.hpp"
+#include "com/sun/star/deployment/DependencyException.hpp"
+#include "com/sun/star/deployment/DeploymentException.hpp"
+
+
+#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
+
+using namespace ::com::sun::star;
+
+namespace dp_gui {
+
+//------------------------------------------------------------------------------
+// struct Entry_Impl
+//------------------------------------------------------------------------------
+Entry_Impl::Entry_Impl( const uno::Reference< deployment::XPackage > &xPackage,
+ const uno::Reference< deployment::XPackageManager > &xPackageManager,
+ PackageState eState ) :
+ m_bActive( false ),
+ m_bLocked( false ),
+ m_bHasOptions( false ),
+ m_bShared( false ),
+ m_bNew( false ),
+ m_bChecked( false ),
+ m_bMissingDeps( false ),
+ m_eState( eState ),
+ m_pPublisher( NULL ),
+ m_xPackage( xPackage ),
+ m_xPackageManager( xPackageManager )
+{
+ m_sTitle = xPackage->getDisplayName();
+ m_sVersion = xPackage->getVersion();
+ m_sDescription = xPackage->getDescription();
+
+ beans::StringPair aInfo( m_xPackage->getPublisherInfo() );
+ m_sPublisher = aInfo.First;
+ m_sPublisherURL = aInfo.Second;
+
+ // get the icons for the package if there are any
+ uno::Reference< graphic::XGraphic > xGraphic = xPackage->getIcon( false );
+ if ( xGraphic.is() )
+ m_aIcon = Image( xGraphic );
+
+ xGraphic = xPackage->getIcon( true );
+ if ( xGraphic.is() )
+ m_aIconHC = Image( xGraphic );
+ 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 )
+ checkDependencies();
+}
+
+//------------------------------------------------------------------------------
+Entry_Impl::~Entry_Impl()
+{}
+
+//------------------------------------------------------------------------------
+StringCompare Entry_Impl::CompareTo( const CollatorWrapper *pCollator, const TEntry_Impl pEntry ) const
+{
+ StringCompare eCompare = (StringCompare) pCollator->compareString( m_sTitle, pEntry->m_sTitle );
+ if ( eCompare == COMPARE_EQUAL )
+ {
+ 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;
+ }
+ }
+ }
+ return eCompare;
+}
+
+//------------------------------------------------------------------------------
+void Entry_Impl::checkDependencies()
+{
+ try {
+ m_xPackage->checkDependencies( uno::Reference< ucb::XCommandEnvironment >() );
+ }
+ catch ( deployment::DeploymentException &e )
+ {
+ deployment::DependencyException depExc;
+ if ( e.Cause >>= depExc )
+ {
+ rtl::OUString aMissingDep( DialogHelper::getResourceString( RID_STR_ERROR_MISSING_DEPENDENCIES ) );
+ for ( sal_Int32 i = 0; i < depExc.UnsatisfiedDependencies.getLength(); ++i )
+ {
+ aMissingDep += OUSTR("\n");
+ aMissingDep += dp_misc::Dependencies::getErrorText( depExc.UnsatisfiedDependencies[i]);
+ }
+ aMissingDep += OUSTR("\n");
+ m_sErrorText = aMissingDep;
+ m_bMissingDeps = true;
+ }
+ }
+}
+//------------------------------------------------------------------------------
+// ExtensionRemovedListener
+//------------------------------------------------------------------------------
+void ExtensionRemovedListener::disposing( lang::EventObject const & rEvt )
+ throw ( uno::RuntimeException )
+{
+ uno::Reference< deployment::XPackage > xPackage( rEvt.Source, uno::UNO_QUERY );
+
+ if ( xPackage.is() )
+ {
+ m_pParent->removeEntry( xPackage );
+ }
+}
+
+//------------------------------------------------------------------------------
+ExtensionRemovedListener::~ExtensionRemovedListener()
+{
+}
+
+//------------------------------------------------------------------------------
+// ExtensionBox_Impl
+//------------------------------------------------------------------------------
+ExtensionBox_Impl::ExtensionBox_Impl( Dialog* pParent, TheExtensionManager *pManager ) :
+ IExtensionListBox( pParent, WB_BORDER | WB_TABSTOP | WB_CHILDDLGCTRL ),
+ m_bHasScrollBar( false ),
+ m_bHasActive( false ),
+ m_bNeedsRecalc( true ),
+ m_bHasNew( false ),
+ m_bInCheckMode( false ),
+ m_bAdjustActive( false ),
+ m_bInDelete( false ),
+ m_nActive( 0 ),
+ m_nTopIndex( 0 ),
+ m_nActiveHeight( 0 ),
+ m_nExtraHeight( 2 ),
+ m_aLockedImage( DialogHelper::getResId( RID_IMG_LOCKED ) ),
+ m_aLockedImageHC( DialogHelper::getResId( RID_IMG_LOCKED_HC ) ),
+ m_aWarningImage( DialogHelper::getResId( RID_IMG_WARNING ) ),
+ m_aWarningImageHC( DialogHelper::getResId( RID_IMG_WARNING_HC ) ),
+ m_aDefaultImage( DialogHelper::getResId( RID_IMG_EXTENSION ) ),
+ m_aDefaultImageHC( DialogHelper::getResId( RID_IMG_EXTENSION_HC ) ),
+ m_pScrollBar( NULL ),
+ m_pManager( pManager )
+{
+ SetHelpId( HID_EXTENSION_MANAGER_LISTBOX );
+
+ m_pScrollBar = new ScrollBar( this, WB_VERT );
+ m_pScrollBar->SetScrollHdl( LINK( this, ExtensionBox_Impl, ScrollHdl ) );
+ m_pScrollBar->EnableDrag();
+
+ SetPaintTransparent( true );
+ SetPosPixel( Point( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP ) );
+ long nIconHeight = 2*TOP_OFFSET + SMALL_ICON_SIZE;
+ long nTitleHeight = 2*TOP_OFFSET + GetTextHeight();
+ if ( nIconHeight < nTitleHeight )
+ m_nStdHeight = nTitleHeight;
+ else
+ m_nStdHeight = nIconHeight;
+ m_nStdHeight += GetTextHeight() + TOP_OFFSET;
+
+ nIconHeight = ICON_HEIGHT + 2*TOP_OFFSET + 1;
+ if ( m_nStdHeight < nIconHeight )
+ m_nStdHeight = nIconHeight;
+
+ m_nActiveHeight = m_nStdHeight;
+
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ if( IsControlBackground() )
+ SetBackground( GetControlBackground() );
+ else
+ SetBackground( rStyleSettings.GetFieldColor() );
+
+ m_xRemoveListener = new ExtensionRemovedListener( this );
+
+ m_pLocale = new lang::Locale( Application::GetSettings().GetLocale() );
+ m_pCollator = new CollatorWrapper( ::comphelper::getProcessServiceFactory() );
+ m_pCollator->loadDefaultCollator( *m_pLocale, i18n::CollatorOptions::CollatorOptions_IGNORE_CASE );
+
+ Show();
+}
+
+//------------------------------------------------------------------------------
+ExtensionBox_Impl::~ExtensionBox_Impl()
+{
+ if ( ! m_bInDelete )
+ DeleteRemoved();
+
+ m_bInDelete = true;
+
+ typedef std::vector< TEntry_Impl >::iterator ITER;
+
+ for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+ {
+ if ( (*iIndex)->m_pPublisher )
+ {
+ delete (*iIndex)->m_pPublisher;
+ (*iIndex)->m_pPublisher = NULL;
+ }
+ (*iIndex)->m_xPackage->removeEventListener( uno::Reference< lang::XEventListener > ( m_xRemoveListener, uno::UNO_QUERY ) );
+ }
+
+ m_vEntries.clear();
+
+ delete m_pScrollBar;
+
+ m_xRemoveListener.clear();
+
+ delete m_pLocale;
+ delete m_pCollator;
+}
+
+//------------------------------------------------------------------------------
+sal_Int32 ExtensionBox_Impl::getItemCount() const
+{
+ return static_cast< sal_Int32 >( m_vEntries.size() );
+}
+
+//------------------------------------------------------------------------------
+sal_Int32 ExtensionBox_Impl::getSelIndex() const
+{
+ if ( m_bHasActive )
+ {
+ OSL_ASSERT( m_nActive >= -1);
+ return static_cast< sal_Int32 >( m_nActive );
+ }
+ else
+ return static_cast< sal_Int32 >( EXTENSION_LISTBOX_ENTRY_NOTFOUND );
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::checkIndex( sal_Int32 nIndex ) const
+{
+ if ( nIndex < 0 )
+ throw lang::IllegalArgumentException( OUSTR("The list index starts with 0"),0, 0 );
+ if ( static_cast< sal_uInt32 >( nIndex ) >= m_vEntries.size())
+ throw lang::IllegalArgumentException( OUSTR("There is no element at the provided position."
+ "The position exceeds the number of available list entries"),0, 0 );
+}
+
+//------------------------------------------------------------------------------
+rtl::OUString ExtensionBox_Impl::getItemName( sal_Int32 nIndex ) const
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+ checkIndex( nIndex );
+ return m_vEntries[ nIndex ]->m_sTitle;
+}
+
+//------------------------------------------------------------------------------
+rtl::OUString ExtensionBox_Impl::getItemVersion( sal_Int32 nIndex ) const
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+ checkIndex( nIndex );
+ return m_vEntries[ nIndex ]->m_sVersion;
+}
+
+//------------------------------------------------------------------------------
+rtl::OUString ExtensionBox_Impl::getItemDescription( sal_Int32 nIndex ) const
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+ checkIndex( nIndex );
+ return m_vEntries[ nIndex ]->m_sDescription;
+}
+
+//------------------------------------------------------------------------------
+rtl::OUString ExtensionBox_Impl::getItemPublisher( sal_Int32 nIndex ) const
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+ checkIndex( nIndex );
+ return m_vEntries[ nIndex ]->m_sPublisher;
+}
+
+//------------------------------------------------------------------------------
+rtl::OUString ExtensionBox_Impl::getItemPublisherLink( sal_Int32 nIndex ) const
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+ checkIndex( nIndex );
+ return m_vEntries[ nIndex ]->m_sPublisherURL;
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::select( sal_Int32 nIndex )
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+ checkIndex( nIndex );
+ selectEntry( nIndex );
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::select( const rtl::OUString & sName )
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+ typedef ::std::vector< TEntry_Impl >::const_iterator It;
+
+ for ( It iIter = m_vEntries.begin(); iIter < m_vEntries.end(); iIter++ )
+ {
+ if ( sName.equals( (*iIter)->m_sTitle ) )
+ {
+ long nPos = iIter - m_vEntries.begin();
+ selectEntry( nPos );
+ break;
+ }
+ }
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+// Title + description
+void ExtensionBox_Impl::CalcActiveHeight( const long nPos )
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+
+ // get title height
+ long aTextHeight;
+ long nIconHeight = 2*TOP_OFFSET + SMALL_ICON_SIZE;
+ long nTitleHeight = 2*TOP_OFFSET + GetTextHeight();
+ if ( nIconHeight < nTitleHeight )
+ aTextHeight = nTitleHeight;
+ else
+ aTextHeight = nIconHeight;
+
+ // calc description height
+ Size aSize = GetOutputSizePixel();
+ if ( m_bHasScrollBar )
+ aSize.Width() -= m_pScrollBar->GetSizePixel().Width();
+
+ aSize.Width() -= ICON_OFFSET;
+ aSize.Height() = 10000;
+
+ rtl::OUString aText( m_vEntries[ nPos ]->m_sErrorText );
+ aText += m_vEntries[ nPos ]->m_sDescription;
+
+ Rectangle aRect = GetTextRect( Rectangle( Point(), aSize ), aText,
+ TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
+ aTextHeight += aRect.GetHeight();
+
+ if ( aTextHeight < m_nStdHeight )
+ aTextHeight = m_nStdHeight;
+
+ m_nActiveHeight = aTextHeight + m_nExtraHeight;
+}
+
+//------------------------------------------------------------------------------
+const Size ExtensionBox_Impl::GetMinOutputSizePixel() const
+{
+ return Size( 200, 80 );
+}
+
+//------------------------------------------------------------------------------
+Rectangle ExtensionBox_Impl::GetEntryRect( const long nPos ) const
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+
+ Size aSize( GetOutputSizePixel() );
+
+ if ( m_bHasScrollBar )
+ aSize.Width() -= m_pScrollBar->GetSizePixel().Width();
+
+ if ( m_vEntries[ nPos ]->m_bActive )
+ aSize.Height() = m_nActiveHeight;
+ else
+ aSize.Height() = m_nStdHeight;
+
+ Point aPos( 0, -m_nTopIndex + nPos * m_nStdHeight );
+ if ( m_bHasActive && ( nPos < m_nActive ) )
+ aPos.Y() += m_nActiveHeight - m_nStdHeight;
+
+ return Rectangle( aPos, aSize );
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::DeleteRemoved()
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+
+ m_bInDelete = true;
+
+ if ( ! m_vRemovedEntries.empty() )
+ {
+ typedef std::vector< TEntry_Impl >::iterator ITER;
+
+ for ( ITER iIndex = m_vRemovedEntries.begin(); iIndex < m_vRemovedEntries.end(); ++iIndex )
+ {
+ if ( (*iIndex)->m_pPublisher )
+ {
+ delete (*iIndex)->m_pPublisher;
+ (*iIndex)->m_pPublisher = NULL;
+ }
+ }
+
+ m_vRemovedEntries.clear();
+ }
+
+ m_bInDelete = false;
+}
+
+//------------------------------------------------------------------------------
+//This function may be called with nPos < 0
+void ExtensionBox_Impl::selectEntry( const long nPos )
+{
+ //ToDo whe should not use the guard at such a big scope here.
+ //Currently it is used to gard m_vEntries and m_nActive. m_nActive will be
+ //modified in this function.
+ //It would be probably best to always use a copy of m_vEntries
+ //and some other state variables from ExtensionBox_Impl for
+ //the whole painting operation. See issue i86993
+ ::osl::ClearableMutexGuard guard(m_entriesMutex);
+
+ if ( m_bInCheckMode )
+ return;
+
+ if ( m_bHasActive )
+ {
+ if ( nPos == m_nActive )
+ return;
+
+ m_bHasActive = false;
+ m_vEntries[ m_nActive ]->m_bActive = false;
+ }
+
+ if ( ( nPos >= 0 ) && ( nPos < (long) m_vEntries.size() ) )
+ {
+ m_bHasActive = true;
+ m_nActive = nPos;
+ m_vEntries[ nPos ]->m_bActive = true;
+
+ if ( IsReallyVisible() )
+ {
+ m_bNeedsRecalc = true;
+ m_bAdjustActive = true;
+ }
+ }
+
+ if ( IsReallyVisible() )
+ Invalidate();
+
+ guard.clear();
+}
+
+// -----------------------------------------------------------------------
+void ExtensionBox_Impl::DrawRow( const Rectangle& rRect, const TEntry_Impl pEntry )
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
+ if ( pEntry->m_bActive )
+ SetTextColor( rStyleSettings.GetHighlightTextColor() );
+ else if ( ( pEntry->m_eState != REGISTERED ) && ( pEntry->m_eState != NOT_AVAILABLE ) )
+ SetTextColor( rStyleSettings.GetDisableColor() );
+ else if ( IsControlForeground() )
+ SetTextColor( GetControlForeground() );
+ else
+ SetTextColor( rStyleSettings.GetFieldTextColor() );
+
+ if ( pEntry->m_bActive )
+ {
+ SetLineColor();
+ SetFillColor( rStyleSettings.GetHighlightColor() );
+ DrawRect( rRect );
+ }
+ else
+ {
+ if( IsControlBackground() )
+ SetBackground( GetControlBackground() );
+ else
+ SetBackground( rStyleSettings.GetFieldColor() );
+
+ SetTextFillColor();
+ Erase( rRect );
+ }
+
+ // Draw extension icon
+ Point aPos( rRect.TopLeft() );
+ aPos += Point( TOP_OFFSET, TOP_OFFSET );
+ Image aImage;
+ if ( ! pEntry->m_aIcon )
+ aImage = isHCMode() ? m_aDefaultImageHC : m_aDefaultImage;
+ else
+ aImage = isHCMode() ? pEntry->m_aIconHC : pEntry->m_aIcon;
+ Size aImageSize = aImage.GetSizePixel();
+ if ( ( aImageSize.Width() <= ICON_HEIGHT ) && ( aImageSize.Height() <= ICON_HEIGHT ) )
+ DrawImage( Point( aPos.X()+((ICON_HEIGHT-aImageSize.Width())/2), aPos.Y()+((ICON_HEIGHT-aImageSize.Height())/2) ), aImage );
+ else
+ DrawImage( aPos, Size( ICON_HEIGHT, ICON_HEIGHT ), aImage );
+
+ // Setup fonts
+ Font aStdFont( GetFont() );
+ Font aBoldFont( aStdFont );
+ aBoldFont.SetWeight( WEIGHT_BOLD );
+ SetFont( aBoldFont );
+ long aTextHeight = GetTextHeight();
+
+ // Init publisher link here
+ if ( !pEntry->m_pPublisher && pEntry->m_sPublisher.Len() )
+ {
+ pEntry->m_pPublisher = new svt::FixedHyperlink( this );
+ pEntry->m_pPublisher->SetBackground();
+ pEntry->m_pPublisher->SetPaintTransparent( true );
+ pEntry->m_pPublisher->SetURL( pEntry->m_sPublisherURL );
+ pEntry->m_pPublisher->SetDescription( pEntry->m_sPublisher );
+ Size aSize = FixedText::CalcMinimumTextSize( pEntry->m_pPublisher );
+ pEntry->m_pPublisher->SetSizePixel( aSize );
+
+ if ( m_aClickHdl.IsSet() )
+ pEntry->m_pPublisher->SetClickHdl( m_aClickHdl );
+ }
+
+ // Get max title width
+ long nMaxTitleWidth = rRect.GetWidth() - ICON_OFFSET;
+ nMaxTitleWidth -= ( 2 * SMALL_ICON_SIZE ) + ( 4 * SPACE_BETWEEN );
+ if ( pEntry->m_pPublisher )
+ {
+ nMaxTitleWidth -= pEntry->m_pPublisher->GetSizePixel().Width() + (2*SPACE_BETWEEN);
+ }
+
+ long aVersionWidth = GetTextWidth( pEntry->m_sVersion );
+ long aTitleWidth = GetTextWidth( pEntry->m_sTitle ) + (aTextHeight / 3);
+
+ aPos = rRect.TopLeft() + Point( ICON_OFFSET, TOP_OFFSET );
+
+ if ( aTitleWidth > nMaxTitleWidth - aVersionWidth )
+ {
+ aTitleWidth = nMaxTitleWidth - aVersionWidth - (aTextHeight / 3);
+ String aShortTitle = GetEllipsisString( pEntry->m_sTitle, aTitleWidth );
+ DrawText( aPos, aShortTitle );
+ aTitleWidth += (aTextHeight / 3);
+ }
+ else
+ DrawText( aPos, pEntry->m_sTitle );
+
+ SetFont( aStdFont );
+ DrawText( Point( aPos.X() + aTitleWidth, aPos.Y() ), pEntry->m_sVersion );
+
+ long nIconHeight = TOP_OFFSET + SMALL_ICON_SIZE;
+ long nTitleHeight = TOP_OFFSET + GetTextHeight();
+ if ( nIconHeight < nTitleHeight )
+ aTextHeight = nTitleHeight;
+ else
+ aTextHeight = nIconHeight;
+
+ // draw description
+ String sDescription;
+ if ( pEntry->m_sErrorText.Len() )
+ {
+ if ( pEntry->m_bActive )
+ sDescription = pEntry->m_sErrorText + OUSTR("\n") + pEntry->m_sDescription;
+ else
+ sDescription = pEntry->m_sErrorText;
+ }
+ else
+ sDescription = pEntry->m_sDescription;
+
+ aPos.Y() += aTextHeight;
+ if ( pEntry->m_bActive )
+ {
+ DrawText( Rectangle( aPos.X(), aPos.Y(), rRect.Right(), rRect.Bottom() - m_nExtraHeight ),
+ sDescription, TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
+ }
+ else
+ {
+ const long nWidth = GetTextWidth( sDescription );
+ if ( nWidth > rRect.GetWidth() - aPos.X() )
+ sDescription = GetEllipsisString( sDescription, rRect.GetWidth() - aPos.X() );
+ DrawText( aPos, sDescription );
+ }
+
+ // Draw publisher link
+ if ( pEntry->m_pPublisher )
+ {
+ pEntry->m_pPublisher->Show();
+ aPos = rRect.TopLeft() + Point( ICON_OFFSET + nMaxTitleWidth + (2*SPACE_BETWEEN), TOP_OFFSET );
+ pEntry->m_pPublisher->SetPosPixel( aPos );
+ }
+
+ // Draw status icons
+ if ( pEntry->m_bShared )
+ {
+ 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_eState == AMBIGUOUS ) || pEntry->m_bMissingDeps )
+ {
+ 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 );
+ }
+
+ SetLineColor( Color( COL_LIGHTGRAY ) );
+ DrawLine( rRect.BottomLeft(), rRect.BottomRight() );
+}
+
+// -----------------------------------------------------------------------
+void ExtensionBox_Impl::RecalcAll()
+{
+ if ( m_bHasActive )
+ CalcActiveHeight( m_nActive );
+
+ SetupScrollBar();
+
+ if ( m_bHasActive )
+ {
+ Rectangle aEntryRect = GetEntryRect( m_nActive );
+
+ if ( m_bAdjustActive )
+ {
+ m_bAdjustActive = false;
+
+ // If the top of the selected entry isn't visible, make it visible
+ if ( aEntryRect.Top() < 0 )
+ {
+ m_nTopIndex += aEntryRect.Top();
+ aEntryRect.Move( 0, -aEntryRect.Top() );
+ }
+
+ // If the bottom of the selected entry isn't visible, make it visible even if now the top
+ // isn't visible any longer ( the buttons are more important )
+ Size aOutputSize = GetOutputSizePixel();
+ if ( aEntryRect.Bottom() > aOutputSize.Height() )
+ {
+ m_nTopIndex += ( aEntryRect.Bottom() - aOutputSize.Height() );
+ aEntryRect.Move( 0, -( aEntryRect.Bottom() - aOutputSize.Height() ) );
+ }
+
+ // If there is unused space below the last entry but all entries don't fit into the box,
+ // move the content down to use the whole space
+ const long nTotalHeight = GetTotalHeight();
+ if ( m_bHasScrollBar && ( aOutputSize.Height() + m_nTopIndex > nTotalHeight ) )
+ {
+ long nOffset = m_nTopIndex;
+ m_nTopIndex = nTotalHeight - aOutputSize.Height();
+ nOffset -= m_nTopIndex;
+ aEntryRect.Move( 0, nOffset );
+ }
+
+ if ( m_bHasScrollBar )
+ m_pScrollBar->SetThumbPos( m_nTopIndex );
+ }
+ }
+
+ m_bNeedsRecalc = false;
+}
+
+// -----------------------------------------------------------------------
+bool ExtensionBox_Impl::HandleTabKey( bool )
+{
+ return false;
+}
+
+// -----------------------------------------------------------------------
+bool ExtensionBox_Impl::HandleCursorKey( USHORT nKeyCode )
+{
+ if ( m_vEntries.empty() )
+ return true;
+
+ long nSelect = 0;
+
+ if ( m_bHasActive )
+ {
+ long nPageSize = GetOutputSizePixel().Height() / m_nStdHeight;
+ if ( nPageSize < 2 )
+ nPageSize = 2;
+
+ if ( ( nKeyCode == KEY_DOWN ) || ( nKeyCode == KEY_RIGHT ) )
+ nSelect = m_nActive + 1;
+ else if ( ( nKeyCode == KEY_UP ) || ( nKeyCode == KEY_LEFT ) )
+ nSelect = m_nActive - 1;
+ else if ( nKeyCode == KEY_HOME )
+ nSelect = 0;
+ else if ( nKeyCode == KEY_END )
+ nSelect = m_vEntries.size() - 1;
+ else if ( nKeyCode == KEY_PAGEUP )
+ nSelect = m_nActive - nPageSize + 1;
+ else if ( nKeyCode == KEY_PAGEDOWN )
+ nSelect = m_nActive + nPageSize - 1;
+ }
+ else // when there is no selected entry, we will select the first or the last.
+ {
+ if ( ( nKeyCode == KEY_DOWN ) || ( nKeyCode == KEY_PAGEDOWN ) || ( nKeyCode == KEY_HOME ) )
+ nSelect = 0;
+ else if ( ( nKeyCode == KEY_UP ) || ( nKeyCode == KEY_PAGEUP ) || ( nKeyCode == KEY_END ) )
+ nSelect = m_vEntries.size() - 1;
+ }
+
+ if ( nSelect < 0 )
+ nSelect = 0;
+ if ( nSelect >= (long) m_vEntries.size() )
+ nSelect = m_vEntries.size() - 1;
+
+ selectEntry( nSelect );
+
+ return true;
+}
+
+// -----------------------------------------------------------------------
+void ExtensionBox_Impl::Paint( const Rectangle &/*rPaintRect*/ )
+{
+ if ( !m_bInDelete )
+ DeleteRemoved();
+
+ if ( m_bNeedsRecalc )
+ RecalcAll();
+
+ Point aStart( 0, -m_nTopIndex );
+ Size aSize( GetOutputSizePixel() );
+
+ if ( m_bHasScrollBar )
+ aSize.Width() -= m_pScrollBar->GetSizePixel().Width();
+
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+
+ typedef std::vector< TEntry_Impl >::iterator ITER;
+ for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+ {
+ aSize.Height() = (*iIndex)->m_bActive ? m_nActiveHeight : m_nStdHeight;
+ Rectangle aEntryRect( aStart, aSize );
+ DrawRow( aEntryRect, *iIndex );
+ aStart.Y() += aSize.Height();
+ }
+}
+
+// -----------------------------------------------------------------------
+long ExtensionBox_Impl::GetTotalHeight() const
+{
+ long nHeight = m_vEntries.size() * m_nStdHeight;
+
+ if ( m_bHasActive )
+ {
+ nHeight += m_nActiveHeight - m_nStdHeight;
+ }
+
+ return nHeight;
+}
+
+// -----------------------------------------------------------------------
+void ExtensionBox_Impl::SetupScrollBar()
+{
+ const Size aSize = GetOutputSizePixel();
+ const long nScrBarSize = GetSettings().GetStyleSettings().GetScrollBarSize();
+ const long nTotalHeight = GetTotalHeight();
+ const bool bNeedsScrollBar = ( nTotalHeight > aSize.Height() );
+
+ if ( bNeedsScrollBar )
+ {
+ if ( m_nTopIndex + aSize.Height() > nTotalHeight )
+ m_nTopIndex = nTotalHeight - aSize.Height();
+
+ m_pScrollBar->SetPosSizePixel( Point( aSize.Width() - nScrBarSize, 0 ),
+ Size( nScrBarSize, aSize.Height() ) );
+ m_pScrollBar->SetRangeMax( nTotalHeight );
+ m_pScrollBar->SetVisibleSize( aSize.Height() );
+ m_pScrollBar->SetPageSize( ( aSize.Height() * 4 ) / 5 );
+ m_pScrollBar->SetLineSize( m_nStdHeight );
+ m_pScrollBar->SetThumbPos( m_nTopIndex );
+
+ if ( !m_bHasScrollBar )
+ m_pScrollBar->Show();
+ }
+ else if ( m_bHasScrollBar )
+ {
+ m_pScrollBar->Hide();
+ m_nTopIndex = 0;
+ }
+
+ m_bHasScrollBar = bNeedsScrollBar;
+}
+
+// -----------------------------------------------------------------------
+void ExtensionBox_Impl::Resize()
+{
+ RecalcAll();
+}
+
+//------------------------------------------------------------------------------
+long ExtensionBox_Impl::PointToPos( const Point& rPos )
+{
+ long nPos = ( rPos.Y() + m_nTopIndex ) / m_nStdHeight;
+
+ if ( m_bHasActive && ( nPos > m_nActive ) )
+ {
+ if ( rPos.Y() + m_nTopIndex <= m_nActive*m_nStdHeight + m_nActiveHeight )
+ nPos = m_nActive;
+ else
+ nPos = ( rPos.Y() + m_nTopIndex - (m_nActiveHeight - m_nStdHeight) ) / m_nStdHeight;
+ }
+
+ return nPos;
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ long nPos = PointToPos( rMEvt.GetPosPixel() );
+
+ if ( rMEvt.IsLeft() )
+ {
+ if ( rMEvt.IsMod1() && m_bHasActive )
+ selectEntry( m_vEntries.size() ); // Selecting an not existing entry will deselect the current one
+ else
+ selectEntry( nPos );
+ }
+}
+
+//------------------------------------------------------------------------------
+long ExtensionBox_Impl::Notify( NotifyEvent& rNEvt )
+{
+ if ( !m_bInDelete )
+ DeleteRemoved();
+
+ bool bHandled = false;
+
+ if ( rNEvt.GetType() == EVENT_KEYINPUT )
+ {
+ const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
+ KeyCode aKeyCode = pKEvt->GetKeyCode();
+ USHORT nKeyCode = aKeyCode.GetCode();
+
+ if ( nKeyCode == KEY_TAB )
+ bHandled = HandleTabKey( aKeyCode.IsShift() );
+ else if ( aKeyCode.GetGroup() == KEYGROUP_CURSOR )
+ bHandled = HandleCursorKey( nKeyCode );
+ }
+
+ if ( rNEvt.GetType() == EVENT_COMMAND )
+ {
+ if ( m_bHasScrollBar &&
+ ( rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL ) )
+ {
+ const CommandWheelData* pData = rNEvt.GetCommandEvent()->GetWheelData();
+ if ( pData->GetMode() == COMMAND_WHEEL_SCROLL )
+ {
+ long nThumbPos = m_pScrollBar->GetThumbPos();
+ if ( pData->GetDelta() < 0 )
+ m_pScrollBar->DoScroll( nThumbPos + m_nStdHeight );
+ else
+ m_pScrollBar->DoScroll( nThumbPos - m_nStdHeight );
+ bHandled = true;
+ }
+ }
+ }
+
+ if ( !bHandled )
+ return Control::Notify( rNEvt );
+ else
+ return true;
+}
+
+//------------------------------------------------------------------------------
+bool ExtensionBox_Impl::FindEntryPos( const TEntry_Impl pEntry, const long nStart,
+ const long nEnd, long &nPos )
+{
+ nPos = nStart;
+ if ( nStart > nEnd )
+ return false;
+
+ StringCompare eCompare;
+
+ if ( nStart == nEnd )
+ {
+ eCompare = pEntry->CompareTo( m_pCollator, m_vEntries[ nStart ] );
+ if ( eCompare == COMPARE_LESS )
+ return false;
+ else if ( eCompare == COMPARE_EQUAL )
+ {
+ //Workaround. See i86963.
+ if (pEntry->m_xPackage != m_vEntries[nStart]->m_xPackage)
+ return false;
+
+ if ( m_bInCheckMode )
+ m_vEntries[ nStart ]->m_bChecked = true;
+ return true;
+ }
+ else
+ {
+ nPos = nStart + 1;
+ return false;
+ }
+ }
+
+ const long nMid = nStart + ( ( nEnd - nStart ) / 2 );
+ eCompare = pEntry->CompareTo( m_pCollator, m_vEntries[ nMid ] );
+
+ if ( eCompare == COMPARE_LESS )
+ return FindEntryPos( pEntry, nStart, nMid-1, nPos );
+ else if ( eCompare == COMPARE_GREATER )
+ return FindEntryPos( pEntry, nMid+1, nEnd, nPos );
+ else
+ {
+ //Workaround.See i86963.
+ if (pEntry->m_xPackage != m_vEntries[nMid]->m_xPackage)
+ return false;
+
+ if ( m_bInCheckMode )
+ m_vEntries[ nMid ]->m_bChecked = true;
+ nPos = nMid;
+ return true;
+ }
+}
+
+//------------------------------------------------------------------------------
+long ExtensionBox_Impl::addEntry( const uno::Reference< deployment::XPackage > &xPackage,
+ const uno::Reference< deployment::XPackageManager > &xPackageManager )
+{
+ long nPos = 0;
+ PackageState eState = m_pManager->getPackageState( xPackage );
+
+ TEntry_Impl pEntry( new Entry_Impl( xPackage, xPackageManager, eState ) );
+ 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 )
+ {
+ OSL_ENSURE( 0, "ExtensionBox_Impl::addEntry(): Will not add duplicate entries" );
+ }
+ }
+ //access to m_nActive must be guarded
+ if ( !m_bInCheckMode && m_bHasActive && ( m_nActive >= nPos ) )
+ m_nActive += 1;
+
+ guard.clear();
+
+ if ( IsReallyVisible() )
+ Invalidate();
+
+ m_bNeedsRecalc = true;
+
+ return nPos;
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::updateEntry( const uno::Reference< deployment::XPackage > &xPackage )
+{
+ typedef std::vector< TEntry_Impl >::iterator ITER;
+ for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+ {
+ if ( (*iIndex)->m_xPackage == xPackage )
+ {
+ PackageState eState = m_pManager->getPackageState( xPackage );
+ (*iIndex)->m_bHasOptions = m_pManager->supportsOptions( xPackage );
+ (*iIndex)->m_eState = eState;
+ (*iIndex)->m_sTitle = xPackage->getDisplayName();
+ (*iIndex)->m_sVersion = xPackage->getVersion();
+ (*iIndex)->m_sDescription = xPackage->getDescription();
+
+ if ( eState == AMBIGUOUS )
+ (*iIndex)->m_sErrorText = DialogHelper::getResourceString( RID_STR_ERROR_UNKNOWN_STATUS );
+ else
+ (*iIndex)->m_sErrorText = String();
+
+ if ( IsReallyVisible() )
+ Invalidate();
+ break;
+ }
+ }
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::removeEntry( const uno::Reference< deployment::XPackage > &xPackage )
+{
+ if ( ! m_bInDelete )
+ {
+ ::osl::ClearableMutexGuard aGuard( m_entriesMutex );
+
+ typedef std::vector< TEntry_Impl >::iterator ITER;
+
+ for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+ {
+ if ( (*iIndex)->m_xPackage == xPackage )
+ {
+ long nPos = iIndex - m_vEntries.begin();
+
+ // Entries mustn't removed here, because they contain a hyperlink control
+ // which can only be deleted when the thread has the solar mutex. Therefor
+ // the entry will be moved into the m_vRemovedEntries list which will be
+ // cleared on the next paint event
+ m_vRemovedEntries.push_back( *iIndex );
+ m_vEntries.erase( iIndex );
+
+ m_bNeedsRecalc = true;
+
+ if ( IsReallyVisible() )
+ Invalidate();
+
+ if ( m_bHasActive )
+ {
+ if ( nPos < m_nActive )
+ m_nActive -= 1;
+ else if ( ( nPos == m_nActive ) &&
+ ( nPos == (long) m_vEntries.size() ) )
+ m_nActive -= 1;
+
+ m_bHasActive = false;
+ //clear before calling out of this method
+ aGuard.clear();
+ selectEntry( m_nActive );
+ }
+ break;
+ }
+ }
+ }
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::RemoveUnlocked()
+{
+ bool bAllRemoved = false;
+
+ while ( ! bAllRemoved )
+ {
+ bAllRemoved = true;
+
+ ::osl::ClearableMutexGuard aGuard( m_entriesMutex );
+
+ typedef std::vector< TEntry_Impl >::iterator ITER;
+
+ for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+ {
+ if ( !(*iIndex)->m_bLocked )
+ {
+ bAllRemoved = false;
+ uno::Reference< deployment::XPackage> xPackage = (*iIndex)->m_xPackage;
+ aGuard.clear();
+ removeEntry( xPackage );
+ break;
+ }
+ }
+ }
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::prepareChecking( const uno::Reference< deployment::XPackageManager > &xPackageMgr )
+{
+ 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_bNew = false;
+ }
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::checkEntries()
+{
+ long nNewPos = -1;
+ long nPos = 0;
+ bool bNeedsUpdate = false;
+
+ ::osl::ClearableMutexGuard guard(m_entriesMutex);
+ typedef std::vector< TEntry_Impl >::iterator ITER;
+ ITER iIndex = m_vEntries.begin();
+ while ( iIndex < m_vEntries.end() )
+ {
+ if ( (*iIndex)->m_bChecked == false )
+ {
+ bNeedsUpdate = true;
+ nPos = iIndex-m_vEntries.begin();
+ if ( (*iIndex)->m_bNew )
+ {
+ if ( nNewPos == - 1)
+ nNewPos = nPos;
+ if ( nPos <= m_nActive )
+ m_nActive += 1;
+ }
+ }
+ iIndex++;
+ }
+ guard.clear();
+
+ m_bInCheckMode = false;
+
+ if ( nNewPos != - 1)
+ selectEntry( nNewPos );
+
+ if ( bNeedsUpdate )
+ {
+ m_bNeedsRecalc = true;
+ if ( IsReallyVisible() )
+ Invalidate();
+ }
+}
+//------------------------------------------------------------------------------
+bool ExtensionBox_Impl::isHCMode()
+{
+ return (bool)GetDisplayBackground().GetColor().IsDark();
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::SetScrollHdl( const Link& rLink )
+{
+ if ( m_pScrollBar )
+ m_pScrollBar->SetScrollHdl( rLink );
+}
+
+// -----------------------------------------------------------------------
+void ExtensionBox_Impl::DoScroll( long nDelta )
+{
+ m_nTopIndex += nDelta;
+ Point aNewSBPt( m_pScrollBar->GetPosPixel() );
+
+ Rectangle aScrRect( Point(), GetOutputSizePixel() );
+ aScrRect.Right() -= m_pScrollBar->GetSizePixel().Width();
+ Scroll( 0, -nDelta, aScrRect );
+
+ m_pScrollBar->SetPosPixel( aNewSBPt );
+}
+
+// -----------------------------------------------------------------------
+IMPL_LINK( ExtensionBox_Impl, ScrollHdl, ScrollBar*, pScrBar )
+{
+ DoScroll( pScrBar->GetDelta() );
+
+ return 1;
+}
+
+} //namespace dp_gui
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
new file mode 100644
index 000000000000..e1a17bb06dc9
--- /dev/null
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
@@ -0,0 +1,271 @@
+/*************************************************************************
+ *
+ * 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_gui_dialog2.cxx,v $
+ *
+ * $Revision: 1.8.4.8 $
+ *
+ * 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 "rtl/ustring.hxx"
+#include "vcl/scrbar.hxx"
+#include "vcl/fixed.hxx"
+#include "vcl/dialog.hxx"
+
+#include "svtools/extensionlistbox.hxx"
+#include "svtools/fixedhyper.hxx"
+#include "cppuhelper/implbase1.hxx"
+#include "unotools/collatorwrapper.hxx"
+
+#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>
+
+namespace dp_gui {
+
+#define SMALL_ICON_SIZE 16
+#define TOP_OFFSET 3
+#define ICON_HEIGHT 42
+#define ICON_OFFSET 50
+#define RIGHT_ICON_OFFSET 5
+#define SPACE_BETWEEN 3
+
+class TheExtensionManager;
+
+typedef ::boost::shared_ptr< svt::FixedHyperlink > TFixedHyperlink;
+
+//------------------------------------------------------------------------------
+// struct Entry_Impl
+//------------------------------------------------------------------------------
+struct Entry_Impl;
+
+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;
+ PackageState m_eState;
+ String m_sTitle;
+ String m_sVersion;
+ String m_sDescription;
+ String m_sPublisher;
+ String m_sPublisherURL;
+ String m_sErrorText;
+ Image m_aIcon;
+ Image m_aIconHC;
+ 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 );
+ ~Entry_Impl();
+
+ StringCompare CompareTo( const CollatorWrapper *pCollator, const TEntry_Impl pEntry ) const;
+ void checkDependencies();
+};
+
+//------------------------------------------------------------------------------
+// class ExtensionBox_Impl
+//------------------------------------------------------------------------------
+
+class ExtensionBox_Impl;
+
+//------------------------------------------------------------------------------
+class ExtensionRemovedListener : public ::cppu::WeakImplHelper1< ::com::sun::star::lang::XEventListener >
+{
+ ExtensionBox_Impl *m_pParent;
+
+public:
+
+ ExtensionRemovedListener( ExtensionBox_Impl *pParent ) { m_pParent = pParent; }
+ ~ExtensionRemovedListener();
+
+ //===================================================================================
+ // XEventListener
+ virtual void SAL_CALL disposing( ::com::sun::star::lang::EventObject const & evt )
+ throw (::com::sun::star::uno::RuntimeException);
+};
+
+//------------------------------------------------------------------------------
+class ExtensionBox_Impl : public ::svt::IExtensionListBox
+{
+ bool m_bHasScrollBar;
+ bool m_bHasActive;
+ bool m_bNeedsRecalc;
+ bool m_bHasNew;
+ bool m_bInCheckMode;
+ bool m_bAdjustActive;
+ bool m_bInDelete;
+ //Must be guarded together with m_vEntries to ensure a valid index at all times.
+ //Use m_entriesMutex as guard.
+ long m_nActive;
+ long m_nTopIndex;
+ long m_nStdHeight;
+ long m_nActiveHeight;
+ long m_nExtraHeight;
+ Size m_aOutputSize;
+ Image m_aLockedImage;
+ Image m_aLockedImageHC;
+ Image m_aWarningImage;
+ Image m_aWarningImageHC;
+ Image m_aDefaultImage;
+ Image m_aDefaultImageHC;
+ Link m_aClickHdl;
+
+ ScrollBar *m_pScrollBar;
+
+ com::sun::star::uno::Reference< ExtensionRemovedListener > m_xRemoveListener;
+
+ TheExtensionManager *m_pManager;
+ //This mutex is used for synchronizing access to m_vEntries.
+ //Currently it is used to synchronize adding, removing entries and
+ //functions like getItemName, getItemDescription, etc. to prevent
+ //that m_vEntries is accessed at an invalid index.
+ //ToDo: There are many more places where m_vEntries is read and which may
+ //fail. For example the Paint method is probable called from the main thread
+ //while new entries are added / removed in a separate thread.
+ mutable ::osl::Mutex m_entriesMutex;
+ std::vector< TEntry_Impl > m_vEntries;
+ std::vector< TEntry_Impl > m_vRemovedEntries;
+
+ ::com::sun::star::lang::Locale *m_pLocale;
+ CollatorWrapper *m_pCollator;
+
+ void CalcActiveHeight( const long nPos );
+ long GetTotalHeight() const;
+ void SetupScrollBar();
+ void DrawRow( const Rectangle& rRect, const TEntry_Impl pEntry );
+ bool HandleTabKey( bool bReverse );
+ bool HandleCursorKey( USHORT nKeyCode );
+ bool FindEntryPos( const TEntry_Impl pEntry, long nStart, long nEnd, long &nFound );
+ bool isHCMode();
+ void DeleteRemoved();
+
+ //-----------------
+ DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar * );
+
+ //Index starts with 1.
+ //Throws an com::sun::star::lang::IllegalArgumentException, when the index is invalid.
+ void checkIndex(sal_Int32 pos) const;
+
+
+public:
+ ExtensionBox_Impl( Dialog* pParent, TheExtensionManager *pManager );
+ ~ExtensionBox_Impl();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Paint( const Rectangle &rPaintRect );
+ virtual void Resize();
+ virtual long Notify( NotifyEvent& rNEvt );
+
+ const Size GetMinOutputSizePixel() const;
+ void SetExtraSize( long nSize ) { m_nExtraHeight = nSize; }
+ TEntry_Impl GetEntryData( long nPos ) { return m_vEntries[ nPos ]; }
+ long GetEntryCount() { return (long) m_vEntries.size(); }
+ Rectangle GetEntryRect( const long nPos ) const;
+ bool HasActive() { return m_bHasActive; }
+ long PointToPos( const Point& rPos );
+ void SetScrollHdl( const Link& rLink );
+ void DoScroll( long nDelta );
+ void SetHyperlinkHdl( const Link& rLink ){ m_aClickHdl = rLink; }
+ virtual void RecalcAll();
+ void RemoveUnlocked();
+
+ //-----------------
+ 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 );
+ 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 checkEntries();
+
+ TheExtensionManager* getExtensionManager() const { return m_pManager; }
+
+ //===================================================================================
+ //These functions are used for automatic testing
+
+ /** @return The count of the entries in the list box. */
+ virtual sal_Int32 getItemCount() const;
+
+ /** @return The index of the first selected entry in the list box.
+ When nothing is selected, which is the case when getItemCount returns '0',
+ then this function returns EXTENSION_LISTBOX_ENTRY_NOTFOUND */
+ virtual sal_Int32 getSelIndex() const;
+
+ /** @return The item name of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual ::rtl::OUString getItemName( sal_Int32 index ) const;
+
+ /** @return The version string of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual ::rtl::OUString getItemVersion( sal_Int32 index ) const;
+
+ /** @return The description string of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual ::rtl::OUString getItemDescription( sal_Int32 index ) const;
+
+ /** @return The publisher string of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual ::rtl::OUString getItemPublisher( sal_Int32 index ) const;
+
+ /** @return The link behind the publisher text of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual ::rtl::OUString getItemPublisherLink( sal_Int32 index ) const;
+
+ /** The entry at the given position will be selected
+ Index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual void select( sal_Int32 pos );
+
+ /** The first found entry with the given name will be selected
+ When there was no entry found with the name, the selection doesn't change.
+ Please note that there might be more than one entry with the same
+ name, because:
+ 1. the name is not unique
+ 2. one extension can be installed as user and shared extension.
+ */
+ virtual void select( const ::rtl::OUString & sName );
+};
+
+}
diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx
index 6e61e95f07cb..ee8c5d26c24f 100644
--- a/desktop/source/deployment/gui/dp_gui_service.cxx
+++ b/desktop/source/deployment/gui/dp_gui_service.cxx
@@ -48,6 +48,7 @@
#include "boost/bind.hpp"
#include "license_dialog.hxx"
+#include "dp_gui_dialog2.hxx"
using namespace ::dp_misc;
using namespace ::com::sun::star;
@@ -271,27 +272,28 @@ void ServiceImpl::startExecuteModal(
{
const ::vos::OGuard guard( Application::GetSolarMutex() );
- ::rtl::Reference< ::dp_gui::TheExtensionManager > dialog(
+ ::rtl::Reference< ::dp_gui::TheExtensionManager > myExtMgr(
::dp_gui::TheExtensionManager::get(
m_xComponentContext,
m_parent ? *m_parent : Reference<awt::XWindow>(),
m_extensionURL ? *m_extensionURL : OUString() ) );
+ myExtMgr->createDialog( false );
if (m_initialTitle.getLength() > 0) {
- dialog->SetText( m_initialTitle );
+ myExtMgr->SetText( m_initialTitle );
m_initialTitle = OUString();
}
if ( m_bShowUpdateOnly )
{
- dialog->checkUpdates( true, !bCloseDialog );
+ myExtMgr->checkUpdates( true, !bCloseDialog );
if ( bCloseDialog )
- dialog->Close();
+ myExtMgr->Close();
else
- dialog->ToTop( TOTOP_RESTOREWHENMIN );
+ myExtMgr->ToTop( TOTOP_RESTOREWHENMIN );
}
else
{
- dialog->Show();
- dialog->ToTop( TOTOP_RESTOREWHENMIN );
+ myExtMgr->Show();
+ myExtMgr->ToTop( TOTOP_RESTOREWHENMIN );
}
}
@@ -331,6 +333,12 @@ sdecl::ServiceDecl const licenseDecl(
licenseSI,
"com.sun.star.comp.deployment.ui.LicenseDialog",
"com.sun.star.deployment.ui.LicenseDialog" );
+
+sdecl::class_<UpdateRequiredDialogService, sdecl::with_args<true> > updateSI;
+sdecl::ServiceDecl const updateDecl(
+ updateSI,
+ "com.sun.star.comp.deployment.ui.UpdateRequiredDialog",
+ "com.sun.star.deployment.ui.UpdateRequiredDialog" );
} // namespace dp_gui
extern "C" {
@@ -346,7 +354,7 @@ sal_Bool SAL_CALL component_writeInfo(
registry::XRegistryKey * pRegistryKey )
{
return component_writeInfoHelper(
- pServiceManager, pRegistryKey, dp_gui::serviceDecl, dp_gui::licenseDecl );
+ pServiceManager, pRegistryKey, dp_gui::serviceDecl, dp_gui::licenseDecl, dp_gui::updateDecl );
}
void * SAL_CALL component_getFactory(
@@ -355,7 +363,7 @@ void * SAL_CALL component_getFactory(
registry::XRegistryKey * pRegistryKey )
{
return component_getFactoryHelper(
- pImplName, pServiceManager, pRegistryKey, dp_gui::serviceDecl, dp_gui::licenseDecl );
+ pImplName, pServiceManager, pRegistryKey, dp_gui::serviceDecl, dp_gui::licenseDecl, dp_gui::updateDecl );
}
} // extern "C"
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index 721d67c8f35b..3d994f31c395 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -66,7 +66,10 @@ namespace dp_gui {
TheExtensionManager::TheExtensionManager( Window *pParent,
const uno::Reference< uno::XComponentContext > &xContext ) :
- m_xContext( xContext )
+ m_xContext( xContext ),
+ m_pParent( pParent ),
+ m_pExtMgrDialog( NULL ),
+ m_pUpdReqDialog( NULL )
{
if ( dp_misc::office_is_running() )
{
@@ -76,10 +79,6 @@ TheExtensionManager::TheExtensionManager( Window *pParent,
m_xDesktop->addTerminateListener( this );
}
- m_pDialog = new ExtMgrDialog( pParent, this );
-
- m_pExecuteCmdQueue.reset( new ExtensionCmdQueue( m_pDialog, this, xContext ) );
-
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") );;
@@ -110,21 +109,43 @@ TheExtensionManager::TheExtensionManager( Window *pParent,
uno::Sequence< uno::Any >( args, 1 )), uno::UNO_QUERY_THROW);
try
{ //throws css::container::NoSuchElementException, css::lang::WrappedTargetException
- OUString sURL;
uno::Any value = xNameAccessRepositories->getByName( OUSTR( "WebsiteLink" ) );
- sURL = value.get< OUString > ();
- m_pDialog->setGetExtensionsURL( sURL );
+ m_sGetExtensionsURL = value.get< OUString > ();
}
catch ( uno::Exception& )
{}
-
- createPackageList();
}
//------------------------------------------------------------------------------
TheExtensionManager::~TheExtensionManager()
{
- delete m_pDialog;
+ if ( m_pUpdReqDialog )
+ delete m_pUpdReqDialog;
+ if ( m_pExtMgrDialog )
+ delete m_pExtMgrDialog;
+}
+
+//------------------------------------------------------------------------------
+void TheExtensionManager::createDialog( const bool bCreateUpdDlg )
+{
+ const ::vos::OGuard guard( Application::GetSolarMutex() );
+
+ if ( bCreateUpdDlg )
+ {
+ if ( !m_pUpdReqDialog )
+ {
+ m_pUpdReqDialog = new UpdateRequiredDialog( NULL, this );
+ m_pExecuteCmdQueue.reset( 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 ) );
+ m_pExtMgrDialog->setGetExtensionsURL( m_sGetExtensionsURL );
+ createPackageList();
+ }
}
//------------------------------------------------------------------------------
@@ -132,7 +153,7 @@ void TheExtensionManager::Show()
{
const ::vos::OGuard guard( Application::GetSolarMutex() );
- m_pDialog->Show();
+ getDialog()->Show();
}
//------------------------------------------------------------------------------
@@ -140,7 +161,7 @@ void TheExtensionManager::SetText( const ::rtl::OUString &rTitle )
{
const ::vos::OGuard guard( Application::GetSolarMutex() );
- m_pDialog->SetText( rTitle );
+ getDialog()->SetText( rTitle );
}
//------------------------------------------------------------------------------
@@ -148,25 +169,69 @@ void TheExtensionManager::ToTop( USHORT nFlags )
{
const ::vos::OGuard guard( Application::GetSolarMutex() );
- m_pDialog->ToTop( nFlags );
+ getDialog()->ToTop( nFlags );
}
//------------------------------------------------------------------------------
bool TheExtensionManager::Close()
{
- return m_pDialog->Close();
+ if ( m_pExtMgrDialog )
+ return m_pExtMgrDialog->Close();
+ else if ( m_pUpdReqDialog )
+ return m_pUpdReqDialog->Close();
+ else
+ return true;
+}
+
+//------------------------------------------------------------------------------
+sal_Int16 TheExtensionManager::execute()
+{
+ sal_Int16 nRet = 0;
+
+ if ( m_pUpdReqDialog )
+ {
+ nRet = m_pUpdReqDialog->Execute();
+ delete m_pUpdReqDialog;
+ m_pUpdReqDialog = NULL;
+ }
+
+ return nRet;
}
//------------------------------------------------------------------------------
bool TheExtensionManager::isVisible()
{
- return m_pDialog->IsVisible();
+ return getDialog()->IsVisible();
}
//------------------------------------------------------------------------------
bool TheExtensionManager::checkUpdates( bool /* bShowUpdateOnly */, bool /*bParentVisible*/ )
{
- m_pExecuteCmdQueue->checkForUpdates( m_sPackageManagers );
+ std::vector< TUpdateListEntry > vEntries;
+
+ for ( sal_Int32 i = 0; i < m_sPackageManagers.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 );
+ }
+ }
+
+ m_pExecuteCmdQueue->checkForUpdates( vEntries );
return true;
}
@@ -189,10 +254,9 @@ bool TheExtensionManager::removePackage( const uno::Reference< deployment::XPack
}
//------------------------------------------------------------------------------
-bool TheExtensionManager::updatePackage( const uno::Reference< deployment::XPackageManager > &xPackageManager,
- const uno::Reference< deployment::XPackage > &xPackage )
+bool TheExtensionManager::updatePackages( const std::vector< TUpdateListEntry > &vList )
{
- m_pExecuteCmdQueue->checkForUpdate( xPackageManager, xPackage );
+ m_pExecuteCmdQueue->checkForUpdates( vList );
return true;
}
@@ -203,6 +267,8 @@ bool TheExtensionManager::installPackage( const OUString &rPackageURL, bool bWar
if ( rPackageURL.getLength() == 0 )
return false;
+ createDialog( false );
+
uno::Reference< deployment::XPackageManager > xUserPkgMgr = getUserPkgMgr();
uno::Reference< deployment::XPackageManager > xSharedPkgMgr = getSharedPkgMgr();
@@ -210,7 +276,7 @@ bool TheExtensionManager::installPackage( const OUString &rPackageURL, bool bWar
bool bInstallForAll = false;
if ( !bWarnUser && ! xSharedPkgMgr->isReadOnly() )
- bInstall = m_pDialog->installForAllUsers( bInstallForAll );
+ bInstall = getDialogHelper()->installForAllUsers( bInstallForAll );
if ( !bInstall )
return false;
@@ -239,8 +305,10 @@ void TheExtensionManager::terminateDialog()
if ( ! dp_misc::office_is_running() )
{
const ::vos::OGuard guard( Application::GetSolarMutex() );
- delete m_pDialog;
- m_pDialog = NULL;
+ delete m_pExtMgrDialog;
+ m_pExtMgrDialog = NULL;
+ delete m_pUpdReqDialog;
+ m_pUpdReqDialog = NULL;
Application::Quit();
}
}
@@ -252,7 +320,7 @@ bool TheExtensionManager::createPackageList( const uno::Reference< deployment::X
try {
packages = xPackageManager->getDeployedPackages( uno::Reference< task::XAbortChannel >(),
- uno::Reference< ucb::XCommandEnvironment >() );
+ uno::Reference< ucb::XCommandEnvironment >() );
} catch ( deployment::DeploymentException & ) {
//handleGeneralError(e.Cause);
return true;
@@ -267,7 +335,7 @@ bool TheExtensionManager::createPackageList( const uno::Reference< deployment::X
for ( sal_Int32 j = 0; j < packages.getLength(); ++j )
{
- m_pDialog->addPackageToList( packages[j], xPackageManager );
+ getDialogHelper()->addPackageToList( packages[j], xPackageManager );
}
return true;
@@ -381,8 +449,10 @@ void TheExtensionManager::disposing( lang::EventObject const & rEvt )
if ( dp_misc::office_is_running() )
{
const ::vos::OGuard guard( Application::GetSolarMutex() );
- delete m_pDialog;
- m_pDialog = NULL;
+ delete m_pExtMgrDialog;
+ m_pExtMgrDialog = NULL;
+ delete m_pUpdReqDialog;
+ m_pUpdReqDialog = NULL;
}
s_ExtMgr.clear();
}
@@ -393,15 +463,22 @@ void TheExtensionManager::disposing( lang::EventObject const & rEvt )
void TheExtensionManager::queryTermination( ::lang::EventObject const & )
throw ( frame::TerminationVetoException, uno::RuntimeException )
{
- if ( m_pExecuteCmdQueue->isBusy() || ( m_pDialog && m_pDialog->isBusy() ) )
+ DialogHelper *pDialogHelper = getDialogHelper();
+
+ if ( m_pExecuteCmdQueue->isBusy() || ( pDialogHelper && pDialogHelper->isBusy() ) )
{
ToTop( TOTOP_RESTOREWHENMIN );
throw frame::TerminationVetoException(
OUSTR("The office cannot be closed while the Extension Manager is running"),
uno::Reference<XInterface>(static_cast<frame::XTerminateListener*>(this), uno::UNO_QUERY));
}
- else if ( m_pDialog )
- m_pDialog->Close();
+ else
+ {
+ if ( m_pExtMgrDialog )
+ m_pExtMgrDialog->Close();
+ if ( m_pUpdReqDialog )
+ m_pUpdReqDialog->Close();
+ }
}
//------------------------------------------------------------------------------
@@ -419,9 +496,9 @@ void TheExtensionManager::modified( ::lang::EventObject const & rEvt )
uno::Reference< deployment::XPackageManager > xPackageManager( rEvt.Source, uno::UNO_QUERY );
if ( xPackageManager.is() )
{
- m_pDialog->prepareChecking( xPackageManager );
+ getDialogHelper()->prepareChecking( xPackageManager );
createPackageList( xPackageManager );
- m_pDialog->checkEntries();
+ getDialogHelper()->checkEntries();
}
}
@@ -433,7 +510,8 @@ void TheExtensionManager::modified( ::lang::EventObject const & rEvt )
if ( s_ExtMgr.is() )
{
OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
- s_ExtMgr->installPackage( extensionURL, true );
+ if ( extensionURL.getLength() )
+ s_ExtMgr->installPackage( extensionURL, true );
return s_ExtMgr;
}
@@ -450,7 +528,8 @@ void TheExtensionManager::modified( ::lang::EventObject const & rEvt )
s_ExtMgr = that;
}
- s_ExtMgr->installPackage( extensionURL, true );
+ if ( extensionURL.getLength() )
+ s_ExtMgr->installPackage( extensionURL, true );
return s_ExtMgr;
}
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
index 21516c683cc8..4ce6005a9346 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
@@ -44,12 +44,13 @@
#include "com/sun/star/util/XModifyListener.hpp"
#include "dp_gui.h"
+#include "dp_gui_dialog2.hxx"
+#include "dp_gui_updatedata.hxx"
//==============================================================================
namespace dp_gui {
//------------------------------------------------------------------------------
-class ExtMgrDialog;
class ExtensionCmdQueue;
//------------------------------------------------------------------------------
@@ -65,7 +66,11 @@ private:
::std::auto_ptr< ExtensionCmdQueue > m_pExecuteCmdQueue;
- ExtMgrDialog *m_pDialog;
+ Window *m_pParent;
+ ExtMgrDialog *m_pExtMgrDialog;
+ UpdateRequiredDialog *m_pUpdReqDialog;
+
+ ::rtl::OUString m_sGetExtensionsURL;
// liste der packages ( xpackage?, mit parent manager, ... )
@@ -79,6 +84,12 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &xContext );
~TheExtensionManager();
+ void createDialog( const bool bCreateUpdDlg );
+ sal_Int16 execute();
+
+ Dialog* getDialog() { return m_pExtMgrDialog ? (Dialog*) m_pExtMgrDialog : (Dialog*) m_pUpdReqDialog; }
+ DialogHelper* getDialogHelper() { return m_pExtMgrDialog ? (DialogHelper*) m_pExtMgrDialog : (DialogHelper*) m_pUpdReqDialog; }
+
void SetText( const ::rtl::OUString &rTitle );
void Show();
void ToTop( USHORT nFlags );
@@ -87,12 +98,12 @@ 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 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 installPackage( const ::rtl::OUString &rPackageURL, bool bWarnUser = false );
bool queryTermination();
diff --git a/desktop/source/deployment/gui/dp_gui_updatedata.hxx b/desktop/source/deployment/gui/dp_gui_updatedata.hxx
index ba78112a26f7..610960b99734 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedata.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedata.hxx
@@ -34,6 +34,8 @@
#include "rtl/ustring.hxx"
#include "com/sun/star/uno/Reference.hxx"
+#include <boost/shared_ptr.hpp>
+
namespace com { namespace sun { namespace star { namespace deployment {
class XPackageManager;
@@ -46,6 +48,19 @@ namespace com { namespace sun { namespace star { namespace xml { namespace dom {
namespace dp_gui {
+struct UpdateListEntry
+{
+ ::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;
+
+
struct UpdateData
{
::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > aInstalledPackage;
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index 370d11c0de63..0e1955359bbc 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -229,9 +229,7 @@ public:
Thread(
css::uno::Reference< css::uno::XComponentContext > const & context,
UpdateDialog & dialog,
- rtl::Reference< dp_gui::SelectedPackage > const & selectedPackage,
- css::uno::Sequence< css::uno::Reference<
- css::deployment::XPackageManager > > const & packageManagers);
+ const std::vector< TUpdateListEntry > &vExtensionList);
void stop();
@@ -285,9 +283,7 @@ private:
css::uno::Reference< css::uno::XComponentContext > m_context;
UpdateDialog & m_dialog;
- rtl::Reference< dp_gui::SelectedPackage > m_selectedPackage;
- css::uno::Sequence< css::uno::Reference<
- css::deployment::XPackageManager > > m_packageManagers;
+ std::vector< dp_gui::TUpdateListEntry > m_vExtensionList;
css::uno::Reference< css::deployment::XUpdateInformationProvider >
m_updateInformation;
@@ -299,13 +295,10 @@ private:
UpdateDialog::Thread::Thread(
css::uno::Reference< css::uno::XComponentContext > const & context,
UpdateDialog & dialog,
- rtl::Reference< dp_gui::SelectedPackage > const & selectedPackage,
- css::uno::Sequence< css::uno::Reference<
- css::deployment::XPackageManager > > const & packageManagers):
+ const std::vector< dp_gui::TUpdateListEntry > &vExtensionList):
m_context(context),
m_dialog(dialog),
- m_selectedPackage(selectedPackage),
- m_packageManagers(packageManagers),
+ m_vExtensionList(vExtensionList),
m_updateInformation(
css::deployment::UpdateInformationProvider::create(context)),
m_stop(false)
@@ -336,55 +329,28 @@ UpdateDialog::Thread::Entry::Entry(
UpdateDialog::Thread::~Thread() {}
-void UpdateDialog::Thread::execute() {
- OSL_ASSERT(m_selectedPackage.is() != (m_packageManagers.getLength() != 0));
+void UpdateDialog::Thread::execute()
+{
+ OSL_ASSERT( ! m_vExtensionList.empty() );
Map map;
- if (m_selectedPackage.is()) {
- css::uno::Reference< css::deployment::XPackage > p = m_selectedPackage->getPackage();
- css::uno::Reference< css::deployment::XPackageManager > m= m_selectedPackage->getPackageManager();
+
+ typedef std::vector< TUpdateListEntry >::const_iterator ITER;
+ for ( ITER iIndex = m_vExtensionList.begin(); iIndex < m_vExtensionList.end(); ++iIndex )
+ {
+ css::uno::Reference< css::deployment::XPackage > p = (*iIndex)->m_xPackage;
+ css::uno::Reference< css::deployment::XPackageManager > m = (*iIndex)->m_xPackageManager;
if ( p.is() )
{
- handle(p, m, &map);
- }
- } else {
- for (sal_Int32 i = 0; i < m_packageManagers.getLength(); ++i) {
- css::uno::Reference< css::task::XAbortChannel > abort(
- m_packageManagers[i]->createAbortChannel());
{
- vos::OGuard g(Application::GetSolarMutex());
- if (m_stop) {
+ vos::OGuard g( Application::GetSolarMutex() );
+ if ( m_stop ) {
return;
}
- m_abort = abort;
- }
- css::uno::Sequence<
- css::uno::Reference< css::deployment::XPackage > > ps;
- try {
- ps = m_packageManagers[i]->getDeployedPackages(
- abort,
- css::uno::Reference< css::ucb::XCommandEnvironment >());
- } catch (css::deployment::DeploymentException & e) {
- handleGeneralError(e.Cause);
- continue;
- } catch (css::ucb::CommandFailedException & e) {
- handleGeneralError(e.Reason);
- continue;
- } catch (css::ucb::CommandAbortedException &) {
- return;
- } catch (css::lang::IllegalArgumentException & e) {
- throw css::uno::RuntimeException(e.Message, e.Context);
- }
- for (sal_Int32 j = 0; j < ps.getLength(); ++j) {
- {
- vos::OGuard g(Application::GetSolarMutex());
- if (m_stop) {
- return;
- }
- }
- handle(ps[j], m_packageManagers[i], &map);
}
+ handle( p, m, &map );
}
}
+
if (!map.empty()) {
const rtl::OUString sDefaultURL(dp_misc::getExtensionDefaultUpdateURL());
if (sDefaultURL.getLength())
@@ -597,9 +563,7 @@ bool UpdateDialog::Thread::update(
UpdateDialog::UpdateDialog(
css::uno::Reference< css::uno::XComponentContext > const & context,
Window * parent,
- rtl::Reference< dp_gui::SelectedPackage > const & selectedPackage,
- css::uno::Sequence< css::uno::Reference<
- css::deployment::XPackageManager > > const & packageManagers,
+ const std::vector< dp_gui::TUpdateListEntry > &vExtensionList,
std::vector< dp_gui::UpdateData > * updateData):
ModalDialog(parent,DpGuiResId(RID_DLG_UPDATE)),
m_context(context),
@@ -636,14 +600,12 @@ UpdateDialog::UpdateDialog(
m_updateData(*updateData),
m_thread(
new UpdateDialog::Thread(
- context, *this, selectedPackage,
- packageManagers)),
+ context, *this, vExtensionList)),
m_nFirstLineDelta(0),
m_nOneLineMissing(0)
// TODO: check!
// ,
// m_extensionManagerDialog(extensionManagerDialog)
-
{
OSL_ASSERT(updateData != NULL);
css::uno::Reference< css::awt::XToolkit > toolkit;
@@ -1310,4 +1272,3 @@ IMPL_LINK( UpdateDialog, hyperlink_clicked, svt::FixedHyperlink*, pHyperlink )
return 1;
}
-
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
index b038c0ef042f..578ad6b6f01d 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
@@ -48,6 +48,7 @@
#include <svtools/fixedhyper.hxx>
#include "descedit.hxx"
+#include "dp_gui_updatedata.hxx"
/// @HTML
@@ -56,18 +57,14 @@ class KeyEvent;
class MouseEvent;
class ResId;
class Window;
+
namespace com { namespace sun { namespace star {
namespace awt { class XThrobber; }
namespace deployment { class XPackageManager; }
namespace uno { class XComponentContext; }
} } }
-namespace dp_gui {
- class SelectedPackage;
- struct UpdateData;
-}
namespace dp_gui {
-
/**
The modal &ldquo;Check for Updates&rdquo; dialog.
*/
@@ -92,13 +89,9 @@ public:
if non-null, check for updates for all managed packages
*/
UpdateDialog(
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
- const & context,
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const & context,
Window * parent,
- rtl::Reference< dp_gui::SelectedPackage > const & selectedPackage,
- com::sun::star::uno::Sequence< com::sun::star::uno::Reference<
- com::sun::star::deployment::XPackageManager > > const &
- packageManagers,
+ const std::vector< dp_gui::TUpdateListEntry > &vExtensionList,
std::vector< dp_gui::UpdateData > * updateData);
~UpdateDialog();
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.src b/desktop/source/deployment/gui/dp_gui_updatedialog.src
index 319d953b1430..49d3c1c0cf8e 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.src
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.src
@@ -236,7 +236,7 @@ ModalDialog RID_DLG_UPDATE {
Text[en-US] = "No descriptions available for this extension.";
};
String RID_DLG_UPDATE_NOINSTALL {
- Text[en-US] = "The extension cannot be installed because:";
+ Text[en-US] = "The extension cannot be updated because:";
};
String RID_DLG_UPDATE_NODEPENDENCY {
Text[en-US] = "Required OpenOffice.org version doesn't match:";
diff --git a/desktop/source/deployment/gui/makefile.mk b/desktop/source/deployment/gui/makefile.mk
index e3211ab7f73f..4d563ae1591a 100644
--- a/desktop/source/deployment/gui/makefile.mk
+++ b/desktop/source/deployment/gui/makefile.mk
@@ -50,6 +50,7 @@ DLLPRE =
SLOFILES = \
$(SLO)$/dp_gui_service.obj \
+ $(SLO)$/dp_gui_extlistbox.obj \
$(SLO)$/dp_gui_dialog2.obj \
$(SLO)$/dp_gui_theextmgr.obj \
$(SLO)$/license_dialog.obj \
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index afd44f83cff6..d7177f90dc77 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -314,6 +314,18 @@ Reference<deployment::XPackageManager> PackageManagerImpl::create(
}
}
+ //Workaround. See issue http://www.openoffice.org/issues/show_bug.cgi?id=99257
+ //This prevents the copying of the common.rdbf and native rdbs. It disables the
+ //feature to add shared extensions in a running office.
+ if (!that->m_readOnly && context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("shared") ))
+ {
+ OUString sNoRdb;
+ ::rtl::Bootstrap::get(OUSTR("NORDBCOPY"), sNoRdb);
+ if (sNoRdb.equalsIgnoreAsciiCase(OUSTR("true"))
+ && dp_misc::office_is_running())
+ that->m_readOnly = true;
+ }
+
if (!that->m_readOnly && logFile.getLength() > 0)
{
const Any any_logFile(logFile);
@@ -660,10 +672,15 @@ Reference<deployment::XPackage> PackageManagerImpl::addPackage(
{
check();
if (m_readOnly)
+ {
+ OUString message;
+ if (m_context == OUSTR("shared"))
+ message = OUSTR("You need write permissions to install a shared extension!");
+ else
+ message = OUSTR("You need write permissions to install this extension!");
throw deployment::DeploymentException(
- OUSTR("operating on read-only context!"),
- static_cast<OWeakObject *>(this), Any() );
-
+ message, static_cast<OWeakObject *>(this), Any() );
+ }
Reference<XCommandEnvironment> xCmdEnv;
if (m_xLogFile.is())
xCmdEnv.set( new CmdEnvWrapperImpl( xCmdEnv_, m_xLogFile ) );
@@ -893,9 +910,15 @@ void PackageManagerImpl::removePackage(
{
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(
- OUSTR("operating on read-only context!"),
- static_cast<OWeakObject *>(this), Any() );
+ message, static_cast<OWeakObject *>(this), Any() );
+ }
Reference<XCommandEnvironment> xCmdEnv;
if (m_xLogFile.is())
@@ -1117,9 +1140,15 @@ void PackageManagerImpl::reinstallDeployedPackages(
{
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(
- OUSTR("operating on read-only context!"),
- static_cast<OWeakObject *>(this), Any() );
+ message, static_cast<OWeakObject *>(this), Any() );
+ }
if (office_is_running())
throw RuntimeException(
diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx
index 7f6d003f8577..aa67536bd425 100644
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -296,6 +296,7 @@ sal_Bool Package::isBundle() throw (RuntimeException)
return false; // default
}
+//______________________________________________________________________________
::sal_Bool Package::checkPrerequisites(
const css::uno::Reference< css::task::XAbortChannel >&,
const css::uno::Reference< css::ucb::XCommandEnvironment >&,
@@ -308,6 +309,16 @@ sal_Bool Package::isBundle() throw (RuntimeException)
return true;
}
+//______________________________________________________________________________
+::sal_Bool Package::checkDependencies(
+ const css::uno::Reference< css::ucb::XCommandEnvironment >& )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::uno::RuntimeException)
+{
+ return true;
+}
+
//______________________________________________________________________________
Sequence< Reference<deployment::XPackage> > Package::getBundle(
diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx
index 573c1c639de1..dd9e009e90cc 100644
--- a/desktop/source/deployment/registry/help/dp_help.cxx
+++ b/desktop/source/deployment/registry/help/dp_help.cxx
@@ -40,7 +40,7 @@
#include "comphelper/servicedecl.hxx"
#include "svtools/inettype.hxx"
-#include <xmlhelp/compilehelp.hxx>
+#include <transex3/compilehelp.hxx>
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/util/XMacroExpander.hpp>
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
diff --git a/desktop/source/deployment/registry/help/dp_help.src b/desktop/source/deployment/registry/help/dp_help.src
index ed65707badbd..be85542dc3b0 100644
--- a/desktop/source/deployment/registry/help/dp_help.src
+++ b/desktop/source/deployment/registry/help/dp_help.src
@@ -42,6 +42,6 @@ String RID_STR_HELPPROCESSING_GENERAL_ERROR
String RID_STR_HELPPROCESSING_XMLPARSING_ERROR
{
- Text [ en-US ] = "The extension will not be installed because an error occured in the Help files:\n";
+ Text [ en-US ] = "The extension will not be installed because an error occurred in the Help files:\n";
};
diff --git a/desktop/source/deployment/registry/inc/dp_backend.h b/desktop/source/deployment/registry/inc/dp_backend.h
index 02e1d79ce2c3..256d4680d795 100644
--- a/desktop/source/deployment/registry/inc/dp_backend.h
+++ b/desktop/source/deployment/registry/inc/dp_backend.h
@@ -177,6 +177,12 @@ public:
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);
+
virtual void SAL_CALL registerPackage(
css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index e39f5e80fc31..14075d0fca38 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -205,6 +205,12 @@ class BackendImpl : public ImplBaseT
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);
+
virtual beans::Optional<OUString> SAL_CALL getIdentifier()
throw (RuntimeException);
@@ -702,6 +708,22 @@ bool BackendImpl::PackageImpl::checkDependencies(
&& checkLicense(xCmdEnv, *spDescription, bInstalled, aContextName);
}
+::sal_Bool BackendImpl::PackageImpl::checkDependencies(
+ const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ 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 checkDependencies(xCmdEnv, *spDescription);
+}
+
beans::Optional<OUString> BackendImpl::PackageImpl::getIdentifier()
throw (RuntimeException)
{
diff --git a/desktop/source/deployment/unopkg/unopkg.src b/desktop/source/deployment/unopkg/unopkg.src
index a3b2bac56cc5..bb5be7e8bbd6 100644
--- a/desktop/source/deployment/unopkg/unopkg.src
+++ b/desktop/source/deployment/unopkg/unopkg.src
@@ -81,5 +81,12 @@ String RID_STR_UNOPKG_ACCEPT_LIC_N
String RID_STR_CONCURRENTINSTANCE
{
- Text [ en-US ] = "You need to close the already opened Extension Manager to continue.";
+ Text [ en-US ] = "unopkg cannot be started. The lock file indicates it as already running. "
+ "If this does not apply, delete the lock file at:";
};
+
+String RID_STR_UNOPKG_ERROR
+{
+ Text [ en-US ] = "ERROR: ";
+};
+
diff --git a/desktop/source/inc/helpid.hrc b/desktop/source/inc/helpid.hrc
index 1d10a9f6fbbe..f2d096460bed 100644
--- a/desktop/source/inc/helpid.hrc
+++ b/desktop/source/inc/helpid.hrc
@@ -66,7 +66,11 @@
#define HID_EXTENSION_MANAGER_LISTBOX_DISABLE (HID_DESKTOP_START + 26)
#define HID_EXTENSION_MANAGER_LISTBOX_REMOVE (HID_DESKTOP_START + 27)
-#define ACT_DESKTOP_HID_END HID_EXTENSION_MANAGER_LISTBOX_REMOVE
+#define HID_EXTENSION_DEPENDENCIES (HID_DESKTOP_START + 28)
+
+#define HID_PACKAGE_MANAGER_UPD_REQ (HID_DESKTOP_START + 29)
+
+#define ACT_DESKTOP_HID_END HID_PACKAGE_MANAGER_UPD_REQ
// check bounds:
#if ACT_DESKTOP_HID_END > HID_DESKTOP_END
diff --git a/desktop/source/migration/pages.cxx b/desktop/source/migration/pages.cxx
index 461ced320da4..80c5849ee4d9 100644
--- a/desktop/source/migration/pages.cxx
+++ b/desktop/source/migration/pages.cxx
@@ -37,6 +37,7 @@
#include "migration.hxx"
#include <vcl/msgbox.hxx>
#include <vcl/mnemonic.hxx>
+#include <vos/security.hxx>
#include <app.hxx>
#include <rtl/ustring.hxx>
#include <osl/file.hxx>
@@ -60,7 +61,6 @@
#include <unotools/bootstrap.hxx>
#include <tools/config.hxx>
-
using namespace rtl;
using namespace osl;
using namespace utl;
@@ -100,9 +100,10 @@ WelcomePage::WelcomePage( svt::OWizardMachine* parent, const ResId& resid, sal_B
// we need to choose the welcome text that is diplayed
// choices are the default text, default text+migradtion,
// OEM and extended OEM
- switch (checkOEM())
- {
- case OEM_NONE:
+ // No OEM is built, remove the check
+// switch (checkOEM())
+// {
+// case OEM_NONE:
// check for migration
if (Migration::checkMigration())
{
@@ -112,27 +113,11 @@ WelcomePage::WelcomePage( svt::OWizardMachine* parent, const ResId& resid, sal_B
m_ftBody.SetText( aText );
}
else
- if (bIsEvalVersion && (! bNoEvalText))
- {
- String aText(WizardResId(STR_WELCOME_EVAL));
- aText.SearchAndReplaceAll( UniString::CreateFromAscii("%EVALDAYS"), UniString::CreateFromAscii("90"));
- m_ftBody.SetText( aText );
- }
- else
if ( ! m_bLicenseNeedsAcceptance )
{
String aText(WizardResId(STR_WELCOME_WITHOUT_LICENSE));
m_ftBody.SetText( aText );
}
- break;
- case OEM_NORMAL:
- m_ftBody.SetText(String(WizardResId(STR_WELCOME_OEM)));
- break;
- case OEM_EXTENDED:
- m_ftBody.SetText(String(WizardResId(STR_WELCOME_OEM_EXT)));
- break;
- }
-
}
@@ -388,6 +373,10 @@ UserPage::UserPage( svt::OWizardMachine* parent, const ResId& resid)
SvtUserOptions aUserOpt;
m_edFirst.SetText(aUserOpt.GetFirstName());
m_edLast.SetText(aUserOpt.GetLastName());
+ rtl::OUString aUserName;
+ vos::OSecurity().getUserName( aUserName );
+ aUserOpt.SetID( aUserName );
+
m_edInitials.SetText(aUserOpt.GetID());
if (m_lang == LANGUAGE_RUSSIAN)
{
@@ -403,6 +392,7 @@ sal_Bool UserPage::commitPage( CommitPageReason )
aUserOpt.SetFirstName(m_edFirst.GetText());
aUserOpt.SetLastName(m_edLast.GetText());
aUserOpt.SetID( m_edInitials.GetText());
+
if (m_lang == LANGUAGE_RUSSIAN)
aUserOpt.SetFathersName(m_edFather.GetText());
diff --git a/desktop/source/migration/wizard.hrc b/desktop/source/migration/wizard.hrc
index 317465736f6e..cdd045164123 100644
--- a/desktop/source/migration/wizard.hrc
+++ b/desktop/source/migration/wizard.hrc
@@ -88,13 +88,13 @@
#define STR_STATE_MIGRATION RID_FIRSTSTSTART_START+102
#define STR_STATE_REGISTRATION RID_FIRSTSTSTART_START+103
#define STR_WELCOME_MIGRATION RID_FIRSTSTSTART_START+104
-#define STR_WELCOME_OEM RID_FIRSTSTSTART_START+105
-#define STR_WELCOME_OEM_EXT RID_FIRSTSTSTART_START+106
+// FREE RID_FIRSTSTSTART_START+105
+// FREE RID_FIRSTSTSTART_START+106
#define STR_LICENSE_ACCEPT RID_FIRSTSTSTART_START+107
#define STR_LICENSE_DECLINE RID_FIRSTSTSTART_START+108
#define STR_FINISH RID_FIRSTSTSTART_START+109
#define STR_STATE_USER RID_FIRSTSTSTART_START+110
-#define STR_WELCOME_EVAL RID_FIRSTSTSTART_START+111
+// FREE RID_FIRSTSTSTART_START+111
#define STR_STATE_UPDATE_CHECK RID_FIRSTSTSTART_START+112
#define STR_WELCOME_WITHOUT_LICENSE RID_FIRSTSTSTART_START+113
#define STR_REGISTRATION_OOO RID_FIRSTSTSTART_START+114
diff --git a/desktop/source/migration/wizard.src b/desktop/source/migration/wizard.src
index 05f637fe7027..634c8fe12dcb 100644
--- a/desktop/source/migration/wizard.src
+++ b/desktop/source/migration/wizard.src
@@ -79,24 +79,6 @@ String STR_WELCOME_MIGRATION
Text [ en-US ] = "This wizard will guide you through the license agreement, the transfer of user data from %OLD_VERSION and the registration of %PRODUCTNAME.\n\nClick 'Next' to continue.";
};
-String STR_WELCOME_OEM
-{
- Text [ en-US ] = "This wizard will guide you through the license agreement and the registration of %PRODUCTNAME.\n\nImportant information is contained in the readme file which is located in the %PRODUCTNAME product directory. Please read this file carefully.\n\nYou can also find detailed information on the Sun Internet pages at\n\nhttp://www.sun.com/%PRODUCTNAME.\n\nClick 'Next' to continue.";
-};
-String STR_WELCOME_OEM_EXT
-{
- Text [ en-US ] = "This wizard will guide you through the license agreement and the registration of %PRODUCTNAME.\n\n"
- "Important information is contained in the readme files which are located in the %PRODUCTNAME product directory. "
- "Please read these files carefully. You can also find detailed information on the Sun website \n\n"
- "http://www.sun.com/%PRODUCTNAME.\n\nSupport:\n\nGet FREE software support valid for 60 days from "
- "date of purchase. To take advantage of this offer, visit the website below.\n\n"
- "http://www.sun.com/star/service\n\nClick 'Next' to continue.";
-};
-
-String STR_WELCOME_EVAL
-{
- Text [ en-US ] = "This wizard will guide you through the license agreement and the registration of %PRODUCTNAME.\n\nThis version lets you evaluate the full functionality. However, since it is an evaluation version, you will be able to start it within %EVALDAYS days after installation. To find out more about the %PRODUCTNAME product, visit www.sun.com/%PRODUCTNAME\n\nClick 'Next' to continue.";
-};
String STR_WELCOME_WITHOUT_LICENSE
{
@@ -305,7 +287,7 @@ TabPage TP_UPDATE_CHECK
#define USERINDENT 40
#define EDHEIGHT 12
-#define INITIALSWIDTH 25
+#define INITIALSWIDTH 50
#define FTADD 2
TabPage TP_USER
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index a5d1fd2f746e..5fc4136a9501 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -470,14 +470,23 @@ extern "C" int unopkg_main()
}
catch (deployment::DeploymentException & exc)
{
+ OUString cause;
+ if (option_verbose)
+ {
+ cause = ::comphelper::anyToString(exc.Cause);
+ }
+ else
+ {
+ css::uno::Exception e;
+ if (exc.Cause >>= e)
+ cause = e.Message;
+ }
+
dp_misc::writeConsoleError(
- OUSTR("\nERROR: ") +
- exc.Message + OUSTR("\n") +
- OUSTR(" Cause: ") +
- OUString(option_verbose ? ::comphelper::anyToString(exc.Cause):
- reinterpret_cast< css::uno::Exception const *>(
- exc.Cause.getValue())->Message) +
- OUSTR("\n"));
+ OUSTR("\nERROR: ") + exc.Message + OUSTR("\n"));
+ if (cause.getLength())
+ dp_misc::writeConsoleError(
+ OUSTR(" Cause: ") + cause + OUSTR("\n"));
}
catch (LockFileException & e)
{
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index de8fedae2bdb..70b469fa58fa 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
@@ -471,10 +471,10 @@ Reference<XComponentContext> getUNO(
{
if (! s_lockfile.check( 0 ))
{
- //String sMsg(ResId(RID_STR_CONCURRENTINSTANCE, *DeploymentResMgr::get()));
- OUString sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "unopkg cannot be started. The lock file indicates it as already running. "
- "If this does not apply, delete the lock file at:"));
+ String sMsg(ResId(RID_STR_CONCURRENTINSTANCE, *DeploymentResMgr::get()));
+ //Create this string before we call DeInitVCL, because this will kill
+ //the ResMgr
+ String sError(ResId(RID_STR_UNOPKG_ERROR, *DeploymentResMgr::get()));
sMsg = sMsg + OUSTR("\n") + getLockFilePath();
@@ -497,9 +497,8 @@ Reference<XComponentContext> getUNO(
DeInitVCL();
}
-// String sError(ResId(RID_STR_UNOPKG_ERROR, *DeploymentResMgr::get()));
throw LockFileException(
- OUSTR("\n") + OUSTR("ERROR: ") + sMsg + OUSTR("\n"));
+ OUSTR("\n") + sError + sMsg + OUSTR("\n"));
}
}
diff --git a/desktop/source/registration/com/sun/star/registration/Registration.java b/desktop/source/registration/com/sun/star/registration/Registration.java
new file mode 100644
index 000000000000..afcb1b99660e
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/registration/Registration.java
@@ -0,0 +1,342 @@
+/*************************************************************************
+ *
+ * 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: Registration.java,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package com.sun.star.registration;
+
+import com.sun.star.beans.NamedValue;
+import com.sun.star.comp.loader.FactoryHelper;
+import com.sun.star.frame.DispatchResultEvent;
+import com.sun.star.frame.DispatchResultState;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XMultiComponentFactory;
+import com.sun.star.lang.XSingleServiceFactory;
+import com.sun.star.registry.*;
+import com.sun.star.servicetag.*;
+import com.sun.star.system.*;
+import com.sun.star.task.*;
+import com.sun.star.uno.*;
+import com.sun.star.uri.XExternalUriReferenceTranslator;
+import com.sun.star.util.XStringSubstitution;
+
+import java.io.*;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Set;
+import java.net.HttpURLConnection;
+
+public class Registration {
+
+ public static XSingleServiceFactory __getServiceFactory(String implName,
+ XMultiServiceFactory multiFactory, XRegistryKey regKey) {
+ XSingleServiceFactory xSingleServiceFactory = null;
+
+ if (implName.equals(Registration.class.getName())) {
+ xSingleServiceFactory = FactoryHelper.getServiceFactory(_Registration.class, _serviceName, multiFactory, regKey);
+ }
+
+ return xSingleServiceFactory;
+ }
+
+ public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
+ return FactoryHelper.writeRegistryServiceInfo(Registration.class.getName(), _serviceName, regKey);
+ }
+
+ static final String _serviceName = "com.sun.star.comp.framework.DoRegistrationJob";
+
+ static public class _Registration implements XJob {
+ XComponentContext xComponentContext;
+
+ XStringSubstitution xPathSubstService = null;
+ XExternalUriReferenceTranslator xUriTranslator = null;
+
+ RegistrationData theRegistrationData = null;
+
+ public _Registration(XComponentContext xComponentContext) {
+ this.xComponentContext = xComponentContext;
+ }
+
+ private String resolvePath(String path) {
+ try {
+ if( xPathSubstService == null || xUriTranslator == null ) {
+ XMultiComponentFactory theServiceManager = xComponentContext.getServiceManager();
+ if( xPathSubstService == null ) {
+ Object o = theServiceManager.createInstanceWithContext(
+ "com.sun.star.util.PathSubstitution",
+ xComponentContext );
+ xPathSubstService = (XStringSubstitution)
+ UnoRuntime.queryInterface(XStringSubstitution.class, o);
+ }
+
+ if( xUriTranslator == null ) {
+ Object o = theServiceManager.createInstanceWithContext(
+ "com.sun.star.uri.ExternalUriReferenceTranslator",
+ xComponentContext );
+ xUriTranslator = (XExternalUriReferenceTranslator)
+ UnoRuntime.queryInterface(XExternalUriReferenceTranslator.class, o);
+ }
+ }
+
+ String s = xPathSubstService.substituteVariables(path, true);
+ return xUriTranslator.translateToExternal(s);
+ } catch (java.lang.Exception e) {
+ return path;
+ }
+ }
+
+ private void openBrowser(String url) {
+ try {
+ XMultiComponentFactory theServiceManager = xComponentContext.getServiceManager();
+
+ Object o = theServiceManager.createInstanceWithContext(
+ "com.sun.star.system.SystemShellExecute",
+ xComponentContext );
+
+ XSystemShellExecute xShellExecuteService = (XSystemShellExecute)
+ UnoRuntime.queryInterface(XSystemShellExecute.class, o);
+
+ xShellExecuteService.execute( url, "", SystemShellExecuteFlags.DEFAULTS );
+ } catch (java.lang.Exception e) {
+ }
+ }
+
+ private ServiceTag getServiceTagFromRegistrationData(File xmlFile, String productURN) {
+ try {
+ RegistrationData storedRegData = RegistrationData.loadFromXML(new FileInputStream(xmlFile));
+ Set<ServiceTag> storedServiceTags = storedRegData.getServiceTags();
+
+ Iterator<ServiceTag> tagIterator = storedServiceTags.iterator();
+ while( tagIterator.hasNext() ) {
+ ServiceTag tag = tagIterator.next();
+ if( tag.getProductURN().equals(productURN) ) {
+ theRegistrationData = storedRegData;
+ return tag;
+ }
+ }
+
+ // product URN has changed, remove registration data file
+ xmlFile.delete();
+ } catch (IOException e) {
+ // fall through intentionally
+ } catch (IllegalArgumentException e) {
+ // file is damaged (or a name clash appeared)
+ xmlFile.delete();
+ }
+ return null;
+ }
+
+ /*
+ * XJob
+ *
+ * NOTE: as this Job hets triggered by the the JobExecutor service from first start
+ * wizard and registration reminder code (because their frames do not implement
+ * XDispatchProvider), making this an XAsyncJob doesn't make sense as the
+ * JobExecutor waits for the jobFinished call on the listener passed.
+ */
+ public Object execute(NamedValue[] args)
+ throws com.sun.star.lang.IllegalArgumentException, com.sun.star.uno.Exception {
+
+ final NamedValue[] f_args = args;
+
+ new Thread(
+ new Runnable () {
+ public void run() {
+ try {
+ executeImpl(f_args);
+ } catch(com.sun.star.uno.Exception e) {
+ }
+ }
+ }
+ ).start();
+
+ NamedValue ret[] = new NamedValue[1];
+ ret[0] = new NamedValue( "Deactivate", new Boolean(false) );
+ return ret;
+ }
+
+ public synchronized void executeImpl(NamedValue[] args)
+ throws com.sun.star.lang.IllegalArgumentException, com.sun.star.uno.Exception {
+
+ // extract the interesting part of the argument list
+ NamedValue[] theJobConfig = null;
+ NamedValue[] theEnvironment = null;
+
+ int c = args.length;
+ for (int i=0; i<c; ++i) {
+ if (args[i].Name.equals("JobConfig"))
+ theJobConfig = (NamedValue[]) AnyConverter.toArray(args[i].Value);
+ else if (args[i].Name.equals("Environment"))
+ theEnvironment = (NamedValue[]) AnyConverter.toArray(args[i].Value);
+ }
+
+ if (theEnvironment==null)
+ throw new com.sun.star.lang.IllegalArgumentException("no environment");
+
+ boolean saveConfig = false;
+
+ String productName = "";
+ String productVersion = "";
+ String productURN = "";
+ String productParent = "";
+ String productParentURN = "";
+ String productDefinedInstanceID = "";
+ String productSource = "";
+ String vendor = "";
+
+ String urlRegData = null;
+ String registrationURL = null;
+
+ c = theJobConfig.length;
+ for (int i=0; i<c; ++i) {
+ if( theJobConfig[i].Name.equals("ProductName") ) {
+ productName = AnyConverter.toString(theJobConfig[i].Value);
+ } else if( theJobConfig[i].Name.equals("ProductVersion") ) {
+ productVersion = AnyConverter.toString(theJobConfig[i].Value);
+ } else if( theJobConfig[i].Name.equals("ProductURN") ) {
+ productURN = AnyConverter.toString(theJobConfig[i].Value);
+ } else if( theJobConfig[i].Name.equals("ProductParent") ) {
+ productParent = AnyConverter.toString(theJobConfig[i].Value);
+ } else if( theJobConfig[i].Name.equals("ProductParentURN") ) {
+ productParentURN = AnyConverter.toString(theJobConfig[i].Value);
+ } else if( theJobConfig[i].Name.equals("ProductSource") ) {
+ productSource = AnyConverter.toString(theJobConfig[i].Value);
+ } else if( theJobConfig[i].Name.equals("Vendor") ) {
+ vendor = AnyConverter.toString(theJobConfig[i].Value);
+ } else if( theJobConfig[i].Name.equals("RegistrationData") ) {
+ urlRegData = resolvePath(AnyConverter.toString(theJobConfig[i].Value));
+ } else if( theJobConfig[i].Name.equals("RegistrationURL") ) {
+ registrationURL = AnyConverter.toString(theJobConfig[i].Value);
+ } else {
+ System.err.println( theJobConfig[i].Name + " = " + AnyConverter.toString(theJobConfig[i].Value) );
+ }
+ }
+
+ if (registrationURL==null)
+ throw new com.sun.star.lang.IllegalArgumentException("no registration url");
+
+ boolean local_only = false;
+
+ c = theEnvironment.length;
+ for (int i=0; i<c; ++i) {
+ if( theEnvironment[i].Name.equals("EventName") ) {
+ if( ! AnyConverter.toString(theEnvironment[i].Value).equals("onRegisterNow") ) {
+ local_only = true;
+ }
+ }
+ }
+
+ try {
+
+ /* ensure only one thread accesses/writes registration.xml at a time
+ * regardless how many instances of this Job exist.
+ */
+ synchronized( _serviceName ) {
+
+ File xmlRegData = new File( new URI( urlRegData ) );
+
+ ServiceTag tag = getServiceTagFromRegistrationData(xmlRegData, productURN);
+ if( tag == null ) {
+ tag = ServiceTag.newInstance(
+ ServiceTag.generateInstanceURN(),
+ productName,
+ productVersion,
+ productURN,
+ productParent,
+ productParentURN,
+ productDefinedInstanceID,
+ vendor,
+ System.getProperty("os.arch"),
+ Installer.getZoneName(),
+ productSource);
+
+ theRegistrationData = new RegistrationData();
+ theRegistrationData.addServiceTag(tag);
+ theRegistrationData.storeToXML( new FileOutputStream( xmlRegData ) );
+ }
+
+ // Store the service tag in local registry, which might have been installed later
+ if( Registry.isSupported() ) {
+ // ignore communication failures with local service tag client
+ try {
+ if( Registry.getSystemRegistry().getServiceTag(tag.getInstanceURN()) == null ) {
+ Registry.getSystemRegistry().addServiceTag(tag);
+ }
+ } catch( java.io.IOException e) {
+ e.printStackTrace();
+ } catch (java.lang.RuntimeException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ if( ! local_only ) {
+ registrationURL = registrationURL.replaceAll("\\$\\{registry_urn\\}", theRegistrationData.getRegistrationURN());
+ registrationURL = registrationURL.replaceAll("\\$\\{locale\\}", Locale.getDefault().getLanguage());
+
+ HttpURLConnection con = (HttpURLConnection) new URL(registrationURL).openConnection();
+ con.setDoInput(true);
+ con.setDoOutput(true);
+ con.setUseCaches(false);
+ con.setAllowUserInteraction(false);
+ con.setRequestMethod("POST");
+
+ con.setRequestProperty("Content-Type", "text/xml;charset=\"utf-8\"");
+ try {
+ con.connect();
+
+ OutputStream out = con.getOutputStream();
+ theRegistrationData.storeToXML(out);
+ out.flush();
+ out.close();
+
+ int returnCode = con.getResponseCode();
+// if (returnCode == HttpURLConnection.HTTP_OK);
+ } catch(java.lang.Exception e) {
+ // IOException and UnknownHostException
+ }
+ openBrowser(registrationURL);
+ }
+ } catch (java.net.MalformedURLException e) {
+ e.printStackTrace();
+ throw new com.sun.star.lang.IllegalArgumentException( e.toString() );
+ } catch (java.net.URISyntaxException e) {
+ e.printStackTrace();
+ throw new com.sun.star.lang.IllegalArgumentException( e.toString() );
+ } catch (java.io.IOException e) {
+ e.printStackTrace();
+ throw new com.sun.star.uno.RuntimeException( e.toString() );
+ } catch (java.lang.RuntimeException e) {
+ e.printStackTrace();
+ throw new com.sun.star.uno.RuntimeException( e.toString() );
+ }
+ }
+ }
+}
diff --git a/sj2/source/jscpp/makefile.mk b/desktop/source/registration/com/sun/star/registration/makefile.mk
index 841b775c1176..f20eaf71adce 100644
--- a/sj2/source/jscpp/makefile.mk
+++ b/desktop/source/registration/com/sun/star/registration/makefile.mk
@@ -8,7 +8,7 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.9 $
+# $Revision: 1.2 $
#
# This file is part of OpenOffice.org.
#
@@ -29,29 +29,31 @@
#
#*************************************************************************
-PRJ=..$/..
+PRJNAME = setup_native
+PRJ = ..$/..$/..$/..$/..$/..
+TARGET = productregistration
+PACKAGE = com$/sun$/star$/registration
-PRJNAME=sj2
-TARGET=jscpp
# --- Settings -----------------------------------------------------
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
+.INCLUDE : settings.mk
-# --- Files --------------------------------------------------------
+.IF "$(ENABLE_SVCTAGS)" == "YES"
-.IF "$(GUIBASE)"=="aqua"
-OBJCXXFLAGS=-x objective-c++ -fobjc-exceptions
-CFLAGSCXX+=$(OBJCXXFLAGS)
-.ENDIF # "$(GUIBASE)"=="aqua"
+JARFILES = jurt.jar unoil.jar ridl.jar
+JAVAFILES = \
+ Registration.java
-SLOFILES= \
- $(SLO)$/sjapplet.obj \
- $(SLO)$/sjapplet_impl.obj
+JAVACLASSFILES= $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+JARTARGET = $(TARGET).jar
+JARCOMPRESS = TRUE
+JARCLASSDIRS = $(PACKAGE) com$/sun$/star$/servicetag
+CUSTOMMANIFESTFILE = manifest
+.ENDIF # "$(ENABLE_SVCTAGS)" == "YES"
# --- Targets ------------------------------------------------------
-.INCLUDE : target.mk
-.INCLUDE : $(PRJ)$/util$/target.pmk
+.INCLUDE : target.mk
diff --git a/desktop/source/registration/com/sun/star/registration/manifest b/desktop/source/registration/com/sun/star/registration/manifest
new file mode 100644
index 000000000000..952aaa804e96
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/registration/manifest
@@ -0,0 +1,2 @@
+RegistrationClassName: com.sun.star.registration.Registration
+UNO-Type-Path:
diff --git a/desktop/source/registration/com/sun/star/servicetag/BrowserSupport.java b/desktop/source/registration/com/sun/star/servicetag/BrowserSupport.java
new file mode 100644
index 000000000000..c97d5f2cd4f0
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/servicetag/BrowserSupport.java
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ * 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: BrowserSupport.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package com.sun.star.servicetag;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
+import java.io.IOException;
+import java.net.URI;
+
+/**
+ * BrowserSupport class.
+ *
+ * The implementation of the com.sun.servicetag API needs to be
+ * compiled with JDK 5 as well since the consumer of this API
+ * may require to support JDK 5 (e.g. NetBeans).
+ *
+ * The Desktop.browse() method can be backported in this class
+ * if needed. The current implementation only supports JDK 6.
+ */
+class BrowserSupport {
+ private static boolean isBrowseSupported = false;
+ private static Method browseMethod = null;
+ private static Object desktop = null;
+ private static volatile Boolean result = false;
+
+
+ private static void initX() {
+ if (desktop != null) {
+ return;
+ }
+ boolean supported = false;
+ Method browseM = null;
+ Object desktopObj = null;
+ try {
+ // Determine if java.awt.Desktop is supported
+ Class desktopCls = Class.forName("java.awt.Desktop", true, null);
+ Method getDesktopM = desktopCls.getMethod("getDesktop");
+ browseM = desktopCls.getMethod("browse", URI.class);
+
+ Class actionCls = Class.forName("java.awt.Desktop$Action", true, null);
+ final Method isDesktopSupportedMethod = desktopCls.getMethod("isDesktopSupported");
+ Method isSupportedMethod = desktopCls.getMethod("isSupported", actionCls);
+ Field browseField = actionCls.getField("BROWSE");
+ // isDesktopSupported calls getDefaultToolkit which can block
+ // infinitely, see 6636099 for details, to workaround we call
+ // in a thread and time it out, noting that the issue is specific
+ // to X11, it does not hurt for Windows.
+ Thread xthread = new Thread() {
+ public void run() {
+ try {
+ // support only if Desktop.isDesktopSupported() and
+ // Desktop.isSupported(Desktop.Action.BROWSE) return true.
+ result = (Boolean) isDesktopSupportedMethod.invoke(null);
+ } catch (IllegalAccessException e) {
+ // should never reach here
+ InternalError x =
+ new InternalError("Desktop.getDesktop() method not found");
+ x.initCause(e);
+ } catch (InvocationTargetException e) {
+ // browser not supported
+ if (Util.isVerbose()) {
+ e.printStackTrace();
+ }
+ }
+ }
+ };
+ // set it to daemon, so that the vm will exit.
+ xthread.setDaemon(true);
+ xthread.start();
+ try {
+ xthread.join(5 * 1000);
+ } catch (InterruptedException ie) {
+ // ignore the exception
+ }
+ if (result.booleanValue()) {
+ desktopObj = getDesktopM.invoke(null);
+ result = (Boolean) isSupportedMethod.invoke(desktopObj, browseField.get(null));
+ supported = result.booleanValue();
+ }
+ } catch (ClassNotFoundException e) {
+ // browser not supported
+ if (Util.isVerbose()) {
+ e.printStackTrace();
+ }
+ } catch (NoSuchMethodException e) {
+ // browser not supported
+ if (Util.isVerbose()) {
+ e.printStackTrace();
+ }
+ } catch (NoSuchFieldException e) {
+ // browser not supported
+ if (Util.isVerbose()) {
+ e.printStackTrace();
+ }
+ } catch (IllegalAccessException e) {
+ // should never reach here
+ InternalError x =
+ new InternalError("Desktop.getDesktop() method not found");
+ x.initCause(e);
+ throw x;
+ } catch (InvocationTargetException e) {
+ // browser not supported
+ if (Util.isVerbose()) {
+ e.printStackTrace();
+ }
+ }
+ isBrowseSupported = supported;
+ browseMethod = browseM;
+ desktop = desktopObj;
+ }
+
+ static boolean isSupported() {
+ initX();
+ return isBrowseSupported;
+ }
+
+ /**
+ * Launches the default browser to display a {@code URI}.
+ * If the default browser is not able to handle the specified
+ * {@code URI}, the application registered for handling
+ * {@code URIs} of the specified type is invoked. The application
+ * is determined from the protocol and path of the {@code URI}, as
+ * defined by the {@code URI} class.
+ * <p>
+ * This method calls the Desktop.getDesktop().browse() method.
+ * <p>
+ * @param uri the URI to be displayed in the user default browser
+ *
+ * @throws NullPointerException if {@code uri} is {@code null}
+ * @throws UnsupportedOperationException if the current platform
+ * does not support the {@link Desktop.Action#BROWSE} action
+ * @throws IOException if the user default browser is not found,
+ * or it fails to be launched, or the default handler application
+ * failed to be launched
+ * @throws IllegalArgumentException if the necessary permissions
+ * are not available and the URI can not be converted to a {@code URL}
+ */
+ static void browse(URI uri) throws IOException {
+ if (uri == null) {
+ throw new NullPointerException("null uri");
+ }
+ if (!isSupported()) {
+ throw new UnsupportedOperationException("Browse operation is not supported");
+ }
+
+ // Call Desktop.browse() method
+ try {
+ if (Util.isVerbose()) {
+ System.out.println("desktop: " + desktop + ":browsing..." + uri);
+ }
+ browseMethod.invoke(desktop, uri);
+ } catch (IllegalAccessException e) {
+ // should never reach here
+ InternalError x =
+ new InternalError("Desktop.getDesktop() method not found");
+ x.initCause(e);
+ throw x;
+ } catch (InvocationTargetException e) {
+ Throwable x = e.getCause();
+ if (x != null) {
+ if (x instanceof UnsupportedOperationException) {
+ throw (UnsupportedOperationException) x;
+ } else if (x instanceof IllegalArgumentException) {
+ throw (IllegalArgumentException) x;
+ } else if (x instanceof IOException) {
+ throw (IOException) x;
+ } else if (x instanceof SecurityException) {
+ throw (SecurityException) x;
+ } else {
+ // ignore
+ }
+ }
+ }
+ }
+}
diff --git a/desktop/source/registration/com/sun/star/servicetag/Installer.java b/desktop/source/registration/com/sun/star/servicetag/Installer.java
new file mode 100644
index 000000000000..02825dfec69d
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/servicetag/Installer.java
@@ -0,0 +1,947 @@
+/*************************************************************************
+ *
+ * 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: Installer.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package com.sun.star.servicetag;
+
+import java.io.*;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Properties;
+import java.util.Set;
+import java.util.List;
+import java.util.ArrayList;
+import static com.sun.star.servicetag.Util.*;
+
+/**
+ * Service Tag Installer for Java SE.
+ */
+public class Installer {
+ // System properties for testing
+ private static String SVCTAG_DIR_PATH =
+ "servicetag.dir.path";
+ private static String SVCTAG_ENABLE_REGISTRATION =
+ "servicetag.registration.enabled";
+ private final static String SUN_VENDOR = "Sun Microsystems";
+ private final static String REGISTRATION_XML = "registration.xml";
+ private final static String SERVICE_TAG_FILE = "servicetag";
+ private final static String REGISTRATION_HTML_NAME = "register";
+
+ private final static Locale[] knownSupportedLocales =
+ new Locale[] { Locale.ENGLISH,
+ Locale.JAPANESE,
+ Locale.SIMPLIFIED_CHINESE};
+
+ private final static String javaHome = System.getProperty("java.home");
+ private static File svcTagDir;
+ private static File serviceTagFile;
+ private static File regXmlFile;
+ private static RegistrationData registration;
+ private static boolean supportRegistration;
+ private static String registerHtmlParent;
+ private static Set<Locale> supportedLocales = new HashSet<Locale>();
+ private static Properties swordfishProps = null;
+ private static String[] jreArchs = null;
+ static {
+ String dir = System.getProperty(SVCTAG_DIR_PATH);
+ if (dir == null) {
+ svcTagDir = new File(getJrePath(), "lib" + File.separator + SERVICE_TAG_FILE);
+ } else {
+ svcTagDir = new File(dir);
+ }
+ serviceTagFile = new File(svcTagDir, SERVICE_TAG_FILE);
+ regXmlFile = new File(svcTagDir, REGISTRATION_XML);
+ if (System.getProperty(SVCTAG_ENABLE_REGISTRATION) == null) {
+ supportRegistration = isJdk();
+ } else {
+ supportRegistration = true;
+ }
+ }
+
+ private Installer() {
+ }
+
+ // Implementation of ServiceTag.getJavaServiceTag(String) method
+ static ServiceTag getJavaServiceTag(String source) throws IOException {
+ if (!System.getProperty("java.vendor").startsWith(SUN_VENDOR)) {
+ // Products bundling this implementation may run on
+ // Mac OS which is not a Sun JDK
+ return null;
+ }
+ boolean cleanup = false;
+ try {
+ // Check if we have the swordfish entries for this JRE version
+ if (loadSwordfishEntries() == null) {
+ return null;
+ }
+
+ ServiceTag st = getJavaServiceTag();
+ // Check if the service tag created by this bundle owner
+ if (st != null && st.getSource().equals(source)) {
+ // Install the system service tag if supported
+ // stclient may be installed after the service tag creation
+ if (Registry.isSupported()) {
+ installSystemServiceTag();
+ }
+ return st;
+ }
+
+ // in case any exception thrown during the cleanup
+ cleanup = true;
+
+ // re-create a new one for this bundle owner
+ // first delete the registration data
+ deleteRegistrationData();
+ cleanup = false;
+
+ // create service tag and generate new register.html pages
+ return createServiceTag(source);
+ } finally {
+ if (cleanup) {
+ if (regXmlFile.exists()) {
+ regXmlFile.delete();
+ }
+ if (serviceTagFile.exists()) {
+ serviceTagFile.delete();
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns the Java SE registration data located in
+ * the <JRE>/lib/servicetag/registration.xml by default.
+ *
+ * @throws IllegalArgumentException if the registration data
+ * is of invalid format.
+ */
+ private static synchronized RegistrationData getRegistrationData()
+ throws IOException {
+ if (registration != null) {
+ return registration;
+ }
+ if (regXmlFile.exists()) {
+ BufferedInputStream in = null;
+ try {
+ in = new BufferedInputStream(new FileInputStream(regXmlFile));
+ registration = RegistrationData.loadFromXML(in);
+ } catch (IllegalArgumentException ex) {
+ System.err.println("Error: Bad registration data \"" +
+ regXmlFile + "\":" + ex.getMessage());
+ throw ex;
+ } finally {
+ if (in != null) {
+ in.close();
+ }
+ }
+ } else {
+ registration = new RegistrationData();
+ }
+ return registration;
+ }
+
+ /**
+ * Write the registration data to the registration.xml file.
+ *
+ * The offline registration page has to be regenerated with
+ * the new registration data.
+ *
+ * @throws java.io.IOException
+ */
+ private static synchronized void writeRegistrationXml()
+ throws IOException {
+ if (!svcTagDir.exists()) {
+ // This check is for NetBeans or other products that
+ // bundles this com.sun.servicetag implementation for
+ // pre-6u5 release.
+ if (!svcTagDir.mkdir()) {
+ throw new IOException("Failed to create directory: " + svcTagDir);
+ }
+ }
+
+ // regenerate the new offline registration page
+ deleteRegistrationHtmlPage();
+ getRegistrationHtmlPage();
+
+ BufferedOutputStream out = null;
+ try {
+ out = new BufferedOutputStream(new FileOutputStream(regXmlFile));
+ getRegistrationData().storeToXML(out);
+ } catch (IllegalArgumentException ex) {
+ System.err.println("Error: Bad registration data \"" +
+ regXmlFile + "\":" + ex.getMessage());
+ throw ex;
+ } finally {
+ if (out != null) {
+ out.close();
+ }
+ }
+ }
+
+ /**
+ * Returns the instance urn(s) stored in the servicetag file
+ * or empty set if file not exists.
+ */
+ private static Set<String> getInstalledURNs() throws IOException {
+ Set<String> urnSet = new HashSet<String>();
+ if (serviceTagFile.exists()) {
+ BufferedReader in = null;
+ try {
+ in = new BufferedReader(new FileReader(serviceTagFile));
+ String urn;
+ while ((urn = in.readLine()) != null) {
+ urn = urn.trim();
+ if (urn.length() > 0) {
+ urnSet.add(urn);
+ }
+ }
+ } finally {
+ if (in != null) {
+ in.close();
+ }
+ }
+ }
+ return urnSet;
+ }
+
+ /**
+ * Return the Java SE service tag(s) if it exists.
+ * Typically only one Java SE service tag but it could have two for
+ * Solaris 32-bit and 64-bit on the same install directory.
+ *
+ * @return the service tag(s) for Java SE
+ */
+ private static ServiceTag[] getJavaServiceTagArray() throws IOException {
+ RegistrationData regData = getRegistrationData();
+ Set<ServiceTag> svcTags = regData.getServiceTags();
+ Set<ServiceTag> result = new HashSet<ServiceTag>();
+
+ Properties props = loadSwordfishEntries();
+ String jdkUrn = props.getProperty("servicetag.jdk.urn");
+ String jreUrn = props.getProperty("servicetag.jre.urn");
+ for (ServiceTag st : svcTags) {
+ if (st.getProductURN().equals(jdkUrn) ||
+ st.getProductURN().equals(jreUrn)) {
+ result.add(st);
+ }
+ }
+ return result.toArray(new ServiceTag[0]);
+ }
+
+ /**
+ * Returns the Java SE service tag for this running platform;
+ * or null if not exist.
+ * This method will return the 64-bit service tag if the JDK
+ * supports both 32-bit and 64-bit if already created.
+ */
+ private static ServiceTag getJavaServiceTag() throws IOException {
+ String definedId = getProductDefinedId();
+ for (ServiceTag st : getJavaServiceTagArray()) {
+ if (st.getProductDefinedInstanceID().equals(definedId)) {
+ return st;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Create a service tag for Java SE and install in the system
+ * service tag registry if supported.
+ *
+ * A registration data <JRE>/lib/servicetag/registration.xml
+ * will be created to storeToXML the XML entry for Java SE service tag.
+ * If the system supports service tags, this method will install
+ * the Java SE service tag in the system service tag registry and
+ * its <tt>instance_urn</tt> will be stored to <JRE>/lib/servicetag/servicetag.
+ *
+ * If <JRE>/lib/servicetag/registration.xml exists but is not installed
+ * in the system service tag registry (i.e. servicetag doesn't exist),
+ * this method will install it as described above.
+ *
+ * If the system supports service tag, stclient will be used
+ * to create the Java SE service tag.
+ *
+ * A Solaris 32-bit and 64-bit JDK will be installed in the same
+ * directory but the registration.xml will have 2 service tags.
+ * The servicetag file will also contain 2 instance_urns for that case.
+ */
+ private static ServiceTag createServiceTag(String svcTagSource)
+ throws IOException {
+ // determine if a new service tag is needed to be created
+ ServiceTag newSvcTag = null;
+ if (getJavaServiceTag() == null) {
+ newSvcTag = newServiceTag(svcTagSource);
+ }
+
+ // Add the new service tag in the registration data
+ if (newSvcTag != null) {
+ RegistrationData regData = getRegistrationData();
+
+ // Add the service tag to the registration data in JDK/JRE
+ newSvcTag = regData.addServiceTag(newSvcTag);
+
+ // add if there is a service tag for the OS
+ ServiceTag osTag = SolarisServiceTag.getServiceTag();
+ if (osTag != null && regData.getServiceTag(osTag.getInstanceURN()) == null) {
+ regData.addServiceTag(osTag);
+ }
+ // write to the registration.xml
+ writeRegistrationXml();
+ }
+
+ // Install the system service tag if supported
+ if (Registry.isSupported()) {
+ installSystemServiceTag();
+ }
+ return newSvcTag;
+ }
+
+ private static void installSystemServiceTag() throws IOException {
+ // only install the service tag in the registry if
+ // it has permission to write the servicetag file.
+ if ((!serviceTagFile.exists() && !svcTagDir.canWrite()) ||
+ (serviceTagFile.exists() && !serviceTagFile.canWrite())) {
+ return;
+ }
+
+ Set<String> urns = getInstalledURNs();
+ ServiceTag[] javaSvcTags = getJavaServiceTagArray();
+ if (urns.size() < javaSvcTags.length) {
+ for (ServiceTag st : javaSvcTags) {
+ // Add the service tag in the system service tag registry
+ // if not installed
+ String instanceURN = st.getInstanceURN();
+ if (!urns.contains(instanceURN)) {
+ Registry.getSystemRegistry().addServiceTag(st);
+ }
+ }
+ }
+ writeInstalledUrns();
+ }
+
+ private static ServiceTag newServiceTag(String svcTagSource) throws IOException {
+ // Load the swoRDFish information for the service tag creation
+ Properties props = loadSwordfishEntries();
+
+ // Determine the product URN and name
+ String productURN;
+ String productName;
+
+ if (isJdk()) {
+ // <HOME>/jre exists which implies it's a JDK
+ productURN = props.getProperty("servicetag.jdk.urn");
+ productName = props.getProperty("servicetag.jdk.name");
+ } else {
+ // Otherwise, it's a JRE
+ productURN = props.getProperty("servicetag.jre.urn");
+ productName = props.getProperty("servicetag.jre.name");
+ }
+
+ return ServiceTag.newInstance(ServiceTag.generateInstanceURN(),
+ productName,
+ System.getProperty("java.version"),
+ productURN,
+ props.getProperty("servicetag.parent.name"),
+ props.getProperty("servicetag.parent.urn"),
+ getProductDefinedId(),
+ SUN_VENDOR,
+ System.getProperty("os.arch"),
+ getZoneName(),
+ svcTagSource);
+ }
+
+ /**
+ * Delete the registration data, the offline registration pages and
+ * the service tags in the system service tag registry if installed.
+ *
+ * The registration.xml and servicetag file will be removed.
+ */
+ private static synchronized void deleteRegistrationData()
+ throws IOException {
+ try {
+ // delete the offline registration page
+ deleteRegistrationHtmlPage();
+
+ // Remove the service tag from the system ST registry if exists
+ Set<String> urns = getInstalledURNs();
+ if (urns.size() > 0 && Registry.isSupported()) {
+ for (String u : urns) {
+ Registry.getSystemRegistry().removeServiceTag(u);
+ }
+ }
+ registration = null;
+ } finally {
+ // Delete the registration.xml and servicetag files if exists
+ if (regXmlFile.exists()) {
+ if (!regXmlFile.delete()) {
+ throw new IOException("Failed to delete " + regXmlFile);
+ }
+ }
+ if (serviceTagFile.exists()) {
+ if (!serviceTagFile.delete()) {
+ throw new IOException("Failed to delete " + serviceTagFile);
+ }
+ }
+ }
+ }
+
+ /**
+ * Updates the registration data to contain one single service tag
+ * for the running Java runtime.
+ */
+ private static synchronized void updateRegistrationData(String svcTagSource)
+ throws IOException {
+ RegistrationData regData = getRegistrationData();
+ ServiceTag curSvcTag = newServiceTag(svcTagSource);
+
+ ServiceTag[] javaSvcTags = getJavaServiceTagArray();
+ Set<String> urns = getInstalledURNs();
+ for (ServiceTag st : javaSvcTags) {
+ if (!st.getProductDefinedInstanceID().equals(curSvcTag.getProductDefinedInstanceID())) {
+ String instanceURN = st.getInstanceURN();
+ regData.removeServiceTag(instanceURN);
+
+ // remove it from the system service tag registry if exists
+ if (urns.contains(instanceURN) && Registry.isSupported()) {
+ Registry.getSystemRegistry().removeServiceTag(instanceURN);
+ }
+ }
+ }
+ writeRegistrationXml();
+ writeInstalledUrns();
+ }
+
+ private static void writeInstalledUrns() throws IOException {
+ // if the Registry is not supported,
+ // remove the servicetag file
+ if (!Registry.isSupported() && serviceTagFile.exists()) {
+ serviceTagFile.delete();
+ return;
+ }
+
+ PrintWriter out = null;
+ try {
+ out = new PrintWriter(serviceTagFile);
+
+ ServiceTag[] javaSvcTags = getJavaServiceTagArray();
+ for (ServiceTag st : javaSvcTags) {
+ // Write the instance_run to the servicetag file
+ String instanceURN = st.getInstanceURN();
+ out.println(instanceURN);
+ }
+ } finally {
+ if (out != null) {
+ out.close();
+ }
+ }
+ }
+
+ /**
+ * Load the values associated with the swoRDFish metadata entries
+ * for Java SE. The swoRDFish metadata entries are different for
+ * different release.
+ *
+ * @param version Version of Java SE
+ */
+ private static synchronized Properties loadSwordfishEntries() throws IOException {
+ if (swordfishProps != null) {
+ return swordfishProps;
+ }
+
+ // The version string for Java SE 6 is 1.6.0
+ // We just need the minor number in the version string
+ int version = Util.getJdkVersion();
+
+ String filename = "/com/sun/servicetag/resources/javase_" +
+ version + "_swordfish.properties";
+ InputStream in = Installer.class.getClass().getResourceAsStream(filename);
+ if (in == null) {
+ return null;
+ }
+ swordfishProps = new Properties();
+ try {
+ swordfishProps.load(in);
+ } finally {
+ in.close();
+ }
+ return swordfishProps;
+ }
+
+ /**
+ * Returns the product defined instance ID for Java SE.
+ * It is a list of comma-separated name/value pairs:
+ * "id=<full-version> <arch> [<arch>]*"
+ * "dir=<java.home system property value>"
+ *
+ * where <full-version> is the full version string of the JRE,
+ * <arch> is the architecture that the runtime supports
+ * (i.e. "sparc", "sparcv9", "i386", "amd64" (ISA list))
+ *
+ * For Solaris, it can be dual mode that can support both
+ * 32-bit and 64-bit. the "id" will be set to
+ * "1.6.0_03-b02 sparc sparcv9"
+ *
+ * The "dir" property is included in the service tag to enable
+ * the Service Tag software to determine if a service tag for
+ * Java SE is invalid and perform appropriate service tag
+ * cleanup if necessary. See RFE# 6574781 Service Tags Enhancement.
+ *
+ */
+ private static String getProductDefinedId() {
+ StringBuilder definedId = new StringBuilder();
+ definedId.append("id=");
+ definedId.append(System.getProperty("java.runtime.version"));
+
+ String[] archs = getJreArchs();
+ for (String name : archs) {
+ definedId.append(" " + name);
+ }
+
+ String location = ",dir=" + javaHome;
+ if ((definedId.length() + location.length()) < 256) {
+ definedId.append(",dir=");
+ definedId.append(javaHome);
+ } else {
+ // if it exceeds the limit, we will not include the location
+ if (isVerbose()) {
+ System.err.println("Warning: Product defined instance ID exceeds the field limit:");
+ }
+ }
+
+ return definedId.toString();
+ }
+
+ /**
+ * Returns the architectures that the runtime supports
+ * (i.e. "sparc", "sparcv9", "i386", "amd64" (ISA list))
+ * The directory name where libjava.so is located.
+ *
+ * On Windows, returns the "os.arch" system property value.
+ */
+ private synchronized static String[] getJreArchs() {
+ if (jreArchs != null) {
+ return jreArchs;
+ }
+
+ Set<String> archs = new HashSet<String>();
+
+ String os = System.getProperty("os.name");
+ if (os.equals("SunOS") || os.equals("Linux")) {
+ // Traverse the directories under <JRE>/lib.
+ // If <JRE>/lib/<arch>/libjava.so exists, add <arch>
+ // to the product defined ID
+ File dir = new File(getJrePath() + File.separator + "lib");
+ if (dir.isDirectory()) {
+ String[] children = dir.list();
+ for (String name : children) {
+ File f = new File(dir, name + File.separator + "libjava.so");
+ if (f.exists()) {
+ archs.add(name);
+ }
+ }
+ }
+ } else {
+ // Windows - append the os.arch
+ archs.add(System.getProperty("os.arch"));
+ }
+ jreArchs = archs.toArray(new String[0]);
+ return jreArchs;
+ }
+
+ /**
+ * Return the zonename if zone is supported; otherwise, return
+ * "global".
+ */
+ public static String getZoneName() throws IOException {
+ String zonename = "global";
+
+ String command = "/usr/bin/zonename";
+ File f = new File(command);
+ // com.sun.servicetag package has to be compiled with JDK 5 as well
+ // JDK 5 doesn't support the File.canExecute() method.
+ // Risk not checking isExecute() for the zonename command is very low.
+ if (f.exists()) {
+ ProcessBuilder pb = new ProcessBuilder(command);
+ Process p = pb.start();
+ String output = commandOutput(p);
+ if (p.exitValue() == 0) {
+ zonename = output.trim();
+ }
+
+ }
+ return zonename;
+ }
+
+ private synchronized static String getRegisterHtmlParent() throws IOException {
+ if (registerHtmlParent == null) {
+ File htmlDir; // register.html is put under the JDK directory
+ if (getJrePath().endsWith(File.separator + "jre")) {
+ htmlDir = new File(getJrePath(), "..");
+ } else {
+ // j2se non-image build
+ htmlDir = new File(getJrePath());
+ }
+
+ // initialize the supported locales
+ initSupportedLocales(htmlDir);
+
+ // Determine the location of the offline registration page
+ String path = System.getProperty(SVCTAG_DIR_PATH);
+ if (path == null) {
+ // Default is <JDK>/register.html
+ registerHtmlParent = htmlDir.getCanonicalPath();
+ } else {
+ File f = new File(path);
+ registerHtmlParent = f.getCanonicalPath();
+ if (!f.isDirectory()) {
+ throw new InternalError("Path " + path + " set in \"" +
+ SVCTAG_DIR_PATH + "\" property is not a directory");
+ }
+ }
+ }
+ return registerHtmlParent;
+ }
+
+ /**
+ * Returns the File object of the offline registration page localized
+ * for the default locale in the JDK directory.
+ */
+ static synchronized File getRegistrationHtmlPage() throws IOException {
+ if (!supportRegistration) {
+ // No register.html page generated if JRE
+ return null;
+ }
+
+ String parent = getRegisterHtmlParent();
+
+ // check if the offline registration page is already generated
+ File f = new File(parent, REGISTRATION_HTML_NAME + ".html");
+ if (!f.exists()) {
+ // Generate the localized version of the offline registration Page
+ generateRegisterHtml(parent);
+ }
+
+ String name = REGISTRATION_HTML_NAME;
+ List<Locale> candidateLocales = getCandidateLocales(Locale.getDefault());
+ for (Locale l : candidateLocales) {
+ if (supportedLocales.contains(l)) {
+ name = REGISTRATION_HTML_NAME + "_" + l.toString();
+ break;
+ }
+ }
+ File htmlFile = new File(parent, name + ".html");
+ if (isVerbose()) {
+ System.out.print("Offline registration page: " + htmlFile);
+ System.out.println((htmlFile.exists() ?
+ "" : " not exist. Use register.html"));
+ }
+ if (htmlFile.exists()) {
+ return htmlFile;
+ } else {
+ return new File(parent,
+ REGISTRATION_HTML_NAME + ".html");
+ }
+ }
+
+ private static List<Locale> getCandidateLocales(Locale locale) {
+ String language = locale.getLanguage();
+ String country = locale.getCountry();
+ String variant = locale.getVariant();
+
+ List<Locale> locales = new ArrayList<Locale>(3);
+ if (variant.length() > 0) {
+ locales.add(locale);
+ }
+ if (country.length() > 0) {
+ locales.add((locales.size() == 0) ?
+ locale : new Locale(language, country, ""));
+ }
+ if (language.length() > 0) {
+ locales.add((locales.size() == 0) ?
+ locale : new Locale(language, "", ""));
+ }
+ return locales;
+ }
+
+ // Remove the offline registration pages
+ private static void deleteRegistrationHtmlPage() throws IOException {
+ String parent = getRegisterHtmlParent();
+ if (parent == null) {
+ return;
+ }
+
+ for (Locale locale : supportedLocales) {
+ String name = REGISTRATION_HTML_NAME;
+ if (!locale.equals(Locale.ENGLISH)) {
+ name += "_" + locale.toString();
+ }
+ File f = new File(parent, name + ".html");
+ if (f.exists()) {
+ if (!f.delete()) {
+ throw new IOException("Failed to delete " + f);
+ }
+ }
+ }
+ }
+
+ private static void initSupportedLocales(File jdkDir) {
+ if (supportedLocales.isEmpty()) {
+ // initialize with the known supported locales
+ for (Locale l : knownSupportedLocales) {
+ supportedLocales.add(l);
+ }
+ }
+
+ // Determine unknown supported locales if any
+ // by finding the localized version of README.html
+ // This prepares if a new locale in JDK is supported in
+ // e.g. in the OpenSource world
+ FilenameFilter ff = new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ String fname = name.toLowerCase();
+ if (fname.startsWith("readme") && fname.endsWith(".html")) {
+ return true;
+ }
+ return false;
+ }
+ };
+
+ String[] readmes = jdkDir.list(ff);
+ for (String name : readmes) {
+ String basename = name.substring(0, name.length() - ".html".length());
+ String[] ss = basename.split("_");
+ switch (ss.length) {
+ case 1:
+ // English version
+ break;
+ case 2:
+ supportedLocales.add(new Locale(ss[1]));
+ break;
+ case 3:
+ supportedLocales.add(new Locale(ss[1], ss[2]));
+ break;
+ default:
+ // ignore
+ break;
+ }
+ }
+ if (isVerbose()) {
+ System.out.println("Supported locales: ");
+ for (Locale l : supportedLocales) {
+ System.out.println(l);
+ }
+ }
+ }
+
+ private static final String JDK_HEADER_PNG_KEY = "@@JDK_HEADER_PNG@@";
+ private static final String JDK_VERSION_KEY = "@@JDK_VERSION@@";
+ private static final String REGISTRATION_URL_KEY = "@@REGISTRATION_URL@@";
+ private static final String REGISTRATION_PAYLOAD_KEY = "@@REGISTRATION_PAYLOAD@@";
+
+ @SuppressWarnings("unchecked")
+ private static void generateRegisterHtml(String parent) throws IOException {
+ int version = Util.getJdkVersion();
+ int update = Util.getUpdateVersion();
+ String jdkVersion = "Version " + version;
+ if (update > 0) {
+ // product name is not translated
+ jdkVersion += " Update " + update;
+ }
+ RegistrationData regData = getRegistrationData();
+ String registerURL = SunConnection.getRegistrationURL(
+ regData.getRegistrationURN()).toString();
+ // Make sure it uses the canonical path before getting the URI.
+ File img = new File(svcTagDir.getCanonicalPath(), "jdk_header.png");
+ String headerImageSrc = img.toURI().toString();
+
+ // Format the registration data in one single line
+ StringBuilder payload = new StringBuilder();
+ String xml = regData.toString().replaceAll("\"", "%22");
+ BufferedReader reader = new BufferedReader(new StringReader(xml));
+ try {
+ String line = null;
+ while ((line = reader.readLine()) != null) {
+ payload.append(line.trim());
+ }
+ } finally {
+ reader.close();
+ }
+
+ String resourceFilename = "/com/sun/star/servicetag/resources/register";
+ for (Locale locale : supportedLocales) {
+ String name = REGISTRATION_HTML_NAME;
+ String resource = resourceFilename;
+ if (!locale.equals(Locale.ENGLISH)) {
+ name += "_" + locale.toString();
+ resource += "_" + locale.toString();
+ }
+ File f = new File(parent, name + ".html");
+ InputStream in = null;
+ BufferedReader br = null;
+ PrintWriter pw = null;
+ try {
+ in = Installer.class.getClass().getResourceAsStream(resource + ".html");
+ if (in == null) {
+ // if the resource file is missing
+ if (isVerbose()) {
+ System.out.println("Missing resouce file: " + resource + ".html");
+ }
+ continue;
+ }
+ if (isVerbose()) {
+ System.out.println("Generating " + f + " from " + resource + ".html");
+ }
+
+ br = new BufferedReader(new InputStreamReader(in, "UTF-8"));
+ pw = new PrintWriter(f, "UTF-8");
+ String line = null;
+ while ((line = br.readLine()) != null) {
+ String output = line;
+ if (line.contains(JDK_VERSION_KEY)) {
+ output = line.replace(JDK_VERSION_KEY, jdkVersion);
+ } else if (line.contains(JDK_HEADER_PNG_KEY)) {
+ output = line.replace(JDK_HEADER_PNG_KEY, headerImageSrc);
+ } else if (line.contains(REGISTRATION_URL_KEY)) {
+ output = line.replace(REGISTRATION_URL_KEY, registerURL);
+ } else if (line.contains(REGISTRATION_PAYLOAD_KEY)) {
+ output = line.replace(REGISTRATION_PAYLOAD_KEY, payload.toString());
+ }
+ pw.println(output);
+ }
+ f.setReadOnly();
+ pw.flush();
+ } finally {
+ if (pw != null) {
+ pw.close();
+ }
+ if (in != null) {
+ in.close();
+ }
+ if (br!= null) {
+ br.close();
+ }
+ }
+ }
+ }
+
+ /**
+ * A utility class to create a service tag for Java SE.
+ * <p>
+ * <b>Usage:</b><br>
+ * <blockquote><tt>
+ * &lt;JAVA_HOME&gt;/bin/java com.sun.servicetag.Installer
+ * </tt></blockquote>
+ * <p>
+ */
+ public static void main(String[] args) {
+ String source = "Manual";
+
+ // Parse the options (arguments starting with "-" )
+ boolean delete = false;
+ boolean update = false;
+ boolean register = false;
+ int count = 0;
+ while (count < args.length) {
+ String arg = args[count];
+ if (arg.trim().length() == 0) {
+ // skip empty arguments
+ count++;
+ continue;
+ }
+
+ if (arg.equals("-source")) {
+ source = args[++count];
+ } else if (arg.equals("-delete")) {
+ delete = true;
+ } else if (arg.equals("-register")) {
+ register = true;
+ } else {
+ usage();
+ return;
+ }
+ count++;
+ }
+ try {
+ if (delete) {
+ deleteRegistrationData();
+ } else {
+ ServiceTag[] javaSvcTags = getJavaServiceTagArray();
+ String[] archs = getJreArchs();
+ if (javaSvcTags.length > archs.length) {
+ // 64-bit has been uninstalled
+ // so remove the service tag
+ updateRegistrationData(source);
+ } else {
+ // create the service tag
+ createServiceTag(source);
+ }
+ }
+
+ if (register) {
+ // Registration is only supported by JDK
+ // For testing purpose, override with a "servicetag.enable.registration" property
+
+ RegistrationData regData = getRegistrationData();
+ if (supportRegistration && !regData.getServiceTags().isEmpty()) {
+ SunConnection.register(regData);
+ }
+ }
+ System.exit(0);
+ } catch (IOException e) {
+ System.err.println("I/O Error: " + e.getMessage());
+ if (isVerbose()) {
+ e.printStackTrace();
+ }
+ } catch (IllegalArgumentException ex) {
+ if (isVerbose()) {
+ ex.printStackTrace();
+ }
+ } catch (Exception e) {
+ System.err.println("Error: " + e.getMessage());
+ if (isVerbose()) {
+ e.printStackTrace();
+ }
+ }
+ System.exit(1);
+ }
+
+ private static void usage() {
+ System.out.println("Usage:");
+ System.out.print(" " + Installer.class.getName());
+ System.out.println(" [-delete|-source <source>|-register]");
+ System.out.println(" to create a service tag for the Java platform");
+ System.out.println("");
+ System.out.println("Internal Options:");
+ System.out.println(" -source: to specify the source of the service tag to be created");
+ System.out.println(" -delete: to delete the service tag ");
+ System.out.println(" -register: to register the JDK");
+ System.out.println(" -help: to print this help message");
+ }
+}
diff --git a/desktop/source/registration/com/sun/star/servicetag/LinuxSystemEnvironment.java b/desktop/source/registration/com/sun/star/servicetag/LinuxSystemEnvironment.java
new file mode 100644
index 000000000000..90e38021c103
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/servicetag/LinuxSystemEnvironment.java
@@ -0,0 +1,194 @@
+/*************************************************************************
+ *
+ * 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: LinuxSystemEnvironment.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package com.sun.star.servicetag;
+
+// The Service Tags team maintains the latest version of the implementation
+// for system environment data collection. JDK will include a copy of
+// the most recent released version for a JDK release. We rename
+// the package to com.sun.servicetag so that the Sun Connection
+// product always uses the latest version from the com.sun.scn.servicetags
+// package. JDK and users of the com.sun.servicetag API
+// (e.g. NetBeans and SunStudio) will use the version in JDK.
+
+import java.io.*;
+
+/**
+ * Linux implementation of the SystemEnvironment class.
+ */
+class LinuxSystemEnvironment extends SystemEnvironment {
+ LinuxSystemEnvironment() {
+ setHostId(getLinuxHostId());
+ setSystemModel(getCommandOutput("/bin/uname", "-i"));
+ setSystemManufacturer(getLinuxSystemManufacturer());
+ setCpuManufacturer(getLinuxCpuManufacturer());
+ setSerialNumber(getLinuxSN());
+ }
+ private String dmiInfo = null;
+
+ private static final int SN = 1;
+ private static final int SYS = 2;
+ private static final int CPU = 3;
+
+ private String getLinuxHostId() {
+ String output = getCommandOutput("/usr/bin/hostid");
+ // trim off the leading 0x
+ if (output.startsWith("0x")) {
+ output = output.substring(2);
+ }
+ return output;
+ }
+
+ /**
+ * Tries to obtain and return the cpu manufacturer.
+ * @return The cpu manufacturer (an empty string if not found or an error occurred)
+ */
+ private String getLinuxCpuManufacturer() {
+ String tmp = getLinuxPSNInfo(CPU);
+ if (tmp.length() > 0) {
+ return tmp;
+ }
+
+ String contents = getFileContent("/proc/cpuinfo");
+ for (String line : contents.split("\n")) {
+ if (line.contains("vendor_id")) {
+ String[] ss = line.split(":", 2);
+ if (ss.length > 1) {
+ return ss[1].trim();
+ }
+ }
+ }
+
+ // returns an empty string if it can't be found or an error happened
+ return getLinuxDMIInfo("dmi type 4", "manufacturer");
+ }
+
+
+ /**
+ * Tries to obtain and return the system manufacturer.
+ * @return The system manufacturer (an empty string if not found or an error occurred)
+ */
+ private String getLinuxSystemManufacturer() {
+ String tmp = getLinuxPSNInfo(SYS);
+ if (tmp.length() > 0) {
+ return tmp;
+ }
+
+ // returns an empty string if it can't be found or an error happened
+ return getLinuxDMIInfo("dmi type 1", "manufacturer");
+ }
+
+ /**
+ * Tries to obtain and return the serial number of the system.
+ * @return The serial number (an empty string if not found or an error occurred)
+ */
+ private String getLinuxSN() {
+ String tmp = getLinuxPSNInfo(SN);
+ if (tmp.length() > 0) {
+ return tmp;
+ }
+
+ // returns an empty string if it can't be found or an error happened
+ return getLinuxDMIInfo("dmi type 1", "serial number");
+ }
+
+ private String getLinuxPSNInfo(int target) {
+ // try to read from the psn file if it exists
+ String contents = getFileContent("/var/run/psn");
+ String[] ss = contents.split("\n");
+ if (target <= ss.length) {
+ return ss[target-1];
+ }
+
+ // default case is to return ""
+ return "";
+ }
+
+ // reads from dmidecode with the given type and target
+ // returns an empty string if nothing was found or an error occurred
+ //
+ // Sample output segment:
+ // Handle 0x0001
+ // DMI type 1, 25 bytes.
+ // System Information
+ // Manufacturer: System manufacturer
+ // Product Name: System Product Name
+ // Version: System Version
+ // Serial Number: System Serial Number
+ // UUID: 3091D719-B25B-D911-959D-6D1B12C7686E
+ // Wake-up Type: Power Switch
+
+ private synchronized String getLinuxDMIInfo(String dmiType, String target) {
+ // only try to get dmidecode information once, after that, we can
+ // reuse the output
+ if (dmiInfo == null) {
+ Thread dmidecodeThread = new Thread() {
+ public void run() {
+ dmiInfo = getCommandOutput("/usr/sbin/dmidecode");
+ }
+ };
+ dmidecodeThread.start();
+
+ try {
+ dmidecodeThread.join(2000);
+ if (dmidecodeThread.isAlive()) {
+ dmidecodeThread.interrupt();
+ dmiInfo = "";
+ }
+ } catch (InterruptedException ie) {
+ dmidecodeThread.interrupt();
+ }
+ }
+
+ if (dmiInfo.length() == 0) {
+ return "";
+ }
+ boolean dmiFlag = false;
+ for (String s : dmiInfo.split("\n")) {
+ String line = s.toLowerCase();
+ if (dmiFlag) {
+ if (line.contains(target)) {
+ String key = target + ":";
+ int indx = line.indexOf(key) + key.length();
+ if (line.contains(key) && indx < line.length()) {
+ return line.substring(indx).trim();
+ }
+ String[] ss = line.split(":");
+ return ss[ss.length-1];
+ }
+ } else if (line.contains(dmiType)) {
+ dmiFlag = true;
+ }
+ }
+ return "";
+ }
+
+}
diff --git a/desktop/source/registration/com/sun/star/servicetag/RegistrationData.java b/desktop/source/registration/com/sun/star/servicetag/RegistrationData.java
new file mode 100644
index 000000000000..57be724a78a3
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/servicetag/RegistrationData.java
@@ -0,0 +1,473 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: RegistrationData.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package com.sun.star.servicetag;
+
+import java.io.*;
+import java.net.UnknownHostException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+
+import static com.sun.star.servicetag.RegistrationDocument.*;
+
+/**
+ * A {@code RegistrationData} object is a container of one or more
+ * {@link #getServiceTags service tags} that identify the
+ * components for product registration.
+ * Each {@code RegistrationData} object has a {@link #getRegistrationURN
+ * uniform resource name} (URN) as its identifier.
+ * <a name="EnvMap"></a>
+ * It also has an <i>environment map</i> with
+ * the following elements:
+ * <blockquote>
+ * <table border=0>
+ * <tr>
+ * <td><tt>hostname</tt></td>
+ * <td>Hostname of the system</td>
+ * <td>e.g. woody</td>
+ * </tr>
+ * <tr>
+ * <td><tt>hostId</tt></td>
+ * <td>Host ID of the system</td>
+ * <td>e.g. 83abc1ab</td>
+ * </tr>
+ * <tr>
+ * <td><tt>osName</tt></td>
+ * <td>Operating system name</td>
+ * <td> e.g. SunOS</td>
+ * </tr>
+ * <tr>
+ * <td><tt>osVersion</tt></td>
+ * <td>Operating system version</td>
+ * <td> e.g. 5.10</td>
+ * </tr>
+ * <tr>
+ * <td><tt>osArchitecture</tt></td>
+ * <td>Operating system architecture</td>
+ * <td> e.g. sparc</td>
+ * </tr>
+ * <tr>
+ * <td><tt>systemModel</tt></td>
+ * <td>System model</td>
+ * <td> e.g. SUNW,Sun-Fire-V440</td>
+ * </tr>
+ * <tr>
+ * <td><tt>systemManufacturer</tt></td>
+ * <td>System manufacturer</td>
+ * <td> e.g. Sun Microsystems</td>
+ * </tr>
+ * <tr>
+ * <td><tt>cpuManufacturer</tt></td>
+ * <td>CPU manufacturer</td>
+ * <td> e.g. Sun Microsystems</td>
+ * </tr>
+ * <tr>
+ * <td><tt>serialNumber</tt></td>
+ * <td>System serial number</td>
+ * <td> e.g. BEL078932</td>
+ * </tr>
+ * </table>
+ * </blockquote>
+ * The <tt>hostname</tt> and <tt>osName</tt> element must have a non-empty value.
+ * If an element is not available on a system and their value will be
+ * empty.
+ * <p>
+ * <a name="XMLSchema">
+ * <b>Registration XML Schema</b></a>
+ * <p>
+ * A {@code RegistrationData} object can be {@link #loadFromXML loaded} from
+ * and {@link #storeToXML stored} into an XML file in the format described
+ * by the
+ * <a href="https://sn-tools.central.sun.com/twiki/pub/ServiceTags/RegistrationRelayService/product_registration.xsd">
+ * registration data schema</a>. The registration data schema is defined by the
+ * Service Tags Technology.
+ * <p>
+ * Typically the registration data is constructed at installation time
+ * and stored in an XML file for later service tag lookup or registration.
+ *
+ * <p>
+ * <b>Example Usage</b>
+ * <p>
+ * The examples below show how the {@code RegistrationData} can be
+ * used for product registration.
+ * Exception handling is not shown in these examples for clarity.
+ * <ol>
+ * <li>This example shows how the JDK creates a JDK service tag, installs it
+ * in the system service tag registry and adds it to the registration data.
+ * <br>
+ * <blockquote><pre>
+ * // create a service tag object with an instance_urn
+ * ServiceTag st = ServiceTag.newInstance(ServiceTag.generateInstanceURN(),
+ * ....);
+ * // Adds to the system service tag registry if supported
+ * if (Registry.isSupported()) {
+ * Registry.getSystemRegistry().addServiceTag(st);
+ * }
+ *
+ * // add to the registration data
+ * RegistrationData registration = new RegistrationData();
+ * registration.addServiceTag(st);
+ * </pre></blockquote>
+ * </li>
+ * <li>At this point, the registration data is ready to
+ * send to Sun Connection for registration. This example shows how to register
+ * the JDK via the <i>Registration Relay Service</i>.
+ * <p>
+ * There are several registration services for Sun Connection. For example,
+ * the <a href="https://sn-tools.central.sun.com/twiki/bin/view/ServiceTags/RegistrationRelayService">
+ * Registration Relay Service</a> is a web application interface that
+ * processes the registration data payload sent via HTTP post
+ * and hosts the registration user interface for a specified
+ * registration URL. Refer to the
+ * Registration Relay Service Specification for details.
+ * <p>
+ * <blockquote><pre>
+ * // Open the connection to the URL of the registration service
+ * HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
+ * con.setDoInput(true);
+ * con.setDoOutput(true);
+ * con.setUseCaches(false);
+ * con.setAllowUserInteraction(false);
+ * con.setRequestMethod("POST");
+ * con.setRequestProperty("Content-Type", "text/xml;charset=\"utf-8\"");
+ * con.connect();
+ *
+ * // send the registration data to the registration service
+ * OutputStream out = con.getOutputStream();
+ * registration.storeToXML(out);
+ * out.close();
+ * </pre></blockquote>
+ * </li>
+ * <li>This example shows how to store the registration data in an XML file.
+ * for later service tag lookup or registration.
+ * <br>
+ * <blockquote><pre>
+ * BufferedOutputStream out = new BufferedOutputStream(
+ * new FileOutputStream(""&lt;JAVA_HOME&gt;/lib/servicetag/registration.xml"));
+ * registration.storeToXML(out);
+ * out.close();
+ * </pre></blockquote>
+ * </li>
+ * <li>This example shows how to install service tags that are in the
+ * registration data in the system service tag registry when determined
+ * to be available. The system service tag registry might not have existed
+ * when the registration data was constructed.
+ * <br>
+ * <blockquote><pre>
+ * if (Registry.isSupported()) {
+ * Set&lt;ServiceTag&gt; svctags = registration.getServiceTags();
+ * for (ServiceTag st : svctags) {
+ * Registry.getSystemRegistry().addServiceTag(st);
+ * }
+ * }
+ * </pre></blockquote>
+ * </li>
+ * </ol>
+ *
+ * @see <a href="https://sunconnection.sun.com/inventory">Sun Connection Inventory Channel</a>
+ */
+public class RegistrationData {
+ private final Map<String, String> environment;
+ private final Map<String, ServiceTag> svcTagMap;
+ private final String urn;
+
+ /**
+ * Creates a {@code RegistrationData} object with a generated
+ * {@link #getRegistrationURN registration URN}.
+ * The following keys in the {@link #getEnvironmentMap environment map}
+ * will be initialized for the configuration of the
+ * running system:
+ * <blockquote>
+ * <tt>hostname</tt>, <tt>osName</tt>, <tt>osVersion</tt> and
+ * <tt>osArchitecture</tt>
+ * </blockquote>
+ * and the value of other keys may be empty.
+ */
+ public RegistrationData() {
+ this(Util.generateURN());
+ }
+
+ // package private
+ RegistrationData(String urn) {
+ this.urn = urn;
+ this.environment = initEnvironment();
+ this.svcTagMap = new LinkedHashMap<String, ServiceTag>();
+ }
+
+ private Map<String, String> initEnvironment() {
+ Map<String, String> map = new LinkedHashMap<String, String>();
+ SystemEnvironment sysEnv = SystemEnvironment.getSystemEnvironment();
+ map.put(ST_NODE_HOSTNAME, sysEnv.getHostname());
+ map.put(ST_NODE_HOST_ID, sysEnv.getHostId());
+ map.put(ST_NODE_OS_NAME, sysEnv.getOsName());
+ map.put(ST_NODE_OS_VERSION, sysEnv.getOsVersion());
+ map.put(ST_NODE_OS_ARCH, sysEnv.getOsArchitecture());
+ map.put(ST_NODE_SYSTEM_MODEL, sysEnv.getSystemModel());
+ map.put(ST_NODE_SYSTEM_MANUFACTURER, sysEnv.getSystemManufacturer());
+ map.put(ST_NODE_CPU_MANUFACTURER, sysEnv.getCpuManufacturer());
+ map.put(ST_NODE_SERIAL_NUMBER, sysEnv.getSerialNumber());
+ return map;
+ }
+
+ /**
+ * Returns the uniform resource name of this registration data
+ * in this format:
+ * <tt>urn:st:&lt;32-char {@link java.util.UUID uuid}&gt;</tt>
+ *
+ * @return the URN of this registration data.
+ */
+ public String getRegistrationURN() {
+ return urn;
+ }
+
+ /**
+ * Returns a map containing the environment information for this
+ * registration data. See the set of <a href="#EnvMap">keys</a>
+ * in the environment map. Subsequent update to the environment
+ * map via the {@link #setEnvironment setEnvironment} method will not be reflected
+ * in the returned map.
+ *
+ * @return an environment map for this registration data.
+ */
+ public Map<String, String> getEnvironmentMap() {
+ return new LinkedHashMap<String,String>(environment);
+ }
+
+ /**
+ * Sets an element of the specified {@code name} in the environment map
+ * with the given {@code value}.
+ *
+ * @throws IllegalArgumentException if {@code name} is not a valid key
+ * in the environment map, or {@code value} is not valid.
+ */
+ public void setEnvironment(String name, String value) {
+ if (name == null) {
+ throw new NullPointerException("name is null");
+ }
+ if (value == null) {
+ throw new NullPointerException("value is null");
+ }
+ if (environment.containsKey(name)) {
+ if (name.equals(ST_NODE_HOSTNAME) || name.equals(ST_NODE_OS_NAME)) {
+ if (value.length() == 0) {
+ throw new IllegalArgumentException("\"" +
+ name + "\" requires non-empty value.");
+ }
+ }
+ environment.put(name, value);
+ } else {
+ throw new IllegalArgumentException("\"" +
+ name + "\" is not an environment element.");
+ }
+ }
+
+ /**
+ * Returns all service tags in this registration data.
+ *
+ * @return a {@link Set Set} of the service tags
+ * in this registration data.
+ */
+ public Set<ServiceTag> getServiceTags() {
+ return new HashSet<ServiceTag>(svcTagMap.values());
+ }
+
+ /**
+ * Adds a service tag to this registration data.
+ * If the given service tag has an empty <tt>instance_urn</tt>,
+ * this method will generate a URN and place it in the copy
+ * of the service tag in this registration data.
+ * This method will return the {@code ServiceTag} object
+ * added to this registration data.
+ *
+ * @param st {@code ServiceTag} object to be added.
+ * @return a {@code ServiceTag} object added to this registration data.
+ *
+ * @throws IllegalArgumentException if
+ * a service tag of the same {@link ServiceTag#getInstanceURN
+ * <tt>instance_urn</tt>} already exists in the registry.
+ */
+ public synchronized ServiceTag addServiceTag(ServiceTag st) {
+ ServiceTag svcTag = ServiceTag.newInstanceWithUrnTimestamp(st);
+
+ String instanceURN = svcTag.getInstanceURN();
+ if (svcTagMap.containsKey(instanceURN)) {
+ throw new IllegalArgumentException("Instance_urn = " + instanceURN +
+ " already exists in the registration data.");
+ } else {
+ svcTagMap.put(instanceURN, svcTag);
+ }
+ return svcTag;
+ }
+
+ /**
+ * Returns a service tag of the given <tt>instance_urn</tt> in this registration
+ * data.
+ *
+ * @param instanceURN the <tt>instance_urn</tt> of the service tag
+ * @return the {@code ServiceTag} object of the given <tt>instance_urn</tt>
+ * if exists; otherwise return {@code null}.
+ */
+ public synchronized ServiceTag getServiceTag(String instanceURN) {
+ if (instanceURN == null) {
+ throw new NullPointerException("instanceURN is null");
+ }
+ return svcTagMap.get(instanceURN);
+ }
+
+ /**
+ * Removes a service tag of the given <tt>instance_urn</tt> from this
+ * registration data.
+ *
+ * @param instanceURN the <tt>instance_urn</tt> of
+ * the service tag to be removed.
+ *
+ * @return the removed {@code ServiceTag} object;
+ * or {@code null} if the service tag does not exist in this
+ * registration data.
+ */
+ public synchronized ServiceTag removeServiceTag(String instanceURN) {
+ if (instanceURN == null) {
+ throw new NullPointerException("instanceURN is null");
+ }
+
+ ServiceTag svcTag = null;
+ if (svcTagMap.containsKey(instanceURN)) {
+ svcTag = svcTagMap.remove(instanceURN);
+ }
+ return svcTag;
+ }
+
+ /**
+ * Updates the <tt>product_defined_instance_id</tt> in the service tag
+ * of the given <tt>instance_urn</tt> in this registration data.
+ *
+ * @param instanceURN the <tt>instance_urn</tt> of the service tag to be updated.
+ * @param productDefinedInstanceID the value of the
+ * <tt>product_defined_instance_id</tt> to be set.
+ *
+ * @return the updated {@code ServiceTag} object;
+ * or {@code null} if the service tag does not exist in this
+ * registration data.
+ */
+ public synchronized ServiceTag updateServiceTag(String instanceURN,
+ String productDefinedInstanceID) {
+ ServiceTag svcTag = getServiceTag(instanceURN);
+ if (svcTag == null) {
+ return null;
+ }
+
+ svcTag = ServiceTag.newInstanceWithUrnTimestamp(svcTag);
+ // update the product defined instance ID field
+ svcTag.setProductDefinedInstanceID(productDefinedInstanceID);
+ svcTagMap.put(instanceURN, svcTag);
+ return svcTag;
+ }
+
+ /**
+ * Reads the registration data from the XML document on the
+ * specified input stream. The XML document must be
+ * in the format described by the <a href="#XMLSchema">
+ * registration data schema</a>.
+ * The specified stream is closed after this method returns.
+ *
+ * @param in the input stream from which to read the XML document.
+ * @return a {@code RegistrationData} object read from the input
+ * stream.
+ *
+ * @throws IllegalArgumentException if the input stream
+ * contains an invalid registration data.
+ *
+ * @throws IOException if an error occurred when reading from the input stream.
+ */
+ public static RegistrationData loadFromXML(InputStream in) throws IOException {
+ try {
+ return RegistrationDocument.load(in);
+ } finally {
+ in.close();
+ }
+ }
+
+ /**
+ * Writes the registration data to the specified output stream
+ * in the format described by the <a href="#XMLSchema">
+ * registration data schema</a> with "UTF-8" encoding.
+ * The specified stream remains open after this method returns.
+ *
+ * @param os the output stream on which to write the XML document.
+ *
+ * @throws IOException if an error occurred when writing to the output stream.
+ */
+ public void storeToXML(OutputStream os) throws IOException {
+ RegistrationDocument.store(os, this);
+ os.flush();
+ }
+
+ /**
+ * Returns a newly allocated byte array containing the registration
+ * data in XML format.
+ *
+ * @return a newly allocated byte array containing the registration
+ * data in XML format.
+ */
+ public byte[] toXML() {
+ try {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ storeToXML(out);
+ return out.toByteArray();
+ } catch (IOException e) {
+ // should not reach here
+ return new byte[0];
+ }
+ }
+
+ /**
+ * Returns a string representation of this registration data in XML
+ * format.
+ *
+ * @return a string representation of this registration data in XML
+ * format.
+ */
+ @Override
+ public String toString() {
+ try {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ storeToXML(out);
+ return out.toString("UTF-8");
+ } catch (IOException e) {
+ // should not reach here
+ return "Error creating the return string.";
+ }
+ }
+}
diff --git a/desktop/source/registration/com/sun/star/servicetag/RegistrationDocument.java b/desktop/source/registration/com/sun/star/servicetag/RegistrationDocument.java
new file mode 100644
index 000000000000..240eebf4e65c
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/servicetag/RegistrationDocument.java
@@ -0,0 +1,374 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: RegistrationDocument.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package com.sun.star.servicetag;
+
+import java.io.*;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+import org.xml.sax.InputSource;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+// For write operation
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+/**
+ * XML Support Class for Product Registration.
+ */
+class RegistrationDocument {
+
+ private static final String REGISTRATION_DATA_SCHEMA =
+ "/com/sun/star/servicetag/resources/product_registration.xsd";
+ private static final String REGISTRATION_DATA_VERSION = "1.0";
+ private static final String SERVICE_TAG_VERSION = "1.0";
+ final static String ST_NODE_REGISTRATION_DATA = "registration_data";
+ final static String ST_ATTR_REGISTRATION_VERSION = "version";
+ final static String ST_NODE_ENVIRONMENT = "environment";
+ final static String ST_NODE_HOSTNAME = "hostname";
+ final static String ST_NODE_HOST_ID = "hostId";
+ final static String ST_NODE_OS_NAME = "osName";
+ final static String ST_NODE_OS_VERSION = "osVersion";
+ final static String ST_NODE_OS_ARCH = "osArchitecture";
+ final static String ST_NODE_SYSTEM_MODEL = "systemModel";
+ final static String ST_NODE_SYSTEM_MANUFACTURER = "systemManufacturer";
+ final static String ST_NODE_CPU_MANUFACTURER = "cpuManufacturer";
+ final static String ST_NODE_SERIAL_NUMBER = "serialNumber";
+ final static String ST_NODE_REGISTRY = "registry";
+ final static String ST_ATTR_REGISTRY_URN = "urn";
+ final static String ST_ATTR_REGISTRY_VERSION = "version";
+ final static String ST_NODE_SERVICE_TAG = "service_tag";
+ final static String ST_NODE_INSTANCE_URN = "instance_urn";
+ final static String ST_NODE_PRODUCT_NAME = "product_name";
+ final static String ST_NODE_PRODUCT_VERSION = "product_version";
+ final static String ST_NODE_PRODUCT_URN = "product_urn";
+ final static String ST_NODE_PRODUCT_PARENT_URN = "product_parent_urn";
+ final static String ST_NODE_PRODUCT_PARENT = "product_parent";
+ final static String ST_NODE_PRODUCT_DEFINED_INST_ID = "product_defined_inst_id";
+ final static String ST_NODE_PRODUCT_VENDOR = "product_vendor";
+ final static String ST_NODE_PLATFORM_ARCH = "platform_arch";
+ final static String ST_NODE_TIMESTAMP = "timestamp";
+ final static String ST_NODE_CONTAINER = "container";
+ final static String ST_NODE_SOURCE = "source";
+ final static String ST_NODE_INSTALLER_UID = "installer_uid";
+
+ static RegistrationData load(InputStream in) throws IOException {
+ Document document = initializeDocument(in);
+
+ // Gets the registration URN
+ Element root = getRegistrationDataRoot(document);
+ Element registryRoot =
+ getSingletonElementFromRoot(root, ST_NODE_REGISTRY);
+ String urn = registryRoot.getAttribute(ST_ATTR_REGISTRY_URN);
+
+ // Construct a new RegistrationData object from the DOM tree
+ // Initialize the environment map and service tags
+ RegistrationData regData = new RegistrationData(urn);
+ addServiceTags(registryRoot, regData);
+
+ Element envRoot = getSingletonElementFromRoot(root, ST_NODE_ENVIRONMENT);
+ buildEnvironmentMap(envRoot, regData);
+ return regData;
+ }
+
+ static void store(OutputStream os, RegistrationData registration)
+ throws IOException {
+ // create a new document with the root node
+ Document document = initializeDocument();
+
+ // create the nodes for the environment map and the service tags
+ // in the registration data
+ addEnvironmentNodes(document,
+ registration.getEnvironmentMap());
+ addServiceTagRegistry(document,
+ registration.getRegistrationURN(),
+ registration.getServiceTags());
+ transform(document, os);
+ }
+
+ // initialize a document from an input stream
+ private static Document initializeDocument(InputStream in) throws IOException {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ try {
+ // XML schema for validation
+ SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ URL xsdUrl = RegistrationDocument.class.getResource(REGISTRATION_DATA_SCHEMA);
+ Schema schema = sf.newSchema(xsdUrl);
+ Validator validator = schema.newValidator();
+
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Document doc = builder.parse(new InputSource(in));
+ validator.validate(new DOMSource(doc));
+ return doc;
+ } catch (SAXException sxe) {
+ IllegalArgumentException e = new IllegalArgumentException("Error generated in parsing");
+ e.initCause(sxe);
+ throw e;
+ } catch (ParserConfigurationException pce) {
+ // Parser with specific options can't be built
+ // should not reach here
+ InternalError x = new InternalError("Error in creating the new document");
+ x.initCause(pce);
+ throw x;
+ }
+ }
+
+ // initialize a new document for the registration data
+ private static Document initializeDocument() throws IOException {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ try {
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Document doc = builder.newDocument();
+
+ // initialize the document with the registration_data root
+ Element root = doc.createElement(ST_NODE_REGISTRATION_DATA);
+ doc.appendChild(root);
+ root.setAttribute(ST_ATTR_REGISTRATION_VERSION, REGISTRATION_DATA_VERSION);
+
+ return doc;
+ } catch (ParserConfigurationException pce) {
+ // Parser with specified options can't be built
+ // should not reach here
+ InternalError x = new InternalError("Error in creating the new document");
+ x.initCause(pce);
+ throw x;
+ }
+ }
+
+ // Transform the current DOM tree with the given output stream.
+ private static void transform(Document document, OutputStream os) {
+ try {
+ // Use a Transformer for output
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+ tFactory.setAttribute("indent-number", new Integer(3));
+
+ Transformer transformer = tFactory.newTransformer();
+
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+ transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
+ transformer.setOutputProperty(OutputKeys.STANDALONE, "yes");
+ transformer.transform(new DOMSource(document),
+ new StreamResult(new BufferedWriter(new OutputStreamWriter(os, "UTF-8"))));
+ } catch (UnsupportedEncodingException ue) {
+ // Should not reach here
+ InternalError x = new InternalError("Error generated during transformation");
+ x.initCause(ue);
+ throw x;
+ } catch (TransformerConfigurationException tce) {
+ // Error generated by the parser
+ // Should not reach here
+ InternalError x = new InternalError("Error in creating the new document");
+ x.initCause(tce);
+ throw x;
+ } catch (TransformerException te) {
+ // Error generated by the transformer
+ InternalError x = new InternalError("Error generated during transformation");
+ x.initCause(te);
+ throw x;
+ }
+ }
+
+ private static void addServiceTagRegistry(Document document,
+ String registryURN,
+ Set<ServiceTag> svcTags) {
+ // add service tag registry node and its attributes
+ Element reg = document.createElement(ST_NODE_REGISTRY);
+ reg.setAttribute(ST_ATTR_REGISTRY_URN, registryURN);
+ reg.setAttribute(ST_ATTR_REGISTRY_VERSION, SERVICE_TAG_VERSION);
+
+ Element root = getRegistrationDataRoot(document);
+ root.appendChild(reg);
+
+ // adds the elements for the service tags
+ for (ServiceTag st : svcTags) {
+ addServiceTagElement(document, reg, st);
+ }
+ }
+
+ private static void addServiceTagElement(Document document,
+ Element registryRoot,
+ ServiceTag st) {
+ Element svcTag = document.createElement(ST_NODE_SERVICE_TAG);
+ registryRoot.appendChild(svcTag);
+ addChildElement(document, svcTag,
+ ST_NODE_INSTANCE_URN, st.getInstanceURN());
+ addChildElement(document, svcTag,
+ ST_NODE_PRODUCT_NAME, st.getProductName());
+ addChildElement(document, svcTag,
+ ST_NODE_PRODUCT_VERSION, st.getProductVersion());
+ addChildElement(document, svcTag,
+ ST_NODE_PRODUCT_URN, st.getProductURN());
+ addChildElement(document, svcTag,
+ ST_NODE_PRODUCT_PARENT_URN, st.getProductParentURN());
+ addChildElement(document, svcTag,
+ ST_NODE_PRODUCT_PARENT, st.getProductParent());
+ addChildElement(document, svcTag,
+ ST_NODE_PRODUCT_DEFINED_INST_ID,
+ st.getProductDefinedInstanceID());
+ addChildElement(document, svcTag,
+ ST_NODE_PRODUCT_VENDOR, st.getProductVendor());
+ addChildElement(document, svcTag,
+ ST_NODE_PLATFORM_ARCH, st.getPlatformArch());
+ addChildElement(document, svcTag,
+ ST_NODE_TIMESTAMP, Util.formatTimestamp(st.getTimestamp()));
+ addChildElement(document, svcTag,
+ ST_NODE_CONTAINER, st.getContainer());
+ addChildElement(document, svcTag,
+ ST_NODE_SOURCE, st.getSource());
+ addChildElement(document, svcTag,
+ ST_NODE_INSTALLER_UID,
+ String.valueOf(st.getInstallerUID()));
+ }
+
+ private static void addChildElement(Document document, Element root,
+ String element, String text) {
+ Element node = document.createElement(element);
+ node.appendChild(document.createTextNode(text));
+ root.appendChild(node);
+ }
+
+ // Constructs service tags from the document
+ private static void addServiceTags(Element registryRoot,
+ RegistrationData registration) {
+ NodeList children = registryRoot.getElementsByTagName(ST_NODE_SERVICE_TAG);
+ int length = (children == null ? 0 : children.getLength());
+ for (int i = 0; i < length; i++) {
+ Element svcTagElement = (Element) children.item(i);
+ ServiceTag st = getServiceTag(svcTagElement);
+ registration.addServiceTag(st);
+ }
+ }
+
+ // build environment map from the document
+ private static void buildEnvironmentMap(Element envRoot,
+ RegistrationData registration) {
+ registration.setEnvironment(ST_NODE_HOSTNAME, getTextValue(envRoot, ST_NODE_HOSTNAME));
+ registration.setEnvironment(ST_NODE_HOST_ID, getTextValue(envRoot, ST_NODE_HOST_ID));
+ registration.setEnvironment(ST_NODE_OS_NAME, getTextValue(envRoot, ST_NODE_OS_NAME));
+ registration.setEnvironment(ST_NODE_OS_VERSION, getTextValue(envRoot, ST_NODE_OS_VERSION));
+ registration.setEnvironment(ST_NODE_OS_ARCH, getTextValue(envRoot, ST_NODE_OS_ARCH));
+ registration.setEnvironment(ST_NODE_SYSTEM_MODEL, getTextValue(envRoot, ST_NODE_SYSTEM_MODEL));
+ registration.setEnvironment(ST_NODE_SYSTEM_MANUFACTURER, getTextValue(envRoot, ST_NODE_SYSTEM_MANUFACTURER));
+ registration.setEnvironment(ST_NODE_CPU_MANUFACTURER, getTextValue(envRoot, ST_NODE_CPU_MANUFACTURER));
+ registration.setEnvironment(ST_NODE_SERIAL_NUMBER, getTextValue(envRoot, ST_NODE_SERIAL_NUMBER));
+ }
+
+ // add the nodes representing the environment map in the document
+ private static void addEnvironmentNodes(Document document,
+ Map<String, String> envMap) {
+ Element root = getRegistrationDataRoot(document);
+ Element env = document.createElement(ST_NODE_ENVIRONMENT);
+ root.appendChild(env);
+ Set<Map.Entry<String, String>> keys = envMap.entrySet();
+ for (Map.Entry<String, String> entry : keys) {
+ addChildElement(document, env, entry.getKey(), entry.getValue());
+ }
+ }
+
+ private static Element getRegistrationDataRoot(Document doc) {
+ Element root = doc.getDocumentElement();
+ if (!root.getNodeName().equals(ST_NODE_REGISTRATION_DATA)) {
+ throw new IllegalArgumentException("Not a " +
+ ST_NODE_REGISTRATION_DATA +
+ " node \"" + root.getNodeName() + "\"");
+ }
+ return root;
+ }
+
+ private static Element getSingletonElementFromRoot(Element root, String name) {
+ NodeList children = root.getElementsByTagName(name);
+ int length = (children == null ? 0 : children.getLength());
+ if (length != 1) {
+ throw new IllegalArgumentException("Invalid number of " + name +
+ " nodes = " + length);
+ }
+ Element e = (Element) children.item(0);
+ if (!e.getNodeName().equals(name)) {
+ throw new IllegalArgumentException("Not a " + name +
+ " node \"" + e.getNodeName() + "\"");
+ }
+ return e;
+ }
+
+ // Constructs one ServiceTag instance from a service tag element root
+ private static ServiceTag getServiceTag(Element svcTagElement) {
+ return new ServiceTag(
+ getTextValue(svcTagElement, ST_NODE_INSTANCE_URN),
+ getTextValue(svcTagElement, ST_NODE_PRODUCT_NAME),
+ getTextValue(svcTagElement, ST_NODE_PRODUCT_VERSION),
+ getTextValue(svcTagElement, ST_NODE_PRODUCT_URN),
+ getTextValue(svcTagElement, ST_NODE_PRODUCT_PARENT),
+ getTextValue(svcTagElement, ST_NODE_PRODUCT_PARENT_URN),
+ getTextValue(svcTagElement, ST_NODE_PRODUCT_DEFINED_INST_ID),
+ getTextValue(svcTagElement, ST_NODE_PRODUCT_VENDOR),
+ getTextValue(svcTagElement, ST_NODE_PLATFORM_ARCH),
+ getTextValue(svcTagElement, ST_NODE_CONTAINER),
+ getTextValue(svcTagElement, ST_NODE_SOURCE),
+ Util.getIntValue(getTextValue(svcTagElement, ST_NODE_INSTALLER_UID)),
+ Util.parseTimestamp(getTextValue(svcTagElement, ST_NODE_TIMESTAMP))
+ );
+ }
+
+ private static String getTextValue(Element e, String tagName) {
+ String value = "";
+ NodeList nl = e.getElementsByTagName(tagName);
+ if (nl != null && nl.getLength() > 0) {
+ Element el = (Element) nl.item(0);
+ Node node = el.getFirstChild();
+ if (node != null) {
+ value = node.getNodeValue();
+ }
+ }
+ return value;
+ }
+}
diff --git a/desktop/source/registration/com/sun/star/servicetag/Registry.java b/desktop/source/registration/com/sun/star/servicetag/Registry.java
new file mode 100644
index 000000000000..c118dc2e2575
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/servicetag/Registry.java
@@ -0,0 +1,558 @@
+/*************************************************************************
+ *
+ * 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: Registry.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package com.sun.star.servicetag;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import static com.sun.star.servicetag.Util.*;
+import static com.sun.star.servicetag.RegistrationDocument.*;
+
+/**
+ * A service tag registry is a XML-based registry containing
+ * the list of {@link ServiceTag service tags} installed in the system.
+ * The {@code Registry} class provides interfaces
+ * to add, remove, update, and get a service tag from a service tag
+ * registry.
+ * This {@code Registry} class may not be supported
+ * on all systems. The {@link #isSupported} method
+ * can be called to determine if it is supported.
+ * <p>
+ * A registry may implement restrictions to only allow certain users
+ * to {@link #updateServiceTag update} and
+ * to {@link #removeServiceTag remove} a service tag record. Typically,
+ * only the owner of the service tag, the owner of the registry
+ * and superuser are authorized to update or remove a service tag in
+ * the registry.
+ *
+ * @see <a href="https://sn-tools.central.sun.com/twiki/bin/view/ServiceTags/ServiceTagDevGuideHelper">
+ * Service Tag User Guide</a>
+ */
+public class Registry {
+
+ private static final String STCLIENT_SOLARIS = "/usr/bin/stclient";
+ private static final String STCLIENT_LINUX = "/opt/sun/servicetag/bin/stclient";
+ // stclient exit value (see sthelper.h)
+ private static final int ST_ERR_NOT_AUTH = 245;
+ private static final int ST_ERR_REC_NOT_FOUND = 225;
+
+ // The stclient output has to be an exported interface
+ private static final String INSTANCE_URN_DESC = "Product instance URN=";
+ private static boolean initialized = false;
+ private static boolean supportsHelperClass = true; // default
+ private static File stclient = null;
+ private static String stclientPath = null;
+ private static Registry registry = new Registry();
+
+ // System properties for testing
+ private static String SVCTAG_STCLIENT_CMD = "servicetag.stclient.cmd";
+ private static String SVCTAG_STHELPER_SUPPORTED = "servicetag.sthelper.supported";
+
+ private Registry() {
+ }
+
+ private synchronized static String getSTclient() {
+ if (!initialized) {
+ // the system property always overrides the default setting
+ if (System.getProperty(SVCTAG_STHELPER_SUPPORTED) != null) {
+ supportsHelperClass = Boolean.getBoolean(SVCTAG_STHELPER_SUPPORTED);
+ }
+
+ // This is only used for testing
+ stclientPath = System.getProperty(SVCTAG_STCLIENT_CMD);
+ if (stclientPath != null) {
+ return stclientPath;
+ }
+
+ // Initialization to determine the platform's stclient pathname
+ String os = System.getProperty("os.name");
+ if (os.equals("SunOS")) {
+ stclient = new File(STCLIENT_SOLARIS);
+ } else if (os.equals("Linux")) {
+ stclient = new File(STCLIENT_LINUX);
+ } else if (os.startsWith("Windows")) {
+ stclient = getWindowsStClientFile();
+ } else {
+ if (isVerbose()) {
+ System.out.println("Running on non-Sun JDK");
+ }
+ }
+ initialized = true;
+ }
+
+ // com.sun.servicetag package has to be compiled with JDK 5 as well
+ // JDK 5 doesn't support the File.canExecute() method.
+ // Risk not checking isExecute() for the stclient command is very low.
+
+ if (stclientPath == null && stclient != null && stclient.exists()) {
+ stclientPath = stclient.getAbsolutePath();
+ }
+ return stclientPath;
+ }
+
+ /**
+ * Returns the system service tag registry. The {@code Registry} class
+ * may not be supported on some platforms; use the {@link #isSupported}
+ * method to determine if it is supported.
+ *
+ * @return the {@code Registry} object for the system service tag registry.
+ *
+ * @throws UnsupportedOperationException if the {@code Registry} class is
+ * not supported.
+ */
+ public static Registry getSystemRegistry() {
+ if (isSupported()) {
+ return registry;
+ } else {
+ throw new UnsupportedOperationException("Registry class is not supported");
+ }
+ }
+
+ /**
+ * Returns {@code true} if the {@code Registry} class is supported on this system.
+ *
+ * @return {@code true} if the {@code Registry} class is supported;
+ * otherwise, return {@code false}.
+ */
+ public static boolean isSupported() {
+ return (getSTclient() != null && supportsHelperClass);
+ }
+
+ private static List<String> getCommandList() {
+ // Set up the arguments to call stclient
+ List<String> command = new ArrayList<String>();
+ if (System.getProperty(SVCTAG_STCLIENT_CMD) != null) {
+ // This is for jtreg testing use. This will be set to something
+ // like:
+ // $JAVA_HOME/bin/java -cp $TEST_DIR \
+ // -Dstclient.registry.path=$TEST_DIR/registry.xml \
+ // SvcTagClient
+ //
+ // On Windows, the JAVA_HOME and TEST_DIR path could contain
+ // space e.g. c:\Program Files\Java\jdk1.6.0_05\bin\java.
+ // The SVCTAG_STCLIENT_CMD must be set with a list of
+ // space-separated parameters. If a parameter contains spaces,
+ // it must be quoted with '"'.
+
+ String cmd = getSTclient();
+ int len = cmd.length();
+ int i = 0;
+ while (i < len) {
+ char separator = ' ';
+ if (cmd.charAt(i) == '"') {
+ separator = '"';
+ i++;
+ }
+ // look for the separator or matched the closing '"'
+ int j;
+ for (j = i+1; j < len; j++) {
+ if (cmd.charAt(j) == separator) {
+ break;
+ }
+ }
+
+ if (i == j-1) {
+ // add an empty parameter
+ command.add("\"\"");
+ } else {
+ // double quotes and space are not included
+ command.add(cmd.substring(i,j));
+ }
+
+ // skip spaces
+ for (i = j+1; i < len; i++) {
+ if (!Character.isSpaceChar(cmd.charAt(i))) {
+ break;
+ }
+ }
+ }
+ if (isVerbose()) {
+ System.out.println("Command list:");
+ for (String s : command) {
+ System.out.println(s);
+ }
+ }
+ } else {
+ command.add(getSTclient());
+ }
+ return command;
+ }
+
+ // Returns null if the service tag record not found;
+ // or throw UnauthorizedAccessException or IOException
+ // based on the exitValue.
+ private static ServiceTag checkReturnError(int exitValue,
+ String output,
+ ServiceTag st) throws IOException {
+ switch (exitValue) {
+ case ST_ERR_REC_NOT_FOUND:
+ return null;
+ case ST_ERR_NOT_AUTH:
+ if (st != null) {
+ throw new UnauthorizedAccessException(
+ "Not authorized to access " + st.getInstanceURN() +
+ " installer_uid=" + st.getInstallerUID());
+ } else {
+ throw new UnauthorizedAccessException(
+ "Not authorized:" + output);
+ }
+ default:
+ throw new IOException("stclient exits with error" +
+ " (" + exitValue + ")\n" + output);
+ }
+ }
+
+ /**
+ * Adds a service tag to this registry.
+ * If the given service tag has an empty <tt>instance_urn</tt>,
+ * this helper class will generate a URN and place it in the
+ * copy of the service tag in this registry.
+ * This method will return the {@code ServiceTag} representing
+ * the service tag entry to this registry.
+ *
+ * @param st {@code ServiceTag} object
+ * @return a {@code ServiceTag} object representing the service tag
+ * entry to this registry.
+ *
+ * @throws IllegalArgumentException if a service tag of the same
+ * <tt>instance_urn</tt> already exists in this registry.
+ *
+ * @throws java.io.IOException if an I/O error occurs in this operation.
+ */
+ public ServiceTag addServiceTag(ServiceTag st) throws IOException {
+ List<String> command = getCommandList();
+ command.add("-a");
+ if (st.getInstanceURN().length() > 0) {
+ ServiceTag sysSvcTag = getServiceTag(st.getInstanceURN());
+ if (sysSvcTag != null) {
+ throw new IllegalArgumentException("Instance_urn = " +
+ st.getInstanceURN() + " already exists");
+ }
+ command.add("-i");
+ command.add(st.getInstanceURN());
+ }
+ command.add("-p");
+ command.add(st.getProductName());
+ command.add("-e");
+ command.add(st.getProductVersion());
+ command.add("-t");
+ command.add(st.getProductURN());
+ if (st.getProductParentURN().length() > 0) {
+ command.add("-F");
+ command.add(st.getProductParentURN());
+ }
+ command.add("-P");
+ command.add(st.getProductParent());
+ if (st.getProductDefinedInstanceID().length() > 0) {
+ command.add("-I");
+ command.add(st.getProductDefinedInstanceID());
+ }
+ command.add("-m");
+ command.add(st.getProductVendor());
+ command.add("-A");
+ command.add(st.getPlatformArch());
+ command.add("-z");
+ command.add(st.getContainer());
+ command.add("-S");
+ command.add(st.getSource());
+
+ BufferedReader in = null;
+ try {
+ ProcessBuilder pb = new ProcessBuilder(command);
+ Process p = pb.start();
+ String output = commandOutput(p);
+ if (isVerbose()) {
+ System.out.println("Output from stclient -a command:");
+ System.out.println(output);
+ }
+ String urn = "";
+ if (p.exitValue() == 0) {
+ // Obtain the instance urn from the stclient output
+ in = new BufferedReader(new StringReader(output));
+ String line = null;
+ while ((line = in.readLine()) != null) {
+ line = line.trim();
+ if (line.startsWith(INSTANCE_URN_DESC)) {
+ urn = line.substring(INSTANCE_URN_DESC.length());
+ break;
+ }
+ }
+ if (urn.length() == 0) {
+ throw new IOException("Error in creating service tag:\n" +
+ output);
+ }
+ return getServiceTag(urn);
+ } else {
+ return checkReturnError(p.exitValue(), output, st);
+ }
+ } finally {
+ if (in != null) {
+ in.close();
+ }
+ }
+ }
+
+ /**
+ * Removes a service tag of the given <tt>instance_urn</tt> from this
+ * registry.
+ *
+ * @param instanceURN the <tt>instance_urn</tt> of the service tag
+ * to be removed.
+ *
+ * @return the {@code ServiceTag} object removed from this registry;
+ * or {@code null} if the service tag does not exist in this registry.
+ *
+ * @throws UnauthorizedAccessException if the user is not authorized to
+ * remove the service tag of the given <tt>instance_urn</tt>
+ * from this registry.
+ *
+ * @throws java.io.IOException if an I/O error occurs in this operation.
+ */
+ public ServiceTag removeServiceTag(String instanceURN) throws IOException {
+ ServiceTag st = getServiceTag(instanceURN);
+ if (st == null) {
+ return null;
+ }
+
+ List<String> command = getCommandList();
+ command.add("-d");
+ command.add("-i");
+ command.add(instanceURN);
+
+ ProcessBuilder pb = new ProcessBuilder(command);
+ Process p = pb.start();
+ String output = commandOutput(p);
+ if (isVerbose()) {
+ System.out.println("Output from stclient -d command:");
+ System.out.println(output);
+ }
+ if (p.exitValue() == 0) {
+ return st;
+ } else {
+ return checkReturnError(p.exitValue(), output, st);
+ }
+ }
+
+ /**
+ * Updates the <tt>product_defined_instance_id</tt> in the service tag
+ * of the specified <tt>instance_urn</tt> in this registry.
+ *
+ * @param instanceURN the <tt>instance_urn</tt> of the service tag to be updated.
+ * @param productDefinedInstanceID the value of the
+ * <tt>product_defined_instance_id</tt> to be set.
+ *
+ * @return the updated {@code ServiceTag} object;
+ * or {@code null} if the service tag does not exist in this
+ * registry.
+ *
+ * @throws UnauthorizedAccessException if the user is not authorized to
+ * update the service tag from this registry.
+ *
+ * @throws IOException if an I/O error occurs in this operation.
+ */
+ public ServiceTag updateServiceTag(String instanceURN,
+ String productDefinedInstanceID)
+ throws IOException {
+ ServiceTag svcTag = getServiceTag(instanceURN);
+ if (svcTag == null) {
+ return null;
+ }
+
+ List<String> command = getCommandList();
+ command.add("-u");
+ command.add("-i");
+ command.add(instanceURN);
+ command.add("-I");
+ if (productDefinedInstanceID.length() > 0) {
+ command.add(productDefinedInstanceID);
+ } else {
+ command.add("\"\"");
+ }
+
+ ProcessBuilder pb = new ProcessBuilder(command);
+ Process p = pb.start();
+ String output = commandOutput(p);
+ if (isVerbose()) {
+ System.out.println("Output from stclient -u command:");
+ System.out.println(output);
+ }
+
+ if (p.exitValue() == 0) {
+ return getServiceTag(instanceURN);
+ } else {
+ return checkReturnError(p.exitValue(), output, svcTag);
+ }
+ }
+
+ /**
+ * Returns a {@code ServiceTag} object of the given <tt>instance_urn</tt>
+ * in this registry.
+ *
+ * @param instanceURN the <tt>instance_urn</tt> of the service tag
+ * @return a {@code ServiceTag} object of the given <tt>instance_urn</tt>
+ * in this registry; or {@code null} if not found.
+ *
+ * @throws java.io.IOException if an I/O error occurs in this operation.
+ */
+ public ServiceTag getServiceTag(String instanceURN) throws IOException {
+ if (instanceURN == null) {
+ throw new NullPointerException("instanceURN is null");
+ }
+
+ List<String> command = getCommandList();
+ command.add("-g");
+ command.add("-i");
+ command.add(instanceURN);
+
+ ProcessBuilder pb = new ProcessBuilder(command);
+ Process p = pb.start();
+ String output = commandOutput(p);
+ if (isVerbose()) {
+ System.out.println("Output from stclient -g command:");
+ System.out.println(output);
+ }
+ if (p.exitValue() == 0) {
+ return parseServiceTag(output);
+ } else {
+ return checkReturnError(p.exitValue(), output, null);
+ }
+ }
+
+ private ServiceTag parseServiceTag(String output) throws IOException {
+ BufferedReader in = null;
+ try {
+ Properties props = new Properties();
+ // parse the service tag output from stclient
+ in = new BufferedReader(new StringReader(output));
+ String line = null;
+ while ((line = in.readLine()) != null) {
+ if ((line = line.trim()).length() > 0) {
+ String[] ss = line.trim().split("=", 2);
+ if (ss.length == 2) {
+ props.setProperty(ss[0].trim(), ss[1].trim());
+ } else {
+ props.setProperty(ss[0].trim(), "");
+ }
+ }
+ }
+
+ String urn = props.getProperty(ST_NODE_INSTANCE_URN);
+ String productName = props.getProperty(ST_NODE_PRODUCT_NAME);
+ String productVersion = props.getProperty(ST_NODE_PRODUCT_VERSION);
+ String productURN = props.getProperty(ST_NODE_PRODUCT_URN);
+ String productParent = props.getProperty(ST_NODE_PRODUCT_PARENT);
+ String productParentURN = props.getProperty(ST_NODE_PRODUCT_PARENT_URN);
+ String productDefinedInstanceID =
+ props.getProperty(ST_NODE_PRODUCT_DEFINED_INST_ID);
+ String productVendor = props.getProperty(ST_NODE_PRODUCT_VENDOR);
+ String platformArch = props.getProperty(ST_NODE_PLATFORM_ARCH);
+ String container = props.getProperty(ST_NODE_CONTAINER);
+ String source = props.getProperty(ST_NODE_SOURCE);
+ int installerUID =
+ Util.getIntValue(props.getProperty(ST_NODE_INSTALLER_UID));
+ Date timestamp =
+ Util.parseTimestamp(props.getProperty(ST_NODE_TIMESTAMP));
+
+ return new ServiceTag(urn,
+ productName,
+ productVersion,
+ productURN,
+ productParent,
+ productParentURN,
+ productDefinedInstanceID,
+ productVendor,
+ platformArch,
+ container,
+ source,
+ installerUID,
+ timestamp);
+ } finally {
+ if (in != null) {
+ in.close();
+ }
+ }
+
+ }
+
+ /**
+ * Returns the service tags of the specified
+ * <tt>product_urn</tt> in this registry.
+ *
+ * @param productURN the <tt>product_urn</tt> to look up
+ * @return a {@code Set} of {@code ServiceTag} objects
+ * of the specified <tt>product_urn</tt> in this registry.
+ *
+ * @throws java.io.IOException if an I/O error occurs in this operation.
+ */
+ public Set<ServiceTag> findServiceTags(String productURN) throws IOException {
+ if (productURN == null) {
+ throw new NullPointerException("productURN is null");
+ }
+
+ List<String> command = getCommandList();
+ command.add("-f");
+ command.add("-t");
+ command.add(productURN);
+
+ BufferedReader in = null;
+ try {
+ ProcessBuilder pb = new ProcessBuilder(command);
+ Process p = pb.start();
+ String output = commandOutput(p);
+
+ Set<ServiceTag> instances = new HashSet<ServiceTag>();
+ if (p.exitValue() == 0) {
+ // parse the service tag output from stclient
+ in = new BufferedReader(new StringReader(output));
+ String line = null;
+ while ((line = in.readLine()) != null) {
+ String s = line.trim();
+ if (s.startsWith("urn:st:")) {
+ instances.add(getServiceTag(s));
+ }
+ }
+ } else {
+ checkReturnError(p.exitValue(), output, null);
+ }
+ return instances;
+ } finally {
+ if (in != null) {
+ in.close();
+ }
+ }
+ }
+}
diff --git a/desktop/source/registration/com/sun/star/servicetag/ServiceTag.java b/desktop/source/registration/com/sun/star/servicetag/ServiceTag.java
new file mode 100644
index 000000000000..4b2be9ff8cc2
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/servicetag/ServiceTag.java
@@ -0,0 +1,640 @@
+/*************************************************************************
+ *
+ * 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: ServiceTag.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package com.sun.star.servicetag;
+
+import java.util.Date;
+import java.io.IOException;
+import static com.sun.star.servicetag.RegistrationDocument.*;
+
+/**
+ * A service tag is an XML-based data structure that identifies a product or
+ * a component on a system. The service tag schema is defined by the
+ * Service Tags Technology. The location of the DTD file is platform dependent.
+ * On Solaris, see <tt>/usr/share/lib/xml/dtd/servicetag.dtd</tt>.
+ * <p>
+ * A valid {@code ServiceTag} instance must comply to the service tag schema
+ * and contain the following fields:
+ * <ul>
+ * <li>{@link #getInstanceURN <tt>instance_urn</tt>}</li>
+ * <li>{@link #getProductName <tt>product_name</tt>}</li>
+ * <li>{@link #getProductVersion <tt>product_version</tt>}</li>
+ * <li>{@link #getProductURN <tt>product_urn</tt>}</li>
+ * <li>{@link #getProductParent <tt>product_parent</tt>}</li>
+ * <li>{@link #getProductParentURN <tt>product_parent_urn</tt>}</li>
+ * <li>{@link #getProductDefinedInstanceID <tt>product_defined_inst_id</tt>}</li>
+ * <li>{@link #getProductVendor <tt>product_vendor</tt>}</li>
+ * <li>{@link #getPlatformArch <tt>platform_arch</tt>}</li>
+ * <li>{@link #getContainer <tt>container</tt>}</li>
+ * <li>{@link #getSource <tt>source</tt>}</li>
+ * <li>{@link #getInstallerUID <tt>installer_uid</tt>}</li>
+ * <li>{@link #getTimestamp <tt>timestamp</tt>}</li>
+ * </ul>
+ *
+ * The <tt>instance_urn</tt> can be specified when a {@code ServiceTag}
+ * object is created, or it can be generated when it is added to
+ * a {@link RegistrationData} object, or {@link Registry
+ * system service tag registry}. The <tt>installer_uid</tt> and
+ * <tt>timestamp</tt> are set when a {@code ServiceTag} object
+ * is added to a {@link RegistrationData} object, or {@link Registry
+ * system service tag registry}.
+ *
+ * @see <a href="https://sunconnection.sun.com/FAQ/sc_faq.html">Service Tags FAQ</a>
+ */
+public class ServiceTag {
+
+ private String instanceURN;
+ private String productName;
+ private String productVersion;
+ private String productURN;
+ private String productParent;
+ private String productParentURN;
+ private String productDefinedInstanceID;
+ private String productVendor;
+ private String platformArch;
+ private String container;
+ private String source;
+ private int installerUID;
+ private Date timestamp;
+
+ // Service Tag Field Lengths (defined in sthelper.h)
+ // Since the constants defined in sthelper.h includes the null-terminated
+ // character, so minus 1 from the sthelper.h defined values.
+ private final int MAX_URN_LEN = 256 - 1;
+ private final int MAX_PRODUCT_NAME_LEN = 256 - 1;
+ private final int MAX_PRODUCT_VERSION_LEN = 64 - 1;
+ private final int MAX_PRODUCT_PARENT_LEN = 256 - 1;
+ private final int MAX_PRODUCT_VENDOR_LEN = 64 - 1;
+ private final int MAX_PLATFORM_ARCH_LEN = 64 - 1;
+ private final int MAX_CONTAINER_LEN = 64 - 1;
+ private final int MAX_SOURCE_LEN = 64 - 1;
+
+ // private constructors
+ private ServiceTag() {
+ }
+ // package private
+ ServiceTag(String instanceURN,
+ String productName,
+ String productVersion,
+ String productURN,
+ String productParent,
+ String productParentURN,
+ String productDefinedInstanceID,
+ String productVendor,
+ String platformArch,
+ String container,
+ String source,
+ int installerUID,
+ Date timestamp) {
+ setInstanceURN(instanceURN);
+ setProductName(productName);
+ setProductVersion(productVersion);
+ setProductURN(productURN);
+ setProductParentURN(productParentURN);
+ setProductParent(productParent);
+ setProductDefinedInstanceID(productDefinedInstanceID);
+ setProductVendor(productVendor);
+ setPlatformArch(platformArch);
+ setContainer(container);
+ setSource(source);
+ setInstallerUID(installerUID);
+ setTimestamp(timestamp);
+ }
+
+ /**
+ * Creates a service tag object with no <tt>instance_urn</tt>.
+ *
+ * @param productName the name of the product.
+ * @param productVersion the version of the product.
+ * @param productURN the uniform resource name of the product
+ * @param productParent the name of the product's parent.
+ * @param productParentURN the uniform resource name of the product's parent.
+ * @param productDefinedInstanceID the instance identifier.
+ * @param productVendor the vendor of the product.
+ * @param platformArch the operating system architecture.
+ * @param container the container of the product.
+ * @param source the source of the product.
+ *
+ * @throws IllegalArgumentException if any value of the input fields
+ * does not conform to the service tag XML schema.
+ */
+ public static ServiceTag newInstance(String productName,
+ String productVersion,
+ String productURN,
+ String productParent,
+ String productParentURN,
+ String productDefinedInstanceID,
+ String productVendor,
+ String platformArch,
+ String container,
+ String source) {
+ return new ServiceTag("", /* empty instance_urn */
+ productName,
+ productVersion,
+ productURN,
+ productParent,
+ productParentURN,
+ productDefinedInstanceID,
+ productVendor,
+ platformArch,
+ container,
+ source,
+ -1,
+ null);
+ }
+
+ /**
+ * Creates a service tag object with a specified <tt>instance_urn</tt>.
+ *
+ * @param instanceURN the uniform resource name of this instance.
+ * @param productName the name of the product.
+ * @param productVersion the version of the product.
+ * @param productURN the uniform resource name of the product
+ * @param productParent the name of the product's parent.
+ * @param productParentURN the uniform resource name of the product's parent.
+ * @param productDefinedInstanceID the instance identifier.
+ * @param productVendor the vendor of the product.
+ * @param platformArch the operating system architecture.
+ * @param container the container of the product.
+ * @param source the source of the product.
+ *
+ * @throws IllegalArgumentException if any value of the input fields
+ * does not conform to the service tag XML schema.
+ */
+ public static ServiceTag newInstance(String instanceURN,
+ String productName,
+ String productVersion,
+ String productURN,
+ String productParent,
+ String productParentURN,
+ String productDefinedInstanceID,
+ String productVendor,
+ String platformArch,
+ String container,
+ String source) {
+ return new ServiceTag(instanceURN,
+ productName,
+ productVersion,
+ productURN,
+ productParent,
+ productParentURN,
+ productDefinedInstanceID,
+ productVendor,
+ platformArch,
+ container,
+ source,
+ -1,
+ null);
+ }
+
+ // Creates a copy of the ServiceTag instance
+ // with instance_urn and timestamp initialized
+ static ServiceTag newInstanceWithUrnTimestamp(ServiceTag st) {
+ String instanceURN =
+ (st.getInstanceURN().length() == 0 ? Util.generateURN() :
+ st.getInstanceURN());
+ ServiceTag svcTag = new ServiceTag(instanceURN,
+ st.getProductName(),
+ st.getProductVersion(),
+ st.getProductURN(),
+ st.getProductParent(),
+ st.getProductParentURN(),
+ st.getProductDefinedInstanceID(),
+ st.getProductVendor(),
+ st.getPlatformArch(),
+ st.getContainer(),
+ st.getSource(),
+ st.getInstallerUID(),
+ new Date());
+ return svcTag;
+ }
+
+ /**
+ * Returns a uniform resource name (URN) in this format:
+ * <blockquote>
+ * "<tt>urn:st:<32-char {@link java.util.UUID uuid}></tt>"
+ * </blockquote>
+ * @return a URN.
+ */
+ public static String generateInstanceURN() {
+ return Util.generateURN();
+ }
+
+ /**
+ * Returns the uniform resource name of this service tag instance.
+ *
+ * @return the <tt>instance_urn</tt> of this service tag.
+ */
+ public String getInstanceURN() {
+ return instanceURN;
+ }
+
+ /**
+ * Returns the name of the product.
+ *
+ * @return the product name.
+ */
+ public String getProductName() {
+ return productName;
+ }
+
+ /**
+ * Returns the version of the product.
+ *
+ * @return the product version.
+ */
+ public String getProductVersion() {
+ return productVersion;
+ }
+
+ /**
+ * Returns the uniform resource name of the product.
+ *
+ * @return the product URN.
+ */
+ public String getProductURN() {
+ return productURN;
+ }
+
+ /**
+ * Returns the uniform resource name of the product's parent.
+ *
+ * @return the product's parent URN.
+ */
+ public String getProductParentURN() {
+ return productParentURN;
+ }
+
+ /**
+ * Returns the name of the product's parent.
+ *
+ * @return the product's parent name.
+ */
+ public String getProductParent() {
+ return productParent;
+ }
+
+ /**
+ * Returns the identifier defined for this product instance.
+ *
+ * @return the identifier defined for this product instance.
+ */
+ public String getProductDefinedInstanceID() {
+ return productDefinedInstanceID;
+ }
+
+ /**
+ * Returns the vendor of the product.
+ *
+ * @return the product vendor.
+ */
+ public String getProductVendor() {
+ return productVendor;
+ }
+
+ /**
+ * Returns the platform architecture on which the product
+ * is running on.
+ *
+ * @return the platform architecture on which the product is running on.
+ */
+ public String getPlatformArch() {
+ return platformArch;
+ }
+
+ /**
+ * Returns the timestamp. This timestamp is set when this service tag
+ * is added to or updated in a {@code RegistrationData} object or
+ * the system service tag registry.
+ * This method may return {@code null}.
+ *
+ * @return timestamp when this service tag
+ * is added to or updated in a {@code RegistrationData} object or
+ * the system service tag registry, or {@code null}.
+ */
+ public Date getTimestamp() {
+ if (timestamp != null) {
+ return (Date) timestamp.clone();
+ } else {
+ return null;
+ }
+ }
+
+
+ /**
+ * Returns the container of the product.
+ *
+ * @return the container of the product.
+ */
+ public String getContainer() {
+ return container;
+ }
+
+ /**
+ * Returns the source of this service tag.
+ *
+ * @return source of this service tag.
+ */
+ public String getSource() {
+ return source;
+ }
+
+ /**
+ * Returns the UID. The UID is set when this service tag
+ * is added to or updated in the system service tag registry.
+ * This is platform dependent whose default value is {@code -1}.
+ * When this service tag is added to a {@code RegistrationData},
+ * the UID is not set.
+ *
+ * @return the UID of whom this service tag
+ * is added to or updated in the system service tag registry,
+ * or {@code -1}.
+ */
+ public int getInstallerUID() {
+ return installerUID;
+ }
+
+ // The following setter methods are used to validate the
+ // input field when constructing a ServiceTag instance
+
+ private void setInstanceURN(String instanceURN) {
+ if (instanceURN == null) {
+ throw new NullPointerException("Parameter instanceURN cannot be null");
+ }
+ if (instanceURN.length() > MAX_URN_LEN) {
+ throw new IllegalArgumentException("instanceURN \"" + instanceURN +
+ "\" exceeds maximum length " + MAX_URN_LEN);
+ }
+ this.instanceURN = instanceURN;
+ }
+
+ private void setProductName(String productName) {
+ if (productName == null) {
+ throw new NullPointerException("Parameter productName cannot be null");
+ }
+ if (productName.length() == 0) {
+ throw new IllegalArgumentException("product name cannot be empty");
+ }
+ if (productName.length() > MAX_PRODUCT_NAME_LEN) {
+ throw new IllegalArgumentException("productName \"" + productName +
+ "\" exceeds maximum length " + MAX_PRODUCT_NAME_LEN);
+ }
+ this.productName = productName;
+ }
+
+ private void setProductVersion(String productVersion) {
+ if (productVersion == null) {
+ throw new NullPointerException("Parameter productVersion cannot be null");
+ }
+
+ if (productVersion.length() == 0) {
+ throw new IllegalArgumentException("product version cannot be empty");
+ }
+ if (productVersion.length() > MAX_PRODUCT_VERSION_LEN) {
+ throw new IllegalArgumentException("productVersion \"" +
+ productVersion + "\" exceeds maximum length " +
+ MAX_PRODUCT_VERSION_LEN);
+ }
+ this.productVersion = productVersion;
+ }
+
+ private void setProductURN(String productURN) {
+ if (productURN == null) {
+ throw new NullPointerException("Parameter productURN cannot be null");
+ }
+ if (productURN.length() == 0) {
+ throw new IllegalArgumentException("product URN cannot be empty");
+ }
+ if (productURN.length() > MAX_URN_LEN) {
+ throw new IllegalArgumentException("productURN \"" + productURN +
+ "\" exceeds maximum length " + MAX_URN_LEN);
+ }
+ this.productURN = productURN;
+ }
+
+ private void setProductParentURN(String productParentURN) {
+ if (productParentURN == null) {
+ throw new NullPointerException("Parameter productParentURN cannot be null");
+ }
+ // optional field - can be empty
+ if (productParentURN.length() > MAX_URN_LEN) {
+ throw new IllegalArgumentException("productParentURN \"" +
+ productParentURN + "\" exceeds maximum length " +
+ MAX_URN_LEN);
+ }
+ this.productParentURN = productParentURN;
+ }
+
+ private void setProductParent(String productParent) {
+ if (productParent == null) {
+ throw new NullPointerException("Parameter productParent cannot be null");
+ }
+ if (productParent.length() == 0) {
+ throw new IllegalArgumentException("product parent cannot be empty");
+ }
+ if (productParent.length() > MAX_PRODUCT_PARENT_LEN) {
+ throw new IllegalArgumentException("productParent \"" +
+ productParent + "\" exceeds maximum length " +
+ MAX_PRODUCT_PARENT_LEN);
+ }
+ this.productParent = productParent;
+ }
+
+ void setProductDefinedInstanceID(String productDefinedInstanceID) {
+ if (productDefinedInstanceID == null) {
+ throw new NullPointerException("Parameter productDefinedInstanceID cannot be null");
+ }
+ if (productDefinedInstanceID.length() > MAX_URN_LEN) {
+ throw new IllegalArgumentException("productDefinedInstanceID \"" +
+ productDefinedInstanceID + "\" exceeds maximum length " +
+ MAX_URN_LEN);
+ }
+ // optional field - can be empty
+ this.productDefinedInstanceID = productDefinedInstanceID;
+ }
+
+ private void setProductVendor(String productVendor) {
+ if (productVendor == null) {
+ throw new NullPointerException("Parameter productVendor cannot be null");
+ }
+ if (productVendor.length() == 0) {
+ throw new IllegalArgumentException("product vendor cannot be empty");
+ }
+ if (productVendor.length() > MAX_PRODUCT_VENDOR_LEN) {
+ throw new IllegalArgumentException("productVendor \"" +
+ productVendor + "\" exceeds maximum length " +
+ MAX_PRODUCT_VENDOR_LEN);
+ }
+ this.productVendor = productVendor;
+ }
+
+ private void setPlatformArch(String platformArch) {
+ if (platformArch == null) {
+ throw new NullPointerException("Parameter platformArch cannot be null");
+ }
+ if (platformArch.length() == 0) {
+ throw new IllegalArgumentException("platform architecture cannot be empty");
+ }
+ if (platformArch.length() > MAX_PLATFORM_ARCH_LEN) {
+ throw new IllegalArgumentException("platformArch \"" +
+ platformArch + "\" exceeds maximum length " +
+ MAX_PLATFORM_ARCH_LEN);
+ }
+ this.platformArch = platformArch;
+ }
+
+ private void setTimestamp(Date timestamp) {
+ // can be null
+ this.timestamp = timestamp;
+ }
+
+ private void setContainer(String container) {
+ if (container == null) {
+ throw new NullPointerException("Parameter container cannot be null");
+ }
+ if (container.length() == 0) {
+ throw new IllegalArgumentException("container cannot be empty");
+ }
+ if (container.length() > MAX_CONTAINER_LEN) {
+ throw new IllegalArgumentException("container \"" +
+ container + "\" exceeds maximum length " +
+ MAX_CONTAINER_LEN);
+ }
+ this.container = container;
+ }
+
+ private void setSource(String source) {
+ if (source == null) {
+ throw new NullPointerException("Parameter source cannot be null");
+ }
+ if (source.length() == 0) {
+ throw new IllegalArgumentException("source cannot be empty");
+ }
+ if (source.length() > MAX_SOURCE_LEN) {
+ throw new IllegalArgumentException("source \"" + source +
+ "\" exceeds maximum length " + MAX_SOURCE_LEN);
+ }
+ this.source = source;
+ }
+
+ private void setInstallerUID(int installerUID) {
+ this.installerUID = installerUID;
+ }
+
+ /**
+ * Compares this service tag to the specified object.
+ * The result is {@code true} if and only if the argument is
+ * not {@code null} and is a {@code ServiceTag} object whose
+ * <tt>instance_urn</tt> is the same as the
+ * <tt>instance_urn</tt> of this service tag.
+ *
+ * @return {@code true} if this service tag is the same as
+ * the specified object.
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null || !(obj instanceof ServiceTag)) {
+ return false;
+ }
+ ServiceTag st = (ServiceTag) obj;
+ if (st == this) {
+ return true;
+ }
+ return st.getInstanceURN().equals(getInstanceURN());
+ }
+
+ /**
+ * Returns the hash code value for this service tag.
+ * @return the hash code value for this service tag.
+ */
+ @Override
+ public int hashCode() {
+ int hash = 7;
+ hash = 19 * hash + (this.instanceURN != null ? this.instanceURN.hashCode() : 0);
+ return hash;
+ }
+
+ /**
+ * Returns the string representation of this service tag.
+ * The format is implementation specific.
+ *
+ * @return the string representation of this service tag.
+ */
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(ST_NODE_INSTANCE_URN).append("=").append(instanceURN).append("\n");
+ sb.append(ST_NODE_PRODUCT_NAME).append("=").append(productName).append("\n");
+ sb.append(ST_NODE_PRODUCT_VERSION).append("=").append(productVersion).append("\n");
+ sb.append(ST_NODE_PRODUCT_URN).append("=").append(productURN).append("\n");
+ sb.append(ST_NODE_PRODUCT_PARENT_URN).append("=").append(productParentURN).append("\n");
+ sb.append(ST_NODE_PRODUCT_PARENT).append("=").append(productParent).append("\n");
+ sb.append(ST_NODE_PRODUCT_DEFINED_INST_ID).append("=").append(productDefinedInstanceID).append("\n");
+ sb.append(ST_NODE_PRODUCT_VENDOR).append("=").append(productVendor).append("\n");
+ sb.append(ST_NODE_PLATFORM_ARCH).append("=").append(platformArch).append("\n");
+ sb.append(ST_NODE_TIMESTAMP).append("=").append(Util.formatTimestamp(timestamp)).append("\n");
+ sb.append(ST_NODE_CONTAINER).append("=").append(container).append("\n");
+ sb.append(ST_NODE_SOURCE).append("=").append(source).append("\n");
+ sb.append(ST_NODE_INSTALLER_UID).append("=").append(String.valueOf(installerUID)).append("\n");
+ return sb.toString();
+ }
+
+
+ /**
+ * Returns the {@link ServiceTag} instance for the running Java
+ * platform. The {@link ServiceTag#setSource source} field
+ * of the {@code ServiceTag} will be set to the given {@code source}.
+ * This method will return {@code null} if there is no service tag
+ * for the running Java platform.
+ * <p>
+ * This method is designed for Sun software that bundles the JDK
+ * or the JRE to use. It is recommended that the {@code source}
+ * string contains information about the bundling software
+ * such as the name and the version of the software bundle,
+ * for example,
+ * <blockquote>
+ * <tt>NetBeans IDE 6.0 with JDK 6 Update 5 Bundle</tt>
+ * </blockquote>
+ * in a NetBeans/JDK bundle.
+ * <p>
+ * At the first time to call this method the application
+ * is required to have the write permission to the installed
+ * directory of this running JDK or JRE instance.
+ *
+ * @param source the source that bundles the JDK or the JRE.
+ * @return a {@code ServiceTag} object for the Java platform,
+ * or {@code null} if not supported.
+ * @throws IOException if an error occurs in this operation.
+ */
+ public static ServiceTag getJavaServiceTag(String source) throws IOException {
+ return Installer.getJavaServiceTag(source);
+ }
+
+}
diff --git a/desktop/source/registration/com/sun/star/servicetag/SolarisServiceTag.java b/desktop/source/registration/com/sun/star/servicetag/SolarisServiceTag.java
new file mode 100644
index 000000000000..245b993b086e
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/servicetag/SolarisServiceTag.java
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * 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: SolarisServiceTag.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package com.sun.star.servicetag;
+
+import java.io.IOException;
+import java.util.Set;
+
+/**
+ * Utility class to obtain the service tag for the Solaris Operating System.
+ */
+class SolarisServiceTag {
+ private final static String[] SolarisProductURNs = new String[] {
+ "urn:uuid:a7a38948-2bd5-11d6-98ce-9d3ac1c0cfd7", /* Solaris 8 */
+ "urn:uuid:4f82caac-36f3-11d6-866b-85f428ef944e", /* Solaris 9 */
+ "urn:uuid:a19de03b-48bc-11d9-9607-080020a9ed93", /* Solaris 9 sparc */
+ "urn:uuid:4c35c45b-4955-11d9-9607-080020a9ed93", /* Solaris 9 x86 */
+ "urn:uuid:5005588c-36f3-11d6-9cec-fc96f718e113", /* Solaris 10 */
+ "urn:uuid:6df19e63-7ef5-11db-a4bd-080020a9ed93" /* Solaris 11 */
+ };
+
+ /**
+ * Returns null if not found.
+ *
+ * There is only one service tag for the operating system.
+ */
+ static ServiceTag getServiceTag() throws IOException {
+ if (Registry.isSupported()) {
+ Registry streg = Registry.getSystemRegistry();
+ for (String parentURN : SolarisProductURNs) {
+ Set<ServiceTag> instances = streg.findServiceTags(parentURN);
+ for (ServiceTag st : instances) {
+ // there should have only one service tag for the OS
+ return st;
+ }
+ }
+ }
+ return null;
+ }
+}
diff --git a/desktop/source/registration/com/sun/star/servicetag/SolarisSystemEnvironment.java b/desktop/source/registration/com/sun/star/servicetag/SolarisSystemEnvironment.java
new file mode 100644
index 000000000000..1ce5f5697bcb
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/servicetag/SolarisSystemEnvironment.java
@@ -0,0 +1,159 @@
+/*************************************************************************
+ *
+ * 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: SolarisSystemEnvironment.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package com.sun.star.servicetag;
+
+// The Service Tags team maintains the latest version of the implementation
+// for system environment data collection. JDK will include a copy of
+// the most recent released version for a JDK release. We rename
+// the package to com.sun.servicetag so that the Sun Connection
+// product always uses the latest version from the com.sun.scn.servicetags
+// package. JDK and users of the com.sun.servicetag API
+// (e.g. NetBeans and SunStudio) will use the version in JDK.
+
+import java.io.*;
+
+/**
+ * Solaris implementation of the SystemEnvironment class.
+ */
+class SolarisSystemEnvironment extends SystemEnvironment {
+ SolarisSystemEnvironment() {
+ setHostId(getCommandOutput("/usr/bin/hostid"));
+ setSystemModel(getCommandOutput("/usr/bin/uname", "-i"));
+ setSystemManufacturer(getSolarisSystemManufacturer());
+ setCpuManufacturer(getSolarisCpuManufacturer());
+ setSerialNumber(getSolarisSN());
+ }
+
+ /**
+ * Tries to obtain the cpu manufacturer.
+ * @return The cpu manufacturer (an empty string if not found or an error occurred)
+ */
+ private String getSolarisCpuManufacturer() {
+ // not fully accurate, this could be another manufacturer (fujitsu for example)
+ if ("sparc".equalsIgnoreCase(System.getProperty("os.arch"))) {
+ return "Sun Microsystems, Inc";
+ }
+
+ // if we're here, then we'll try smbios (type 3)
+ return getSmbiosData("3", "Manufacturer: ");
+ }
+
+ /**
+ * Tries to obtain the system manufacturer.
+ * @return The system manufacturer (an empty string if not found or an error occurred)
+ */
+ private String getSolarisSystemManufacturer() {
+ // not fully accurate, this could be another manufacturer (fujitsu for example)
+ if ("sparc".equalsIgnoreCase(System.getProperty("os.arch"))) {
+ return "Sun Microsystems, Inc";
+ }
+
+ // if we're here, then we'll try smbios (type 1)
+ return getSmbiosData("1", "Manufacturer: ");
+ }
+
+ /**
+ * Tries to obtain the serial number.
+ * @return The serial number (empty string if not found or an error occurred)
+ */
+ private String getSolarisSN() {
+ // try to read from the psn file if it exists
+ String tmp = getFileContent("/var/run/psn");
+ if (tmp.length() > 0) {
+ return tmp.trim();
+ }
+
+ // if we're here, then we'll try sneep
+ String tmpSN = getSneepSN();
+ if (tmpSN.length() > 0) {
+ return tmpSN;
+ }
+
+ // if we're here, then we'll try smbios (type 1)
+ tmpSN = getSmbiosData("1", "Serial Number: ");
+ if (tmpSN.length() > 0) {
+ return tmpSN;
+ }
+
+ // if we're here, then we'll try smbios (type 3)
+ tmpSN = getSmbiosData("3", "Serial Number: ");
+ if (tmpSN.length() > 0) {
+ return tmpSN;
+ }
+
+ // give up and return
+ return "";
+ }
+
+ // Sample smbios output segment:
+ // ID SIZE TYPE
+ // 1 150 SMB_TYPE_SYSTEM (system information)
+ //
+ // Manufacturer: Sun Microsystems
+ // Product: Sun Fire X4600
+ // Version: To Be Filled By O.E.M.
+ // Serial Number: 00:14:4F:45:0C:2A
+ private String getSmbiosData(String type, String target) {
+ String output = getCommandOutput("/usr/sbin/smbios", "-t", type);
+ for (String s : output.split("\n")) {
+ if (s.contains(target)) {
+ int indx = s.indexOf(target) + target.length();
+ if (indx < s.length()) {
+ String tmp = s.substring(indx).trim();
+ String lowerCaseStr = tmp.toLowerCase();
+ if (!lowerCaseStr.startsWith("not available")
+ && !lowerCaseStr.startsWith("to be filled by o.e.m")) {
+ return tmp;
+ }
+ }
+ }
+ }
+
+ return "";
+ }
+
+ private String getSneepSN() {
+ String basedir = getCommandOutput("pkgparam","SUNWsneep","BASEDIR");
+ File f = new File(basedir + "/bin/sneep");
+ if (f.exists()) {
+ String sneepSN = getCommandOutput(basedir + "/bin/sneep");
+ if (sneepSN.equalsIgnoreCase("unknown")) {
+ return "";
+ } else {
+ return sneepSN;
+ }
+ } else {
+ return "";
+ }
+ }
+
+}
diff --git a/desktop/source/registration/com/sun/star/servicetag/SunConnection.java b/desktop/source/registration/com/sun/star/servicetag/SunConnection.java
new file mode 100644
index 000000000000..4a3d2ee9722f
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/servicetag/SunConnection.java
@@ -0,0 +1,296 @@
+/*************************************************************************
+ *
+ * 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: SunConnection.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package com.sun.star.servicetag;
+
+import java.io.*;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.io.OutputStreamWriter;
+import java.util.Locale;
+import javax.net.ssl.HttpsURLConnection;
+
+/**
+ * Sun Connection Class for Product Registration.
+ *
+ * Registration Web Application Interface
+ * 1) POST the product registry to the output stream of the registration
+ * relay service.
+ * 2) Open the webapp URL from a browser with the following parameters:
+ * registry-urn
+ * product=jdk
+ * locale=<locale-lang>
+ *
+ * @see https://sn-tools.central.sun.com/twiki/pub/ServiceTags/RegistrationRelayService/
+ *
+ */
+class SunConnection {
+
+ private static String JDK_REGISTRATION_URL =
+ "https://inventory.sun.com/RegistrationWeb/register";
+ private static String SANDBOX_TESTING_URL =
+ "https://connection-tst.sun.com/RegistrationWeb/register";
+
+ // System properties for testing
+ private static String SVCTAG_REGISTER_TESTING = "servicetag.register.testing";
+ private static String SVCTAG_REGISTRATION_URL = "servicetag.registration.url";
+ private static String SVCTAG_CONNECTION_TIMEOUT = "servicetag.connection.timeout";
+
+ private SunConnection() {
+ }
+
+ /**
+ * Returns a URL for JDK registration interfacing with the Sun Connection
+ * registration relay service in this form:
+ * <registration-url>/<registry_urn>?product=jdk&locale=<locale-lang>
+ *
+ * The <registration-url> can be overridden by an environment
+ * variable or a system property.
+ *
+ * 1) "servicetag.register.testing" system property to switch to the
+ * Sun Connection registration sandbox testing.
+ * 2) "servicetag.registration.url" system property to override
+ * the URL
+ * 3) Default production URL
+ *
+ */
+ static URL getRegistrationURL(String registrationURN) {
+ String url = System.getProperty(SVCTAG_REGISTRATION_URL);
+ if (url == null) {
+ if (System.getProperty(SVCTAG_REGISTER_TESTING) != null) {
+ url = SANDBOX_TESTING_URL;
+ } else {
+ url = JDK_REGISTRATION_URL;
+ }
+ }
+
+ // trim whitespaces
+ url = url.trim();
+ if (url.length() == 0) {
+ throw new InternalError("Empty registration url set");
+ }
+
+ // Add the registry_urn in the URL's query
+ String registerURL = rewriteURL(url, registrationURN);
+ try {
+ return new URL(registerURL);
+ } catch (MalformedURLException ex) {
+ // should never reach here
+ InternalError x =
+ new InternalError(ex.getMessage());
+ x.initCause(ex);
+ throw x;
+ }
+ }
+
+ private static String rewriteURL(String url, String registryURN) {
+ StringBuilder sb = new StringBuilder(url.trim());
+ int len = sb.length();
+ if (sb.charAt(len-1) != '/') {
+ sb.append('/');
+ }
+ sb.append(registryURN);
+ sb.append("?");
+ sb.append("product=jdk");
+ sb.append("&");
+ sb.append("locale=").append(Locale.getDefault().getLanguage());
+ return sb.toString();
+ }
+
+ /**
+ * Registers all products in the given product registry. If it fails
+ * to post the service tag registry, open the browser with the offline
+ * registration page.
+ *
+ * @param regData registration data to be posted to the Sun Connection
+ * for registration.
+ *
+ * @throws IOException if I/O error occurs in this operation
+ */
+ public static void register(RegistrationData regData) throws IOException {
+ // Gets the URL for SunConnection registration relay service
+ URL url = getRegistrationURL(regData.getRegistrationURN());
+
+ // Post the Product Registry to Sun Connection
+ boolean succeed = postRegistrationData(url, regData);
+ if (succeed) {
+ // service tags posted successfully
+ // now prompt for registration
+ openBrowser(url);
+ } else {
+ // open browser with the offline registration page
+ openOfflineRegisterPage();
+ }
+ }
+
+ /**
+ * Opens a browser for JDK product registration.
+ * @param url Registration Webapp URL
+ */
+ private static void openBrowser(URL url) throws IOException {
+ if (!BrowserSupport.isSupported()) {
+ if (Util.isVerbose()) {
+ System.out.println("Browser is not supported");
+ }
+ return;
+ }
+
+ try {
+ BrowserSupport.browse(url.toURI());
+ } catch (URISyntaxException ex) {
+ InternalError x = new InternalError("Error in registering: " + ex.getMessage());
+ x.initCause(ex);
+ throw x;
+ } catch (IllegalArgumentException ex) {
+ if (Util.isVerbose()) {
+ ex.printStackTrace();
+ }
+ } catch (UnsupportedOperationException ex) {
+ // ignore if not supported
+ if (Util.isVerbose()) {
+ ex.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * POST service tag registry to Sun Connection
+ * @param loc the URL of the webapp to handle the POST request
+ * @param streg the Service Tag registry
+ * @return true if posting succeeds; otherwise, false.
+ */
+ private static boolean postRegistrationData(URL url,
+ RegistrationData registration) {
+ try {
+ HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
+ con.setDoInput(true);
+ con.setDoOutput(true);
+ con.setUseCaches(false);
+ con.setAllowUserInteraction(false);
+
+ // default 10 seconds timeout
+ String timeout = System.getProperty(SVCTAG_CONNECTION_TIMEOUT, "10");
+ con.setConnectTimeout(Util.getIntValue(timeout) * 1000);
+
+ if (Util.isVerbose()) {
+ System.out.println("Connecting to post registration data at " + url);
+ }
+
+ con.setRequestMethod("POST");
+ con.setRequestProperty("Content-Type", "text/xml;charset=\"utf-8\"");
+ con.connect();
+
+ OutputStream out = con.getOutputStream();
+ registration.storeToXML(out);
+ out.flush();
+ out.close();
+
+ int returnCode = con.getResponseCode();
+ if (Util.isVerbose()) {
+ System.out.println("POST return status = " + returnCode);
+ printReturnData(con, returnCode);
+ }
+ return (returnCode == HttpURLConnection.HTTP_OK);
+ } catch (MalformedURLException me) {
+ // should never reach here
+ InternalError x = new InternalError("Error in registering: " + me.getMessage());
+ x.initCause(me);
+ throw x;
+ } catch (Exception ioe) {
+ // SocketTimeoutException, IOException or UnknownHostException
+ if (Util.isVerbose()) {
+ ioe.printStackTrace();
+ }
+ return false;
+ }
+ }
+
+ /**
+ * Opens the offline registratioin page in the browser.
+ *
+ */
+ private static void openOfflineRegisterPage()
+ throws IOException {
+ if (!BrowserSupport.isSupported()) {
+ if (Util.isVerbose()) {
+ System.out.println("Browser is not supported");
+ }
+ return;
+ }
+
+ File registerPage = Installer.getRegistrationHtmlPage();
+ try {
+ BrowserSupport.browse(registerPage.toURI());
+ } catch (FileNotFoundException ex) {
+ // should never reach here
+ InternalError x =
+ new InternalError("Error in launching " + registerPage + ": " + ex.getMessage());
+ x.initCause(ex);
+ throw x;
+ } catch (IllegalArgumentException ex) {
+ if (Util.isVerbose()) {
+ ex.printStackTrace();
+ }
+ } catch (UnsupportedOperationException ex) {
+ // ignore if not supported
+ if (Util.isVerbose()) {
+ ex.printStackTrace();
+ }
+ }
+ }
+
+ private static void printReturnData(HttpURLConnection con, int returnCode)
+ throws IOException {
+ BufferedReader reader = null;
+ try {
+ if (returnCode < 400) {
+ reader = new BufferedReader(
+ new InputStreamReader(con.getInputStream()));
+ } else {
+ reader = new BufferedReader(
+ new InputStreamReader(con.getErrorStream()));
+ }
+ StringBuilder sb = new StringBuilder();
+ String line;
+ while ((line = reader.readLine()) != null) {
+ sb.append(line).append("\n");
+ }
+ System.out.println("Response is : ");
+ System.out.println(sb.toString());
+ } finally {
+ if (reader != null) {
+ reader.close();
+ }
+ }
+ }
+}
diff --git a/desktop/source/registration/com/sun/star/servicetag/SysnetRegistryHelper.java b/desktop/source/registration/com/sun/star/servicetag/SysnetRegistryHelper.java
new file mode 100644
index 000000000000..d50104e827ed
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/servicetag/SysnetRegistryHelper.java
@@ -0,0 +1,380 @@
+/*************************************************************************
+ *
+ * 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: SysnetRegistryHelper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package com.sun.star.servicetag;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import static com.sun.star.servicetag.Util.*;
+import static com.sun.star.servicetag.RegistrationDocument.*;
+
+/**
+ * Class containing additional methods that are not yet
+ * in the JDK Registry class. Note that all methods in this class
+ * will be superceeded by the JDK classes.
+ */
+public class SysnetRegistryHelper {
+
+ private static final String STCLIENT_SOLARIS = "/usr/bin/stclient";
+ private static final String STCLIENT_LINUX = "/opt/sun/servicetag/bin/stclient";
+ // stclient exit value (see sthelper.h)
+ private static final int ST_ERR_NOT_AUTH = 245;
+ private static final int ST_ERR_REC_NOT_FOUND = 225;
+
+ // The stclient output has to be an exported interface
+ private static final String INSTANCE_URN_OPEN_ELEMENT = "<instance_urn>";
+ private static final String INSTANCE_URN_CLOSE_ELEMENT = "</instance_urn>";
+ private static final String REGISTRY_URN = "<registry urn=\"";
+ private static final String INSTANCE_URN_DESC = "Product instance URN=";
+ private static boolean initialized = false;
+ private static boolean supportsHelperClass = true; // default
+ private static File stclient = null;
+ private static String stclientPath = null;
+
+ // System properties for testing
+ private static String SVCTAG_STCLIENT_CMD = "servicetag.stclient.cmd";
+ private static String SVCTAG_STHELPER_SUPPORTED = "servicetag.sthelper.supported";
+
+ private synchronized static String getSTclient() {
+ if (!initialized) {
+ // the system property always overrides the default setting
+ if (System.getProperty(SVCTAG_STHELPER_SUPPORTED) != null) {
+ supportsHelperClass = Boolean.getBoolean(SVCTAG_STHELPER_SUPPORTED);
+ }
+
+ // This is only used for testing
+ stclientPath = System.getProperty(SVCTAG_STCLIENT_CMD);
+ if (stclientPath != null) {
+ return stclientPath;
+ }
+
+ // Initialization to determine the platform's stclient pathname
+ String os = System.getProperty("os.name");
+ if (os.equals("SunOS")) {
+ stclient = new File(STCLIENT_SOLARIS);
+ } else if (os.equals("Linux")) {
+ stclient = new File(STCLIENT_LINUX);
+ } else if (os.startsWith("Windows")) {
+ stclient = getWindowsStClientFile();
+ } else {
+ if (isVerbose()) {
+ System.out.println("Running on non-Sun JDK");
+ }
+ }
+ initialized = true;
+ }
+
+ // com.sun.servicetag package has to be compiled with JDK 5 as well
+ // JDK 5 doesn't support the File.canExecute() method.
+ // Risk not checking isExecute() for the stclient command is very low.
+
+ if (stclientPath == null && stclient != null && stclient.exists()) {
+ stclientPath = stclient.getAbsolutePath();
+ }
+ return stclientPath;
+ }
+
+ private static List<String> getCommandList() {
+ // Set up the arguments to call stclient
+ List<String> command = new ArrayList<String>();
+ if (System.getProperty(SVCTAG_STCLIENT_CMD) != null) {
+ // This is for jtreg testing use. This will be set to something
+ // like:
+ // $JAVA_HOME/bin/java -cp $TEST_DIR \
+ // -Dstclient.registry.path=$TEST_DIR/registry.xml \
+ // SvcTagClient
+ //
+ // On Windows, the JAVA_HOME and TEST_DIR path could contain
+ // space e.g. c:\Program Files\Java\jdk1.6.0_05\bin\java.
+ // The SVCTAG_STCLIENT_CMD must be set with a list of
+ // space-separated parameters. If a parameter contains spaces,
+ // it must be quoted with '"'.
+
+ String cmd = getSTclient();
+ int len = cmd.length();
+ int i = 0;
+ while (i < len) {
+ char separator = ' ';
+ if (cmd.charAt(i) == '"') {
+ separator = '"';
+ i++;
+ }
+ // look for the separator or matched the closing '"'
+ int j;
+ for (j = i+1; j < len; j++) {
+ if (cmd.charAt(j) == separator) {
+ break;
+ }
+ }
+
+ if (i == j-1) {
+ // add an empty parameter
+ command.add("\"\"");
+ } else {
+ // double quotes and space are not included
+ command.add(cmd.substring(i,j));
+ }
+
+ // skip spaces
+ for (i = j+1; i < len; i++) {
+ if (!Character.isSpaceChar(cmd.charAt(i))) {
+ break;
+ }
+ }
+ }
+ if (isVerbose()) {
+ System.out.println("Command list:");
+ for (String s : command) {
+ System.out.println(s);
+ }
+ }
+ } else {
+ command.add(getSTclient());
+ }
+ return command;
+ }
+
+ // Returns null if the service tag record not found;
+ // or throw UnauthorizedAccessException or IOException
+ // based on the exitValue.
+ private static ServiceTag checkReturnError(int exitValue,
+ String output,
+ ServiceTag st) throws IOException {
+ switch (exitValue) {
+ case ST_ERR_REC_NOT_FOUND:
+ return null;
+ case ST_ERR_NOT_AUTH:
+ if (st != null) {
+ throw new UnauthorizedAccessException(
+ "Not authorized to access " + st.getInstanceURN() +
+ " installer_uid=" + st.getInstallerUID());
+ } else {
+ throw new UnauthorizedAccessException(
+ "Not authorized:" + output);
+ }
+ default:
+ throw new IOException("stclient exits with error" +
+ " (" + exitValue + ")\n" + output);
+ }
+ }
+
+ /**
+ * Returns a {@code ServiceTag} object of the given <tt>instance_urn</tt>
+ * in this registry.
+ *
+ * @param instanceURN the <tt>instance_urn</tt> of the service tag
+ * @return a {@code ServiceTag} object of the given <tt>instance_urn</tt>
+ * in this registry; or {@code null} if not found.
+ *
+ * @throws java.io.IOException if an I/O error occurs in this operation.
+ */
+ private static ServiceTag getServiceTag(String instanceURN) throws IOException {
+ if (instanceURN == null) {
+ throw new NullPointerException("instanceURN is null");
+ }
+
+ List<String> command = getCommandList();
+ command.add("-g");
+ command.add("-i");
+ command.add(instanceURN);
+
+ ProcessBuilder pb = new ProcessBuilder(command);
+ Process p = pb.start();
+ String output = commandOutput(p);
+ if (isVerbose()) {
+ System.out.println("Output from stclient -g command:");
+ System.out.println(output);
+ }
+ if (p.exitValue() == 0) {
+ return parseServiceTag(output);
+ } else {
+ return checkReturnError(p.exitValue(), output, null);
+ }
+ }
+
+ private static ServiceTag parseServiceTag(String output) throws IOException {
+ BufferedReader in = null;
+ try {
+ Properties props = new Properties();
+ // parse the service tag output from stclient
+ in = new BufferedReader(new StringReader(output));
+ String line = null;
+ while ((line = in.readLine()) != null) {
+ if ((line = line.trim()).length() > 0) {
+ String[] ss = line.trim().split("=", 2);
+ if (ss.length == 2) {
+ props.setProperty(ss[0].trim(), ss[1].trim());
+ } else {
+ props.setProperty(ss[0].trim(), "");
+ }
+ }
+ }
+
+ String urn = props.getProperty(ST_NODE_INSTANCE_URN);
+ String productName = props.getProperty(ST_NODE_PRODUCT_NAME);
+ String productVersion = props.getProperty(ST_NODE_PRODUCT_VERSION);
+ String productURN = props.getProperty(ST_NODE_PRODUCT_URN);
+ String productParent = props.getProperty(ST_NODE_PRODUCT_PARENT);
+ String productParentURN = props.getProperty(ST_NODE_PRODUCT_PARENT_URN);
+ String productDefinedInstanceID =
+ props.getProperty(ST_NODE_PRODUCT_DEFINED_INST_ID);
+ String productVendor = props.getProperty(ST_NODE_PRODUCT_VENDOR);
+ String platformArch = props.getProperty(ST_NODE_PLATFORM_ARCH);
+ String container = props.getProperty(ST_NODE_CONTAINER);
+ String source = props.getProperty(ST_NODE_SOURCE);
+ int installerUID =
+ Util.getIntValue(props.getProperty(ST_NODE_INSTALLER_UID));
+ Date timestamp =
+ Util.parseTimestamp(props.getProperty(ST_NODE_TIMESTAMP));
+
+ return new ServiceTag(urn,
+ productName,
+ productVersion,
+ productURN,
+ productParent,
+ productParentURN,
+ productDefinedInstanceID,
+ productVendor,
+ platformArch,
+ container,
+ source,
+ installerUID,
+ timestamp);
+ } finally {
+ if (in != null) {
+ in.close();
+ }
+ }
+
+ }
+
+ /**
+ * Returns the urn of this registry.
+ *
+ * @return a {@code String} for the urn of this registry.
+ *
+ * @throws java.io.IOException if an I/O error occurs in this operation.
+ */
+ // Once JDK makes this method available, we'll deprecate this method
+ // @deprecated Use the JDK version when available.
+ public static String getRegistryURN() throws IOException {
+ List<String> command = getCommandList();
+ command.add("-x");
+
+ BufferedReader in = null;
+ try {
+ ProcessBuilder pb = new ProcessBuilder(command);
+ Process p = pb.start();
+ String output = commandOutput(p);
+
+ String registryURN = null;
+ if (p.exitValue() == 0) {
+ // parse the service tag output from stclient
+ in = new BufferedReader(new StringReader(output));
+ String line = null;
+ while ((line = in.readLine()) != null) {
+ String s = line.trim();
+ if (s.indexOf(REGISTRY_URN) != -1) {
+ s = s.substring(s.indexOf(REGISTRY_URN)
+ + REGISTRY_URN.length());
+ if (s.indexOf("\"") != -1) {
+ s = s.substring(0, s.indexOf("\""));
+ registryURN = s;
+ break;
+ }
+ }
+ }
+ } else {
+ checkReturnError(p.exitValue(), output, null);
+ }
+ return registryURN;
+ } finally {
+ if (in != null) {
+ in.close();
+ }
+ }
+ }
+
+ /**
+ * Returns all the service tags in this registry.
+ *
+ * @return a {@code Set} of {@code ServiceTag} objects
+ * in this registry.
+ *
+ * @throws java.io.IOException if an I/O error occurs in this operation.
+ */
+ // Once JDK makes this method available, we'll deprecate this method
+ // @deprecated Use the JDK version when available.
+ public static Set<ServiceTag> getServiceTags() throws IOException {
+ List<String> command = getCommandList();
+ command.add("-x");
+
+ BufferedReader in = null;
+ try {
+ ProcessBuilder pb = new ProcessBuilder(command);
+ Process p = pb.start();
+ String output = commandOutput(p);
+
+ Set<ServiceTag> instances = new HashSet<ServiceTag>();
+ if (p.exitValue() == 0) {
+ // parse the service tag output from stclient
+ in = new BufferedReader(new StringReader(output));
+ String line = null;
+ while ((line = in.readLine()) != null) {
+ String s = line.trim();
+ if (s.indexOf(INSTANCE_URN_OPEN_ELEMENT) != -1
+ && s.indexOf(INSTANCE_URN_CLOSE_ELEMENT) != -1) {
+ s = s.substring(s.indexOf(INSTANCE_URN_OPEN_ELEMENT)
+ + INSTANCE_URN_OPEN_ELEMENT.length(),
+ s.indexOf(INSTANCE_URN_CLOSE_ELEMENT));
+ try {
+ instances.add(getServiceTag(s));
+ } catch (Exception e) {
+ }
+ }
+ }
+ } else {
+ checkReturnError(p.exitValue(), output, null);
+ }
+ return instances;
+ } finally {
+ if (in != null) {
+ in.close();
+ }
+ }
+ }
+}
diff --git a/desktop/source/registration/com/sun/star/servicetag/SystemEnvironment.java b/desktop/source/registration/com/sun/star/servicetag/SystemEnvironment.java
new file mode 100644
index 000000000000..e5b9e0e3b4fe
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/servicetag/SystemEnvironment.java
@@ -0,0 +1,341 @@
+/*************************************************************************
+ *
+ * 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: SystemEnvironment.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package com.sun.star.servicetag;
+
+// The Service Tags team maintains the latest version of the implementation
+// for system environment data collection. JDK will include a copy of
+// the most recent released version for a JDK release. We rename
+// the package to com.sun.servicetag so that the Sun Connection
+// product always uses the latest version from the com.sun.scn.servicetags
+// package. JDK and users of the com.sun.servicetag API
+// (e.g. NetBeans and SunStudio) will use the version in JDK.
+
+import java.io.*;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+/**
+ * SystemEnvironment class collects the environment data with the
+ * best effort from the underlying platform.
+ */
+public class SystemEnvironment {
+ private String hostname;
+ private String hostId;
+ private String osName;
+ private String osVersion;
+ private String osArchitecture;
+ private String systemModel;
+ private String systemManufacturer;
+ private String cpuManufacturer;
+ private String serialNumber;
+ private static SystemEnvironment sysEnv = null;
+
+ public static synchronized SystemEnvironment getSystemEnvironment() {
+ if (sysEnv == null) {
+ String os = System.getProperty("os.name");
+ if (os.equals("SunOS")) {
+ sysEnv = new SolarisSystemEnvironment();
+ } else if (os.equals("Linux")) {
+ sysEnv = new LinuxSystemEnvironment();
+ } else if (os.startsWith("Windows")) {
+ sysEnv = new WindowsSystemEnvironment();
+ } else {
+ sysEnv = new SystemEnvironment();
+ }
+ }
+ return sysEnv;
+ }
+
+ // package-private
+ SystemEnvironment() {
+ try {
+ this.hostname = InetAddress.getLocalHost().getHostName();
+ } catch (UnknownHostException ex) {
+ this.hostname = "Unknown host";
+ }
+ this.hostId = "";
+ this.osName = System.getProperty("os.name");
+ this.osVersion = System.getProperty("os.version");
+ this.osArchitecture = System.getProperty("os.arch");
+ this.systemModel = "";
+ this.systemManufacturer = "";
+ this.cpuManufacturer = "";
+ this.serialNumber = "";
+ }
+
+
+ /**
+ * Sets the hostname.
+ * @param hostname The hostname to set.
+ */
+ public void setHostname(String hostname) {
+ this.hostname = hostname;
+ }
+
+ /**
+ * Sets the OS name.
+ * @param osName The osName to set.
+ */
+ public void setOsName(String osName) {
+ this.osName = osName;
+ }
+
+ /**
+ * Sets the OS version.
+ * @param osVersion The osVersion to set.
+ */
+ public void setOsVersion(String osVersion) {
+ this.osVersion = osVersion;
+ }
+
+ /**
+ * Sets the OS architecture.
+ * @param osArchitecture The osArchitecture to set.
+ */
+ public void setOsArchitecture(String osArchitecture) {
+ this.osArchitecture = osArchitecture;
+ }
+
+ /**
+ * Sets the system model.
+ * @param systemModel The systemModel to set.
+ */
+ public void setSystemModel(String systemModel) {
+ this.systemModel = systemModel;
+ }
+
+ /**
+ * Sets the system manufacturer.
+ * @param systemManufacturer The systemManufacturer to set.
+ */
+ public void setSystemManufacturer(String systemManufacturer) {
+ this.systemManufacturer = systemManufacturer;
+ }
+
+ /**
+ * Sets the cpu manufacturer.
+ * @param cpuManufacturer The cpuManufacturer to set.
+ */
+ public void setCpuManufacturer(String cpuManufacturer) {
+ this.cpuManufacturer = cpuManufacturer;
+ }
+
+ /**
+ * Sets the serial number.
+ * @param serialNumber The serialNumber to set.
+ */
+ public void setSerialNumber(String serialNumber) {
+ this.serialNumber = serialNumber;
+ }
+
+ /**
+ * Sets the hostid. Truncates to a max length of 16 chars.
+ * @param hostId The hostid to set.
+ */
+ public void setHostId(String hostId) {
+ if (hostId == null || hostId.equals("null")) {
+ hostId = "";
+ }
+ if (hostId.length() > 16) {
+ hostId = hostId.substring(0,16);
+ }
+ this.hostId = hostId;
+ }
+
+ /**
+ * Returns the hostname.
+ * @return The hostname.
+ */
+ public String getHostname() {
+ return hostname;
+ }
+
+ /**
+ * Returns the osName.
+ * @return The osName.
+ */
+ public String getOsName() {
+ return osName;
+ }
+
+ /**
+ * Returns the osVersion.
+ * @return The osVersion.
+ */
+ public String getOsVersion() {
+ return osVersion;
+ }
+
+ /**
+ * Returns the osArchitecture.
+ * @return The osArchitecture.
+ */
+ public String getOsArchitecture() {
+ return osArchitecture;
+ }
+
+ /**
+ * Returns the systemModel.
+ * @return The systemModel.
+ */
+ public String getSystemModel() {
+ return systemModel;
+ }
+
+ /**
+ * Returns the systemManufacturer.
+ * @return The systemManufacturer.
+ */
+ public String getSystemManufacturer() {
+ return systemManufacturer;
+ }
+
+ /**
+ * Returns the serialNumber.
+ * @return The serialNumber.
+ */
+ public String getSerialNumber() {
+ return serialNumber;
+ }
+
+ /**
+ * Returns the hostId.
+ * @return The hostId.
+ */
+ public String getHostId() {
+ return hostId;
+ }
+
+ /**
+ * Returns the cpuManufacturer.
+ * @return The cpuManufacturer.
+ */
+ public String getCpuManufacturer() {
+ return cpuManufacturer;
+ }
+
+ protected String getCommandOutput(String... command) {
+ StringBuilder sb = new StringBuilder();
+ BufferedReader br = null;
+ Process p = null;
+ try {
+ ProcessBuilder pb = new ProcessBuilder(command);
+ p = pb.start();
+ p.waitFor();
+
+ if (p.exitValue() == 0) {
+ br = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String line = null;
+ while ((line = br.readLine()) != null) {
+ line = line.trim();
+ if (line.length() > 0) {
+ if (sb.length() > 0) {
+ sb.append("\n");
+ }
+ sb.append(line);
+ }
+ }
+ }
+ return sb.toString();
+ } catch (InterruptedException ie) {
+ // in case the command hangs
+ if (p != null) {
+ p.destroy();
+ }
+ return "";
+ } catch (Exception e) {
+ // ignore exception
+ return "";
+ } finally {
+ if (p != null) {
+ try {
+ p.getErrorStream().close();
+ } catch (IOException e) {
+ // ignore
+ }
+ try {
+ p.getInputStream().close();
+ } catch (IOException e) {
+ // ignore
+ }
+ try {
+ p.getOutputStream().close();
+ } catch (IOException e) {
+ // ignore
+ }
+ p = null;
+ }
+ if (br != null) {
+ try {
+ br.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ }
+ }
+
+ protected String getFileContent(String filename) {
+ File f = new File(filename);
+ if (!f.exists()) {
+ return "";
+ }
+
+ StringBuilder sb = new StringBuilder();
+ BufferedReader br = null;
+ try {
+ br = new BufferedReader(new FileReader(f));
+ String line = null;
+ while ((line = br.readLine()) != null) {
+ line = line.trim();
+ if (line.length() > 0) {
+ if (sb.length() > 0) {
+ sb.append("\n");
+ }
+ sb.append(line);
+ }
+ }
+ return sb.toString();
+ } catch (Exception e) {
+ // ignore exception
+ return "";
+ } finally {
+ if (br != null) {
+ try {
+ br.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ }
+ }
+}
diff --git a/xmlhelp/inc/xmlhelp/helplinkerdllapi.h b/desktop/source/registration/com/sun/star/servicetag/UnauthorizedAccessException.java
index e2454a3f8b19..785cb35777ae 100644
--- a/xmlhelp/inc/xmlhelp/helplinkerdllapi.h
+++ b/desktop/source/registration/com/sun/star/servicetag/UnauthorizedAccessException.java
@@ -6,8 +6,9 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: helplinkerdllapi.h,v $
- * $Revision: 1.3 $
+ * $RCSfile: UnauthorizedAccessException.java,v $
+ *
+ * $Revision: 1.2 $
*
* This file is part of OpenOffice.org.
*
@@ -28,17 +29,31 @@
*
************************************************************************/
-#ifndef INCLUDED_HELPLINKERDLLAPI_H
-#define INCLUDED_HELPLINKERDLLAPI_H
+package com.sun.star.servicetag;
-#include "sal/types.h"
+/**
+ * Thrown if the user is not authorized to
+ * {@link Registry#updateServiceTag update} or
+ * {@link Registry#removeServiceTag remove}
+ * a service tag from a {@link Registry}.
+ */
+public class UnauthorizedAccessException extends RuntimeException {
-#if defined(HELPLINKER_DLLIMPLEMENTATION)
-#define HELPLINKER_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
-#else
-#define HELPLINKER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
-#endif
-#define HELPLINKER_DLLPRIVATE SAL_DLLPRIVATE
+ /**
+ * Constructs an <code>UnauthorizedAccessException</code> object
+ * without detail message.
+ */
+ public UnauthorizedAccessException() {
+ }
-#endif /* INCLUDED_HELPLINKERDLLAPI_H */
+ /**
+ * Constructs an <code>UnauthorizedAccessException</code> object
+ * with the specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public UnauthorizedAccessException(String msg) {
+ super(msg);
+ }
+}
diff --git a/desktop/source/registration/com/sun/star/servicetag/Util.java b/desktop/source/registration/com/sun/star/servicetag/Util.java
new file mode 100644
index 000000000000..55fa097297e6
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/servicetag/Util.java
@@ -0,0 +1,297 @@
+/*************************************************************************
+ *
+ * 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: Util.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package com.sun.star.servicetag;
+
+import java.io.*;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.text.ParseException;
+import java.util.TimeZone;
+import java.util.UUID;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+// Utility class for com.sun.star.servicetag package
+class Util {
+ private static boolean verbose = (System.getProperty("servicetag.verbose") != null);
+ private static String jrepath = null;
+
+ // for debugging and tracing
+ static boolean isVerbose() {
+ return verbose;
+ }
+
+ /**
+ * Gets the pathname of JRE in the running platform
+ * This can be a JDK or JRE.
+ */
+ static synchronized String getJrePath() {
+ if (jrepath == null) {
+ // Determine the JRE path by checking the existence of
+ // <HOME>/jre/lib and <HOME>/lib.
+ String javaHome = System.getProperty("java.home");
+ jrepath = javaHome + File.separator + "jre";
+ File f = new File(jrepath, "lib");
+ if (!f.exists()) {
+ // java.home usually points to the JRE path
+ jrepath = javaHome;
+ }
+ }
+ return jrepath;
+ }
+
+ /**
+ * Tests if the running platform is a JDK.
+ */
+ static boolean isJdk() {
+ // <HOME>/jre exists which implies it's a JDK
+ return getJrePath().endsWith(File.separator + "jre");
+ }
+
+ /**
+ * Generates the URN string of "urn:st" namespace
+ */
+ static String generateURN() {
+ return "urn:st:" + UUID.randomUUID().toString();
+ }
+
+ static int getIntValue(String value) {
+ try {
+ return Integer.parseInt(value);
+ } catch (NumberFormatException e) {
+ throw new IllegalArgumentException("\"" + value + "\"" +
+ " expected to be an integer");
+ }
+ }
+
+ /**
+ * Formats the Date into a timestamp string in YYYY-MM-dd HH:mm:ss GMT.
+ * @param timestamp Date
+ * @return a string representation of the timestamp
+ * in the YYYY-MM-dd HH:mm:ss GMT format.
+ */
+ static String formatTimestamp(Date timestamp) {
+ if (timestamp == null) {
+ return "[No timestamp]";
+ }
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
+ df.setTimeZone(TimeZone.getTimeZone("GMT"));
+ return df.format(timestamp);
+ }
+
+ /**
+ * Parses a timestamp string in YYYY-MM-dd HH:mm:ss GMT format.
+ * @param timestamp Timestamp in the YYYY-MM-dd HH:mm:ss GMT format.
+ * @return Date
+ */
+ static Date parseTimestamp(String timestamp) {
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
+ df.setTimeZone(TimeZone.getTimeZone("GMT"));
+ try {
+ return df.parse(timestamp);
+ } catch (ParseException e) {
+ // should not reach here
+ e.printStackTrace();
+ return new Date();
+ }
+ }
+
+ static String commandOutput(Process p) throws IOException {
+ Reader r = null;
+ Reader err = null;
+ try {
+ r = new InputStreamReader(p.getInputStream());
+ err = new InputStreamReader(p.getErrorStream());
+ String output = commandOutput(r);
+ String errorMsg = commandOutput(err);
+ p.waitFor();
+ return output + errorMsg.trim();
+ } catch (InterruptedException e) {
+ if (isVerbose()) {
+ e.printStackTrace();
+ }
+ return e.getMessage();
+ } finally {
+ if (r != null) {
+ r.close();
+ }
+ if (err != null) {
+ err.close();
+ }
+ }
+ }
+
+ static String commandOutput(Reader r) throws IOException {
+ StringBuilder sb = new StringBuilder();
+ int c;
+ while ((c = r.read()) > 0) {
+ if (c != '\r') {
+ sb.append((char) c);
+ }
+ }
+ return sb.toString();
+ }
+
+ static int getJdkVersion() {
+ parseVersion();
+ return jdkVersion;
+ }
+
+ static int getUpdateVersion() {
+ parseVersion();
+ return jdkUpdate;
+ }
+
+ private static int jdkVersion = 0;
+ private static int jdkUpdate = 0;
+ private static synchronized void parseVersion() {
+ if (jdkVersion > 0) {
+ return;
+ }
+
+ // parse java.runtime.version
+ // valid format of the version string is:
+ // n.n.n[_uu[c]][-<identifer>]-bxx
+ String cs = System.getProperty("java.runtime.version");
+ if (cs.length() >= 5 &&
+ Character.isDigit(cs.charAt(0)) && cs.charAt(1) == '.' &&
+ Character.isDigit(cs.charAt(2)) && cs.charAt(3) == '.' &&
+ Character.isDigit(cs.charAt(4))) {
+ jdkVersion = Character.digit(cs.charAt(2), 10);
+ cs = cs.substring(5, cs.length());
+ if (cs.charAt(0) == '_' && cs.length() >= 3 &&
+ Character.isDigit(cs.charAt(1)) &&
+ Character.isDigit(cs.charAt(2))) {
+ int nextChar = 3;
+ try {
+ String uu = cs.substring(1, 3);
+ jdkUpdate = Integer.valueOf(uu).intValue();
+ } catch (NumberFormatException e) {
+ // not conforming to the naming convention
+ return;
+ }
+ }
+ } else {
+ throw new InternalError("Invalid java.runtime.version" + cs);
+ }
+ }
+
+ /**
+ * Returns this java string as a null-terminated byte array
+ */
+ private static byte[] stringToByteArray(String str) {
+ return (str + "\u0000").getBytes();
+ }
+
+ /**
+ * Converts a null-terminated byte array to java string
+ */
+ private static String byteArrayToString(byte[] array) {
+ return new String(array, 0, array.length -1);
+ }
+
+ /**
+ * Gets the stclient path using a well known location from
+ * the Windows platform Registry, otherwise it will return null.
+ */
+ static File getWindowsStClientFile() {
+ File out = null;
+ String regKey = "software\\microsoft\\windows\\currentversion\\app paths\\stclient.exe";
+ String keyName = "" ; // use the default key
+ String path = getRegistryKey(regKey, keyName);
+
+ if (path != null && (new File(path)).exists()) {
+ out = new File(path);
+ }
+ if (isVerbose()) {
+ System.out.println("stclient=" + out);
+ }
+ return out;
+ }
+
+ /**
+ * This uses reflection to access a private java windows registry
+ * interface, any changes to that Class must be appropriately adjusted.
+ * Returns a null if unsuccessful.
+ */
+ private static String getRegistryKey(String regKey, String keyName) {
+ String out = null;
+ try {
+ Class<?> clazz = Class.forName("java.util.prefs.WindowsPreferences");
+
+ // Get the registry methods
+ Method winRegOpenKeyM = clazz.getDeclaredMethod("WindowsRegOpenKey",
+ int.class, byte[].class, int.class);
+ winRegOpenKeyM.setAccessible(true);
+
+ Method winRegCloseKeyM = clazz.getDeclaredMethod("WindowsRegCloseKey",
+ int.class);
+ winRegCloseKeyM.setAccessible(true);
+
+ Method winRegQueryValueM = clazz.getDeclaredMethod("WindowsRegQueryValueEx",
+ int.class, byte[].class);
+ winRegQueryValueM.setAccessible(true);
+
+ // Get all the constants we need
+ int HKLM = getValueFromStaticField("HKEY_LOCAL_MACHINE", clazz);
+ int KEY_READ = getValueFromStaticField("KEY_READ", clazz);
+ int ERROR_CODE = getValueFromStaticField("ERROR_CODE", clazz);
+ int NATIVE_HANDLE = getValueFromStaticField("NATIVE_HANDLE", clazz);
+ int ERROR_SUCCESS = getValueFromStaticField("ERROR_SUCCESS", clazz);
+
+ // Convert keys
+ byte[] reg = stringToByteArray(regKey);
+ byte[] key = stringToByteArray(keyName);
+
+ // Open the registry
+ int[] result = (int[]) winRegOpenKeyM.invoke(null, HKLM, reg, KEY_READ);
+
+ if (result[ERROR_CODE] == ERROR_SUCCESS) {
+ byte[] stvalue = (byte[]) winRegQueryValueM.invoke(null,
+ result[NATIVE_HANDLE], key);
+ out = byteArrayToString(stvalue);
+ winRegCloseKeyM.invoke(null, result[NATIVE_HANDLE]);
+ }
+ } catch (Exception ex) {
+ if (isVerbose()) {
+ ex.printStackTrace();
+ }
+ }
+ return out;
+ }
+
+ private static int getValueFromStaticField(String fldName, Class<?> klass) throws Exception {
+ Field f = klass.getDeclaredField(fldName);
+ f.setAccessible(true);
+ return f.getInt(null);
+ }
+}
diff --git a/desktop/source/registration/com/sun/star/servicetag/WindowsSystemEnvironment.java b/desktop/source/registration/com/sun/star/servicetag/WindowsSystemEnvironment.java
new file mode 100644
index 000000000000..cdc374f4a993
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/servicetag/WindowsSystemEnvironment.java
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * 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: WindowsSystemEnvironment.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package com.sun.star.servicetag;
+
+// The Service Tags team maintains the latest version of the implementation
+// for system environment data collection. JDK will include a copy of
+// the most recent released version for a JDK release. We rename
+// the package to com.sun.servicetag so that the Sun Connection
+// product always uses the latest version from the com.sun.scn.servicetags
+// package. JDK and users of the com.sun.servicetag API
+// (e.g. NetBeans and SunStudio) will use the version in JDK.
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Windows implementation of the SystemEnvironment class.
+ */
+class WindowsSystemEnvironment extends SystemEnvironment {
+ WindowsSystemEnvironment() {
+ super();
+
+ // run a call to make sure things are initialized
+ // ignore the first call result as the system may
+ // give inconsistent data on the first invocation ever
+ getWmicResult("computersystem", "get", "model");
+
+ setSystemModel(getWmicResult("computersystem", "get", "model"));
+ setSystemManufacturer(getWmicResult("computersystem", "get", "manufacturer"));
+ setSerialNumber(getWmicResult("bios", "get", "serialnumber"));
+
+ String cpuMfr = getWmicResult("cpu", "get", "manufacturer");
+ // this isn't as good an option, but if we couldn't get anything
+ // from wmic, try the processor_identifier
+ if (cpuMfr.length() == 0) {
+ String procId = System.getenv("processor_identifer");
+ if (procId != null) {
+ String[] s = procId.split(",");
+ cpuMfr = s[s.length - 1].trim();
+ }
+ }
+ setCpuManufacturer(cpuMfr);
+
+ // try to remove the temp file that gets created from running wmic cmds
+ try {
+ // look in the current working directory
+ File f = new File("TempWmicBatchFile.bat");
+ if (f.exists()) {
+ f.delete();
+ }
+ } catch (Exception e) {
+ // ignore the exception
+ }
+ }
+
+
+ /**
+ * This method invokes wmic outside of the normal environment
+ * collection routines.
+ *
+ * An initial call to wmic can be costly in terms of time.
+ *
+ * <code>
+ * Details of why the first call is costly can be found at:
+ *
+ * http://support.microsoft.com/kb/290216/en-us
+ *
+ * "When you run the Wmic.exe utility for the first time, the utility
+ * compiles its .mof files into the repository. To save time during
+ * Windows installation, this operation takes place as necessary."
+ * </code>
+ */
+ private String getWmicResult(String alias, String verb, String property) {
+ String res = "";
+ BufferedReader in = null;
+ try {
+ ProcessBuilder pb = new ProcessBuilder("cmd", "/C", "WMIC", alias, verb, property);
+ Process p = pb.start();
+ // need this for executing windows commands (at least
+ // needed for executing wmic command)
+ BufferedWriter bw = new BufferedWriter(
+ new OutputStreamWriter(p.getOutputStream()));
+ bw.write(13);
+ bw.flush();
+ bw.close();
+
+ p.waitFor();
+ if (p.exitValue() == 0) {
+ in = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String line = null;
+ while ((line = in.readLine()) != null) {
+ line = line.trim();
+ if (line.length() == 0) {
+ continue;
+ }
+ res = line;
+ }
+ // return the *last* line read
+ return res;
+ }
+
+ } catch (Exception e) {
+ // ignore the exception
+ } finally {
+ if (in != null) {
+ try {
+ in.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ }
+ return res.trim();
+ }
+}
diff --git a/sj2/util/makefile.mk b/desktop/source/registration/com/sun/star/servicetag/makefile.mk
index 9a74eb31b012..d4ebbed2f0c4 100644
--- a/sj2/util/makefile.mk
+++ b/desktop/source/registration/com/sun/star/servicetag/makefile.mk
@@ -8,7 +8,7 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.16 $
+# $Revision: 1.2 $
#
# This file is part of OpenOffice.org.
#
@@ -29,69 +29,55 @@
#
#*************************************************************************
-PRJ=..
-
-PRJNAME=sj2
-TARGET=sj
-TARGETTYPE=GUI
+PRJNAME = setup_native
+PRJ = ..$/..$/..$/..$/..$/..
+TARGET = servicetag
+PACKAGE = com$/sun$/star$/servicetag
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
-# ------------------------------------------------------------------
-
-LIB1TARGET= $(SLB)$/$(TARGET).lib
-LIB1FILES= \
- $(SLB)$/jscpp.lib
+.IF "$(ENABLE_SVCTAGS)" == "YES"
-SHL1DEPN= $(LIB1TARGET)
+JARFILES = jurt.jar unoil.jar ridl.jar
+JAVAFILES = \
+ BrowserSupport.java \
+ Installer.java \
+ LinuxSystemEnvironment.java \
+ RegistrationData.java \
+ RegistrationDocument.java \
+ Registry.java \
+ ServiceTag.java \
+ SolarisServiceTag.java \
+ SolarisSystemEnvironment.java \
+ SunConnection.java \
+ SysnetRegistryHelper.java \
+ SystemEnvironment.java \
+ UnauthorizedAccessException.java \
+ Util.java \
+ WindowsSystemEnvironment.java
-SHL1TARGET= j$(DLLPOSTFIX)_g
-SHL1IMPLIB= $(TARGET)
+JAVACLASSFILES= $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-SHL1STDLIBS= \
- $(VCLLIB) \
- $(TOOLSLIB) \
- $(CPPULIB) \
- $(SALLIB)
+JARTARGET = $(TARGET).jar
+JARCOMPRESS = TRUE
+JARCLASSDIRS = $(PACKAGE)
-.IF "$(GUI)$(COMID)"=="WNTMSC"
-SHL1STDLIBS+= \
- $(SVTOOLLIB)
-.ENDIF # "$(GUI)$(COMID)"=="WNTMSC"
+JAVARES= $(CLASSDIR)$/$(PACKAGE)$/resources$/product_registration.xsd
-.IF "$(SOLAR_JAVA)"!=""
- SHL1STDLIBS+=$(JVMACCESSLIB)
-.ENDIF
+.ENDIF # "$(ENABLE_SVCTAGS)" == "YES"
-SHL1LIBS= $(SLB)$/$(TARGET).lib
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
+# --- Targets ------------------------------------------------------
-DEF1NAME =$(SHL1TARGET)
-DEF1DEPN =$(MISC)$/$(SHL1TARGET).flt
-DEFLIB1NAME =$(TARGET)
-DEF1DES =JavaCPP
-DEF1CEXP =Java
-JARTARGET=classes.jar
-JARCLASSDIRS=stardiv
-JARCLASSPATH = sandbox.jar
+.INCLUDE : target.mk
-# --- Targets ------------------------------------------------------
+.IF "$(ENABLE_SVCTAGS)" == "YES"
+ALLTAR: $(JAVARES)
-.INCLUDE : target.mk
-.INCLUDE : target.pmk
+$(JAVARES) : $$(@:d:d:f)$/$$(@:f)
+ $(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
-$(MISC)$/$(SHL1TARGET).flt: makefile.mk
- @echo ------------------------------
- @echo Making: $@
- @echo WEP>$@
- @echo LIBMAIN>>$@
- @echo LibMain>>$@
- @echo bad_alloc::bad_alloc>>$@
- @echo exception::exception>>$@
-.IF "$(COM)"=="MSC"
- @echo __CT>>$@
- @echo _C@>>$@
-.ENDIF
+.ENDIF # "$(ENABLE_SVCTAGS)" == "YES"
diff --git a/desktop/source/registration/com/sun/star/servicetag/resources/product_registration.xsd b/desktop/source/registration/com/sun/star/servicetag/resources/product_registration.xsd
new file mode 100644
index 000000000000..e9b34417d9ae
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/servicetag/resources/product_registration.xsd
@@ -0,0 +1,301 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+<xs:element name="registration_data">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="environment"
+ minOccurs="1"
+ maxOccurs="1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="hostname"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="hostId"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="osName"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="osVersion"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="osArchitecture"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="systemModel"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="systemManufacturer"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="cpuManufacturer"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="serialNumber"
+ minOccurs='1'
+ maxOccurs='1'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="registry"
+ minOccurs="1"
+ maxOccurs="1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="service_tag"
+ minOccurs="0"
+ maxOccurs="1024">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="instance_urn"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="product_name"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="product_version"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="product_urn"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="product_parent_urn"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="product_parent"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="product_defined_inst_id"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="product_vendor"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="platform_arch"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="timestamp"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="container"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="source"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="installer_uid"
+ minOccurs='1'
+ maxOccurs='1'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="urn"
+ type="xs:string"
+ use="required"/>
+ <xs:attribute name="version"
+ type="xs:string"
+ use="required"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="version"
+ type="xs:string"
+ use="required"/>
+ </xs:complexType>
+</xs:element>
+
+ <!-- definition of simple elements -->
+ <xs:element name="hostname">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1"/>
+ <xs:maxLength value="255"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="hostId">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="16"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="osName">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1"/>
+ <xs:maxLength value="256"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="osVersion">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="50"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="osArchitecture">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="256"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="systemModel">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="50"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="systemManufacturer">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="50"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="cpuManufacturer">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="50"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="serialNumber">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="256"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="instance_urn">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1"/>
+ <xs:maxLength value="255"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="product_name">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="255"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="product_version">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="63"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="product_urn">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1"/>
+ <xs:maxLength value="255"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="product_parent_urn">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="255"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="product_parent">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1"/>
+ <xs:maxLength value="255"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="product_defined_inst_id">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="255"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="product_vendor">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1"/>
+ <xs:maxLength value="63"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="platform_arch">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1"/>
+ <xs:maxLength value="63"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="timestamp">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="24"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="container">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="63"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="source">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="63"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="installer_uid">
+ <xs:simpleType>
+ <xs:restriction base="xs:integer">
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+</xs:schema>
diff --git a/desktop/source/splash/makefile.mk b/desktop/source/splash/makefile.mk
index 0447c0c2020e..3ca31875c937 100644
--- a/desktop/source/splash/makefile.mk
+++ b/desktop/source/splash/makefile.mk
@@ -72,6 +72,7 @@ SHL1STDLIBS= \
$(UCBHELPERLIB) \
$(CPPUHELPERLIB) \
$(CPPULIB) \
+ $(VOSLIB) \
$(SALLIB) \
$(SFXLIB)
diff --git a/desktop/util/hidother.src b/desktop/util/hidother.src
index f4d06d3fa72b..6f5a86159d75 100644
--- a/desktop/util/hidother.src
+++ b/desktop/util/hidother.src
@@ -36,6 +36,8 @@ hidspecial HID_PACKAGE_MANAGER_TREELISTBOX { HelpID = HID_PACKAGE_MANAGER_TREELI
hidspecial HID_PACKAGE_MANAGER_PROGRESS { HelpID = HID_PACKAGE_MANAGER_PROGRESS; };
hidspecial HID_PACKAGE_MANAGER_PROGRESS_CANCEL { HelpID = HID_PACKAGE_MANAGER_PROGRESS_CANCEL; };
+hidspecial HID_PACKAGE_MANAGER_UPD_REQ { HelpID = HID_PACKAGE_MANAGER_UPD_REQ; };
+
hidspecial HID_FIRSTSTART_PREV { HelpId = HID_FIRSTSTART_PREV;};
hidspecial HID_FIRSTSTART_NEXT { HelpId = HID_FIRSTSTART_NEXT;};
hidspecial HID_FIRSTSTART_CANCEL { HelpId = HID_FIRSTSTART_CANCEL;};
@@ -45,7 +47,7 @@ hidspecial UID_FIRSTSTART_HELP { HelpId = UID_FIRSTSTART_HELP;};
hidspecial UID_BTN_LICENSE_ACCEPT { HelpId = UID_BTN_LICENSE_ACCEPT;};
hidspecial HID_DEPLOYMENT_GUI_UPDATE { HelpId = HID_DEPLOYMENT_GUI_UPDATE;};
-hidspecial HID_DEPLOYMENT_GUI_UPDATE { HelpId = HID_DEPLOYMENT_GUI_UPDATEINSTALL;};
+hidspecial HID_DEPLOYMENT_GUI_UPDATEINSTALL { HelpId = HID_DEPLOYMENT_GUI_UPDATEINSTALL;};
hidspecial HID_EXTENSION_MANAGER_LISTBOX { HelpId = HID_EXTENSION_MANAGER_LISTBOX; };
hidspecial HID_EXTENSION_MANAGER_LISTBOX_OPTIONS { HelpId = HID_EXTENSION_MANAGER_LISTBOX_OPTIONS; };
diff --git a/desktop/util/makefile.mk b/desktop/util/makefile.mk
index b04162cf0ad1..05f129b3c5fc 100644
--- a/desktop/util/makefile.mk
+++ b/desktop/util/makefile.mk
@@ -78,6 +78,7 @@ RESLIB1IMAGES= $(PRJ)$/res
RESLIB1SRSFILES= $(SRS)$/desktop.srs \
$(SRS)$/wizard.srs
+.IF "$(L10N_framework)"==""
.IF "$(GUI)" != "OS2"
APP1TARGET=so$/$(TARGET)
APP1NOSAL=TRUE
@@ -107,7 +108,6 @@ APP1STDLIBS = \
$(SAXLIB) \
$(FWILIB) \
$(ICUUCLIB) \
- $(SJLIB) \
$(I18NUTILLIB) \
$(ICULIB) \
$(JVMFWKLIB) \
@@ -121,7 +121,7 @@ APP1STDLIBS = \
.IF "$(GUI)" == "UNX"
.IF "$(OS)" == "LINUX" || "$(OS)" == "FREEBSD"
-APP1STDLIBS+= -lXext -lSM -lICE
+APP1STDLIBS+= -lXext
.ENDIF
.ENDIF
@@ -171,7 +171,6 @@ APP5STDLIBS = \
$(SAXLIB) \
$(FWILIB) \
$(ICUUCLIB) \
- $(SJLIB) \
$(I18NUTILLIB) \
$(ICULIB) \
$(JVMFWKLIB) \
@@ -183,7 +182,8 @@ APP5STDLIBS = \
$(VOSLIB)
.IF "$(OS)" == "LINUX"
-APP5STDLIBS+= -lXext -lSM -lICE
+APP5STDLIBS+= -lXext
+#APP5STDLIBS+= -lXext -lSM -lICE
.ENDIF # LINUX
APP5DEPN= $(APP1TARGETN) $(APP5RES) ooverinfo.rc
@@ -241,10 +241,14 @@ APP5DEPN= $(APP1TARGETN) $(APP5RES) ooverinfo.rc
APP5DEF= $(MISCX)$/$(TARGET).def
.ENDIF # WNT
+.ENDIF
+
# --- Targets -------------------------------------------------------------
.INCLUDE : target.mk
+.IF "$(L10N_framework)"==""
+
.IF "$(APP1TARGETN)"!=""
$(APP1TARGETN) : $(MISC)$/binso_created.flg
.ENDIF # "$(APP1TARGETN)"!=""
@@ -333,3 +337,5 @@ $(BIN)$/$(TARGET).bin: $(BIN)$/$(TARGET)$(EXECPOST)
$(MISC)$/binso_created.flg :
@@-$(MKDIRHIER) $(BIN)$/so && $(TOUCH) $@
+
+.ENDIF
diff --git a/desktop/win32/source/extendloaderenvironment.cxx b/desktop/win32/source/extendloaderenvironment.cxx
index 4c8ae784acf7..e5b33f5aa2be 100644
--- a/desktop/win32/source/extendloaderenvironment.cxx
+++ b/desktop/win32/source/extendloaderenvironment.cxx
@@ -135,18 +135,21 @@ void extendLoaderEnvironment(WCHAR * binPath, WCHAR * iniDirectory) {
if (GetLastError() != ERROR_FILE_NOT_FOUND) {
fail();
}
+ // This path is only taken by testtool.exe in basis program directory;
+ // its PATH needs to include the brand program directory:
pathEnd = tools::buildPath(
path, iniDirectory, iniDirEnd, MY_STRING(L".."));
if (pathEnd == NULL) {
fail();
}
- exclude1 = true;
- } else {
- padEnd = tools::buildPath(pad, path, pathEnd, MY_STRING(L"\\program"));
+ padEnd = tools::buildPath(
+ pad, path, pathEnd, MY_STRING(L"\\..\\program"));
if (padEnd == NULL) {
fail();
}
exclude1 = contains(env, pad, padEnd);
+ } else {
+ exclude1 = true;
}
WCHAR * pad2 = exclude1 ? pad : padEnd + 1;
pathEnd = tools::buildPath(path, path, pathEnd, MY_STRING(L"\\ure-link"));
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
index 1e9dd170dd02..df09718a7582 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
@@ -41,6 +41,7 @@
#include <tools/poly.hxx>
#include <basegfx/range/b2drange.hxx>
#include <vector>
+#include <com/sun/star/lang/Locale.hpp>
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -75,8 +76,11 @@ namespace drawinglayer
~TextLayouterDevice();
void setFont(const Font& rFont);
- void setFontAttributes(const FontAttributes& rFontAttributes, const basegfx::B2DHomMatrix& rTransform);
- void setFontAttributes(const FontAttributes& rFontAttributes, double fFontScaleX, double fFontScaleY);
+ void setFontAttributes(
+ const FontAttributes& rFontAttributes,
+ double fFontScaleX,
+ double fFontScaleY,
+ const ::com::sun::star::lang::Locale & rLocale);
double getTextHeight() const;
double getOverlineHeight() const;
@@ -84,9 +88,6 @@ namespace drawinglayer
double getUnderlineHeight() const;
double getUnderlineOffset() const;
double getStrikeoutOffset() const;
-#ifdef WIN32
- double getCurrentFontRelation() const;
-#endif
double getTextWidth(
const String& rText,
@@ -98,9 +99,7 @@ namespace drawinglayer
const String& rText,
xub_StrLen nIndex,
xub_StrLen nLength,
- // #i89784# added suppirt for DXArray for justified text
- const ::std::vector< double >& rDXArray,
- double fFontScaleWidth);
+ const ::std::vector< double >& rDXArray);
basegfx::B2DRange getTextBoundRect(
const String& rText,
@@ -111,25 +110,33 @@ namespace drawinglayer
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
+// helper methods for vcl font handling
namespace drawinglayer
{
namespace primitive2d
{
- // helper methods for vcl font handling
+ // Create a VCL-Font based on the definitions in FontAttributes
+ // and the given FontScaling. The FontScaling defines the FontHeight
+ // (fFontScaleY) and the FontWidth (fFontScaleX). The combination of
+ // both defines FontStretching, where no stretching happens at
+ // fFontScaleY == fFontScaleX
Font getVclFontFromFontAttributes(
const FontAttributes& rFontAttributes,
double fFontScaleX,
double fFontScaleY,
double fFontRotation,
- const OutputDevice& rOutDev);
-
- Font getVclFontFromFontAttributes(
- const FontAttributes& rFontAttributes,
- const basegfx::B2DHomMatrix& rTransform,
- const OutputDevice& rOutDev);
-
- FontAttributes getFontAttributesFromVclFont(basegfx::B2DVector& rSize, const Font& rFont, bool bRTL, bool bBiDiStrong);
+ const ::com::sun::star::lang::Locale & rLocale);
+
+ // Generate FontAttributes DataSet derived from the given VCL-Font.
+ // The FontScaling with fFontScaleY, fFontScaleX relationship (see
+ // above) will be set in return parameter o_rSize to allow further
+ // processing
+ FontAttributes getFontAttributesFromVclFont(
+ basegfx::B2DVector& o_rSize,
+ const Font& rFont,
+ bool bRTL,
+ bool bBiDiStrong);
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
index 9515fcc22ee8..d7f9bdb1e89a 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
@@ -158,14 +158,6 @@ namespace drawinglayer
// the necessary VCL outline extractins, scaling adaptions and other stuff.
void getTextOutlinesAndTransformation(basegfx::B2DPolyPolygonVector& rTarget, basegfx::B2DHomMatrix& rTransformation) const;
- // adapts fontScale for usage with TextLayouter. Input is rScale which is the extracted
- // scale from a text transformation. A copy goes to rFontScale and is modified so that
- // it contains only positive scalings and XY-equal scalings to allow to get a non-X-scaled
- // Vcl-Font for TextLayouter. rScale is adapted accordingly to contain the corrected scale
- // which would need to be applied to e.g. outlines received from TextLayouter under
- // usage of fontScale. This includes Y-Scale, X-Scale-correction and mirrorings.
- void getCorrectedScaleAndFontScale(basegfx::B2DVector& rScale, basegfx::B2DVector& rFontScale) const;
-
// get data
const basegfx::B2DHomMatrix& getTextTransform() const { return maTextTransform; }
const String& getText() const { return maText; }
diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
index ffceaf8ce04a..1ed826dab562 100644
--- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
@@ -266,7 +266,38 @@ namespace drawinglayer
case GRAPHIC_GDIMETAFILE :
{
- xPrimitive = Primitive2DReference(new MetafilePrimitive2D(getTransform(), aTransformedGraphic.GetGDIMetaFile()));
+ // create MetafilePrimitive2D
+ const GDIMetaFile& rMetafile = aTransformedGraphic.GetGDIMetaFile();
+
+ xPrimitive = Primitive2DReference(
+ new MetafilePrimitive2D(
+ getTransform(),
+ rMetafile));
+
+ // #i100357# find out if clipping is needed for this primitive. Unfortunately,
+ // there exist Metafiles who's content is bigger than the proposed PrefSize set
+ // at them. This is an error, but we need to work around this
+ const Size aMetaFilePrefSize(rMetafile.GetPrefSize());
+ const Size aMetaFileRealSize(
+ const_cast< GDIMetaFile& >(rMetafile).GetBoundRect(
+ *Application::GetDefaultDevice()).GetSize());
+
+ if(aMetaFileRealSize.getWidth() > aMetaFilePrefSize.getWidth()
+ || aMetaFileRealSize.getHeight() > aMetaFilePrefSize.getHeight())
+ {
+ // clipping needed. Embed to MaskPrimitive2D. Create childs and mask polygon
+ const primitive2d::Primitive2DSequence aChildContent(&xPrimitive, 1);
+ basegfx::B2DPolygon aMaskPolygon(
+ basegfx::tools::createPolygonFromRect(
+ basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ aMaskPolygon.transform(getTransform());
+
+ xPrimitive = Primitive2DReference(
+ new MaskPrimitive2D(
+ basegfx::B2DPolyPolygon(aMaskPolygon),
+ aChildContent));
+ }
+
break;
}
diff --git a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
index 4faa85fe898c..d337950c6c6b 100644
--- a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
@@ -277,15 +277,16 @@ namespace drawinglayer
const FontAttributes& rFontAttributes) const
{
// create the SimpleTextPrimitive needed in any case
- rTarget.push_back(Primitive2DReference(new TextSimplePortionPrimitive2D(
- rDecTrans.getB2DHomMatrix(),
- rText,
- aTextPosition,
- aTextLength,
- rDXArray,
- rFontAttributes,
- getLocale(),
- getFontColor())));
+ rTarget.push_back(Primitive2DReference(
+ new TextSimplePortionPrimitive2D(
+ rDecTrans.getB2DHomMatrix(),
+ rText,
+ aTextPosition,
+ aTextLength,
+ rDXArray,
+ rFontAttributes,
+ getLocale(),
+ getFontColor())));
// see if something else needs to be done
const bool bOverlineUsed(FONT_UNDERLINE_NONE != getFontOverline());
@@ -305,7 +306,11 @@ namespace drawinglayer
// TextLayouterDevice is needed to get metrics for text decorations like
// underline/strikeout/emphasis marks from it. For setup, the font size is needed
- aTextLayouter.setFontAttributes(getFontAttributes(), rDecTrans.getScale().getX(), rDecTrans.getScale().getY());
+ aTextLayouter.setFontAttributes(
+ getFontAttributes(),
+ rDecTrans.getScale().getX(),
+ rDecTrans.getScale().getY(),
+ getLocale());
// get text width
double fTextWidth(0.0);
@@ -317,6 +322,14 @@ namespace drawinglayer
else
{
fTextWidth = rDXArray.back() * rDecTrans.getScale().getX();
+ const double fFontScaleX(rDecTrans.getScale().getX());
+
+ if(!basegfx::fTools::equal(fFontScaleX, 1.0)
+ && !basegfx::fTools::equalZero(fFontScaleX))
+ {
+ // need to take FontScaling out of the DXArray
+ fTextWidth /= fFontScaleX;
+ }
}
if(bOverlineUsed)
@@ -343,28 +356,26 @@ namespace drawinglayer
const String aSingleCharString(aStrikeoutChar);
const double fStrikeCharWidth(aTextLayouter.getTextWidth(aSingleCharString, 0, 1));
const double fStrikeCharCount(fabs(fTextWidth/fStrikeCharWidth));
- const sal_uInt32 nStrikeCharCount(static_cast< sal_uInt32 >(fStrikeCharCount + 0.9));
- const double fScaleX(rDecTrans.getScale().getX());
- const double fStrikeCharWidthUnscaled(basegfx::fTools::equalZero(fScaleX) ? fStrikeCharWidth : fStrikeCharWidth/fScaleX);
-
+ const sal_uInt32 nStrikeCharCount(static_cast< sal_uInt32 >(fStrikeCharCount + 0.5));
std::vector<double> aDXArray(nStrikeCharCount);
String aStrikeoutString;
for(sal_uInt32 a(0); a < nStrikeCharCount; a++)
{
aStrikeoutString += aSingleCharString;
- aDXArray[a] = (a + 1) * fStrikeCharWidthUnscaled;
+ aDXArray[a] = (a + 1) * fStrikeCharWidth;
}
- rTarget.push_back(Primitive2DReference(new TextSimplePortionPrimitive2D(
- rDecTrans.getB2DHomMatrix(),
- aStrikeoutString,
- 0,
- aStrikeoutString.Len(),
- aDXArray,
- rFontAttributes,
- getLocale(),
- getFontColor())));
+ rTarget.push_back(Primitive2DReference(
+ new TextSimplePortionPrimitive2D(
+ rDecTrans.getB2DHomMatrix(),
+ aStrikeoutString,
+ 0,
+ aStrikeoutString.Len(),
+ aDXArray,
+ rFontAttributes,
+ getLocale(),
+ getFontColor())));
}
else
{
@@ -483,17 +494,15 @@ namespace drawinglayer
xLocalBreakIterator.set(xMSF->createInstance(rtl::OUString::createFromAscii("com.sun.star.i18n.BreakIterator")), ::com::sun::star::uno::UNO_QUERY);
}
- if(xLocalBreakIterator.is())
+ if(xLocalBreakIterator.is() && getTextLength())
{
// init word iterator, get first word and truncate to possibilities
::com::sun::star::i18n::Boundary aNextWordBoundary(xLocalBreakIterator->getWordBoundary(
getText(), getTextPosition(), getLocale(), ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True));
- if(aNextWordBoundary.endPos == getTextPosition() && getTextLength() > 0)
+ if(aNextWordBoundary.endPos == getTextPosition())
{
- // #i96474#
- // a word before was found (this can happen when search starts on a whitespace and a word
- // in front of it exists), force to look one position further
+ // backward hit, force next word
aNextWordBoundary = xLocalBreakIterator->getWordBoundary(
getText(), getTextPosition() + 1, getLocale(), ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True);
}
@@ -526,7 +535,11 @@ namespace drawinglayer
if(bNoDXArray)
{
// ..but only completely when no DXArray
- aTextLayouter.setFontAttributes(getFontAttributes(), rDecTrans.getScale().getX(), rDecTrans.getScale().getY());
+ aTextLayouter.setFontAttributes(
+ getFontAttributes(),
+ rDecTrans.getScale().getX(),
+ rDecTrans.getScale().getY(),
+ getLocale());
}
// do iterate over single words
@@ -566,12 +579,25 @@ namespace drawinglayer
fOffset = getDXArray()[nIndex - 1];
}
+ // need offset without FontScale for building the new transformation. The
+ // new transformation will be multiplied with the current text transformation
+ // so FontScale would be double
+ double fOffsetNoScale(fOffset);
+ const double fFontScaleX(rDecTrans.getScale().getX());
+
+ if(!basegfx::fTools::equal(fFontScaleX, 1.0)
+ && !basegfx::fTools::equalZero(fFontScaleX))
+ {
+ fOffsetNoScale /= fFontScaleX;
+ }
+
// apply needed offset to transformation
- aNewTransform.translate(fOffset, 0.0);
+ aNewTransform.translate(fOffsetNoScale, 0.0);
if(!bNoDXArray)
{
- // DXArray values need to be corrected with the offset, too
+ // DXArray values need to be corrected with the offset, too. Here,
+ // take the scaled offset since the DXArray is scaled
const sal_uInt32 nArraySize(aNewDXArray.size());
for(sal_uInt32 a(0); a < nArraySize; a++)
@@ -591,12 +617,30 @@ namespace drawinglayer
impCreateGeometryContent(rTarget, aDecTrans, getText(), nNewTextStart,
nNewTextEnd - nNewTextStart, aNewDXArray, aNewFontAttributes);
- // prepare next word and truncate to possibilities
- aNextWordBoundary = xLocalBreakIterator->nextWord(
- getText(), aNextWordBoundary.endPos, getLocale(),
- ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES);
+ if(aNextWordBoundary.endPos >= getTextPosition() + getTextLength())
+ {
+ // end reached
+ aNextWordBoundary.startPos = aNextWordBoundary.endPos;
+ }
+ else
+ {
+ // get new word portion
+ const sal_Int32 nLastEndPos(aNextWordBoundary.endPos);
+
+ aNextWordBoundary = xLocalBreakIterator->getWordBoundary(
+ getText(), aNextWordBoundary.endPos, getLocale(),
+ ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True);
- impCorrectTextBoundary(aNextWordBoundary);
+ if(nLastEndPos == aNextWordBoundary.endPos)
+ {
+ // backward hit, force next word
+ aNextWordBoundary = xLocalBreakIterator->getWordBoundary(
+ getText(), nLastEndPos + 1, getLocale(),
+ ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True);
+ }
+
+ impCorrectTextBoundary(aNextWordBoundary);
+ }
}
}
}
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index 23ec468d83d4..e321783c8406 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -41,7 +41,9 @@
#include <vcl/virdev.hxx>
#include <vcl/font.hxx>
#include <vcl/metric.hxx>
+#include <i18npool/mslangid.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
+#include <vcl/svapp.hxx>
//////////////////////////////////////////////////////////////////////////////
// VDev RevDevice provider
@@ -165,14 +167,18 @@ namespace drawinglayer
mrDevice.SetFont( rFont );
}
- void TextLayouterDevice::setFontAttributes(const FontAttributes& rFontAttributes, const basegfx::B2DHomMatrix& rTransform)
- {
- setFont(getVclFontFromFontAttributes(rFontAttributes, rTransform, mrDevice));
- }
-
- void TextLayouterDevice::setFontAttributes(const FontAttributes& rFontAttributes, double fFontScaleX, double fFontScaleY)
+ void TextLayouterDevice::setFontAttributes(
+ const FontAttributes& rFontAttributes,
+ double fFontScaleX,
+ double fFontScaleY,
+ const ::com::sun::star::lang::Locale& rLocale)
{
- setFont(getVclFontFromFontAttributes(rFontAttributes, fFontScaleX, fFontScaleY, 0.0, mrDevice));
+ setFont(getVclFontFromFontAttributes(
+ rFontAttributes,
+ fFontScaleX,
+ fFontScaleY,
+ 0.0,
+ rLocale));
}
double TextLayouterDevice::getOverlineOffset() const
@@ -196,18 +202,6 @@ namespace drawinglayer
return fRet;
}
-#ifdef WIN32
- double TextLayouterDevice::getCurrentFontRelation() const
- {
- const Font aFont(mrDevice.GetFont());
- const FontMetric aFontMetric(mrDevice.GetFontMetric(aFont));
- const double fWidth(aFontMetric.GetWidth());
- const double fHeight(aFont.GetHeight());
-
- return basegfx::fTools::equalZero(fWidth) ? 1.0 : fHeight / fWidth;
- }
-#endif
-
double TextLayouterDevice::getOverlineHeight() const
{
const ::FontMetric& rMetric = mrDevice.GetFontMetric();
@@ -240,33 +234,42 @@ namespace drawinglayer
const String& rText,
xub_StrLen nIndex,
xub_StrLen nLength,
- // #i89784# added suppirt for DXArray for justified text
- const ::std::vector< double >& rDXArray,
- double fFontScaleWidth)
+ const ::std::vector< double >& rDXArray)
{
- std::vector< sal_Int32 > aTransformedDXArray;
- const sal_uInt32 nDXArraySize(rDXArray.size());
+ const sal_uInt32 nDXArrayCount(rDXArray.size());
- if(nDXArraySize && basegfx::fTools::more(fFontScaleWidth, 0.0))
+ if(nDXArrayCount)
{
- OSL_ENSURE(nDXArraySize == nLength, "DXArray size does not correspond to text portion size (!)");
- aTransformedDXArray.reserve(nDXArraySize);
+ OSL_ENSURE(nDXArrayCount == nLength, "DXArray size does not correspond to text portion size (!)");
+ std::vector< sal_Int32 > aIntegerDXArray(nDXArrayCount);
- for(std::vector< double >::const_iterator aStart(rDXArray.begin()); aStart != rDXArray.end(); aStart++)
+ for(sal_uInt32 a(0); a < nDXArrayCount; a++)
{
- aTransformedDXArray.push_back(basegfx::fround((*aStart) * fFontScaleWidth));
+ aIntegerDXArray[a] = basegfx::fround(rDXArray[a]);
}
- }
- return mrDevice.GetTextOutlines(
- rB2DPolyPolyVector,
- rText,
- nIndex,
- nIndex,
- nLength,
- true,
- 0,
- nDXArraySize ? &(aTransformedDXArray[0]) : 0);
+ return mrDevice.GetTextOutlines(
+ rB2DPolyPolyVector,
+ rText,
+ nIndex,
+ nIndex,
+ nLength,
+ true,
+ 0,
+ &(aIntegerDXArray[0]));
+ }
+ else
+ {
+ return mrDevice.GetTextOutlines(
+ rB2DPolyPolyVector,
+ rText,
+ nIndex,
+ nIndex,
+ nLength,
+ true,
+ 0,
+ 0);
+ }
}
basegfx::B2DRange TextLayouterDevice::getTextBoundRect(
@@ -285,12 +288,14 @@ namespace drawinglayer
nIndex,
nLength);
- return basegfx::B2DRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom());
- }
- else
- {
- return basegfx::B2DRange();
+ // #i104432#, #i102556# take empty results into account
+ if(!aRect.IsEmpty())
+ {
+ return basegfx::B2DRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom());
+ }
}
+
+ return basegfx::B2DRange();
}
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -304,70 +309,59 @@ namespace drawinglayer
{
Font getVclFontFromFontAttributes(
const FontAttributes& rFontAttributes,
- const basegfx::B2DHomMatrix& rTransform,
- const OutputDevice& rOutDev)
- {
- // decompose matrix to have position and size of text
- basegfx::B2DVector aScale, aTranslate;
- double fRotate, fShearX;
-
- rTransform.decompose(aScale, aTranslate, fRotate, fShearX);
-
- return getVclFontFromFontAttributes(rFontAttributes, aScale.getX(), aScale.getY(), fRotate, rOutDev);
- }
-
- Font getVclFontFromFontAttributes(
- const FontAttributes& rFontAttributes,
double fFontScaleX,
double fFontScaleY,
double fFontRotation,
- const OutputDevice& /*rOutDev*/)
+ const ::com::sun::star::lang::Locale& rLocale)
{
- sal_uInt32 nWidth(basegfx::fround(fabs(fFontScaleX)));
- sal_uInt32 nHeight(basegfx::fround(fabs(fFontScaleY)));
+ // detect FontScaling
+ const sal_uInt32 nHeight(basegfx::fround(fabs(fFontScaleY)));
+ const sal_uInt32 nWidth(basegfx::fround(fabs(fFontScaleX)));
+ const bool bFontIsScaled(nHeight != nWidth);
+
+#ifdef WIN32
+ // for WIN32 systems, start with creating an unscaled font. If FontScaling
+ // is wanted, that width needs to be adapted using FontMetric again to get a
+ // width of the unscaled font
Font aRetval(
rFontAttributes.getFamilyName(),
rFontAttributes.getStyleName(),
-#ifdef WIN32
Size(0, nHeight));
#else
- Size(nWidth, nHeight));
+ // for non-WIN32 systems things are easier since these accept a Font creation
+ // with initially nWidth != nHeight for FontScaling. Despite that, use zero for
+ // FontWidth when no scaling is used to explicitely have that zero when e.g. the
+ // Font would be recorded in a MetaFile (The MetaFile FontAction WILL record a
+ // set FontWidth; import that in a WIN32 system, and trouble is there)
+ Font aRetval(
+ rFontAttributes.getFamilyName(),
+ rFontAttributes.getStyleName(),
+ Size(bFontIsScaled ? nWidth : 0, nHeight));
#endif
-
+ // define various other FontAttributes
aRetval.SetAlign(ALIGN_BASELINE);
aRetval.SetCharSet(rFontAttributes.getSymbol() ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE);
aRetval.SetVertical(rFontAttributes.getVertical() ? TRUE : FALSE);
aRetval.SetWeight(static_cast<FontWeight>(rFontAttributes.getWeight()));
aRetval.SetItalic(rFontAttributes.getItalic() ? ITALIC_NORMAL : ITALIC_NONE);
aRetval.SetOutline(rFontAttributes.getOutline());
+ aRetval.SetLanguage(MsLangId::convertLocaleToLanguage(rLocale));
#ifdef WIN32
- // #100424# use higher precision
- if(!basegfx::fTools::equal(fFontScaleX, fFontScaleY))
+ // for WIN32 systems, correct the FontWidth if FontScaling is used
+ if(bFontIsScaled && nHeight > 0)
{
- // #i92757#
- // Removed the relative calculation with GetFontMetric() usage again. On
- // the one hand it was wrong (integer division always created zero), OTOH
- // calculating a scale factor from current to target width and then using
- // it to actually scale the current width does nothing but set the target
- // value directly. Maybe more is needed here with WIN version of font
- // width/height handling, but currently, this works the simple way.
- //
- // As can be seen, when this can stay the simple way, the OutputDevice
- // can be removed from the whole getVclFontFromFontAttributes implementations
- // again and make it more VCL-independent.
- //
- // Adapted nWidth usage to nWidth-1 to be completely compatible with
- // non-primitive version.
- //
- // previous stuff:
- // const FontMetric aFontMetric(rOutDev.GetFontMetric(aRetval));
- // const double fCurrentWidth(aFontMetric.GetWidth());
- // aRetval.SetWidth(basegfx::fround(fCurrentWidth * ((double)nWidth/(double)nHeight)));
- aRetval.SetWidth(nWidth ? nWidth - 1 : 0);
+ const FontMetric aUnscaledFontMetric(Application::GetDefaultDevice()->GetFontMetric(aRetval));
+
+ if(aUnscaledFontMetric.GetWidth() > 0)
+ {
+ const double fScaleFactor((double)nWidth / (double)nHeight);
+ const sal_uInt32 nScaledWidth(basegfx::fround((double)aUnscaledFontMetric.GetWidth() * fScaleFactor));
+ aRetval.SetWidth(nScaledWidth);
+ }
}
#endif
-
+ // handle FontRotation (if defined)
if(!basegfx::fTools::equalZero(fFontRotation))
{
sal_Int16 aRotate10th((sal_Int16)(fFontRotation * (-1800.0/F_PI)));
@@ -377,9 +371,13 @@ namespace drawinglayer
return aRetval;
}
- FontAttributes getFontAttributesFromVclFont(basegfx::B2DVector& rSize, const Font& rFont, bool bRTL, bool bBiDiStrong)
+ FontAttributes getFontAttributesFromVclFont(
+ basegfx::B2DVector& o_rSize,
+ const Font& rFont,
+ bool bRTL,
+ bool bBiDiStrong)
{
- FontAttributes aRetval(
+ const FontAttributes aRetval(
rFont.GetName(),
rFont.GetStyleName(),
static_cast<sal_uInt16>(rFont.GetWeight()),
@@ -391,12 +389,38 @@ namespace drawinglayer
bBiDiStrong);
// TODO: eKerning
- const sal_Int32 nWidth(rFont.GetSize().getWidth());
- const sal_Int32 nHeight(rFont.GetSize().getHeight());
+ // set FontHeight and init to no FontScaling
+ o_rSize.setY(rFont.GetSize().getHeight() > 0 ? rFont.GetSize().getHeight() : 0);
+ o_rSize.setX(o_rSize.getY());
- rSize.setX(nWidth ? nWidth : nHeight);
- rSize.setY(nHeight);
+#ifdef WIN32
+ // for WIN32 systems, the FontScaling at the Font is detected by
+ // checking that FontWidth != 0. When FontScaling is used, WIN32
+ // needs to do extra stuff to detect the correct width (since it's
+ // zero and not equal the font height) and it's relationship to
+ // the height
+ if(rFont.GetSize().getWidth() > 0)
+ {
+ Font aUnscaledFont(rFont);
+ aUnscaledFont.SetWidth(0);
+ const FontMetric aUnscaledFontMetric(Application::GetDefaultDevice()->GetFontMetric(aUnscaledFont));
+ if(aUnscaledFontMetric.GetWidth() > 0)
+ {
+ const double fScaleFactor((double)rFont.GetSize().getWidth() / (double)aUnscaledFontMetric.GetWidth());
+ o_rSize.setX(fScaleFactor * o_rSize.getY());
+ }
+ }
+#else
+ // For non-WIN32 systems the detection is the same, but the value
+ // is easier achieved since width == height is interpreted as no
+ // scaling. Ergo, Width == 0 means width == height, and width != 0
+ // means the scaling is in the direct relation of width to height
+ if(rFont.GetSize().getWidth() > 0)
+ {
+ o_rSize.setX((double)rFont.GetSize().getWidth());
+ }
+#endif
return aRetval;
}
} // end of namespace primitive2d
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index 1b527668db2c..f8e413da0e8c 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -70,49 +70,63 @@ namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
-namespace drawinglayer
+namespace
{
- namespace primitive2d
+ // adapts fontScale for usage with TextLayouter. Input is rScale which is the extracted
+ // scale from a text transformation. A copy is modified so that it contains only positive
+ // scalings and XY-equal scalings to allow to get a non-X-scaled Vcl-Font for TextLayouter.
+ // rScale is adapted accordingly to contain the corrected scale which would need to be
+ // applied to e.g. outlines received from TextLayouter under usage of fontScale. This
+ // includes Y-Scale, X-Scale-correction and mirrorings.
+ basegfx::B2DVector getCorrectedScaleAndFontScale(basegfx::B2DVector& rScale)
{
- void TextSimplePortionPrimitive2D::getCorrectedScaleAndFontScale(basegfx::B2DVector& rScale, basegfx::B2DVector& rFontScale) const
- {
- // copy input value
- rFontScale = rScale;
+ // copy input value
+ basegfx::B2DVector aFontScale(rScale);
- if(basegfx::fTools::equalZero(rFontScale.getY()))
- {
- // no font height; choose one and adapt scale to get back to original scaling
- static double fDefaultFontScale(100.0);
- rScale.setY(1.0 / fDefaultFontScale);
- rFontScale.setY(fDefaultFontScale);
- }
- else if(basegfx::fTools::less(rFontScale.getY(), 0.0))
- {
- // negative font height; invert and adapt scale to get back to original scaling
- rFontScale.setY(-rFontScale.getY());
- rScale.setY(-1.0);
- }
- else
- {
- // positive font height; adapt scale; scaling will be part of the polygons
- rScale.setY(1.0);
- }
+ // correct FontHeight settings
+ if(basegfx::fTools::equalZero(aFontScale.getY()))
+ {
+ // no font height; choose one and adapt scale to get back to original scaling
+ static double fDefaultFontScale(100.0);
+ rScale.setY(1.0 / fDefaultFontScale);
+ aFontScale.setY(fDefaultFontScale);
+ }
+ else if(basegfx::fTools::less(aFontScale.getY(), 0.0))
+ {
+ // negative font height; invert and adapt scale to get back to original scaling
+ aFontScale.setY(-aFontScale.getY());
+ rScale.setY(-1.0);
+ }
+ else
+ {
+ // positive font height; adapt scale; scaling will be part of the polygons
+ rScale.setY(1.0);
+ }
- if(basegfx::fTools::equal(rFontScale.getX(), rFontScale.getY()))
- {
- // adapt scale in X
- rScale.setX(1.0);
- }
- else
- {
- // If font scale is different in X and Y, force font scale to equal
- // in X and Y to get a non-scaled VCL font.
- // Adapt scaling in X accordingly. FontScaleY cannot be zero here.
- rScale.setX(rFontScale.getX()/rFontScale.getY());
- rFontScale.setX(rFontScale.getY());
- }
+ // correct FontWidth settings
+ if(basegfx::fTools::equal(aFontScale.getX(), aFontScale.getY()))
+ {
+ // no FontScale, adapt scale
+ rScale.setX(1.0);
+ }
+ else
+ {
+ // If FontScale is used, force to no FontScale to get a non-scaled VCL font.
+ // Adapt scaling in X accordingly.
+ rScale.setX(aFontScale.getX() / aFontScale.getY());
+ aFontScale.setX(aFontScale.getY());
}
+ return aFontScale;
+ }
+} // end of anonymous namespace
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
void TextSimplePortionPrimitive2D::getTextOutlinesAndTransformation(basegfx::B2DPolyPolygonVector& rTarget, basegfx::B2DHomMatrix& rTransformation) const
{
if(getTextLength())
@@ -137,33 +151,47 @@ namespace drawinglayer
// the font size. Since we want to extract polygons here, it is okay to
// work just with scaling and to ignore shear, rotation and translation,
// all that can be applied to the polygons later
-#ifdef WIN32
- const bool bCorrectScale(!basegfx::fTools::equal(fabs(aScale.getX()), fabs(aScale.getY())));
-#endif
- basegfx::B2DVector aFontScale;
- getCorrectedScaleAndFontScale(aScale, aFontScale);
+ const basegfx::B2DVector aFontScale(getCorrectedScaleAndFontScale(aScale));
// prepare textlayoutdevice
TextLayouterDevice aTextLayouter;
- aTextLayouter.setFontAttributes(getFontAttributes(), aFontScale.getX(), aFontScale.getY());
-#ifdef WIN32
- // when under Windows and the font is unequally scaled, need to correct font X-Scaling factor
- if(bCorrectScale)
+ aTextLayouter.setFontAttributes(
+ getFontAttributes(),
+ aFontScale.getX(),
+ aFontScale.getY(),
+ getLocale());
+
+ // When getting outlines from stretched text (aScale.getX() != 1.0) it
+ // is necessary to inverse-scale the DXArray (if used) to not get the
+ // outlines already aligned to given, but wrong DXArray
+ if(getDXArray().size() && !basegfx::fTools::equal(aScale.getX(), 1.0))
{
- const double fFontRelation(aTextLayouter.getCurrentFontRelation());
- aScale.setX(aScale.getX() * fFontRelation);
- aFontScale.setX(aFontScale.getX() / fFontRelation);
+ ::std::vector< double > aScaledDXArray = getDXArray();
+ const double fDXArrayScale(1.0 / aScale.getX());
+
+ for(sal_uInt32 a(0); a < aScaledDXArray.size(); a++)
+ {
+ aScaledDXArray[a] *= fDXArrayScale;
+ }
+
+ // get the text outlines
+ aTextLayouter.getTextOutlines(
+ rTarget,
+ getText(),
+ getTextPosition(),
+ getTextLength(),
+ aScaledDXArray);
+ }
+ else
+ {
+ // get the text outlines
+ aTextLayouter.getTextOutlines(
+ rTarget,
+ getText(),
+ getTextPosition(),
+ getTextLength(),
+ getDXArray());
}
-#endif
- // get the text outlines. No DXArray is given (would contain integers equal to unit vector
- // transformed by object's transformation), let VCL do the job
- aTextLayouter.getTextOutlines(
- rTarget, getText(),
- getTextPosition(),
- getTextLength(),
- // #i89784# added support for DXArray for justified text
- getDXArray(),
- aFontScale.getX());
// create primitives for the outlines
const sal_uInt32 nCount(rTarget.size());
@@ -300,38 +328,36 @@ namespace drawinglayer
// the font size. Since we want to extract polygons here, it is okay to
// work just with scaling and to ignore shear, rotation and translation,
// all that can be applied to the polygons later
-#ifdef WIN32
- const bool bCorrectScale(!basegfx::fTools::equal(fabs(aScale.getX()), fabs(aScale.getY())));
-#endif
- basegfx::B2DVector aFontScale;
- getCorrectedScaleAndFontScale(aScale, aFontScale);
+ const basegfx::B2DVector aFontScale(getCorrectedScaleAndFontScale(aScale));
// prepare textlayoutdevice
TextLayouterDevice aTextLayouter;
- aTextLayouter.setFontAttributes(getFontAttributes(), aFontScale.getX(), aFontScale.getY());
+ aTextLayouter.setFontAttributes(
+ getFontAttributes(),
+ aFontScale.getX(),
+ aFontScale.getY(),
+ getLocale());
// get basic text range
basegfx::B2DRange aNewRange(aTextLayouter.getTextBoundRect(getText(), getTextPosition(), getTextLength()));
-#ifdef WIN32
- // when under Windows and the font is unequally scaled, need to correct font X-Scaling factor
- if(bCorrectScale)
+
+ // #i104432#, #i102556# take empty results into account
+ if(!aNewRange.isEmpty())
{
- aScale.setX(aScale.getX() * aTextLayouter.getCurrentFontRelation());
- }
-#endif
- // prepare object transformation for range
- basegfx::B2DHomMatrix aRangeTransformation;
+ // prepare object transformation for range
+ basegfx::B2DHomMatrix aRangeTransformation;
- aRangeTransformation.scale(aScale.getX(), aScale.getY());
- aRangeTransformation.shearX(fShearX);
- aRangeTransformation.rotate(fRotate);
- aRangeTransformation.translate(aTranslate.getX(), aTranslate.getY());
+ aRangeTransformation.scale(aScale.getX(), aScale.getY());
+ aRangeTransformation.shearX(fShearX);
+ aRangeTransformation.rotate(fRotate);
+ aRangeTransformation.translate(aTranslate.getX(), aTranslate.getY());
- // apply range transformation to it
- aNewRange.transform(aRangeTransformation);
+ // apply range transformation to it
+ aNewRange.transform(aRangeTransformation);
- // assign to buffered value
- const_cast< TextSimplePortionPrimitive2D* >(this)->maB2DRange = aNewRange;
+ // assign to buffered value
+ const_cast< TextSimplePortionPrimitive2D* >(this)->maB2DRange = aNewRange;
+ }
}
}
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 24f54d3ddc58..1c040545eedd 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -614,13 +614,13 @@ namespace drawinglayer
{
const GraphicAttr& rAttr = rGraphicPrimitive.getGraphicAttr();
- if(!rAttr.IsSpecialDrawMode() && !rAttr.IsMirrored() && !rAttr.IsRotated() && !rAttr.IsAdjusted())
+ if(!rAttr.IsSpecialDrawMode() && !rAttr.IsAdjusted())
{
const basegfx::B2DHomMatrix& rTransform = rGraphicPrimitive.getTransform();
double fRotate, fShearX;
rTransform.decompose(aScale, aTranslate, fRotate, fShearX);
- if(aScale.getX() > 0.0 && aScale.getY() > 0.0)
+ if( basegfx::fTools::equalZero( fRotate ) && ( aScale.getX() > 0.0 ) && ( aScale.getY() > 0.0 ) )
{
bUsingPDFExtOutDevData = true;
mpPDFExtOutDevData->BeginGroup();
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 0c5299c9c99d..e5a88812dd10 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -4,10 +4,6 @@
*
* $RCSfile: vclprocessor2d.cxx,v $
*
- * $Revision: 1.31 $
- *
- * last change: $Author: aw $ $Date: 2008-06-24 15:31:09 $
- *
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
@@ -142,77 +138,31 @@ namespace drawinglayer
{
// decompose matrix to have position and size of text
basegfx::B2DHomMatrix aLocalTransform(maCurrentTransformation * rTextCandidate.getTextTransform());
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aFontScaling, aTranslate;
double fRotate, fShearX;
- aLocalTransform.decompose(aScale, aTranslate, fRotate, fShearX);
+ aLocalTransform.decompose(aFontScaling, aTranslate, fRotate, fShearX);
bool bPrimitiveAccepted(false);
if(basegfx::fTools::equalZero(fShearX))
{
- if(basegfx::fTools::less(aScale.getX(), 0.0) && basegfx::fTools::less(aScale.getY(), 0.0))
+ if(basegfx::fTools::less(aFontScaling.getX(), 0.0) && basegfx::fTools::less(aFontScaling.getY(), 0.0))
{
// handle special case: If scale is negative in (x,y) (3rd quadrant), it can
- // be expressed as rotation by PI
- aScale = basegfx::absolute(aScale);
+ // be expressed as rotation by PI. Use this since the Font rendering will not
+ // apply the negative scales in any form
+ aFontScaling = basegfx::absolute(aFontScaling);
fRotate += F_PI;
}
- if(basegfx::fTools::more(aScale.getX(), 0.0) && basegfx::fTools::more(aScale.getY(), 0.0))
+ if(basegfx::fTools::more(aFontScaling.getX(), 0.0) && basegfx::fTools::more(aFontScaling.getY(), 0.0))
{
- // #i96581# Get the font forced without FontStretching (use FontHeight as FontWidth)
+ // Get the VCL font (use FontHeight as FontWidth)
Font aFont(primitive2d::getVclFontFromFontAttributes(
rTextCandidate.getFontAttributes(),
-
- // #i100373# FontScaling
- //
- // There are two different definitions for unscaled fonts, (1) 0==width and
- // (2) height==width where (2) is the more modern one supported on all non-WIN32
- // systems and (1) is the old one coming from WIN16-VCL definitions where
- // that ominous FontWidth (available over FontMetric) is involved. While
- // WIN32 only supports (1), all other systems support (2). When on WIN32, the
- // support for (1) is ensured inside getVclFontFromFontAttributes.
- //
- // The former usage of (2) leads to problems when it is used on non-WIN32 systems
- // and exported to MetaFile FontActions where the scale is taken over unseen. When
- // such a MetaFile is imported on a WIN32-System supporting (1), all fonts are
- // seen as scaled an look wrong.
- //
- // The simplest and fastest solution is to fallback to (1) independent from the
- // system we are running on.
- //
- // The best solution would be a system-independent Y-value just expressing the
- // font scaling, e.g. when (2) is used and width == height, use 1.0 as Y-Value,
- // which would also solve the involved ominous FontWidth value for WIN32-systems.
- // This is a region which needs redesign urgently.
- //
- 0, // aScale.getY(),
-
- aScale.getY(),
+ aFontScaling.getX(),
+ aFontScaling.getY(),
fRotate,
- *mpOutputDevice));
-
- if(!basegfx::fTools::equal(aScale.getX(), aScale.getY()))
- {
- // #100424# We have a hint on FontScaling here. To decide a look
- // at the pure font's scale is needed, since e.g. SC uses unequally scaled
- // MapModes (was: #i96581#, but use available full precision from primitive
- // now). aTranslate and fShearX can be reused since no longer needed.
- basegfx::B2DVector aFontScale;
- double fFontRotate;
- rTextCandidate.getTextTransform().decompose(aFontScale, aTranslate, fFontRotate, fShearX);
-
- if(!basegfx::fTools::equal(aFontScale.getX(), aFontScale.getY()))
- {
- // indeed a FontScaling. Set at Font. Use the combined scale
- // and rotate here
- aFont = primitive2d::getVclFontFromFontAttributes(
- rTextCandidate.getFontAttributes(),
- aScale.getX(),
- aScale.getY(),
- fRotate,
- *mpOutputDevice);
- }
- }
+ rTextCandidate.getLocale()));
// handle additional font attributes
const primitive2d::TextDecoratedPortionPrimitive2D* pTCPP =
@@ -225,11 +175,13 @@ namespace drawinglayer
const basegfx::BColor aTextlineColor = maBColorModifierStack.getModifiedColor(pTCPP->getTextlineColor());
mpOutputDevice->SetTextLineColor( Color(aTextlineColor) );
- // set Overline attribute
+ // set Overline attribute
FontUnderline eFontOverline = mapTextLineStyle( pTCPP->getFontOverline() );
if( eFontOverline != UNDERLINE_NONE )
{
aFont.SetOverline( eFontOverline );
+ const basegfx::BColor aOverlineColor = maBColorModifierStack.getModifiedColor(pTCPP->getOverlineColor());
+ mpOutputDevice->SetOverlineColor( Color(aOverlineColor) );
if( pTCPP->getWordLineMode() )
aFont.SetWordLineMode( true );
}
@@ -314,10 +266,11 @@ namespace drawinglayer
if(rTextCandidate.getDXArray().size())
{
aTransformedDXArray.reserve(rTextCandidate.getDXArray().size());
- const basegfx::B2DVector aPixelVector(aLocalTransform * basegfx::B2DVector(1.0, 0.0));
+ const basegfx::B2DVector aPixelVector(maCurrentTransformation * basegfx::B2DVector(1.0, 0.0));
const double fPixelVectorFactor(aPixelVector.getLength());
- for(::std::vector< double >::const_iterator aStart(rTextCandidate.getDXArray().begin()); aStart != rTextCandidate.getDXArray().end(); aStart++)
+ for(::std::vector< double >::const_iterator aStart(rTextCandidate.getDXArray().begin());
+ aStart != rTextCandidate.getDXArray().end(); aStart++)
{
aTransformedDXArray.push_back(basegfx::fround((*aStart) * fPixelVectorFactor));
}
@@ -680,6 +633,15 @@ namespace drawinglayer
double fRotate, fShearX;
aLocalTransform.decompose(aScale, aTranslate, fRotate, fShearX);
+ if(basegfx::fTools::less(aScale.getX(), 0.0) && basegfx::fTools::less(aScale.getY(), 0.0))
+ {
+ // #i102175# handle special case: If scale is negative in (x,y) (3rd quadrant), it can
+ // be expressed as rotation by PI. This needs to be done for Metafiles since
+ // these can be rotated, but not really mirrored
+ aScale = basegfx::absolute(aScale);
+ fRotate += F_PI;
+ }
+
// get BoundRect
basegfx::B2DRange aOutlineRange(rMetaCandidate.getB2DRange(getViewInformation2D()));
aOutlineRange.transform(maCurrentTransformation);
@@ -713,8 +675,18 @@ namespace drawinglayer
// rotation
if(!basegfx::fTools::equalZero(fRotate))
{
- double fRotation((fRotate / F_PI180) * -10.0);
- aMetaFile.Rotate((sal_uInt16)(fRotation));
+ // #i103530#
+ // MetaFile::Rotate has no input parameter check, so the parameter needs to be
+ // well-aligned to the old range [0..3600] 10th degrees with inverse orientation
+ sal_Int16 nRotation((sal_Int16)((fRotate / F_PI180) * -10.0));
+
+ while(nRotation < 0)
+ nRotation += 3600;
+
+ while(nRotation >= 3600)
+ nRotation -= 3600;
+
+ aMetaFile.Rotate(nRotation);
}
// Prepare target output size
diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
index 0a15ff224073..b5a59e10a119 100644
--- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
@@ -675,15 +675,25 @@ namespace drawinglayer
{
// step two:
//
- // bring from [0.0 .. 1.0] in X,Y and Z to view cordinates. also:
- // - scale Z to [0.0 .. fMaxZDepth]
- const double fMaxZDepth(double(0x0000ff00));
+ // bring from [0.0 .. 1.0] in X,Y and Z to view cordinates
+ //
+ // #i102611#
+ // also: scale Z to [1.5 .. 65534.5]. Normally, a range of [0.0 .. 65535.0]
+ // could be used, but a 'unused' value is needed, so '0' is used what reduces
+ // the range to [1.0 .. 65535.0]. It has also shown that small numerical errors
+ // (smaller as basegfx::fTools::mfSmallValue, which is 0.000000001) happen.
+ // Instead of checking those by basegfx::fTools methods which would cost
+ // runtime, just add another 0.5 tolerance to the start and end of the Z-Buffer
+ // range, thus resulting in [1.5 .. 65534.5]
+ const double fMaxZDepth(65533.0);
aDeviceToView.translate(-rVisiblePart.getMinX(), -rVisiblePart.getMinY(), 0.0);
if(mnAntiAlialize)
aDeviceToView.scale(fFullViewSizeX * mnAntiAlialize, fFullViewSizeY * mnAntiAlialize, fMaxZDepth);
else
aDeviceToView.scale(fFullViewSizeX, fFullViewSizeY, fMaxZDepth);
+
+ aDeviceToView.translate(0.0, 0.0, 1.5);
}
// update local ViewInformation3D with own DeviceToView
diff --git a/drawinglayer/util/makefile.mk b/drawinglayer/util/makefile.mk
index 3d29625cb0e6..5356ee0cef54 100644
--- a/drawinglayer/util/makefile.mk
+++ b/drawinglayer/util/makefile.mk
@@ -72,6 +72,7 @@ SHL1STDLIBS=\
$(CPPUHELPERLIB) \
$(CPPULIB) \
$(AVMEDIALIB) \
+ $(I18NISOLANGLIB) \
$(COMPHELPERLIB)
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx
index 668c4a53508f..85f9b8b0b2c9 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -696,3 +696,9 @@ void SAL_CALL OCommonEmbeddedObject::setParent( const com::sun::star::uno::Refer
}
}
+// XDefaultSizeTransmitter
+void SAL_CALL OCommonEmbeddedObject::setDefaultSize( const ::com::sun::star::awt::Size& rSize_100TH_MM ) throw (::com::sun::star::uno::RuntimeException)
+{
+ //#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this method
+ m_aDefaultSizeForChart_In_100TH_MM = rSize_100TH_MM;
+}
diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx
index 58a5e87fe418..e557437e336d 100644
--- a/embeddedobj/source/commonembedding/miscobj.cxx
+++ b/embeddedobj/source/commonembedding/miscobj.cxx
@@ -361,9 +361,14 @@ uno::Any SAL_CALL OCommonEmbeddedObject::queryInterface( const uno::Type& rType
{
uno::Any aReturn;
- aReturn <<= ::cppu::queryInterface(
+ if ( rType == ::getCppuType( (uno::Reference< embed::XEmbeddedObject > const *)0 ))
+ {
+ void * p = static_cast< embed::XEmbeddedObject * >( this );
+ return uno::Any( &p, rType );
+ }
+ else
+ aReturn <<= ::cppu::queryInterface(
rType,
- static_cast< embed::XEmbeddedObject* >( this ),
static_cast< embed::XInplaceObject* >( this ),
static_cast< embed::XVisualObject* >( this ),
static_cast< embed::XCommonEmbedPersist* >( static_cast< embed::XEmbedPersist* >( this ) ),
@@ -374,6 +379,7 @@ uno::Any SAL_CALL OCommonEmbeddedObject::queryInterface( const uno::Type& rType
static_cast< embed::XComponentSupplier* >( this ),
static_cast< util::XCloseable* >( this ),
static_cast< container::XChild* >( this ),
+ static_cast< chart2::XDefaultSizeTransmitter* >( this ),
static_cast< document::XEventBroadcaster* >( this ) );
if ( aReturn.hasValue() )
diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx
index 8d33935168b6..47b16bf961af 100644
--- a/embeddedobj/source/commonembedding/persistence.cxx
+++ b/embeddedobj/source/commonembedding/persistence.cxx
@@ -58,6 +58,7 @@
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/IllegalTypeException.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
#include <comphelper/fileformat.h>
#include <comphelper/storagehelper.hxx>
@@ -463,6 +464,15 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag
uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xFactory, GetDocumentServiceName(),
m_bEmbeddedScriptSupport ) );
+ //#i103460# ODF: take the size given from the parent frame as default
+ uno::Reference< chart2::XChartDocument > xChart( xDocument, uno::UNO_QUERY );
+ if( xChart.is() )
+ {
+ uno::Reference< embed::XVisualObject > xChartVisualObject( xChart, uno::UNO_QUERY );
+ if( xChartVisualObject.is() )
+ xChartVisualObject->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, m_aDefaultSizeForChart_In_100TH_MM );
+ }
+
uno::Reference< frame::XLoadable > xLoadable( xDocument, uno::UNO_QUERY );
uno::Reference< document::XStorageBasedDocument > xDoc
#ifdef USE_STORAGEBASED_DOCUMENT
diff --git a/embeddedobj/source/inc/commonembobj.hxx b/embeddedobj/source/inc/commonembobj.hxx
index afd199af9207..5a2827de3aa6 100644
--- a/embeddedobj/source/inc/commonembobj.hxx
+++ b/embeddedobj/source/inc/commonembobj.hxx
@@ -47,6 +47,7 @@
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/document/XEventBroadcaster.hpp>
#include <com/sun/star/util/XCloseable.hpp>
+#include <com/sun/star/chart2/XDefaultSizeTransmitter.hpp>
#include <cppuhelper/weak.hxx>
namespace com { namespace sun { namespace star {
@@ -85,6 +86,7 @@ class OCommonEmbeddedObject : public ::com::sun::star::embed::XEmbeddedObject
, public ::com::sun::star::embed::XLinkageSupport
, public ::com::sun::star::embed::XInplaceObject
, public ::com::sun::star::container::XChild
+ , public ::com::sun::star::chart2::XDefaultSizeTransmitter
, public ::cppu::OWeakObject
{
protected:
@@ -159,6 +161,7 @@ protected:
sal_Bool m_bHasClonedSize; // the object has cached size
::com::sun::star::awt::Size m_aClonedSize;
sal_Int32 m_nClonedMapUnit;
+ ::com::sun::star::awt::Size m_aDefaultSizeForChart_In_100TH_MM;//#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this member
private:
void CommonInit_Impl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aObjectProps );
@@ -492,6 +495,10 @@ public:
// XChild
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+
+ // XDefaultSizeTransmitter
+ //#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this method
+ virtual void SAL_CALL setDefaultSize( const ::com::sun::star::awt::Size& rSize_100TH_MM ) throw (::com::sun::star::uno::RuntimeException);
};
#endif
diff --git a/eventattacher/source/eventattacher.cxx b/eventattacher/source/eventattacher.cxx
index 04ed033862c1..b61548c0fa3c 100644
--- a/eventattacher/source/eventattacher.cxx
+++ b/eventattacher/source/eventattacher.cxx
@@ -882,7 +882,7 @@ void * SAL_CALL component_getFactory(
{
Reference< XSingleServiceFactory > xFactory( createOneInstanceFactory(
reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
- OUString( RTL_CONSTASCII_USTRINGPARAM( pImplName ) ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM( IMPLNAME ) ),
::comp_EventAttacher::EventAttacherImpl_CreateInstance,
::comp_EventAttacher::EventAttacherImpl::getSupportedServiceNames_Static() ) );
diff --git a/eventattacher/source/makefile.mk b/eventattacher/source/makefile.mk
index 1a1cbe3f751a..f642559b8000 100644
--- a/eventattacher/source/makefile.mk
+++ b/eventattacher/source/makefile.mk
@@ -40,6 +40,7 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
# ------------------------------------------------------------------
+.IF "$(L10N_framework)"==""
SLOFILES= \
$(SLO)$/eventattacher.obj
@@ -59,6 +60,8 @@ SHL1STDLIBS= \
SHL1DEPN=
SHL1LIBS= $(SLB)$/$(TARGET).lib
+.ENDIF # L10N_framework
+
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
diff --git a/fileaccess/source/makefile.mk b/fileaccess/source/makefile.mk
index 36906af4e103..ff9eaab41f40 100644
--- a/fileaccess/source/makefile.mk
+++ b/fileaccess/source/makefile.mk
@@ -40,6 +40,7 @@ COMPRDB=$(SOLARBINDIR)$/types.rdb
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
+.IF "$(L10N_framework)"==""
# ------------------------------------------------------------------
SLOFILES= \
@@ -65,6 +66,7 @@ SHL1DEPN=
SHL1LIBS=$(SLB)$/$(TARGET).lib
# --- Targets ------------------------------------------------------
+.ENDIF # L10N_framework
.INCLUDE : target.mk
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index 3cb3eb10f1eb..ae9848778622 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -900,6 +900,8 @@ inline bool MissingConvention::isRewriteNeeded( OpCode eOp ) const
case ocGammaDist:
case ocPoissonDist:
case ocAddress:
+ case ocLogNormDist:
+ case ocNormDist:
return true;
case ocMissing:
case ocLog:
@@ -943,6 +945,25 @@ void FormulaMissingContext::AddMoreArgs( FormulaTokenArray *pNewArr, const Missi
pNewArr->AddDouble( 1.0 ); // 3rd, Cumulative=TRUE()
}
break;
+ case ocNormDist:
+ if ( mnCurArg == 2 )
+ {
+ pNewArr->AddOpCode( ocSep );
+ pNewArr->AddDouble( 1.0 ); // 4th, Cumulative=TRUE()
+ }
+ break;
+ case ocLogNormDist:
+ if ( mnCurArg == 0 )
+ {
+ pNewArr->AddOpCode( ocSep );
+ pNewArr->AddDouble( 0.0 ); // 2nd, mean = 0.0
+ }
+ if ( mnCurArg <= 1 )
+ {
+ pNewArr->AddOpCode( ocSep );
+ pNewArr->AddDouble( 1.0 ); // 3rd, standard deviation = 1.0
+ }
+ break;
case ocLog:
if ( !rConv.isODFF() && mnCurArg == 0 )
{
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index 1e5b55b7b67f..37db1d2eb3cb 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -1605,6 +1605,7 @@ void FormulaDlg_Impl::Update()
{
FormEditData* pData = m_pHelper->getFormEditData();
const String sExpression = pMEdit->GetText();
+ aOldFormula = String();
UpdateTokenArray(sExpression);
FormulaCursorHdl(&aMEFormula);
CalcStruct(sExpression);
diff --git a/formula/util/makefile.mk b/formula/util/makefile.mk
index 6852a53e499d..d1d78c11bbc2 100644
--- a/formula/util/makefile.mk
+++ b/formula/util/makefile.mk
@@ -98,7 +98,11 @@ SHL2STDLIBS= \
$(CPPUHELPERLIB) \
$(SALLIB)
-.IF "$(GUI)"!="WNT" || "$(COM)"=="GCC"
+.IF "$(GUI)"=="OS2"
+SHL2STDLIBS+= \
+ $(LB)$/ifor.lib
+SHL2DEPN=$(LB)$/i$(TARGET).lib
+.ELIF "$(GUI)"!="WNT" || "$(COM)"=="GCC"
SHL2STDLIBS+= \
-lfor$(DLLPOSTFIX)
SHL2DEPN=$(SHL1TARGETN)
@@ -113,6 +117,10 @@ SHL2IMPLIB=i$(TARGET2)
SHL2LIBS=$(LIB2TARGET)
SHL2DEF=$(MISC)$/$(SHL2TARGET).def
DEF2NAME=$(SHL2TARGET)
+.IF "$(GUI)"=="OS2"
+DEFLIB2NAME=$(TARGET2)
+.ENDIF
+
SHL2USE_EXPORTS=name
# SHL2VERSIONMAP=$(TARGET2).map
diff --git a/fpicker/prj/build.lst b/fpicker/prj/build.lst
index 87084f1b6656..434f22660f33 100644
--- a/fpicker/prj/build.lst
+++ b/fpicker/prj/build.lst
@@ -3,6 +3,7 @@ fp fpicker\inc nmake - all fp_inc NULL
fp fpicker\source\generic nmake - all fp_generic fp_inc NULL
fp fpicker\source\office nmake - all fp_office fp_inc NULL
fp fpicker\source\unx\gnome nmake - u fp_gnome_filepicker fp_inc NULL
+fp fpicker\source\unx\kde4 nmake - u fp_kde4_filepicker fp_inc NULL
fp fpicker\source\aqua nmake - u fp_macosx_filepicker NULL
fp fpicker\source\win32\filepicker nmake - w fp_win32_filepicker fp_inc NULL
fp fpicker\source\win32\folderpicker nmake - w fp_win32_folderpicker fp_inc NULL
diff --git a/fpicker/prj/d.lst b/fpicker/prj/d.lst
index 05ab72c01208..7c4e0bf6024a 100644
--- a/fpicker/prj/d.lst
+++ b/fpicker/prj/d.lst
@@ -10,4 +10,5 @@ mkdir: %COMMON_DEST%\bin%_EXT%\hid
..\source\win32\filepicker\*.xml %_DEST%\xml%_EXT%\*.xml
..\source\win32\folderpicker\*.xml %_DEST%\xml%_EXT%\*.xml
..\source\unx\gnome\fps-gnome-ucd.txt %_DEST%\bin%_EXT%\fps-gnome-ucd.txt
+..\source\unx\kde4\fps-kde4-ucd.txt %_DEST%\bin%_EXT%\fps-kde4-ucd.txt
..\source\aqua\fps-aqua-ucd.txt %_DEST%\bin%_EXT%\fps-aqua-ucd.txt
diff --git a/fpicker/source/aqua/AquaFilePickerDelegate.hxx b/fpicker/source/aqua/AquaFilePickerDelegate.hxx
index e3191962a131..6e5afc8bb5cc 100644
--- a/fpicker/source/aqua/AquaFilePickerDelegate.hxx
+++ b/fpicker/source/aqua/AquaFilePickerDelegate.hxx
@@ -49,11 +49,11 @@ class FilterHelper;
- (void)setFilterHelper:(FilterHelper*)filterHelper;
- (MacOSBOOL)panel:(id)sender shouldShowFilename:(NSString *)filename;
-
- (void)panelSelectionDidChange:(id)sender;
- (void)panel:(id)sender directoryDidChange:(NSString *)path;
- (void)filterSelectedAtIndex:(id)sender;
+- (void)autoextensionChanged:(id)sender;
@end
diff --git a/fpicker/source/aqua/AquaFilePickerDelegate.mm b/fpicker/source/aqua/AquaFilePickerDelegate.mm
index 7a557495191b..d73e5d82ff16 100644
--- a/fpicker/source/aqua/AquaFilePickerDelegate.mm
+++ b/fpicker/source/aqua/AquaFilePickerDelegate.mm
@@ -27,6 +27,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
+#include <com/sun/star/uno/Any.hxx>
#ifndef _SALAQUAFILEPICKER_HXX_
#include "SalAquaFilePicker.hxx"
@@ -106,5 +108,19 @@
filePicker->filterControlChanged();
}
+- (void)autoextensionChanged:(id)sender
+{
+ if (sender == nil) {
+ return;
+ }
+
+ if ([sender class] != [NSButton class]) {
+ return;
+ }
+ uno::Any aValue;
+ aValue <<= ([((NSButton*)sender) state] == NSOnState);
+
+ filePicker->setValue(::com::sun::star::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, 0, aValue);
+}
-@end \ No newline at end of file
+@end
diff --git a/fpicker/source/aqua/ControlHelper.cxx b/fpicker/source/aqua/ControlHelper.cxx
index 6919133612da..4ff3d1c33835 100644
--- a/fpicker/source/aqua/ControlHelper.cxx
+++ b/fpicker/source/aqua/ControlHelper.cxx
@@ -61,7 +61,6 @@ ControlHelper::ControlHelper()
, m_bUserPaneNeeded( false )
, m_bIsUserPaneLaidOut(false)
, m_bIsFilterControlNeeded(false)
-, m_bAutoFilenameExtension(true)
, m_pFilterHelper(NULL)
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
@@ -174,12 +173,7 @@ void ControlHelper::enableControl( const sal_Int16 nControlId, const sal_Bool bE
::vos::OGuard aGuard( Application::GetSolarMutex() );
- if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION) {
- OSL_TRACE(" autoextension checkbox cannot be changed");
- DBG_PRINT_EXIT(CLASS_NAME, __func__);
- return;
- }
- else if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_PREVIEW) {
+ if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_PREVIEW) {
OSL_TRACE(" preview checkbox cannot be changed");
DBG_PRINT_EXIT(CLASS_NAME, __func__);
return;
@@ -268,12 +262,7 @@ void ControlHelper::setValue( sal_Int16 nControlId, sal_Int16 nControlAction, co
::vos::OGuard aGuard( Application::GetSolarMutex() );
- if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION) {
- /* see comment in the header file */
- //rValue >>= m_bAutoFilenameExtension;
- OSL_TRACE(" value is a bool: %d", m_bAutoFilenameExtension);
- }
- else if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_PREVIEW) {
+ if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_PREVIEW) {
OSL_TRACE(" value for preview is unchangeable");
}
else {
@@ -307,25 +296,19 @@ uno::Any ControlHelper::getValue( sal_Int16 nControlId, sal_Int16 nControlAction
::vos::OGuard aGuard( Application::GetSolarMutex() );
uno::Any aRetval;
- if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION) {
- aRetval <<= m_bAutoFilenameExtension;
- OSL_TRACE("value is a bool (autoextension): %d", m_bAutoFilenameExtension);
- }
- else {
- NSControl* pControl = getControl( nControlId );
+ NSControl* pControl = getControl( nControlId );
- if( pControl == nil ) {
- OSL_TRACE("get value for unknown control %d", nControlId);
- aRetval <<= sal_True;
- } else {
- if( [pControl class] == [NSPopUpButton class] ) {
- aRetval = HandleGetListValue(pControl, nControlAction);
- } else if( [pControl class] == [NSButton class] ) {
- //NSLog(@"control: %@", [[pControl cell] title]);
- sal_Bool bValue = [(NSButton*)pControl state] == NSOnState ? sal_True : sal_False;
- aRetval <<= bValue;
- OSL_TRACE("value is a bool (checkbox): %d", bValue);
- }
+ if( pControl == nil ) {
+ OSL_TRACE("get value for unknown control %d", nControlId);
+ aRetval <<= sal_True;
+ } else {
+ if( [pControl class] == [NSPopUpButton class] ) {
+ aRetval = HandleGetListValue(pControl, nControlAction);
+ } else if( [pControl class] == [NSButton class] ) {
+ //NSLog(@"control: %@", [[pControl cell] title]);
+ sal_Bool bValue = [(NSButton*)pControl state] == NSOnState ? sal_True : sal_False;
+ aRetval <<= bValue;
+ OSL_TRACE("value is a bool (checkbox): %d", bValue);
}
}
@@ -528,7 +511,7 @@ void ControlHelper::createControls()
}
}
- for (int i = 1; i < TOGGLE_LAST; i++) {
+ for (int i = 0/*#i102102*/; i < TOGGLE_LAST; i++) {
if (true == m_bToggleVisibility[i]) {
m_bUserPaneNeeded = true;
@@ -542,6 +525,11 @@ void ControlHelper::createControls()
[button setState:NSOffState];
+ if (i == AUTOEXTENSION) {
+ [button setTarget:m_pDelegate];
+ [button setAction:@selector(autoextensionChanged:)];
+ }
+
m_pToggles[i] = button;
m_aActiveControls.push_back(m_pToggles[i]);
@@ -790,6 +778,7 @@ case ExtendedFilePickerElementIds::LISTBOX_##elem##_LABEL: \
switch( nControlId )
{
+ MAP_TOGGLE( AUTOEXTENSION );
MAP_TOGGLE( PASSWORD );
MAP_TOGGLE( FILTEROPTIONS );
MAP_TOGGLE( READONLY );
diff --git a/fpicker/source/aqua/ControlHelper.hxx b/fpicker/source/aqua/ControlHelper.hxx
index 4dbee2e818fe..081377a24dc6 100644
--- a/fpicker/source/aqua/ControlHelper.hxx
+++ b/fpicker/source/aqua/ControlHelper.hxx
@@ -127,7 +127,7 @@ public:
}
inline bool isAutoExtensionEnabled() {
- return m_bAutoFilenameExtension;
+ return ([((NSButton*) m_pToggles[AUTOEXTENSION]) state] == NSOnState);
}
private:
@@ -168,16 +168,6 @@ private:
/** indicates if a filter control is needed */
bool m_bIsFilterControlNeeded;
- /*
- * With issue #78852 the GUI option to set automatic filename extension was removed but
- * so far the setting is still in effect and so the value for has to be saved and possibly be restored
- * also.
- * But with issue #FILLME users were starting to get confused on Windows so we decided to have
- * autoextension always on and have it selectable for the user again.
- */
- /** indicates if a filename extension is to automatically be appended to a user entered file name */
- bool m_bAutoFilenameExtension;
-
/** a list with all actively used controls */
::std::list<NSControl*> m_aActiveControls;
diff --git a/fpicker/source/aqua/SalAquaFilePicker.cxx b/fpicker/source/aqua/SalAquaFilePicker.cxx
index 5cd5247dac37..8f79c5d2201d 100644
--- a/fpicker/source/aqua/SalAquaFilePicker.cxx
+++ b/fpicker/source/aqua/SalAquaFilePicker.cxx
@@ -35,7 +35,6 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
#include <cppuhelper/interfacecontainer.h>
@@ -357,10 +356,6 @@ uno::Sequence<rtl::OUString> SAL_CALL SalAquaFilePicker::getFiles() throw( uno::
if (nFiles > 1) {
aSelectedFiles[0] = OUString(sDirectoryURL);
}
-
- implsetDisplayDirectory(sDirectoryURL);
-
- OSL_TRACE("dir url: %s", OUStringToOString(sDirectoryURL, RTL_TEXTENCODING_UTF8).getStr());
}
short nSequenceIndex = nFiles > 1 ? nIndex + 1 : nIndex;
@@ -453,12 +448,7 @@ throw( uno::RuntimeException )
m_pControlHelper->setValue(nControlId, nControlAction, rValue);
if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION && m_nDialogType == NAVIGATIONSERVICES_SAVE) {
- sal_Bool bAutoExtensionOn = sal_False;
- rValue >>= bAutoExtensionOn;
- if (bAutoExtensionOn == sal_True) {
- [m_pDialog setExtensionHidden:bAutoExtensionOn];
- updateSaveFileNameExtension();
- }
+ updateSaveFileNameExtension();
}
DBG_PRINT_EXIT(CLASS_NAME, __func__);
@@ -775,21 +765,30 @@ void SalAquaFilePicker::updateSaveFileNameExtension() {
return;
}
- if (m_pControlHelper->isAutoExtensionEnabled() == false)
- return;
+ // we need to set this here again because initial setting does
+ //[m_pDialog setExtensionHidden:YES];
::vos::OGuard aGuard( Application::GetSolarMutex() );
- ensureFilterHelper();
+ if (m_pControlHelper->isAutoExtensionEnabled() == false) {
+ OSL_TRACE("allowing other file types");
+ [m_pDialog setAllowedFileTypes:nil];
+ [m_pDialog setAllowsOtherFileTypes:YES];
+ } else {
+ ensureFilterHelper();
- OUStringList aStringList = m_pFilterHelper->getCurrentFilterSuffixList();
- if( aStringList.empty()) // #i9328#
- return;
+ OUStringList aStringList = m_pFilterHelper->getCurrentFilterSuffixList();
+ if( aStringList.empty()) // #i9328#
+ return;
- rtl::OUString suffix = (*(aStringList.begin())).copy(1);
- NSString *requiredFileType = [NSString stringWithOUString:suffix];
+ rtl::OUString suffix = (*(aStringList.begin())).copy(1);
+ NSString *requiredFileType = [NSString stringWithOUString:suffix];
- [m_pDialog setRequiredFileType:requiredFileType];
+ [m_pDialog setRequiredFileType:requiredFileType];
+
+ OSL_TRACE("disallowing other file types");
+ [m_pDialog setAllowsOtherFileTypes:NO];
+ }
DBG_PRINT_EXIT(CLASS_NAME, __func__);
}
diff --git a/fpicker/source/aqua/SalAquaPicker.cxx b/fpicker/source/aqua/SalAquaPicker.cxx
index 0f326e1e2d29..aaf311de020a 100644
--- a/fpicker/source/aqua/SalAquaPicker.cxx
+++ b/fpicker/source/aqua/SalAquaPicker.cxx
@@ -48,12 +48,17 @@
#include "CFStringUtilities.hxx"
#include "NSString_OOoAdditions.hxx"
+#ifndef _NSURL_OOOADDITIONS_HXX_
+#include "NSURL_OOoAdditions.hxx"
+#endif
+
#include "SalAquaFilePicker.hxx"
#include <stdio.h>
#pragma mark DEFINES
#define CLASS_NAME "SalAquaPicker"
+#define kSetHideExtensionStateKey @"NSNavLastUserSetHideExtensionButtonState"
//------------------------------------------------------------------------
// namespace directives
@@ -114,8 +119,22 @@ void SAL_CALL SalAquaPicker::implInitialize()
case NAVIGATIONSERVICES_SAVE:
OSL_TRACE("NAVIGATIONSERVICES_SAVE");
m_pDialog = [NSSavePanel savePanel];
- [(NSSavePanel*)m_pDialog setCanSelectHiddenExtension:YES];
- [(NSSavePanel*)m_pDialog setExtensionHidden:NO];
+ [(NSSavePanel*)m_pDialog setCanSelectHiddenExtension:NO]; //changed for issue #102102
+ /* I would have loved to use
+ * [(NSSavePanel*)m_pDialog setExtensionHidden:YES];
+ * here but unfortunately this
+ * a) only works when the dialog is already displayed because it seems to act on the corresponding checkbox (that we don't show but that doesn't matter)
+ * b) Mac OS X saves this setting on an application-based level which means that the last state is always being restored again when the app runs for the next time
+ *
+ * So the only reliable way seems to be using the NSUserDefaults object because that is where that value is stored and
+ * to just overwrite it if it has the wrong value.
+ */
+ NSUserDefaults *pDefaults = [NSUserDefaults standardUserDefaults];
+ NSNumber *pExtn = [pDefaults objectForKey:kSetHideExtensionStateKey];
+ if(pExtn == nil || [pExtn boolValue] == NO) {
+ OSL_TRACE("Hiding extension");
+ [pDefaults setBool:YES forKey:kSetHideExtensionStateKey];
+ }
break;
case NAVIGATIONSERVICES_DIRECTORY:
@@ -188,6 +207,9 @@ int SalAquaPicker::run()
break;
}
+ if (retVal == NSFileHandlingPanelOKButton) {
+ implsetDisplayDirectory([[NSURL fileURLWithPath:[m_pDialog directory]] OUStringForInfo:FULLPATH]);
+ }
DBG_PRINT_EXIT(CLASS_NAME, __func__, retVal);
@@ -217,11 +239,6 @@ void SAL_CALL SalAquaPicker::implsetDisplayDirectory( const rtl::OUString& aDire
if (aDirectory != m_sDisplayDirectory) {
m_sDisplayDirectory = aDirectory;
-
- if (m_pDialog != nil) {
- //NSLog(@"would change now to:%@", [NSString stringWithOUString:aDirectory]);
- // [m_pDialog setDirectory:[NSString stringWithOUString:aDirectory]];
- }
}
DBG_PRINT_EXIT(CLASS_NAME, __func__);
diff --git a/fpicker/source/aqua/makefile.mk b/fpicker/source/aqua/makefile.mk
index cd52ddfb6c9f..e6a8247480c9 100644
--- a/fpicker/source/aqua/makefile.mk
+++ b/fpicker/source/aqua/makefile.mk
@@ -40,7 +40,6 @@ ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
DLLPRE=
@@ -52,7 +51,7 @@ dummy:
@echo "Nothing to build. GUIBASE == $(GUIBASE)"
.ELSE # we build for aqua
-
+CFLAGSCXX+=$(OBJCXXFLAGS)
# --- Files --------------------------------------------------------
diff --git a/fpicker/source/generic/fpicker.cxx b/fpicker/source/generic/fpicker.cxx
index dec3488211c5..9bdb870ebcc8 100644
--- a/fpicker/source/generic/fpicker.cxx
+++ b/fpicker/source/generic/fpicker.cxx
@@ -60,6 +60,8 @@ static OUString FilePicker_getSystemPickerServiceName()
return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.GtkFilePicker"));
else if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("kde"))
return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.KDEFilePicker"));
+ else if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("kde4"))
+ return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.KDE4FilePicker"));
else if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("macosx"))
return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.AquaFilePicker"));
else
diff --git a/fpicker/source/unx/kde4/FPServiceInfo.hxx b/fpicker/source/unx/kde4/FPServiceInfo.hxx
new file mode 100644
index 000000000000..d0a465102768
--- /dev/null
+++ b/fpicker/source/unx/kde4/FPServiceInfo.hxx
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 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
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma once
+
+// the service names
+#define FILE_PICKER_SERVICE_NAME "com.sun.star.ui.dialogs.KDE4FilePicker"
+
+// the implementation names
+#define FILE_PICKER_IMPL_NAME "com.sun.star.ui.dialogs.KDE4FilePicker"
+
+// the registry key names
+// a key under which this service will be registered,
+// Format: -> "/ImplName/UNO/SERVICES/ServiceName"
+// <Implementation-Name></UNO/SERVICES/><Service-Name>
+#define FILE_PICKER_REGKEY_NAME "/com.sun.star.ui.dialogs.KDE4FilePickerImpl/UNO/SERVICES/com.sun.star.ui.dialogs.KDE4FilePicker"
diff --git a/fpicker/source/unx/kde4/KDE4FPEntry.cxx b/fpicker/source/unx/kde4/KDE4FPEntry.cxx
new file mode 100644
index 000000000000..268c01b600b3
--- /dev/null
+++ b/fpicker/source/unx/kde4/KDE4FPEntry.cxx
@@ -0,0 +1,136 @@
+/*************************************************************************
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 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
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <cppuhelper/factory.hxx>
+
+#include <com/sun/star/container/XSet.hpp>
+
+#include <osl/diagnose.h>
+
+#include "KDE4FilePicker.hxx"
+#include "FPServiceInfo.hxx"
+
+using namespace ::rtl;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::registry;
+using namespace ::cppu;
+using ::com::sun::star::ui::dialogs::XFilePicker;
+
+static Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& serviceManager )
+{
+ return Reference< XInterface >(static_cast< XFilePicker* >( new KDE4FilePicker( serviceManager ) ) );
+}
+
+// the three uno functions that will be exported
+extern "C"
+{
+ void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
+ {
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+ }
+
+ sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey )
+ {
+ sal_Bool bRetVal = sal_True;
+
+ if ( pRegistryKey )
+ {
+ try
+ {
+ Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
+ pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) );
+ }
+ catch( InvalidRegistryException& )
+ {
+ OSL_ENSURE( sal_False, "InvalidRegistryException caught" );
+ bRetVal = sal_False;
+ }
+ }
+
+ return bRetVal;
+ }
+
+ void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* pRegistryKey )
+ {
+ void* pRet = 0;
+
+ if ( pSrvManager && ( 0 == rtl_str_compare( pImplName, FILE_PICKER_IMPL_NAME ) ) )
+ {
+ Sequence< OUString > aSNS( 1 );
+ aSNS.getArray( )[0] = OUString::createFromAscii( FILE_PICKER_SERVICE_NAME );
+
+ Reference< XSingleServiceFactory > xFactory ( createSingleFactory(
+ reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ),
+ OUString::createFromAscii( pImplName ),
+ createInstance,
+ aSNS ) );
+ if ( xFactory.is() )
+ {
+ xFactory->acquire();
+ pRet = xFactory.get();
+ }
+ }
+
+ return pRet;
+ }
+}
diff --git a/fpicker/source/unx/kde4/KDE4FilePicker.cxx b/fpicker/source/unx/kde4/KDE4FilePicker.cxx
new file mode 100644
index 000000000000..09e33a225977
--- /dev/null
+++ b/fpicker/source/unx/kde4/KDE4FilePicker.cxx
@@ -0,0 +1,711 @@
+/*************************************************************************
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 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
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): Jan Holesovsky <kendy@openoffice.org>
+ *
+ *
+ ************************************************************************/
+
+//////////////////////////////////////////////////////////////////////////
+// includes
+//////////////////////////////////////////////////////////////////////////
+
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <cppuhelper/interfacecontainer.h>
+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
+#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
+#include <com/sun/star/ui/dialogs/ControlActions.hpp>
+#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
+
+#include <svtools/svtools.hrc>
+
+#include <vos/mutex.hxx>
+
+#include <vcl/svapp.hxx>
+#include <vcl/sysdata.hxx>
+#include <vcl/syswin.hxx>
+
+#include "KDE4FilePicker.hxx"
+#include "FPServiceInfo.hxx"
+
+/* ********* Hack, but needed because of conflicting types... */
+#define Region QtXRegion
+
+//kde has an enum that uses this...OO does too
+#undef SETTINGS_MOUSE
+
+#include <kfiledialog.h>
+#include <kwindowsystem.h>
+#include <kapplication.h>
+#include <kfilefiltercombo.h>
+
+#include <QWidget>
+#include <QCheckBox>
+#include <QGridLayout>
+
+#undef Region
+
+using namespace ::com::sun::star;
+
+using namespace ::com::sun::star::ui::dialogs;
+using namespace ::com::sun::star::ui::dialogs::TemplateDescription;
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::ui::dialogs;
+using namespace ::com::sun::star::ui::dialogs::TemplateDescription;
+using namespace ::com::sun::star::ui::dialogs::ExtendedFilePickerElementIds;
+using namespace ::com::sun::star::ui::dialogs::CommonFilePickerElementIds;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::uno;
+
+//////////////////////////////////////////////////////////////////////////
+// helper functions
+//////////////////////////////////////////////////////////////////////////
+
+namespace
+{
+ // controling event notifications
+ const bool STARTUP_SUSPENDED = true;
+ const bool STARTUP_ALIVE = false;
+
+ uno::Sequence<rtl::OUString> SAL_CALL FilePicker_getSupportedServiceNames()
+ {
+ uno::Sequence<rtl::OUString> aRet(3);
+ aRet[0] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.FilePicker");
+ aRet[1] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.SystemFilePicker");
+ aRet[2] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.KDE4FilePicker");
+ return aRet;
+ }
+}
+
+rtl::OUString toOUString(const QString& s)
+{
+ // QString stores UTF16, just like OUString
+ return rtl::OUString(reinterpret_cast<const sal_Unicode*>(s.data()), s.length());
+}
+
+QString toQString(const rtl::OUString& s)
+{
+ return QString::fromUtf16(s.getStr(), s.getLength());
+}
+
+//////////////////////////////////////////////////////////////////////////
+// KDE4FilePicker
+//////////////////////////////////////////////////////////////////////////
+
+KDE4FilePicker::KDE4FilePicker( const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr )
+ : cppu::WeakComponentImplHelper8<
+ XFilterManager,
+ XFilterGroupManager,
+ XFilePickerControlAccess,
+ XFilePickerNotifier,
+// TODO XFilePreview,
+ lang::XInitialization,
+ util::XCancellable,
+ lang::XEventListener,
+ lang::XServiceInfo>( _helperMutex ),
+ m_xServiceMgr( xServiceMgr ),
+ _resMgr( CREATEVERSIONRESMGR( fps_office ) )
+{
+ _extraControls = new QWidget();
+
+ _layout = new QGridLayout(_extraControls);
+
+ _dialog = new KFileDialog(KUrl(""), QString(""), 0, _extraControls);
+ _dialog->setMode(KFile::File | KFile::LocalOnly);
+
+ //default mode
+ _dialog->setOperationMode(KFileDialog::Opening);
+}
+
+KDE4FilePicker::~KDE4FilePicker()
+{
+ delete _resMgr;
+ delete _dialog;
+}
+
+void SAL_CALL KDE4FilePicker::addFilePickerListener( const uno::Reference<XFilePickerListener>& xListener )
+ throw( uno::RuntimeException )
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ m_xListener = xListener;
+}
+
+void SAL_CALL KDE4FilePicker::removeFilePickerListener( const uno::Reference<XFilePickerListener>& )
+ throw( uno::RuntimeException )
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ m_xListener.clear();
+}
+
+void SAL_CALL KDE4FilePicker::setTitle( const rtl::OUString &title )
+ throw( uno::RuntimeException )
+{
+ _dialog->setCaption(toQString(title));
+}
+
+sal_Int16 SAL_CALL KDE4FilePicker::execute()
+ throw( uno::RuntimeException )
+{
+ //get the window id of the main OO window to set it for the dialog as a parent
+ Window *pParentWin = Application::GetDefDialogParent();
+ if ( pParentWin )
+ {
+ const SystemEnvData* pSysData = ((SystemWindow *)pParentWin)->GetSystemData();
+ if ( pSysData )
+ {
+ KWindowSystem::setMainWindow( _dialog, pSysData->aWindow); // unx only
+ }
+ }
+
+ _dialog->setFilter(_filter);
+ _dialog->exec();
+
+ //nasty hack to get a local qt event loop going to process the dialog
+ //otherwise the dialog returns immediately
+ while (_dialog->isVisible())
+ {
+ kapp->processEvents(QEventLoop::WaitForMoreEvents);
+ }
+
+ //block and wait for user input
+ if (_dialog->result() == KFileDialog::Accepted)
+ {
+ return ExecutableDialogResults::OK;
+ }
+
+ return ExecutableDialogResults::CANCEL;
+}
+
+void SAL_CALL KDE4FilePicker::setMultiSelectionMode( sal_Bool multiSelect )
+ throw( uno::RuntimeException )
+{
+ if (multiSelect)
+ {
+ _dialog->setMode(KFile::Files | KFile::LocalOnly);
+ }
+ else
+ {
+ _dialog->setMode(KFile::File | KFile::LocalOnly);
+ }
+}
+
+void SAL_CALL KDE4FilePicker::setDefaultName( const ::rtl::OUString &name )
+ throw( uno::RuntimeException )
+{
+ const QString url = toQString(name);
+ _dialog->setSelection(url);
+}
+
+void SAL_CALL KDE4FilePicker::setDisplayDirectory( const rtl::OUString &dir )
+ throw( uno::RuntimeException )
+{
+ const QString url = toQString(dir);
+ _dialog->setStartDir(KUrl(url));
+}
+
+rtl::OUString SAL_CALL KDE4FilePicker::getDisplayDirectory()
+ throw( uno::RuntimeException )
+{
+ QString dir = _dialog->baseUrl().url();
+ return toOUString(dir);
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL KDE4FilePicker::getFiles()
+ throw( uno::RuntimeException )
+{
+ QStringList files = _dialog->selectedFiles();
+
+ uno::Sequence< ::rtl::OUString > seq(files.size());
+
+ for (int i=0 ; i<files.size() ; ++i)
+ {
+ const QString fileName = "file:" + files[i];
+ seq[i] = toOUString(fileName);
+ }
+
+ return seq;
+}
+
+void SAL_CALL KDE4FilePicker::appendFilter( const ::rtl::OUString &title, const ::rtl::OUString &filter )
+ throw( lang::IllegalArgumentException, uno::RuntimeException )
+{
+ QString t = toQString(title);
+ QString f = toQString(filter);
+
+ if (!_filter.isNull())
+ {
+ _filter.append("\n");
+ }
+
+ //add to hash map for reverse lookup in getCurrentFilter
+ _filters.insert(f, t);
+
+ // '/' meed to be escaped to else they are assumed to be mime types by kfiledialog
+ //see the docs
+ t.replace("/", "\\/");
+
+ _filter.append(QString("%1|%2").arg(f).arg(t));
+}
+
+void SAL_CALL KDE4FilePicker::setCurrentFilter( const rtl::OUString &title )
+ throw( lang::IllegalArgumentException, uno::RuntimeException )
+{
+ QString filter = toQString(title);
+ filter.replace("/", "\\/");
+ _dialog->filterWidget()->setCurrentFilter(filter);
+}
+
+rtl::OUString SAL_CALL KDE4FilePicker::getCurrentFilter()
+ throw( uno::RuntimeException )
+{
+ QString filter = _filters[_dialog->currentFilter()];
+
+ //default if not found
+ if (filter.isNull())
+ {
+ filter = "ODF Text Document (.odt)";
+ }
+
+ return toOUString(filter);
+}
+
+void SAL_CALL KDE4FilePicker::appendFilterGroup( const rtl::OUString&, const uno::Sequence<beans::StringPair>& )
+ throw( lang::IllegalArgumentException, uno::RuntimeException )
+{
+ //TODO
+}
+
+void SAL_CALL KDE4FilePicker::setValue( sal_Int16 controlId, sal_Int16, const uno::Any &value )
+ throw( uno::RuntimeException )
+{
+ QWidget* widget = _customWidgets[controlId];
+
+ if (widget)
+ {
+ switch (controlId)
+ {
+ case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION:
+ case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD:
+ case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS:
+ case ExtendedFilePickerElementIds::CHECKBOX_READONLY:
+ case ExtendedFilePickerElementIds::CHECKBOX_LINK:
+ case ExtendedFilePickerElementIds::CHECKBOX_PREVIEW:
+ case ExtendedFilePickerElementIds::CHECKBOX_SELECTION:
+ {
+ QCheckBox* cb = dynamic_cast<QCheckBox*>(widget);
+ cb->setChecked(value.getValue());
+ break;
+ }
+ case ExtendedFilePickerElementIds::PUSHBUTTON_PLAY:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_FILTER_SELECTOR:
+ break;
+ }
+ }
+}
+
+uno::Any SAL_CALL KDE4FilePicker::getValue( sal_Int16 controlId, sal_Int16 )
+ throw( uno::RuntimeException )
+{
+ uno::Any res(false);
+
+ QWidget* widget = _customWidgets[controlId];
+
+ if (widget)
+ {
+ switch (controlId)
+ {
+ case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION:
+ case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD:
+ case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS:
+ case ExtendedFilePickerElementIds::CHECKBOX_READONLY:
+ case ExtendedFilePickerElementIds::CHECKBOX_LINK:
+ case ExtendedFilePickerElementIds::CHECKBOX_PREVIEW:
+ case ExtendedFilePickerElementIds::CHECKBOX_SELECTION:
+ {
+ QCheckBox* cb = dynamic_cast<QCheckBox*>(widget);
+ res = uno::Any(cb->isChecked());
+ break;
+ }
+ case ExtendedFilePickerElementIds::PUSHBUTTON_PLAY:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_FILTER_SELECTOR:
+ break;
+ }
+ }
+
+ return res;
+}
+
+void SAL_CALL KDE4FilePicker::enableControl( sal_Int16 controlId, sal_Bool enable )
+ throw( uno::RuntimeException )
+{
+ QWidget* widget = _customWidgets[controlId];
+
+ if (widget)
+ {
+ widget->setEnabled(enable);
+ }
+}
+
+void SAL_CALL KDE4FilePicker::setLabel( sal_Int16 controlId, const ::rtl::OUString &label )
+ throw( uno::RuntimeException )
+{
+ QWidget* widget = _customWidgets[controlId];
+
+ if (widget)
+ {
+ switch (controlId)
+ {
+ case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION:
+ case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD:
+ case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS:
+ case ExtendedFilePickerElementIds::CHECKBOX_READONLY:
+ case ExtendedFilePickerElementIds::CHECKBOX_LINK:
+ case ExtendedFilePickerElementIds::CHECKBOX_PREVIEW:
+ case ExtendedFilePickerElementIds::CHECKBOX_SELECTION:
+ {
+ QCheckBox* cb = dynamic_cast<QCheckBox*>(widget);
+ cb->setText(toQString(label));
+ break;
+ }
+ case ExtendedFilePickerElementIds::PUSHBUTTON_PLAY:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_FILTER_SELECTOR:
+ break;
+ }
+ }
+}
+
+rtl::OUString SAL_CALL KDE4FilePicker::getLabel(sal_Int16 controlId)
+ throw ( uno::RuntimeException )
+{
+ QWidget* widget = _customWidgets[controlId];
+ QString label;
+
+ if (widget)
+ {
+ switch (controlId)
+ {
+ case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION:
+ case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD:
+ case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS:
+ case ExtendedFilePickerElementIds::CHECKBOX_READONLY:
+ case ExtendedFilePickerElementIds::CHECKBOX_LINK:
+ case ExtendedFilePickerElementIds::CHECKBOX_PREVIEW:
+ case ExtendedFilePickerElementIds::CHECKBOX_SELECTION:
+ {
+ QCheckBox* cb = dynamic_cast<QCheckBox*>(widget);
+ label = cb->text();
+ break;
+ }
+ case ExtendedFilePickerElementIds::PUSHBUTTON_PLAY:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_FILTER_SELECTOR:
+ break;
+ }
+ }
+ return toOUString(label);
+}
+
+void KDE4FilePicker::addCustomControl(sal_Int16 controlId)
+{
+ QWidget* widget = 0;
+ sal_Int32 resId = -1;
+
+ switch (controlId)
+ {
+ case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION:
+ resId = STR_SVT_FILEPICKER_AUTO_EXTENSION;
+ break;
+ case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD:
+ resId = STR_SVT_FILEPICKER_PASSWORD;
+ break;
+ case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS:
+ resId = STR_SVT_FILEPICKER_FILTER_OPTIONS;
+ break;
+ case ExtendedFilePickerElementIds::CHECKBOX_READONLY:
+ resId = STR_SVT_FILEPICKER_READONLY;
+ break;
+ case ExtendedFilePickerElementIds::CHECKBOX_LINK:
+ resId = STR_SVT_FILEPICKER_INSERT_AS_LINK;
+ break;
+ case ExtendedFilePickerElementIds::CHECKBOX_PREVIEW:
+ resId = STR_SVT_FILEPICKER_SHOW_PREVIEW;
+ break;
+ case ExtendedFilePickerElementIds::CHECKBOX_SELECTION:
+ resId = STR_SVT_FILEPICKER_SELECTION;
+ break;
+ case ExtendedFilePickerElementIds::PUSHBUTTON_PLAY:
+ resId = STR_SVT_FILEPICKER_PLAY;
+ break;
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION:
+ resId = STR_SVT_FILEPICKER_VERSION;
+ break;
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE:
+ resId = STR_SVT_FILEPICKER_TEMPLATES;
+ break;
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE:
+ resId = STR_SVT_FILEPICKER_IMAGE_TEMPLATE;
+ break;
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_FILTER_SELECTOR:
+ break;
+ }
+
+ switch (controlId)
+ {
+ case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION:
+ case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD:
+ case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS:
+ case ExtendedFilePickerElementIds::CHECKBOX_READONLY:
+ case ExtendedFilePickerElementIds::CHECKBOX_LINK:
+ case ExtendedFilePickerElementIds::CHECKBOX_PREVIEW:
+ case ExtendedFilePickerElementIds::CHECKBOX_SELECTION:
+ {
+ QString label;
+
+ if (_resMgr && resId != -1)
+ {
+ rtl::OUString s = String(ResId( resId, *_resMgr ));
+ label = toQString(s);
+ label.replace("~", "&");
+ }
+
+ widget = new QCheckBox(label, _extraControls);
+
+ break;
+ }
+ case ExtendedFilePickerElementIds::PUSHBUTTON_PLAY:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_FILTER_SELECTOR:
+ break;
+ }
+
+ if (widget)
+ {
+ _layout->addWidget(widget);
+ _customWidgets.insert(controlId, widget);
+ }
+}
+
+void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args )
+ throw( uno::Exception, uno::RuntimeException )
+{
+ _filter.clear();
+ _filters.clear();
+
+ // parameter checking
+ uno::Any arg;
+ if (args.getLength() == 0)
+ {
+ throw lang::IllegalArgumentException(
+ rtl::OUString::createFromAscii( "no arguments" ),
+ static_cast< XFilePicker* >( this ), 1 );
+ }
+
+ arg = args[0];
+
+ if (( arg.getValueType() != ::getCppuType((sal_Int16*)0)) &&
+ ( arg.getValueType() != ::getCppuType((sal_Int8*)0)))
+ {
+ throw lang::IllegalArgumentException(
+ rtl::OUString::createFromAscii( "invalid argument type" ),
+ static_cast< XFilePicker* >( this ), 1 );
+ }
+
+ sal_Int16 templateId = -1;
+ arg >>= templateId;
+
+ //default is opening
+ KFileDialog::OperationMode operationMode = KFileDialog::Opening;
+
+ switch ( templateId )
+ {
+ case FILEOPEN_SIMPLE:
+ break;
+
+ case FILESAVE_SIMPLE:
+ operationMode = KFileDialog::Saving;
+ break;
+
+ case FILESAVE_AUTOEXTENSION:
+ operationMode = KFileDialog::Saving;
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
+ break;
+
+ case FILESAVE_AUTOEXTENSION_PASSWORD:
+ {
+ operationMode = KFileDialog::Saving;
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_PASSWORD );
+ break;
+ }
+ case FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS:
+ {
+ operationMode = KFileDialog::Saving;
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_PASSWORD );
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS );
+ break;
+ }
+ case FILESAVE_AUTOEXTENSION_SELECTION:
+ operationMode = KFileDialog::Saving;
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_SELECTION );
+ break;
+
+ case FILESAVE_AUTOEXTENSION_TEMPLATE:
+ operationMode = KFileDialog::Saving;
+ addCustomControl( ExtendedFilePickerElementIds::LISTBOX_TEMPLATE );
+ break;
+
+ case FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE:
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_LINK );
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW );
+ addCustomControl( ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE );
+ break;
+
+ case FILEOPEN_PLAY:
+ addCustomControl( ExtendedFilePickerElementIds::PUSHBUTTON_PLAY );
+ break;
+
+ case FILEOPEN_READONLY_VERSION:
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_READONLY );
+ addCustomControl( ExtendedFilePickerElementIds::LISTBOX_VERSION );
+ break;
+
+ case FILEOPEN_LINK_PREVIEW:
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_LINK );
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW );
+ break;
+
+ default:
+ throw lang::IllegalArgumentException(
+ rtl::OUString::createFromAscii( "Unknown template" ),
+ static_cast< XFilePicker* >( this ),
+ 1 );
+ }
+
+ _dialog->setOperationMode(operationMode);
+}
+
+void SAL_CALL KDE4FilePicker::cancel()
+ throw ( uno::RuntimeException )
+{
+
+}
+
+void SAL_CALL KDE4FilePicker::disposing( const lang::EventObject &rEvent )
+ throw( uno::RuntimeException )
+{
+ uno::Reference<XFilePickerListener> xFilePickerListener( rEvent.Source, uno::UNO_QUERY );
+
+ if ( xFilePickerListener.is() )
+ {
+ removeFilePickerListener( xFilePickerListener );
+ }
+}
+
+rtl::OUString SAL_CALL KDE4FilePicker::getImplementationName()
+ throw( uno::RuntimeException )
+{
+ return rtl::OUString::createFromAscii( FILE_PICKER_IMPL_NAME );
+}
+
+sal_Bool SAL_CALL KDE4FilePicker::supportsService( const rtl::OUString& ServiceName )
+ throw( uno::RuntimeException )
+{
+ uno::Sequence< ::rtl::OUString > SupportedServicesNames = FilePicker_getSupportedServiceNames();
+
+ for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
+ {
+ if ( SupportedServicesNames[n].compareTo( ServiceName ) == 0 )
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL KDE4FilePicker::getSupportedServiceNames()
+ throw( uno::RuntimeException )
+{
+ return FilePicker_getSupportedServiceNames();
+}
diff --git a/fpicker/source/unx/kde4/KDE4FilePicker.hxx b/fpicker/source/unx/kde4/KDE4FilePicker.hxx
new file mode 100644
index 000000000000..da355852798a
--- /dev/null
+++ b/fpicker/source/unx/kde4/KDE4FilePicker.hxx
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 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
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): Jan Holesovsky <kendy@openoffice.org>
+ *
+ *
+ ************************************************************************/
+
+#pragma once
+
+#include <cppuhelper/compbase8.hxx>
+
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/ui/dialogs/XFilePickerNotifier.hpp>
+#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
+#include <com/sun/star/ui/dialogs/XFilterGroupManager.hpp>
+#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
+//#include <com/sun/star/ui/dialogs/XFilePreview.hpp>
+#include <com/sun/star/util/XCancellable.hpp>
+
+#include <osl/conditn.hxx>
+#include <osl/mutex.hxx>
+
+#include <rtl/ustrbuf.hxx>
+
+#include <QString>
+#include <QHash>
+
+class KFileDialog;
+class QWidget;
+class QLayout;
+
+class ResMgr;
+
+class KDE4FilePicker :
+ public cppu::WeakComponentImplHelper8<
+ ::com::sun::star::ui::dialogs::XFilterManager,
+ ::com::sun::star::ui::dialogs::XFilterGroupManager,
+ ::com::sun::star::ui::dialogs::XFilePickerControlAccess,
+ ::com::sun::star::ui::dialogs::XFilePickerNotifier,
+// TODO ::com::sun::star::ui::dialogs::XFilePreview,
+ ::com::sun::star::lang::XInitialization,
+ ::com::sun::star::util::XCancellable,
+ ::com::sun::star::lang::XEventListener,
+ ::com::sun::star::lang::XServiceInfo >
+{
+protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceMgr; // to instanciate own services
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener > m_xListener;
+
+ ResMgr *_resMgr;
+
+ //the dialog to display
+ KFileDialog* _dialog;
+
+ osl::Mutex _helperMutex;
+
+ //running filter string to add to dialog
+ QString _filter;
+
+ //filter for reverse lookup of filter text
+ QHash<QString, QString> _filters;
+
+ //mapping of SAL control ID's to created custom controls
+ QHash<sal_Int16, QWidget*> _customWidgets;
+
+ //widget to contain extra custom controls
+ QWidget* _extraControls;
+
+ //layout for extra custom controls
+ QLayout* _layout;
+
+public:
+ KDE4FilePicker( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceMgr );
+ virtual ~KDE4FilePicker();
+
+ // XFilePickerNotifier
+
+ virtual void SAL_CALL addFilePickerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >& xListener ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL removeFilePickerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >& xListener ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XExecutableDialog functions
+
+ virtual void SAL_CALL setTitle( const ::rtl::OUString &rTitle ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Int16 SAL_CALL execute() throw( ::com::sun::star::uno::RuntimeException );
+
+ // XFilePicker functions
+
+ virtual void SAL_CALL setMultiSelectionMode( sal_Bool bMode ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setDefaultName( const ::rtl::OUString &rName ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setDisplayDirectory( const ::rtl::OUString &rDirectory ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::rtl::OUString SAL_CALL getDisplayDirectory() throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFiles() throw( ::com::sun::star::uno::RuntimeException );
+
+ // XFilterManager functions
+
+ virtual void SAL_CALL appendFilter( const ::rtl::OUString &rTitle, const ::rtl::OUString &rFilter ) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setCurrentFilter( const ::rtl::OUString &rTitle ) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
+ virtual ::rtl::OUString SAL_CALL getCurrentFilter() throw( ::com::sun::star::uno::RuntimeException );
+
+ // XFilterGroupManager functions
+
+ virtual void SAL_CALL appendFilterGroup( const ::rtl::OUString &rGroupTitle, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > &rFilters ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ // XFilePickerControlAccess functions
+
+ virtual void SAL_CALL setValue( sal_Int16 nControlId, sal_Int16 nControlAction, const ::com::sun::star::uno::Any &rValue ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getValue( sal_Int16 nControlId, sal_Int16 nControlAction ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL enableControl( sal_Int16 nControlId, sal_Bool bEnable ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setLabel( sal_Int16 nControlId, const ::rtl::OUString &rLabel ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getLabel( sal_Int16 nControlId ) throw (::com::sun::star::uno::RuntimeException);
+
+ /* TODO XFilePreview
+
+ virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSupportedImageFormats( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getTargetColorDepth( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getAvailableWidth( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getAvailableHeight( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setImage( sal_Int16 aImageFormat, const ::com::sun::star::uno::Any &rImage ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL setShowState( sal_Bool bShowState ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getShowState( ) throw (::com::sun::star::uno::RuntimeException);
+ */
+
+ // XInitialization
+
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > &rArguments ) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException );
+
+ // XCancellable
+
+ virtual void SAL_CALL cancel( ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XEventListener
+
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject &rEvent ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XServiceInfo
+
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString &rServiceName ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
+
+private:
+ // prevent copy and assignment
+ KDE4FilePicker( const KDE4FilePicker& );
+ KDE4FilePicker& operator=( const KDE4FilePicker& );
+
+ //add a custom control widget to the file dialog
+ void addCustomControl(sal_Int16 controlId);
+
+};
diff --git a/fpicker/source/unx/kde4/fps-kde4-ucd.txt b/fpicker/source/unx/kde4/fps-kde4-ucd.txt
new file mode 100644
index 000000000000..8ecc4e0a0a52
--- /dev/null
+++ b/fpicker/source/unx/kde4/fps-kde4-ucd.txt
@@ -0,0 +1,6 @@
+[ComponentDescriptor]
+ImplementationName=com.sun.star.ui.dialogs.KDE4FilePicker
+ComponentName=fps_kde4.uno.so
+LoaderName=com.sun.star.loader.SharedLibrary
+[SupportedServices]
+com.sun.star.ui.dialogs.KDE4FilePicker
diff --git a/fpicker/source/unx/kde4/fps_kde4.xml b/fpicker/source/unx/kde4/fps_kde4.xml
new file mode 100644
index 000000000000..a12bf894186a
--- /dev/null
+++ b/fpicker/source/unx/kde4/fps_kde4.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
+<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
+ <module-name>fps_kde4</module-name>
+ <component-description>
+ <author> Jan Holesovsky </author>
+ <name> com.sun.star.comp.ui.dialogs.FilePicker </name>
+ <description>
+ The KDE implementation of the FilePicker service.
+ </description>
+ <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
+ <language> c++ </language>
+ <status value="beta"/>
+ <supported-service> com.sun.star.ui.dialogs.FilePicker </supported-service>
+ <service-dependency>...</service-dependency>
+ <type> com.sun.star.ui.dialogs.XExecutableDialog </type>
+ <type> com.sun.star.ui.dialogs.XFilePicker </type>
+ <type> com.sun.star.ui.dialogs.XFilterManager </type>
+ <type> com.sun.star.ui.dialogs.XFilterGroupManager </type>
+ <type> com.sun.star.ui.dialogs.XFilePickerListener </type>
+ <type> com.sun.star.ui.dialogs.ExecutableDialogException </type>
+ <type> com.sun.star.ui.dialogs.XFilePickerNotifier </type>
+ <type> com.sun.star.ui.dialogs.XFilePickerControlAccess </type>
+ <type> com.sun.star.ui.dialogs.XFilePreview </type>
+ <type> com.sun.star.ui.dialogs.ExtendedFilePickerElementIds </type>
+ <type> com.sun.star.ui.dialogs.ExecutableDialogResults </type>
+ <type> com.sun.star.ui.dialogs.FilePickerEvent </type>
+ <type> com.sun.star.ui.dialogs.CommonFilePickerElementIds </type>
+ <type> com.sun.star.ui.dialogs.ListboxControlActions </type>
+ <type> com.sun.star.ui.dialogs.TemplateDescription </type>
+ <type> com.sun.star.ui.dialogs.FilePreviewImageFormats </type>
+ <type> com.sun.star.util.XCancellable </type>
+ <type> com.sun.star.lang.XComponent </type>
+ <type> com.sun.star.lang.XMultiServiceFactory </type>
+ <type> com.sun.star.lang.XSingleServiceFactory </type>
+ <type> com.sun.star.lang.XServiceInfo </type>
+ <type> com.sun.star.lang.XTypeProvider </type>
+ <type> com.sun.star.lang.IllegalArgumentException </type>
+ <type> com.sun.star.uno.TypeClass </type>
+ <type> com.sun.star.uno.XWeak </type>
+ <type> com.sun.star.uno.XAggregation </type>
+ <type> com.sun.star.registry.XRegistryKey </type>
+ <type> com.sun.star.container.XSet </type>
+ </component-description>
+ <project-build-dependency> cppuhelper </project-build-dependency>
+ <project-build-dependency> cppu </project-build-dependency>
+ <project-build-dependency> sal </project-build-dependency>
+ <runtime-module-dependency> cppuhelper </runtime-module-dependency>
+ <runtime-module-dependency> cppu2 </runtime-module-dependency>
+ <runtime-module-dependency> sal2 </runtime-module-dependency>
+</module-description>
diff --git a/fpicker/source/unx/kde4/makefile.mk b/fpicker/source/unx/kde4/makefile.mk
new file mode 100644
index 000000000000..6f9db777bcb6
--- /dev/null
+++ b/fpicker/source/unx/kde4/makefile.mk
@@ -0,0 +1,117 @@
+#*************************************************************************
+#
+#
+#
+#
+#
+#
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 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
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PRJNAME=fpicker
+TARGET=fps_kde4.uno
+LIBTARGET=NO
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+DLLPRE=
+
+# ------------------------------------------------------------------
+
+# Currently just KDE is supported...
+.IF "$(GUIBASE)" != "unx" || "$(ENABLE_KDE4)" != "TRUE"
+
+dummy:
+ @echo "Nothing to build. GUIBASE == $(GUIBASE), ENABLE_KDE4 is not set"
+
+.ELSE # we build for KDE
+
+CFLAGS+= $(KDE4_CFLAGS)
+
+# --- Files --------------------------------------------------------
+
+SLOFILES =\
+ $(SLO)$/KDE4FilePicker.obj \
+ $(SLO)$/KDE4FilePicker.moc.obj \
+ $(SLO)$/KDE4FPEntry.obj
+
+SHL1NOCHECK=TRUE
+SHL1TARGET=$(TARGET)
+SHL1STDLIBS=$(CPPULIB)\
+ $(CPPUHELPERLIB)\
+ $(SALLIB)\
+ $(VCLLIB)\
+ $(TOOLSLIB) \
+ $(KDE4_LIBS) -lkio -lkfile
+
+
+SHL1OBJS=$(SLOFILES)
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+
+DEF1NAME=$(SHL1TARGET)
+DEF1VERSIONMAP=exports.map
+
+.ENDIF
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
+$(MISC)$/KDE4FilePicker.moc.cxx : KDE4FilePicker.hxx
+ $(MOC4) $< -o $@
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx
index ff673c2345a8..b8987b0b7a5f 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx
@@ -191,7 +191,7 @@ void lcl_updateVersionListDirectly(IFileDialog* pDialog)
// at least an empty version list will be better then the wrong one .-)
iCustomize->RemoveAllControlItems(CONTROL_VERSIONLIST);
- HRESULT hResult;
+ HRESULT hResult = E_FAIL;
ComPtr< IShellItemArray > iItems;
ComPtr< IShellItem > iItem;
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx
index 60e0b1fad04c..e2fdde44ce07 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx
@@ -35,6 +35,10 @@
// includes
//-----------------------------------------------------------------------------
+#if defined(_MSC_VER) && (_MSC_VER >= 1400)
+#pragma warning( disable : 4917 )
+#endif
+
#include "comptr.hxx"
#include "vistatypes.h"
#include "IVistaFilePickerInternalNotify.hxx"
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
index 23467f148f4b..58041b3fe628 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
@@ -40,6 +40,9 @@
#include <comphelper/sequenceasvector.hxx>
#include <osl/file.hxx>
#include <osl/mutex.hxx>
+#ifdef __MINGW32__
+#include <limits.h>
+#endif
#include "..\misc\WinImplHelper.hxx"
inline bool is_current_process_window(HWND hwnd)
@@ -778,7 +781,7 @@ void VistaFilePickerImpl::impl_sta_getSelectedFiles(const RequestRef& rRequest)
// Note further: we must react different if dialog is in execute or not .-(
ComPtr< IShellItem > iItem;
ComPtr< IShellItemArray > iItems;
- HRESULT hResult;
+ HRESULT hResult = E_FAIL;
if (iOpen.is())
{
@@ -914,7 +917,7 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(const RequestRef& rRequest)
}
- HRESULT hResult;
+ HRESULT hResult = E_FAIL;
try
{
// show dialog and wait for user decision
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx
index b15b5c24c52d..59e684d94fc6 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx
@@ -35,6 +35,10 @@
// includes
//-----------------------------------------------------------------------------
+#if defined(_MSC_VER) && (_MSC_VER >= 1400)
+#pragma warning( disable : 4917 )
+#endif
+
#include "platform_vista.h"
#include "asyncrequests.hxx"
#include "comptr.hxx"
diff --git a/fpicker/source/win32/folderpicker/workbench/Test_fops.cxx b/fpicker/source/win32/folderpicker/workbench/Test_fops.cxx
index d260288ca2cc..825ec45d5661 100644
--- a/fpicker/source/win32/folderpicker/workbench/Test_fops.cxx
+++ b/fpicker/source/win32/folderpicker/workbench/Test_fops.cxx
@@ -45,7 +45,7 @@
#include <cppuhelper/servicefactory.hxx>
#ifndef _RTL_USTRING_
-#include <rtl/ustring>
+#include <rtl/ustring.hxx>
#endif
#include <sal/types.h>
#include <osl/diagnose.h>
@@ -120,7 +120,7 @@ void CreateDeepDirectory( )
//--------------------------------------------------------------
-int SAL_CALL main(int nArgc, char* Argv[], char* Env[] )
+int SAL_CALL main(int /*nArgc*/, char* /*Argv[]*/, char* /*Env[]*/ )
{
CoInitializeEx( NULL, COINIT_MULTITHREADED );
@@ -175,7 +175,7 @@ int SAL_CALL main(int nArgc, char* Argv[], char* Env[] )
rootDir = xFolderPicker->getDisplayDirectory( );
selectedDir = xFolderPicker->getDirectory( );
}
- catch(...)
+ catch( ::com::sun::star::uno::Exception& )
{
MessageBox( NULL, "Exception caught!", "Error", MB_OK );
}
diff --git a/fpicker/source/win32/folderpicker/workbench/makefile.mk b/fpicker/source/win32/folderpicker/workbench/makefile.mk
index ed5afe6e7b0a..dda6c98e2143 100644
--- a/fpicker/source/win32/folderpicker/workbench/makefile.mk
+++ b/fpicker/source/win32/folderpicker/workbench/makefile.mk
@@ -42,7 +42,7 @@ TARGETTYPE= CUI
.INCLUDE : settings.mk
-CFLAGS+=-GR -GX
+CFLAGS+=-GR -EHa
# --- Files --------------------------------------------------------
diff --git a/fpicker/source/win32/misc/makefile.mk b/fpicker/source/win32/misc/makefile.mk
index 6b41215c9909..29ba591478e4 100644
--- a/fpicker/source/win32/misc/makefile.mk
+++ b/fpicker/source/win32/misc/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..$/..
PRJNAME=fpicker
TARGET=utils
LIBTARGET=NO
+ENABLE_EXCEPTIONS=TRUE
# --- Settings ----------------------------------
@@ -41,7 +42,7 @@ LIBTARGET=NO
.IF "$(COM)"=="GCC"
CFLAGSAPPEND+=-fexceptions -fno-enforce-eh-specs -DUNICODE -D_UNICODE
.ELSE
-CFLAGS+=-GX -DUNICODE -D_UNICODE
+CFLAGS+=-EHa -DUNICODE -D_UNICODE
.ENDIF
# --- Files -------------------------------------
diff --git a/fpicker/util/makefile.pmk b/fpicker/util/makefile.pmk
deleted file mode 100644
index 15e00b88eda4..000000000000
--- a/fpicker/util/makefile.pmk
+++ /dev/null
@@ -1,35 +0,0 @@
-#*************************************************************************
-#
-# 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.pmk,v $
-#
-# $Revision: 1.3 $
-#
-# 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 "$(GUIBASE)"=="aqua"
-OBJCXXFLAGS=-x objective-c++ -fobjc-exceptions
-CFLAGSCXX+=$(OBJCXXFLAGS)
-.ENDIF # "$(GUIBASE)"=="aqua"
diff --git a/framework/collector/cmduicollector.cxx b/framework/collector/cmduicollector.cxx
index e6d9fd0a726c..f71a74bff40f 100644
--- a/framework/collector/cmduicollector.cxx
+++ b/framework/collector/cmduicollector.cxx
@@ -865,8 +865,9 @@ bool impl_isDuplicateKey(const KeyCommandInfoList& rList,
const KeyCommandInfo& aInfo)
{
KeyCommandInfoList::const_iterator pInfo;
+ KeyCommandInfoList::const_iterator aEnd = rList.end();
for ( pInfo = rList.begin();
- pInfo != rList.end() ;
+ pInfo != aEnd ;
++pInfo )
{
if (
@@ -886,6 +887,7 @@ bool ReadAccelerators( int nLangIndex, ResMgr* pResMgr, MODULES eModule, const :
KeyCommandInfoList& rAccs = rLocale[nLangIndex];
USHORT c = pAcc->GetItemCount();
+ rAccs.reserve(rAccs.size()+c);
USHORT i = 0;
for (i=0; i<c; ++i)
{
@@ -1067,11 +1069,12 @@ SfxSlotInfo::SfxSlotInfo( const ResId &rResId ) :
bool ReadSlotInfos( int nLangIndex, ResMgr* pResMgr, MODULES eModule, const OUString& aProjectName )
{
- CommandIDToLabelsMap::iterator pIter = moduleMapFiles[MODULE_GLOBAL].begin();;
+ CommandIDToLabelsMap::iterator pIter = moduleMapFiles[MODULE_GLOBAL].begin();
+ CommandIDToLabelsMap::iterator pEnd = moduleMapFiles[MODULE_GLOBAL].end();
if ( eModule != MODULE_GLOBAL )
{
- while ( pIter != moduleMapFiles[MODULE_GLOBAL].end() )
+ while ( pIter != pEnd )
{
int nId = pIter->first;
CommandLabels& rCmdLabels = pIter->second;
@@ -1091,7 +1094,8 @@ bool ReadSlotInfos( int nLangIndex, ResMgr* pResMgr, MODULES eModule, const OUSt
}
pIter = moduleMapFiles[eModule].begin();
- while ( pIter != moduleMapFiles[eModule].end() )
+ pEnd = moduleMapFiles[eModule].end();
+ while ( pIter != pEnd )
{
int nId = pIter->first;
CommandLabels& rCmdLabels = pIter->second;
@@ -1261,13 +1265,15 @@ void FindAndMarkModulePopupMenuCmds()
for ( int i = 0; i < int( MODULE_COUNT ); i++ )
{
CommandToLabelsMap::iterator pCmdIter = modulePopupMenusCmd[i].begin();
- while ( pCmdIter != modulePopupMenusCmd[i].end() )
+ CommandToLabelsMap::iterator pCmdEnd = modulePopupMenusCmd[i].end();
+ while ( pCmdIter != pCmdEnd )
{
CommandLabels& rCmdLabel = pCmdIter->second;
if ( rCmdLabel.bPopupMenu )
{
CommandIDToLabelsMap::iterator pIDIter = moduleMapFiles[i].begin();
- while ( pIDIter != moduleMapFiles[i].end() )
+ CommandIDToLabelsMap::iterator pIDEnd = moduleMapFiles[i].end();
+ while ( pIDIter != pIDEnd )
{
CommandLabels& rIDLabel = pIDIter->second;
if ( rIDLabel.aCommand.equals( rCmdLabel.aCommand ))
@@ -1311,7 +1317,8 @@ bool FindAndMoveGlobalPopupMenus()
for ( int i = 1; i < int( MODULE_COUNT ); i++ )
{
CommandToLabelsMap::iterator pCmdIter = modulePopupMenusCmd[i].begin();
- while ( pCmdIter != modulePopupMenusCmd[i].end() )
+ CommandToLabelsMap::iterator pCmdEnd = modulePopupMenusCmd[i].end();
+ while ( pCmdIter != pCmdEnd )
{
CommandLabels& rCmdLabel = pCmdIter->second;
if ( rCmdLabel.bPopupMenu )
@@ -1409,8 +1416,8 @@ bool WriteXMLFiles( const OUString& aOutputDirURL)
aXMLFile.write( ComponentDataStartEnd, strlen( ComponentDataStartEnd ), nWritten );
aXMLFile.write( GroupText, strlen( GroupText ), nWritten );
- if (( moduleMapFiles[i].size() > 0 ) ||
- ( modulePopupMenusCmd[i].size() > 0 ) )
+ if (( !moduleMapFiles[i].empty() ) ||
+ ( !modulePopupMenusCmd[i].empty() ) )
{
for ( int nSets = 0; nSets < 2; nSets++ )
{
@@ -1420,7 +1427,8 @@ bool WriteXMLFiles( const OUString& aOutputDirURL)
aXMLFile.write( SetTextPopups, strlen( SetTextPopups ), nWritten );
CommandIDToLabelsMap::iterator pIter = moduleMapFiles[i].begin();
- while ( pIter != moduleMapFiles[i].end() )
+ CommandIDToLabelsMap::iterator pEnd = moduleMapFiles[i].end();
+ while ( pIter != pEnd )
{
CommandLabels& rCmdLabels = pIter->second;
@@ -1813,8 +1821,9 @@ bool impl_isAccListDuplicate(const KeyCommandInfoList& rAccsReference,
const KeyCommandInfoList& rAccs )
{
KeyCommandInfoList::const_iterator pIt1;
+ KeyCommandInfoList::const_iterator aEnd = rAccsReference.end();
for ( pIt1 = rAccsReference.begin();
- pIt1 != rAccsReference.end() ;
+ pIt1 != aEnd ;
++pIt1 )
{
KeyCommandInfoList::const_iterator pIt2 = ::std::find(rAccs.begin(), rAccs.end(), *pIt1);
@@ -1839,7 +1848,7 @@ bool ReadResourceWriteAcceleratorXMLLang( const ::rtl::OUString& aOutDirURL,
KeyCommandInfoList& rAccsReference = rLocale[1]; // en-US!
// dont write empty files :-)
- if (rAccs.size()<1)
+ if ( rAccs.empty() )
return true;
::rtl::OUString sLanguage = ::rtl::OUString::createFromAscii(Language_codes[nLanguage].pLanguage);
@@ -1901,8 +1910,9 @@ bool ReadResourceWriteAcceleratorXMLLang( const ::rtl::OUString& aOutDirURL,
::rtl::OUStringBuffer sAccBuf(10000);
KeyCommandInfoList::const_iterator pIt;
+ KeyCommandInfoList::const_iterator aEnd = rAccs.end();
for ( pIt = rAccs.begin();
- pIt != rAccs.end() ;
+ pIt != aEnd ;
++pIt )
{
const KeyCommandInfo& aInfo = *pIt;
@@ -2620,7 +2630,7 @@ bool GetCommandOptions( const ::std::vector< OUString >& rArgs, const OUString&
}
}
- return( rParams.size() > 0 );
+ return( !rParams.empty() );
}
void ShowUsage()
@@ -2694,7 +2704,7 @@ void Main()
if ( aVersion.getLength() > 0 &&
aPlatformName.getLength() > 0 &&
aUseRes.getLength() > 0 &&
- aInDirVector.size() > 0 )
+ !aInDirVector.empty() )
{
Convert( bUseProduct, aUseRes, aVersion, aOutputDirName, aPlatformName, aInDirVector, aErrOutputFileName );
}
diff --git a/framework/collector/uicmdstohtml.cxx b/framework/collector/uicmdstohtml.cxx
index 7745ca5a5472..b89879745952 100644
--- a/framework/collector/uicmdstohtml.cxx
+++ b/framework/collector/uicmdstohtml.cxx
@@ -697,7 +697,7 @@ bool WriteJumpTable( osl::File& rFile )
sal_uInt32 i = 0;
while ( ModuleName[i] != 0 )
{
- if ( moduleMapFiles[i].size() > 0 )
+ if ( !moduleMapFiles[i].empty() )
{
OString aTableNameStr( ModuleName[i] );
OStringBuffer aJumpMark( aTableNameStr );
@@ -850,7 +850,7 @@ bool WriteHTMLFile( const OUString& aOutputDirURL)
while ( ModuleToXML_Mapping[i] != 0 )
{
SortCommandTable( MODULES( i ));
- if ( moduleCmdVector[i].size() > 0 )
+ if ( !moduleCmdVector[i].empty() )
{
WriteHTMLTable( aHTMLFile, OUString::createFromAscii( ModuleName[i] ));
diff --git a/framework/inc/classes/addonmenu.hxx b/framework/inc/classes/addonmenu.hxx
index d0b35594bdf3..0bce4509297d 100644
--- a/framework/inc/classes/addonmenu.hxx
+++ b/framework/inc/classes/addonmenu.hxx
@@ -56,12 +56,12 @@ class AddonMenu : public PopupMenu
AddonMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
~AddonMenu();
- private:
+ protected:
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
};
class AddonMenuManager;
-class AddonPopupMenu : public PopupMenu
+class AddonPopupMenu : public AddonMenu
{
public:
~AddonPopupMenu();
@@ -78,8 +78,7 @@ class AddonPopupMenu : public PopupMenu
private:
AddonPopupMenu( const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame );
- rtl::OUString m_aCommandURL;
- ::com::sun::star::uno::Reference< com::sun::star::frame::XFrame > m_xFrame;
+ rtl::OUString m_aCommandURL;
friend class AddonMenuManager;
};
diff --git a/framework/inc/classes/bmkmenu.hxx b/framework/inc/classes/bmkmenu.hxx
index 7fcdbe3ae544..5e4b2818afeb 100644
--- a/framework/inc/classes/bmkmenu.hxx
+++ b/framework/inc/classes/bmkmenu.hxx
@@ -30,6 +30,7 @@
#ifndef __FRAMEWORK_CLASSES_BMKMENU_HXX
#define __FRAMEWORK_CLASSES_BMKMENU_HXX
+#include "classes/addonmenu.hxx"
//_________________________________________________________________________________________________________________
// interface includes
//_________________________________________________________________________________________________________________
@@ -52,7 +53,7 @@ namespace framework
{
class BmkMenu_Impl;
-class BmkMenu : public PopupMenu
+class BmkMenu : public AddonMenu
{
public:
enum BmkMenuType
@@ -76,7 +77,6 @@ class BmkMenu : public PopupMenu
BmkMenuType, BmkMenu* pRoot );
BmkMenu_Impl* _pImp;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& m_xFrame;
};
} // namespace framework
diff --git a/framework/inc/classes/eventsconfiguration.hxx b/framework/inc/classes/eventsconfiguration.hxx
deleted file mode 100644
index 01b55616fafb..000000000000
--- a/framework/inc/classes/eventsconfiguration.hxx
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef __FRAMEWORK_CLASSES_EVENTSCONFIGURATION_HXX_
-#define __FRAMEWORK_CLASSES_EVENTSCONFIGURATION_HXX_
-
-#include <svtools/svarray.hxx>
-#include <tools/string.hxx>
-#include <tools/stream.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/beans/PropertyValue.hpp>
-
-// #110897#
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-namespace framework
-{
-
-struct EventsConfig
-{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > aEventNames;
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aEventsProperties;
-};
-
-class EventsConfiguration
-{
- public:
-
- // #110897#
- static sal_Bool LoadEventsConfig(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- SvStream& rInStream, EventsConfig& aItems );
-
- // #110897#
- static sal_Bool StoreEventsConfig(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- SvStream& rOutStream, const EventsConfig& aItems );
-};
-
-} // namespace framework
-
-#endif // __FRAMEWORK_CLASSES_EVENTSCONFIGURATION_HXX_
diff --git a/framework/inc/classes/eventsdocumenthandler.hxx b/framework/inc/classes/eventsdocumenthandler.hxx
deleted file mode 100644
index b563153611b1..000000000000
--- a/framework/inc/classes/eventsdocumenthandler.hxx
+++ /dev/null
@@ -1,198 +0,0 @@
-/*************************************************************************
- *
- * 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: eventsdocumenthandler.hxx,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 __FRAMEWORK_CLASSES_EVENTSDOCUMENTHANDLER_HXX_
-#define __FRAMEWORK_CLASSES_EVENTSDOCUMENTHANDLER_HXX_
-
-#ifndef __FRAMEWORK_CLASSES_TOOLBOXCONFIGURATION_HXX_
-#include <classes/eventsconfiguration.hxx>
-#endif
-
-//_________________________________________________________________________________________________________________
-// 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>
-
-#ifndef __SGI_STL_HASH_MAP
-#include <hash_map>
-#endif
-#include <stdtypes.h>
-
-//_________________________________________________________________________________________________________________
-// namespace
-//_________________________________________________________________________________________________________________
-
-namespace framework{
-
-//*****************************************************************************************************************
-// Hash code function for using in all hash maps of follow implementation.
-
-class OReadEventsDocumentHandler : public ::com::sun::star::xml::sax::XDocumentHandler,
- private ThreadHelpBase, // Struct for right initalization of lock member! Must be first of baseclasses.
- public ::cppu::OWeakObject
-{
- public:
- enum Events_XML_Entry
- {
- EV_ELEMENT_EVENTS,
- EV_ELEMENT_EVENT,
- EV_ATTRIBUTE_TYPE,
- EV_ATTRIBUTE_NAME,
- XL_ATTRIBUTE_HREF,
- XL_ATTRIBUTE_TYPE,
- EV_ATTRIBUTE_MACRONAME,
- EV_ATTRIBUTE_LIBRARY,
- EV_XML_ENTRY_COUNT
- };
-
- enum Event_XML_Namespace
- {
- EV_NS_EVENT,
- EV_NS_XLINK,
- EV_XML_NAMESPACES_COUNT
- };
-
- OReadEventsDocumentHandler( EventsConfig& aItems );
- virtual ~OReadEventsDocumentHandler();
-
- // XInterface
- virtual void SAL_CALL acquire() throw()
- { OWeakObject::acquire(); }
- virtual void SAL_CALL release() throw()
- { OWeakObject::release(); }
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
- const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
-
- // XDocumentHandler
- virtual void SAL_CALL startDocument(void)
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endDocument(void)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL startElement(
- const rtl::OUString& aName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &xAttribs)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endElement(const rtl::OUString& aName)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL characters(const rtl::OUString& aChars)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL ignorableWhitespace(const rtl::OUString& aWhitespaces)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL processingInstruction(const rtl::OUString& aTarget,
- const rtl::OUString& aData)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL setDocumentLocator(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > &xLocator)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- private:
- ::rtl::OUString getErrorLineString();
-
- class EventsHashMap : public ::std::hash_map< ::rtl::OUString ,
- Events_XML_Entry ,
- OUStringHashCode ,
- ::std::equal_to< ::rtl::OUString > >
- {
- public:
- inline void free()
- {
- EventsHashMap().swap( *this );
- }
- };
-
- sal_Bool m_bEventsStartFound;
- sal_Bool m_bEventsEndFound;
- sal_Bool m_bEventStartFound;
- EventsHashMap m_aEventsMap;
- EventsConfig& m_aEventItems;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > m_xLocator;
-};
-
-class OWriteEventsDocumentHandler : private ThreadHelpBase // Struct for right initalization of lock member! Must be first of baseclasses.
-{
- public:
- OWriteEventsDocumentHandler(
- const EventsConfig& aItems,
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > );
- virtual ~OWriteEventsDocumentHandler();
-
- void WriteEventsDocument() throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- protected:
- virtual void WriteEvent(
- const ::rtl::OUString& aEventName,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aPropertyValue ) throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- const EventsConfig& m_aItems;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xWriteDocumentHandler;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > m_xEmptyList;
- ::rtl::OUString m_aXMLEventNS;
- ::rtl::OUString m_aXMLXlinkNS;
- ::rtl::OUString m_aAttributeType;
- ::rtl::OUString m_aAttributeURL;
- ::rtl::OUString m_aAttributeLanguage;
- ::rtl::OUString m_aAttributeLinkType;
- ::rtl::OUString m_aAttributeMacroName;
- ::rtl::OUString m_aAttributeLibrary;
- ::rtl::OUString m_aAttributeName;
-};
-
-} // namespace framework
-
-#endif
diff --git a/framework/inc/classes/fwktabwindow.hxx b/framework/inc/classes/fwktabwindow.hxx
index ba6a2522c2c7..80e4b8144bb0 100644
--- a/framework/inc/classes/fwktabwindow.hxx
+++ b/framework/inc/classes/fwktabwindow.hxx
@@ -84,9 +84,6 @@ public:
virtual void ActivatePage();
virtual void DeactivatePage();
virtual void Resize();
-
- void Reset();
- void Save();
};
struct TabEntry
@@ -131,7 +128,6 @@ public:
FwkTabPage* AddTabPage( sal_Int32 nIndex, const css::uno::Sequence< css::beans::NamedValue >& rProperties );
void ActivatePage( sal_Int32 nIndex );
void RemovePage( sal_Int32 nIndex );
- sal_Int32 GetActivePageId() const;
virtual void Resize();
};
diff --git a/sj2/stardiv/applet/LiveConnectable.java b/framework/inc/classes/fwlresid.hxx
index 36604358c19f..e1d38f59bfce 100644..100755
--- a/sj2/stardiv/applet/LiveConnectable.java
+++ b/framework/inc/classes/fwlresid.hxx
@@ -6,7 +6,7 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: LiveConnectable.java,v $
+ * $RCSfile: FwlResId.hxx,v $
* $Revision: 1.3 $
*
* This file is part of OpenOffice.org.
@@ -28,18 +28,22 @@
*
************************************************************************/
-package stardiv.applet;
+#ifndef __FRAMEWORK_CLASSES_FwlResId_HXX_
+#define __FRAMEWORK_CLASSES_FwlResId_HXX_
-/**
- * LiveConnectable interface .
- *
- * @version 1.0, 21/04/98
- * @author Markus Meyer
- */
+#include <tools/resid.hxx>
-public interface LiveConnectable
+namespace framework
{
- public Object getJavaScriptJSObjectWindow();
-}
+class FwlResId : public ResId
+{
+ public:
+ FwlResId( USHORT nId );
+
+ static ResMgr* GetResManager();
+};
+
+}
+#endif // __FRAMEWORK_CLASSES_FwlResId
diff --git a/framework/inc/classes/imagesconfiguration.hxx b/framework/inc/classes/imagesconfiguration.hxx
deleted file mode 100644
index 33d36873c016..000000000000
--- a/framework/inc/classes/imagesconfiguration.hxx
+++ /dev/null
@@ -1,115 +0,0 @@
-/*************************************************************************
- *
- * 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: imagesconfiguration.hxx,v $
- * $Revision: 1.10 $
- *
- * 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_IMAGESCONFIGURATION_HXX_
-#define __FRAMEWORK_CLASSES_IMAGESCONFIGURATION_HXX_
-
-#include <svtools/svarray.hxx>
-#include <tools/string.hxx>
-#include <tools/stream.hxx>
-#include <tools/color.hxx>
-
-// #110897#
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-namespace framework
-{
-
-enum ImageMaskMode
-{
- ImageMaskMode_Color,
- ImageMaskMode_Bitmap
-};
-
-struct ImageItemDescriptor
-{
- ImageItemDescriptor() : nIndex( -1 ) {}
-
- String aCommandURL; // URL command to dispatch
- long nIndex; // index of the bitmap inside the bitmaplist
-};
-
-struct ExternalImageItemDescriptor
-{
- String aCommandURL; // URL command to dispatch
- String aURL; // a URL to an external bitmap
-};
-
-typedef ImageItemDescriptor* ImageItemDescriptorPtr;
-SV_DECL_PTRARR_DEL( ImageItemListDescriptor, ImageItemDescriptorPtr, 10, 2)
-
-typedef ExternalImageItemDescriptor* ExternalImageItemDescriptorPtr;
-SV_DECL_PTRARR_DEL( ExternalImageItemListDescriptor, ExternalImageItemDescriptorPtr, 10, 2)
-
-struct ImageListItemDescriptor
-{
- ImageListItemDescriptor() : nMaskMode( ImageMaskMode_Color )
- , pImageItemList( 0 ) {}
- ~ImageListItemDescriptor() { delete pImageItemList; }
-
- String aURL; // an URL to a bitmap with several images inside
- Color aMaskColor; // a color used as transparent
- String aMaskURL; // an URL to an optional bitmap used as a mask
- ImageMaskMode nMaskMode; // an enum to describe the current mask mode
- ImageItemListDescriptor* pImageItemList; // an array of ImageItemDescriptors that describes every image
- String aHighContrastURL; // an URL to an optional high contrast bitmap with serveral images inside
- String aHighContrastMaskURL; // an URL to an optional high contrast bitmap as a mask
-};
-
-typedef ImageListItemDescriptor* ImageListItemDescriptorPtr;
-SV_DECL_PTRARR_DEL( ImageListDescriptor, ImageListItemDescriptorPtr, 10, 2)
-
-struct ImageListsDescriptor
-{
- ImageListsDescriptor() : pImageList( 0 ),
- pExternalImageList( 0 ) {}
- ~ImageListsDescriptor() { delete pImageList; delete pExternalImageList; }
-
- ImageListDescriptor* pImageList;
- ExternalImageItemListDescriptor* pExternalImageList;
-};
-
-class ImagesConfiguration
-{
- public:
- // #110897#
- static sal_Bool LoadImages(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- SvStream& rInStream, ImageListsDescriptor& aItems );
-
- // #110897#
- static sal_Bool StoreImages(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- SvStream& rOutStream, const ImageListsDescriptor& aItems );
-};
-
-} // namespace framework
-
-#endif // __FRAMEWORK_CLASSES_IMAGES
diff --git a/framework/inc/classes/imagesdocumenthandler.hxx b/framework/inc/classes/imagesdocumenthandler.hxx
deleted file mode 100644
index a3d42e266865..000000000000
--- a/framework/inc/classes/imagesdocumenthandler.hxx
+++ /dev/null
@@ -1,215 +0,0 @@
-/*************************************************************************
- *
- * 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: imagesdocumenthandler.hxx,v $
- * $Revision: 1.5 $
- *
- * 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_IMAGEDOCUMENTHANDLER_HXX_
-#define __FRAMEWORK_CLASSES_IMAGEDOCUMENTHANDLER_HXX_
-
-//_________________________________________________________________________________________________________________
-// interface includes
-//_________________________________________________________________________________________________________________
-
-#ifndef __COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP_
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-#endif
-
-//_________________________________________________________________________________________________________________
-// other includes
-//_________________________________________________________________________________________________________________
-#include <classes/imagesconfiguration.hxx>
-#include <threadhelp/threadhelpbase.hxx>
-#include <rtl/ustring.hxx>
-#include <cppuhelper/weak.hxx>
-
-#ifndef __SGI_STL_HASH_MAP
-#include <hash_map>
-#endif
-#include <stdtypes.h>
-
-//_________________________________________________________________________________________________________________
-// namespace
-//_________________________________________________________________________________________________________________
-
-namespace framework{
-
-//*****************************************************************************************************************
-// Hash code function for using in all hash maps of follow implementation.
-
-class OReadImagesDocumentHandler : public ::com::sun::star::xml::sax::XDocumentHandler,
- private ThreadHelpBase, // Struct for right initalization of lock member! Must be first of baseclasses.
- public ::cppu::OWeakObject
-{
- public:
- enum Image_XML_Entry
- {
- IMG_ELEMENT_IMAGECONTAINER,
- IMG_ELEMENT_IMAGES,
- IMG_ELEMENT_ENTRY,
- IMG_ELEMENT_EXTERNALIMAGES,
- IMG_ELEMENT_EXTERNALENTRY,
- IMG_ATTRIBUTE_HREF,
- IMG_ATTRIBUTE_MASKCOLOR,
- IMG_ATTRIBUTE_COMMAND,
- IMG_ATTRIBUTE_BITMAPINDEX,
- IMG_ATTRIBUTE_MASKURL,
- IMG_ATTRIBUTE_MASKMODE,
- IMG_ATTRIBUTE_HIGHCONTRASTURL,
- IMG_ATTRIBUTE_HIGHCONTRASTMASKURL,
- IMG_XML_ENTRY_COUNT
- };
-
- enum Image_XML_Namespace
- {
- IMG_NS_IMAGE,
- IMG_NS_XLINK,
- TBL_XML_NAMESPACES_COUNT
- };
-
- OReadImagesDocumentHandler( ImageListsDescriptor& aItems );
- virtual ~OReadImagesDocumentHandler();
-
- // XInterface
- virtual void SAL_CALL acquire() throw()
- { OWeakObject::acquire(); }
- virtual void SAL_CALL release() throw()
- { OWeakObject::release(); }
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
- const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
-
- // XDocumentHandler
- virtual void SAL_CALL startDocument(void)
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endDocument(void)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL startElement(
- const rtl::OUString& aName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &xAttribs)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endElement(const rtl::OUString& aName)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL characters(const rtl::OUString& aChars)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL ignorableWhitespace(const rtl::OUString& aWhitespaces)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL processingInstruction(const rtl::OUString& aTarget,
- const rtl::OUString& aData)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL setDocumentLocator(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > &xLocator)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- private:
- ::rtl::OUString getErrorLineString();
-
- class ImageHashMap : public ::std::hash_map< ::rtl::OUString ,
- Image_XML_Entry ,
- OUStringHashCode ,
- ::std::equal_to< ::rtl::OUString > >
- {
- public:
- inline void free()
- {
- ImageHashMap().swap( *this );
- }
- };
-
- sal_Bool m_bImageContainerStartFound;
- sal_Bool m_bImageContainerEndFound;
- sal_Bool m_bImagesStartFound;
- sal_Bool m_bImagesEndFound;
- sal_Bool m_bImageStartFound;
- sal_Bool m_bExternalImagesStartFound;
- sal_Bool m_bExternalImagesEndFound;
- sal_Bool m_bExternalImageStartFound;
- sal_Int32 m_nHashMaskModeBitmap;
- sal_Int32 m_nHashMaskModeColor;
- ImageHashMap m_aImageMap;
- ImageListsDescriptor& m_aImageList;
- ImageListItemDescriptor* m_pImages;
- ExternalImageItemListDescriptor* m_pExternalImages;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > m_xLocator;
-};
-
-class OWriteImagesDocumentHandler : private ThreadHelpBase // Struct for right initalization of lock member! Must be first of baseclasses.
-{
- public:
- OWriteImagesDocumentHandler(
- const ImageListsDescriptor& aItems,
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > );
- virtual ~OWriteImagesDocumentHandler();
-
- void WriteImagesDocument() throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- protected:
- virtual void WriteImageList( const ImageListItemDescriptor* ) throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void WriteExternalImageList( const ExternalImageItemListDescriptor* ) throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void WriteImage( const ImageItemDescriptor* ) throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void WriteExternalImage( const ExternalImageItemDescriptor* ) throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- const ImageListsDescriptor& m_aImageListsItems;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xWriteDocumentHandler;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > m_xEmptyList;
- ::rtl::OUString m_aXMLXlinkNS;
- ::rtl::OUString m_aXMLImageNS;
- ::rtl::OUString m_aAttributeType;
- ::rtl::OUString m_aAttributeXlinkType;
- ::rtl::OUString m_aAttributeValueSimple;
-};
-
-} // namespace framework
-
-#endif
diff --git a/framework/inc/classes/imagewrapper.hxx b/framework/inc/classes/imagewrapper.hxx
index 71732e9c8766..eb9e2fd00a74 100644
--- a/framework/inc/classes/imagewrapper.hxx
+++ b/framework/inc/classes/imagewrapper.hxx
@@ -35,17 +35,15 @@
#include <com/sun/star/awt/XBitmap.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <vcl/image.hxx>
namespace framework
{
class ImageWrapper : public ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::com::sun::star::awt::XBitmap ,
- public ::com::sun::star::lang::XUnoTunnel ,
- public ::com::sun::star::lang::XTypeProvider ,
- public ::cppu::OWeakObject
+ public ::cppu::WeakImplHelper2< ::com::sun::star::awt::XBitmap,
+ ::com::sun::star::lang::XUnoTunnel >
{
public:
ImageWrapper( const Image& aImage );
@@ -58,12 +56,6 @@ class ImageWrapper : public ThreadHelpBase , // Struc
static ::com::sun::star::uno::Sequence< sal_Int8 > GetUnoTunnelId();
- // 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 ();
-
// XBitmap
virtual ::com::sun::star::awt::Size SAL_CALL getSize() throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getDIB() throw (::com::sun::star::uno::RuntimeException);
@@ -72,10 +64,6 @@ class ImageWrapper : public ThreadHelpBase , // Struc
// XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (::com::sun::star::uno::RuntimeException);
- // 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);
-
private:
Image m_aImage;
};
diff --git a/framework/inc/classes/menuconfiguration.hxx b/framework/inc/classes/menuconfiguration.hxx
deleted file mode 100644
index 35d60caf04e5..000000000000
--- a/framework/inc/classes/menuconfiguration.hxx
+++ /dev/null
@@ -1,126 +0,0 @@
-/*************************************************************************
- *
- * 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: menuconfiguration.hxx,v $
- * $Revision: 1.13 $
- *
- * 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_MENUCONFIGURATION_HXX_
-#define __FRAMEWORK_CLASSES_MENUCONFIGURATION_HXX_
-
-//_________________________________________________________________________________________________________________
-// interface includes
-//_________________________________________________________________________________________________________________
-
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/WrappedTargetException.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/io/XOutputStream.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/frame/XDispatchProvider.hpp>
-
-//_________________________________________________________________________________________________________________
-// includes of other projects
-//_________________________________________________________________________________________________________________
-
-#include <vcl/menu.hxx>
-#include <vcl/toolbox.hxx>
-#include <cppuhelper/weak.hxx>
-
-#define BOOKMARK_NEWMENU ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:menu_bookmark_new" ))
-#define BOOKMARK_WIZARDMENU ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:menu_bookmark_wizard" ))
-#define ADDONS_POPUPMENU ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:menu_addons_popup" ))
-
-// Prepare for inclusion by framework and sfx
-// Please consider that there is a corresponding define also in sfxsids.hrc!! (SID_SFX_START)/(SID_ADDONS)
-#define FWK_SID_SFX_START 5000
-#define FWK_SID_ADDONS (FWK_SID_SFX_START+1678)
-#define FWK_SID_ADDONHELP (FWK_SID_SFX_START+1684)
-
-const USHORT START_ITEMID_PICKLIST = 4500;
-const USHORT END_ITEMID_PICKLIST = 4599;
-const USHORT MAX_ITEMCOUNT_PICKLIST = 99; // difference between START_... & END_... for picklist / must be changed too, if these values are changed!
-const USHORT START_ITEMID_WINDOWLIST = 4600;
-const USHORT END_ITEMID_WINDOWLIST = 4699;
-const USHORT ITEMID_ADDONLIST = FWK_SID_ADDONS;
-const USHORT ITEMID_ADDONHELP = FWK_SID_ADDONHELP;
-
-namespace framework
-{
-
-class MenuConfiguration
-{
- public:
- struct Attributes
- {
- Attributes() {}
- Attributes( const ::rtl::OUString& aFrame, const ::rtl::OUString& aImageIdStr ) :
- aTargetFrame( aFrame ), aImageId( aImageIdStr ) {}
-
- ::rtl::OUString aTargetFrame;
- ::rtl::OUString aImageId;
- ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XDispatchProvider > xDispatchProvider;
- };
-
- MenuConfiguration(
- // #110897#-1 use const when giving a uno reference by reference
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
-
- virtual ~MenuConfiguration();
-
- MenuBar* CreateMenuBarFromConfiguration(
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rInputStream )
- throw ( ::com::sun::star::lang::WrappedTargetException );
-
- PopupMenu* CreateBookmarkMenu(
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
- const ::rtl::OUString& aURL )
- throw ( ::com::sun::star::lang::WrappedTargetException );
-
- ToolBox* CreateToolBoxFromConfiguration(
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rInputStream )
- throw ( ::com::sun::star::lang::WrappedTargetException );
-
- void StoreMenuBar( MenuBar* pMenuBar,
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rOutputStream )
- throw ( ::com::sun::star::lang::WrappedTargetException );
-
- void StoreToolBox( ToolBox* pToolBox,
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rOutputStream )
- throw ( ::com::sun::star::lang::WrappedTargetException );
-
- static BOOL IsPickListItemId( USHORT nId );
- static BOOL IsWindowListItemId( USHORT nId );
-
- private:
- // #110897#-1 do not hold the uno reference by reference
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& m_rxServiceManager;
-};
-
-}
-
-#endif // __FRAMEWORK_CLASSES_MENUCONFIGURATION_HXX_
-
diff --git a/framework/inc/classes/menumanager.hxx b/framework/inc/classes/menumanager.hxx
index 8d6fb3de2018..5c7d8b386657 100644
--- a/framework/inc/classes/menumanager.hxx
+++ b/framework/inc/classes/menumanager.hxx
@@ -43,6 +43,7 @@
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/FeatureStateEvent.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
//_________________________________________________________________________________________________________________
// other includes
@@ -50,7 +51,7 @@
#include <rtl/ustring.hxx>
#include <vcl/menu.hxx>
#include <vcl/accel.hxx>
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase1.hxx>
#include <threadhelp/threadhelpbase.hxx>
#include <macros/debug.hxx>
@@ -73,9 +74,8 @@ namespace framework
class BmkMenu;
class AddonMenu;
class AddonPopupMenu;
-class MenuManager : public XSTATUSLISTENER ,
- public ThreadHelpBase ,
- public ::cppu::OWeakObject
+class MenuManager : public ThreadHelpBase ,
+ public ::cppu::WeakImplHelper1< ::com::sun::star::frame::XStatusListener >
{
public:
// #110897#
@@ -89,34 +89,12 @@ class MenuManager : public XSTATUSLISTENER ,
MenuManager(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
REFERENCE< XFRAME >& rFrame,
- BmkMenu* pBmkMenu,
- sal_Bool bDelete,
- sal_Bool bDeleteChildren );
-
- MenuManager(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- REFERENCE< XFRAME >& rFrame,
AddonMenu* pAddonMenu,
sal_Bool bDelete,
sal_Bool bDeleteChildren );
- MenuManager(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- REFERENCE< XFRAME >& rFrame,
- AddonPopupMenu* pAddonMenu,
- sal_Bool bDelete,
- sal_Bool bDeleteChildren );
-
virtual ~MenuManager();
- // XInterface
- virtual void SAL_CALL acquire() throw()
- { OWeakObject::acquire(); }
- virtual void SAL_CALL release() throw()
- { OWeakObject::release(); }
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
- const ::com::sun::star::uno::Type & rType ) throw( RUNTIMEEXCEPTION );
-
// XStatusListener
virtual void SAL_CALL statusChanged( const FEATURSTATEEVENT& Event ) throw ( RUNTIMEEXCEPTION );
@@ -132,6 +110,9 @@ class MenuManager : public XSTATUSLISTENER ,
// #110897#
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& getServiceFactory();
+ static void UpdateSpecialWindowMenu( Menu* pMenu ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,IMutex& _rMutex);
+ static void FillMenuImages(::com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& xFrame,Menu* _pMenu,sal_Bool bIsHiContrast,sal_Bool bShowMenuImages);
+
protected:
DECL_LINK( Highlight, Menu * );
DECL_LINK( Activate, Menu * );
@@ -140,6 +121,10 @@ class MenuManager : public XSTATUSLISTENER ,
private:
void UpdateSpecialFileMenu( Menu* pMenu );
void UpdateSpecialWindowMenu( Menu* pMenu );
+ void ClearMenuDispatch(const EVENTOBJECT& Source = EVENTOBJECT(),bool _bRemoveOnly = true);
+ void SetHdl();
+ void AddMenu(PopupMenu* _pPopupMenu,const ::rtl::OUString& _sItemCommand,USHORT _nItemId,sal_Bool _bDelete,sal_Bool _bDeleteChildren);
+ USHORT FillItemCommand(::rtl::OUString& _rItemCommand,Menu* _pMenu,USHORT _nIndex) const;
struct MenuItemHandler
@@ -177,6 +162,7 @@ class MenuManager : public XSTATUSLISTENER ,
// #110897#
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& mxServiceFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
};
} // namespace
diff --git a/framework/inc/classes/statusbarconfiguration.hxx b/framework/inc/classes/statusbarconfiguration.hxx
deleted file mode 100644
index 02df2a0a6518..000000000000
--- a/framework/inc/classes/statusbarconfiguration.hxx
+++ /dev/null
@@ -1,48 +0,0 @@
-#ifndef __FRAMEWORK_CLASSES_STATUSBARCONFIGURATION_HXX_
-#define __FRAMEWORK_CLASSES_STATUSBARCONFIGURATION_HXX_
-
-#include <svtools/svarray.hxx>
-#include <tools/string.hxx>
-#include <tools/stream.hxx>
-#include <vcl/status.hxx>
-
-// #110897#
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-namespace framework
-{
-
-struct StatusBarItemDescriptor
-{
- String aURL; // URL command to dispatch
- long nItemBits; // properties for this statusbar item (WinBits)
- long nWidth; // width of a statusbar item
- long nOffset; // offset
-
- public:
-
- StatusBarItemDescriptor() : nItemBits( SIB_CENTER | SIB_IN )
- ,nWidth( 0 )
- ,nOffset( STATUSBAR_OFFSET ) {}
-};
-
-typedef StatusBarItemDescriptor* StatusBarItemDescriptorPtr;
-SV_DECL_PTRARR_DEL( StatusBarDescriptor, StatusBarItemDescriptorPtr, 10, 2)
-
-class StatusBarConfiguration
-{
- public:
- // #110897#
- static sal_Bool LoadStatusBar(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- SvStream& rInStream, StatusBarDescriptor& aItems );
-
- // #110897#
- static sal_Bool StoreStatusBar(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- SvStream& rOutStream, const StatusBarDescriptor& aItems );
-};
-
-} // namespace framework
-
-#endif // __FRAMEWORK_CLASSES_STATUSBARCONFIGURATION_HXX_
diff --git a/framework/inc/classes/statusbardocumenthandler.hxx b/framework/inc/classes/statusbardocumenthandler.hxx
deleted file mode 100644
index e81b7db30b43..000000000000
--- a/framework/inc/classes/statusbardocumenthandler.hxx
+++ /dev/null
@@ -1,190 +0,0 @@
-/*************************************************************************
- *
- * 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: statusbardocumenthandler.hxx,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 __FRAMEWORK_CLASSES_STATUSBARDOCUMENTHANDLER_HXX_
-#define __FRAMEWORK_CLASSES_STATUSBARDOCUMENTHANDLER_HXX_
-
-#include <classes/statusbarconfiguration.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>
-
-#ifndef __SGI_STL_HASH_MAP
-#include <hash_map>
-#endif
-#include <stdtypes.h>
-
-//_________________________________________________________________________________________________________________
-// namespace
-//_________________________________________________________________________________________________________________
-
-namespace framework{
-
-//*****************************************************************************************************************
-// Hash code function for using in all hash maps of follow implementation.
-
-class OReadStatusBarDocumentHandler : public ::com::sun::star::xml::sax::XDocumentHandler,
- private ThreadHelpBase, // Struct for right initalization of lock member! Must be first of baseclasses.
- public ::cppu::OWeakObject
-{
- public:
- enum StatusBar_XML_Entry
- {
- SB_ELEMENT_STATUSBAR,
- SB_ELEMENT_STATUSBARITEM,
- SB_ATTRIBUTE_URL,
- SB_ATTRIBUTE_ALIGN,
- SB_ATTRIBUTE_STYLE,
- SB_ATTRIBUTE_AUTOSIZE,
- SB_ATTRIBUTE_OWNERDRAW,
- SB_ATTRIBUTE_WIDTH,
- SB_ATTRIBUTE_OFFSET,
- SB_XML_ENTRY_COUNT
- };
-
- enum StatusBar_XML_Namespace
- {
- SB_NS_STATUSBAR,
- SB_NS_XLINK,
- SB_XML_NAMESPACES_COUNT
- };
-
- OReadStatusBarDocumentHandler( StatusBarDescriptor& aStatusBarItems );
- virtual ~OReadStatusBarDocumentHandler();
-
- // XInterface
- virtual void SAL_CALL acquire() throw()
- { OWeakObject::acquire(); }
- virtual void SAL_CALL release() throw()
- { OWeakObject::release(); }
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
- const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
-
- // XDocumentHandler
- virtual void SAL_CALL startDocument(void)
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endDocument(void)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL startElement(
- const rtl::OUString& aName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &xAttribs)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endElement(const rtl::OUString& aName)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL characters(const rtl::OUString& aChars)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL ignorableWhitespace(const rtl::OUString& aWhitespaces)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL processingInstruction(const rtl::OUString& aTarget,
- const rtl::OUString& aData)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL setDocumentLocator(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > &xLocator)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- private:
- ::rtl::OUString getErrorLineString();
-
- class StatusBarHashMap : public ::std::hash_map< ::rtl::OUString ,
- StatusBar_XML_Entry ,
- OUStringHashCode ,
- ::std::equal_to< ::rtl::OUString > >
- {
- public:
- inline void free()
- {
- StatusBarHashMap().swap( *this );
- }
- };
-
- sal_Bool m_bStatusBarStartFound;
- sal_Bool m_bStatusBarEndFound;
- sal_Bool m_bStatusBarItemStartFound;
- StatusBarHashMap m_aStatusBarMap;
- StatusBarDescriptor& m_aStatusBarItems;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > m_xLocator;
-};
-
-class OWriteStatusBarDocumentHandler : private ThreadHelpBase // Struct for right initalization of lock member! Must be first of baseclasses.
-{
- public:
- OWriteStatusBarDocumentHandler(
- const StatusBarDescriptor& aStatusBarItems,
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > );
- virtual ~OWriteStatusBarDocumentHandler();
-
- void WriteStatusBarDocument() throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- protected:
- virtual void WriteStatusBarItem( const StatusBarItemDescriptor* ) throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- const StatusBarDescriptor& m_aStatusBarItems;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xWriteDocumentHandler;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > m_xEmptyList;
- ::rtl::OUString m_aXMLStatusBarNS;
- ::rtl::OUString m_aXMLXlinkNS;
- ::rtl::OUString m_aAttributeType;
- ::rtl::OUString m_aAttributeURL;
-};
-
-} // namespace framework
-
-#endif
diff --git a/framework/inc/classes/toolboxconfiguration.hxx b/framework/inc/classes/toolboxconfiguration.hxx
deleted file mode 100755
index 39cb30603859..000000000000
--- a/framework/inc/classes/toolboxconfiguration.hxx
+++ /dev/null
@@ -1,96 +0,0 @@
-#ifndef __FRAMEWORK_CLASSES_TOOLBOXCONFIGURATION_HXX_
-#define __FRAMEWORK_CLASSES_TOOLBOXCONFIGURATION_HXX_
-
-#include <svtools/svarray.hxx>
-#ifndef _SV_BITMAP_HXX
-#include <vcl/bitmapex.hxx>
-#endif
-#include <tools/string.hxx>
-#include <tools/stream.hxx>
-#include <vcl/toolbox.hxx>
-#include <vcl/toolbox.hxx>
-
-// #110897#
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-namespace framework
-{
-
-struct ToolBoxItemDescriptor
-{
- BitmapEx* pBmpEx; // Bitmap ptr not used by xml configuration
- String aBitmapName; // bitmap name => use to find correct bmp file
- String aItemText; // label for this toolbox item
- String aURL; // URL command to dispatch
- USHORT nId; // internal id not used by xml configuration
- USHORT nItemBits; // properties for this toolbox item (WinBits)
- USHORT nItemType; // toolbox item type (BUTTON, SPACE, BREAK, SEPARATOR)
- USHORT nVisible; // toolbox item visible?
- USHORT nWidth; // width of a toolbox window (edit field, etc.)
- USHORT nUserDef; // user defined toolbox item (1=yes/0=no)
- String aHelpId; // A help id associated with this toolbox item
-
- public:
-
- ToolBoxItemDescriptor() : pBmpEx( 0 )
- ,nId( 0 )
- ,nItemBits( 0 )
- ,nItemType( (USHORT)TOOLBOXITEM_SPACE )
- ,nVisible( sal_True )
- ,nWidth( 0 )
- ,nUserDef( sal_False ) {}
-};
-
-typedef ToolBoxItemDescriptor* ToolBoxItemDescriptorPtr;
-SV_DECL_PTRARR_DEL( ToolBoxDescriptor, ToolBoxItemDescriptorPtr, 10, 2)
-
-struct ToolBoxLayoutItemDescriptor
-{
- String aName; // Unique name of the toolbox ( Objectbar, Toolbar etc. )
- String aUserName; // Userspecified name for this toolbar
- Point aFloatingPos; // Position in floating mode
- USHORT nFloatingLines; // Number of lines in floating mode
- USHORT nLines; // Number of lines in docking mode
- WindowAlign eAlign; // Aligned position in docking mode
- BOOL bVisible; // Visible or not
- BOOL bFloating; // Floating mode on/off
- ButtonType eType; // text, symbol or text+symbol
-
- ToolBoxLayoutItemDescriptor() : nFloatingLines( 0 )
- ,nLines( 1 )
- ,eAlign( WINDOWALIGN_LEFT )
- ,bVisible( sal_False )
- ,bFloating( sal_False )
- ,eType( BUTTON_SYMBOL ) {}
-};
-
-typedef ToolBoxLayoutItemDescriptor* ToolBoxLayoutItemDescriptorPtr;
-SV_DECL_PTRARR_DEL( ToolBoxLayoutDescriptor, ToolBoxLayoutItemDescriptorPtr, 10, 2)
-
-class ToolBoxConfiguration
-{
- public:
- // #110897#
- static sal_Bool LoadToolBox(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- SvStream& rInStream, ToolBoxDescriptor& aItems );
-
- // #110897#
- static sal_Bool StoreToolBox(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- SvStream& rOutStream, const ToolBoxDescriptor& aItems );
-
- // #110897#
- static sal_Bool LoadToolBoxLayout(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- SvStream& rInStream, ToolBoxLayoutDescriptor& aItems );
-
- // #110897#
- static sal_Bool StoreToolBoxLayout(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- SvStream& rOutStream, ToolBoxLayoutDescriptor& aItems );
-};
-
-} // namespace framework
-
-#endif // __FRAMEWORK_CLASSES_TOOLBOXCONFIGURATION_HXX_
diff --git a/framework/inc/classes/toolboxconfigurationdefines.hxx b/framework/inc/classes/toolboxconfigurationdefines.hxx
deleted file mode 100644
index f9a2f8365583..000000000000
--- a/framework/inc/classes/toolboxconfigurationdefines.hxx
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef __FRAMEWORK_TOOLBOXCONFIGURATIONDEFINES_HXX_
-#define __FRAMEWORK_TOOLBOXCONFIGURATIONDEFINES_HXX_
-
-#define XMLNS_TOOLBAR "http://openoffice.org/2001/toolbar"
-#define XMLNS_XLINK "http://www.w3.org/1999/xlink"
-#define XMLNS_TOOLBAR_PREFIX "toolbar:"
-#define XMLNS_XLINK_PREFIX "xlink:"
-
-#define XMLNS_FILTER_SEPARATOR "^"
-
-#define ELEMENT_TOOLBAR "toolbar"
-#define ELEMENT_TOOLBARITEM "toolbaritem"
-#define ELEMENT_TOOLBARSPACE "toolbarspace"
-#define ELEMENT_TOOLBARBREAK "toolbarbreak"
-#define ELEMENT_TOOLBARSEPARATOR "toolbarseparator"
-
-#define ELEMENT_TOOLBARLAYOUTS "toolbarlayouts"
-#define ELEMENT_TOOLBARLAYOUT "toolbarlayout"
-#define ELEMENT_TOOLBARCONFIGITEMS "toolbarconfigitems"
-#define ELEMENT_TOOLBARCONFIGITEM "toolbarconfigitem"
-
-#define ATTRIBUTE_BITMAP "bitmap"
-#define ATTRIBUTE_TEXT "text"
-#define ATTRIBUTE_URL "href"
-#define ATTRIBUTE_ITEMBITS "property"
-#define ATTRIBUTE_VISIBLE "visible"
-#define ATTRIBUTE_WIDTH "width"
-#define ATTRIBUTE_USER "userdefined"
-#define ATTRIBUTE_HELPID "helpid"
-#define ATTRIBUTE_ITEMSTYLE "style"
-
-#define ATTRIBUTE_ID "id"
-#define ATTRIBUTE_FLOATINGPOSLEFT "floatingposleft"
-#define ATTRIBUTE_FLOATINGPOSTOP "floatingpostop"
-#define ATTRIBUTE_TOOLBARNAME "toolbarname"
-#define ATTRIBUTE_CONTEXT "context"
-#define ATTRIBUTE_FLOATINGLINES "floatinglines"
-#define ATTRIBUTE_DOCKINGLINES "dockinglines"
-#define ATTRIBUTE_ALIGN "align"
-#define ATTRIBUTE_FLOATING "floating"
-#define ATTRIBUTE_BUTTONTYPE "style"
-#define ATTRIBUTE_USERDEFNAME "userdefname"
-
-#define ELEMENT_NS_TOOLBAR "toolbar:toolbar"
-#define ELEMENT_NS_TOOLBARITEM "toolbar:toolbaritem"
-#define ELEMENT_NS_TOOLBARSPACE "toolbar:toolbarspace"
-#define ELEMENT_NS_TOOLBARBREAK "toolbar:toolbarbreak"
-#define ELEMENT_NS_TOOLBARSEPARATOR "toolbar:toolbarseparator"
-
-#define ELEMENT_NS_TOOLBARLAYOUTS "toolbar:toolbarlayouts"
-#define ELEMENT_NS_TOOLBARLAYOUT "toolbar:toolbarlayout"
-#define ELEMENT_NS_TOOLBARCONFIGITEMS "toolbar:toolbarconfigitems"
-#define ELEMENT_NS_TOOLBARCONFIGITEM "toolbar:toolbarconfigitem"
-
-#define ATTRIBUTE_XMLNS_TOOLBAR "xmlns:toolbar"
-#define ATTRIBUTE_XMLNS_XLINK "xmlns:xlink"
-
-#define ATTRIBUTE_TYPE_CDATA "CDATA"
-
-#define ATTRIBUTE_BOOLEAN_TRUE "true"
-#define ATTRIBUTE_BOOLEAN_FALSE "false"
-
-#define ATTRIBUTE_ALIGN_LEFT "left"
-#define ATTRIBUTE_ALIGN_RIGHT "right"
-#define ATTRIBUTE_ALIGN_TOP "top"
-#define ATTRIBUTE_ALIGN_BOTTOM "bottom"
-
-#define ATTRIBUTE_STYLE_TEXT "text"
-#define ATTRIBUTE_STYLE_SYMBOL "symbol"
-#define ATTRIBUTE_STYLE_SYMBOLTEXT "symboltext"
-#define ATTRIBUTE_STYLE_SYMBOLPLUSTEXT "symbol+text"
-
-#define ATTRIBUTE_ITEMSTYLE_RADIO "radio"
-#define ATTRIBUTE_ITEMSTYLE_AUTO "auto"
-#define ATTRIBUTE_ITEMSTYLE_LEFT "left"
-#define ATTRIBUTE_ITEMSTYLE_AUTOSIZE "autosize"
-#define ATTRIBUTE_ITEMSTYLE_DROPDOWN "dropdown"
-#define ATTRIBUTE_ITEMSTYLE_REPEAT "repeat"
-
-#endif
diff --git a/framework/inc/classes/toolboxdocumenthandler.hxx b/framework/inc/classes/toolboxdocumenthandler.hxx
deleted file mode 100755
index 346fa0982848..000000000000
--- a/framework/inc/classes/toolboxdocumenthandler.hxx
+++ /dev/null
@@ -1,217 +0,0 @@
-/*************************************************************************
- *
- * 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: toolboxdocumenthandler.hxx,v $
- * $Revision: 1.6 $
- *
- * 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_TOOLBOXDOCUMENTHANDLER_HXX_
-#define __FRAMEWORK_CLASSES_TOOLBOXDOCUMENTHANDLER_HXX_
-
-#include <classes/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>
-
-#ifndef __SGI_STL_HASH_MAP
-#include <hash_map>
-#endif
-#include <stdtypes.h>
-
-//_________________________________________________________________________________________________________________
-// namespace
-//_________________________________________________________________________________________________________________
-
-namespace framework{
-
-//*****************************************************************************************************************
-// Hash code function for using in all hash maps of follow implementation.
-
-class OReadToolBoxDocumentHandler : public ::com::sun::star::xml::sax::XDocumentHandler,
- private ThreadHelpBase, // Struct for right initalization of lock member! Must be first of baseclasses.
- public ::cppu::OWeakObject
-{
- public:
- enum ToolBox_XML_Entry
- {
- TB_ELEMENT_TOOLBAR,
- TB_ELEMENT_TOOLBARITEM,
- TB_ELEMENT_TOOLBARSPACE,
- TB_ELEMENT_TOOLBARBREAK,
- TB_ELEMENT_TOOLBARSEPARATOR,
- TB_ATTRIBUTE_TEXT,
- TB_ATTRIBUTE_BITMAP,
- TB_ATTRIBUTE_URL,
- TB_ATTRIBUTE_ITEMBITS,
- TB_ATTRIBUTE_VISIBLE,
- TB_ATTRIBUTE_WIDTH,
- TB_ATTRIBUTE_USER,
- TB_ATTRIBUTE_HELPID,
- TB_ATTRIBUTE_STYLE,
- TB_XML_ENTRY_COUNT
- };
-
- enum ToolBox_XML_Namespace
- {
- TB_NS_TOOLBAR,
- TB_NS_XLINK,
- TB_XML_NAMESPACES_COUNT
- };
-
- OReadToolBoxDocumentHandler( ToolBoxDescriptor& aToolBoxItems );
- virtual ~OReadToolBoxDocumentHandler();
-
- // XInterface
- virtual void SAL_CALL acquire() throw()
- { OWeakObject::acquire(); }
- virtual void SAL_CALL release() throw()
- { OWeakObject::release(); }
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
- const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
-
- // XDocumentHandler
- virtual void SAL_CALL startDocument(void)
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endDocument(void)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL startElement(
- const rtl::OUString& aName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &xAttribs)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endElement(const rtl::OUString& aName)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL characters(const rtl::OUString& aChars)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL ignorableWhitespace(const rtl::OUString& aWhitespaces)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL processingInstruction(const rtl::OUString& aTarget,
- const rtl::OUString& aData)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL setDocumentLocator(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > &xLocator)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- private:
- ::rtl::OUString getErrorLineString();
-
- class ToolBoxHashMap : public ::std::hash_map< ::rtl::OUString ,
- ToolBox_XML_Entry ,
- OUStringHashCode ,
- ::std::equal_to< ::rtl::OUString > >
- {
- public:
- inline void free()
- {
- ToolBoxHashMap().swap( *this );
- }
- };
-
- sal_Bool m_bToolBarStartFound;
- sal_Bool m_bToolBarEndFound;
- sal_Bool m_bToolBarItemStartFound;
- sal_Bool m_bToolBarSpaceStartFound;
- sal_Bool m_bToolBarBreakStartFound;
- sal_Bool m_bToolBarSeparatorStartFound;
- ToolBoxHashMap m_aToolBoxMap;
- ToolBoxDescriptor& m_aToolBoxItems;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > m_xLocator;
-
- sal_Int32 m_nHashCode_Style_Radio;
- sal_Int32 m_nHashCode_Style_Auto;
- sal_Int32 m_nHashCode_Style_Left;
- sal_Int32 m_nHashCode_Style_AutoSize;
- sal_Int32 m_nHashCode_Style_DropDown;
- sal_Int32 m_nHashCode_Style_Repeat;
-};
-
-class OWriteToolBoxDocumentHandler : private ThreadHelpBase // Struct for right initalization of lock member! Must be first of baseclasses.
-{
- public:
- OWriteToolBoxDocumentHandler(
- const ToolBoxDescriptor& aToolBoxItems,
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > );
- virtual ~OWriteToolBoxDocumentHandler();
-
- void WriteToolBoxDocument() throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- protected:
- virtual void WriteToolBoxItem( const ToolBoxItemDescriptor* ) throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void WriteToolBoxSpace() throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void WriteToolBoxBreak() throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void WriteToolBoxSeparator() throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- const ToolBoxDescriptor& m_aToolBoxItems;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xWriteDocumentHandler;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > m_xEmptyList;
- ::rtl::OUString m_aXMLToolbarNS;
- ::rtl::OUString m_aXMLXlinkNS;
- ::rtl::OUString m_aAttributeType;
- ::rtl::OUString m_aAttributeURL;
-};
-
-} // namespace framework
-
-#endif
diff --git a/framework/inc/classes/toolboxlayoutdocumenthandler.hxx b/framework/inc/classes/toolboxlayoutdocumenthandler.hxx
deleted file mode 100644
index f18e5af68415..000000000000
--- a/framework/inc/classes/toolboxlayoutdocumenthandler.hxx
+++ /dev/null
@@ -1,198 +0,0 @@
-/*************************************************************************
- *
- * 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: toolboxlayoutdocumenthandler.hxx,v $
- * $Revision: 1.7 $
- *
- * 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_TOOLBOXLAYOUTDOCUMENTHANDLER_HXX_
-#define __FRAMEWORK_CLASSES_TOOLBOXLAYOUTDOCUMENTHANDLER_HXX_
-
-#include <classes/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>
-
-#ifndef __SGI_STL_HASH_MAP
-#include <hash_map>
-#endif
-#include <stdtypes.h>
-
-//_________________________________________________________________________________________________________________
-// namespace
-//_________________________________________________________________________________________________________________
-
-namespace framework{
-
-//*****************************************************************************************************************
-// Hash code function for using in all hash maps of follow implementation.
-
-class OReadToolBoxLayoutDocumentHandler : public ::com::sun::star::xml::sax::XDocumentHandler,
- private ThreadHelpBase, // Struct for right initalization of lock member! Must be first of baseclasses.
- public ::cppu::OWeakObject
-{
- public:
- enum ToolBoxLayout_XML_Entry
- {
- TBL_ELEMENT_TOOLBARLAYOUTS,
- TBL_ELEMENT_TOOLBARLAYOUT,
- TBL_ELEMENT_TOOLBARCONFIGITEMS,
- TBL_ELEMENT_TOOLBARCONFIGITEM,
- TBL_ATTRIBUTE_ID,
- TBL_ATTRIBUTE_TOOLBARNAME,
- TBL_ATTRIBUTE_CONTEXT,
- TBL_ATTRIBUTE_FLOATINGLINES,
- TBL_ATTRIBUTE_DOCKINGLINES,
- TBL_ATTRIBUTE_ALIGN,
- TBL_ATTRIBUTE_FLOATING,
- TBL_ATTRIBUTE_FLOATINGPOSLEFT,
- TBL_ATTRIBUTE_FLOATINGPOSTOP,
- TBL_ATTRIBUTE_VISIBLE,
- TBL_ATTRIBUTE_STYLE,
- TBL_ATTRIBUTE_USERDEFNAME,
- TBL_XML_ENTRY_COUNT
- };
-
- enum ToolBox_XML_Namespace
- {
- TBL_NS_TOOLBAR,
- TBL_XML_NAMESPACES_COUNT
- };
-
- OReadToolBoxLayoutDocumentHandler( ToolBoxLayoutDescriptor& aToolBoxLayoutItems );
- virtual ~OReadToolBoxLayoutDocumentHandler();
-
- // XInterface
- virtual void SAL_CALL acquire() throw()
- { OWeakObject::acquire(); }
- virtual void SAL_CALL release() throw()
- { OWeakObject::release(); }
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
- const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
-
- // XDocumentHandler
- virtual void SAL_CALL startDocument(void)
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endDocument(void)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL startElement(
- const rtl::OUString& aName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &xAttribs)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endElement(const rtl::OUString& aName)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL characters(const rtl::OUString& aChars)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL ignorableWhitespace(const rtl::OUString& aWhitespaces)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL processingInstruction(const rtl::OUString& aTarget,
- const rtl::OUString& aData)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL setDocumentLocator(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > &xLocator)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- private:
- ::rtl::OUString getErrorLineString();
-
- class ToolBoxLayoutHashMap : public ::std::hash_map< ::rtl::OUString ,
- ToolBoxLayout_XML_Entry ,
- OUStringHashCode ,
- ::std::equal_to< ::rtl::OUString > >
- {
- public:
- inline void free()
- {
- ToolBoxLayoutHashMap().swap( *this );
- }
- };
-
- sal_Bool m_bToolBarLayoutsStartFound;
- sal_Bool m_bToolBarLayoutsEndFound;
- sal_Bool m_bToolBarLayoutStartFound;
- sal_Bool m_bToolBarConfigListStartFound;
- sal_Bool m_bToolBarConfigItemStartFound;
- ToolBoxLayoutHashMap m_aToolBoxMap;
- ToolBoxLayoutDescriptor& m_aToolBoxItems;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > m_xLocator;
-};
-
-class OWriteToolBoxLayoutDocumentHandler : private ThreadHelpBase // Struct for right initalization of lock member! Must be first of baseclasses.
-{
- public:
- OWriteToolBoxLayoutDocumentHandler(
- const ToolBoxLayoutDescriptor& aToolBoxLayoutItems,
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > );
- virtual ~OWriteToolBoxLayoutDocumentHandler();
-
- void WriteToolBoxLayoutDocument() throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- protected:
- virtual void WriteToolBoxLayoutItem( const ToolBoxLayoutItemDescriptor* ) throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- const ToolBoxLayoutDescriptor& m_aToolBoxLayoutItems;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xWriteDocumentHandler;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > m_xEmptyList;
- ::rtl::OUString m_aXMLToolbarNS;
- ::rtl::OUString m_aAttributeType;
- ::rtl::OUString m_aTrueValue;
- ::rtl::OUString m_aFalseValue;
-};
-
-} // namespace framework
-
-#endif
diff --git a/framework/inc/dispatch/menudispatcher.hxx b/framework/inc/dispatch/menudispatcher.hxx
index 3f52e952c825..0c76dbf96983 100644
--- a/framework/inc/dispatch/menudispatcher.hxx
+++ b/framework/inc/dispatch/menudispatcher.hxx
@@ -312,8 +312,6 @@ class MenuDispatcher : // interfaces
static sal_Bool impldbg_checkParameter_MenuDispatcher ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ,
const css::uno::Reference< css::frame::XFrame >& xOwner );
- static sal_Bool impldbg_checkParameter_dispatch ( const css::util::URL& aURL ,
- const css::uno::Sequence< css::beans::PropertyValue >& seqArguments );
static sal_Bool impldbg_checkParameter_addStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& xControl ,
const css::util::URL& aURL );
static sal_Bool impldbg_checkParameter_removeStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& xControl ,
diff --git a/framework/inc/helper/dockingareadefaultacceptor.hxx b/framework/inc/helper/dockingareadefaultacceptor.hxx
index b701d4c1a124..49ba96b5e58f 100644
--- a/framework/inc/helper/dockingareadefaultacceptor.hxx
+++ b/framework/inc/helper/dockingareadefaultacceptor.hxx
@@ -51,7 +51,7 @@
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/weakref.hxx>
//_________________________________________________________________________________________________________________
@@ -63,10 +63,8 @@ namespace framework{
//_________________________________________________________________________________________________________________
-class DockingAreaDefaultAcceptor : public css::lang::XTypeProvider ,
- public ::com::sun::star::ui::XDockingAreaAcceptor ,
- private ThreadHelpBase ,
- public ::cppu::OWeakObject
+class DockingAreaDefaultAcceptor : private ThreadHelpBase ,
+ public ::cppu::WeakImplHelper1< ::com::sun::star::ui::XDockingAreaAcceptor >
{
public:
@@ -93,13 +91,6 @@ class DockingAreaDefaultAcceptor : public css::lang::XTypeProvider
virtual ~DockingAreaDefaultAcceptor();
//---------------------------------------------------------------------------------------------------------
- // XInterface
- //---------------------------------------------------------------------------------------------------------
-
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
-
- //---------------------------------------------------------------------------------------------------------
// XDockingAreaAcceptor
//---------------------------------------------------------------------------------------------------------
diff --git a/framework/inc/helper/mischelper.hxx b/framework/inc/helper/mischelper.hxx
index 1d9df9caa4ff..435b87a4f248 100644
--- a/framework/inc/helper/mischelper.hxx
+++ b/framework/inc/helper/mischelper.hxx
@@ -32,6 +32,8 @@
#define __MISC_HELPER_HXX_
#include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
#include <i18npool/lang.h>
#include <svtools/languageoptions.hxx>
@@ -48,12 +50,21 @@ inline bool IsScriptTypeMatchingToLanguage( sal_Int16 nScriptType, LanguageType
class 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() {}
+ LanguageGuessingHelper(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xServiceManager) : m_xServiceManager(_xServiceManager){}
::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLanguageGuessing > GetGuesser() const;
-};
+};
+
+::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);
} // namespace framework
diff --git a/framework/inc/helper/ocomponentaccess.hxx b/framework/inc/helper/ocomponentaccess.hxx
index 2081be00991d..c84904f8187d 100644
--- a/framework/inc/helper/ocomponentaccess.hxx
+++ b/framework/inc/helper/ocomponentaccess.hxx
@@ -55,7 +55,7 @@
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/weakref.hxx>
//_________________________________________________________________________________________________________________
@@ -90,10 +90,8 @@ namespace framework{
@devstatus ready to use
*//*-*************************************************************************************************************/
-class OComponentAccess : public css::lang::XTypeProvider ,
- public css::container::XEnumerationAccess , // => XElementAccess
- private ThreadHelpBase , // Must be the first of baseclasses - Is neccessary for right initialization of objects!
- public ::cppu::OWeakObject
+class OComponentAccess : private ThreadHelpBase , // Must be the first of baseclasses - Is neccessary for right initialization of objects!
+ public ::cppu::WeakImplHelper1< ::com::sun::star::container::XEnumerationAccess >
{
//-------------------------------------------------------------------------------------------------------------
// public methods
@@ -123,13 +121,6 @@ class OComponentAccess : public css::lang::XTypeProvider ,
OComponentAccess( const css::uno::Reference< css::frame::XDesktop >& xOwner );
//---------------------------------------------------------------------------------------------------------
- // XInterface
- //---------------------------------------------------------------------------------------------------------
-
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
-
- //---------------------------------------------------------------------------------------------------------
// XEnumerationAccess
//---------------------------------------------------------------------------------------------------------
diff --git a/framework/inc/helper/ocomponentenumeration.hxx b/framework/inc/helper/ocomponentenumeration.hxx
index 77efce5d49e4..2f8bdcd2b87d 100644
--- a/framework/inc/helper/ocomponentenumeration.hxx
+++ b/framework/inc/helper/ocomponentenumeration.hxx
@@ -54,7 +54,7 @@
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase2.hxx>
//_________________________________________________________________________________________________________________
// namespace
@@ -88,11 +88,8 @@ namespace framework{
@threadsafe yes
*//*-*************************************************************************************************************/
-class OComponentEnumeration : public css::lang::XTypeProvider ,
- public css::lang::XEventListener ,
- public css::container::XEnumeration ,
- public ThreadHelpBase ,
- public ::cppu::OWeakObject
+class OComponentEnumeration : public ThreadHelpBase ,
+ public ::cppu::WeakImplHelper2< ::com::sun::star::container::XEnumeration,::com::sun::star::lang::XEventListener >
{
//-------------------------------------------------------------------------------------------------------------
// public methods
@@ -120,13 +117,6 @@ class OComponentEnumeration : public css::lang::XTypeProvider ,
OComponentEnumeration( const css::uno::Sequence< css::uno::Reference< css::lang::XComponent > >& seqComponents );
//---------------------------------------------------------------------------------------------------------
- // XInterface
- //---------------------------------------------------------------------------------------------------------
-
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
-
- //---------------------------------------------------------------------------------------------------------
// XEventListener
//---------------------------------------------------------------------------------------------------------
diff --git a/framework/inc/helper/oframes.hxx b/framework/inc/helper/oframes.hxx
index b7f03923db5a..5d6a622bc8d5 100644
--- a/framework/inc/helper/oframes.hxx
+++ b/framework/inc/helper/oframes.hxx
@@ -53,7 +53,7 @@
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/weakref.hxx>
//_________________________________________________________________________________________________________________
@@ -90,10 +90,8 @@ namespace framework{
@devstatus deprecated
*//*-*************************************************************************************************************/
-class OFrames : public css::lang::XTypeProvider ,
- public css::frame::XFrames , //=> XIndexAccess => XElementAccess
- private ThreadHelpBase , // Must be the first of baseclasses - Is neccessary for right initialization of objects!
- public ::cppu::OWeakObject
+class OFrames : private ThreadHelpBase , // Must be the first of baseclasses - Is neccessary for right initialization of objects!
+ public ::cppu::WeakImplHelper1< ::com::sun::star::frame::XFrames >
{
//-------------------------------------------------------------------------------------------------------------
// public methods
@@ -125,13 +123,6 @@ class OFrames : public css::lang::XTypeProvider ,
FrameContainer* pFrameContainer );
//---------------------------------------------------------------------------------------------------------
- // XInterface
- //---------------------------------------------------------------------------------------------------------
-
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
-
- //---------------------------------------------------------------------------------------------------------
// XFrames
//---------------------------------------------------------------------------------------------------------
diff --git a/framework/inc/helper/opluginframedispatcher.hxx b/framework/inc/helper/opluginframedispatcher.hxx
deleted file mode 100644
index 627db5abfcd2..000000000000
--- a/framework/inc/helper/opluginframedispatcher.hxx
+++ /dev/null
@@ -1,362 +0,0 @@
-/*************************************************************************
- *
- * 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: opluginframedispatcher.hxx,v $
- * $Revision: 1.8 $
- *
- * 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_OPLUGINFRAMEDISPATCHER_HXX_
-#define __FRAMEWORK_HELPER_OPLUGINFRAMEDISPATCHER_HXX_
-
-//_________________________________________________________________________________________________________________
-// my own includes
-//_________________________________________________________________________________________________________________
-
-#include <threadhelp/threadhelpbase.hxx>
-#include <macros/generic.hxx>
-#include <macros/xinterface.hxx>
-#include <macros/debug.hxx>
-#include <general.h>
-
-//_________________________________________________________________________________________________________________
-// interface includes
-//_________________________________________________________________________________________________________________
-#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/frame/XDispatch.hpp>
-#include <com/sun/star/frame/XDispatchProvider.hpp>
-#include <com/sun/star/mozilla/XPluginInstance.hpp>
-#include <com/sun/star/mozilla/XPluginInstancePeer.hpp>
-#include <com/sun/star/mozilla/XPluginInstanceNotifySink.hpp>
-#include <com/sun/star/util/URL.hpp>
-#include <com/sun/star/frame/DispatchDescriptor.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/beans/PROPERTYVALUE.hpp>
-
-//_________________________________________________________________________________________________________________
-// other includes
-//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
-#include <cppuhelper/weakref.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
-
-//_________________________________________________________________________________________________________________
-// namespace
-//_________________________________________________________________________________________________________________
-
-namespace framework{
-
-//_________________________________________________________________________________________________________________
-// exported const
-//_________________________________________________________________________________________________________________
-
-//_________________________________________________________________________________________________________________
-// exported definitions
-//_________________________________________________________________________________________________________________
-
-/*-************************************************************************************************************//**
- Use OMultiTypeInterfaceContainerHelperVar-template to create new class to get a container
- to combine string values with listeners.
-*//*-*************************************************************************************************************/
-
-struct IMPL_hashCode
-{
- size_t operator()(const ::rtl::OUString& sString) const
- {
- return sString.hashCode();
- }
-};
-
-typedef ::cppu::OMultiTypeInterfaceContainerHelperVar< ::rtl::OUString ,
- IMPL_hashCode ,
- ::std::equal_to< ::rtl::OUString > > IMPL_ListenerContainerHelper ;
-
-/*-************************************************************************************************************//**
- @short -
- @descr -
-
- @implements XInterface
- XDispatchProvider
- XDispatch
- XPluginInstanceNotifySink
- @base OWeakObject
-
- @devstatus ready to use
-*//*-*************************************************************************************************************/
-
-class OPlugInFrameDispatcher : public css::frame::XDispatchProvider ,
- public css::frame::XDispatch ,
- public css::mozilla::XPluginInstanceNotifySink ,
- private ThreadHelpBase ,
- public ::cppu::OWeakObject
-{
- //-------------------------------------------------------------------------------------------------------------
- // public methods
- //-------------------------------------------------------------------------------------------------------------
-
- public:
-
- static void AddArguments ( const css::uno::Sequence< css::beans::PropertyValue > & rArgs ,
- const ::rtl::OUString& rURL );
- static const css::uno::Sequence < css::beans::PropertyValue >* GetArguments ( const ::rtl::OUString& rURL );
- static void RemoveArguments ( const ::rtl::OUString& rURL );
-
- //---------------------------------------------------------------------------------------------------------
- // constructor / destructor
- //---------------------------------------------------------------------------------------------------------
-
- /*-****************************************************************************************************//**
- @short standard ctor
- @descr These initialize a new instance of ths class with needed informations for work.
-
- @seealso using at owner
-
- @param -
- @return -
-
- @onerror -
- *//*-*****************************************************************************************************/
-
- OPlugInFrameDispatcher( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ,
- const css::uno::Reference< css::mozilla::XPluginInstance >& xOwner ,
- const css::uno::Reference< css::mozilla::XPluginInstancePeer >& xPlugInDLL );
-
- //---------------------------------------------------------------------------------------------------------
- // XInterface
- //---------------------------------------------------------------------------------------------------------
-
- DECLARE_XINTERFACE
-
- //---------------------------------------------------------------------------------------------------------
- // XDispatchProvider
- //---------------------------------------------------------------------------------------------------------
-
- /*-****************************************************************************************************//**
- @short search a dispatcher for given URL
- @descr If no interceptor is set on owner, we search for right frame and dispatch URL to it.
- If no frame was found, we do nothing.
-
- @seealso -
-
- @param "aURL" , URL to dispatch.
- @param "sTargetFrameName" , name of searched frame.
- @param "nSearchFlags" , flags for searching.
- @return A reference a dispatcher for these URL (if someone was found!).
-
- @onerror We return a NULL-reference.
- *//*-*****************************************************************************************************/
-
- 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 );
-
- /*-****************************************************************************************************//**
- @short search dispatcher for more the one URL
- @descr Call this method, if you search dispatcher for more then one URL at the same time.
- ( But these mode is not supported yet! )
-
- @seealso -
-
- @param "seqDescripts", descriptor to search more then one dispatcher.
- @return A list of founded dispatcher. (if somewhere exist!)
-
- @onerror An empty list is returned.
- *//*-*****************************************************************************************************/
-
- virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& seqDescripts ) throw( css::uno::RuntimeException );
-
- //---------------------------------------------------------------------------------------------------------
- // XDispatch
- //---------------------------------------------------------------------------------------------------------
-
- /*-****************************************************************************************************//**
- @short dispatch URL with arguments
- @descr This class implement XDispatch interface to. We use the implementation of ouer owner
- directly to do this. He must support a function impl_loadComponent().
-
- @seealso methode <owner>::impl_loadComponent()
-
- @param "aURL" , URL to dispatch.
- @param "seqArguments" , list of optional arguments.
- @return -
-
- @onerror -
- *//*-*****************************************************************************************************/
-
- virtual void SAL_CALL dispatch( const css::util::URL& aURL ,
- const css::uno::Sequence< css::beans::PropertyValue >& seqArguments) throw( css::uno::RuntimeException );
-
- /*-****************************************************************************************************//**
- @short add listener for state events
- @descr -
-
- @seealso -
-
- @param "xControl" , reference to a valid listener for state events.
- @param "aURL" , URL about listener will be informed, if something occured.
- @return -
-
- @onerror -
- *//*-*****************************************************************************************************/
-
- virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl,
- const css::util::URL& aURL ) throw( css::uno::RuntimeException );
-
- /*-****************************************************************************************************//**
- @short remove listener
- @descr -
-
- @seealso -
-
- @param "xControl" , reference to a valid listener.
- @param "aURL" , URL on which listener has registered.
- @return -
-
- @onerror -
- *//*-*****************************************************************************************************/
-
- virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl,
- const css::util::URL& aURL ) throw( css::uno::RuntimeException );
-
- //---------------------------------------------------------------------------------------------------------
- // XPluginInstanceNotifySink
- //---------------------------------------------------------------------------------------------------------
-
- /*-****************************************************************************************************//**
- @short -
- @descr -
-
- @seealso -
-
- @param -
- @param -
- @return -
-
- @onerror -
- *//*-*****************************************************************************************************/
-
- void SAL_CALL notifyURL( const ::rtl::OUString& sURL ) throw( css::uno::RuntimeException );
-
- //-------------------------------------------------------------------------------------------------------------
- // protected methods
- //-------------------------------------------------------------------------------------------------------------
-
- protected:
-
- /*-****************************************************************************************************//**
- @short standard destructor
- @descr This method destruct an instance of this class and clear some member.
- This method is protected, because its not allowed to use an instance of this class as a member!
- You MUST use a pointer.
-
- @seealso -
-
- @param -
- @return -
-
- @onerror -
- *//*-*****************************************************************************************************/
-
- virtual ~OPlugInFrameDispatcher();
-
- //-------------------------------------------------------------------------------------------------------------
- // private methods
- //-------------------------------------------------------------------------------------------------------------
-
- private:
-
- /*-****************************************************************************************************//**
- @short -
- @descr -
-
- @seealso -
-
- @param -
- @return -
-
- @onerror -
- *//*-*****************************************************************************************************/
-
- void impl_sendStatusEvent( const ::rtl::OUString& sURL ,
- sal_Bool bLoadingSuccessful );
-
- //-------------------------------------------------------------------------------------------------------------
- // debug methods
- // (should be private everyway!)
- //-------------------------------------------------------------------------------------------------------------
-
- /*-****************************************************************************************************//**
- @short debug-method to check incoming parameter of some other mehods of this class
- @descr The following methods are used to check parameters for other methods
- of this class. The return value is used directly for an ASSERT(...).
-
- @seealso ASSERTs in implementation!
-
- @param references to checking variables
- @return sal_False on invalid parameter<BR>
- sal_True otherway
-
- @onerror -
- *//*-*****************************************************************************************************/
-
- #ifdef ENABLE_ASSERTIONS
-
- private:
-
- static sal_Bool impldbg_checkParameter_OPlugInFrameDispatcherCtor ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ,
- const css::uno::Reference< css::mozilla::XPluginInstance >& xOwner ,
- const css::uno::Reference< css::mozilla::XPluginInstancePeer >& xPlugInDLL );
- static sal_Bool impldbg_checkParameter_queryDispatch ( const css::util::URL& aURL ,
- const ::rtl::OUString& sTargetFrameName ,
- sal_Int32 nSearchFlags );
- static sal_Bool impldbg_checkParameter_queryDispatches ( const css::uno::Sequence< css::frame::DispatchDescriptor >& seqDescriptor );
- static sal_Bool impldbg_checkParameter_dispatch ( const css::util::URL& aURL ,
- const css::uno::Sequence< css::beans::PropertyValue >& seqArguments );
- static sal_Bool impldbg_checkParameter_addStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& xControl ,
- const css::util::URL& aURL );
- static sal_Bool impldbg_checkParameter_removeStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& xControl ,
- const css::util::URL& aURL );
- static sal_Bool impldbg_checkParameter_notifyURL ( const ::rtl::OUString& sURL );
-
- #endif // #ifdef ENABLE_ASSERTIONS
-
- //-------------------------------------------------------------------------------------------------------------
- // variables
- // (should be private everyway!)
- //-------------------------------------------------------------------------------------------------------------
-
- private:
-
- css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory ; /// servicemanager to create uno services
- css::uno::WeakReference< css::mozilla::XPluginInstance > m_xOwnerWeak ; /// weakreference to owner (Don't use a hard reference. Owner can't delete us then!)
- css::uno::Reference< css::mozilla::XPluginInstancePeer > m_xPlugInDLL ; /// Interface for communication with browser.
- ::rtl::OUString m_sTargetFrameName ; /// We need it as target for get/postURL.
- IMPL_ListenerContainerHelper m_aListenerContainer ; /// Container to combine listeners and URLs.
-
-}; // class OPlugInFrameDispatcher
-
-} // namespace framework
-
-#endif // #ifndef __FRAMEWORK_HELPER_OPLUGINFRAMEDISPATCHER_HXX_
diff --git a/framework/inc/helper/popupmenucontrollerbase.hxx b/framework/inc/helper/popupmenucontrollerbase.hxx
index 760a59c6d096..25d308a72641 100644
--- a/framework/inc/helper/popupmenucontrollerbase.hxx
+++ b/framework/inc/helper/popupmenucontrollerbase.hxx
@@ -56,7 +56,7 @@
#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
//_________________________________________________________________________________________________________________
@@ -93,7 +93,7 @@ namespace framework
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) = 0;
+ 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
@@ -127,8 +127,11 @@ namespace framework
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;
@@ -136,6 +139,7 @@ namespace framework
::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
};
diff --git a/framework/inc/helper/uiconfigelementwrapperbase.hxx b/framework/inc/helper/uiconfigelementwrapperbase.hxx
index d3006ae75602..2069f6b983f0 100644
--- a/framework/inc/helper/uiconfigelementwrapperbase.hxx
+++ b/framework/inc/helper/uiconfigelementwrapperbase.hxx
@@ -52,6 +52,7 @@
#include <com/sun/star/util/XUpdatable.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
//_________________________________________________________________________________________________________________
// other includes
@@ -80,7 +81,7 @@ class UIConfigElementWrapperBase : public ::com::sun::star::lang::XTypeProvider
// public methods
//-------------------------------------------------------------------------------------------------------------
public:
- UIConfigElementWrapperBase( sal_Int16 nType );
+ UIConfigElementWrapperBase( sal_Int16 nType,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xServiceFactory );
virtual ~UIConfigElementWrapperBase();
//---------------------------------------------------------------------------------------------------------
@@ -99,8 +100,8 @@ class UIConfigElementWrapperBase : public ::com::sun::star::lang::XTypeProvider
// XUIElementSettings
virtual void SAL_CALL updateSettings() throw (::com::sun::star::uno::RuntimeException) = 0;
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getSettings( sal_Bool bWriteable ) throw (::com::sun::star::uno::RuntimeException) = 0;
- virtual void SAL_CALL setSettings( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& UISettings ) throw (::com::sun::star::uno::RuntimeException) = 0;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getSettings( sal_Bool bWriteable ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setSettings( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& UISettings ) throw (::com::sun::star::uno::RuntimeException);
// XUIElement
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getRealInterface() throw (::com::sun::star::uno::RuntimeException) = 0;
@@ -135,6 +136,8 @@ class UIConfigElementWrapperBase : public ::com::sun::star::lang::XTypeProvider
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
virtual ::com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw (::com::sun::star::uno::RuntimeException);
+ virtual void impl_fillNewData();
+
static const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > impl_getStaticPropertyDescriptor();
sal_Int16 m_nType;
@@ -145,6 +148,7 @@ class UIConfigElementWrapperBase : public ::com::sun::star::lang::XTypeProvider
m_bDisposed : 1,
m_bNoClose : 1;
rtl::OUString m_aResourceURL;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory;
com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xConfigSource;
com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > m_xConfigData;
com::sun::star::uno::WeakReference< com::sun::star::frame::XFrame > m_xWeakFrame;
diff --git a/framework/inc/interaction/preventduplicateinteraction.hxx b/framework/inc/interaction/preventduplicateinteraction.hxx
index af4c7c857075..2b43ab02fcdc 100644
--- a/framework/inc/interaction/preventduplicateinteraction.hxx
+++ b/framework/inc/interaction/preventduplicateinteraction.hxx
@@ -85,8 +85,8 @@ struct ThreadHelpBase2
mutable ::osl::Mutex m_aLock;
};
-class PreventDuplicateInteraction : public ::cppu::WeakImplHelper1< css::task::XInteractionHandler >
- , private ThreadHelpBase2
+class PreventDuplicateInteraction : private ThreadHelpBase2
+ ,public ::cppu::WeakImplHelper1< css::task::XInteractionHandler >
{
//_____________________________________
// structs, types etcp.
diff --git a/framework/inc/interaction/stillinteraction.hxx b/framework/inc/interaction/quietinteraction.hxx
index d77ebe462043..d45d1b97580e 100644
--- a/framework/inc/interaction/stillinteraction.hxx
+++ b/framework/inc/interaction/quietinteraction.hxx
@@ -28,8 +28,8 @@
*
************************************************************************/
-#ifndef __FRAMEWORK_INTERACTION_STILLINTERACTION_HXX_
-#define __FRAMEWORK_INTERACTION_STILLINTERACTION_HXX_
+#ifndef __FRAMEWORK_INTERACTION_QUIETINTERACTION_HXX_
+#define __FRAMEWORK_INTERACTION_QUIETINTERACTION_HXX_
//_________________________________________________________________________________________________________________
// my own includes
@@ -80,7 +80,7 @@ namespace framework{
@modified 12.07.2002 14:06
@by Andreas Schlns
*/
-class StillInteraction : public css::lang::XTypeProvider
+class QuietInteraction : public css::lang::XTypeProvider
, public css::task::XInteractionHandler
, private ThreadHelpBase
, public ::cppu::OWeakObject
@@ -130,7 +130,7 @@ class StillInteraction : public css::lang::XTypeProvider
@threadsafe not neccessary
*/
- StillInteraction();
+ QuietInteraction();
//_________________________________
/**
diff --git a/framework/inc/jobs/helponstartup.hxx b/framework/inc/jobs/helponstartup.hxx
index 4525284f6c1c..8711396af24b 100644
--- a/framework/inc/jobs/helponstartup.hxx
+++ b/framework/inc/jobs/helponstartup.hxx
@@ -41,7 +41,7 @@
//_______________________________________________
// other includes
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase3.hxx>
//_______________________________________________
// uno includes
@@ -66,12 +66,8 @@ namespace framework{
@author as96863
*/
-class HelpOnStartup : public css::lang::XTypeProvider
- , public css::lang::XServiceInfo
- , public css::task::XJob
- , public css::lang::XEventListener
- , private ThreadHelpBase
- , public ::cppu::OWeakObject
+class HelpOnStartup : private ThreadHelpBase
+ ,public ::cppu::WeakImplHelper3< ::com::sun::star::lang::XServiceInfo,::com::sun::star::lang::XEventListener,::com::sun::star::task::XJob >
{
//-------------------------------------------
// member
@@ -132,11 +128,7 @@ class HelpOnStartup : public css::lang::XTypeProvider
public:
//---------------------------------------
- // css.uno.XInterface
- // css.lang.XTypeProvider
// css.lang.XServiceInfo
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
// css.task.XJob
diff --git a/framework/inc/jobs/shelljob.hxx b/framework/inc/jobs/shelljob.hxx
index ff70fadb9f4e..1150d35078b8 100644
--- a/framework/inc/jobs/shelljob.hxx
+++ b/framework/inc/jobs/shelljob.hxx
@@ -41,7 +41,7 @@
//_______________________________________________
// other includes
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase2.hxx>
//_______________________________________________
// uno includes
@@ -71,11 +71,8 @@ namespace framework{
@author as96863
*/
-class ShellJob : public css::lang::XTypeProvider
- , public css::lang::XServiceInfo
- , public css::task::XJob
- , private ThreadHelpBase
- , public ::cppu::OWeakObject
+class ShellJob : private ThreadHelpBase
+ ,public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo,::com::sun::star::task::XJob >
{
//-------------------------------------------
// member
@@ -112,11 +109,7 @@ class ShellJob : public css::lang::XTypeProvider
public:
//---------------------------------------
- // css.uno.XInterface
- // css.lang.XTypeProvider
// css.lang.XServiceInfo
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
// css.task.XJob
diff --git a/framework/inc/macros/debug/memorymeasure.hxx b/framework/inc/macros/debug/memorymeasure.hxx
index 4ed702429be2..bfc5f5ff5791 100644
--- a/framework/inc/macros/debug/memorymeasure.hxx
+++ b/framework/inc/macros/debug/memorymeasure.hxx
@@ -111,7 +111,7 @@
{
::rtl::OStringBuffer sBuffer( 10000 );
- if( m_lSnapshots.size() > 0 )
+ if( !m_lSnapshots.empty() )
{
// Write informations to return buffer
::std::vector< _MemoryInfo >::const_iterator pItem1;
diff --git a/framework/inc/macros/xserviceinfo.hxx b/framework/inc/macros/xserviceinfo.hxx
index c375fe43dfab..45d72ee8bfee 100644
--- a/framework/inc/macros/xserviceinfo.hxx
+++ b/framework/inc/macros/xserviceinfo.hxx
@@ -55,7 +55,9 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <cppuhelper/factory.hxx>
+#include <comphelper/sequence.hxx>
#include <rtl/ustring.hxx>
+#include <rtl/logfile.hxx>
//_________________________________________________________________________________________________________________
// namespace
@@ -93,29 +95,7 @@ ________________________________________________________________________________
/*===========================================================================================================*/ \
sal_Bool SAL_CALL CLASS::supportsService( const ::rtl::OUString& sServiceName ) throw( css::uno::RuntimeException ) \
{ \
- /* Set default return value. */ \
- sal_Bool bReturn = sal_False ; \
- /* Get names of all supported servicenames. */ \
- css::uno::Sequence< ::rtl::OUString > seqServiceNames = getSupportedServiceNames(); \
- const ::rtl::OUString* pArray = seqServiceNames.getConstArray(); \
- sal_Int32 nCounter = 0; \
- sal_Int32 nLength = seqServiceNames.getLength(); \
- /* Search for right name in list. */ \
- while ( \
- ( nCounter < nLength ) && \
- ( bReturn == sal_False ) \
- ) \
- { \
- /* Is name was found, say "YES, SERVICE IS SUPPORTED." and break loop. */ \
- if ( pArray[nCounter] == sServiceName ) \
- { \
- bReturn = sal_True ; \
- } \
- /* Else step to next element in list. */ \
- ++nCounter; \
- } \
- /* Return state of search. */ \
- return bReturn; \
+ return ::comphelper::findValue(getSupportedServiceNames(), sServiceName, sal_True).getLength() != 0; \
} \
\
/*===========================================================================================================*/ \
@@ -155,6 +135,7 @@ ________________________________________________________________________________
/*===========================================================================================================*/ \
css::uno::Reference< css::uno::XInterface > SAL_CALL CLASS::impl_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ) throw( css::uno::Exception ) \
{ \
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework","Ocke.Janssen@sun.com",U2B(IMPLEMENTATIONNAME).getStr()); \
/* create new instance of service */ \
CLASS* pClass = new CLASS( xServiceManager ); \
/* hold it alive by increasing his ref count!!! */ \
diff --git a/framework/inc/mediadescriptor.h b/framework/inc/mediadescriptor.h
index d4e29db30c7d..6c544d11c1d1 100644
--- a/framework/inc/mediadescriptor.h
+++ b/framework/inc/mediadescriptor.h
@@ -36,44 +36,44 @@
namespace framework{
-static const ::rtl::OUString MEDIADESCRIPTOR_ASTEMPLATE = ::rtl::OUString::createFromAscii("AsTemplate" );
-static const ::rtl::OUString MEDIADESCRIPTOR_CHARACTERSET = ::rtl::OUString::createFromAscii("CharacterSet" );
-static const ::rtl::OUString MEDIADESCRIPTOR_DEEPDETECTION = ::rtl::OUString::createFromAscii("DeepDetection" );
-static const ::rtl::OUString MEDIADESCRIPTOR_DETECTSERVICE = ::rtl::OUString::createFromAscii("DetectService" );
-static const ::rtl::OUString MEDIADESCRIPTOR_EXTENSION = ::rtl::OUString::createFromAscii("Extension" );
-static const ::rtl::OUString MEDIADESCRIPTOR_FILENAME = ::rtl::OUString::createFromAscii("FileName" ); // deprecated!
-static const ::rtl::OUString MEDIADESCRIPTOR_FILTERNAME = ::rtl::OUString::createFromAscii("FilterName" );
-static const ::rtl::OUString MEDIADESCRIPTOR_FILTEROPTIONS = ::rtl::OUString::createFromAscii("FilterOptions" );
-static const ::rtl::OUString MEDIADESCRIPTOR_FORMAT = ::rtl::OUString::createFromAscii("Format" );
-static const ::rtl::OUString MEDIADESCRIPTOR_FRAMENAME = ::rtl::OUString::createFromAscii("FrameName" );
-static const ::rtl::OUString MEDIADESCRIPTOR_HIDDEN = ::rtl::OUString::createFromAscii("Hidden" );
-static const ::rtl::OUString MEDIADESCRIPTOR_INPUTSTREAM = ::rtl::OUString::createFromAscii("InputStream" );
-static const ::rtl::OUString MEDIADESCRIPTOR_INTERACTIONHANDLER = ::rtl::OUString::createFromAscii("InteractionHandler");
-static const ::rtl::OUString MEDIADESCRIPTOR_JUMPMARK = ::rtl::OUString::createFromAscii("JumpMark" );
-static const ::rtl::OUString MEDIADESCRIPTOR_MACROEXECUTIONMODE = ::rtl::OUString::createFromAscii("MacroExecutionMode");
-static const ::rtl::OUString MEDIADESCRIPTOR_MEDIATYPE = ::rtl::OUString::createFromAscii("MediaType" );
-static const ::rtl::OUString MEDIADESCRIPTOR_MINIMIZED = ::rtl::OUString::createFromAscii("Minimized" );
-static const ::rtl::OUString MEDIADESCRIPTOR_OPENNEWVIEW = ::rtl::OUString::createFromAscii("OpenNewView" );
-static const ::rtl::OUString MEDIADESCRIPTOR_OUTPUTSTREAM = ::rtl::OUString::createFromAscii("OutputStream" );
-static const ::rtl::OUString MEDIADESCRIPTOR_PATTERN = ::rtl::OUString::createFromAscii("Pattern" );
-static const ::rtl::OUString MEDIADESCRIPTOR_POSSIZE = ::rtl::OUString::createFromAscii("PosSize" );
-static const ::rtl::OUString MEDIADESCRIPTOR_POSTDATA = ::rtl::OUString::createFromAscii("PostData" );
-static const ::rtl::OUString MEDIADESCRIPTOR_POSTSTRING = ::rtl::OUString::createFromAscii("PostString" );
-static const ::rtl::OUString MEDIADESCRIPTOR_PREVIEW = ::rtl::OUString::createFromAscii("Preview" );
-static const ::rtl::OUString MEDIADESCRIPTOR_READONLY = ::rtl::OUString::createFromAscii("ReadOnly" );
-static const ::rtl::OUString MEDIADESCRIPTOR_REFERRER = ::rtl::OUString::createFromAscii("Referer" );
-static const ::rtl::OUString MEDIADESCRIPTOR_SILENT = ::rtl::OUString::createFromAscii("Silent" );
-static const ::rtl::OUString MEDIADESCRIPTOR_STATUSINDICATOR = ::rtl::OUString::createFromAscii("StatusIndicator" );
-static const ::rtl::OUString MEDIADESCRIPTOR_TEMPLATENAME = ::rtl::OUString::createFromAscii("TemplateName" );
-static const ::rtl::OUString MEDIADESCRIPTOR_TEMPLATEREGIONNAME = ::rtl::OUString::createFromAscii("TemplateRegionName");
-static const ::rtl::OUString MEDIADESCRIPTOR_TYPENAME = ::rtl::OUString::createFromAscii("TypeName" );
-static const ::rtl::OUString MEDIADESCRIPTOR_UPDATEDOCMODE = ::rtl::OUString::createFromAscii("UpdateDocMode" );
-static const ::rtl::OUString MEDIADESCRIPTOR_URL = ::rtl::OUString::createFromAscii("URL" );
-static const ::rtl::OUString MEDIADESCRIPTOR_VERSION = ::rtl::OUString::createFromAscii("Version" );
-static const ::rtl::OUString MEDIADESCRIPTOR_VIEWID = ::rtl::OUString::createFromAscii("ViewId" );
-static const ::rtl::OUString MEDIADESCRIPTOR_REPAIRPACKAGE = ::rtl::OUString::createFromAscii("RepairPackage" );
-static const ::rtl::OUString MEDIADESCRIPTOR_DOCUMENTTITLE = ::rtl::OUString::createFromAscii("DocumentTitle" );
-static const ::rtl::OUString MEDIADESCRIPTOR_MODEL = ::rtl::OUString::createFromAscii("Model" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_ASTEMPLATE = ::rtl::OUString::createFromAscii("AsTemplate" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_CHARACTERSET = ::rtl::OUString::createFromAscii("CharacterSet" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_DEEPDETECTION = ::rtl::OUString::createFromAscii("DeepDetection" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_DETECTSERVICE = ::rtl::OUString::createFromAscii("DetectService" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_EXTENSION = ::rtl::OUString::createFromAscii("Extension" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_FILENAME = ::rtl::OUString::createFromAscii("FileName" ); // deprecated!
+//static const ::rtl::OUString MEDIADESCRIPTOR_FILTERNAME = ::rtl::OUString::createFromAscii("FilterName" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_FILTEROPTIONS = ::rtl::OUString::createFromAscii("FilterOptions" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_FORMAT = ::rtl::OUString::createFromAscii("Format" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_FRAMENAME = ::rtl::OUString::createFromAscii("FrameName" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_HIDDEN = ::rtl::OUString::createFromAscii("Hidden" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_INPUTSTREAM = ::rtl::OUString::createFromAscii("InputStream" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_INTERACTIONHANDLER = ::rtl::OUString::createFromAscii("InteractionHandler");
+//static const ::rtl::OUString MEDIADESCRIPTOR_JUMPMARK = ::rtl::OUString::createFromAscii("JumpMark" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_MACROEXECUTIONMODE = ::rtl::OUString::createFromAscii("MacroExecutionMode");
+//static const ::rtl::OUString MEDIADESCRIPTOR_MEDIATYPE = ::rtl::OUString::createFromAscii("MediaType" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_MINIMIZED = ::rtl::OUString::createFromAscii("Minimized" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_OPENNEWVIEW = ::rtl::OUString::createFromAscii("OpenNewView" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_OUTPUTSTREAM = ::rtl::OUString::createFromAscii("OutputStream" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_PATTERN = ::rtl::OUString::createFromAscii("Pattern" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_POSSIZE = ::rtl::OUString::createFromAscii("PosSize" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_POSTDATA = ::rtl::OUString::createFromAscii("PostData" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_POSTSTRING = ::rtl::OUString::createFromAscii("PostString" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_PREVIEW = ::rtl::OUString::createFromAscii("Preview" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_READONLY = ::rtl::OUString::createFromAscii("ReadOnly" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_REFERRER = ::rtl::OUString::createFromAscii("Referer" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_SILENT = ::rtl::OUString::createFromAscii("Silent" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_STATUSINDICATOR = ::rtl::OUString::createFromAscii("StatusIndicator" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_TEMPLATENAME = ::rtl::OUString::createFromAscii("TemplateName" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_TEMPLATEREGIONNAME = ::rtl::OUString::createFromAscii("TemplateRegionName");
+//static const ::rtl::OUString MEDIADESCRIPTOR_TYPENAME = ::rtl::OUString::createFromAscii("TypeName" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_UPDATEDOCMODE = ::rtl::OUString::createFromAscii("UpdateDocMode" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_URL = ::rtl::OUString::createFromAscii("URL" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_VERSION = ::rtl::OUString::createFromAscii("Version" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_VIEWID = ::rtl::OUString::createFromAscii("ViewId" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_REPAIRPACKAGE = ::rtl::OUString::createFromAscii("RepairPackage" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_DOCUMENTTITLE = ::rtl::OUString::createFromAscii("DocumentTitle" );
+//static const ::rtl::OUString MEDIADESCRIPTOR_MODEL = ::rtl::OUString::createFromAscii("Model" );
} // namespace framework
diff --git a/framework/inc/services.h b/framework/inc/services.h
index 8ad7c529015e..e9f3e1bfe3ce 100644
--- a/framework/inc/services.h
+++ b/framework/inc/services.h
@@ -135,17 +135,17 @@ namespace framework{
#define IMPLEMENTATIONNAME_FRAME DECLARE_ASCII("com.sun.star.comp.framework.Frame" )
#define IMPLEMENTATIONNAME_DESKTOP DECLARE_ASCII("com.sun.star.comp.framework.Desktop" )
#define IMPLEMENTATIONNAME_TASK DECLARE_ASCII("com.sun.star.comp.framework.Task" )
-#define IMPLEMENTATIONNAME_FRAMELOADERFACTORY DECLARE_ASCII("com.sun.star.comp.framework.FrameLoaderFactory" )
-#define IMPLEMENTATIONNAME_FILTERFACTORY DECLARE_ASCII("com.sun.star.comp.framework.FilterFactory" )
+//#define IMPLEMENTATIONNAME_FRAMELOADERFACTORY DECLARE_ASCII("com.sun.star.comp.framework.FrameLoaderFactory" )
+//#define IMPLEMENTATIONNAME_FILTERFACTORY DECLARE_ASCII("com.sun.star.comp.framework.FilterFactory" )
#define IMPLEMENTATIONNAME_URLTRANSFORMER DECLARE_ASCII("com.sun.star.comp.framework.URLTransformer" )
-#define IMPLEMENTATIONNAME_PLUGINFRAME DECLARE_ASCII("com.sun.star.comp.framework.PluginFrame" )
+// #define IMPLEMENTATIONNAME_PLUGINFRAME DECLARE_ASCII("com.sun.star.comp.framework.PluginFrame" )
#define IMPLEMENTATIONNAME_GENERICFRAMELOADER DECLARE_ASCII("com.sun.star.comp.office.FrameLoader" )
#define IMPLEMENTATIONNAME_MEDIATYPEDETECTIONHELPER DECLARE_ASCII("com.sun.star.comp.framework.MediaTypeDetectionHelper")
-#define IMPLEMENTATIONNAME_LOGINDIALOG DECLARE_ASCII("com.sun.star.comp.framework.LoginDialog" )
-#define IMPLEMENTATIONNAME_TYPEDETECTION DECLARE_ASCII("com.sun.star.comp.framework.TypeDetection" )
-#define IMPLEMENTATIONNAME_DOCUMENTPROPERTIES DECLARE_ASCII("com.sun.star.comp.framework.DocumentProperties" )
+//#define IMPLEMENTATIONNAME_LOGINDIALOG DECLARE_ASCII("com.sun.star.comp.framework.LoginDialog" )
+//#define IMPLEMENTATIONNAME_TYPEDETECTION DECLARE_ASCII("com.sun.star.comp.framework.TypeDetection" )
+//#define IMPLEMENTATIONNAME_DOCUMENTPROPERTIES DECLARE_ASCII("com.sun.star.comp.framework.DocumentProperties" )
#define IMPLEMENTATIONNAME_OXT_HANDLER DECLARE_ASCII("com.sun.star.comp.framework.OXTFileHandler" )
-#define IMPLEMENTATIONNAME_CONTENTHANDLERFACTORY DECLARE_ASCII("com.sun.star.comp.framework.ContentHandlerFactory" )
+//#define IMPLEMENTATIONNAME_CONTENTHANDLERFACTORY DECLARE_ASCII("com.sun.star.comp.framework.ContentHandlerFactory" )
#define IMPLEMENTATIONNAME_SFXTERMINATOR DECLARE_ASCII("com.sun.star.comp.sfx2.SfxTerminateListener" )
#define IMPLEMENTATIONNAME_PIPETERMINATOR DECLARE_ASCII("com.sun.star.comp.OfficeIPCThreadController" )
#define IMPLEMENTATIONNAME_QUICKLAUNCHER DECLARE_ASCII("com.sun.star.comp.desktop.QuickstartWrapper" )
@@ -160,13 +160,13 @@ namespace framework{
#define IMPLEMENTATIONNAME_PATHSETTINGS DECLARE_ASCII("com.sun.star.comp.framework.PathSettings" )
#define IMPLEMENTATIONNAME_JOBDISPATCH DECLARE_ASCII("com.sun.star.comp.framework.jobs.JobDispatch" )
#define IMPLEMENTATIONNAME_DISPATCHHELPER DECLARE_ASCII("com.sun.star.comp.framework.services.DispatchHelper" )
-#define IMPLEMENTATIONNAME_DETECTORFACTORY DECLARE_ASCII("com.sun.star.comp.framework.DetectorFactory" )
+//#define IMPLEMENTATIONNAME_DETECTORFACTORY DECLARE_ASCII("com.sun.star.comp.framework.DetectorFactory" )
#define IMPLEMENTATIONNAME_LAYOUTMANAGER DECLARE_ASCII("com.sun.star.comp.framework.LayoutManager" )
#define IMPLEMENTATIONNAME_POPUPMENUCONTROLLERFACTORY DECLARE_ASCII("com.sun.star.comp.framework.PopupMenuControllerFactory" )
#define IMPLEMENTATIONNAME_MACROSMENUCONTROLLER DECLARE_ASCII("com.sun.star.comp.framework.MacrosMenuController" )
#define IMPLEMENTATIONNAME_FONTMENUCONTROLLER DECLARE_ASCII("com.sun.star.comp.framework.FontMenuController" )
#define IMPLEMENTATIONNAME_FONTSIZEMENUCONTROLLER DECLARE_ASCII("com.sun.star.comp.framework.FontSizeMenuController" )
-#define IMPLEMENTATIONNAME_FORMATMENUCONTROLLER DECLARE_ASCII("com.sun.star.comp.framework.FormatMenuController" )
+// #define IMPLEMENTATIONNAME_FORMATMENUCONTROLLER DECLARE_ASCII("com.sun.star.comp.framework.FormatMenuController" )
#define IMPLEMENTATIONNAME_OBJECTMENUCONTROLLER DECLARE_ASCII("com.sun.star.comp.framework.ObjectMenuController" )
#define IMPLEMENTATIONNAME_HEADERMENUCONTROLLER DECLARE_ASCII("com.sun.star.comp.framework.HeaderMenuController" )
#define IMPLEMENTATIONNAME_FOOTERMENUCONTROLLER DECLARE_ASCII("com.sun.star.comp.framework.FooterMenuController" )
diff --git a/framework/inc/services/desktop.hxx b/framework/inc/services/desktop.hxx
index 04623d369f82..92c575c7b5b5 100644
--- a/framework/inc/services/desktop.hxx
+++ b/framework/inc/services/desktop.hxx
@@ -440,13 +440,8 @@ class Desktop : // interfaces
private:
static sal_Bool implcp_ctor ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory );
- static sal_Bool implcp_addTerminateListener ( const css::uno::Reference< css::frame::XTerminateListener >& xListener );
- static sal_Bool implcp_removeTerminateListener ( const css::uno::Reference< css::frame::XTerminateListener >& xListener );
- static sal_Bool implcp_findFrame ( const ::rtl::OUString& sTargetFrameName ,
- sal_Int32 nSearchFlags );
static sal_Bool implcp_addEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener );
static sal_Bool implcp_removeEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener );
- static sal_Bool implcp_statusChanged ( const css::frame::FeatureStateEvent& aEvent );
sal_Bool m_bIsTerminated ; /// check flag to protect us against dispose before terminate!
/// see dispose() for further informations!
diff --git a/framework/inc/services/dispatchhelper.hxx b/framework/inc/services/dispatchhelper.hxx
index 3bd5a15c25db..31304a212fd0 100644
--- a/framework/inc/services/dispatchhelper.hxx
+++ b/framework/inc/services/dispatchhelper.hxx
@@ -51,7 +51,7 @@
//_______________________________________________
// other includes
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase3.hxx>
#include <osl/conditn.hxx>
//_______________________________________________
@@ -74,12 +74,8 @@ namespace framework{
All these steps are done inside one method call here.
*/
-class DispatchHelper : public css::lang::XTypeProvider
- , public css::lang::XServiceInfo
- , public css::frame::XDispatchHelper
- , public css::frame::XDispatchResultListener // => XEventListener
- , public ThreadHelpBase // must be the first base class!
- , public ::cppu::OWeakObject // => XInterface, XWeak
+class DispatchHelper : public ThreadHelpBase // must be the first base class!
+ ,public ::cppu::WeakImplHelper3< ::com::sun::star::lang::XServiceInfo,::com::sun::star::frame::XDispatchHelper,::com::sun::star::frame::XDispatchResultListener >
{
//-------------------------------------------
@@ -112,8 +108,6 @@ class DispatchHelper : public css::lang::XTypeProvider
//---------------------------------------
// XInterface, XTypeProvider, XServiceInfo
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
//---------------------------------------
diff --git a/framework/inc/services/frame.hxx b/framework/inc/services/frame.hxx
index 7c48e44693eb..32e83aed1974 100644
--- a/framework/inc/services/frame.hxx
+++ b/framework/inc/services/frame.hxx
@@ -400,13 +400,6 @@ class Frame : // interfaces
static sal_Bool implcp_ctor ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory );
static sal_Bool implcp_setActiveFrame ( const css::uno::Reference< css::frame::XFrame >& xFrame );
- static sal_Bool implcp_initialize ( const css::uno::Reference< css::awt::XWindow >& xWindow );
- static sal_Bool implcp_setCreator ( const css::uno::Reference< css::frame::XFramesSupplier >& xCreator );
- static sal_Bool implcp_setName ( const ::rtl::OUString& sName );
- static sal_Bool implcp_findFrame ( const ::rtl::OUString& sTargetFrameName ,
- sal_Int32 nSearchFlags );
- static sal_Bool implcp_setComponent ( const css::uno::Reference< css::awt::XWindow >& xComponentWindow ,
- const css::uno::Reference< css::frame::XController >& xController );
static sal_Bool implcp_addFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener );
static sal_Bool implcp_removeFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener );
static sal_Bool implcp_addEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener );
diff --git a/framework/inc/services/frameloaderfactory.hxx b/framework/inc/services/frameloaderfactory.hxx
index b6244f81fc73..5fa6ff348ffc 100644
--- a/framework/inc/services/frameloaderfactory.hxx
+++ b/framework/inc/services/frameloaderfactory.hxx
@@ -57,7 +57,7 @@
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase3.hxx>
//_________________________________________________________________________________________________________________
// namespace
@@ -107,12 +107,8 @@ struct tIMPLExtractedArguments
@devstatus deprecated
*//*-*************************************************************************************************************/
-class FrameLoaderFactory : public css::lang::XTypeProvider ,
- public css::lang::XServiceInfo ,
- public css::lang::XMultiServiceFactory ,
- public css::container::XNameAccess , // => XElementAccess
- public ThreadHelpBase , // Struct for right initalization of mutex member! Mst first of baseclasses
- public ::cppu::OWeakObject
+class FrameLoaderFactory : public ThreadHelpBase , // Struct for right initalization of mutex member! Mst first of baseclasses
+ public ::cppu::WeakImplHelper3< ::com::sun::star::lang::XServiceInfo,::com::sun::star::lang::XMultiServiceFactory,::com::sun::star::container::XNameAccess >
{
//-------------------------------------------------------------------------------------------------------------
// public methods
@@ -158,8 +154,6 @@ class FrameLoaderFactory : public css::lang::XTypeProvider ,
// XInterface, XTypeProvider, XServiceInfo
//---------------------------------------------------------------------------------------------------------
- DECLARE_XINTERFACE
- DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
//---------------------------------------------------------------------------------------------------------
diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx
index 8b518f1bda07..86dec1a938bf 100644
--- a/framework/inc/services/layoutmanager.hxx
+++ b/framework/inc/services/layoutmanager.hxx
@@ -397,7 +397,6 @@ namespace framework
SingleRowColumnWindowData& rRowColumnWindowData );
::Point implts_findNextCascadeFloatingPos();
void implts_findNextDockingPos( ::com::sun::star::ui::DockingArea DockingArea, const ::Size& aUIElementSize, ::Point& rVirtualPos, ::Point& rPixelPos );
- void implts_sortActiveElement( const UIElement& aElementData );
::com::sun::star::awt::Rectangle implts_calcDockingAreaSizes();
void implts_setDockingAreaWindowSizes( const com::sun::star::awt::Rectangle& rBorderSpace );
sal_Bool implts_doLayout( sal_Bool bForceRequestBorderSpace );
@@ -428,8 +427,9 @@ namespace framework
sal_Bool impl_parseResourceURL( const rtl::OUString aResourceURL, rtl::OUString& aElementType, rtl::OUString& aElementName );
void implts_notifyListeners( short nEvent, ::com::sun::star::uno::Any aInfoParam );
-
+#ifdef DBG_UTIL
void implts_checkElementContainer();
+#endif
DECL_LINK( OptionsChanged, void* );
DECL_LINK( SettingsChanged, void* );
diff --git a/framework/inc/services/license.hxx b/framework/inc/services/license.hxx
index 9e4cb9197275..66810193f1b3 100644
--- a/framework/inc/services/license.hxx
+++ b/framework/inc/services/license.hxx
@@ -91,7 +91,9 @@ namespace framework
FWK_DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
+#if 0
DECL_STATIC_LINK( License, Terminate, void* );
+#endif
/*
XJob...
diff --git a/framework/inc/services/mediatypedetectionhelper.hxx b/framework/inc/services/mediatypedetectionhelper.hxx
index 7153c1239fa0..4c4ac90a9a2e 100644
--- a/framework/inc/services/mediatypedetectionhelper.hxx
+++ b/framework/inc/services/mediatypedetectionhelper.hxx
@@ -50,8 +50,7 @@
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
-
+#include <cppuhelper/implbase2.hxx>
//_________________________________________________________________________________________________________________
// namespaces
//_________________________________________________________________________________________________________________
@@ -75,10 +74,7 @@ namespace framework{
@devstatus deprecated
*//*-*************************************************************************************************************/
-class MediaTypeDetectionHelper : public css::lang::XTypeProvider
- , public css::lang::XServiceInfo
- , public css::util::XStringMapping
- , public ::cppu::OWeakObject
+class MediaTypeDetectionHelper : public ::cppu::WeakImplHelper2< ::com::sun::star::util::XStringMapping, css::lang::XServiceInfo>
{
//-------------------------------------------------------------------------------------------------------------
// public methods
@@ -122,8 +118,6 @@ class MediaTypeDetectionHelper : public css::lang::XTypeProvider
// XInterface, XTypeProvider, XServiceInfo
//---------------------------------------------------------------------------------------------------------
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
//---------------------------------------------------------------------------------------------------------
diff --git a/framework/inc/services/menudocumenthandler.hxx b/framework/inc/services/menudocumenthandler.hxx
deleted file mode 100644
index 47718f26936a..000000000000
--- a/framework/inc/services/menudocumenthandler.hxx
+++ /dev/null
@@ -1,317 +0,0 @@
-/*************************************************************************
- *
- * 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: menudocumenthandler.hxx,v $
- * $Revision: 1.8 $
- *
- * 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_SERVICES_MENUDOCUMENTHANDLER_HXX_
-#define __FRAMEWORK_SERVICES_MENUDOCUMENTHANDLER_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 <vcl/menu.hxx>
-#include <cppuhelper/weak.hxx>
-
-// #110897#
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-//_________________________________________________________________________________________________________________
-// namespace
-//_________________________________________________________________________________________________________________
-
-namespace framework{
-
-class ReadMenuDocumentHandlerBase : public ::com::sun::star::xml::sax::XDocumentHandler,
- public ThreadHelpBase, // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
-{
- public:
- ReadMenuDocumentHandlerBase();
- virtual ~ReadMenuDocumentHandlerBase();
-
- // XInterface
- virtual void SAL_CALL acquire() throw()
- { OWeakObject::acquire(); }
- virtual void SAL_CALL release() throw()
- { OWeakObject::release(); }
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
- const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
-
- // XDocumentHandler
- virtual void SAL_CALL startDocument(void)
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException ) = 0;
-
- virtual void SAL_CALL endDocument(void)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException ) = 0;
-
- virtual void SAL_CALL startElement(
- const rtl::OUString& aName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &xAttribs)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException ) = 0;
-
- virtual void SAL_CALL endElement(const rtl::OUString& aName)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException ) = 0;
-
- virtual void SAL_CALL characters(const rtl::OUString& aChars)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException ) = 0;
-
- virtual void SAL_CALL ignorableWhitespace(const rtl::OUString& aWhitespaces)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL processingInstruction(const rtl::OUString& aTarget,
- const rtl::OUString& aData)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL setDocumentLocator(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > &xLocator)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- protected:
- ::rtl::OUString getErrorLineString();
-
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > m_xLocator;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler> m_xReader;
-};
-
-
-class OReadMenuDocumentHandler : public ReadMenuDocumentHandlerBase
-{
- public:
- // #110897#
- OReadMenuDocumentHandler(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- MenuBar* pMenuBar );
- virtual ~OReadMenuDocumentHandler();
-
- // #110897#
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& getServiceFactory();
-
- // XDocumentHandler
- virtual void SAL_CALL startDocument(void)
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endDocument(void)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL startElement(
- const rtl::OUString& aName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &xAttribs)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endElement(const rtl::OUString& aName)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL characters(const rtl::OUString& aChars)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- private:
- USHORT m_nItemId;
- int m_nElementDepth;
- sal_Bool m_bMenuBarMode;
- MenuBar* m_pMenuBar;
-
- // #110897#
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& mxServiceFactory;
-}; // OReadMenuDocumentHandler
-
-
-class OReadMenuBarHandler : public ReadMenuDocumentHandlerBase
-{
- public:
- // #110897#
- OReadMenuBarHandler(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- MenuBar* pMenuBar, USHORT* pItemId );
- virtual ~OReadMenuBarHandler();
-
- // #110897#
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& getServiceFactory();
-
- // XDocumentHandler
- virtual void SAL_CALL startDocument(void)
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endDocument(void)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL startElement(
- const rtl::OUString& aName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &xAttribs)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endElement(const rtl::OUString& aName)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL characters(const rtl::OUString& aChars)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- private:
- USHORT* m_pItemId;
- int m_nElementDepth;
- sal_Bool m_bMenuMode;
- MenuBar* m_pMenuBar;
-
- // #110897#
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& mxServiceFactory;
-}; // OReadMenuBarHandler
-
-
-class OReadMenuHandler : public ReadMenuDocumentHandlerBase
-{
- public:
- OReadMenuHandler( Menu* pMenu, USHORT* pItemId );
- virtual ~OReadMenuHandler();
-
- // XDocumentHandler
- virtual void SAL_CALL startDocument(void)
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endDocument(void)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL startElement(
- const rtl::OUString& aName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &xAttribs)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endElement(const rtl::OUString& aName)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL characters(const rtl::OUString& aChars)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- private:
- USHORT* m_pItemId;
- int m_nElementDepth;
- sal_Bool m_bMenuPopupMode;
- Menu* m_pMenu;
-}; // OReadMenuHandler
-
-
-class OReadMenuPopupHandler : public ReadMenuDocumentHandlerBase
-{
- public:
- OReadMenuPopupHandler( Menu* pMenu, USHORT* pItemId );
- virtual ~OReadMenuPopupHandler();
-
- // XDocumentHandler
- virtual void SAL_CALL startDocument(void)
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endDocument(void)
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL startElement(
- const rtl::OUString& aName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > &xAttribs)
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endElement(const rtl::OUString& aName)
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL characters(const rtl::OUString& aChars)
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- private:
- enum NextElementClose { ELEM_CLOSE_NONE, ELEM_CLOSE_MENUITEM, ELEM_CLOSE_MENUSEPARATOR };
-
- int m_nElementDepth;
- USHORT* m_pItemId;
- sal_Bool m_bMenuMode;
- Menu* m_pMenu;
- NextElementClose m_nNextElementExpected;
-}; // OReadMenuPopupHandler
-
-
-class OWriteMenuDocumentHandler
-{
- public:
- OWriteMenuDocumentHandler(
- MenuBar* pMenu,
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > );
- virtual ~OWriteMenuDocumentHandler();
-
- void WriteMenuDocument() throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
- protected:
- virtual void WriteMenu( Menu* pMenu ) throw
- ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void WriteMenuItem( Menu* pMenu, USHORT nItemId );
- virtual void WriteMenuSeparator();
-
- MenuBar* m_pMenuBar;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xWriteDocumentHandler;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > m_xEmptyList;
- ::rtl::OUString m_aAttributeType;
-};
-
-} // namespace framework
-
-#endif // #ifndef __FRAMEWORK_SERVICES_MENUDOCUMENTHANDLER_HXX_
diff --git a/framework/inc/services/popupmenucontrollerfactory.hxx b/framework/inc/services/popupmenucontrollerfactory.hxx
deleted file mode 100644
index 222f8270213e..000000000000
--- a/framework/inc/services/popupmenucontrollerfactory.hxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/*************************************************************************
- *
- * 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: popupmenucontrollerfactory.hxx,v $
- * $Revision: 1.6 $
- *
- * 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_SERVICES_POPUPMENUCONTROLLERFACTORY_HXX_
-#define __FRAMEWORK_SERVICES_POPUPMENUCONTROLLERFACTORY_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/XMultiComponentFactory.hpp>
-#include <com/sun/star/frame/XUIControllerRegistration.hpp>
-
-//_________________________________________________________________________________________________________________
-// other includes
-//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
-#include <rtl/ustring.hxx>
-
-namespace framework
-{
-
-class ConfigurationAccess_PopupMenuControllerFactory;
-class PopupMenuControllerFactory : public com::sun::star::lang::XTypeProvider ,
- public com::sun::star::lang::XServiceInfo ,
- public com::sun::star::lang::XMultiComponentFactory ,
- public ::com::sun::star::frame::XUIControllerRegistration ,
- private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
-{
- public:
- PopupMenuControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
- virtual ~PopupMenuControllerFactory();
-
- // XInterface, XTypeProvider, XServiceInfo
- DECLARE_XINTERFACE
- DECLARE_XTYPEPROVIDER
- DECLARE_XSERVICEINFO
-
- // XMultiComponentFactory
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithContext( const ::rtl::OUString& aServiceSpecifier, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArgumentsAndContext( const ::rtl::OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames() throw (::com::sun::star::uno::RuntimeException);
-
- // XUIControllerRegistration
- virtual sal_Bool SAL_CALL hasController( const ::rtl::OUString& aCommandURL, const rtl::OUString& aModelName ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL registerController( const ::rtl::OUString& aCommandURL, const rtl::OUString& aModelName, const ::rtl::OUString& aControllerImplementationName ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deregisterController( const ::rtl::OUString& aCommandURL, const rtl::OUString& aModelName ) throw (::com::sun::star::uno::RuntimeException);
-
- private:
- sal_Bool m_bConfigRead;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
- ConfigurationAccess_PopupMenuControllerFactory* m_pConfigAccess;
-};
-
-} // namespace framework
-
-#endif // __FRAMEWORK_SERVICES_POPUPMENUCONTROLLERFACTORY_HXX_
diff --git a/framework/inc/services/saxnamespacefilter.hxx b/framework/inc/services/saxnamespacefilter.hxx
deleted file mode 100644
index d1fef98401d8..000000000000
--- a/framework/inc/services/saxnamespacefilter.hxx
+++ /dev/null
@@ -1,119 +0,0 @@
-/*************************************************************************
- *
- * 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: saxnamespacefilter.hxx,v $
- * $Revision: 1.5 $
- *
- * 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_SERVICES_SAXNAMESPACEFILTER_HXX_
-#define __FRAMEWORK_SERVICES_SAXNAMESPACEFILTER_HXX_
-
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-#include <threadhelp/threadhelpbase.hxx>
-#include <classes/xmlnamespaces.hxx>
-
-#ifndef _RTL_USTRING_
-#include <rtl/ustring>
-#endif
-#include <vcl/menu.hxx>
-#include <cppuhelper/weak.hxx>
-
-#include <stack>
-
-//_________________________________________________________________________________________________________________
-// namespace
-//_________________________________________________________________________________________________________________
-
-namespace framework
-{
-
-class SaxNamespaceFilter : public ::com::sun::star::xml::sax::XDocumentHandler,
- public ThreadHelpBase, // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
-{
- public:
- SaxNamespaceFilter( ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler >& rSax1DocumentHandler );
- virtual ~SaxNamespaceFilter();
-
- // XInterface
- virtual void SAL_CALL acquire() throw()
- { OWeakObject::acquire(); }
- virtual void SAL_CALL release() throw()
- { OWeakObject::release(); }
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
- const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
-
- // XDocumentHandler
- virtual void SAL_CALL startDocument(void)
- throw ( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endDocument(void)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL startElement(
- const rtl::OUString& aName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &xAttribs)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL endElement(const rtl::OUString& aName)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL characters(const rtl::OUString& aChars)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL ignorableWhitespace(const rtl::OUString& aWhitespaces)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL processingInstruction(const rtl::OUString& aTarget,
- const rtl::OUString& aData)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL setDocumentLocator(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > &xLocator)
- throw( ::com::sun::star::xml::sax::SAXException,
- ::com::sun::star::uno::RuntimeException );
-
- protected:
- typedef ::std::stack< XMLNamespaces > NamespaceStack;
-
- ::rtl::OUString getErrorLineString();
-
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > m_xLocator;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler> xDocumentHandler;
- NamespaceStack m_aNamespaceStack;
- sal_Int32 m_nDepth;
-};
-
-}
-
-#endif // __FRAMEWORK_SERVICES_SAXNAMESPACEFILTER_HXX_
diff --git a/framework/inc/services/substitutepathvars.hxx b/framework/inc/services/substitutepathvars.hxx
index 96e654c3a151..a95e913695b0 100644
--- a/framework/inc/services/substitutepathvars.hxx
+++ b/framework/inc/services/substitutepathvars.hxx
@@ -59,7 +59,7 @@
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <rtl/ustring.hxx>
#include <unotools/configitem.hxx>
#include <tools/link.hxx>
@@ -236,11 +236,8 @@ struct ReSubstUserVarOrder
typedef std::list< ReSubstFixedVarOrder > ReSubstFixedVarOrderVector;
typedef std::list< ReSubstUserVarOrder > ReSubstUserVarOrderVector;
-class SubstitutePathVariables : public com::sun::star::lang::XTypeProvider ,
- public com::sun::star::lang::XServiceInfo ,
- public com::sun::star::util::XStringSubstitution,
- private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class SubstitutePathVariables : private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper2< ::com::sun::star::util::XStringSubstitution, css::lang::XServiceInfo>
{
friend class SubstitutePathVariables_Impl;
@@ -249,8 +246,6 @@ class SubstitutePathVariables : public com::sun::star::lang::XTypeProvider
virtual ~SubstitutePathVariables();
// XInterface, XTypeProvider, XServiceInfo
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
// XStringSubstitution
diff --git a/framework/inc/services/uriabbreviation.hxx b/framework/inc/services/uriabbreviation.hxx
index 36c9b93e3213..4ba644f1148e 100644
--- a/framework/inc/services/uriabbreviation.hxx
+++ b/framework/inc/services/uriabbreviation.hxx
@@ -40,22 +40,16 @@
#include <com/sun/star/util/XStringAbbreviation.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase2.hxx>
namespace framework
{
-class UriAbbreviation:
- public ::com::sun::star::lang::XTypeProvider,
- public ::com::sun::star::lang::XServiceInfo,
- public ::com::sun::star::util::XStringAbbreviation,
- public ::cppu::OWeakObject // helper implements XInterface, XWeak
+class UriAbbreviation: public ::cppu::WeakImplHelper2< ::com::sun::star::util::XStringAbbreviation, css::lang::XServiceInfo>
{
public:
explicit UriAbbreviation(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & context);
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
// ::com::sun::star::util::XStringAbbreviation:
diff --git a/framework/inc/services/urltransformer.hxx b/framework/inc/services/urltransformer.hxx
index 55e95e71e08b..5c338085b4e8 100644
--- a/framework/inc/services/urltransformer.hxx
+++ b/framework/inc/services/urltransformer.hxx
@@ -54,7 +54,7 @@
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase2.hxx>
//_________________________________________________________________________________________________________________
// namespace
@@ -84,11 +84,7 @@ namespace framework{
OWeakObject
*//*-*************************************************************************************************************/
-class URLTransformer : public css::lang::XTypeProvider ,
- public css::lang::XServiceInfo ,
- public css::util::XURLTransformer ,
- public ThreadHelpBase ,
- public ::cppu::OWeakObject
+class URLTransformer : public ::cppu::WeakImplHelper2< ::com::sun::star::util::XURLTransformer, css::lang::XServiceInfo>
{
//-------------------------------------------------------------------------------------------------------------
// public methods
@@ -132,8 +128,6 @@ class URLTransformer : public css::lang::XTypeProvider ,
// XInterface, XTypeProvider, XServiceInfo
//---------------------------------------------------------------------------------------------------------
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
//---------------------------------------------------------------------------------------------------------
diff --git a/framework/inc/tabwin/tabwinfactory.hxx b/framework/inc/tabwin/tabwinfactory.hxx
index 12fcaab4f30e..fd11854b26ae 100644
--- a/framework/inc/tabwin/tabwinfactory.hxx
+++ b/framework/inc/tabwin/tabwinfactory.hxx
@@ -56,26 +56,21 @@
//_________________________________________________________________________________________________________________
// includes of other projects
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <rtl/ustring.hxx>
namespace framework
{
-class TabWinFactory : public com::sun::star::lang::XTypeProvider ,
- public com::sun::star::lang::XServiceInfo ,
- public com::sun::star::lang::XSingleComponentFactory ,
- protected ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class TabWinFactory : protected ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XSingleComponentFactory, com::sun::star::lang::XServiceInfo>
{
public:
TabWinFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
virtual ~TabWinFactory();
// XInterface, XTypeProvider, XServiceInfo
- FWK_DECLARE_XINTERFACE
DECLARE_XSERVICEINFO
- FWK_DECLARE_XTYPEPROVIDER
// XSingleComponentFactory
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithContext( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
diff --git a/framework/inc/uiconfiguration/imagemanager.hxx b/framework/inc/uiconfiguration/imagemanager.hxx
index e2a23a343455..af2f599a62ae 100644
--- a/framework/inc/uiconfiguration/imagemanager.hxx
+++ b/framework/inc/uiconfiguration/imagemanager.hxx
@@ -38,6 +38,7 @@
#include <vector>
#include <list>
#include <hash_map>
+#include <memory>
//_________________________________________________________________________________________________________________
// my own includes
@@ -68,7 +69,7 @@
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <rtl/ustring.hxx>
@@ -80,16 +81,12 @@
namespace framework
{
- class ImageManager : public com::sun::star::lang::XTypeProvider ,
- public css::lang::XServiceInfo ,
- public ::com::sun::star::ui::XImageManager ,
- private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+ class ImageManagerImpl;
+ class ImageManager : private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper2< ::com::sun::star::ui::XImageManager, css::lang::XServiceInfo>
{
public:
// XInterface, XTypeProvider, XServiceInfo
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
ImageManager( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xServiceManager );
@@ -127,54 +124,7 @@ namespace framework
void setStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& Storage ) throw (::com::sun::star::uno::RuntimeException);
private:
- typedef std::hash_map< rtl::OUString,
- sal_Bool,
- OUStringHashCode,
- ::std::equal_to< ::rtl::OUString > > ImageNameMap;
-
- // private data types
- enum Layer
- {
- LAYER_DEFAULT,
- LAYER_USERDEFINED,
- LAYER_COUNT
- };
-
- enum NotifyOp
- {
- NotifyOp_Remove,
- NotifyOp_Insert,
- NotifyOp_Replace
- };
-
- typedef ::std::vector< ::com::sun::star::ui::ConfigurationEvent > ConfigEventNotifyContainer;
-
- // private methods
- void implts_initialize();
- void implts_notifyContainerListener( const ::com::sun::star::ui::ConfigurationEvent& aEvent, NotifyOp eOp );
- ImageList* implts_getUserImageList( ImageType nImageType );
- sal_Bool implts_loadUserImages( ImageType nImageType,
- const com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& xUserImageStorage,
- const com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& xUserBitmapsStorage );
- sal_Bool implts_storeUserImages( ImageType nImageType,
- const com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& xUserImageStorage,
- const com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& xUserBitmapsStorage );
-
- com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xUserConfigStorage;
- com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xUserImageStorage;
- com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xUserBitmapsStorage;
- bool m_bReadOnly;
- bool m_bInitialized;
- bool m_bModified;
- bool m_bConfigRead;
- bool m_bDisposed;
- rtl::OUString m_aXMLPostfix;
- rtl::OUString m_aModuleIdentifier;
- rtl::OUString m_aResourceString;
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
- ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
- ImageList* m_pUserImageList[ImageType_COUNT];
- bool m_bUserImageListModified[ImageType_COUNT];
+ ::std::auto_ptr<ImageManagerImpl> m_pImpl;
};
}
diff --git a/framework/inc/uiconfiguration/moduleimagemanager.hxx b/framework/inc/uiconfiguration/moduleimagemanager.hxx
index acf992d467f0..c43b9109eb6e 100644
--- a/framework/inc/uiconfiguration/moduleimagemanager.hxx
+++ b/framework/inc/uiconfiguration/moduleimagemanager.hxx
@@ -38,6 +38,7 @@
#include <vector>
#include <list>
#include <hash_map>
+#include <memory>
//_________________________________________________________________________________________________________________
// my own includes
@@ -68,7 +69,7 @@
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <rtl/ustring.hxx>
@@ -80,64 +81,12 @@
namespace framework
{
- class CmdImageList
- {
- public:
- CmdImageList( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rServiceManager,
- const ::rtl::OUString& aModuleIdentifier );
- virtual ~CmdImageList();
-
- virtual Image getImageFromCommandURL( sal_Int16 nImageType, const rtl::OUString& rCommandURL );
- virtual bool hasImage( sal_Int16 nImageType, const rtl::OUString& rCommandURL );
- virtual ::std::vector< rtl::OUString >& getImageNames();
- virtual ::std::vector< rtl::OUString >& getImageCommandNames();
-
- protected:
- void impl_fillCommandToImageNameMap();
- ImageList* impl_getImageList( sal_Int16 nImageType );
- std::vector< ::rtl::OUString >& impl_getImageNameVector();
- std::vector< ::rtl::OUString >& impl_getImageCommandNameVector();
+ class ImageManagerImpl;
- private:
- sal_Bool m_bVectorInit;
- rtl::OUString m_aModuleIdentifier;
- ImageList* m_pImageList[ImageType_COUNT];
- CommandToImageNameMap m_aCommandToImageNameMap;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
- ::std::vector< rtl::OUString > m_aImageNameVector;
- ::std::vector< rtl::OUString > m_aImageCommandNameVector;
- sal_Int16 m_nSymbolsStyle;
- };
-
- class GlobalImageList : public CmdImageList, public rtl::IReference
+ class ModuleImageManager : private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper1< ::com::sun::star::ui::XImageManager>
{
public:
- GlobalImageList( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
- virtual ~GlobalImageList();
-
- virtual Image getImageFromCommandURL( sal_Int16 nImageType, const rtl::OUString& rCommandURL );
- virtual bool hasImage( sal_Int16 nImageType, const rtl::OUString& rCommandURL );
- virtual ::std::vector< rtl::OUString >& getImageNames();
- virtual ::std::vector< rtl::OUString >& getImageCommandNames();
-
- // Reference
- virtual oslInterlockedCount SAL_CALL acquire();
- virtual oslInterlockedCount SAL_CALL release();
-
- private:
- oslInterlockedCount m_nRefCount;
- };
-
- class ModuleImageManager : public com::sun::star::lang::XTypeProvider ,
- public ::com::sun::star::ui::XImageManager ,
- private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
- {
- public:
- // XInterface, XTypeProvider, XServiceInfo
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
-
ModuleImageManager( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xServiceManager );
virtual ~ModuleImageManager();
@@ -170,59 +119,7 @@ namespace framework
virtual sal_Bool SAL_CALL isReadOnly() throw (::com::sun::star::uno::RuntimeException);
private:
- typedef std::hash_map< rtl::OUString,
- sal_Bool,
- OUStringHashCode,
- ::std::equal_to< ::rtl::OUString > > ImageNameMap;
-
- // private data types
- enum Layer
- {
- LAYER_DEFAULT,
- LAYER_USERDEFINED,
- LAYER_COUNT
- };
-
- enum NotifyOp
- {
- NotifyOp_Remove,
- NotifyOp_Insert,
- NotifyOp_Replace
- };
-
- typedef ::std::vector< ::com::sun::star::ui::ConfigurationEvent > ConfigEventNotifyContainer;
-
- // private methods
- void implts_initialize();
- void implts_notifyContainerListener( const ::com::sun::star::ui::ConfigurationEvent& aEvent, NotifyOp eOp );
- const rtl::Reference< GlobalImageList >& implts_getGlobalImageList();
- CmdImageList* implts_getDefaultImageList();
- ImageList* implts_getUserImageList( ImageType nImageType );
- sal_Bool implts_loadUserImages( ImageType nImageType,
- const com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& xUserImageStorage,
- const com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& xUserBitmapsStorage );
- sal_Bool implts_storeUserImages( ImageType nImageType,
- const com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& xUserImageStorage,
- const com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& xUserBitmapsStorage );
-
- com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xUserConfigStorage;
- com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xUserImageStorage;
- com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xUserBitmapsStorage;
- bool m_bReadOnly;
- bool m_bInitialized;
- bool m_bModified;
- bool m_bConfigRead;
- bool m_bDisposed;
- rtl::OUString m_aXMLPostfix;
- rtl::OUString m_aModuleIdentifier;
- rtl::OUString m_aResourceString;
- com::sun::star::uno::Reference< com::sun::star::embed::XTransactedObject > m_xUserRootCommit;
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
- ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
- rtl::Reference< GlobalImageList > m_pGlobalImageList;
- CmdImageList* m_pDefaultImageList;
- ImageList* m_pUserImageList[ImageType_COUNT];
- bool m_bUserImageListModified[ImageType_COUNT];
+ ::std::auto_ptr<ImageManagerImpl> m_pImpl;
};
}
diff --git a/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx b/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx
index a0dc92ae50d3..62c0477a5169 100644
--- a/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx
+++ b/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx
@@ -38,6 +38,7 @@
#include <vector>
#include <list>
#include <hash_map>
+#include <memory>
//_________________________________________________________________________________________________________________
// my own includes
@@ -77,6 +78,7 @@
namespace framework
{
+ class UIConfigurationManagerImpl;
class ModuleUIConfigurationManager : public com::sun::star::lang::XTypeProvider ,
public com::sun::star::lang::XServiceInfo ,
public com::sun::star::lang::XComponent ,
@@ -85,7 +87,6 @@ namespace framework
public ::com::sun::star::ui::XUIConfigurationManager ,
public ::com::sun::star::ui::XModuleUIConfigurationManager ,
public ::com::sun::star::ui::XUIConfigurationPersistence ,
- private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
public ::cppu::OWeakObject
{
public:
@@ -134,94 +135,7 @@ namespace framework
virtual sal_Bool SAL_CALL isReadOnly() throw (::com::sun::star::uno::RuntimeException);
private:
- // private data types
- enum Layer
- {
- LAYER_DEFAULT,
- LAYER_USERDEFINED,
- LAYER_COUNT
- };
-
- enum NotifyOp
- {
- NotifyOp_Remove,
- NotifyOp_Insert,
- NotifyOp_Replace
- };
-
- struct UIElementInfo
- {
- UIElementInfo( const rtl::OUString& rResourceURL, const rtl::OUString& rUIName ) :
- aResourceURL( rResourceURL), aUIName( rUIName ) {}
- rtl::OUString aResourceURL;
- rtl::OUString aUIName;
- };
-
- struct UIElementData
- {
- UIElementData() : bModified( false ), bDefault( true ), bDefaultNode( true ) {};
-
- rtl::OUString aResourceURL;
- rtl::OUString aName;
- bool bModified; // has been changed since last storing
- bool bDefault; // default settings
- bool bDefaultNode; // this is a default layer element data
- com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > xSettings;
- };
-
- struct UIElementType;
- friend struct UIElementType;
- typedef ::std::hash_map< rtl::OUString, UIElementData, OUStringHashCode, ::std::equal_to< rtl::OUString > > UIElementDataHashMap;
-
- struct UIElementType
- {
- UIElementType() : bModified( false ),
- bLoaded( false ),
- bDefaultLayer( false ),
- nElementType( ::com::sun::star::ui::UIElementType::UNKNOWN ) {}
-
-
- bool bModified;
- bool bLoaded;
- bool bDefaultLayer;
- sal_Int16 nElementType;
- UIElementDataHashMap aElementsHashMap;
- com::sun::star::uno::Reference< com::sun::star::embed::XStorage > xStorage;
- };
-
- typedef ::std::vector< UIElementType > UIElementTypesVector;
- typedef ::std::vector< ::com::sun::star::ui::ConfigurationEvent > ConfigEventNotifyContainer;
- typedef ::std::hash_map< rtl::OUString, UIElementInfo, OUStringHashCode, ::std::equal_to< rtl::OUString > > UIElementInfoHashMap;
-
- // private methods
- void impl_Initialize();
- void implts_notifyContainerListener( const ::com::sun::star::ui::ConfigurationEvent& aEvent, NotifyOp eOp );
- void impl_fillSequenceWithElementTypeInfo( UIElementInfoHashMap& aUIElementInfoCollection, sal_Int16 nElementType );
- void impl_preloadUIElementTypeList( Layer eLayer, sal_Int16 nElementType );
- UIElementData* impl_findUIElementData( const rtl::OUString& aResourceURL, sal_Int16 nElementType, bool bLoad = true );
- void impl_requestUIElementData( sal_Int16 nElementType, Layer eLayer, UIElementData& aUIElementData );
- void impl_storeElementTypeData( com::sun::star::uno::Reference< com::sun::star::embed::XStorage > xStorage, UIElementType& rElementType, bool bResetModifyState = true );
- void impl_resetElementTypeData( UIElementType& rUserElementType, UIElementType& rDefaultElementType, ConfigEventNotifyContainer& rRemoveNotifyContainer, ConfigEventNotifyContainer& rReplaceNotifyContainer );
- void impl_reloadElementTypeData( UIElementType& rUserElementType, UIElementType& rDefaultElementType, ConfigEventNotifyContainer& rRemoveNotifyContainer, ConfigEventNotifyContainer& rReplaceNotifyContainer );
-
- UIElementTypesVector m_aUIElements[LAYER_COUNT];
- PresetHandler* m_pStorageHandler[::com::sun::star::ui::UIElementType::COUNT];
- com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xDefaultConfigStorage;
- com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xUserConfigStorage;
- bool m_bReadOnly;
- bool m_bInitialized;
- bool m_bModified;
- bool m_bConfigRead;
- bool m_bDisposed;
- rtl::OUString m_aXMLPostfix;
- rtl::OUString m_aPropUIName;
- rtl::OUString m_aPropResourceURL;
- rtl::OUString m_aModuleIdentifier;
- rtl::OUString m_aModuleShortName;
- com::sun::star::uno::Reference< com::sun::star::embed::XTransactedObject > m_xUserRootCommit;
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
- ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
- com::sun::star::uno::Reference< com::sun::star::lang::XComponent > m_xModuleImageManager;
+ ::std::auto_ptr<UIConfigurationManagerImpl> m_pImpl;
};
}
diff --git a/framework/inc/uiconfiguration/uicategorydescription.hxx b/framework/inc/uiconfiguration/uicategorydescription.hxx
index 9316b20c7705..24a7a8972fdb 100644
--- a/framework/inc/uiconfiguration/uicategorydescription.hxx
+++ b/framework/inc/uiconfiguration/uicategorydescription.hxx
@@ -43,9 +43,8 @@
//_________________________________________________________________________________________________________________
#include <threadhelp/threadhelpbase.hxx>
#include <macros/generic.hxx>
-#include <macros/xinterface.hxx>
-#include <macros/xtypeprovider.hxx>
#include <macros/xserviceinfo.hxx>
+#include <uielement/uicommanddescription.hxx>
#include <stdtypes.h>
//_________________________________________________________________________________________________________________
@@ -59,61 +58,18 @@
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
-#include <rtl/ustring.hxx>
namespace framework
{
-
-class ConfigurationAccess_UICategory;
-class UICategoryDescription : public com::sun::star::lang::XTypeProvider ,
- public com::sun::star::lang::XServiceInfo ,
- public com::sun::star::container::XNameAccess ,
- private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class UICategoryDescription : public UICommandDescription
{
public:
UICategoryDescription( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
virtual ~UICategoryDescription();
- // XInterface, XTypeProvider, XServiceInfo
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
-
- // XNameAccess
- virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
- throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
- throw (::com::sun::star::uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
- throw (::com::sun::star::uno::RuntimeException);
-
- // XElementAccess
- virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
- throw (::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasElements()
- throw (::com::sun::star::uno::RuntimeException);
-
- typedef ::std::hash_map< ::rtl::OUString,
- ::rtl::OUString,
- OUStringHashCode,
- ::std::equal_to< ::rtl::OUString > > ModuleToCategoryFileMap;
-
- typedef ::std::hash_map< ::rtl::OUString,
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >,
- OUStringHashCode,
- ::std::equal_to< ::rtl::OUString > > CategoryHashMap;
-
private:
- sal_Bool m_bConfigRead;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
- ModuleToCategoryFileMap m_aModuleToCategoryFileMap;
- CategoryHashMap m_aCategoryHashMap;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xGenericCategories;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > m_xModuleManager;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > impl_createConfigAccess(const ::rtl::OUString& _sName);
};
} // namespace framework
diff --git a/framework/inc/uiconfiguration/uiconfigurationmanager.hxx b/framework/inc/uiconfiguration/uiconfigurationmanager.hxx
index e7ecec183570..39f1d9503513 100644
--- a/framework/inc/uiconfiguration/uiconfigurationmanager.hxx
+++ b/framework/inc/uiconfiguration/uiconfigurationmanager.hxx
@@ -38,6 +38,7 @@
#include <vector>
#include <list>
#include <hash_map>
+#include <memory>
//_________________________________________________________________________________________________________________
// my own includes
@@ -77,6 +78,7 @@
namespace framework
{
+ class UIConfigurationManagerImpl;
class UIConfigurationManager : public com::sun::star::lang::XTypeProvider ,
public com::sun::star::lang::XServiceInfo ,
public com::sun::star::lang::XComponent ,
@@ -84,7 +86,6 @@ namespace framework
public ::com::sun::star::ui::XUIConfigurationManager ,
public ::com::sun::star::ui::XUIConfigurationPersistence ,
public ::com::sun::star::ui::XUIConfigurationStorage ,
- private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
public ::cppu::OWeakObject
{
public:
@@ -130,83 +131,7 @@ namespace framework
virtual sal_Bool SAL_CALL hasStorage() throw (::com::sun::star::uno::RuntimeException);
private:
- // private data types
- enum NotifyOp
- {
- NotifyOp_Remove,
- NotifyOp_Insert,
- NotifyOp_Replace
- };
-
- struct UIElementInfo
- {
- UIElementInfo( const rtl::OUString& rResourceURL, const rtl::OUString& rUIName ) :
- aResourceURL( rResourceURL), aUIName( rUIName ) {}
- rtl::OUString aResourceURL;
- rtl::OUString aUIName;
- };
-
- struct UIElementData
- {
- UIElementData() : bModified( false ), bDefault( true ) {};
-
- rtl::OUString aResourceURL;
- rtl::OUString aName;
- bool bModified; // has been changed since last storing
- bool bDefault; // default settings
- com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > xSettings;
- };
-
- struct UIElementType;
- friend struct UIElementType;
- typedef ::std::hash_map< rtl::OUString, UIElementData, OUStringHashCode, ::std::equal_to< rtl::OUString > > UIElementDataHashMap;
-
- struct UIElementType
- {
- UIElementType() : bModified( false ),
- bLoaded( false ),
- bDefaultLayer( false ),
- nElementType( ::com::sun::star::ui::UIElementType::UNKNOWN ) {}
-
-
- bool bModified;
- bool bLoaded;
- bool bDefaultLayer;
- sal_Int16 nElementType;
- UIElementDataHashMap aElementsHashMap;
- com::sun::star::uno::Reference< com::sun::star::embed::XStorage > xStorage;
- };
-
- typedef ::std::vector< UIElementType > UIElementTypesVector;
- typedef ::std::vector< ::com::sun::star::ui::ConfigurationEvent > ConfigEventNotifyContainer;
- typedef ::std::hash_map< rtl::OUString, UIElementInfo, OUStringHashCode, ::std::equal_to< rtl::OUString > > UIElementInfoHashMap;
-
- // private methods
- void impl_Initialize();
- void implts_notifyContainerListener( const ::com::sun::star::ui::ConfigurationEvent& aEvent, NotifyOp eOp );
- void impl_fillSequenceWithElementTypeInfo( UIElementInfoHashMap& aUIElementInfoCollection, sal_Int16 nElementType );
- void impl_preloadUIElementTypeList( sal_Int16 nElementType );
- UIElementData* impl_findUIElementData( const rtl::OUString& aResourceURL, sal_Int16 nElementType, bool bLoad = true );
- void impl_requestUIElementData( sal_Int16 nElementType, UIElementData& aUIElementData );
- void impl_storeElementTypeData( com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& xStorage, UIElementType& rElementType, bool bResetModifyState = true );
- void impl_resetElementTypeData( UIElementType& rDocElementType, ConfigEventNotifyContainer& rRemoveNotifyContainer );
- void impl_reloadElementTypeData( UIElementType& rDocElementType, ConfigEventNotifyContainer& rRemoveNotifyContainer, ConfigEventNotifyContainer& rReplaceNotifyContainer );
-
- UIElementTypesVector m_aUIElements;
- com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xDocConfigStorage;
- bool m_bReadOnly;
- bool m_bInitialized;
- bool m_bModified;
- bool m_bConfigRead;
- bool m_bDisposed;
- rtl::OUString m_aXMLPostfix;
- rtl::OUString m_aPropUIName;
- rtl::OUString m_aPropResourceURL;
- rtl::OUString m_aModuleIdentifier;
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
- ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
- com::sun::star::uno::Reference< com::sun::star::lang::XComponent > m_xImageManager;
- com::sun::star::uno::Reference< com::sun::star::uno::XInterface > m_xAccConfig;
+ ::std::auto_ptr<UIConfigurationManagerImpl> m_pImpl;
};
}
diff --git a/framework/inc/uiconfiguration/windowstateconfiguration.hxx b/framework/inc/uiconfiguration/windowstateconfiguration.hxx
index ea3b7499f918..7d7b2800334b 100644
--- a/framework/inc/uiconfiguration/windowstateconfiguration.hxx
+++ b/framework/inc/uiconfiguration/windowstateconfiguration.hxx
@@ -59,7 +59,7 @@
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <rtl/ustring.hxx>
namespace framework
@@ -83,11 +83,8 @@ namespace framework
#define WINDOWSTATE_PROPERTY_CONTEXTACTIVE "ContextActive"
class ConfigurationAccess_Windows;
-class WindowStateConfiguration : public com::sun::star::lang::XTypeProvider ,
- public com::sun::star::lang::XServiceInfo ,
- public com::sun::star::container::XNameAccess ,
- private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class WindowStateConfiguration : private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper2< ::com::sun::star::container::XNameAccess, css::lang::XServiceInfo>
{
public:
WindowStateConfiguration( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
diff --git a/framework/inc/uielement/comboboxtoolbarcontroller.hxx b/framework/inc/uielement/comboboxtoolbarcontroller.hxx
index 967ff4131f30..bdf4b3699cc8 100644
--- a/framework/inc/uielement/comboboxtoolbarcontroller.hxx
+++ b/framework/inc/uielement/comboboxtoolbarcontroller.hxx
@@ -77,9 +77,6 @@ class ComboboxToolbarController : public IComboBoxListener,
// XComponent
virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException );
- // XToolbarController
- virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
-
// IComboBoxListener
virtual void Select();
virtual void DoubleClick();
@@ -91,6 +88,7 @@ class ComboboxToolbarController : public IComboBoxListener,
protected:
virtual void executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> getExecuteArgs(sal_Int16 KeyModifier) const;
private:
ComboBoxControl* m_pComboBox;
diff --git a/framework/inc/uielement/complextoolbarcontroller.hxx b/framework/inc/uielement/complextoolbarcontroller.hxx
index cde94ff788d0..c882fb2cf244 100644
--- a/framework/inc/uielement/complextoolbarcontroller.hxx
+++ b/framework/inc/uielement/complextoolbarcontroller.hxx
@@ -95,6 +95,7 @@ class ComplexToolbarController : public svt::ToolboxController
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rInfo );
virtual void executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand ) = 0;
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> getExecuteArgs(sal_Int16 KeyModifier) const;
const ::com::sun::star::util::URL& getInitializedURL();
void notifyFocusGet();
void notifyFocusLost();
diff --git a/framework/inc/uielement/controlmenucontroller.hxx b/framework/inc/uielement/controlmenucontroller.hxx
index ffa4b1c21c27..ab86506d385b 100644
--- a/framework/inc/uielement/controlmenucontroller.hxx
+++ b/framework/inc/uielement/controlmenucontroller.hxx
@@ -72,7 +72,6 @@ namespace framework
DECLARE_XSERVICEINFO
// 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
@@ -82,15 +81,15 @@ namespace framework
virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
// 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);
// XEventListener
virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
private:
+ 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);
+
class UrlToDispatchMap : public ::std::hash_map< ::rtl::OUString,
com::sun::star::uno::Reference< com::sun::star::frame::XDispatch >,
OUStringHashCode,
diff --git a/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx b/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx
index 14a141f52b24..70b3cf6ed657 100644
--- a/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx
+++ b/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx
@@ -75,9 +75,6 @@ class DropdownToolbarController : public IListBoxListener,
// XComponent
virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException );
- // XToolbarController
- virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
-
// IComboBoxListener
virtual void Select();
virtual void DoubleClick();
@@ -87,6 +84,7 @@ class DropdownToolbarController : public IListBoxListener,
protected:
virtual void executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> getExecuteArgs(sal_Int16 KeyModifier) const;
private:
ListBoxControl* m_pListBoxControl;
diff --git a/framework/inc/uielement/edittoolbarcontroller.hxx b/framework/inc/uielement/edittoolbarcontroller.hxx
index 7ee1a8571dec..144ae48baaad 100644
--- a/framework/inc/uielement/edittoolbarcontroller.hxx
+++ b/framework/inc/uielement/edittoolbarcontroller.hxx
@@ -75,9 +75,6 @@ class EditToolbarController : public IEditListener,
// XComponent
virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException );
- // XToolbarController
- virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
-
// IEditListener
virtual void Modify();
virtual void KeyInput( const KeyEvent& rKEvt );
@@ -87,6 +84,7 @@ class EditToolbarController : public IEditListener,
protected:
virtual void executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> getExecuteArgs(sal_Int16 KeyModifier) const;
private:
EditControl* m_pEditControl;
diff --git a/framework/inc/uielement/fontmenucontroller.hxx b/framework/inc/uielement/fontmenucontroller.hxx
index 5039cc757a25..33035d4a082f 100644
--- a/framework/inc/uielement/fontmenucontroller.hxx
+++ b/framework/inc/uielement/fontmenucontroller.hxx
@@ -69,25 +69,20 @@ namespace framework
DECLARE_XSERVICEINFO
// 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 );
// 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);
// XEventListener
virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
private:
+ 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);
void fillPopupMenu( const com::sun::star::uno::Sequence< ::rtl::OUString >& rFontNameSeq, com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu );
rtl::OUString m_aFontFamilyName;
diff --git a/framework/inc/uielement/fontsizemenucontroller.hxx b/framework/inc/uielement/fontsizemenucontroller.hxx
index 191b323923e6..f571ccef0d16 100644
--- a/framework/inc/uielement/fontsizemenucontroller.hxx
+++ b/framework/inc/uielement/fontsizemenucontroller.hxx
@@ -70,25 +70,17 @@ namespace framework
DECLARE_XSERVICEINFO
// 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 );
- // 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);
-
// XEventListener
virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
private:
+ 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);
void setCurHeight( long nHeight, com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu );
void fillPopupMenu( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu );
rtl::OUString retrievePrinterName( com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame );
diff --git a/framework/inc/uielement/footermenucontroller.hxx b/framework/inc/uielement/footermenucontroller.hxx
index a54c8f60f170..534e4bd6437e 100644
--- a/framework/inc/uielement/footermenucontroller.hxx
+++ b/framework/inc/uielement/footermenucontroller.hxx
@@ -34,65 +34,26 @@
//_________________________________________________________________________________________________________________
// my own includes
//_________________________________________________________________________________________________________________
-
-#include <helper/popupmenucontrollerbase.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/XDispatch.hpp>
-#include <com/sun/star/frame/XStatusListener.hpp>
-#include <com/sun/star/frame/XPopupMenuController.hpp>
-#include <com/sun/star/frame/status/Verb.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-
-//_________________________________________________________________________________________________________________
-// includes of other projects
-//_________________________________________________________________________________________________________________
-#include <toolkit/awt/vclxmenu.hxx>
-#include <cppuhelper/weak.hxx>
-#include <rtl/ustring.hxx>
+#include <uielement/headermenucontroller.hxx>
namespace framework
{
- class FooterMenuController : public PopupMenuControllerBase
+ class FooterMenuController : public HeaderMenuController
{
public:
FooterMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
virtual ~FooterMenuController();
// XServiceInfo
- DECLARE_XSERVICEINFO
-
- // 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 );
-
- // 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);
-
- // XEventListener
- virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
-
- private:
- void fillPopupMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rModel, com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu );
-
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel;
+ virtual ::rtl::OUString SAL_CALL getImplementationName ( ) throw( css::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL supportsService ( const ::rtl::OUString& sServiceName ) throw( css::uno::RuntimeException );
+ virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames ( ) throw( css::uno::RuntimeException );
+ /* Helper for XServiceInfo */
+ static css::uno::Sequence< ::rtl::OUString > SAL_CALL impl_getStaticSupportedServiceNames( );
+ static ::rtl::OUString SAL_CALL impl_getStaticImplementationName ( );
+ /* Helper for registry */
+ static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ) throw( css::uno::Exception );
+ static css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager );
};
}
diff --git a/framework/inc/uielement/headermenucontroller.hxx b/framework/inc/uielement/headermenucontroller.hxx
index ade3b34bc80a..e0721bafb49a 100644
--- a/framework/inc/uielement/headermenucontroller.hxx
+++ b/framework/inc/uielement/headermenucontroller.hxx
@@ -64,35 +64,27 @@ namespace framework
class HeaderMenuController : public PopupMenuControllerBase
{
public:
- HeaderMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
+ HeaderMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager,bool _bFooter = sal_False );
virtual ~HeaderMenuController();
// XServiceInfo
DECLARE_XSERVICEINFO
// 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 );
- // 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);
-
// XEventListener
virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
private:
+ virtual void impl_select(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& _xDispatch,const ::com::sun::star::util::URL& aURL);
void fillPopupMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rModel, com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu );
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel;
+ bool m_bFooter;
};
}
diff --git a/framework/inc/uielement/imagebuttontoolbarcontroller.hxx b/framework/inc/uielement/imagebuttontoolbarcontroller.hxx
index 8495ec93a734..850f024e9e76 100644
--- a/framework/inc/uielement/imagebuttontoolbarcontroller.hxx
+++ b/framework/inc/uielement/imagebuttontoolbarcontroller.hxx
@@ -61,9 +61,6 @@ class ImageButtonToolbarController : public ComplexToolbarController
// XComponent
virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException );
- // XToolbarController
- virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
-
protected:
virtual void executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand );
diff --git a/framework/inc/uielement/itemcontainer.hxx b/framework/inc/uielement/itemcontainer.hxx
index 03b169bef319..f9499e83edb8 100644
--- a/framework/inc/uielement/itemcontainer.hxx
+++ b/framework/inc/uielement/itemcontainer.hxx
@@ -52,7 +52,7 @@
// other includes
//_________________________________________________________________________________________________________________
#include <rtl/ustring.hxx>
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase1.hxx>
#include <vector>
@@ -60,10 +60,7 @@ namespace framework
{
class ConstItemContainer;
-class ItemContainer : public ::com::sun::star::lang::XTypeProvider ,
- public ::com::sun::star::container::XIndexContainer ,
- public ::com::sun::star::lang::XUnoTunnel ,
- public ::cppu::OWeakObject
+class ItemContainer : public ::cppu::WeakImplHelper1< ::com::sun::star::container::XIndexContainer>
{
friend class ConstItemContainer;
@@ -76,9 +73,6 @@ class ItemContainer : public ::com::sun::star::lang::XTypeProvider ,
//---------------------------------------------------------------------------------------------------------
// XInterface, XTypeProvider
//---------------------------------------------------------------------------------------------------------
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
-
// XUnoTunnel
static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw();
static ItemContainer* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw();
diff --git a/framework/inc/uielement/langselectionmenucontroller.hxx b/framework/inc/uielement/langselectionmenucontroller.hxx
index f9cec2dfb814..ff8083ce6714 100644
--- a/framework/inc/uielement/langselectionmenucontroller.hxx
+++ b/framework/inc/uielement/langselectionmenucontroller.hxx
@@ -72,7 +72,6 @@ namespace framework
DECLARE_XSERVICEINFO
// 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
@@ -81,16 +80,12 @@ namespace framework
// XStatusListener
virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
- // 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);
-
// XEventListener
virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
private:
+ 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);
enum Mode
{
MODE_SetLanguageSelectionMenu,
diff --git a/framework/inc/uielement/langselectionstatusbarcontroller.hxx b/framework/inc/uielement/langselectionstatusbarcontroller.hxx
index 4e886f89adfb..0b9df06c8877 100644
--- a/framework/inc/uielement/langselectionstatusbarcontroller.hxx
+++ b/framework/inc/uielement/langselectionstatusbarcontroller.hxx
@@ -88,6 +88,7 @@ class LangSelectionStatusbarController : public svt::StatusbarController
LangSelectionStatusbarController(LangSelectionStatusbarController &); // not defined
void operator =(LangSelectionStatusbarController &); // not defined
+
sal_Bool m_bShowMenu;
sal_Int16 m_nScriptType;
::rtl::OUString m_aCurrentLanguage;
diff --git a/framework/inc/uielement/macrosmenucontroller.hxx b/framework/inc/uielement/macrosmenucontroller.hxx
index 4729bff517d2..fb993e0af8f4 100644
--- a/framework/inc/uielement/macrosmenucontroller.hxx
+++ b/framework/inc/uielement/macrosmenucontroller.hxx
@@ -71,25 +71,14 @@ namespace framework
// XServiceInfo
DECLARE_XSERVICEINFO
- // XPopupMenuController
- virtual void SAL_CALL setPopupMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >& PopupMenu ) 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 );
- // 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);
-
// XEventListener
virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
private:
+ virtual void impl_select(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& _xDispatch,const ::com::sun::star::util::URL& aURL);
void fillPopupMenu( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu );
String RetrieveLabelFromCommand( const String& aCmdURL );
void addScriptItems( PopupMenu* pPopupMenu, USHORT startItemId );
diff --git a/framework/inc/uielement/menubarmanager.hxx b/framework/inc/uielement/menubarmanager.hxx
index 73d5ca1780b2..067fb9e2cfe3 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -103,6 +103,7 @@ class MenuBarManager : public com::sun::star::frame::XStatusListener
MenuBarManager(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
const ::com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer >& _xURLTransformer,
AddonMenu* pAddonMenu,
sal_Bool bDelete,
sal_Bool bDeleteChildren );
@@ -111,6 +112,7 @@ class MenuBarManager : public com::sun::star::frame::XStatusListener
MenuBarManager(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
const ::com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer >& _xURLTransformer,
AddonPopupMenu* pAddonMenu,
sal_Bool bDelete,
sal_Bool bDeleteChildren );
@@ -120,6 +122,7 @@ class MenuBarManager : public com::sun::star::frame::XStatusListener
MenuBarManager(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer >& _xURLTransformer,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& rDispatchProvider,
const rtl::OUString& aModuleIdentifier,
Menu* pMenu,
@@ -192,11 +195,12 @@ class MenuBarManager : public com::sun::star::frame::XStatusListener
void RequestImages();
void RetrieveImageManagers();
static sal_Bool MustBeHidden( PopupMenu* pPopupMenu, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer >& rTransformer );
+ String RetrieveLabelFromCommand( const String& aCmdURL );
private:
- String RetrieveLabelFromCommand( const String& aCmdURL );
- void UpdateSpecialFileMenu( Menu* pMenu );
- void UpdateSpecialWindowMenu( Menu* pMenu );
+
+
+
void Destroy();
struct MenuItemHandler
@@ -235,6 +239,10 @@ class MenuBarManager : public com::sun::star::frame::XStatusListener
MenuItemHandler* GetMenuItemHandler( USHORT nItemId );
sal_Bool CreatePopupMenuController( MenuItemHandler* pMenuItemHandler );
+ void AddMenu(MenuBarManager* pSubMenuManager,const ::rtl::OUString& _sItemCommand,USHORT _nItemId);
+ USHORT FillItemCommand(::rtl::OUString& _rItemCommand,Menu* _pMenu,USHORT _nIndex) const;
+ void Init(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,AddonMenu* pAddonMenu,sal_Bool bDelete,sal_Bool bDeleteChildren,bool _bHandlePopUp = false);
+ void SetHdl();
sal_Bool m_bDisposed : 1,
m_bInitialized : 1,
@@ -244,9 +252,9 @@ class MenuBarManager : public com::sun::star::frame::XStatusListener
m_bIsBookmarkMenu : 1,
m_bWasHiContrast : 1,
m_bShowMenuImages : 1;
- sal_Bool m_bModuleIdentified : 1,
- m_bRetrieveImages : 1,
+ sal_Bool m_bRetrieveImages : 1,
m_bAcceleratorCfg : 1;
+ sal_Bool m_bModuleIdentified;
::rtl::OUString m_aMenuItemCommand;
::rtl::OUString m_aModuleIdentifier;
Menu* m_pVCLMenu;
@@ -262,6 +270,7 @@ class MenuBarManager : public com::sun::star::frame::XStatusListener
::com::sun::star::uno::Reference< ::com::sun::star::ui::XAcceleratorConfiguration > m_xModuleAcceleratorManager;
::com::sun::star::uno::Reference< ::com::sun::star::ui::XAcceleratorConfiguration > m_xGlobalAcceleratorManager;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > m_xDeferedItemContainer;
sal_Int16 m_nSymbolsStyle;
Timer m_aAsyncSettingsTimer;
diff --git a/framework/inc/uielement/menubarwrapper.hxx b/framework/inc/uielement/menubarwrapper.hxx
index 8686d2e87ecb..027fc6deca14 100644
--- a/framework/inc/uielement/menubarwrapper.hxx
+++ b/framework/inc/uielement/menubarwrapper.hxx
@@ -74,9 +74,6 @@ class MenuBarWrapper : public UIConfigElementWrapperBase,
FWK_DECLARE_XINTERFACE
FWK_DECLARE_XTYPEPROVIDER
- // #110897#
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& getServiceFactory();
-
MenuBarManager* GetMenuBarManager() const { return static_cast< MenuBarManager* >( m_xMenuBarManager.get() ); }
void InvalidatePopupControllerCache() { m_bRefreshPopupControllerCache = sal_True; }
@@ -91,8 +88,6 @@ class MenuBarWrapper : public UIConfigElementWrapperBase,
// XUIElementSettings
virtual void SAL_CALL updateSettings( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getSettings( sal_Bool bWriteable ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setSettings( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& UISettings ) throw (::com::sun::star::uno::RuntimeException);
// XElementAccess
virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw (::com::sun::star::uno::RuntimeException);
@@ -104,11 +99,11 @@ class MenuBarWrapper : public UIConfigElementWrapperBase,
virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
private:
+ virtual void impl_fillNewData();
void fillPopupControllerCache();
sal_Bool m_bRefreshPopupControllerCache : 1;
com::sun::star::uno::Reference< com::sun::star::lang::XComponent > m_xMenuBarManager;
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& mxServiceFactory;
PopupControllerCache m_aPopupControllerCache;
};
diff --git a/framework/inc/uielement/newmenucontroller.hxx b/framework/inc/uielement/newmenucontroller.hxx
index fb65d2415479..799f58fd3f6b 100644
--- a/framework/inc/uielement/newmenucontroller.hxx
+++ b/framework/inc/uielement/newmenucontroller.hxx
@@ -51,7 +51,6 @@
#include <com/sun/star/frame/XStatusListener.hpp>
#include <com/sun/star/frame/XPopupMenuController.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
//_________________________________________________________________________________________________________________
@@ -84,10 +83,6 @@ namespace framework
// XServiceInfo
DECLARE_XSERVICEINFO
- // XPopupMenuController
- virtual void SAL_CALL updatePopupMenu() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setPopupMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >& PopupMenu ) 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);
@@ -95,10 +90,8 @@ namespace framework
virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
// 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);
// XEventListener
virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
@@ -106,6 +99,7 @@ namespace framework
DECL_STATIC_LINK( NewMenuController, ExecuteHdl_Impl, NewDocument* );
private:
+ virtual void impl_setPopupMenu();
struct AddInfo
{
rtl::OUString aTargetFrame;
@@ -133,7 +127,6 @@ namespace framework
rtl::OUString m_aTargetFrame;
rtl::OUString m_aModuleIdentifier;
rtl::OUString m_aEmptyDocURL;
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
::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/objectmenucontroller.hxx b/framework/inc/uielement/objectmenucontroller.hxx
index 4107e1063869..d32f8aa61615 100644
--- a/framework/inc/uielement/objectmenucontroller.hxx
+++ b/framework/inc/uielement/objectmenucontroller.hxx
@@ -69,26 +69,15 @@ namespace framework
// XServiceInfo
DECLARE_XSERVICEINFO
- // XPopupMenuController
- virtual void SAL_CALL setPopupMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >& PopupMenu ) 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 );
- // 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);
-
// XEventListener
virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
private:
void fillPopupMenu( const com::sun::star::uno::Sequence< com::sun::star::embed::VerbDescriptor >& rVerbCommandSeq, com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu );
+ virtual void impl_select(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& _xDispatch,const ::com::sun::star::util::URL& aURL);
com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > m_xObjectUpdateDispatch;
};
diff --git a/framework/inc/uielement/recentfilesmenucontroller.hxx b/framework/inc/uielement/recentfilesmenucontroller.hxx
index 40beb34dc69a..7fdd4897b31c 100644
--- a/framework/inc/uielement/recentfilesmenucontroller.hxx
+++ b/framework/inc/uielement/recentfilesmenucontroller.hxx
@@ -79,23 +79,16 @@ namespace framework
// XPopupMenuController
virtual void SAL_CALL updatePopupMenu() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setPopupMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >& PopupMenu ) 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 );
// 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 );
@@ -108,6 +101,7 @@ namespace framework
DECL_STATIC_LINK( RecentFilesMenuController, ExecuteHdl_Impl, LoadRecentFile* );
private:
+ virtual void impl_setPopupMenu();
struct RecentFile
{
rtl::OUString aURL;
diff --git a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
index 9d9706a25f82..a25c452c25e4 100644
--- a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
+++ b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
@@ -81,9 +81,6 @@ class SpinfieldToolbarController : public ISpinfieldListener,
// XComponent
virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException );
- // XToolbarController
- virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
-
// ISpinfieldListener
virtual void Up();
virtual void Down();
@@ -99,6 +96,7 @@ class SpinfieldToolbarController : public ISpinfieldListener,
protected:
virtual void executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> getExecuteArgs(sal_Int16 KeyModifier) const;
private:
bool impl_getValue( const ::com::sun::star::uno::Any& rAny, sal_Int32& nValue, double& fValue, bool& bFloat );
diff --git a/framework/inc/uielement/statusbarmanager.hxx b/framework/inc/uielement/statusbarmanager.hxx
index 431dda7cae04..26bebd3924aa 100644
--- a/framework/inc/uielement/statusbarmanager.hxx
+++ b/framework/inc/uielement/statusbarmanager.hxx
@@ -46,6 +46,7 @@
//_________________________________________________________________________________________________________________
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XStatusListener.hpp>
+#include <com/sun/star/frame/XStatusbarController.hpp>
#include <com/sun/star/frame/XUIControllerRegistration.hpp>
#include <com/sun/star/ui/XUIConfiguration.hpp>
#include <com/sun/star/frame/XModuleManager.hpp>
@@ -120,14 +121,15 @@ class StatusBarManager : public ::com::sun::star::frame::XFrameActionListener
void CreateControllers();
void UpdateControllers();
void AddFrameActionListener();
+ void MouseButton( const MouseEvent& rMEvt ,sal_Bool ( SAL_CALL ::com::sun::star::frame::XStatusbarController::*_pMethod )(const ::com::sun::star::awt::MouseEvent&));
protected:
typedef std::vector< ::com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener > > StatusBarControllerVector;
sal_Bool m_bDisposed : 1,
- m_bModuleIdentified : 1,
m_bFrameActionRegistered : 1,
m_bUpdateControllers : 1;
+ sal_Bool m_bModuleIdentified;
StatusBar* m_pStatusBar;
rtl::OUString m_aModuleIdentifier;
rtl::OUString m_aResourceName;
diff --git a/framework/inc/uielement/statusbarwrapper.hxx b/framework/inc/uielement/statusbarwrapper.hxx
index a5baabee9f6e..cda501e9724d 100644
--- a/framework/inc/uielement/statusbarwrapper.hxx
+++ b/framework/inc/uielement/statusbarwrapper.hxx
@@ -70,12 +70,9 @@ class StatusBarWrapper : public UIConfigElementWrapperBase
// XUIElementSettings
virtual void SAL_CALL updateSettings() throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getSettings( sal_Bool bWriteable ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setSettings( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& UISettings ) throw (::com::sun::star::uno::RuntimeException);
private:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xStatusBarManager;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory;
};
} // namespace framework
diff --git a/framework/inc/uielement/statusindicatorinterfacewrapper.hxx b/framework/inc/uielement/statusindicatorinterfacewrapper.hxx
index 1bb78b63095c..525d2af3f22d 100644
--- a/framework/inc/uielement/statusindicatorinterfacewrapper.hxx
+++ b/framework/inc/uielement/statusindicatorinterfacewrapper.hxx
@@ -51,28 +51,20 @@
// other includes
//_________________________________________________________________________________________________________________
#include <rtl/ustring.hxx>
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase1.hxx>
#include <vector>
namespace framework
{
-class StatusIndicatorInterfaceWrapper : public ::com::sun::star::lang::XTypeProvider ,
- public ::com::sun::star::task::XStatusIndicator ,
- public ::cppu::OWeakObject
+class StatusIndicatorInterfaceWrapper : public ::cppu::WeakImplHelper1< ::com::sun::star::task::XStatusIndicator>
{
public:
StatusIndicatorInterfaceWrapper( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rStatusIndicatorImpl );
virtual ~StatusIndicatorInterfaceWrapper();
//---------------------------------------------------------------------------------------------------------
- // XInterface, XTypeProvider
- //---------------------------------------------------------------------------------------------------------
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
-
- //---------------------------------------------------------------------------------------------------------
// XStatusIndicator
//---------------------------------------------------------------------------------------------------------
virtual void SAL_CALL start ( const ::rtl::OUString& sText ,
diff --git a/framework/inc/uielement/togglebuttontoolbarcontroller.hxx b/framework/inc/uielement/togglebuttontoolbarcontroller.hxx
index dea5a3b560d7..8778995c56ff 100644
--- a/framework/inc/uielement/togglebuttontoolbarcontroller.hxx
+++ b/framework/inc/uielement/togglebuttontoolbarcontroller.hxx
@@ -70,11 +70,11 @@ class ToggleButtonToolbarController : public ComplexToolbarController
virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException );
// XToolbarController
- virtual void SAL_CALL execute( sal_Int16 KeyModifier ) 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);
protected:
virtual void executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> getExecuteArgs(sal_Int16 KeyModifier) const;
private:
DECL_LINK( MenuSelectHdl, Menu *);
diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx
index e08983ef7a4a..553da978b8ce 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -56,7 +56,9 @@
#include <com/sun/star/ui/XImageManager.hpp>
#include <com/sun/star/frame/XStatusListener.hpp>
#include <com/sun/star/frame/XSubToolbarController.hpp>
+#include <com/sun/star/frame/XToolbarController.hpp>
#include <com/sun/star/ui/ItemStyle.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
//_________________________________________________________________________________________________________________
// other includes
@@ -189,6 +191,9 @@ class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetModelFromFrame() const;
sal_Bool IsPluginMode() const;
Image QueryAddonsImage( const ::rtl::OUString& aCommandURL, bool bBigImages, bool bHiContrast );
+ long HandleClick(void ( SAL_CALL ::com::sun::star::frame::XToolbarController::*_pClick )( ));
+ void setToolBarImage(const Image& _aImage,const CommandToInfoMap::const_iterator& _pIter);
+ void impl_elementChanged(bool _bRemove,const ::com::sun::star::ui::ConfigurationEvent& Event );
protected:
typedef ::std::hash_map< sal_uInt16, ::com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener > > ToolBarControllerMap;
@@ -210,6 +215,7 @@ class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener
ToolBar* m_pToolBar;
rtl::OUString m_aModuleIdentifier;
rtl::OUString m_aResourceName;
+ com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
com::sun::star::uno::Reference< com::sun::star::frame::XFrame > m_xFrame;
com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > m_xUICommandLabels;
ToolBarControllerMap m_aControllerMap;
diff --git a/framework/inc/uielement/toolbarsmenucontroller.hxx b/framework/inc/uielement/toolbarsmenucontroller.hxx
index 03e2c0f63bf3..ff1d117efd65 100644
--- a/framework/inc/uielement/toolbarsmenucontroller.hxx
+++ b/framework/inc/uielement/toolbarsmenucontroller.hxx
@@ -52,7 +52,6 @@
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/ui/XUIConfigurationManager.hpp>
//_________________________________________________________________________________________________________________
@@ -86,10 +85,8 @@ namespace framework
virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
// 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);
// XEventListener
virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
@@ -112,7 +109,6 @@ namespace framework
sal_Bool isContextSensitiveToolbarNonVisible();
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xPersistentWindowState;
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xUICommandDescription;
::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xModuleCfgMgr;
::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xDocCfgMgr;
diff --git a/framework/inc/uielement/toolbarwrapper.hxx b/framework/inc/uielement/toolbarwrapper.hxx
index 4fbc14a4185c..16e41e9029b0 100644
--- a/framework/inc/uielement/toolbarwrapper.hxx
+++ b/framework/inc/uielement/toolbarwrapper.hxx
@@ -79,13 +79,6 @@ class ToolBarWrapper : public ::com::sun::star::ui::XUIFunctionListener,
// XUIElementSettings
virtual void SAL_CALL updateSettings() throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getSettings( sal_Bool bWriteable ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setSettings( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& UISettings ) throw (::com::sun::star::uno::RuntimeException);
-
- // XUIConfigurationListener
- virtual void SAL_CALL elementInserted( const ::com::sun::star::ui::ConfigurationEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL elementRemoved( const ::com::sun::star::ui::ConfigurationEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL elementReplaced( const ::com::sun::star::ui::ConfigurationEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
// XUIFunctionListener
virtual void SAL_CALL functionExecute( const ::rtl::OUString& aUIElementName, const ::rtl::OUString& aCommand ) throw (::com::sun::star::uno::RuntimeException);
@@ -99,9 +92,9 @@ class ToolBarWrapper : public ::com::sun::star::ui::XUIFunctionListener,
//-------------------------------------------------------------------------------------------------------------
protected:
virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const com::sun::star::uno::Any& aValue ) throw( com::sun::star::uno::Exception );
+ virtual void impl_fillNewData();
private:
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
com::sun::star::uno::Reference< com::sun::star::lang::XComponent > m_xToolBarManager;
com::sun::star::uno::Reference< com::sun::star::awt::XWindow > m_xToolBarWindow;
};
diff --git a/framework/inc/uielement/uicommanddescription.hxx b/framework/inc/uielement/uicommanddescription.hxx
index f1647b87ab15..9b93c8eeefb2 100644
--- a/framework/inc/uielement/uicommanddescription.hxx
+++ b/framework/inc/uielement/uicommanddescription.hxx
@@ -59,28 +59,22 @@
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <rtl/ustring.hxx>
namespace framework
{
-
-class ConfigurationAccess_UICommand;
-class UICommandDescription : public com::sun::star::lang::XTypeProvider ,
- public com::sun::star::lang::XServiceInfo ,
- public com::sun::star::container::XNameAccess ,
- private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class UICommandDescription : private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper2< com::sun::star::lang::XServiceInfo ,
+ com::sun::star::container::XNameAccess >
{
public:
UICommandDescription( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
virtual ~UICommandDescription();
// XInterface, XTypeProvider, XServiceInfo
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
-
+private:
// XNameAccess
virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
@@ -97,6 +91,7 @@ class UICommandDescription : public com::sun::star::lang::XTypeProvider ,
virtual sal_Bool SAL_CALL hasElements()
throw (::com::sun::star::uno::RuntimeException);
+public:
typedef ::std::hash_map< ::rtl::OUString,
::rtl::OUString,
OUStringHashCode,
@@ -107,7 +102,10 @@ class UICommandDescription : public com::sun::star::lang::XTypeProvider ,
OUStringHashCode,
::std::equal_to< ::rtl::OUString > > UICommandsHashMap;
- private:
+ protected:
+ UICommandDescription( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager,bool );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > impl_createConfigAccess(const ::rtl::OUString& _sName);
+ void impl_fillElements(const sal_Char* _pName);
sal_Bool m_bConfigRead;
rtl::OUString m_aPrivateResourceURL;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
diff --git a/framework/inc/uifactory/addonstoolboxfactory.hxx b/framework/inc/uifactory/addonstoolboxfactory.hxx
index 046ba883e8e1..24830a72f598 100644
--- a/framework/inc/uifactory/addonstoolboxfactory.hxx
+++ b/framework/inc/uifactory/addonstoolboxfactory.hxx
@@ -58,26 +58,22 @@
//_________________________________________________________________________________________________________________
// includes of other projects
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <rtl/ustring.hxx>
namespace framework
{
-class AddonsToolBoxFactory : public com::sun::star::lang::XTypeProvider ,
- public com::sun::star::lang::XServiceInfo ,
- public ::com::sun::star::ui::XUIElementFactory ,
- protected ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class AddonsToolBoxFactory : protected ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper2< com::sun::star::lang::XServiceInfo ,
+ com::sun::star::ui::XUIElementFactory >
{
public:
AddonsToolBoxFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
virtual ~AddonsToolBoxFactory();
// XInterface, XTypeProvider, XServiceInfo
- FWK_DECLARE_XINTERFACE
DECLARE_XSERVICEINFO
- FWK_DECLARE_XTYPEPROVIDER
// XUIElementFactory
virtual ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement > SAL_CALL createUIElement( const ::rtl::OUString& ResourceURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Args ) throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
diff --git a/framework/inc/uifactory/factoryconfiguration.hxx b/framework/inc/uifactory/factoryconfiguration.hxx
new file mode 100755
index 000000000000..ee6ca85ccfeb
--- /dev/null
+++ b/framework/inc/uifactory/factoryconfiguration.hxx
@@ -0,0 +1,127 @@
+/*************************************************************************
+ *
+ * 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: toolbarcontrollerfactory.hxx,v $
+ * $Revision: 1.7 $
+ *
+ * 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_UIFACTORY_FACTORYCONFIGURATION_HXX_
+#define __FRAMEWORK_UIFACTORY_FACTORYCONFIGURATION_HXX_
+#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/container/XContainerListener.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/lang/XMultiComponentFactory.hpp>
+#include <com/sun/star/frame/XUIControllerRegistration.hpp>
+
+//_________________________________________________________________________________________________________________
+// other includes
+//_________________________________________________________________________________________________________________
+#include <cppuhelper/implbase1.hxx>
+#include <rtl/ustring.hxx>
+
+//_________________________________________________________________________________________________________________
+// Namespace
+//_________________________________________________________________________________________________________________
+//
+
+namespace framework
+{
+
+//*****************************************************************************************************************
+// Configuration access class for PopupMenuControllerFactory implementation
+//*****************************************************************************************************************
+class ConfigurationAccess_ControllerFactory : // interfaces
+ private ThreadHelpBase,
+ public ::cppu::WeakImplHelper1< ::com::sun::star::container::XContainerListener>
+{
+public:
+ ConfigurationAccess_ControllerFactory( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rServiceManager,const ::rtl::OUString& _sRoot,bool _bAskValue = false );
+ virtual ~ConfigurationAccess_ControllerFactory();
+
+ void readConfigurationData();
+ void updateConfigurationData();
+
+ rtl::OUString getServiceFromCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule ) const;
+ rtl::OUString getValueFromCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule ) const;
+ void addServiceToCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule, const rtl::OUString& rServiceSpecifier );
+ void removeServiceFromCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule );
+ inline bool hasValue() const { return m_bAskValue; }
+
+ // container.XContainerListener
+ virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // lang.XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+private:
+ struct ControllerInfo
+ {
+ rtl::OUString m_aImplementationName;
+ rtl::OUString m_aValue;
+ ControllerInfo(const ::rtl::OUString& _aImplementationName,const ::rtl::OUString& _aValue) : m_aImplementationName(_aImplementationName),m_aValue(_aValue){}
+ ControllerInfo(){}
+ };
+ class MenuControllerMap : public std::hash_map< rtl::OUString,
+ ControllerInfo,
+ OUStringHashCode,
+ ::std::equal_to< ::rtl::OUString > >
+ {
+ inline void free()
+ {
+ MenuControllerMap().swap( *this );
+ }
+ };
+
+ sal_Bool impl_getElementProps( const ::com::sun::star::uno::Any& aElement, rtl::OUString& aCommand, rtl::OUString& aModule, rtl::OUString& aServiceSpecifier,rtl::OUString& aValue ) const;
+
+ rtl::OUString m_aPropCommand;
+ rtl::OUString m_aPropModule;
+ rtl::OUString m_aPropController;
+ rtl::OUString m_aPropValue;
+ rtl::OUString m_sRoot;
+ MenuControllerMap m_aMenuControllerMap;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xConfigProvider;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xConfigAccess;
+ sal_Bool m_bConfigAccessInitialized;
+ bool m_bAskValue;
+};
+
+} // namespace framework
+#endif // __FRAMEWORK_UIFACTORY_FACTORYCONFIGURATION_HXX_
diff --git a/framework/inc/uifactory/menubarfactory.hxx b/framework/inc/uifactory/menubarfactory.hxx
index 7bcc20358ed6..3e63559099a1 100644
--- a/framework/inc/uifactory/menubarfactory.hxx
+++ b/framework/inc/uifactory/menubarfactory.hxx
@@ -56,30 +56,36 @@
// includes of other projects
//_________________________________________________________________________________________________________________
#include <toolkit/awt/vclxmenu.hxx>
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <rtl/ustring.hxx>
namespace framework
{
- class MenuBarFactory : public com::sun::star::lang::XTypeProvider ,
- public com::sun::star::lang::XServiceInfo ,
- public ::com::sun::star::ui::XUIElementFactory ,
- protected ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+ class MenuBarFactory : protected ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper2< com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::ui::XUIElementFactory>
{
public:
MenuBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
virtual ~MenuBarFactory();
// XInterface, XTypeProvider, XServiceInfo
- FWK_DECLARE_XINTERFACE
DECLARE_XSERVICEINFO
- FWK_DECLARE_XTYPEPROVIDER
// XUIElementFactory
virtual ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement > SAL_CALL createUIElement( const ::rtl::OUString& ResourceURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Args ) throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
- private:
+ static void CreateUIElement(const ::rtl::OUString& ResourceURL
+ , const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Args
+ ,const char* _pExtraMode
+ ,const char* _pAsciiName
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& _xMenuBar
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager >& _xModuleManager
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xServiceManager);
+
+ protected:
+ MenuBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager,bool );
+
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > m_xModuleManager;
};
diff --git a/framework/inc/uifactory/popupmenucontrollerfactory.hxx b/framework/inc/uifactory/popupmenucontrollerfactory.hxx
index 2fae0e3a3897..7ba129179a44 100644
--- a/framework/inc/uifactory/popupmenucontrollerfactory.hxx
+++ b/framework/inc/uifactory/popupmenucontrollerfactory.hxx
@@ -40,61 +40,29 @@
//_________________________________________________________________________________________________________________
// 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>
+#include <uifactory/toolbarcontrollerfactory.hxx>
//_________________________________________________________________________________________________________________
// interface includes
//_________________________________________________________________________________________________________________
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XTypeProvider.hpp>
-#include <com/sun/star/lang/XMultiComponentFactory.hpp>
-#include <com/sun/star/frame/XUIControllerRegistration.hpp>
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
-#include <rtl/ustring.hxx>
namespace framework
{
-class ConfigurationAccess_PopupMenuControllerFactory;
-class PopupMenuControllerFactory : public com::sun::star::lang::XTypeProvider ,
- public com::sun::star::lang::XServiceInfo ,
- public com::sun::star::lang::XMultiComponentFactory ,
- public ::com::sun::star::frame::XUIControllerRegistration ,
- private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class ConfigurationAccess_ControllerFactory;
+class PopupMenuControllerFactory : public ToolbarControllerFactory
{
public:
PopupMenuControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
- virtual ~PopupMenuControllerFactory();
// XInterface, XTypeProvider, XServiceInfo
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
-
- // XMultiComponentFactory
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithContext( const ::rtl::OUString& aServiceSpecifier, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArgumentsAndContext( const ::rtl::OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames() throw (::com::sun::star::uno::RuntimeException);
-
- // XUIControllerRegistration
- virtual sal_Bool SAL_CALL hasController( const ::rtl::OUString& aCommandURL, const rtl::OUString& aModuleName ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL registerController( const ::rtl::OUString& aCommandURL, const rtl::OUString& aModuleName, const ::rtl::OUString& aControllerImplementationName ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deregisterController( const ::rtl::OUString& aCommandURL, const rtl::OUString& aModuleName ) throw (::com::sun::star::uno::RuntimeException);
-
- private:
- sal_Bool m_bConfigRead;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
- ConfigurationAccess_PopupMenuControllerFactory* m_pConfigAccess;
};
} // namespace framework
diff --git a/framework/inc/uifactory/statusbarcontrollerfactory.hxx b/framework/inc/uifactory/statusbarcontrollerfactory.hxx
index 1c0ee3ce8ca7..d7962a21b553 100644
--- a/framework/inc/uifactory/statusbarcontrollerfactory.hxx
+++ b/framework/inc/uifactory/statusbarcontrollerfactory.hxx
@@ -34,62 +34,30 @@
//_________________________________________________________________________________________________________________
// my own includes
//_________________________________________________________________________________________________________________
-
-#include <threadhelp/threadhelpbase.hxx>
-#include <macros/generic.hxx>
-#include <macros/xinterface.hxx>
-#include <macros/xtypeprovider.hxx>
#include <macros/xserviceinfo.hxx>
+#include <uifactory/toolbarcontrollerfactory.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/XMultiComponentFactory.hpp>
-#include <com/sun/star/frame/XUIControllerRegistration.hpp>
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
-#include <rtl/ustring.hxx>
+
namespace framework
{
-class ConfigurationAccess_StatusbarControllerFactory;
-class StatusbarControllerFactory : public com::sun::star::lang::XTypeProvider ,
- public com::sun::star::lang::XServiceInfo ,
- public com::sun::star::lang::XMultiComponentFactory ,
- public ::com::sun::star::frame::XUIControllerRegistration ,
- private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class ConfigurationAccess_ControllerFactory;
+class StatusbarControllerFactory : public ToolbarControllerFactory
{
public:
StatusbarControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
- virtual ~StatusbarControllerFactory();
// XInterface, XTypeProvider, XServiceInfo
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
-
- // XMultiComponentFactory
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithContext( const ::rtl::OUString& aServiceSpecifier, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArgumentsAndContext( const ::rtl::OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames() throw (::com::sun::star::uno::RuntimeException);
-
- // XUIControllerRegistration
- virtual sal_Bool SAL_CALL hasController( const ::rtl::OUString& aCommandURL, const rtl::OUString& aModuleName ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL registerController( const ::rtl::OUString& aCommandURL, const rtl::OUString& aModuleName, const ::rtl::OUString& aControllerImplementationName ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deregisterController( const ::rtl::OUString& aCommandURL, const rtl::OUString& aModuleName ) throw (::com::sun::star::uno::RuntimeException);
-
- private:
- sal_Bool m_bConfigRead;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
- ConfigurationAccess_StatusbarControllerFactory* m_pConfigAccess;
};
} // namespace framework
diff --git a/framework/inc/uifactory/statusbarfactory.hxx b/framework/inc/uifactory/statusbarfactory.hxx
index 96ad3d8b1b86..78f66ad45408 100644
--- a/framework/inc/uifactory/statusbarfactory.hxx
+++ b/framework/inc/uifactory/statusbarfactory.hxx
@@ -36,53 +36,33 @@
//_________________________________________________________________________________________________________________
#include <stdtypes.h>
-#include <threadhelp/threadhelpbase.hxx>
-#include <macros/generic.hxx>
-#include <macros/xinterface.hxx>
-#include <macros/xtypeprovider.hxx>
+
#include <macros/xserviceinfo.hxx>
#include <services.h>
+#include <uifactory/menubarfactory.hxx>
//_________________________________________________________________________________________________________________
// interface includes
//_________________________________________________________________________________________________________________
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XTypeProvider.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/ui/XUIElementFactory.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
-
//_________________________________________________________________________________________________________________
// includes of other projects
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
#include <rtl/ustring.hxx>
namespace framework
{
-class StatusBarFactory : public com::sun::star::lang::XTypeProvider ,
- public com::sun::star::lang::XServiceInfo ,
- public ::com::sun::star::ui::XUIElementFactory ,
- protected ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class StatusBarFactory : public MenuBarFactory
{
public:
StatusBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
- virtual ~StatusBarFactory();
// XInterface, XTypeProvider, XServiceInfo
- FWK_DECLARE_XINTERFACE
DECLARE_XSERVICEINFO
- FWK_DECLARE_XTYPEPROVIDER
// XUIElementFactory
virtual ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement > SAL_CALL createUIElement( const ::rtl::OUString& ResourceURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Args ) throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
- private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > m_xModuleManager;
};
}
diff --git a/framework/inc/uifactory/toolbarcontrollerfactory.hxx b/framework/inc/uifactory/toolbarcontrollerfactory.hxx
index cb645944763a..e346ee18347c 100644
--- a/framework/inc/uifactory/toolbarcontrollerfactory.hxx
+++ b/framework/inc/uifactory/toolbarcontrollerfactory.hxx
@@ -53,27 +53,23 @@
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase3.hxx>
#include <rtl/ustring.hxx>
namespace framework
{
-class ConfigurationAccess_ToolbarControllerFactory;
-class ToolbarControllerFactory : public com::sun::star::lang::XTypeProvider ,
- public com::sun::star::lang::XServiceInfo ,
- public com::sun::star::lang::XMultiComponentFactory ,
- public ::com::sun::star::frame::XUIControllerRegistration ,
- private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class ConfigurationAccess_ControllerFactory;
+class ToolbarControllerFactory : protected ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper3< com::sun::star::lang::XServiceInfo,
+ com::sun::star::lang::XMultiComponentFactory,
+ com::sun::star::frame::XUIControllerRegistration>
{
public:
ToolbarControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
virtual ~ToolbarControllerFactory();
// XInterface, XTypeProvider, XServiceInfo
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
// XMultiComponentFactory
@@ -86,10 +82,11 @@ class ToolbarControllerFactory : public com::sun::star::lang::XTypeProvider
virtual void SAL_CALL registerController( const ::rtl::OUString& aCommandURL, const rtl::OUString& aModuleName, const ::rtl::OUString& aControllerImplementationName ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL deregisterController( const ::rtl::OUString& aCommandURL, const rtl::OUString& aModuleName ) throw (::com::sun::star::uno::RuntimeException);
- private:
+ protected:
+ ToolbarControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager,bool );
sal_Bool m_bConfigRead;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
- ConfigurationAccess_ToolbarControllerFactory* m_pConfigAccess;
+ ConfigurationAccess_ControllerFactory* m_pConfigAccess;
};
} // namespace framework
diff --git a/framework/inc/uifactory/toolboxfactory.hxx b/framework/inc/uifactory/toolboxfactory.hxx
index 479a34c71451..4b8950a35c48 100644
--- a/framework/inc/uifactory/toolboxfactory.hxx
+++ b/framework/inc/uifactory/toolboxfactory.hxx
@@ -36,23 +36,13 @@
//_________________________________________________________________________________________________________________
#include <stdtypes.h>
-#include <threadhelp/threadhelpbase.hxx>
-#include <macros/generic.hxx>
-#include <macros/xinterface.hxx>
-#include <macros/xtypeprovider.hxx>
#include <macros/xserviceinfo.hxx>
#include <services.h>
+#include <uifactory/menubarfactory.hxx>
//_________________________________________________________________________________________________________________
// interface includes
//_________________________________________________________________________________________________________________
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XTypeProvider.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/ui/XUIElementFactory.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
-
//_________________________________________________________________________________________________________________
// includes of other projects
//_________________________________________________________________________________________________________________
@@ -62,27 +52,16 @@
namespace framework
{
-class ToolBoxFactory : public com::sun::star::lang::XTypeProvider ,
- public com::sun::star::lang::XServiceInfo ,
- public ::com::sun::star::ui::XUIElementFactory ,
- protected ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class ToolBoxFactory : public MenuBarFactory
{
public:
ToolBoxFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
- virtual ~ToolBoxFactory();
// XInterface, XTypeProvider, XServiceInfo
- FWK_DECLARE_XINTERFACE
DECLARE_XSERVICEINFO
- FWK_DECLARE_XTYPEPROVIDER
// XUIElementFactory
virtual ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement > SAL_CALL createUIElement( const ::rtl::OUString& ResourceURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Args ) throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
-
- private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > m_xModuleManager;
};
}
diff --git a/framework/inc/uifactory/uielementfactorymanager.hxx b/framework/inc/uifactory/uielementfactorymanager.hxx
index 9e4c997082e3..bbb019352e49 100644
--- a/framework/inc/uifactory/uielementfactorymanager.hxx
+++ b/framework/inc/uifactory/uielementfactorymanager.hxx
@@ -51,35 +51,85 @@
// interface includes
//_________________________________________________________________________________________________________________
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/ui/XUIElementFactory.hpp>
#include <com/sun/star/ui/XUIElementFactoryRegistration.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
#include "com/sun/star/frame/XModuleManager.hpp"
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase3.hxx>
#include <rtl/ustring.hxx>
namespace framework
{
-class ConfigurationAccess_UIElementFactoryManager;
-class UIElementFactoryManager : public com::sun::star::lang::XTypeProvider ,
- public com::sun::star::lang::XServiceInfo ,
- public ::com::sun::star::ui::XUIElementFactory ,
- public ::com::sun::star::ui::XUIElementFactoryRegistration ,
- private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+ class ConfigurationAccess_FactoryManager : // interfaces
+ // baseclasses
+ // Order is neccessary for right initialization!
+ private ThreadHelpBase ,
+ public ::cppu::WeakImplHelper1< ::com::sun::star::container::XContainerListener>
+{
+ public:
+ ConfigurationAccess_FactoryManager( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rServiceManager,const ::rtl::OUString& _sRoot );
+ virtual ~ConfigurationAccess_FactoryManager();
+
+ void readConfigurationData();
+
+ rtl::OUString getFactorySpecifierFromTypeNameModule( const rtl::OUString& rType, const rtl::OUString& rName, const rtl::OUString& rModule ) const;
+ void addFactorySpecifierToTypeNameModule( const rtl::OUString& rType, const rtl::OUString& rName, const rtl::OUString& rModule, const rtl::OUString& aServiceSpecifier );
+ void removeFactorySpecifierFromTypeNameModule( const rtl::OUString& rType, const rtl::OUString& rName, const rtl::OUString& rModule );
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > getFactoriesDescription() const;
+
+ // container.XContainerListener
+ virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // lang.XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ private:
+ class FactoryManagerMap : public std::hash_map< rtl::OUString,
+ rtl::OUString,
+ OUStringHashCode,
+ ::std::equal_to< ::rtl::OUString > >
+ {
+ inline void free()
+ {
+ FactoryManagerMap().swap( *this );
+ }
+ };
+
+ sal_Bool impl_getElementProps( const ::com::sun::star::uno::Any& rElement, rtl::OUString& rType, rtl::OUString& rName, rtl::OUString& rModule, rtl::OUString& rServiceSpecifier ) const;
+
+ rtl::OUString m_aPropType;
+ rtl::OUString m_aPropName;
+ rtl::OUString m_aPropModule;
+ rtl::OUString m_aPropFactory;
+ ::rtl::OUString m_sRoot;
+ FactoryManagerMap m_aFactoryManagerMap;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xConfigProvider;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xConfigAccess;
+ sal_Bool m_bConfigAccessInitialized;
+ bool m_bConfigDirty;
+};
+
+
+class UIElementFactoryManager : private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper3< ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::ui::XUIElementFactory,
+ ::com::sun::star::ui::XUIElementFactoryRegistration>
{
public:
UIElementFactoryManager( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
virtual ~UIElementFactoryManager();
// XInterface, XTypeProvider, XServiceInfo
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
// XUIElementFactory
@@ -92,12 +142,11 @@ class UIElementFactoryManager : public com::sun::star::lang::XTypeProvider
virtual void SAL_CALL deregisterFactory( const ::rtl::OUString& aType, const ::rtl::OUString& aName, const ::rtl::OUString& aModuleIdentifier ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
private:
- void RetrieveTypeNameFromResourceURL( const ::rtl::OUString& aResourceURL, rtl::OUString& aType, rtl::OUString& aName );
sal_Bool m_bConfigRead;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > m_xModuleManager;
- ConfigurationAccess_UIElementFactoryManager* m_pConfigAccess;
+ ConfigurationAccess_FactoryManager* m_pConfigAccess;
};
} // namespace framework
diff --git a/framework/inc/uifactory/windowcontentfactorymanager.hxx b/framework/inc/uifactory/windowcontentfactorymanager.hxx
index ed58aa40dc13..9d96a9d6086e 100644
--- a/framework/inc/uifactory/windowcontentfactorymanager.hxx
+++ b/framework/inc/uifactory/windowcontentfactorymanager.hxx
@@ -51,46 +51,41 @@
// interface includes
//_________________________________________________________________________________________________________________
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include "com/sun/star/frame/XModuleManager.hpp"
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <rtl/ustring.hxx>
namespace framework
{
-class ConfigurationAccess_WindowContentFactoryManager;
-class WindowContentFactoryManager : public com::sun::star::lang::XTypeProvider ,
- public com::sun::star::lang::XServiceInfo ,
- public com::sun::star::lang::XSingleComponentFactory ,
- private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class ConfigurationAccess_FactoryManager;
+class WindowContentFactoryManager : private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper2< com::sun::star::lang::XServiceInfo ,
+ com::sun::star::lang::XSingleComponentFactory>
{
public:
WindowContentFactoryManager( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
virtual ~WindowContentFactoryManager();
// XInterface, XTypeProvider, XServiceInfo
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
// XSingleComponentFactory
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithContext( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArgumentsAndContext( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ static void RetrieveTypeNameFromResourceURL( const ::rtl::OUString& aResourceURL, rtl::OUString& aType, rtl::OUString& aName );
private:
- void RetrieveTypeNameFromResourceURL( const ::rtl::OUString& aResourceURL, rtl::OUString& aType, rtl::OUString& aName );
sal_Bool m_bConfigRead;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > m_xModuleManager;
- ConfigurationAccess_WindowContentFactoryManager* m_pConfigAccess;
+ ConfigurationAccess_FactoryManager* m_pConfigAccess;
};
} // namespace framework
diff --git a/framework/inc/xml/eventsdocumenthandler.hxx b/framework/inc/xml/eventsdocumenthandler.hxx
index 48d197257555..db490dbb6c18 100644
--- a/framework/inc/xml/eventsdocumenthandler.hxx
+++ b/framework/inc/xml/eventsdocumenthandler.hxx
@@ -48,7 +48,7 @@
//_________________________________________________________________________________________________________________
#include <threadhelp/threadhelpbase.hxx>
#include <rtl/ustring.hxx>
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase1.hxx>
#include <hash_map>
#include <stdtypes.h>
@@ -62,9 +62,8 @@ namespace framework{
//*****************************************************************************************************************
// Hash code function for using in all hash maps of follow implementation.
-class OReadEventsDocumentHandler : public ::com::sun::star::xml::sax::XDocumentHandler,
- private ThreadHelpBase, // Struct for right initalization of lock member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class OReadEventsDocumentHandler : private ThreadHelpBase, // Struct for right initalization of lock member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XDocumentHandler >
{
public:
enum Events_XML_Entry
@@ -88,15 +87,7 @@ class OReadEventsDocumentHandler : public ::com::sun::star::xml::sax::XDocument
};
OReadEventsDocumentHandler( EventsConfig& aItems );
- virtual ~OReadEventsDocumentHandler();
- // XInterface
- virtual void SAL_CALL acquire() throw()
- { OWeakObject::acquire(); }
- virtual void SAL_CALL release() throw()
- { OWeakObject::release(); }
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
- const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
// XDocumentHandler
virtual void SAL_CALL startDocument(void)
@@ -135,6 +126,9 @@ class OReadEventsDocumentHandler : public ::com::sun::star::xml::sax::XDocument
throw( ::com::sun::star::xml::sax::SAXException,
::com::sun::star::uno::RuntimeException );
+ protected:
+ virtual ~OReadEventsDocumentHandler();
+
private:
::rtl::OUString getErrorLineString();
diff --git a/framework/inc/xml/imagesdocumenthandler.hxx b/framework/inc/xml/imagesdocumenthandler.hxx
index 9dfee8acb36a..a58da84b89aa 100644
--- a/framework/inc/xml/imagesdocumenthandler.hxx
+++ b/framework/inc/xml/imagesdocumenthandler.hxx
@@ -45,7 +45,7 @@
#include <xml/imagesconfiguration.hxx>
#include <threadhelp/threadhelpbase.hxx>
#include <rtl/ustring.hxx>
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase1.hxx>
#include <hash_map>
#include <stdtypes.h>
@@ -59,9 +59,8 @@ namespace framework{
//*****************************************************************************************************************
// Hash code function for using in all hash maps of follow implementation.
-class OReadImagesDocumentHandler : public ::com::sun::star::xml::sax::XDocumentHandler,
- private ThreadHelpBase, // Struct for right initalization of lock member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class OReadImagesDocumentHandler : private ThreadHelpBase, // Struct for right initalization of lock member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XDocumentHandler >
{
public:
enum Image_XML_Entry
@@ -92,14 +91,6 @@ class OReadImagesDocumentHandler : public ::com::sun::star::xml::sax::XDocumentH
OReadImagesDocumentHandler( ImageListsDescriptor& aItems );
virtual ~OReadImagesDocumentHandler();
- // XInterface
- virtual void SAL_CALL acquire() throw()
- { OWeakObject::acquire(); }
- virtual void SAL_CALL release() throw()
- { OWeakObject::release(); }
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
- const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
-
// XDocumentHandler
virtual void SAL_CALL startDocument(void)
throw ( ::com::sun::star::xml::sax::SAXException,
diff --git a/framework/inc/xml/menudocumenthandler.hxx b/framework/inc/xml/menudocumenthandler.hxx
index 6cf8982c05b1..a85a4c200086 100644
--- a/framework/inc/xml/menudocumenthandler.hxx
+++ b/framework/inc/xml/menudocumenthandler.hxx
@@ -42,13 +42,14 @@
#include <com/sun/star/lang/XSingleComponentFactory.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/uno/XComponentContext.hpp>
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
#include <threadhelp/threadhelpbase.hxx>
#include <rtl/ustring.hxx>
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
//_________________________________________________________________________________________________________________
@@ -57,22 +58,13 @@
namespace framework{
-class ReadMenuDocumentHandlerBase : public ::com::sun::star::xml::sax::XDocumentHandler,
- public ThreadHelpBase, // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class ReadMenuDocumentHandlerBase : public ThreadHelpBase, // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XDocumentHandler >
{
public:
ReadMenuDocumentHandlerBase();
virtual ~ReadMenuDocumentHandlerBase();
- // XInterface
- virtual void SAL_CALL acquire() throw()
- { OWeakObject::acquire(); }
- virtual void SAL_CALL release() throw()
- { OWeakObject::release(); }
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
- const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
-
// XDocumentHandler
virtual void SAL_CALL startDocument(void)
throw ( ::com::sun::star::xml::sax::SAXException,
@@ -295,6 +287,7 @@ class OReadMenuPopupHandler : public ReadMenuDocumentHandlerBase
sal_Bool m_bMenuMode;
com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > m_xMenuContainer;
com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleComponentFactory > m_xContainerFactory;
+ com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xComponentContext;
NextElementClose m_nNextElementExpected;
}; // OReadMenuPopupHandler
diff --git a/framework/inc/xml/saxnamespacefilter.hxx b/framework/inc/xml/saxnamespacefilter.hxx
index f9fb983047b2..9f0a5bbf2646 100644
--- a/framework/inc/xml/saxnamespacefilter.hxx
+++ b/framework/inc/xml/saxnamespacefilter.hxx
@@ -36,7 +36,7 @@
#include <xml/xmlnamespaces.hxx>
#include <rtl/ustring.hxx>
#include <vcl/menu.hxx>
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase1.hxx>
#include <stack>
@@ -47,22 +47,13 @@
namespace framework
{
-class SaxNamespaceFilter : public ::com::sun::star::xml::sax::XDocumentHandler,
- public ThreadHelpBase, // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class SaxNamespaceFilter : public ThreadHelpBase, // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XDocumentHandler >
{
public:
SaxNamespaceFilter( ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler >& rSax1DocumentHandler );
virtual ~SaxNamespaceFilter();
- // XInterface
- virtual void SAL_CALL acquire() throw()
- { OWeakObject::acquire(); }
- virtual void SAL_CALL release() throw()
- { OWeakObject::release(); }
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
- const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
-
// XDocumentHandler
virtual void SAL_CALL startDocument(void)
throw ( ::com::sun::star::xml::sax::SAXException,
diff --git a/framework/inc/xml/statusbardocumenthandler.hxx b/framework/inc/xml/statusbardocumenthandler.hxx
index 54ee919eccb7..6e66fa6ae403 100644
--- a/framework/inc/xml/statusbardocumenthandler.hxx
+++ b/framework/inc/xml/statusbardocumenthandler.hxx
@@ -48,7 +48,7 @@
//_________________________________________________________________________________________________________________
#include <threadhelp/threadhelpbase.hxx>
#include <rtl/ustring.hxx>
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase1.hxx>
#include <hash_map>
#include <stdtypes.h>
@@ -62,9 +62,8 @@ namespace framework{
//*****************************************************************************************************************
// Hash code function for using in all hash maps of follow implementation.
-class OReadStatusBarDocumentHandler : public ::com::sun::star::xml::sax::XDocumentHandler,
- private ThreadHelpBase, // Struct for right initalization of lock member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class OReadStatusBarDocumentHandler : private ThreadHelpBase, // Struct for right initalization of lock member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XDocumentHandler >
{
public:
enum StatusBar_XML_Entry
@@ -92,14 +91,6 @@ class OReadStatusBarDocumentHandler : public ::com::sun::star::xml::sax::XDocu
OReadStatusBarDocumentHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >& aStatusBarItems );
virtual ~OReadStatusBarDocumentHandler();
- // XInterface
- virtual void SAL_CALL acquire() throw()
- { OWeakObject::acquire(); }
- virtual void SAL_CALL release() throw()
- { OWeakObject::release(); }
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
- const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
-
// XDocumentHandler
virtual void SAL_CALL startDocument(void)
throw ( ::com::sun::star::xml::sax::SAXException,
diff --git a/framework/inc/xml/toolboxdocumenthandler.hxx b/framework/inc/xml/toolboxdocumenthandler.hxx
index e462636254ae..ccf64e6d0033 100644
--- a/framework/inc/xml/toolboxdocumenthandler.hxx
+++ b/framework/inc/xml/toolboxdocumenthandler.hxx
@@ -44,7 +44,7 @@
//_________________________________________________________________________________________________________________
#include <threadhelp/threadhelpbase.hxx>
#include <rtl/ustring.hxx>
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase1.hxx>
#include <stdtypes.h>
//_________________________________________________________________________________________________________________
@@ -56,9 +56,8 @@ namespace framework{
//*****************************************************************************************************************
// Hash code function for using in all hash maps of follow implementation.
-class OReadToolBoxDocumentHandler : public ::com::sun::star::xml::sax::XDocumentHandler,
- private ThreadHelpBase, // Struct for right initalization of lock member! Must be first of baseclasses.
- public ::cppu::OWeakObject
+class OReadToolBoxDocumentHandler : private ThreadHelpBase, // Struct for right initalization of lock member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XDocumentHandler >
{
public:
enum ToolBox_XML_Entry
@@ -91,14 +90,6 @@ class OReadToolBoxDocumentHandler : public ::com::sun::star::xml::sax::XDocument
OReadToolBoxDocumentHandler( const ::com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer >& rItemContainer );
virtual ~OReadToolBoxDocumentHandler();
- // XInterface
- virtual void SAL_CALL acquire() throw()
- { OWeakObject::acquire(); }
- virtual void SAL_CALL release() throw()
- { OWeakObject::release(); }
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
- const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
-
// XDocumentHandler
virtual void SAL_CALL startDocument(void)
throw ( ::com::sun::star::xml::sax::SAXException,
diff --git a/framework/prj/d.lst b/framework/prj/d.lst
index bf7a67d091e9..a8640138ba25 100644
--- a/framework/prj/d.lst
+++ b/framework/prj/d.lst
@@ -30,15 +30,14 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\statusbar
..\inc\helper\imageproducer.hxx %_DEST%\inc%_EXT%\framework\imageproducer.hxx
..\inc\helper\acceleratorinfo.hxx %_DEST%\inc%_EXT%\framework\acceleratorinfo.hxx
..\inc\helper\actiontriggerhelper.hxx %_DEST%\inc%_EXT%\framework\actiontriggerhelper.hxx
-..\inc\classes\menuconfiguration.hxx %_DEST%\inc%_EXT%\framework\menuconfiguration.hxx
+..\inc\xml\menuconfiguration.hxx %_DEST%\inc%_EXT%\framework\menuconfiguration.hxx
..\inc\classes\bmkmenu.hxx %_DEST%\inc%_EXT%\framework\bmkmenu.hxx
-..\inc\classes\toolboxconfiguration.hxx %_DEST%\inc%_EXT%\framework\toolboxconfiguration.hxx
-..\inc\classes\statusbarconfiguration.hxx %_DEST%\inc%_EXT%\framework\statusbarconfiguration.hxx
-..\inc\classes\eventsconfiguration.hxx %_DEST%\inc%_EXT%\framework\eventsconfiguration.hxx
-..\inc\classes\imagesconfiguration.hxx %_DEST%\inc%_EXT%\framework\imagesconfiguration.hxx
+..\inc\xml\toolboxconfiguration.hxx %_DEST%\inc%_EXT%\framework\toolboxconfiguration.hxx
+..\inc\xml\statusbarconfiguration.hxx %_DEST%\inc%_EXT%\framework\statusbarconfiguration.hxx
+..\inc\xml\eventsconfiguration.hxx %_DEST%\inc%_EXT%\framework\eventsconfiguration.hxx
+..\inc\xml\imagesconfiguration.hxx %_DEST%\inc%_EXT%\framework\imagesconfiguration.hxx
..\inc\classes\addonsoptions.hxx %_DEST%\inc%_EXT%\framework\addonsoptions.hxx
..\inc\dispatch\interaction.hxx %_DEST%\inc%_EXT%\framework\interaction.hxx
-..\inc\classes\addonsoptions.hxx %_DEST%\inc%_EXT%\framework\addonsoptions.hxx
..\inc\classes\addonmenu.hxx %_DEST%\inc%_EXT%\framework\addonmenu.hxx
..\inc\classes\sfxhelperfunctions.hxx %_DEST%\inc%_EXT%\framework\sfxhelperfunctions.hxx
..\inc\helper\configimporter.hxx %_DEST%\inc%_EXT%\framework\configimporter.hxx
diff --git a/framework/source/accelerators/acceleratorcache.cxx b/framework/source/accelerators/acceleratorcache.cxx
index 7737fcc776ff..59c244169342 100644
--- a/framework/source/accelerators/acceleratorcache.cxx
+++ b/framework/source/accelerators/acceleratorcache.cxx
@@ -127,10 +127,12 @@ AcceleratorCache::TKeyList AcceleratorCache::getAllKeys() const
// SAFE -> ----------------------------------
ReadGuard aReadLock(m_aLock);
+ lKeys.reserve(m_lKey2Commands.size());
TKey2Commands::const_iterator pIt;
+ TKey2Commands::const_iterator pEnd = m_lKey2Commands.end();
for ( pIt = m_lKey2Commands.begin();
- pIt != m_lKey2Commands.end() ;
+ pIt != pEnd ;
++pIt )
{
lKeys.push_back(pIt->first);
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx
index 971e4c00024b..d19032660de5 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -61,10 +61,6 @@
// other includes
#include <vcl/svapp.hxx>
-#ifndef __FRAMEWORK_ACCELERATORS_KEYMAPPING_HXX_
-#include <accelerators/keymapping.hxx>
-#endif
-
#ifndef _COM_SUN_STAR_CONTAINER_XNAMED_HPP_
#include <com/sun/star/container/XNamed.hpp>
#endif
@@ -115,6 +111,23 @@ namespace framework
namespace fpc = ::framework::pattern::configuration;
#endif
+ ::rtl::OUString lcl_getKeyString(salhelper::SingletonRef<framework::KeyMapping>& _rKeyMapping, const css::awt::KeyEvent& aKeyEvent)
+ {
+ const sal_Int32 nBeginIndex = 4; // "KEY_" is the prefix of a identifier...
+ ::rtl::OUStringBuffer sKeyBuffer((_rKeyMapping->mapCodeToIdentifier(aKeyEvent.KeyCode)).copy(nBeginIndex));
+
+ if ( (aKeyEvent.Modifiers & css::awt::KeyModifier::SHIFT) == css::awt::KeyModifier::SHIFT )
+ sKeyBuffer.appendAscii("_SHIFT");
+ if ( (aKeyEvent.Modifiers & css::awt::KeyModifier::MOD1 ) == css::awt::KeyModifier::MOD1 )
+ sKeyBuffer.appendAscii("_MOD1");
+ if ( (aKeyEvent.Modifiers & css::awt::KeyModifier::MOD2 ) == css::awt::KeyModifier::MOD2 )
+ sKeyBuffer.appendAscii("_MOD2");
+ if ( (aKeyEvent.Modifiers & css::awt::KeyModifier::MOD3 ) == css::awt::KeyModifier::MOD3 )
+ sKeyBuffer.appendAscii("_MOD3");
+
+ return sKeyBuffer.makeStringAndClear();
+ }
+
//-----------------------------------------------
// XInterface, XTypeProvider
DEFINE_XINTERFACE_6(XMLBasedAcceleratorConfiguration ,
@@ -285,7 +298,7 @@ css::uno::Sequence< css::uno::Any > SAL_CALL XMLBasedAcceleratorConfiguration::g
continue;
AcceleratorCache::TKeyList lKeys = rCache.getKeysByCommand(rCommand);
- if (lKeys.size()<1)
+ if ( lKeys.empty() )
continue;
css::uno::Any& rAny = lPreferredOnes[i];
@@ -694,6 +707,7 @@ XCUBasedAcceleratorConfiguration::XCUBasedAcceleratorConfiguration(const css::un
, m_pPrimaryWriteCache(0 )
, m_pSecondaryWriteCache(0 )
{
+ static const ::rtl::OUString CFG_ENTRY_ACCELERATORS(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Accelerators"));
m_xCfg = css::uno::Reference< css::container::XNameAccess > (
::comphelper::ConfigurationHelper::openConfig( m_xSMGR, CFG_ENTRY_ACCELERATORS, ::comphelper::ConfigurationHelper::E_ALL_LOCALES ),
css::uno::UNO_QUERY );
@@ -714,8 +728,10 @@ css::uno::Sequence< css::awt::KeyEvent > SAL_CALL XCUBasedAcceleratorConfigurati
AcceleratorCache::TKeyList lKeys = impl_getCFG(sal_True).getAllKeys(); //get keys from PrimaryKeys set
AcceleratorCache::TKeyList lSecondaryKeys = impl_getCFG(sal_False).getAllKeys(); //get keys from SecondaryKeys set
+ lKeys.reserve(lKeys.size()+lSecondaryKeys.size());
AcceleratorCache::TKeyList::const_iterator pIt;
- for ( pIt = lSecondaryKeys.begin(); pIt != lSecondaryKeys.end(); ++pIt )
+ AcceleratorCache::TKeyList::const_iterator pEnd = lSecondaryKeys.end();
+ for ( pIt = lSecondaryKeys.begin(); pIt != pEnd; ++pIt )
lKeys.push_back(*pIt);
return lKeys.getAsConstList();
@@ -753,7 +769,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::setKeyEvent(const css::awt::KeyE
throw(css::lang::IllegalArgumentException,
css::uno::RuntimeException )
{
- RTL_LOGFILE_PRODUCT_CONTEXT( aLog1, " start XCUBasedAcceleratorConfiguration::setKeyEvent" );
+ RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "XCUBasedAcceleratorConfiguration::setKeyEvent" );
if (
(aKeyEvent.KeyCode == 0) &&
@@ -832,8 +848,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::setKeyEvent(const css::awt::KeyE
aWriteLock.unlock();
// <- SAFE ----------------------------------
-
- RTL_LOGFILE_PRODUCT_CONTEXT( aLog2, " end XCUBasedAcceleratorConfiguration::setKeyEvent" );
}
//-----------------------------------------------
@@ -959,7 +973,7 @@ css::uno::Sequence< css::uno::Any > SAL_CALL XCUBasedAcceleratorConfiguration::g
continue;
AcceleratorCache::TKeyList lKeys = rCache.getKeysByCommand(rCommand);
- if (lKeys.size()<1)
+ if ( lKeys.empty() )
continue;
AcceleratorCache::TKeyList::const_iterator pPreferredKey = lcl_getPreferredKey(lKeys);
@@ -1013,7 +1027,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::reload()
throw(css::uno::Exception ,
css::uno::RuntimeException)
{
- RTL_LOGFILE_PRODUCT_CONTEXT( aLog1, " start XCUBasedAcceleratorConfiguration::reload()" );
+ RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "XCUBasedAcceleratorConfiguration::reload()" );
// SAFE -> ----------------------------------
WriteGuard aWriteLock(m_aLock);
@@ -1047,8 +1061,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::reload()
aWriteLock.unlock();
// <- SAFE ----------------------------------
-
- RTL_LOGFILE_PRODUCT_CONTEXT( aLog2, " end XCUBasedAcceleratorConfiguration::reload()" );
}
//-----------------------------------------------
@@ -1056,7 +1068,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::store()
throw(css::uno::Exception ,
css::uno::RuntimeException)
{
- RTL_LOGFILE_PRODUCT_CONTEXT( aLog1, " start XCUBasedAcceleratorConfiguration::store()" );
+ RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "XCUBasedAcceleratorConfiguration::store()" );
// SAFE -> ----------------------------------
ReadGuard aReadLock(m_aLock);
@@ -1078,17 +1090,73 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::store()
aReadLock.unlock();
// <- SAFE ----------------------------------
-
- RTL_LOGFILE_PRODUCT_CONTEXT( aLog2, " end XCUBasedAcceleratorConfiguration::store()" );
}
//-----------------------------------------------
-void SAL_CALL XCUBasedAcceleratorConfiguration::storeToStorage(const css::uno::Reference< css::embed::XStorage >& /*xStorage*/)
+void SAL_CALL XCUBasedAcceleratorConfiguration::storeToStorage(const css::uno::Reference< css::embed::XStorage >& xStorage)
throw(css::uno::Exception ,
css::uno::RuntimeException)
{
- // todo implement me
// use m_aCache + old AcceleratorXMLWriter to store data directly on storage given as parameter ...
+ if (!xStorage.is())
+ return;
+
+ long nOpenModes = css::embed::ElementModes::READWRITE;
+ css::uno::Reference< css::embed::XStorage > xAcceleratorTypeStorage = xStorage->openStorageElement(::rtl::OUString::createFromAscii("accelerator"), nOpenModes);
+ if (!xAcceleratorTypeStorage.is())
+ return;
+
+ css::uno::Reference< css::io::XStream > xStream = xAcceleratorTypeStorage->openStreamElement(::rtl::OUString::createFromAscii("current"), nOpenModes);
+ css::uno::Reference< css::io::XOutputStream > xOut;
+ if (xStream.is())
+ xOut = xStream->getOutputStream();
+ if (!xOut.is())
+ throw css::io::IOException(
+ ::rtl::OUString::createFromAscii("Could not open accelerator configuration for saving."),
+ static_cast< ::cppu::OWeakObject* >(this));
+
+ // the original m_aCache has been split into primay cache and secondary cache...
+ // we should merge them before storing to storage
+ // SAFE -> ----------------------------------
+ WriteGuard aWriteLock(m_aLock);
+
+ AcceleratorCache aCache;
+ if (m_pPrimaryWriteCache != 0)
+ aCache.takeOver(*m_pPrimaryWriteCache);
+ else
+ aCache.takeOver(m_aPrimaryReadCache);
+
+ AcceleratorCache::TKeyList lKeys;
+ AcceleratorCache::TKeyList::const_iterator pIt;
+ if (m_pSecondaryWriteCache!=0)
+ {
+ lKeys = m_pSecondaryWriteCache->getAllKeys();
+ for ( pIt=lKeys.begin(); pIt!=lKeys.end(); ++pIt )
+ aCache.setKeyCommandPair(*pIt, m_pSecondaryWriteCache->getCommandByKey(*pIt));
+ }
+ else
+ {
+ lKeys = m_aSecondaryReadCache.getAllKeys();
+ for ( pIt=lKeys.begin(); pIt!=lKeys.end(); ++pIt )
+ aCache.setKeyCommandPair(*pIt, m_aSecondaryReadCache.getCommandByKey(*pIt));
+ }
+
+ aWriteLock.unlock();
+ // <- SAFE ----------------------------------
+
+ css::uno::Reference< css::io::XTruncate > xClearable(xOut, css::uno::UNO_QUERY_THROW);
+ xClearable->truncate();
+ css::uno::Reference< css::io::XSeekable > xSeek(xOut, css::uno::UNO_QUERY);
+ if (xSeek.is())
+ xSeek->seek(0);
+
+ css::uno::Reference< css::xml::sax::XDocumentHandler > xWriter (m_xSMGR->createInstance(SERVICENAME_SAXWRITER), css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::io::XActiveDataSource> xDataSource(xWriter , css::uno::UNO_QUERY_THROW);
+ xDataSource->setOutputStream(xOut);
+
+ // write into the stream
+ AcceleratorConfigurationWriter aWriter(aCache, xWriter);
+ aWriter.flush();
}
//-----------------------------------------------
@@ -1174,7 +1242,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::removeResetListener(const css::u
void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util::ChangesEvent& aEvent)
throw(css::uno::RuntimeException)
{
- RTL_LOGFILE_PRODUCT_CONTEXT( aLog1, " start XCUBasedAcceleratorConfiguration::changesOccurred()" );
+ RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "XCUBasedAcceleratorConfiguration::changesOccurred()" );
css::uno::Reference< css::container::XHierarchicalNameAccess > xHAccess;
aEvent.Base >>= xHAccess;
@@ -1222,8 +1290,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util:
reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey);
}
}
-
- RTL_LOGFILE_PRODUCT_CONTEXT( aLog2, " end XCUBasedAcceleratorConfiguration::changesOccurred()" );
}
//-----------------------------------------------
@@ -1246,7 +1312,6 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( sal_Bool bPreferred, const
xModules->getByName(m_sModuleCFG) >>= xAccess;
}
- static KeyMapping aKeyMapping;
const ::rtl::OUString sIsoLang = impl_ts_getLocale().toISO();
const ::rtl::OUString sDefaultLocale = ::rtl::OUString::createFromAscii("en-US");
@@ -1298,7 +1363,7 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( sal_Bool bPreferred, const
sal_Int32 nIndex = 0;
::rtl::OUString sKeyCommand = sKey.getToken(0, '_', nIndex);
::rtl::OUString sPrefix = ::rtl::OUString::createFromAscii("KEY_");
- aKeyEvent.KeyCode = aKeyMapping.mapIdentifierToCode(sPrefix + sKeyCommand);
+ aKeyEvent.KeyCode = m_rKeyMapping->mapIdentifierToCode(sPrefix + sKeyCommand);
css::uno::Sequence< ::rtl::OUString > sToken(4);
const sal_Int32 nToken = 4;
@@ -1464,18 +1529,7 @@ void XCUBasedAcceleratorConfiguration::insertKeyToConfiguration( const css::awt:
xModules->getByName(m_sModuleCFG) >>= xContainer;
}
- KeyMapping aKeyMapping;
- const sal_Int32 nBeginIndex = 4; // "KEY_" is the prefix of a identifier...
- ::rtl::OUString sKey = (aKeyMapping.mapCodeToIdentifier(aKeyEvent.KeyCode)).copy(nBeginIndex);
-
- if ( (aKeyEvent.Modifiers & css::awt::KeyModifier::SHIFT) == css::awt::KeyModifier::SHIFT )
- sKey += ::rtl::OUString::createFromAscii("_SHIFT");
- if ( (aKeyEvent.Modifiers & css::awt::KeyModifier::MOD1 ) == css::awt::KeyModifier::MOD1 )
- sKey += ::rtl::OUString::createFromAscii("_MOD1");
- if ( (aKeyEvent.Modifiers & css::awt::KeyModifier::MOD2 ) == css::awt::KeyModifier::MOD2 )
- sKey += ::rtl::OUString::createFromAscii("_MOD2");
- if ( (aKeyEvent.Modifiers & css::awt::KeyModifier::MOD3 ) == css::awt::KeyModifier::MOD3 )
- sKey += ::rtl::OUString::createFromAscii("_MOD3");
+ const ::rtl::OUString sKey = lcl_getKeyString(m_rKeyMapping,aKeyEvent);
css::uno::Reference< css::container::XNameAccess > xKey;
css::uno::Reference< css::container::XNameContainer > xCommand;
if ( !xContainer->hasByName(sKey) )
@@ -1516,19 +1570,7 @@ void XCUBasedAcceleratorConfiguration::removeKeyFromConfiguration( const css::aw
xModules->getByName(m_sModuleCFG) >>= xContainer;
}
- KeyMapping aKeyMapping;
- const sal_Int32 nBeginIndex = 4; // "KEY_" is the prefix of a identifier...
- ::rtl::OUString sKey = (aKeyMapping.mapCodeToIdentifier(aKeyEvent.KeyCode)).copy(nBeginIndex);
-
- if ( (aKeyEvent.Modifiers & css::awt::KeyModifier::SHIFT) == css::awt::KeyModifier::SHIFT )
- sKey += ::rtl::OUString::createFromAscii("_SHIFT");
- if ( (aKeyEvent.Modifiers & css::awt::KeyModifier::MOD1 ) == css::awt::KeyModifier::MOD1 )
- sKey += ::rtl::OUString::createFromAscii("_MOD1");
- if ( (aKeyEvent.Modifiers & css::awt::KeyModifier::MOD2 ) == css::awt::KeyModifier::MOD2 )
- sKey += ::rtl::OUString::createFromAscii("_MOD2");
- if ( (aKeyEvent.Modifiers & css::awt::KeyModifier::MOD3 ) == css::awt::KeyModifier::MOD3 )
- sKey += ::rtl::OUString::createFromAscii("_MOD3");
-
+ const ::rtl::OUString sKey = lcl_getKeyString(m_rKeyMapping,aKeyEvent);
xContainer->removeByName(sKey);
}
@@ -1550,13 +1592,12 @@ void XCUBasedAcceleratorConfiguration::reloadChanged( const ::rtl::OUString& sPr
xModules->getByName(sModule) >>= xContainer;
}
- KeyMapping aKeyMapping;
css::awt::KeyEvent aKeyEvent;
::rtl::OUString sKeyIdentifier;
sal_Int32 nIndex = 0;
sKeyIdentifier = sKey.getToken(0, '_', nIndex);
- aKeyEvent.KeyCode = aKeyMapping.mapIdentifierToCode(::rtl::OUString::createFromAscii("KEY_")+sKeyIdentifier);
+ aKeyEvent.KeyCode = m_rKeyMapping->mapIdentifierToCode(::rtl::OUString::createFromAscii("KEY_")+sKeyIdentifier);
css::uno::Sequence< ::rtl::OUString > sToken(3);
const sal_Int32 nToken = 3;
@@ -1677,4 +1718,3 @@ AcceleratorCache& XCUBasedAcceleratorConfiguration::impl_getCFG(sal_Bool bPrefer
}
} // namespace framework
-
diff --git a/framework/source/accelerators/acceleratorexecute.cxx b/framework/source/accelerators/acceleratorexecute.cxx
index 89f43cebc65d..529070f72ec9 100644
--- a/framework/source/accelerators/acceleratorexecute.cxx
+++ b/framework/source/accelerators/acceleratorexecute.cxx
@@ -123,7 +123,7 @@ void AcceleratorExecute::init(const css::uno::Reference< css::lang::XMultiServic
// <- SAFE ------------------------------
css::uno::Reference< css::frame::XDispatchProvider > xDispatcher(
- xSMGR->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")),
+ xSMGR->createInstance(SERVICENAME_DESKTOP),
css::uno::UNO_QUERY_THROW);
// SAFE -> ------------------------------
@@ -276,7 +276,7 @@ KeyCode AcceleratorExecute::st_AWTKey2VCLKey(const css::awt::KeyEvent& aAWTKey)
css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::impl_st_openGlobalConfig(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
{
css::uno::Reference< css::ui::XAcceleratorConfiguration > xAccCfg(
- xSMGR->createInstance(::rtl::OUString::createFromAscii("com.sun.star.ui.GlobalAcceleratorConfiguration")),
+ xSMGR->createInstance(SERVICENAME_GLOBALACCELERATORCONFIGURATION),
css::uno::UNO_QUERY_THROW);
return xAccCfg;
}
@@ -286,7 +286,7 @@ css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::im
const css::uno::Reference< css::frame::XFrame >& xFrame)
{
css::uno::Reference< css::frame::XModuleManager > xModuleDetection(
- xSMGR->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager")),
+ xSMGR->createInstance(SERVICENAME_MODULEMANAGER),
css::uno::UNO_QUERY_THROW);
::rtl::OUString sModule;
@@ -300,7 +300,7 @@ css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::im
{ return css::uno::Reference< css::ui::XAcceleratorConfiguration >(); }
css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xUISupplier(
- xSMGR->createInstance(::rtl::OUString::createFromAscii("com.sun.star.ui.ModuleUIConfigurationManagerSupplier")),
+ xSMGR->createInstance(SERVICENAME_MODULEUICONFIGURATIONMANAGERSUPPLIER),
css::uno::UNO_QUERY_THROW);
css::uno::Reference< css::ui::XUIConfigurationManager > xUIManager = xUISupplier->getUIConfigurationManager(sModule);
@@ -331,7 +331,7 @@ css::uno::Reference< css::util::XURLTransformer > AcceleratorExecute::impl_ts_ge
// <- SAFE ----------------------------------
css::uno::Reference< css::util::XURLTransformer > xParser(
- xSMGR->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer")),
+ xSMGR->createInstance(SERVICENAME_URLTRANSFORMER),
css::uno::UNO_QUERY_THROW);
// SAFE -> ----------------------------------
diff --git a/framework/source/accelerators/moduleacceleratorconfiguration.cxx b/framework/source/accelerators/moduleacceleratorconfiguration.cxx
index 974f57d0af60..35f5ab85eb57 100644
--- a/framework/source/accelerators/moduleacceleratorconfiguration.cxx
+++ b/framework/source/accelerators/moduleacceleratorconfiguration.cxx
@@ -109,6 +109,7 @@ DEFINE_INIT_SERVICE(ModuleAcceleratorConfiguration,
ModuleAcceleratorConfiguration::ModuleAcceleratorConfiguration(const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR)
: XCUBasedAcceleratorConfiguration(xSMGR)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleAcceleratorConfiguration::ModuleAcceleratorConfiguration" );
}
//-----------------------------------------------
@@ -122,6 +123,7 @@ void SAL_CALL ModuleAcceleratorConfiguration::initialize(const css::uno::Sequenc
throw(css::uno::Exception ,
css::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleAcceleratorConfiguration::initialize" );
// SAFE -> ----------------------------------
WriteGuard aWriteLock(m_aLock);
@@ -143,6 +145,7 @@ void SAL_CALL ModuleAcceleratorConfiguration::initialize(const css::uno::Sequenc
//-----------------------------------------------
void ModuleAcceleratorConfiguration::impl_ts_fillCache()
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleAcceleratorConfiguration::impl_ts_fillCache" );
// SAFE -> ----------------------------------
ReadGuard aReadLock(m_aLock);
::rtl::OUString sModule = m_sModule;
diff --git a/framework/source/accelerators/presethandler.cxx b/framework/source/accelerators/presethandler.cxx
index 1c5984184f0f..5ae8a7280b2a 100644
--- a/framework/source/accelerators/presethandler.cxx
+++ b/framework/source/accelerators/presethandler.cxx
@@ -613,15 +613,6 @@ void PresetHandler::connectToResource( PresetHandler::EConfigType
}
//-----------------------------------------------
-sal_Bool PresetHandler::existsTarget(const ::rtl::OUString& sTarget) const
-{
- // SAFE -> ----------------------------------
- ReadGuard aReadLock(m_aLock);
- return (m_lTargets.findConst(sTarget) != m_lTargets.end());
- // <- SAFE ----------------------------------
-}
-
-//-----------------------------------------------
void PresetHandler::copyPresetToTarget(const ::rtl::OUString& sPreset,
const ::rtl::OUString& sTarget)
{
diff --git a/framework/source/classes/addonmenu.cxx b/framework/source/classes/addonmenu.cxx
index 48fa2bee2e74..55c8ba553062 100644
--- a/framework/source/classes/addonmenu.cxx
+++ b/framework/source/classes/addonmenu.cxx
@@ -39,7 +39,7 @@
#include <general.h>
#include <macros/debug/assertion.hxx>
#include <helper/imageproducer.hxx>
-#include <classes/menuconfiguration.hxx>
+#include <xml/menuconfiguration.hxx>
//_________________________________________________________________________________________________________________
// interface includes
@@ -106,23 +106,12 @@ sal_Bool AddonPopupMenu::IsCommandURLPrefix( const ::rtl::OUString& aCmdURL )
}
AddonPopupMenu::AddonPopupMenu( const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame ) :
- m_xFrame( rFrame )
+ AddonMenu( rFrame )
{
}
AddonPopupMenu::~AddonPopupMenu()
{
- for ( USHORT i = 0; i < GetItemCount(); i++ )
- {
- if ( GetItemType( i ) != MENUITEM_SEPARATOR )
- {
- // delete user attributes created with new!
- USHORT nId = GetItemId( i );
- MenuConfiguration::Attributes* pUserAttributes = (MenuConfiguration::Attributes*)GetUserValue( nId );
- delete pUserAttributes;
- delete GetPopupMenu( nId );
- }
- }
}
// ------------------------------------------------------------------------
diff --git a/framework/source/classes/addonsoptions.cxx b/framework/source/classes/addonsoptions.cxx
index 8e0b9c726a22..730bf0baa32f 100644
--- a/framework/source/classes/addonsoptions.cxx
+++ b/framework/source/classes/addonsoptions.cxx
@@ -789,7 +789,7 @@ sal_Bool AddonsOptions_Impl::ReadOfficeToolBarSet( AddonToolBars& rAddonOfficeTo
ReadToolBarItemSet( aToolBarItemNode, rAddonOfficeToolBars[n] );
}
- return ( rAddonOfficeToolBars.size() > 0 );
+ return ( !rAddonOfficeToolBars.empty() );
}
diff --git a/framework/source/classes/bmkmenu.cxx b/framework/source/classes/bmkmenu.cxx
index f2873bef7570..efa66b3a6140 100644
--- a/framework/source/classes/bmkmenu.cxx
+++ b/framework/source/classes/bmkmenu.cxx
@@ -41,7 +41,7 @@
#include <general.h>
#include <macros/debug/assertion.hxx>
#include <helper/imageproducer.hxx>
-#include <classes/menuconfiguration.hxx>
+#include <xml/menuconfiguration.hxx>
//_________________________________________________________________________________________________________________
// interface includes
@@ -130,15 +130,17 @@ USHORT BmkMenu_Impl::GetMID()
// ------------------------------------------------------------------------
-BmkMenu::BmkMenu( com::sun::star::uno::Reference< XFrame >& xFrame, BmkMenu::BmkMenuType nType, BmkMenu* pRoot ) :
- m_nType( nType ), m_xFrame( xFrame )
+BmkMenu::BmkMenu( com::sun::star::uno::Reference< XFrame >& xFrame, BmkMenu::BmkMenuType nType, BmkMenu* pRoot )
+ :AddonMenu(xFrame)
+ ,m_nType( nType )
{
_pImp = new BmkMenu_Impl( pRoot );
Initialize();
}
-BmkMenu::BmkMenu( Reference< XFrame >& xFrame, BmkMenu::BmkMenuType nType ) :
- m_nType( nType ), m_xFrame( xFrame )
+BmkMenu::BmkMenu( Reference< XFrame >& xFrame, BmkMenu::BmkMenuType nType )
+ :AddonMenu(xFrame)
+ ,m_nType( nType )
{
_pImp = new BmkMenu_Impl();
Initialize();
@@ -147,17 +149,6 @@ BmkMenu::BmkMenu( Reference< XFrame >& xFrame, BmkMenu::BmkMenuType nType ) :
BmkMenu::~BmkMenu()
{
delete _pImp;
-
- for ( USHORT i = 0; i < GetItemCount(); i++ )
- {
- if ( GetItemType( i ) != MENUITEM_SEPARATOR )
- {
- // delete user attributes created with new!
- USHORT nId = GetItemId( i );
- MenuConfiguration::Attributes* pUserAttributes = (MenuConfiguration::Attributes*)GetUserValue( nId );
- delete pUserAttributes;
- }
- }
}
void BmkMenu::Initialize()
@@ -184,7 +175,7 @@ void BmkMenu::Initialize()
::rtl::OUString aTargetFrame;
::rtl::OUString aImageId;
- BOOL bIsHiContrastMode = rSettings.GetMenuColor().IsDark();
+ BOOL bIsHiContrastMode = rSettings.GetHighContrastMode();
UINT32 i, nCount = aDynamicMenuEntries.getLength();
for ( i = 0; i < nCount; ++i )
diff --git a/framework/source/classes/framelistanalyzer.cxx b/framework/source/classes/framelistanalyzer.cxx
index a49fc4650546..5fbea7d9fcb7 100644
--- a/framework/source/classes/framelistanalyzer.cxx
+++ b/framework/source/classes/framelistanalyzer.cxx
@@ -151,8 +151,7 @@ void FrameListAnalyzer::impl_analyze()
(xSet.is() )
)
{
- css::uno::Any aValue = xSet->getPropertyValue(FRAME_PROPNAME_ISHIDDEN);
- aValue >>= m_bReferenceIsHidden;
+ xSet->getPropertyValue(FRAME_PROPNAME_ISHIDDEN) >>= m_bReferenceIsHidden;
}
// check, if the reference frame includes the backing component.
@@ -272,8 +271,7 @@ void FrameListAnalyzer::impl_analyze()
xSet = css::uno::Reference< css::beans::XPropertySet >(xFrame, css::uno::UNO_QUERY);
if (xSet.is())
{
- css::uno::Any aValue = xSet->getPropertyValue(FRAME_PROPNAME_ISHIDDEN);
- aValue >>= bHidden;
+ xSet->getPropertyValue(FRAME_PROPNAME_ISHIDDEN) >>= bHidden;
}
}
diff --git a/framework/source/classes/fwktabwindow.cxx b/framework/source/classes/fwktabwindow.cxx
index a7c6882751ee..d737a2d77308 100644
--- a/framework/source/classes/fwktabwindow.cxx
+++ b/framework/source/classes/fwktabwindow.cxx
@@ -33,13 +33,14 @@
#include <classes/fwktabwindow.hxx>
#include "framework.hrc"
-#include <classes/fwkresid.hxx>
+#include <classes/fwlresid.hxx>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/XContainerWindowEventHandler.hpp>
#include <com/sun/star/awt/XContainerWindowProvider.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
+#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -90,7 +91,7 @@ FwkTabPage::FwkTabPage(
const css::uno::Reference< css::awt::XContainerWindowEventHandler >& rEventHdl,
const css::uno::Reference< css::awt::XContainerWindowProvider >& rProvider ) :
- TabPage( pParent, WB_DIALOGCONTROL ),
+ TabPage( pParent, WB_DIALOGCONTROL | WB_TABSTOP | WB_CHILDDLGCTRL ),
m_sPageURL ( rPageURL ),
m_xEventHdl ( rEventHdl ),
@@ -122,6 +123,18 @@ void FwkTabPage::CreateDialog()
m_xWinProvider->createContainerWindow(
m_sPageURL, rtl::OUString(), xParent, xHandler ), uno::UNO_QUERY );
+ uno::Reference< awt::XControl > xPageControl( m_xPage, uno::UNO_QUERY );
+ if ( xPageControl.is() )
+ {
+ uno::Reference< awt::XWindowPeer > xWinPeer( xPageControl->getPeer() );
+ if ( xWinPeer.is() )
+ {
+ Window* pWindow = VCLUnoHelper::GetWindow( xWinPeer );
+ if ( pWindow )
+ pWindow->SetStyle( pWindow->GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL );
+ }
+ }
+
CallMethod( INITIALIZE_METHOD );
}
catch ( lang::IllegalArgumentException& )
@@ -192,28 +205,13 @@ void FwkTabPage::Resize()
}
}
-// -----------------------------------------------------------------------
-
-void FwkTabPage::Reset()
-{
- CallMethod( BACK_METHOD );
- ActivatePage();
-}
-
-// -----------------------------------------------------------------------
-
-void FwkTabPage::Save()
-{
- CallMethod( OK_METHOD );
-}
-
// class FwkTabWindow ---------------------------------------------
FwkTabWindow::FwkTabWindow( Window* pParent ) :
- Window( pParent, FwkResId( WIN_TABWINDOW ) ),
+ Window( pParent, FwlResId( WIN_TABWINDOW ) ),
- m_aTabCtrl ( this, FwkResId( TC_TABCONTROL ) )
+ m_aTabCtrl ( this, FwlResId( TC_TABCONTROL ) )
{
uno::Reference < lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
m_xWinProvider = uno::Reference < awt::XContainerWindowProvider >(
@@ -352,20 +350,19 @@ FwkTabPage* FwkTabWindow::AddTabPage( sal_Int32 nIndex, const uno::Sequence< bea
{
beans::NamedValue aValue = rProperties[i];
::rtl::OUString sName = aValue.Name;
- uno::Any aAny = aValue.Value;
if ( sName.equalsAscii("Title") )
- aAny >>= sTitle;
+ aValue.Value >>= sTitle;
else if ( sName.equalsAscii("ToolTip") )
- aAny >>= sToolTip;
+ aValue.Value >>= sToolTip;
else if ( sName.equalsAscii("PageURL") )
- aAny >>= sPageURL;
+ aValue.Value >>= sPageURL;
else if ( sName.equalsAscii("EventHdl") )
- aAny >>= xEventHdl;
+ aValue.Value >>= xEventHdl;
else if ( sName.equalsAscii("Image") )
- aAny >>= xImage;
+ aValue.Value >>= xImage;
else if ( sName.equalsAscii("Disabled") )
- aAny >>= bDisabled;
+ aValue.Value >>= bDisabled;
}
TabEntry* pEntry = new TabEntry( nIndex, sPageURL, xEventHdl );
@@ -404,13 +401,6 @@ void FwkTabWindow::RemovePage( sal_Int32 nIndex )
}
// -----------------------------------------------------------------------
-
-sal_Int32 FwkTabWindow::GetActivePageId() const
-{
- return m_aTabCtrl.GetCurPageId();
-}
-
-// -----------------------------------------------------------------------
void FwkTabWindow::Resize()
{
Size aPageSize = GetSizePixel();
diff --git a/framework/source/classes/fwlresid.cxx b/framework/source/classes/fwlresid.cxx
new file mode 100755
index 000000000000..e7e3676e9f7b
--- /dev/null
+++ b/framework/source/classes/fwlresid.cxx
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * 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: FwlResId.cxx,v $
+ * $Revision: 1.8 $
+ *
+ * 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 "classes/fwlresid.hxx"
+#include <tools/string.hxx>
+#include <vos/mutex.hxx>
+#include <vcl/svapp.hxx>
+
+#include <rtl/strbuf.hxx>
+
+namespace framework
+{
+
+ResMgr* FwlResId::GetResManager()
+{
+ static ResMgr* pResMgr = NULL;
+
+ if ( !pResMgr )
+ {
+ rtl::OStringBuffer aBuf( 32 );
+ aBuf.append( "fwe" );
+
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ pResMgr = ResMgr::CreateResMgr( aBuf.getStr() );
+ }
+
+ return pResMgr;
+}
+
+// -----------------------------------------------------------------------
+
+FwlResId::FwlResId( USHORT nId ) :
+ ResId( nId, *FwlResId::GetResManager() )
+{
+}
+
+}
+
diff --git a/framework/source/classes/imagewrapper.cxx b/framework/source/classes/imagewrapper.cxx
index f23fdb336bdc..4479c9dfe86e 100644
--- a/framework/source/classes/imagewrapper.cxx
+++ b/framework/source/classes/imagewrapper.cxx
@@ -54,7 +54,6 @@ static Sequence< sal_Int8 > impl_getStaticIdentifier()
ImageWrapper::ImageWrapper( const Image& aImage ) : ThreadHelpBase( &Application::GetSolarMutex() )
- , cppu::OWeakObject()
, m_aImage( aImage )
{
}
@@ -70,33 +69,6 @@ Sequence< sal_Int8 > ImageWrapper::GetUnoTunnelId()
return impl_getStaticIdentifier();
}
-
-// XInterface
-void SAL_CALL ImageWrapper::acquire() throw ()
-{
- OWeakObject::acquire();
-}
-
-void SAL_CALL ImageWrapper::release() throw ()
-{
- OWeakObject::release();
-}
-
-Any SAL_CALL ImageWrapper::queryInterface( const Type& aType )
-throw ( RuntimeException )
-{
- Any a = ::cppu::queryInterface(
- aType ,
- SAL_STATIC_CAST( com::sun::star::awt::XBitmap*, this ),
- SAL_STATIC_CAST( XUnoTunnel*, this ),
- SAL_STATIC_CAST( XTypeProvider*, this ));
-
- if( a.hasValue() )
- return a;
-
- return OWeakObject::queryInterface( aType );
-}
-
// XBitmap
com::sun::star::awt::Size SAL_CALL ImageWrapper::getSize() throw ( RuntimeException )
{
@@ -147,63 +119,5 @@ sal_Int64 SAL_CALL ImageWrapper::getSomething( const Sequence< sal_Int8 >& aIden
return 0;
}
-// XTypeProvider
-Sequence< Type > SAL_CALL ImageWrapper::getTypes() throw ( RuntimeException )
-{
- // Optimize this method !
- // We initialize a static variable only one time. And we don't must use a mutex at every call!
- // For the first call; pTypeCollection is NULL - for the second call pTypeCollection is different from NULL!
- static ::cppu::OTypeCollection* pTypeCollection = NULL ;
-
- if ( pTypeCollection == NULL )
- {
- // Ready for multithreading; get global mutex for first call of this method only! see before
- osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ;
-
- // Control these pointer again ... it can be, that another instance will be faster then these!
- if ( pTypeCollection == NULL )
- {
- // Create a static typecollection ...
- static ::cppu::OTypeCollection aTypeCollection(
- ::getCppuType(( const Reference< XTypeProvider >*)NULL ) ,
- ::getCppuType(( const Reference< XUnoTunnel >*)NULL ) ,
- ::getCppuType(( const Reference< com::sun::star::awt::XBitmap >*)NULL ) ) ;
-
- // ... and set his address to static pointer!
- pTypeCollection = &aTypeCollection ;
- }
- }
-
- return pTypeCollection->getTypes() ;
-}
-
-Sequence< sal_Int8 > SAL_CALL ImageWrapper::getImplementationId() throw ( RuntimeException )
-{
- // Create one Id for all instances of this class.
- // Use ethernet address to do this! (sal_True)
-
- // Optimize this method
- // We initialize a static variable only one time. And we don't must use a mutex at every call!
- // For the first call; pID is NULL - for the second call pID is different from NULL!
- static ::cppu::OImplementationId* pID = NULL ;
-
- if ( pID == NULL )
- {
- // Ready for multithreading; get global mutex for first call of this method only! see before
- osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ;
-
- // Control these pointer again ... it can be, that another instance will be faster then these!
- if ( pID == NULL )
- {
- // Create a new static ID ...
- static ::cppu::OImplementationId aID( sal_False ) ;
- // ... and set his address to static pointer!
- pID = &aID ;
- }
- }
-
- return pID->getImplementationId() ;
-}
-
}
diff --git a/framework/source/classes/makefile.mk b/framework/source/classes/makefile.mk
index a80bf0b87ab0..c55af1cdf8e4 100644
--- a/framework/source/classes/makefile.mk
+++ b/framework/source/classes/makefile.mk
@@ -57,6 +57,7 @@ SLOFILES= \
$(SLO)$/addonmenu.obj \
$(SLO)$/addonsoptions.obj \
$(SLO)$/fwkresid.obj \
+ $(SLO)$/fwlresid.obj \
$(SLO)$/framelistanalyzer.obj \
$(SLO)$/sfxhelperfunctions.obj \
$(SLO)$/menuextensionsupplier.obj \
diff --git a/framework/source/classes/menumanager.cxx b/framework/source/classes/menumanager.cxx
index af764dd6af1c..bb850b876e5c 100644
--- a/framework/source/classes/menumanager.cxx
+++ b/framework/source/classes/menumanager.cxx
@@ -36,14 +36,14 @@
// my own includes
//_________________________________________________________________________________________________________________
#include <classes/menumanager.hxx>
-#include <classes/menuconfiguration.hxx>
+#include <xml/menuconfiguration.hxx>
#include <classes/bmkmenu.hxx>
#include <classes/addonmenu.hxx>
#include <helper/imageproducer.hxx>
#include <threadhelp/resetableguard.hxx>
#include "classes/addonsoptions.hxx"
#include <classes/fwkresid.hxx>
-
+#include <services.h>
#include "classes/resource.hrc"
//_________________________________________________________________________________________________________________
@@ -92,6 +92,7 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
@@ -122,9 +123,7 @@ namespace framework
#define SID_HELPMENU (SID_SFX_START + 410)
#define SFX_REFERER_USER "private:user"
-#define DESKTOP_SERVICE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))
-const ::rtl::OUString aSlotString( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
const ::rtl::OUString aSlotNewDocDirect( RTL_CONSTASCII_USTRINGPARAM( "slot:5537" ));
const ::rtl::OUString aSlotAutoPilot( RTL_CONSTASCII_USTRINGPARAM( "slot:6381" ));
@@ -146,7 +145,6 @@ MenuManager::MenuManager(
REFERENCE< XFRAME >& rFrame, Menu* pMenu, sal_Bool bDelete, sal_Bool bDeleteChildren )
: // #110897#
ThreadHelpBase( &Application::GetSolarMutex() ),
- OWeakObject(),
mxServiceFactory(xServiceFactory)
{
m_bActive = sal_False;
@@ -159,65 +157,34 @@ MenuManager::MenuManager(
SAL_STATIC_CAST( ::com::sun::star::uno::XInterface*, (OWeakObject*)this )->acquire();
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
- m_bWasHiContrast = rSettings.GetMenuColor().IsDark();
+ m_bWasHiContrast = rSettings.GetHighContrastMode();
m_bShowMenuImages = rSettings.GetUseImagesInMenus();
sal_Int32 nAddonsURLPrefixLength = ADDONSPOPUPMENU_URL_PREFIX.getLength();
+#if 0
::std::vector< USHORT > aQueryLabelItemIdVector;
+#endif
USHORT nItemCount = pMenu->GetItemCount();
+ m_aMenuItemHandlerVector.reserve(nItemCount);
+ ::rtl::OUString aItemCommand;
for ( USHORT i = 0; i < nItemCount; i++ )
{
- USHORT nItemId = pMenu->GetItemId( i );
-
- ::rtl::OUString aItemCommand = pMenu->GetItemCommand( nItemId );
- if ( !aItemCommand.getLength() )
- {
- aItemCommand = aSlotString;
- aItemCommand += ::rtl::OUString::valueOf( (sal_Int32)nItemId );
- pMenu->SetItemCommand( nItemId, aItemCommand );
- }
+ USHORT nItemId = FillItemCommand(aItemCommand,pMenu, i );
PopupMenu* pPopupMenu = pMenu->GetPopupMenu( nItemId );
if ( pPopupMenu )
{
- if (( aItemCommand.getLength() > nAddonsURLPrefixLength ) &&
- ( aItemCommand.indexOf( ADDONSPOPUPMENU_URL_PREFIX ) == 0 ))
- {
- // A special addon popup menu, must be created with a different ctor
-
- // #110897#
- // MenuManager* pSubMenuManager = new MenuManager( rFrame, (AddonPopupMenu *)pPopupMenu, bDeleteChildren, bDeleteChildren );
- MenuManager* pSubMenuManager = new MenuManager( getServiceFactory(), rFrame, (AddonPopupMenu *)pPopupMenu, bDeleteChildren, bDeleteChildren );
-
- // store menu item command as we later have to know which menu is active (see Activate handler)
- pSubMenuManager->m_aMenuItemCommand = aItemCommand;
-
- REFERENCE< XDISPATCH > aXDispatchRef;
- MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
- nItemId,
- pSubMenuManager,
- aXDispatchRef );
- m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
- }
- else
+ AddMenu(pPopupMenu,aItemCommand,nItemId,bDeleteChildren,bDeleteChildren);
+ if (! (( aItemCommand.getLength() > nAddonsURLPrefixLength ) &&
+ ( aItemCommand.indexOf( ADDONSPOPUPMENU_URL_PREFIX ) == 0 )) )
{
// #110897#
// MenuManager* pSubMenuManager = new MenuManager( rFrame, pPopupMenu, bDeleteChildren, bDeleteChildren );
- MenuManager* pSubMenuMgr = new MenuManager( getServiceFactory(), rFrame, pPopupMenu, bDeleteChildren, bDeleteChildren );
-
- // store menu item command as we later have to know which menu is active (see Activate handler)
- pSubMenuMgr->m_aMenuItemCommand = aItemCommand;
-
- REFERENCE< XDISPATCH > aXDispRef;
- MenuItemHandler* pMenuItemHdl = new MenuItemHandler(
- nItemId,
- pSubMenuMgr,
- aXDispRef );
- m_aMenuItemHandlerVector.push_back( pMenuItemHdl );
-
+#if 0
if ( pMenu->GetItemText( nItemId ).Len() == 0 )
aQueryLabelItemIdVector.push_back( nItemId );
+#endif
// Create addon popup menu if there exist elements and this is the tools popup menu
if (( nItemId == SID_ADDONLIST ||
@@ -237,23 +204,18 @@ MenuManager::MenuManager(
pPopupMenu->SetPopupMenu( ITEMID_ADDONLIST, pSubMenu );
// Set item command for popup menu to enable it for GetImageFromURL
+ const static ::rtl::OUString aSlotString( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
aItemCommand = aSlotString;
aItemCommand += ::rtl::OUString::valueOf( (sal_Int32)ITEMID_ADDONLIST );
pPopupMenu->SetItemCommand( ITEMID_ADDONLIST, aItemCommand );
// #110897#
// MenuManager* pSubMenuManager = new MenuManager( rFrame, pSubMenu, sal_True, sal_False );
- MenuManager* pSubMenuManager = new MenuManager( getServiceFactory(), rFrame, pSubMenu, sal_True, sal_False );
-
- REFERENCE< XDISPATCH > aXDispatchRef;
- MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
- nItemId,
- pSubMenuManager,
- aXDispatchRef );
+ AddMenu(pSubMenu,::rtl::OUString(),nItemId,sal_True,sal_False);
+#if 0
if ( pMenu->GetItemText( nItemId ).Len() == 0 )
aQueryLabelItemIdVector.push_back( nItemId );
- m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
-
+#endif
// Set image for the addon popup menu item
if ( m_bShowMenuImages && !pPopupMenu->GetItemImage( ITEMID_ADDONLIST ))
{
@@ -281,16 +243,11 @@ MenuManager::MenuManager(
// #110897#
// MenuManager* pSubMenuManager = new MenuManager( rFrame, pSubMenu, sal_True, sal_False );
- MenuManager* pSubMenuManager = new MenuManager( getServiceFactory(), rFrame, pSubMenu, sal_True, sal_False );
-
- REFERENCE< XDISPATCH > aXDispatchRef;
- MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
- nItemId,
- pSubMenuManager,
- aXDispatchRef );
+ AddMenu(pSubMenu,::rtl::OUString(),nItemId,sal_True,sal_False);
+#if 0
if ( pMenu->GetItemText( nItemId ).Len() == 0 )
aQueryLabelItemIdVector.push_back( nItemId );
- m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
+#endif
if ( m_bShowMenuImages && !pMenu->GetItemImage( nItemId ))
{
@@ -311,16 +268,11 @@ MenuManager::MenuManager(
// #110897#
// MenuManager* pSubMenuManager = new MenuManager( rFrame, pSubMenu, sal_True, sal_False );
- MenuManager* pSubMenuManager = new MenuManager( getServiceFactory(), rFrame, pSubMenu, sal_True, sal_False );
-
- REFERENCE< XDISPATCH > aXDispatchRef;
- MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
- nItemId,
- pSubMenuManager,
- aXDispatchRef );
+ AddMenu(pSubMenu,::rtl::OUString(),nItemId,sal_True,sal_False);
+#if 0
if ( pMenu->GetItemText( nItemId ).Len() == 0 )
aQueryLabelItemIdVector.push_back( nItemId );
- m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
+#endif
if ( m_bShowMenuImages && !pMenu->GetItemImage( nItemId ))
{
@@ -368,8 +320,10 @@ MenuManager::MenuManager(
REFERENCE< XDISPATCH > aXDispatchRef;
m_aMenuItemHandlerVector.push_back( new MenuItemHandler( nItemId, NULL, aXDispatchRef ));
+#if 0
if ( pMenu->GetItemText( nItemId ).Len() == 0 )
aQueryLabelItemIdVector.push_back( nItemId );
+#endif
}
}
}
@@ -397,98 +351,15 @@ MenuManager::MenuManager(
}
}
#endif
- m_pVCLMenu->SetHighlightHdl( LINK( this, MenuManager, Highlight ));
- m_pVCLMenu->SetActivateHdl( LINK( this, MenuManager, Activate ));
- m_pVCLMenu->SetDeactivateHdl( LINK( this, MenuManager, Deactivate ));
- m_pVCLMenu->SetSelectHdl( LINK( this, MenuManager, Select ));
-}
-
-
-// #110897#
-MenuManager::MenuManager(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- REFERENCE< XFRAME >& rFrame, BmkMenu* pBmkMenu, sal_Bool bDelete, sal_Bool bDeleteChildren )
-: // #110897#
- ThreadHelpBase( &Application::GetSolarMutex() ),
- OWeakObject(),
- mxServiceFactory(xServiceFactory)
-{
- m_bActive = sal_False;
- m_bDeleteMenu = bDelete;
- m_bDeleteChildren = bDeleteChildren;
- m_pVCLMenu = pBmkMenu;
- m_xFrame = rFrame;
- m_bInitialized = sal_False;
- m_bIsBookmarkMenu = sal_True;
-
- const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
- m_bWasHiContrast = rSettings.GetMenuColor().IsDark();
-
- SAL_STATIC_CAST( ::com::sun::star::uno::XInterface*, (OWeakObject*)this )->acquire();
-
- USHORT nItemCount = pBmkMenu->GetItemCount();
- for ( USHORT i = 0; i < nItemCount; i++ )
- {
- USHORT nItemId = pBmkMenu->GetItemId( i );
-
- ::rtl::OUString aItemCommand = pBmkMenu->GetItemCommand( nItemId );
- if ( !aItemCommand.getLength() )
- {
- aItemCommand = aSlotString;
- aItemCommand += ::rtl::OUString::valueOf( (sal_Int32)nItemId );
- pBmkMenu->SetItemCommand( nItemId, aItemCommand );
- }
-
- PopupMenu* pPopupMenu = pBmkMenu->GetPopupMenu( nItemId );
- if ( pPopupMenu )
- {
- // #110897#
- // MenuManager* pSubMenuManager = new MenuManager( rFrame, pPopupMenu, bDeleteChildren, bDeleteChildren );
- MenuManager* pSubMenuManager = new MenuManager( getServiceFactory(), rFrame, pPopupMenu, bDeleteChildren, bDeleteChildren );
-
- // store menu item command as we later have to know which menu is active (see Acivate handler)
- pSubMenuManager->m_aMenuItemCommand = aItemCommand;
-
- REFERENCE< XDISPATCH > aXDispatchRef;
- MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
- nItemId,
- pSubMenuManager,
- aXDispatchRef );
- m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
- }
- else
- {
- if ( pBmkMenu->GetItemType( i ) != MENUITEM_SEPARATOR )
- {
- MenuConfiguration::Attributes* pBmkAttributes = (MenuConfiguration::Attributes *)(pBmkMenu->GetUserValue( nItemId ));
- REFERENCE< XDISPATCH > aXDispatchRef;
- MenuItemHandler* pMenuItemHandler = new MenuItemHandler( nItemId, NULL, aXDispatchRef );
-
- if ( pBmkAttributes )
- {
- // read additional attributes from attributes struct and BmkMenu implementation will delete all attributes itself!!
- pMenuItemHandler->aTargetFrame = pBmkAttributes->aTargetFrame;
- }
-
- m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
- }
- }
- }
-
- m_pVCLMenu->SetHighlightHdl( LINK( this, MenuManager, Highlight ));
- m_pVCLMenu->SetActivateHdl( LINK( this, MenuManager, Activate ));
- m_pVCLMenu->SetDeactivateHdl( LINK( this, MenuManager, Deactivate ));
- m_pVCLMenu->SetSelectHdl( LINK( this, MenuManager, Select ));
+ SetHdl();
}
-
// #110897#
MenuManager::MenuManager(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
REFERENCE< XFRAME >& rFrame, AddonMenu* pAddonMenu, sal_Bool bDelete, sal_Bool bDeleteChildren )
: // #110897#
ThreadHelpBase( &Application::GetSolarMutex() ),
- OWeakObject(),
mxServiceFactory(xServiceFactory)
{
m_bActive = sal_False;
@@ -500,39 +371,23 @@ MenuManager::MenuManager(
m_bIsBookmarkMenu = sal_True;
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
- m_bWasHiContrast = rSettings.GetMenuColor().IsDark();
+ m_bWasHiContrast = rSettings.GetHighContrastMode();
SAL_STATIC_CAST( ::com::sun::star::uno::XInterface*, (OWeakObject*)this )->acquire();
USHORT nItemCount = pAddonMenu->GetItemCount();
+ m_aMenuItemHandlerVector.reserve(nItemCount);
+ ::rtl::OUString aItemCommand;
for ( USHORT i = 0; i < nItemCount; i++ )
{
- USHORT nItemId = pAddonMenu->GetItemId( i );
-
- ::rtl::OUString aItemCommand = pAddonMenu->GetItemCommand( nItemId );
- if ( !aItemCommand.getLength() )
- {
- aItemCommand = aSlotString;
- aItemCommand += ::rtl::OUString::valueOf( (sal_Int32)nItemId );
- pAddonMenu->SetItemCommand( nItemId, aItemCommand );
- }
+ USHORT nItemId = FillItemCommand(aItemCommand,pAddonMenu, i );
PopupMenu* pPopupMenu = pAddonMenu->GetPopupMenu( nItemId );
if ( pPopupMenu )
{
// #110897#
// MenuManager* pSubMenuManager = new MenuManager( rFrame, pPopupMenu, bDeleteChildren, bDeleteChildren );
- MenuManager* pSubMenuManager = new MenuManager( getServiceFactory(), rFrame, pPopupMenu, bDeleteChildren, bDeleteChildren );
-
- // store menu item command as we later have to know which menu is active (see Acivate handler)
- pSubMenuManager->m_aMenuItemCommand = aItemCommand;
-
- REFERENCE< XDISPATCH > aXDispatchRef;
- MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
- nItemId,
- pSubMenuManager,
- aXDispatchRef );
- m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
+ AddMenu(pPopupMenu,aItemCommand,nItemId,bDeleteChildren,bDeleteChildren);
}
else
{
@@ -553,110 +408,27 @@ MenuManager::MenuManager(
}
}
- m_pVCLMenu->SetHighlightHdl( LINK( this, MenuManager, Highlight ));
- m_pVCLMenu->SetActivateHdl( LINK( this, MenuManager, Activate ));
- m_pVCLMenu->SetDeactivateHdl( LINK( this, MenuManager, Deactivate ));
- m_pVCLMenu->SetSelectHdl( LINK( this, MenuManager, Select ));
+ SetHdl();
}
-
-// #110897#
-MenuManager::MenuManager(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- REFERENCE< XFRAME >& rFrame, AddonPopupMenu* pAddonPopupMenu, sal_Bool bDelete, sal_Bool bDeleteChildren )
-: // #110897#
- ThreadHelpBase( &Application::GetSolarMutex() ),
- OWeakObject(),
- mxServiceFactory(xServiceFactory)
+void MenuManager::SetHdl()
{
- m_bActive = sal_False;
- m_bDeleteMenu = bDelete;
- m_bDeleteChildren = bDeleteChildren;
- m_pVCLMenu = pAddonPopupMenu;
- m_xFrame = rFrame;
- m_bInitialized = sal_False;
- m_bIsBookmarkMenu = sal_True;
-
- const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
- m_bWasHiContrast = rSettings.GetMenuColor().IsDark();
-
- SAL_STATIC_CAST( ::com::sun::star::uno::XInterface*, (OWeakObject*)this )->acquire();
-
- USHORT nItemCount = pAddonPopupMenu->GetItemCount();
- for ( USHORT i = 0; i < nItemCount; i++ )
- {
- USHORT nItemId = pAddonPopupMenu->GetItemId( i );
-
- ::rtl::OUString aItemCommand = pAddonPopupMenu->GetItemCommand( nItemId );
- if ( !aItemCommand.getLength() )
- {
- aItemCommand = aSlotString;
- aItemCommand += ::rtl::OUString::valueOf( (sal_Int32)nItemId );
- pAddonPopupMenu->SetItemCommand( nItemId, aItemCommand );
- }
-
- PopupMenu* pPopupMenu = pAddonPopupMenu->GetPopupMenu( nItemId );
- if ( pPopupMenu )
- {
- // #110897#
- // MenuManager* pSubMenuManager = new MenuManager( rFrame, pPopupMenu, bDeleteChildren, bDeleteChildren );
- MenuManager* pSubMenuManager = new MenuManager( getServiceFactory(), rFrame, pPopupMenu, bDeleteChildren, bDeleteChildren );
-
- // store menu item command as we later have to know which menu is active (see Acivate handler)
- pSubMenuManager->m_aMenuItemCommand = aItemCommand;
-
- REFERENCE< XDISPATCH > aXDispatchRef;
- MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
- nItemId,
- pSubMenuManager,
- aXDispatchRef );
- m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
- }
- else
- {
- if ( pAddonPopupMenu->GetItemType( i ) != MENUITEM_SEPARATOR )
- {
- MenuConfiguration::Attributes* pAttributes = (MenuConfiguration::Attributes *)(pAddonPopupMenu->GetUserValue( nItemId ));
- REFERENCE< XDISPATCH > aXDispatchRef;
- MenuItemHandler* pMenuItemHandler = new MenuItemHandler( nItemId, NULL, aXDispatchRef );
-
- if ( pAttributes )
- {
- // read additional attributes from attributes struct and BmkMenu implementation will delete all attributes itself!!
- pMenuItemHandler->aTargetFrame = pAttributes->aTargetFrame;
- }
-
- m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
- }
- }
- }
-
m_pVCLMenu->SetHighlightHdl( LINK( this, MenuManager, Highlight ));
m_pVCLMenu->SetActivateHdl( LINK( this, MenuManager, Activate ));
m_pVCLMenu->SetDeactivateHdl( LINK( this, MenuManager, Deactivate ));
m_pVCLMenu->SetSelectHdl( LINK( this, MenuManager, Select ));
-}
-Any SAL_CALL MenuManager::queryInterface( const ::com::sun::star::uno::Type & rType ) throw ( RuntimeException )
-{
- Any a = ::cppu::queryInterface(
- rType ,
- SAL_STATIC_CAST( XSTATUSLISTENER*, this ),
- SAL_STATIC_CAST( XEVENTLISTENER*, this ));
- if ( a.hasValue() )
- return a;
-
- return OWeakObject::queryInterface( rType );
+ if ( mxServiceFactory.is() )
+ m_xURLTransformer.set( mxServiceFactory->createInstance(SERVICENAME_URLTRANSFORMER),UNO_QUERY );
}
-
MenuManager::~MenuManager()
{
std::vector< MenuItemHandler* >::iterator p;
for ( p = m_aMenuItemHandlerVector.begin(); p != m_aMenuItemHandlerVector.end(); p++ )
{
MenuItemHandler* pItemHandler = *p;
- pItemHandler->xMenuItemDispatch = REFERENCE< XDISPATCH >();
+ pItemHandler->xMenuItemDispatch.clear();
if ( pItemHandler->pSubMenuManager )
SAL_STATIC_CAST( ::com::sun::star::uno::XInterface*, (OWeakObject*)pItemHandler->pSubMenuManager )->release();
delete pItemHandler;
@@ -730,11 +502,7 @@ throw ( RuntimeException )
aTargetURL.Complete = pStatusChangedMenu->aMenuItemURL;
// #110897#
- // REFERENCE< XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
- // rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
- REFERENCE< XURLTransformer > xTrans( getServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
- xTrans->parseStrict( aTargetURL );
+ m_xURLTransformer->parseStrict( aTargetURL );
REFERENCE< XDISPATCHPROVIDER > xDispatchProvider( m_xFrame, UNO_QUERY );
REFERENCE< XDISPATCH > xMenuItemDispatch = xDispatchProvider->queryDispatch(
@@ -754,16 +522,15 @@ throw ( RuntimeException )
void MenuManager::RemoveListener()
{
ResetableGuard aGuard( m_aLock );
+ ClearMenuDispatch();
+}
+void MenuManager::ClearMenuDispatch(const EVENTOBJECT& Source,bool _bRemoveOnly)
+{
// disposing called from parent dispatcher
// remove all listener to prepare shutdown
// #110897#
- //REFERENCE< XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
- // rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
- REFERENCE< XURLTransformer > xTrans( getServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
-
std::vector< MenuItemHandler* >::iterator p;
for ( p = m_aMenuItemHandlerVector.begin(); p != m_aMenuItemHandlerVector.end(); p++ )
{
@@ -772,15 +539,20 @@ void MenuManager::RemoveListener()
{
URL aTargetURL;
aTargetURL.Complete = pItemHandler->aMenuItemURL;
- xTrans->parseStrict( aTargetURL );
+ m_xURLTransformer->parseStrict( aTargetURL );
pItemHandler->xMenuItemDispatch->removeStatusListener(
SAL_STATIC_CAST( XSTATUSLISTENER*, this ), aTargetURL );
}
- pItemHandler->xMenuItemDispatch = REFERENCE< XDISPATCH >();
+ pItemHandler->xMenuItemDispatch.clear();
if ( pItemHandler->pSubMenuManager )
- pItemHandler->pSubMenuManager->RemoveListener();
+ {
+ if ( _bRemoveOnly )
+ pItemHandler->pSubMenuManager->RemoveListener();
+ else
+ pItemHandler->pSubMenuManager->disposing( Source );
+ }
}
}
@@ -790,34 +562,7 @@ void SAL_CALL MenuManager::disposing( const EVENTOBJECT& Source ) throw ( RUNTIM
if ( Source.Source == m_xFrame )
{
ResetableGuard aGuard( m_aLock );
-
- // disposing called from parent dispatcher
- // remove all listener to prepare shutdown
-
- // #110897#
- // REFERENCE< XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
- // rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
- REFERENCE< XURLTransformer > xTrans( getServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
-
- std::vector< MenuItemHandler* >::iterator p;
- for ( p = m_aMenuItemHandlerVector.begin(); p != m_aMenuItemHandlerVector.end(); p++ )
- {
- MenuItemHandler* pItemHandler = *p;
- if ( pItemHandler->xMenuItemDispatch.is() )
- {
- URL aTargetURL;
- aTargetURL.Complete = pItemHandler->aMenuItemURL;
- xTrans->parseStrict( aTargetURL );
-
- pItemHandler->xMenuItemDispatch->removeStatusListener(
- SAL_STATIC_CAST( XSTATUSLISTENER*, this ), aTargetURL );
- }
-
- pItemHandler->xMenuItemDispatch = REFERENCE< XDISPATCH >();
- if ( pItemHandler->pSubMenuManager )
- pItemHandler->pSubMenuManager->disposing( Source );
- }
+ ClearMenuDispatch(Source,false);
}
else
{
@@ -844,15 +589,10 @@ void SAL_CALL MenuManager::disposing( const EVENTOBJECT& Source ) throw ( RUNTIM
aTargetURL.Complete = pMenuItemDisposing->aMenuItemURL;
// #110897#
- // REFERENCE< XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
- // rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
- REFERENCE< XURLTransformer > xTrans( getServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
- xTrans->parseStrict( aTargetURL );
-
- pMenuItemDisposing->xMenuItemDispatch->removeStatusListener(
- SAL_STATIC_CAST( XSTATUSLISTENER*, this ), aTargetURL );
- pMenuItemDisposing->xMenuItemDispatch = REFERENCE< XDISPATCH >();
+ m_xURLTransformer->parseStrict( aTargetURL );
+
+ pMenuItemDisposing->xMenuItemDispatch->removeStatusListener(SAL_STATIC_CAST( XSTATUSLISTENER*, this ), aTargetURL );
+ pMenuItemDisposing->xMenuItemDispatch.clear();
}
}
}
@@ -869,6 +609,7 @@ void MenuManager::UpdateSpecialFileMenu( Menu* pMenu )
USHORT nPickItemId = START_ITEMID_PICKLIST;
int nPickListMenuItems = ( aHistoryList.getLength() > 99 ) ? 99 : aHistoryList.getLength();
+ aNewPickVector.reserve(nPickListMenuItems);
for ( int i = 0; i < nPickListMenuItems; i++ )
{
Sequence< PropertyValue > aPickListEntry = aHistoryList[i];
@@ -896,19 +637,15 @@ void MenuManager::UpdateSpecialFileMenu( Menu* pMenu )
aNewPickVector.push_back( pNewMenuItemHandler );
}
- if ( aNewPickVector.size() > 0 )
+ if ( !aNewPickVector.empty() )
{
URL aTargetURL;
REFERENCE< XDISPATCHPROVIDER > xDispatchProvider( m_xFrame, UNO_QUERY );
// #110897#
- // REFERENCE< XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
- // rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
- REFERENCE< XURLTransformer > xTrans( getServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
-
REFERENCE< XDISPATCH > xMenuItemDispatch;
+ static const ::rtl::OUString s_sDefault(RTL_CONSTASCII_USTRINGPARAM("_default"));
// query for dispatcher
std::vector< MenuItemHandler* >::iterator p;
for ( p = aNewPickVector.begin(); p != aNewPickVector.end(); p++ )
@@ -916,12 +653,12 @@ void MenuManager::UpdateSpecialFileMenu( Menu* pMenu )
MenuItemHandler* pMenuItemHandler = *p;
aTargetURL.Complete = pMenuItemHandler->aMenuItemURL;
- xTrans->parseStrict( aTargetURL );
+ m_xURLTransformer->parseStrict( aTargetURL );
if ( !xMenuItemDispatch.is() )
{
// attention: this code assume that "_blank" can only be consumed by desktop service
- xMenuItemDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString::createFromAscii("_default"), 0 );
+ xMenuItemDispatch = xDispatchProvider->queryDispatch( aTargetURL, s_sDefault, 0 );
}
if ( xMenuItemDispatch.is() )
@@ -963,8 +700,10 @@ void MenuManager::UpdateSpecialFileMenu( Menu* pMenu )
}
// append new picklist menu entries
+ aNewPickVector.reserve(aNewPickVector.size());
pMenu->InsertSeparator();
- for ( sal_uInt32 i = 0; i < aNewPickVector.size(); i++ )
+ const sal_uInt32 nCount = aNewPickVector.size();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
char menuShortCut[5] = "~n: ";
@@ -1027,17 +766,13 @@ void MenuManager::UpdateSpecialFileMenu( Menu* pMenu )
}
}
-
-void MenuManager::UpdateSpecialWindowMenu( Menu* pMenu )
+void MenuManager::UpdateSpecialWindowMenu( Menu* pMenu,const Reference< XMultiServiceFactory >& xServiceFactory,framework::IMutex& _rMutex )
{
// update window list
::std::vector< ::rtl::OUString > aNewWindowListVector;
// #110897#
- // Reference< XDesktop > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance(
- // DESKTOP_SERVICE ), UNO_QUERY );
- Reference< XDesktop > xDesktop( getServiceFactory()->createInstance(
- DESKTOP_SERVICE ), UNO_QUERY );
+ Reference< XDesktop > xDesktop( xServiceFactory->createInstance( SERVICENAME_DESKTOP ), UNO_QUERY );
USHORT nActiveItemId = 0;
USHORT nItemId = START_ITEMID_WINDOWLIST;
@@ -1048,11 +783,12 @@ void MenuManager::UpdateSpecialWindowMenu( Menu* pMenu )
Reference< XFrame > xCurrentFrame = xDesktop->getCurrentFrame();
Reference< XIndexAccess > xList( xTasksSupplier->getFrames(), UNO_QUERY );
sal_Int32 nCount = xList->getCount();
+ aNewWindowListVector.reserve(nCount);
for (sal_Int32 i=0; i<nCount; ++i )
{
- Any aItem = xList->getByIndex(i);
Reference< XFrame > xFrame;
- aItem >>= xFrame;
+ xList->getByIndex(i) >>= xFrame;
+
if (xFrame.is())
{
if ( xFrame == xCurrentFrame )
@@ -1069,9 +805,9 @@ void MenuManager::UpdateSpecialWindowMenu( Menu* pMenu )
}
{
- ResetableGuard aGuard( m_aLock );
+ ResetableGuard aGuard( _rMutex );
- int nItemCount = pMenu->GetItemCount();
+ int nItemCount = pMenu->GetItemCount();
if ( nItemCount > 0 )
{
@@ -1084,12 +820,13 @@ void MenuManager::UpdateSpecialWindowMenu( Menu* pMenu )
pMenu->RemoveItem( pMenu->GetItemCount()-1 );
}
- if ( aNewWindowListVector.size() > 0 )
+ if ( !aNewWindowListVector.empty() )
{
// append new window list entries to menu
pMenu->InsertSeparator();
nItemId = START_ITEMID_WINDOWLIST;
- for ( sal_uInt32 i = 0; i < aNewWindowListVector.size(); i++ )
+ const sal_uInt32 nCount = aNewWindowListVector.size();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
pMenu->InsertItem( nItemId, aNewWindowListVector.at( i ), MIB_RADIOCHECK );
if ( nItemId == nActiveItemId )
@@ -1179,58 +916,17 @@ IMPL_LINK( MenuManager, Activate, Menu *, pMenu )
else if ( m_aMenuItemCommand == aSpecialWindowMenu ||
m_aMenuItemCommand == aSlotSpecialWindowMenu ||
aCommand == aSpecialWindowCommand )
- UpdateSpecialWindowMenu( pMenu );
+ UpdateSpecialWindowMenu( pMenu,getServiceFactory(),m_aLock );
// Check if some modes have changed so we have to update our menu images
- sal_Bool bIsHiContrast = rSettings.GetMenuColor().IsDark();
+ sal_Bool bIsHiContrast = rSettings.GetHighContrastMode();
if ( m_bWasHiContrast != bIsHiContrast || bShowMenuImages != m_bShowMenuImages )
{
// The mode changed so we have to replace all images
m_bWasHiContrast = bIsHiContrast;
m_bShowMenuImages = bShowMenuImages;
- AddonsOptions aAddonOptions;
-
- for ( USHORT nPos = 0; nPos < pMenu->GetItemCount(); nPos++ )
- {
- USHORT nId = pMenu->GetItemId( nPos );
- if ( pMenu->GetItemType( nPos ) != MENUITEM_SEPARATOR )
- {
- if ( bShowMenuImages )
- {
- sal_Bool bImageSet = sal_False;
- ::rtl::OUString aImageId;
-
- ::framework::MenuConfiguration::Attributes* pMenuAttributes =
- (::framework::MenuConfiguration::Attributes*)pMenu->GetUserValue( nId );
-
- if ( pMenuAttributes )
- aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes
-
- if ( aImageId.getLength() > 0 )
- {
- Image aImage = GetImageFromURL( m_xFrame, aImageId, FALSE, bIsHiContrast );
- if ( !!aImage )
- {
- bImageSet = sal_True;
- pMenu->SetItemImage( nId, aImage );
- }
- }
-
- if ( !bImageSet )
- {
- rtl::OUString aMenuItemCommand = pMenu->GetItemCommand( nId );
- Image aImage = GetImageFromURL( m_xFrame, aMenuItemCommand, FALSE, bIsHiContrast );
- if ( !aImage )
- aImage = aAddonOptions.GetImageFromURL( aMenuItemCommand, FALSE, bIsHiContrast );
-
- pMenu->SetItemImage( nId, aImage );
- }
- }
- else
- pMenu->SetItemImage( nId, Image() );
- }
- }
+ FillMenuImages(m_xFrame,pMenu,bIsHiContrast,bShowMenuImages);
}
if ( m_bInitialized )
@@ -1240,11 +936,6 @@ IMPL_LINK( MenuManager, Activate, Menu *, pMenu )
URL aTargetURL;
// #110897#
- // REFERENCE< XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
- // rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
- REFERENCE< XURLTransformer > xTrans( getServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
-
ResetableGuard aGuard( m_aLock );
REFERENCE< XDISPATCHPROVIDER > xDispatchProvider( m_xFrame, UNO_QUERY );
@@ -1266,14 +957,15 @@ IMPL_LINK( MenuManager, Activate, Menu *, pMenu )
::rtl::OUString aItemCommand = pMenu->GetItemCommand( pMenuItemHandler->nItemId );
if ( !aItemCommand.getLength() )
{
- aItemCommand = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
+ const static ::rtl::OUString aSlotString( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
+ aItemCommand = aSlotString;
aItemCommand += ::rtl::OUString::valueOf( (sal_Int32)pMenuItemHandler->nItemId );
pMenu->SetItemCommand( pMenuItemHandler->nItemId, aItemCommand );
}
aTargetURL.Complete = aItemCommand;
- xTrans->parseStrict( aTargetURL );
+ m_xURLTransformer->parseStrict( aTargetURL );
REFERENCE< XDISPATCH > xMenuItemDispatch;
if ( m_bIsBookmarkMenu )
@@ -1330,8 +1022,7 @@ IMPL_LINK( MenuManager, Select, Menu *, pMenu )
// #110897#
// Reference< XFramesSupplier > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance(
// DESKTOP_SERVICE ), UNO_QUERY );
- Reference< XFramesSupplier > xDesktop( getServiceFactory()->createInstance(
- DESKTOP_SERVICE ), UNO_QUERY );
+ Reference< XFramesSupplier > xDesktop( getServiceFactory()->createInstance( SERVICENAME_DESKTOP ), UNO_QUERY );
if ( xDesktop.is() )
{
@@ -1340,9 +1031,9 @@ IMPL_LINK( MenuManager, Select, Menu *, pMenu )
sal_Int32 nCount = xList->getCount();
for ( sal_Int32 i=0; i<nCount; ++i )
{
- Any aItem = xList->getByIndex(i);
Reference< XFrame > xFrame;
- aItem >>= xFrame;
+ xList->getByIndex(i) >>= xFrame;
+
if ( xFrame.is() && nTaskId == nCurItemId )
{
Window* pWin = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
@@ -1360,14 +1051,8 @@ IMPL_LINK( MenuManager, Select, Menu *, pMenu )
MenuItemHandler* pMenuItemHandler = GetMenuItemHandler( nCurItemId );
if ( pMenuItemHandler && pMenuItemHandler->xMenuItemDispatch.is() )
{
- // #110897#
- // REFERENCE< XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
- // rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
- REFERENCE< XURLTransformer > xTrans( getServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
-
aTargetURL.Complete = pMenuItemHandler->aMenuItemURL;
- xTrans->parseStrict( aTargetURL );
+ m_xURLTransformer->parseStrict( aTargetURL );
if ( nCurItemId >= START_ITEMID_PICKLIST &&
nCurItemId < START_ITEMID_WINDOWLIST )
@@ -1378,11 +1063,9 @@ IMPL_LINK( MenuManager, Select, Menu *, pMenu )
else if ( m_bIsBookmarkMenu )
{
// bookmark menu item selected
- Any a;
aArgs.realloc( 1 );
aArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Referer" ));
- a <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SFX_REFERER_USER ));
- aArgs[0].Value = a;
+ aArgs[0].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SFX_REFERER_USER ));
}
xDispatch = pMenuItemHandler->xMenuItemDispatch;
@@ -1410,4 +1093,78 @@ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFac
return mxServiceFactory;
}
+void MenuManager::AddMenu(PopupMenu* _pPopupMenu,const ::rtl::OUString& _sItemCommand,USHORT _nItemId,sal_Bool _bDelete,sal_Bool _bDeleteChildren)
+{
+ MenuManager* pSubMenuManager = new MenuManager( getServiceFactory(), m_xFrame, _pPopupMenu, _bDelete, _bDeleteChildren );
+
+ // store menu item command as we later have to know which menu is active (see Activate handler)
+ pSubMenuManager->m_aMenuItemCommand = _sItemCommand;
+
+ REFERENCE< XDISPATCH > aXDispatchRef;
+ MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
+ _nItemId,
+ pSubMenuManager,
+ aXDispatchRef );
+ m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
+}
+
+USHORT MenuManager::FillItemCommand(::rtl::OUString& _rItemCommand,Menu* _pMenu,USHORT _nIndex) const
+{
+ USHORT nItemId = _pMenu->GetItemId( _nIndex );
+
+ _rItemCommand = _pMenu->GetItemCommand( nItemId );
+ if ( !_rItemCommand.getLength() )
+ {
+ const static ::rtl::OUString aSlotString( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
+ _rItemCommand = aSlotString;
+ _rItemCommand += ::rtl::OUString::valueOf( (sal_Int32)nItemId );
+ _pMenu->SetItemCommand( nItemId, _rItemCommand );
+ }
+ return nItemId;
+}
+void MenuManager::FillMenuImages(Reference< XFrame >& _xFrame,Menu* _pMenu,sal_Bool bIsHiContrast,sal_Bool bShowMenuImages)
+{
+ AddonsOptions aAddonOptions;
+
+ for ( USHORT nPos = 0; nPos < _pMenu->GetItemCount(); nPos++ )
+ {
+ USHORT nId = _pMenu->GetItemId( nPos );
+ if ( _pMenu->GetItemType( nPos ) != MENUITEM_SEPARATOR )
+ {
+ if ( bShowMenuImages )
+ {
+ sal_Bool bImageSet = sal_False;
+ ::rtl::OUString aImageId;
+
+ ::framework::MenuConfiguration::Attributes* pMenuAttributes =
+ (::framework::MenuConfiguration::Attributes*)_pMenu->GetUserValue( nId );
+
+ if ( pMenuAttributes )
+ aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes
+
+ if ( aImageId.getLength() > 0 )
+ {
+ Image aImage = GetImageFromURL( _xFrame, aImageId, FALSE, bIsHiContrast );
+ if ( !!aImage )
+ {
+ bImageSet = sal_True;
+ _pMenu->SetItemImage( nId, aImage );
+ }
+ }
+
+ if ( !bImageSet )
+ {
+ rtl::OUString aMenuItemCommand = _pMenu->GetItemCommand( nId );
+ Image aImage = GetImageFromURL( _xFrame, aMenuItemCommand, FALSE, bIsHiContrast );
+ if ( !aImage )
+ aImage = aAddonOptions.GetImageFromURL( aMenuItemCommand, FALSE, bIsHiContrast );
+
+ _pMenu->SetItemImage( nId, aImage );
+ }
+ }
+ else
+ _pMenu->SetItemImage( nId, Image() );
+ }
+ }
+}
}
diff --git a/framework/source/classes/propertysethelper.cxx b/framework/source/classes/propertysethelper.cxx
index ae1b945855dd..decda29fa46b 100644
--- a/framework/source/classes/propertysethelper.cxx
+++ b/framework/source/classes/propertysethelper.cxx
@@ -301,8 +301,7 @@ css::uno::Any SAL_CALL PropertySetHelper::getPropertyValue(const ::rtl::OUString
// <- SAFE
}
- css::uno::Any aValue = impl_getPropertyValue(aPropInfo.Name, aPropInfo.Handle);
- return aValue;
+ return impl_getPropertyValue(aPropInfo.Name, aPropInfo.Handle);
}
//-----------------------------------------------------------------------------
diff --git a/framework/source/classes/protocolhandlercache.cxx b/framework/source/classes/protocolhandlercache.cxx
index 0048b140e18f..034b35259186 100644
--- a/framework/source/classes/protocolhandlercache.cxx
+++ b/framework/source/classes/protocolhandlercache.cxx
@@ -56,6 +56,7 @@
//_________________________________________________________________________________________________________________
#include <tools/wldcrd.hxx>
#include <unotools/configpathes.hxx>
+#include <rtl/ustrbuf.hxx>
//_________________________________________________________________________________________________________________
// namespace
@@ -299,15 +300,13 @@ void HandlerCFGAccess::read( HandlerHash** ppHandler ,
sal_Int32 nTarget=0;
for( nSource=0; nSource<nSourceCount; ++nSource )
{
- ::rtl::OUString sPath;
+ ::rtl::OUStringBuffer sPath( SETNAME_HANDLER );
+ sPath.append(CFG_PATH_SEPERATOR);
+ sPath.append(lNames[nSource]);
+ sPath.append(CFG_PATH_SEPERATOR);
+ sPath.append(PROPERTY_PROTOCOLS);
- sPath = SETNAME_HANDLER ;
- sPath += CFG_PATH_SEPERATOR ;
- sPath += lNames[nSource] ;
- sPath += CFG_PATH_SEPERATOR ;
-
- lFullNames[nTarget] = sPath;
- lFullNames[nTarget] += PROPERTY_PROTOCOLS;
+ lFullNames[nTarget] = sPath.makeStringAndClear();
++nTarget;
}
diff --git a/framework/source/classes/taskcreator.cxx b/framework/source/classes/taskcreator.cxx
index bc8ed3cf72b3..598147b93766 100644
--- a/framework/source/classes/taskcreator.cxx
+++ b/framework/source/classes/taskcreator.cxx
@@ -127,8 +127,7 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const ::rtl::
( TargetHelper::matchSpecialTarget(sName, TargetHelper::E_DEFAULT) )
)
{
- css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(xSMGR, PACKAGE, RELPATH, KEY, ::comphelper::ConfigurationHelper::E_READONLY);
- aVal >>= sCreator;
+ ::comphelper::ConfigurationHelper::readDirectKey(xSMGR, PACKAGE, RELPATH, KEY, ::comphelper::ConfigurationHelper::E_READONLY) >>= sCreator;
}
xCreator = css::uno::Reference< css::lang::XSingleServiceFactory >(
diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx
index 57546118ff1c..25b80650e81a 100644
--- a/framework/source/dispatch/closedispatcher.cxx
+++ b/framework/source/dispatch/closedispatcher.cxx
@@ -46,11 +46,9 @@
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/CommandGroup.hpp>
-
-#ifndef __COM_SUN_STAR_AWT_XTOPWINDOW_HPP_
+#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
-#endif
-
+#include <com/sun/star/document/XActionLockable.hpp>
#include "com/sun/star/beans/XFastPropertySet.hpp"
#include <toolkit/helper/vclunohelper.hxx>
@@ -174,7 +172,7 @@ void SAL_CALL CloseDispatcher::removeStatusListener(const css::uno::Reference< c
//-----------------------------------------------
void SAL_CALL CloseDispatcher::dispatchWithNotification(const css::util::URL& aURL ,
- const css::uno::Sequence< css::beans::PropertyValue >& /*lArguments*/,
+ const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
const css::uno::Reference< css::frame::XDispatchResultListener >& xListener )
throw(css::uno::RuntimeException)
{
@@ -239,7 +237,20 @@ void SAL_CALL CloseDispatcher::dispatchWithNotification(const css::util::URL&
aWriteLock.unlock();
// <- SAFE ----------------------------------
- m_aAsyncCallback.Post(0);
+ sal_Bool bIsSynchron = sal_False;
+ for (sal_Int32 nArgs=0; nArgs<lArguments.getLength(); nArgs++ )
+ {
+ if ( lArguments[nArgs].Name.equalsAscii("SynchronMode") )
+ {
+ lArguments[nArgs].Value >>= bIsSynchron;
+ break;
+ }
+ }
+
+ if ( bIsSynchron )
+ impl_asyncCallback(0);
+ else
+ m_aAsyncCallback.Post(0);
}
//-----------------------------------------------
@@ -543,6 +554,10 @@ sal_Bool CloseDispatcher::implts_establishBackingMode()
if (!xFrame.is())
return sal_False;
+ css::uno::Reference < css::document::XActionLockable > xLock( xFrame, css::uno::UNO_QUERY );
+ if ( xLock.is() && xLock->isActionLocked() )
+ return sal_False;
+
css::uno::Reference< css::awt::XWindow > xContainerWindow = xFrame->getContainerWindow();
css::uno::Sequence< css::uno::Any > lArgs(1);
lArgs[0] <<= xContainerWindow;
diff --git a/framework/source/dispatch/dispatchprovider.cxx b/framework/source/dispatch/dispatchprovider.cxx
index 392e5574d82d..a4b330bab2b3 100644
--- a/framework/source/dispatch/dispatchprovider.cxx
+++ b/framework/source/dispatch/dispatchprovider.cxx
@@ -47,7 +47,7 @@
#include <pattern/window.hxx>
#include <threadhelp/transactionguard.hxx>
#include <threadhelp/readguard.hxx>
-#include <threadhelp/writeguard.hxx>
+#include <threadhelp/writeguard.hxx>
#include <dispatchcommands.h>
#include <protocols.h>
#include <services.h>
@@ -224,24 +224,13 @@ css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL Disp
return lDispatcher;
}
-//_________________________________________________________________________________________________________________
-
-::sal_Bool lcl_isCloseDispatch (const css::util::URL& aURL)
-{
- return (
- (aURL.Complete.equals(CMD_UNO_CLOSEDOC )) ||
- (aURL.Complete.equals(CMD_UNO_CLOSEWIN )) ||
- (aURL.Complete.equals(CMD_UNO_CLOSEFRAME))
- );
-}
-
-//_________________________________________________________________________________________________________________
-
-::sal_Bool lcl_isStartModuleDispatch (const css::util::URL& aURL)
-{
- return (aURL.Complete.equals(CMD_UNO_SHOWSTARTMODULE));
-}
-
+//_________________________________________________________________________________________________________________
+
+::sal_Bool lcl_isStartModuleDispatch (const css::util::URL& aURL)
+{
+ return (aURL.Complete.equals(CMD_UNO_SHOWSTARTMODULE));
+}
+
//_________________________________________________________________________________________________________________
/**
@@ -296,10 +285,10 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryDeskt
if (sTargetFrameName==SPECIALTARGET_DEFAULT)
{
if (implts_isLoadableContent(aURL))
- xDispatcher = implts_getOrCreateDispatchHelper( E_DEFAULTDISPATCHER, xDesktop );
-
- if (lcl_isStartModuleDispatch(aURL))
- xDispatcher = implts_getOrCreateDispatchHelper( E_STARTMODULEDISPATCHER, xDesktop );
+ xDispatcher = implts_getOrCreateDispatchHelper( E_DEFAULTDISPATCHER, xDesktop );
+
+ if (lcl_isStartModuleDispatch(aURL))
+ xDispatcher = implts_getOrCreateDispatchHelper( E_STARTMODULEDISPATCHER, xDesktop );
}
//-----------------------------------------------------------------------------------------------------
@@ -772,7 +761,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat
CloseDispatcher* pDispatcher = new CloseDispatcher( xFactory, xOwner, sTarget );
xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY );
}
- break;
+ break;
case E_STARTMODULEDISPATCHER :
{
diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx
index 72517cb8ca6c..9e399f1ea0b6 100644
--- a/framework/source/dispatch/interceptionhelper.cxx
+++ b/framework/source/dispatch/interceptionhelper.cxx
@@ -185,7 +185,7 @@ void SAL_CALL InterceptionHelper::registerDispatchProviderInterceptor(const css:
// a) no interceptor at all - set this instance as master for given interceptor
// and set our slave as it's slave - and put this interceptor to the list.
// It's place there doesn matter. Because this list is currently empty.
- if (m_lInterceptionRegs.size()<1)
+ if (m_lInterceptionRegs.empty())
{
xInterceptor->setMasterDispatchProvider(xThis );
xInterceptor->setSlaveDispatchProvider (m_xSlave);
@@ -333,7 +333,7 @@ void SAL_CALL InterceptionHelper::disposing(const css::lang::EventObject& aEvent
#if OSL_DEBUG_LEVEL > 0
// SAFE ->
aReadLock.lock();
- if (m_lInterceptionRegs.size() > 0)
+ if (!m_lInterceptionRegs.empty() )
OSL_ENSURE(sal_False, "There are some pending interceptor objects, which seams to be registered during (!) the destruction of a frame.");
aReadLock.unlock();
// <- SAFE
diff --git a/framework/source/dispatch/menudispatcher.cxx b/framework/source/dispatch/menudispatcher.cxx
index 78b10a271e30..1e715f58fddc 100644
--- a/framework/source/dispatch/menudispatcher.cxx
+++ b/framework/source/dispatch/menudispatcher.cxx
@@ -36,8 +36,9 @@
//_________________________________________________________________________________________________________________
#include <dispatch/menudispatcher.hxx>
#include <general.h>
-#include <classes/menuconfiguration.hxx>
+#include <xml/menuconfiguration.hxx>
#include <classes/addonmenu.hxx>
+#include <services.h>
//_________________________________________________________________________________________________________________
// interface includes
@@ -62,6 +63,7 @@
#include <tools/rcid.h>
#include <vos/mutex.hxx>
#include <toolkit/helper/vclunohelper.hxx>
+#include <rtl/logfile.hxx>
//_________________________________________________________________________________________________________________
// includes of other projects
@@ -388,7 +390,7 @@ IMPL_LINK( MenuDispatcher, Close_Impl, void*, EMPTYARG )
css::util::URL aURL;
aURL.Complete = ::rtl::OUString::createFromAscii(".uno:CloseWin");
css::uno::Reference< css::util::XURLTransformer > xTrans ( m_xFactory->createInstance(
- ::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer") ), css::uno::UNO_QUERY );
+ SERVICENAME_URLTRANSFORMER ), css::uno::UNO_QUERY );
if( xTrans.is() )
{
// Datei laden
@@ -443,26 +445,6 @@ sal_Bool MenuDispatcher::impldbg_checkParameter_MenuDispatcher( const uno::R
}
//*****************************************************************************************************************
-// We don't know anything about right values of aURL and seqArguments!
-// Check valid references only.
-sal_Bool MenuDispatcher::impldbg_checkParameter_dispatch( const URL& aURL ,
- const Sequence< PropertyValue >& seqArguments)
-{
- // Set default return value.
- sal_Bool bOK = sal_True;
- // Check parameter.
- if (
- ( &aURL == NULL ) ||
- ( &seqArguments == NULL )
- )
- {
- bOK = sal_False ;
- }
- // Return result of check.
- return bOK ;
-}
-
-//*****************************************************************************************************************
// We need a valid URL. What is meaning with "register for nothing"?!
// xControl must correct to - nobody can advised otherwise!
sal_Bool MenuDispatcher::impldbg_checkParameter_addStatusListener( const uno::Reference< XStatusListener >& xControl,
diff --git a/framework/source/dispatch/popupmenudispatcher.cxx b/framework/source/dispatch/popupmenudispatcher.cxx
index 293cac96ff89..78aa4bc1ea35 100644
--- a/framework/source/dispatch/popupmenudispatcher.cxx
+++ b/framework/source/dispatch/popupmenudispatcher.cxx
@@ -37,7 +37,7 @@
#include <dispatch/popupmenudispatcher.hxx>
#include <general.h>
-#include <classes/menuconfiguration.hxx>
+#include <xml/menuconfiguration.hxx>
#include <classes/addonmenu.hxx>
#include <services.h>
#include <properties.h>
@@ -241,8 +241,7 @@ throw( css::uno::RuntimeException )
css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider;
// Find popup menu controller using the base URL
- Any a = xPopupCtrlQuery->getByName( aBaseURL );
- a >>= xDispatchProvider;
+ xPopupCtrlQuery->getByName( aBaseURL ) >>= xDispatchProvider;
aGuard.unlock();
// Ask popup menu dispatch provider for dispatch object
@@ -384,8 +383,7 @@ void PopupMenuDispatcher::impl_RetrievePopupControllerQuery()
{
try
{
- Any a = xPropSet->getPropertyValue( FRAME_PROPNAME_LAYOUTMANAGER );
- a >>= xLayoutManager;
+ xPropSet->getPropertyValue( FRAME_PROPNAME_LAYOUTMANAGER ) >>= xLayoutManager;
if ( xLayoutManager.is() )
{
diff --git a/framework/source/dispatch/windowcommanddispatch.cxx b/framework/source/dispatch/windowcommanddispatch.cxx
index 8de2bc796036..c4dbed7991e2 100755
--- a/framework/source/dispatch/windowcommanddispatch.cxx
+++ b/framework/source/dispatch/windowcommanddispatch.cxx
@@ -55,6 +55,7 @@
#include <vcl/cmdevt.hxx>
#include <vos/mutex.hxx>
#include <toolkit/helper/vclunohelper.hxx>
+#include <rtl/logfile.hxx>
//_______________________________________________
// namespace
diff --git a/framework/source/helper/actiontriggerhelper.cxx b/framework/source/helper/actiontriggerhelper.cxx
index 15977c777f1e..dae7002d08ff 100644
--- a/framework/source/helper/actiontriggerhelper.cxx
+++ b/framework/source/helper/actiontriggerhelper.cxx
@@ -119,7 +119,7 @@ void InsertSubMenuItems( Menu* pSubMenu, USHORT& nItemId, Reference< XIndexConta
{
AddonsOptions aAddonOptions;
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
- sal_Bool bHiContrast = rSettings.GetMenuColor().IsDark();
+ sal_Bool bHiContrast = rSettings.GetHighContrastMode();
OUString aSlotURL( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
@@ -128,9 +128,7 @@ void InsertSubMenuItems( Menu* pSubMenu, USHORT& nItemId, Reference< XIndexConta
try
{
Reference< XPropertySet > xPropSet;
- Any a = xIndexAccess->getByIndex( i );
-
- if (( a >>= xPropSet ) && ( xPropSet.is() ))
+ if (( xIndexAccess->getByIndex( i ) >>= xPropSet ) && ( xPropSet.is() ))
{
if ( IsSeparator( xPropSet ))
{
diff --git a/framework/source/helper/dockingareadefaultacceptor.cxx b/framework/source/helper/dockingareadefaultacceptor.cxx
index 172a31f2ad2f..217c6bcefb55 100644
--- a/framework/source/helper/dockingareadefaultacceptor.cxx
+++ b/framework/source/helper/dockingareadefaultacceptor.cxx
@@ -82,7 +82,6 @@ using namespace ::rtl ;
DockingAreaDefaultAcceptor::DockingAreaDefaultAcceptor( const Reference< XFrame >& xOwner )
// Init baseclasses first
: ThreadHelpBase ( &Application::GetSolarMutex() )
- , OWeakObject ( )
// Init member
, m_xOwner ( xOwner )
{
@@ -96,18 +95,6 @@ DockingAreaDefaultAcceptor::~DockingAreaDefaultAcceptor()
}
//*****************************************************************************************************************
-// XInterface, XTypeProvider
-//*****************************************************************************************************************
-DEFINE_XINTERFACE_2( DockingAreaDefaultAcceptor ,
- OWeakObject ,
- DIRECT_INTERFACE(XTypeProvider ) ,
- DIRECT_INTERFACE(::com::sun::star::ui::XDockingAreaAcceptor ) )
-
-DEFINE_XTYPEPROVIDER_2( DockingAreaDefaultAcceptor ,
- XTypeProvider ,
- ::com::sun::star::ui::XDockingAreaAcceptor )
-
-//*****************************************************************************************************************
// XDockingAreaAcceptor
//*****************************************************************************************************************
css::uno::Reference< css::awt::XWindow > SAL_CALL DockingAreaDefaultAcceptor::getContainerWindow() throw (css::uno::RuntimeException)
diff --git a/framework/source/helper/mischelper.cxx b/framework/source/helper/mischelper.cxx
index 395d59259286..8e0f79b2607c 100644
--- a/framework/source/helper/mischelper.cxx
+++ b/framework/source/helper/mischelper.cxx
@@ -32,13 +32,21 @@
#include "precompiled_framework.hxx"
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/frame/XModuleManager.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
#include <tools/debug.hxx>
#include <comphelper/processfactory.hxx>
#include <helper/mischelper.hxx>
+#include <services.h>
using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
namespace framework
{
@@ -49,14 +57,10 @@ uno::Reference< linguistic2::XLanguageGuessing > LanguageGuessingHelper::GetGues
{
try
{
- uno::Reference< lang::XMultiServiceFactory > xMgr ( comphelper::getProcessServiceFactory() );
- if (xMgr.is())
- {
- m_xLanguageGuesser = uno::Reference< linguistic2::XLanguageGuessing >(
- xMgr->createInstance(
- rtl::OUString::createFromAscii( "com.sun.star.linguistic2.LanguageGuessing" ) ),
- uno::UNO_QUERY );
- }
+ m_xLanguageGuesser = uno::Reference< linguistic2::XLanguageGuessing >(
+ m_xServiceManager->createInstance(
+ rtl::OUString::createFromAscii( "com.sun.star.linguistic2.LanguageGuessing" ) ),
+ uno::UNO_QUERY );
}
catch (uno::Exception &r)
{
@@ -66,6 +70,76 @@ 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 aLabel;
+
+ // Retrieve popup menu labels
+ if ( !_xUICommandLabels.is() )
+ {
+ try
+ {
+ if ( !_rIni )
+ {
+ _rIni = sal_True;
+ Reference< XModuleManager > xModuleManager( _xServiceFactory->createInstance( SERVICENAME_MODULEMANAGER ), UNO_QUERY_THROW );
+
+ try
+ {
+ _rModuleIdentifier = xModuleManager->identify( _xFrame );
+ }
+ catch( Exception& )
+ {
+ }
+ }
+
+ Reference< XNameAccess > xNameAccess( _xServiceFactory->createInstance( SERVICENAME_UICOMMANDDESCRIPTION ), UNO_QUERY );
+ if ( xNameAccess.is() )
+ {
+ xNameAccess->getByName( _rModuleIdentifier ) >>= _xUICommandLabels;
+ }
+ }
+ catch ( Exception& )
+ {
+ }
+ }
+
+ if ( _xUICommandLabels.is() )
+ {
+ try
+ {
+ if ( aCmdURL.getLength() > 0 )
+ {
+ rtl::OUString aStr;
+ Sequence< PropertyValue > aPropSeq;
+ if ( _xUICommandLabels->getByName( aCmdURL ) >>= aPropSeq )
+ {
+ for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
+ {
+ if ( aPropSeq[i].Name.equalsAscii( _pName/*"Label"*/ ))
+ {
+ aPropSeq[i].Value >>= aStr;
+ break;
+ }
+ }
+ }
+ aLabel = aStr;
+ }
+ }
+ catch ( com::sun::star::uno::Exception& )
+ {
+ }
+ }
+
+ return aLabel;
+}
} // namespace framework
diff --git a/framework/source/helper/ocomponentaccess.cxx b/framework/source/helper/ocomponentaccess.cxx
index ef78779c3bc3..5f2aab470650 100644
--- a/framework/source/helper/ocomponentaccess.cxx
+++ b/framework/source/helper/ocomponentaccess.cxx
@@ -83,7 +83,6 @@ using namespace ::rtl ;
OComponentAccess::OComponentAccess( const Reference< XDesktop >& xOwner )
// Init baseclasses first
: ThreadHelpBase ( &Application::GetSolarMutex() )
- , OWeakObject ( )
// Init member
, m_xOwner ( xOwner )
{
@@ -99,20 +98,6 @@ OComponentAccess::~OComponentAccess()
}
//*****************************************************************************************************************
-// XInterface, XTypeProvider
-//*****************************************************************************************************************
-DEFINE_XINTERFACE_3( OComponentAccess ,
- OWeakObject ,
- DIRECT_INTERFACE(XTypeProvider ) ,
- DIRECT_INTERFACE(XEnumerationAccess ) ,
- DIRECT_INTERFACE(XElementAccess ) )
-
-DEFINE_XTYPEPROVIDER_3( OComponentAccess ,
- XTypeProvider ,
- XEnumerationAccess ,
- XElementAccess )
-
-//*****************************************************************************************************************
// XEnumerationAccess
//*****************************************************************************************************************
Reference< XEnumeration > SAL_CALL OComponentAccess::createEnumeration() throw( RuntimeException )
diff --git a/framework/source/helper/ocomponentenumeration.cxx b/framework/source/helper/ocomponentenumeration.cxx
index 15ae12458cef..5b0dbc6a7790 100644
--- a/framework/source/helper/ocomponentenumeration.cxx
+++ b/framework/source/helper/ocomponentenumeration.cxx
@@ -85,7 +85,6 @@ OComponentEnumeration::OComponentEnumeration( const Sequence< Reference< XCompon
// we must garant right initialization and a valid value of this! First initialize
// baseclasses and then members. And we need the mutex for other baseclasses !!!
: ThreadHelpBase ( &Application::GetSolarMutex() )
- , OWeakObject ( )
// Init member
, m_nPosition ( 0 ) // 0 is the first position for a valid list and the right value for an invalid list to!
, m_seqComponents ( seqComponents )
@@ -105,22 +104,6 @@ OComponentEnumeration::~OComponentEnumeration()
}
//*****************************************************************************************************************
-// XInterface, XTypeProvider
-//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( OComponentEnumeration ,
- OWeakObject ,
- DIRECT_INTERFACE(XTypeProvider ),
- DIRECT_INTERFACE(XEventListener ),
- DIRECT_INTERFACE(XEnumeration )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( OComponentEnumeration ,
- XTypeProvider ,
- XEventListener ,
- XEnumeration
- )
-
-//*****************************************************************************************************************
// XEventListener
//*****************************************************************************************************************
void SAL_CALL OComponentEnumeration::disposing( const EventObject&
diff --git a/framework/source/helper/oframes.cxx b/framework/source/helper/oframes.cxx
index 20ea3af1d929..3de76885efbc 100644
--- a/framework/source/helper/oframes.cxx
+++ b/framework/source/helper/oframes.cxx
@@ -87,7 +87,6 @@ OFrames::OFrames( const Reference< XMultiServiceFactory >& xFactory
FrameContainer* pFrameContainer )
// Init baseclasses first
: ThreadHelpBase ( &Application::GetSolarMutex() )
- , OWeakObject ( )
// Init member
, m_xFactory ( xFactory )
, m_xOwner ( xOwner )
@@ -109,24 +108,6 @@ OFrames::~OFrames()
}
//*****************************************************************************************************************
-// XInterface
-//*****************************************************************************************************************
-DEFINE_XINTERFACE_4 ( OFrames ,
- OWeakObject ,
- DIRECT_INTERFACE(XTypeProvider ),
- DIRECT_INTERFACE(XFrames ),
- DIRECT_INTERFACE(XIndexAccess ),
- DIRECT_INTERFACE(XElementAccess )
- )
-
-DEFINE_XTYPEPROVIDER_4 ( OFrames ,
- XTypeProvider ,
- XFrames ,
- XIndexAccess ,
- XElementAccess
- )
-
-//*****************************************************************************************************************
// XFrames
//*****************************************************************************************************************
void SAL_CALL OFrames::append( const Reference< XFrame >& xFrame ) throw( RuntimeException )
diff --git a/framework/source/helper/persistentwindowstate.cxx b/framework/source/helper/persistentwindowstate.cxx
index b8e6e5e7ddfd..1deae55d5622 100644
--- a/framework/source/helper/persistentwindowstate.cxx
+++ b/framework/source/helper/persistentwindowstate.cxx
@@ -240,12 +240,11 @@ void SAL_CALL PersistentWindowState::disposing(const css::lang::EventObject&)
try
{
- css::uno::Any aWindowState = ::comphelper::ConfigurationHelper::readDirectKey(xSMGR,
+ ::comphelper::ConfigurationHelper::readDirectKey(xSMGR,
sPackage,
sRelPath,
sKey,
- ::comphelper::ConfigurationHelper::E_READONLY);
- aWindowState >>= sWindowState;
+ ::comphelper::ConfigurationHelper::E_READONLY) >>= sWindowState;
}
catch(const css::uno::RuntimeException& exRun)
{ throw exRun; }
diff --git a/framework/source/helper/popupmenucontrollerbase.cxx b/framework/source/helper/popupmenucontrollerbase.cxx
index 0145de64d1b7..7a768b11a32d 100644
--- a/framework/source/helper/popupmenucontrollerbase.cxx
+++ b/framework/source/helper/popupmenucontrollerbase.cxx
@@ -44,9 +44,8 @@
#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/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
-
+#include <com/sun/star/lang/DisposedException.hpp>
//_________________________________________________________________________________________________________________
// includes of other projects
@@ -57,7 +56,7 @@
#endif
#include <vcl/svapp.hxx>
#include <rtl/ustrbuf.hxx>
-
+#include <rtl/logfile.hxx>
//_________________________________________________________________________________________________________________
// Defines
//_________________________________________________________________________________________________________________
@@ -111,6 +110,10 @@ PopupMenuControllerBase::PopupMenuControllerBase( const ::com::sun::star::uno::R
m_xServiceManager( xServiceManager ),
m_aListenerContainer( m_aLock.getShareableOslMutex() )
{
+ if ( m_xServiceManager.is() )
+ m_xURLTransformer.set( m_xServiceManager->createInstance(
+ SERVICENAME_URLTRANSFORMER),
+ UNO_QUERY );
}
PopupMenuControllerBase::~PopupMenuControllerBase()
@@ -178,10 +181,12 @@ void SAL_CALL PopupMenuControllerBase::disposing( const EventObject& ) throw ( R
// XMenuListener
void SAL_CALL PopupMenuControllerBase::highlight( const css::awt::MenuEvent& ) throw (RuntimeException)
{
- ResetableGuard aLock( m_aLock );
+}
- if ( m_bDisposed )
- throw DisposedException();
+void PopupMenuControllerBase::impl_select(const Reference< XDispatch >& _xDispatch,const ::com::sun::star::util::URL& aURL)
+{
+ Sequence<PropertyValue> aArgs;
+ _xDispatch->dispatch( aURL, aArgs );
}
void SAL_CALL PopupMenuControllerBase::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
@@ -205,37 +210,24 @@ void SAL_CALL PopupMenuControllerBase::select( const css::awt::MenuEvent& rEvent
if ( pPopupMenu )
{
css::util::URL aTargetURL;
- Sequence<PropertyValue> aArgs;
- Reference< XURLTransformer > xURLTransformer( xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
-
{
vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu();
aTargetURL.Complete = pVCLPopupMenu->GetItemCommand( rEvent.MenuId );
}
- xURLTransformer->parseStrict( aTargetURL );
- xDispatch->dispatch( aTargetURL, aArgs );
+ m_xURLTransformer->parseStrict( aTargetURL );
+ impl_select(xDispatch,aTargetURL);
}
}
}
void SAL_CALL PopupMenuControllerBase::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
{
- ResetableGuard aLock( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
}
void SAL_CALL PopupMenuControllerBase::deactivate( const css::awt::MenuEvent& ) throw (RuntimeException)
{
- ResetableGuard aLock( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
}
void SAL_CALL PopupMenuControllerBase::updatePopupMenu() throw ( ::com::sun::star::uno::RuntimeException )
@@ -247,12 +239,9 @@ void SAL_CALL PopupMenuControllerBase::updatePopupMenu() throw ( ::com::sun::sta
Reference< XStatusListener > xStatusListener( static_cast< OWeakObject* >( this ), UNO_QUERY );
Reference< XDispatch > xDispatch( m_xDispatch );
- Reference< XURLTransformer > xURLTransformer( m_xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
com::sun::star::util::URL aTargetURL;
aTargetURL.Complete = m_aCommandURL;
- xURLTransformer->parseStrict( aTargetURL );
+ m_xURLTransformer->parseStrict( aTargetURL );
aLock.unlock();
// Add/remove status listener to get a status update once
@@ -279,10 +268,7 @@ throw( RuntimeException )
return Reference< XDispatch >();
}
-Sequence< Reference< XDispatch > > SAL_CALL
-PopupMenuControllerBase::queryDispatches(
- const Sequence< DispatchDescriptor >& lDescriptor )
-throw( RuntimeException )
+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!
@@ -381,9 +367,6 @@ throw( ::com::sun::star::uno::RuntimeException )
// XInitialization
void SAL_CALL PopupMenuControllerBase::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
{
- const rtl::OUString aFrameName( RTL_CONSTASCII_USTRINGPARAM( "Frame" ));
- const rtl::OUString aCommandURLName( RTL_CONSTASCII_USTRINGPARAM( "CommandURL" ));
-
ResetableGuard aLock( m_aLock );
sal_Bool bInitalized( m_bInitialized );
@@ -413,5 +396,35 @@ void SAL_CALL PopupMenuControllerBase::initialize( const Sequence< Any >& aArgum
}
}
}
+// 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/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx
index 17196682445f..c57840b4d442 100644
--- a/framework/source/helper/titlebarupdate.cxx
+++ b/framework/source/helper/titlebarupdate.cxx
@@ -336,8 +336,7 @@ void TitleBarUpdate::impl_updateIcon(const css::uno::Reference< css::frame::XFra
{
try
{
- css::uno::Any aID = xSet->getPropertyValue( CONTROLLER_PROPNAME_ICONID );
- aID >>= nIcon;
+ xSet->getPropertyValue( CONTROLLER_PROPNAME_ICONID ) >>= nIcon;
}
catch(const css::uno::Exception&)
{}
diff --git a/framework/source/helper/titlehelper.cxx b/framework/source/helper/titlehelper.cxx
index 291ed4f00633..88a6484ca92c 100644
--- a/framework/source/helper/titlehelper.cxx
+++ b/framework/source/helper/titlehelper.cxx
@@ -521,7 +521,7 @@ void TitleHelper::impl_updateTitleForFrame (const css::uno::Reference< css::fram
impl_appendProductName (sTitle);
impl_appendModuleName (sTitle);
impl_appendProductExtension (sTitle);
- impl_appendEvalVersion (sTitle);
+ //impl_appendEvalVersion (sTitle);
impl_appendDebugVersion (sTitle);
// SYNCHRONIZED ->
@@ -633,29 +633,29 @@ void TitleHelper::impl_appendDebugVersion (::rtl::OUStringBuffer&)
#endif
//*****************************************************************************************************************
-void TitleHelper::impl_appendEvalVersion (::rtl::OUStringBuffer& sTitle)
+void TitleHelper::impl_appendEvalVersion (::rtl::OUStringBuffer& /*sTitle*/)
{
// SYNCHRONIZED ->
- ::osl::ResettableMutexGuard aLock(m_aMutex);
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR ;
- aLock.clear ();
- // <- SYNCHRONIZED
-
- css::uno::Reference< css::beans::XMaterialHolder > xHolder(
- xSMGR->createInstance(SERVICENAME_TABREG),
- css::uno::UNO_QUERY);
-
- if ( ! xHolder.is())
- return;
-
- ::comphelper::SequenceAsHashMap aMaterial(xHolder->getMaterial());
- const ::rtl::OUString sEvalTitle = aMaterial.getUnpackedValueOrDefault(TABREG_PROPNAME_TITLE, ::rtl::OUString());
-
- if (sEvalTitle.getLength())
- {
- sTitle.appendAscii (" " );
- sTitle.append (sEvalTitle);
- }
+ // ::osl::ResettableMutexGuard aLock(m_aMutex);
+ // css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR ;
+ //aLock.clear ();
+ //// <- SYNCHRONIZED
+
+ //css::uno::Reference< css::beans::XMaterialHolder > xHolder(
+ // xSMGR->createInstance(SERVICENAME_TABREG),
+ // css::uno::UNO_QUERY);
+
+ // if ( ! xHolder.is())
+ // return;
+
+ // ::comphelper::SequenceAsHashMap aMaterial(xHolder->getMaterial());
+ //const ::rtl::OUString sEvalTitle = aMaterial.getUnpackedValueOrDefault(TABREG_PROPNAME_TITLE, ::rtl::OUString());
+
+ //if (sEvalTitle.getLength())
+ //{
+ // sTitle.appendAscii (" " );
+ // sTitle.append (sEvalTitle);
+ //}
}
//-----------------------------------------------
diff --git a/framework/source/helper/uiconfigelementwrapperbase.cxx b/framework/source/helper/uiconfigelementwrapperbase.cxx
index 91c6d80e2955..1f93e356f290 100644
--- a/framework/source/helper/uiconfigelementwrapperbase.cxx
+++ b/framework/source/helper/uiconfigelementwrapperbase.cxx
@@ -38,6 +38,8 @@
#include <general.h>
#include <properties.h>
#include <threadhelp/resetableguard.hxx>
+#include <uielement/constitemcontainer.hxx>
+#include <uielement/rootitemcontainer.hxx>
//_________________________________________________________________________________________________________________
// interface includes
@@ -46,11 +48,13 @@
#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
//_________________________________________________________________________________________________________________
#include <vcl/svapp.hxx>
+#include <rtl/logfile.hxx>
const int UIELEMENT_PROPHANDLE_CONFIGSOURCE = 1;
const int UIELEMENT_PROPHANDLE_FRAME = 2;
@@ -75,6 +79,7 @@ using namespace com::sun::star::beans;
using namespace com::sun::star::uno;
using namespace com::sun::star::frame;
using namespace com::sun::star::lang;
+using namespace com::sun::star::container;
using namespace ::com::sun::star::ui;
namespace framework
@@ -110,7 +115,7 @@ DEFINE_XTYPEPROVIDER_10 ( UIConfigElementWrapperBase
::com::sun::star::ui::XUIConfigurationListener
)
-UIConfigElementWrapperBase::UIConfigElementWrapperBase( sal_Int16 nType )
+UIConfigElementWrapperBase::UIConfigElementWrapperBase( sal_Int16 nType,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xServiceFactory )
: ThreadHelpBase ( &Application::GetSolarMutex() )
, ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType >( m_aLock.getShareableOslMutex() )
, ::cppu::OPropertySetHelper ( *(static_cast< ::cppu::OBroadcastHelper* >(this)) )
@@ -122,6 +127,7 @@ UIConfigElementWrapperBase::UIConfigElementWrapperBase( sal_Int16 nType )
, m_bConfigListening ( sal_False )
, m_bDisposed ( sal_False )
, m_bNoClose ( sal_False )
+ , m_xServiceFactory ( _xServiceFactory )
, m_aListenerContainer ( m_aLock.getShareableOslMutex() )
{
}
@@ -493,5 +499,58 @@ const com::sun::star::uno::Sequence< com::sun::star::beans::Property > UIConfigE
// Return static "PropertyDescriptor"
return lPropertyDescriptor;
}
+void SAL_CALL UIConfigElementWrapperBase::setSettings( const Reference< XIndexAccess >& xSettings ) throw ( RuntimeException )
+{
+ ResetableGuard aLock( m_aLock );
+
+ //if ( m_bDisposed )
+ // throw DisposedException();
+
+ if ( xSettings.is() )
+ {
+ // Create a copy of the data if the container is not const
+ Reference< XIndexReplace > xReplace( xSettings, UNO_QUERY );
+ if ( xReplace.is() )
+ m_xConfigData = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( xSettings ) ), UNO_QUERY );
+ else
+ m_xConfigData = xSettings;
+
+ if ( m_xConfigSource.is() && m_bPersistent )
+ {
+ ::rtl::OUString aResourceURL( m_aResourceURL );
+ Reference< XUIConfigurationManager > xUICfgMgr( m_xConfigSource );
+
+ aLock.unlock();
+
+ try
+ {
+ xUICfgMgr->replaceSettings( aResourceURL, m_xConfigData );
+ }
+ catch( NoSuchElementException& )
+ {
+ }
+ }
+ else if ( !m_bPersistent )
+ {
+ // Transient menubar => Fill menubar with new data
+ impl_fillNewData();
+ }
+ }
+}
+void UIConfigElementWrapperBase::impl_fillNewData()
+{
+}
+Reference< XIndexAccess > SAL_CALL UIConfigElementWrapperBase::getSettings( sal_Bool bWriteable ) throw ( RuntimeException )
+{
+ ResetableGuard aLock( m_aLock );
+
+ //if ( m_bDisposed )
+ // throw DisposedException();
+
+ if ( bWriteable )
+ return Reference< XIndexAccess >( static_cast< OWeakObject * >( new RootItemContainer( m_xConfigData ) ), UNO_QUERY );
+
+ return m_xConfigData;
+}
}
diff --git a/framework/source/helper/uielementwrapperbase.cxx b/framework/source/helper/uielementwrapperbase.cxx
index d7137b148e2b..e406e19df81b 100644
--- a/framework/source/helper/uielementwrapperbase.cxx
+++ b/framework/source/helper/uielementwrapperbase.cxx
@@ -50,6 +50,7 @@
// includes of other projects
//_________________________________________________________________________________________________________________
#include <vcl/svapp.hxx>
+#include <rtl/logfile.hxx>
const int UIELEMENT_PROPHANDLE_RESOURCEURL = 1;
const int UIELEMENT_PROPHANDLE_TYPE = 2;
diff --git a/framework/source/inc/accelerators/acceleratorconfiguration.hxx b/framework/source/inc/accelerators/acceleratorconfiguration.hxx
index 8a497c859b1d..d6547105a347 100644
--- a/framework/source/inc/accelerators/acceleratorconfiguration.hxx
+++ b/framework/source/inc/accelerators/acceleratorconfiguration.hxx
@@ -37,6 +37,7 @@
#include <accelerators/istoragelistener.hxx>
#include <accelerators/presethandler.hxx>
#include <accelerators/acceleratorcache.hxx>
+#include <accelerators/keymapping.hxx>
#include <macros/xinterface.hxx>
#include <macros/xtypeprovider.hxx>
#include <threadhelp/threadhelpbase.hxx>
@@ -67,6 +68,7 @@
#include <cppuhelper/propshlp.hxx>
#include <cppuhelper/weak.hxx>
#include <comphelper/locale.hxx>
+#include <salhelper/singletonref.hxx>
//__________________________________________
// definition
@@ -75,7 +77,7 @@ namespace framework
{
//-----------------------------------------------
// Accelerators.xcu
-static const ::rtl::OUString CFG_ENTRY_ACCELERATORS = ::rtl::OUString::createFromAscii("org.openoffice.Office.Accelerators");
+
static const ::rtl::OUString CFG_ENTRY_PRIMARY = ::rtl::OUString::createFromAscii("PrimaryKeys");
static const ::rtl::OUString CFG_ENTRY_SECONDARY = ::rtl::OUString::createFromAscii("SecondaryKeys");
@@ -338,6 +340,8 @@ class XCUBasedAcceleratorConfiguration : protected ThreadHelpBase
::rtl::OUString m_sGlobalOrModules;
::rtl::OUString m_sModuleCFG;
+ ::salhelper::SingletonRef< KeyMapping > m_rKeyMapping;
+
//______________________________________
// native interface!
diff --git a/framework/source/inc/accelerators/presethandler.hxx b/framework/source/inc/accelerators/presethandler.hxx
index a7c266db52b6..211316758f4c 100644
--- a/framework/source/inc/accelerators/presethandler.hxx
+++ b/framework/source/inc/accelerators/presethandler.hxx
@@ -356,8 +356,6 @@ class PresetHandler : private ThreadHelpBase // attention! Must be the first bas
const css::uno::Reference< css::embed::XStorage >& xDocumentRoot ,
const ::comphelper::Locale& aLocale = ::comphelper::Locale(::comphelper::Locale::X_NOTRANSLATE()));
- sal_Bool existsTarget(const ::rtl::OUString& sTarget) const;
-
//---------------------------------------
/** @short try to copy the specified preset from the share
layer to the user layer and establish it as the
diff --git a/framework/source/inc/dispatch/uieventloghelper.hxx b/framework/source/inc/dispatch/uieventloghelper.hxx
index d897f08e99a3..8f2c8148b008 100644
--- a/framework/source/inc/dispatch/uieventloghelper.hxx
+++ b/framework/source/inc/dispatch/uieventloghelper.hxx
@@ -40,6 +40,7 @@
#include <com/sun/star/util/URL.hpp>
#include <comphelper/uieventslogger.hxx>
#include <rtl/ustring.hxx>
+#include <services.h>
namespace framework
{
@@ -61,7 +62,7 @@ namespace framework
{
try
{
- static ::rtl::OUString our_aModuleManagerName = ::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager");
+ static ::rtl::OUString our_aModuleManagerName = SERVICENAME_MODULEMANAGER;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > xModuleManager(
rServiceManager->createInstance(our_aModuleManagerName)
, ::com::sun::star::uno::UNO_QUERY_THROW);
diff --git a/framework/source/inc/loadenv/loadenv.hxx b/framework/source/inc/loadenv/loadenv.hxx
index 4a49f72df985..40ded72db9f6 100644
--- a/framework/source/inc/loadenv/loadenv.hxx
+++ b/framework/source/inc/loadenv/loadenv.hxx
@@ -67,7 +67,7 @@
namespace framework{
namespace css = ::com::sun::star;
-
+class QuietInteraction;
//_______________________________________________
// definitions
@@ -232,6 +232,8 @@ class LoadEnv : private ThreadHelpBase
/** TODO document me ... */
void* m_pCheck;
+ QuietInteraction* m_pQuietInteraction;
+
//___________________________________________
// native interface
diff --git a/framework/source/inc/pattern/frame.hxx b/framework/source/inc/pattern/frame.hxx
index 5c1fd0db9ce5..1be340b10071 100644
--- a/framework/source/inc/pattern/frame.hxx
+++ b/framework/source/inc/pattern/frame.hxx
@@ -42,6 +42,7 @@
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/util/XCloseable.hpp>
//_______________________________________________
diff --git a/framework/source/interaction/makefile.mk b/framework/source/interaction/makefile.mk
index 1399335b6ca8..4ae3564c21f7 100644
--- a/framework/source/interaction/makefile.mk
+++ b/framework/source/interaction/makefile.mk
@@ -45,7 +45,7 @@ CDEFS+=-DCOMPMOD_NAMESPACE=framework
# --- Generate -----------------------------------------------------
-SLOFILES= $(SLO)$/stillinteraction.obj \
+SLOFILES= $(SLO)$/quietinteraction.obj \
$(SLO)$/preventduplicateinteraction.obj
# --- Targets ------------------------------------------------------
diff --git a/framework/source/interaction/stillinteraction.cxx b/framework/source/interaction/quietinteraction.cxx
index 278053d6f6bb..30130bf37360 100644
--- a/framework/source/interaction/stillinteraction.cxx
+++ b/framework/source/interaction/quietinteraction.cxx
@@ -6,7 +6,7 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: stillinteraction.cxx,v $
+ * $RCSfile: QuietInteraction.cxx,v $
* $Revision: 1.7 $
*
* This file is part of OpenOffice.org.
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_framework.hxx"
-#include "interaction/stillinteraction.hxx"
+#include "interaction/quietinteraction.hxx"
//_________________________________________________________________________________________________________________
// my own includes
@@ -77,18 +77,18 @@ namespace framework{
// exported definitions
//_________________________________________________________________________________________________________________
-DEFINE_XINTERFACE_2( StillInteraction ,
+DEFINE_XINTERFACE_2( QuietInteraction ,
OWeakObject ,
DIRECT_INTERFACE(css::lang::XTypeProvider ) ,
DIRECT_INTERFACE(css::task::XInteractionHandler) )
-DEFINE_XTYPEPROVIDER_2( StillInteraction ,
+DEFINE_XTYPEPROVIDER_2( QuietInteraction ,
css::lang::XTypeProvider ,
css::task::XInteractionHandler )
//_________________________________________________________________________________________________________________
-StillInteraction::StillInteraction()
+QuietInteraction::QuietInteraction()
: ThreadHelpBase ( &Application::GetSolarMutex() )
, ::cppu::OWeakObject( )
, m_aRequest ( )
@@ -97,7 +97,7 @@ StillInteraction::StillInteraction()
//_________________________________________________________________________________________________________________
-void SAL_CALL StillInteraction::handle( const css::uno::Reference< css::task::XInteractionRequest >& xRequest ) throw( css::uno::RuntimeException )
+void SAL_CALL QuietInteraction::handle( const css::uno::Reference< css::task::XInteractionRequest >& xRequest ) throw( css::uno::RuntimeException )
{
// safe the request for outside analyzing everytime!
css::uno::Any aRequest = xRequest->getRequest();
@@ -172,7 +172,7 @@ void SAL_CALL StillInteraction::handle( const css::uno::Reference< css::task::XI
//_________________________________________________________________________________________________________________
-css::uno::Any StillInteraction::getRequest() const
+css::uno::Any QuietInteraction::getRequest() const
{
/* SAFE { */
ReadGuard aReadLock(m_aLock);
@@ -182,7 +182,7 @@ css::uno::Any StillInteraction::getRequest() const
//_________________________________________________________________________________________________________________
-sal_Bool StillInteraction::wasUsed() const
+sal_Bool QuietInteraction::wasUsed() const
{
/* SAFE { */
ReadGuard aReadLock(m_aLock);
diff --git a/framework/source/jobs/helponstartup.cxx b/framework/source/jobs/helponstartup.cxx
index 9cc67cd22ad0..f28f8c19229f 100644
--- a/framework/source/jobs/helponstartup.cxx
+++ b/framework/source/jobs/helponstartup.cxx
@@ -85,19 +85,6 @@ static ::rtl::OUString ENVTYPE_DOCUMENTEVENT = ::rtl::OUString::createFromAsc
//-----------------------------------------------
-DEFINE_XINTERFACE_4(HelpOnStartup ,
- OWeakObject ,
- DIRECT_INTERFACE(css::lang::XTypeProvider ),
- DIRECT_INTERFACE(css::lang::XServiceInfo ),
- DIRECT_INTERFACE(css::task::XJob ),
- DIRECT_INTERFACE(css::lang::XEventListener))
-
-DEFINE_XTYPEPROVIDER_4(HelpOnStartup ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- css::task::XJob ,
- css::lang::XEventListener)
-
DEFINE_XSERVICEINFO_MULTISERVICE(HelpOnStartup ,
::cppu::OWeakObject ,
SERVICENAME_JOB ,
diff --git a/framework/source/jobs/job.cxx b/framework/source/jobs/job.cxx
index a72d2516d8b8..40d36f9a65f8 100644
--- a/framework/source/jobs/job.cxx
+++ b/framework/source/jobs/job.cxx
@@ -45,11 +45,13 @@
#include <com/sun/star/task/XAsyncJob.hpp>
#include <com/sun/star/util/XCloseBroadcaster.hpp>
#include <com/sun/star/util/XCloseable.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
//________________________________
// includes of other projects
#include <rtl/ustrbuf.hxx>
#include <vcl/svapp.hxx>
+#include <comphelper/uieventslogger.hxx>
//________________________________
// namespace
@@ -236,6 +238,7 @@ void Job::execute( /*IN*/ const css::uno::Sequence< css::beans::NamedValue >& lD
// Otherwhise we might die by ref count ...
css::uno::Reference< css::task::XJobListener > xThis(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY);
+ if ( ::comphelper::UiEventsLogger::isEnabled() )
try
{
// create the job
diff --git a/framework/source/jobs/jobdata.cxx b/framework/source/jobs/jobdata.cxx
index 77bfe23c4ea2..ce615370cd82 100644
--- a/framework/source/jobs/jobdata.cxx
+++ b/framework/source/jobs/jobdata.cxx
@@ -660,23 +660,20 @@ css::uno::Sequence< ::rtl::OUString > JobData::getEnabledJobsForEvent( const css
for (sal_Int32 s=0; s<c; ++s)
{
- css::uno::Any aNode = xJobList->getByName(pAllJobs[s]);
css::uno::Reference< css::beans::XPropertySet > xJob;
if (
- !(aNode >>= xJob) ||
+ !(xJobList->getByName(pAllJobs[s]) >>= xJob) ||
!(xJob.is() )
)
{
continue;
}
- aNode = xJob->getPropertyValue(ADMINTIME);
::rtl::OUString sAdminTime;
- aNode >>= sAdminTime;
+ xJob->getPropertyValue(ADMINTIME) >>= sAdminTime;
- aNode = xJob->getPropertyValue(USERTIME);
::rtl::OUString sUserTime;
- aNode >>= sUserTime;
+ xJob->getPropertyValue(USERTIME) >>= sUserTime;
if (!isEnabled(sAdminTime, sUserTime))
continue;
diff --git a/framework/source/jobs/jobresult.cxx b/framework/source/jobs/jobresult.cxx
index 66b4eff3ecf2..c30e2c411539 100644
--- a/framework/source/jobs/jobresult.cxx
+++ b/framework/source/jobs/jobresult.cxx
@@ -138,7 +138,7 @@ JobResult::JobResult( /*IN*/ const css::uno::Any& aResult )
// analyze the result and actualize our other members
::comphelper::SequenceAsHashMap aProtocol(aResult);
- if (aProtocol.size() < 1)
+ if ( aProtocol.empty() )
return;
::comphelper::SequenceAsHashMap::const_iterator pIt = aProtocol.end();
diff --git a/framework/source/jobs/shelljob.cxx b/framework/source/jobs/shelljob.cxx
index 91c44d65703b..573c23f32fc9 100644
--- a/framework/source/jobs/shelljob.cxx
+++ b/framework/source/jobs/shelljob.cxx
@@ -80,17 +80,6 @@ static const ::rtl::OUString PROP_CHECKEXITCODE = ::rtl::OUString::createFromAsc
//-----------------------------------------------
-DEFINE_XINTERFACE_3(ShellJob ,
- OWeakObject ,
- DIRECT_INTERFACE(css::lang::XTypeProvider ),
- DIRECT_INTERFACE(css::lang::XServiceInfo ),
- DIRECT_INTERFACE(css::task::XJob ))
-
-DEFINE_XTYPEPROVIDER_3(ShellJob ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- css::task::XJob )
-
DEFINE_XSERVICEINFO_MULTISERVICE(ShellJob ,
::cppu::OWeakObject ,
SERVICENAME_JOB ,
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 932dd7fd1019..fb10e4fae24c 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -86,6 +86,7 @@
#include <com/sun/star/frame/LayoutManagerEvents.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XDispatchHelper.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
//_________________________________________________________________________________________________________________
// other includes
@@ -107,7 +108,7 @@
#include <svtools/cmdoptions.hxx>
#include <algorithm>
-
+#include <boost/bind.hpp>
// ______________________________________________
// using namespace
@@ -131,6 +132,26 @@ using namespace ::com::sun::star::frame;
// You have to change BOTH values, see sfx2/inc/sfx2/sfxsids.hrc (SID_DOCKWIN_START)
static const sal_Int32 DOCKWIN_ID_BASE = 9800;
+bool lcl_checkUIElement(const Reference< XUIElement >& xUIElement,css::awt::Rectangle& _rPosSize,Reference< css::awt::XWindow >& _xWindow)
+{
+ bool bRet = xUIElement.is();
+ if ( bRet )
+ {
+ vos::OGuard aGuard( Application::GetSolarMutex() );
+ _xWindow.set( xUIElement->getRealInterface(), UNO_QUERY );
+ _rPosSize = _xWindow->getPosSize();
+
+ Window* pWindow = VCLUnoHelper::GetWindow( _xWindow );
+ if ( pWindow->GetType() == WINDOW_TOOLBOX )
+ {
+ ::Size aSize = ((ToolBox*)pWindow)->CalcWindowSizePixel( 1 );
+ _rPosSize.Width = aSize.Width();
+ _rPosSize.Height = aSize.Height();
+ }
+ } // if ( xUIElement.is() )
+ return bRet;
+}
+
// convert alignment constant to vcl's WindowAlign type
static WindowAlign ImplConvertAlignment( sal_Int16 aAlignment )
{
@@ -200,15 +221,10 @@ bool LayoutManager::UIElement::operator< ( const LayoutManager::UIElement& aUIEl
bool bEqual = ( m_aDockedData.m_aPos.X() == aUIElement.m_aDockedData.m_aPos.X() );
if ( bEqual )
{
- if ( m_bUserActive && !aUIElement.m_bUserActive )
- return sal_True;
- else if ( !m_bUserActive && aUIElement.m_bUserActive )
- return sal_False;
- else
- return sal_False;
+ return m_bUserActive && !aUIElement.m_bUserActive;
}
else
- return ( m_aDockedData.m_aPos.X() <= aUIElement.m_aDockedData.m_aPos.X() );
+ return ( m_aDockedData.m_aPos.X() < aUIElement.m_aDockedData.m_aPos.X() );
}
}
else
@@ -220,15 +236,10 @@ bool LayoutManager::UIElement::operator< ( const LayoutManager::UIElement& aUIEl
bool bEqual = ( m_aDockedData.m_aPos.Y() == aUIElement.m_aDockedData.m_aPos.Y() );
if ( bEqual )
{
- if ( m_bUserActive && !aUIElement.m_bUserActive )
- return sal_True;
- else if ( !m_bUserActive && aUIElement.m_bUserActive )
- return sal_False;
- else
- return sal_False;
+ return m_bUserActive && !aUIElement.m_bUserActive;
}
else
- return ( m_aDockedData.m_aPos.Y() <= aUIElement.m_aDockedData.m_aPos.Y() );
+ return ( m_aDockedData.m_aPos.Y() < aUIElement.m_aDockedData.m_aPos.Y() );
}
}
}
@@ -394,7 +405,7 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM
, ::cppu::OWeakObject ( )
, m_xSMGR( xServiceManager )
, m_xURLTransformer( Reference< XURLTransformer >( xServiceManager->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
+ SERVICENAME_URLTRANSFORMER),
UNO_QUERY ))
, m_nLockCount( 0 )
, m_bActive( sal_False )
@@ -493,8 +504,7 @@ void LayoutManager::impl_clearUpMenuBar()
{
try
{
- Any a = xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XMenuBar" )));
- a >>= xMenuBar;
+ xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XMenuBar" ))) >>= xMenuBar;
}
catch ( com::sun::star::beans::UnknownPropertyException )
{
@@ -821,7 +831,8 @@ void LayoutManager::implts_destroyDockingAreaWindows()
aWriteLock.unlock();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
- for ( sal_Int32 i=0; i < (sal_Int32)oldDockingAreaWindows.size(); i++ )
+ const sal_uInt32 nCount = oldDockingAreaWindows.size();
+ for ( sal_uInt32 i=0; i < nCount; i++ )
{
if ( oldDockingAreaWindows[i].is() )
{
@@ -957,13 +968,13 @@ void LayoutManager::implts_createAddonsToolBars()
Sequence< PropertyValue > aPropSeq( 2 );
aPropSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Frame" ));
- aPropSeq[0].Value = makeAny( xFrame );
+ aPropSeq[0].Value <<= xFrame;
aPropSeq[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ConfigurationData" ));
for ( sal_uInt32 i = 0; i < nCount; i++ )
{
::rtl::OUString aAddonToolBarName( aAddonsToolBarStaticName + m_pAddonOptions->GetAddonsToolbarResourceName(i) );
aAddonToolBarData = m_pAddonOptions->GetAddonsToolBarPart( i );
- aPropSeq[1].Value = makeAny( aAddonToolBarData );
+ aPropSeq[1].Value <<= aAddonToolBarData;
aWriteLock.lock();
UIElement aElement = impl_findElement( aAddonToolBarName );
@@ -1072,15 +1083,16 @@ void LayoutManager::implts_createNonContextSensitiveToolBars()
try
{
- rtl::OUString aElementType;
- rtl::OUString aElementName;
- rtl::OUString aName;
-
- Reference< ::com::sun::star::ui::XUIElement > xUIElement;
Sequence< rtl::OUString > aToolbarNames = xPersistentWindowState->getElementNames();
if ( aToolbarNames.getLength() > 0 )
{
+ rtl::OUString aElementType;
+ rtl::OUString aElementName;
+ rtl::OUString aName;
+
+ Reference< ::com::sun::star::ui::XUIElement > xUIElement;
+ aMakeVisibleToolbars.reserve(aToolbarNames.getLength());
WriteGuard aWriteLock( m_aLock );
const rtl::OUString* pTbNames = aToolbarNames.getConstArray();
@@ -1120,12 +1132,10 @@ void LayoutManager::implts_createNonContextSensitiveToolBars()
{
}
- if ( aMakeVisibleToolbars.size() > 0 )
+ if ( !aMakeVisibleToolbars.empty() )
{
implts_lock();
- for ( sal_uInt32 i = 0; i < aMakeVisibleToolbars.size(); i++ )
- requestElement( aMakeVisibleToolbars[i] );
-
+ ::std::for_each( aMakeVisibleToolbars.begin(), aMakeVisibleToolbars.end(),::boost::bind( &LayoutManager::requestElement, this,_1 ));
implts_unlock();
}
}
@@ -1368,7 +1378,8 @@ void LayoutManager::implts_refreshContextToolbarsVisibility()
aReadLock.unlock();
UIElement aUIElement;
- for ( sal_uInt32 i = 0; i < aToolbarVisibleVector.size(); i++ )
+ const sal_uInt32 nCount = aToolbarVisibleVector.size();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
UIElementVisibility& rToolbar = aToolbarVisibleVector[i];
@@ -1411,10 +1422,8 @@ sal_Bool LayoutManager::implts_readWindowStateData( const rtl::OUString& aName,
try
{
- Any a;
Sequence< PropertyValue > aWindowState;
- a = xPersistentWindowState->getByName( aName );
- if ( a >>= aWindowState )
+ if ( xPersistentWindowState->getByName( aName ) >>= aWindowState )
{
sal_Bool bValue( sal_False );
for ( sal_Int32 n = 0; n < aWindowState.getLength(); n++ )
@@ -1579,18 +1588,18 @@ void LayoutManager::implts_writeWindowStateData( const rtl::OUString& aName, con
aPos.X = rElementData.m_aDockedData.m_aPos.X();
aPos.Y = rElementData.m_aDockedData.m_aPos.Y();
aWindowState[3].Name = m_aPropDockPos;
- aWindowState[3].Value = makeAny( aPos );
+ aWindowState[3].Value <<= aPos;
aPos.X = rElementData.m_aFloatingData.m_aPos.X();
aPos.Y = rElementData.m_aFloatingData.m_aPos.Y();
aWindowState[4].Name = m_aPropPos;
- aWindowState[4].Value = makeAny( aPos );
+ aWindowState[4].Value <<= aPos;
css::awt::Size aSize;
aSize.Width = rElementData.m_aFloatingData.m_aSize.Width();
aSize.Height = rElementData.m_aFloatingData.m_aSize.Height();
aWindowState[5].Name = m_aPropSize;
- aWindowState[5].Value = makeAny( aSize );
+ aWindowState[5].Value <<= aSize;
aWindowState[6].Name = m_aPropUIName;
aWindowState[6].Value = makeAny( rElementData.m_aUIName );
aWindowState[7].Name = m_aPropLocked;
@@ -1799,7 +1808,7 @@ void LayoutManager::implts_setElementData( UIElement& rElement, const Reference<
{
Reference< css::awt::XDockableWindow > xDockWindow( pIter->m_xUIElement->getRealInterface(), UNO_QUERY );
Reference< css::awt::XWindow > xWindow( xDockWindow, UNO_QUERY );
- if ( xDockWindow.is() && xWindow.is() && xDockWindow->isFloating() )
+ if ( xDockWindow.is() && xDockWindow->isFloating() )
{
vos::OGuard aGuard( Application::GetSolarMutex() );
Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
@@ -1864,7 +1873,8 @@ void LayoutManager::implts_findNextDockingPos( DockingArea DockingArea, const ::
implts_getDockingAreaElementInfos( DockingArea, aRowColumnsWindowData );
sal_Int32 nPixelPos( 0 );
- for ( sal_Int32 i = 0; i < sal_Int32( aRowColumnsWindowData.size()); i++ )
+ const sal_uInt32 nCount = aRowColumnsWindowData.size();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
SingleRowColumnWindowData& rRowColumnWindowData = aRowColumnsWindowData[i];
@@ -1877,7 +1887,8 @@ void LayoutManager::implts_findNextDockingPos( DockingArea DockingArea, const ::
{
// Check current row where we can find the needed space
sal_Int32 nCurrPos( 0 );
- for ( sal_Int32 j = 0; j < sal_Int32( rRowColumnWindowData.aRowColumnWindowSizes.size()); j++ )
+ const sal_uInt32 nWindowSizesCount = rRowColumnWindowData.aRowColumnWindowSizes.size();
+ for ( sal_uInt32 j = 0; j < nWindowSizesCount; j++ )
{
css::awt::Rectangle rRect = rRowColumnWindowData.aRowColumnWindowSizes[j];
sal_Int32& rSpace = rRowColumnWindowData.aRowColumnSpace[j];
@@ -1999,7 +2010,8 @@ void LayoutManager::implts_sortUIElements()
UIElementVector::iterator pIter;
for ( pIter = m_aUIElements.begin(); pIter != m_aUIElements.end(); pIter++ )
{
- if ( pIter->m_bUserActive )
+ // why check, just set it to false
+ //if ( pIter->m_bUserActive )
pIter->m_bUserActive = sal_False;
}
@@ -2021,24 +2033,22 @@ void LayoutManager::implts_getDockingAreaElementInfos( DockingArea eDockingArea,
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
ReadGuard aReadLock( m_aLock );
+ aWindowVector.reserve(m_aUIElements.size());
xDockAreaWindow = m_xDockAreaWindows[eDockingArea];
UIElementVector::iterator pIter;
for ( pIter = m_aUIElements.begin(); pIter != m_aUIElements.end(); pIter++ )
{
- if ( pIter->m_aDockedData.m_nDockedArea == eDockingArea )
+ if ( pIter->m_aDockedData.m_nDockedArea == eDockingArea && pIter->m_bVisible && !pIter->m_bFloating )
{
Reference< XUIElement > xUIElement( pIter->m_xUIElement );
if ( xUIElement.is() )
{
Reference< css::awt::XWindow > xWindow( xUIElement->getRealInterface(), UNO_QUERY );
- if ( xWindow.is() )
+ Reference< css::awt::XDockableWindow > xDockWindow( xWindow, UNO_QUERY );
+ if ( xDockWindow.is() )
{
- Reference< css::awt::XDockableWindow > xDockWindow( xWindow, UNO_QUERY );
- if ( xDockWindow.is() && pIter->m_bVisible && !pIter->m_bFloating )
- {
- // docked windows
- aWindowVector.push_back( *pIter );
- }
+ // docked windows
+ aWindowVector.push_back( *pIter );
}
}
}
@@ -2068,29 +2078,15 @@ void LayoutManager::implts_getDockingAreaElementInfos( DockingArea eDockingArea,
else
nLastRowColPixelPos = aDockAreaRect.Width;
- for ( j = 0; j < sal_Int32( aWindowVector.size()); j++ )
+ const sal_uInt32 nCount = aWindowVector.size();
+ for ( j = 0; j < sal_Int32( nCount); j++ )
{
const UIElement& rElement = aWindowVector[j];
Reference< css::awt::XWindow > xWindow;
Reference< XUIElement > xUIElement( rElement.m_xUIElement );
css::awt::Rectangle aPosSize;
- if ( xUIElement.is() )
- {
- vos::OGuard aGuard( Application::GetSolarMutex() );
- xWindow = Reference< css::awt::XWindow >( xUIElement->getRealInterface(), UNO_QUERY );
- aPosSize = xWindow->getPosSize();
-
- Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
- if ( pWindow->GetType() == WINDOW_TOOLBOX )
- {
- ::Size aSize = ((ToolBox*)pWindow)->CalcWindowSizePixel( 1 );
- aPosSize.Width = aSize.Width();
- aPosSize.Height = aSize.Height();
- }
- }
- else
+ if ( !lcl_checkUIElement(xUIElement,aPosSize,xWindow) )
continue;
-
if (( eDockingArea == DockingArea_DOCKINGAREA_TOP ) ||
( eDockingArea == DockingArea_DOCKINGAREA_BOTTOM ))
{
@@ -2225,7 +2221,8 @@ void LayoutManager::implts_getDockingAreaElementInfoOnSingleRowCol( DockingArea
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
ReadGuard aReadLock( m_aLock );
UIElementVector::iterator pIter;
- for ( pIter = m_aUIElements.begin(); pIter != m_aUIElements.end(); pIter++ )
+ UIElementVector::iterator pEnd = m_aUIElements.end();
+ for ( pIter = m_aUIElements.begin(); pIter != pEnd; pIter++ )
{
if ( pIter->m_aDockedData.m_nDockedArea == eDockingArea )
{
@@ -2268,33 +2265,21 @@ void LayoutManager::implts_getDockingAreaElementInfoOnSingleRowCol( DockingArea
sal_Int32 j;
sal_Int32 nLastPos( 0 );
- for ( j = 0; j < sal_Int32( aWindowVector.size()); j++ )
+ const sal_uInt32 nCount = aWindowVector.size();
+ for ( j = 0; j < sal_Int32( nCount); j++ )
{
const UIElement& rElement = aWindowVector[j];
Reference< css::awt::XWindow > xWindow;
Reference< XUIElement > xUIElement( rElement.m_xUIElement );
css::awt::Rectangle aPosSize;
- if ( xUIElement.is() )
- {
- vos::OGuard aGuard( Application::GetSolarMutex() );
- xWindow = Reference< css::awt::XWindow >( xUIElement->getRealInterface(), UNO_QUERY );
- aPosSize = xWindow->getPosSize();
-
- Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
- if ( pWindow->GetType() == WINDOW_TOOLBOX )
- {
- ::Size aSize = ((ToolBox*)pWindow)->CalcWindowSizePixel( 1 );
- aPosSize.Width = aSize.Width();
- aPosSize.Height = aSize.Height();
- }
- }
- else
+ if ( !lcl_checkUIElement(xUIElement,aPosSize,xWindow) )
continue;
+ sal_Int32 nSpace;
if (( eDockingArea == DockingArea_DOCKINGAREA_TOP ) ||
( eDockingArea == DockingArea_DOCKINGAREA_BOTTOM ))
{
- sal_Int32 nSpace( rElement.m_aDockedData.m_aPos.X() - nLastPos );
+ nSpace = ( rElement.m_aDockedData.m_aPos.X() - nLastPos );
// Calc space before an element and store it
if ( rElement.m_aDockedData.m_aPos.X() > nLastPos )
@@ -2302,11 +2287,9 @@ void LayoutManager::implts_getDockingAreaElementInfoOnSingleRowCol( DockingArea
else
nSpace = 0;
- rRowColumnWindowData.aRowColumnSpace.push_back( nSpace );
nLastPos = rElement.m_aDockedData.m_aPos.X() + aPosSize.Width;
- rRowColumnWindowData.aRowColumnWindows.push_back( xWindow );
- rRowColumnWindowData.aUIElementNames.push_back( rElement.m_aName );
+
rRowColumnWindowData.aRowColumnWindowSizes.push_back(
css::awt::Rectangle( rElement.m_aDockedData.m_aPos.X(),
rElement.m_aDockedData.m_aPos.Y(),
@@ -2314,21 +2297,19 @@ void LayoutManager::implts_getDockingAreaElementInfoOnSingleRowCol( DockingArea
aPosSize.Height ));
if ( rRowColumnWindowData.nStaticSize < aPosSize.Height )
rRowColumnWindowData.nStaticSize = aPosSize.Height;
- rRowColumnWindowData.nVarSize += aPosSize.Width + nSpace;
+ rRowColumnWindowData.nVarSize += aPosSize.Width;
}
else
{
// Calc space before an element and store it
- sal_Int32 nSpace( rElement.m_aDockedData.m_aPos.Y() - nLastPos );
+ nSpace = ( rElement.m_aDockedData.m_aPos.Y() - nLastPos );
if ( rElement.m_aDockedData.m_aPos.Y() > nLastPos )
rRowColumnWindowData.nSpace += nSpace;
else
nSpace = 0;
- rRowColumnWindowData.aRowColumnSpace.push_back( nSpace );
+
nLastPos = rElement.m_aDockedData.m_aPos.Y() + aPosSize.Height;
- rRowColumnWindowData.aRowColumnWindows.push_back( xWindow );
- rRowColumnWindowData.aUIElementNames.push_back( rElement.m_aName );
rRowColumnWindowData.aRowColumnWindowSizes.push_back(
css::awt::Rectangle( rElement.m_aDockedData.m_aPos.X(),
rElement.m_aDockedData.m_aPos.Y(),
@@ -2336,8 +2317,13 @@ void LayoutManager::implts_getDockingAreaElementInfoOnSingleRowCol( DockingArea
aPosSize.Height ));
if ( rRowColumnWindowData.nStaticSize < aPosSize.Width )
rRowColumnWindowData.nStaticSize = aPosSize.Width;
- rRowColumnWindowData.nVarSize += aPosSize.Height + nSpace;
+ rRowColumnWindowData.nVarSize += aPosSize.Height;
}
+
+ rRowColumnWindowData.aUIElementNames.push_back( rElement.m_aName );
+ rRowColumnWindowData.aRowColumnWindows.push_back( xWindow );
+ rRowColumnWindowData.aRowColumnSpace.push_back( nSpace );
+ rRowColumnWindowData.nVarSize += nSpace;
}
}
@@ -2354,13 +2340,14 @@ void LayoutManager::implts_getDockingAreaElementInfoOnSingleRowCol( DockingArea
( eDockingArea == DockingArea_DOCKINGAREA_BOTTOM ));
implts_getDockingAreaElementInfoOnSingleRowCol( eDockingArea, nRowCol, aRowColumnWindowData );
- if ( aRowColumnWindowData.aRowColumnWindows.size() == 0 )
+ if ( aRowColumnWindowData.aRowColumnWindows.empty() )
return rMovedElementRect;
else
{
sal_Int32 nSpace( 0 );
::Rectangle aFrontDockingRect( rMovedElementRect );
- for ( sal_uInt32 i = 0; i < aRowColumnWindowData.aRowColumnWindows.size(); i++ )
+ const sal_uInt32 nCount = aRowColumnWindowData.aRowColumnWindows.size();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
if ( bHorzDockArea )
{
@@ -2415,7 +2402,7 @@ void LayoutManager::implts_getDockingAreaElementInfoOnSingleRowCol( DockingArea
( DockingArea > DockingArea_DOCKINGAREA_RIGHT ))
DockingArea = DockingArea_DOCKINGAREA_TOP;
- if ( rRowColumnWindowData.aRowColumnWindows.size() == 0 )
+ if ( rRowColumnWindowData.aRowColumnWindows.empty() )
return aWinRect;
else
{
@@ -2432,7 +2419,8 @@ void LayoutManager::implts_getDockingAreaElementInfoOnSingleRowCol( DockingArea
Window* pDockingAreaWindow( VCLUnoHelper::GetWindow( xDockingAreaWindow ));
if ( pDockingAreaWindow && pContainerWindow )
{
- for ( sal_uInt32 i = 0; i < rRowColumnWindowData.aRowColumnWindows.size(); i++ )
+ const sal_uInt32 nCount = rRowColumnWindowData.aRowColumnWindows.size();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
css::awt::Rectangle aWindowRect = rRowColumnWindowData.aRowColumnWindows[i]->getPosSize();
::Rectangle aRect( aWindowRect.X, aWindowRect.Y, aWindowRect.X+aWindowRect.Width, aWindowRect.Y+aWindowRect.Height );
@@ -2660,7 +2648,8 @@ void LayoutManager::implts_calcDockingPosSize(
// determine current first row/column and last row/column
sal_Int32 nMaxRowCol( -1 );
sal_Int32 nMinRowCol( SAL_MAX_INT32 );
- for ( sal_uInt32 i = 0; i < aRowColumnsWindowData.size(); i++ )
+ const sal_uInt32 nCount = aRowColumnsWindowData.size();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
if ( aRowColumnsWindowData[i].nRowColumn > nMaxRowCol )
nMaxRowCol = aRowColumnsWindowData[i].nRowColumn;
@@ -2676,7 +2665,8 @@ void LayoutManager::implts_calcDockingPosSize(
::Rectangle aWindowRect;
::Rectangle aRowColumnRect;
- for ( sal_uInt32 i = 0; i < aRowColumnsWindowData.size(); i++ )
+ const sal_uInt32 nWindowDataCount = aRowColumnsWindowData.size();
+ for ( sal_uInt32 i = 0; i < nWindowDataCount; i++ )
{
::Rectangle aRect( aRowColumnsWindowData[i].aRowColumnRect.X,
aRowColumnsWindowData[i].aRowColumnRect.Y,
@@ -3078,11 +3068,6 @@ void LayoutManager::implts_renumberRowColumnData(
return aSize;
}
-void LayoutManager::implts_sortActiveElement( const UIElement& )
-{
- implts_sortUIElements();
-}
-
Reference< XUIElement > LayoutManager::implts_createElement( const rtl::OUString& aName )
{
Reference< ::com::sun::star::ui::XUIElement > xUIElement;
@@ -3163,6 +3148,7 @@ void LayoutManager::implts_updateUIElementsVisibleState( sal_Bool bSetVisible )
}
ReadGuard aReadLock( m_aLock );
+ aWinVector.reserve(m_aUIElements.size());
UIElementVector::iterator pIter;
for ( pIter = m_aUIElements.begin(); pIter != m_aUIElements.end(); pIter++ )
{
@@ -3187,7 +3173,8 @@ void LayoutManager::implts_updateUIElementsVisibleState( sal_Bool bSetVisible )
try
{
vos::OGuard aGuard( Application::GetSolarMutex() );
- for ( sal_uInt32 i = 0; i < aWinVector.size(); i++ )
+ const sal_uInt32 nCount = aWinVector.size();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
Reference< css::awt::XWindow > xWindow( aWinVector[i] );
if ( xWindow.is() )
@@ -3653,7 +3640,7 @@ throw (::com::sun::star::uno::RuntimeException)
Reference< XDispatchProvider > xDispatchProvider;
MenuBar* pMenuBar = new MenuBar;
- m_pInplaceMenuBar = new MenuBarManager( m_xSMGR, m_xFrame, xDispatchProvider, aModuleIdentifier, pMenuBar, sal_True, sal_True );
+ m_pInplaceMenuBar = new MenuBarManager( m_xSMGR, m_xFrame, m_xURLTransformer,xDispatchProvider, aModuleIdentifier, pMenuBar, sal_True, sal_True );
m_pInplaceMenuBar->SetItemContainer( xMergedMenuBar );
Window* pWindow = VCLUnoHelper::GetWindow( m_xContainerWindow );
@@ -3895,9 +3882,10 @@ throw ( RuntimeException )
else
implts_destroyElements(); // remove all elements
- if ( oldDockingAreaWindows.size() > 0 )
+ if ( !oldDockingAreaWindows.empty() )
{
- for ( sal_Int32 i=0; i < (sal_Int32)oldDockingAreaWindows.size(); i++ )
+ const sal_uInt32 nCount = oldDockingAreaWindows.size();
+ for ( sal_uInt32 i = 0; i < nCount; ++i )
{
if ( oldDockingAreaWindows[i].is() )
{
@@ -4079,7 +4067,8 @@ IMPL_LINK( LayoutManager, WindowEventListener, VclSimpleEvent*, pEvent )
aReadLock.unlock();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
- for ( sal_uInt32 i = 0; i < aListenerArray.size(); i++ )
+ const sal_uInt32 nCount = aListenerArray.size();
+ for ( sal_uInt32 i = 0; i < nCount; ++i )
{
try
{
@@ -4125,7 +4114,6 @@ throw (RuntimeException)
ReadGuard aReadLock( m_aLock );
Reference< XFrame > xFrame = m_xFrame;
Reference< XURLTransformer > xURLTransformer = m_xURLTransformer;
- Reference< XModel > xModel;
sal_Bool bInPlaceMenu = m_bInplaceMenuSet;
aReadLock.unlock();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
@@ -4133,7 +4121,7 @@ throw (RuntimeException)
if ( !xFrame.is() )
return;
- xModel = impl_getModelFromFrame( xFrame );
+ Reference< XModel > xModel( impl_getModelFromFrame( xFrame ) );
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
WriteGuard aWriteLock( m_aLock );
@@ -4147,7 +4135,7 @@ throw (RuntimeException)
implts_findElement( aName, aElementType, aElementName, xUIElement );
bFound = xUIElement.is();
- if ( xFrame.is() && m_xContainerWindow.is() && !implts_isPreviewModel( xModel ) ) // no bars on preview mode
+ if ( /*xFrame.is() && */m_xContainerWindow.is() && !implts_isPreviewModel( xModel ) ) // no bars on preview mode
{
if ( aElementType.equalsIgnoreAsciiCaseAscii( "toolbar" ))
{
@@ -4243,8 +4231,7 @@ throw (RuntimeException)
{
try
{
- Any a = xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XMenuBar" )));
- a >>= xMenuBar;
+ xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XMenuBar" ))) >>= xMenuBar;
}
catch ( com::sun::star::beans::UnknownPropertyException )
{
@@ -4263,13 +4250,11 @@ throw (RuntimeException)
if ( pMenuBar )
{
pSysWindow->SetMenuBar( pMenuBar );
+ pMenuBar->SetDisplayable( m_bMenuVisible );
if ( m_bMenuVisible )
{
- pMenuBar->SetDisplayable( sal_True );
bNotify = sal_True;
}
- else
- pMenuBar->SetDisplayable( sal_False );
implts_updateMenuBarClose();
}
}
@@ -4304,8 +4289,7 @@ throw (RuntimeException)
if ( bNotify )
{
// UI element is invisible - provide information to listeners
- uno::Any a = uno::makeAny( aName );
- implts_notifyListeners( css::frame::LayoutManagerEvents::UIELEMENT_VISIBLE, a );
+ implts_notifyListeners( css::frame::LayoutManagerEvents::UIELEMENT_VISIBLE, uno::makeAny( aName ) );
}
}
@@ -4362,7 +4346,7 @@ throw (RuntimeException)
{
if ( pIter->m_aName == aName )
{
- xComponent = Reference< XComponent >( pIter->m_xUIElement, UNO_QUERY );
+ xComponent.set( pIter->m_xUIElement, UNO_QUERY );
Reference< XUIElement > xUIElement( pIter->m_xUIElement );
if ( xUIElement.is() )
{
@@ -4444,8 +4428,7 @@ throw (RuntimeException)
if ( bNotify )
{
// UI element is invisible - provide information to listeners
- uno::Any a = uno::makeAny( aName );
- implts_notifyListeners( css::frame::LayoutManagerEvents::UIELEMENT_INVISIBLE, a );
+ implts_notifyListeners( css::frame::LayoutManagerEvents::UIELEMENT_INVISIBLE, uno::makeAny( aName ) );
}
}
@@ -4530,7 +4513,7 @@ throw (::com::sun::star::uno::RuntimeException)
if ( xDockWindow.is() && xDockWindow->isFloating() )
bShowElement = ( bShowElement && xContainerWindow->isActive() );
- if ( xWindow.is() && xDockWindow.is() && bShowElement )
+ if ( xDockWindow.is() && bShowElement )
{
pIter->m_bVisible = sal_True;
aWriteLock.unlock();
@@ -4550,9 +4533,9 @@ throw (::com::sun::star::uno::RuntimeException)
}
bResult = sal_False;
- break;
}
- }
+ } // if ( pIter->m_xUIElement.is() )
+ break;
}
}
@@ -4597,8 +4580,7 @@ throw (::com::sun::star::uno::RuntimeException)
if ( bNotify )
{
// UI element is visible - provide information to listeners
- uno::Any a = uno::makeAny( ResourceURL );
- implts_notifyListeners( css::frame::LayoutManagerEvents::UIELEMENT_VISIBLE, a );
+ implts_notifyListeners( css::frame::LayoutManagerEvents::UIELEMENT_VISIBLE, uno::makeAny( ResourceURL ) );
}
return bResult;
@@ -4723,7 +4705,7 @@ throw (RuntimeException)
implts_writeWindowStateData( aUIElement.m_aName, aUIElement );
implts_sortUIElements();
- if ( xWindow.is() && xDockWindow.is() && bShowElement )
+ if ( xDockWindow.is() && bShowElement )
{
// we need VCL here to pass special flags to Show()
vos::OGuard aGuard( Application::GetSolarMutex() );
@@ -4739,7 +4721,8 @@ throw (RuntimeException)
doLayout();
bResult = sal_True;
- }
+ } // if ( xDockWindow.is() && bShowElement )
+ break;
}
}
}
@@ -4757,8 +4740,7 @@ throw (RuntimeException)
if ( bNotify )
{
// UI element is visible - provide information to listeners
- uno::Any a = uno::makeAny( aName );
- implts_notifyListeners( css::frame::LayoutManagerEvents::UIELEMENT_VISIBLE, a );
+ implts_notifyListeners( css::frame::LayoutManagerEvents::UIELEMENT_VISIBLE, uno::makeAny( aName ) );
}
return bResult;
@@ -4839,7 +4821,7 @@ throw (RuntimeException)
Reference< css::awt::XWindow > xWindow( pIter->m_xUIElement->getRealInterface(), UNO_QUERY );
Reference< css::awt::XDockableWindow > xDockWindow( xWindow, UNO_QUERY );
- if ( xWindow.is() && xDockWindow.is() )
+ if ( xDockWindow.is() )
{
pIter->m_bVisible = sal_False;
aWriteLock.unlock();
@@ -4852,7 +4834,8 @@ throw (RuntimeException)
bResult = sal_True;
bNotify = sal_True;
- }
+ } // if ( xDockWindow.is() )
+ break;
}
}
}
@@ -4870,8 +4853,7 @@ throw (RuntimeException)
if ( bNotify )
{
// UI element is visible - provide information to listeners
- uno::Any a = uno::makeAny( aName );
- implts_notifyListeners( css::frame::LayoutManagerEvents::UIELEMENT_INVISIBLE, a );
+ implts_notifyListeners( css::frame::LayoutManagerEvents::UIELEMENT_INVISIBLE, uno::makeAny( aName ) );
}
return sal_False;
@@ -4882,96 +4864,93 @@ throw (RuntimeException)
{
UIElement aUIElement;
- if ( implts_findElement( aName, aUIElement ))
+ if ( implts_findElement( aName, aUIElement ) && aUIElement.m_xUIElement.is() )
{
- if ( aUIElement.m_xUIElement.is() )
+ try
{
- try
+ Reference< css::awt::XWindow > xWindow( aUIElement.m_xUIElement->getRealInterface(), UNO_QUERY );
+ Reference< css::awt::XDockableWindow > xDockWindow( xWindow, UNO_QUERY );
+ if ( xDockWindow.is() )
{
- Reference< css::awt::XWindow > xWindow( aUIElement.m_xUIElement->getRealInterface(), UNO_QUERY );
- Reference< css::awt::XDockableWindow > xDockWindow( xWindow, UNO_QUERY );
- if ( xWindow.is() && xDockWindow.is() )
- {
- if ( DockingArea != DockingArea_DOCKINGAREA_DEFAULT )
- aUIElement.m_aDockedData.m_nDockedArea = sal_Int16( DockingArea );
+ if ( DockingArea != DockingArea_DOCKINGAREA_DEFAULT )
+ aUIElement.m_aDockedData.m_nDockedArea = sal_Int16( DockingArea );
- if (( Pos.X != SAL_MAX_INT32 ) && ( Pos.Y != SAL_MAX_INT32 ))
- aUIElement.m_aDockedData.m_aPos = ::Point( Pos.X, Pos.Y );
+ if (( Pos.X != SAL_MAX_INT32 ) && ( Pos.Y != SAL_MAX_INT32 ))
+ aUIElement.m_aDockedData.m_aPos = ::Point( Pos.X, Pos.Y );
- if ( !xDockWindow->isFloating() )
- {
- Window* pWindow( 0 );
- ToolBox* pToolBox( 0 );
+ if ( !xDockWindow->isFloating() )
+ {
+ Window* pWindow( 0 );
+ ToolBox* pToolBox( 0 );
+ {
+ vos::OGuard aGuard( Application::GetSolarMutex() );
+ pWindow = VCLUnoHelper::GetWindow( xWindow );
+ if ( pWindow && pWindow->GetType() == WINDOW_TOOLBOX )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
- pWindow = VCLUnoHelper::GetWindow( xWindow );
- if ( pWindow && pWindow->GetType() == WINDOW_TOOLBOX )
- {
- pToolBox = (ToolBox *)pWindow;
+ pToolBox = (ToolBox *)pWindow;
- // We have to set the alignment of the toolbox. It's possible that the toolbox is moved from a
- // horizontal to a vertical docking area!
- pToolBox->SetAlign( ImplConvertAlignment( aUIElement.m_aDockedData.m_nDockedArea ));
- }
+ // We have to set the alignment of the toolbox. It's possible that the toolbox is moved from a
+ // horizontal to a vertical docking area!
+ pToolBox->SetAlign( ImplConvertAlignment( aUIElement.m_aDockedData.m_nDockedArea ));
}
+ }
- if (( aUIElement.m_aDockedData.m_aPos.X() == SAL_MAX_INT32 ) ||
- ( aUIElement.m_aDockedData.m_aPos.Y() == SAL_MAX_INT32 ))
- {
- // Docking on its default position without a preset position -
- // we have to find a good place for it.
- ::Size aSize;
-
- vos::OGuard aGuard( Application::GetSolarMutex() );
- {
- if ( pToolBox )
- aSize = pToolBox->CalcWindowSizePixel( 1, ImplConvertAlignment( aUIElement.m_aDockedData.m_nDockedArea ) );
- else
- aSize = pWindow->GetSizePixel();
- }
+ if (( aUIElement.m_aDockedData.m_aPos.X() == SAL_MAX_INT32 ) ||
+ ( aUIElement.m_aDockedData.m_aPos.Y() == SAL_MAX_INT32 ))
+ {
+ // Docking on its default position without a preset position -
+ // we have to find a good place for it.
+ ::Size aSize;
- ::Point aPixelPos;
- ::Point aDockPos;
- implts_findNextDockingPos( (::com::sun::star::ui::DockingArea)aUIElement.m_aDockedData.m_nDockedArea,
- aSize,
- aDockPos,
- aPixelPos );
- aUIElement.m_aDockedData.m_aPos = aDockPos;
+ vos::OGuard aGuard( Application::GetSolarMutex() );
+ {
+ if ( pToolBox )
+ aSize = pToolBox->CalcWindowSizePixel( 1, ImplConvertAlignment( aUIElement.m_aDockedData.m_nDockedArea ) );
+ else
+ aSize = pWindow->GetSizePixel();
}
- }
- WriteGuard aWriteLock( m_aLock );
- UIElement& rUIElement = LayoutManager::impl_findElement( aUIElement.m_aName );
- if ( rUIElement.m_aName == aName )
- {
- rUIElement.m_aDockedData.m_nDockedArea = aUIElement.m_aDockedData.m_nDockedArea;
- rUIElement.m_aDockedData.m_aPos = aUIElement.m_aDockedData.m_aPos;
+ ::Point aPixelPos;
+ ::Point aDockPos;
+ implts_findNextDockingPos( (::com::sun::star::ui::DockingArea)aUIElement.m_aDockedData.m_nDockedArea,
+ aSize,
+ aDockPos,
+ aPixelPos );
+ aUIElement.m_aDockedData.m_aPos = aDockPos;
}
- aWriteLock.unlock();
+ }
- if ( xDockWindow->isFloating() )
- {
- // Will call toggle floating mode which will do the rest!
- xWindow->setVisible( sal_False );
- xDockWindow->setFloatingMode( sal_False );
- xWindow->setVisible( sal_True );
- }
- else
- {
- implts_writeWindowStateData( aName, aUIElement );
- implts_sortUIElements();
+ WriteGuard aWriteLock( m_aLock );
+ UIElement& rUIElement = LayoutManager::impl_findElement( aUIElement.m_aName );
+ if ( rUIElement.m_aName == aName )
+ {
+ rUIElement.m_aDockedData.m_nDockedArea = aUIElement.m_aDockedData.m_nDockedArea;
+ rUIElement.m_aDockedData.m_aPos = aUIElement.m_aDockedData.m_aPos;
+ }
+ aWriteLock.unlock();
- if ( aUIElement.m_bVisible )
- doLayout();
- }
+ if ( xDockWindow->isFloating() )
+ {
+ // Will call toggle floating mode which will do the rest!
+ xWindow->setVisible( sal_False );
+ xDockWindow->setFloatingMode( sal_False );
+ xWindow->setVisible( sal_True );
+ }
+ else
+ {
+ implts_writeWindowStateData( aName, aUIElement );
+ implts_sortUIElements();
- return sal_True;
+ if ( aUIElement.m_bVisible )
+ doLayout();
}
+
+ return sal_True;
}
- catch ( DisposedException& )
- {
- }
+ }
+ catch ( DisposedException& )
+ {
}
}
@@ -5000,7 +4979,8 @@ throw (RuntimeException)
}
}
- for ( sal_uInt32 i = 0; i < aToolBarNameVector.size(); i++ )
+ const sal_uInt32 nCount = aToolBarNameVector.size();
+ for ( sal_uInt32 i = 0; i < nCount; ++i )
{
::com::sun::star::awt::Point aPoint;
aPoint.X = aPoint.Y = SAL_MAX_INT32;
@@ -5164,42 +5144,39 @@ throw (RuntimeException)
{
UIElement aUIElement;
- if ( implts_findElement( aName, aUIElement ))
+ if ( implts_findElement( aName, aUIElement ) && aUIElement.m_xUIElement.is() )
{
- if ( aUIElement.m_xUIElement.is() )
+ try
{
- try
- {
- Reference< css::awt::XWindow > xWindow( aUIElement.m_xUIElement->getRealInterface(), UNO_QUERY );
- Reference< css::awt::XDockableWindow > xDockWindow( xWindow, UNO_QUERY );
+ Reference< css::awt::XWindow > xWindow( aUIElement.m_xUIElement->getRealInterface(), UNO_QUERY );
+ Reference< css::awt::XDockableWindow > xDockWindow( xWindow, UNO_QUERY );
- if ( xWindow.is() && xDockWindow.is() )
+ if ( xWindow.is() && xDockWindow.is() )
+ {
+ if ( aUIElement.m_bFloating )
{
- if ( aUIElement.m_bFloating )
- {
- xWindow->setPosSize( aPos.X, aPos.Y, 0, 0, css::awt::PosSize::POS );
- implts_writeNewStateData( aName, xWindow );
- }
- else
- {
- WriteGuard aWriteLock( m_aLock );
- UIElement& rUIElement = LayoutManager::impl_findElement( aUIElement.m_aName );
- if ( rUIElement.m_aName == aName )
- rUIElement.m_aDockedData.m_aPos = ::Point( aPos.X, aPos.Y );
- aWriteLock.unlock();
+ xWindow->setPosSize( aPos.X, aPos.Y, 0, 0, css::awt::PosSize::POS );
+ implts_writeNewStateData( aName, xWindow );
+ }
+ else
+ {
+ WriteGuard aWriteLock( m_aLock );
+ UIElement& rUIElement = LayoutManager::impl_findElement( aUIElement.m_aName );
+ if ( rUIElement.m_aName == aName )
+ rUIElement.m_aDockedData.m_aPos = ::Point( aPos.X, aPos.Y );
+ aWriteLock.unlock();
- aUIElement.m_aDockedData.m_aPos = ::Point( aPos.X, aPos.Y );
- implts_writeWindowStateData( aName, aUIElement );
- implts_sortUIElements();
+ aUIElement.m_aDockedData.m_aPos = ::Point( aPos.X, aPos.Y );
+ implts_writeWindowStateData( aName, aUIElement );
+ implts_sortUIElements();
- if ( aUIElement.m_bVisible )
- doLayout();
- }
+ if ( aUIElement.m_bVisible )
+ doLayout();
}
}
- catch ( DisposedException& )
- {
- }
+ }
+ catch ( DisposedException& )
+ {
}
}
}
@@ -5322,10 +5299,7 @@ throw (RuntimeException)
if ( xWindow.is() )
{
Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
- if ( pWindow && pWindow->IsVisible() )
- return sal_True;
- else
- return sal_False;
+ return pWindow && pWindow->IsVisible();
}
}
}
@@ -5353,13 +5327,8 @@ throw (RuntimeException)
{
if ( pIter->m_aName == aName && pIter->m_xUIElement.is() )
{
- Reference< css::awt::XWindow > xWindow( pIter->m_xUIElement->getRealInterface(), UNO_QUERY );
- if ( xWindow.is() )
- {
- Reference< css::awt::XDockableWindow > xDockWindow( xWindow, UNO_QUERY );
- if ( xDockWindow.is() )
- return xDockWindow->isFloating();
- }
+ Reference< css::awt::XDockableWindow > xDockWindow( pIter->m_xUIElement->getRealInterface(), UNO_QUERY );
+ return xDockWindow.is() && xDockWindow->isFloating();
}
}
@@ -5376,13 +5345,8 @@ throw (RuntimeException)
{
if ( pIter->m_aName == aName && pIter->m_xUIElement.is() )
{
- Reference< css::awt::XWindow > xWindow( pIter->m_xUIElement->getRealInterface(), UNO_QUERY );
- if ( xWindow.is() )
- {
- Reference< css::awt::XDockableWindow > xDockWindow( xWindow, UNO_QUERY );
- if ( xDockWindow.is() )
- return !xDockWindow->isFloating();
- }
+ Reference< css::awt::XDockableWindow > xDockWindow( pIter->m_xUIElement->getRealInterface(), UNO_QUERY );
+ return xDockWindow.is() && !xDockWindow->isFloating();
}
}
@@ -5397,16 +5361,10 @@ throw (::com::sun::star::uno::RuntimeException)
ReadGuard aReadLock( m_aLock );
for ( pIter = m_aUIElements.begin(); pIter != m_aUIElements.end(); pIter++ )
{
- if (( pIter->m_aName == ResourceURL ) &&
- ( pIter->m_xUIElement.is() ))
+ if (( pIter->m_aName == ResourceURL ) && ( pIter->m_xUIElement.is() ))
{
- Reference< css::awt::XWindow > xWindow( pIter->m_xUIElement->getRealInterface(), UNO_QUERY );
- if ( xWindow.is() )
- {
- Reference< css::awt::XDockableWindow > xDockWindow( xWindow, UNO_QUERY );
- if ( xDockWindow.is() )
- return xDockWindow->isLocked();
- }
+ Reference< css::awt::XDockableWindow > xDockWindow( pIter->m_xUIElement->getRealInterface(), UNO_QUERY );
+ return xDockWindow.is() && !xDockWindow->isLocked();
}
}
@@ -5416,64 +5374,53 @@ throw (::com::sun::star::uno::RuntimeException)
css::awt::Size SAL_CALL LayoutManager::getElementSize( const ::rtl::OUString& aName )
throw (RuntimeException)
{
- UIElementVector::const_iterator pIter;
-
ReadGuard aReadLock( m_aLock );
- for ( pIter = m_aUIElements.begin(); pIter != m_aUIElements.end(); pIter++ )
+ UIElement aElementData;
+ if ( implts_findElement( aName,aElementData ) && aElementData.m_xUIElement.is() )
{
- if ( pIter->m_aName == aName && pIter->m_xUIElement.is() )
+ Reference< css::awt::XWindow > xWindow( aElementData.m_xUIElement->getRealInterface(), UNO_QUERY );
+ if ( xWindow.is() )
{
- Reference< css::awt::XWindow > xWindow( pIter->m_xUIElement->getRealInterface(), UNO_QUERY );
- if ( xWindow.is() )
+ Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
+ if ( pWindow )
{
- Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
- if ( pWindow )
- {
- ::Size aSize = pWindow->GetSizePixel();
- css::awt::Size aElementSize;
- aElementSize.Width = aSize.Width();
- aElementSize.Height = aSize.Height();
- return aElementSize;
- }
- else
- break;
- }
+ ::Size aSize = pWindow->GetSizePixel();
+ css::awt::Size aElementSize;
+ aElementSize.Width = aSize.Width();
+ aElementSize.Height = aSize.Height();
+ return aElementSize;
+ } // if ( pWindow )
}
}
-
return css::awt::Size();
}
css::awt::Point SAL_CALL LayoutManager::getElementPos( const ::rtl::OUString& aName )
throw (RuntimeException)
{
- UIElementVector::const_iterator pIter;
-
ReadGuard aReadLock( m_aLock );
- for ( pIter = m_aUIElements.begin(); pIter != m_aUIElements.end(); pIter++ )
+ UIElement aElementData;
+ if ( implts_findElement( aName,aElementData ) && aElementData.m_xUIElement.is() )
{
- if ( pIter->m_aName == aName && pIter->m_xUIElement.is() )
+ Reference< css::awt::XWindow > xWindow( aElementData.m_xUIElement->getRealInterface(), UNO_QUERY );
+ Reference< css::awt::XDockableWindow > xDockWindow( xWindow, UNO_QUERY );
+ if ( xDockWindow.is() )
{
- Reference< css::awt::XWindow > xWindow( pIter->m_xUIElement->getRealInterface(), UNO_QUERY );
- Reference< css::awt::XDockableWindow > xDockWindow( xWindow, UNO_QUERY );
- if ( xWindow.is() && xDockWindow.is() )
+ css::awt::Point aPos;
+ if ( aElementData.m_bFloating )
{
- css::awt::Point aPos;
- if ( pIter->m_bFloating )
- {
- css::awt::Rectangle aRect = xWindow->getPosSize();
- aPos.X = aRect.X;
- aPos.Y = aRect.Y;
- }
- else
- {
- ::Point aVirtualPos = pIter->m_aDockedData.m_aPos;
- aPos.X = aVirtualPos.X();
- aPos.Y = aVirtualPos.Y();
- }
-
- return aPos;
+ css::awt::Rectangle aRect = xWindow->getPosSize();
+ aPos.X = aRect.X;
+ aPos.Y = aRect.Y;
}
+ else
+ {
+ ::Point aVirtualPos = aElementData.m_aDockedData.m_aPos;
+ aPos.X = aVirtualPos.X();
+ aPos.Y = aVirtualPos.Y();
+ }
+
+ return aPos;
}
}
@@ -5621,7 +5568,8 @@ sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace )
implts_getDockingAreaElementInfos( (DockingArea)i, aRowColumnsWindowData );
sal_Int32 nOffset( 0 );
- for ( sal_Int32 j = 0; j < sal_Int32( aRowColumnsWindowData.size() ); j++ )
+ const sal_uInt32 nCount = aRowColumnsWindowData.size();
+ for ( sal_uInt32 j = 0; j < nCount; ++j )
{
implts_calcWindowPosSizeOnSingleRowColumn( i, nOffset, aRowColumnsWindowData[j], aContainerSize );
nOffset += aRowColumnsWindowData[j].nStaticSize;
@@ -5687,7 +5635,7 @@ void LayoutManager::implts_calcWindowPosSizeOnSingleRowColumn( sal_Int32 nDockin
sal_Int32 nBottomDockingAreaSize;
sal_Int32 nContainerClientSize;
- if ( rRowColumnWindowData.aRowColumnWindows.size() == 0 )
+ if ( rRowColumnWindowData.aRowColumnWindows.empty() )
return;
if (( nDockingArea == DockingArea_DOCKINGAREA_TOP ) ||
@@ -5704,26 +5652,28 @@ void LayoutManager::implts_calcWindowPosSizeOnSingleRowColumn( sal_Int32 nDockin
nDiff = nContainerClientSize - rRowColumnWindowData.nVarSize;
}
+ const sal_uInt32 nCount = rRowColumnWindowData.aRowColumnWindowSizes.size();
if (( nDiff < 0 ) && ( nRCSpace > 0 ))
{
// First we try to reduce the size of blank space before/behind docked windows
- sal_Int32 i = rRowColumnWindowData.aRowColumnWindowSizes.size()-1;
+ sal_Int32 i = nCount - 1;
while ( i >= 0 )
{
sal_Int32 nSpace = rRowColumnWindowData.aRowColumnSpace[i];
if ( nSpace >= -nDiff )
{
+
if (( nDockingArea == DockingArea_DOCKINGAREA_TOP ) ||
( nDockingArea == DockingArea_DOCKINGAREA_BOTTOM ))
{
// Try to move this and all user elements behind with the calculated difference
- for ( sal_Int32 j = i; j < sal_Int32( rRowColumnWindowData.aRowColumnWindowSizes.size() ); j++ )
+ for ( sal_uInt32 j = i; j < nCount ; j++ )
rRowColumnWindowData.aRowColumnWindowSizes[j].X += nDiff;
}
else
{
// Try to move this and all user elements behind with the calculated difference
- for ( sal_Int32 j = i; j < sal_Int32( rRowColumnWindowData.aRowColumnWindowSizes.size() ); j++ )
+ for ( sal_uInt32 j = i; j < nCount ; j++ )
rRowColumnWindowData.aRowColumnWindowSizes[j].Y += nDiff;
}
nDiff = 0;
@@ -5736,13 +5686,13 @@ void LayoutManager::implts_calcWindowPosSizeOnSingleRowColumn( sal_Int32 nDockin
( nDockingArea == DockingArea_DOCKINGAREA_BOTTOM ))
{
// Try to move this and all user elements behind with the calculated difference
- for ( sal_Int32 j = i; j < sal_Int32( rRowColumnWindowData.aRowColumnWindowSizes.size() ); j++ )
+ for ( sal_uInt32 j = i; j < nCount; j++ )
rRowColumnWindowData.aRowColumnWindowSizes[j].X -= nSpace;
}
else
{
// Try to move this and all user elements behind with the calculated difference
- for ( sal_Int32 j = i; j < sal_Int32( rRowColumnWindowData.aRowColumnWindowSizes.size() ); j++ )
+ for ( sal_uInt32 j = i; j < nCount; j++ )
rRowColumnWindowData.aRowColumnWindowSizes[j].Y -= nSpace;
}
nDiff += nSpace;
@@ -5755,7 +5705,7 @@ void LayoutManager::implts_calcWindowPosSizeOnSingleRowColumn( sal_Int32 nDockin
if ( nDiff < 0 )
{
// Now we have to reduce the size of certain docked windows
- sal_Int32 i = sal_Int32( rRowColumnWindowData.aRowColumnWindowSizes.size() - 1 );
+ sal_Int32 i = sal_Int32( nCount - 1 );
while ( i >= 0 )
{
css::awt::Rectangle& rWinRect = rRowColumnWindowData.aRowColumnWindowSizes[i];
@@ -5787,7 +5737,7 @@ void LayoutManager::implts_calcWindowPosSizeOnSingleRowColumn( sal_Int32 nDockin
}
// Try to move this and all user elements behind with the calculated difference
- for ( sal_Int32 j = i; j < sal_Int32( rRowColumnWindowData.aRowColumnWindowSizes.size() ); j++ )
+ for ( sal_uInt32 j = i; j < nCount; j++ )
rRowColumnWindowData.aRowColumnWindowSizes[j].X += nDiff;
}
else
@@ -5805,7 +5755,7 @@ void LayoutManager::implts_calcWindowPosSizeOnSingleRowColumn( sal_Int32 nDockin
}
// Try to move this and all user elements behind with the calculated difference
- for ( sal_Int32 j = i; j < sal_Int32( rRowColumnWindowData.aRowColumnWindowSizes.size() ); j++ )
+ for ( sal_uInt32 j = i; j < nCount; j++ )
rRowColumnWindowData.aRowColumnWindowSizes[j].Y += nDiff;
}
}
@@ -5831,7 +5781,7 @@ void LayoutManager::implts_calcWindowPosSizeOnSingleRowColumn( sal_Int32 nDockin
nStartOffset = pDockAreaWindow->GetSizePixel().Height() - rRowColumnWindowData.nStaticSize;
vos::OGuard aGuard( Application::GetSolarMutex() );
- for ( sal_Int32 i = 0; i < sal_Int32( rRowColumnWindowData.aRowColumnWindows.size() ); i++ )
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
Reference< css::awt::XWindow > xWindow = rRowColumnWindowData.aRowColumnWindows[i];
Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
@@ -5986,12 +5936,13 @@ css::awt::Rectangle LayoutManager::implts_calcDockingAreaSizes()
}
// Sum up max heights from every row/column
- if ( aWindowVector.size() > 0 )
+ if ( !aWindowVector.empty() )
{
for ( sal_Int32 i = 0; i <= DockingArea_DOCKINGAREA_RIGHT; i++ )
{
sal_Int32 nSize( 0 );
- for ( sal_Int32 j = 0; j < sal_Int32( aRowColumnSizes[i].size() ); j++ )
+ const sal_uInt32 nCount = aRowColumnSizes[i].size();
+ for ( sal_uInt32 j = 0; j < nCount; j++ )
nSize += aRowColumnSizes[i][j];
if ( i == DockingArea_DOCKINGAREA_TOP )
@@ -7082,8 +7033,10 @@ IMPL_LINK( LayoutManager, AsyncLayoutHdl, Timer *, EMPTYARG )
return 0;
}
+#ifdef DBG_UTIL
void LayoutManager::implts_checkElementContainer()
{
+#ifdef DBG_UTIL
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
ReadGuard aReadLock( m_aLock );
@@ -7102,8 +7055,10 @@ void LayoutManager::implts_checkElementContainer()
::rtl::OString aName = ::rtl::OUStringToOString( pCheckIter->first, RTL_TEXTENCODING_ASCII_US );
DBG_ASSERT( "More than one element (%s) with the same name found!", aName.getStr() );
}
- }
+ } // for ( ; pCheckIter != aUIElementHash.end(); pCheckIter++ )
+#endif
}
+#endif
//---------------------------------------------------------------------------------------------------------
// XFrameActionListener
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 309b65007edb..0af8ea0e6587 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -55,7 +55,7 @@
#ifndef __FRAMEWORK_CONSTANT_CONTAINERQUERY_HXX_
#include <constant/containerquery.hxx>
#endif
-#include <interaction/stillinteraction.hxx>
+#include <interaction/quietinteraction.hxx>
#include <threadhelp/writeguard.hxx>
#include <threadhelp/readguard.hxx>
#include <threadhelp/resetableguard.hxx>
@@ -75,6 +75,7 @@
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/awt/XWindow2.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
@@ -171,6 +172,7 @@ LoadEnv::LoadEnv(const css::uno::Reference< css::lang::XMultiServiceFactory >& x
: ThreadHelpBase( )
, m_xSMGR (xSMGR)
, m_pCheck (this )
+ , m_pQuietInteraction( 0 )
{
}
@@ -347,8 +349,9 @@ void LoadEnv::initializeLoading(const ::rtl::OUString&
{
nMacroMode = css::document::MacroExecMode::NEVER_EXECUTE;
nUpdateMode = css::document::UpdateDocMode::NO_UPDATE;
- StillInteraction* pInteraction = new StillInteraction();
- xInteractionHandler = css::uno::Reference< css::task::XInteractionHandler >(static_cast< css::task::XInteractionHandler* >(pInteraction), css::uno::UNO_QUERY);
+ m_pQuietInteraction = new QuietInteraction();
+ m_pQuietInteraction->acquire();
+ xInteractionHandler = css::uno::Reference< css::task::XInteractionHandler >(static_cast< css::task::XInteractionHandler* >(m_pQuietInteraction), css::uno::UNO_QUERY);
}
if (
@@ -1659,8 +1662,7 @@ void LoadEnv::impl_reactForLoadingState()
m_xTargetFrame->setName(sFrameName);
}
}
- else
- if (m_bReactivateControllerOnError)
+ else if (m_bReactivateControllerOnError)
{
// Try to reactivate the old document (if any exists!)
css::uno::Reference< css::frame::XController > xOldDoc = m_xTargetFrame->getController();
@@ -1676,8 +1678,7 @@ void LoadEnv::impl_reactForLoadingState()
m_bReactivateControllerOnError = sal_False;
}
}
- else
- if (m_bCloseFrameOnError)
+ else if (m_bCloseFrameOnError)
{
// close empty frames
css::uno::Reference< css::util::XCloseable > xCloseable (m_xTargetFrame, css::uno::UNO_QUERY);
@@ -1711,7 +1712,25 @@ void LoadEnv::impl_reactForLoadingState()
// Otherwhise it hold a might existing stream open!
m_lMediaDescriptor.clear();
+ css::uno::Any aRequest;
+ bool bThrow = false;
+ if ( !m_bLoaded && m_pQuietInteraction && m_pQuietInteraction->wasUsed() )
+ {
+ aRequest = m_pQuietInteraction->getRequest();
+ m_pQuietInteraction->release();
+ m_pQuietInteraction = 0;
+ bThrow = true;
+ }
+
aReadLock.unlock();
+
+ if (bThrow)
+ {
+ css::uno::Exception aEx;
+ if ( aRequest >>= aEx )
+ throw LoadEnvException( LoadEnvException::ID_GENERAL_ERROR, aEx );
+ }
+
// <- SAFE ----------------------------------
}
@@ -1829,9 +1848,8 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw
// read window state from the configuration
// and apply it on the window.
// Do nothing, if no configuration entry exists!
- css::uno::Any aWindowState = ::comphelper::ConfigurationHelper::readRelativeKey(xModuleCfg, sModule, OFFICEFACTORY_PROPNAME_WINDOWATTRIBUTES);
::rtl::OUString sWindowState ;
- aWindowState >>= sWindowState;
+ ::comphelper::ConfigurationHelper::readRelativeKey(xModuleCfg, sModule, OFFICEFACTORY_PROPNAME_WINDOWATTRIBUTES) >>= sWindowState;
if (sWindowState.getLength())
{
// SOLAR SAFE ->
diff --git a/framework/source/recording/dispatchrecorder.cxx b/framework/source/recording/dispatchrecorder.cxx
index df8345d8cd44..39129d20b77f 100644
--- a/framework/source/recording/dispatchrecorder.cxx
+++ b/framework/source/recording/dispatchrecorder.cxx
@@ -187,7 +187,7 @@ void SAL_CALL DispatchRecorder::endRecording() throw( css::uno::RuntimeException
/* SAFE{ */
WriteGuard aWriteLock(m_aLock);
- if ( !m_aStatements.size() )
+ if ( m_aStatements.empty() )
return ::rtl::OUString();
::rtl::OUStringBuffer aScriptBuffer;
diff --git a/framework/source/register/registerservices.cxx b/framework/source/register/registerservices.cxx
index d54b206d393f..c9a8764c7509 100644
--- a/framework/source/register/registerservices.cxx
+++ b/framework/source/register/registerservices.cxx
@@ -61,29 +61,29 @@
=================================================================================================================*/
#include <services/urltransformer.hxx>
#include <services/desktop.hxx>
-#include <services/tabwindowservice.hxx>
+//#include <services/tabwindowservice.hxx>
#include <services/frame.hxx>
#include <services/modulemanager.hxx>
-#include <dispatch/oxt_handler.hxx>
+//#include <dispatch/oxt_handler.hxx>
#include <jobs/jobexecutor.hxx>
-#include <recording/dispatchrecordersupplier.hxx>
-#include <recording/dispatchrecorder.hxx>
-#include <dispatch/mailtodispatcher.hxx>
-#include <dispatch/servicehandler.hxx>
+//#include <recording/dispatchrecordersupplier.hxx>
+//#include <recording/dispatchrecorder.hxx>
+//#include <dispatch/mailtodispatcher.hxx>
+//#include <dispatch/servicehandler.hxx>
#include <jobs/jobdispatch.hxx>
#include <services/backingcomp.hxx>
-#include <services/dispatchhelper.hxx>
+//#include <services/dispatchhelper.hxx>
#include <services/layoutmanager.hxx>
-#include <services/license.hxx>
+//#include <services/license.hxx>
#include <uifactory/uielementfactorymanager.hxx>
#include <uifactory/popupmenucontrollerfactory.hxx>
-#include <uielement/fontmenucontroller.hxx>
-#include <uielement/fontsizemenucontroller.hxx>
+//#include <uielement/fontmenucontroller.hxx>
+//#include <uielement/fontsizemenucontroller.hxx>
#include <uielement/objectmenucontroller.hxx>
-#include <uielement/headermenucontroller.hxx>
-#include <uielement/footermenucontroller.hxx>
+//#include <uielement/headermenucontroller.hxx>
+//#include <uielement/footermenucontroller.hxx>
#include <uielement/controlmenucontroller.hxx>
-#include <uielement/macrosmenucontroller.hxx>
+//#include <uielement/macrosmenucontroller.hxx>
#include <uielement/uicommanddescription.hxx>
#include <uiconfiguration/uiconfigurationmanager.hxx>
#include <uiconfiguration/moduleuicfgsupplier.hxx>
@@ -95,53 +95,54 @@
#include <uifactory/toolboxfactory.hxx>
#include <uifactory/addonstoolboxfactory.hxx>
#include "uiconfiguration/windowstateconfiguration.hxx"
-#include <uielement/toolbarsmenucontroller.hxx>
+//#include <uielement/toolbarsmenucontroller.hxx>
#include "uifactory/toolbarcontrollerfactory.hxx"
#include "uifactory/statusbarcontrollerfactory.hxx"
-#include <uielement/toolbarsmenucontroller.hxx>
#include <services/autorecovery.hxx>
#include <helper/statusindicatorfactory.hxx>
#include <uielement/recentfilesmenucontroller.hxx>
#include <uifactory/statusbarfactory.hxx>
#include <uiconfiguration/uicategorydescription.hxx>
#include <services/sessionlistener.hxx>
-#include <uielement/logoimagestatusbarcontroller.hxx>
-#include <uielement/logotextstatusbarcontroller.hxx>
-#include <uielement/newmenucontroller.hxx>
+//#include <uielement/logoimagestatusbarcontroller.hxx>
+//#include <uielement/logotextstatusbarcontroller.hxx>
+//#include <uielement/newmenucontroller.hxx>
#include <services/taskcreatorsrv.hxx>
-#include <uielement/simpletextstatusbarcontroller.hxx>
-#include <services/uriabbreviation.hxx>
-#include <dispatch/popupmenudispatcher.hxx>
+//#include <uielement/simpletextstatusbarcontroller.hxx>
+//#include <services/uriabbreviation.hxx>
+
#include <uielement/langselectionstatusbarcontroller.hxx>
-#include <uielement/langselectionmenucontroller.hxx>
+//#include <uielement/langselectionmenucontroller.hxx>
#include <uiconfiguration/imagemanager.hxx>
#include <uifactory/windowcontentfactorymanager.hxx>
+#include <services/substitutepathvars.hxx>
+#include <services/pathsettings.hxx>
COMPONENTGETIMPLEMENTATIONENVIRONMENT
COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::URLTransformer )
COMPONENTINFO( ::framework::Desktop )
COMPONENTINFO( ::framework::Frame )
- COMPONENTINFO( ::framework::Oxt_Handler )
+ //COMPONENTINFO( ::framework::Oxt_Handler )
COMPONENTINFO( ::framework::JobExecutor )
- COMPONENTINFO( ::framework::DispatchRecorderSupplier )
- COMPONENTINFO( ::framework::DispatchRecorder )
- COMPONENTINFO( ::framework::MailToDispatcher )
- COMPONENTINFO( ::framework::ServiceHandler )
+ //COMPONENTINFO( ::framework::DispatchRecorderSupplier )
+ //COMPONENTINFO( ::framework::DispatchRecorder )
+ //COMPONENTINFO( ::framework::MailToDispatcher )
+ //COMPONENTINFO( ::framework::ServiceHandler )
COMPONENTINFO( ::framework::JobDispatch )
COMPONENTINFO( ::framework::BackingComp )
- COMPONENTINFO( ::framework::DispatchHelper )
+ //COMPONENTINFO( ::framework::DispatchHelper )
COMPONENTINFO( ::framework::LayoutManager )
- COMPONENTINFO( ::framework::License )
+ //COMPONENTINFO( ::framework::License )
COMPONENTINFO( ::framework::UIElementFactoryManager )
COMPONENTINFO( ::framework::PopupMenuControllerFactory )
- COMPONENTINFO( ::framework::FontMenuController )
- COMPONENTINFO( ::framework::FontSizeMenuController )
+ //COMPONENTINFO( ::framework::FontMenuController )
+ //COMPONENTINFO( ::framework::FontSizeMenuController )
COMPONENTINFO( ::framework::ObjectMenuController )
- COMPONENTINFO( ::framework::HeaderMenuController )
- COMPONENTINFO( ::framework::FooterMenuController )
+ //COMPONENTINFO( ::framework::HeaderMenuController )
+ //COMPONENTINFO( ::framework::FooterMenuController )
COMPONENTINFO( ::framework::ControlMenuController )
- COMPONENTINFO( ::framework::MacrosMenuController )
+ //COMPONENTINFO( ::framework::MacrosMenuController )
COMPONENTINFO( ::framework::UICommandDescription )
COMPONENTINFO( ::framework::ModuleManager )
COMPONENTINFO( ::framework::UIConfigurationManager )
@@ -155,7 +156,7 @@ COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::URLTransformer
COMPONENTINFO( ::framework::AddonsToolBoxFactory )
COMPONENTINFO( ::framework::WindowStateConfiguration )
COMPONENTINFO( ::framework::ToolbarControllerFactory )
- COMPONENTINFO( ::framework::ToolbarsMenuController )
+ //COMPONENTINFO( ::framework::ToolbarsMenuController )
COMPONENTINFO( ::framework::AutoRecovery )
COMPONENTINFO( ::framework::StatusIndicatorFactory )
COMPONENTINFO( ::framework::RecentFilesMenuController )
@@ -163,43 +164,45 @@ COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::URLTransformer
COMPONENTINFO( ::framework::UICategoryDescription )
COMPONENTINFO( ::framework::StatusbarControllerFactory )
COMPONENTINFO( ::framework::SessionListener )
- COMPONENTINFO( ::framework::LogoImageStatusbarController )
- COMPONENTINFO( ::framework::LogoTextStatusbarController )
- COMPONENTINFO( ::framework::NewMenuController )
+ //COMPONENTINFO( ::framework::LogoImageStatusbarController )
+ //COMPONENTINFO( ::framework::LogoTextStatusbarController )
+ //COMPONENTINFO( ::framework::NewMenuController )
COMPONENTINFO( ::framework::TaskCreatorService )
- COMPONENTINFO( ::framework::SimpleTextStatusbarController )
- COMPONENTINFO( ::framework::UriAbbreviation )
- COMPONENTINFO( ::framework::PopupMenuDispatcher )
+ //COMPONENTINFO( ::framework::SimpleTextStatusbarController )
+ //COMPONENTINFO( ::framework::UriAbbreviation )
+ //COMPONENTINFO( ::framework::PopupMenuDispatcher )
COMPONENTINFO( ::framework::ImageManager )
COMPONENTINFO( ::framework::LangSelectionStatusbarController )
- COMPONENTINFO( ::framework::LanguageSelectionMenuController )
- COMPONENTINFO( ::framework::TabWindowService )
+ //COMPONENTINFO( ::framework::LanguageSelectionMenuController )
+ //COMPONENTINFO( ::framework::TabWindowService )
COMPONENTINFO( ::framework::WindowContentFactoryManager )
+ COMPONENTINFO( ::framework::SubstitutePathVariables )
+ COMPONENTINFO( ::framework::PathSettings )
)
COMPONENTGETFACTORY ( IFFACTORY( ::framework::URLTransformer ) else
IFFACTORY( ::framework::Desktop ) else
IFFACTORY( ::framework::Frame ) else
- IFFACTORY( ::framework::Oxt_Handler ) else
+ //IFFACTORY( ::framework::Oxt_Handler ) else
IFFACTORY( ::framework::JobExecutor ) else
- IFFACTORY( ::framework::DispatchRecorderSupplier ) else
- IFFACTORY( ::framework::DispatchRecorder ) else
- IFFACTORY( ::framework::MailToDispatcher ) else
- IFFACTORY( ::framework::ServiceHandler ) else
+ //IFFACTORY( ::framework::DispatchRecorderSupplier ) else
+ //IFFACTORY( ::framework::DispatchRecorder ) else
+ //IFFACTORY( ::framework::MailToDispatcher ) else
+ //IFFACTORY( ::framework::ServiceHandler ) else
IFFACTORY( ::framework::JobDispatch ) else
IFFACTORY( ::framework::BackingComp ) else
- IFFACTORY( ::framework::DispatchHelper ) else
+ //IFFACTORY( ::framework::DispatchHelper ) else
IFFACTORY( ::framework::LayoutManager ) else
- IFFACTORY( ::framework::License ) else
+ //IFFACTORY( ::framework::License ) else
IFFACTORY( ::framework::UIElementFactoryManager ) else
IFFACTORY( ::framework::PopupMenuControllerFactory ) else
- IFFACTORY( ::framework::FontMenuController ) else
- IFFACTORY( ::framework::FontSizeMenuController ) else
+ //IFFACTORY( ::framework::FontMenuController ) else
+ //IFFACTORY( ::framework::FontSizeMenuController ) else
IFFACTORY( ::framework::ObjectMenuController ) else
- IFFACTORY( ::framework::HeaderMenuController ) else
- IFFACTORY( ::framework::FooterMenuController ) else
+ //IFFACTORY( ::framework::HeaderMenuController ) else
+ //IFFACTORY( ::framework::FooterMenuController ) else
IFFACTORY( ::framework::ControlMenuController ) else
- IFFACTORY( ::framework::MacrosMenuController ) else
+ //IFFACTORY( ::framework::MacrosMenuController ) else
IFFACTORY( ::framework::UICommandDescription ) else
IFFACTORY( ::framework::ModuleManager ) else
IFFACTORY( ::framework::UIConfigurationManager ) else
@@ -213,7 +216,7 @@ COMPONENTGETFACTORY ( IFFACTORY( ::framework::URLTransformer
IFFACTORY( ::framework::AddonsToolBoxFactory ) else
IFFACTORY( ::framework::WindowStateConfiguration ) else
IFFACTORY( ::framework::ToolbarControllerFactory ) else
- IFFACTORY( ::framework::ToolbarsMenuController ) else
+ //IFFACTORY( ::framework::ToolbarsMenuController ) else
IFFACTORY( ::framework::AutoRecovery ) else
IFFACTORY( ::framework::StatusIndicatorFactory ) else
IFFACTORY( ::framework::RecentFilesMenuController ) else
@@ -222,18 +225,19 @@ COMPONENTGETFACTORY ( IFFACTORY( ::framework::URLTransformer
IFFACTORY( ::framework::SessionListener ) else
IFFACTORY( ::framework::StatusbarControllerFactory ) else
IFFACTORY( ::framework::SessionListener ) else
- IFFACTORY( ::framework::LogoImageStatusbarController ) else
- IFFACTORY( ::framework::LogoTextStatusbarController ) else
+ //IFFACTORY( ::framework::LogoImageStatusbarController ) else
+ //IFFACTORY( ::framework::LogoTextStatusbarController ) else
IFFACTORY( ::framework::TaskCreatorService ) else
- IFFACTORY( ::framework::NewMenuController ) else
- IFFACTORY( ::framework::SimpleTextStatusbarController ) else
- IFFACTORY( ::framework::UriAbbreviation ) else
- IFFACTORY( ::framework::PopupMenuDispatcher ) else
+ //IFFACTORY( ::framework::NewMenuController ) else
+ //IFFACTORY( ::framework::SimpleTextStatusbarController ) else
+ //IFFACTORY( ::framework::UriAbbreviation ) else
+ //IFFACTORY( ::framework::PopupMenuDispatcher ) else
IFFACTORY( ::framework::ImageManager ) else
- IFFACTORY( ::framework::PopupMenuDispatcher ) else
IFFACTORY( ::framework::LangSelectionStatusbarController ) else
- IFFACTORY( ::framework::LanguageSelectionMenuController ) else
+ //IFFACTORY( ::framework::LanguageSelectionMenuController ) else
IFFACTORY( ::framework::WindowContentFactoryManager ) else
- IFFACTORY( ::framework::TabWindowService )
+ //IFFACTORY( ::framework::TabWindowService ) else
+ IFFACTORY( ::framework::SubstitutePathVariables ) else
+ IFFACTORY( ::framework::PathSettings )
)
diff --git a/framework/source/register/registertemp.cxx b/framework/source/register/registertemp.cxx
index 6aad0e0e114f..704854558256 100644
--- a/framework/source/register/registertemp.cxx
+++ b/framework/source/register/registertemp.cxx
@@ -60,17 +60,74 @@
)
=================================================================================================================*/
#include <services/mediatypedetectionhelper.hxx>
-#include <services/substitutepathvars.hxx>
-#include <services/pathsettings.hxx>
+#include <dispatch/mailtodispatcher.hxx>
+#include <dispatch/oxt_handler.hxx>
+#include <dispatch/popupmenudispatcher.hxx>
+#include <dispatch/servicehandler.hxx>
+#include <services/dispatchhelper.hxx>
+#include <recording/dispatchrecorder.hxx>
+#include <recording/dispatchrecordersupplier.hxx>
+#include <services/license.hxx>
+#include <services/uriabbreviation.hxx>
+#include <uielement/simpletextstatusbarcontroller.hxx>
+#include <uielement/logoimagestatusbarcontroller.hxx>
+#include <uielement/logotextstatusbarcontroller.hxx>
+#include <services/tabwindowservice.hxx>
+#include <uielement/fontmenucontroller.hxx>
+#include <uielement/fontsizemenucontroller.hxx>
+#include <uielement/footermenucontroller.hxx>
+#include <uielement/headermenucontroller.hxx>
+#include <uielement/langselectionmenucontroller.hxx>
+#include <uielement/macrosmenucontroller.hxx>
+#include <uielement/newmenucontroller.hxx>
+#include <uielement/toolbarsmenucontroller.hxx>
COMPONENTGETIMPLEMENTATIONENVIRONMENT
COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::MediaTypeDetectionHelper )
- COMPONENTINFO( ::framework::SubstitutePathVariables )
- COMPONENTINFO( ::framework::PathSettings )
+ COMPONENTINFO( ::framework::MailToDispatcher )
+ COMPONENTINFO( ::framework::NewMenuController )
+ COMPONENTINFO( ::framework::ToolbarsMenuController )
+ COMPONENTINFO( ::framework::MacrosMenuController )
+ COMPONENTINFO( ::framework::FontSizeMenuController )
+ COMPONENTINFO( ::framework::HeaderMenuController )
+ COMPONENTINFO( ::framework::FooterMenuController )
+ COMPONENTINFO( ::framework::FontMenuController )
+ COMPONENTINFO( ::framework::ServiceHandler )
+ COMPONENTINFO( ::framework::LogoImageStatusbarController )
+ COMPONENTINFO( ::framework::LogoTextStatusbarController )
+ COMPONENTINFO( ::framework::SimpleTextStatusbarController )
+ COMPONENTINFO( ::framework::UriAbbreviation )
+ COMPONENTINFO( ::framework::LanguageSelectionMenuController )
+ COMPONENTINFO( ::framework::PopupMenuDispatcher )
+ COMPONENTINFO( ::framework::DispatchHelper )
+ COMPONENTINFO( ::framework::TabWindowService )
+ COMPONENTINFO( ::framework::DispatchRecorder )
+ COMPONENTINFO( ::framework::DispatchRecorderSupplier )
+ COMPONENTINFO( ::framework::Oxt_Handler )
+ COMPONENTINFO( ::framework::License )
)
-COMPONENTGETFACTORY ( IFFACTORY( ::framework::MediaTypeDetectionHelper ) else
- IFFACTORY( ::framework::SubstitutePathVariables ) else
- IFFACTORY( ::framework::PathSettings )
+COMPONENTGETFACTORY ( IFFACTORY( ::framework::MediaTypeDetectionHelper )
+ IFFACTORY( ::framework::MailToDispatcher ) else
+ IFFACTORY( ::framework::ServiceHandler ) else
+ IFFACTORY( ::framework::LogoTextStatusbarController ) else
+ IFFACTORY( ::framework::LogoImageStatusbarController ) else
+ IFFACTORY( ::framework::License ) else
+ IFFACTORY( ::framework::PopupMenuDispatcher ) else
+ IFFACTORY( ::framework::DispatchHelper ) else
+ IFFACTORY( ::framework::TabWindowService ) else
+ IFFACTORY( ::framework::DispatchRecorder ) else
+ IFFACTORY( ::framework::DispatchRecorderSupplier ) else
+ IFFACTORY( ::framework::SimpleTextStatusbarController ) else
+ IFFACTORY( ::framework::ToolbarsMenuController ) else
+ IFFACTORY( ::framework::FontMenuController ) else
+ IFFACTORY( ::framework::MacrosMenuController ) else
+ IFFACTORY( ::framework::NewMenuController ) else
+ IFFACTORY( ::framework::FontSizeMenuController ) else
+ IFFACTORY( ::framework::UriAbbreviation ) else
+ IFFACTORY( ::framework::FooterMenuController ) else
+ IFFACTORY( ::framework::HeaderMenuController ) else
+ IFFACTORY( ::framework::LanguageSelectionMenuController ) else
+ IFFACTORY( ::framework::Oxt_Handler )
)
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 93a9f215c079..9328ed9d9a5c 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -3180,15 +3180,13 @@ void SAL_CALL AutoRecovery::getFastPropertyValue(css::uno::Any& aValue ,
{
case AUTORECOVERY_PROPHANDLE_EXISTS_RECOVERYDATA :
{
- css::uno::Any aSessionVal = ::comphelper::ConfigurationHelper::readDirectKey(
+ sal_Bool bSessionData = sal_False;
+ ::comphelper::ConfigurationHelper::readDirectKey(
m_xSMGR,
CFG_PACKAGE_RECOVERY,
CFG_PATH_RECOVERYINFO,
CFG_ENTRY_SESSIONDATA,
- ::comphelper::ConfigurationHelper::E_READONLY);
-
- sal_Bool bSessionData = sal_False;
- aSessionVal >>= bSessionData;
+ ::comphelper::ConfigurationHelper::E_READONLY) >>= bSessionData;
sal_Bool bRecoveryData = ((sal_Bool)(m_lDocCache.size()>0));
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index 03b0e1ec3dcc..40e4a9f7a6b9 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -34,6 +34,7 @@
#include "backingwindow.hxx"
#include "framework.hrc"
#include "classes/fwkresid.hxx"
+#include <services.h>
#include "vcl/metric.hxx"
#include "vcl/mnemonic.hxx"
@@ -167,6 +168,10 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
// clean up resource stack
FreeResource();
+ maWelcome.SetPaintTransparent( TRUE );
+ maProduct.SetPaintTransparent( TRUE );
+ EnableChildTransparentMode();
+
SetStyle( GetStyle() | WB_DIALOGCONTROL );
// add some breathing space for the images
@@ -202,9 +207,7 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
maToolbox.ShowItem( nItemId_Info );
// get dispatch provider
- mxDesktop = Reference<XDesktop>( comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ),
- UNO_QUERY );
+ mxDesktop = Reference<XDesktop>( comphelper::getProcessServiceFactory()->createInstance(SERVICENAME_DESKTOP ),UNO_QUERY );
if( mxDesktop.is() )
mxDesktopDispatchProvider = Reference< XDispatchProvider >( mxDesktop, UNO_QUERY );
@@ -242,6 +245,7 @@ void BackingWindow::DataChanged( const DataChangedEvent& rDCEvt )
if ( rDCEvt.GetFlags() & SETTINGS_STYLE )
{
initBackground();
+ Invalidate();
}
}
@@ -249,7 +253,7 @@ void BackingWindow::initBackground()
{
SetBackground( GetSettings().GetStyleSettings().GetWorkspaceGradient() );
- bool bDark = GetSettings().GetStyleSettings().GetWindowColor().IsDark();
+ bool bDark = GetSettings().GetStyleSettings().GetHighContrastMode();
maWelcomeTextColor = maLabelTextColor = bDark ? Color( COL_WHITE ) : Color( 0x26, 0x35, 0x42 );
Color aTextBGColor( bDark ? COL_BLACK : COL_WHITE );
@@ -279,9 +283,9 @@ void BackingWindow::initBackground()
}
maWelcome.SetControlForeground( maWelcomeTextColor );
- maWelcome.SetControlBackground( aTextBGColor );
+ maWelcome.SetBackground();
maProduct.SetControlForeground( maWelcomeTextColor );
- maProduct.SetControlBackground( aTextBGColor );
+ maProduct.SetBackground();
maCreateText.SetControlForeground( maLabelTextColor );
maCreateText.SetControlBackground( aTextBGColor );
maWriterText.SetControlForeground( maLabelTextColor );
@@ -524,7 +528,7 @@ void BackingWindow::layoutButtonAndText(
void BackingWindow::Paint( const Rectangle& )
{
- bool bDark = GetSettings().GetStyleSettings().GetWindowColor().IsDark();
+ bool bDark = GetSettings().GetStyleSettings().GetHighContrastMode();
Color aBackColor( bDark ? COL_BLACK : COL_WHITE );
@@ -716,9 +720,7 @@ IMPL_LINK( BackingWindow, ToolboxHdl, void*, EMPTYARG )
{
try
{
- Reference<lang::XMultiServiceFactory> xConfig( comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"))),
- UNO_QUERY);
+ Reference<lang::XMultiServiceFactory> xConfig( comphelper::getProcessServiceFactory()->createInstance(SERVICENAME_CFGPROVIDER),UNO_QUERY);
if( xConfig.is() )
{
Sequence<Any> args(1);
@@ -728,9 +730,7 @@ IMPL_LINK( BackingWindow, ToolboxHdl, void*, EMPTYARG )
Any(rtl::OUString::createFromAscii(pNodePath)),
PropertyState_DIRECT_VALUE);
args.getArray()[0] <<= val;
- Reference<container::XNameAccess> xNameAccess(
- xConfig->createInstanceWithArguments(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")),
- args), UNO_QUERY);
+ Reference<container::XNameAccess> xNameAccess(xConfig->createInstanceWithArguments(SERVICENAME_CFGREADACCESS,args), UNO_QUERY);
if( xNameAccess.is() )
{
rtl::OUString sURL;
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index b1ede5fce89e..62361d619df3 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -82,6 +82,7 @@
#include <com/sun/star/frame/XNotifyingDispatch.hpp>
#include <com/sun/star/frame/DispatchResultState.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/document/MacroExecMode.hpp>
#include <com/sun/star/document/UpdateDocMode.hpp>
@@ -2015,47 +2016,6 @@ sal_Bool Desktop::implcp_ctor( const css::uno::Reference< css::lang::XMultiServi
//*****************************************************************************************************************
// We work with valid listener only.
-sal_Bool Desktop::implcp_addTerminateListener( const css::uno::Reference< css::frame::XTerminateListener >& xListener )
-{
- return(
- ( &xListener == NULL ) ||
- ( xListener.is() == sal_False )
- );
-}
-
-//*****************************************************************************************************************
-// We work with valid listener only.
-sal_Bool Desktop::implcp_removeTerminateListener( const css::uno::Reference< css::frame::XTerminateListener >& xListener )
-{
- return(
- ( &xListener == NULL ) ||
- ( xListener.is() == sal_False )
- );
-}
-
-//*****************************************************************************************************************
-// The target frame could be ""(!), but flags must be in range of right enum.
-sal_Bool Desktop::implcp_findFrame( const ::rtl::OUString& sTargetFrameName,
- sal_Int32 nSearchFlags )
-{
- return(
- ( &sTargetFrameName == NULL ) ||
- (
- ( nSearchFlags != css::frame::FrameSearchFlag::AUTO ) &&
- ( !( nSearchFlags & css::frame::FrameSearchFlag::PARENT ) ) &&
- ( !( nSearchFlags & css::frame::FrameSearchFlag::SELF ) ) &&
- ( !( nSearchFlags & css::frame::FrameSearchFlag::CHILDREN ) ) &&
- ( !( nSearchFlags & css::frame::FrameSearchFlag::CREATE ) ) &&
- ( !( nSearchFlags & css::frame::FrameSearchFlag::SIBLINGS ) ) &&
- ( !( nSearchFlags & css::frame::FrameSearchFlag::TASKS ) ) &&
- ( !( nSearchFlags & css::frame::FrameSearchFlag::ALL ) ) &&
- ( !( nSearchFlags & css::frame::FrameSearchFlag::GLOBAL ) )
- )
- );
-}
-
-//*****************************************************************************************************************
-// We work with valid listener only.
sal_Bool Desktop::implcp_addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener )
{
return(
@@ -2074,15 +2034,6 @@ sal_Bool Desktop::implcp_removeEventListener( const css::uno::Reference< css::la
);
}
-//*****************************************************************************************************************
-sal_Bool Desktop::implcp_statusChanged( const css::frame::FeatureStateEvent& aEvent )
-{
- return(
- ( &aEvent == NULL ) ||
- ( aEvent.FeatureDescriptor.getLength() < 1 )
- );
-}
-
#endif // #ifdef ENABLE_ASSERTIONS
} // namespace framework
diff --git a/framework/source/services/dispatchhelper.cxx b/framework/source/services/dispatchhelper.cxx
index ffdd88d65818..c47406f424e3 100644
--- a/framework/source/services/dispatchhelper.cxx
+++ b/framework/source/services/dispatchhelper.cxx
@@ -63,19 +63,6 @@ namespace framework{
//_______________________________________________
// XInterface, XTypeProvider, XServiceInfo
-DEFINE_XINTERFACE_4(DispatchHelper ,
- OWeakObject ,
- DIRECT_INTERFACE(css::lang::XTypeProvider ),
- DIRECT_INTERFACE(css::lang::XServiceInfo ),
- DIRECT_INTERFACE(css::frame::XDispatchHelper ),
- DIRECT_INTERFACE(css::frame::XDispatchResultListener))
-
-DEFINE_XTYPEPROVIDER_4(DispatchHelper ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- css::frame::XDispatchHelper ,
- css::frame::XDispatchResultListener)
-
DEFINE_XSERVICEINFO_MULTISERVICE(DispatchHelper ,
::cppu::OWeakObject ,
SERVICENAME_DISPATCHHELPER ,
@@ -91,7 +78,6 @@ DEFINE_INIT_SERVICE( DispatchHelper, {} )
*/
DispatchHelper::DispatchHelper( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR )
: ThreadHelpBase( )
- , OWeakObject ( )
// Init member
, m_xSMGR (xSMGR)
{
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index 3d7b28697dd9..0e14404de381 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -62,6 +62,7 @@
// interface includes
//_________________________________________________________________________________________________________________
#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/task/XJobExecutor.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/util/XCloseable.hpp>
@@ -991,10 +992,9 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const ::rtl
sal_Int32 nCount = xContainer->getCount();
for( sal_Int32 i=0; i<nCount; ++i )
{
- css::uno::Any aItem = xContainer->getByIndex(i);
css::uno::Reference< css::frame::XFrame > xSibling;
if (
- ( !(aItem>>=xSibling) ) || // control unpacking
+ ( !(xContainer->getByIndex(i)>>=xSibling) ) || // control unpacking
( ! xSibling.is() ) || // check for valid items
( xSibling==static_cast< ::cppu::OWeakObject* >(this) ) // ignore ourself! (We are a part of this container too - but search on our children was already done.)
)
@@ -2899,11 +2899,7 @@ void Frame::implts_setIconOnWindow()
{
try
{
- css::uno::Any aID = xSet->getPropertyValue( DECLARE_ASCII("IconId") );
- if( aID.hasValue() == sal_True )
- {
- aID >>= nIcon;
- }
+ xSet->getPropertyValue( DECLARE_ASCII("IconId") )>>= nIcon;
}
catch( css::beans::UnknownPropertyException& )
{
@@ -3247,50 +3243,6 @@ sal_Bool Frame::implcp_setActiveFrame( const css::uno::Reference< css::frame::XF
}
//*****************************************************************************************************************
-// We don't accept null pointer ... but NULL-References are allowed!
-sal_Bool Frame::implcp_initialize( const css::uno::Reference< css::awt::XWindow >& xWindow )
-{
- return( &xWindow == NULL );
-}
-
-//*****************************************************************************************************************
-// We don't accept null pointer or references!
-sal_Bool Frame::implcp_setCreator( const css::uno::Reference< css::frame::XFramesSupplier >& xCreator )
-{
- return (
- ( &xCreator == NULL ) ||
- ( xCreator.is() == sal_False )
- );
-}
-
-//*****************************************************************************************************************
-// We don't accept null pointer or references!
-sal_Bool Frame::implcp_setName( const ::rtl::OUString& sName )
-{
- return( &sName == NULL );
-}
-
-//*****************************************************************************************************************
-// We don't accept null pointer or references!
-// An empty target name is allowed => is the same like "_self"
-sal_Bool Frame::implcp_findFrame( const ::rtl::OUString& sTargetFrameName,
- sal_Int32 /*nSearchFlags*/ )
-{
- return( &sTargetFrameName == NULL );
-}
-
-//*****************************************************************************************************************
-// We don't accept null pointer!
-sal_Bool Frame::implcp_setComponent( const css::uno::Reference< css::awt::XWindow >& xComponentWindow ,
- const css::uno::Reference< css::frame::XController >& xController )
-{
- return (
- ( &xComponentWindow == NULL ) ||
- ( &xController == NULL )
- );
-}
-
-//*****************************************************************************************************************
sal_Bool Frame::implcp_addFrameActionListener( const css::uno::Reference< css::frame::XFrameActionListener >& xListener )
{
return (
diff --git a/framework/source/services/license.cxx b/framework/source/services/license.cxx
index 768f7aef289c..c2a63843d45b 100644
--- a/framework/source/services/license.cxx
+++ b/framework/source/services/license.cxx
@@ -167,7 +167,7 @@ DEFINE_INIT_SERVICE ( License,
)
-
+#if 0
IMPL_STATIC_LINK_NOINSTANCE( License, Terminate, void*, EMPTYARG )
{
/*
@@ -182,6 +182,7 @@ IMPL_STATIC_LINK_NOINSTANCE( License, Terminate, void*, EMPTYARG )
*/
return 0;
}
+#endif
static DateTime _oslDateTimeToDateTime(const oslDateTime& aDateTime)
{
@@ -318,9 +319,9 @@ css::uno::Any SAL_CALL License::execute(const css::uno::Sequence< css::beans::Na
#endif
// check if we need to show the license at all
// open org.openoffice.Setup/Office/ooLicenseAcceptDate
- ::rtl::OUString sConfigSrvc = ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider");
+ ::rtl::OUString sConfigSrvc = SERVICENAME_CFGPROVIDER;
::rtl::OUString sAccessSrvc = ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess");
- ::rtl::OUString sReadSrvc = ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess");
+ ::rtl::OUString sReadSrvc = SERVICENAME_CFGREADACCESS;
// get configuration provider
Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
@@ -332,11 +333,10 @@ css::uno::Any SAL_CALL License::execute(const css::uno::Sequence< css::beans::Na
theArgs[0] <<= v;
Reference< XPropertySet > pset = Reference< XPropertySet >(
theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW);
- Any result = pset->getPropertyValue(::rtl::OUString::createFromAscii("ooLicenseAcceptDate"));
// if we find a date there, compare it to baseinstall license date
::rtl::OUString aAcceptDate;
- if (result >>= aAcceptDate)
+ if (pset->getPropertyValue(::rtl::OUString::createFromAscii("ooLicenseAcceptDate")) >>= aAcceptDate)
{
// get LicenseFileDate from base install
::rtl::OUString aLicenseURL = aLicensePath;
diff --git a/framework/source/services/mediatypedetectionhelper.cxx b/framework/source/services/mediatypedetectionhelper.cxx
index f2139280f80a..41d57b47899e 100644
--- a/framework/source/services/mediatypedetectionhelper.cxx
+++ b/framework/source/services/mediatypedetectionhelper.cxx
@@ -38,6 +38,7 @@
#include <services.h>
#include <svtools/inettype.hxx>
#include <tools/string.hxx>
+#include <rtl/logfile.hxx>
//_________________________________________________________________________________________________________________
// interface includes
@@ -72,23 +73,6 @@ MediaTypeDetectionHelper::~MediaTypeDetectionHelper()
{
}
-//*****************************************************************************************************************
-// XInterface, XTypeProvider, XServiceInfo
-//*****************************************************************************************************************
-
-DEFINE_XINTERFACE_3 ( MediaTypeDetectionHelper
- , OWeakObject
- , DIRECT_INTERFACE( lang::XTypeProvider )
- , DIRECT_INTERFACE( lang::XServiceInfo )
- , DIRECT_INTERFACE( util::XStringMapping )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( MediaTypeDetectionHelper
- , lang::XTypeProvider
- , lang::XServiceInfo
- , util::XStringMapping
- )
-
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( MediaTypeDetectionHelper
, ::cppu::OWeakObject
, SERVICENAME_MEDIATYPEDETECTIONHELPER
diff --git a/framework/source/services/modulemanager.cxx b/framework/source/services/modulemanager.cxx
index 9fa3f3af2898..9c8ce95a3ffa 100644
--- a/framework/source/services/modulemanager.cxx
+++ b/framework/source/services/modulemanager.cxx
@@ -53,6 +53,7 @@
//_______________________________________________
// other includes
+#include <rtl/logfile.hxx>
namespace framework
{
@@ -194,7 +195,7 @@ void SAL_CALL ModuleManager::replaceByName(const ::rtl::OUString& sName ,
css::uno::RuntimeException )
{
::comphelper::SequenceAsHashMap lProps(aValue);
- if (lProps.size() < 1)
+ if (lProps.empty() )
{
throw css::lang::IllegalArgumentException(
::rtl::OUString::createFromAscii("No properties given to replace part of module."),
@@ -254,10 +255,8 @@ css::uno::Any SAL_CALL ModuleManager::getByName(const ::rtl::OUString& sName)
{
// get access to the element
css::uno::Reference< css::container::XNameAccess > xCFG = implts_getConfig();
- css::uno::Any aElement = xCFG->getByName(sName);
-
css::uno::Reference< css::container::XNameAccess > xModule;
- aElement >>= xModule;
+ xCFG->getByName(sName) >>= xModule;
if (!xModule.is())
{
throw css::uno::RuntimeException(
diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx
index a14324f9c3ed..bb3a18548b42 100644
--- a/framework/source/services/pathsettings.cxx
+++ b/framework/source/services/pathsettings.cxx
@@ -157,6 +157,7 @@ PathSettings::PathSettings( const css::uno::Reference< css::lang::XMultiServiceF
, m_pPropHelp(0 )
, m_bIgnoreEvents(sal_False)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::PathSettings" );
}
//-----------------------------------------------------------------------------
@@ -170,6 +171,7 @@ PathSettings::~PathSettings()
void SAL_CALL PathSettings::changesOccurred(const css::util::ChangesEvent& aEvent)
throw (css::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::changesOccurred" );
/*
if (m_bIgnoreEvents)
return;
@@ -206,6 +208,7 @@ void SAL_CALL PathSettings::changesOccurred(const css::util::ChangesEvent& aEven
void SAL_CALL PathSettings::disposing(const css::lang::EventObject& aSource)
throw(css::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::disposing" );
// SAFE ->
WriteGuard aWriteLock(m_aLock);
@@ -219,6 +222,7 @@ void SAL_CALL PathSettings::disposing(const css::lang::EventObject& aSource)
//-----------------------------------------------------------------------------
void PathSettings::impl_readAll()
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::impl_readAll" );
RTL_LOGFILE_CONTEXT(aLog, "framework (as96863) ::PathSettings::load config (all)");
// TODO think about me
@@ -241,6 +245,7 @@ void PathSettings::impl_readAll()
// NO substitution here ! It's done outside ...
OUStringList PathSettings::impl_readOldFormat(const ::rtl::OUString& sPath)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::impl_readOldFormat" );
css::uno::Reference< css::container::XNameAccess > xCfg = fa_getCfgOld();
css::uno::Any aVal = xCfg->getByName(sPath);
@@ -308,6 +313,7 @@ PathSettings::PathInfo PathSettings::impl_readNewFormat(const ::rtl::OUString& s
//-----------------------------------------------------------------------------
void PathSettings::impl_storePath(const PathSettings::PathInfo& aPath)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::impl_storePath" );
m_bIgnoreEvents = sal_True;
css::uno::Reference< css::container::XNameAccess > xCfgNew = fa_getCfgNew();
@@ -356,6 +362,7 @@ void PathSettings::impl_storePath(const PathSettings::PathInfo& aPath)
void PathSettings::impl_mergeOldUserPaths( PathSettings::PathInfo& rPath,
const OUStringList& lOld )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::impl_mergeOldUserPaths" );
OUStringList::const_iterator pIt;
for ( pIt = lOld.begin();
pIt != lOld.end() ;
@@ -654,6 +661,7 @@ void PathSettings::impl_subst(PathSettings::PathInfo& aPath ,
{
OUStringList::const_iterator pIt;
OUStringList lTemp;
+ lTemp.reserve(rPath.lInternalPaths.size() + rPath.lUserPaths.size() + 1);
for ( pIt = rPath.lInternalPaths.begin();
pIt != rPath.lInternalPaths.end() ;
@@ -857,7 +865,7 @@ void PathSettings::impl_setPathValue( sal_Int32 nID ,
if (aChangePath.bIsSinglePath)
{
LOG_ASSERT2(lList.size()>1, "PathSettings::impl_setPathValue()", "You try to set more then path value for a defined SINGLE_PATH!")
- if (lList.size()>0)
+ if ( !lList.empty() )
aChangePath.sWritePath = *(lList.begin());
else
aChangePath.sWritePath = ::rtl::OUString();
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx
index 55849ab8124a..966ce1756c64 100644
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -295,7 +295,7 @@ void SubstitutePathVariables_Impl::GetSharePointsRules( SubstituteVariables& aSu
SubstituteRuleVector aRuleSet;
ReadSharePointRuleSetFromConfiguration( aSharePointNames[ nSharePoints ], aSharePointNodeName, aRuleSet );
- if ( aRuleSet.size() > 0 )
+ if ( !aRuleSet.empty() )
{
// We have at minimum one rule. Filter the correct rule out of the rule set
// and put into our SubstituteVariable map
@@ -409,10 +409,11 @@ sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector
{
sal_Bool bResult = sal_False;
- if ( aRuleSet.size() >= 1 )
+ if ( !aRuleSet.empty() )
{
sal_Int16 nPrioCurrentRule = aEnvPrioTable[ ET_UNKNOWN ];
- for ( sal_Int32 nIndex = 0; nIndex < (sal_Int32)aRuleSet.size(); nIndex++ )
+ const sal_uInt32 nCount = aRuleSet.size();
+ for ( sal_uInt32 nIndex = 0; nIndex < nCount; nIndex++ )
{
const SubstituteRule& aRule = aRuleSet[nIndex];
EnvironmentType eEnvType = aRule.aEnvType;
@@ -587,19 +588,6 @@ void SubstitutePathVariables_Impl::ReadSharePointRuleSetFromConfiguration(
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( SubstitutePathVariables ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XServiceInfo ),
- DIRECT_INTERFACE( css::util::XStringSubstitution )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( SubstitutePathVariables ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- css::util::XStringSubstitution
- )
-
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( SubstitutePathVariables ,
::cppu::OWeakObject ,
SERVICENAME_SUBSTITUTEPATHVARIABLES ,
@@ -616,6 +604,7 @@ SubstitutePathVariables::SubstitutePathVariables( const Reference< XMultiService
m_aImpl( LINK( this, SubstitutePathVariables, implts_ConfigurationNotify )),
m_xServiceManager( xServiceManager )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::SubstitutePathVariables" );
int i;
SetPredefinedPathVariables( m_aPreDefVars );
@@ -674,6 +663,7 @@ SubstitutePathVariables::~SubstitutePathVariables()
rtl::OUString SAL_CALL SubstitutePathVariables::substituteVariables( const ::rtl::OUString& aText, sal_Bool bSubstRequired )
throw ( NoSuchElementException, RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::substituteVariables" );
ResetableGuard aLock( m_aLock );
return impl_substituteVariable( aText, bSubstRequired );
}
@@ -681,6 +671,7 @@ throw ( NoSuchElementException, RuntimeException )
rtl::OUString SAL_CALL SubstitutePathVariables::reSubstituteVariables( const ::rtl::OUString& aText )
throw ( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::reSubstituteVariables" );
ResetableGuard aLock( m_aLock );
return impl_reSubstituteVariables( aText );
}
@@ -688,6 +679,7 @@ throw ( RuntimeException )
rtl::OUString SAL_CALL SubstitutePathVariables::getSubstituteVariableValue( const ::rtl::OUString& aVariable )
throw ( NoSuchElementException, RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::getSubstituteVariableValue" );
ResetableGuard aLock( m_aLock );
return impl_getSubstituteVariableValue( aVariable );
}
@@ -707,6 +699,7 @@ IMPL_LINK( SubstitutePathVariables, implts_ConfigurationNotify, SubstitutePathNo
rtl::OUString SubstitutePathVariables::ConvertOSLtoUCBURL( const rtl::OUString& aOSLCompliantURL ) const
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::ConvertOSLtoUCBURL" );
String aResult;
rtl::OUString aTemp;
@@ -722,27 +715,27 @@ rtl::OUString SubstitutePathVariables::ConvertOSLtoUCBURL( const rtl::OUString&
rtl::OUString SubstitutePathVariables::GetWorkPath() const
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::GetWorkPath" );
rtl::OUString aWorkPath;
- css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(
+ ::comphelper::ConfigurationHelper::readDirectKey(
m_xServiceManager,
::rtl::OUString::createFromAscii("org.openoffice.Office.Paths"),
::rtl::OUString::createFromAscii("Paths/Work"),
::rtl::OUString::createFromAscii("WritePath"),
- ::comphelper::ConfigurationHelper::E_READONLY);
- aVal >>= aWorkPath;
+ ::comphelper::ConfigurationHelper::E_READONLY) >>= aWorkPath;
return aWorkPath;
}
rtl::OUString SubstitutePathVariables::GetWorkVariableValue() const
{
- css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::GetWorkVariableValue" );
+ ::rtl::OUString aWorkPath;
+ ::comphelper::ConfigurationHelper::readDirectKey(
m_xServiceManager,
::rtl::OUString::createFromAscii("org.openoffice.Office.Paths"),
::rtl::OUString::createFromAscii("Variables"),
::rtl::OUString::createFromAscii("Work"),
- ::comphelper::ConfigurationHelper::E_READONLY);
- ::rtl::OUString aWorkPath;
- aVal >>= aWorkPath;
+ ::comphelper::ConfigurationHelper::E_READONLY) >>= aWorkPath;
// fallback to $HOME in case platform dependend config layer does not return
// an usuable work dir value.
@@ -756,6 +749,7 @@ rtl::OUString SubstitutePathVariables::GetWorkVariableValue() const
rtl::OUString SubstitutePathVariables::GetHomeVariableValue() const
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::GetHomeVariableValue" );
osl::Security aSecurity;
rtl::OUString aHomePath;
@@ -765,6 +759,7 @@ rtl::OUString SubstitutePathVariables::GetHomeVariableValue() const
rtl::OUString SubstitutePathVariables::GetPathVariableValue() const
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::GetPathVariableValue" );
const int PATH_EXTEND_FACTOR = 120;
rtl::OUString aRetStr;
@@ -801,6 +796,7 @@ rtl::OUString SubstitutePathVariables::GetPathVariableValue() const
rtl::OUString SubstitutePathVariables::impl_substituteVariable( const ::rtl::OUString& rText, sal_Bool bSubstRequired )
throw ( NoSuchElementException, RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::impl_substituteVariable" );
// This is maximal recursive depth supported!
const sal_Int32 nMaxRecursiveDepth = 8;
@@ -928,7 +924,8 @@ throw ( NoSuchElementException, RuntimeException )
else
{
// Check for recursion
- for ( sal_Int32 i=0; i < (sal_Int32)aEndlessRecursiveDetector.size(); i++ )
+ const sal_uInt32 nCount = aEndlessRecursiveDetector.size();
+ for ( sal_uInt32 i=0; i < nCount; i++ )
{
if ( aEndlessRecursiveDetector[i] == aWorkText )
{
@@ -992,6 +989,7 @@ throw ( NoSuchElementException, RuntimeException )
rtl::OUString SubstitutePathVariables::impl_reSubstituteVariables( const ::rtl::OUString& rURL )
throw ( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::impl_reSubstituteVariables" );
rtl::OUString aURL;
INetURLObject aUrl( rURL );
@@ -1096,6 +1094,7 @@ throw ( RuntimeException )
::rtl::OUString SubstitutePathVariables::impl_getSubstituteVariableValue( const ::rtl::OUString& rVariable )
throw ( NoSuchElementException, RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::impl_getSubstituteVariableValue" );
rtl::OUString aVariable;
sal_Int32 nPos = rVariable.indexOf( m_aVarStart );
@@ -1148,6 +1147,7 @@ throw ( NoSuchElementException, RuntimeException )
void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariables& aPreDefPathVariables )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::SetPredefinedPathVariables" );
Any aAny;
::rtl::OUString aOfficePath;
::rtl::OUString aUserPath;
@@ -1204,9 +1204,8 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable
// Detect the language type of the current office
aPreDefPathVariables.m_eLanguageType = LANGUAGE_ENGLISH_US;
- Any aLocale = utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( utl::ConfigManager::LOCALE );
rtl::OUString aLocaleStr;
- if ( aLocale >>= aLocaleStr )
+ if ( utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( utl::ConfigManager::LOCALE ) >>= aLocaleStr )
aPreDefPathVariables.m_eLanguageType = MsLangId::convertIsoStringToLanguage( aLocaleStr );
else
{
diff --git a/framework/source/services/uriabbreviation.cxx b/framework/source/services/uriabbreviation.cxx
index 71c9b430c0b9..45dc02068c91 100644
--- a/framework/source/services/uriabbreviation.cxx
+++ b/framework/source/services/uriabbreviation.cxx
@@ -55,19 +55,6 @@ namespace css = ::com::sun::star;
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( UriAbbreviation ,
- cppu::OWeakObject ,
- DIRECT_INTERFACE(css::lang::XTypeProvider ),
- DIRECT_INTERFACE(css::lang::XServiceInfo ),
- DIRECT_INTERFACE(css::util::XStringAbbreviation )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( UriAbbreviation ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- css::util::XStringAbbreviation
- )
-
DEFINE_XSERVICEINFO_MULTISERVICE_2 ( UriAbbreviation ,
::cppu::OWeakObject ,
SERVICENAME_STRINGABBREVIATION ,
diff --git a/framework/source/services/urltransformer.cxx b/framework/source/services/urltransformer.cxx
index 90e63a2ce122..e248c8308b52 100644
--- a/framework/source/services/urltransformer.cxx
+++ b/framework/source/services/urltransformer.cxx
@@ -77,21 +77,11 @@ using namespace ::com::sun::star::util ;
//*****************************************************************************************************************
// constructor
//*****************************************************************************************************************
-URLTransformer::URLTransformer( const Reference< XMultiServiceFactory >& xFactory )
- // Init baseclasses first
- // Attention:
- // Don't change order of initialization!
- // ThreadHelpBase is a struct with a mutex as member. We can't use a mutex as member, while
- // we must garant right initialization and a valid value of this! First initialize
- // baseclasses and then members. And we need the mutex for other baseclasses !!!
- : ThreadHelpBase ( &Application::GetSolarMutex() )
- , OWeakObject ( )
- // Init member
- , m_xFactory ( xFactory )
+URLTransformer::URLTransformer( const Reference< XMultiServiceFactory >& /*xFactory*/ )
{
// Safe impossible cases.
// Method not defined for all incoming parameter.
- LOG_ASSERT( xFactory.is(), "URLTransformer::URLTransformer()\nInvalid parameter detected!\n" )
+ //LOG_ASSERT( xFactory.is(), "URLTransformer::URLTransformer()\nInvalid parameter detected!\n" )
}
//*****************************************************************************************************************
@@ -105,19 +95,6 @@ URLTransformer::~URLTransformer()
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( URLTransformer ,
- OWeakObject ,
- DIRECT_INTERFACE(XTypeProvider ),
- DIRECT_INTERFACE(XServiceInfo ),
- DIRECT_INTERFACE(XURLTransformer )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( URLTransformer ,
- XTypeProvider ,
- XServiceInfo ,
- XURLTransformer
- )
-
DEFINE_XSERVICEINFO_MULTISERVICE ( URLTransformer ,
OWeakObject ,
SERVICENAME_URLTRANSFORMER ,
@@ -129,21 +106,68 @@ DEFINE_INIT_SERVICE ( URLTransformer,
}
)
+namespace
+{
+ void lcl_ParserHelper(INetURLObject& _rParser,URL& _rURL,bool _bUseIntern)
+ {
+ // Get all information about this URL.
+ _rURL.Protocol = INetURLObject::GetScheme( _rParser.GetProtocol() );
+ _rURL.User = _rParser.GetUser ( INetURLObject::DECODE_WITH_CHARSET );
+ _rURL.Password = _rParser.GetPass ( INetURLObject::DECODE_WITH_CHARSET );
+ _rURL.Server = _rParser.GetHost ( INetURLObject::DECODE_WITH_CHARSET );
+ _rURL.Port = (sal_Int16)_rParser.GetPort();
+
+ sal_Int32 nCount = _rParser.getSegmentCount( false );
+ if ( nCount > 0 )
+ {
+ // Don't add last segment as it is the name!
+ --nCount;
+
+ rtl::OUStringBuffer aPath;
+ for ( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ aPath.append( sal_Unicode( '/' ));
+ aPath.append( _rParser.getName( nIndex, false, INetURLObject::NO_DECODE ));
+ }
+
+ if ( nCount > 0 )
+ aPath.append( sal_Unicode( '/' )); // final slash!
+
+ _rURL.Path = aPath.makeStringAndClear();
+ _rURL.Name = _rParser.getName( INetURLObject::LAST_SEGMENT, false, INetURLObject::NO_DECODE );
+ }
+ else
+ {
+ _rURL.Path = _rParser.GetURLPath( INetURLObject::NO_DECODE );
+ _rURL.Name = _rParser.GetName ( );
+ }
+
+ _rURL.Arguments = _rParser.GetParam ( INetURLObject::NO_DECODE );
+ _rURL.Mark = _rParser.GetMark ( INetURLObject::DECODE_WITH_CHARSET );
+
+ // INetURLObject supports only an intelligent method of parsing URL's. So write
+ // back Complete to have a valid encoded URL in all cases!
+ _rURL.Complete = _rParser.GetMainURL( INetURLObject::NO_DECODE );
+ if ( _bUseIntern )
+ _rURL.Complete = _rURL.Complete.intern();
+
+ _rParser.SetMark ( ::rtl::OUString() );
+ _rParser.SetParam( ::rtl::OUString() );
+
+ _rURL.Main = _rParser.GetMainURL( INetURLObject::NO_DECODE );
+ }
+}
//*****************************************************************************************************************
// XURLTransformer
//*****************************************************************************************************************
sal_Bool SAL_CALL URLTransformer::parseStrict( URL& aURL ) throw( RuntimeException )
{
- // Ready for multithreading
- ResetableGuard aGuard( m_aLock );
-
// Safe impossible cases.
if (( &aURL == NULL ) ||
( aURL.Complete.getLength() < 1 ) )
{
return sal_False;
}
-
// Try to extract the protocol
sal_Int32 nURLIndex = aURL.Complete.indexOf( sal_Unicode( ':' ));
::rtl::OUString aProtocol;
@@ -165,50 +189,7 @@ sal_Bool SAL_CALL URLTransformer::parseStrict( URL& aURL ) throw( RuntimeExcepti
}
else if ( !aParser.HasError() )
{
- aURL.Protocol = INetURLObject::GetScheme( aParser.GetProtocol() );
- aURL.User = aParser.GetUser ( INetURLObject::DECODE_WITH_CHARSET );
- aURL.Password = aParser.GetPass ( INetURLObject::DECODE_WITH_CHARSET );
- aURL.Server = aParser.GetHost ( INetURLObject::DECODE_WITH_CHARSET );
- aURL.Port = (sal_Int16)aParser.GetPort();
-
- sal_Int32 nCount = aParser.getSegmentCount( false );
- if ( nCount > 0 )
- {
- // Don't add last segment as it is the name!
- --nCount;
-
- rtl::OUStringBuffer aPath;
- for ( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
- {
- aPath.append( sal_Unicode( '/' ));
- aPath.append( aParser.getName( nIndex, false, INetURLObject::NO_DECODE ));
- }
-
- if ( nCount > 0 )
- aPath.append( sal_Unicode( '/' )); // final slash!
-
- aURL.Path = aPath.makeStringAndClear();
- aURL.Name = aParser.getName( INetURLObject::LAST_SEGMENT, false, INetURLObject::NO_DECODE );
- }
- else
- {
- aURL.Path = aParser.GetURLPath( INetURLObject::NO_DECODE );
- aURL.Name = aParser.GetName ( );
- }
-
- aURL.Arguments = aParser.GetParam ( INetURLObject::NO_DECODE );
- aURL.Mark = aParser.GetMark ( INetURLObject::DECODE_WITH_CHARSET );
-
- // INetURLObject supports only an intelligent method of parsing URL's. So write
- // back Complete to have a valid encoded URL in all cases!
- aURL.Complete = aParser.GetMainURL( INetURLObject::NO_DECODE );
- aURL.Complete = aURL.Complete.intern();
-
- aParser.SetMark ( ::rtl::OUString() );
- aParser.SetParam( ::rtl::OUString() );
-
- aURL.Main = aParser.GetMainURL( INetURLObject::NO_DECODE );
-
+ lcl_ParserHelper(aParser,aURL,false);
// Return "URL is parsed".
return sal_True;
}
@@ -235,8 +216,6 @@ sal_Bool SAL_CALL URLTransformer::parseStrict( URL& aURL ) throw( RuntimeExcepti
sal_Bool SAL_CALL URLTransformer::parseSmart( URL& aURL ,
const ::rtl::OUString& sSmartProtocol ) throw( RuntimeException )
{
- // Ready for multithreading
- ResetableGuard aGuard( m_aLock );
// Safe impossible cases.
if (( &aURL == NULL ) ||
( aURL.Complete.getLength() < 1 ) )
@@ -251,48 +230,7 @@ sal_Bool SAL_CALL URLTransformer::parseSmart( URL& aURL
bool bOk = aParser.SetSmartURL( aURL.Complete );
if ( bOk )
{
- // Get all information about this URL.
- aURL.Protocol = INetURLObject::GetScheme( aParser.GetProtocol() );
- aURL.User = aParser.GetUser ( INetURLObject::DECODE_WITH_CHARSET );
- aURL.Password = aParser.GetPass ( INetURLObject::DECODE_WITH_CHARSET );
- aURL.Server = aParser.GetHost ( INetURLObject::DECODE_WITH_CHARSET );
- aURL.Port = (sal_Int16)aParser.GetPort();
-
- sal_Int32 nCount = aParser.getSegmentCount( false );
- if ( nCount > 0 )
- {
- // Don't add last segment as it is the name!
- --nCount;
-
- rtl::OUStringBuffer aPath;
- for ( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
- {
- aPath.append( sal_Unicode( '/' ));
- aPath.append( aParser.getName( nIndex, false, INetURLObject::NO_DECODE ));
- }
-
- if ( nCount > 0 )
- aPath.append( sal_Unicode( '/' )); // final slash!
-
- aURL.Path = aPath.makeStringAndClear();
- aURL.Name = aParser.getName( INetURLObject::LAST_SEGMENT, false, INetURLObject::NO_DECODE );
- }
- else
- {
- aURL.Path = aParser.GetURLPath( INetURLObject::NO_DECODE );
- aURL.Name = aParser.GetName ( );
- }
-
- aURL.Arguments = aParser.GetParam ( INetURLObject::NO_DECODE );
- aURL.Mark = aParser.GetMark ( INetURLObject::DECODE_WITH_CHARSET );
-
- aURL.Complete = aParser.GetMainURL( INetURLObject::NO_DECODE );
-
- aParser.SetMark ( ::rtl::OUString() );
- aParser.SetParam( ::rtl::OUString() );
-
- aURL.Main = aParser.GetMainURL( INetURLObject::NO_DECODE );
-
+ lcl_ParserHelper(aParser,aURL,true);
// Return "URL is parsed".
return sal_True;
}
@@ -333,9 +271,6 @@ sal_Bool SAL_CALL URLTransformer::parseSmart( URL& aURL
//*****************************************************************************************************************
sal_Bool SAL_CALL URLTransformer::assemble( URL& aURL ) throw( RuntimeException )
{
- // Ready for multithreading
- ResetableGuard aGuard( m_aLock );
-
// Safe impossible cases.
if ( &aURL == NULL )
return sal_False ;
@@ -400,9 +335,6 @@ sal_Bool SAL_CALL URLTransformer::assemble( URL& aURL ) throw( RuntimeException
::rtl::OUString SAL_CALL URLTransformer::getPresentation( const URL& aURL ,
sal_Bool bWithPassword ) throw( RuntimeException )
{
- // Ready for multithreading
- ResetableGuard aGuard( m_aLock );
-
// Safe impossible cases.
if (( &aURL == NULL ) ||
( aURL.Complete.getLength() < 1 ) ||
diff --git a/framework/source/tabwin/tabwindow.cxx b/framework/source/tabwin/tabwindow.cxx
index 4bb769386d25..fe406598163e 100644
--- a/framework/source/tabwin/tabwindow.cxx
+++ b/framework/source/tabwin/tabwindow.cxx
@@ -45,7 +45,7 @@
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/WindowDescriptor.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
-
+#include <com/sun/star/lang/DisposedException.hpp>
//_________________________________________________________________________________________________________________
// includes of other projects
//_________________________________________________________________________________________________________________
diff --git a/framework/source/tabwin/tabwinfactory.cxx b/framework/source/tabwin/tabwinfactory.cxx
index c8663cbc492b..0e88cb6aeaa5 100644
--- a/framework/source/tabwin/tabwinfactory.cxx
+++ b/framework/source/tabwin/tabwinfactory.cxx
@@ -70,19 +70,6 @@ namespace framework
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( TabWinFactory ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XServiceInfo ),
- DIRECT_INTERFACE( css::lang::XSingleComponentFactory )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( TabWinFactory ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- css::lang::XSingleComponentFactory
- )
-
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( TabWinFactory ,
::cppu::OWeakObject ,
SERVICENAME_TABWINFACTORY ,
diff --git a/framework/source/threadhelp/transactionmanager.cxx b/framework/source/threadhelp/transactionmanager.cxx
index 2fcd5a805332..031e64b1d4b7 100644
--- a/framework/source/threadhelp/transactionmanager.cxx
+++ b/framework/source/threadhelp/transactionmanager.cxx
@@ -43,7 +43,7 @@
//_________________________________________________________________________________________________________________
// interface includes
//_________________________________________________________________________________________________________________
-
+#include <com/sun/star/lang/DisposedException.hpp>
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
diff --git a/framework/source/uiconfiguration/graphicnameaccess.cxx b/framework/source/uiconfiguration/graphicnameaccess.cxx
index 8fae61c88d3e..f7568db1edec 100644
--- a/framework/source/uiconfiguration/graphicnameaccess.cxx
+++ b/framework/source/uiconfiguration/graphicnameaccess.cxx
@@ -103,7 +103,7 @@ throw(::com::sun::star::uno::RuntimeException)
sal_Bool SAL_CALL GraphicNameAccess::hasElements()
throw( uno::RuntimeException )
{
- return ( m_aNameToElementMap.size() > 0 );
+ return ( !m_aNameToElementMap.empty() );
}
uno::Type SAL_CALL GraphicNameAccess::getElementType()
diff --git a/framework/source/uiconfiguration/imagemanager.cxx b/framework/source/uiconfiguration/imagemanager.cxx
index 3ec26805de71..6844b5cb6b43 100644
--- a/framework/source/uiconfiguration/imagemanager.cxx
+++ b/framework/source/uiconfiguration/imagemanager.cxx
@@ -35,6 +35,7 @@
#include <xml/imagesconfiguration.hxx>
#include <uiconfiguration/graphicnameaccess.hxx>
#include <services.h>
+#include "imagemanagerimpl.hxx"
#include "properties.h"
@@ -62,6 +63,7 @@
#include <unotools/ucbstreamhelper.hxx>
#include <vcl/pngread.hxx>
#include <vcl/pngwrite.hxx>
+#include <rtl/logfile.hxx>
//_________________________________________________________________________________________________________________
// namespaces
@@ -90,55 +92,14 @@ const sal_Int32 IMAGE_SIZE_LARGE = 26;
const sal_Int16 MAX_IMAGETYPE_VALUE = ::com::sun::star::ui::ImageType::COLOR_HIGHCONTRAST|
::com::sun::star::ui::ImageType::SIZE_LARGE;
-static const char IMAGE_FOLDER[] = "images";
-static const char BITMAPS_FOLDER[] = "Bitmaps";
-static const char IMAGE_EXTENSION[] = ".png";
-
-static const char* IMAGELIST_XML_FILE[] =
-{
- "sc_imagelist.xml",
- "lc_imagelist.xml",
- "sch_imagelist.xml",
- "lch_imagelist.xml"
-};
-
-static const char* BITMAP_FILE_NAMES[] =
-{
- "sc_userimages.png",
- "lc_userimages.png",
- "sch_userimages.png",
- "lch_userimages.png"
-};
-
namespace framework
{
-static char ModuleImageList[] = "private:resource/images/moduleimages";
-
typedef GraphicNameAccess CmdToXGraphicNameAccess;
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_6 ( ImageManager ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XComponent ),
- DIRECT_INTERFACE( css::lang::XInitialization ),
- DIRECT_INTERFACE( ::com::sun::star::ui::XImageManager ),
- DIRECT_INTERFACE( ::com::sun::star::ui::XUIConfiguration ),
- DIRECT_INTERFACE( ::com::sun::star::ui::XUIConfigurationPersistence )
- )
-
-DEFINE_XTYPEPROVIDER_6 ( ImageManager ,
- css::lang::XTypeProvider ,
- css::lang::XComponent ,
- css::lang::XInitialization ,
- ::com::sun::star::ui::XImageManager ,
- ::com::sun::star::ui::XUIConfiguration ,
- ::com::sun::star::ui::XUIConfigurationPersistence
- )
-
DEFINE_XSERVICEINFO_MULTISERVICE ( ImageManager ,
::cppu::OWeakObject ,
SERVICENAME_IMAGEMANAGER ,
@@ -147,471 +108,69 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( ImageManager
DEFINE_INIT_SERVICE ( ImageManager, {} )
-static sal_Bool implts_checkAndScaleGraphic( uno::Reference< XGraphic >& rOutGraphic, const uno::Reference< XGraphic >& rInGraphic, sal_Int16 nImageType )
-{
- static Size aNormSize( IMAGE_SIZE_NORMAL, IMAGE_SIZE_NORMAL );
- static Size aLargeSize( IMAGE_SIZE_LARGE, IMAGE_SIZE_LARGE );
-
- if ( !rInGraphic.is() )
- {
- rOutGraphic = Image().GetXGraphic();
- return sal_False;
- }
-
- // Check size and scale it
- Image aImage( rInGraphic );
- Size aSize = aImage.GetSizePixel();
- bool bMustScale( false );
-
- if (( nImageType == ImageType_Color_Large ) ||
- ( nImageType == ImageType_HC_Large ))
- bMustScale = ( aSize != aLargeSize );
- else
- bMustScale = ( aSize != aNormSize );
-
- if ( bMustScale )
- {
- BitmapEx aBitmap = aImage.GetBitmapEx();
- aBitmap.Scale( aNormSize );
- aImage = Image( aBitmap );
- rOutGraphic = aImage.GetXGraphic();
- }
- else
- rOutGraphic = rInGraphic;
- return sal_True;
-}
-
-static sal_Int16 implts_convertImageTypeToIndex( sal_Int16 nImageType )
-{
- sal_Int16 nIndex( 0 );
- if ( nImageType & ::com::sun::star::ui::ImageType::SIZE_LARGE )
- nIndex += 1;
- if ( nImageType & ::com::sun::star::ui::ImageType::COLOR_HIGHCONTRAST )
- nIndex += 2;
- return nIndex;
-}
-
-ImageList* ImageManager::implts_getUserImageList( ImageType nImageType )
-{
- ResetableGuard aGuard( m_aLock );
- if ( !m_pUserImageList[nImageType] )
- implts_loadUserImages( nImageType, m_xUserImageStorage, m_xUserBitmapsStorage );
-
- return m_pUserImageList[nImageType];
-}
-
-void ImageManager::implts_initialize()
-{
- // Initialize the top-level structures with the storage data
- if ( m_xUserConfigStorage.is() )
- {
- long nModes = m_bReadOnly ? ElementModes::READ : ElementModes::READWRITE;
-
- try
- {
- m_xUserImageStorage = m_xUserConfigStorage->openStorageElement( OUString::createFromAscii( IMAGE_FOLDER ),
- nModes );
- if ( m_xUserImageStorage.is() )
- {
- m_xUserBitmapsStorage = m_xUserImageStorage->openStorageElement( OUString::createFromAscii( BITMAPS_FOLDER ),
- nModes );
- }
- }
- catch ( com::sun::star::container::NoSuchElementException& )
- {
- }
- catch ( ::com::sun::star::embed::InvalidStorageException& )
- {
- }
- catch ( ::com::sun::star::lang::IllegalArgumentException& )
- {
- }
- catch ( ::com::sun::star::io::IOException& )
- {
- }
- catch ( ::com::sun::star::embed::StorageWrappedTargetException& )
- {
- }
- }
-}
-
-sal_Bool ImageManager::implts_loadUserImages(
- ImageType nImageType,
- const uno::Reference< XStorage >& xUserImageStorage,
- const uno::Reference< XStorage >& xUserBitmapsStorage )
-{
- ResetableGuard aGuard( m_aLock );
-
- if ( xUserImageStorage.is() && xUserBitmapsStorage.is() )
- {
- try
- {
- uno::Reference< XStream > xStream = xUserImageStorage->openStreamElement( rtl::OUString::createFromAscii( IMAGELIST_XML_FILE[nImageType] ),
- ElementModes::READ );
- uno::Reference< XInputStream > xInputStream = xStream->getInputStream();
-
- ImageListsDescriptor aUserImageListInfo;
- ImagesConfiguration::LoadImages( m_xServiceManager,
- xInputStream,
- aUserImageListInfo );
- if (( aUserImageListInfo.pImageList != 0 ) &&
- ( aUserImageListInfo.pImageList->Count() > 0 ))
- {
- ImageListItemDescriptor* pList = aUserImageListInfo.pImageList->GetObject(0);
- sal_Int32 nCount = pList->pImageItemList->Count();
-
- std::vector< OUString > aUserImagesVector;
- for ( USHORT i=0; i < nCount; i++ )
- {
- const ImageItemDescriptor* pItem = pList->pImageItemList->GetObject(i);
- aUserImagesVector.push_back( pItem->aCommandURL );
- }
-
- uno::Reference< XStream > xBitmapStream = xUserBitmapsStorage->openStreamElement(
- rtl::OUString::createFromAscii( BITMAP_FILE_NAMES[nImageType] ),
- ElementModes::READ );
-
- if ( xBitmapStream.is() )
- {
- SvStream* pSvStream( 0 );
- BitmapEx aUserBitmap;
- {
- pSvStream = utl::UcbStreamHelper::CreateStream( xBitmapStream );
- vcl::PNGReader aPngReader( *pSvStream );
- aUserBitmap = aPngReader.Read();
- }
- delete pSvStream;
-
- // Delete old image list and create a new one from the read bitmap
- delete m_pUserImageList[nImageType];
- m_pUserImageList[nImageType] = new ImageList();
- m_pUserImageList[nImageType]->InsertFromHorizontalStrip
- ( aUserBitmap, aUserImagesVector );
- return sal_True;
- }
- }
- }
- catch ( com::sun::star::container::NoSuchElementException& )
- {
- }
- catch ( ::com::sun::star::embed::InvalidStorageException& )
- {
- }
- catch ( ::com::sun::star::lang::IllegalArgumentException& )
- {
- }
- catch ( ::com::sun::star::io::IOException& )
- {
- }
- catch ( ::com::sun::star::embed::StorageWrappedTargetException& )
- {
- }
- }
-
- // Destroy old image list - create a new empty one
- delete m_pUserImageList[nImageType];
- m_pUserImageList[nImageType] = new ImageList;
-
- return sal_True;
-}
-
-sal_Bool ImageManager::implts_storeUserImages(
- ImageType nImageType,
- const uno::Reference< XStorage >& xUserImageStorage,
- const uno::Reference< XStorage >& xUserBitmapsStorage )
-{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bModified )
- {
- ImageList* pImageList = implts_getUserImageList( nImageType );
- if ( pImageList->GetImageCount() > 0 )
- {
- ImageListsDescriptor aUserImageListInfo;
- aUserImageListInfo.pImageList = new ImageListDescriptor;
-
- ImageListItemDescriptor* pList = new ImageListItemDescriptor;
- aUserImageListInfo.pImageList->Insert( pList, 0 );
-
- pList->pImageItemList = new ImageItemListDescriptor;
- for ( USHORT i=0; i < pImageList->GetImageCount(); i++ )
- {
- ImageItemDescriptor* pItem = new ::framework::ImageItemDescriptor;
-
- pItem->nIndex = i;
- pItem->aCommandURL = pImageList->GetImageName( i );
- pList->pImageItemList->Insert( pItem, pList->pImageItemList->Count() );
- }
-
- pList->aURL = String::CreateFromAscii("Bitmaps/");
- pList->aURL += String::CreateFromAscii( BITMAP_FILE_NAMES[nImageType] );
-
- uno::Reference< XTransactedObject > xTransaction;
- uno::Reference< XOutputStream > xOutputStream;
- uno::Reference< XStream > xStream = xUserImageStorage->openStreamElement( rtl::OUString::createFromAscii( IMAGELIST_XML_FILE[nImageType] ),
- ElementModes::WRITE|ElementModes::TRUNCATE );
- if ( xStream.is() )
- {
- uno::Reference< XStream > xBitmapStream =
- xUserBitmapsStorage->openStreamElement( rtl::OUString::createFromAscii( BITMAP_FILE_NAMES[nImageType] ),
- ElementModes::WRITE|ElementModes::TRUNCATE );
- if ( xBitmapStream.is() )
- {
- SvStream* pSvStream = utl::UcbStreamHelper::CreateStream( xBitmapStream );
- {
- vcl::PNGWriter aPngWriter( pImageList->GetAsHorizontalStrip() );
- aPngWriter.Write( *pSvStream );
- }
- delete pSvStream;
-
- // Commit user bitmaps storage
- xTransaction = uno::Reference< XTransactedObject >( xUserBitmapsStorage, UNO_QUERY );
- if ( xTransaction.is() )
- xTransaction->commit();
- }
-
- xOutputStream = xStream->getOutputStream();
- if ( xOutputStream.is() )
- ImagesConfiguration::StoreImages( m_xServiceManager, xOutputStream, aUserImageListInfo );
-
- // Commit user image storage
- xTransaction = uno::Reference< XTransactedObject >( xUserImageStorage, UNO_QUERY );
- if ( xTransaction.is() )
- xTransaction->commit();
- }
-
- return sal_True;
- }
- else
- {
- // Remove the streams from the storage, if we have no data. We have to catch
- // the NoSuchElementException as it can be possible that there is no stream at all!
- try
- {
- xUserImageStorage->removeElement( rtl::OUString::createFromAscii( IMAGELIST_XML_FILE[nImageType] ));
- }
- catch ( ::com::sun::star::container::NoSuchElementException& )
- {
- }
-
- try
- {
- xUserBitmapsStorage->removeElement( rtl::OUString::createFromAscii( BITMAP_FILE_NAMES[nImageType] ));
- }
- catch ( ::com::sun::star::container::NoSuchElementException& )
- {
- }
-
- uno::Reference< XTransactedObject > xTransaction;
-
- // Commit user image storage
- xTransaction = uno::Reference< XTransactedObject >( xUserImageStorage, UNO_QUERY );
- if ( xTransaction.is() )
- xTransaction->commit();
-
- // Commit user bitmaps storage
- xTransaction = uno::Reference< XTransactedObject >( xUserBitmapsStorage, UNO_QUERY );
- if ( xTransaction.is() )
- xTransaction->commit();
-
- return sal_True;
- }
- }
-
- return sal_False;
-}
-
ImageManager::ImageManager( uno::Reference< XMultiServiceFactory > xServiceManager ) :
ThreadHelpBase( &Application::GetSolarMutex() )
- , m_xUserConfigStorage( 0 )
- , m_xUserImageStorage( 0 )
- , m_xUserBitmapsStorage( 0 )
- , m_bReadOnly( true )
- , m_bInitialized( false )
- , m_bModified( false )
- , m_bConfigRead( false )
- , m_bDisposed( false )
- , m_aXMLPostfix( RTL_CONSTASCII_USTRINGPARAM( ".xml" ))
- , m_aResourceString( RTL_CONSTASCII_USTRINGPARAM( ModuleImageList ))
- , m_xServiceManager( xServiceManager )
- , m_aListenerContainer( m_aLock.getShareableOslMutex() )
+ , m_pImpl( new ImageManagerImpl(xServiceManager,static_cast< OWeakObject* >(this),false) )
{
- for ( sal_Int32 n=0; n < ImageType_COUNT; n++ )
- {
- m_pUserImageList[n] = 0;
- m_bUserImageListModified[n] = false;
- }
}
ImageManager::~ImageManager()
{
- ResetableGuard aGuard( m_aLock );
- for ( sal_Int32 n = 0; n < ImageType_COUNT; n++ )
- {
- delete m_pUserImageList[n];
- m_pUserImageList[n] = 0;
- }
+ m_pImpl->clear();
}
// XComponent
void SAL_CALL ImageManager::dispose() throw (::com::sun::star::uno::RuntimeException)
{
- uno::Reference< XComponent > xThis( static_cast< OWeakObject* >(this), UNO_QUERY );
-
- css::lang::EventObject aEvent( xThis );
- m_aListenerContainer.disposeAndClear( aEvent );
-
- {
- ResetableGuard aGuard( m_aLock );
- m_xUserConfigStorage.clear();
- m_xUserImageStorage.clear();
- m_bConfigRead = false;
- m_bModified = false;
- m_bDisposed = true;
- }
+ m_pImpl->dispose();
}
void SAL_CALL ImageManager::addEventListener( const uno::Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
- {
- ResetableGuard aGuard( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
- }
-
- m_aListenerContainer.addInterface( ::getCppuType( ( const uno::Reference< XEventListener >* ) NULL ), xListener );
+ m_pImpl->addEventListener(xListener);
}
void SAL_CALL ImageManager::removeEventListener( const uno::Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
- m_aListenerContainer.removeInterface( ::getCppuType( ( const uno::Reference< XEventListener >* ) NULL ), xListener );
+ m_pImpl->removeEventListener(xListener);
}
// Non-UNO methods
void ImageManager::setStorage( const uno::Reference< XStorage >& Storage )
throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aLock( m_aLock );
+ ResetableGuard aLock( m_pImpl->m_aLock );
- m_xUserConfigStorage = Storage;
- implts_initialize();
+ m_pImpl->m_xUserConfigStorage = Storage;
+ m_pImpl->implts_initialize();
}
// XInitialization
void SAL_CALL ImageManager::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
{
- ResetableGuard aLock( m_aLock );
-
- if ( !m_bInitialized )
- {
- for ( sal_Int32 n = 0; n < aArguments.getLength(); n++ )
- {
- PropertyValue aPropValue;
- if ( aArguments[n] >>= aPropValue )
- {
- if ( aPropValue.Name.equalsAscii( "UserConfigStorage" ))
- {
- aPropValue.Value >>= m_xUserConfigStorage;
- }
- else if ( aPropValue.Name.equalsAscii( "ModuleIdentifier" ))
- {
- aPropValue.Value >>= m_aModuleIdentifier;
- }
- }
- }
-
- if ( m_xUserConfigStorage.is() )
- {
- uno::Reference< XPropertySet > xPropSet( m_xUserConfigStorage, UNO_QUERY );
- if ( xPropSet.is() )
- {
- long nOpenMode = 0;
- Any a = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenMode" )));
- if ( a >>= nOpenMode )
- m_bReadOnly = !( nOpenMode & ElementModes::WRITE );
- }
- }
-
- implts_initialize();
-
- m_bInitialized = true;
- }
+ m_pImpl->initialize(aArguments);
}
// XImageManager
void SAL_CALL ImageManager::reset()
throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aLock( m_aLock );
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
-
- std::vector< OUString > aUserImageNames;
-
- for ( sal_Int32 i = 0; i < ImageType_COUNT; i++ )
- {
- aUserImageNames.clear();
- ImageList* pImageList = implts_getUserImageList( ImageType(i));
- pImageList->GetImageNames( aUserImageNames );
-
- Sequence< rtl::OUString > aRemoveList( aUserImageNames.size() );
- for ( sal_uInt32 j = 0; j < aUserImageNames.size(); j++ )
- aRemoveList[j] = aUserImageNames[j];
-
- // Remove images
- removeImages( sal_Int16( i ), aRemoveList );
- m_bUserImageListModified[i] = true;
- }
-
- m_bModified = sal_True;
+ m_pImpl->reset();
}
Sequence< ::rtl::OUString > SAL_CALL ImageManager::getAllImageNames( ::sal_Int16 nImageType )
throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aLock( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
-
- sal_uInt32 i( 0 );
- sal_Int16 nIndex = implts_convertImageTypeToIndex( nImageType );
- ImageList* pImageList = implts_getUserImageList( ImageType( nIndex ));
-
- std::vector< OUString > aUserImageNames;
- pImageList->GetImageNames( aUserImageNames );
-
- Sequence< OUString > aImageNameSeq( aUserImageNames.size() );
- for ( i = 0; i < aUserImageNames.size(); i++ )
- aImageNameSeq[i] = aUserImageNames[i];
-
- return aImageNameSeq;
+ return m_pImpl->getAllImageNames( nImageType );
}
::sal_Bool SAL_CALL ImageManager::hasImage( ::sal_Int16 nImageType, const ::rtl::OUString& aCommandURL )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aLock( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
-
- if (( nImageType < 0 ) || ( nImageType > MAX_IMAGETYPE_VALUE ))
- throw IllegalArgumentException();
-
- sal_Int16 nIndex = implts_convertImageTypeToIndex( nImageType );
- ImageList* pImageList = implts_getUserImageList( ImageType( nIndex ));
- if ( pImageList )
- return ( pImageList->GetImagePos( aCommandURL ) != IMAGELIST_IMAGE_NOTFOUND );
-
- return sal_False;
+ return m_pImpl->hasImage(nImageType,aCommandURL);
}
Sequence< uno::Reference< XGraphic > > SAL_CALL ImageManager::getImages(
@@ -619,28 +178,7 @@ Sequence< uno::Reference< XGraphic > > SAL_CALL ImageManager::getImages(
const Sequence< ::rtl::OUString >& aCommandURLSequence )
throw ( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException )
{
- ResetableGuard aLock( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
-
- if (( nImageType < 0 ) || ( nImageType > MAX_IMAGETYPE_VALUE ))
- throw IllegalArgumentException();
-
- Sequence< uno::Reference< XGraphic > > aGraphSeq( aCommandURLSequence.getLength() );
-
- const rtl::OUString* aStrArray = aCommandURLSequence.getConstArray();
- sal_Int16 nIndex = implts_convertImageTypeToIndex( nImageType );
- ImageList* pUserImageList = implts_getUserImageList( ImageType( nIndex ));
-
- for ( sal_Int32 n = 0; n < aCommandURLSequence.getLength(); n++ )
- {
- Image aImage = pUserImageList->GetImage( aStrArray[n] );
- aGraphSeq[n] = aImage.GetXGraphic();
- }
-
- return aGraphSeq;
+ return m_pImpl->getImages(nImageType,aCommandURLSequence);
}
void SAL_CALL ImageManager::replaceImages(
@@ -651,84 +189,7 @@ throw ( ::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::lang::IllegalAccessException,
::com::sun::star::uno::RuntimeException)
{
- CmdToXGraphicNameAccess* pInsertedImages( 0 );
- CmdToXGraphicNameAccess* pReplacedImages( 0 );
-
- {
- ResetableGuard aLock( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
-
- if (( aCommandURLSequence.getLength() != aGraphicsSequence.getLength() ) ||
- (( nImageType < 0 ) || ( nImageType > MAX_IMAGETYPE_VALUE )))
- throw IllegalArgumentException();
-
- if ( m_bReadOnly )
- throw IllegalAccessException();
-
- sal_Int16 nIndex = implts_convertImageTypeToIndex( nImageType );
- ImageList* pImageList = implts_getUserImageList( ImageType( nIndex ));
-
- uno::Reference< XGraphic > xGraphic;
- for ( sal_Int32 i = 0; i < aCommandURLSequence.getLength(); i++ )
- {
- // Check size and scale. If we don't have any graphics ignore it
- if ( !implts_checkAndScaleGraphic( xGraphic, aGraphicsSequence[i], nIndex ))
- continue;
-
- USHORT nPos = pImageList->GetImagePos( aCommandURLSequence[i] );
- if ( nPos == IMAGELIST_IMAGE_NOTFOUND )
- {
- pImageList->AddImage( aCommandURLSequence[i], xGraphic );
- if ( !pInsertedImages )
- pInsertedImages = new CmdToXGraphicNameAccess();
- pInsertedImages->addElement( aCommandURLSequence[i], xGraphic );
- }
- else
- {
- pImageList->ReplaceImage( aCommandURLSequence[i], xGraphic );
- if ( !pReplacedImages )
- pReplacedImages = new CmdToXGraphicNameAccess();
- pReplacedImages->addElement( aCommandURLSequence[i], xGraphic );
- }
- }
-
- if (( pInsertedImages != 0 ) || ( pReplacedImages != 0 ))
- {
- m_bModified = sal_True;
- m_bUserImageListModified[nIndex] = true;
- }
- }
-
- // Notify listeners
- uno::Reference< XImageManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- uno::Reference< XInterface > xIfac( xThis, UNO_QUERY );
-
- if ( pInsertedImages != 0 )
- {
- ConfigurationEvent aInsertEvent;
- aInsertEvent.aInfo = uno::makeAny( nImageType );
- aInsertEvent.Accessor = uno::makeAny( xThis );
- aInsertEvent.Source = xIfac;
- aInsertEvent.ResourceURL = m_aResourceString;
- aInsertEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
- static_cast< OWeakObject *>( pInsertedImages ), UNO_QUERY ));
- implts_notifyContainerListener( aInsertEvent, NotifyOp_Insert );
- }
- if ( pReplacedImages != 0 )
- {
- ConfigurationEvent aReplaceEvent;
- aReplaceEvent.aInfo = uno::makeAny( nImageType );
- aReplaceEvent.Accessor = uno::makeAny( xThis );
- aReplaceEvent.Source = xIfac;
- aReplaceEvent.ResourceURL = m_aResourceString;
- aReplaceEvent.ReplacedElement = Any();
- aReplaceEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
- static_cast< OWeakObject *>( pReplacedImages ), UNO_QUERY ));
- implts_notifyContainerListener( aReplaceEvent, NotifyOp_Replace );
- }
+ m_pImpl->replaceImages(nImageType,aCommandURLSequence,aGraphicsSequence);
}
void SAL_CALL ImageManager::removeImages( ::sal_Int16 nImageType, const Sequence< ::rtl::OUString >& aCommandURLSequence )
@@ -736,62 +197,7 @@ throw ( ::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::lang::IllegalAccessException,
::com::sun::star::uno::RuntimeException)
{
- CmdToXGraphicNameAccess* pRemovedImages( 0 );
-
- {
- ResetableGuard aLock( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
-
- if (( nImageType < 0 ) || ( nImageType > MAX_IMAGETYPE_VALUE ))
- throw IllegalArgumentException();
-
- if ( m_bReadOnly )
- throw IllegalAccessException();
-
- sal_Int16 nIndex = implts_convertImageTypeToIndex( nImageType );
- ImageList* pImageList = implts_getUserImageList( ImageType( nIndex ));
- uno::Reference< XGraphic > xEmptyGraphic( Image().GetXGraphic() );
-
- for ( sal_Int32 i = 0; i < aCommandURLSequence.getLength(); i++ )
- {
- USHORT nPos = pImageList->GetImagePos( aCommandURLSequence[i] );
- if ( nPos != IMAGELIST_IMAGE_NOTFOUND )
- {
- Image aImage = pImageList->GetImage( nPos );
- USHORT nId = pImageList->GetImageId( nPos );
- pImageList->RemoveImage( nId );
-
- if ( !pRemovedImages )
- pRemovedImages = new CmdToXGraphicNameAccess();
- pRemovedImages->addElement( aCommandURLSequence[i], xEmptyGraphic );
- }
- }
-
- if ( pRemovedImages != 0 )
- {
- m_bModified = sal_True;
- m_bUserImageListModified[nIndex] = true;
- }
- }
-
- // Notify listeners
- uno::Reference< XImageManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- uno::Reference< XInterface > xIfac( xThis, UNO_QUERY );
-
- if ( pRemovedImages != 0 )
- {
- ConfigurationEvent aRemoveEvent;
- aRemoveEvent.aInfo = uno::makeAny( nImageType );
- aRemoveEvent.Accessor = uno::makeAny( xThis );
- aRemoveEvent.Source = xIfac;
- aRemoveEvent.ResourceURL = m_aResourceString;
- aRemoveEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
- static_cast< OWeakObject *>( pRemovedImages ), UNO_QUERY ));
- implts_notifyContainerListener( aRemoveEvent, NotifyOp_Remove );
- }
+ m_pImpl->removeImages(nImageType,aCommandURLSequence);
}
void SAL_CALL ImageManager::insertImages( ::sal_Int16 nImageType, const Sequence< ::rtl::OUString >& aCommandURLSequence, const Sequence< uno::Reference< XGraphic > >& aGraphicSequence )
@@ -800,105 +206,21 @@ throw ( ::com::sun::star::container::ElementExistException,
::com::sun::star::lang::IllegalAccessException,
::com::sun::star::uno::RuntimeException)
{
- CmdToXGraphicNameAccess* pInsertedImages( 0 );
- CmdToXGraphicNameAccess* pReplacedImages( 0 );
-
- {
- ResetableGuard aLock( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
-
- if (( aCommandURLSequence.getLength() != aGraphicSequence.getLength() ) ||
- (( nImageType < 0 ) || ( nImageType > MAX_IMAGETYPE_VALUE )))
- throw IllegalArgumentException();
-
- if ( m_bReadOnly )
- throw IllegalAccessException();
-
- sal_Int16 nIndex = implts_convertImageTypeToIndex( nImageType );
- ImageList* pImageList = implts_getUserImageList( ImageType( nIndex ));
-
- uno::Reference< XGraphic > xGraphic;
- for ( sal_Int32 i = 0; i < aCommandURLSequence.getLength(); i++ )
- {
- if ( !implts_checkAndScaleGraphic( xGraphic, aGraphicSequence[i], nIndex ))
- continue;
-
- USHORT nPos = pImageList->GetImagePos( aCommandURLSequence[i] );
- if ( nPos == IMAGELIST_IMAGE_NOTFOUND )
- {
- pImageList->AddImage( aCommandURLSequence[i], xGraphic );
- if ( !pInsertedImages )
- pInsertedImages = new CmdToXGraphicNameAccess();
- pInsertedImages->addElement( aCommandURLSequence[i], xGraphic );
- }
- else
- {
- pImageList->ReplaceImage( aCommandURLSequence[i], xGraphic );
- if ( !pReplacedImages )
- pReplacedImages = new CmdToXGraphicNameAccess();
- pReplacedImages->addElement( aCommandURLSequence[i], xGraphic );
- }
- }
-
- if (( pInsertedImages != 0 ) || ( pReplacedImages != 0 ))
- {
- m_bModified = sal_True;
- m_bUserImageListModified[nIndex] = true;
- }
- }
-
- // Notify listeners
- uno::Reference< XImageManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- uno::Reference< XInterface > xIfac( xThis, UNO_QUERY );
-
- if ( pInsertedImages != 0 )
- {
- ConfigurationEvent aInsertEvent;
- aInsertEvent.aInfo = uno::makeAny( nImageType );
- aInsertEvent.Accessor = uno::makeAny( xThis );
- aInsertEvent.Source = xIfac;
- aInsertEvent.ResourceURL = m_aResourceString;
- aInsertEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
- static_cast< OWeakObject *>( pInsertedImages ), UNO_QUERY ));
- implts_notifyContainerListener( aInsertEvent, NotifyOp_Insert );
- }
- if ( pReplacedImages != 0 )
- {
- ConfigurationEvent aReplaceEvent;
- aReplaceEvent.aInfo = uno::makeAny( nImageType );
- aReplaceEvent.Accessor = uno::makeAny( xThis );
- aReplaceEvent.Source = xIfac;
- aReplaceEvent.ResourceURL = m_aResourceString;
- aReplaceEvent.ReplacedElement = Any();
- aReplaceEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
- static_cast< OWeakObject *>( pReplacedImages ), UNO_QUERY ));
- implts_notifyContainerListener( aReplaceEvent, NotifyOp_Replace );
- }
+ m_pImpl->insertImages(nImageType,aCommandURLSequence,aGraphicSequence);
}
// XUIConfiguration
void SAL_CALL ImageManager::addConfigurationListener( const uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener )
throw (::com::sun::star::uno::RuntimeException)
{
- {
- ResetableGuard aGuard( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
- }
-
- m_aListenerContainer.addInterface( ::getCppuType( ( const uno::Reference< XUIConfigurationListener >* ) NULL ), xListener );
+ m_pImpl->addConfigurationListener(xListener);
}
void SAL_CALL ImageManager::removeConfigurationListener( const uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener )
throw (::com::sun::star::uno::RuntimeException)
{
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
- m_aListenerContainer.removeInterface( ::getCppuType( ( const uno::Reference< XUIConfigurationListener >* ) NULL ), xListener );
+ m_pImpl->removeConfigurationListener(xListener);
}
// XUIConfigurationPersistence
@@ -906,228 +228,30 @@ void SAL_CALL ImageManager::reload()
throw ( ::com::sun::star::uno::Exception,
::com::sun::star::uno::RuntimeException )
{
- ResetableGuard aGuard( m_aLock );
-
- uno::Reference< uno::XInterface > xRefThis( static_cast< OWeakObject* >( this ));
-
- if ( m_bDisposed )
- throw DisposedException();
-
- CommandMap aOldUserCmdImageSet;
- std::vector< rtl::OUString > aNewUserCmdImageSet;
-
- if ( m_bModified )
- {
- uno::Reference< XImageManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- uno::Reference< XInterface > xIfac( xThis, UNO_QUERY );
-
- for ( sal_Int16 i = 0; i < sal_Int16( ImageType_COUNT ); i++ )
- {
- if ( !m_bDisposed && m_bUserImageListModified[i] )
- {
- std::vector< rtl::OUString > aOldUserCmdImageVector;
- ImageList* pImageList = implts_getUserImageList( (ImageType)i );
- pImageList->GetImageNames( aOldUserCmdImageVector );
-
- // Fill hash map to speed up search afterwards
- sal_uInt32 j( 0 );
- for ( j = 0; j < aOldUserCmdImageVector.size(); j++ )
- aOldUserCmdImageSet.insert( CommandMap::value_type( aOldUserCmdImageVector[j], false ));
-
- // Attention: This can make the old image list pointer invalid!
- implts_loadUserImages( (ImageType)i, m_xUserImageStorage, m_xUserBitmapsStorage );
- pImageList = implts_getUserImageList( (ImageType)i );
- pImageList->GetImageNames( aNewUserCmdImageSet );
-
- CmdToXGraphicNameAccess* pInsertedImages( 0 );
- CmdToXGraphicNameAccess* pReplacedImages( 0 );
- CmdToXGraphicNameAccess* pRemovedImages( 0 );
-
- for ( j = 0; j < aNewUserCmdImageSet.size(); j++ )
- {
- CommandMap::iterator pIter = aOldUserCmdImageSet.find( aNewUserCmdImageSet[j] );
- if ( pIter != aOldUserCmdImageSet.end() )
- {
- pIter->second = true; // mark entry as replaced
- if ( !pReplacedImages )
- pReplacedImages = new CmdToXGraphicNameAccess();
- pReplacedImages->addElement( aNewUserCmdImageSet[j],
- pImageList->GetImage( aNewUserCmdImageSet[j] ).GetXGraphic() );
- }
- else
- {
- if ( !pInsertedImages )
- pInsertedImages = new CmdToXGraphicNameAccess();
- pInsertedImages->addElement( aNewUserCmdImageSet[j],
- pImageList->GetImage( aNewUserCmdImageSet[j] ).GetXGraphic() );
- }
- }
-
- // Search map for unmarked entries => they have been removed from the user list
- // through this reload operation.
- uno::Reference< XGraphic > xEmptyGraphic( Image().GetXGraphic() );
- CommandMap::const_iterator pIter = aOldUserCmdImageSet.begin();
- while ( pIter != aOldUserCmdImageSet.end() )
- {
- if ( !pIter->second )
- {
- // No image in the user image list => remove user image
- if ( !pRemovedImages )
- pRemovedImages = new CmdToXGraphicNameAccess();
- pRemovedImages->addElement( pIter->first, xEmptyGraphic );
- }
- ++pIter;
- }
-
- aGuard.unlock();
-
- // Now notify our listeners. Unlock mutex to prevent deadlocks
- if ( pInsertedImages != 0 )
- {
- ConfigurationEvent aInsertEvent;
- aInsertEvent.aInfo = uno::makeAny( i );
- aInsertEvent.Accessor = uno::makeAny( xThis );
- aInsertEvent.Source = xIfac;
- aInsertEvent.ResourceURL = m_aResourceString;
- aInsertEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
- static_cast< OWeakObject *>( pInsertedImages ), UNO_QUERY ));
- implts_notifyContainerListener( aInsertEvent, NotifyOp_Insert );
- }
- if ( pReplacedImages != 0 )
- {
- ConfigurationEvent aReplaceEvent;
- aReplaceEvent.aInfo = uno::makeAny( i );
- aReplaceEvent.Accessor = uno::makeAny( xThis );
- aReplaceEvent.Source = xIfac;
- aReplaceEvent.ResourceURL = m_aResourceString;
- aReplaceEvent.ReplacedElement = Any();
- aReplaceEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
- static_cast< OWeakObject *>( pReplacedImages ), UNO_QUERY ));
- implts_notifyContainerListener( aReplaceEvent, NotifyOp_Replace );
- }
- if ( pRemovedImages != 0 )
- {
- ConfigurationEvent aRemoveEvent;
- aRemoveEvent.aInfo = uno::makeAny( i );
- aRemoveEvent.Accessor = uno::makeAny( xThis );
- aRemoveEvent.Source = xIfac;
- aRemoveEvent.ResourceURL = m_aResourceString;
- aRemoveEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
- static_cast< OWeakObject *>( pRemovedImages ), UNO_QUERY ));
- implts_notifyContainerListener( aRemoveEvent, NotifyOp_Remove );
- }
-
- aGuard.lock();
- }
- }
- }
+ m_pImpl->reload();
}
void SAL_CALL ImageManager::store()
throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_bModified )
- {
- sal_Bool bWritten( sal_False );
- for ( sal_Int32 i = 0; i < ImageType_COUNT; i++ )
- {
- sal_Bool bSuccess = implts_storeUserImages( ImageType(i), m_xUserImageStorage, m_xUserBitmapsStorage );
- if ( bSuccess )
- bWritten = sal_True;
- m_bUserImageListModified[i] = false;
- }
-
- if ( bWritten &&
- m_xUserConfigStorage.is())
- {
- uno::Reference< XTransactedObject > xUserConfigStorageCommit( m_xUserConfigStorage, UNO_QUERY );
- if ( xUserConfigStorageCommit.is() )
- xUserConfigStorageCommit->commit();
- }
-
- m_bModified = sal_False;
- }
+ m_pImpl->store();
}
void SAL_CALL ImageManager::storeToStorage( const uno::Reference< XStorage >& Storage )
throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_bModified && Storage.is() )
- {
- long nModes = ElementModes::READWRITE;
-
- uno::Reference< XStorage > xUserImageStorage = Storage->openStorageElement( OUString::createFromAscii( IMAGE_FOLDER ),
- nModes );
- if ( xUserImageStorage.is() )
- {
- uno::Reference< XStorage > xUserBitmapsStorage = xUserImageStorage->openStorageElement( OUString::createFromAscii( BITMAPS_FOLDER ),
- nModes );
- for ( sal_Int32 i = 0; i < ImageType_COUNT; i++ )
- {
- implts_getUserImageList( (ImageType)i );
- implts_storeUserImages( (ImageType)i, xUserImageStorage, xUserBitmapsStorage );
- }
-
- uno::Reference< XTransactedObject > xTransaction( Storage, UNO_QUERY );
- if ( xTransaction.is() )
- xTransaction->commit();
- }
- }
+ m_pImpl->storeToStorage(Storage);
}
sal_Bool SAL_CALL ImageManager::isModified()
throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
- return m_bModified;
+ return m_pImpl->isModified();
}
sal_Bool SAL_CALL ImageManager::isReadOnly() throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
- return m_bReadOnly;
-}
-
-void ImageManager::implts_notifyContainerListener( const ConfigurationEvent& aEvent, NotifyOp eOp )
-{
- ::cppu::OInterfaceContainerHelper* pContainer = m_aListenerContainer.getContainer(
- ::getCppuType( ( const css::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >*) NULL ) );
- if ( pContainer != NULL )
- {
- ::cppu::OInterfaceIteratorHelper pIterator( *pContainer );
- while ( pIterator.hasMoreElements() )
- {
- try
- {
- switch ( eOp )
- {
- case NotifyOp_Replace:
- ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementReplaced( aEvent );
- break;
- case NotifyOp_Insert:
- ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementInserted( aEvent );
- break;
- case NotifyOp_Remove:
- ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementRemoved( aEvent );
- break;
- }
- }
- catch( css::uno::RuntimeException& )
- {
- pIterator.remove();
- }
- }
- }
+ return m_pImpl->isReadOnly();
}
} // namespace framework
diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx
new file mode 100755
index 000000000000..d46711048b11
--- /dev/null
+++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx
@@ -0,0 +1,1466 @@
+/*************************************************************************
+ *
+ * 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: ImageManagerImpl.cxx,v $
+ * $Revision: 1.16.82.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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_framework.hxx"
+#include <imagemanagerimpl.hxx>
+#include <threadhelp/resetableguard.hxx>
+#include <xml/imagesconfiguration.hxx>
+#include <uiconfiguration/graphicnameaccess.hxx>
+#include <services.h>
+
+#include "properties.h"
+
+//_________________________________________________________________________________________________________________
+// interface includes
+//_________________________________________________________________________________________________________________
+#include <com/sun/star/ui/UIElementType.hpp>
+#include <com/sun/star/ui/ConfigurationEvent.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/io/XStream.hpp>
+#include <com/sun/star/ui/ImageType.hpp>
+
+//_________________________________________________________________________________________________________________
+// other includes
+//_________________________________________________________________________________________________________________
+
+#include <vcl/svapp.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <osl/mutex.hxx>
+#include <comphelper/sequence.hxx>
+#include <tools/urlobj.hxx>
+#include <unotools/ucbstreamhelper.hxx>
+#include <vcl/pngread.hxx>
+#include <vcl/pngwrite.hxx>
+#include <rtl/logfile.hxx>
+#include "svtools/miscopt.hxx"
+
+//_________________________________________________________________________________________________________________
+// namespaces
+//_________________________________________________________________________________________________________________
+
+using ::rtl::OUString;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::XInterface;
+using ::com::sun::star::uno::Exception;
+using ::com::sun::star::uno::RuntimeException;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::Any;
+using ::com::sun::star::uno::makeAny;
+using ::com::sun::star::graphic::XGraphic;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::embed;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::ui;
+using namespace ::cppu;
+
+// Image sizes for our toolbars/menus
+const sal_Int32 IMAGE_SIZE_NORMAL = 16;
+const sal_Int32 IMAGE_SIZE_LARGE = 26;
+const sal_Int16 MAX_IMAGETYPE_VALUE = ::com::sun::star::ui::ImageType::COLOR_HIGHCONTRAST|
+ ::com::sun::star::ui::ImageType::SIZE_LARGE;
+
+static const char IMAGE_FOLDER[] = "images";
+static const char BITMAPS_FOLDER[] = "Bitmaps";
+static const char IMAGE_EXTENSION[] = ".png";
+
+static const char* IMAGELIST_XML_FILE[] =
+{
+ "sc_imagelist.xml",
+ "lc_imagelist.xml",
+ "sch_imagelist.xml",
+ "lch_imagelist.xml"
+};
+
+static const char* BITMAP_FILE_NAMES[] =
+{
+ "sc_userimages.png",
+ "lc_userimages.png",
+ "sch_userimages.png",
+ "lch_userimages.png"
+};
+
+namespace framework
+{
+ static char ModuleImageList[] = "private:resource/images/moduleimages";
+ static osl::Mutex* pImageListWrapperMutex = 0;
+ static GlobalImageList* pGlobalImageList = 0;
+ static const char* ImageType_Prefixes[ImageType_COUNT] =
+ {
+ "res/commandimagelist/sc_",
+ "res/commandimagelist/lc_",
+ "res/commandimagelist/sch_",
+ "res/commandimagelist/lch_"
+ };
+
+typedef GraphicNameAccess CmdToXGraphicNameAccess;
+
+static osl::Mutex& getGlobalImageListMutex()
+{
+ if ( pImageListWrapperMutex == 0 )
+ {
+ osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ;
+ if ( pImageListWrapperMutex == 0 )
+ pImageListWrapperMutex = new osl::Mutex;
+ }
+
+ return *pImageListWrapperMutex;
+}
+
+static GlobalImageList* getGlobalImageList( const uno::Reference< XMultiServiceFactory >& rServiceManager )
+{
+ osl::MutexGuard guard( getGlobalImageListMutex() );
+
+ if ( pGlobalImageList == 0 )
+ pGlobalImageList = new GlobalImageList( rServiceManager );
+
+ return pGlobalImageList;
+}
+
+static rtl::OUString getCanonicalName( const rtl::OUString& rFileName )
+{
+ bool bRemoveSlash( true );
+ sal_Int32 nLength = rFileName.getLength();
+ const sal_Unicode* pString = rFileName.getStr();
+
+ rtl::OUStringBuffer aBuf( nLength );
+ for ( sal_Int32 i = 0; i < nLength; i++ )
+ {
+ const sal_Unicode c = pString[i];
+ switch ( c )
+ {
+ // map forbidden characters to escape
+ case '/' : if ( !bRemoveSlash )
+ aBuf.appendAscii( "%2f" );
+ break;
+ case '\\': aBuf.appendAscii( "%5c" ); bRemoveSlash = false; break;
+ case ':' : aBuf.appendAscii( "%3a" ); bRemoveSlash = false; break;
+ case '*' : aBuf.appendAscii( "%2a" ); bRemoveSlash = false; break;
+ case '?' : aBuf.appendAscii( "%3f" ); bRemoveSlash = false; break;
+ case '<' : aBuf.appendAscii( "%3c" ); bRemoveSlash = false; break;
+ case '>' : aBuf.appendAscii( "%3e" ); bRemoveSlash = false; break;
+ case '|' : aBuf.appendAscii( "%7c" ); bRemoveSlash = false; break;
+ default: aBuf.append( c ); bRemoveSlash = false;
+ }
+ }
+ return aBuf.makeStringAndClear();
+}
+
+//_________________________________________________________________________________________________________________
+
+CmdImageList::CmdImageList( const uno::Reference< XMultiServiceFactory >& rServiceManager, const rtl::OUString& aModuleIdentifier ) :
+ m_bVectorInit( sal_False ),
+ m_aModuleIdentifier( aModuleIdentifier ),
+ m_xServiceManager( rServiceManager ),
+ m_nSymbolsStyle( SvtMiscOptions().GetCurrentSymbolsStyle() )
+{
+ for ( sal_Int32 n=0; n < ImageType_COUNT; n++ )
+ m_pImageList[n] = 0;
+}
+
+CmdImageList::~CmdImageList()
+{
+ for ( sal_Int32 n=0; n < ImageType_COUNT; n++ )
+ delete m_pImageList[n];
+}
+
+void CmdImageList::impl_fillCommandToImageNameMap()
+{
+ RTL_LOGFILE_CONTEXT( aLog, "framework: CmdImageList::impl_fillCommandToImageNameMap" );
+
+ if ( !m_bVectorInit )
+ {
+ const rtl::OUString aCommandImageList( RTL_CONSTASCII_USTRINGPARAM( UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDIMAGELIST ));
+ Sequence< OUString > aCmdImageSeq;
+ uno::Reference< XNameAccess > xCmdDesc( m_xServiceManager->createInstance(
+ SERVICENAME_UICOMMANDDESCRIPTION ),
+ UNO_QUERY );
+
+ if ( m_aModuleIdentifier.getLength() > 0 )
+ {
+ // If we have a module identifier - use to retrieve the command image name list from it.
+ // Otherwise we will use the global command image list
+ try
+ {
+ xCmdDesc->getByName( m_aModuleIdentifier ) >>= xCmdDesc;
+ if ( xCmdDesc.is() )
+ xCmdDesc->getByName( aCommandImageList ) >>= aCmdImageSeq;
+ }
+ catch ( NoSuchElementException& )
+ {
+ // Module unknown we will work with an empty command image list!
+ return;
+ }
+ }
+
+ if ( xCmdDesc.is() )
+ {
+ try
+ {
+ xCmdDesc->getByName( aCommandImageList ) >>= aCmdImageSeq;
+ }
+ catch ( NoSuchElementException& )
+ {
+ }
+ catch ( WrappedTargetException& )
+ {
+ }
+ }
+
+ // We have to map commands which uses special characters like '/',':','?','\','<'.'>','|'
+ String aExt = String::CreateFromAscii( IMAGE_EXTENSION );
+ m_aImageCommandNameVector.resize(aCmdImageSeq.getLength() );
+ m_aImageNameVector.resize( aCmdImageSeq.getLength() );
+
+ ::std::copy( aCmdImageSeq.getConstArray(),
+ aCmdImageSeq.getConstArray()+aCmdImageSeq.getLength(),
+ m_aImageCommandNameVector.begin() );
+
+ // Create a image name vector that must be provided to the vcl imagelist. We also need
+ // a command to image name map to speed up access time for image retrieval.
+ OUString aUNOString( RTL_CONSTASCII_USTRINGPARAM( ".uno:" ));
+ String aEmptyString;
+ const sal_uInt32 nCount = m_aImageCommandNameVector.size();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
+ {
+ OUString aCommandName( m_aImageCommandNameVector[i] );
+ String aImageName;
+
+ if ( aCommandName.indexOf( aUNOString ) != 0 )
+ {
+ INetURLObject aUrlObject( aCommandName, INetURLObject::ENCODE_ALL );
+ aImageName = aUrlObject.GetURLPath();
+ aImageName = getCanonicalName( aImageName ); // convert to valid filename
+ }
+ else
+ {
+ // just remove the schema
+ if ( aCommandName.getLength() > 5 )
+ aImageName = aCommandName.copy( 5 );
+ else
+ aImageName = aEmptyString;
+
+ // Search for query part.
+ sal_Int32 nIndex = aImageName.Search( '?' );
+ if ( nIndex != STRING_NOTFOUND )
+ aImageName = getCanonicalName( aImageName ); // convert to valid filename
+ }
+ // Image names are not case-dependent. Always use lower case characters to
+ // reflect this.
+ aImageName += aExt;
+ aImageName.ToLowerAscii();
+
+ m_aImageNameVector[i] = aImageName;
+ m_aCommandToImageNameMap.insert( CommandToImageNameMap::value_type( aCommandName, aImageName ));
+ }
+
+ m_bVectorInit = sal_True;
+ }
+}
+
+ImageList* CmdImageList::impl_getImageList( sal_Int16 nImageType )
+{
+ SvtMiscOptions aMiscOptions;
+
+ sal_Int16 nSymbolsStyle = aMiscOptions.GetCurrentSymbolsStyle();
+ if ( nSymbolsStyle != m_nSymbolsStyle )
+ {
+ m_nSymbolsStyle = nSymbolsStyle;
+ for ( sal_Int32 n=0; n < ImageType_COUNT; n++ )
+ delete m_pImageList[n], m_pImageList[n] = NULL;
+ }
+
+ if ( !m_pImageList[nImageType] )
+ {
+ m_pImageList[nImageType] = new ImageList( m_aImageNameVector,
+ OUString::createFromAscii( ImageType_Prefixes[nImageType] ) );
+ }
+
+ return m_pImageList[nImageType];
+}
+
+std::vector< ::rtl::OUString >& CmdImageList::impl_getImageNameVector()
+{
+ return m_aImageNameVector;
+}
+
+std::vector< rtl::OUString >& CmdImageList::impl_getImageCommandNameVector()
+{
+ return m_aImageCommandNameVector;
+}
+
+Image CmdImageList::getImageFromCommandURL( sal_Int16 nImageType, const rtl::OUString& rCommandURL )
+{
+ impl_fillCommandToImageNameMap();
+ CommandToImageNameMap::const_iterator pIter = m_aCommandToImageNameMap.find( rCommandURL );
+ if ( pIter != m_aCommandToImageNameMap.end() )
+ {
+ ImageList* pImageList = impl_getImageList( nImageType );
+ return pImageList->GetImage( pIter->second );
+ }
+
+ return Image();
+}
+
+bool CmdImageList::hasImage( sal_Int16 /*nImageType*/, const rtl::OUString& rCommandURL )
+{
+ impl_fillCommandToImageNameMap();
+ CommandToImageNameMap::const_iterator pIter = m_aCommandToImageNameMap.find( rCommandURL );
+ if ( pIter != m_aCommandToImageNameMap.end() )
+ return true;
+ else
+ return false;
+}
+
+::std::vector< rtl::OUString >& CmdImageList::getImageNames()
+{
+ return impl_getImageNameVector();
+}
+
+::std::vector< rtl::OUString >& CmdImageList::getImageCommandNames()
+{
+ return impl_getImageCommandNameVector();
+}
+
+//_________________________________________________________________________________________________________________
+
+GlobalImageList::GlobalImageList( const uno::Reference< XMultiServiceFactory >& rServiceManager ) :
+ CmdImageList( rServiceManager, rtl::OUString() ),
+ m_nRefCount( 0 )
+{
+}
+
+GlobalImageList::~GlobalImageList()
+{
+}
+
+Image GlobalImageList::getImageFromCommandURL( sal_Int16 nImageType, const rtl::OUString& rCommandURL )
+{
+ osl::MutexGuard guard( getGlobalImageListMutex() );
+ return CmdImageList::getImageFromCommandURL( nImageType, rCommandURL );
+}
+
+bool GlobalImageList::hasImage( sal_Int16 nImageType, const rtl::OUString& rCommandURL )
+{
+ osl::MutexGuard guard( getGlobalImageListMutex() );
+ return CmdImageList::hasImage( nImageType, rCommandURL );
+}
+
+::std::vector< rtl::OUString >& GlobalImageList::getImageNames()
+{
+ osl::MutexGuard guard( getGlobalImageListMutex() );
+ return impl_getImageNameVector();
+}
+
+::std::vector< rtl::OUString >& GlobalImageList::getImageCommandNames()
+{
+ osl::MutexGuard guard( getGlobalImageListMutex() );
+ return impl_getImageCommandNameVector();
+}
+
+oslInterlockedCount GlobalImageList::acquire()
+{
+ osl_incrementInterlockedCount( &m_nRefCount );
+ return m_nRefCount;
+}
+
+oslInterlockedCount GlobalImageList::release()
+{
+ osl::MutexGuard guard( getGlobalImageListMutex() );
+
+ if ( !osl_decrementInterlockedCount( &m_nRefCount ))
+ {
+ oslInterlockedCount nCount( m_nRefCount );
+ // remove global pointer as we destroy the object now
+ pGlobalImageList = 0;
+ delete this;
+ return nCount;
+ }
+
+ return m_nRefCount;
+}
+
+static sal_Bool implts_checkAndScaleGraphic( uno::Reference< XGraphic >& rOutGraphic, const uno::Reference< XGraphic >& rInGraphic, sal_Int16 nImageType )
+{
+ static Size aNormSize( IMAGE_SIZE_NORMAL, IMAGE_SIZE_NORMAL );
+ static Size aLargeSize( IMAGE_SIZE_LARGE, IMAGE_SIZE_LARGE );
+
+ if ( !rInGraphic.is() )
+ {
+ rOutGraphic = Image().GetXGraphic();
+ return sal_False;
+ }
+
+ // Check size and scale it
+ Image aImage( rInGraphic );
+ Size aSize = aImage.GetSizePixel();
+ bool bMustScale( false );
+
+ if (( nImageType == ImageType_Color_Large ) ||
+ ( nImageType == ImageType_HC_Large ))
+ bMustScale = ( aSize != aLargeSize );
+ else
+ bMustScale = ( aSize != aNormSize );
+
+ if ( bMustScale )
+ {
+ BitmapEx aBitmap = aImage.GetBitmapEx();
+ aBitmap.Scale( aNormSize );
+ aImage = Image( aBitmap );
+ rOutGraphic = aImage.GetXGraphic();
+ }
+ else
+ rOutGraphic = rInGraphic;
+ return sal_True;
+}
+
+static sal_Int16 implts_convertImageTypeToIndex( sal_Int16 nImageType )
+{
+ sal_Int16 nIndex( 0 );
+ if ( nImageType & ::com::sun::star::ui::ImageType::SIZE_LARGE )
+ nIndex += 1;
+ if ( nImageType & ::com::sun::star::ui::ImageType::COLOR_HIGHCONTRAST )
+ nIndex += 2;
+ return nIndex;
+}
+
+ImageList* ImageManagerImpl::implts_getUserImageList( ImageType nImageType )
+{
+ ResetableGuard aGuard( m_aLock );
+ if ( !m_pUserImageList[nImageType] )
+ implts_loadUserImages( nImageType, m_xUserImageStorage, m_xUserBitmapsStorage );
+
+ return m_pUserImageList[nImageType];
+}
+
+void ImageManagerImpl::implts_initialize()
+{
+ // Initialize the top-level structures with the storage data
+ if ( m_xUserConfigStorage.is() )
+ {
+ long nModes = m_bReadOnly ? ElementModes::READ : ElementModes::READWRITE;
+
+ try
+ {
+ m_xUserImageStorage = m_xUserConfigStorage->openStorageElement( OUString::createFromAscii( IMAGE_FOLDER ),
+ nModes );
+ if ( m_xUserImageStorage.is() )
+ {
+ m_xUserBitmapsStorage = m_xUserImageStorage->openStorageElement( OUString::createFromAscii( BITMAPS_FOLDER ),
+ nModes );
+ }
+ }
+ catch ( com::sun::star::container::NoSuchElementException& )
+ {
+ }
+ catch ( ::com::sun::star::embed::InvalidStorageException& )
+ {
+ }
+ catch ( ::com::sun::star::lang::IllegalArgumentException& )
+ {
+ }
+ catch ( ::com::sun::star::io::IOException& )
+ {
+ }
+ catch ( ::com::sun::star::embed::StorageWrappedTargetException& )
+ {
+ }
+ }
+}
+
+sal_Bool ImageManagerImpl::implts_loadUserImages(
+ ImageType nImageType,
+ const uno::Reference< XStorage >& xUserImageStorage,
+ const uno::Reference< XStorage >& xUserBitmapsStorage )
+{
+ ResetableGuard aGuard( m_aLock );
+
+ if ( xUserImageStorage.is() && xUserBitmapsStorage.is() )
+ {
+ try
+ {
+ uno::Reference< XStream > xStream = xUserImageStorage->openStreamElement( rtl::OUString::createFromAscii( IMAGELIST_XML_FILE[nImageType] ),
+ ElementModes::READ );
+ uno::Reference< XInputStream > xInputStream = xStream->getInputStream();
+
+ ImageListsDescriptor aUserImageListInfo;
+ ImagesConfiguration::LoadImages( m_xServiceManager,
+ xInputStream,
+ aUserImageListInfo );
+ if (( aUserImageListInfo.pImageList != 0 ) &&
+ ( aUserImageListInfo.pImageList->Count() > 0 ))
+ {
+ ImageListItemDescriptor* pList = aUserImageListInfo.pImageList->GetObject(0);
+ sal_Int32 nCount = pList->pImageItemList->Count();
+ std::vector< OUString > aUserImagesVector;
+ aUserImagesVector.reserve(nCount);
+ for ( USHORT i=0; i < nCount; i++ )
+ {
+ const ImageItemDescriptor* pItem = pList->pImageItemList->GetObject(i);
+ aUserImagesVector.push_back( pItem->aCommandURL );
+ }
+
+ uno::Reference< XStream > xBitmapStream = xUserBitmapsStorage->openStreamElement(
+ rtl::OUString::createFromAscii( BITMAP_FILE_NAMES[nImageType] ),
+ ElementModes::READ );
+
+ if ( xBitmapStream.is() )
+ {
+ SvStream* pSvStream( 0 );
+ BitmapEx aUserBitmap;
+ {
+ pSvStream = utl::UcbStreamHelper::CreateStream( xBitmapStream );
+ vcl::PNGReader aPngReader( *pSvStream );
+ aUserBitmap = aPngReader.Read();
+ }
+ delete pSvStream;
+
+ // Delete old image list and create a new one from the read bitmap
+ delete m_pUserImageList[nImageType];
+ m_pUserImageList[nImageType] = new ImageList();
+ m_pUserImageList[nImageType]->InsertFromHorizontalStrip
+ ( aUserBitmap, aUserImagesVector );
+ return sal_True;
+ }
+ }
+ }
+ catch ( com::sun::star::container::NoSuchElementException& )
+ {
+ }
+ catch ( ::com::sun::star::embed::InvalidStorageException& )
+ {
+ }
+ catch ( ::com::sun::star::lang::IllegalArgumentException& )
+ {
+ }
+ catch ( ::com::sun::star::io::IOException& )
+ {
+ }
+ catch ( ::com::sun::star::embed::StorageWrappedTargetException& )
+ {
+ }
+ }
+
+ // Destroy old image list - create a new empty one
+ delete m_pUserImageList[nImageType];
+ m_pUserImageList[nImageType] = new ImageList;
+
+ return sal_True;
+}
+
+sal_Bool ImageManagerImpl::implts_storeUserImages(
+ ImageType nImageType,
+ const uno::Reference< XStorage >& xUserImageStorage,
+ const uno::Reference< XStorage >& xUserBitmapsStorage )
+{
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bModified )
+ {
+ ImageList* pImageList = implts_getUserImageList( nImageType );
+ if ( pImageList->GetImageCount() > 0 )
+ {
+ ImageListsDescriptor aUserImageListInfo;
+ aUserImageListInfo.pImageList = new ImageListDescriptor;
+
+ ImageListItemDescriptor* pList = new ImageListItemDescriptor;
+ aUserImageListInfo.pImageList->Insert( pList, 0 );
+
+ pList->pImageItemList = new ImageItemListDescriptor;
+ for ( USHORT i=0; i < pImageList->GetImageCount(); i++ )
+ {
+ ImageItemDescriptor* pItem = new ::framework::ImageItemDescriptor;
+
+ pItem->nIndex = i;
+ pItem->aCommandURL = pImageList->GetImageName( i );
+ pList->pImageItemList->Insert( pItem, pList->pImageItemList->Count() );
+ }
+
+ pList->aURL = String::CreateFromAscii("Bitmaps/");
+ pList->aURL += String::CreateFromAscii( BITMAP_FILE_NAMES[nImageType] );
+
+ uno::Reference< XTransactedObject > xTransaction;
+ uno::Reference< XOutputStream > xOutputStream;
+ uno::Reference< XStream > xStream = xUserImageStorage->openStreamElement( rtl::OUString::createFromAscii( IMAGELIST_XML_FILE[nImageType] ),
+ ElementModes::WRITE|ElementModes::TRUNCATE );
+ if ( xStream.is() )
+ {
+ uno::Reference< XStream > xBitmapStream =
+ xUserBitmapsStorage->openStreamElement( rtl::OUString::createFromAscii( BITMAP_FILE_NAMES[nImageType] ),
+ ElementModes::WRITE|ElementModes::TRUNCATE );
+ if ( xBitmapStream.is() )
+ {
+ SvStream* pSvStream = utl::UcbStreamHelper::CreateStream( xBitmapStream );
+ {
+ vcl::PNGWriter aPngWriter( pImageList->GetAsHorizontalStrip() );
+ aPngWriter.Write( *pSvStream );
+ }
+ delete pSvStream;
+
+ // Commit user bitmaps storage
+ xTransaction = uno::Reference< XTransactedObject >( xUserBitmapsStorage, UNO_QUERY );
+ if ( xTransaction.is() )
+ xTransaction->commit();
+ }
+
+ xOutputStream = xStream->getOutputStream();
+ if ( xOutputStream.is() )
+ ImagesConfiguration::StoreImages( m_xServiceManager, xOutputStream, aUserImageListInfo );
+
+ // Commit user image storage
+ xTransaction = uno::Reference< XTransactedObject >( xUserImageStorage, UNO_QUERY );
+ if ( xTransaction.is() )
+ xTransaction->commit();
+ }
+
+ return sal_True;
+ }
+ else
+ {
+ // Remove the streams from the storage, if we have no data. We have to catch
+ // the NoSuchElementException as it can be possible that there is no stream at all!
+ try
+ {
+ xUserImageStorage->removeElement( rtl::OUString::createFromAscii( IMAGELIST_XML_FILE[nImageType] ));
+ }
+ catch ( ::com::sun::star::container::NoSuchElementException& )
+ {
+ }
+
+ try
+ {
+ xUserBitmapsStorage->removeElement( rtl::OUString::createFromAscii( BITMAP_FILE_NAMES[nImageType] ));
+ }
+ catch ( ::com::sun::star::container::NoSuchElementException& )
+ {
+ }
+
+ uno::Reference< XTransactedObject > xTransaction;
+
+ // Commit user image storage
+ xTransaction = uno::Reference< XTransactedObject >( xUserImageStorage, UNO_QUERY );
+ if ( xTransaction.is() )
+ xTransaction->commit();
+
+ // Commit user bitmaps storage
+ xTransaction = uno::Reference< XTransactedObject >( xUserBitmapsStorage, UNO_QUERY );
+ if ( xTransaction.is() )
+ xTransaction->commit();
+
+ return sal_True;
+ }
+ }
+
+ return sal_False;
+}
+const rtl::Reference< GlobalImageList >& ImageManagerImpl::implts_getGlobalImageList()
+{
+ ResetableGuard aGuard( m_aLock );
+
+ if ( !m_pGlobalImageList.is() )
+ m_pGlobalImageList = getGlobalImageList( m_xServiceManager );
+ return m_pGlobalImageList;
+}
+
+CmdImageList* ImageManagerImpl::implts_getDefaultImageList()
+{
+ ResetableGuard aGuard( m_aLock );
+
+ if ( !m_pDefaultImageList )
+ m_pDefaultImageList = new CmdImageList( m_xServiceManager, m_aModuleIdentifier );
+
+ return m_pDefaultImageList;
+}
+
+ImageManagerImpl::ImageManagerImpl( const uno::Reference< XMultiServiceFactory >& xServiceManager,const uno::Reference< XInterface >& _xOwner,bool _bUseGlobal ) :
+ ThreadHelpBase( &Application::GetSolarMutex() )
+ , m_xServiceManager( xServiceManager )
+ , m_xOwner(_xOwner)
+ , m_pDefaultImageList( 0 )
+ , m_aXMLPostfix( RTL_CONSTASCII_USTRINGPARAM( ".xml" ))
+ , m_aResourceString( RTL_CONSTASCII_USTRINGPARAM( ModuleImageList ))
+ , m_aListenerContainer( m_aLock.getShareableOslMutex() )
+ , m_bUseGlobal(_bUseGlobal)
+ , m_bReadOnly( true )
+ , m_bInitialized( false )
+ , m_bModified( false )
+ , m_bConfigRead( false )
+ , m_bDisposed( false )
+{
+ for ( sal_Int32 n=0; n < ImageType_COUNT; n++ )
+ {
+ m_pUserImageList[n] = 0;
+ m_bUserImageListModified[n] = false;
+ }
+}
+
+ImageManagerImpl::~ImageManagerImpl()
+{
+ clear();
+}
+
+void ImageManagerImpl::dispose()
+{
+ css::lang::EventObject aEvent( m_xOwner );
+ m_aListenerContainer.disposeAndClear( aEvent );
+
+ {
+ ResetableGuard aGuard( m_aLock );
+ m_xUserConfigStorage.clear();
+ m_xUserImageStorage.clear();
+ m_xUserRootCommit.clear();
+ m_bConfigRead = false;
+ m_bModified = false;
+ m_bDisposed = true;
+
+ // delete user and default image list on dispose
+ for ( sal_Int32 n=0; n < ImageType_COUNT; n++ )
+ {
+ delete m_pUserImageList[n];
+ m_pUserImageList[n] = 0;
+ }
+ delete m_pDefaultImageList;
+ m_pDefaultImageList = 0;
+ }
+
+}
+void ImageManagerImpl::addEventListener( const uno::Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
+{
+ {
+ ResetableGuard aGuard( m_aLock );
+
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ if ( m_bDisposed )
+ throw DisposedException();
+ }
+
+ m_aListenerContainer.addInterface( ::getCppuType( ( const uno::Reference< XEventListener >* ) NULL ), xListener );
+}
+
+void ImageManagerImpl::removeEventListener( const uno::Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
+{
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ m_aListenerContainer.removeInterface( ::getCppuType( ( const uno::Reference< XEventListener >* ) NULL ), xListener );
+}
+
+// XInitialization
+void ImageManagerImpl::initialize( const Sequence< Any >& aArguments )
+{
+ ResetableGuard aLock( m_aLock );
+
+ if ( !m_bInitialized )
+ {
+ for ( sal_Int32 n = 0; n < aArguments.getLength(); n++ )
+ {
+ PropertyValue aPropValue;
+ if ( aArguments[n] >>= aPropValue )
+ {
+ if ( aPropValue.Name.equalsAscii( "UserConfigStorage" ))
+ {
+ aPropValue.Value >>= m_xUserConfigStorage;
+ }
+ else if ( aPropValue.Name.equalsAscii( "ModuleIdentifier" ))
+ {
+ aPropValue.Value >>= m_aModuleIdentifier;
+ }
+ else if ( aPropValue.Name.equalsAscii( "UserRootCommit" ))
+ {
+ aPropValue.Value >>= m_xUserRootCommit;
+ }
+ }
+ }
+
+ if ( m_xUserConfigStorage.is() )
+ {
+ uno::Reference< XPropertySet > xPropSet( m_xUserConfigStorage, UNO_QUERY );
+ if ( xPropSet.is() )
+ {
+ long nOpenMode = 0;
+ if ( xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenMode" ))) >>= nOpenMode )
+ m_bReadOnly = !( nOpenMode & ElementModes::WRITE );
+ }
+ }
+
+ implts_initialize();
+
+ m_bInitialized = true;
+ }
+}
+
+// XImageManagerImpl
+void ImageManagerImpl::reset()
+throw (::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aLock( m_aLock );
+
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ std::vector< OUString > aUserImageNames;
+
+ for ( sal_Int32 i = 0; i < ImageType_COUNT; i++ )
+ {
+ aUserImageNames.clear();
+ ImageList* pImageList = implts_getUserImageList( ImageType(i));
+ pImageList->GetImageNames( aUserImageNames );
+
+ Sequence< rtl::OUString > aRemoveList( aUserImageNames.size() );
+ const sal_uInt32 nCount = aUserImageNames.size();
+ for ( sal_uInt32 j = 0; j < nCount; j++ )
+ aRemoveList[j] = aUserImageNames[j];
+
+ // Remove images
+ removeImages( sal_Int16( i ), aRemoveList );
+ m_bUserImageListModified[i] = true;
+ }
+
+ m_bModified = sal_True;
+}
+
+Sequence< ::rtl::OUString > ImageManagerImpl::getAllImageNames( ::sal_Int16 nImageType )
+throw (::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aLock( m_aLock );
+
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ ImageNameMap aImageCmdNameMap;
+
+ sal_Int16 nIndex = implts_convertImageTypeToIndex( nImageType );
+
+ sal_uInt32 i( 0 );
+ if ( m_bUseGlobal )
+ {
+ rtl::Reference< GlobalImageList > rGlobalImageList = implts_getGlobalImageList();
+
+ const std::vector< OUString >& rGlobalImageNameVector = rGlobalImageList->getImageCommandNames();
+ const sal_uInt32 nGlobalCount = rGlobalImageNameVector.size();
+ for ( i = 0; i < nGlobalCount; i++ )
+ aImageCmdNameMap.insert( ImageNameMap::value_type( rGlobalImageNameVector[i], sal_True ));
+
+ const std::vector< OUString >& rModuleImageNameVector = implts_getDefaultImageList()->getImageCommandNames();
+ const sal_uInt32 nModuleCount = rModuleImageNameVector.size();
+ for ( i = 0; i < nModuleCount; i++ )
+ aImageCmdNameMap.insert( ImageNameMap::value_type( rModuleImageNameVector[i], sal_True ));
+ }
+
+ ImageList* pImageList = implts_getUserImageList( ImageType( nIndex ));
+ std::vector< OUString > rUserImageNames;
+ pImageList->GetImageNames( rUserImageNames );
+ const sal_uInt32 nUserCount = rUserImageNames.size();
+ for ( i = 0; i < nUserCount; i++ )
+ aImageCmdNameMap.insert( ImageNameMap::value_type( rUserImageNames[i], sal_True ));
+
+ Sequence< OUString > aImageNameSeq( aImageCmdNameMap.size() );
+ ImageNameMap::const_iterator pIter;
+ i = 0;
+ for ( pIter = aImageCmdNameMap.begin(); pIter != aImageCmdNameMap.end(); pIter++ )
+ aImageNameSeq[i++] = pIter->first;
+
+ return aImageNameSeq;
+}
+
+::sal_Bool ImageManagerImpl::hasImage( ::sal_Int16 nImageType, const ::rtl::OUString& aCommandURL )
+throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aLock( m_aLock );
+
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ if (( nImageType < 0 ) || ( nImageType > MAX_IMAGETYPE_VALUE ))
+ throw IllegalArgumentException();
+
+ sal_Int16 nIndex = implts_convertImageTypeToIndex( nImageType );
+ if ( m_bUseGlobal && implts_getGlobalImageList()->hasImage( nIndex, aCommandURL ))
+ return sal_True;
+ else
+ {
+ if ( m_bUseGlobal && implts_getDefaultImageList()->hasImage( nIndex, aCommandURL ))
+ return sal_True;
+ else
+ {
+ // User layer
+ ImageList* pImageList = implts_getUserImageList( ImageType( nIndex ));
+ if ( pImageList )
+ return ( pImageList->GetImagePos( aCommandURL ) != IMAGELIST_IMAGE_NOTFOUND );
+ }
+ }
+
+ return sal_False;
+}
+
+Sequence< uno::Reference< XGraphic > > ImageManagerImpl::getImages(
+ ::sal_Int16 nImageType,
+ const Sequence< ::rtl::OUString >& aCommandURLSequence )
+throw ( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException )
+{
+ ResetableGuard aLock( m_aLock );
+
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ if (( nImageType < 0 ) || ( nImageType > MAX_IMAGETYPE_VALUE ))
+ throw IllegalArgumentException();
+
+ Sequence< uno::Reference< XGraphic > > aGraphSeq( aCommandURLSequence.getLength() );
+
+ const rtl::OUString* aStrArray = aCommandURLSequence.getConstArray();
+
+ sal_Int16 nIndex = implts_convertImageTypeToIndex( nImageType );
+ rtl::Reference< GlobalImageList > rGlobalImageList;
+ CmdImageList* pDefaultImageList = NULL;
+ if ( m_bUseGlobal )
+ {
+ rGlobalImageList = implts_getGlobalImageList();
+ pDefaultImageList = implts_getDefaultImageList();
+ }
+ ImageList* pUserImageList = implts_getUserImageList( ImageType( nIndex ));
+
+ // We have to search our image list in the following order:
+ // 1. user image list (read/write)
+ // 2. module image list (read)
+ // 3. global image list (read)
+ for ( sal_Int32 n = 0; n < aCommandURLSequence.getLength(); n++ )
+ {
+ Image aImage = pUserImageList->GetImage( aStrArray[n] );
+ if ( !aImage && m_bUseGlobal )
+ {
+ aImage = pDefaultImageList->getImageFromCommandURL( nIndex, aStrArray[n] );
+ if ( !aImage )
+ aImage = rGlobalImageList->getImageFromCommandURL( nIndex, aStrArray[n] );
+ }
+
+ aGraphSeq[n] = aImage.GetXGraphic();
+ }
+
+ return aGraphSeq;
+}
+
+void ImageManagerImpl::replaceImages(
+ ::sal_Int16 nImageType,
+ const Sequence< ::rtl::OUString >& aCommandURLSequence,
+ const Sequence< uno::Reference< XGraphic > >& aGraphicsSequence )
+throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::IllegalAccessException,
+ ::com::sun::star::uno::RuntimeException)
+{
+ CmdToXGraphicNameAccess* pInsertedImages( 0 );
+ CmdToXGraphicNameAccess* pReplacedImages( 0 );
+
+ {
+ ResetableGuard aLock( m_aLock );
+
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ if (( aCommandURLSequence.getLength() != aGraphicsSequence.getLength() ) ||
+ (( nImageType < 0 ) || ( nImageType > MAX_IMAGETYPE_VALUE )))
+ throw IllegalArgumentException();
+
+ if ( m_bReadOnly )
+ throw IllegalAccessException();
+
+ sal_Int16 nIndex = implts_convertImageTypeToIndex( nImageType );
+ ImageList* pImageList = implts_getUserImageList( ImageType( nIndex ));
+
+ uno::Reference< XGraphic > xGraphic;
+ for ( sal_Int32 i = 0; i < aCommandURLSequence.getLength(); i++ )
+ {
+ // Check size and scale. If we don't have any graphics ignore it
+ if ( !implts_checkAndScaleGraphic( xGraphic, aGraphicsSequence[i], nIndex ))
+ continue;
+
+ USHORT nPos = pImageList->GetImagePos( aCommandURLSequence[i] );
+ if ( nPos == IMAGELIST_IMAGE_NOTFOUND )
+ {
+ pImageList->AddImage( aCommandURLSequence[i], xGraphic );
+ if ( !pInsertedImages )
+ pInsertedImages = new CmdToXGraphicNameAccess();
+ pInsertedImages->addElement( aCommandURLSequence[i], xGraphic );
+ }
+ else
+ {
+ pImageList->ReplaceImage( aCommandURLSequence[i], xGraphic );
+ if ( !pReplacedImages )
+ pReplacedImages = new CmdToXGraphicNameAccess();
+ pReplacedImages->addElement( aCommandURLSequence[i], xGraphic );
+ }
+ }
+
+ if (( pInsertedImages != 0 ) || ( pReplacedImages != 0 ))
+ {
+ m_bModified = sal_True;
+ m_bUserImageListModified[nIndex] = true;
+ }
+ }
+
+ // Notify listeners
+ if ( pInsertedImages != 0 )
+ {
+ ConfigurationEvent aInsertEvent;
+ aInsertEvent.aInfo <<= nImageType;
+ aInsertEvent.Accessor <<= m_xOwner;
+ aInsertEvent.Source = m_xOwner;
+ aInsertEvent.ResourceURL = m_aResourceString;
+ aInsertEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
+ static_cast< OWeakObject *>( pInsertedImages ), UNO_QUERY ));
+ implts_notifyContainerListener( aInsertEvent, NotifyOp_Insert );
+ }
+ if ( pReplacedImages != 0 )
+ {
+ ConfigurationEvent aReplaceEvent;
+ aReplaceEvent.aInfo <<= nImageType;
+ aReplaceEvent.Accessor <<= m_xOwner;
+ aReplaceEvent.Source = m_xOwner;
+ aReplaceEvent.ResourceURL = m_aResourceString;
+ aReplaceEvent.ReplacedElement = Any();
+ aReplaceEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
+ static_cast< OWeakObject *>( pReplacedImages ), UNO_QUERY ));
+ implts_notifyContainerListener( aReplaceEvent, NotifyOp_Replace );
+ }
+}
+
+void ImageManagerImpl::removeImages( ::sal_Int16 nImageType, const Sequence< ::rtl::OUString >& aCommandURLSequence )
+throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::IllegalAccessException,
+ ::com::sun::star::uno::RuntimeException)
+{
+ CmdToXGraphicNameAccess* pRemovedImages( 0 );
+ CmdToXGraphicNameAccess* pReplacedImages( 0 );
+
+ {
+ ResetableGuard aLock( m_aLock );
+
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ if (( nImageType < 0 ) || ( nImageType > MAX_IMAGETYPE_VALUE ))
+ throw IllegalArgumentException();
+
+ if ( m_bReadOnly )
+ throw IllegalAccessException();
+
+ sal_Int16 nIndex = implts_convertImageTypeToIndex( nImageType );
+ rtl::Reference< GlobalImageList > rGlobalImageList;
+ CmdImageList* pDefaultImageList = NULL;
+ if ( m_bUseGlobal )
+ {
+ rGlobalImageList = implts_getGlobalImageList();
+ pDefaultImageList = implts_getDefaultImageList();
+ }
+ ImageList* pImageList = implts_getUserImageList( ImageType( nIndex ));
+ uno::Reference< XGraphic > xEmptyGraphic( Image().GetXGraphic() );
+
+ for ( sal_Int32 i = 0; i < aCommandURLSequence.getLength(); i++ )
+ {
+ USHORT nPos = pImageList->GetImagePos( aCommandURLSequence[i] );
+ if ( nPos != IMAGELIST_IMAGE_NOTFOUND )
+ {
+ Image aImage = pImageList->GetImage( nPos );
+ USHORT nId = pImageList->GetImageId( nPos );
+ pImageList->RemoveImage( nId );
+
+ if ( m_bUseGlobal )
+ {
+ // Check, if we have a image in our module/global image list. If we find one =>
+ // this is a replace instead of a remove operation!
+ Image aNewImage = pDefaultImageList->getImageFromCommandURL( nIndex, aCommandURLSequence[i] );
+ if ( !aNewImage )
+ aNewImage = rGlobalImageList->getImageFromCommandURL( nIndex, aCommandURLSequence[i] );
+ if ( !aNewImage )
+ {
+ if ( !pRemovedImages )
+ pRemovedImages = new CmdToXGraphicNameAccess();
+ pRemovedImages->addElement( aCommandURLSequence[i], xEmptyGraphic );
+ }
+ else
+ {
+ if ( !pReplacedImages )
+ pReplacedImages = new CmdToXGraphicNameAccess();
+ pReplacedImages->addElement( aCommandURLSequence[i], aNewImage.GetXGraphic() );
+ }
+ } // if ( m_bUseGlobal )
+ else
+ {
+ if ( !pRemovedImages )
+ pRemovedImages = new CmdToXGraphicNameAccess();
+ pRemovedImages->addElement( aCommandURLSequence[i], xEmptyGraphic );
+ }
+ }
+ }
+
+ if (( pReplacedImages != 0 ) || ( pRemovedImages != 0 ))
+ {
+ m_bModified = sal_True;
+ m_bUserImageListModified[nIndex] = true;
+ }
+ }
+
+ // Notify listeners
+ if ( pRemovedImages != 0 )
+ {
+ ConfigurationEvent aRemoveEvent;
+ aRemoveEvent.aInfo = uno::makeAny( nImageType );
+ aRemoveEvent.Accessor = uno::makeAny( m_xOwner );
+ aRemoveEvent.Source = m_xOwner;
+ aRemoveEvent.ResourceURL = m_aResourceString;
+ aRemoveEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
+ static_cast< OWeakObject *>( pRemovedImages ), UNO_QUERY ));
+ implts_notifyContainerListener( aRemoveEvent, NotifyOp_Remove );
+ }
+ if ( pReplacedImages != 0 )
+ {
+ ConfigurationEvent aReplaceEvent;
+ aReplaceEvent.aInfo = uno::makeAny( nImageType );
+ aReplaceEvent.Accessor = uno::makeAny( m_xOwner );
+ aReplaceEvent.Source = m_xOwner;
+ aReplaceEvent.ResourceURL = m_aResourceString;
+ aReplaceEvent.ReplacedElement = Any();
+ aReplaceEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
+ static_cast< OWeakObject *>( pReplacedImages ), UNO_QUERY ));
+ implts_notifyContainerListener( aReplaceEvent, NotifyOp_Replace );
+ }
+}
+
+void ImageManagerImpl::insertImages( ::sal_Int16 nImageType, const Sequence< ::rtl::OUString >& aCommandURLSequence, const Sequence< uno::Reference< XGraphic > >& aGraphicSequence )
+throw ( ::com::sun::star::container::ElementExistException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::IllegalAccessException,
+ ::com::sun::star::uno::RuntimeException)
+{
+ replaceImages(nImageType,aCommandURLSequence,aGraphicSequence);
+}
+
+
+// XUIConfigurationPersistence
+void ImageManagerImpl::reload()
+throw ( ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException )
+{
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ CommandMap aOldUserCmdImageSet;
+ std::vector< rtl::OUString > aNewUserCmdImageSet;
+
+ if ( m_bModified )
+ {
+ for ( sal_Int16 i = 0; i < sal_Int16( ImageType_COUNT ); i++ )
+ {
+ if ( !m_bDisposed && m_bUserImageListModified[i] )
+ {
+ std::vector< rtl::OUString > aOldUserCmdImageVector;
+ ImageList* pImageList = implts_getUserImageList( (ImageType)i );
+ pImageList->GetImageNames( aOldUserCmdImageVector );
+
+ // Fill hash map to speed up search afterwards
+ sal_uInt32 j( 0 );
+ const sal_uInt32 nOldCount = aOldUserCmdImageVector.size();
+ for ( j = 0; j < nOldCount; j++ )
+ aOldUserCmdImageSet.insert( CommandMap::value_type( aOldUserCmdImageVector[j], false ));
+
+ // Attention: This can make the old image list pointer invalid!
+ implts_loadUserImages( (ImageType)i, m_xUserImageStorage, m_xUserBitmapsStorage );
+ pImageList = implts_getUserImageList( (ImageType)i );
+ pImageList->GetImageNames( aNewUserCmdImageSet );
+
+ CmdToXGraphicNameAccess* pInsertedImages( 0 );
+ CmdToXGraphicNameAccess* pReplacedImages( 0 );
+ CmdToXGraphicNameAccess* pRemovedImages( 0 );
+
+ const sal_uInt32 nNewCount = aNewUserCmdImageSet.size();
+ for ( j = 0; j < nNewCount; j++ )
+ {
+ CommandMap::iterator pIter = aOldUserCmdImageSet.find( aNewUserCmdImageSet[j] );
+ if ( pIter != aOldUserCmdImageSet.end() )
+ {
+ pIter->second = true; // mark entry as replaced
+ if ( !pReplacedImages )
+ pReplacedImages = new CmdToXGraphicNameAccess();
+ pReplacedImages->addElement( aNewUserCmdImageSet[j],
+ pImageList->GetImage( aNewUserCmdImageSet[j] ).GetXGraphic() );
+ }
+ else
+ {
+ if ( !pInsertedImages )
+ pInsertedImages = new CmdToXGraphicNameAccess();
+ pInsertedImages->addElement( aNewUserCmdImageSet[j],
+ pImageList->GetImage( aNewUserCmdImageSet[j] ).GetXGraphic() );
+ }
+ }
+
+ // Search map for unmarked entries => they have been removed from the user list
+ // through this reload operation.
+ // We have to search the module and global image list!
+ rtl::Reference< GlobalImageList > rGlobalImageList;
+ CmdImageList* pDefaultImageList = NULL;
+ if ( m_bUseGlobal )
+ {
+ rGlobalImageList = implts_getGlobalImageList();
+ pDefaultImageList = implts_getDefaultImageList();
+ }
+ uno::Reference< XGraphic > xEmptyGraphic( Image().GetXGraphic() );
+ CommandMap::const_iterator pIter = aOldUserCmdImageSet.begin();
+ while ( pIter != aOldUserCmdImageSet.end() )
+ {
+ if ( !pIter->second )
+ {
+ if ( m_bUseGlobal )
+ {
+ Image aImage = pDefaultImageList->getImageFromCommandURL( i, pIter->first );
+ if ( !aImage )
+ aImage = rGlobalImageList->getImageFromCommandURL( i, pIter->first );
+
+ if ( !aImage )
+ {
+ // No image in the module/global image list => remove user image
+ if ( !pRemovedImages )
+ pRemovedImages = new CmdToXGraphicNameAccess();
+ pRemovedImages->addElement( pIter->first, xEmptyGraphic );
+ }
+ else
+ {
+ // Image has been found in the module/global image list => replace user image
+ if ( !pReplacedImages )
+ pReplacedImages = new CmdToXGraphicNameAccess();
+ pReplacedImages->addElement( pIter->first, aImage.GetXGraphic() );
+ }
+ } // if ( m_bUseGlobal )
+ else
+ {
+ // No image in the user image list => remove user image
+ if ( !pRemovedImages )
+ pRemovedImages = new CmdToXGraphicNameAccess();
+ pRemovedImages->addElement( pIter->first, xEmptyGraphic );
+ }
+ }
+ ++pIter;
+ }
+
+ aGuard.unlock();
+
+ // Now notify our listeners. Unlock mutex to prevent deadlocks
+ if ( pInsertedImages != 0 )
+ {
+ ConfigurationEvent aInsertEvent;
+ aInsertEvent.aInfo = uno::makeAny( i );
+ aInsertEvent.Accessor = uno::makeAny( m_xOwner );
+ aInsertEvent.Source = m_xOwner;
+ aInsertEvent.ResourceURL = m_aResourceString;
+ aInsertEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
+ static_cast< OWeakObject *>( pInsertedImages ), UNO_QUERY ));
+ implts_notifyContainerListener( aInsertEvent, NotifyOp_Insert );
+ }
+ if ( pReplacedImages != 0 )
+ {
+ ConfigurationEvent aReplaceEvent;
+ aReplaceEvent.aInfo = uno::makeAny( i );
+ aReplaceEvent.Accessor = uno::makeAny( m_xOwner );
+ aReplaceEvent.Source = m_xOwner;
+ aReplaceEvent.ResourceURL = m_aResourceString;
+ aReplaceEvent.ReplacedElement = Any();
+ aReplaceEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
+ static_cast< OWeakObject *>( pReplacedImages ), UNO_QUERY ));
+ implts_notifyContainerListener( aReplaceEvent, NotifyOp_Replace );
+ }
+ if ( pRemovedImages != 0 )
+ {
+ ConfigurationEvent aRemoveEvent;
+ aRemoveEvent.aInfo = uno::makeAny( i );
+ aRemoveEvent.Accessor = uno::makeAny( m_xOwner );
+ aRemoveEvent.Source = m_xOwner;
+ aRemoveEvent.ResourceURL = m_aResourceString;
+ aRemoveEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
+ static_cast< OWeakObject *>( pRemovedImages ), UNO_QUERY ));
+ implts_notifyContainerListener( aRemoveEvent, NotifyOp_Remove );
+ }
+
+ aGuard.lock();
+ }
+ }
+ }
+}
+
+void ImageManagerImpl::store()
+throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ if ( m_bModified )
+ {
+ sal_Bool bWritten( sal_False );
+ for ( sal_Int32 i = 0; i < ImageType_COUNT; i++ )
+ {
+ sal_Bool bSuccess = implts_storeUserImages( ImageType(i), m_xUserImageStorage, m_xUserBitmapsStorage );
+ if ( bSuccess )
+ bWritten = sal_True;
+ m_bUserImageListModified[i] = false;
+ }
+
+ if ( bWritten &&
+ m_xUserConfigStorage.is() )
+ {
+ uno::Reference< XTransactedObject > xUserConfigStorageCommit( m_xUserConfigStorage, UNO_QUERY );
+ if ( xUserConfigStorageCommit.is() )
+ xUserConfigStorageCommit->commit();
+ if ( m_xUserRootCommit.is() )
+ m_xUserRootCommit->commit();
+ }
+
+ m_bModified = sal_False;
+ }
+}
+
+void ImageManagerImpl::storeToStorage( const uno::Reference< XStorage >& Storage )
+throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ if ( m_bModified && Storage.is() )
+ {
+ long nModes = ElementModes::READWRITE;
+
+ uno::Reference< XStorage > xUserImageStorage = Storage->openStorageElement( OUString::createFromAscii( IMAGE_FOLDER ),
+ nModes );
+ if ( xUserImageStorage.is() )
+ {
+ uno::Reference< XStorage > xUserBitmapsStorage = xUserImageStorage->openStorageElement( OUString::createFromAscii( BITMAPS_FOLDER ),
+ nModes );
+ for ( sal_Int32 i = 0; i < ImageType_COUNT; i++ )
+ {
+ implts_getUserImageList( (ImageType)i );
+ implts_storeUserImages( (ImageType)i, xUserImageStorage, xUserBitmapsStorage );
+ }
+
+ uno::Reference< XTransactedObject > xTransaction( Storage, UNO_QUERY );
+ if ( xTransaction.is() )
+ xTransaction->commit();
+ }
+ }
+}
+
+sal_Bool ImageManagerImpl::isModified()
+throw (::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aGuard( m_aLock );
+ return m_bModified;
+}
+
+sal_Bool ImageManagerImpl::isReadOnly() throw (::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aGuard( m_aLock );
+ return m_bReadOnly;
+}
+// XUIConfiguration
+void ImageManagerImpl::addConfigurationListener( const uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener )
+throw (::com::sun::star::uno::RuntimeException)
+{
+ {
+ ResetableGuard aGuard( m_aLock );
+
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ if ( m_bDisposed )
+ throw DisposedException();
+ }
+
+ m_aListenerContainer.addInterface( ::getCppuType( ( const uno::Reference< XUIConfigurationListener >* ) NULL ), xListener );
+}
+
+void ImageManagerImpl::removeConfigurationListener( const uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener )
+throw (::com::sun::star::uno::RuntimeException)
+{
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ m_aListenerContainer.removeInterface( ::getCppuType( ( const uno::Reference< XUIConfigurationListener >* ) NULL ), xListener );
+}
+
+
+void ImageManagerImpl::implts_notifyContainerListener( const ConfigurationEvent& aEvent, NotifyOp eOp )
+{
+ ::cppu::OInterfaceContainerHelper* pContainer = m_aListenerContainer.getContainer(
+ ::getCppuType( ( const css::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >*) NULL ) );
+ if ( pContainer != NULL )
+ {
+ ::cppu::OInterfaceIteratorHelper pIterator( *pContainer );
+ while ( pIterator.hasMoreElements() )
+ {
+ try
+ {
+ switch ( eOp )
+ {
+ case NotifyOp_Replace:
+ ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementReplaced( aEvent );
+ break;
+ case NotifyOp_Insert:
+ ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementInserted( aEvent );
+ break;
+ case NotifyOp_Remove:
+ ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementRemoved( aEvent );
+ break;
+ }
+ }
+ catch( css::uno::RuntimeException& )
+ {
+ pIterator.remove();
+ }
+ }
+ }
+}
+void ImageManagerImpl::clear()
+{
+ ResetableGuard aGuard( m_aLock );
+ for ( sal_Int32 n = 0; n < ImageType_COUNT; n++ )
+ {
+ delete m_pUserImageList[n];
+ m_pUserImageList[n] = 0;
+ }
+}
+} // namespace framework
diff --git a/framework/source/uiconfiguration/imagemanagerimpl.hxx b/framework/source/uiconfiguration/imagemanagerimpl.hxx
new file mode 100755
index 000000000000..8eea59b9236c
--- /dev/null
+++ b/framework/source/uiconfiguration/imagemanagerimpl.hxx
@@ -0,0 +1,225 @@
+/*************************************************************************
+ *
+ * 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: imagemanager.hxx,v $
+ * $Revision: 1.7.82.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 __FRAMEWORK_UICONFIGURATION_IMAGEMANAGERIMPL_HXX_
+#define __FRAMEWORK_UICONFIGURATION_IMAGEMANAGERIMPL_HXX_
+
+
+/** Attention: stl headers must(!) be included at first. Otherwhise it can make trouble
+ with solaris headers ...
+*/
+#include <vector>
+#include <list>
+#include <hash_map>
+
+//_________________________________________________________________________________________________________________
+// 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>
+#include <uiconfiguration/imagetype.hxx>
+
+//_________________________________________________________________________________________________________________
+// interface includes
+//_________________________________________________________________________________________________________________
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
+#include <com/sun/star/ui/XUIConfigurationStorage.hpp>
+#include <com/sun/star/ui/XUIConfiguration.hpp>
+#include <com/sun/star/ui/XImageManager.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/ui/ConfigurationEvent.hpp>
+#include <com/sun/star/embed/XTransactedObject.hpp>
+#include <com/sun/star/ui/XImageManager.hpp>
+
+//_________________________________________________________________________________________________________________
+// other includes
+//_________________________________________________________________________________________________________________
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <rtl/ustring.hxx>
+
+#include <vcl/image.hxx>
+#include <tools/color.hxx>
+#include <rtl/ref.hxx>
+
+#include <vector>
+
+namespace framework
+{
+ class CmdImageList
+ {
+ public:
+ CmdImageList( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rServiceManager,
+ const ::rtl::OUString& aModuleIdentifier );
+ virtual ~CmdImageList();
+
+ virtual Image getImageFromCommandURL( sal_Int16 nImageType, const rtl::OUString& rCommandURL );
+ virtual bool hasImage( sal_Int16 nImageType, const rtl::OUString& rCommandURL );
+ virtual ::std::vector< rtl::OUString >& getImageNames();
+ virtual ::std::vector< rtl::OUString >& getImageCommandNames();
+
+ protected:
+ void impl_fillCommandToImageNameMap();
+ ImageList* impl_getImageList( sal_Int16 nImageType );
+ std::vector< ::rtl::OUString >& impl_getImageNameVector();
+ std::vector< ::rtl::OUString >& impl_getImageCommandNameVector();
+
+ private:
+ sal_Bool m_bVectorInit;
+ rtl::OUString m_aModuleIdentifier;
+ ImageList* m_pImageList[ImageType_COUNT];
+ CommandToImageNameMap m_aCommandToImageNameMap;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+ ::std::vector< rtl::OUString > m_aImageNameVector;
+ ::std::vector< rtl::OUString > m_aImageCommandNameVector;
+ sal_Int16 m_nSymbolsStyle;
+ };
+
+ class GlobalImageList : public CmdImageList, public rtl::IReference
+ {
+ public:
+ GlobalImageList( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
+ virtual ~GlobalImageList();
+
+ virtual Image getImageFromCommandURL( sal_Int16 nImageType, const rtl::OUString& rCommandURL );
+ virtual bool hasImage( sal_Int16 nImageType, const rtl::OUString& rCommandURL );
+ virtual ::std::vector< rtl::OUString >& getImageNames();
+ virtual ::std::vector< rtl::OUString >& getImageCommandNames();
+
+ // Reference
+ virtual oslInterlockedCount SAL_CALL acquire();
+ virtual oslInterlockedCount SAL_CALL release();
+
+ private:
+ oslInterlockedCount m_nRefCount;
+ };
+
+ class ImageManagerImpl : public ThreadHelpBase // Struct for right initalization of mutex member! Must be first of baseclasses.
+ {
+ public:
+
+ ImageManagerImpl(const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceManager
+ ,const com::sun::star::uno::Reference< com::sun::star::uno::XInterface >& _xOwner
+ ,bool _bUseGlobal);
+ ~ImageManagerImpl();
+
+ void dispose();
+ void initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments );
+ void addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ void removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XImageManager
+ void reset() throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > getAllImageNames( ::sal_Int16 nImageType ) throw (::com::sun::star::uno::RuntimeException);
+ ::sal_Bool hasImage( ::sal_Int16 nImageType, const ::rtl::OUString& aCommandURL ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > > getImages( ::sal_Int16 nImageType, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aCommandURLSequence ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ void replaceImages( ::sal_Int16 nImageType, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aCommandURLSequence, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > >& aGraphicsSequence ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IllegalAccessException, ::com::sun::star::uno::RuntimeException);
+ void removeImages( ::sal_Int16 nImageType, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aResourceURLSequence ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IllegalAccessException, ::com::sun::star::uno::RuntimeException);
+ void insertImages( ::sal_Int16 nImageType, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aCommandURLSequence, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > >& aGraphicSequence ) throw (::com::sun::star::container::ElementExistException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IllegalAccessException, ::com::sun::star::uno::RuntimeException);
+
+ // XUIConfiguration
+ void addConfigurationListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+ void removeConfigurationListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XUIConfigurationPersistence
+ void reload() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ void store() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ void storeToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& Storage ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ sal_Bool isModified() throw (::com::sun::star::uno::RuntimeException);
+ sal_Bool isReadOnly() throw (::com::sun::star::uno::RuntimeException);
+
+ void clear();
+
+ typedef std::hash_map< rtl::OUString,
+ sal_Bool,
+ OUStringHashCode,
+ ::std::equal_to< ::rtl::OUString > > ImageNameMap;
+
+ enum Layer
+ {
+ LAYER_DEFAULT,
+ LAYER_USERDEFINED,
+ LAYER_COUNT
+ };
+
+ enum NotifyOp
+ {
+ NotifyOp_Remove,
+ NotifyOp_Insert,
+ NotifyOp_Replace
+ };
+
+ typedef ::std::vector< ::com::sun::star::ui::ConfigurationEvent > ConfigEventNotifyContainer;
+
+ // private methods
+ void implts_initialize();
+ void implts_notifyContainerListener( const ::com::sun::star::ui::ConfigurationEvent& aEvent, NotifyOp eOp );
+ ImageList* implts_getUserImageList( ImageType nImageType );
+ sal_Bool implts_loadUserImages( ImageType nImageType,
+ const com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& xUserImageStorage,
+ const com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& xUserBitmapsStorage );
+ sal_Bool implts_storeUserImages( ImageType nImageType,
+ const com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& xUserImageStorage,
+ const com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& xUserBitmapsStorage );
+ const rtl::Reference< GlobalImageList >& implts_getGlobalImageList();
+ CmdImageList* implts_getDefaultImageList();
+
+
+ com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xUserConfigStorage;
+ com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xUserImageStorage;
+ com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xUserBitmapsStorage;
+ com::sun::star::uno::Reference< com::sun::star::embed::XTransactedObject > m_xUserRootCommit;
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+ com::sun::star::uno::Reference< com::sun::star::uno::XInterface > m_xOwner;
+ rtl::Reference< GlobalImageList > m_pGlobalImageList;
+ CmdImageList* m_pDefaultImageList;
+ rtl::OUString m_aXMLPostfix;
+ rtl::OUString m_aModuleIdentifier;
+ rtl::OUString m_aResourceString;
+ ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
+ ImageList* m_pUserImageList[ImageType_COUNT];
+ bool m_bUserImageListModified[ImageType_COUNT];
+ bool m_bUseGlobal;
+ bool m_bReadOnly;
+ bool m_bInitialized;
+ bool m_bModified;
+ bool m_bConfigRead;
+ bool m_bDisposed;
+ };
+}
+
+#endif // __FRAMEWORK_UICONFIGURATION_IMAGEMANAGERIMPL_HXX_
diff --git a/framework/source/uiconfiguration/makefile.mk b/framework/source/uiconfiguration/makefile.mk
index a78ecaca4d47..c7d6eb435d4f 100644
--- a/framework/source/uiconfiguration/makefile.mk
+++ b/framework/source/uiconfiguration/makefile.mk
@@ -43,11 +43,13 @@ ENABLE_EXCEPTIONS= TRUE
SLOFILES= \
$(SLO)$/uiconfigurationmanager.obj \
+ $(SLO)$/uiconfigurationmanagerimpl.obj \
$(SLO)$/moduleuiconfigurationmanager.obj \
$(SLO)$/moduleuicfgsupplier.obj \
$(SLO)$/windowstateconfiguration.obj \
$(SLO)$/moduleimagemanager.obj \
$(SLO)$/imagemanager.obj \
+ $(SLO)$/imagemanagerimpl.obj \
$(SLO)$/graphicnameaccess.obj \
$(SLO)$/uicategorydescription.obj \
$(SLO)$/globalsettings.obj
diff --git a/framework/source/uiconfiguration/moduleimagemanager.cxx b/framework/source/uiconfiguration/moduleimagemanager.cxx
index c5eb6d485072..8dedf0e5b033 100644
--- a/framework/source/uiconfiguration/moduleimagemanager.cxx
+++ b/framework/source/uiconfiguration/moduleimagemanager.cxx
@@ -36,6 +36,7 @@
#include <xml/imagesconfiguration.hxx>
#include <uiconfiguration/graphicnameaccess.hxx>
#include <services.h>
+#include "imagemanagerimpl.hxx"
#include "properties.h"
@@ -67,7 +68,7 @@
#include <unotools/ucbstreamhelper.hxx>
#include <vcl/pngread.hxx>
#include <vcl/pngwrite.hxx>
-#include "svtools/miscopt.hxx"
+#include <rtl/logfile.hxx>
//_________________________________________________________________________________________________________________
// namespaces
@@ -90,668 +91,12 @@ using namespace ::com::sun::star::container;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::ui;
-// Image sizes for our toolbars/menus
-const sal_Int32 IMAGE_SIZE_NORMAL = 16;
-const sal_Int32 IMAGE_SIZE_LARGE = 26;
-const sal_Int16 MAX_IMAGETYPE_VALUE = ::com::sun::star::ui::ImageType::COLOR_HIGHCONTRAST|
- ::com::sun::star::ui::ImageType::SIZE_LARGE;
-
-static const char IMAGE_FOLDER[] = "images";
-static const char BITMAPS_FOLDER[] = "Bitmaps";
-static const char IMAGE_EXTENSION[] = ".png";
-
-static const char* IMAGELIST_XML_FILE[] =
-{
- "sc_imagelist.xml",
- "lc_imagelist.xml",
- "sch_imagelist.xml",
- "lch_imagelist.xml"
-};
-
-static const char* BITMAP_FILE_NAMES[] =
-{
- "sc_userimages.png",
- "lc_userimages.png",
- "sch_userimages.png",
- "lch_userimages.png"
-};
-
namespace framework
{
-
-static osl::Mutex* pImageListWrapperMutex = 0;
-static GlobalImageList* pGlobalImageList = 0;
-static const char* ImageType_Prefixes[ImageType_COUNT] =
-{
- "res/commandimagelist/sc_",
- "res/commandimagelist/lc_",
- "res/commandimagelist/sch_",
- "res/commandimagelist/lch_"
-};
-static char ModuleImageList[] = "private:resource/images/moduleimages";
-
-typedef GraphicNameAccess CmdToXGraphicNameAccess;
-
-static osl::Mutex& getGlobalImageListMutex()
-{
- if ( pImageListWrapperMutex == 0 )
- {
- osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ;
- if ( pImageListWrapperMutex == 0 )
- pImageListWrapperMutex = new osl::Mutex;
- }
-
- return *pImageListWrapperMutex;
-}
-
-static GlobalImageList* getGlobalImageList( const uno::Reference< XMultiServiceFactory >& rServiceManager )
-{
- osl::MutexGuard guard( getGlobalImageListMutex() );
-
- if ( pGlobalImageList == 0 )
- pGlobalImageList = new GlobalImageList( rServiceManager );
-
- return pGlobalImageList;
-}
-
-static rtl::OUString getCanonicalName( const rtl::OUString& rFileName )
-{
- bool bRemoveSlash( true );
- sal_Int32 nLength = rFileName.getLength();
- const sal_Unicode* pString = rFileName.getStr();
-
- rtl::OUStringBuffer aBuf( nLength );
- for ( sal_Int32 i = 0; i < nLength; i++ )
- {
- const sal_Unicode c = pString[i];
- switch ( c )
- {
- // map forbidden characters to escape
- case '/' : if ( !bRemoveSlash )
- aBuf.appendAscii( "%2f" );
- break;
- case '\\': aBuf.appendAscii( "%5c" ); bRemoveSlash = false; break;
- case ':' : aBuf.appendAscii( "%3a" ); bRemoveSlash = false; break;
- case '*' : aBuf.appendAscii( "%2a" ); bRemoveSlash = false; break;
- case '?' : aBuf.appendAscii( "%3f" ); bRemoveSlash = false; break;
- case '<' : aBuf.appendAscii( "%3c" ); bRemoveSlash = false; break;
- case '>' : aBuf.appendAscii( "%3e" ); bRemoveSlash = false; break;
- case '|' : aBuf.appendAscii( "%7c" ); bRemoveSlash = false; break;
- default: aBuf.append( c ); bRemoveSlash = false;
- }
- }
- return aBuf.makeStringAndClear();
-}
-
-//_________________________________________________________________________________________________________________
-
-CmdImageList::CmdImageList( const uno::Reference< XMultiServiceFactory >& rServiceManager, const rtl::OUString& aModuleIdentifier ) :
- m_bVectorInit( sal_False ),
- m_aModuleIdentifier( aModuleIdentifier ),
- m_xServiceManager( rServiceManager ),
- m_nSymbolsStyle( SvtMiscOptions().GetCurrentSymbolsStyle() )
-{
- for ( sal_Int32 n=0; n < ImageType_COUNT; n++ )
- m_pImageList[n] = 0;
-}
-
-CmdImageList::~CmdImageList()
-{
- for ( sal_Int32 n=0; n < ImageType_COUNT; n++ )
- delete m_pImageList[n];
-}
-
-void CmdImageList::impl_fillCommandToImageNameMap()
-{
- RTL_LOGFILE_CONTEXT( aLog, "framework: CmdImageList::impl_fillCommandToImageNameMap" );
-
- if ( !m_bVectorInit )
- {
- const rtl::OUString aCommandImageList( RTL_CONSTASCII_USTRINGPARAM( UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDIMAGELIST ));
- Sequence< OUString > aCmdImageSeq;
- uno::Reference< XNameAccess > xCmdDesc( m_xServiceManager->createInstance(
- SERVICENAME_UICOMMANDDESCRIPTION ),
- UNO_QUERY );
-
- if ( m_aModuleIdentifier.getLength() > 0 )
- {
- // If we have a module identifier - use to retrieve the command image name list from it.
- // Otherwise we will use the global command image list
- try
- {
- xCmdDesc->getByName( m_aModuleIdentifier ) >>= xCmdDesc;
- if ( xCmdDesc.is() )
- xCmdDesc->getByName( aCommandImageList ) >>= aCmdImageSeq;
- }
- catch ( NoSuchElementException& )
- {
- // Module unknown we will work with an empty command image list!
- return;
- }
- }
-
- if ( xCmdDesc.is() )
- {
- try
- {
- xCmdDesc->getByName( aCommandImageList ) >>= aCmdImageSeq;
- }
- catch ( NoSuchElementException& )
- {
- }
- catch ( WrappedTargetException& )
- {
- }
- }
-
- // We have to map commands which uses special characters like '/',':','?','\','<'.'>','|'
- String aExt = String::CreateFromAscii( IMAGE_EXTENSION );
- m_aImageCommandNameVector.resize(aCmdImageSeq.getLength() );
- m_aImageNameVector.resize( aCmdImageSeq.getLength() );
-
- ::std::copy( aCmdImageSeq.getConstArray(),
- aCmdImageSeq.getConstArray()+aCmdImageSeq.getLength(),
- m_aImageCommandNameVector.begin() );
-
- // Create a image name vector that must be provided to the vcl imagelist. We also need
- // a command to image name map to speed up access time for image retrieval.
- OUString aUNOString( RTL_CONSTASCII_USTRINGPARAM( ".uno:" ));
- String aEmptyString;
- for ( sal_uInt32 i = 0; i < m_aImageCommandNameVector.size(); i++ )
- {
- OUString aCommandName( m_aImageCommandNameVector[i] );
- String aImageName;
-
- if ( aCommandName.indexOf( aUNOString ) != 0 )
- {
- INetURLObject aUrlObject( aCommandName, INetURLObject::ENCODE_ALL );
- aImageName = aUrlObject.GetURLPath();
- aImageName = getCanonicalName( aImageName ); // convert to valid filename
- }
- else
- {
- // just remove the schema
- if ( aCommandName.getLength() > 5 )
- aImageName = aCommandName.copy( 5 );
- else
- aImageName = aEmptyString;
-
- // Search for query part.
- sal_Int32 nIndex = aImageName.Search( '?' );
- if ( nIndex != STRING_NOTFOUND )
- aImageName = getCanonicalName( aImageName ); // convert to valid filename
- }
- // Image names are not case-dependent. Always use lower case characters to
- // reflect this.
- aImageName += aExt;
- aImageName.ToLowerAscii();
-
- m_aImageNameVector[i] = aImageName;
- m_aCommandToImageNameMap.insert( CommandToImageNameMap::value_type( aCommandName, aImageName ));
- }
-
- m_bVectorInit = sal_True;
- }
-}
-
-ImageList* CmdImageList::impl_getImageList( sal_Int16 nImageType )
-{
- SvtMiscOptions aMiscOptions;
-
- sal_Int16 nSymbolsStyle = aMiscOptions.GetCurrentSymbolsStyle();
- if ( nSymbolsStyle != m_nSymbolsStyle )
- {
- m_nSymbolsStyle = nSymbolsStyle;
- for ( sal_Int32 n=0; n < ImageType_COUNT; n++ )
- delete m_pImageList[n], m_pImageList[n] = NULL;
- }
-
- if ( !m_pImageList[nImageType] )
- {
- m_pImageList[nImageType] = new ImageList( m_aImageNameVector,
- OUString::createFromAscii( ImageType_Prefixes[nImageType] ) );
- }
-
- return m_pImageList[nImageType];
-}
-
-std::vector< ::rtl::OUString >& CmdImageList::impl_getImageNameVector()
-{
- return m_aImageNameVector;
-}
-
-std::vector< rtl::OUString >& CmdImageList::impl_getImageCommandNameVector()
-{
- return m_aImageCommandNameVector;
-}
-
-Image CmdImageList::getImageFromCommandURL( sal_Int16 nImageType, const rtl::OUString& rCommandURL )
-{
- impl_fillCommandToImageNameMap();
- CommandToImageNameMap::const_iterator pIter = m_aCommandToImageNameMap.find( rCommandURL );
- if ( pIter != m_aCommandToImageNameMap.end() )
- {
- ImageList* pImageList = impl_getImageList( nImageType );
- return pImageList->GetImage( pIter->second );
- }
-
- return Image();
-}
-
-bool CmdImageList::hasImage( sal_Int16 /*nImageType*/, const rtl::OUString& rCommandURL )
-{
- impl_fillCommandToImageNameMap();
- CommandToImageNameMap::const_iterator pIter = m_aCommandToImageNameMap.find( rCommandURL );
- if ( pIter != m_aCommandToImageNameMap.end() )
- return true;
- else
- return false;
-}
-
-::std::vector< rtl::OUString >& CmdImageList::getImageNames()
-{
- return impl_getImageNameVector();
-}
-
-::std::vector< rtl::OUString >& CmdImageList::getImageCommandNames()
-{
- return impl_getImageCommandNameVector();
-}
-
-//_________________________________________________________________________________________________________________
-
-GlobalImageList::GlobalImageList( const uno::Reference< XMultiServiceFactory >& rServiceManager ) :
- CmdImageList( rServiceManager, rtl::OUString() ),
- m_nRefCount( 0 )
-{
-}
-
-GlobalImageList::~GlobalImageList()
-{
-}
-
-Image GlobalImageList::getImageFromCommandURL( sal_Int16 nImageType, const rtl::OUString& rCommandURL )
-{
- osl::MutexGuard guard( getGlobalImageListMutex() );
- return CmdImageList::getImageFromCommandURL( nImageType, rCommandURL );
-}
-
-bool GlobalImageList::hasImage( sal_Int16 nImageType, const rtl::OUString& rCommandURL )
-{
- osl::MutexGuard guard( getGlobalImageListMutex() );
- return CmdImageList::hasImage( nImageType, rCommandURL );
-}
-
-::std::vector< rtl::OUString >& GlobalImageList::getImageNames()
-{
- osl::MutexGuard guard( getGlobalImageListMutex() );
- return impl_getImageNameVector();
-}
-
-::std::vector< rtl::OUString >& GlobalImageList::getImageCommandNames()
-{
- osl::MutexGuard guard( getGlobalImageListMutex() );
- return impl_getImageCommandNameVector();
-}
-
-oslInterlockedCount GlobalImageList::acquire()
-{
- osl_incrementInterlockedCount( &m_nRefCount );
- return m_nRefCount;
-}
-
-oslInterlockedCount GlobalImageList::release()
-{
- osl::MutexGuard guard( getGlobalImageListMutex() );
-
- if ( !osl_decrementInterlockedCount( &m_nRefCount ))
- {
- oslInterlockedCount nCount( m_nRefCount );
- // remove global pointer as we destroy the object now
- pGlobalImageList = 0;
- delete this;
- return nCount;
- }
-
- return m_nRefCount;
-}
-
-//*****************************************************************************************************************
-// XInterface, XTypeProvider, XServiceInfo
-//*****************************************************************************************************************
-DEFINE_XINTERFACE_6 ( ModuleImageManager ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XComponent ),
- DIRECT_INTERFACE( css::lang::XInitialization ),
- DIRECT_INTERFACE( ::com::sun::star::ui::XImageManager ),
- DIRECT_INTERFACE( ::com::sun::star::ui::XUIConfiguration ),
- DIRECT_INTERFACE( ::com::sun::star::ui::XUIConfigurationPersistence )
- )
-
-DEFINE_XTYPEPROVIDER_6 ( ModuleImageManager ,
- css::lang::XTypeProvider ,
- css::lang::XComponent ,
- css::lang::XInitialization ,
- ::com::sun::star::ui::XImageManager ,
- ::com::sun::star::ui::XUIConfiguration ,
- ::com::sun::star::ui::XUIConfigurationPersistence
- )
-
-static sal_Bool implts_checkAndScaleGraphic( uno::Reference< XGraphic >& rOutGraphic, const uno::Reference< XGraphic >& rInGraphic, sal_Int16 nImageType )
-{
- static Size aNormSize( IMAGE_SIZE_NORMAL, IMAGE_SIZE_NORMAL );
- static Size aLargeSize( IMAGE_SIZE_LARGE, IMAGE_SIZE_LARGE );
-
- if ( !rInGraphic.is() )
- {
- rOutGraphic = Image().GetXGraphic();
- return sal_False;
- }
-
- // Check size and scale it
- Image aImage( rInGraphic );
- Size aSize = aImage.GetSizePixel();
- bool bMustScale( false );
-
- if (( nImageType == ImageType_Color_Large ) ||
- ( nImageType == ImageType_HC_Large ))
- bMustScale = ( aSize != aLargeSize );
- else
- bMustScale = ( aSize != aNormSize );
-
- if ( bMustScale )
- {
- BitmapEx aBitmap = aImage.GetBitmapEx();
- aBitmap.Scale( aNormSize );
- aImage = Image( aBitmap );
- rOutGraphic = aImage.GetXGraphic();
- }
- else
- rOutGraphic = rInGraphic;
- return sal_True;
-}
-
-static sal_Int16 implts_convertImageTypeToIndex( sal_Int16 nImageType )
-{
- sal_Int16 nIndex( 0 );
- if ( nImageType & ::com::sun::star::ui::ImageType::SIZE_LARGE )
- nIndex += 1;
- if ( nImageType & ::com::sun::star::ui::ImageType::COLOR_HIGHCONTRAST )
- nIndex += 2;
- return nIndex;
-}
-
-const rtl::Reference< GlobalImageList >& ModuleImageManager::implts_getGlobalImageList()
-{
- ResetableGuard aGuard( m_aLock );
-
- if ( !m_pGlobalImageList.is() )
- m_pGlobalImageList = getGlobalImageList( m_xServiceManager );
- return m_pGlobalImageList;
-}
-
-CmdImageList* ModuleImageManager::implts_getDefaultImageList()
-{
- ResetableGuard aGuard( m_aLock );
-
- if ( !m_pDefaultImageList )
- m_pDefaultImageList = new CmdImageList( m_xServiceManager, m_aModuleIdentifier );
-
- return m_pDefaultImageList;
-}
-
-ImageList* ModuleImageManager::implts_getUserImageList( ImageType nImageType )
-{
- ResetableGuard aGuard( m_aLock );
- if ( !m_pUserImageList[nImageType] )
- implts_loadUserImages( nImageType, m_xUserImageStorage, m_xUserBitmapsStorage );
-
- return m_pUserImageList[nImageType];
-}
-
-void ModuleImageManager::implts_initialize()
-{
- // Initialize the top-level structures with the storage data
- if ( m_xUserConfigStorage.is() )
- {
- long nModes = m_bReadOnly ? ElementModes::READ : ElementModes::READWRITE;
-
- try
- {
- m_xUserImageStorage = m_xUserConfigStorage->openStorageElement( OUString::createFromAscii( IMAGE_FOLDER ),
- nModes );
- if ( m_xUserImageStorage.is() )
- {
- m_xUserBitmapsStorage = m_xUserImageStorage->openStorageElement( OUString::createFromAscii( BITMAPS_FOLDER ),
- nModes );
- }
- }
- catch ( com::sun::star::container::NoSuchElementException& )
- {
- }
- catch ( ::com::sun::star::embed::InvalidStorageException& )
- {
- }
- catch ( ::com::sun::star::lang::IllegalArgumentException& )
- {
- }
- catch ( ::com::sun::star::io::IOException& )
- {
- }
- catch ( ::com::sun::star::embed::StorageWrappedTargetException& )
- {
- }
- }
-}
-
-sal_Bool ModuleImageManager::implts_loadUserImages(
- ImageType nImageType,
- const uno::Reference< XStorage >& xUserImageStorage,
- const uno::Reference< XStorage >& xUserBitmapsStorage )
-{
- ResetableGuard aGuard( m_aLock );
-
- if ( xUserImageStorage.is() && xUserBitmapsStorage.is() )
- {
- try
- {
- uno::Reference< XStream > xStream = xUserImageStorage->openStreamElement( rtl::OUString::createFromAscii( IMAGELIST_XML_FILE[nImageType] ),
- ElementModes::READ );
- uno::Reference< XInputStream > xInputStream = xStream->getInputStream();
-
- ImageListsDescriptor aUserImageListInfo;
- ImagesConfiguration::LoadImages( m_xServiceManager,
- xInputStream,
- aUserImageListInfo );
- if (( aUserImageListInfo.pImageList != 0 ) &&
- ( aUserImageListInfo.pImageList->Count() > 0 ))
- {
- ImageListItemDescriptor* pList = aUserImageListInfo.pImageList->GetObject(0);
- sal_Int32 nCount = pList->pImageItemList->Count();
-
- std::vector< OUString > aUserImagesVector;
- for ( USHORT i=0; i < nCount; i++ )
- {
- const ImageItemDescriptor* pItem = pList->pImageItemList->GetObject(i);
- aUserImagesVector.push_back( pItem->aCommandURL );
- }
-
- uno::Reference< XStream > xBitmapStream = xUserBitmapsStorage->openStreamElement(
- rtl::OUString::createFromAscii( BITMAP_FILE_NAMES[nImageType] ),
- ElementModes::READ );
-
- if ( xBitmapStream.is() )
- {
- SvStream* pSvStream( 0 );
- BitmapEx aUserBitmap;
- {
- pSvStream = utl::UcbStreamHelper::CreateStream( xBitmapStream );
- vcl::PNGReader aPngReader( *pSvStream );
- aUserBitmap = aPngReader.Read();
- }
- delete pSvStream;
-
- // Delete old image list and create a new one from the read bitmap
- delete m_pUserImageList[nImageType];
- m_pUserImageList[nImageType] = new ImageList();
- m_pUserImageList[nImageType]->InsertFromHorizontalStrip
- ( aUserBitmap, aUserImagesVector );
- return sal_True;
- }
- }
- }
- catch ( com::sun::star::container::NoSuchElementException& )
- {
- }
- catch ( ::com::sun::star::embed::InvalidStorageException& )
- {
- }
- catch ( ::com::sun::star::lang::IllegalArgumentException& )
- {
- }
- catch ( ::com::sun::star::io::IOException& )
- {
- }
- catch ( ::com::sun::star::embed::StorageWrappedTargetException& )
- {
- }
- }
-
- // Destroy old image list - create a new empty one
- delete m_pUserImageList[nImageType];
- m_pUserImageList[nImageType] = new ImageList;
-
- return sal_True;
-}
-
-sal_Bool ModuleImageManager::implts_storeUserImages(
- ImageType nImageType,
- const uno::Reference< XStorage >& xUserImageStorage,
- const uno::Reference< XStorage >& xUserBitmapsStorage )
-{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bModified )
- {
- ImageList* pImageList = implts_getUserImageList( nImageType );
- if ( pImageList->GetImageCount() > 0 )
- {
- ImageListsDescriptor aUserImageListInfo;
- aUserImageListInfo.pImageList = new ImageListDescriptor;
-
- ImageListItemDescriptor* pList = new ImageListItemDescriptor;
- aUserImageListInfo.pImageList->Insert( pList, 0 );
-
- pList->pImageItemList = new ImageItemListDescriptor;
- for ( USHORT i=0; i < pImageList->GetImageCount(); i++ )
- {
- ImageItemDescriptor* pItem = new ::framework::ImageItemDescriptor;
-
- pItem->nIndex = i;
- pItem->aCommandURL = pImageList->GetImageName( i );
- pList->pImageItemList->Insert( pItem, pList->pImageItemList->Count() );
- }
-
- pList->aURL = String::CreateFromAscii("Bitmaps/");
- pList->aURL += String::CreateFromAscii( BITMAP_FILE_NAMES[nImageType] );
-
- uno::Reference< XTransactedObject > xTransaction;
- uno::Reference< XOutputStream > xOutputStream;
- uno::Reference< XStream > xStream = xUserImageStorage->openStreamElement( rtl::OUString::createFromAscii( IMAGELIST_XML_FILE[nImageType] ),
- ElementModes::WRITE|ElementModes::TRUNCATE );
- if ( xStream.is() )
- {
- uno::Reference< XStream > xBitmapStream =
- xUserBitmapsStorage->openStreamElement( rtl::OUString::createFromAscii( BITMAP_FILE_NAMES[nImageType] ),
- ElementModes::WRITE|ElementModes::TRUNCATE );
- if ( xBitmapStream.is() )
- {
- SvStream* pSvStream = utl::UcbStreamHelper::CreateStream( xBitmapStream );
- {
- vcl::PNGWriter aPngWriter( pImageList->GetAsHorizontalStrip() );
- aPngWriter.Write( *pSvStream );
- }
- delete pSvStream;
-
- // Commit user bitmaps storage
- xTransaction = uno::Reference< XTransactedObject >( xUserBitmapsStorage, UNO_QUERY );
- if ( xTransaction.is() )
- xTransaction->commit();
- }
-
- xOutputStream = xStream->getOutputStream();
- if ( xOutputStream.is() )
- ImagesConfiguration::StoreImages( m_xServiceManager, xOutputStream, aUserImageListInfo );
-
- // Commit user image storage
- xTransaction = uno::Reference< XTransactedObject >( xUserImageStorage, UNO_QUERY );
- if ( xTransaction.is() )
- xTransaction->commit();
- }
-
- return sal_True;
- }
- else
- {
- // Remove the streams from the storage, if we have no data. We have to catch
- // the NoSuchElementException as it can be possible that there is no stream at all!
- try
- {
- xUserImageStorage->removeElement( rtl::OUString::createFromAscii( IMAGELIST_XML_FILE[nImageType] ));
- }
- catch ( ::com::sun::star::container::NoSuchElementException& )
- {
- }
-
- try
- {
- xUserBitmapsStorage->removeElement( rtl::OUString::createFromAscii( BITMAP_FILE_NAMES[nImageType] ));
- }
- catch ( ::com::sun::star::container::NoSuchElementException& )
- {
- }
-
- uno::Reference< XTransactedObject > xTransaction;
-
- // Commit user image storage
- xTransaction = uno::Reference< XTransactedObject >( xUserImageStorage, UNO_QUERY );
- if ( xTransaction.is() )
- xTransaction->commit();
-
- // Commit user bitmaps storage
- xTransaction = uno::Reference< XTransactedObject >( xUserBitmapsStorage, UNO_QUERY );
- if ( xTransaction.is() )
- xTransaction->commit();
-
- return sal_True;
- }
- }
-
- return sal_False;
-}
-
ModuleImageManager::ModuleImageManager( uno::Reference< XMultiServiceFactory > xServiceManager ) :
ThreadHelpBase( &Application::GetSolarMutex() )
- , m_xUserConfigStorage( 0 )
- , m_xUserImageStorage( 0 )
- , m_xUserBitmapsStorage( 0 )
- , m_bReadOnly( true )
- , m_bInitialized( false )
- , m_bModified( false )
- , m_bConfigRead( false )
- , m_bDisposed( false )
- , m_aXMLPostfix( RTL_CONSTASCII_USTRINGPARAM( ".xml" ))
- , m_aResourceString( RTL_CONSTASCII_USTRINGPARAM( ModuleImageList ))
- , m_xServiceManager( xServiceManager )
- , m_aListenerContainer( m_aLock.getShareableOslMutex() )
- , m_pDefaultImageList( 0 )
+ , m_pImpl( new ImageManagerImpl(xServiceManager,static_cast< OWeakObject* >(this),true) )
{
- for ( sal_Int32 n=0; n < ImageType_COUNT; n++ )
- {
- m_pUserImageList[n] = 0;
- m_bUserImageListModified[n] = false;
- }
}
ModuleImageManager::~ModuleImageManager()
@@ -761,192 +106,43 @@ ModuleImageManager::~ModuleImageManager()
// XComponent
void SAL_CALL ModuleImageManager::dispose() throw (::com::sun::star::uno::RuntimeException)
{
- uno::Reference< XComponent > xThis( static_cast< OWeakObject* >(this), UNO_QUERY );
-
- css::lang::EventObject aEvent( xThis );
- m_aListenerContainer.disposeAndClear( aEvent );
-
- {
- ResetableGuard aGuard( m_aLock );
- m_xUserConfigStorage.clear();
- m_xUserImageStorage.clear();
- m_xUserRootCommit.clear();
- m_bConfigRead = false;
- m_bModified = false;
- m_bDisposed = true;
-
- // delete user and default image list on dispose
- for ( sal_Int32 n=0; n < ImageType_COUNT; n++ )
- {
- delete m_pUserImageList[n];
- m_pUserImageList[n] = 0;
- }
- delete m_pDefaultImageList;
- m_pDefaultImageList = 0;
- }
+ m_pImpl->dispose();
}
void SAL_CALL ModuleImageManager::addEventListener( const uno::Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
- {
- ResetableGuard aGuard( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
- }
-
- m_aListenerContainer.addInterface( ::getCppuType( ( const uno::Reference< XEventListener >* ) NULL ), xListener );
+ m_pImpl->addEventListener(xListener);
}
void SAL_CALL ModuleImageManager::removeEventListener( const uno::Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
- m_aListenerContainer.removeInterface( ::getCppuType( ( const uno::Reference< XEventListener >* ) NULL ), xListener );
+ m_pImpl->removeEventListener(xListener);
}
// XInitialization
void SAL_CALL ModuleImageManager::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
{
- ResetableGuard aLock( m_aLock );
-
- if ( !m_bInitialized )
- {
- for ( sal_Int32 n = 0; n < aArguments.getLength(); n++ )
- {
- PropertyValue aPropValue;
- if ( aArguments[n] >>= aPropValue )
- {
- if ( aPropValue.Name.equalsAscii( "UserConfigStorage" ))
- {
- aPropValue.Value >>= m_xUserConfigStorage;
- }
- else if ( aPropValue.Name.equalsAscii( "ModuleIdentifier" ))
- {
- aPropValue.Value >>= m_aModuleIdentifier;
- }
- else if ( aPropValue.Name.equalsAscii( "UserRootCommit" ))
- {
- aPropValue.Value >>= m_xUserRootCommit;
- }
- }
- }
-
- if ( m_xUserConfigStorage.is() )
- {
- uno::Reference< XPropertySet > xPropSet( m_xUserConfigStorage, UNO_QUERY );
- if ( xPropSet.is() )
- {
- long nOpenMode = 0;
- Any a = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenMode" )));
- if ( a >>= nOpenMode )
- m_bReadOnly = !( nOpenMode & ElementModes::WRITE );
- }
- }
-
- implts_initialize();
-
- m_bInitialized = true;
- }
+ m_pImpl->initialize(aArguments);
}
// XImageManager
void SAL_CALL ModuleImageManager::reset()
throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aLock( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
-
- std::vector< OUString > aUserImageNames;
-
- for ( sal_Int32 i = 0; i < ImageType_COUNT; i++ )
- {
- aUserImageNames.clear();
- ImageList* pImageList = implts_getUserImageList( ImageType(i));
- pImageList->GetImageNames( aUserImageNames );
-
- Sequence< rtl::OUString > aRemoveList( aUserImageNames.size() );
- for ( sal_uInt32 j = 0; j < aUserImageNames.size(); j++ )
- aRemoveList[j] = aUserImageNames[j];
-
- // Remove images
- removeImages( sal_Int16( i ), aRemoveList );
- m_bUserImageListModified[i] = true;
- }
-
- m_bModified = sal_True;
+ m_pImpl->reset();
}
Sequence< ::rtl::OUString > SAL_CALL ModuleImageManager::getAllImageNames( ::sal_Int16 nImageType )
throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aLock( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
-
- ImageNameMap aImageCmdNameMap;
-
- sal_Int16 nIndex = implts_convertImageTypeToIndex( nImageType );
- rtl::Reference< GlobalImageList > rGlobalImageList = implts_getGlobalImageList();
-
- sal_uInt32 i( 0 );
- const std::vector< OUString >& rGlobalImageNameVector = rGlobalImageList->getImageCommandNames();
- for ( i = 0; i < rGlobalImageNameVector.size(); i++ )
- aImageCmdNameMap.insert( ImageNameMap::value_type( rGlobalImageNameVector[i], sal_True ));
-
- const std::vector< OUString >& rModuleImageNameVector = implts_getDefaultImageList()->getImageCommandNames();
- for ( i = 0; i < rModuleImageNameVector.size(); i++ )
- aImageCmdNameMap.insert( ImageNameMap::value_type( rModuleImageNameVector[i], sal_True ));
-
- ImageList* pImageList = implts_getUserImageList( ImageType( nIndex ));
- std::vector< OUString > rUserImageNames;
- pImageList->GetImageNames( rUserImageNames );
- for ( i = 0; i < rUserImageNames.size(); i++ )
- aImageCmdNameMap.insert( ImageNameMap::value_type( rUserImageNames[i], sal_True ));
-
- Sequence< OUString > aImageNameSeq( aImageCmdNameMap.size() );
- ImageNameMap::const_iterator pIter;
- i = 0;
- for ( pIter = aImageCmdNameMap.begin(); pIter != aImageCmdNameMap.end(); pIter++ )
- aImageNameSeq[i++] = pIter->first;
-
- return aImageNameSeq;
+ return m_pImpl->getAllImageNames( nImageType );
}
::sal_Bool SAL_CALL ModuleImageManager::hasImage( ::sal_Int16 nImageType, const ::rtl::OUString& aCommandURL )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aLock( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
-
- if (( nImageType < 0 ) || ( nImageType > MAX_IMAGETYPE_VALUE ))
- throw IllegalArgumentException();
-
- sal_Int16 nIndex = implts_convertImageTypeToIndex( nImageType );
- if ( implts_getGlobalImageList()->hasImage( nIndex, aCommandURL ))
- return sal_True;
- else
- {
- if ( implts_getDefaultImageList()->hasImage( nIndex, aCommandURL ))
- return sal_True;
- else
- {
- // User layer
- ImageList* pImageList = implts_getUserImageList( ImageType( nIndex ));
- if ( pImageList )
- return ( pImageList->GetImagePos( aCommandURL ) != IMAGELIST_IMAGE_NOTFOUND );
- }
- }
-
- return sal_False;
+ return m_pImpl->hasImage(nImageType,aCommandURL);
}
Sequence< uno::Reference< XGraphic > > SAL_CALL ModuleImageManager::getImages(
@@ -955,43 +151,7 @@ Sequence< uno::Reference< XGraphic > > SAL_CALL ModuleImageManager::getImages(
throw ( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException )
{
RTL_LOGFILE_CONTEXT( aLog, "framework: ModuleImageManager::getImages" );
-
- ResetableGuard aLock( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
-
- if (( nImageType < 0 ) || ( nImageType > MAX_IMAGETYPE_VALUE ))
- throw IllegalArgumentException();
-
- Sequence< uno::Reference< XGraphic > > aGraphSeq( aCommandURLSequence.getLength() );
-
- const rtl::OUString* aStrArray = aCommandURLSequence.getConstArray();
-
- sal_Int16 nIndex = implts_convertImageTypeToIndex( nImageType );
- rtl::Reference< GlobalImageList > rGlobalImageList = implts_getGlobalImageList();
- CmdImageList* pDefaultImageList = implts_getDefaultImageList();
- ImageList* pUserImageList = implts_getUserImageList( ImageType( nIndex ));
-
- // We have to search our image list in the following order:
- // 1. user image list (read/write)
- // 2. module image list (read)
- // 3. global image list (read)
- for ( sal_Int32 n = 0; n < aCommandURLSequence.getLength(); n++ )
- {
- Image aImage = pUserImageList->GetImage( aStrArray[n] );
- if ( !aImage )
- {
- aImage = pDefaultImageList->getImageFromCommandURL( nIndex, aStrArray[n] );
- if ( !aImage )
- aImage = rGlobalImageList->getImageFromCommandURL( nIndex, aStrArray[n] );
- }
-
- aGraphSeq[n] = aImage.GetXGraphic();
- }
-
- return aGraphSeq;
+ return m_pImpl->getImages(nImageType,aCommandURLSequence);
}
void SAL_CALL ModuleImageManager::replaceImages(
@@ -1002,84 +162,7 @@ throw ( ::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::lang::IllegalAccessException,
::com::sun::star::uno::RuntimeException)
{
- CmdToXGraphicNameAccess* pInsertedImages( 0 );
- CmdToXGraphicNameAccess* pReplacedImages( 0 );
-
- {
- ResetableGuard aLock( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
-
- if (( aCommandURLSequence.getLength() != aGraphicsSequence.getLength() ) ||
- (( nImageType < 0 ) || ( nImageType > MAX_IMAGETYPE_VALUE )))
- throw IllegalArgumentException();
-
- if ( m_bReadOnly )
- throw IllegalAccessException();
-
- sal_Int16 nIndex = implts_convertImageTypeToIndex( nImageType );
- ImageList* pImageList = implts_getUserImageList( ImageType( nIndex ));
-
- uno::Reference< XGraphic > xGraphic;
- for ( sal_Int32 i = 0; i < aCommandURLSequence.getLength(); i++ )
- {
- // Check size and scale. If we don't have any graphics ignore it
- if ( !implts_checkAndScaleGraphic( xGraphic, aGraphicsSequence[i], nIndex ))
- continue;
-
- USHORT nPos = pImageList->GetImagePos( aCommandURLSequence[i] );
- if ( nPos == IMAGELIST_IMAGE_NOTFOUND )
- {
- pImageList->AddImage( aCommandURLSequence[i], xGraphic );
- if ( !pInsertedImages )
- pInsertedImages = new CmdToXGraphicNameAccess();
- pInsertedImages->addElement( aCommandURLSequence[i], xGraphic );
- }
- else
- {
- pImageList->ReplaceImage( aCommandURLSequence[i], xGraphic );
- if ( !pReplacedImages )
- pReplacedImages = new CmdToXGraphicNameAccess();
- pReplacedImages->addElement( aCommandURLSequence[i], xGraphic );
- }
- }
-
- if (( pInsertedImages != 0 ) || ( pReplacedImages != 0 ))
- {
- m_bModified = sal_True;
- m_bUserImageListModified[nIndex] = true;
- }
- }
-
- // Notify listeners
- uno::Reference< XImageManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- uno::Reference< XInterface > xIfac( xThis, UNO_QUERY );
-
- if ( pInsertedImages != 0 )
- {
- ConfigurationEvent aInsertEvent;
- aInsertEvent.aInfo = uno::makeAny( nImageType );
- aInsertEvent.Accessor = uno::makeAny( xThis );
- aInsertEvent.Source = xIfac;
- aInsertEvent.ResourceURL = m_aResourceString;
- aInsertEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
- static_cast< OWeakObject *>( pInsertedImages ), UNO_QUERY ));
- implts_notifyContainerListener( aInsertEvent, NotifyOp_Insert );
- }
- if ( pReplacedImages != 0 )
- {
- ConfigurationEvent aReplaceEvent;
- aReplaceEvent.aInfo = uno::makeAny( nImageType );
- aReplaceEvent.Accessor = uno::makeAny( xThis );
- aReplaceEvent.Source = xIfac;
- aReplaceEvent.ResourceURL = m_aResourceString;
- aReplaceEvent.ReplacedElement = Any();
- aReplaceEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
- static_cast< OWeakObject *>( pReplacedImages ), UNO_QUERY ));
- implts_notifyContainerListener( aReplaceEvent, NotifyOp_Replace );
- }
+ m_pImpl->replaceImages(nImageType,aCommandURLSequence,aGraphicsSequence);
}
void SAL_CALL ModuleImageManager::removeImages( ::sal_Int16 nImageType, const Sequence< ::rtl::OUString >& aCommandURLSequence )
@@ -1087,91 +170,7 @@ throw ( ::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::lang::IllegalAccessException,
::com::sun::star::uno::RuntimeException)
{
- CmdToXGraphicNameAccess* pRemovedImages( 0 );
- CmdToXGraphicNameAccess* pReplacedImages( 0 );
-
- {
- ResetableGuard aLock( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
-
- if (( nImageType < 0 ) || ( nImageType > MAX_IMAGETYPE_VALUE ))
- throw IllegalArgumentException();
-
- if ( m_bReadOnly )
- throw IllegalAccessException();
-
- sal_Int16 nIndex = implts_convertImageTypeToIndex( nImageType );
- rtl::Reference< GlobalImageList > rGlobalImageList = implts_getGlobalImageList();
- CmdImageList* pDefaultImageList = implts_getDefaultImageList();
- ImageList* pImageList = implts_getUserImageList( ImageType( nIndex ));
- uno::Reference< XGraphic > xEmptyGraphic( Image().GetXGraphic() );
-
- for ( sal_Int32 i = 0; i < aCommandURLSequence.getLength(); i++ )
- {
- USHORT nPos = pImageList->GetImagePos( aCommandURLSequence[i] );
- if ( nPos != IMAGELIST_IMAGE_NOTFOUND )
- {
- Image aImage = pImageList->GetImage( nPos );
- USHORT nId = pImageList->GetImageId( nPos );
- pImageList->RemoveImage( nId );
-
- // Check, if we have a image in our module/global image list. If we find one =>
- // this is a replace instead of a remove operation!
- Image aNewImage = pDefaultImageList->getImageFromCommandURL( nIndex, aCommandURLSequence[i] );
- if ( !aNewImage )
- aNewImage = rGlobalImageList->getImageFromCommandURL( nIndex, aCommandURLSequence[i] );
- if ( !aNewImage )
- {
- if ( !pRemovedImages )
- pRemovedImages = new CmdToXGraphicNameAccess();
- pRemovedImages->addElement( aCommandURLSequence[i], xEmptyGraphic );
- }
- else
- {
- if ( !pReplacedImages )
- pReplacedImages = new CmdToXGraphicNameAccess();
- pReplacedImages->addElement( aCommandURLSequence[i], aNewImage.GetXGraphic() );
- }
- }
- }
-
- if (( pReplacedImages != 0 ) || ( pRemovedImages != 0 ))
- {
- m_bModified = sal_True;
- m_bUserImageListModified[nIndex] = true;
- }
- }
-
- // Notify listeners
- uno::Reference< XImageManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- uno::Reference< XInterface > xIfac( xThis, UNO_QUERY );
-
- if ( pRemovedImages != 0 )
- {
- ConfigurationEvent aRemoveEvent;
- aRemoveEvent.aInfo = uno::makeAny( nImageType );
- aRemoveEvent.Accessor = uno::makeAny( xThis );
- aRemoveEvent.Source = xIfac;
- aRemoveEvent.ResourceURL = m_aResourceString;
- aRemoveEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
- static_cast< OWeakObject *>( pRemovedImages ), UNO_QUERY ));
- implts_notifyContainerListener( aRemoveEvent, NotifyOp_Remove );
- }
- if ( pReplacedImages != 0 )
- {
- ConfigurationEvent aReplaceEvent;
- aReplaceEvent.aInfo = uno::makeAny( nImageType );
- aReplaceEvent.Accessor = uno::makeAny( xThis );
- aReplaceEvent.Source = xIfac;
- aReplaceEvent.ResourceURL = m_aResourceString;
- aReplaceEvent.ReplacedElement = Any();
- aReplaceEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
- static_cast< OWeakObject *>( pReplacedImages ), UNO_QUERY ));
- implts_notifyContainerListener( aReplaceEvent, NotifyOp_Replace );
- }
+ m_pImpl->removeImages(nImageType,aCommandURLSequence);
}
void SAL_CALL ModuleImageManager::insertImages( ::sal_Int16 nImageType, const Sequence< ::rtl::OUString >& aCommandURLSequence, const Sequence< uno::Reference< XGraphic > >& aGraphicSequence )
@@ -1180,105 +179,20 @@ throw ( ::com::sun::star::container::ElementExistException,
::com::sun::star::lang::IllegalAccessException,
::com::sun::star::uno::RuntimeException)
{
- CmdToXGraphicNameAccess* pInsertedImages( 0 );
- CmdToXGraphicNameAccess* pReplacedImages( 0 );
-
- {
- ResetableGuard aLock( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
-
- if (( aCommandURLSequence.getLength() != aGraphicSequence.getLength() ) ||
- (( nImageType < 0 ) || ( nImageType > MAX_IMAGETYPE_VALUE )))
- throw IllegalArgumentException();
-
- if ( m_bReadOnly )
- throw IllegalAccessException();
-
- sal_Int16 nIndex = implts_convertImageTypeToIndex( nImageType );
- ImageList* pImageList = implts_getUserImageList( ImageType( nIndex ));
-
- uno::Reference< XGraphic > xGraphic;
- for ( sal_Int32 i = 0; i < aCommandURLSequence.getLength(); i++ )
- {
- if ( !implts_checkAndScaleGraphic( xGraphic, aGraphicSequence[i], nIndex ))
- continue;
-
- USHORT nPos = pImageList->GetImagePos( aCommandURLSequence[i] );
- if ( nPos == IMAGELIST_IMAGE_NOTFOUND )
- {
- pImageList->AddImage( aCommandURLSequence[i], xGraphic );
- if ( !pInsertedImages )
- pInsertedImages = new CmdToXGraphicNameAccess();
- pInsertedImages->addElement( aCommandURLSequence[i], xGraphic );
- }
- else
- {
- pImageList->ReplaceImage( aCommandURLSequence[i], xGraphic );
- if ( !pReplacedImages )
- pReplacedImages = new CmdToXGraphicNameAccess();
- pReplacedImages->addElement( aCommandURLSequence[i], xGraphic );
- }
- }
-
- if (( pInsertedImages != 0 ) || ( pReplacedImages != 0 ))
- {
- m_bModified = sal_True;
- m_bUserImageListModified[nIndex] = true;
- }
- }
-
- // Notify listeners
- uno::Reference< XImageManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- uno::Reference< XInterface > xIfac( xThis, UNO_QUERY );
-
- if ( pInsertedImages != 0 )
- {
- ConfigurationEvent aInsertEvent;
- aInsertEvent.aInfo = uno::makeAny( nImageType );
- aInsertEvent.Accessor = uno::makeAny( xThis );
- aInsertEvent.Source = xIfac;
- aInsertEvent.ResourceURL = m_aResourceString;
- aInsertEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
- static_cast< OWeakObject *>( pInsertedImages ), UNO_QUERY ));
- implts_notifyContainerListener( aInsertEvent, NotifyOp_Insert );
- }
- if ( pReplacedImages != 0 )
- {
- ConfigurationEvent aReplaceEvent;
- aReplaceEvent.aInfo = uno::makeAny( nImageType );
- aReplaceEvent.Accessor = uno::makeAny( xThis );
- aReplaceEvent.Source = xIfac;
- aReplaceEvent.ResourceURL = m_aResourceString;
- aReplaceEvent.ReplacedElement = Any();
- aReplaceEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
- static_cast< OWeakObject *>( pReplacedImages ), UNO_QUERY ));
- implts_notifyContainerListener( aReplaceEvent, NotifyOp_Replace );
- }
+ m_pImpl->insertImages(nImageType,aCommandURLSequence,aGraphicSequence);
}
// XUIConfiguration
void SAL_CALL ModuleImageManager::addConfigurationListener( const uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener )
throw (::com::sun::star::uno::RuntimeException)
{
- {
- ResetableGuard aGuard( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
- }
-
- m_aListenerContainer.addInterface( ::getCppuType( ( const uno::Reference< XUIConfigurationListener >* ) NULL ), xListener );
+ m_pImpl->addConfigurationListener(xListener);
}
void SAL_CALL ModuleImageManager::removeConfigurationListener( const uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener )
throw (::com::sun::star::uno::RuntimeException)
{
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- m_aListenerContainer.removeInterface( ::getCppuType( ( const uno::Reference< XUIConfigurationListener >* ) NULL ), xListener );
+ m_pImpl->removeConfigurationListener(xListener);
}
// XUIConfigurationPersistence
@@ -1286,248 +200,30 @@ void SAL_CALL ModuleImageManager::reload()
throw ( ::com::sun::star::uno::Exception,
::com::sun::star::uno::RuntimeException )
{
- ResetableGuard aGuard( m_aLock );
-
- uno::Reference< uno::XInterface > xRefThis( static_cast< OWeakObject* >( this ));
-
- if ( m_bDisposed )
- throw DisposedException();
-
- CommandMap aOldUserCmdImageSet;
- std::vector< rtl::OUString > aNewUserCmdImageSet;
-
- if ( m_bModified )
- {
- uno::Reference< XImageManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- uno::Reference< XInterface > xIfac( xThis, UNO_QUERY );
-
- for ( sal_Int16 i = 0; i < sal_Int16( ImageType_COUNT ); i++ )
- {
- if ( !m_bDisposed && m_bUserImageListModified[i] )
- {
- std::vector< rtl::OUString > aOldUserCmdImageVector;
- ImageList* pImageList = implts_getUserImageList( (ImageType)i );
- pImageList->GetImageNames( aOldUserCmdImageVector );
-
- // Fill hash map to speed up search afterwards
- sal_uInt32 j( 0 );
- for ( j = 0; j < aOldUserCmdImageVector.size(); j++ )
- aOldUserCmdImageSet.insert( CommandMap::value_type( aOldUserCmdImageVector[j], false ));
-
- // Attention: This can make the old image list pointer invalid!
- implts_loadUserImages( (ImageType)i, m_xUserImageStorage, m_xUserBitmapsStorage );
- pImageList = implts_getUserImageList( (ImageType)i );
- pImageList->GetImageNames( aNewUserCmdImageSet );
-
- CmdToXGraphicNameAccess* pInsertedImages( 0 );
- CmdToXGraphicNameAccess* pReplacedImages( 0 );
- CmdToXGraphicNameAccess* pRemovedImages( 0 );
-
- for ( j = 0; j < aNewUserCmdImageSet.size(); j++ )
- {
- CommandMap::iterator pIter = aOldUserCmdImageSet.find( aNewUserCmdImageSet[j] );
- if ( pIter != aOldUserCmdImageSet.end() )
- {
- pIter->second = true; // mark entry as replaced
- if ( !pReplacedImages )
- pReplacedImages = new CmdToXGraphicNameAccess();
- pReplacedImages->addElement( aNewUserCmdImageSet[j],
- pImageList->GetImage( aNewUserCmdImageSet[j] ).GetXGraphic() );
- }
- else
- {
- if ( !pInsertedImages )
- pInsertedImages = new CmdToXGraphicNameAccess();
- pInsertedImages->addElement( aNewUserCmdImageSet[j],
- pImageList->GetImage( aNewUserCmdImageSet[j] ).GetXGraphic() );
- }
- }
-
- // Search map for unmarked entries => they have been removed from the user list
- // through this reload operation.
- // We have to search the module and global image list!
- rtl::Reference< GlobalImageList > rGlobalImageList = implts_getGlobalImageList();
- CmdImageList* pDefaultImageList = implts_getDefaultImageList();
- uno::Reference< XGraphic > xEmptyGraphic( Image().GetXGraphic() );
- CommandMap::const_iterator pIter = aOldUserCmdImageSet.begin();
- while ( pIter != aOldUserCmdImageSet.end() )
- {
- if ( !pIter->second )
- {
- Image aImage = pDefaultImageList->getImageFromCommandURL( i, pIter->first );
- if ( !aImage )
- aImage = rGlobalImageList->getImageFromCommandURL( i, pIter->first );
-
- if ( !aImage )
- {
- // No image in the module/global image list => remove user image
- if ( !pRemovedImages )
- pRemovedImages = new CmdToXGraphicNameAccess();
- pRemovedImages->addElement( pIter->first, xEmptyGraphic );
- }
- else
- {
- // Image has been found in the module/global image list => replace user image
- if ( !pReplacedImages )
- pReplacedImages = new CmdToXGraphicNameAccess();
- pReplacedImages->addElement( pIter->first, aImage.GetXGraphic() );
- }
- }
- ++pIter;
- }
-
- aGuard.unlock();
-
- // Now notify our listeners. Unlock mutex to prevent deadlocks
- if ( pInsertedImages != 0 )
- {
- ConfigurationEvent aInsertEvent;
- aInsertEvent.aInfo = uno::makeAny( i );
- aInsertEvent.Accessor = uno::makeAny( xThis );
- aInsertEvent.Source = xIfac;
- aInsertEvent.ResourceURL = m_aResourceString;
- aInsertEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
- static_cast< OWeakObject *>( pInsertedImages ), UNO_QUERY ));
- implts_notifyContainerListener( aInsertEvent, NotifyOp_Insert );
- }
- if ( pReplacedImages != 0 )
- {
- ConfigurationEvent aReplaceEvent;
- aReplaceEvent.aInfo = uno::makeAny( i );
- aReplaceEvent.Accessor = uno::makeAny( xThis );
- aReplaceEvent.Source = xIfac;
- aReplaceEvent.ResourceURL = m_aResourceString;
- aReplaceEvent.ReplacedElement = Any();
- aReplaceEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
- static_cast< OWeakObject *>( pReplacedImages ), UNO_QUERY ));
- implts_notifyContainerListener( aReplaceEvent, NotifyOp_Replace );
- }
- if ( pRemovedImages != 0 )
- {
- ConfigurationEvent aRemoveEvent;
- aRemoveEvent.aInfo = uno::makeAny( i );
- aRemoveEvent.Accessor = uno::makeAny( xThis );
- aRemoveEvent.Source = xIfac;
- aRemoveEvent.ResourceURL = m_aResourceString;
- aRemoveEvent.Element = uno::makeAny( uno::Reference< XNameAccess >(
- static_cast< OWeakObject *>( pRemovedImages ), UNO_QUERY ));
- implts_notifyContainerListener( aRemoveEvent, NotifyOp_Remove );
- }
-
- aGuard.lock();
- }
- }
- }
+ m_pImpl->reload();
}
void SAL_CALL ModuleImageManager::store()
throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_bModified )
- {
- sal_Bool bWritten( sal_False );
- for ( sal_Int32 i = 0; i < ImageType_COUNT; i++ )
- {
- sal_Bool bSuccess = implts_storeUserImages( ImageType(i), m_xUserImageStorage, m_xUserBitmapsStorage );
- if ( bSuccess )
- bWritten = sal_True;
- m_bUserImageListModified[i] = false;
- }
-
- if ( bWritten &&
- m_xUserConfigStorage.is() &&
- m_xUserRootCommit.is() )
- {
- uno::Reference< XTransactedObject > xUserConfigStorageCommit( m_xUserConfigStorage, UNO_QUERY );
- if ( xUserConfigStorageCommit.is() )
- xUserConfigStorageCommit->commit();
- m_xUserRootCommit->commit();
- }
-
- m_bModified = sal_False;
- }
+ m_pImpl->store();
}
void SAL_CALL ModuleImageManager::storeToStorage( const uno::Reference< XStorage >& Storage )
throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_bModified && Storage.is() )
- {
- long nModes = ElementModes::READWRITE;
-
- uno::Reference< XStorage > xUserImageStorage = Storage->openStorageElement( OUString::createFromAscii( IMAGE_FOLDER ),
- nModes );
- if ( xUserImageStorage.is() )
- {
- uno::Reference< XStorage > xUserBitmapsStorage = xUserImageStorage->openStorageElement( OUString::createFromAscii( BITMAPS_FOLDER ),
- nModes );
- for ( sal_Int32 i = 0; i < ImageType_COUNT; i++ )
- {
- implts_getUserImageList( (ImageType)i );
- implts_storeUserImages( (ImageType)i, xUserImageStorage, xUserBitmapsStorage );
- }
-
- uno::Reference< XTransactedObject > xTransaction( Storage, UNO_QUERY );
- if ( xTransaction.is() )
- xTransaction->commit();
- }
- }
+ m_pImpl->storeToStorage(Storage);
}
sal_Bool SAL_CALL ModuleImageManager::isModified()
throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
- return m_bModified;
+ return m_pImpl->isModified();
}
sal_Bool SAL_CALL ModuleImageManager::isReadOnly() throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- return m_bReadOnly;
-}
-
-void ModuleImageManager::implts_notifyContainerListener( const ConfigurationEvent& aEvent, NotifyOp eOp )
-{
- ::cppu::OInterfaceContainerHelper* pContainer = m_aListenerContainer.getContainer(
- ::getCppuType( ( const css::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >*) NULL ) );
- if ( pContainer != NULL )
- {
- ::cppu::OInterfaceIteratorHelper pIterator( *pContainer );
- while ( pIterator.hasMoreElements() )
- {
- try
- {
- switch ( eOp )
- {
- case NotifyOp_Replace:
- ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementReplaced( aEvent );
- break;
- case NotifyOp_Insert:
- ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementInserted( aEvent );
- break;
- case NotifyOp_Remove:
- ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementRemoved( aEvent );
- break;
- }
- }
- catch( css::uno::RuntimeException& )
- {
- pIterator.remove();
- }
- }
- }
+ return m_pImpl->isReadOnly();
}
} // namespace framework
diff --git a/framework/source/uiconfiguration/moduleuicfgsupplier.cxx b/framework/source/uiconfiguration/moduleuicfgsupplier.cxx
index 400428a582ea..343e569a4993 100644
--- a/framework/source/uiconfiguration/moduleuicfgsupplier.cxx
+++ b/framework/source/uiconfiguration/moduleuicfgsupplier.cxx
@@ -50,7 +50,7 @@
// other includes
//_________________________________________________________________________________________________________________
#include <rtl/logfile.hxx>
-
+#include <cppuhelper/implbase1.hxx>
#include <vcl/svapp.hxx>
using namespace com::sun::star::uno;
@@ -65,15 +65,10 @@ using namespace ::com::sun::star::frame;
namespace framework
{
-class RootStorageWrapper : public com::sun::star::lang::XTypeProvider ,
- public com::sun::star::embed::XTransactedObject ,
- public ::cppu::OWeakObject
+class RootStorageWrapper : public ::cppu::WeakImplHelper1< com::sun::star::embed::XTransactedObject >
{
public:
// XInterface, XTypeProvider
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
-
RootStorageWrapper( const Reference< XTransactedObject >& xRootCommit ) : m_xRootCommit( xRootCommit ) {}
virtual ~RootStorageWrapper() {}
@@ -92,17 +87,6 @@ class RootStorageWrapper : public com::sun::star::lang::XTypeProvider ,
Reference< XTransactedObject > m_xRootCommit;
};
-DEFINE_XINTERFACE_2 ( RootStorageWrapper ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( com::sun::star::embed::XTransactedObject )
- )
-
-DEFINE_XTYPEPROVIDER_2 ( RootStorageWrapper ,
- css::lang::XTypeProvider ,
- css::embed::XTransactedObject
- )
-
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
@@ -133,6 +117,7 @@ DEFINE_INIT_SERVICE ( ModuleUIConfigurationManagerSupplier
/*TODO_AS
void ModuleUIConfigurationManagerSupplier::impl_initStorages()
{
+RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManagerSupplier::impl_initStorages" );
if ( !m_bInit )
{
RTL_LOGFILE_CONTEXT( aLog, "framework (cd100003) ::ModuleUIConfigurationManagerSupplier::impl_initStorages" );
@@ -232,6 +217,7 @@ ModuleUIConfigurationManagerSupplier::ModuleUIConfigurationManagerSupplier( cons
, m_xServiceManager( xServiceManager )
, m_aListenerContainer( m_aLock.getShareableOslMutex() )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManagerSupplier::ModuleUIConfigurationManagerSupplier" );
// Retrieve known modules and insert them into our hash_map to speed-up access time.
Reference< XNameAccess > xNameAccess( m_xModuleMgr, UNO_QUERY );
const Sequence< ::rtl::OUString > aNameSeq = xNameAccess->getElementNames();
@@ -273,6 +259,7 @@ ModuleUIConfigurationManagerSupplier::~ModuleUIConfigurationManagerSupplier()
void SAL_CALL ModuleUIConfigurationManagerSupplier::dispose()
throw ( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManagerSupplier::dispose" );
Reference< XComponent > xThis( static_cast< OWeakObject* >(this), UNO_QUERY );
css::lang::EventObject aEvent( xThis );
@@ -287,6 +274,7 @@ throw ( RuntimeException )
void SAL_CALL ModuleUIConfigurationManagerSupplier::addEventListener( const Reference< XEventListener >& xListener )
throw ( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManagerSupplier::addEventListener" );
{
ResetableGuard aGuard( m_aLock );
@@ -301,6 +289,7 @@ throw ( RuntimeException )
void SAL_CALL ModuleUIConfigurationManagerSupplier::removeEventListener( const Reference< XEventListener >& xListener )
throw ( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManagerSupplier::removeEventListener" );
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
m_aListenerContainer.removeInterface( ::getCppuType( ( const Reference< XEventListener >* ) NULL ), xListener );
}
@@ -309,6 +298,7 @@ throw ( RuntimeException )
Reference< XUIConfigurationManager > SAL_CALL ModuleUIConfigurationManagerSupplier::getUIConfigurationManager( const ::rtl::OUString& ModuleIdentifier )
throw ( NoSuchElementException, RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManagerSupplier::getUIConfigurationManager" );
ResetableGuard aGuard( m_aLock );
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
@@ -318,30 +308,6 @@ throw ( NoSuchElementException, RuntimeException)
ModuleToModuleCfgMgr::iterator pIter = m_aModuleToModuleUICfgMgrMap.find( ModuleIdentifier );
if ( pIter == m_aModuleToModuleUICfgMgrMap.end() )
throw NoSuchElementException();
-
- ::rtl::OUString sShort;
- try
- {
- Sequence< PropertyValue > lProps;
- Reference< XNameAccess > xCont(m_xModuleMgr, UNO_QUERY);
- xCont->getByName(ModuleIdentifier) >>= lProps;
- for (sal_Int32 i=0; i<lProps.getLength(); ++i)
- {
- if (lProps[i].Name.equalsAscii("ooSetupFactoryShortName"))
- {
- lProps[i].Value >>= sShort;
- break;
- }
- }
- }
- catch( Exception& )
- {
- sShort = ::rtl::OUString();
- }
-
- if (!sShort.getLength())
- throw NoSuchElementException();
-
//TODO_AS impl_initStorages();
// Create instance on demand
@@ -394,6 +360,28 @@ throw ( NoSuchElementException, RuntimeException)
aArg.Value <<= m_xUserRootCommit;
aArgs[3] <<= aArg;
*/
+ ::rtl::OUString sShort;
+ try
+ {
+ Sequence< PropertyValue > lProps;
+ Reference< XNameAccess > xCont(m_xModuleMgr, UNO_QUERY);
+ xCont->getByName(ModuleIdentifier) >>= lProps;
+ for (sal_Int32 i=0; i<lProps.getLength(); ++i)
+ {
+ if (lProps[i].Name.equalsAscii("ooSetupFactoryShortName"))
+ {
+ lProps[i].Value >>= sShort;
+ break;
+ }
+ }
+ }
+ catch( Exception& )
+ {
+ sShort = ::rtl::OUString();
+ }
+
+ if (!sShort.getLength())
+ throw NoSuchElementException();
PropertyValue aArg;
Sequence< Any > aArgs( 2 );
aArg.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ModuleShortName" ));
@@ -403,9 +391,7 @@ throw ( NoSuchElementException, RuntimeException)
aArg.Value <<= ModuleIdentifier;
aArgs[1] <<= aArg;
- pIter->second = Reference< XUIConfigurationManager >( m_xServiceManager->createInstanceWithArguments(
- SERVICENAME_MODULEUICONFIGURATIONMANAGER, aArgs ),
- UNO_QUERY );
+ pIter->second.set( m_xServiceManager->createInstanceWithArguments(SERVICENAME_MODULEUICONFIGURATIONMANAGER, aArgs ),UNO_QUERY );
}
return pIter->second;
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index 663c2d0d6dd8..04c87a2c3946 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -38,6 +38,7 @@
#include <uielement/uielementtypenames.hxx>
#include <xml/menuconfiguration.hxx>
#include <xml/toolboxconfiguration.hxx>
+#include <uiconfigurationmanagerimpl.hxx>
#ifndef __FRAMEWORK_XML_STATUSBARCONFIGURATION_HXX_
#include <xml/statusbarconfiguration.hxx>
@@ -113,1292 +114,127 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( ModuleUIConfigurationManager
DEFINE_INIT_SERVICE ( ModuleUIConfigurationManager, {} )
-// important: The order and position of the elements must match the constant
-// definition of "::com::sun::star::ui::UIElementType"
-static const char* UIELEMENTTYPENAMES[] =
+ModuleUIConfigurationManager::ModuleUIConfigurationManager( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xServiceManager )
+: m_pImpl( new UIConfigurationManagerImpl(xServiceManager,static_cast< OWeakObject* >(this),true) )
{
- "", // Dummy value for unknown!
- UIELEMENTTYPE_MENUBAR_NAME,
- UIELEMENTTYPE_POPUPMENU_NAME,
- UIELEMENTTYPE_TOOLBAR_NAME,
- UIELEMENTTYPE_STATUSBAR_NAME,
- UIELEMENTTYPE_FLOATINGWINDOW_NAME,
- UIELEMENTTYPE_PROGRESSBAR_NAME
-};
-
-static const char RESOURCEURL_PREFIX[] = "private:resource/";
-static const sal_Int32 RESOURCEURL_PREFIX_SIZE = 17;
-static const char RESOURCEURL_CUSTOM_ELEMENT[] = "custom_";
-
-static sal_Int16 RetrieveTypeFromResourceURL( const rtl::OUString& aResourceURL )
-{
-
- if (( aResourceURL.indexOf( OUString( RTL_CONSTASCII_USTRINGPARAM( RESOURCEURL_PREFIX ))) == 0 ) &&
- ( aResourceURL.getLength() > RESOURCEURL_PREFIX_SIZE ))
- {
- OUString aTmpStr = aResourceURL.copy( RESOURCEURL_PREFIX_SIZE );
- sal_Int32 nIndex = aTmpStr.indexOf( '/' );
- if (( nIndex > 0 ) && ( aTmpStr.getLength() > nIndex ))
- {
- OUString aTypeStr( aTmpStr.copy( 0, nIndex ));
- for ( int i = 0; i < UIElementType::COUNT; i++ )
- {
- if ( aTypeStr.equalsAscii( UIELEMENTTYPENAMES[i] ))
- return sal_Int16( i );
- }
- }
- }
-
- return UIElementType::UNKNOWN;
-}
-
-static OUString RetrieveNameFromResourceURL( const rtl::OUString& aResourceURL )
-{
- if (( aResourceURL.indexOf( OUString( RTL_CONSTASCII_USTRINGPARAM( RESOURCEURL_PREFIX ))) == 0 ) &&
- ( aResourceURL.getLength() > RESOURCEURL_PREFIX_SIZE ))
- {
- sal_Int32 nIndex = aResourceURL.lastIndexOf( '/' );
- if (( nIndex > 0 ) && (( nIndex+1 ) < aResourceURL.getLength()))
- return aResourceURL.copy( nIndex+1 );
- }
-
- return OUString();
-}
-
-void ModuleUIConfigurationManager::impl_fillSequenceWithElementTypeInfo( UIElementInfoHashMap& aUIElementInfoCollection, sal_Int16 nElementType )
-{
- // preload list of element types on demand
- impl_preloadUIElementTypeList( LAYER_USERDEFINED, nElementType );
- impl_preloadUIElementTypeList( LAYER_DEFAULT, nElementType );
-
- UIElementDataHashMap& rUserElements = m_aUIElements[LAYER_USERDEFINED][nElementType].aElementsHashMap;
- UIElementDataHashMap::const_iterator pUserIter = rUserElements.begin();
-
- OUString aCustomUrlPrefix( RTL_CONSTASCII_USTRINGPARAM( RESOURCEURL_CUSTOM_ELEMENT ));
- while ( pUserIter != rUserElements.end() )
- {
- sal_Int32 nIndex = pUserIter->second.aResourceURL.indexOf( aCustomUrlPrefix, RESOURCEURL_PREFIX_SIZE );
- if ( nIndex > RESOURCEURL_PREFIX_SIZE )
- {
- // Performance: Retrieve user interface name only for custom user interface elements.
- // It's only used by them!
- UIElementData* pDataSettings = impl_findUIElementData( pUserIter->second.aResourceURL, nElementType );
- if ( pDataSettings )
- {
- // Retrieve user interface name from XPropertySet interface
- rtl::OUString aUIName;
- Reference< XPropertySet > xPropSet( pDataSettings->xSettings, UNO_QUERY );
- if ( xPropSet.is() )
- {
- Any a = xPropSet->getPropertyValue( m_aPropUIName );
- a >>= aUIName;
- }
-
- UIElementInfo aInfo( pUserIter->second.aResourceURL, aUIName );
- aUIElementInfoCollection.insert( UIElementInfoHashMap::value_type( pUserIter->second.aResourceURL, aInfo ));
- }
- }
- else
- {
- // The user interface name for standard user interface elements is stored in the WindowState.xcu file
- UIElementInfo aInfo( pUserIter->second.aResourceURL, OUString() );
- aUIElementInfoCollection.insert( UIElementInfoHashMap::value_type( pUserIter->second.aResourceURL, aInfo ));
- }
- ++pUserIter;
- }
-
- UIElementDataHashMap& rDefaultElements = m_aUIElements[LAYER_DEFAULT][nElementType].aElementsHashMap;
- UIElementDataHashMap::const_iterator pDefIter = rDefaultElements.begin();
-
- while ( pDefIter != rDefaultElements.end() )
- {
- UIElementInfoHashMap::const_iterator pIterInfo = aUIElementInfoCollection.find( pDefIter->second.aResourceURL );
- if ( pIterInfo == aUIElementInfoCollection.end() )
- {
- sal_Int32 nIndex = pDefIter->second.aResourceURL.indexOf( aCustomUrlPrefix, RESOURCEURL_PREFIX_SIZE );
- if ( nIndex > RESOURCEURL_PREFIX_SIZE )
- {
- // Performance: Retrieve user interface name only for custom user interface elements.
- // It's only used by them!
- UIElementData* pDataSettings = impl_findUIElementData( pDefIter->second.aResourceURL, nElementType );
- if ( pDataSettings )
- {
- // Retrieve user interface name from XPropertySet interface
- rtl::OUString aUIName;
- Reference< XPropertySet > xPropSet( pDataSettings->xSettings, UNO_QUERY );
- if ( xPropSet.is() )
- {
- Any a = xPropSet->getPropertyValue( m_aPropUIName );
- a >>= aUIName;
- }
-
- UIElementInfo aInfo( pDefIter->second.aResourceURL, aUIName );
- aUIElementInfoCollection.insert( UIElementInfoHashMap::value_type( pDefIter->second.aResourceURL, aInfo ));
- }
- }
- else
- {
- // The user interface name for standard user interface elements is stored in the WindowState.xcu file
- UIElementInfo aInfo( pDefIter->second.aResourceURL, OUString() );
- aUIElementInfoCollection.insert( UIElementInfoHashMap::value_type( pDefIter->second.aResourceURL, aInfo ));
- }
- }
-
- ++pDefIter;
- }
-}
-
-void ModuleUIConfigurationManager::impl_preloadUIElementTypeList( Layer eLayer, sal_Int16 nElementType )
-{
- UIElementType& rElementTypeData = m_aUIElements[eLayer][nElementType];
-
- if ( !rElementTypeData.bLoaded )
- {
- Reference< XStorage > xElementTypeStorage = rElementTypeData.xStorage;
- if ( xElementTypeStorage.is() )
- {
- rtl::OUStringBuffer aBuf( RESOURCEURL_PREFIX_SIZE );
- aBuf.appendAscii( RESOURCEURL_PREFIX );
- aBuf.appendAscii( UIELEMENTTYPENAMES[ nElementType ] );
- aBuf.appendAscii( "/" );
- OUString aResURLPrefix( aBuf.makeStringAndClear() );
-
- UIElementDataHashMap& rHashMap = rElementTypeData.aElementsHashMap;
- Reference< XNameAccess > xNameAccess( xElementTypeStorage, UNO_QUERY );
- Sequence< OUString > aUIElementNames = xNameAccess->getElementNames();
- for ( sal_Int32 n = 0; n < aUIElementNames.getLength(); n++ )
- {
- UIElementData aUIElementData;
-
- // Resource name must be without ".xml"
- sal_Int32 nIndex = aUIElementNames[n].lastIndexOf( '.' );
- if (( nIndex > 0 ) && ( nIndex < aUIElementNames[n].getLength() ))
- {
- OUString aExtension( aUIElementNames[n].copy( nIndex+1 ));
- OUString aUIElementName( aUIElementNames[n].copy( 0, nIndex ));
-
- if (( aUIElementName.getLength() > 0 ) &&
- ( aExtension.equalsIgnoreAsciiCaseAsciiL( "xml", 3 )))
- {
- aUIElementData.aResourceURL = aResURLPrefix + aUIElementName;
- aUIElementData.aName = aUIElementNames[n];
-
- if ( eLayer == LAYER_USERDEFINED )
- {
- aUIElementData.bModified = false;
- aUIElementData.bDefault = false;
- aUIElementData.bDefaultNode = false;
- }
-
- // Create hash_map entries for all user interface elements inside the storage. We don't load the
- // settings to speed up the process.
- rHashMap.insert( UIElementDataHashMap::value_type( aUIElementData.aResourceURL, aUIElementData ));
- }
- }
- }
- }
- }
-
- rElementTypeData.bLoaded = true;
-}
-
-void ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElementType, Layer eLayer, UIElementData& aUIElementData )
-{
- UIElementType& rElementTypeData = m_aUIElements[eLayer][nElementType];
-
- Reference< XStorage > xElementTypeStorage = rElementTypeData.xStorage;
- if ( xElementTypeStorage.is() && aUIElementData.aName.getLength() )
- {
- try
- {
- Reference< XStream > xStream = xElementTypeStorage->openStreamElement( aUIElementData.aName, ElementModes::READ );
- Reference< XInputStream > xInputStream = xStream->getInputStream();
-
- if ( xInputStream.is() )
- {
- switch ( nElementType )
- {
- case ::com::sun::star::ui::UIElementType::UNKNOWN:
- break;
-
- case ::com::sun::star::ui::UIElementType::MENUBAR:
- {
- try
- {
- MenuConfiguration aMenuCfg( m_xServiceManager );
- Reference< XIndexAccess > xContainer( aMenuCfg.CreateMenuBarConfigurationFromXML( xInputStream ));
- RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xContainer );
- if ( pRootItemContainer )
- aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, sal_True ) ), UNO_QUERY );
- else
- aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( xContainer, sal_True ) ), UNO_QUERY );
- return;
- }
- catch ( ::com::sun::star::lang::WrappedTargetException& )
- {
- }
- }
- break;
-
- case ::com::sun::star::ui::UIElementType::POPUPMENU:
- {
- break;
- }
-
- case ::com::sun::star::ui::UIElementType::TOOLBAR:
- {
- try
- {
- Reference< XIndexContainer > xIndexContainer( static_cast< OWeakObject * >( new RootItemContainer() ), UNO_QUERY );
- ToolBoxConfiguration::LoadToolBox( m_xServiceManager, xInputStream, xIndexContainer );
- RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xIndexContainer );
- aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, sal_True ) ), UNO_QUERY );
- return;
- }
- catch ( ::com::sun::star::lang::WrappedTargetException& )
- {
- }
-
- break;
- }
-
- case ::com::sun::star::ui::UIElementType::STATUSBAR:
- {
- try
- {
- Reference< XIndexContainer > xIndexContainer( static_cast< OWeakObject * >( new RootItemContainer() ), UNO_QUERY );
- StatusBarConfiguration::LoadStatusBar( m_xServiceManager, xInputStream, xIndexContainer );
- RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xIndexContainer );
- aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, sal_True ) ), UNO_QUERY );
- return;
- }
- catch ( ::com::sun::star::lang::WrappedTargetException& )
- {
- }
-
- break;
- }
-
- case ::com::sun::star::ui::UIElementType::FLOATINGWINDOW:
- {
- break;
- }
- }
- }
- }
- catch ( ::com::sun::star::embed::InvalidStorageException& )
- {
- }
- catch ( ::com::sun::star::lang::IllegalArgumentException& )
- {
- }
- catch ( ::com::sun::star::io::IOException& )
- {
- }
- catch ( ::com::sun::star::embed::StorageWrappedTargetException& )
- {
- }
- }
-
- // At least we provide an empty settings container!
- aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer() ), UNO_QUERY );
-}
-
-ModuleUIConfigurationManager::UIElementData* ModuleUIConfigurationManager::impl_findUIElementData( const rtl::OUString& aResourceURL, sal_Int16 nElementType, bool bLoad )
-{
- // preload list of element types on demand
- impl_preloadUIElementTypeList( LAYER_USERDEFINED, nElementType );
- impl_preloadUIElementTypeList( LAYER_DEFAULT, nElementType );
-
- // first try to look into our user-defined vector/hash_map combination
- UIElementDataHashMap& rUserHashMap = m_aUIElements[LAYER_USERDEFINED][nElementType].aElementsHashMap;
- UIElementDataHashMap::iterator pIter = rUserHashMap.find( aResourceURL );
- if ( pIter != rUserHashMap.end() )
- {
- // Default data settings data must be retrieved from the default layer!
- if ( !pIter->second.bDefault )
- {
- if ( !pIter->second.xSettings.is() && bLoad )
- impl_requestUIElementData( nElementType, LAYER_USERDEFINED, pIter->second );
- return &(pIter->second);
- }
- }
-
- // Not successfull, we have to look into our default vector/hash_map combination
- UIElementDataHashMap& rDefaultHashMap = m_aUIElements[LAYER_DEFAULT][nElementType].aElementsHashMap;
- pIter = rDefaultHashMap.find( aResourceURL );
- if ( pIter != rDefaultHashMap.end() )
- {
- if ( !pIter->second.xSettings.is() && bLoad )
- impl_requestUIElementData( nElementType, LAYER_DEFAULT, pIter->second );
- return &(pIter->second);
- }
-
- // Nothing has been found!
- return NULL;
-}
-
-void ModuleUIConfigurationManager::impl_storeElementTypeData( Reference< XStorage > xStorage, UIElementType& rElementType, bool bResetModifyState )
-{
- UIElementDataHashMap& rHashMap = rElementType.aElementsHashMap;
- UIElementDataHashMap::iterator pIter = rHashMap.begin();
-
- while ( pIter != rHashMap.end() )
- {
- UIElementData& rElement = pIter->second;
- if ( rElement.bModified )
- {
- if ( rElement.bDefault )
- {
- xStorage->removeElement( rElement.aName );
- rElement.bModified = sal_False; // mark as not modified
- }
- else
- {
- Reference< XStream > xStream( xStorage->openStreamElement( rElement.aName, ElementModes::WRITE|ElementModes::TRUNCATE ), UNO_QUERY );
- Reference< XOutputStream > xOutputStream( xStream->getOutputStream() );
-
- if ( xOutputStream.is() )
- {
- switch( rElementType.nElementType )
- {
- case ::com::sun::star::ui::UIElementType::MENUBAR:
- {
- try
- {
- MenuConfiguration aMenuCfg( m_xServiceManager );
- aMenuCfg.StoreMenuBarConfigurationToXML( rElement.xSettings, xOutputStream );
- }
- catch ( ::com::sun::star::lang::WrappedTargetException& )
- {
- }
- }
- break;
-
- case ::com::sun::star::ui::UIElementType::TOOLBAR:
- {
- try
- {
- ToolBoxConfiguration::StoreToolBox( m_xServiceManager, xOutputStream, rElement.xSettings );
- }
- catch ( ::com::sun::star::lang::WrappedTargetException& )
- {
- }
- }
- break;
-
- case ::com::sun::star::ui::UIElementType::STATUSBAR:
- {
- try
- {
- StatusBarConfiguration::StoreStatusBar( m_xServiceManager, xOutputStream, rElement.xSettings );
- }
- catch ( ::com::sun::star::lang::WrappedTargetException& )
- {
- }
- }
- break;
-
- default:
- break;
- }
- }
-
- // mark as not modified if we store to our own storage
- if ( bResetModifyState )
- rElement.bModified = sal_False;
- }
- }
-
- ++pIter;
- }
-
- // commit element type storage
- Reference< XTransactedObject > xTransactedObject( xStorage, UNO_QUERY );
- if ( xTransactedObject.is() )
- xTransactedObject->commit();
-
- // mark UIElementType as not modified if we store to our own storage
- if ( bResetModifyState )
- rElementType.bModified = sal_False;
-}
-
-// This is only allowed to be called on the LAYER_USER_DEFINED!
-void ModuleUIConfigurationManager::impl_resetElementTypeData(
- UIElementType& rUserElementType,
- UIElementType& rDefaultElementType,
- ConfigEventNotifyContainer& rRemoveNotifyContainer,
- ConfigEventNotifyContainer& rReplaceNotifyContainer )
-{
- UIElementDataHashMap& rHashMap = rUserElementType.aElementsHashMap;
- UIElementDataHashMap::iterator pIter = rHashMap.begin();
-
- Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- Reference< XInterface > xIfac( xThis, UNO_QUERY );
- Reference< XNameAccess > xDefaultNameAccess( rDefaultElementType.xStorage, UNO_QUERY );
- sal_Int16 nType = rUserElementType.nElementType;
-
- // Make copies of the event structures to be thread-safe. We have to unlock our mutex before calling
- // our listeners!
- while ( pIter != rHashMap.end() )
- {
- UIElementData& rElement = pIter->second;
- if ( !rElement.bDefault )
- {
- if ( xDefaultNameAccess->hasByName( rElement.aName ))
- {
- // Replace settings with data from default layer
- Reference< XIndexAccess > xOldSettings( rElement.xSettings );
- impl_requestUIElementData( nType, LAYER_DEFAULT, rElement );
-
- ConfigurationEvent aReplaceEvent;
- aReplaceEvent.ResourceURL = rElement.aResourceURL;
- aReplaceEvent.Accessor <<= xThis;
- aReplaceEvent.Source = xIfac;
- aReplaceEvent.ReplacedElement <<= xOldSettings;
- aReplaceEvent.Element <<= rElement.xSettings;
-
- rReplaceNotifyContainer.push_back( aReplaceEvent );
-
- // Mark element as default and not modified. That means "not active"
- // in the user layer anymore.
- rElement.bModified = false;
- rElement.bDefault = true;
- }
- else
- {
- // Remove user-defined settings from user layer
- ConfigurationEvent aEvent;
- aEvent.ResourceURL = rElement.aResourceURL;
- aEvent.Accessor <<= xThis;
- aEvent.Source = xIfac;
- aEvent.Element <<= rElement.xSettings;
-
- rRemoveNotifyContainer.push_back( aEvent );
-
- // Mark element as default and not modified. That means "not active"
- // in the user layer anymore.
- rElement.bModified = false;
- rElement.bDefault = true;
- }
- }
-
- ++pIter;
- }
-
- // Remove all settings from our user interface elements
- rHashMap.clear();
-}
-
-void ModuleUIConfigurationManager::impl_reloadElementTypeData(
- UIElementType& rUserElementType,
- UIElementType& rDefaultElementType,
- ConfigEventNotifyContainer& rRemoveNotifyContainer,
- ConfigEventNotifyContainer& rReplaceNotifyContainer )
-{
- UIElementDataHashMap& rHashMap = rUserElementType.aElementsHashMap;
- UIElementDataHashMap::iterator pIter = rHashMap.begin();
- Reference< XStorage > xUserStorage( rUserElementType.xStorage );
- Reference< XStorage > xDefaultStorage( rDefaultElementType.xStorage );
- Reference< XNameAccess > xUserNameAccess( rUserElementType.xStorage, UNO_QUERY );
- Reference< XNameAccess > xDefaultNameAccess( rDefaultElementType.xStorage, UNO_QUERY );
-
- Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- Reference< XInterface > xIfac( xThis, UNO_QUERY );
- sal_Int16 nType = rUserElementType.nElementType;
-
- while ( pIter != rHashMap.end() )
- {
- UIElementData& rElement = pIter->second;
- if ( rElement.bModified )
- {
- if ( xUserNameAccess->hasByName( rElement.aName ))
- {
- // Replace settings with data from user layer
- Reference< XIndexAccess > xOldSettings( rElement.xSettings );
-
- impl_requestUIElementData( nType, LAYER_USERDEFINED, rElement );
-
- ConfigurationEvent aReplaceEvent;
-
- aReplaceEvent.ResourceURL = rElement.aResourceURL;
- aReplaceEvent.Accessor <<= xThis;
- aReplaceEvent.Source = xIfac;
- aReplaceEvent.ReplacedElement <<= xOldSettings;
- aReplaceEvent.Element <<= rElement.xSettings;
- rReplaceNotifyContainer.push_back( aReplaceEvent );
-
- rElement.bModified = false;
- }
- else if ( xDefaultNameAccess->hasByName( rElement.aName ))
- {
- // Replace settings with data from default layer
- Reference< XIndexAccess > xOldSettings( rElement.xSettings );
-
- impl_requestUIElementData( nType, LAYER_DEFAULT, rElement );
-
- ConfigurationEvent aReplaceEvent;
-
- aReplaceEvent.ResourceURL = rElement.aResourceURL;
- aReplaceEvent.Accessor <<= xThis;
- aReplaceEvent.Source = xIfac;
- aReplaceEvent.ReplacedElement <<= xOldSettings;
- aReplaceEvent.Element <<= rElement.xSettings;
- rReplaceNotifyContainer.push_back( aReplaceEvent );
-
- // Mark element as default and not modified. That means "not active"
- // in the user layer anymore.
- rElement.bModified = false;
- rElement.bDefault = true;
- }
- else
- {
- // Element settings are not in any storage => remove
- ConfigurationEvent aRemoveEvent;
-
- aRemoveEvent.ResourceURL = rElement.aResourceURL;
- aRemoveEvent.Accessor <<= xThis;
- aRemoveEvent.Source = xIfac;
- aRemoveEvent.Element <<= rElement.xSettings;
-
- rRemoveNotifyContainer.push_back( aRemoveEvent );
-
- // Mark element as default and not modified. That means "not active"
- // in the user layer anymore.
- rElement.bModified = false;
- rElement.bDefault = true;
- }
- }
- ++pIter;
- }
-
- rUserElementType.bModified = sal_False;
-}
-
-void ModuleUIConfigurationManager::impl_Initialize()
-{
- // Initialize the top-level structures with the storage data
- if ( m_xUserConfigStorage.is() )
- {
- // Try to access our module sub folder
- for ( sal_Int16 i = 1; i < ::com::sun::star::ui::UIElementType::COUNT;
- i++ )
- {
- Reference< XStorage > xElementTypeStorage;
- try
- {
- if ( m_pStorageHandler[i] )
- xElementTypeStorage = m_pStorageHandler[i]->getWorkingStorageUser();
- }
- catch ( com::sun::star::container::NoSuchElementException& )
- {
- }
- catch ( ::com::sun::star::embed::InvalidStorageException& )
- {
- }
- catch ( ::com::sun::star::lang::IllegalArgumentException& )
- {
- }
- catch ( ::com::sun::star::io::IOException& )
- {
- }
- catch ( ::com::sun::star::embed::StorageWrappedTargetException& )
- {
- }
-
- m_aUIElements[LAYER_USERDEFINED][i].nElementType = i;
- m_aUIElements[LAYER_USERDEFINED][i].bModified = false;
- m_aUIElements[LAYER_USERDEFINED][i].xStorage = xElementTypeStorage;
- m_aUIElements[LAYER_USERDEFINED][i].bDefaultLayer = false;
- }
- }
-
- if ( m_xDefaultConfigStorage.is() )
- {
- Reference< XNameAccess > xNameAccess( m_xDefaultConfigStorage, UNO_QUERY_THROW );
-
- // Try to access our module sub folder
- for ( sal_Int16 i = 1; i < ::com::sun::star::ui::UIElementType::COUNT;
- i++ )
- {
- Reference< XStorage > xElementTypeStorage;
- try
- {
- Any a = xNameAccess->getByName( OUString::createFromAscii( UIELEMENTTYPENAMES[i] ));
- a >>= xElementTypeStorage;
- }
- catch ( com::sun::star::container::NoSuchElementException& )
- {
- }
-
- m_aUIElements[LAYER_DEFAULT][i].nElementType = i;
- m_aUIElements[LAYER_DEFAULT][i].bModified = false;
- m_aUIElements[LAYER_DEFAULT][i].xStorage = xElementTypeStorage;
- m_aUIElements[LAYER_DEFAULT][i].bDefaultLayer = true;
- }
- }
-}
-
-ModuleUIConfigurationManager::ModuleUIConfigurationManager( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xServiceManager ) :
- ThreadHelpBase( &Application::GetSolarMutex() )
- , m_xDefaultConfigStorage( 0 )
- , m_xUserConfigStorage( 0 )
- , m_bReadOnly( true )
- , m_bInitialized( false )
- , m_bModified( false )
- , m_bConfigRead( false )
- , m_bDisposed( false )
- , m_aXMLPostfix( RTL_CONSTASCII_USTRINGPARAM( ".xml" ))
- , m_aPropUIName( RTL_CONSTASCII_USTRINGPARAM( "UIName" ))
- , m_aPropResourceURL( RTL_CONSTASCII_USTRINGPARAM( "ResourceURL" ))
- , m_xServiceManager( xServiceManager )
- , m_aListenerContainer( m_aLock.getShareableOslMutex() )
-{
- for ( int i = 0; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
- m_pStorageHandler[i] = 0;
-
- // Make sure we have a default initialized entry for every layer and user interface element type!
- // The following code depends on this!
- m_aUIElements[LAYER_DEFAULT].resize( ::com::sun::star::ui::UIElementType::COUNT );
- m_aUIElements[LAYER_USERDEFINED].resize( ::com::sun::star::ui::UIElementType::COUNT );
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::ModuleUIConfigurationManager" );
}
ModuleUIConfigurationManager::~ModuleUIConfigurationManager()
{
- for ( int i = 0; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
- delete m_pStorageHandler[i];
}
// XComponent
void SAL_CALL ModuleUIConfigurationManager::dispose() throw (::com::sun::star::uno::RuntimeException)
{
- Reference< XComponent > xThis( static_cast< OWeakObject* >(this), UNO_QUERY );
-
- css::lang::EventObject aEvent( xThis );
- m_aListenerContainer.disposeAndClear( aEvent );
-
- {
- ResetableGuard aGuard( m_aLock );
- try
- {
- if ( m_xModuleImageManager.is() )
- m_xModuleImageManager->dispose();
- }
- catch ( Exception& )
- {
- }
-
- m_xModuleImageManager.clear();
- m_aUIElements[LAYER_USERDEFINED].clear();
- m_aUIElements[LAYER_DEFAULT].clear();
- m_xDefaultConfigStorage.clear();
- m_xUserConfigStorage.clear();
- m_xUserRootCommit.clear();
- m_bConfigRead = false;
- m_bModified = false;
- m_bDisposed = true;
- }
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::dispose" );
+ m_pImpl->dispose();
}
void SAL_CALL ModuleUIConfigurationManager::addEventListener( const Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
- {
- ResetableGuard aGuard( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
- }
-
- m_aListenerContainer.addInterface( ::getCppuType( ( const Reference< XEventListener >* ) NULL ), xListener );
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::addEventListener" );
+ m_pImpl->addEventListener(xListener);
}
void SAL_CALL ModuleUIConfigurationManager::removeEventListener( const Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- m_aListenerContainer.removeInterface( ::getCppuType( ( const Reference< XEventListener >* ) NULL ), xListener );
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::removeEventListener" );
+ m_pImpl->removeEventListener(xListener);
}
// XInitialization
void SAL_CALL ModuleUIConfigurationManager::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
{
- ResetableGuard aLock( m_aLock );
-
- if ( !m_bInitialized )
- {
- ::comphelper::SequenceAsHashMap lArgs(aArguments);
- m_aModuleIdentifier = lArgs.getUnpackedValueOrDefault(::rtl::OUString::createFromAscii("ModuleIdentifier"), ::rtl::OUString());
- m_aModuleShortName = lArgs.getUnpackedValueOrDefault(::rtl::OUString::createFromAscii("ModuleShortName"), ::rtl::OUString());
-
- for ( int i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
- {
- rtl::OUString aResourceType;
- if ( i == ::com::sun::star::ui::UIElementType::MENUBAR )
- aResourceType = PresetHandler::RESOURCETYPE_MENUBAR();
- else if ( i == ::com::sun::star::ui::UIElementType::TOOLBAR )
- aResourceType = PresetHandler::RESOURCETYPE_TOOLBAR();
- else if ( i == ::com::sun::star::ui::UIElementType::STATUSBAR )
- aResourceType = PresetHandler::RESOURCETYPE_STATUSBAR();
-
- if ( aResourceType.getLength() > 0 )
- {
- m_pStorageHandler[i] = new PresetHandler( m_xServiceManager );
- m_pStorageHandler[i]->connectToResource( PresetHandler::E_MODULES,
- aResourceType, // this path wont be used later ... seee next lines!
- m_aModuleShortName,
- css::uno::Reference< css::embed::XStorage >()); // no document root used here!
- }
- }
-
- // initialize root storages for all resource types
- m_xUserRootCommit = css::uno::Reference< css::embed::XTransactedObject >(
- m_pStorageHandler[::com::sun::star::ui::UIElementType::MENUBAR]->getOrCreateRootStorageUser(), css::uno::UNO_QUERY); // can be empty
- m_xDefaultConfigStorage = m_pStorageHandler[::com::sun::star::ui::UIElementType::MENUBAR]->getParentStorageShare(
- m_pStorageHandler[::com::sun::star::ui::UIElementType::MENUBAR]->getWorkingStorageShare());
- m_xUserConfigStorage = m_pStorageHandler[::com::sun::star::ui::UIElementType::MENUBAR]->getParentStorageUser(
- m_pStorageHandler[::com::sun::star::ui::UIElementType::MENUBAR]->getWorkingStorageUser());
-
- if ( m_xUserConfigStorage.is() )
- {
- Reference< XPropertySet > xPropSet( m_xUserConfigStorage, UNO_QUERY );
- if ( xPropSet.is() )
- {
- long nOpenMode = 0;
- Any a = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenMode" )));
- if ( a >>= nOpenMode )
- m_bReadOnly = !( nOpenMode & ElementModes::WRITE );
- }
- }
-
- impl_Initialize();
-
- m_bInitialized = true;
- }
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::initialize" );
+ m_pImpl->initialize(aArguments);
}
// XUIConfiguration
void SAL_CALL ModuleUIConfigurationManager::addConfigurationListener( const Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
- {
- ResetableGuard aGuard( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
- }
-
- m_aListenerContainer.addInterface( ::getCppuType( ( const Reference< XUIConfigurationListener >* ) NULL ), xListener );
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::addConfigurationListener" );
+ m_pImpl->addConfigurationListener(xListener);
}
void SAL_CALL ModuleUIConfigurationManager::removeConfigurationListener( const Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- m_aListenerContainer.removeInterface( ::getCppuType( ( const Reference< XUIConfigurationListener >* ) NULL ), xListener );
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::removeConfigurationListener" );
+ m_pImpl->removeConfigurationListener(xListener);
}
// XUIConfigurationManager
void SAL_CALL ModuleUIConfigurationManager::reset() throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
-
- bool bResetStorage( false );
-
- if ( !isReadOnly() )
- {
- // Remove all elements from our user-defined storage!
- try
- {
- for ( int i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
- {
- UIElementType& rElementType = m_aUIElements[LAYER_USERDEFINED][i];
- Reference< XStorage > xSubStorage( rElementType.xStorage, UNO_QUERY );
-
- if ( xSubStorage.is() )
- {
- bool bCommitSubStorage( false );
- Reference< XNameAccess > xSubStorageNameAccess( xSubStorage, UNO_QUERY );
- Sequence< OUString > aUIElementStreamNames = xSubStorageNameAccess->getElementNames();
- for ( sal_Int32 j = 0; j < aUIElementStreamNames.getLength(); j++ )
- {
- xSubStorage->removeElement( aUIElementStreamNames[j] );
- bCommitSubStorage = true;
- }
-
- if ( bCommitSubStorage )
- {
- Reference< XTransactedObject > xTransactedObject( xSubStorage, UNO_QUERY );
- if ( xTransactedObject.is() )
- xTransactedObject->commit();
- m_pStorageHandler[i]->commitUserChanges();
- }
- }
- }
-
- bResetStorage = true;
-
- // remove settings from user defined layer and notify listener about removed settings data!
- ConfigEventNotifyContainer aRemoveEventNotifyContainer;
- ConfigEventNotifyContainer aReplaceEventNotifyContainer;
- for ( sal_Int16 j = 1; j < ::com::sun::star::ui::UIElementType::COUNT; j++ )
- {
- try
- {
- UIElementType& rUserElementType = m_aUIElements[LAYER_USERDEFINED][j];
- UIElementType& rDefaultElementType = m_aUIElements[LAYER_DEFAULT][j];
-
- impl_resetElementTypeData( rUserElementType, rDefaultElementType, aRemoveEventNotifyContainer, aReplaceEventNotifyContainer );
- rUserElementType.bModified = sal_False;
- }
- catch ( Exception& )
- {
- throw IOException();
- }
- }
-
- m_bModified = sal_False;
-
- // Unlock mutex before notify our listeners
- aGuard.unlock();
-
- // Notify our listeners
- sal_uInt32 k = 0;
- for ( k = 0; k < aRemoveEventNotifyContainer.size(); k++ )
- implts_notifyContainerListener( aRemoveEventNotifyContainer[k], NotifyOp_Remove );
- for ( k = 0; k < aReplaceEventNotifyContainer.size(); k++ )
- implts_notifyContainerListener( aReplaceEventNotifyContainer[k], NotifyOp_Replace );
- }
- catch ( ::com::sun::star::lang::IllegalArgumentException& )
- {
- }
- catch ( ::com::sun::star::container::NoSuchElementException& )
- {
- }
- catch ( ::com::sun::star::embed::InvalidStorageException& )
- {
- }
- catch ( ::com::sun::star::embed::StorageWrappedTargetException& )
- {
- }
- }
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::reset" );
+ m_pImpl->reset();
}
Sequence< Sequence< PropertyValue > > SAL_CALL ModuleUIConfigurationManager::getUIElementsInfo( sal_Int16 ElementType )
throw ( IllegalArgumentException, RuntimeException )
{
- if (( ElementType < 0 ) || ( ElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
- throw IllegalArgumentException();
-
- ResetableGuard aGuard( m_aLock );
- if ( m_bDisposed )
- throw DisposedException();
-
- Sequence< Sequence< PropertyValue > > aElementInfoSeq;
- UIElementInfoHashMap aUIElementInfoCollection;
-
- if ( ElementType == ::com::sun::star::ui::UIElementType::UNKNOWN )
- {
- for ( sal_Int16 i = 0; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
- impl_fillSequenceWithElementTypeInfo( aUIElementInfoCollection, sal_Int16( i ) );
- }
- else
- impl_fillSequenceWithElementTypeInfo( aUIElementInfoCollection, ElementType );
-
- Sequence< PropertyValue > aUIElementInfo( 2 );
- aUIElementInfo[0].Name = m_aPropResourceURL;
- aUIElementInfo[1].Name = m_aPropUIName;
-
- aElementInfoSeq.realloc( aUIElementInfoCollection.size() );
- UIElementInfoHashMap::const_iterator pIter = aUIElementInfoCollection.begin();
-
- sal_Int32 n = 0;
- while ( pIter != aUIElementInfoCollection.end() )
- {
- aUIElementInfo[0].Value <<= pIter->second.aResourceURL;
- aUIElementInfo[1].Value <<= pIter->second.aUIName;
- aElementInfoSeq[n++] = aUIElementInfo;
- ++pIter;
- }
-
- return aElementInfoSeq;
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::getUIElementsInfo" );
+ return m_pImpl->getUIElementsInfo(ElementType);
}
Reference< XIndexContainer > SAL_CALL ModuleUIConfigurationManager::createSettings() throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::createSettings" );
// Creates an empty item container which can be filled from outside
- return Reference< XIndexContainer >( static_cast< OWeakObject * >( new RootItemContainer() ), UNO_QUERY );
+ return m_pImpl->createSettings();
}
sal_Bool SAL_CALL ModuleUIConfigurationManager::hasSettings( const ::rtl::OUString& ResourceURL )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{
- sal_Int16 nElementType = RetrieveTypeFromResourceURL( ResourceURL );
-
- if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
- ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
- throw IllegalArgumentException();
- else
- {
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType, false );
- if ( pDataSettings )
- return sal_True;
- }
-
- return sal_False;
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::hasSettings" );
+ return m_pImpl->hasSettings(ResourceURL);
}
Reference< XIndexAccess > SAL_CALL ModuleUIConfigurationManager::getSettings( const ::rtl::OUString& ResourceURL, sal_Bool bWriteable )
throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{
- sal_Int16 nElementType = RetrieveTypeFromResourceURL( ResourceURL );
-
- if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
- ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
- throw IllegalArgumentException();
- else
- {
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType );
- if ( pDataSettings )
- {
- // Create a copy of our data if someone wants to change the data.
- if ( bWriteable )
- return Reference< XIndexAccess >( static_cast< OWeakObject * >( new RootItemContainer( pDataSettings->xSettings ) ), UNO_QUERY );
- else
- return pDataSettings->xSettings;
- }
- }
-
- throw NoSuchElementException();
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::getSettings" );
+ return m_pImpl->getSettings(ResourceURL,bWriteable);
}
void SAL_CALL ModuleUIConfigurationManager::replaceSettings( const ::rtl::OUString& ResourceURL, const Reference< ::com::sun::star::container::XIndexAccess >& aNewData )
throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IllegalAccessException, ::com::sun::star::uno::RuntimeException)
{
- sal_Int16 nElementType = RetrieveTypeFromResourceURL( ResourceURL );
-
- if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
- ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
- throw IllegalArgumentException();
- else if ( m_bReadOnly )
- throw IllegalAccessException();
- else
- {
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType );
- if ( pDataSettings )
- {
- if ( !pDataSettings->bDefaultNode )
- {
- // we have a settings entry in our user-defined layer - replace
- Reference< XIndexAccess > xOldSettings = pDataSettings->xSettings;
-
- // Create a copy of the data if the container is not const
- Reference< XIndexReplace > xReplace( aNewData, UNO_QUERY );
- if ( xReplace.is() )
- pDataSettings->xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( aNewData ) ), UNO_QUERY );
- else
- pDataSettings->xSettings = aNewData;
- pDataSettings->bDefault = false;
- pDataSettings->bModified = true;
- m_bModified = true;
-
- // Modify type container
- UIElementType& rElementType = m_aUIElements[LAYER_USERDEFINED][nElementType];
- rElementType.bModified = true;
-
- Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
-
- // Create event to notify listener about replaced element settings
- ConfigurationEvent aEvent;
- Reference< XInterface > xIfac( xThis, UNO_QUERY );
-
- aEvent.ResourceURL = ResourceURL;
- aEvent.Accessor <<= xThis;
- aEvent.Source = xIfac;
- aEvent.ReplacedElement <<= xOldSettings;
- aEvent.Element <<= pDataSettings->xSettings;
-
- aGuard.unlock();
-
- implts_notifyContainerListener( aEvent, NotifyOp_Replace );
- }
- else
- {
- // we have no settings in our user-defined layer - insert
- UIElementData aUIElementData;
-
- aUIElementData.bDefault = false;
- aUIElementData.bDefaultNode = false;
- aUIElementData.bModified = true;
-
- // Create a copy of the data if the container is not const
- Reference< XIndexReplace > xReplace( aNewData, UNO_QUERY );
- if ( xReplace.is() )
- aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( aNewData ) ), UNO_QUERY );
- else
- aUIElementData.xSettings = aNewData;
- aUIElementData.aName = RetrieveNameFromResourceURL( ResourceURL ) + m_aXMLPostfix;
- aUIElementData.aResourceURL = ResourceURL;
- m_bModified = true;
-
- // Modify type container
- UIElementType& rElementType = m_aUIElements[LAYER_USERDEFINED][nElementType];
- rElementType.bModified = true;
-
- UIElementDataHashMap& rElements = rElementType.aElementsHashMap;
-
- // Check our user element settings hash map as it can already contain settings that have been set to default!
- // If no node can be found, we have to insert it.
- UIElementDataHashMap::iterator pIter = rElements.find( ResourceURL );
- if ( pIter != rElements.end() )
- pIter->second = aUIElementData;
- else
- rElements.insert( UIElementDataHashMap::value_type( ResourceURL, aUIElementData ));
-
- Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- Reference< XInterface > xIfac( xThis, UNO_QUERY );
-
- // Create event to notify listener about replaced element settings
- ConfigurationEvent aEvent;
-
- aEvent.ResourceURL = ResourceURL;
- aEvent.Accessor <<= xThis;
- aEvent.Source = xIfac;
- aEvent.ReplacedElement <<= pDataSettings->xSettings;
- aEvent.Element <<= aUIElementData.xSettings;
-
- aGuard.unlock();
-
- implts_notifyContainerListener( aEvent, NotifyOp_Replace );
- }
- }
- else
- throw NoSuchElementException();
- }
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::replaceSettings" );
+ return m_pImpl->replaceSettings(ResourceURL,aNewData);
}
void SAL_CALL ModuleUIConfigurationManager::removeSettings( const ::rtl::OUString& ResourceURL )
throw ( NoSuchElementException, IllegalArgumentException, IllegalAccessException, RuntimeException)
{
- sal_Int16 nElementType = RetrieveTypeFromResourceURL( ResourceURL );
-
- if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
- ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
- throw IllegalArgumentException();
- else if ( m_bReadOnly )
- throw IllegalAccessException();
- else
- {
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType );
- if ( pDataSettings )
- {
- // If element settings are default, we don't need to change anything!
- if ( pDataSettings->bDefault )
- return;
- else
- {
- Reference< XIndexAccess > xRemovedSettings = pDataSettings->xSettings;
- pDataSettings->bDefault = true;
-
- // check if this is a default layer node
- if ( !pDataSettings->bDefaultNode )
- pDataSettings->bModified = true; // we have to remove this node from the user layer!
- pDataSettings->xSettings.clear();
- m_bModified = true; // user layer must be written
-
- // Modify type container
- UIElementType& rElementType = m_aUIElements[LAYER_USERDEFINED][nElementType];
- rElementType.bModified = true;
-
- Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- Reference< XInterface > xIfac( xThis, UNO_QUERY );
-
- // Check if we have settings in the default layer which replaces the user-defined one!
- UIElementData* pDefaultDataSettings = impl_findUIElementData( ResourceURL, nElementType );
- if ( pDefaultDataSettings )
- {
- // Create event to notify listener about replaced element settings
- ConfigurationEvent aEvent;
-
- aEvent.ResourceURL = ResourceURL;
- aEvent.Accessor <<= xThis;
- aEvent.Source = xIfac;
- aEvent.Element <<= xRemovedSettings;
- aEvent.ReplacedElement <<= pDefaultDataSettings->xSettings;
-
- aGuard.unlock();
-
- implts_notifyContainerListener( aEvent, NotifyOp_Replace );
- }
- else
- {
- // Create event to notify listener about removed element settings
- ConfigurationEvent aEvent;
-
- aEvent.ResourceURL = ResourceURL;
- aEvent.Accessor <<= xThis;
- aEvent.Source = xIfac;
- aEvent.Element <<= xRemovedSettings;
-
- aGuard.unlock();
-
- implts_notifyContainerListener( aEvent, NotifyOp_Remove );
- }
- }
- }
- else
- throw NoSuchElementException();
- }
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::removeSettings" );
+ m_pImpl->removeSettings(ResourceURL);
}
void SAL_CALL ModuleUIConfigurationManager::insertSettings( const ::rtl::OUString& NewResourceURL, const Reference< XIndexAccess >& aNewData )
throw ( ElementExistException, IllegalArgumentException, IllegalAccessException, RuntimeException )
{
- sal_Int16 nElementType = RetrieveTypeFromResourceURL( NewResourceURL );
-
- if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
- ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
- throw IllegalArgumentException();
- else if ( m_bReadOnly )
- throw IllegalAccessException();
- else
- {
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- UIElementData* pDataSettings = impl_findUIElementData( NewResourceURL, nElementType );
- if ( !pDataSettings )
- {
- UIElementData aUIElementData;
-
- aUIElementData.bDefault = false;
- aUIElementData.bDefaultNode = false;
- aUIElementData.bModified = true;
-
- // Create a copy of the data if the container is not const
- Reference< XIndexReplace > xReplace( aNewData, UNO_QUERY );
- if ( xReplace.is() )
- aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( aNewData ) ), UNO_QUERY );
- else
- aUIElementData.xSettings = aNewData;
- aUIElementData.aName = RetrieveNameFromResourceURL( NewResourceURL ) + m_aXMLPostfix;
- aUIElementData.aResourceURL = NewResourceURL;
- m_bModified = true;
-
- UIElementType& rElementType = m_aUIElements[LAYER_USERDEFINED][nElementType];
- rElementType.bModified = true;
-
- UIElementDataHashMap& rElements = rElementType.aElementsHashMap;
- rElements.insert( UIElementDataHashMap::value_type( NewResourceURL, aUIElementData ));
-
- Reference< XIndexAccess > xInsertSettings( aUIElementData.xSettings );
- Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- Reference< XInterface > xIfac( xThis, UNO_QUERY );
-
- // Create event to notify listener about removed element settings
- ConfigurationEvent aEvent;
-
- aEvent.ResourceURL = NewResourceURL;
- aEvent.Accessor <<= xThis;
- aEvent.Source = xIfac;
- aEvent.Element <<= xInsertSettings;
-
- aGuard.unlock();
-
- implts_notifyContainerListener( aEvent, NotifyOp_Insert );
- }
- else
- throw ElementExistException();
- }
+ m_pImpl->insertSettings(NewResourceURL,aNewData);
}
Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getImageManager() throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( !m_xModuleImageManager.is() )
- {
- m_xModuleImageManager = Reference< XComponent >( static_cast< cppu::OWeakObject *>( new ModuleImageManager( m_xServiceManager )),
- UNO_QUERY );
- Reference< XInitialization > xInit( m_xModuleImageManager, UNO_QUERY );
-
- Sequence< Any > aPropSeq( 3 );
- PropertyValue aPropValue;
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UserConfigStorage" ));
- aPropValue.Value = makeAny( m_xUserConfigStorage );
- aPropSeq[0] = makeAny( aPropValue );
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ModuleIdentifier" ));
- aPropValue.Value = makeAny( m_aModuleIdentifier );
- aPropSeq[1] = makeAny( aPropValue );
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UserRootCommit" ));
- aPropValue.Value = makeAny( m_xUserRootCommit );
- aPropSeq[2] = makeAny( aPropValue );
-
- xInit->initialize( aPropSeq );
- }
-
- return Reference< XInterface >( m_xModuleImageManager, UNO_QUERY );
-
-// return Reference< XInterface >();
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::getImageManager" );
+ return m_pImpl->getImageManager();
}
Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getShortCutManager() throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
- Reference< XMultiServiceFactory > xSMGR = m_xServiceManager;
- ::rtl::OUString aModule = /*m_aModuleShortName*/m_aModuleIdentifier;
- aGuard.unlock();
-
- Reference< XInterface > xManager = xSMGR->createInstance(SERVICENAME_MODULEACCELERATORCONFIGURATION);
- Reference< XInitialization > xInit (xManager, UNO_QUERY_THROW);
-
- PropertyValue aProp;
- aProp.Name = ::rtl::OUString::createFromAscii("ModuleIdentifier");
- aProp.Value <<= aModule;
-
- Sequence< Any > lArgs(1);
- lArgs[0] <<= aProp;
-
- xInit->initialize(lArgs);
-
- return xManager;
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::getShortCutManager" );
+ return m_pImpl->getShortCutManager();
}
Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getEventsManager() throw (::com::sun::star::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::getEventsManager" );
return Reference< XInterface >();
}
@@ -1406,210 +242,46 @@ Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getEventsManager(
sal_Bool SAL_CALL ModuleUIConfigurationManager::isDefaultSettings( const ::rtl::OUString& ResourceURL )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{
- sal_Int16 nElementType = RetrieveTypeFromResourceURL( ResourceURL );
-
- if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
- ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
- throw IllegalArgumentException();
- else
- {
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType, false );
- if ( pDataSettings && pDataSettings->bDefaultNode )
- return sal_True;
- }
-
- return sal_False;
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::isDefaultSettings" );
+ return m_pImpl->isDefaultSettings(ResourceURL);
}
Reference< XIndexAccess > SAL_CALL ModuleUIConfigurationManager::getDefaultSettings( const ::rtl::OUString& ResourceURL )
throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{
- sal_Int16 nElementType = RetrieveTypeFromResourceURL( ResourceURL );
-
- if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
- ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
- throw IllegalArgumentException();
- else
- {
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- // preload list of element types on demand
- impl_preloadUIElementTypeList( LAYER_DEFAULT, nElementType );
-
- // Look into our default vector/hash_map combination
- UIElementDataHashMap& rDefaultHashMap = m_aUIElements[LAYER_DEFAULT][nElementType].aElementsHashMap;
- UIElementDataHashMap::iterator pIter = rDefaultHashMap.find( ResourceURL );
- if ( pIter != rDefaultHashMap.end() )
- {
- if ( !pIter->second.xSettings.is() )
- impl_requestUIElementData( nElementType, LAYER_DEFAULT, pIter->second );
- return pIter->second.xSettings;
- }
- }
-
- // Nothing has been found!
- throw NoSuchElementException();
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::getDefaultSettings" );
+ return m_pImpl->getDefaultSettings(ResourceURL);
}
// XUIConfigurationPersistence
void SAL_CALL ModuleUIConfigurationManager::reload() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_xUserConfigStorage.is() && m_bModified && !m_bReadOnly )
- {
- // Try to access our module sub folder
- ConfigEventNotifyContainer aRemoveNotifyContainer;
- ConfigEventNotifyContainer aReplaceNotifyContainer;
- for ( sal_Int16 i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
- {
- try
- {
- UIElementType& rUserElementType = m_aUIElements[LAYER_USERDEFINED][i];
- UIElementType& rDefaultElementType = m_aUIElements[LAYER_DEFAULT][i];
-
- if ( rUserElementType.bModified )
- impl_reloadElementTypeData( rUserElementType, rDefaultElementType, aRemoveNotifyContainer, aReplaceNotifyContainer );
- }
- catch ( Exception& )
- {
- throw IOException();
- }
- }
-
- m_bModified = sal_False;
-
- // Unlock mutex before notify our listeners
- aGuard.unlock();
-
- // Notify our listeners
- for ( sal_uInt32 j = 0; j < aRemoveNotifyContainer.size(); j++ )
- implts_notifyContainerListener( aRemoveNotifyContainer[j], NotifyOp_Remove );
- for ( sal_uInt32 k = 0; k < aReplaceNotifyContainer.size(); k++ )
- implts_notifyContainerListener( aReplaceNotifyContainer[k], NotifyOp_Replace );
- }
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::reload" );
+ m_pImpl->reload();
}
void SAL_CALL ModuleUIConfigurationManager::store() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_xUserConfigStorage.is() && m_bModified && !m_bReadOnly )
- {
- // Try to access our module sub folder
- for ( int i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
- {
- try
- {
- UIElementType& rElementType = m_aUIElements[LAYER_USERDEFINED][i];
- Reference< XStorage > xStorage( rElementType.xStorage, UNO_QUERY );
-
- if ( rElementType.bModified && xStorage.is() )
- {
- impl_storeElementTypeData( xStorage, rElementType );
- m_pStorageHandler[i]->commitUserChanges();
- }
- }
- catch ( Exception& )
- {
- throw IOException();
- }
- }
-
- m_bModified = false;
- }
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::store" );
+ m_pImpl->store();
}
void SAL_CALL ModuleUIConfigurationManager::storeToStorage( const Reference< XStorage >& Storage ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_xUserConfigStorage.is() && m_bModified && !m_bReadOnly )
- {
- // Try to access our module sub folder
- for ( int i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
- {
- try
- {
- Reference< XStorage > xElementTypeStorage( Storage->openStorageElement(
- OUString::createFromAscii( UIELEMENTTYPENAMES[i] ), ElementModes::READWRITE ));
- UIElementType& rElementType = m_aUIElements[LAYER_USERDEFINED][i];
-
- if ( rElementType.bModified && xElementTypeStorage.is() )
- impl_storeElementTypeData( xElementTypeStorage, rElementType, false ); // store data to storage, but don't reset modify flag!
- }
- catch ( Exception& )
- {
- throw IOException();
- }
- }
-
- Reference< XTransactedObject > xTransactedObject( Storage, UNO_QUERY );
- if ( xTransactedObject.is() )
- xTransactedObject->commit();
- }
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::storeToStorage" );
+ m_pImpl->storeToStorage(Storage);
}
sal_Bool SAL_CALL ModuleUIConfigurationManager::isModified() throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- return m_bModified;
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::isModified" );
+ return m_pImpl->isModified();
}
sal_Bool SAL_CALL ModuleUIConfigurationManager::isReadOnly() throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- return m_bReadOnly;
-}
-
-void ModuleUIConfigurationManager::implts_notifyContainerListener( const ConfigurationEvent& aEvent, NotifyOp eOp )
-{
- ::cppu::OInterfaceContainerHelper* pContainer = m_aListenerContainer.getContainer( ::getCppuType( ( const css::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >*) NULL ) );
- if ( pContainer != NULL )
- {
- ::cppu::OInterfaceIteratorHelper pIterator( *pContainer );
- while ( pIterator.hasMoreElements() )
- {
- try
- {
- switch ( eOp )
- {
- case NotifyOp_Replace:
- ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementReplaced( aEvent );
- break;
- case NotifyOp_Insert:
- ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementInserted( aEvent );
- break;
- case NotifyOp_Remove:
- ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementRemoved( aEvent );
- break;
- }
- }
- catch( css::uno::RuntimeException& )
- {
- pIterator.remove();
- }
- }
- }
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::isReadOnly" );
+ return m_pImpl->isReadOnly();
}
} // namespace framework
diff --git a/framework/source/uiconfiguration/uicategorydescription.cxx b/framework/source/uiconfiguration/uicategorydescription.cxx
index f2569e211662..a7f63db38257 100644
--- a/framework/source/uiconfiguration/uicategorydescription.cxx
+++ b/framework/source/uiconfiguration/uicategorydescription.cxx
@@ -56,7 +56,7 @@
// includes of other projects
//_________________________________________________________________________________________________________________
#include <rtl/ustrbuf.hxx>
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <unotools/configmgr.hxx>
#include <tools/string.hxx>
@@ -101,23 +101,14 @@ namespace framework
// Configuration access class for PopupMenuControllerFactory implementation
//*****************************************************************************************************************
-class ConfigurationAccess_UICategory : // interfaces
- public XTypeProvider ,
- public XNameAccess ,
- public XContainerListener ,
- // baseclasses
- // Order is neccessary for right initialization!
+class ConfigurationAccess_UICategory : // Order is neccessary for right initialization!
private ThreadHelpBase ,
- public ::cppu::OWeakObject
+ public ::cppu::WeakImplHelper2<XNameAccess,XContainerListener>
{
public:
ConfigurationAccess_UICategory( const ::rtl::OUString& aModuleName, const Reference< XNameAccess >& xGenericUICommands, const Reference< XMultiServiceFactory >& rServiceManager );
virtual ~ConfigurationAccess_UICategory();
- // XInterface, XTypeProvider
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
-
// XNameAccess
virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
@@ -171,22 +162,6 @@ class ConfigurationAccess_UICategory : // interfaces
//*****************************************************************************************************************
// XInterface, XTypeProvider
//*****************************************************************************************************************
-DEFINE_XINTERFACE_5 ( ConfigurationAccess_UICategory ,
- OWeakObject ,
- DIRECT_INTERFACE ( css::container::XNameAccess ),
- DIRECT_INTERFACE ( css::container::XContainerListener ),
- DIRECT_INTERFACE ( css::lang::XTypeProvider ),
- DERIVED_INTERFACE( css::container::XElementAccess, css::container::XNameAccess ),
- DERIVED_INTERFACE( css::lang::XEventListener, XContainerListener )
- )
-
-DEFINE_XTYPEPROVIDER_5 ( ConfigurationAccess_UICategory ,
- css::container::XNameAccess ,
- css::container::XElementAccess ,
- css::container::XContainerListener ,
- css::lang::XTypeProvider ,
- css::lang::XEventListener
- )
ConfigurationAccess_UICategory::ConfigurationAccess_UICategory( const rtl::OUString& aModuleName, const Reference< XNameAccess >& rGenericUICategories, const Reference< XMultiServiceFactory >& rServiceManager ) :
ThreadHelpBase(),
@@ -197,14 +172,12 @@ ConfigurationAccess_UICategory::ConfigurationAccess_UICategory( const rtl::OUStr
m_bConfigAccessInitialized( sal_False ),
m_bCacheFilled( sal_False )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_UICategory::ConfigurationAccess_UICategory" );
// Create configuration hierachical access name
m_aConfigCategoryAccess += aModuleName;
m_aConfigCategoryAccess += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CONFIGURATION_CATEGORY_ELEMENT_ACCESS ));
- m_xConfigProvider = Reference< XMultiServiceFactory >( rServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationProvider" ))),
- UNO_QUERY );
+ m_xConfigProvider = Reference< XMultiServiceFactory >( rServiceManager->createInstance(SERVICENAME_CFGPROVIDER),UNO_QUERY );
}
ConfigurationAccess_UICategory::~ConfigurationAccess_UICategory()
@@ -220,6 +193,7 @@ ConfigurationAccess_UICategory::~ConfigurationAccess_UICategory()
Any SAL_CALL ConfigurationAccess_UICategory::getByName( const ::rtl::OUString& rId )
throw ( NoSuchElementException, WrappedTargetException, RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_UICategory::getByName" );
ResetableGuard aLock( m_aLock );
if ( !m_bConfigAccessInitialized )
{
@@ -240,42 +214,42 @@ throw ( NoSuchElementException, WrappedTargetException, RuntimeException)
Sequence< ::rtl::OUString > SAL_CALL ConfigurationAccess_UICategory::getElementNames()
throw ( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_UICategory::getElementNames" );
return getAllIds();
}
sal_Bool SAL_CALL ConfigurationAccess_UICategory::hasByName( const ::rtl::OUString& rId )
throw (::com::sun::star::uno::RuntimeException)
{
- Any a = getByName( rId );
- if ( a != Any() )
- return sal_True;
- else
- return sal_False;
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_UICategory::hasByName" );
+ return getByName( rId ).hasValue();
}
// XElementAccess
Type SAL_CALL ConfigurationAccess_UICategory::getElementType()
throw ( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_UICategory::getElementType" );
return( ::getCppuType( (const rtl::OUString*)NULL ) );
}
sal_Bool SAL_CALL ConfigurationAccess_UICategory::hasElements()
throw ( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_UICategory::hasElements" );
// There must be global categories!
return sal_True;
}
sal_Bool ConfigurationAccess_UICategory::fillCache()
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_UICategory::fillCache" );
RTL_LOGFILE_CONTEXT( aLog, "framework (cd100003) ::ConfigurationAccess_UICategory::fillCache" );
if ( m_bCacheFilled )
return sal_True;
sal_Int32 i( 0 );
- Any a;
rtl::OUString aUIName;
Sequence< ::rtl::OUString > aNameSeq = m_xConfigAccess->getElementNames();
@@ -283,12 +257,10 @@ sal_Bool ConfigurationAccess_UICategory::fillCache()
{
try
{
- Reference< XNameAccess > xNameAccess;
- a = m_xConfigAccess->getByName( aNameSeq[i] );
- if ( a >>= xNameAccess )
+ Reference< XNameAccess > xNameAccess(m_xConfigAccess->getByName( aNameSeq[i] ),UNO_QUERY);
+ if ( xNameAccess.is() )
{
- a = xNameAccess->getByName( m_aPropUIName );
- a >>= aUIName;
+ xNameAccess->getByName( m_aPropUIName ) >>= aUIName;
m_aIdCache.insert( IdToInfoCache::value_type( aNameSeq[i], aUIName ));
}
@@ -308,6 +280,7 @@ sal_Bool ConfigurationAccess_UICategory::fillCache()
Any ConfigurationAccess_UICategory::getUINameFromID( const rtl::OUString& rId )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_UICategory::getUINameFromID" );
Any a;
try
@@ -343,6 +316,7 @@ Any ConfigurationAccess_UICategory::getUINameFromID( const rtl::OUString& rId )
Any ConfigurationAccess_UICategory::getUINameFromCache( const rtl::OUString& rId )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_UICategory::getUINameFromCache" );
Any a;
IdToInfoCache::const_iterator pIter = m_aIdCache.find( rId );
@@ -354,6 +328,7 @@ Any ConfigurationAccess_UICategory::getUINameFromCache( const rtl::OUString& rId
Sequence< rtl::OUString > ConfigurationAccess_UICategory::getAllIds()
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_UICategory::getAllIds" );
// SAFE
ResetableGuard aLock( m_aLock );
@@ -402,20 +377,17 @@ Sequence< rtl::OUString > ConfigurationAccess_UICategory::getAllIds()
sal_Bool ConfigurationAccess_UICategory::initializeConfigAccess()
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_UICategory::initializeConfigAccess" );
Sequence< Any > aArgs( 1 );
PropertyValue aPropValue;
try
{
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ));
- aPropValue.Value = makeAny( m_aConfigCategoryAccess );
+ aPropValue.Value <<= m_aConfigCategoryAccess;
aArgs[0] <<= aPropValue;
- m_xConfigAccess = Reference< XNameAccess >( m_xConfigProvider->createInstanceWithArguments(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationAccess" )),
- aArgs ),
- UNO_QUERY );
+ m_xConfigAccess = Reference< XNameAccess >( m_xConfigProvider->createInstanceWithArguments(SERVICENAME_CFGREADACCESS,aArgs ),UNO_QUERY );
if ( m_xConfigAccess.is() )
{
// Add as container listener
@@ -439,19 +411,23 @@ sal_Bool ConfigurationAccess_UICategory::initializeConfigAccess()
// container.XContainerListener
void SAL_CALL ConfigurationAccess_UICategory::elementInserted( const ContainerEvent& ) throw(RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_UICategory::elementInserted" );
}
void SAL_CALL ConfigurationAccess_UICategory::elementRemoved ( const ContainerEvent& ) throw(RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_UICategory::elementRemoved " );
}
void SAL_CALL ConfigurationAccess_UICategory::elementReplaced( const ContainerEvent& ) throw(RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_UICategory::elementReplaced" );
}
// lang.XEventListener
void SAL_CALL ConfigurationAccess_UICategory::disposing( const EventObject& aEvent ) throw(RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_UICategory::disposing" );
// SAFE
// remove our reference to the config access
ResetableGuard aLock( m_aLock );
@@ -465,21 +441,6 @@ void SAL_CALL ConfigurationAccess_UICategory::disposing( const EventObject& aEve
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_4 ( UICategoryDescription ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XServiceInfo ),
- DIRECT_INTERFACE( css::container::XNameAccess ),
- DERIVED_INTERFACE( css::container::XElementAccess, css::container::XNameAccess )
- )
-
-DEFINE_XTYPEPROVIDER_4 ( UICategoryDescription ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- css::container::XNameAccess ,
- css::container::XElementAccess
- )
-
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( UICategoryDescription ,
::cppu::OWeakObject ,
SERVICENAME_UICATEGORYDESCRIPTION ,
@@ -489,139 +450,29 @@ DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( UICategoryDescription
DEFINE_INIT_SERVICE ( UICategoryDescription, {} )
UICategoryDescription::UICategoryDescription( const Reference< XMultiServiceFactory >& xServiceManager ) :
- ThreadHelpBase(),
- m_xServiceManager( xServiceManager )
+ UICommandDescription(xServiceManager,true)
{
Reference< XNameAccess > xEmpty;
- rtl::OUString aGenericCategories( ::rtl::OUString::createFromAscii( "GenericCategories" ));
- m_xGenericCategories = new ConfigurationAccess_UICategory( aGenericCategories, xEmpty, xServiceManager );
-
- m_xModuleManager = Reference< XModuleManager >( m_xServiceManager->createInstance( SERVICENAME_MODULEMANAGER ),
- UNO_QUERY );
- Reference< XNameAccess > xNameAccess( m_xModuleManager, UNO_QUERY_THROW );
- Sequence< rtl::OUString > aElementNames = xNameAccess->getElementNames();
- Sequence< PropertyValue > aSeq;
- ::rtl::OUString aModuleIdentifier;
+ rtl::OUString aGenericCategories( RTL_CONSTASCII_USTRINGPARAM( "GenericCategories" ));
+ m_xGenericUICommands = new ConfigurationAccess_UICategory( aGenericCategories, xEmpty, xServiceManager );
// insert generic categories mappings
- m_aModuleToCategoryFileMap.insert( ModuleToCategoryFileMap::value_type(
+ m_aModuleToCommandFileMap.insert( ModuleToCommandFileMap::value_type(
rtl::OUString::createFromAscii( GENERIC_MODULE_NAME ), aGenericCategories ));
- CategoryHashMap::iterator pCatIter = m_aCategoryHashMap.find( aGenericCategories );
- if ( pCatIter != m_aCategoryHashMap.end() )
- pCatIter->second = m_xGenericCategories;
-
- for ( sal_Int32 i = 0; i < aElementNames.getLength(); i++ )
- {
- aModuleIdentifier = aElementNames[i];
- Any a = xNameAccess->getByName( aModuleIdentifier );
- if ( a >>= aSeq )
- {
- ::rtl::OUString aCmdCategoryStr;
- for ( sal_Int32 y = 0; y < aSeq.getLength(); y++ )
- {
- if ( aSeq[y].Name.equalsAscii("ooSetupFactoryCmdCategoryConfigRef") )
- {
- aSeq[y].Value >>= aCmdCategoryStr;
- break;
- }
- }
-
- // Create first mapping module identifier ==> category file
- m_aModuleToCategoryFileMap.insert(
- ModuleToCategoryFileMap::value_type( aModuleIdentifier, aCmdCategoryStr ));
+ UICommandsHashMap::iterator pCatIter = m_aUICommandsHashMap.find( aGenericCategories );
+ if ( pCatIter != m_aUICommandsHashMap.end() )
+ pCatIter->second = m_xGenericUICommands;
- // Create second mapping category file ==> category instance
- CategoryHashMap::iterator pIter = m_aCategoryHashMap.find( aCmdCategoryStr );
- if ( pIter == m_aCategoryHashMap.end() )
- m_aCategoryHashMap.insert( CategoryHashMap::value_type( aCmdCategoryStr, xEmpty ));
- }
- }
+ impl_fillElements("ooSetupFactoryCmdCategoryConfigRef");
}
UICategoryDescription::~UICategoryDescription()
{
- ResetableGuard aLock( m_aLock );
- m_aModuleToCategoryFileMap.clear();
- m_aCategoryHashMap.clear();
- m_xGenericCategories.clear();
}
-
-Any SAL_CALL UICategoryDescription::getByName( const ::rtl::OUString& aName )
-throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+Reference< XNameAccess > UICategoryDescription::impl_createConfigAccess(const ::rtl::OUString& _sName)
{
- Any a;
-
- ResetableGuard aLock( m_aLock );
-
- ModuleToCategoryFileMap::const_iterator pM2CIter = m_aModuleToCategoryFileMap.find( aName );
- if ( pM2CIter != m_aModuleToCategoryFileMap.end() )
- {
- ::rtl::OUString aCommandFile( pM2CIter->second );
- CategoryHashMap::iterator pIter = m_aCategoryHashMap.find( aCommandFile );
- if ( pIter != m_aCategoryHashMap.end() )
- {
- if ( pIter->second.is() )
- a <<= pIter->second;
- else
- {
- Reference< XNameAccess > xUICategory;
- ConfigurationAccess_UICategory* pUICategory = new ConfigurationAccess_UICategory( aCommandFile,
- m_xGenericCategories,
- m_xServiceManager );
- xUICategory = Reference< XNameAccess >( static_cast< cppu::OWeakObject* >( pUICategory ),UNO_QUERY );
- pIter->second = xUICategory;
- a <<= xUICategory;
- }
- }
- }
- else
- {
- throw NoSuchElementException();
- }
-
- return a;
-}
-
-Sequence< ::rtl::OUString > SAL_CALL UICategoryDescription::getElementNames()
-throw (::com::sun::star::uno::RuntimeException)
-{
- ResetableGuard aLock( m_aLock );
-
- Sequence< rtl::OUString > aSeq( m_aModuleToCategoryFileMap.size() );
-
- sal_Int32 n = 0;
- ModuleToCategoryFileMap::const_iterator pIter = m_aModuleToCategoryFileMap.begin();
- while ( pIter != m_aModuleToCategoryFileMap.end() )
- {
- aSeq[n] = pIter->first;
- ++pIter;
- }
-
- return aSeq;
-}
-
-sal_Bool SAL_CALL UICategoryDescription::hasByName( const ::rtl::OUString& aName )
-throw (::com::sun::star::uno::RuntimeException)
-{
- ResetableGuard aLock( m_aLock );
-
- ModuleToCategoryFileMap::const_iterator pIter = m_aModuleToCategoryFileMap.find( aName );
- return ( pIter != m_aModuleToCategoryFileMap.end() );
-}
-
-// XElementAccess
-Type SAL_CALL UICategoryDescription::getElementType()
-throw (::com::sun::star::uno::RuntimeException)
-{
- return( ::getCppuType( (const Reference< XNameAccess >*)NULL ) );
-}
-
-sal_Bool SAL_CALL UICategoryDescription::hasElements()
-throw (::com::sun::star::uno::RuntimeException)
-{
- // generic UI commands are always available!
- return sal_True;
+ return new ConfigurationAccess_UICategory( _sName,m_xGenericUICommands,m_xServiceManager );
}
} // namespace framework
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index 3309333fb327..67049d9eb4dc 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -38,6 +38,7 @@
#include <uielement/uielementtypenames.hxx>
#include <xml/menuconfiguration.hxx>
#include <xml/toolboxconfiguration.hxx>
+#include <uiconfigurationmanagerimpl.hxx>
#ifndef __FRAMEWORK_XML_STATUSBARCONFIGURATION_HXX_
#include <xml/statusbarconfiguration.hxx>
@@ -110,511 +111,9 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( UIConfigurationManager
DEFINE_INIT_SERVICE ( UIConfigurationManager, {} )
-
-// important: The order and position of the elements must match the constant
-// definition of "::com::sun::star::ui::UIElementType"
-static const char* UIELEMENTTYPENAMES[] =
-{
- "", // Dummy value for unknown!
- UIELEMENTTYPE_MENUBAR_NAME,
- UIELEMENTTYPE_POPUPMENU_NAME,
- UIELEMENTTYPE_TOOLBAR_NAME,
- UIELEMENTTYPE_STATUSBAR_NAME,
- UIELEMENTTYPE_FLOATINGWINDOW_NAME,
- UIELEMENTTYPE_PROGRESSBAR_NAME
-};
-
-static const char RESOURCEURL_PREFIX[] = "private:resource/";
-static const sal_Int32 RESOURCEURL_PREFIX_SIZE = 17;
-
-static sal_Int16 RetrieveTypeFromResourceURL( const rtl::OUString& aResourceURL )
-{
-
- if (( aResourceURL.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( RESOURCEURL_PREFIX ))) == 0 ) &&
- ( aResourceURL.getLength() > RESOURCEURL_PREFIX_SIZE ))
- {
- rtl::OUString aTmpStr = aResourceURL.copy( RESOURCEURL_PREFIX_SIZE );
- sal_Int32 nIndex = aTmpStr.indexOf( '/' );
- if (( nIndex > 0 ) && ( aTmpStr.getLength() > nIndex ))
- {
- rtl::OUString aTypeStr( aTmpStr.copy( 0, nIndex ));
- for ( int i = 0; i < UIElementType::COUNT; i++ )
- {
- if ( aTypeStr.equalsAscii( UIELEMENTTYPENAMES[i] ))
- return sal_Int16( i );
- }
- }
- }
-
- return UIElementType::UNKNOWN;
-}
-
-static rtl::OUString RetrieveNameFromResourceURL( const rtl::OUString& aResourceURL )
-{
- if (( aResourceURL.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( RESOURCEURL_PREFIX ))) == 0 ) &&
- ( aResourceURL.getLength() > RESOURCEURL_PREFIX_SIZE ))
- {
- sal_Int32 nIndex = aResourceURL.lastIndexOf( '/' );
- if (( nIndex > 0 ) && (( nIndex+1 ) < aResourceURL.getLength()))
- return aResourceURL.copy( nIndex+1 );
- }
-
- return rtl::OUString();
-}
-
-void UIConfigurationManager::impl_fillSequenceWithElementTypeInfo( UIElementInfoHashMap& aUIElementInfoCollection, sal_Int16 nElementType )
+UIConfigurationManager::UIConfigurationManager( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xServiceManager )
+: m_pImpl( new UIConfigurationManagerImpl(xServiceManager,static_cast< OWeakObject* >(this),false) )
{
- // preload list of element types on demand
- impl_preloadUIElementTypeList( nElementType );
-
- UIElementDataHashMap& rUserElements = m_aUIElements[nElementType].aElementsHashMap;
- UIElementDataHashMap::const_iterator pUserIter = rUserElements.begin();
-
- while ( pUserIter != rUserElements.end() )
- {
- UIElementData* pDataSettings = impl_findUIElementData( pUserIter->second.aResourceURL, nElementType );
- if ( pDataSettings && !pDataSettings->bDefault )
- {
- // Retrieve user interface name from XPropertySet interface
- rtl::OUString aUIName;
- Reference< XPropertySet > xPropSet( pDataSettings->xSettings, UNO_QUERY );
- if ( xPropSet.is() )
- {
- Any a = xPropSet->getPropertyValue( m_aPropUIName );
- a >>= aUIName;
- }
-
- UIElementInfo aInfo( pUserIter->second.aResourceURL, aUIName );
- aUIElementInfoCollection.insert( UIElementInfoHashMap::value_type( pUserIter->second.aResourceURL, aInfo ));
- }
- ++pUserIter;
- }
-}
-
-void UIConfigurationManager::impl_preloadUIElementTypeList( sal_Int16 nElementType )
-{
- UIElementType& rElementTypeData = m_aUIElements[nElementType];
-
- if ( !rElementTypeData.bLoaded )
- {
- Reference< XStorage > xElementTypeStorage = rElementTypeData.xStorage;
- if ( xElementTypeStorage.is() )
- {
- rtl::OUStringBuffer aBuf( RESOURCEURL_PREFIX_SIZE );
- aBuf.appendAscii( RESOURCEURL_PREFIX );
- aBuf.appendAscii( UIELEMENTTYPENAMES[ nElementType ] );
- aBuf.appendAscii( "/" );
- rtl::OUString aResURLPrefix( aBuf.makeStringAndClear() );
-
- UIElementDataHashMap& rHashMap = rElementTypeData.aElementsHashMap;
- Reference< XNameAccess > xNameAccess( xElementTypeStorage, UNO_QUERY );
- Sequence< rtl::OUString > aUIElementNames = xNameAccess->getElementNames();
- for ( sal_Int32 n = 0; n < aUIElementNames.getLength(); n++ )
- {
- UIElementData aUIElementData;
-
- // Resource name must be without ".xml"
- sal_Int32 nIndex = aUIElementNames[n].lastIndexOf( '.' );
- if (( nIndex > 0 ) && ( nIndex < aUIElementNames[n].getLength() ))
- {
- rtl::OUString aExtension( aUIElementNames[n].copy( nIndex+1 ));
- rtl::OUString aUIElementName( aUIElementNames[n].copy( 0, nIndex ));
-
- if (( aUIElementName.getLength() > 0 ) &&
- ( aExtension.equalsIgnoreAsciiCaseAsciiL( "xml", 3 )))
- {
- aUIElementData.aResourceURL = aResURLPrefix + aUIElementName;
- aUIElementData.aName = aUIElementNames[n];
- aUIElementData.bModified = false;
- aUIElementData.bDefault = false;
-
- // Create hash_map entries for all user interface elements inside the storage. We don't load the
- // settings to speed up the process.
- rHashMap.insert( UIElementDataHashMap::value_type( aUIElementData.aResourceURL, aUIElementData ));
- }
- }
- }
- }
- }
-
- rElementTypeData.bLoaded = true;
-}
-
-void UIConfigurationManager::impl_requestUIElementData( sal_Int16 nElementType, UIElementData& aUIElementData )
-{
- UIElementType& rElementTypeData = m_aUIElements[nElementType];
-
- Reference< XStorage > xElementTypeStorage = rElementTypeData.xStorage;
- if ( xElementTypeStorage.is() && aUIElementData.aName.getLength() )
- {
- try
- {
- Reference< XStream > xStream = xElementTypeStorage->openStreamElement( aUIElementData.aName, ElementModes::READ );
- Reference< XInputStream > xInputStream = xStream->getInputStream();
-
- if ( xInputStream.is() )
- {
- switch ( nElementType )
- {
- case ::com::sun::star::ui::UIElementType::UNKNOWN:
- break;
-
- case ::com::sun::star::ui::UIElementType::MENUBAR:
- {
- try
- {
- MenuConfiguration aMenuCfg( m_xServiceManager );
- Reference< XIndexAccess > xContainer( aMenuCfg.CreateMenuBarConfigurationFromXML( xInputStream ));
- RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xContainer );
- if ( pRootItemContainer )
- aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, sal_True ) ), UNO_QUERY );
- else
- aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( xContainer, sal_True ) ), UNO_QUERY );
- return;
- }
- catch ( ::com::sun::star::lang::WrappedTargetException& )
- {
- }
- }
- break;
-
- case ::com::sun::star::ui::UIElementType::POPUPMENU:
- {
- break;
- }
-
- case ::com::sun::star::ui::UIElementType::TOOLBAR:
- {
- try
- {
- Reference< XIndexContainer > xIndexContainer( static_cast< OWeakObject * >( new RootItemContainer() ), UNO_QUERY );
- ToolBoxConfiguration::LoadToolBox( m_xServiceManager, xInputStream, xIndexContainer );
- RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xIndexContainer );
- aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, sal_True ) ), UNO_QUERY );
- return;
- }
- catch ( ::com::sun::star::lang::WrappedTargetException& )
- {
- }
-
- break;
- }
-
- case ::com::sun::star::ui::UIElementType::STATUSBAR:
- {
- try
- {
- Reference< XIndexContainer > xIndexContainer( static_cast< OWeakObject * >( new RootItemContainer() ), UNO_QUERY );
- StatusBarConfiguration::LoadStatusBar( m_xServiceManager, xInputStream, xIndexContainer );
- RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xIndexContainer );
- aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, sal_True ) ), UNO_QUERY );
- return;
- }
- catch ( ::com::sun::star::lang::WrappedTargetException& )
- {
- }
-
- break;
- }
-
- case ::com::sun::star::ui::UIElementType::FLOATINGWINDOW:
- {
- break;
- }
- }
- }
- }
- catch ( ::com::sun::star::embed::InvalidStorageException& )
- {
- }
- catch ( ::com::sun::star::lang::IllegalArgumentException& )
- {
- }
- catch ( ::com::sun::star::io::IOException& )
- {
- }
- catch ( ::com::sun::star::embed::StorageWrappedTargetException& )
- {
- }
- }
-
- // At least we provide an empty settings container!
- aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer()), UNO_QUERY );
-}
-
-UIConfigurationManager::UIElementData* UIConfigurationManager::impl_findUIElementData( const rtl::OUString& aResourceURL, sal_Int16 nElementType, bool bLoad )
-{
- // preload list of element types on demand
- impl_preloadUIElementTypeList( nElementType );
-
- // try to look into our document vector/hash_map combination
- UIElementDataHashMap& rUserHashMap = m_aUIElements[nElementType].aElementsHashMap;
- UIElementDataHashMap::iterator pIter = rUserHashMap.find( aResourceURL );
- if ( pIter != rUserHashMap.end() )
- {
- // Default data settings data means removed!
- if ( pIter->second.bDefault )
- return &(pIter->second);
- else
- {
- if ( !pIter->second.xSettings.is() && bLoad )
- impl_requestUIElementData( nElementType, pIter->second );
- return &(pIter->second);
- }
- }
-
- // Nothing has been found!
- return NULL;
-}
-
-void UIConfigurationManager::impl_storeElementTypeData( Reference< XStorage >& xStorage, UIElementType& rElementType, bool bResetModifyState )
-{
- UIElementDataHashMap& rHashMap = rElementType.aElementsHashMap;
- UIElementDataHashMap::iterator pIter = rHashMap.begin();
-
- while ( pIter != rHashMap.end() )
- {
- UIElementData& rElement = pIter->second;
- if ( rElement.bModified )
- {
- if ( rElement.bDefault )
- {
- xStorage->removeElement( rElement.aName );
- rElement.bModified = sal_False; // mark as not modified
- }
- else
- {
- Reference< XStream > xStream( xStorage->openStreamElement( rElement.aName, ElementModes::WRITE|ElementModes::TRUNCATE ), UNO_QUERY );
- Reference< XOutputStream > xOutputStream( xStream->getOutputStream() );
-
- if ( xOutputStream.is() )
- {
- switch( rElementType.nElementType )
- {
- case ::com::sun::star::ui::UIElementType::MENUBAR:
- {
- try
- {
- MenuConfiguration aMenuCfg( m_xServiceManager );
- aMenuCfg.StoreMenuBarConfigurationToXML( rElement.xSettings, xOutputStream );
- }
- catch ( ::com::sun::star::lang::WrappedTargetException& )
- {
- }
- }
- break;
-
- case ::com::sun::star::ui::UIElementType::TOOLBAR:
- {
- try
- {
- ToolBoxConfiguration::StoreToolBox( m_xServiceManager, xOutputStream, rElement.xSettings );
- }
- catch ( ::com::sun::star::lang::WrappedTargetException& )
- {
- }
- }
- break;
-
- case ::com::sun::star::ui::UIElementType::STATUSBAR:
- {
- try
- {
- StatusBarConfiguration::StoreStatusBar( m_xServiceManager, xOutputStream, rElement.xSettings );
- }
- catch ( ::com::sun::star::lang::WrappedTargetException& )
- {
- }
- }
- break;
-
- default:
- break;
- }
- }
-
- // mark as not modified if we store to our own storage
- if ( bResetModifyState )
- rElement.bModified = sal_False;
- }
- }
-
- ++pIter;
- }
-
- // commit element type storage
- Reference< XTransactedObject > xTransactedObject( xStorage, UNO_QUERY );
- if ( xTransactedObject.is() )
- xTransactedObject->commit();
-
- // mark UIElementType as not modified if we store to our own storage
- if ( bResetModifyState )
- rElementType.bModified = sal_False;
-}
-
-void UIConfigurationManager::impl_resetElementTypeData(
- UIElementType& rDocElementType,
- ConfigEventNotifyContainer& rRemoveNotifyContainer )
-{
- UIElementDataHashMap& rHashMap = rDocElementType.aElementsHashMap;
- UIElementDataHashMap::iterator pIter = rHashMap.begin();
-
- Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- Reference< XInterface > xIfac( xThis, UNO_QUERY );
-
- // Make copies of the event structures to be thread-safe. We have to unlock our mutex before calling
- // our listeners!
- while ( pIter != rHashMap.end() )
- {
- UIElementData& rElement = pIter->second;
- if ( !rElement.bDefault )
- {
- // Remove user-defined settings from document
- ConfigurationEvent aEvent;
- aEvent.ResourceURL = rElement.aResourceURL;
- aEvent.Accessor <<= xThis;
- aEvent.Source = xIfac;
- aEvent.Element <<= rElement.xSettings;
-
- rRemoveNotifyContainer.push_back( aEvent );
-
- // Mark element as default.
- rElement.bModified = false;
- rElement.bDefault = true;
- }
- else
- rElement.bModified = false;
-
- ++pIter;
- }
-
- // Remove all settings from our user interface elements
- rHashMap.clear();
-}
-
-void UIConfigurationManager::impl_reloadElementTypeData(
- UIElementType& rDocElementType,
- ConfigEventNotifyContainer& rRemoveNotifyContainer,
- ConfigEventNotifyContainer& rReplaceNotifyContainer )
-{
- UIElementDataHashMap& rHashMap = rDocElementType.aElementsHashMap;
- UIElementDataHashMap::iterator pIter = rHashMap.begin();
- Reference< XStorage > xElementStorage( rDocElementType.xStorage );
- Reference< XNameAccess > xElementNameAccess( xElementStorage, UNO_QUERY );
-
- Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- Reference< XInterface > xIfac( xThis, UNO_QUERY );
- sal_Int16 nType = rDocElementType.nElementType;
-
- while ( pIter != rHashMap.end() )
- {
- UIElementData& rElement = pIter->second;
- if ( rElement.bModified )
- {
- if ( xElementNameAccess->hasByName( rElement.aName ))
- {
- // Replace settings with data from user layer
- Reference< XIndexAccess > xOldSettings( rElement.xSettings );
-
- impl_requestUIElementData( nType, rElement );
-
- ConfigurationEvent aReplaceEvent;
-
- aReplaceEvent.ResourceURL = rElement.aResourceURL;
- aReplaceEvent.Accessor <<= xThis;
- aReplaceEvent.Source = xIfac;
- aReplaceEvent.ReplacedElement <<= xOldSettings;
- aReplaceEvent.Element <<= rElement.xSettings;
- rReplaceNotifyContainer.push_back( aReplaceEvent );
-
- rElement.bModified = false;
- }
- else
- {
- // Element settings are not in any storage => remove
- ConfigurationEvent aRemoveEvent;
-
- aRemoveEvent.ResourceURL = rElement.aResourceURL;
- aRemoveEvent.Accessor <<= xThis;
- aRemoveEvent.Source = xIfac;
- aRemoveEvent.Element <<= rElement.xSettings;
-
- rRemoveNotifyContainer.push_back( aRemoveEvent );
-
- // Mark element as default and not modified. That means "not active" in the document anymore
- rElement.bModified = false;
- rElement.bDefault = true;
- }
- }
- ++pIter;
- }
-
- rDocElementType.bModified = sal_False;
-}
-
-void UIConfigurationManager::impl_Initialize()
-{
- // Initialize the top-level structures with the storage data
- if ( m_xDocConfigStorage.is() )
- {
- long nModes = m_bReadOnly ? ElementModes::READ : ElementModes::READWRITE;
-
- // Try to access our module sub folder
- for ( sal_Int16 i = 1; i < ::com::sun::star::ui::UIElementType::COUNT;
- i++ )
- {
- Reference< XStorage > xElementTypeStorage;
- try
- {
- xElementTypeStorage = m_xDocConfigStorage->openStorageElement( rtl::OUString::createFromAscii( UIELEMENTTYPENAMES[i] ), nModes );
- }
- catch ( com::sun::star::container::NoSuchElementException& )
- {
- }
- catch ( ::com::sun::star::embed::InvalidStorageException& )
- {
- }
- catch ( ::com::sun::star::lang::IllegalArgumentException& )
- {
- }
- catch ( ::com::sun::star::io::IOException& )
- {
- }
- catch ( ::com::sun::star::embed::StorageWrappedTargetException& )
- {
- }
-
- m_aUIElements[i].nElementType = i;
- m_aUIElements[i].bModified = false;
- m_aUIElements[i].xStorage = xElementTypeStorage;
- m_aUIElements[i].bDefaultLayer = false;
- }
- }
- else
- {
- // We have no storage, just initialize ui element types with empty storage!
- for ( int i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
- m_aUIElements[i].xStorage = m_xDocConfigStorage;
- }
-}
-
-UIConfigurationManager::UIConfigurationManager( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xServiceManager ) :
- ThreadHelpBase( &Application::GetSolarMutex() )
- , m_xDocConfigStorage( 0 )
- , m_bReadOnly( true )
- , m_bInitialized( false )
- , m_bModified( false )
- , m_bConfigRead( false )
- , m_bDisposed( false )
- , m_aXMLPostfix( RTL_CONSTASCII_USTRINGPARAM( ".xml" ))
- , m_aPropUIName( RTL_CONSTASCII_USTRINGPARAM( "UIName" ))
- , m_aPropResourceURL( RTL_CONSTASCII_USTRINGPARAM( "ResourceURL" ))
- , m_xServiceManager( xServiceManager )
- , m_aListenerContainer( m_aLock.getShareableOslMutex() )
-{
- // Make sure we have a default initialized entry for every layer and user interface element type!
- // The following code depends on this!
- m_aUIElements.resize( ::com::sun::star::ui::UIElementType::COUNT );
}
UIConfigurationManager::~UIConfigurationManager()
@@ -624,507 +123,86 @@ UIConfigurationManager::~UIConfigurationManager()
// XComponent
void SAL_CALL UIConfigurationManager::dispose() throw (::com::sun::star::uno::RuntimeException)
{
- Reference< XComponent > xThis( static_cast< OWeakObject* >(this), UNO_QUERY );
-
- css::lang::EventObject aEvent( xThis );
- m_aListenerContainer.disposeAndClear( aEvent );
-
- {
- ResetableGuard aGuard( m_aLock );
- try
- {
- if ( m_xImageManager.is() )
- m_xImageManager->dispose();
- }
- catch ( Exception& )
- {
- }
-
- m_xImageManager.clear();
- m_aUIElements.clear();
- m_xDocConfigStorage.clear();
- m_bConfigRead = false;
- m_bModified = false;
- m_bDisposed = true;
- }
+ m_pImpl->dispose();
}
void SAL_CALL UIConfigurationManager::addEventListener( const Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
- {
- ResetableGuard aGuard( m_aLock );
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
- }
-
- m_aListenerContainer.addInterface( ::getCppuType( ( const Reference< XEventListener >* ) NULL ), xListener );
+ m_pImpl->addEventListener(xListener);
}
void SAL_CALL UIConfigurationManager::removeEventListener( const Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- m_aListenerContainer.removeInterface( ::getCppuType( ( const Reference< XEventListener >* ) NULL ), xListener );
+ m_pImpl->removeEventListener(xListener);
}
// XUIConfigurationManager
void SAL_CALL UIConfigurationManager::addConfigurationListener( const Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
- {
- ResetableGuard aGuard( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
- }
-
- m_aListenerContainer.addInterface( ::getCppuType( ( const Reference< XUIConfigurationListener >* ) NULL ), xListener );
+ m_pImpl->addConfigurationListener(xListener);
}
void SAL_CALL UIConfigurationManager::removeConfigurationListener( const Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- m_aListenerContainer.removeInterface( ::getCppuType( ( const Reference< XUIConfigurationListener >* ) NULL ), xListener );
+ m_pImpl->removeConfigurationListener(xListener);
}
void SAL_CALL UIConfigurationManager::reset() throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( isReadOnly() )
- return;
-
- bool bResetStorage( false );
- if ( m_xDocConfigStorage.is() )
- {
- try
- {
- // Remove all elements from our user-defined storage!
- bool bCommit( false );
- for ( int i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
- {
- UIElementType& rElementType = m_aUIElements[i];
- Reference< XStorage > xSubStorage( rElementType.xStorage, UNO_QUERY );
-
- if ( xSubStorage.is() )
- {
- bool bCommitSubStorage( false );
- Reference< XNameAccess > xSubStorageNameAccess( xSubStorage, UNO_QUERY );
- Sequence< rtl::OUString > aUIElementStreamNames = xSubStorageNameAccess->getElementNames();
- for ( sal_Int32 j = 0; j < aUIElementStreamNames.getLength(); j++ )
- {
- xSubStorage->removeElement( aUIElementStreamNames[j] );
- bCommitSubStorage = true;
- bCommit = true;
- }
-
- if ( bCommitSubStorage )
- {
- Reference< XTransactedObject > xTransactedObject( xSubStorage, UNO_QUERY );
- if ( xTransactedObject.is() )
- xTransactedObject->commit();
- }
- }
- }
-
- // Commit changes
- if ( bCommit )
- {
- Reference< XTransactedObject > xTransactedObject( m_xDocConfigStorage, UNO_QUERY );
- if ( xTransactedObject.is() )
- xTransactedObject->commit();
- }
- bResetStorage = true;
-
- // remove settings from user defined layer and notify listener about removed settings data!
- // Try to access our module sub folder
- ConfigEventNotifyContainer aRemoveEventNotifyContainer;
- for ( sal_Int16 j = 1; j < ::com::sun::star::ui::UIElementType::COUNT; j++ )
- {
- UIElementType& rDocElementType = m_aUIElements[j];
-
- impl_resetElementTypeData( rDocElementType, aRemoveEventNotifyContainer );
- rDocElementType.bModified = sal_False;
- }
-
- m_bModified = sal_False;
-
- // Unlock mutex before notify our listeners
- aGuard.unlock();
-
- // Notify our listeners
- for ( sal_uInt32 k = 0; k < aRemoveEventNotifyContainer.size(); k++ )
- implts_notifyContainerListener( aRemoveEventNotifyContainer[k], NotifyOp_Remove );
- }
- catch ( ::com::sun::star::lang::IllegalArgumentException& )
- {
- }
- catch ( ::com::sun::star::container::NoSuchElementException& )
- {
- }
- catch ( ::com::sun::star::embed::InvalidStorageException& )
- {
- }
- catch ( ::com::sun::star::embed::StorageWrappedTargetException& )
- {
- }
- }
+ m_pImpl->reset();
}
Sequence< Sequence< PropertyValue > > SAL_CALL UIConfigurationManager::getUIElementsInfo( sal_Int16 ElementType )
throw ( IllegalArgumentException, RuntimeException )
{
- if (( ElementType < 0 ) || ( ElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
- throw IllegalArgumentException();
-
- ResetableGuard aGuard( m_aLock );
- if ( m_bDisposed )
- throw DisposedException();
-
- Sequence< Sequence< PropertyValue > > aElementInfoSeq;
- UIElementInfoHashMap aUIElementInfoCollection;
-
- if ( ElementType == ::com::sun::star::ui::UIElementType::UNKNOWN )
- {
- for ( sal_Int16 i = 0; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
- impl_fillSequenceWithElementTypeInfo( aUIElementInfoCollection, sal_Int16( i ) );
- }
- else
- impl_fillSequenceWithElementTypeInfo( aUIElementInfoCollection, ElementType );
-
- Sequence< PropertyValue > aUIElementInfo( 2 );
- aUIElementInfo[0].Name = m_aPropResourceURL;
- aUIElementInfo[1].Name = m_aPropUIName;
-
- aElementInfoSeq.realloc( aUIElementInfoCollection.size() );
- UIElementInfoHashMap::const_iterator pIter = aUIElementInfoCollection.begin();
-
- sal_Int32 n = 0;
- while ( pIter != aUIElementInfoCollection.end() )
- {
- aUIElementInfo[0].Value <<= pIter->second.aResourceURL;
- aUIElementInfo[1].Value <<= pIter->second.aUIName;
- aElementInfoSeq[n++] = aUIElementInfo;
- ++pIter;
- }
-
- return aElementInfoSeq;
+ return m_pImpl->getUIElementsInfo(ElementType);
}
Reference< XIndexContainer > SAL_CALL UIConfigurationManager::createSettings() throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- // Creates an empty item container which can be filled from outside
- return Reference< XIndexContainer >( static_cast< OWeakObject * >( new RootItemContainer()), UNO_QUERY );
+ return m_pImpl->createSettings();
}
sal_Bool SAL_CALL UIConfigurationManager::hasSettings( const ::rtl::OUString& ResourceURL )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{
- sal_Int16 nElementType = RetrieveTypeFromResourceURL( ResourceURL );
-
- if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
- ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
- throw IllegalArgumentException();
- else
- {
- UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType, false );
- if ( pDataSettings && !pDataSettings->bDefault )
- return sal_True;
- }
-
- return sal_False;
+ return m_pImpl->hasSettings(ResourceURL);
}
Reference< XIndexAccess > SAL_CALL UIConfigurationManager::getSettings( const ::rtl::OUString& ResourceURL, sal_Bool bWriteable )
throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{
- sal_Int16 nElementType = RetrieveTypeFromResourceURL( ResourceURL );
-
- if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
- ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
- throw IllegalArgumentException();
- else
- {
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType );
- if ( pDataSettings && !pDataSettings->bDefault )
- {
- // Create a copy of our data if someone wants to change the data.
- if ( bWriteable )
- return Reference< XIndexAccess >( static_cast< OWeakObject * >( new RootItemContainer( pDataSettings->xSettings ) ), UNO_QUERY );
- else
- return pDataSettings->xSettings;
- }
- }
-
- throw NoSuchElementException();
+ return m_pImpl->getSettings(ResourceURL,bWriteable);
}
void SAL_CALL UIConfigurationManager::replaceSettings( const ::rtl::OUString& ResourceURL, const Reference< ::com::sun::star::container::XIndexAccess >& aNewData )
throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IllegalAccessException, ::com::sun::star::uno::RuntimeException)
{
- sal_Int16 nElementType = RetrieveTypeFromResourceURL( ResourceURL );
-
- if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
- ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
- throw IllegalArgumentException();
- else if ( m_bReadOnly )
- throw IllegalAccessException();
- else
- {
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType );
- if ( pDataSettings && !pDataSettings->bDefault )
- {
- // we have a settings entry in our user-defined layer - replace
- Reference< XIndexAccess > xOldSettings = pDataSettings->xSettings;
-
- // Create a copy of the data if the container is not const
- Reference< XIndexReplace > xReplace( aNewData, UNO_QUERY );
- if ( xReplace.is() )
- pDataSettings->xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( aNewData ) ), UNO_QUERY );
- else
- pDataSettings->xSettings = aNewData;
-
- pDataSettings->bDefault = false;
- pDataSettings->bModified = true;
- m_bModified = true;
-
- // Modify type container
- UIElementType& rElementType = m_aUIElements[nElementType];
- rElementType.bModified = true;
-
- Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
-
- // Create event to notify listener about replaced element settings
- ConfigurationEvent aEvent;
- Reference< XInterface > xIfac( xThis, UNO_QUERY );
-
- aEvent.ResourceURL = ResourceURL;
- aEvent.Accessor <<= xThis;
- aEvent.Source = xIfac;
- aEvent.ReplacedElement <<= xOldSettings;
- aEvent.Element <<= pDataSettings->xSettings;
-
- aGuard.unlock();
-
- implts_notifyContainerListener( aEvent, NotifyOp_Replace );
- }
- else
- throw NoSuchElementException();
- }
+ return m_pImpl->replaceSettings(ResourceURL,aNewData);
}
void SAL_CALL UIConfigurationManager::removeSettings( const ::rtl::OUString& ResourceURL )
throw ( NoSuchElementException, IllegalArgumentException, IllegalAccessException, RuntimeException)
{
- sal_Int16 nElementType = RetrieveTypeFromResourceURL( ResourceURL );
-
- if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
- ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
- throw IllegalArgumentException();
- else if ( m_bReadOnly )
- throw IllegalAccessException();
- else
- {
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType );
- if ( pDataSettings )
- {
- // If element settings are default, we don't need to change anything!
- if ( pDataSettings->bDefault )
- return;
- else
- {
- Reference< XIndexAccess > xRemovedSettings = pDataSettings->xSettings;
- pDataSettings->bDefault = true;
-
- // check if this is a default layer node
- pDataSettings->bModified = true; // we have to remove this node from the user layer!
- pDataSettings->xSettings.clear();
- m_bModified = true; // user layer must be written
-
- // Modify type container
- UIElementType& rElementType = m_aUIElements[nElementType];
- rElementType.bModified = true;
-
- Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- Reference< XInterface > xIfac( xThis, UNO_QUERY );
-
- // Create event to notify listener about removed element settings
- ConfigurationEvent aEvent;
-
- aEvent.ResourceURL = ResourceURL;
- aEvent.Accessor <<= xThis;
- aEvent.Source = xIfac;
- aEvent.Element <<= xRemovedSettings;
-
- aGuard.unlock();
-
- implts_notifyContainerListener( aEvent, NotifyOp_Remove );
- }
- }
- else
- throw NoSuchElementException();
- }
+ m_pImpl->removeSettings(ResourceURL);
}
void SAL_CALL UIConfigurationManager::insertSettings( const ::rtl::OUString& NewResourceURL, const Reference< XIndexAccess >& aNewData )
throw ( ElementExistException, IllegalArgumentException, IllegalAccessException, RuntimeException )
{
- sal_Int16 nElementType = RetrieveTypeFromResourceURL( NewResourceURL );
-
- if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
- ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
- throw IllegalArgumentException();
- else if ( m_bReadOnly )
- throw IllegalAccessException();
- else
- {
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- bool bInsertData( false );
- UIElementData aUIElementData;
- UIElementData* pDataSettings = impl_findUIElementData( NewResourceURL, nElementType );
-
- if ( pDataSettings && !pDataSettings->bDefault )
- throw ElementExistException();
-
- if ( !pDataSettings )
- {
- pDataSettings = &aUIElementData;
- bInsertData = true;
- }
-
- {
- pDataSettings->bDefault = false;
- pDataSettings->bModified = true;
-
- // Create a copy of the data if the container is not const
- Reference< XIndexReplace > xReplace( aNewData, UNO_QUERY );
- if ( xReplace.is() )
- pDataSettings->xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( aNewData ) ), UNO_QUERY );
- else
- pDataSettings->xSettings = aNewData;
-
- m_bModified = true;
-
- UIElementType& rElementType = m_aUIElements[nElementType];
- rElementType.bModified = true;
-
- if ( bInsertData )
- {
- pDataSettings->aName = RetrieveNameFromResourceURL( NewResourceURL ) + m_aXMLPostfix;
- pDataSettings->aResourceURL = NewResourceURL;
-
- UIElementDataHashMap& rElements = rElementType.aElementsHashMap;
- rElements.insert( UIElementDataHashMap::value_type( NewResourceURL, *pDataSettings ));
- }
-
- Reference< XIndexAccess > xInsertSettings( aUIElementData.xSettings );
- Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- Reference< XInterface > xIfac( xThis, UNO_QUERY );
-
- // Create event to notify listener about removed element settings
- ConfigurationEvent aEvent;
-
- aEvent.ResourceURL = NewResourceURL;
- aEvent.Accessor <<= xThis;
- aEvent.Source = xIfac;
- aEvent.Element <<= xInsertSettings;
-
- aGuard.unlock();
-
- implts_notifyContainerListener( aEvent, NotifyOp_Insert );
- }
- }
+ m_pImpl->insertSettings(NewResourceURL,aNewData);
}
Reference< XInterface > SAL_CALL UIConfigurationManager::getImageManager() throw (::com::sun::star::uno::RuntimeException)
{
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( !m_xImageManager.is() )
- {
- m_xImageManager = Reference< XComponent >( static_cast< cppu::OWeakObject *>( new ImageManager( m_xServiceManager )),
- UNO_QUERY );
- Reference< XInitialization > xInit( m_xImageManager, UNO_QUERY );
-
- Sequence< Any > aPropSeq( 2 );
- PropertyValue aPropValue;
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UserConfigStorage" ));
- aPropValue.Value = makeAny( m_xDocConfigStorage );
- aPropSeq[0] = makeAny( aPropValue );
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ModuleIdentifier" ));
- aPropValue.Value = makeAny( m_aModuleIdentifier );
- aPropSeq[1] = makeAny( aPropValue );
-
- xInit->initialize( aPropSeq );
- }
-
- return Reference< XInterface >( m_xImageManager, UNO_QUERY );
+ return m_pImpl->getImageManager();
}
Reference< XInterface > SAL_CALL UIConfigurationManager::getShortCutManager() throw (::com::sun::star::uno::RuntimeException)
{
- // SAFE ->
- ResetableGuard aGuard( m_aLock );
-
- if (m_xAccConfig.is())
- return m_xAccConfig;
-
- Reference< XMultiServiceFactory > xSMGR = m_xServiceManager;
- Reference< XStorage > xDocumentRoot = m_xDocConfigStorage;
-
- aGuard.unlock();
- // <- SAFE
-
- Reference< XInterface > xAccConfig = xSMGR->createInstance(SERVICENAME_DOCUMENTACCELERATORCONFIGURATION);
- Reference< XInitialization > xInit (xAccConfig, UNO_QUERY_THROW);
-
- PropertyValue aProp;
- aProp.Name = ::rtl::OUString::createFromAscii("DocumentRoot");
- aProp.Value <<= xDocumentRoot;
-
- Sequence< Any > lArgs(1);
- lArgs[0] <<= aProp;
-
- xInit->initialize(lArgs);
-
- // SAFE ->
- aGuard.lock();
- m_xAccConfig = xAccConfig;
- aGuard.unlock();
- // <- SAFE
-
- return xAccConfig;
+ return m_pImpl->getShortCutManager();
}
Reference< XInterface > SAL_CALL UIConfigurationManager::getEventsManager() throw (::com::sun::star::uno::RuntimeException)
@@ -1135,223 +213,38 @@ Reference< XInterface > SAL_CALL UIConfigurationManager::getEventsManager() thro
// XUIConfigurationStorage
void SAL_CALL UIConfigurationManager::setStorage( const Reference< XStorage >& Storage ) throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_xDocConfigStorage.is() )
- {
- try
- {
- // Dispose old storage to be sure that it will be closed
- Reference< XComponent > xComponent( m_xDocConfigStorage, UNO_QUERY );
- if ( xComponent.is() )
- xComponent->dispose();
- }
- catch ( Exception& )
- {
- }
- }
-
- // We store the new storage. Be careful it could be an empty reference!
- m_xDocConfigStorage = Storage;
- m_bReadOnly = sal_True;
-
- Reference< XUIConfigurationStorage > xAccUpdate(m_xAccConfig, UNO_QUERY);
- if ( xAccUpdate.is() )
- xAccUpdate->setStorage( m_xDocConfigStorage );
-
- if ( m_xImageManager.is() )
- {
- ImageManager* pImageManager = (ImageManager*)m_xImageManager.get();
- if ( pImageManager )
- pImageManager->setStorage( m_xDocConfigStorage );
- }
-
- if ( m_xDocConfigStorage.is() )
- {
- Reference< XPropertySet > xPropSet( m_xDocConfigStorage, UNO_QUERY );
- if ( xPropSet.is() )
- {
- try
- {
- long nOpenMode = 0;
- Any a = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenMode" )));
- if ( a >>= nOpenMode )
- m_bReadOnly = !( nOpenMode & ElementModes::WRITE );
- }
- catch ( com::sun::star::beans::UnknownPropertyException& )
- {
- }
- catch ( com::sun::star::lang::WrappedTargetException& )
- {
- }
- }
- }
-
- impl_Initialize();
+ m_pImpl->setStorage(Storage);
}
sal_Bool SAL_CALL UIConfigurationManager::hasStorage() throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- return ( m_xDocConfigStorage.is() );
+ return m_pImpl->hasStorage();
}
// XUIConfigurationPersistence
void SAL_CALL UIConfigurationManager::reload() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_xDocConfigStorage.is() && m_bModified && !m_bReadOnly )
- {
- // Try to access our module sub folder
- ConfigEventNotifyContainer aRemoveNotifyContainer;
- ConfigEventNotifyContainer aReplaceNotifyContainer;
- for ( sal_Int16 i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
- {
- try
- {
- UIElementType& rDocElementType = m_aUIElements[i];
- if ( rDocElementType.bModified )
- impl_reloadElementTypeData( rDocElementType, aRemoveNotifyContainer, aReplaceNotifyContainer );
- }
- catch ( Exception& )
- {
- throw IOException();
- }
- }
-
- m_bModified = sal_False;
-
- // Unlock mutex before notify our listeners
- aGuard.unlock();
-
- // Notify our listeners
- for ( sal_uInt32 j = 0; j < aRemoveNotifyContainer.size(); j++ )
- implts_notifyContainerListener( aRemoveNotifyContainer[j], NotifyOp_Remove );
- for ( sal_uInt32 k = 0; k < aReplaceNotifyContainer.size(); k++ )
- implts_notifyContainerListener( aReplaceNotifyContainer[k], NotifyOp_Replace );
- }
+ m_pImpl->reload();
}
void SAL_CALL UIConfigurationManager::store() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_xDocConfigStorage.is() && m_bModified && !m_bReadOnly )
- {
- // Try to access our module sub folder
- for ( int i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
- {
- try
- {
- UIElementType& rElementType = m_aUIElements[i];
- Reference< XStorage > xStorage( rElementType.xStorage, UNO_QUERY );
-
- if ( rElementType.bModified && xStorage.is() )
- impl_storeElementTypeData( xStorage, rElementType );
- }
- catch ( Exception& )
- {
- throw IOException();
- }
- }
-
- m_bModified = false;
- Reference< XTransactedObject > xTransactedObject( m_xDocConfigStorage, UNO_QUERY );
- if ( xTransactedObject.is() )
- xTransactedObject->commit();
- }
+ m_pImpl->store();
}
void SAL_CALL UIConfigurationManager::storeToStorage( const Reference< XStorage >& Storage ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_xDocConfigStorage.is() && m_bModified && !m_bReadOnly )
- {
- // Try to access our module sub folder
- for ( int i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
- {
- try
- {
- Reference< XStorage > xElementTypeStorage( Storage->openStorageElement(
- rtl::OUString::createFromAscii( UIELEMENTTYPENAMES[i] ), ElementModes::READWRITE ));
- UIElementType& rElementType = m_aUIElements[i];
-
- if ( rElementType.bModified && xElementTypeStorage.is() )
- impl_storeElementTypeData( xElementTypeStorage, rElementType, false ); // store data to storage, but don't reset modify flag!
- }
- catch ( Exception& )
- {
- throw IOException();
- }
- }
-
- Reference< XTransactedObject > xTransactedObject( Storage, UNO_QUERY );
- if ( xTransactedObject.is() )
- xTransactedObject->commit();
- }
+ m_pImpl->storeToStorage(Storage);
}
sal_Bool SAL_CALL UIConfigurationManager::isModified() throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- return m_bModified;
+ return m_pImpl->isModified();
}
sal_Bool SAL_CALL UIConfigurationManager::isReadOnly() throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- return m_bReadOnly;
-}
-
-void UIConfigurationManager::implts_notifyContainerListener( const ConfigurationEvent& aEvent, NotifyOp eOp )
-{
- ::cppu::OInterfaceContainerHelper* pContainer = m_aListenerContainer.getContainer( ::getCppuType( ( const css::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >*) NULL ) );
- if ( pContainer != NULL )
- {
- ::cppu::OInterfaceIteratorHelper pIterator( *pContainer );
- while ( pIterator.hasMoreElements() )
- {
- try
- {
- switch ( eOp )
- {
- case NotifyOp_Replace:
- ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementReplaced( aEvent );
- break;
- case NotifyOp_Insert:
- ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementInserted( aEvent );
- break;
- case NotifyOp_Remove:
- ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementRemoved( aEvent );
- break;
- }
- }
- catch( css::uno::RuntimeException& )
- {
- pIterator.remove();
- }
- }
- }
+ return m_pImpl->isReadOnly();
}
} // namespace framework
diff --git a/framework/source/uiconfiguration/uiconfigurationmanagerimpl.cxx b/framework/source/uiconfiguration/uiconfigurationmanagerimpl.cxx
new file mode 100755
index 000000000000..9b2284c0c6b8
--- /dev/null
+++ b/framework/source/uiconfiguration/uiconfigurationmanagerimpl.cxx
@@ -0,0 +1,1713 @@
+/*************************************************************************
+ *
+ * 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: UIConfigurationManagerImpl.cxx,v $
+ * $Revision: 1.19.208.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_framework.hxx"
+#include <uiconfigurationmanagerimpl.hxx>
+#include <threadhelp/resetableguard.hxx>
+#include <services.h>
+#include <uielement/constitemcontainer.hxx>
+#include <uielement/rootitemcontainer.hxx>
+#include <uielement/uielementtypenames.hxx>
+#include <xml/menuconfiguration.hxx>
+#include <xml/toolboxconfiguration.hxx>
+#include <uiconfiguration/imagemanager.hxx>
+
+#ifndef __FRAMEWORK_XML_STATUSBARCONFIGURATION_HXX_
+#include <xml/statusbarconfiguration.hxx>
+#endif
+
+//_________________________________________________________________________________________________________________
+// interface includes
+//_________________________________________________________________________________________________________________
+#include <com/sun/star/ui/UIElementType.hpp>
+#include <com/sun/star/ui/ConfigurationEvent.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/io/XStream.hpp>
+
+//_________________________________________________________________________________________________________________
+// other includes
+//_________________________________________________________________________________________________________________
+
+#include <vcl/svapp.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <comphelper/sequenceashashmap.hxx>
+#include <boost/bind.hpp>
+
+//_________________________________________________________________________________________________________________
+// namespaces
+//_________________________________________________________________________________________________________________
+
+using rtl::OUString;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::io;
+using namespace com::sun::star::embed;
+using namespace com::sun::star::lang;
+using namespace com::sun::star::container;
+using namespace com::sun::star::beans;
+using namespace ::com::sun::star::ui;
+using namespace ::cppu;
+
+namespace framework
+{
+
+
+// important: The order and position of the elements must match the constant
+// definition of "::com::sun::star::ui::UIElementType"
+static const char* UIELEMENTTYPENAMES[] =
+{
+ "", // Dummy value for unknown!
+ UIELEMENTTYPE_MENUBAR_NAME,
+ UIELEMENTTYPE_POPUPMENU_NAME,
+ UIELEMENTTYPE_TOOLBAR_NAME,
+ UIELEMENTTYPE_STATUSBAR_NAME,
+ UIELEMENTTYPE_FLOATINGWINDOW_NAME,
+ UIELEMENTTYPE_PROGRESSBAR_NAME
+};
+
+static const char RESOURCEURL_PREFIX[] = "private:resource/";
+static const sal_Int32 RESOURCEURL_PREFIX_SIZE = 17;
+static const char RESOURCEURL_CUSTOM_ELEMENT[] = "custom_";
+
+static sal_Int16 RetrieveTypeFromResourceURL( const rtl::OUString& aResourceURL )
+{
+
+ if (( aResourceURL.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( RESOURCEURL_PREFIX ))) == 0 ) &&
+ ( aResourceURL.getLength() > RESOURCEURL_PREFIX_SIZE ))
+ {
+ rtl::OUString aTmpStr = aResourceURL.copy( RESOURCEURL_PREFIX_SIZE );
+ sal_Int32 nIndex = aTmpStr.indexOf( '/' );
+ if (( nIndex > 0 ) && ( aTmpStr.getLength() > nIndex ))
+ {
+ rtl::OUString aTypeStr( aTmpStr.copy( 0, nIndex ));
+ for ( int i = 0; i < UIElementType::COUNT; i++ )
+ {
+ if ( aTypeStr.equalsAscii( UIELEMENTTYPENAMES[i] ))
+ return sal_Int16( i );
+ }
+ }
+ }
+
+ return UIElementType::UNKNOWN;
+}
+
+static rtl::OUString RetrieveNameFromResourceURL( const rtl::OUString& aResourceURL )
+{
+ if (( aResourceURL.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( RESOURCEURL_PREFIX ))) == 0 ) &&
+ ( aResourceURL.getLength() > RESOURCEURL_PREFIX_SIZE ))
+ {
+ sal_Int32 nIndex = aResourceURL.lastIndexOf( '/' );
+ if (( nIndex > 0 ) && (( nIndex+1 ) < aResourceURL.getLength()))
+ return aResourceURL.copy( nIndex+1 );
+ }
+
+ return rtl::OUString();
+}
+
+void UIConfigurationManagerImpl::impl_fillSequenceWithElementTypeInfo( UIElementInfoHashMap& aUIElementInfoCollection, sal_Int16 nElementType )
+{
+ // preload list of element types on demand
+ impl_preloadUIElementTypeList( LAYER_USERDEFINED, nElementType );
+ if ( m_bUseDefault )
+ impl_preloadUIElementTypeList( LAYER_DEFAULT, nElementType );
+
+ UIElementDataHashMap& rUserElements = m_aUIElements[LAYER_USERDEFINED][nElementType].aElementsHashMap;
+ UIElementDataHashMap::const_iterator pUserIter = rUserElements.begin();
+
+ rtl::OUString aCustomUrlPrefix( RTL_CONSTASCII_USTRINGPARAM( RESOURCEURL_CUSTOM_ELEMENT ));
+ while ( pUserIter != rUserElements.end() )
+ {
+ sal_Int32 nIndex = pUserIter->second.aResourceURL.indexOf( aCustomUrlPrefix, RESOURCEURL_PREFIX_SIZE );
+ if ( !m_bUseDefault && nIndex > RESOURCEURL_PREFIX_SIZE )
+ {
+ // Performance: Retrieve user interface name only for custom user interface elements.
+ // It's only used by them!
+ UIElementData* pDataSettings = impl_findUIElementData( pUserIter->second.aResourceURL, nElementType );
+ if ( pDataSettings && ( !m_bUseDefault || !pDataSettings->bDefault) )
+ {
+ // Retrieve user interface name from XPropertySet interface
+ rtl::OUString aUIName;
+ Reference< XPropertySet > xPropSet( pDataSettings->xSettings, UNO_QUERY );
+ if ( xPropSet.is() )
+ {
+ xPropSet->getPropertyValue( m_aPropUIName ) >>= aUIName;
+ }
+
+ UIElementInfo aInfo( pUserIter->second.aResourceURL, aUIName );
+ aUIElementInfoCollection.insert( UIElementInfoHashMap::value_type( pUserIter->second.aResourceURL, aInfo ));
+ }
+ }
+ else
+ {
+ // The user interface name for standard user interface elements is stored in the WindowState.xcu file
+ UIElementInfo aInfo( pUserIter->second.aResourceURL, rtl::OUString() );
+ aUIElementInfoCollection.insert( UIElementInfoHashMap::value_type( pUserIter->second.aResourceURL, aInfo ));
+ }
+ ++pUserIter;
+ }
+
+ if ( m_bUseDefault )
+ {
+ UIElementDataHashMap& rDefaultElements = m_aUIElements[LAYER_DEFAULT][nElementType].aElementsHashMap;
+ UIElementDataHashMap::const_iterator pDefIter = rDefaultElements.begin();
+
+ while ( pDefIter != rDefaultElements.end() )
+ {
+ UIElementInfoHashMap::const_iterator pIterInfo = aUIElementInfoCollection.find( pDefIter->second.aResourceURL );
+ if ( pIterInfo == aUIElementInfoCollection.end() )
+ {
+ sal_Int32 nIndex = pDefIter->second.aResourceURL.indexOf( aCustomUrlPrefix, RESOURCEURL_PREFIX_SIZE );
+ if ( nIndex > RESOURCEURL_PREFIX_SIZE )
+ {
+ // Performance: Retrieve user interface name only for custom user interface elements.
+ // It's only used by them!
+ UIElementData* pDataSettings = impl_findUIElementData( pDefIter->second.aResourceURL, nElementType );
+ if ( pDataSettings )
+ {
+ // Retrieve user interface name from XPropertySet interface
+ rtl::OUString aUIName;
+ Reference< XPropertySet > xPropSet( pDataSettings->xSettings, UNO_QUERY );
+ if ( xPropSet.is() )
+ {
+ xPropSet->getPropertyValue( m_aPropUIName ) >>= aUIName;
+ }
+
+ UIElementInfo aInfo( pDefIter->second.aResourceURL, aUIName );
+ aUIElementInfoCollection.insert( UIElementInfoHashMap::value_type( pDefIter->second.aResourceURL, aInfo ));
+ }
+ }
+ else
+ {
+ // The user interface name for standard user interface elements is stored in the WindowState.xcu file
+ UIElementInfo aInfo( pDefIter->second.aResourceURL, rtl::OUString() );
+ aUIElementInfoCollection.insert( UIElementInfoHashMap::value_type( pDefIter->second.aResourceURL, aInfo ));
+ }
+ }
+
+ ++pDefIter;
+ } // while ( pDefIter != rDefaultElements.end() )
+ }
+}
+
+void UIConfigurationManagerImpl::impl_preloadUIElementTypeList( Layer eLayer, sal_Int16 nElementType )
+{
+ UIElementType& rElementTypeData = m_aUIElements[eLayer][nElementType];
+
+ if ( !rElementTypeData.bLoaded )
+ {
+ Reference< XStorage > xElementTypeStorage = rElementTypeData.xStorage;
+ if ( xElementTypeStorage.is() )
+ {
+ rtl::OUStringBuffer aBuf( RESOURCEURL_PREFIX_SIZE );
+ aBuf.appendAscii( RESOURCEURL_PREFIX );
+ aBuf.appendAscii( UIELEMENTTYPENAMES[ nElementType ] );
+ aBuf.appendAscii( "/" );
+ rtl::OUString aResURLPrefix( aBuf.makeStringAndClear() );
+
+ UIElementDataHashMap& rHashMap = rElementTypeData.aElementsHashMap;
+ Reference< XNameAccess > xNameAccess( xElementTypeStorage, UNO_QUERY );
+ Sequence< rtl::OUString > aUIElementNames = xNameAccess->getElementNames();
+ for ( sal_Int32 n = 0; n < aUIElementNames.getLength(); n++ )
+ {
+ UIElementData aUIElementData;
+
+ // Resource name must be without ".xml"
+ sal_Int32 nIndex = aUIElementNames[n].lastIndexOf( '.' );
+ if (( nIndex > 0 ) && ( nIndex < aUIElementNames[n].getLength() ))
+ {
+ rtl::OUString aExtension( aUIElementNames[n].copy( nIndex+1 ));
+ rtl::OUString aUIElementName( aUIElementNames[n].copy( 0, nIndex ));
+
+ if (( aUIElementName.getLength() > 0 ) &&
+ ( aExtension.equalsIgnoreAsciiCaseAsciiL( "xml", 3 )))
+ {
+ aUIElementData.aResourceURL = aResURLPrefix + aUIElementName;
+ aUIElementData.aName = aUIElementNames[n];
+
+ if ( eLayer == LAYER_USERDEFINED )
+ {
+ aUIElementData.bModified = false;
+ aUIElementData.bDefault = false;
+ aUIElementData.bDefaultNode = false;
+ }
+
+ // Create hash_map entries for all user interface elements inside the storage. We don't load the
+ // settings to speed up the process.
+ rHashMap.insert( UIElementDataHashMap::value_type( aUIElementData.aResourceURL, aUIElementData ));
+ }
+ }
+ }
+ }
+ }
+
+ rElementTypeData.bLoaded = true;
+}
+
+void UIConfigurationManagerImpl::impl_requestUIElementData( sal_Int16 nElementType, Layer eLayer, UIElementData& aUIElementData )
+{
+ UIElementType& rElementTypeData = m_aUIElements[eLayer][nElementType];
+
+ Reference< XStorage > xElementTypeStorage = rElementTypeData.xStorage;
+ if ( xElementTypeStorage.is() && aUIElementData.aName.getLength() )
+ {
+ try
+ {
+ Reference< XStream > xStream = xElementTypeStorage->openStreamElement( aUIElementData.aName, ElementModes::READ );
+ Reference< XInputStream > xInputStream = xStream->getInputStream();
+
+ if ( xInputStream.is() )
+ {
+ switch ( nElementType )
+ {
+ case ::com::sun::star::ui::UIElementType::UNKNOWN:
+ break;
+
+ case ::com::sun::star::ui::UIElementType::MENUBAR:
+ {
+ try
+ {
+ MenuConfiguration aMenuCfg( m_xServiceManager );
+ Reference< XIndexAccess > xContainer( aMenuCfg.CreateMenuBarConfigurationFromXML( xInputStream ));
+ RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xContainer );
+ if ( pRootItemContainer )
+ aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, sal_True ) ), UNO_QUERY );
+ else
+ aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( xContainer, sal_True ) ), UNO_QUERY );
+ return;
+ }
+ catch ( ::com::sun::star::lang::WrappedTargetException& )
+ {
+ }
+ }
+ break;
+
+ case ::com::sun::star::ui::UIElementType::POPUPMENU:
+ {
+ break;
+ }
+
+ case ::com::sun::star::ui::UIElementType::TOOLBAR:
+ {
+ try
+ {
+ Reference< XIndexContainer > xIndexContainer( static_cast< OWeakObject * >( new RootItemContainer() ), UNO_QUERY );
+ ToolBoxConfiguration::LoadToolBox( m_xServiceManager, xInputStream, xIndexContainer );
+ RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xIndexContainer );
+ aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, sal_True ) ), UNO_QUERY );
+ return;
+ }
+ catch ( ::com::sun::star::lang::WrappedTargetException& )
+ {
+ }
+
+ break;
+ }
+
+ case ::com::sun::star::ui::UIElementType::STATUSBAR:
+ {
+ try
+ {
+ Reference< XIndexContainer > xIndexContainer( static_cast< OWeakObject * >( new RootItemContainer() ), UNO_QUERY );
+ StatusBarConfiguration::LoadStatusBar( m_xServiceManager, xInputStream, xIndexContainer );
+ RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xIndexContainer );
+ aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, sal_True ) ), UNO_QUERY );
+ return;
+ }
+ catch ( ::com::sun::star::lang::WrappedTargetException& )
+ {
+ }
+
+ break;
+ }
+
+ case ::com::sun::star::ui::UIElementType::FLOATINGWINDOW:
+ {
+ break;
+ }
+ }
+ }
+ }
+ catch ( ::com::sun::star::embed::InvalidStorageException& )
+ {
+ }
+ catch ( ::com::sun::star::lang::IllegalArgumentException& )
+ {
+ }
+ catch ( ::com::sun::star::io::IOException& )
+ {
+ }
+ catch ( ::com::sun::star::embed::StorageWrappedTargetException& )
+ {
+ }
+ }
+
+ // At least we provide an empty settings container!
+ aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer() ), UNO_QUERY );
+}
+
+UIConfigurationManagerImpl::UIElementData* UIConfigurationManagerImpl::impl_findUIElementData( const rtl::OUString& aResourceURL, sal_Int16 nElementType, bool bLoad )
+{
+ // preload list of element types on demand
+ impl_preloadUIElementTypeList( LAYER_USERDEFINED, nElementType );
+ if ( m_bUseDefault )
+ impl_preloadUIElementTypeList( LAYER_DEFAULT, nElementType );
+
+ // first try to look into our user-defined vector/hash_map combination
+ UIElementDataHashMap& rUserHashMap = m_aUIElements[LAYER_USERDEFINED][nElementType].aElementsHashMap;
+ UIElementDataHashMap::iterator pIter = rUserHashMap.find( aResourceURL );
+ if ( pIter != rUserHashMap.end() )
+ {
+ // Default data settings data must be retrieved from the default layer!
+ if ( !pIter->second.bDefault )
+ {
+ if ( !pIter->second.xSettings.is() && bLoad )
+ impl_requestUIElementData( nElementType, LAYER_USERDEFINED, pIter->second );
+ return &(pIter->second);
+ }
+ }
+
+ if ( m_bUseDefault )
+ {
+ // Not successfull, we have to look into our default vector/hash_map combination
+ UIElementDataHashMap& rDefaultHashMap = m_aUIElements[LAYER_DEFAULT][nElementType].aElementsHashMap;
+ pIter = rDefaultHashMap.find( aResourceURL );
+ if ( pIter != rDefaultHashMap.end() )
+ {
+ if ( !pIter->second.xSettings.is() && bLoad )
+ impl_requestUIElementData( nElementType, LAYER_DEFAULT, pIter->second );
+ return &(pIter->second);
+ } // if ( pIter != rDefaultHashMap.end() )
+ }
+
+ // Nothing has been found!
+ return NULL;
+}
+
+void UIConfigurationManagerImpl::impl_storeElementTypeData( Reference< XStorage > xStorage, UIElementType& rElementType, bool bResetModifyState )
+{
+ UIElementDataHashMap& rHashMap = rElementType.aElementsHashMap;
+ UIElementDataHashMap::iterator pIter = rHashMap.begin();
+
+ while ( pIter != rHashMap.end() )
+ {
+ UIElementData& rElement = pIter->second;
+ if ( rElement.bModified )
+ {
+ if ( rElement.bDefault )
+ {
+ xStorage->removeElement( rElement.aName );
+ rElement.bModified = sal_False; // mark as not modified
+ }
+ else
+ {
+ Reference< XStream > xStream( xStorage->openStreamElement( rElement.aName, ElementModes::WRITE|ElementModes::TRUNCATE ), UNO_QUERY );
+ Reference< XOutputStream > xOutputStream( xStream->getOutputStream() );
+
+ if ( xOutputStream.is() )
+ {
+ switch( rElementType.nElementType )
+ {
+ case ::com::sun::star::ui::UIElementType::MENUBAR:
+ {
+ try
+ {
+ MenuConfiguration aMenuCfg( m_xServiceManager );
+ aMenuCfg.StoreMenuBarConfigurationToXML( rElement.xSettings, xOutputStream );
+ }
+ catch ( ::com::sun::star::lang::WrappedTargetException& )
+ {
+ }
+ }
+ break;
+
+ case ::com::sun::star::ui::UIElementType::TOOLBAR:
+ {
+ try
+ {
+ ToolBoxConfiguration::StoreToolBox( m_xServiceManager, xOutputStream, rElement.xSettings );
+ }
+ catch ( ::com::sun::star::lang::WrappedTargetException& )
+ {
+ }
+ }
+ break;
+
+ case ::com::sun::star::ui::UIElementType::STATUSBAR:
+ {
+ try
+ {
+ StatusBarConfiguration::StoreStatusBar( m_xServiceManager, xOutputStream, rElement.xSettings );
+ }
+ catch ( ::com::sun::star::lang::WrappedTargetException& )
+ {
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ // mark as not modified if we store to our own storage
+ if ( bResetModifyState )
+ rElement.bModified = sal_False;
+ }
+ }
+
+ ++pIter;
+ }
+
+ // commit element type storage
+ Reference< XTransactedObject > xTransactedObject( xStorage, UNO_QUERY );
+ if ( xTransactedObject.is() )
+ xTransactedObject->commit();
+
+ // mark UIElementType as not modified if we store to our own storage
+ if ( bResetModifyState )
+ rElementType.bModified = sal_False;
+}
+
+// This is only allowed to be called on the LAYER_USER_DEFINED!
+void UIConfigurationManagerImpl::impl_resetElementTypeData(
+ UIElementType& rUserElementType,
+ UIElementType& rDefaultElementType,
+ ConfigEventNotifyContainer& rRemoveNotifyContainer,
+ ConfigEventNotifyContainer& rReplaceNotifyContainer )
+{
+ UIElementDataHashMap& rHashMap = rUserElementType.aElementsHashMap;
+ UIElementDataHashMap::iterator pIter = rHashMap.begin();
+
+ Reference< XUIConfigurationManager > xThis( m_xOwner, UNO_QUERY );
+ Reference< XNameAccess > xDefaultNameAccess( rDefaultElementType.xStorage, UNO_QUERY );
+ sal_Int16 nType = rUserElementType.nElementType;
+
+ // Make copies of the event structures to be thread-safe. We have to unlock our mutex before calling
+ // our listeners!
+ while ( pIter != rHashMap.end() )
+ {
+ UIElementData& rElement = pIter->second;
+ if ( !rElement.bDefault )
+ {
+ if ( m_bUseDefault && xDefaultNameAccess->hasByName( rElement.aName ))
+ {
+ // Replace settings with data from default layer
+ Reference< XIndexAccess > xOldSettings( rElement.xSettings );
+ impl_requestUIElementData( nType, LAYER_DEFAULT, rElement );
+
+ ConfigurationEvent aReplaceEvent;
+ aReplaceEvent.ResourceURL = rElement.aResourceURL;
+ aReplaceEvent.Accessor <<= xThis;
+ aReplaceEvent.Source = m_xOwner;
+ aReplaceEvent.ReplacedElement <<= xOldSettings;
+ aReplaceEvent.Element <<= rElement.xSettings;
+
+ rReplaceNotifyContainer.push_back( aReplaceEvent );
+
+ // Mark element as default and not modified. That means "not active"
+ // in the user layer anymore.
+ rElement.bModified = false;
+ rElement.bDefault = true;
+ }
+ else
+ {
+ // Remove user-defined settings from user layer
+ ConfigurationEvent aEvent;
+ aEvent.ResourceURL = rElement.aResourceURL;
+ aEvent.Accessor <<= xThis;
+ aEvent.Source = m_xOwner;
+ aEvent.Element <<= rElement.xSettings;
+
+ rRemoveNotifyContainer.push_back( aEvent );
+
+ // Mark element as default and not modified. That means "not active"
+ // in the user layer anymore.
+ rElement.bModified = false;
+ rElement.bDefault = true;
+ }
+ } // if ( !rElement.bDefault )
+ else
+ rElement.bModified = false;
+
+ ++pIter;
+ }
+
+ // Remove all settings from our user interface elements
+ rHashMap.clear();
+}
+
+void UIConfigurationManagerImpl::impl_reloadElementTypeData(
+ UIElementType& rUserElementType,
+ UIElementType& rDefaultElementType,
+ ConfigEventNotifyContainer& rRemoveNotifyContainer,
+ ConfigEventNotifyContainer& rReplaceNotifyContainer )
+{
+ UIElementDataHashMap& rHashMap = rUserElementType.aElementsHashMap;
+ UIElementDataHashMap::iterator pIter = rHashMap.begin();
+ Reference< XStorage > xUserStorage( rUserElementType.xStorage );
+ Reference< XStorage > xDefaultStorage( rDefaultElementType.xStorage );
+ Reference< XNameAccess > xUserNameAccess( rUserElementType.xStorage, UNO_QUERY );
+ Reference< XNameAccess > xDefaultNameAccess( rDefaultElementType.xStorage, UNO_QUERY );
+
+ Reference< XUIConfigurationManager > xThis( m_xOwner, UNO_QUERY );
+ sal_Int16 nType = rUserElementType.nElementType;
+
+ while ( pIter != rHashMap.end() )
+ {
+ UIElementData& rElement = pIter->second;
+ if ( rElement.bModified )
+ {
+ if ( xUserNameAccess->hasByName( rElement.aName ))
+ {
+ // Replace settings with data from user layer
+ Reference< XIndexAccess > xOldSettings( rElement.xSettings );
+
+ impl_requestUIElementData( nType, LAYER_USERDEFINED, rElement );
+
+ ConfigurationEvent aReplaceEvent;
+
+ aReplaceEvent.ResourceURL = rElement.aResourceURL;
+ aReplaceEvent.Accessor <<= xThis;
+ aReplaceEvent.Source = m_xOwner;
+ aReplaceEvent.ReplacedElement <<= xOldSettings;
+ aReplaceEvent.Element <<= rElement.xSettings;
+ rReplaceNotifyContainer.push_back( aReplaceEvent );
+
+ rElement.bModified = false;
+ }
+ else if ( m_bUseDefault && xDefaultNameAccess->hasByName( rElement.aName ))
+ {
+ // Replace settings with data from default layer
+ Reference< XIndexAccess > xOldSettings( rElement.xSettings );
+
+ impl_requestUIElementData( nType, LAYER_DEFAULT, rElement );
+
+ ConfigurationEvent aReplaceEvent;
+
+ aReplaceEvent.ResourceURL = rElement.aResourceURL;
+ aReplaceEvent.Accessor <<= xThis;
+ aReplaceEvent.Source = m_xOwner;
+ aReplaceEvent.ReplacedElement <<= xOldSettings;
+ aReplaceEvent.Element <<= rElement.xSettings;
+ rReplaceNotifyContainer.push_back( aReplaceEvent );
+
+ // Mark element as default and not modified. That means "not active"
+ // in the user layer anymore.
+ rElement.bModified = false;
+ rElement.bDefault = true;
+ }
+ else
+ {
+ // Element settings are not in any storage => remove
+ ConfigurationEvent aRemoveEvent;
+
+ aRemoveEvent.ResourceURL = rElement.aResourceURL;
+ aRemoveEvent.Accessor <<= xThis;
+ aRemoveEvent.Source = m_xOwner;
+ aRemoveEvent.Element <<= rElement.xSettings;
+
+ rRemoveNotifyContainer.push_back( aRemoveEvent );
+
+ // Mark element as default and not modified. That means "not active"
+ // in the user layer anymore.
+ rElement.bModified = false;
+ rElement.bDefault = true;
+ }
+ }
+ ++pIter;
+ }
+
+ rUserElementType.bModified = sal_False;
+}
+
+void UIConfigurationManagerImpl::impl_Initialize()
+{
+ // Initialize the top-level structures with the storage data
+ if ( m_xUserConfigStorage.is() )
+ {
+ // Try to access our module sub folder
+ for ( sal_Int16 i = 1; i < ::com::sun::star::ui::UIElementType::COUNT;
+ i++ )
+ {
+ Reference< XStorage > xElementTypeStorage;
+ try
+ {
+ if ( m_pStorageHandler[i] )
+ xElementTypeStorage = m_pStorageHandler[i]->getWorkingStorageUser();
+ }
+ catch ( com::sun::star::container::NoSuchElementException& )
+ {
+ }
+ catch ( ::com::sun::star::embed::InvalidStorageException& )
+ {
+ }
+ catch ( ::com::sun::star::lang::IllegalArgumentException& )
+ {
+ }
+ catch ( ::com::sun::star::io::IOException& )
+ {
+ }
+ catch ( ::com::sun::star::embed::StorageWrappedTargetException& )
+ {
+ }
+
+ m_aUIElements[LAYER_USERDEFINED][i].nElementType = i;
+ m_aUIElements[LAYER_USERDEFINED][i].bModified = false;
+ m_aUIElements[LAYER_USERDEFINED][i].xStorage = xElementTypeStorage;
+ m_aUIElements[LAYER_USERDEFINED][i].bDefaultLayer = false;
+ }
+ } // if ( m_xUserConfigStorage.is() )
+ else if ( !m_bUseDefault )
+ {
+ // We have no storage, just initialize ui element types with empty storage!
+ for ( int i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
+ m_aUIElements[LAYER_USERDEFINED][i].xStorage.clear();
+ }
+
+ if ( m_bUseDefault && m_xUserConfigStorage.is() )
+ {
+ Reference< XNameAccess > xNameAccess( m_xDefaultConfigStorage, UNO_QUERY_THROW );
+
+ // Try to access our module sub folder
+ for ( sal_Int16 i = 1; i < ::com::sun::star::ui::UIElementType::COUNT;
+ i++ )
+ {
+ Reference< XStorage > xElementTypeStorage;
+ try
+ {
+ xNameAccess->getByName( rtl::OUString::createFromAscii( UIELEMENTTYPENAMES[i] )) >>= xElementTypeStorage;
+ }
+ catch ( com::sun::star::container::NoSuchElementException& )
+ {
+ }
+
+ m_aUIElements[LAYER_DEFAULT][i].nElementType = i;
+ m_aUIElements[LAYER_DEFAULT][i].bModified = false;
+ m_aUIElements[LAYER_DEFAULT][i].xStorage = xElementTypeStorage;
+ m_aUIElements[LAYER_DEFAULT][i].bDefaultLayer = true;
+ }
+ }
+}
+
+UIConfigurationManagerImpl::UIConfigurationManagerImpl( const Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceManager
+ ,const Reference< XInterface >& _xOwner
+ , bool _bUseDefault) :
+ ThreadHelpBase( &Application::GetSolarMutex() )
+ , m_xOwner( _xOwner )
+ , m_bUseDefault(_bUseDefault)
+ , m_bReadOnly( true )
+ , m_bInitialized( false )
+ , m_bModified( false )
+ , m_bConfigRead( false )
+ , m_bDisposed( false )
+ , m_aXMLPostfix( RTL_CONSTASCII_USTRINGPARAM( ".xml" ))
+ , m_aPropUIName( RTL_CONSTASCII_USTRINGPARAM( "UIName" ))
+ , m_aPropResourceURL( RTL_CONSTASCII_USTRINGPARAM( "ResourceURL" ))
+ , m_xServiceManager( xServiceManager )
+ , m_aListenerContainer( m_aLock.getShareableOslMutex() )
+{
+ for ( int i = 0; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
+ m_pStorageHandler[i] = 0;
+
+ // Make sure we have a default initialized entry for every layer and user interface element type!
+ // The following code depends on this!
+ m_aUIElements[LAYER_DEFAULT].resize( ::com::sun::star::ui::UIElementType::COUNT );
+ m_aUIElements[LAYER_USERDEFINED].resize( ::com::sun::star::ui::UIElementType::COUNT );
+}
+
+UIConfigurationManagerImpl::~UIConfigurationManagerImpl()
+{
+ for ( int i = 0; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
+ delete m_pStorageHandler[i];
+}
+
+// XComponent
+void UIConfigurationManagerImpl::dispose() throw (::com::sun::star::uno::RuntimeException)
+{
+ css::lang::EventObject aEvent( m_xOwner );
+ m_aListenerContainer.disposeAndClear( aEvent );
+
+ {
+ ResetableGuard aGuard( m_aLock );
+ try
+ {
+ if ( m_xModuleImageManager.is() )
+ m_xModuleImageManager->dispose();
+ }
+ catch ( Exception& )
+ {
+ }
+
+ m_xModuleImageManager.clear();
+ m_aUIElements[LAYER_USERDEFINED].clear();
+ m_aUIElements[LAYER_DEFAULT].clear();
+ m_xDefaultConfigStorage.clear();
+ m_xUserConfigStorage.clear();
+ m_xUserRootCommit.clear();
+ m_bConfigRead = false;
+ m_bModified = false;
+ m_bDisposed = true;
+ }
+}
+
+void UIConfigurationManagerImpl::addEventListener( const Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
+{
+ {
+ ResetableGuard aGuard( m_aLock );
+
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ if ( m_bDisposed )
+ throw DisposedException();
+ }
+
+ m_aListenerContainer.addInterface( ::getCppuType( ( const Reference< XEventListener >* ) NULL ), xListener );
+}
+
+void UIConfigurationManagerImpl::removeEventListener( const Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
+{
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ m_aListenerContainer.removeInterface( ::getCppuType( ( const Reference< XEventListener >* ) NULL ), xListener );
+}
+
+// XInitialization
+void UIConfigurationManagerImpl::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
+{
+ ResetableGuard aLock( m_aLock );
+
+ if ( !m_bInitialized )
+ {
+ ::comphelper::SequenceAsHashMap lArgs(aArguments);
+ m_aModuleIdentifier = lArgs.getUnpackedValueOrDefault(::rtl::OUString::createFromAscii("ModuleIdentifier"), ::rtl::OUString());
+ m_aModuleShortName = lArgs.getUnpackedValueOrDefault(::rtl::OUString::createFromAscii("ModuleShortName"), ::rtl::OUString());
+
+ for ( int i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
+ {
+ rtl::OUString aResourceType;
+ if ( i == ::com::sun::star::ui::UIElementType::MENUBAR )
+ aResourceType = PresetHandler::RESOURCETYPE_MENUBAR();
+ else if ( i == ::com::sun::star::ui::UIElementType::TOOLBAR )
+ aResourceType = PresetHandler::RESOURCETYPE_TOOLBAR();
+ else if ( i == ::com::sun::star::ui::UIElementType::STATUSBAR )
+ aResourceType = PresetHandler::RESOURCETYPE_STATUSBAR();
+
+ if ( aResourceType.getLength() > 0 )
+ {
+ m_pStorageHandler[i] = new PresetHandler( m_xServiceManager );
+ m_pStorageHandler[i]->connectToResource( PresetHandler::E_MODULES,
+ aResourceType, // this path wont be used later ... seee next lines!
+ m_aModuleShortName,
+ css::uno::Reference< css::embed::XStorage >()); // no document root used here!
+ }
+ }
+
+ // initialize root storages for all resource types
+ m_xUserRootCommit = css::uno::Reference< css::embed::XTransactedObject >(
+ m_pStorageHandler[::com::sun::star::ui::UIElementType::MENUBAR]->getOrCreateRootStorageUser(), css::uno::UNO_QUERY); // can be empty
+ m_xDefaultConfigStorage = m_pStorageHandler[::com::sun::star::ui::UIElementType::MENUBAR]->getParentStorageShare(
+ m_pStorageHandler[::com::sun::star::ui::UIElementType::MENUBAR]->getWorkingStorageShare());
+ m_xUserConfigStorage = m_pStorageHandler[::com::sun::star::ui::UIElementType::MENUBAR]->getParentStorageUser(
+ m_pStorageHandler[::com::sun::star::ui::UIElementType::MENUBAR]->getWorkingStorageUser());
+
+ if ( m_xUserConfigStorage.is() )
+ {
+ Reference< XPropertySet > xPropSet( m_xUserConfigStorage, UNO_QUERY );
+ if ( xPropSet.is() )
+ {
+ long nOpenMode = 0;
+ if ( xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenMode" ))) >>= nOpenMode )
+ m_bReadOnly = !( nOpenMode & ElementModes::WRITE );
+ }
+ }
+
+ impl_Initialize();
+
+ m_bInitialized = true;
+ }
+}
+
+// XUIConfiguration
+void UIConfigurationManagerImpl::addConfigurationListener( const Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
+{
+ {
+ ResetableGuard aGuard( m_aLock );
+
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ if ( m_bDisposed )
+ throw DisposedException();
+ }
+
+ m_aListenerContainer.addInterface( ::getCppuType( ( const Reference< XUIConfigurationListener >* ) NULL ), xListener );
+}
+
+void UIConfigurationManagerImpl::removeConfigurationListener( const Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
+{
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ m_aListenerContainer.removeInterface( ::getCppuType( ( const Reference< XUIConfigurationListener >* ) NULL ), xListener );
+}
+
+
+// XUIConfigurationManager
+void UIConfigurationManagerImpl::reset() throw (::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aGuard( m_aLock );
+
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ bool bResetStorage( false );
+
+ if ( !isReadOnly() )
+ {
+ // Remove all elements from our user-defined storage!
+ try
+ {
+ for ( int i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
+ {
+ UIElementType& rElementType = m_aUIElements[LAYER_USERDEFINED][i];
+ Reference< XStorage > xSubStorage( rElementType.xStorage, UNO_QUERY );
+
+ if ( xSubStorage.is() )
+ {
+ bool bCommitSubStorage( false );
+ Reference< XNameAccess > xSubStorageNameAccess( xSubStorage, UNO_QUERY );
+ Sequence< rtl::OUString > aUIElementStreamNames = xSubStorageNameAccess->getElementNames();
+ for ( sal_Int32 j = 0; j < aUIElementStreamNames.getLength(); j++ )
+ {
+ xSubStorage->removeElement( aUIElementStreamNames[j] );
+ bCommitSubStorage = true;
+ }
+
+ if ( bCommitSubStorage )
+ {
+ Reference< XTransactedObject > xTransactedObject( xSubStorage, UNO_QUERY );
+ if ( xTransactedObject.is() )
+ xTransactedObject->commit();
+ m_pStorageHandler[i]->commitUserChanges();
+ }
+ }
+ }
+
+ bResetStorage = true;
+
+ // remove settings from user defined layer and notify listener about removed settings data!
+ ConfigEventNotifyContainer aRemoveEventNotifyContainer;
+ ConfigEventNotifyContainer aReplaceEventNotifyContainer;
+ for ( sal_Int16 j = 1; j < ::com::sun::star::ui::UIElementType::COUNT; j++ )
+ {
+ try
+ {
+ UIElementType& rUserElementType = m_aUIElements[LAYER_USERDEFINED][j];
+ UIElementType& rDefaultElementType = m_aUIElements[LAYER_DEFAULT][j];
+
+ impl_resetElementTypeData( rUserElementType, rDefaultElementType, aRemoveEventNotifyContainer, aReplaceEventNotifyContainer );
+ rUserElementType.bModified = sal_False;
+ }
+ catch ( Exception& )
+ {
+ throw IOException();
+ }
+ }
+
+ m_bModified = sal_False;
+
+ // Unlock mutex before notify our listeners
+ aGuard.unlock();
+
+ // Notify our listeners
+ ::std::for_each(aRemoveEventNotifyContainer.begin(),aRemoveEventNotifyContainer.end(),::boost::bind(&UIConfigurationManagerImpl::implts_notifyContainerListener,this,_1,NotifyOp_Remove));
+ ::std::for_each(aReplaceEventNotifyContainer.begin(),aReplaceEventNotifyContainer.end(),::boost::bind(&UIConfigurationManagerImpl::implts_notifyContainerListener,this,_1,NotifyOp_Replace));
+ }
+ catch ( ::com::sun::star::lang::IllegalArgumentException& )
+ {
+ }
+ catch ( ::com::sun::star::container::NoSuchElementException& )
+ {
+ }
+ catch ( ::com::sun::star::embed::InvalidStorageException& )
+ {
+ }
+ catch ( ::com::sun::star::embed::StorageWrappedTargetException& )
+ {
+ }
+ }
+}
+
+Sequence< Sequence< PropertyValue > > UIConfigurationManagerImpl::getUIElementsInfo( sal_Int16 ElementType )
+throw ( IllegalArgumentException, RuntimeException )
+{
+ if (( ElementType < 0 ) || ( ElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
+ throw IllegalArgumentException();
+
+ ResetableGuard aGuard( m_aLock );
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ Sequence< Sequence< PropertyValue > > aElementInfoSeq;
+ UIElementInfoHashMap aUIElementInfoCollection;
+
+ if ( ElementType == ::com::sun::star::ui::UIElementType::UNKNOWN )
+ {
+ for ( sal_Int16 i = 0; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
+ impl_fillSequenceWithElementTypeInfo( aUIElementInfoCollection, sal_Int16( i ) );
+ }
+ else
+ impl_fillSequenceWithElementTypeInfo( aUIElementInfoCollection, ElementType );
+
+ Sequence< PropertyValue > aUIElementInfo( 2 );
+ aUIElementInfo[0].Name = m_aPropResourceURL;
+ aUIElementInfo[1].Name = m_aPropUIName;
+
+ aElementInfoSeq.realloc( aUIElementInfoCollection.size() );
+ UIElementInfoHashMap::const_iterator pIter = aUIElementInfoCollection.begin();
+
+ sal_Int32 n = 0;
+ while ( pIter != aUIElementInfoCollection.end() )
+ {
+ aUIElementInfo[0].Value <<= pIter->second.aResourceURL;
+ aUIElementInfo[1].Value <<= pIter->second.aUIName;
+ aElementInfoSeq[n++] = aUIElementInfo;
+ ++pIter;
+ }
+
+ return aElementInfoSeq;
+}
+
+Reference< XIndexContainer > UIConfigurationManagerImpl::createSettings() throw (::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ // Creates an empty item container which can be filled from outside
+ return Reference< XIndexContainer >( static_cast< OWeakObject * >( new RootItemContainer() ), UNO_QUERY );
+}
+
+sal_Bool UIConfigurationManagerImpl::hasSettings( const ::rtl::OUString& ResourceURL )
+throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+{
+ sal_Int16 nElementType = RetrieveTypeFromResourceURL( ResourceURL );
+
+ if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
+ ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
+ throw IllegalArgumentException();
+ else
+ {
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType, false );
+ if ( pDataSettings && ( m_bUseDefault || !pDataSettings->bDefault) )
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+Reference< XIndexAccess > UIConfigurationManagerImpl::getSettings( const ::rtl::OUString& ResourceURL, sal_Bool bWriteable )
+throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+{
+ sal_Int16 nElementType = RetrieveTypeFromResourceURL( ResourceURL );
+
+ if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
+ ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
+ throw IllegalArgumentException();
+ else
+ {
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType );
+ if ( pDataSettings && ( m_bUseDefault || !pDataSettings->bDefault) )
+ {
+ // Create a copy of our data if someone wants to change the data.
+ if ( bWriteable )
+ return Reference< XIndexAccess >( static_cast< OWeakObject * >( new RootItemContainer( pDataSettings->xSettings ) ), UNO_QUERY );
+ else
+ return pDataSettings->xSettings;
+ }
+ }
+
+ throw NoSuchElementException();
+}
+
+void UIConfigurationManagerImpl::replaceSettings( const ::rtl::OUString& ResourceURL, const Reference< ::com::sun::star::container::XIndexAccess >& aNewData )
+throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IllegalAccessException, ::com::sun::star::uno::RuntimeException)
+{
+ sal_Int16 nElementType = RetrieveTypeFromResourceURL( ResourceURL );
+
+ if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
+ ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
+ throw IllegalArgumentException();
+ else if ( m_bReadOnly )
+ throw IllegalAccessException();
+ else
+ {
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType );
+ if ( pDataSettings && ( m_bUseDefault || !pDataSettings->bDefault) )
+ {
+ if ( !m_bUseDefault || !pDataSettings->bDefaultNode )
+ {
+ // we have a settings entry in our user-defined layer - replace
+ Reference< XIndexAccess > xOldSettings = pDataSettings->xSettings;
+
+ // Create a copy of the data if the container is not const
+ Reference< XIndexReplace > xReplace( aNewData, UNO_QUERY );
+ if ( xReplace.is() )
+ pDataSettings->xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( aNewData ) ), UNO_QUERY );
+ else
+ pDataSettings->xSettings = aNewData;
+ pDataSettings->bDefault = false;
+ pDataSettings->bModified = true;
+ m_bModified = true;
+
+ // Modify type container
+ UIElementType& rElementType = m_aUIElements[LAYER_USERDEFINED][nElementType];
+ rElementType.bModified = true;
+
+ Reference< XUIConfigurationManager > xThis( m_xOwner, UNO_QUERY );
+
+ // Create event to notify listener about replaced element settings
+ ConfigurationEvent aEvent;
+
+ aEvent.ResourceURL = ResourceURL;
+ aEvent.Accessor <<= xThis;
+ aEvent.Source = m_xOwner;
+ aEvent.ReplacedElement <<= xOldSettings;
+ aEvent.Element <<= pDataSettings->xSettings;
+
+ aGuard.unlock();
+
+ implts_notifyContainerListener( aEvent, NotifyOp_Replace );
+ }
+ else
+ {
+ // we have no settings in our user-defined layer - insert
+ UIElementData aUIElementData;
+
+ aUIElementData.bDefault = false;
+ aUIElementData.bDefaultNode = false;
+ aUIElementData.bModified = true;
+
+ // Create a copy of the data if the container is not const
+ Reference< XIndexReplace > xReplace( aNewData, UNO_QUERY );
+ if ( xReplace.is() )
+ aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( aNewData ) ), UNO_QUERY );
+ else
+ aUIElementData.xSettings = aNewData;
+ aUIElementData.aName = RetrieveNameFromResourceURL( ResourceURL ) + m_aXMLPostfix;
+ aUIElementData.aResourceURL = ResourceURL;
+ m_bModified = true;
+
+ // Modify type container
+ UIElementType& rElementType = m_aUIElements[LAYER_USERDEFINED][nElementType];
+ rElementType.bModified = true;
+
+ UIElementDataHashMap& rElements = rElementType.aElementsHashMap;
+
+ // Check our user element settings hash map as it can already contain settings that have been set to default!
+ // If no node can be found, we have to insert it.
+ UIElementDataHashMap::iterator pIter = rElements.find( ResourceURL );
+ if ( pIter != rElements.end() )
+ pIter->second = aUIElementData;
+ else
+ rElements.insert( UIElementDataHashMap::value_type( ResourceURL, aUIElementData ));
+
+ Reference< XUIConfigurationManager > xThis( m_xOwner, UNO_QUERY );
+
+ // Create event to notify listener about replaced element settings
+ ConfigurationEvent aEvent;
+
+ aEvent.ResourceURL = ResourceURL;
+ aEvent.Accessor <<= xThis;
+ aEvent.Source = m_xOwner;
+ aEvent.ReplacedElement <<= pDataSettings->xSettings;
+ aEvent.Element <<= aUIElementData.xSettings;
+
+ aGuard.unlock();
+
+ implts_notifyContainerListener( aEvent, NotifyOp_Replace );
+ }
+ }
+ else
+ throw NoSuchElementException();
+ }
+}
+
+void UIConfigurationManagerImpl::removeSettings( const ::rtl::OUString& ResourceURL )
+throw ( NoSuchElementException, IllegalArgumentException, IllegalAccessException, RuntimeException)
+{
+ sal_Int16 nElementType = RetrieveTypeFromResourceURL( ResourceURL );
+
+ if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
+ ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
+ throw IllegalArgumentException();
+ else if ( m_bReadOnly )
+ throw IllegalAccessException();
+ else
+ {
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType );
+ if ( pDataSettings )
+ {
+ // If element settings are default, we don't need to change anything!
+ if ( pDataSettings->bDefault )
+ return;
+ else
+ {
+ Reference< XIndexAccess > xRemovedSettings = pDataSettings->xSettings;
+ pDataSettings->bDefault = true;
+
+ // check if this is a default layer node
+ if ( !m_bUseDefault || !pDataSettings->bDefaultNode )
+ pDataSettings->bModified = true; // we have to remove this node from the user layer!
+ pDataSettings->xSettings.clear();
+ m_bModified = true; // user layer must be written
+
+ // Modify type container
+ UIElementType& rElementType = m_aUIElements[LAYER_USERDEFINED][nElementType];
+ rElementType.bModified = true;
+
+ Reference< XUIConfigurationManager > xThis( m_xOwner, UNO_QUERY );
+ // Check if we have settings in the default layer which replaces the user-defined one!
+ UIElementData* pDefaultDataSettings = m_bUseDefault ? impl_findUIElementData( ResourceURL, nElementType ) : NULL;
+ if ( pDefaultDataSettings )
+ {
+ // Create event to notify listener about replaced element settings
+ ConfigurationEvent aEvent;
+
+ aEvent.ResourceURL = ResourceURL;
+ aEvent.Accessor <<= xThis;
+ aEvent.Source = m_xOwner;
+ aEvent.Element <<= xRemovedSettings;
+ aEvent.ReplacedElement <<= pDefaultDataSettings->xSettings;
+
+ aGuard.unlock();
+
+ implts_notifyContainerListener( aEvent, NotifyOp_Replace );
+ }
+ else
+ {
+ // Create event to notify listener about removed element settings
+ ConfigurationEvent aEvent;
+
+ aEvent.ResourceURL = ResourceURL;
+ aEvent.Accessor <<= xThis;
+ aEvent.Source = m_xOwner;
+ aEvent.Element <<= xRemovedSettings;
+
+ aGuard.unlock();
+
+ implts_notifyContainerListener( aEvent, NotifyOp_Remove );
+ }
+ }
+ }
+ else
+ throw NoSuchElementException();
+ }
+}
+
+void UIConfigurationManagerImpl::insertSettings( const ::rtl::OUString& NewResourceURL, const Reference< XIndexAccess >& aNewData )
+throw ( ElementExistException, IllegalArgumentException, IllegalAccessException, RuntimeException )
+{
+ sal_Int16 nElementType = RetrieveTypeFromResourceURL( NewResourceURL );
+
+ if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
+ ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
+ throw IllegalArgumentException();
+ else if ( m_bReadOnly )
+ throw IllegalAccessException();
+ else
+ {
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ bool bInsertData( m_bUseDefault );
+ UIElementData aUIElementData;
+ UIElementData* pDataSettings = impl_findUIElementData( NewResourceURL, nElementType );
+ if ( !m_bUseDefault )
+ {
+ if ( pDataSettings && !pDataSettings->bDefault )
+ throw ElementExistException();
+ if ( !pDataSettings )
+ {
+ pDataSettings = &aUIElementData;
+ bInsertData = true;
+ }
+ }
+ if ( !pDataSettings )
+ {
+ aUIElementData.bDefault = false;
+ if ( !m_bUseDefault )
+ aUIElementData.bDefaultNode = false;
+ aUIElementData.bModified = true;
+
+ // Create a copy of the data if the container is not const
+ Reference< XIndexReplace > xReplace( aNewData, UNO_QUERY );
+ if ( xReplace.is() )
+ aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( aNewData ) ), UNO_QUERY );
+ else
+ aUIElementData.xSettings = aNewData;
+
+ m_bModified = true;
+
+ UIElementType& rElementType = m_aUIElements[LAYER_USERDEFINED][nElementType];
+ rElementType.bModified = true;
+
+ if ( bInsertData )
+ {
+ aUIElementData.aName = RetrieveNameFromResourceURL( NewResourceURL ) + m_aXMLPostfix;
+ aUIElementData.aResourceURL = NewResourceURL;
+ UIElementDataHashMap& rElements = rElementType.aElementsHashMap;
+ rElements.insert( UIElementDataHashMap::value_type( NewResourceURL, aUIElementData ));
+ }
+
+ Reference< XIndexAccess > xInsertSettings( aUIElementData.xSettings );
+ Reference< XUIConfigurationManager > xThis( m_xOwner, UNO_QUERY );
+
+ // Create event to notify listener about removed element settings
+ ConfigurationEvent aEvent;
+
+ aEvent.ResourceURL = NewResourceURL;
+ aEvent.Accessor <<= xThis;
+ aEvent.Source = m_xOwner;
+ aEvent.Element <<= xInsertSettings;
+
+ aGuard.unlock();
+
+ implts_notifyContainerListener( aEvent, NotifyOp_Insert );
+ }
+ else
+ throw ElementExistException();
+ }
+}
+
+Reference< XInterface > UIConfigurationManagerImpl::getImageManager() throw (::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ if ( !m_xModuleImageManager.is() )
+ {
+ if ( m_bUseDefault )
+ m_xModuleImageManager = Reference< XComponent >( static_cast< cppu::OWeakObject *>( new ModuleImageManager( m_xServiceManager )),
+ UNO_QUERY );
+ else
+ m_xModuleImageManager = Reference< XComponent >( static_cast< cppu::OWeakObject *>( new ImageManager( m_xServiceManager )),
+ UNO_QUERY );
+ Reference< XInitialization > xInit( m_xModuleImageManager, UNO_QUERY );
+
+ Sequence< Any > aPropSeq( m_bUseDefault ? 3 : 2 );
+ PropertyValue aPropValue;
+ aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UserConfigStorage" ));
+ aPropValue.Value <<= m_xUserConfigStorage;
+ aPropSeq[0] <<= aPropValue;
+ aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ModuleIdentifier" ));
+ aPropValue.Value <<= m_aModuleIdentifier;
+ aPropSeq[1] <<= aPropValue;
+ if ( m_bUseDefault )
+ {
+ aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UserRootCommit" ));
+ aPropValue.Value <<= m_xUserRootCommit;
+ aPropSeq[2] <<= aPropValue;
+ }
+
+ xInit->initialize( aPropSeq );
+ }
+
+ return Reference< XInterface >( m_xModuleImageManager, UNO_QUERY );
+
+// return Reference< XInterface >();
+}
+
+Reference< XInterface > UIConfigurationManagerImpl::getShortCutManager() throw (::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aGuard( m_aLock );
+ if ( !m_bUseDefault && m_xAccConfig.is())
+ return m_xAccConfig;
+
+ Reference< XMultiServiceFactory > xSMGR = m_xServiceManager;
+ ::rtl::OUString aModule = m_aModuleIdentifier;
+ Reference< XStorage > xDocumentRoot = m_xUserConfigStorage;
+ aGuard.unlock();
+ Reference< XInterface > xManager = xSMGR->createInstance(m_bUseDefault ? SERVICENAME_MODULEACCELERATORCONFIGURATION : SERVICENAME_DOCUMENTACCELERATORCONFIGURATION );
+ Reference< XInitialization > xInit (xManager, UNO_QUERY_THROW);
+
+ PropertyValue aProp;
+ Sequence< Any > lArgs(1);
+ if ( m_bUseDefault )
+ {
+ aProp.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleIdentifier"));
+ aProp.Value <<= aModule;
+ } // if ( m_bUseDefault )
+ else
+ {
+ aProp.Name = ::rtl::OUString::createFromAscii("DocumentRoot");
+ aProp.Value <<= xDocumentRoot;
+ }
+ lArgs[0] <<= aProp;
+ xInit->initialize(lArgs);
+
+ if ( !m_bUseDefault )
+ {
+ // SAFE ->
+ aGuard.lock();
+ m_xAccConfig = xManager;
+ aGuard.unlock();
+ // <- SAFE
+ }
+
+ return xManager;
+}
+
+Reference< XInterface > UIConfigurationManagerImpl::getEventsManager() throw (::com::sun::star::uno::RuntimeException)
+{
+ return Reference< XInterface >();
+}
+// XUIConfigurationStorage
+void UIConfigurationManagerImpl::setStorage( const Reference< XStorage >& Storage ) throw (::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ if ( m_xUserConfigStorage.is() )
+ {
+ try
+ {
+ // Dispose old storage to be sure that it will be closed
+ Reference< XComponent > xComponent( m_xUserConfigStorage, UNO_QUERY );
+ if ( xComponent.is() )
+ xComponent->dispose();
+ }
+ catch ( Exception& )
+ {
+ }
+ }
+
+ // We store the new storage. Be careful it could be an empty reference!
+ m_xUserConfigStorage = Storage;
+ m_bReadOnly = sal_True;
+
+ Reference< XUIConfigurationStorage > xAccUpdate(m_xAccConfig, UNO_QUERY);
+ if ( xAccUpdate.is() )
+ xAccUpdate->setStorage( m_xUserConfigStorage );
+
+ if ( m_xModuleImageManager.is() )
+ {
+ ImageManager* pImageManager = (ImageManager*)m_xModuleImageManager.get();
+ if ( pImageManager )
+ pImageManager->setStorage( m_xUserConfigStorage );
+ }
+
+ if ( m_xUserConfigStorage.is() )
+ {
+ ::rtl::OUString sEmpty;
+ for ( int i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
+ {
+ rtl::OUString aResourceType;
+ if ( i == ::com::sun::star::ui::UIElementType::MENUBAR )
+ aResourceType = PresetHandler::RESOURCETYPE_MENUBAR();
+ else if ( i == ::com::sun::star::ui::UIElementType::TOOLBAR )
+ aResourceType = PresetHandler::RESOURCETYPE_TOOLBAR();
+ else if ( i == ::com::sun::star::ui::UIElementType::STATUSBAR )
+ aResourceType = PresetHandler::RESOURCETYPE_STATUSBAR();
+
+ //if ( aResourceType.getLength() > 0 )
+ {
+ m_pStorageHandler[i] = new PresetHandler( m_xServiceManager );
+ m_pStorageHandler[i]->connectToResource( PresetHandler::E_DOCUMENT,
+ rtl::OUString::createFromAscii( UIELEMENTTYPENAMES[i] ), // this path wont be used later ... seee next lines!
+ sEmpty,
+ m_xUserConfigStorage);
+ }
+ }
+ Reference< XPropertySet > xPropSet( m_xUserConfigStorage, UNO_QUERY );
+ if ( xPropSet.is() )
+ {
+ try
+ {
+ long nOpenMode = 0;
+ if ( xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenMode" ))) >>= nOpenMode )
+ m_bReadOnly = !( nOpenMode & ElementModes::WRITE );
+ }
+ catch ( com::sun::star::beans::UnknownPropertyException& )
+ {
+ }
+ catch ( com::sun::star::lang::WrappedTargetException& )
+ {
+ }
+ }
+ }
+
+ impl_Initialize();
+}
+// -----------------------------------------------------------------------------
+sal_Bool UIConfigurationManagerImpl::hasStorage() throw (::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ return ( m_xUserConfigStorage.is() );
+}
+
+// XUIConfigurationManagerImpl
+sal_Bool UIConfigurationManagerImpl::isDefaultSettings( const ::rtl::OUString& ResourceURL )
+throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+{
+ sal_Int16 nElementType = RetrieveTypeFromResourceURL( ResourceURL );
+
+ if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
+ ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
+ throw IllegalArgumentException();
+ else
+ {
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType, false );
+ if ( pDataSettings && pDataSettings->bDefaultNode )
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+Reference< XIndexAccess > UIConfigurationManagerImpl::getDefaultSettings( const ::rtl::OUString& ResourceURL )
+throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+{
+ sal_Int16 nElementType = RetrieveTypeFromResourceURL( ResourceURL );
+
+ if (( nElementType == ::com::sun::star::ui::UIElementType::UNKNOWN ) ||
+ ( nElementType >= ::com::sun::star::ui::UIElementType::COUNT ))
+ throw IllegalArgumentException();
+ else
+ {
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ // preload list of element types on demand
+ impl_preloadUIElementTypeList( LAYER_DEFAULT, nElementType );
+
+ // Look into our default vector/hash_map combination
+ UIElementDataHashMap& rDefaultHashMap = m_aUIElements[LAYER_DEFAULT][nElementType].aElementsHashMap;
+ UIElementDataHashMap::iterator pIter = rDefaultHashMap.find( ResourceURL );
+ if ( pIter != rDefaultHashMap.end() )
+ {
+ if ( !pIter->second.xSettings.is() )
+ impl_requestUIElementData( nElementType, LAYER_DEFAULT, pIter->second );
+ return pIter->second.xSettings;
+ }
+ }
+
+ // Nothing has been found!
+ throw NoSuchElementException();
+}
+
+// XUIConfigurationPersistence
+void UIConfigurationManagerImpl::reload() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ if ( m_xUserConfigStorage.is() && m_bModified && !m_bReadOnly )
+ {
+ // Try to access our module sub folder
+ ConfigEventNotifyContainer aRemoveNotifyContainer;
+ ConfigEventNotifyContainer aReplaceNotifyContainer;
+ for ( sal_Int16 i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
+ {
+ try
+ {
+ UIElementType& rUserElementType = m_aUIElements[LAYER_USERDEFINED][i];
+ UIElementType& rDefaultElementType = m_aUIElements[LAYER_DEFAULT][i];
+
+ if ( rUserElementType.bModified )
+ impl_reloadElementTypeData( rUserElementType, rDefaultElementType, aRemoveNotifyContainer, aReplaceNotifyContainer );
+ }
+ catch ( Exception& )
+ {
+ throw IOException();
+ }
+ }
+
+ m_bModified = sal_False;
+
+ // Unlock mutex before notify our listeners
+ aGuard.unlock();
+
+ // Notify our listeners
+ ::std::for_each(aRemoveNotifyContainer.begin(),aRemoveNotifyContainer.end(),::boost::bind(&UIConfigurationManagerImpl::implts_notifyContainerListener,this,_1,NotifyOp_Remove));
+ ::std::for_each(aReplaceNotifyContainer.begin(),aReplaceNotifyContainer.end(),::boost::bind(&UIConfigurationManagerImpl::implts_notifyContainerListener,this,_1,NotifyOp_Replace));
+ }
+}
+
+void UIConfigurationManagerImpl::store() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ if ( m_xUserConfigStorage.is() && m_bModified && !m_bReadOnly )
+ {
+ // Try to access our module sub folder
+ for ( int i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
+ {
+ try
+ {
+ UIElementType& rElementType = m_aUIElements[LAYER_USERDEFINED][i];
+ Reference< XStorage > xStorage( rElementType.xStorage, UNO_QUERY );
+
+ if ( rElementType.bModified && xStorage.is() )
+ {
+ impl_storeElementTypeData( xStorage, rElementType );
+ m_pStorageHandler[i]->commitUserChanges();
+ }
+ }
+ catch ( Exception& )
+ {
+ throw IOException();
+ }
+ }
+
+ m_bModified = false;
+ }
+}
+
+void UIConfigurationManagerImpl::storeToStorage( const Reference< XStorage >& Storage ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ if ( m_xUserConfigStorage.is() && m_bModified && !m_bReadOnly )
+ {
+ // Try to access our module sub folder
+ for ( int i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
+ {
+ try
+ {
+ Reference< XStorage > xElementTypeStorage( Storage->openStorageElement(
+ rtl::OUString::createFromAscii( UIELEMENTTYPENAMES[i] ), ElementModes::READWRITE ));
+ UIElementType& rElementType = m_aUIElements[LAYER_USERDEFINED][i];
+
+ if ( rElementType.bModified && xElementTypeStorage.is() )
+ impl_storeElementTypeData( xElementTypeStorage, rElementType, false ); // store data to storage, but don't reset modify flag!
+ }
+ catch ( Exception& )
+ {
+ throw IOException();
+ }
+ }
+
+ Reference< XTransactedObject > xTransactedObject( Storage, UNO_QUERY );
+ if ( xTransactedObject.is() )
+ xTransactedObject->commit();
+ }
+}
+
+sal_Bool UIConfigurationManagerImpl::isModified() throw (::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aGuard( m_aLock );
+
+ return m_bModified;
+}
+
+sal_Bool UIConfigurationManagerImpl::isReadOnly() throw (::com::sun::star::uno::RuntimeException)
+{
+ ResetableGuard aGuard( m_aLock );
+
+ return m_bReadOnly;
+}
+
+void UIConfigurationManagerImpl::implts_notifyContainerListener( const ConfigurationEvent& aEvent, NotifyOp eOp )
+{
+ ::cppu::OInterfaceContainerHelper* pContainer = m_aListenerContainer.getContainer( ::getCppuType( ( const css::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >*) NULL ) );
+ if ( pContainer != NULL )
+ {
+ ::cppu::OInterfaceIteratorHelper pIterator( *pContainer );
+ while ( pIterator.hasMoreElements() )
+ {
+ try
+ {
+ switch ( eOp )
+ {
+ case NotifyOp_Replace:
+ ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementReplaced( aEvent );
+ break;
+ case NotifyOp_Insert:
+ ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementInserted( aEvent );
+ break;
+ case NotifyOp_Remove:
+ ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementRemoved( aEvent );
+ break;
+ }
+ }
+ catch( css::uno::RuntimeException& )
+ {
+ pIterator.remove();
+ }
+ }
+ }
+}
+
+} // namespace framework
diff --git a/framework/source/uiconfiguration/uiconfigurationmanagerimpl.hxx b/framework/source/uiconfiguration/uiconfigurationmanagerimpl.hxx
new file mode 100755
index 000000000000..3d726ba3dfa0
--- /dev/null
+++ b/framework/source/uiconfiguration/uiconfigurationmanagerimpl.hxx
@@ -0,0 +1,221 @@
+/*************************************************************************
+ *
+ * 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: UIConfigurationManagerImpl.hxx,v $
+ * $Revision: 1.10 $
+ *
+ * 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_UICONFIGURATION_UICONFIGMANAGERIMPL_HXX_
+#define __FRAMEWORK_UICONFIGURATION_UICONFIGMANAGERIMPL_HXX_
+
+
+/** Attention: stl headers must(!) be included at first. Otherwhise it can make trouble
+ with solaris headers ...
+*/
+#include <vector>
+#include <list>
+#include <hash_map>
+
+//_________________________________________________________________________________________________________________
+// my own includes
+//_________________________________________________________________________________________________________________
+#include <accelerators/presethandler.hxx>
+#include <threadhelp/threadhelpbase.hxx>
+#include <macros/generic.hxx>
+#include <macros/xinterface.hxx>
+#include <macros/xtypeprovider.hxx>
+#include <macros/xserviceinfo.hxx>
+#include <stdtypes.h>
+#include <uiconfiguration/moduleimagemanager.hxx>
+
+//_________________________________________________________________________________________________________________
+// interface includes
+//_________________________________________________________________________________________________________________
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
+#include <com/sun/star/ui/XUIConfiguration.hpp>
+#include <com/sun/star/ui/XUIConfigurationManager.hpp>
+#include <com/sun/star/ui/UIElementType.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/ui/ConfigurationEvent.hpp>
+#include <com/sun/star/embed/XTransactedObject.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
+
+//_________________________________________________________________________________________________________________
+// other includes
+//_________________________________________________________________________________________________________________
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <rtl/ustring.hxx>
+
+
+namespace framework
+{
+ class UIConfigurationManagerImpl : public ThreadHelpBase // Struct for right initalization of mutex member! Must be first of baseclasses.
+ {
+ public:
+ // XInterface, XTypeProvider, XServiceInfo
+ UIConfigurationManagerImpl( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceManager
+ , const com::sun::star::uno::Reference< com::sun::star::uno::XInterface >& _xOwner
+ , bool _bUseDefault);
+ ~UIConfigurationManagerImpl();
+
+ // XComponent
+ void dispose() throw (::com::sun::star::uno::RuntimeException);
+ void addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ void removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XInitialization
+ void initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XUIConfiguration
+ void addConfigurationListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+ void removeConfigurationListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XUIConfigurationManager
+ void reset() throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > getUIElementsInfo( sal_Int16 ElementType ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > createSettings( ) throw (::com::sun::star::uno::RuntimeException);
+ sal_Bool hasSettings( const ::rtl::OUString& ResourceURL ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > getSettings( const ::rtl::OUString& ResourceURL, sal_Bool bWriteable ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ void replaceSettings( const ::rtl::OUString& ResourceURL, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& aNewData ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IllegalAccessException, ::com::sun::star::uno::RuntimeException);
+ void removeSettings( const ::rtl::OUString& ResourceURL ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IllegalAccessException, ::com::sun::star::uno::RuntimeException);
+ void insertSettings( const ::rtl::OUString& NewResourceURL, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& aNewData ) throw (::com::sun::star::container::ElementExistException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IllegalAccessException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getImageManager() throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getShortCutManager() throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getEventsManager() throw (::com::sun::star::uno::RuntimeException);
+
+ // XUIConfigurationManagerImpl
+ sal_Bool isDefaultSettings( const ::rtl::OUString& ResourceURL ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > getDefaultSettings( const ::rtl::OUString& ResourceURL ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ // XUIConfigurationPersistence
+ void reload() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ void store() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ void storeToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& Storage ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ sal_Bool isModified() throw (::com::sun::star::uno::RuntimeException);
+ sal_Bool isReadOnly() throw (::com::sun::star::uno::RuntimeException);
+
+ // XUIConfigurationStorage
+ void setStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& Storage ) throw (::com::sun::star::uno::RuntimeException);
+ sal_Bool hasStorage() throw (::com::sun::star::uno::RuntimeException);
+
+ enum Layer
+ {
+ LAYER_DEFAULT,
+ LAYER_USERDEFINED,
+ LAYER_COUNT
+ };
+
+ enum NotifyOp
+ {
+ NotifyOp_Remove,
+ NotifyOp_Insert,
+ NotifyOp_Replace
+ };
+
+ struct UIElementInfo
+ {
+ UIElementInfo( const rtl::OUString& rResourceURL, const rtl::OUString& rUIName ) :
+ aResourceURL( rResourceURL), aUIName( rUIName ) {}
+ rtl::OUString aResourceURL;
+ rtl::OUString aUIName;
+ };
+
+ struct UIElementData
+ {
+ UIElementData() : bModified( false ), bDefault( true ), bDefaultNode( true ) {};
+
+ rtl::OUString aResourceURL;
+ rtl::OUString aName;
+ bool bModified; // has been changed since last storing
+ bool bDefault; // default settings
+ bool bDefaultNode; // this is a default layer element data
+ com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > xSettings;
+ };
+
+ struct UIElementType;
+ friend struct UIElementType;
+ typedef ::std::hash_map< rtl::OUString, UIElementData, OUStringHashCode, ::std::equal_to< rtl::OUString > > UIElementDataHashMap;
+
+ struct UIElementType
+ {
+ UIElementType() : bModified( false ),
+ bLoaded( false ),
+ bDefaultLayer( false ),
+ nElementType( ::com::sun::star::ui::UIElementType::UNKNOWN ) {}
+
+
+ bool bModified;
+ bool bLoaded;
+ bool bDefaultLayer;
+ sal_Int16 nElementType;
+ UIElementDataHashMap aElementsHashMap;
+ com::sun::star::uno::Reference< com::sun::star::embed::XStorage > xStorage;
+ };
+
+ typedef ::std::vector< UIElementType > UIElementTypesVector;
+ typedef ::std::vector< ::com::sun::star::ui::ConfigurationEvent > ConfigEventNotifyContainer;
+ typedef ::std::hash_map< rtl::OUString, UIElementInfo, OUStringHashCode, ::std::equal_to< rtl::OUString > > UIElementInfoHashMap;
+
+ // private methods
+ void impl_Initialize();
+ void implts_notifyContainerListener( const ::com::sun::star::ui::ConfigurationEvent& aEvent, NotifyOp eOp );
+ void impl_fillSequenceWithElementTypeInfo( UIElementInfoHashMap& aUIElementInfoCollection, sal_Int16 nElementType );
+ void impl_preloadUIElementTypeList( Layer eLayer, sal_Int16 nElementType );
+ UIElementData* impl_findUIElementData( const rtl::OUString& aResourceURL, sal_Int16 nElementType, bool bLoad = true );
+ void impl_requestUIElementData( sal_Int16 nElementType, Layer eLayer, UIElementData& aUIElementData );
+ void impl_storeElementTypeData( com::sun::star::uno::Reference< com::sun::star::embed::XStorage > xStorage, UIElementType& rElementType, bool bResetModifyState = true );
+ void impl_resetElementTypeData( UIElementType& rUserElementType, UIElementType& rDefaultElementType, ConfigEventNotifyContainer& rRemoveNotifyContainer, ConfigEventNotifyContainer& rReplaceNotifyContainer );
+ void impl_reloadElementTypeData( UIElementType& rUserElementType, UIElementType& rDefaultElementType, ConfigEventNotifyContainer& rRemoveNotifyContainer, ConfigEventNotifyContainer& rReplaceNotifyContainer );
+
+ UIElementTypesVector m_aUIElements[LAYER_COUNT];
+ PresetHandler* m_pStorageHandler[::com::sun::star::ui::UIElementType::COUNT];
+ com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xDefaultConfigStorage;
+ com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xUserConfigStorage;
+ com::sun::star::uno::Reference< com::sun::star::uno::XInterface > m_xOwner;
+ bool m_bUseDefault;
+ bool m_bReadOnly;
+ bool m_bInitialized;
+ bool m_bModified;
+ bool m_bConfigRead;
+ bool m_bDisposed;
+ rtl::OUString m_aXMLPostfix;
+ rtl::OUString m_aPropUIName;
+ rtl::OUString m_aPropResourceURL;
+ rtl::OUString m_aModuleIdentifier;
+ rtl::OUString m_aModuleShortName;
+ com::sun::star::uno::Reference< com::sun::star::embed::XTransactedObject > m_xUserRootCommit;
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+ ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
+ com::sun::star::uno::Reference< com::sun::star::uno::XInterface > m_xAccConfig;
+ com::sun::star::uno::Reference< com::sun::star::lang::XComponent > m_xModuleImageManager;
+ };
+}
+
+#endif // __FRAMEWORK_UICONFIGURATION_UICONFIGMANAGERIMPL_HXX_
diff --git a/framework/source/uiconfiguration/windowstateconfiguration.cxx b/framework/source/uiconfiguration/windowstateconfiguration.cxx
index 2552991c992b..ddf3cee7f848 100644
--- a/framework/source/uiconfiguration/windowstateconfiguration.cxx
+++ b/framework/source/uiconfiguration/windowstateconfiguration.cxx
@@ -369,7 +369,7 @@ throw (::com::sun::star::uno::RuntimeException)
{
try
{
- Any a = getByName( rResourceURL );
+ getByName( rResourceURL );
}
catch ( NoSuchElementException& )
{
@@ -761,7 +761,7 @@ Any ConfigurationAccess_WindowState::impl_insertCacheAndReturnSequence( const rt
nMask |= WINDOWSTATE_MASK_DOCKPOS;
}
- a = makeAny( aPos );
+ a <<= aPos;
bAddToSeq = true;
}
}
@@ -792,7 +792,7 @@ Any ConfigurationAccess_WindowState::impl_insertCacheAndReturnSequence( const rt
nMask |= WINDOWSTATE_MASK_DOCKSIZE;
}
- a = makeAny( aSize );
+ a <<= aSize;
bAddToSeq = true;
}
}
@@ -1312,11 +1312,11 @@ sal_Bool ConfigurationAccess_WindowState::impl_initializeConfigAccess()
try
{
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ));
- aPropValue.Value = makeAny( m_aConfigWindowAccess );
- aArgs[0] = makeAny( aPropValue );
+ aPropValue.Value <<= m_aConfigWindowAccess;
+ aArgs[0] <<= aPropValue;
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "lazywrite" ));
- aPropValue.Value = makeAny( sal_True );
- aArgs[1] = makeAny( aPropValue );
+ aPropValue.Value <<= sal_True;
+ aArgs[1] <<= aPropValue;
m_xConfigAccess = Reference< XNameAccess >( m_xConfigProvider->createInstanceWithArguments(
SERVICENAME_CFGUPDATEACCESS, aArgs ),
@@ -1383,8 +1383,7 @@ WindowStateConfiguration::WindowStateConfiguration( const Reference< XMultiServi
for ( sal_Int32 i = 0; i < aElementNames.getLength(); i++ )
{
aModuleIdentifier = aElementNames[i];
- Any a = xNameAccess->getByName( aModuleIdentifier );
- if ( a >>= aSeq )
+ if ( xNameAccess->getByName( aModuleIdentifier ) >>= aSeq )
{
::rtl::OUString aWindowStateFileStr;
for ( sal_Int32 y = 0; y < aSeq.getLength(); y++ )
@@ -1439,7 +1438,7 @@ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::la
ConfigurationAccess_WindowState* pModuleWindowState = new ConfigurationAccess_WindowState( aWindowStateConfigFile, m_xServiceManager );
xResourceURLWindowState = Reference< XNameAccess >( static_cast< cppu::OWeakObject* >( pModuleWindowState ),UNO_QUERY );
pModuleIter->second = xResourceURLWindowState;
- a = makeAny( xResourceURLWindowState );
+ a <<= xResourceURLWindowState;
}
return a;
diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx
index 30680801d19f..5bf655a4a0d6 100644
--- a/framework/source/uielement/addonstoolbarmanager.cxx
+++ b/framework/source/uielement/addonstoolbarmanager.cxx
@@ -343,20 +343,20 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue
PropertyValue aPropValue;
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ModuleName" ));
- aPropValue.Value = makeAny( m_aModuleIdentifier );
- aArgs[0] = makeAny( aPropValue );
+ aPropValue.Value <<= m_aModuleIdentifier;
+ aArgs[0] <<= aPropValue;
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Frame" ));
- aPropValue.Value = makeAny( m_xFrame );
- aArgs[1] = makeAny( aPropValue );
+ aPropValue.Value <<= m_xFrame;
+ aArgs[1] <<= aPropValue;
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ServiceManager" ));
- aPropValue.Value = makeAny( m_xServiceManager );
- aArgs[2] = makeAny( aPropValue );
+ aPropValue.Value <<= m_xServiceManager;
+ aArgs[2] <<= aPropValue;
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParentWindow" ));
- aPropValue.Value = makeAny( xToolbarWindow );
- aArgs[3] = makeAny( aPropValue );
+ aPropValue.Value <<= xToolbarWindow;
+ aArgs[3] <<= aPropValue;
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ItemId" ));
aPropValue.Value = makeAny( sal_Int32( nId ));
- aArgs[4] = makeAny( aPropValue );
+ aArgs[4] <<= aPropValue;
try
{
@@ -387,14 +387,14 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue
PropertyValue aPropValue;
Sequence< Any > aArgs( 3 );
aPropValue.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Frame" ));
- aPropValue.Value = makeAny( m_xFrame );
- aArgs[0] = makeAny( aPropValue );
+ aPropValue.Value <<= m_xFrame;
+ aArgs[0] <<= aPropValue;
aPropValue.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CommandURL" ));
- aPropValue.Value = makeAny( aURL );
- aArgs[1] = makeAny( aPropValue );
+ aPropValue.Value <<= aURL;
+ aArgs[1] <<= aPropValue;
aPropValue.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ServiceManager" ));
- aPropValue.Value = makeAny( m_xServiceManager );
- aArgs[2] = makeAny( aPropValue );
+ aPropValue.Value <<= m_xServiceManager;
+ aArgs[2] <<= aPropValue;
try
{
xInit->initialize( aArgs );
diff --git a/framework/source/uielement/addonstoolbarwrapper.cxx b/framework/source/uielement/addonstoolbarwrapper.cxx
index c7e0287274a1..0f6ce41ce269 100644
--- a/framework/source/uielement/addonstoolbarwrapper.cxx
+++ b/framework/source/uielement/addonstoolbarwrapper.cxx
@@ -51,6 +51,7 @@
// interface includes
//_________________________________________________________________________________________________________________
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/XSystemDependentMenuPeer.hpp>
#include <com/sun/star/awt/XMenuBar.hpp>
diff --git a/framework/source/uielement/buttontoolbarcontroller.cxx b/framework/source/uielement/buttontoolbarcontroller.cxx
index bce27ca58c76..ed1aaeb2ae61 100644
--- a/framework/source/uielement/buttontoolbarcontroller.cxx
+++ b/framework/source/uielement/buttontoolbarcontroller.cxx
@@ -285,7 +285,7 @@ throw (::com::sun::star::uno::RuntimeException)
// Provide key modifier information to dispatch function
aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "KeyModifier" ));
- aArgs[0].Value = makeAny( KeyModifier );
+ aArgs[0].Value <<= KeyModifier;
if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
UiEventLogHelper(::rtl::OUString::createFromAscii("ButtonToolbarController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx
index 5c63e6e064d7..dd3f9f0bb4b4 100644
--- a/framework/source/uielement/comboboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx
@@ -214,52 +214,17 @@ throw ( RuntimeException )
}
// ------------------------------------------------------------------
-
-void SAL_CALL ComboboxToolbarController::execute( sal_Int16 KeyModifier )
-throw ( RuntimeException )
+Sequence<PropertyValue> ComboboxToolbarController::getExecuteArgs(sal_Int16 KeyModifier) const
{
- Reference< XDispatch > xDispatch;
- Reference< XURLTransformer > xURLTransformer;
- ::rtl::OUString aCommandURL;
- ::rtl::OUString aSelectedText;
- ::com::sun::star::util::URL aTargetURL;
-
- {
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_bInitialized &&
- m_xFrame.is() &&
- m_xServiceManager.is() &&
- m_aCommandURL.getLength() )
- {
- xURLTransformer = m_xURLTransformer;
- xDispatch = getDispatchFromCommand( m_aCommandURL );
- aCommandURL = m_aCommandURL;
- aTargetURL = getInitializedURL();
- aSelectedText = m_pComboBox->GetText();
- }
- }
-
- if ( xDispatch.is() && aTargetURL.Complete.getLength() > 0 )
- {
- Sequence<PropertyValue> aArgs( 2 );
-
- // Add key modifier to argument list
- aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "KeyModifier" ));
- aArgs[0].Value <<= KeyModifier;
- aArgs[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ));
- aArgs[1].Value <<= aSelectedText;
-
- // Execute dispatch asynchronously
- ExecuteInfo* pExecuteInfo = new ExecuteInfo;
- pExecuteInfo->xDispatch = xDispatch;
- pExecuteInfo->aTargetURL = aTargetURL;
- pExecuteInfo->aArgs = aArgs;
- Application::PostUserEvent( STATIC_LINK(0, ComplexToolbarController , ExecuteHdl_Impl), pExecuteInfo );
- }
+ Sequence<PropertyValue> aArgs( 2 );
+ ::rtl::OUString aSelectedText = m_pComboBox->GetText();
+
+ // Add key modifier to argument list
+ aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "KeyModifier" ));
+ aArgs[0].Value <<= KeyModifier;
+ aArgs[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ));
+ aArgs[1].Value <<= aSelectedText;
+ return aArgs;
}
// ------------------------------------------------------------------
diff --git a/framework/source/uielement/complextoolbarcontroller.cxx b/framework/source/uielement/complextoolbarcontroller.cxx
index 1571d53ca497..e3b4d5e5a135 100644
--- a/framework/source/uielement/complextoolbarcontroller.cxx
+++ b/framework/source/uielement/complextoolbarcontroller.cxx
@@ -92,7 +92,7 @@ ComplexToolbarController::ComplexToolbarController(
, m_nID( nID )
, m_bMadeInvisible( sal_False )
{
- m_xURLTransformer = Reference< XURLTransformer >( m_xServiceManager->createInstance(
+ m_xURLTransformer.set( m_xServiceManager->createInstance(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
UNO_QUERY_THROW );
}
@@ -119,7 +119,16 @@ throw ( RuntimeException )
}
// ------------------------------------------------------------------
+Sequence<PropertyValue> ComplexToolbarController::getExecuteArgs(sal_Int16 KeyModifier) const
+{
+ Sequence<PropertyValue> aArgs( 1 );
+ // Add key modifier to argument list
+ aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "KeyModifier" ));
+ aArgs[0].Value <<= KeyModifier;
+ return aArgs;
+}
+// -----------------------------------------------------------------------------
void SAL_CALL ComplexToolbarController::execute( sal_Int16 KeyModifier )
throw ( RuntimeException )
{
@@ -127,6 +136,7 @@ throw ( RuntimeException )
Reference< XURLTransformer > xURLTransformer;
::rtl::OUString aCommandURL;
::com::sun::star::util::URL aTargetURL;
+ Sequence<PropertyValue> aArgs;
{
vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
@@ -143,17 +153,12 @@ throw ( RuntimeException )
xDispatch = getDispatchFromCommand( m_aCommandURL );
aCommandURL = m_aCommandURL;
aTargetURL = getInitializedURL();
+ aArgs = getExecuteArgs(KeyModifier);
}
}
if ( xDispatch.is() && aTargetURL.Complete.getLength() > 0 )
{
- Sequence<PropertyValue> aArgs( 1 );
-
- // Add key modifier to argument list
- aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "KeyModifier" ));
- aArgs[0].Value <<= KeyModifier;
-
// Execute dispatch asynchronously
ExecuteInfo* pExecuteInfo = new ExecuteInfo;
pExecuteInfo->xDispatch = xDispatch;
diff --git a/framework/source/uielement/constitemcontainer.cxx b/framework/source/uielement/constitemcontainer.cxx
index afd3fd7159d4..959f91776db0 100644
--- a/framework/source/uielement/constitemcontainer.cxx
+++ b/framework/source/uielement/constitemcontainer.cxx
@@ -201,13 +201,13 @@ ConstItemContainer::ConstItemContainer( const Reference< XIndexAccess >& rSource
try
{
sal_Int32 nCount = rSourceContainer->getCount();
+ m_aItemVector.reserve(nCount);
if ( bFastCopy )
{
for ( sal_Int32 i = 0; i < nCount; i++ )
{
Sequence< PropertyValue > aPropSeq;
- Any a = rSourceContainer->getByIndex( i );
- if ( a >>= aPropSeq )
+ if ( rSourceContainer->getByIndex( i ) >>= aPropSeq )
m_aItemVector.push_back( aPropSeq );
}
}
@@ -216,8 +216,7 @@ ConstItemContainer::ConstItemContainer( const Reference< XIndexAccess >& rSource
for ( sal_Int32 i = 0; i < nCount; i++ )
{
Sequence< PropertyValue > aPropSeq;
- Any a = rSourceContainer->getByIndex( i );
- if ( a >>= aPropSeq )
+ if ( rSourceContainer->getByIndex( i ) >>= aPropSeq )
{
sal_Int32 nContainerIndex = -1;
Reference< XIndexAccess > xIndexAccess;
@@ -252,7 +251,8 @@ ConstItemContainer::~ConstItemContainer()
// private
void ConstItemContainer::copyItemContainer( const std::vector< Sequence< PropertyValue > >& rSourceVector )
{
- for ( sal_uInt32 i = 0; i < rSourceVector.size(); i++ )
+ const sal_uInt32 nCount = rSourceVector.size();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
sal_Int32 nContainerIndex = -1;
Sequence< PropertyValue > aPropSeq( rSourceVector[i] );
@@ -328,7 +328,7 @@ ConstItemContainer* ConstItemContainer::GetImplementation( const ::com::sun::sta
sal_Bool SAL_CALL ConstItemContainer::hasElements()
throw ( RuntimeException )
{
- return ( m_aItemVector.size() != 0 );
+ return ( !m_aItemVector.empty() );
}
// XIndexAccess
diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx
index 6b3edfb22a6b..311db615ed2a 100644
--- a/framework/source/uielement/controlmenucontroller.cxx
+++ b/framework/source/uielement/controlmenucontroller.cxx
@@ -44,7 +44,6 @@
#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/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
@@ -228,7 +227,7 @@ ControlMenuController::ControlMenuController( const ::com::sun::star::uno::Refer
m_pResPopupMenu( 0 )
{
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
- m_bWasHiContrast = rSettings.GetMenuColor().IsDark();
+ m_bWasHiContrast = rSettings.GetHighContrastMode();
m_bShowMenuImages = rSettings.GetUseImagesInMenus();
}
@@ -346,51 +345,17 @@ void SAL_CALL ControlMenuController::statusChanged( const FeatureStateEvent& Eve
}
// XMenuListener
-void SAL_CALL ControlMenuController::highlight( const css::awt::MenuEvent& ) throw (RuntimeException)
+void ControlMenuController::impl_select(const Reference< XDispatch >& /*_xDispatch*/,const ::com::sun::star::util::URL& aURL)
{
-}
-
-void SAL_CALL ControlMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
-{
- Reference< css::awt::XPopupMenu > xPopupMenu;
- Reference< XDispatch > xRefDispatch;
- Reference< XMultiServiceFactory > xServiceManager;
-
- ResetableGuard aLock( m_aLock );
- xPopupMenu = m_xPopupMenu;
- xRefDispatch = m_xDispatch;
- xServiceManager = m_xServiceManager;
- aLock.unlock();
-
- if ( xPopupMenu.is() )
+ UrlToDispatchMap::iterator pIter = m_aURLToDispatchMap.find( aURL.Complete );
+ if ( pIter != m_aURLToDispatchMap.end() )
{
- VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( xPopupMenu );
- if ( pPopupMenu )
- {
- css::util::URL aTargetURL;
- Sequence<PropertyValue> aArgs( 1 );
- Reference< XURLTransformer > xURLTransformer( xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
-
- {
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
- PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu();
-
- aTargetURL.Complete = pVCLPopupMenu->GetItemCommand( rEvent.MenuId );
- }
-
- xURLTransformer->parseStrict( aTargetURL );
- UrlToDispatchMap::iterator pIter = m_aURLToDispatchMap.find( aTargetURL.Complete );
- if ( pIter != m_aURLToDispatchMap.end() )
- {
- Reference< XDispatch > xDispatch = pIter->second;
- if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
- UiEventLogHelper(::rtl::OUString::createFromAscii("ControlMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
- if ( xDispatch.is() )
- xDispatch->dispatch( aTargetURL, aArgs );
- }
- }
+ Sequence<PropertyValue> aArgs;
+ Reference< XDispatch > xDispatch = pIter->second;
+ if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
+ UiEventLogHelper(::rtl::OUString::createFromAscii("ControlMenuController")).log(m_xServiceManager, m_xFrame, aURL, aArgs);
+ if ( xDispatch.is() )
+ xDispatch->dispatch( aURL, aArgs );
}
}
@@ -404,7 +369,7 @@ void SAL_CALL ControlMenuController::activate( const css::awt::MenuEvent& ) thro
// Check if some modes have changed so we have to update our menu images
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
- sal_Bool bIsHiContrast = rSettings.GetMenuColor().IsDark();
+ sal_Bool bIsHiContrast = rSettings.GetHighContrastMode();
sal_Bool bShowMenuImages = rSettings.GetUseImagesInMenus();
sal_Bool bUpdateImages = (( m_bWasHiContrast != bIsHiContrast ) || ( bShowMenuImages != m_bShowMenuImages ));
@@ -425,54 +390,26 @@ void SAL_CALL ControlMenuController::activate( const css::awt::MenuEvent& ) thro
}
}
-void SAL_CALL ControlMenuController::deactivate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
// XPopupMenuController
-void SAL_CALL ControlMenuController::setPopupMenu( const Reference< css::awt::XPopupMenu >& xPopupMenu ) throw ( RuntimeException )
+void ControlMenuController::impl_setPopupMenu()
{
- ResetableGuard aLock( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_xFrame.is() && !m_xPopupMenu.is() )
+ if ( m_pResPopupMenu == 0 )
{
- // Create popup menu on demand
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+ rtl::OStringBuffer aBuf( 32 );
+ aBuf.append( "svx" );
- if ( m_pResPopupMenu == 0 )
+ ResMgr* pResMgr = ResMgr::CreateResMgr( aBuf.getStr() );
+ if ( pResMgr )
{
- rtl::OStringBuffer aBuf( 32 );
- aBuf.append( "svx" );
-
- ResMgr* pResMgr = ResMgr::CreateResMgr( aBuf.getStr() );
- if ( pResMgr )
- {
- ResId aResId( RID_FMSHELL_CONVERSIONMENU, *pResMgr );
- aResId.SetRT( RSC_MENU );
- if ( pResMgr->IsAvailable( aResId ))
- m_pResPopupMenu = new PopupMenu( aResId );
+ ResId aResId( RID_FMSHELL_CONVERSIONMENU, *pResMgr );
+ aResId.SetRT( RSC_MENU );
+ if ( pResMgr->IsAvailable( aResId ))
+ m_pResPopupMenu = new PopupMenu( aResId );
- updateImagesPopupMenu( m_pResPopupMenu );
- delete pResMgr;
- }
+ updateImagesPopupMenu( m_pResPopupMenu );
+ delete pResMgr;
}
-
- m_xPopupMenu = xPopupMenu;
- m_xPopupMenu->addMenuListener( Reference< css::awt::XMenuListener >( (OWeakObject*)this, UNO_QUERY ));
-
- Reference< XURLTransformer > xURLTransformer( m_xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
- Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
-
- com::sun::star::util::URL aTargetURL;
- aTargetURL.Complete = m_aCommandURL;
- xURLTransformer->parseStrict( aTargetURL );
- m_xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
- }
+ } // if ( m_pResPopupMenu == 0 )
}
void SAL_CALL ControlMenuController::updatePopupMenu() throw (::com::sun::star::uno::RuntimeException)
@@ -485,10 +422,6 @@ void SAL_CALL ControlMenuController::updatePopupMenu() throw (::com::sun::star::
if ( m_xFrame.is() && m_xPopupMenu.is() )
{
URL aTargetURL;
- Reference< XURLTransformer > xURLTransformer( m_xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
-
Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
fillPopupMenu( m_xPopupMenu );
m_aURLToDispatchMap.free();
@@ -496,7 +429,7 @@ void SAL_CALL ControlMenuController::updatePopupMenu() throw (::com::sun::star::
for (sal_uInt32 i=0; i<sizeof(aCommands)/sizeof(aCommands[0]); ++i)
{
aTargetURL.Complete = rtl::OUString::createFromAscii( aCommands[i] );
- xURLTransformer->parseStrict( aTargetURL );
+ m_xURLTransformer->parseStrict( aTargetURL );
Reference< XDispatch > xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
if ( xDispatch.is() )
@@ -512,36 +445,9 @@ void SAL_CALL ControlMenuController::updatePopupMenu() throw (::com::sun::star::
// XInitialization
void SAL_CALL ControlMenuController::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
{
- const rtl::OUString aFrameName( RTL_CONSTASCII_USTRINGPARAM( "Frame" ));
- const rtl::OUString aCommandURLName( RTL_CONSTASCII_USTRINGPARAM( "CommandURL" ));
-
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_bInitialized = sal_True;
- }
- }
+ PopupMenuControllerBase::initialize(aArguments);
+ m_aBaseURL = ::rtl::OUString();
}
}
diff --git a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
index b62a9891313d..cb3327c560e4 100644
--- a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
@@ -197,52 +197,17 @@ throw ( RuntimeException )
}
// ------------------------------------------------------------------
-
-void SAL_CALL DropdownToolbarController::execute( sal_Int16 KeyModifier )
-throw ( RuntimeException )
+Sequence<PropertyValue> DropdownToolbarController::getExecuteArgs(sal_Int16 KeyModifier) const
{
- Reference< XDispatch > xDispatch;
- Reference< XURLTransformer > xURLTransformer;
- ::rtl::OUString aCommandURL;
- ::rtl::OUString aSelectedText;
- ::com::sun::star::util::URL aTargetURL;
-
- {
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_bInitialized &&
- m_xFrame.is() &&
- m_xServiceManager.is() &&
- m_aCommandURL.getLength() )
- {
- xURLTransformer = m_xURLTransformer;
- xDispatch = getDispatchFromCommand( m_aCommandURL );
- aCommandURL = m_aCommandURL;
- aTargetURL = getInitializedURL();
- aSelectedText = m_pListBoxControl->GetText();
- }
- }
-
- if ( xDispatch.is() && aTargetURL.Complete.getLength() > 0 )
- {
- Sequence<PropertyValue> aArgs( 2 );
-
- // Add key modifier to argument list
- aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "KeyModifier" ));
- aArgs[0].Value <<= KeyModifier;
- aArgs[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ));
- aArgs[1].Value <<= aSelectedText;
-
- // Execute dispatch asynchronously
- ExecuteInfo* pExecuteInfo = new ExecuteInfo;
- pExecuteInfo->xDispatch = xDispatch;
- pExecuteInfo->aTargetURL = aTargetURL;
- pExecuteInfo->aArgs = aArgs;
- Application::PostUserEvent( STATIC_LINK(0, ComplexToolbarController , ExecuteHdl_Impl), pExecuteInfo );
- }
+ Sequence<PropertyValue> aArgs( 2 );
+ ::rtl::OUString aSelectedText = m_pListBoxControl->GetText();
+
+ // Add key modifier to argument list
+ aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "KeyModifier" ));
+ aArgs[0].Value <<= KeyModifier;
+ aArgs[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ));
+ aArgs[1].Value <<= aSelectedText;
+ return aArgs;
}
// ------------------------------------------------------------------
diff --git a/framework/source/uielement/edittoolbarcontroller.cxx b/framework/source/uielement/edittoolbarcontroller.cxx
index 0d6c88e83aec..88eb8641e0da 100644
--- a/framework/source/uielement/edittoolbarcontroller.cxx
+++ b/framework/source/uielement/edittoolbarcontroller.cxx
@@ -194,52 +194,17 @@ throw ( RuntimeException )
}
// ------------------------------------------------------------------
-
-void SAL_CALL EditToolbarController::execute( sal_Int16 KeyModifier )
-throw ( RuntimeException )
+Sequence<PropertyValue> EditToolbarController::getExecuteArgs(sal_Int16 KeyModifier) const
{
- Reference< XDispatch > xDispatch;
- Reference< XURLTransformer > xURLTransformer;
- ::rtl::OUString aCommandURL;
- ::rtl::OUString aSelectedText;
- ::com::sun::star::util::URL aTargetURL;
-
- {
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_bInitialized &&
- m_xFrame.is() &&
- m_xServiceManager.is() &&
- m_aCommandURL.getLength() )
- {
- xURLTransformer = m_xURLTransformer;
- xDispatch = getDispatchFromCommand( m_aCommandURL );
- aCommandURL = m_aCommandURL;
- aTargetURL = getInitializedURL();
- aSelectedText = m_pEditControl->GetText();
- }
- }
-
- if ( xDispatch.is() && aTargetURL.Complete.getLength() > 0 )
- {
- Sequence<PropertyValue> aArgs( 2 );
-
- // Add key modifier to argument list
- aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "KeyModifier" ));
- aArgs[0].Value <<= KeyModifier;
- aArgs[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ));
- aArgs[1].Value <<= aSelectedText;
-
- // Execute dispatch asynchronously
- ExecuteInfo* pExecuteInfo = new ExecuteInfo;
- pExecuteInfo->xDispatch = xDispatch;
- pExecuteInfo->aTargetURL = aTargetURL;
- pExecuteInfo->aArgs = aArgs;
- Application::PostUserEvent( STATIC_LINK(0, ComplexToolbarController , ExecuteHdl_Impl), pExecuteInfo );
- }
+ Sequence<PropertyValue> aArgs( 2 );
+ ::rtl::OUString aSelectedText = m_pEditControl->GetText();
+
+ // Add key modifier to argument list
+ aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "KeyModifier" ));
+ aArgs[0].Value <<= KeyModifier;
+ aArgs[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ));
+ aArgs[1].Value <<= aSelectedText;
+ return aArgs;
}
// ------------------------------------------------------------------
diff --git a/framework/source/uielement/fontmenucontroller.cxx b/framework/source/uielement/fontmenucontroller.cxx
index 1845f6f4cdb7..ee1014f25b77 100644
--- a/framework/source/uielement/fontmenucontroller.cxx
+++ b/framework/source/uielement/fontmenucontroller.cxx
@@ -44,7 +44,6 @@
#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/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
@@ -119,6 +118,7 @@ void FontMenuController::fillPopupMenu( const Sequence< ::rtl::OUString >& rFont
if ( pVCLPopupMenu )
{
vector<rtl::OUString> aVector;
+ aVector.reserve(rFontNameSeq.getLength());
for ( USHORT i = 0; i < rFontNameSeq.getLength(); i++ )
{
aVector.push_back(MnemonicGenerator::EraseAllMnemonicChars(pFontNameArray[i]));
@@ -126,7 +126,8 @@ void FontMenuController::fillPopupMenu( const Sequence< ::rtl::OUString >& rFont
sort(aVector.begin(), aVector.end(), lcl_I18nCompareString );
const rtl::OUString aFontNameCommandPrefix( RTL_CONSTASCII_USTRINGPARAM( ".uno:CharFontName?CharFontName.FamilyName:string=" ));
- for(USHORT i = 0; i < aVector.size(); i++)
+ const sal_Int16 nCount = (sal_Int16)aVector.size();
+ for ( sal_Int16 i = 0; i < nCount; i++ )
{
const rtl::OUString& rName = aVector[i];
m_xPopupMenu->insertItem( i+1, rName, css::awt::MenuItemStyle::RADIOCHECK | css::awt::MenuItemStyle::AUTOCHECK, i );
@@ -178,51 +179,16 @@ void SAL_CALL FontMenuController::statusChanged( const FeatureStateEvent& Event
}
// XMenuListener
-void SAL_CALL FontMenuController::highlight( const css::awt::MenuEvent& ) throw (RuntimeException)
+void FontMenuController::impl_select(const Reference< XDispatch >& _xDispatch,const ::com::sun::star::util::URL& aTargetURL)
{
-}
-
-void SAL_CALL FontMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
-{
- Reference< css::awt::XPopupMenu > xPopupMenu;
- Reference< XDispatch > xDispatch;
- Reference< XMultiServiceFactory > xServiceManager;
-
- ResetableGuard aLock( m_aLock );
- xPopupMenu = m_xPopupMenu;
- xDispatch = m_xDispatch;
- xServiceManager = m_xServiceManager;
- aLock.unlock();
-
- if ( xPopupMenu.is() && xDispatch.is() )
- {
- VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( xPopupMenu );
- if ( pPopupMenu )
- {
- css::util::URL aTargetURL;
- Sequence<PropertyValue> aArgs;
- Reference< XURLTransformer > xURLTransformer( xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
-
- {
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
-
- // Command URL used to dispatch the selected font family name
- PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu();
- aTargetURL.Complete = pVCLPopupMenu->GetItemCommand( rEvent.MenuId );
- }
-
- xURLTransformer->parseStrict( aTargetURL );
- if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
- UiEventLogHelper(::rtl::OUString::createFromAscii("FontMenuController")).log(
- m_xServiceManager,
- m_xFrame,
- aTargetURL,
- Sequence<PropertyValue>());
- xDispatch->dispatch( aTargetURL, aArgs );
- }
- }
+ Sequence<PropertyValue> aArgs;
+ if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
+ UiEventLogHelper(::rtl::OUString::createFromAscii("FontMenuController")).log(
+ m_xServiceManager,
+ m_xFrame,
+ aTargetURL,
+ Sequence<PropertyValue>());
+ _xDispatch->dispatch( aTargetURL, aArgs );
}
void SAL_CALL FontMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
@@ -262,44 +228,16 @@ void SAL_CALL FontMenuController::activate( const css::awt::MenuEvent& ) throw (
}
}
-void SAL_CALL FontMenuController::deactivate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
// XPopupMenuController
-void SAL_CALL FontMenuController::setPopupMenu( const Reference< css::awt::XPopupMenu >& xPopupMenu ) throw (RuntimeException)
+void FontMenuController::impl_setPopupMenu()
{
- 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< XURLTransformer > xURLTransformer( m_xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
- Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
+ Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
- com::sun::star::util::URL aTargetURL;
- aTargetURL.Complete = m_aCommandURL;
- xURLTransformer->parseStrict( aTargetURL );
- m_xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
-
- // Register for font list updates to get the current font list from the controller
- aTargetURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontNameList" ));
- xURLTransformer->parseStrict( aTargetURL );
- m_xFontListDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
-
- updatePopupMenu();
- }
+ com::sun::star::util::URL aTargetURL;
+ // Register for font list updates to get the current font list from the controller
+ aTargetURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontNameList" ));
+ m_xURLTransformer->parseStrict( aTargetURL );
+ m_xFontListDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
}
void SAL_CALL FontMenuController::updatePopupMenu() throw ( ::com::sun::star::uno::RuntimeException )
@@ -308,12 +246,9 @@ void SAL_CALL FontMenuController::updatePopupMenu() throw ( ::com::sun::star::un
ResetableGuard aLock( m_aLock );
Reference< XDispatch > xDispatch( m_xFontListDispatch );
- Reference< XURLTransformer > xURLTransformer( m_xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
com::sun::star::util::URL aTargetURL;
aTargetURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontNameList" ));
- xURLTransformer->parseStrict( aTargetURL );
+ m_xURLTransformer->parseStrict( aTargetURL );
aLock.unlock();
if ( xDispatch.is() )
@@ -323,11 +258,5 @@ void SAL_CALL FontMenuController::updatePopupMenu() throw ( ::com::sun::star::un
}
}
-// XInitialization
-void SAL_CALL FontMenuController::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
-{
- PopupMenuControllerBase::initialize( aArguments );
-}
-
}
diff --git a/framework/source/uielement/fontsizemenucontroller.cxx b/framework/source/uielement/fontsizemenucontroller.cxx
index d1097e621be9..bbf3915d2e06 100644
--- a/framework/source/uielement/fontsizemenucontroller.cxx
+++ b/framework/source/uielement/fontsizemenucontroller.cxx
@@ -44,7 +44,6 @@
#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/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/view/XPrintable.hpp>
@@ -322,93 +321,23 @@ void SAL_CALL FontSizeMenuController::statusChanged( const FeatureStateEvent& Ev
}
// XMenuListener
-void SAL_CALL FontSizeMenuController::highlight( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
-void SAL_CALL FontSizeMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
-{
- Reference< css::awt::XPopupMenu > xPopupMenu;
- Reference< XDispatch > xDispatch;
- Reference< XMultiServiceFactory > xServiceManager;
-
- ResetableGuard aLock( m_aLock );
- xPopupMenu = m_xPopupMenu;
- xDispatch = m_xDispatch;
- xServiceManager = m_xServiceManager;
- aLock.unlock();
-
- // Command URL used to dispatch the selected font family name
- const rtl::OUString aFontHeightCommand( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontHeight?FontHeight.Height:float=" ));
-
- if ( xPopupMenu.is() && xDispatch.is() )
- {
- VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( xPopupMenu );
- if ( pPopupMenu )
- {
- css::util::URL aTargetURL;
- Sequence<PropertyValue> aArgs;
- Reference< XURLTransformer > xURLTransformer( xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
-
- {
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
- PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu();
- aTargetURL.Complete = pVCLPopupMenu->GetItemCommand( rEvent.MenuId );
- }
-
- xURLTransformer->parseStrict( aTargetURL );
- if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
- UiEventLogHelper(::rtl::OUString::createFromAscii("FontSizeMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
- xDispatch->dispatch( aTargetURL, aArgs );
- }
- }
-}
-
-void SAL_CALL FontSizeMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
-void SAL_CALL FontSizeMenuController::deactivate( const css::awt::MenuEvent& ) throw (RuntimeException)
+void FontSizeMenuController::impl_select(const Reference< XDispatch >& _xDispatch,const ::com::sun::star::util::URL& aTargetURL)
{
+ Sequence<PropertyValue> aArgs;
+ if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
+ UiEventLogHelper(::rtl::OUString::createFromAscii("FontSizeMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
+ _xDispatch->dispatch( aTargetURL, aArgs );
}
// XPopupMenuController
-void SAL_CALL FontSizeMenuController::setPopupMenu( const Reference< css::awt::XPopupMenu >& xPopupMenu ) throw ( RuntimeException )
+void FontSizeMenuController::impl_setPopupMenu()
{
- 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< XURLTransformer > xURLTransformer( m_xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
- Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
-
- com::sun::star::util::URL aTargetURL;
-
- // Register for font name updates which gives us info about the current font!
- aTargetURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CharFontName" ));
- xURLTransformer->parseStrict( aTargetURL );
- m_xCurrentFontDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
-
- // Register for font height updates
- aTargetURL.Complete = m_aCommandURL;
- xURLTransformer->parseStrict( aTargetURL );
- m_xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
-
- updatePopupMenu();
- }
+ Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
+ com::sun::star::util::URL aTargetURL;
+ // Register for font name updates which gives us info about the current font!
+ aTargetURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CharFontName" ));
+ m_xURLTransformer->parseStrict( aTargetURL );
+ m_xCurrentFontDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
}
void SAL_CALL FontSizeMenuController::updatePopupMenu() throw ( ::com::sun::star::uno::RuntimeException )
@@ -419,12 +348,9 @@ void SAL_CALL FontSizeMenuController::updatePopupMenu() throw ( ::com::sun::star
throw DisposedException();
Reference< XDispatch > xDispatch( m_xCurrentFontDispatch );
- Reference< XURLTransformer > xURLTransformer( m_xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
com::sun::star::util::URL aTargetURL;
aTargetURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CharFontName" ));
- xURLTransformer->parseStrict( aTargetURL );
+ m_xURLTransformer->parseStrict( aTargetURL );
aLock.unlock();
if ( xDispatch.is() )
@@ -435,11 +361,4 @@ void SAL_CALL FontSizeMenuController::updatePopupMenu() throw ( ::com::sun::star
PopupMenuControllerBase::updatePopupMenu();
}
-
-// XInitialization
-void SAL_CALL FontSizeMenuController::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
-{
- PopupMenuControllerBase::initialize( aArguments );
-}
-
}
diff --git a/framework/source/uielement/footermenucontroller.cxx b/framework/source/uielement/footermenucontroller.cxx
index 8f295b82c11d..9396be03d9ea 100644
--- a/framework/source/uielement/footermenucontroller.cxx
+++ b/framework/source/uielement/footermenucontroller.cxx
@@ -40,7 +40,7 @@
#ifndef __FRAMEWORK_CLASSES_RESOURCE_HRC_
#include <classes/resource.hrc>
#endif
-#include <classes/fwkresid.hxx>
+#include <classes/fwlresid.hxx>
//_________________________________________________________________________________________________________________
// interface includes
@@ -80,8 +80,6 @@ using namespace com::sun::star::util;
using namespace com::sun::star::style;
using namespace com::sun::star::container;
-const USHORT ALL_MENUITEM_ID = 1;
-
namespace framework
{
@@ -91,256 +89,12 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( FooterMenuController
IMPLEMENTATIONNAME_FOOTERMENUCONTROLLER
)
-DEFINE_INIT_SERVICE ( FooterMenuController, {} )
-
FooterMenuController::FooterMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
- PopupMenuControllerBase( xServiceManager )
+ HeaderMenuController( xServiceManager,true )
{
}
FooterMenuController::~FooterMenuController()
{
}
-
-// private function
-void FooterMenuController::fillPopupMenu( const Reference< ::com::sun::star::frame::XModel >& rModel, Reference< css::awt::XPopupMenu >& rPopupMenu )
-{
- VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( rPopupMenu );
- PopupMenu* pVCLPopupMenu = 0;
-
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
-
- resetPopupMenu( rPopupMenu );
- if ( pPopupMenu )
- pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu();
-
- Reference< XStyleFamiliesSupplier > xStyleFamiliesSupplier( rModel, UNO_QUERY );
- if ( pVCLPopupMenu && xStyleFamiliesSupplier.is())
- {
- Reference< XNameAccess > xStyleFamilies = xStyleFamiliesSupplier->getStyleFamilies();
-
- try
- {
- const rtl::OUString aCmd( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertPageFooter" ));
- const rtl::OUString aIsPhysicalStr( RTL_CONSTASCII_USTRINGPARAM( "IsPhysical" ));
- const rtl::OUString aDisplayNameStr( RTL_CONSTASCII_USTRINGPARAM( "DisplayName" ));
- const rtl::OUString aFooterIsOnStr( RTL_CONSTASCII_USTRINGPARAM( "FooterIsOn" ));
-
- Reference< XNameContainer > xNameContainer;
- Any a = xStyleFamilies->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageStyles" )));
- if ( a >>= xNameContainer )
- {
- Sequence< rtl::OUString > aSeqNames = xNameContainer->getElementNames();
-
- USHORT nId = 2;
- USHORT nCount = 0;
- sal_Bool bAllOneState( sal_True );
- sal_Bool bLastCheck( sal_True );
- sal_Bool bFirstChecked( sal_False );
- sal_Bool bFirstItemInserted( sal_False );
- for ( sal_Int32 n = 0; n < aSeqNames.getLength(); n++ )
- {
- rtl::OUString aName = aSeqNames[n];
- Reference< XPropertySet > xPropSet( xNameContainer->getByName( aName ), UNO_QUERY );
- if ( xPropSet.is() )
- {
- sal_Bool bIsPhysical( sal_False );
- a = xPropSet->getPropertyValue( aIsPhysicalStr );
- if (( a >>= bIsPhysical ) && bIsPhysical )
- {
- rtl::OUString aDisplayName;
- sal_Bool bHeaderIsOn( sal_False );
- a = xPropSet->getPropertyValue( aDisplayNameStr );
- a >>= aDisplayName;
- a = xPropSet->getPropertyValue( aFooterIsOnStr );
- a >>= bHeaderIsOn;
-
- rtl::OUStringBuffer aStrBuf( aCmd );
- aStrBuf.appendAscii( "?PageStyle:string=");
- aStrBuf.append( aDisplayName );
- aStrBuf.appendAscii( "&On:bool=" );
- if ( !bHeaderIsOn )
- aStrBuf.appendAscii( "true" );
- else
- aStrBuf.appendAscii( "false" );
- rtl::OUString aCommand( aStrBuf.makeStringAndClear() );
- pVCLPopupMenu->InsertItem( nId, aDisplayName, MIB_CHECKABLE );
- if ( !bFirstItemInserted )
- {
- bFirstItemInserted = sal_True;
- bFirstChecked = bHeaderIsOn;
- }
-
- pVCLPopupMenu->SetItemCommand( nId, aCommand );
- if ( bHeaderIsOn )
- pVCLPopupMenu->CheckItem( nId, sal_True );
- ++nId;
-
- // Check if all entries have the same state
- if( bAllOneState && n && bHeaderIsOn != bLastCheck )
- bAllOneState = FALSE;
- bLastCheck = bHeaderIsOn;
- ++nCount;
- }
- }
- }
-
- if ( bAllOneState && ( nCount > 1 ))
- {
- // Insert special item for all command
- pVCLPopupMenu->InsertItem( ALL_MENUITEM_ID, String( FwkResId( STR_MENU_HEADFOOTALL )), 0, 0 );
-
- rtl::OUStringBuffer aStrBuf( aCmd );
- aStrBuf.appendAscii( "?On:bool=" );
-
- // Command depends on check state of first menu item entry
- if ( !bFirstChecked )
- aStrBuf.appendAscii( "true" );
- else
- aStrBuf.appendAscii( "false" );
-
- pVCLPopupMenu->SetItemCommand( 1, aStrBuf.makeStringAndClear() );
- pVCLPopupMenu->InsertSeparator( 1 );
- }
- }
- }
- catch ( com::sun::star::container::NoSuchElementException& )
- {
- }
- }
-}
-
-// XEventListener
-void SAL_CALL FooterMenuController::disposing( const EventObject& ) throw ( RuntimeException )
-{
- Reference< css::awt::XMenuListener > xHolder(( OWeakObject *)this, UNO_QUERY );
-
- ResetableGuard aLock( m_aLock );
- m_xFrame.clear();
- m_xDispatch.clear();
- m_xServiceManager.clear();
-
- if ( m_xPopupMenu.is() )
- m_xPopupMenu->removeMenuListener( Reference< css::awt::XMenuListener >(( OWeakObject *)this, UNO_QUERY ));
- m_xPopupMenu.clear();
-}
-
-// XStatusListener
-void SAL_CALL FooterMenuController::statusChanged( const FeatureStateEvent& Event ) throw ( RuntimeException )
-{
- Reference< com::sun::star::frame::XModel > xModel;
-
- if ( Event.State >>= xModel )
- {
- ResetableGuard aLock( m_aLock );
- if ( m_xPopupMenu.is() )
- fillPopupMenu( xModel, m_xPopupMenu );
- }
-}
-
-// XMenuListener
-void SAL_CALL FooterMenuController::highlight( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
-void SAL_CALL FooterMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
-{
- Reference< css::awt::XPopupMenu > xPopupMenu;
- Reference< XDispatch > xDispatch;
- Reference< XMultiServiceFactory > xServiceManager;
-
- ResetableGuard aLock( m_aLock );
- xPopupMenu = m_xPopupMenu;
- xDispatch = m_xDispatch;
- xServiceManager = m_xServiceManager;
- aLock.unlock();
-
- if ( xPopupMenu.is() && xDispatch.is() )
- {
- VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( xPopupMenu );
- if ( pPopupMenu )
- {
- css::util::URL aTargetURL;
- Sequence<PropertyValue> aArgs( 1 );
- Reference< XURLTransformer > xURLTransformer( xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
-
- {
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
- PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu();
-
- aTargetURL.Complete = pVCLPopupMenu->GetItemCommand( rEvent.MenuId );
- }
-
- xURLTransformer->parseStrict( aTargetURL );
- if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
- UiEventLogHelper(::rtl::OUString::createFromAscii("FooterMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
- xDispatch->dispatch( aTargetURL, aArgs );
- }
- }
-}
-
-void SAL_CALL FooterMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
-void SAL_CALL FooterMenuController::deactivate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
-// XPopupMenuController
-void SAL_CALL FooterMenuController::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< XURLTransformer > xURLTransformer( m_xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
- Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
-
- com::sun::star::util::URL aTargetURL;
- aTargetURL.Complete = m_aCommandURL;
- xURLTransformer->parseStrict( aTargetURL );
- m_xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
-
- updatePopupMenu();
- }
-}
-
-void SAL_CALL FooterMenuController::updatePopupMenu() throw (::com::sun::star::uno::RuntimeException)
-{
- ResetableGuard aLock( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- Reference< com::sun::star::frame::XModel > xModel( m_xModel );
- aLock.unlock();
-
- if ( !xModel.is() )
- PopupMenuControllerBase::updatePopupMenu();
-
- aLock.lock();
- if ( m_xPopupMenu.is() && m_xModel.is() )
- fillPopupMenu( m_xModel, m_xPopupMenu );
-}
-
-// XInitialization
-void SAL_CALL FooterMenuController::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
-{
- PopupMenuControllerBase::initialize( aArguments );
-}
-
}
diff --git a/framework/source/uielement/headermenucontroller.cxx b/framework/source/uielement/headermenucontroller.cxx
index c3645aea3cac..4e90d86fe0c9 100644
--- a/framework/source/uielement/headermenucontroller.cxx
+++ b/framework/source/uielement/headermenucontroller.cxx
@@ -41,7 +41,7 @@
#ifndef __FRAMEWORK_CLASSES_RESOURCE_HRC_
#include <classes/resource.hrc>
#endif
-#include <classes/fwkresid.hxx>
+#include <classes/fwlresid.hxx>
//_________________________________________________________________________________________________________________
// interface includes
@@ -49,11 +49,11 @@
#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/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#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
@@ -99,8 +99,9 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( HeaderMenuController
DEFINE_INIT_SERVICE ( HeaderMenuController, {} )
-HeaderMenuController::HeaderMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
+HeaderMenuController::HeaderMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager,bool _bFooter ) :
PopupMenuControllerBase( xServiceManager )
+ ,m_bFooter(_bFooter)
{
}
@@ -125,16 +126,20 @@ void HeaderMenuController::fillPopupMenu( const Reference< ::com::sun::star::fra
{
Reference< XNameAccess > xStyleFamilies = xStyleFamiliesSupplier->getStyleFamilies();
- try
+ rtl::OUString aCmd( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertPageHeader" ));
+ rtl::OUString aHeaderFooterIsOnStr(RTL_CONSTASCII_USTRINGPARAM( "HeaderIsOn" ));
+ if ( m_bFooter )
{
- const rtl::OUString aCmd( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertPageHeader" ));
- const rtl::OUString aIsPhysicalStr( RTL_CONSTASCII_USTRINGPARAM( "IsPhysical" ));
- const rtl::OUString aDisplayNameStr( RTL_CONSTASCII_USTRINGPARAM( "DisplayName" ));
- const rtl::OUString aHeaderIsOnStr( RTL_CONSTASCII_USTRINGPARAM( "HeaderIsOn" ));
+ aCmd = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertPageFooter" ));
+ aHeaderFooterIsOnStr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FooterIsOn" ));
+ }
+ const rtl::OUString aIsPhysicalStr( RTL_CONSTASCII_USTRINGPARAM( "IsPhysical" ));
+ const rtl::OUString aDisplayNameStr( RTL_CONSTASCII_USTRINGPARAM( "DisplayName" ));
+ try
+ {
Reference< XNameContainer > xNameContainer;
- Any a = xStyleFamilies->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageStyles" )));
- if ( a >>= xNameContainer )
+ if ( xStyleFamilies->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageStyles" ))) >>= xNameContainer )
{
Sequence< rtl::OUString > aSeqNames = xNameContainer->getElementNames();
@@ -151,15 +156,12 @@ void HeaderMenuController::fillPopupMenu( const Reference< ::com::sun::star::fra
if ( xPropSet.is() )
{
sal_Bool bIsPhysical( sal_False );
- a = xPropSet->getPropertyValue( aIsPhysicalStr );
- if (( a >>= bIsPhysical ) && bIsPhysical )
+ if (( xPropSet->getPropertyValue( aIsPhysicalStr ) >>= bIsPhysical ) && bIsPhysical )
{
rtl::OUString aDisplayName;
sal_Bool bHeaderIsOn( sal_False );
- a = xPropSet->getPropertyValue( aDisplayNameStr );
- a >>= aDisplayName;
- a = xPropSet->getPropertyValue( aHeaderIsOnStr );
- a >>= bHeaderIsOn;
+ xPropSet->getPropertyValue( aDisplayNameStr ) >>= aDisplayName;
+ xPropSet->getPropertyValue( aHeaderFooterIsOnStr ) >>= bHeaderIsOn;
rtl::OUStringBuffer aStrBuf( aCmd );
aStrBuf.appendAscii( "?PageStyle:string=");
@@ -195,7 +197,7 @@ void HeaderMenuController::fillPopupMenu( const Reference< ::com::sun::star::fra
if ( bAllOneState && ( nCount > 1 ))
{
// Insert special item for all command
- pVCLPopupMenu->InsertItem( ALL_MENUITEM_ID, String( FwkResId( STR_MENU_HEADFOOTALL )), 0, 0 );
+ pVCLPopupMenu->InsertItem( ALL_MENUITEM_ID, String( FwlResId( STR_MENU_HEADFOOTALL )), 0, 0 );
rtl::OUStringBuffer aStrBuf( aCmd );
aStrBuf.appendAscii( "?On:bool=" );
@@ -247,84 +249,12 @@ void SAL_CALL HeaderMenuController::statusChanged( const FeatureStateEvent& Even
}
// XMenuListener
-void SAL_CALL HeaderMenuController::highlight( const css::awt::MenuEvent& ) throw (RuntimeException)
+void HeaderMenuController::impl_select(const Reference< XDispatch >& _xDispatch,const ::com::sun::star::util::URL& aTargetURL)
{
-}
-
-void SAL_CALL HeaderMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
-{
- Reference< css::awt::XPopupMenu > xPopupMenu;
- Reference< XDispatch > xDispatch;
- Reference< XMultiServiceFactory > xServiceManager;
-
- ResetableGuard aLock( m_aLock );
- xPopupMenu = m_xPopupMenu;
- xDispatch = m_xDispatch;
- xServiceManager = m_xServiceManager;
- aLock.unlock();
-
- if ( xPopupMenu.is() && xDispatch.is() )
- {
- VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( xPopupMenu );
- if ( pPopupMenu )
- {
- css::util::URL aTargetURL;
- Sequence<PropertyValue> aArgs( 1 );
- Reference< XURLTransformer > xURLTransformer( xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
-
- {
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
- PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu();
-
- aTargetURL.Complete = pVCLPopupMenu->GetItemCommand( rEvent.MenuId );
- }
-
- xURLTransformer->parseStrict( aTargetURL );
- if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
- UiEventLogHelper(::rtl::OUString::createFromAscii("HeaderMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
- xDispatch->dispatch( aTargetURL, aArgs );
- }
- }
-}
-
-void SAL_CALL HeaderMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
-void SAL_CALL HeaderMenuController::deactivate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
-// XPopupMenuController
-void SAL_CALL HeaderMenuController::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< XURLTransformer > xURLTransformer( m_xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
- Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
-
- com::sun::star::util::URL aTargetURL;
- aTargetURL.Complete = m_aCommandURL;
- xURLTransformer->parseStrict( aTargetURL );
- m_xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
-
- updatePopupMenu();
- }
+ Sequence<PropertyValue> aArgs;
+ if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
+ UiEventLogHelper(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(m_bFooter ? "FooterMenuController" : "HeaderMenuController"))).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
+ _xDispatch->dispatch( aTargetURL, aArgs );
}
void SAL_CALL HeaderMenuController::updatePopupMenu() throw (::com::sun::star::uno::RuntimeException)
@@ -345,10 +275,4 @@ void SAL_CALL HeaderMenuController::updatePopupMenu() throw (::com::sun::star::u
fillPopupMenu( m_xModel, m_xPopupMenu );
}
-// XInitialization
-void SAL_CALL HeaderMenuController::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
-{
- PopupMenuControllerBase::initialize( aArguments );
-}
-
}
diff --git a/framework/source/uielement/imagebuttontoolbarcontroller.cxx b/framework/source/uielement/imagebuttontoolbarcontroller.cxx
index 588fccf8b526..ed941ea58b71 100644
--- a/framework/source/uielement/imagebuttontoolbarcontroller.cxx
+++ b/framework/source/uielement/imagebuttontoolbarcontroller.cxx
@@ -143,7 +143,7 @@ ImageButtonToolbarController::ImageButtonToolbarController(
ComplexToolbarController( rServiceManager, rFrame, pToolbar, nID, aCommand )
{
sal_Bool bBigImages( SvtMiscOptions().AreCurrentSymbolsLarge() );
- sal_Bool bHiContrast( pToolbar->GetDisplayBackground().GetColor().IsDark() );
+ sal_Bool bHiContrast( pToolbar->GetSettings().GetStyleSettings().GetHighContrastMode() );
Image aImage = AddonsOptions().GetImageFromURL( aCommand, bBigImages, bHiContrast, sal_True );
@@ -168,14 +168,6 @@ throw ( RuntimeException )
// ------------------------------------------------------------------
-void SAL_CALL ImageButtonToolbarController::execute( sal_Int16 KeyModifier )
-throw ( RuntimeException )
-{
- ComplexToolbarController::execute( KeyModifier );
-}
-
-// ------------------------------------------------------------------
-
void ImageButtonToolbarController::executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand )
{
vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
diff --git a/framework/source/uielement/itemcontainer.cxx b/framework/source/uielement/itemcontainer.cxx
index 72a691c6368a..b42930159924 100644
--- a/framework/source/uielement/itemcontainer.cxx
+++ b/framework/source/uielement/itemcontainer.cxx
@@ -55,39 +55,20 @@ namespace framework
//*****************************************************************************************************************
// XInterface, XTypeProvider
//*****************************************************************************************************************
-DEFINE_XINTERFACE_6 ( ItemContainer ,
- OWeakObject ,
- DIRECT_INTERFACE( ::com::sun::star::lang::XTypeProvider ),
- DIRECT_INTERFACE( ::com::sun::star::container::XIndexContainer ),
- DIRECT_INTERFACE( ::com::sun::star::lang::XUnoTunnel ),
- DERIVED_INTERFACE( ::com::sun::star::container::XIndexReplace, com::sun::star::container::XIndexContainer ),
- DERIVED_INTERFACE( ::com::sun::star::container::XIndexAccess, com::sun::star::container::XIndexReplace ),
- DERIVED_INTERFACE( ::com::sun::star::container::XElementAccess, ::com::sun::star::container::XIndexAccess )
- )
-DEFINE_XTYPEPROVIDER_6 ( ItemContainer ,
- ::com::sun::star::lang::XTypeProvider ,
- ::com::sun::star::container::XIndexContainer ,
- ::com::sun::star::container::XIndexReplace ,
- ::com::sun::star::container::XIndexAccess ,
- ::com::sun::star::container::XElementAccess ,
- ::com::sun::star::lang::XUnoTunnel
- )
-
-ItemContainer::ItemContainer( const ShareableMutex& rMutex ) : ::cppu::OWeakObject()
- , m_aShareMutex( rMutex )
+ItemContainer::ItemContainer( const ShareableMutex& rMutex ) :
+ m_aShareMutex( rMutex )
{
}
-ItemContainer::ItemContainer( const ConstItemContainer& rConstItemContainer, const ShareableMutex& rMutex ) : ::cppu::OWeakObject()
- , m_aShareMutex( rMutex )
+ItemContainer::ItemContainer( const ConstItemContainer& rConstItemContainer, const ShareableMutex& rMutex ) : m_aShareMutex( rMutex )
{
copyItemContainer( rConstItemContainer.m_aItemVector, rMutex );
}
-ItemContainer::ItemContainer( const Reference< XIndexAccess >& rSourceContainer, const ShareableMutex& rMutex ) : ::cppu::OWeakObject()
- , m_aShareMutex( rMutex )
+ItemContainer::ItemContainer( const Reference< XIndexAccess >& rSourceContainer, const ShareableMutex& rMutex ) :
+ m_aShareMutex( rMutex )
{
if ( rSourceContainer.is() )
{
@@ -97,8 +78,7 @@ ItemContainer::ItemContainer( const Reference< XIndexAccess >& rSourceContainer,
for ( sal_Int32 i = 0; i < nCount; i++ )
{
Sequence< PropertyValue > aPropSeq;
- Any a = rSourceContainer->getByIndex( i );
- if ( a >>= aPropSeq )
+ if ( rSourceContainer->getByIndex( i ) >>= aPropSeq )
{
sal_Int32 nContainerIndex = -1;
Reference< XIndexAccess > xIndexAccess;
@@ -132,7 +112,8 @@ ItemContainer::~ItemContainer()
// private
void ItemContainer::copyItemContainer( const std::vector< Sequence< PropertyValue > >& rSourceVector, const ShareableMutex& rMutex )
{
- for ( sal_uInt32 i = 0; i < rSourceVector.size(); i++ )
+ const sal_uInt32 nCount = rSourceVector.size();
+ for ( sal_uInt32 i = 0; i < nCount; ++i )
{
sal_Int32 nContainerIndex = -1;
Sequence< PropertyValue > aPropSeq( rSourceVector[i] );
@@ -208,7 +189,7 @@ sal_Bool SAL_CALL ItemContainer::hasElements()
throw ( RuntimeException )
{
ShareGuard aLock( m_aShareMutex );
- return ( m_aItemVector.size() != 0 );
+ return ( !m_aItemVector.empty() );
}
// XIndexAccess
diff --git a/framework/source/uielement/langselectionmenucontroller.cxx b/framework/source/uielement/langselectionmenucontroller.cxx
index 84323b3bb7ef..555682677e33 100644
--- a/framework/source/uielement/langselectionmenucontroller.cxx
+++ b/framework/source/uielement/langselectionmenucontroller.cxx
@@ -44,7 +44,6 @@
#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/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
//_________________________________________________________________________________________________________________
@@ -72,7 +71,7 @@
#include <svtools/languageoptions.hxx>
#include <com/sun/star/awt/MenuItemStyle.hpp>
#include <svtools/langtab.hxx>
-#include <classes/fwkresid.hxx>
+#include <classes/fwlresid.hxx>
#ifndef __FRAMEWORK_CLASSES_RESOURCE_HRC_
#include <classes/resource.hrc>
@@ -107,6 +106,7 @@ 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)
{
}
@@ -167,129 +167,65 @@ void SAL_CALL LanguageSelectionMenuController::statusChanged( const FeatureState
}
// XMenuListener
-void SAL_CALL LanguageSelectionMenuController::highlight( const css::awt::MenuEvent& ) throw (RuntimeException)
+void LanguageSelectionMenuController::impl_select(const Reference< XDispatch >& _xDispatch,const ::com::sun::star::util::URL& aTargetURL)
{
-}
-
-void SAL_CALL LanguageSelectionMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
-{
- Reference< css::awt::XPopupMenu > xPopupMenu;
- Reference< XDispatch > xDispatch;
- Reference< XMultiServiceFactory > xServiceManager;
+ Reference< XDispatch > xDispatch = _xDispatch;
- ResetableGuard aLock( m_aLock );
- xPopupMenu = m_xPopupMenu;
- //xDispatch = m_xDispatch;
- xServiceManager = m_xServiceManager;
- aLock.unlock();
+ if ( aTargetURL.Complete == m_aMenuCommandURL_Font )
+ { //open format/character dialog for current selection
+ xDispatch = m_xMenuDispatch_Font;
+ }
+ else if ( aTargetURL.Complete == m_aMenuCommandURL_Lang )
+ { //open language tab-page in tools/options dialog
+ xDispatch = m_xMenuDispatch_Lang;
+ }
+ else if ( aTargetURL.Complete == m_aMenuCommandURL_CharDlgForParagraph )
+ { //open format/character dialog for current selection
+ xDispatch = m_xMenuDispatch_CharDlgForParagraph;
+ }
- if ( xPopupMenu.is())//&& xDispatch.is()
+ if ( !xDispatch.is() )
{
- VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( xPopupMenu );
- if ( pPopupMenu )
- {
- css::util::URL aTargetURL;
- Sequence< PropertyValue > aArgs;
- Reference< XURLTransformer > xURLTransformer( xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
-
- {
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
-
- // Command URL used to dispatch the selected font family name
- PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu();
- aTargetURL.Complete = pVCLPopupMenu->GetItemCommand( rEvent.MenuId );
- }
-
- if ( aTargetURL.Complete == m_aMenuCommandURL_Font )
- { //open format/character dialog for current selection
- xDispatch = m_xMenuDispatch_Font;
- }
- else if ( aTargetURL.Complete == m_aMenuCommandURL_Lang )
- { //open language tab-page in tools/options dialog
- xDispatch = m_xMenuDispatch_Lang;
- }
- else if ( aTargetURL.Complete == m_aMenuCommandURL_CharDlgForParagraph )
- { //open format/character dialog for current selection
- xDispatch = m_xMenuDispatch_CharDlgForParagraph;
- }
-
- xURLTransformer->parseStrict( aTargetURL );
- if ( !xDispatch.is() )
- {
- Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
- if ( xDispatchProvider.is() )
- xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
- }
-
- if ( xDispatch.is() )
- {
- if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
- UiEventLogHelper(::rtl::OUString::createFromAscii("LanguageSelectionMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
- xDispatch->dispatch( aTargetURL, aArgs );
- }
- }
+ Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
+ if ( xDispatchProvider.is() )
+ xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
}
-}
-void SAL_CALL LanguageSelectionMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
-void SAL_CALL LanguageSelectionMenuController::deactivate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
+ if ( xDispatch.is() )
+ {
+ Sequence<PropertyValue> aArgs;
+ if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
+ UiEventLogHelper(::rtl::OUString::createFromAscii("LanguageSelectionMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
+ xDispatch->dispatch( aTargetURL, aArgs );
+ }
}
// XPopupMenuController
-void SAL_CALL LanguageSelectionMenuController::setPopupMenu( const Reference< css::awt::XPopupMenu >& xPopupMenu ) throw (RuntimeException)
+void LanguageSelectionMenuController::impl_setPopupMenu()
{
- 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< XURLTransformer > xURLTransformer( m_xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
- Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
+ Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
- com::sun::star::util::URL aTargetURL;
- aTargetURL.Complete = m_aCommandURL;
- xURLTransformer->parseStrict( aTargetURL );
- m_xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
-
- // Register for language updates
- aTargetURL.Complete = m_aLangStatusCommandURL;
- xURLTransformer->parseStrict( aTargetURL );
- m_xLanguageDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
-
- // Register for setting languages and opening language dialog
- aTargetURL.Complete = m_aMenuCommandURL_Lang;
- xURLTransformer->parseStrict( aTargetURL );
- m_xMenuDispatch_Lang = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
-
- // Register for opening character dialog
- aTargetURL.Complete = m_aMenuCommandURL_Font;
- xURLTransformer->parseStrict( aTargetURL );
- m_xMenuDispatch_Font = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
-
- // Register for opening character dialog with preselected paragraph
- aTargetURL.Complete = m_aMenuCommandURL_CharDlgForParagraph;
- xURLTransformer->parseStrict( aTargetURL );
- m_xMenuDispatch_CharDlgForParagraph = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
+ com::sun::star::util::URL aTargetURL;
- updatePopupMenu();
- }
+ // Register for language updates
+ aTargetURL.Complete = m_aLangStatusCommandURL;
+ m_xURLTransformer->parseStrict( aTargetURL );
+ m_xLanguageDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::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 );
+
+ // Register for opening character dialog
+ aTargetURL.Complete = m_aMenuCommandURL_Font;
+ m_xURLTransformer->parseStrict( aTargetURL );
+ m_xMenuDispatch_Font = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::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 );
}
void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopupMenu , const Mode eMode )
@@ -306,9 +242,9 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
if ( pVCLPopupMenu )
pPopupMenu = (PopupMenu *)pVCLPopupMenu->GetMenu();
- String aCmd=String::CreateFromAscii("");
- String aCmd_Dialog=String::CreateFromAscii("");
- String aCmd_Language=String::CreateFromAscii("");
+ String aCmd;
+ String aCmd_Dialog;
+ String aCmd_Language;
if( eMode == MODE_SetLanguageSelectionMenu )
{
aCmd_Dialog+=String::CreateFromAscii(".uno:FontDialog?Language:string=*");
@@ -332,7 +268,7 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
USHORT nItemId = 1;
//1--add current language
- if(m_aCurLang!=::rtl::OUString::createFromAscii(""))
+ if(m_aCurLang.getLength())
{
LangItems[m_aCurLang]=m_aCurLang;
}
@@ -404,17 +340,18 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
break;
const Locale& rLocale=rLocales[i];
if(IsScriptTypeMatchingToLanguage(m_nScriptType, aLanguageTable.GetType(rLocale.Language)))
- LangItems[::rtl::OUString(rLocale.Language)]=::rtl::OUString(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 != ::rtl::OUString::createFromAscii("*") &&
- it->first != ::rtl::OUString::createFromAscii(""))
+ it->first != sAsterix &&
+ it->first.getLength())
{
++nItemId;
pPopupMenu->InsertItem( nItemId,it->first);
@@ -432,14 +369,14 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
//7--none
nItemId++;
- pPopupMenu->InsertItem( nItemId, String(FwkResId( STR_LANGSTATUS_NONE )) );
+ pPopupMenu->InsertItem( nItemId, String(FwlResId( STR_LANGSTATUS_NONE )) );
aCmd=aCmd_Language;
aCmd+=String::CreateFromAscii("LANGUAGE_NONE");
pPopupMenu->SetItemCommand(nItemId,aCmd);
//More...
nItemId++;
- pPopupMenu->InsertItem( nItemId, String(FwkResId( STR_LANGSTATUS_MORE )));
+ pPopupMenu->InsertItem( nItemId, String(FwlResId( STR_LANGSTATUS_MORE )));
pPopupMenu->SetItemCommand(nItemId,aCmd_Dialog);
}
@@ -451,12 +388,9 @@ void SAL_CALL LanguageSelectionMenuController::updatePopupMenu() throw ( ::com::
// Force status update to get information about the current languages
ResetableGuard aLock( m_aLock );
Reference< XDispatch > xDispatch( m_xLanguageDispatch );
- Reference< XURLTransformer > xURLTransformer( m_xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
com::sun::star::util::URL aTargetURL;
aTargetURL.Complete = m_aLangStatusCommandURL;
- xURLTransformer->parseStrict( aTargetURL );
+ m_xURLTransformer->parseStrict( aTargetURL );
aLock.unlock();
if ( xDispatch.is() )
@@ -484,39 +418,19 @@ void SAL_CALL LanguageSelectionMenuController::updatePopupMenu() throw ( ::com::
// XInitialization
void SAL_CALL LanguageSelectionMenuController::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
{
- const rtl::OUString aFrameName( RTL_CONSTASCII_USTRINGPARAM( "Frame" ));
- const rtl::OUString aCommandURLName( RTL_CONSTASCII_USTRINGPARAM( "CommandURL" ));
-
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;
- }
- }
+ PopupMenuControllerBase::initialize(aArguments);
- if ( xFrame.is() && aCommandURL.getLength() )
+ if ( m_bInitialized )
{
- m_xFrame = xFrame;
- m_aCommandURL = aCommandURL;
- m_aBaseURL = determineBaseURL( aCommandURL );
m_aLangStatusCommandURL = rtl::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_bInitialized = true;
}
}
}
diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx
index 6eee84328315..bccd553b57d3 100644
--- a/framework/source/uielement/langselectionstatusbarcontroller.cxx
+++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx
@@ -100,6 +100,7 @@ LangSelectionStatusbarController::LangSelectionStatusbarController( const uno::R
svt::StatusbarController( xServiceManager, uno::Reference< frame::XFrame >(), rtl::OUString(), 0 ),
m_bShowMenu( sal_True ),
m_nScriptType( 7 )
+ ,m_aLangGuessHelper(xServiceManager)
{
}
@@ -123,6 +124,7 @@ void SAL_CALL LangSelectionStatusbarController::release() throw ()
void SAL_CALL LangSelectionStatusbarController::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::initialize" );
vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
svt::StatusbarController::initialize( aArguments );
@@ -142,6 +144,7 @@ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException
void SAL_CALL LangSelectionStatusbarController::dispose()
throw (::com::sun::star::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::dispose" );
svt::StatusbarController::dispose();
}
@@ -149,6 +152,7 @@ throw (::com::sun::star::uno::RuntimeException)
void SAL_CALL LangSelectionStatusbarController::disposing( const com::sun::star::lang::EventObject& Source )
throw ( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::disposing" );
svt::StatusbarController::disposing( Source );
}
@@ -157,6 +161,7 @@ throw ( RuntimeException )
const ::com::sun::star::awt::MouseEvent& )
throw (::com::sun::star::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::mouseButtonDown" );
return sal_False;
}
@@ -164,6 +169,7 @@ throw (::com::sun::star::uno::RuntimeException)
const ::com::sun::star::awt::MouseEvent& )
throw (::com::sun::star::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::mouseMove" );
return sal_False;
}
@@ -171,18 +177,21 @@ throw (::com::sun::star::uno::RuntimeException)
const ::com::sun::star::awt::MouseEvent& )
throw (::com::sun::star::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::mouseButtonUp" );
return sal_False;
}
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
- Reference< awt::XPopupMenu > xPopupMenu( m_xServiceManager->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.awt.PopupMenu" ) ), UNO_QUERY );
+ const static ::rtl::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( ::rtl::OUString::createFromAscii( "com.sun.star.awt.PopupMenu" ) ), UNO_QUERY );
+ Reference< awt::XPopupMenu > subPopupMenu(m_xServiceManager->createInstance( s_sPopupMenu ), UNO_QUERY );
std::set< ::rtl::OUString > LangItems;
@@ -190,7 +199,7 @@ void LangSelectionStatusbarController::LangMenu()throw (::com::sun::star::uno::R
USHORT nItemId=1;
//1--add current language
- if( m_aCurLang != ::rtl::OUString::createFromAscii( "" ) &&
+ if( m_aCurLang != ::rtl::OUString( ) &&
LANGUAGE_DONTKNOW != aLanguageTable.GetType( m_aCurLang ))
LangItems.insert( m_aCurLang );
@@ -394,6 +403,7 @@ void SAL_CALL LangSelectionStatusbarController::command(
const ::com::sun::star::uno::Any& /*aData*/ )
throw (::com::sun::star::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::command" );
if ( nCommand & ::awt::Command::CONTEXTMENU )
{
LangMenu();
@@ -407,18 +417,21 @@ void SAL_CALL LangSelectionStatusbarController::paint(
::sal_Int32 nStyle )
throw (::com::sun::star::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::paint" );
svt::StatusbarController::paint( xGraphics, rOutputRectangle, nItemId, nStyle );
}
void SAL_CALL LangSelectionStatusbarController::click()
throw (::com::sun::star::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::click" );
LangMenu();
}
void SAL_CALL LangSelectionStatusbarController::doubleClick()
throw (::com::sun::star::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::doubleClick" );
svt::StatusbarController::doubleClick();
}
@@ -426,6 +439,7 @@ throw (::com::sun::star::uno::RuntimeException)
void SAL_CALL LangSelectionStatusbarController::statusChanged( const FeatureStateEvent& Event )
throw ( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::statusChanged" );
vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
if ( m_bDisposed )
diff --git a/framework/source/uielement/logoimagestatusbarcontroller.cxx b/framework/source/uielement/logoimagestatusbarcontroller.cxx
index 963c652251fd..7f08e9746370 100644
--- a/framework/source/uielement/logoimagestatusbarcontroller.cxx
+++ b/framework/source/uielement/logoimagestatusbarcontroller.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_framework.hxx"
#include <uielement/logoimagestatusbarcontroller.hxx>
-#include <classes/fwkresid.hxx>
+#include <classes/fwlresid.hxx>
#include <services.h>
#include <classes/resource.hrc>
#include <vos/mutex.hxx>
@@ -64,7 +64,7 @@ DEFINE_INIT_SERVICE ( LogoImageStatusbarController, {} )
LogoImageStatusbarController::LogoImageStatusbarController( const uno::Reference< lang::XMultiServiceFactory >& xServiceManager ) :
svt::StatusbarController( xServiceManager, uno::Reference< frame::XFrame >(), rtl::OUString(), 0 )
{
- Image aImage( FwkResId( RID_IMAGE_STATUSBAR_LOGO ));
+ Image aImage( FwlResId( RID_IMAGE_STATUSBAR_LOGO ));
m_aLogoImage = aImage;
}
diff --git a/framework/source/uielement/logotextstatusbarcontroller.cxx b/framework/source/uielement/logotextstatusbarcontroller.cxx
index efba92bcfd1d..035bb7b0a523 100644
--- a/framework/source/uielement/logotextstatusbarcontroller.cxx
+++ b/framework/source/uielement/logotextstatusbarcontroller.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_framework.hxx"
#include <uielement/logotextstatusbarcontroller.hxx>
-#include <classes/fwkresid.hxx>
+#include <classes/fwlresid.hxx>
#include <services.h>
#include <classes/resource.hrc>
#include <vos/mutex.hxx>
@@ -65,7 +65,7 @@ DEFINE_INIT_SERVICE ( LogoTextStatusbarController, {} )
LogoTextStatusbarController::LogoTextStatusbarController( const uno::Reference< lang::XMultiServiceFactory >& xServiceManager ) :
svt::StatusbarController( xServiceManager, uno::Reference< frame::XFrame >(), rtl::OUString(), 0 )
{
- m_aLogoText = String( FwkResId( STR_STATUSBAR_LOGOTEXT ));
+ m_aLogoText = String( FwlResId( STR_STATUSBAR_LOGOTEXT ));
}
LogoTextStatusbarController::~LogoTextStatusbarController()
diff --git a/framework/source/uielement/macrosmenucontroller.cxx b/framework/source/uielement/macrosmenucontroller.cxx
index 93997d27cbb0..612f50d62dd0 100644
--- a/framework/source/uielement/macrosmenucontroller.cxx
+++ b/framework/source/uielement/macrosmenucontroller.cxx
@@ -32,6 +32,7 @@
#include "precompiled_framework.hxx"
#include <uielement/macrosmenucontroller.hxx>
+#include <uielement/menubarmanager.hxx>
#include <threadhelp/resetableguard.hxx>
#include "services.h"
#include <classes/resource.hrc>
@@ -42,7 +43,6 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XModuleManager.hpp>
#include <comphelper/processfactory.hxx>
#include <vcl/svapp.hxx>
@@ -50,6 +50,7 @@
#include <tools/urlobj.hxx>
#include <rtl/ustrbuf.hxx>
#include <dispatch/uieventloghelper.hxx>
+#include "helper/mischelper.hxx"
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
@@ -136,60 +137,25 @@ void SAL_CALL MacrosMenuController::statusChanged( const FeatureStateEvent& ) th
}
// XMenuListener
-void SAL_CALL MacrosMenuController::highlight( const css::awt::MenuEvent& ) throw (RuntimeException)
+void MacrosMenuController::impl_select(const Reference< XDispatch >& /*_xDispatch*/,const ::com::sun::star::util::URL& aTargetURL)
{
-}
-
-void SAL_CALL MacrosMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
-{
- Reference< css::awt::XPopupMenu > xPopupMenu;
- Reference< XDispatch > xDispatch;
- Reference< XMultiServiceFactory > xServiceManager;
-
- ResetableGuard aLock( m_aLock );
- xPopupMenu = m_xPopupMenu;
- xDispatch = m_xDispatch;
- xServiceManager = m_xServiceManager;
- aLock.unlock();
-
- if ( xPopupMenu.is() && xDispatch.is() )
+ // need to requery, since we handle more than one type of Command
+ // if we don't do this only .uno:ScriptOrganizer commands are executed
+ Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
+ Reference< XDispatch > xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
+ if( xDispatch.is() )
{
- VCLXPopupMenu* pVCLPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( xPopupMenu );
- if ( pVCLPopupMenu )
- {
- css::util::URL aTargetURL;
- Sequence<PropertyValue> aArgs;
- Reference< XURLTransformer > xURLTransformer( xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
-
- {
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
- PopupMenu* pPopupMenu = (PopupMenu *)pVCLPopupMenu->GetMenu();
-
- aTargetURL.Complete = pPopupMenu->GetItemCommand( rEvent.MenuId );
- }
-
- xURLTransformer->parseStrict( aTargetURL );
-
- // need to requery, since we handle more than one type of Command
- // if we don't do this only .uno:ScriptOrganizer commands are executed
- xDispatch = m_xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
- if( xDispatch.is() )
- {
- ExecuteInfo* pExecuteInfo = new ExecuteInfo;
- pExecuteInfo->xDispatch = xDispatch;
- pExecuteInfo->aTargetURL = aTargetURL;
- pExecuteInfo->aArgs = aArgs;
- if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
- UiEventLogHelper(::rtl::OUString::createFromAscii("MacrosMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
+ ExecuteInfo* pExecuteInfo = new ExecuteInfo;
+ pExecuteInfo->xDispatch = xDispatch;
+ pExecuteInfo->aTargetURL = aTargetURL;
+ //pExecuteInfo->aArgs = aArgs;
+ if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
+ UiEventLogHelper(::rtl::OUString::createFromAscii("MacrosMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, pExecuteInfo->aArgs);
// xDispatch->dispatch( aTargetURL, aArgs );
- Application::PostUserEvent( STATIC_LINK(0, MacrosMenuController , ExecuteHdl_Impl), pExecuteInfo );
- }
- else
- {
- }
- }
+ Application::PostUserEvent( STATIC_LINK(0, MacrosMenuController , ExecuteHdl_Impl), pExecuteInfo );
+ }
+ else
+ {
}
}
@@ -210,105 +176,10 @@ IMPL_STATIC_LINK_NOINSTANCE( MacrosMenuController, ExecuteHdl_Impl, ExecuteInfo*
return 0;
}
-void SAL_CALL MacrosMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
-void SAL_CALL MacrosMenuController::deactivate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
-// XPopupMenuController
-void SAL_CALL MacrosMenuController::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< XURLTransformer > xURLTransformer( m_xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
- Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
-
- m_xDispatchProvider = xDispatchProvider;
- com::sun::star::util::URL aTargetURL;
- aTargetURL.Complete = m_aCommandURL;
- xURLTransformer->parseStrict( aTargetURL );
- m_xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
-
- updatePopupMenu();
- }
-}
-
-// XInitialization
-void SAL_CALL MacrosMenuController::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
-{
- PopupMenuControllerBase::initialize( aArguments );
-}
-
String MacrosMenuController::RetrieveLabelFromCommand( const String& aCmdURL )
{
- String aLabel;
-
- // Retrieve popup menu labels
- if ( !m_aModuleIdentifier.getLength() )
- {
- Reference< XModuleManager > xModuleManager( ::comphelper::getProcessServiceFactory()->createInstance(
- SERVICENAME_MODULEMANAGER ), UNO_QUERY_THROW );
- Reference< XInterface > xIfac( m_xFrame, UNO_QUERY );
- m_aModuleIdentifier = xModuleManager->identify( xIfac );
-
- if ( m_aModuleIdentifier.getLength() > 0 )
- {
- Reference< XNameAccess > xNameAccess( ::comphelper::getProcessServiceFactory()->createInstance(
- SERVICENAME_UICOMMANDDESCRIPTION ), UNO_QUERY );
- if ( xNameAccess.is() )
- {
- Any a = xNameAccess->getByName( m_aModuleIdentifier );
- Reference< XNameAccess > xUICommands;
- a >>= m_xUICommandLabels;
- }
- }
- }
-
- if ( m_xUICommandLabels.is() )
- {
- try
- {
- if ( aCmdURL.Len() > 0 )
- {
- rtl::OUString aStr;
- Sequence< PropertyValue > aPropSeq;
- Any a( m_xUICommandLabels->getByName( aCmdURL ));
- if ( a >>= aPropSeq )
- {
- for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
- {
- if ( aPropSeq[i].Name.equalsAscii( "Label" ))
- {
- aPropSeq[i].Value >>= aStr;
- break;
- }
- }
- }
- aLabel = aStr;
- }
- }
- catch ( com::sun::star::uno::Exception& )
- {
- }
- }
-
- return aLabel;
+ sal_Bool bModuleIdentified = m_aModuleIdentifier.getLength() != 0;
+ return framework::RetrieveLabelFromCommand(aCmdURL,m_xServiceManager,m_xUICommandLabels,m_xFrame,m_aModuleIdentifier,bModuleIdentified,"Label");
}
void MacrosMenuController::addScriptItems( PopupMenu* pPopupMenu, USHORT startItemId )
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 54e77596970b..4c20b96f00dc 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -36,14 +36,16 @@
// my own includes
//_________________________________________________________________________________________________________________
#include <uielement/menubarmanager.hxx>
-#include <classes/menuconfiguration.hxx>
+#include <xml/menuconfiguration.hxx>
#include <classes/bmkmenu.hxx>
#include <classes/addonmenu.hxx>
#include <helper/imageproducer.hxx>
#include <threadhelp/resetableguard.hxx>
#include "classes/addonsoptions.hxx"
#include <classes/fwkresid.hxx>
+#include <classes/menumanager.hxx>
#include <helper/acceleratorinfo.hxx>
+#include <helper/mischelper.hxx>
#include <classes/menuextensionsupplier.hxx>
#include <classes/resource.hrc>
#include <services.h>
@@ -53,6 +55,7 @@
//_________________________________________________________________________________________________________________
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XFramesSupplier.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
@@ -67,7 +70,6 @@
#endif
#include <com/sun/star/ui/ItemType.hpp>
#include <com/sun/star/ui/ImageType.hpp>
-#include <com/sun/star/lang/XSingleComponentFactory.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/frame/XModuleManager.hpp>
#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
@@ -153,7 +155,7 @@ class StringLength : public ::cppu::WeakImplHelper1< ::com::sun::star::util::XSt
// XStringWidth
sal_Int32 SAL_CALL queryStringWidth( const ::rtl::OUString& aString )
- throw (::com::sun::star::uno::RuntimeException)
+ throw (RuntimeException)
{
return aString.getLength();
}
@@ -172,9 +174,7 @@ namespace framework
#define SID_HELPMENU (SID_SFX_START + 410)
#define SFX_REFERER_USER "private:user"
-#define DESKTOP_SERVICE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))
-const ::rtl::OUString aSlotString( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
const ::rtl::OUString aCmdHelpIndex( RTL_CONSTASCII_USTRINGPARAM( ".uno:HelpIndex" ));
const ::rtl::OUString aCmdToolsMenu( RTL_CONSTASCII_USTRINGPARAM( ".uno:ToolsMenu" ));
const ::rtl::OUString aCmdHelpMenu( RTL_CONSTASCII_USTRINGPARAM( ".uno:HelpMenu" ));
@@ -204,20 +204,23 @@ static sal_Int16 getImageTypeFromBools( sal_Bool bBig, sal_Bool bHighContrast )
// #110897#
MenuBarManager::MenuBarManager(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
+ const Reference< XMultiServiceFactory >& xServiceFactory,
const Reference< XFrame >& rFrame,
+ const Reference< XURLTransformer >& _xURLTransformer,
const Reference< XDispatchProvider >& rDispatchProvider,
const rtl::OUString& rModuleIdentifier,
Menu* pMenu, sal_Bool bDelete, sal_Bool bDeleteChildren )
: ThreadHelpBase( &Application::GetSolarMutex() ), OWeakObject()
, m_bDisposed( sal_False )
- , m_bModuleIdentified( sal_False )
, m_bRetrieveImages( sal_False )
, m_bAcceleratorCfg( sal_False )
+ , m_bModuleIdentified( sal_False )
, m_aListenerContainer( m_aLock.getShareableOslMutex() )
, mxServiceFactory(xServiceFactory)
+ , m_xURLTransformer(_xURLTransformer)
, m_nSymbolsStyle( SvtMiscOptions().GetCurrentSymbolsStyle() )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::MenuBarManager" );
m_xPopupMenuControllerRegistration = Reference< ::com::sun::star::frame::XUIControllerRegistration >(
getServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.PopupMenuControllerFactory" ))),
UNO_QUERY );
@@ -226,209 +229,59 @@ MenuBarManager::MenuBarManager(
// #110897#
MenuBarManager::MenuBarManager(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
+ const Reference< XMultiServiceFactory >& xServiceFactory,
const Reference< XFrame >& rFrame,
+ const Reference< XURLTransformer >& _xURLTransformer,
AddonMenu* pAddonMenu,
sal_Bool bDelete,
sal_Bool bDeleteChildren )
: ThreadHelpBase( &Application::GetSolarMutex() )
, OWeakObject()
, m_bDisposed( sal_False )
- , m_bModuleIdentified( sal_False )
, m_bRetrieveImages( sal_True )
, m_bAcceleratorCfg( sal_False )
+ , m_bModuleIdentified( sal_False )
, m_aListenerContainer( m_aLock.getShareableOslMutex() )
, mxServiceFactory(xServiceFactory)
+ , m_xURLTransformer(_xURLTransformer)
, m_nSymbolsStyle( SvtMiscOptions().GetCurrentSymbolsStyle() )
{
- m_bActive = sal_False;
- m_bDeleteMenu = bDelete;
- m_bDeleteChildren = bDeleteChildren;
- m_pVCLMenu = pAddonMenu;
- m_xFrame = rFrame;
- m_bInitialized = sal_False;
- m_bIsBookmarkMenu = sal_True;
-
- rtl::OUString aModuleIdentifier;
- m_xPopupMenuControllerRegistration = Reference< ::com::sun::star::frame::XUIControllerRegistration >(
- getServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.PopupMenuControllerFactory" ))),
- UNO_QUERY );
-
- const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
- m_bWasHiContrast = rSettings.GetMenuColor().IsDark();
-
- Reference< XStatusListener > xStatusListener;
- Reference< XDispatch > xDispatch;
- USHORT nItemCount = pAddonMenu->GetItemCount();
- for ( USHORT i = 0; i < nItemCount; i++ )
- {
- USHORT nItemId = pAddonMenu->GetItemId( i );
-
- ::rtl::OUString aItemCommand = pAddonMenu->GetItemCommand( nItemId );
- if ( !aItemCommand.getLength() )
- {
- aItemCommand = aSlotString;
- aItemCommand += ::rtl::OUString::valueOf( (sal_Int32)nItemId );
- pAddonMenu->SetItemCommand( nItemId, aItemCommand );
- }
-
- PopupMenu* pPopupMenu = pAddonMenu->GetPopupMenu( nItemId );
- if ( pPopupMenu )
- {
- // #110897#
- Reference< XDispatchProvider > xDispatchProvider;
- MenuBarManager* pSubMenuManager = new MenuBarManager( getServiceFactory(), rFrame, xDispatchProvider, aModuleIdentifier, pPopupMenu, bDeleteChildren, bDeleteChildren );
-
- Reference< XStatusListener > xSubMenuManager( static_cast< OWeakObject *>( pSubMenuManager ), UNO_QUERY );
-
- // store menu item command as we later have to know which menu is active (see Acivate handler)
- pSubMenuManager->m_aMenuItemCommand = aItemCommand;
-
- MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
- nItemId,
- xSubMenuManager,
- xDispatch );
- m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
- }
- else
- {
- if ( pAddonMenu->GetItemType( i ) != MENUITEM_SEPARATOR )
- {
- MenuConfiguration::Attributes* pAddonAttributes = (MenuConfiguration::Attributes *)(pAddonMenu->GetUserValue( nItemId ));
- MenuItemHandler* pMenuItemHandler = new MenuItemHandler( nItemId, xStatusListener, xDispatch );
-
- if ( pAddonAttributes )
- {
- // read additional attributes from attributes struct and AddonMenu implementation will delete all attributes itself!!
- pMenuItemHandler->aTargetFrame = pAddonAttributes->aTargetFrame;
- }
-
- pMenuItemHandler->aMenuItemURL = aItemCommand;
- m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
- }
- }
- }
-
- m_pVCLMenu->SetHighlightHdl( LINK( this, MenuBarManager, Highlight ));
- m_pVCLMenu->SetActivateHdl( LINK( this, MenuBarManager, Activate ));
- m_pVCLMenu->SetDeactivateHdl( LINK( this, MenuBarManager, Deactivate ));
- m_pVCLMenu->SetSelectHdl( LINK( this, MenuBarManager, Select ));
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::MenuBarManager" );
+ Init(rFrame,pAddonMenu,bDelete,bDeleteChildren);
}
-
// #110897#
MenuBarManager::MenuBarManager(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
+ const Reference< XMultiServiceFactory >& xServiceFactory,
const Reference< XFrame >& rFrame,
+ const Reference< XURLTransformer >& _xURLTransformer,
AddonPopupMenu* pAddonPopupMenu,
sal_Bool bDelete,
sal_Bool bDeleteChildren )
: ThreadHelpBase( &Application::GetSolarMutex() )
, OWeakObject()
, m_bDisposed( sal_False )
- , m_bModuleIdentified( sal_False )
, m_bRetrieveImages( sal_True )
, m_bAcceleratorCfg( sal_False )
+ , m_bModuleIdentified( sal_False )
, m_aListenerContainer( m_aLock.getShareableOslMutex() )
, mxServiceFactory(xServiceFactory)
+ , m_xURLTransformer(_xURLTransformer)
, m_nSymbolsStyle( SvtMiscOptions().GetCurrentSymbolsStyle() )
{
- m_bActive = sal_False;
- m_bDeleteMenu = bDelete;
- m_bDeleteChildren = bDeleteChildren;
- m_pVCLMenu = pAddonPopupMenu;
- m_xFrame = rFrame;
- m_bInitialized = sal_False;
- m_bIsBookmarkMenu = sal_True;
-
- rtl::OUString aModuleIdentifier;
- m_xPopupMenuControllerRegistration = Reference< ::com::sun::star::frame::XUIControllerRegistration >(
- getServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.PopupMenuControllerFactory" ))),
- UNO_QUERY );
-
- const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
- m_bWasHiContrast = rSettings.GetMenuColor().IsDark();
-
- Reference< XDispatch > xDispatch;
- Reference< XStatusListener > xStatusListener;
- USHORT nItemCount = pAddonPopupMenu->GetItemCount();
- for ( USHORT i = 0; i < nItemCount; i++ )
- {
- USHORT nItemId = pAddonPopupMenu->GetItemId( i );
-
- ::rtl::OUString aItemCommand = pAddonPopupMenu->GetItemCommand( nItemId );
- if ( !aItemCommand.getLength() )
- {
- aItemCommand = aSlotString;
- aItemCommand += ::rtl::OUString::valueOf( (sal_Int32)nItemId );
- pAddonPopupMenu->SetItemCommand( nItemId, aItemCommand );
- }
-
- PopupMenu* pPopupMenu = pAddonPopupMenu->GetPopupMenu( nItemId );
- if ( pPopupMenu )
- {
- // #110897#
- Reference< XDispatchProvider > xDispatchProvider;
- MenuBarManager* pSubMenuManager = new MenuBarManager( getServiceFactory(), rFrame, xDispatchProvider, aModuleIdentifier, pPopupMenu, sal_False, sal_False );
-
- Reference< XStatusListener > xSubMenuManager( static_cast< OWeakObject *>( pSubMenuManager ), UNO_QUERY );
-
- // store menu item command as we later have to know which menu is active (see Acivate handler)
- pSubMenuManager->m_aMenuItemCommand = aItemCommand;
-
- MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
- nItemId,
- xSubMenuManager,
- xDispatch );
- m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
- }
- else
- {
- if ( pAddonPopupMenu->GetItemType( i ) != MENUITEM_SEPARATOR )
- {
- MenuConfiguration::Attributes* pAttributes = (MenuConfiguration::Attributes *)(pAddonPopupMenu->GetUserValue( nItemId ));
- MenuItemHandler* pMenuItemHandler = new MenuItemHandler( nItemId, xStatusListener, xDispatch );
-
- if ( pAttributes )
- {
- // read additional attributes from attributes struct and BmkMenu implementation will delete all attributes itself!!
- pMenuItemHandler->aTargetFrame = pAttributes->aTargetFrame;
- }
-
- pMenuItemHandler->aMenuItemURL = aItemCommand;
-
- // Check if we have to create a popup menu for a uno based popup menu controller.
- // We have to set an empty popup menu into our menu structure so the controller also
- // works with inplace OLE.
- if ( m_xPopupMenuControllerRegistration.is() &&
- m_xPopupMenuControllerRegistration->hasController( aItemCommand, rtl::OUString() ))
- {
- VCLXPopupMenu* pVCLXPopupMenu = new VCLXPopupMenu;
- PopupMenu* pCtlPopupMenu = (PopupMenu *)pVCLXPopupMenu->GetMenu();
- pAddonPopupMenu->SetPopupMenu( pMenuItemHandler->nItemId, pCtlPopupMenu );
- pMenuItemHandler->xPopupMenu = Reference< com::sun::star::awt::XPopupMenu >( (OWeakObject *)pVCLXPopupMenu, UNO_QUERY );
-
- }
- m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
- }
- }
- }
-
- m_pVCLMenu->SetHighlightHdl( LINK( this, MenuBarManager, Highlight ));
- m_pVCLMenu->SetActivateHdl( LINK( this, MenuBarManager, Activate ));
- m_pVCLMenu->SetDeactivateHdl( LINK( this, MenuBarManager, Deactivate ));
- m_pVCLMenu->SetSelectHdl( LINK( this, MenuBarManager, Select ));
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::MenuBarManager" );
+ Init(rFrame,pAddonPopupMenu,bDelete,bDeleteChildren,true);
}
-Any SAL_CALL MenuBarManager::queryInterface( const ::com::sun::star::uno::Type & rType ) throw ( RuntimeException )
+Any SAL_CALL MenuBarManager::queryInterface( const Type & rType ) throw ( RuntimeException )
{
Any a = ::cppu::queryInterface(
rType ,
SAL_STATIC_CAST( ::com::sun::star::frame::XStatusListener*, this ),
SAL_STATIC_CAST( ::com::sun::star::frame::XFrameActionListener*, this ),
SAL_STATIC_CAST( ::com::sun::star::ui::XUIConfigurationListener*, this ),
- SAL_STATIC_CAST( ::com::sun::star::lang::XEventListener*, (XStatusListener *)this ),
- SAL_STATIC_CAST( ::com::sun::star::lang::XComponent*, this ),
+ SAL_STATIC_CAST( XEventListener*, (XStatusListener *)this ),
+ SAL_STATIC_CAST( XComponent*, this ),
SAL_STATIC_CAST( ::com::sun::star::awt::XSystemDependentMenuPeer*, this ));
if ( a.hasValue() )
@@ -450,8 +303,9 @@ void SAL_CALL MenuBarManager::release() throw()
}
-Any SAL_CALL MenuBarManager::getMenuHandle( const ::com::sun::star::uno::Sequence< sal_Int8 >& /*ProcessId*/, sal_Int16 SystemType ) throw (::com::sun::star::uno::RuntimeException)
+Any SAL_CALL MenuBarManager::getMenuHandle( const Sequence< sal_Int8 >& /*ProcessId*/, sal_Int16 SystemType ) throw (RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::getMenuHandle" );
ResetableGuard aGuard( m_aLock );
if ( m_bDisposed )
@@ -468,16 +322,16 @@ Any SAL_CALL MenuBarManager::getMenuHandle( const ::com::sun::star::uno::Sequenc
m_pVCLMenu->GetSystemMenuData( &aSystemMenuData );
#ifdef QUARTZ
- if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_MAC )
+ if( SystemType == SystemDependent::SYSTEM_MAC )
{
}
#elif (defined WNT)
- if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_WIN32 )
+ if( SystemType == SystemDependent::SYSTEM_WIN32 )
{
a <<= (long) aSystemMenuData.hMenu;
}
#elif (defined UNX)
- if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_XWINDOW )
+ if( SystemType == SystemDependent::SYSTEM_XWINDOW )
{
}
#endif
@@ -497,6 +351,7 @@ MenuBarManager::~MenuBarManager()
void MenuBarManager::Destroy()
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::Destroy" );
OGuard aGuard( Application::GetSolarMutex() );
if ( !m_bDisposed )
@@ -529,6 +384,7 @@ void MenuBarManager::Destroy()
// XComponent
void SAL_CALL MenuBarManager::dispose() throw( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::dispose" );
Reference< XComponent > xThis( static_cast< OWeakObject* >(this), UNO_QUERY );
EventObject aEvent( xThis );
@@ -577,6 +433,7 @@ void SAL_CALL MenuBarManager::dispose() throw( RuntimeException )
void SAL_CALL MenuBarManager::addEventListener( const Reference< XEventListener >& xListener ) throw( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::addEventListener" );
ResetableGuard aGuard( m_aLock );
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
@@ -588,14 +445,16 @@ void SAL_CALL MenuBarManager::addEventListener( const Reference< XEventListener
void SAL_CALL MenuBarManager::removeEventListener( const Reference< XEventListener >& xListener ) throw( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::removeEventListener" );
ResetableGuard aGuard( m_aLock );
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
m_aListenerContainer.removeInterface( ::getCppuType( ( const Reference< XEventListener >* ) NULL ), xListener );
}
void SAL_CALL MenuBarManager::elementInserted( const ::com::sun::star::ui::ConfigurationEvent& Event )
-throw (::com::sun::star::uno::RuntimeException)
+throw (RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::elementInserted" );
ResetableGuard aGuard( m_aLock );
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
@@ -610,41 +469,24 @@ throw (::com::sun::star::uno::RuntimeException)
}
void SAL_CALL MenuBarManager::elementRemoved( const ::com::sun::star::ui::ConfigurationEvent& Event )
-throw (::com::sun::star::uno::RuntimeException)
+throw (RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- return;
-
- sal_Int16 nImageType = sal_Int16();
- sal_Int16 nCurrentImageType = getImageTypeFromBools( sal_False, m_bWasHiContrast );
- if (( Event.aInfo >>= nImageType ) &&
- ( nImageType == nCurrentImageType ))
- RequestImages();
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::elementRemoved" );
+ elementInserted(Event);
}
void SAL_CALL MenuBarManager::elementReplaced( const ::com::sun::star::ui::ConfigurationEvent& Event )
-throw (::com::sun::star::uno::RuntimeException)
+throw (RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- return;
-
- sal_Int16 nImageType = sal_Int16();
- sal_Int16 nCurrentImageType = getImageTypeFromBools( sal_False, m_bWasHiContrast );
- if (( Event.aInfo >>= nImageType ) &&
- ( nImageType == nCurrentImageType ))
- RequestImages();
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::elementReplaced" );
+ elementInserted(Event);
}
// XFrameActionListener
void SAL_CALL MenuBarManager::frameAction( const FrameActionEvent& Action )
throw ( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::frameAction" );
ResetableGuard aGuard( m_aLock );
if ( m_bDisposed )
@@ -666,6 +508,7 @@ throw ( RuntimeException )
void SAL_CALL MenuBarManager::statusChanged( const FeatureStateEvent& Event )
throw ( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::statusChanged" );
::rtl::OUString aFeatureURL = Event.FeatureURL.Complete;
OGuard aSolarGuard( Application::GetSolarMutex() );
@@ -761,6 +604,7 @@ throw ( RuntimeException )
// Helper to retrieve own structure from item ID
MenuBarManager::MenuItemHandler* MenuBarManager::GetMenuItemHandler( USHORT nItemId )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::GetMenuItemHandler" );
ResetableGuard aGuard( m_aLock );
std::vector< MenuItemHandler* >::iterator p;
@@ -777,10 +621,13 @@ MenuBarManager::MenuItemHandler* MenuBarManager::GetMenuItemHandler( USHORT nIte
// Helper to set request images flag
void MenuBarManager::RequestImages()
{
- ResetableGuard aGuard( m_aLock );
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::RequestImages" );
+ // must be locked from callee
+ // ResetableGuard aGuard( m_aLock );
m_bRetrieveImages = sal_True;
- for ( sal_uInt32 i = 0; i < m_aMenuItemHandlerVector.size(); i++ )
+ const sal_uInt32 nCount = m_aMenuItemHandlerVector.size();
+ for ( sal_uInt32 i = 0; i < nCount; ++i )
{
MenuItemHandler* pItemHandler = m_aMenuItemHandlerVector[i];
if ( pItemHandler->xSubMenuManager.is() )
@@ -794,6 +641,7 @@ void MenuBarManager::RequestImages()
// Helper to reset objects to prepare shutdown
void MenuBarManager::RemoveListener()
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::RemoveListener" );
ResetableGuard aGuard( m_aLock );
// Check service manager reference. Remove listener can be called due
@@ -802,9 +650,6 @@ void MenuBarManager::RemoveListener()
Reference< XMultiServiceFactory > xServiceManager = getServiceFactory();
if ( xServiceManager.is() )
{
- Reference< XURLTransformer > xTrans( xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
-
std::vector< MenuItemHandler* >::iterator p;
for ( p = m_aMenuItemHandlerVector.begin(); p != m_aMenuItemHandlerVector.end(); p++ )
{
@@ -813,7 +658,7 @@ void MenuBarManager::RemoveListener()
{
URL aTargetURL;
aTargetURL.Complete = pItemHandler->aMenuItemURL;
- xTrans->parseStrict( aTargetURL );
+ m_xURLTransformer->parseStrict( aTargetURL );
pItemHandler->xMenuItemDispatch->removeStatusListener(
static_cast< XStatusListener* >( this ), aTargetURL );
@@ -879,6 +724,7 @@ void MenuBarManager::RemoveListener()
void SAL_CALL MenuBarManager::disposing( const EventObject& Source ) throw ( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::disposing(evt)" );
MenuItemHandler* pMenuItemDisposing = NULL;
ResetableGuard aGuard( m_aLock );
@@ -907,9 +753,7 @@ void SAL_CALL MenuBarManager::disposing( const EventObject& Source ) throw ( Run
Reference< XMultiServiceFactory > xServiceManager( getServiceFactory() );
if ( xServiceManager.is() )
{
- Reference< XURLTransformer > xTrans( xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
- xTrans->parseStrict( aTargetURL );
+ m_xURLTransformer->parseStrict( aTargetURL );
pMenuItemDisposing->xMenuItemDispatch->removeStatusListener(
static_cast< XStatusListener* >( this ), aTargetURL );
@@ -944,78 +788,10 @@ void SAL_CALL MenuBarManager::disposing( const EventObject& Source ) throw ( Run
m_xModuleImageManager.clear();
}
-void MenuBarManager::UpdateSpecialWindowMenu( Menu* pMenu )
-{
- // update window list
- ::std::vector< ::rtl::OUString > aNewWindowListVector;
-
- // #110897#
- // Reference< XDesktop > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance( DESKTOP_SERVICE ), UNO_QUERY );
- Reference< XDesktop > xDesktop( getServiceFactory()->createInstance( DESKTOP_SERVICE ), UNO_QUERY );
-
- USHORT nActiveItemId = 0;
- USHORT nItemId = START_ITEMID_WINDOWLIST;
-
- if ( xDesktop.is() )
- {
- Reference< XFramesSupplier > xTasksSupplier( xDesktop, UNO_QUERY );
- Reference< XFrame > xCurrentFrame = xDesktop->getCurrentFrame();
- Reference< XIndexAccess > xList( xTasksSupplier->getFrames(), UNO_QUERY );
- sal_Int32 nCount = xList->getCount();
- for (sal_Int32 i=0; i<nCount; ++i )
- {
- Any aItem = xList->getByIndex(i);
- Reference< XFrame > xFrame;
- aItem >>= xFrame;
- if (xFrame.is())
- {
- if ( xFrame == xCurrentFrame )
- nActiveItemId = nItemId;
-
- Window* pWin = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
- if ( pWin && pWin->IsVisible() )
- {
- aNewWindowListVector.push_back( pWin->GetText() );
- ++nItemId;
- }
- }
- }
- }
-
- {
- ResetableGuard aGuard( m_aLock );
-
- int nItemCount = pMenu->GetItemCount();
-
- if ( nItemCount > 0 )
- {
- // remove all old window list entries from menu
- sal_uInt16 nPos = pMenu->GetItemPos( START_ITEMID_WINDOWLIST );
- for ( sal_uInt16 n = nPos; n < pMenu->GetItemCount(); )
- pMenu->RemoveItem( n );
-
- if ( pMenu->GetItemType( pMenu->GetItemCount()-1 ) == MENUITEM_SEPARATOR )
- pMenu->RemoveItem( pMenu->GetItemCount()-1 );
- }
-
- if ( aNewWindowListVector.size() > 0 )
- {
- // append new window list entries to menu
- pMenu->InsertSeparator();
- nItemId = START_ITEMID_WINDOWLIST;
- for ( sal_uInt32 i = 0; i < aNewWindowListVector.size(); i++ )
- {
- pMenu->InsertItem( nItemId, aNewWindowListVector.at( i ), MIB_RADIOCHECK );
- if ( nItemId == nActiveItemId )
- pMenu->CheckItem( nItemId );
- ++nItemId;
- }
- }
- }
-}
void MenuBarManager::CheckAndAddMenuExtension( Menu* pMenu )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::CheckAndAddMenuExtension" );
static const char REFERENCECOMMAND_AFTER[] = ".uno:OnlineRegistrationDlg";
static const char REFERENCECOMMAND_BEFORE[] = ".uno:About";
@@ -1064,6 +840,7 @@ static void lcl_CheckForChildren(Menu* pMenu, USHORT nItemId)
IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::Activate" );
if ( pMenu == m_pVCLMenu )
{
// set/unset hiding disabled menu entries
@@ -1090,10 +867,10 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu )
if ( m_aMenuItemCommand == aSpecialWindowMenu ||
m_aMenuItemCommand == aSlotSpecialWindowMenu ||
aMenuCommand == aSpecialWindowCommand )
- UpdateSpecialWindowMenu( pMenu );
+ MenuManager::UpdateSpecialWindowMenu( pMenu,getServiceFactory(),m_aLock );
// Check if some modes have changed so we have to update our menu images
- sal_Bool bIsHiContrast = rSettings.GetMenuColor().IsDark();
+ sal_Bool bIsHiContrast = rSettings.GetHighContrastMode();
sal_Int16 nSymbolsStyle = SvtMiscOptions().GetCurrentSymbolsStyle();
if ( m_bRetrieveImages ||
@@ -1106,48 +883,7 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu )
m_bShowMenuImages = bShowMenuImages;
m_bRetrieveImages = sal_False;
m_nSymbolsStyle = nSymbolsStyle;
- AddonsOptions aAddonOptions;
-
- for ( USHORT nPos = 0; nPos < pMenu->GetItemCount(); nPos++ )
- {
- USHORT nId = pMenu->GetItemId( nPos );
- if ( pMenu->GetItemType( nPos ) != MENUITEM_SEPARATOR )
- {
- if ( bShowMenuImages )
- {
- sal_Bool bImageSet = sal_False;
- ::rtl::OUString aImageId;
-
- ::framework::MenuConfiguration::Attributes* pMenuAttributes =
- (::framework::MenuConfiguration::Attributes*)pMenu->GetUserValue( nId );
-
- if ( pMenuAttributes )
- aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes
-
- if ( aImageId.getLength() > 0 )
- {
- Image aImage = GetImageFromURL( m_xFrame, aImageId, FALSE, bIsHiContrast );
- if ( !!aImage )
- {
- bImageSet = sal_True;
- pMenu->SetItemImage( nId, aImage );
- }
- }
-
- if ( !bImageSet )
- {
- rtl::OUString aMenuItemCommand = pMenu->GetItemCommand( nId );
- Image aImage = GetImageFromURL( m_xFrame, aMenuItemCommand, FALSE, bIsHiContrast );
- if ( !aImage )
- aImage = aAddonOptions.GetImageFromURL( aMenuItemCommand, FALSE, bIsHiContrast );
-
- pMenu->SetItemImage( nId, aImage );
- }
- }
- else
- pMenu->SetItemImage( nId, Image() );
- }
- }
+ MenuManager::FillMenuImages(m_xFrame,pMenu,bIsHiContrast,bShowMenuImages);
}
// Try to map commands to labels
@@ -1185,10 +921,6 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu )
URL aTargetURL;
- // #110897#
- // Reference< XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
- Reference< XURLTransformer > xTrans( getServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
-
// Use provided dispatch provider => fallback to frame as dispatch provider
Reference< XDispatchProvider > xDispatchProvider;
if ( m_xDispatchProvider.is() )
@@ -1227,7 +959,7 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu )
aTargetURL.Complete = aItemCommand;
- xTrans->parseStrict( aTargetURL );
+ m_xURLTransformer->parseStrict( aTargetURL );
if ( bHasDisabledEntries )
{
@@ -1285,7 +1017,7 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu )
try
{
aTargetURL.Complete = pMenuItemHandler->aMenuItemURL;
- xTrans->parseStrict( aTargetURL );
+ m_xURLTransformer->parseStrict( aTargetURL );
pMenuItemHandler->xMenuItemDispatch->addStatusListener(
static_cast< XStatusListener* >( this ), aTargetURL );
@@ -1309,6 +1041,7 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu )
IMPL_LINK( MenuBarManager, Deactivate, Menu *, pMenu )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::Deactivate" );
if ( pMenu == m_pVCLMenu )
{
m_bActive = sal_False;
@@ -1344,6 +1077,7 @@ IMPL_LINK( MenuBarManager, AsyncSettingsHdl, Timer*,)
IMPL_LINK( MenuBarManager, Select, Menu *, pMenu )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::Select" );
URL aTargetURL;
Sequence<PropertyValue> aArgs;
Reference< XDispatch > xDispatch;
@@ -1363,7 +1097,7 @@ IMPL_LINK( MenuBarManager, Select, Menu *, pMenu )
// #110897#
// Reference< XFramesSupplier > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance( DESKTOP_SERVICE ), UNO_QUERY );
- Reference< XFramesSupplier > xDesktop( getServiceFactory()->createInstance( DESKTOP_SERVICE ), UNO_QUERY );
+ Reference< XFramesSupplier > xDesktop( getServiceFactory()->createInstance( SERVICENAME_DESKTOP ), UNO_QUERY );
if ( xDesktop.is() )
{
@@ -1372,9 +1106,8 @@ IMPL_LINK( MenuBarManager, Select, Menu *, pMenu )
sal_Int32 nCount = xList->getCount();
for ( sal_Int32 i=0; i<nCount; ++i )
{
- Any aItem = xList->getByIndex(i);
Reference< XFrame > xFrame;
- aItem >>= xFrame;
+ xList->getByIndex(i) >>= xFrame;
if ( xFrame.is() && nTaskId == nCurItemId )
{
Window* pWin = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
@@ -1392,21 +1125,15 @@ IMPL_LINK( MenuBarManager, Select, Menu *, pMenu )
MenuItemHandler* pMenuItemHandler = GetMenuItemHandler( nCurItemId );
if ( pMenuItemHandler && pMenuItemHandler->xMenuItemDispatch.is() )
{
- // #110897#
- // Reference< XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
- Reference< XURLTransformer > xTrans( getServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
-
aTargetURL.Complete = pMenuItemHandler->aMenuItemURL;
- xTrans->parseStrict( aTargetURL );
+ m_xURLTransformer->parseStrict( aTargetURL );
if ( m_bIsBookmarkMenu )
{
// bookmark menu item selected
- Any a;
aArgs.realloc( 1 );
aArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Referer" ));
- a <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SFX_REFERER_USER ));
- aArgs[0].Value = a;
+ aArgs[0].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SFX_REFERER_USER ));
}
xDispatch = pMenuItemHandler->xMenuItemDispatch;
@@ -1435,6 +1162,7 @@ IMPL_LINK( MenuBarManager, Highlight, Menu *, EMPTYARG )
sal_Bool MenuBarManager::MustBeHidden( PopupMenu* pPopupMenu, const Reference< XURLTransformer >& rTransformer )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::MustBeHidden" );
if ( pPopupMenu )
{
URL aTargetURL;
@@ -1475,77 +1203,16 @@ sal_Bool MenuBarManager::MustBeHidden( PopupMenu* pPopupMenu, const Reference< X
return sal_True;
}
-
String MenuBarManager::RetrieveLabelFromCommand( const String& aCmdURL )
{
- String aLabel;
-
- // Retrieve popup menu labels
- if ( !m_xUICommandLabels.is() )
- {
- try
- {
- if ( !m_bModuleIdentified )
- {
- m_bModuleIdentified = sal_True;
- Reference< XModuleManager > xModuleManager;
- xModuleManager = Reference< XModuleManager >( getServiceFactory()->createInstance( SERVICENAME_MODULEMANAGER ), UNO_QUERY_THROW );
-
- try
- {
- m_aModuleIdentifier = xModuleManager->identify( m_xFrame );
- }
- catch( Exception& )
- {
- }
- }
+ return framework::RetrieveLabelFromCommand(aCmdURL,mxServiceFactory,m_xUICommandLabels,m_xFrame,m_aModuleIdentifier,m_bModuleIdentified,"Label");
+}
- Reference< XNameAccess > xNameAccess( getServiceFactory()->createInstance( SERVICENAME_UICOMMANDDESCRIPTION ), UNO_QUERY );
- if ( xNameAccess.is() )
- {
- Any a = xNameAccess->getByName( m_aModuleIdentifier );
- Reference< XNameAccess > xUICommands;
- a >>= m_xUICommandLabels;
- }
- }
- catch ( Exception& )
- {
- }
- }
- if ( m_xUICommandLabels.is() )
- {
- try
- {
- if ( aCmdURL.Len() > 0 )
- {
- rtl::OUString aStr;
- Sequence< PropertyValue > aPropSeq;
- Any a( m_xUICommandLabels->getByName( aCmdURL ));
- if ( a >>= aPropSeq )
- {
- for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
- {
- if ( aPropSeq[i].Name.equalsAscii( "Label" ))
- {
- aPropSeq[i].Value >>= aStr;
- break;
- }
- }
- }
- aLabel = aStr;
- }
- }
- catch ( com::sun::star::uno::Exception& )
- {
- }
- }
-
- return aLabel;
-}
sal_Bool MenuBarManager::CreatePopupMenuController( MenuItemHandler* pMenuItemHandler )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::CreatePopupMenuController" );
rtl::OUString aItemCommand( pMenuItemHandler->aMenuItemURL );
// Try instanciate a popup menu controller. It is stored in the menu item handler.
@@ -1589,6 +1256,7 @@ sal_Bool MenuBarManager::CreatePopupMenuController( MenuItemHandler* pMenuItemHa
void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rFrame, const Reference< XDispatchProvider >& rDispatchProvider, const rtl::OUString& rModuleIdentifier, sal_Bool bDelete, sal_Bool bDeleteChildren )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::FillMenuManager" );
m_xFrame = rFrame;
m_bActive = sal_False;
m_bDeleteMenu = bDelete;
@@ -1599,7 +1267,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
m_xDispatchProvider = rDispatchProvider;
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
- m_bWasHiContrast = rSettings.GetMenuColor().IsDark();
+ m_bWasHiContrast = rSettings.GetHighContrastMode();
m_bShowMenuImages = rSettings.GetUseImagesInMenus();
m_bRetrieveImages = sal_False;
@@ -1636,17 +1304,11 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
String aEmpty;
sal_Bool bAccessibilityEnabled( Application::GetSettings().GetMiscSettings().GetEnableATToolSupport() );
USHORT nItemCount = pMenu->GetItemCount();
+ ::rtl::OUString aItemCommand;
+ m_aMenuItemHandlerVector.reserve(nItemCount);
for ( USHORT i = 0; i < nItemCount; i++ )
{
- USHORT nItemId = pMenu->GetItemId( i );
-
- ::rtl::OUString aItemCommand = pMenu->GetItemCommand( nItemId );
- if ( !aItemCommand.getLength() )
- {
- aItemCommand = aSlotString;
- aItemCommand += ::rtl::OUString::valueOf( (sal_Int32)nItemId );
- pMenu->SetItemCommand( nItemId, aItemCommand );
- }
+ USHORT nItemId = FillItemCommand(aItemCommand,pMenu, i );
// Set module identifier when provided from outside
if ( rModuleIdentifier.getLength() > 0 )
@@ -1676,8 +1338,9 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
}
if ( m_xPopupMenuControllerRegistration.is() &&
- m_xPopupMenuControllerRegistration->hasController( aItemCommand, rtl::OUString() ) &&
- pPopup->GetItemCount() == 0 )
+ pPopup->GetItemCount() == 0 &&
+ m_xPopupMenuControllerRegistration->hasController( aItemCommand, rtl::OUString() )
+ )
{
// Check if we have to create a popup menu for a uno based popup menu controller.
// We have to set an empty popup menu into our menu structure so the controller also
@@ -1703,20 +1366,8 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
{
// A special addon popup menu, must be created with a different ctor
// #110897#
- MenuBarManager* pSubMenuManager = new MenuBarManager( getServiceFactory(), rFrame, (AddonPopupMenu *)pPopup, bDeleteChildren, bDeleteChildren );
-
- Reference< XStatusListener > xSubMenuManager( static_cast< OWeakObject *>( pSubMenuManager ), UNO_QUERY );
- rFrame->addFrameActionListener( Reference< XFrameActionListener >( xSubMenuManager, UNO_QUERY ));
-
- // store menu item command as we later have to know which menu is active (see Activate handler)
- pSubMenuManager->m_aMenuItemCommand = aItemCommand;
-
- MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
- nItemId,
- xSubMenuManager,
- xDispatch );
- pMenuItemHandler->aMenuItemURL = aItemCommand;
- m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
+ MenuBarManager* pSubMenuManager = new MenuBarManager( getServiceFactory(), m_xFrame, m_xURLTransformer,(AddonPopupMenu *)pPopup, bDeleteChildren, bDeleteChildren );
+ AddMenu(pSubMenuManager,aItemCommand,nItemId);
}
else
{
@@ -1750,6 +1401,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
pPopup->SetPopupMenu( ITEMID_ADDONLIST, pSubMenu );
// Set item command for popup menu to enable it for GetImageFromURL
+ const ::rtl::OUString aSlotString( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
::rtl::OUString aNewItemCommand( aSlotString );
aNewItemCommand += ::rtl::OUString::valueOf( (sal_Int32)ITEMID_ADDONLIST );
pPopup->SetItemCommand( ITEMID_ADDONLIST, aNewItemCommand );
@@ -1765,17 +1417,9 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
AddonMenu* pSubMenu = dynamic_cast< AddonMenu* >( pPopup );
if ( pSubMenu )
{
- MenuBarManager* pSubMenuManager = new MenuBarManager( getServiceFactory(), rFrame, pSubMenu, sal_True, sal_False );
-
- Reference< XStatusListener > xSubMenuManager( static_cast< OWeakObject *>( pSubMenuManager ), UNO_QUERY );
- rFrame->addFrameActionListener( Reference< XFrameActionListener >( xSubMenuManager, UNO_QUERY ));
-
- MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
- nItemId,
- xSubMenuManager,
- xDispatch );
- pMenuItemHandler->aMenuItemURL = aItemCommand;
- m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
+ MenuBarManager* pSubMenuManager = new MenuBarManager( getServiceFactory(), m_xFrame, m_xURLTransformer,pSubMenu, sal_True, sal_False );
+ AddMenu(pSubMenuManager,aItemCommand,nItemId);
+ pSubMenuManager->m_aMenuItemCommand = ::rtl::OUString();
// Set image for the addon popup menu item
if ( m_bShowMenuImages && !pPopup->GetItemImage( ITEMID_ADDONLIST ))
@@ -1790,19 +1434,8 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
else
{
// #110897# MenuBarManager* pSubMenuManager = new MenuBarManager( rFrame, pPopupMenu, bDeleteChildren, bDeleteChildren );
- MenuBarManager* pSubMenuMgr = new MenuBarManager( getServiceFactory(), rFrame, rDispatchProvider, aModuleIdentifier, pPopup, bDeleteChildren, bDeleteChildren );
- Reference< XStatusListener > xSubMenuMgr( static_cast< OWeakObject *>( pSubMenuMgr ), UNO_QUERY );
- rFrame->addFrameActionListener( Reference< XFrameActionListener >( xSubMenuMgr, UNO_QUERY ));
-
- // store menu item command as we later have to know which menu is active (see Activate handler)
- pSubMenuMgr->m_aMenuItemCommand = aItemCommand;
-
- MenuItemHandler* pMenuItemHdl = new MenuItemHandler(
- nItemId,
- xSubMenuMgr,
- xDispatch );
- pMenuItemHdl->aMenuItemURL = aItemCommand;
- m_aMenuItemHandlerVector.push_back( pMenuItemHdl );
+ MenuBarManager* pSubMenuMgr = new MenuBarManager( getServiceFactory(), rFrame, m_xURLTransformer,rDispatchProvider, aModuleIdentifier, pPopup, bDeleteChildren, bDeleteChildren );
+ AddMenu(pSubMenuMgr,aItemCommand,nItemId);
}
}
}
@@ -1854,10 +1487,9 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
pMenu->SetPopupMenu( pItemHandler->nItemId, pPopupMenu );
pItemHandler->xPopupMenu = Reference< com::sun::star::awt::XPopupMenu >( (OWeakObject *)pVCLXPopupMenu, UNO_QUERY );
- if ( bAccessibilityEnabled )
+ if ( bAccessibilityEnabled && CreatePopupMenuController( pItemHandler ) )
{
- if ( CreatePopupMenuController( pItemHandler ))
- pItemHandler->xPopupMenuController->updatePopupMenu();
+ pItemHandler->xPopupMenuController->updatePopupMenu();
}
lcl_CheckForChildren(pMenu, pItemHandler->nItemId);
@@ -1887,10 +1519,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
}
}
- m_pVCLMenu->SetHighlightHdl( LINK( this, MenuBarManager, Highlight ));
- m_pVCLMenu->SetActivateHdl( LINK( this, MenuBarManager, Activate ));
- m_pVCLMenu->SetDeactivateHdl( LINK( this, MenuBarManager, Deactivate ));
- m_pVCLMenu->SetSelectHdl( LINK( this, MenuBarManager, Select ));
+ SetHdl();
}
void MenuBarManager::impl_RetrieveShortcutsFromConfiguration(
@@ -1898,6 +1527,7 @@ void MenuBarManager::impl_RetrieveShortcutsFromConfiguration(
const Sequence< rtl::OUString >& rCommands,
std::vector< MenuItemHandler* >& aMenuShortCuts )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::impl_RetrieveShortcutsFromConfiguration" );
if ( rAccelCfg.is() )
{
try
@@ -1918,6 +1548,7 @@ void MenuBarManager::impl_RetrieveShortcutsFromConfiguration(
void MenuBarManager::RetrieveShortcuts( std::vector< MenuItemHandler* >& aMenuShortCuts )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::RetrieveShortcuts" );
if ( !m_bModuleIdentified )
{
m_bModuleIdentified = sal_True;
@@ -2000,7 +1631,8 @@ void MenuBarManager::RetrieveShortcuts( std::vector< MenuItemHandler* >& aMenuSh
KeyCode aEmptyKeyCode;
Sequence< rtl::OUString > aSeq( aMenuShortCuts.size() );
- for ( sal_uInt32 i = 0; i < aMenuShortCuts.size(); i++ )
+ const sal_uInt32 nCount = aMenuShortCuts.size();
+ for ( sal_uInt32 i = 0; i < nCount; ++i )
{
aSeq[i] = aMenuShortCuts[i]->aMenuItemURL;
aMenuShortCuts[i]->aKeyCode = aEmptyKeyCode;
@@ -2017,6 +1649,7 @@ void MenuBarManager::RetrieveShortcuts( std::vector< MenuItemHandler* >& aMenuSh
void MenuBarManager::RetrieveImageManagers()
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::RetrieveImageManagers" );
if ( !m_xDocImageManager.is() )
{
Reference< XController > xController = m_xFrame->getController();
@@ -2041,7 +1674,7 @@ void MenuBarManager::RetrieveImageManagers()
Reference< XModuleManager > xModuleManager;
if ( m_aModuleIdentifier.getLength() == 0 )
- xModuleManager = Reference< XModuleManager >( getServiceFactory()->createInstance( SERVICENAME_MODULEMANAGER ), UNO_QUERY_THROW );
+ xModuleManager.set( getServiceFactory()->createInstance( SERVICENAME_MODULEMANAGER ), UNO_QUERY_THROW );
try
{
@@ -2058,7 +1691,7 @@ void MenuBarManager::RetrieveImageManagers()
SERVICENAME_MODULEUICONFIGURATIONMANAGERSUPPLIER ),
UNO_QUERY );
Reference< XUIConfigurationManager > xUICfgMgr = xModuleCfgMgrSupplier->getUIConfigurationManager( m_aModuleIdentifier );
- m_xModuleImageManager = Reference< XImageManager >( xUICfgMgr->getImageManager(), UNO_QUERY );
+ m_xModuleImageManager.set( xUICfgMgr->getImageManager(), UNO_QUERY );
m_xModuleImageManager->addConfigurationListener( Reference< XUIConfigurationListener >(
static_cast< OWeakObject* >( this ), UNO_QUERY ));
}
@@ -2071,6 +1704,7 @@ void MenuBarManager::FillMenuWithConfiguration(
const Reference< XIndexAccess >& rItemContainer,
const Reference< XURLTransformer >& rTransformer )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::FillMenuWithConfiguration" );
Reference< XDispatchProvider > xEmptyDispatchProvider;
MenuBarManager::FillMenu( nId, pMenu, rModuleIdentifier, rItemContainer, xEmptyDispatchProvider );
@@ -2106,6 +1740,7 @@ void MenuBarManager::FillMenu(
const Reference< XIndexAccess >& rItemContainer,
const Reference< XDispatchProvider >& rDispatchProvider )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::FillMenu" );
// Fill menu bar with container contents
for ( sal_Int32 n = 0; n < rItemContainer->getCount(); n++ )
{
@@ -2187,7 +1822,7 @@ void MenuBarManager::FillMenu(
}
}
}
- catch ( ::com::sun::star::lang::IndexOutOfBoundsException& )
+ catch ( IndexOutOfBoundsException& )
{
break;
}
@@ -2199,6 +1834,7 @@ void MenuBarManager::MergeAddonMenus(
const MergeMenuInstructionContainer& aMergeInstructionContainer,
const ::rtl::OUString& rModuleIdentifier )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::MergeAddonMenus" );
// set start value for the item ID for the new addon menu items
sal_uInt16 nItemId = ADDONMENU_MERGE_ITEMID_START;
@@ -2299,10 +1935,7 @@ void MenuBarManager::SetItemContainer( const Reference< XIndexAccess >& rItemCon
USHORT nId = 1;
// Fill menu bar with container contents
- Reference< XURLTransformer > xTrans( getServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
- FillMenuWithConfiguration( nId, (Menu *)m_pVCLMenu, m_aModuleIdentifier, rItemContainer, xTrans );
+ FillMenuWithConfiguration( nId, (Menu *)m_pVCLMenu, m_aModuleIdentifier, rItemContainer, m_xURLTransformer );
// Refill menu manager again
Reference< XDispatchProvider > xDispatchProvider;
@@ -2315,6 +1948,7 @@ void MenuBarManager::SetItemContainer( const Reference< XIndexAccess >& rItemCon
void MenuBarManager::GetPopupController( PopupControllerCache& rPopupController )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::GetPopupController" );
String aPopupScheme = String::CreateFromAscii( "vnd.sun.star.popup:" );
vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
@@ -2360,10 +1994,138 @@ void MenuBarManager::GetPopupController( PopupControllerCache& rPopupController
}
// #110897#
-const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& MenuBarManager::getServiceFactory()
+const Reference< XMultiServiceFactory >& MenuBarManager::getServiceFactory()
{
// #110897#
return mxServiceFactory;
}
+void MenuBarManager::AddMenu(MenuBarManager* pSubMenuManager,const ::rtl::OUString& _sItemCommand,USHORT _nItemId)
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::AddMenu" );
+ Reference< XStatusListener > xSubMenuManager( static_cast< OWeakObject *>( pSubMenuManager ), UNO_QUERY );
+ m_xFrame->addFrameActionListener( Reference< XFrameActionListener >( xSubMenuManager, UNO_QUERY ));
+
+ // store menu item command as we later have to know which menu is active (see Activate handler)
+ pSubMenuManager->m_aMenuItemCommand = _sItemCommand;
+ Reference< XDispatch > xDispatch;
+ MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
+ _nItemId,
+ xSubMenuManager,
+ xDispatch );
+ pMenuItemHandler->aMenuItemURL = _sItemCommand;
+ m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
+}
+
+USHORT MenuBarManager::FillItemCommand(::rtl::OUString& _rItemCommand,Menu* _pMenu,USHORT _nIndex) const
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::FillItemCommand" );
+ USHORT nItemId = _pMenu->GetItemId( _nIndex );
+
+ _rItemCommand = _pMenu->GetItemCommand( nItemId );
+ if ( !_rItemCommand.getLength() )
+ {
+ const static ::rtl::OUString aSlotString( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
+ _rItemCommand = aSlotString;
+ _rItemCommand += ::rtl::OUString::valueOf( (sal_Int32)nItemId );
+ _pMenu->SetItemCommand( nItemId, _rItemCommand );
+ }
+ return nItemId;
+}
+void MenuBarManager::Init(const Reference< XFrame >& rFrame,AddonMenu* pAddonMenu,sal_Bool bDelete,sal_Bool bDeleteChildren,bool _bHandlePopUp)
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::Init" );
+ m_bActive = sal_False;
+ m_bDeleteMenu = bDelete;
+ m_bDeleteChildren = bDeleteChildren;
+ m_pVCLMenu = pAddonMenu;
+ m_xFrame = rFrame;
+ m_bInitialized = sal_False;
+ m_bIsBookmarkMenu = sal_True;
+
+ rtl::OUString aModuleIdentifier;
+ m_xPopupMenuControllerRegistration = Reference< ::com::sun::star::frame::XUIControllerRegistration >(
+ getServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.PopupMenuControllerFactory" ))),
+ UNO_QUERY );
+
+ const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
+ m_bWasHiContrast = rSettings.GetHighContrastMode();
+
+ Reference< XStatusListener > xStatusListener;
+ Reference< XDispatch > xDispatch;
+ USHORT nItemCount = pAddonMenu->GetItemCount();
+ ::rtl::OUString aItemCommand;
+ m_aMenuItemHandlerVector.reserve(nItemCount);
+ for ( USHORT i = 0; i < nItemCount; i++ )
+ {
+ USHORT nItemId = FillItemCommand(aItemCommand,pAddonMenu, i );
+
+ PopupMenu* pPopupMenu = pAddonMenu->GetPopupMenu( nItemId );
+ if ( pPopupMenu )
+ {
+ // #110897#
+ Reference< XDispatchProvider > xDispatchProvider;
+ MenuBarManager* pSubMenuManager = new MenuBarManager( getServiceFactory(), rFrame, m_xURLTransformer,xDispatchProvider, aModuleIdentifier, pPopupMenu, _bHandlePopUp ? sal_False : bDeleteChildren, _bHandlePopUp ? sal_False : bDeleteChildren );
+
+ Reference< XStatusListener > xSubMenuManager( static_cast< OWeakObject *>( pSubMenuManager ), UNO_QUERY );
+
+ // store menu item command as we later have to know which menu is active (see Acivate handler)
+ pSubMenuManager->m_aMenuItemCommand = aItemCommand;
+
+ MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
+ nItemId,
+ xSubMenuManager,
+ xDispatch );
+ m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
+ }
+ else
+ {
+ if ( pAddonMenu->GetItemType( i ) != MENUITEM_SEPARATOR )
+ {
+ MenuConfiguration::Attributes* pAddonAttributes = (MenuConfiguration::Attributes *)(pAddonMenu->GetUserValue( nItemId ));
+ MenuItemHandler* pMenuItemHandler = new MenuItemHandler( nItemId, xStatusListener, xDispatch );
+
+ if ( pAddonAttributes )
+ {
+ // read additional attributes from attributes struct and AddonMenu implementation will delete all attributes itself!!
+ pMenuItemHandler->aTargetFrame = pAddonAttributes->aTargetFrame;
+ }
+
+ pMenuItemHandler->aMenuItemURL = aItemCommand;
+ if ( _bHandlePopUp )
+ {
+ // Check if we have to create a popup menu for a uno based popup menu controller.
+ // We have to set an empty popup menu into our menu structure so the controller also
+ // works with inplace OLE.
+ if ( m_xPopupMenuControllerRegistration.is() &&
+ m_xPopupMenuControllerRegistration->hasController( aItemCommand, rtl::OUString() ))
+ {
+ VCLXPopupMenu* pVCLXPopupMenu = new VCLXPopupMenu;
+ PopupMenu* pCtlPopupMenu = (PopupMenu *)pVCLXPopupMenu->GetMenu();
+ pAddonMenu->SetPopupMenu( pMenuItemHandler->nItemId, pCtlPopupMenu );
+ pMenuItemHandler->xPopupMenu = Reference< com::sun::star::awt::XPopupMenu >( (OWeakObject *)pVCLXPopupMenu, UNO_QUERY );
+
+ }
+ }
+ m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
+ }
+ }
+ }
+
+ SetHdl();
+}
+
+void MenuBarManager::SetHdl()
+{
+ m_pVCLMenu->SetHighlightHdl( LINK( this, MenuBarManager, Highlight ));
+ m_pVCLMenu->SetActivateHdl( LINK( this, MenuBarManager, Activate ));
+ m_pVCLMenu->SetDeactivateHdl( LINK( this, MenuBarManager, Deactivate ));
+ m_pVCLMenu->SetSelectHdl( LINK( this, MenuBarManager, Select ));
+
+ if ( !m_xURLTransformer.is() && mxServiceFactory.is() )
+ m_xURLTransformer.set( mxServiceFactory->createInstance(
+ SERVICENAME_URLTRANSFORMER),
+ UNO_QUERY );
+}
+
}
diff --git a/framework/source/uielement/menubarmerger.cxx b/framework/source/uielement/menubarmerger.cxx
index 1f0dc704e004..647bdf3f4f0c 100644
--- a/framework/source/uielement/menubarmerger.cxx
+++ b/framework/source/uielement/menubarmerger.cxx
@@ -190,7 +190,7 @@ bool MenuBarMerger::CreateSubMenu(
{
pSubMenu->InsertItem( nItemId, rMenuItem.aTitle, 0, MENU_APPEND );
pSubMenu->SetItemCommand( nItemId, rMenuItem.aURL );
- if ( rMenuItem.aSubMenu.size() > 0 )
+ if ( !rMenuItem.aSubMenu.empty() )
{
PopupMenu* pPopupMenu = new PopupMenu();
pSubMenu->SetPopupMenu( nItemId, pPopupMenu );
@@ -231,7 +231,7 @@ bool MenuBarMerger::MergeMenuItems(
{
pMenu->InsertItem( nItemId, rMenuItem.aTitle, 0, nPos+nModIndex+nIndex );
pMenu->SetItemCommand( nItemId, rMenuItem.aURL );
- if ( rMenuItem.aSubMenu.size() > 0 )
+ if ( !rMenuItem.aSubMenu.empty() )
{
PopupMenu* pSubMenu = new PopupMenu();
pMenu->SetPopupMenu( nItemId, pSubMenu );
@@ -342,7 +342,8 @@ bool MenuBarMerger::ProcessFallbackOperation(
{
if ( nLevel == nSize-1 )
{
- for ( sal_uInt32 i = 0; i < rAddonMenuItems.size(); i++ )
+ const sal_uInt32 nCount = rAddonMenuItems.size();
+ for ( sal_uInt32 i = 0; i < nCount; ++i )
{
const AddonMenuItem& rMenuItem = rAddonMenuItems[i];
if ( IsCorrectContext( rMenuItem.aContext, rModuleIdentifier ))
@@ -429,6 +430,7 @@ void MenuBarMerger::GetSubMenu(
rSubMenu.clear();
const sal_Int32 nCount = rSubMenuEntries.getLength();
+ rSubMenu.reserve(rSubMenu.size() + nCount);
for ( sal_Int32 i = 0; i < nCount; i++ )
{
const uno::Sequence< beans::PropertyValue >& rMenuEntry = rSubMenuEntries[ i ];
diff --git a/framework/source/uielement/menubarwrapper.cxx b/framework/source/uielement/menubarwrapper.cxx
index 434c1cfc4be3..32e7a757d2cd 100644
--- a/framework/source/uielement/menubarwrapper.cxx
+++ b/framework/source/uielement/menubarwrapper.cxx
@@ -37,8 +37,6 @@
#include <uielement/menubarwrapper.hxx>
#include <threadhelp/resetableguard.hxx>
#include <helper/actiontriggerhelper.hxx>
-#include <uielement/constitemcontainer.hxx>
-#include <uielement/rootitemcontainer.hxx>
#include <services.h>
//_________________________________________________________________________________________________________________
@@ -110,9 +108,8 @@ DEFINE_XTYPEPROVIDER_11 ( MenuBarWrapper ,
MenuBarWrapper::MenuBarWrapper(
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceManager
)
-: UIConfigElementWrapperBase( UIElementType::MENUBAR ),
- m_bRefreshPopupControllerCache( sal_True ),
- mxServiceFactory( xServiceManager )
+: UIConfigElementWrapperBase( UIElementType::MENUBAR,xServiceManager ),
+ m_bRefreshPopupControllerCache( sal_True )
{
}
@@ -120,13 +117,6 @@ MenuBarWrapper::~MenuBarWrapper()
{
}
-// #110897#
-const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& MenuBarWrapper::getServiceFactory()
-{
- // #110897#
- return mxServiceFactory;
-}
-
void SAL_CALL MenuBarWrapper::dispose() throw (::com::sun::star::uno::RuntimeException)
{
Reference< XComponent > xThis( static_cast< OWeakObject* >(this), UNO_QUERY );
@@ -173,7 +163,7 @@ void SAL_CALL MenuBarWrapper::initialize( const Sequence< Any >& aArguments ) th
Reference< XModuleManager > xModuleManager;
xModuleManager = Reference< XModuleManager >(
- getServiceFactory()->createInstance(
+ m_xServiceFactory->createInstance(
SERVICENAME_MODULEMANAGER ), UNO_QUERY_THROW );
try
@@ -184,15 +174,16 @@ void SAL_CALL MenuBarWrapper::initialize( const Sequence< Any >& aArguments ) th
{
}
+ Reference< XURLTransformer > xTrans;
try
{
+ xTrans.set( m_xServiceFactory->createInstance(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
m_xConfigData = m_xConfigSource->getSettings( m_aResourceURL, sal_False );
if ( m_xConfigData.is() )
{
// Fill menubar with container contents
- Reference< XURLTransformer > xTrans( getServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
USHORT nId = 1;
MenuBarManager::FillMenuWithConfiguration( nId, pVCLMenuBar, aModuleIdentifier, m_xConfigData, xTrans );
}
@@ -221,8 +212,9 @@ void SAL_CALL MenuBarWrapper::initialize( const Sequence< Any >& aArguments ) th
Reference< XDispatchProvider > xDispatchProvider;
// #110897#
- MenuBarManager* pMenuBarManager = new MenuBarManager( getServiceFactory(),
+ MenuBarManager* pMenuBarManager = new MenuBarManager( m_xServiceFactory,
xFrame,
+ xTrans,
xDispatchProvider,
aModuleIdentifier,
pVCLMenuBar,
@@ -270,61 +262,15 @@ void SAL_CALL MenuBarWrapper::updateSettings() throw ( RuntimeException )
}
}
}
-
-void SAL_CALL MenuBarWrapper::setSettings( const Reference< XIndexAccess >& xSettings ) throw ( RuntimeException )
+void MenuBarWrapper::impl_fillNewData()
{
- ResetableGuard aLock( m_aLock );
+ // Transient menubar => Fill menubar with new data
+ MenuBarManager* pMenuBarManager = static_cast< MenuBarManager *>( m_xMenuBarManager.get() );
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( xSettings.is() )
- {
- // Create a copy of the data if the container is not const
- Reference< XIndexReplace > xReplace( xSettings, UNO_QUERY );
- if ( xReplace.is() )
- m_xConfigData = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( xSettings ) ), UNO_QUERY );
- else
- m_xConfigData = xSettings;
-
- if ( m_xConfigSource.is() && m_bPersistent )
- {
- ::rtl::OUString aResourceURL( m_aResourceURL );
- Reference< XUIConfigurationManager > xUICfgMgr( m_xConfigSource );
-
- aLock.unlock();
-
- try
- {
- xUICfgMgr->replaceSettings( aResourceURL, m_xConfigData );
- }
- catch( NoSuchElementException& )
- {
- }
- }
- else if ( !m_bPersistent )
- {
- // Transient menubar => Fill menubar with new data
- MenuBarManager* pMenuBarManager = static_cast< MenuBarManager *>( m_xMenuBarManager.get() );
-
- if ( pMenuBarManager )
- pMenuBarManager->SetItemContainer( m_xConfigData );
- }
- }
+ if ( pMenuBarManager )
+ pMenuBarManager->SetItemContainer( m_xConfigData );
}
-Reference< XIndexAccess > SAL_CALL MenuBarWrapper::getSettings( sal_Bool bWriteable ) throw ( RuntimeException )
-{
- ResetableGuard aLock( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( bWriteable )
- return Reference< XIndexAccess >( static_cast< OWeakObject * >( new RootItemContainer( m_xConfigData ) ), UNO_QUERY );
- else
- return m_xConfigData;
-}
void MenuBarWrapper::fillPopupControllerCache()
{
@@ -333,7 +279,7 @@ void MenuBarWrapper::fillPopupControllerCache()
MenuBarManager* pMenuBarManager = static_cast< MenuBarManager *>( m_xMenuBarManager.get() );
if ( pMenuBarManager )
pMenuBarManager->GetPopupController( m_aPopupControllerCache );
- if ( m_aPopupControllerCache.size() > 0 )
+ if ( !m_aPopupControllerCache.empty() )
m_bRefreshPopupControllerCache = sal_False;
}
}
@@ -354,7 +300,7 @@ throw (::com::sun::star::uno::RuntimeException)
throw DisposedException();
fillPopupControllerCache();
- return ( m_aPopupControllerCache.size() > 0 );
+ return ( !m_aPopupControllerCache.empty() );
}
// XNameAccess
@@ -374,12 +320,9 @@ throw ( container::NoSuchElementException,
PopupControllerCache::const_iterator pIter = m_aPopupControllerCache.find( aName );
if ( pIter != m_aPopupControllerCache.end() )
{
- Any a;
uno::Reference< frame::XDispatchProvider > xDispatchProvider;
xDispatchProvider = pIter->second.m_xDispatchProvider;
-
- a = uno::makeAny( xDispatchProvider );
- return a;
+ return uno::makeAny( xDispatchProvider );
}
else
throw container::NoSuchElementException();
diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx
index 5162f812ef58..37580f86f546 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -43,7 +43,7 @@
#include <classes/fwkresid.hxx>
#include <classes/bmkmenu.hxx>
#include <helper/imageproducer.hxx>
-#include <classes/menuconfiguration.hxx>
+#include <xml/menuconfiguration.hxx>
//_________________________________________________________________________________________________________________
// interface includes
@@ -280,7 +280,8 @@ void NewMenuController::setAccelerators( PopupMenu* pPopupMenu )
aMenuShortCuts.push_back( aEmptyKeyCode );
}
- for ( sal_uInt32 i = 0; i < aCmds.size(); i++ )
+ const sal_uInt32 nCount = aCmds.size();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
aSeq[i] = aCmds[i];
if ( m_xGlobalAcceleratorManager.is() )
@@ -290,7 +291,8 @@ void NewMenuController::setAccelerators( PopupMenu* pPopupMenu )
if ( m_xDocAcceleratorManager.is() )
retrieveShortcutsFromConfiguration( xGlobalAccelCfg, aSeq, aMenuShortCuts );
- for ( sal_uInt32 i = 0; i < aIds.size(); i++ )
+ const sal_uInt32 nCount2 = aIds.size();
+ for ( sal_uInt32 i = 0; i < nCount2; i++ )
pPopupMenu->SetAccelKey( USHORT( aIds[i] ), aMenuShortCuts[i] );
// Special handling for "New" menu short-cut should be set at the
@@ -335,10 +337,6 @@ NewMenuController::NewMenuController( const ::com::sun::star::uno::Reference< ::
m_bAcceleratorCfg( sal_False ),
m_aTargetFrame( RTL_CONSTASCII_USTRINGPARAM( "_default" ))
{
- m_xURLTransformer = Reference< XURLTransformer >(
- xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
}
NewMenuController::~NewMenuController()
@@ -420,10 +418,6 @@ void SAL_CALL NewMenuController::statusChanged( const FeatureStateEvent& ) throw
}
// XMenuListener
-void SAL_CALL NewMenuController::highlight( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
void SAL_CALL NewMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
{
Reference< css::awt::XPopupMenu > xPopupMenu;
@@ -492,7 +486,7 @@ void SAL_CALL NewMenuController::activate( const css::awt::MenuEvent& ) throw (R
{
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
sal_Bool bShowImages( rSettings.GetUseImagesInMenus() );
- sal_Bool bHiContrast( rSettings.GetMenuColor().IsDark() );
+ sal_Bool bHiContrast( rSettings.GetHighContrastMode() );
PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu();
@@ -510,118 +504,66 @@ void SAL_CALL NewMenuController::activate( const css::awt::MenuEvent& ) throw (R
}
}
-void SAL_CALL NewMenuController::deactivate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
// XPopupMenuController
-void SAL_CALL NewMenuController::setPopupMenu( const Reference< css::awt::XPopupMenu >& xPopupMenu ) throw ( RuntimeException )
+void NewMenuController::impl_setPopupMenu()
{
- ResetableGuard aLock( m_aLock );
- if ( m_bDisposed )
- throw DisposedException();
+ if ( m_xPopupMenu.is() )
+ fillPopupMenu( m_xPopupMenu );
- if ( m_xFrame.is() && !m_xPopupMenu.is() )
+ // Identify module that we are attach to. It's our context that we need to know.
+ Reference< XModuleManager > xModuleManager( m_xServiceManager->createInstance( SERVICENAME_MODULEMANAGER ),UNO_QUERY );
+ if ( xModuleManager.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 );
-
- if ( m_xPopupMenu.is() )
- fillPopupMenu( m_xPopupMenu );
-
- // Identify module that we are attach to. It's our context that we need to know.
- Reference< XModuleManager > xModuleManager( m_xServiceManager->createInstance( SERVICENAME_MODULEMANAGER ),UNO_QUERY );
- if ( xModuleManager.is() )
+ try
{
- try
+ m_aModuleIdentifier = xModuleManager->identify( m_xFrame );
+ m_bModuleIdentified = sal_True;
+
+ Reference< XNameAccess > xNameAccess( xModuleManager, UNO_QUERY );
+ if (( m_aModuleIdentifier.getLength() > 0 ) && xNameAccess.is() )
{
- m_aModuleIdentifier = xModuleManager->identify( m_xFrame );
- m_bModuleIdentified = sal_True;
+ Sequence< PropertyValue > aSeq;
- Reference< XNameAccess > xNameAccess( xModuleManager, UNO_QUERY );
- if (( m_aModuleIdentifier.getLength() > 0 ) && xNameAccess.is() )
+ if ( xNameAccess->getByName( m_aModuleIdentifier ) >>= aSeq )
{
- Sequence< PropertyValue > aSeq;
-
- Any a = xNameAccess->getByName( m_aModuleIdentifier );
- if ( a >>= aSeq )
+ for ( sal_Int32 y = 0; y < aSeq.getLength(); y++ )
{
- for ( sal_Int32 y = 0; y < aSeq.getLength(); y++ )
+ if ( aSeq[y].Name.equalsAscii("ooSetupFactoryEmptyDocumentURL") )
{
- if ( aSeq[y].Name.equalsAscii("ooSetupFactoryEmptyDocumentURL") )
- {
- aSeq[y].Value >>= m_aEmptyDocURL;
- break;
- }
+ aSeq[y].Value >>= m_aEmptyDocURL;
+ break;
}
}
}
}
- catch ( RuntimeException& e )
- {
- throw e;
- }
- catch ( Exception& )
- {
- }
+ }
+ catch ( RuntimeException& e )
+ {
+ throw e;
+ }
+ catch ( Exception& )
+ {
}
}
}
-void SAL_CALL NewMenuController::updatePopupMenu() throw (RuntimeException)
-{
- ResetableGuard aLock( m_aLock );
- if ( m_bDisposed )
- throw DisposedException();
-}
-
// XInitialization
void SAL_CALL NewMenuController::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
{
- const rtl::OUString aFrameName( RTL_CONSTASCII_USTRINGPARAM( "Frame" ));
- const rtl::OUString aCommandURLName( RTL_CONSTASCII_USTRINGPARAM( "CommandURL" ));
-
ResetableGuard aLock( m_aLock );
sal_Bool bInitalized( m_bInitialized );
if ( !bInitalized )
{
- PropertyValue aPropValue;
- rtl::OUString aCommandURL;
- Reference< XFrame > xFrame;
+ PopupMenuControllerBase::initialize( aArguments );
- for ( int i = 0; i < aArguments.getLength(); i++ )
+ if ( m_bInitialized )
{
- 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_bInitialized = sal_True;
-
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
m_bShowImages = rSettings.GetUseImagesInMenus();
- m_bHiContrast = rSettings.GetMenuColor().IsDark();
+ m_bHiContrast = rSettings.GetHighContrastMode();
m_bNewMenu = m_aCommandURL.equalsAscii( ".uno:AddDirect" );
}
diff --git a/framework/source/uielement/objectmenucontroller.cxx b/framework/source/uielement/objectmenucontroller.cxx
index 2009c16a1f64..9f7d3bb64f5e 100644
--- a/framework/source/uielement/objectmenucontroller.cxx
+++ b/framework/source/uielement/objectmenucontroller.cxx
@@ -44,7 +44,6 @@
#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/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#ifndef _COM_SUN_STAR_EMBED_VERBDATTRIBUTES_HPP_
@@ -156,90 +155,12 @@ void SAL_CALL ObjectMenuController::statusChanged( const FeatureStateEvent& Even
}
// XMenuListener
-void SAL_CALL ObjectMenuController::highlight( const css::awt::MenuEvent& ) throw (RuntimeException)
+void ObjectMenuController::impl_select(const Reference< XDispatch >& _xDispatch,const ::com::sun::star::util::URL& aTargetURL)
{
-}
-
-void SAL_CALL ObjectMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
-{
- Reference< css::awt::XPopupMenu > xPopupMenu;
- Reference< XDispatch > xDispatch;
- Reference< XMultiServiceFactory > xServiceManager;
-
- ResetableGuard aLock( m_aLock );
- xPopupMenu = m_xPopupMenu;
- xDispatch = m_xDispatch;
- xServiceManager = m_xServiceManager;
- aLock.unlock();
-
- if ( xPopupMenu.is() && xDispatch.is() )
- {
- VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( xPopupMenu );
- if ( pPopupMenu )
- {
- css::util::URL aTargetURL;
- Sequence<PropertyValue> aArgs;
- Reference< XURLTransformer > xURLTransformer( xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
-
- {
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
- PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu();
-
- aTargetURL.Complete = pVCLPopupMenu->GetItemCommand( rEvent.MenuId );
- }
-
- xURLTransformer->parseStrict( aTargetURL );
- if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
- UiEventLogHelper(::rtl::OUString::createFromAscii("ObjectMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
- xDispatch->dispatch( aTargetURL, aArgs );
- }
- }
-}
-
-void SAL_CALL ObjectMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
-void SAL_CALL ObjectMenuController::deactivate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
-// XPopupMenuController
-void SAL_CALL ObjectMenuController::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< XURLTransformer > xURLTransformer( m_xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
- Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
-
- com::sun::star::util::URL aTargetURL;
- aTargetURL.Complete = m_aCommandURL;
- xURLTransformer->parseStrict( aTargetURL );
- m_xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
-
- updatePopupMenu();
- }
-}
-
-// XInitialization
-void SAL_CALL ObjectMenuController::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
-{
- PopupMenuControllerBase::initialize( aArguments );
+ Sequence<PropertyValue> aArgs;
+ if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
+ UiEventLogHelper(::rtl::OUString::createFromAscii("ObjectMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
+ _xDispatch->dispatch( aTargetURL, aArgs );
}
}
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx
index 3d92f1e10615..1ca5bf409e6d 100644
--- a/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/framework/source/uielement/recentfilesmenucontroller.cxx
@@ -49,9 +49,8 @@
#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/util/XURLTransformer.hpp>
#include <com/sun/star/util/XStringWidth.hpp>
-
+#include <com/sun/star/lang/DisposedException.hpp>
//_________________________________________________________________________________________________________________
// includes of other projects
//_________________________________________________________________________________________________________________
@@ -166,11 +165,12 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
}
}
- if ( m_aRecentFilesItems.size() > 0 )
+ if ( !m_aRecentFilesItems.empty() )
{
URL aTargetURL;
- for ( sal_uInt32 i = 0; i < m_aRecentFilesItems.size(); i++ )
+ const sal_uInt32 nCount = m_aRecentFilesItems.size();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
char menuShortCut[5] = "~n: ";
@@ -260,14 +260,10 @@ void RecentFilesMenuController::executeEntry( sal_Int32 nIndex )
if (( nIndex >= 0 ) &&
( nIndex < sal::static_int_cast<sal_Int32>( m_aRecentFilesItems.size() )))
{
- Reference< XURLTransformer > xURLTransformer( xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
-
const RecentFile& rRecentFile = m_aRecentFilesItems[ nIndex ];
aTargetURL.Complete = rRecentFile.aURL;
- xURLTransformer->parseStrict( aTargetURL );
+ m_xURLTransformer->parseStrict( aTargetURL );
aArgsList.realloc( NUM_OF_PICKLIST_ARGS );
aArgsList[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Referer" ));
@@ -287,14 +283,14 @@ void RecentFilesMenuController::executeEntry( sal_Int32 nIndex )
aFilterOptions = aFilter.copy( nPos+1 );
aArgsList[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterOptions" ));
- aArgsList[2].Value = makeAny( aFilterOptions );
+ aArgsList[2].Value <<= aFilterOptions;
aFilter = aFilter.copy( 0, nPos-1 );
aArgsList.realloc( ++NUM_OF_PICKLIST_ARGS );
}
aArgsList[NUM_OF_PICKLIST_ARGS-1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ));
- aArgsList[NUM_OF_PICKLIST_ARGS-1].Value = makeAny( aFilter );
+ aArgsList[NUM_OF_PICKLIST_ARGS-1].Value <<= aFilter;
xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString::createFromAscii("_default"), 0 );
}
@@ -336,11 +332,6 @@ void SAL_CALL RecentFilesMenuController::statusChanged( const FeatureStateEvent&
m_bDisabled = !Event.IsEnabled;
}
-// XMenuListener
-void SAL_CALL RecentFilesMenuController::highlight( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
void SAL_CALL RecentFilesMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
{
Reference< css::awt::XPopupMenu > xPopupMenu;
@@ -368,43 +359,14 @@ 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 );
- if ( m_xPopupMenu.is() )
- fillPopupMenu( m_xPopupMenu );
-}
-
-void SAL_CALL RecentFilesMenuController::deactivate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
+ impl_setPopupMenu();
}
// XPopupMenuController
-void SAL_CALL RecentFilesMenuController::setPopupMenu( const Reference< css::awt::XPopupMenu >& xPopupMenu ) throw ( RuntimeException )
+void RecentFilesMenuController::impl_setPopupMenu()
{
- 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< XURLTransformer > xURLTransformer( m_xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
- Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
-
- com::sun::star::util::URL aTargetURL;
- aTargetURL.Complete = m_aCommandURL;
- xURLTransformer->parseStrict( aTargetURL );
- m_xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
-
- if ( m_xPopupMenu.is() )
- fillPopupMenu( m_xPopupMenu );
- }
+ if ( m_xPopupMenu.is() )
+ fillPopupMenu( m_xPopupMenu );
}
void SAL_CALL RecentFilesMenuController::updatePopupMenu() throw (RuntimeException)
@@ -416,12 +378,9 @@ void SAL_CALL RecentFilesMenuController::updatePopupMenu() throw (RuntimeExcepti
Reference< XStatusListener > xStatusListener( static_cast< OWeakObject* >( this ), UNO_QUERY );
Reference< XDispatch > xDispatch( m_xDispatch );
- Reference< XURLTransformer > xURLTransformer( m_xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
com::sun::star::util::URL aTargetURL;
aTargetURL.Complete = m_aCommandURL;
- xURLTransformer->parseStrict( aTargetURL );
+ m_xURLTransformer->parseStrict( aTargetURL );
aLock.unlock();
// Add/remove status listener to get a status update once
@@ -450,18 +409,6 @@ throw( RuntimeException )
return Reference< XDispatch >();
}
-Sequence< Reference< XDispatch > > SAL_CALL RecentFilesMenuController::queryDispatches(
- const Sequence< DispatchDescriptor >& lDescriptor )
-throw( RuntimeException )
-{
- ResetableGuard aLock( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- return PopupMenuControllerBase::queryDispatches( lDescriptor );
-}
-
// XDispatch
void SAL_CALL RecentFilesMenuController::dispatch(
const URL& aURL,
@@ -520,12 +467,6 @@ throw( RuntimeException )
PopupMenuControllerBase::removeStatusListener( xControl, aURL );
}
-// XInitialization
-void SAL_CALL RecentFilesMenuController::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
-{
- PopupMenuControllerBase::initialize( aArguments );
-}
-
IMPL_STATIC_LINK_NOINSTANCE( RecentFilesMenuController, ExecuteHdl_Impl, LoadRecentFile*, pLoadRecentFile )
{
try
diff --git a/framework/source/uielement/rootitemcontainer.cxx b/framework/source/uielement/rootitemcontainer.cxx
index b34130ea92c9..e560a95d7923 100644
--- a/framework/source/uielement/rootitemcontainer.cxx
+++ b/framework/source/uielement/rootitemcontainer.cxx
@@ -146,8 +146,7 @@ RootItemContainer::RootItemContainer( const Reference< XIndexAccess >& rSourceCo
for ( sal_Int32 i = 0; i < nCount; i++ )
{
Sequence< PropertyValue > aPropSeq;
- Any a = rSourceContainer->getByIndex( i );
- if ( a >>= aPropSeq )
+ if ( rSourceContainer->getByIndex( i ) >>= aPropSeq )
{
sal_Int32 nContainerIndex = -1;
Reference< XIndexAccess > xIndexAccess;
@@ -181,7 +180,9 @@ RootItemContainer::~RootItemContainer()
// private
void RootItemContainer::copyItemContainer( const std::vector< Sequence< PropertyValue > >& rSourceVector )
{
- for ( sal_uInt32 i = 0; i < rSourceVector.size(); i++ )
+ const sal_uInt32 nCount = rSourceVector.size();
+ m_aItemVector.reserve(nCount);
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
sal_Int32 nContainerIndex = -1;
Sequence< PropertyValue > aPropSeq( rSourceVector[i] );
@@ -256,7 +257,7 @@ sal_Bool SAL_CALL RootItemContainer::hasElements()
throw ( RuntimeException )
{
ShareGuard aLock( m_aShareMutex );
- return ( m_aItemVector.size() != 0 );
+ return ( !m_aItemVector.empty() );
}
// XIndexAccess
diff --git a/framework/source/uielement/spinfieldtoolbarcontroller.cxx b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
index b6de37cd13dc..866de8d701d3 100644
--- a/framework/source/uielement/spinfieldtoolbarcontroller.cxx
+++ b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
@@ -255,59 +255,20 @@ throw ( RuntimeException )
}
// ------------------------------------------------------------------
-
-void SAL_CALL SpinfieldToolbarController::execute( sal_Int16 KeyModifier )
-throw ( RuntimeException )
+Sequence<PropertyValue> SpinfieldToolbarController::getExecuteArgs(sal_Int16 KeyModifier) const
{
- Reference< XDispatch > xDispatch;
- Reference< XURLTransformer > xURLTransformer;
- ::rtl::OUString aCommandURL;
- ::rtl::OUString aSpinfieldText;
- ::com::sun::star::util::URL aTargetURL;
- bool bFloat( false );
-
- {
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+ Sequence<PropertyValue> aArgs( 2 );
+ ::rtl::OUString aSpinfieldText = m_pSpinfieldControl->GetText();
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_bInitialized &&
- m_xFrame.is() &&
- m_xServiceManager.is() &&
- m_aCommandURL.getLength() )
- {
- xURLTransformer = m_xURLTransformer;
- xDispatch = getDispatchFromCommand( m_aCommandURL );
- aCommandURL = m_aCommandURL;
- aTargetURL = getInitializedURL();
- aSpinfieldText = m_pSpinfieldControl->GetText();
- bFloat = m_bFloat;
- }
- }
-
- if ( xDispatch.is() && aTargetURL.Complete.getLength() > 0 )
- {
- Sequence<PropertyValue> aArgs( 2 );
-
- // Add key modifier to argument list
- aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "KeyModifier" ));
- aArgs[0].Value <<= KeyModifier;
- aArgs[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Value" ));
-
- // Use correct type
- if ( bFloat )
- aArgs[1].Value <<= aSpinfieldText.toDouble();
- else
- aArgs[1].Value <<= aSpinfieldText.toInt32();
-
- // Execute dispatch asynchronously
- ExecuteInfo* pExecuteInfo = new ExecuteInfo;
- pExecuteInfo->xDispatch = xDispatch;
- pExecuteInfo->aTargetURL = aTargetURL;
- pExecuteInfo->aArgs = aArgs;
- Application::PostUserEvent( STATIC_LINK(0, ComplexToolbarController , ExecuteHdl_Impl), pExecuteInfo );
- }
+ // Add key modifier to argument list
+ aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "KeyModifier" ));
+ aArgs[0].Value <<= KeyModifier;
+ aArgs[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Value" ));
+ if ( m_bFloat )
+ aArgs[1].Value <<= aSpinfieldText.toDouble();
+ else
+ aArgs[1].Value <<= aSpinfieldText.toInt32();
+ return aArgs;
}
// ------------------------------------------------------------------
diff --git a/framework/source/uielement/statusbarmanager.cxx b/framework/source/uielement/statusbarmanager.cxx
index 523e0fa6480f..6f7f235632df 100644
--- a/framework/source/uielement/statusbarmanager.cxx
+++ b/framework/source/uielement/statusbarmanager.cxx
@@ -46,6 +46,7 @@
#include "services.h"
#include "general.h"
#include "properties.h"
+#include <helper/mischelper.hxx>
//_________________________________________________________________________________________________________________
// interface includes
@@ -148,15 +149,16 @@ StatusBarManager::StatusBarManager(
ThreadHelpBase( &Application::GetSolarMutex() ),
OWeakObject(),
m_bDisposed( sal_False ),
- m_bModuleIdentified( sal_False ),
m_bFrameActionRegistered( sal_False ),
m_bUpdateControllers( sal_False ),
+ m_bModuleIdentified( sal_False ),
m_pStatusBar( pStatusBar ),
m_aResourceName( rResourceName ),
m_xFrame( rFrame ),
m_aListenerContainer( m_aLock.getShareableOslMutex() ),
m_xServiceManager( rServiceManager )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::StatusBarManager" );
if ( m_xServiceManager.is() )
m_xStatusbarControllerRegistration = uno::Reference< css::frame::XUIControllerRegistration >(
@@ -173,6 +175,7 @@ StatusBarManager::~StatusBarManager()
StatusBar* StatusBarManager::GetStatusBar() const
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::GetStatusBar" );
ResetableGuard aGuard( m_aLock );
return m_pStatusBar;
}
@@ -180,6 +183,7 @@ StatusBar* StatusBarManager::GetStatusBar() const
void StatusBarManager::frameAction( const frame::FrameActionEvent& Action )
throw ( uno::RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::frameAction" );
ResetableGuard aGuard( m_aLock );
if ( Action.Action == frame::FrameAction_CONTEXT_CHANGED )
UpdateControllers();
@@ -187,6 +191,7 @@ throw ( uno::RuntimeException )
void SAL_CALL StatusBarManager::disposing( const lang::EventObject& Source ) throw ( uno::RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::disposing" );
{
ResetableGuard aGuard( m_aLock );
if ( m_bDisposed )
@@ -207,6 +212,7 @@ void SAL_CALL StatusBarManager::disposing( const lang::EventObject& Source ) thr
// XComponent
void SAL_CALL StatusBarManager::dispose() throw( uno::RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::dispose" );
uno::Reference< lang::XComponent > xThis(
static_cast< OWeakObject* >(this), uno::UNO_QUERY );
@@ -245,6 +251,7 @@ void SAL_CALL StatusBarManager::dispose() throw( uno::RuntimeException )
void SAL_CALL StatusBarManager::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) throw( uno::RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::addEventListener" );
ResetableGuard aGuard( m_aLock );
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
@@ -257,6 +264,7 @@ void SAL_CALL StatusBarManager::addEventListener( const uno::Reference< lang::XE
void SAL_CALL StatusBarManager::removeEventListener( const uno::Reference< lang::XEventListener >& xListener ) throw( uno::RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::removeEventListener" );
m_aListenerContainer.removeInterface( ::getCppuType(
( const uno::Reference< lang::XEventListener >* ) NULL ), xListener );
}
@@ -264,6 +272,7 @@ void SAL_CALL StatusBarManager::removeEventListener( const uno::Reference< lang:
// XUIConfigurationListener
void SAL_CALL StatusBarManager::elementInserted( const css::ui::ConfigurationEvent& ) throw ( uno::RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::elementInserted" );
ResetableGuard aGuard( m_aLock );
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
@@ -273,6 +282,7 @@ void SAL_CALL StatusBarManager::elementInserted( const css::ui::ConfigurationEve
void SAL_CALL StatusBarManager::elementRemoved( const css::ui::ConfigurationEvent& ) throw ( uno::RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::elementRemoved" );
ResetableGuard aGuard( m_aLock );
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
@@ -282,6 +292,7 @@ void SAL_CALL StatusBarManager::elementRemoved( const css::ui::ConfigurationEven
void SAL_CALL StatusBarManager::elementReplaced( const css::ui::ConfigurationEvent& ) throw ( uno::RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::elementReplaced" );
ResetableGuard aGuard( m_aLock );
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
@@ -291,10 +302,12 @@ void SAL_CALL StatusBarManager::elementReplaced( const css::ui::ConfigurationEve
void StatusBarManager::UpdateControllers()
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::UpdateControllers" );
if ( !m_bUpdateControllers )
{
m_bUpdateControllers = sal_True;
- for ( sal_uInt32 n = 0; n < m_aControllerVector.size(); n++ )
+ const sal_uInt32 nCount = m_aControllerVector.size();
+ for ( sal_uInt32 n = 0; n < nCount; n++ )
{
try
{
@@ -312,12 +325,14 @@ void StatusBarManager::UpdateControllers()
void StatusBarManager::RemoveControllers()
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::RemoveControllers" );
ResetableGuard aGuard( m_aLock );
if ( m_bDisposed )
return;
- for ( sal_uInt32 n = 0; n < m_aControllerVector.size(); n++ )
+ const sal_uInt32 nCount = m_aControllerVector.size();
+ for ( sal_uInt32 n = 0; n < nCount; n++ )
{
try
{
@@ -336,71 +351,12 @@ void StatusBarManager::RemoveControllers()
rtl::OUString StatusBarManager::RetrieveLabelFromCommand( const rtl::OUString& aCmdURL )
{
- rtl::OUString aLabel;
-
- // Retrieve short bubble help
- if ( !m_bModuleIdentified )
- {
- uno::Reference< css::frame::XModuleManager > xModuleManager(
- m_xServiceManager->createInstance(
- SERVICENAME_MODULEMANAGER ), uno::UNO_QUERY_THROW );
- uno::Reference< uno::XInterface > xIfac( m_xFrame, uno::UNO_QUERY );
- try
- {
- m_bModuleIdentified = sal_True;
- m_aModuleIdentifier = xModuleManager->identify( xIfac );
-
- if ( m_aModuleIdentifier.getLength() > 0 )
- {
- uno::Reference< container::XNameAccess > xNameAccess(
- m_xServiceManager->createInstance(
- SERVICENAME_UICOMMANDDESCRIPTION ), uno::UNO_QUERY );
- if ( xNameAccess.is() )
- {
- uno::Any a = xNameAccess->getByName( m_aModuleIdentifier );
- uno::Reference< container::XNameAccess > xUICommands;
- a >>= m_xUICommandLabels;
- }
- }
- }
- catch ( uno::Exception& )
- {
- }
- }
-
- if ( m_xUICommandLabels.is() )
- {
- try
- {
- if ( aCmdURL.getLength() > 0 )
- {
- rtl::OUString aStr;
- uno::Sequence< beans::PropertyValue > aPropSeq;
- uno::Any a( m_xUICommandLabels->getByName( aCmdURL ));
- if ( a >>= aPropSeq )
- {
- for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
- {
- if ( aPropSeq[i].Name.equalsAscii( "Name" ))
- {
- aPropSeq[i].Value >>= aStr;
- break;
- }
- }
- }
- aLabel = aStr;
- }
- }
- catch ( uno::Exception& )
- {
- }
- }
-
- return aLabel;
+ return framework::RetrieveLabelFromCommand(aCmdURL,m_xServiceManager,m_xUICommandLabels,m_xFrame,m_aModuleIdentifier,m_bModuleIdentified,"Name");
}
void StatusBarManager::CreateControllers()
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::CreateControllers" );
uno::Reference< lang::XMultiComponentFactory > xStatusbarControllerFactory( m_xStatusbarControllerRegistration, uno::UNO_QUERY );
uno::Reference< uno::XComponentContext > xComponentContext;
uno::Reference< beans::XPropertySet > xProps( m_xServiceManager, uno::UNO_QUERY );
@@ -499,6 +455,7 @@ void StatusBarManager::CreateControllers()
void StatusBarManager::AddFrameActionListener()
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::AddFrameActionListener" );
if ( !m_bFrameActionRegistered && m_xFrame.is() )
{
m_bFrameActionRegistered = sal_True;
@@ -527,6 +484,7 @@ void StatusBarManager::FillStatusBar( const uno::Reference< container::XIndexAcc
for ( sal_Int32 n = 0; n < rItemContainer->getCount(); n++ )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::FillStatusBar" );
uno::Sequence< beans::PropertyValue > aProp;
rtl::OUString aCommandURL;
rtl::OUString aHelpURL;
@@ -604,10 +562,12 @@ void StatusBarManager::FillStatusBar( const uno::Reference< container::XIndexAcc
void StatusBarManager::StateChanged( StateChangedType )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::StateChanged" );
}
void StatusBarManager::DataChanged( const DataChangedEvent& rDCEvt )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::DataChanged" );
ResetableGuard aGuard( m_aLock );
if ((( rDCEvt.GetType() == DATACHANGED_SETTINGS ) ||
@@ -616,12 +576,10 @@ void StatusBarManager::DataChanged( const DataChangedEvent& rDCEvt )
( rDCEvt.GetType() == DATACHANGED_DISPLAY )) &&
( rDCEvt.GetFlags() & SETTINGS_STYLE ))
{
- css::uno::Any a;
css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
css::uno::Reference< css::beans::XPropertySet > xPropSet( m_xFrame, css::uno::UNO_QUERY );
if ( xPropSet.is() )
- a = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )));
- a >>= xLayoutManager;
+ xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))) >>= xLayoutManager;
if ( xLayoutManager.is() )
{
aGuard.unlock();
@@ -632,6 +590,7 @@ void StatusBarManager::DataChanged( const DataChangedEvent& rDCEvt )
void StatusBarManager::UserDraw( const UserDrawEvent& rUDEvt )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::UserDraw" );
ResetableGuard aGuard( m_aLock );
if ( m_bDisposed )
@@ -659,6 +618,7 @@ void StatusBarManager::UserDraw( const UserDrawEvent& rUDEvt )
void StatusBarManager::Command( const CommandEvent& rEvt )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::Command" );
ResetableGuard aGuard( m_aLock );
if ( m_bDisposed )
@@ -684,74 +644,43 @@ void StatusBarManager::Command( const CommandEvent& rEvt )
void StatusBarManager::MouseMove( const MouseEvent& rMEvt )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::MouseMove" );
+ MouseButton(rMEvt,&frame::XStatusbarController::mouseMove);
+}
+void StatusBarManager::MouseButton( const MouseEvent& rMEvt ,sal_Bool ( SAL_CALL frame::XStatusbarController::*_pMethod )(const ::com::sun::star::awt::MouseEvent&))
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::MouseButton" );
ResetableGuard aGuard( m_aLock );
- if ( m_bDisposed )
- return;
-
- USHORT nId = m_pStatusBar->GetItemId( rMEvt.GetPosPixel() );
- if (( nId > 0 ) && ( nId <= m_aControllerVector.size() ))
+ if ( !m_bDisposed )
{
- uno::Reference< frame::XStatusbarController > xController(
- m_aControllerVector[nId-1], uno::UNO_QUERY );
- if ( xController.is() )
+ USHORT nId = m_pStatusBar->GetItemId( rMEvt.GetPosPixel() );
+ if (( nId > 0 ) && ( nId <= m_aControllerVector.size() ))
{
- ::com::sun::star::awt::MouseEvent aMouseEvent;
- aMouseEvent.Buttons = rMEvt.GetButtons();
- aMouseEvent.X = rMEvt.GetPosPixel().X();
- aMouseEvent.Y = rMEvt.GetPosPixel().Y();
- aMouseEvent.ClickCount = rMEvt.GetClicks();
- xController->mouseMove( aMouseEvent );
- }
+ uno::Reference< frame::XStatusbarController > xController(
+ m_aControllerVector[nId-1], uno::UNO_QUERY );
+ if ( xController.is() )
+ {
+ ::com::sun::star::awt::MouseEvent aMouseEvent;
+ aMouseEvent.Buttons = rMEvt.GetButtons();
+ aMouseEvent.X = rMEvt.GetPosPixel().X();
+ aMouseEvent.Y = rMEvt.GetPosPixel().Y();
+ aMouseEvent.ClickCount = rMEvt.GetClicks();
+ (xController.get()->*_pMethod)( aMouseEvent);
+ }
+ } // if (( nId > 0 ) && ( nId <= m_aControllerVector.size() ))
}
}
-
void StatusBarManager::MouseButtonDown( const MouseEvent& rMEvt )
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- return;
-
- USHORT nId = m_pStatusBar->GetItemId( rMEvt.GetPosPixel() );
- if (( nId > 0 ) && ( nId <= m_aControllerVector.size() ))
- {
- uno::Reference< frame::XStatusbarController > xController(
- m_aControllerVector[nId-1], uno::UNO_QUERY );
- if ( xController.is() )
- {
- ::com::sun::star::awt::MouseEvent aMouseEvent;
- aMouseEvent.Buttons = rMEvt.GetButtons();
- aMouseEvent.X = rMEvt.GetPosPixel().X();
- aMouseEvent.Y = rMEvt.GetPosPixel().Y();
- aMouseEvent.ClickCount = rMEvt.GetClicks();
- xController->mouseButtonDown( aMouseEvent );
- }
- }
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::MouseButtonDown" );
+ MouseButton(rMEvt,&frame::XStatusbarController::mouseButtonDown);
}
void StatusBarManager::MouseButtonUp( const MouseEvent& rMEvt )
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- return;
-
- USHORT nId = m_pStatusBar->GetItemId( rMEvt.GetPosPixel() );
- if (( nId > 0 ) && ( nId <= m_aControllerVector.size() ))
- {
- uno::Reference< frame::XStatusbarController > xController(
- m_aControllerVector[nId-1], uno::UNO_QUERY );
- if ( xController.is() )
- {
- ::com::sun::star::awt::MouseEvent aMouseEvent;
- aMouseEvent.Buttons = rMEvt.GetButtons();
- aMouseEvent.X = rMEvt.GetPosPixel().X();
- aMouseEvent.Y = rMEvt.GetPosPixel().Y();
- aMouseEvent.ClickCount = rMEvt.GetClicks();
- xController->mouseButtonUp( aMouseEvent );
- }
- }
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::MouseButtonUp" );
+ MouseButton(rMEvt,&frame::XStatusbarController::mouseButtonUp);
}
IMPL_LINK( StatusBarManager, Click, StatusBar*, EMPTYARG )
diff --git a/framework/source/uielement/statusbarwrapper.cxx b/framework/source/uielement/statusbarwrapper.cxx
index b73e85f5dd68..0cfbc52515c4 100644
--- a/framework/source/uielement/statusbarwrapper.cxx
+++ b/framework/source/uielement/statusbarwrapper.cxx
@@ -80,8 +80,7 @@ namespace framework
StatusBarWrapper::StatusBarWrapper(
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceManager
)
- : UIConfigElementWrapperBase( UIElementType::STATUSBAR ),
- m_xServiceFactory( xServiceManager )
+ : UIConfigElementWrapperBase( UIElementType::STATUSBAR,xServiceManager )
{
}
@@ -187,53 +186,6 @@ void SAL_CALL StatusBarWrapper::updateSettings() throw ( RuntimeException )
}
}
-void SAL_CALL StatusBarWrapper::setSettings( const Reference< XIndexAccess >& xSettings ) throw ( RuntimeException )
-{
- ResetableGuard aLock( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( xSettings.is() )
- {
- // Create a copy of the data if the container is not const
- Reference< XIndexReplace > xReplace( xSettings, UNO_QUERY );
- if ( xReplace.is() )
- m_xConfigData = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( xSettings ) ), UNO_QUERY );
- else
- m_xConfigData = xSettings;
-
- if ( m_xConfigSource.is() && m_bPersistent )
- {
- ::rtl::OUString aResourceURL( m_aResourceURL );
- Reference< XUIConfigurationManager > xUICfgMgr( m_xConfigSource );
-
- aLock.unlock();
-
- try
- {
- xUICfgMgr->replaceSettings( aResourceURL, m_xConfigData );
- }
- catch( NoSuchElementException& )
- {
- }
- }
- }
-}
-
-Reference< XIndexAccess > SAL_CALL StatusBarWrapper::getSettings( sal_Bool bWriteable ) throw ( RuntimeException )
-{
- ResetableGuard aLock( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( bWriteable )
- return Reference< XIndexAccess >( static_cast< OWeakObject * >( new RootItemContainer( m_xConfigData ) ), UNO_QUERY );
- else
- return m_xConfigData;
-}
-
Reference< XInterface > SAL_CALL StatusBarWrapper::getRealInterface() throw ( RuntimeException )
{
ResetableGuard aLock( m_aLock );
diff --git a/framework/source/uielement/statusindicatorinterfacewrapper.cxx b/framework/source/uielement/statusindicatorinterfacewrapper.cxx
index c1cc6b1d7fdc..d09a97481315 100644
--- a/framework/source/uielement/statusindicatorinterfacewrapper.cxx
+++ b/framework/source/uielement/statusindicatorinterfacewrapper.cxx
@@ -53,24 +53,10 @@ using namespace com::sun::star::beans;
namespace framework
{
-//*****************************************************************************************************************
-// XInterface, XTypeProvider
-//*****************************************************************************************************************
-DEFINE_XINTERFACE_2 ( StatusIndicatorInterfaceWrapper ,
- cppu::OWeakObject ,
- DIRECT_INTERFACE( ::com::sun::star::lang::XTypeProvider ),
- DIRECT_INTERFACE( ::com::sun::star::task::XStatusIndicator )
- )
-
-DEFINE_XTYPEPROVIDER_2 ( StatusIndicatorInterfaceWrapper ,
- ::com::sun::star::lang::XTypeProvider ,
- ::com::sun::star::task::XStatusIndicator
- )
StatusIndicatorInterfaceWrapper::StatusIndicatorInterfaceWrapper(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rStatusIndicatorImpl ) :
- ::cppu::OWeakObject()
- , m_xStatusIndicatorImpl( rStatusIndicatorImpl )
+ m_xStatusIndicatorImpl( rStatusIndicatorImpl )
{
}
diff --git a/framework/source/uielement/togglebuttontoolbarcontroller.cxx b/framework/source/uielement/togglebuttontoolbarcontroller.cxx
index 301c9a022182..b4bcc27f4636 100644
--- a/framework/source/uielement/togglebuttontoolbarcontroller.cxx
+++ b/framework/source/uielement/togglebuttontoolbarcontroller.cxx
@@ -117,52 +117,16 @@ throw ( RuntimeException )
}
// ------------------------------------------------------------------
-
-void SAL_CALL ToggleButtonToolbarController::execute( sal_Int16 KeyModifier )
-throw ( RuntimeException )
+Sequence<PropertyValue> ToggleButtonToolbarController::getExecuteArgs(sal_Int16 KeyModifier) const
{
- Reference< XDispatch > xDispatch;
- Reference< XURLTransformer > xURLTransformer;
- ::rtl::OUString aCommandURL;
- ::rtl::OUString aSelectedText;
- ::com::sun::star::util::URL aTargetURL;
-
- {
- vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( m_bInitialized &&
- m_xFrame.is() &&
- m_xServiceManager.is() &&
- m_aCommandURL.getLength() )
- {
- xURLTransformer = m_xURLTransformer;
- xDispatch = getDispatchFromCommand( m_aCommandURL );
- aCommandURL = m_aCommandURL;
- aTargetURL = getInitializedURL();
- aSelectedText = m_aCurrentSelection;
- }
- }
-
- if ( xDispatch.is() && aTargetURL.Complete.getLength() > 0 )
- {
- Sequence<PropertyValue> aArgs( 2 );
-
- // Add key modifier to argument list
- aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "KeyModifier" ));
- aArgs[0].Value <<= KeyModifier;
- aArgs[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ));
- aArgs[1].Value <<= aSelectedText;
-
- // Execute dispatch asynchronously
- ExecuteInfo* pExecuteInfo = new ExecuteInfo;
- pExecuteInfo->xDispatch = xDispatch;
- pExecuteInfo->aTargetURL = aTargetURL;
- pExecuteInfo->aArgs = aArgs;
- Application::PostUserEvent( STATIC_LINK(0, ComplexToolbarController , ExecuteHdl_Impl), pExecuteInfo );
- }
+ Sequence<PropertyValue> aArgs( 2 );
+
+ // Add key modifier to argument list
+ aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "KeyModifier" ));
+ aArgs[0].Value <<= KeyModifier;
+ aArgs[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ));
+ aArgs[1].Value <<= m_aCurrentSelection;
+ return aArgs;
}
// ------------------------------------------------------------------
@@ -178,8 +142,8 @@ throw (::com::sun::star::uno::RuntimeException)
{
// create popup menu
PopupMenu aPopup;
-
- for ( sal_uInt32 i = 0; i < m_aDropdownMenuList.size(); i++ )
+ const sal_uInt32 nCount = m_aDropdownMenuList.size();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
rtl::OUString aLabel( m_aDropdownMenuList[i] );
aPopup.InsertItem( sal_uInt16( i+1 ), aLabel );
@@ -246,7 +210,6 @@ void ToggleButtonToolbarController::executeControlCommand( const ::com::sun::sta
< m_aDropdownMenuList.size() ) )
{
m_aCurrentSelection = m_aDropdownMenuList[nPos];
- m_pToolbar->SetItemText( m_nID, m_aCurrentSelection );
// send notification
uno::Sequence< beans::NamedValue > aInfo( 1 );
@@ -353,7 +316,6 @@ IMPL_LINK( ToggleButtonToolbarController, MenuSelectHdl, Menu *, pMenu )
if ( nItemId > 0 && nItemId <= m_aDropdownMenuList.size() )
{
m_aCurrentSelection = m_aDropdownMenuList[nItemId-1];
- m_pToolbar->SetItemText( m_nID, m_aCurrentSelection );
execute( 0 );
}
diff --git a/framework/source/uielement/toolbar.cxx b/framework/source/uielement/toolbar.cxx
index 0ff7603c7898..a5c5d679fa9f 100644
--- a/framework/source/uielement/toolbar.cxx
+++ b/framework/source/uielement/toolbar.cxx
@@ -36,6 +36,7 @@
//_________________________________________________________________________________________________________________
#include <uielement/toolbar.hxx>
#include <uielement/toolbarmanager.hxx>
+#include <rtl/logfile.hxx>
namespace framework
{
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index a105f7b281a1..55c8d16af2ec 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -60,7 +60,6 @@
// interface includes
//_________________________________________________________________________________________________________________
#include <com/sun/star/ui/ItemType.hpp>
-#include <com/sun/star/frame/XToolbarController.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/XDockableWindow.hpp>
@@ -101,6 +100,7 @@
#include <rtl/logfile.hxx>
#include <svtools/menuoptions.hxx>
#include <svtools/cmdoptions.hxx>
+#include <boost/bind.hpp>
//_________________________________________________________________________________________________________________
// namespaces
@@ -200,8 +200,7 @@ static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager
{
try
{
- Any a( xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))) );
- a >>= xLayoutManager;
+ xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))) >>= xLayoutManager;
}
catch ( RuntimeException& )
{
@@ -244,7 +243,7 @@ ToolBarManager::ToolBarManager( const Reference< XMultiServiceFactory >& rServic
ThreadHelpBase( &Application::GetSolarMutex() ),
OWeakObject(),
m_bDisposed( sal_False ),
- m_bIsHiContrast( pToolBar->GetSettings().GetStyleSettings().GetFaceColor().IsDark() ),
+ m_bIsHiContrast( pToolBar->GetSettings().GetStyleSettings().GetHighContrastMode() ),
m_bSmallSymbols( !SvtMiscOptions().AreCurrentSymbolsLarge() ),
m_bModuleIdentified( sal_False ),
m_bAddedToTaskPaneList( sal_True ),
@@ -269,10 +268,16 @@ ToolBarManager::ToolBarManager( const Reference< XMultiServiceFactory >& rServic
((SystemWindow *)pWindow)->GetTaskPaneList()->AddWindow( m_pToolBar );
if ( m_xServiceManager.is() )
+ {
m_xToolbarControllerRegistration = Reference< XUIControllerRegistration >(
m_xServiceManager->createInstance( SERVICENAME_TOOLBARCONTROLLERFACTORY ),
UNO_QUERY );
+ m_xURLTransformer.set( m_xServiceManager->createInstance(
+ SERVICENAME_URLTRANSFORMER),
+ UNO_QUERY );
+ }
+
m_pToolBar->SetSelectHdl( LINK( this, ToolBarManager, Select) );
m_pToolBar->SetActivateHdl( LINK( this, ToolBarManager, Activate) );
m_pToolBar->SetDeactivateHdl( LINK( this, ToolBarManager, Deactivate) );
@@ -366,7 +371,7 @@ void ToolBarManager::CheckAndUpdateImages()
sal_Bool bRefreshImages = sal_False;
// Check if high contrast/normal mode have changed
- if ( m_pToolBar->GetSettings().GetStyleSettings().GetFaceColor().IsDark() )
+ if ( m_pToolBar->GetSettings().GetStyleSettings().GetHighContrastMode() )
{
if ( !m_bIsHiContrast )
{
@@ -681,56 +686,15 @@ void SAL_CALL ToolBarManager::removeEventListener( const Reference< XEventListen
// XUIConfigurationListener
void SAL_CALL ToolBarManager::elementInserted( const ::com::sun::star::ui::ConfigurationEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- return;
-
- Reference< XNameAccess > xNameAccess;
- sal_Int16 nImageType = sal_Int16();
- sal_Int16 nCurrentImageType = getImageTypeFromBools(
- SvtMiscOptions().AreCurrentSymbolsLarge(),
- m_bIsHiContrast );
-
- if (( Event.aInfo >>= nImageType ) &&
- ( nImageType == nCurrentImageType ) &&
- ( Event.Element >>= xNameAccess ))
- {
- sal_Int16 nImageInfo( 1 );
- Reference< XInterface > xIfacDocImgMgr( m_xDocImageManager, UNO_QUERY );
- if ( xIfacDocImgMgr == Event.Source )
- nImageInfo = 0;
-
- Sequence< rtl::OUString > aSeq = xNameAccess->getElementNames();
- for ( sal_Int32 i = 0; i < aSeq.getLength(); i++ )
- {
- // Check if we have commands which have an image. We stored for every command
- // from which image manager it got its image. Use only images from this
- // notification if stored nImageInfo >= current nImageInfo!
- rtl::OUString aCommandURL = aSeq[i];
- CommandToInfoMap::iterator pIter = m_aCommandMap.find( aCommandURL );
- if ( pIter != m_aCommandMap.end() && ( pIter->second.nImageInfo >= nImageInfo ))
- {
- Reference< XGraphic > xGraphic;
- if ( xNameAccess->getByName( aSeq[i] ) >>= xGraphic )
- {
- Image aImage( xGraphic );
- m_pToolBar->SetItemImage( pIter->second.nId, aImage );
- if ( pIter->second.aIds.size() > 0 )
- {
- for ( sal_uInt32 j=0; j < pIter->second.aIds.size(); j++ )
- m_pToolBar->SetItemImage( pIter->second.aIds[j], aImage );
- }
- }
- pIter->second.nImageInfo = nImageInfo;
- }
- }
- }
+ impl_elementChanged(false,Event);
}
void SAL_CALL ToolBarManager::elementRemoved( const ::com::sun::star::ui::ConfigurationEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
{
+ impl_elementChanged(true,Event);
+}
+void ToolBarManager::impl_elementChanged(bool _bRemove,const ::com::sun::star::ui::ConfigurationEvent& Event )
+{
ResetableGuard aGuard( m_aLock );
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
@@ -755,80 +719,50 @@ void SAL_CALL ToolBarManager::elementRemoved( const ::com::sun::star::ui::Config
Sequence< rtl::OUString > aSeq = xNameAccess->getElementNames();
for ( sal_Int32 i = 0; i < aSeq.getLength(); i++ )
{
- CommandToInfoMap::const_iterator pIter = m_aCommandMap.find( aSeq[i] );
+ CommandToInfoMap::iterator pIter = m_aCommandMap.find( aSeq[i] );
if ( pIter != m_aCommandMap.end() && ( pIter->second.nImageInfo >= nImageInfo ))
{
- Image aImage;
- if (( pIter->second.nImageInfo == 0 ) && ( pIter->second.nImageInfo == nImageInfo ))
+ if ( _bRemove )
{
- // Special case: An image from the document image manager has been removed.
- // It is possible that we have a image at our module image manager. Before
- // we can remove our image we have to ask our module image manager.
- Sequence< rtl::OUString > aCmdURLSeq( 1 );
- Sequence< Reference< XGraphic > > aGraphicSeq;
- aCmdURLSeq[0] = pIter->first;
- aGraphicSeq = m_xModuleImageManager->getImages( nImageType, aCmdURLSeq );
- aImage = Image( aGraphicSeq[0] );
- }
+ Image aImage;
+ if (( pIter->second.nImageInfo == 0 ) && ( pIter->second.nImageInfo == nImageInfo ))
+ {
+ // Special case: An image from the document image manager has been removed.
+ // It is possible that we have a image at our module image manager. Before
+ // we can remove our image we have to ask our module image manager.
+ Sequence< rtl::OUString > aCmdURLSeq( 1 );
+ Sequence< Reference< XGraphic > > aGraphicSeq;
+ aCmdURLSeq[0] = pIter->first;
+ aGraphicSeq = m_xModuleImageManager->getImages( nImageType, aCmdURLSeq );
+ aImage = Image( aGraphicSeq[0] );
+ }
- m_pToolBar->SetItemImage( pIter->second.nId, aImage );
- if ( pIter->second.aIds.size() > 0 )
+ setToolBarImage(aImage,pIter);
+ } // if ( _bRemove )
+ else
{
- for ( sal_uInt32 j=0; j < pIter->second.aIds.size(); j++ )
- m_pToolBar->SetItemImage( pIter->second.aIds[j], aImage );
+ Reference< XGraphic > xGraphic;
+ if ( xNameAccess->getByName( aSeq[i] ) >>= xGraphic )
+ {
+ Image aImage( xGraphic );
+ setToolBarImage(aImage,pIter);
+ }
+ pIter->second.nImageInfo = nImageInfo;
}
}
}
}
}
+void ToolBarManager::setToolBarImage(const Image& _aImage,const CommandToInfoMap::const_iterator& _pIter)
+{
+ const ::std::vector< USHORT >& _rIDs = _pIter->second.aIds;
+ m_pToolBar->SetItemImage( _pIter->second.nId, _aImage );
+ ::std::for_each(_rIDs.begin(),_rIDs.end(),::boost::bind(&ToolBar::SetItemImage,m_pToolBar,_1,_aImage));
+}
void SAL_CALL ToolBarManager::elementReplaced( const ::com::sun::star::ui::ConfigurationEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
{
- ResetableGuard aGuard( m_aLock );
-
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( m_bDisposed )
- return;
-
- Reference< XNameAccess > xNameAccess;
- sal_Int16 nImageType = sal_Int16();
- sal_Int16 nCurrentImageType = getImageTypeFromBools(
- SvtMiscOptions().AreCurrentSymbolsLarge(),
- m_bIsHiContrast );
-
- if (( Event.aInfo >>= nImageType ) &&
- ( nImageType == nCurrentImageType ) &&
- ( Event.Element >>= xNameAccess ))
- {
- sal_Int16 nImageInfo( 1 );
- Reference< XInterface > xIfacDocImgMgr( m_xDocImageManager, UNO_QUERY );
- if ( xIfacDocImgMgr == Event.Source )
- nImageInfo = 0;
-
- Sequence< rtl::OUString > aSeq = xNameAccess->getElementNames();
- for ( sal_Int32 i = 0; i < aSeq.getLength(); i++ )
- {
- // Check if we have commands which have an image. We stored for every command
- // from which image manager it got its image. Use only images from this
- // notification if stored nImageInfo >= current nImageInfo!
- CommandToInfoMap::iterator pIter = m_aCommandMap.find( aSeq[i] );
- if ( pIter != m_aCommandMap.end() && ( pIter->second.nImageInfo >= nImageInfo ))
- {
- Reference< XGraphic > xGraphic;
- if ( xNameAccess->getByName( aSeq[i] ) >>= xGraphic )
- {
- Image aImage( xGraphic );
- m_pToolBar->SetItemImage( pIter->second.nId, aImage );
- if ( pIter->second.aIds.size() > 0 )
- {
- for ( sal_uInt32 j=0; j < pIter->second.aIds.size(); j++ )
- m_pToolBar->SetItemImage( pIter->second.aIds[j], aImage );
- }
- }
- pIter->second.nImageInfo = nImageInfo;
- }
- }
- }
+ impl_elementChanged(false,Event);
}
void ToolBarManager::RemoveControllers()
@@ -887,9 +821,7 @@ void ToolBarManager::RemoveControllers()
Reference< XNameAccess > xNameAccess( m_xServiceManager->createInstance( SERVICENAME_UICOMMANDDESCRIPTION ), UNO_QUERY );
if ( xNameAccess.is() )
{
- Any a = xNameAccess->getByName( m_aModuleIdentifier );
- Reference< XNameAccess > xUICommands;
- a >>= m_xUICommandLabels;
+ xNameAccess->getByName( m_aModuleIdentifier ) >>= m_xUICommandLabels;
}
}
}
@@ -906,8 +838,7 @@ void ToolBarManager::RemoveControllers()
{
rtl::OUString aStr;
Sequence< PropertyValue > aPropSeq;
- Any a( m_xUICommandLabels->getByName( aCmdURL ));
- if ( a >>= aPropSeq )
+ if ( m_xUICommandLabels->getByName( aCmdURL ) >>= aPropSeq )
{
for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
{
@@ -937,8 +868,6 @@ void ToolBarManager::CreateControllers()
Reference< XComponentContext > xComponentContext;
Reference< XPropertySet > xProps( m_xServiceManager, UNO_QUERY );
Reference< XWindow > xToolbarWindow = VCLUnoHelper::GetInterface( m_pToolBar );
- Reference< css::util::XURLTransformer > xTrans( m_xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), css::uno::UNO_QUERY );
css::util::URL aURL;
sal_Bool bHasDisabledEntries = SvtCommandOptions().HasEntries( SvtCommandOptions::CMDOPTION_DISABLED );
@@ -966,7 +895,7 @@ void ToolBarManager::CreateControllers()
if ( bHasDisabledEntries )
{
aURL.Complete = aCommandURL;
- xTrans->parseStrict( aURL );
+ m_xURLTransformer->parseStrict( aURL );
if ( aCmdOptions.Lookup( SvtCommandOptions::CMDOPTION_DISABLED, aURL.Path ))
{
m_aControllerMap[ nId ] = xController;
@@ -984,22 +913,22 @@ void ToolBarManager::CreateControllers()
std::vector< Any > aPropertyVector;
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ModuleName" ));
- aPropValue.Value = makeAny( m_aModuleIdentifier );
+ aPropValue.Value <<= m_aModuleIdentifier;
aPropertyVector.push_back( makeAny( aPropValue ));
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Frame" ));
- aPropValue.Value = makeAny( m_xFrame );
+ aPropValue.Value <<= m_xFrame;
aPropertyVector.push_back( makeAny( aPropValue ));
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ServiceManager" ));
- aPropValue.Value = makeAny( m_xServiceManager );
+ aPropValue.Value <<= m_xServiceManager;
aPropertyVector.push_back( makeAny( aPropValue ));
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParentWindow" ));
- aPropValue.Value = makeAny( xToolbarWindow );
+ aPropValue.Value <<= xToolbarWindow;
aPropertyVector.push_back( makeAny( aPropValue ));
if ( nWidth > 0 )
{
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ));
- aPropValue.Value = makeAny( nWidth );
+ aPropValue.Value <<= nWidth;
aPropertyVector.push_back( makeAny( aPropValue ));
}
@@ -1082,21 +1011,21 @@ void ToolBarManager::CreateControllers()
std::vector< Any > aPropertyVector;
aPropValue.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Frame" ));
- aPropValue.Value = makeAny( m_xFrame );
+ aPropValue.Value <<= m_xFrame;
aPropertyVector.push_back( makeAny( aPropValue ));
aPropValue.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CommandURL" ));
- aPropValue.Value = makeAny( aCommandURL );
+ aPropValue.Value <<= aCommandURL;
aPropertyVector.push_back( makeAny( aPropValue ));
aPropValue.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ServiceManager" ));
- aPropValue.Value = makeAny( m_xServiceManager );
+ aPropValue.Value <<= m_xServiceManager;
aPropertyVector.push_back( makeAny( aPropValue ));
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParentWindow" ));
- aPropValue.Value = makeAny( xToolbarWindow );
+ aPropValue.Value <<= xToolbarWindow;
aPropertyVector.push_back( makeAny( aPropValue ));
if ( nWidth > 0 )
{
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ));
- aPropValue.Value = makeAny( nWidth );
+ aPropValue.Value <<= nWidth;
aPropertyVector.push_back( makeAny( aPropValue ));
}
@@ -1340,10 +1269,11 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
AddonsOptions().GetMergeToolbarInstructions( aToolbarName, aMergeInstructionContainer );
- if ( aMergeInstructionContainer.size() > 0 )
+ if ( !aMergeInstructionContainer.empty() )
{
sal_uInt16 nItemId( TOOLBAR_ITEM_STARTID );
- for ( sal_uInt32 i = 0; i < aMergeInstructionContainer.size(); i++ )
+ const sal_uInt32 nCount = aMergeInstructionContainer.size();
+ for ( sal_uInt32 i=0; i < nCount; i++ )
{
MergeToolbarInstruction& rInstruction = aMergeInstructionContainer[i];
if ( ToolBarMerger::IsCorrectContext( rInstruction.aMergeContext, m_aModuleIdentifier ))
@@ -1403,7 +1333,6 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
Reference< XPropertySet > xPropSet( rItemContainer, UNO_QUERY );
if ( xPropSet.is() )
{
- Any a;
try
{
rtl::OUString aUIName;
@@ -1428,14 +1357,15 @@ void ToolBarManager::RequestImages()
sal_uInt32 i = 0;
CommandToInfoMap::iterator pIter = m_aCommandMap.begin();
- while ( pIter != m_aCommandMap.end() )
+ CommandToInfoMap::iterator pEnd = m_aCommandMap.end();
+ while ( pIter != pEnd )
{
aCmdURLSeq[i++] = pIter->first;
++pIter;
}
sal_Bool bBigImages( SvtMiscOptions().AreCurrentSymbolsLarge() );
- m_bIsHiContrast = m_pToolBar->GetSettings().GetStyleSettings().GetFaceColor().IsDark();
+ m_bIsHiContrast = m_pToolBar->GetSettings().GetStyleSettings().GetHighContrastMode();
sal_Int16 p = getImageTypeFromBools( SvtMiscOptions().AreCurrentSymbolsLarge(), m_bIsHiContrast );
if ( m_xDocImageManager.is() )
@@ -1444,7 +1374,7 @@ void ToolBarManager::RequestImages()
i = 0;
pIter = m_aCommandMap.begin();
- while ( pIter != m_aCommandMap.end() )
+ while ( pIter != pEnd )
{
rtl::OUString aCommandURL = aCmdURLSeq[i];
@@ -1458,24 +1388,14 @@ void ToolBarManager::RequestImages()
// empty image.
if ( !aImage )
aImage = QueryAddonsImage( aCmdURLSeq[i], bBigImages, m_bIsHiContrast );
- m_pToolBar->SetItemImage( pIter->second.nId, aImage );
- if ( pIter->second.aIds.size() > 0 )
- {
- for ( sal_uInt32 j=0; j < pIter->second.aIds.size(); j++ )
- m_pToolBar->SetItemImage( pIter->second.aIds[j], aImage );
- }
+
pIter->second.nImageInfo = 1; // mark image as module based
}
else
{
- m_pToolBar->SetItemImage( pIter->second.nId, aImage );
- if ( pIter->second.aIds.size() > 0 )
- {
- for ( sal_uInt32 j=0; j < pIter->second.aIds.size(); j++ )
- m_pToolBar->SetItemImage( pIter->second.aIds[j], aImage );
- }
pIter->second.nImageInfo = 0; // mark image as document based
}
+ setToolBarImage(aImage,pIter);
++pIter;
++i;
}
@@ -1484,7 +1404,7 @@ void ToolBarManager::RequestImages()
void ToolBarManager::notifyRegisteredControllers( const rtl::OUString& aUIElementName, const rtl::OUString& aCommand )
{
ResetableGuard aGuard( m_aLock );
- if ( m_aSubToolBarControllerMap.size() > 0 )
+ if ( !m_aSubToolBarControllerMap.empty() )
{
SubToolBarToSubToolBarControllerMap::const_iterator pIter =
m_aSubToolBarControllerMap.find( aUIElementName );
@@ -1492,12 +1412,13 @@ void ToolBarManager::notifyRegisteredControllers( const rtl::OUString& aUIElemen
if ( pIter != m_aSubToolBarControllerMap.end() )
{
const SubToolBarControllerVector& rSubToolBarVector = pIter->second;
- if ( rSubToolBarVector.size() > 0 )
+ if ( !rSubToolBarVector.empty() )
{
SubToolBarControllerVector aNotifyVector = rSubToolBarVector;
aGuard.unlock();
- for ( sal_uInt32 i = 0; i < aNotifyVector.size(); i++ )
+ const sal_uInt32 nCount = aNotifyVector.size();
+ for ( sal_uInt32 i=0; i < nCount; i++ )
{
try
{
@@ -1517,8 +1438,7 @@ void ToolBarManager::notifyRegisteredControllers( const rtl::OUString& aUIElemen
}
}
}
-
-IMPL_LINK( ToolBarManager, Click, ToolBox*, EMPTYARG )
+long ToolBarManager::HandleClick(void ( SAL_CALL XToolbarController::*_pClick )())
{
ResetableGuard aGuard( m_aLock );
@@ -1532,12 +1452,16 @@ IMPL_LINK( ToolBarManager, Click, ToolBox*, EMPTYARG )
Reference< XToolbarController > xController( pIter->second, UNO_QUERY );
if ( xController.is() )
- xController->click();
- }
-
+ (xController.get()->*_pClick)( );
+ } // if ( pIter != m_aControllerMap.end() )
return 1;
}
+IMPL_LINK( ToolBarManager, Click, ToolBox*, EMPTYARG )
+{
+ return HandleClick(&XToolbarController::click);
+}
+
IMPL_LINK( ToolBarManager, DropdownClick, ToolBox*, EMPTYARG )
{
ResetableGuard aGuard( m_aLock );
@@ -1554,28 +1478,12 @@ IMPL_LINK( ToolBarManager, DropdownClick, ToolBox*, EMPTYARG )
if ( xController.is() )
xController->createPopupWindow();
}
-
return 1;
}
IMPL_LINK( ToolBarManager, DoubleClick, ToolBox*, EMPTYARG )
{
- ResetableGuard aGuard( m_aLock );
-
- if ( m_bDisposed )
- return 1;
-
- USHORT nId( m_pToolBar->GetCurItemId() );
- ToolBarControllerMap::const_iterator pIter = m_aControllerMap.find( nId );
- if ( pIter != m_aControllerMap.end() )
- {
- Reference< XToolbarController > xController( pIter->second, UNO_QUERY );
-
- if ( xController.is() )
- xController->doubleClick();
- }
-
- return 1;
+ return HandleClick(&XToolbarController::doubleClick);
}
void ToolBarManager::ImplClearPopupMenu( ToolBox *pToolBar )
@@ -1668,11 +1576,8 @@ PopupMenu * ToolBarManager::GetToolBarCustomMeun(ToolBox* pToolBar)
if ( m_xFrame.is() )
{
Reference< XDispatchProvider > xProv( m_xFrame, UNO_QUERY );
- Reference< XURLTransformer > xTrans( m_xServiceManager->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
aURL.Complete = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ConfigureDialog" ));
- xTrans->parseStrict( aURL );
+ m_xURLTransformer->parseStrict( aURL );
if ( xProv.is() )
xDisp = xProv->queryDispatch( aURL, ::rtl::OUString(), 0 );
@@ -1841,11 +1746,8 @@ IMPL_LINK( ToolBarManager, MenuSelect, Menu*, pMenu )
if ( m_xFrame.is() )
{
Reference< XDispatchProvider > xProv( m_xFrame, UNO_QUERY );
- Reference< XURLTransformer > xTrans( m_xServiceManager->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
aURL.Complete = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ConfigureDialog" ));
- xTrans->parseStrict( aURL );
+ m_xURLTransformer->parseStrict( aURL );
if ( xProv.is() )
xDisp = xProv->queryDispatch( aURL, ::rtl::OUString(), 0 );
}
@@ -1965,9 +1867,7 @@ IMPL_LINK( ToolBarManager, MenuSelect, Menu*, pMenu )
if ( xPropSet.is() )
{
Reference< XUIConfigurationPersistence > xUICfgMgr;
- Any a = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "ConfigurationSource" )));
- if (( a >>= xUICfgMgr ) && ( xUICfgMgr.is() ))
+ if (( xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ConfigurationSource" ))) >>= xUICfgMgr ) && ( xUICfgMgr.is() ))
xUICfgMgr->store();
}
}
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx
index ab2c72425223..3b359eea97c2 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -58,13 +58,10 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/ui/XUIElementSettings.hpp>
-#ifndef _COM_SUN_STAR_UI_XMODULEUICONFIGURATIONMANAGER_HPP_
#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
-#endif
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
-#ifndef _COM_SUN_STAR_UI_UIElementType_HPP_
#include <com/sun/star/ui/UIElementType.hpp>
-#endif
+#include <com/sun/star/lang/DisposedException.hpp>
//_________________________________________________________________________________________________________________
// includes of other projects
@@ -85,6 +82,7 @@
#include <svtools/menuoptions.hxx>
#include <svtools/cmdoptions.hxx>
#include <dispatch/uieventloghelper.hxx>
+#include <rtl/logfile.hxx>
//_________________________________________________________________________________________________________________
// Defines
@@ -148,8 +146,7 @@ Reference< XLayoutManager > getLayoutManagerFromFrame( const Reference< XFrame >
try
{
- Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )));
- aValue >>= xLayoutManager;
+ xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))) >>= xLayoutManager;
}
catch ( UnknownPropertyException& )
{
@@ -214,7 +211,7 @@ void ToolbarsMenuController::addCommand(
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
if ( rSettings.GetUseImagesInMenus() )
- aImage = GetImageFromURL( m_xFrame, rCommandURL, FALSE, rSettings.GetMenuColor().IsDark() );
+ aImage = GetImageFromURL( m_xFrame, rCommandURL, FALSE, rSettings.GetHighContrastMode() );
VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( rPopupMenu );
if ( pPopupMenu )
@@ -264,8 +261,7 @@ rtl::OUString ToolbarsMenuController::getUINameFromCommand( const rtl::OUString&
Reference< XNameAccess > xNameAccess( m_xServiceManager->createInstance(
SERVICENAME_UICOMMANDDESCRIPTION ),
UNO_QUERY );
- Any a = xNameAccess->getByName( m_aModuleIdentifier );
- a >>= m_xUICommandDescription;
+ xNameAccess->getByName( m_aModuleIdentifier ) >>= m_xUICommandDescription;
}
catch ( Exception& )
{
@@ -278,8 +274,7 @@ rtl::OUString ToolbarsMenuController::getUINameFromCommand( const rtl::OUString&
{
Sequence< PropertyValue > aPropSeq;
rtl::OUString aStr;
- Any a( m_xUICommandDescription->getByName( rCommandURL ));
- if ( a >>= aPropSeq )
+ if ( m_xUICommandDescription->getByName( rCommandURL ) >>= aPropSeq )
{
for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
{
@@ -367,7 +362,8 @@ Sequence< Sequence< com::sun::star::beans::PropertyValue > > ToolbarsMenuControl
aTbSeq[1].Name = m_aPropResourceURL;
Sequence< Sequence< com::sun::star::beans::PropertyValue > > aSeq( aToolBarArray.size() );
- for ( sal_uInt32 i = 0; i < aToolBarArray.size(); i++ )
+ const sal_uInt32 nCount = aToolBarArray.size();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
aTbSeq[0].Value <<= aToolBarArray[i].aToolBarUIName;
aTbSeq[1].Value <<= aToolBarArray[i].aToolBarResName;
@@ -476,7 +472,8 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r
std::sort( aSortedTbs.begin(), aSortedTbs.end(), CompareToolBarEntry );
sal_Int16 nIndex( 1 );
- for ( sal_uInt32 i = 0; i < aSortedTbs.size(); i++ )
+ const sal_uInt32 nCount = aSortedTbs.size();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
USHORT nItemCount = m_xPopupMenu->getItemCount();
m_xPopupMenu->insertItem( nIndex, aSortedTbs[i].aUIName, css::awt::MenuItemStyle::CHECKABLE, nItemCount );
@@ -631,10 +628,6 @@ void SAL_CALL ToolbarsMenuController::statusChanged( const FeatureStateEvent& Ev
}
// XMenuListener
-void SAL_CALL ToolbarsMenuController::highlight( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
void SAL_CALL ToolbarsMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
{
Reference< css::awt::XPopupMenu > xPopupMenu;
@@ -679,9 +672,7 @@ void SAL_CALL ToolbarsMenuController::select( const css::awt::MenuEvent& rEvent
rtl::OUString aElementName = aElementNames[i];
Sequence< PropertyValue > aWindowState;
- Any a( xPersistentWindowState->getByName( aElementName ));
-
- if ( a >>= aWindowState )
+ if ( xPersistentWindowState->getByName( aElementName ) >>= aWindowState )
{
sal_Bool bVisible( sal_False );
sal_Bool bContextSensitive( sal_False );
@@ -700,7 +691,7 @@ void SAL_CALL ToolbarsMenuController::select( const css::awt::MenuEvent& rEvent
if ( !bVisible && bContextSensitive && nVisibleIndex >= 0 )
{
// Default is: Every context sensitive toolbar is visible
- aWindowState[nVisibleIndex].Value = makeAny( sal_True );
+ aWindowState[nVisibleIndex].Value <<= sal_True;
xNameReplace->replaceByName( aElementName, makeAny( aWindowState ));
bRefreshToolbars = true;
}
@@ -810,7 +801,8 @@ void SAL_CALL ToolbarsMenuController::activate( const css::awt::MenuEvent& ) thr
}
// Update status for all commands inside our toolbars popup menu
- for ( sal_uInt32 i=0; i < aCmdVector.size(); i++ )
+ const sal_uInt32 nCount = aCmdVector.size();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
bool bInternal = ( aCmdVector[i].indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( STATIC_INTERNAL_CMD_PART ))) == 0);
@@ -837,10 +829,6 @@ void SAL_CALL ToolbarsMenuController::activate( const css::awt::MenuEvent& ) thr
}
}
-void SAL_CALL ToolbarsMenuController::deactivate( const css::awt::MenuEvent& ) throw (RuntimeException)
-{
-}
-
// XPopupMenuController
void SAL_CALL ToolbarsMenuController::setPopupMenu( const Reference< css::awt::XPopupMenu >& xPopupMenu ) throw ( RuntimeException )
{
@@ -863,37 +851,14 @@ void SAL_CALL ToolbarsMenuController::setPopupMenu( const Reference< css::awt::X
// XInitialization
void SAL_CALL ToolbarsMenuController::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
{
- const rtl::OUString aFrameName( RTL_CONSTASCII_USTRINGPARAM( "Frame" ));
- const rtl::OUString aCommandURLName( RTL_CONSTASCII_USTRINGPARAM( "CommandURL" ));
-
ResetableGuard aLock( m_aLock );
-
sal_Bool bInitalized( m_bInitialized );
if ( !bInitalized )
{
- PropertyValue aPropValue;
- rtl::OUString aCommandURL;
- Reference< XFrame > xFrame;
+ PopupMenuControllerBase::initialize(aArguments);
- for ( int i = 0; i < aArguments.getLength(); i++ )
+ if ( m_bInitialized )
{
- 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_bInitialized = true;
-
- m_aBaseURL = determineBaseURL( aCommandURL );
-
Reference< XModuleManager > xModuleManager( m_xServiceManager->createInstance(
SERVICENAME_MODULEMANAGER ),
UNO_QUERY );
@@ -932,11 +897,6 @@ void SAL_CALL ToolbarsMenuController::initialize( const Sequence< Any >& aArgume
{
}
}
-
- m_xURLTransformer = Reference< XURLTransformer >( m_xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.util.URLTransformer" ))),
- UNO_QUERY );
}
}
}
diff --git a/framework/source/uielement/toolbarwrapper.cxx b/framework/source/uielement/toolbarwrapper.cxx
index 5f38979f9dbc..4c42c9c863ea 100644
--- a/framework/source/uielement/toolbarwrapper.cxx
+++ b/framework/source/uielement/toolbarwrapper.cxx
@@ -85,8 +85,7 @@ namespace framework
{
ToolBarWrapper::ToolBarWrapper( const Reference< XMultiServiceFactory >& xServiceManager ) :
- UIConfigElementWrapperBase( UIElementType::TOOLBAR ),
- m_xServiceManager( xServiceManager )
+ UIConfigElementWrapperBase( UIElementType::TOOLBAR,xServiceManager )
{
}
@@ -185,7 +184,7 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments ) th
pToolBar = new ToolBar( pWindow, nStyles );
m_xToolBarWindow = VCLUnoHelper::GetInterface( pToolBar );
- pToolBarManager = new ToolBarManager( m_xServiceManager, xFrame, m_aResourceURL, pToolBar );
+ pToolBarManager = new ToolBarManager( m_xServiceFactory, xFrame, m_aResourceURL, pToolBar );
pToolBar->SetToolBarManager( pToolBarManager );
m_xToolBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY );
pToolBar->WillUsePopupMode( bPopupMode );
@@ -276,71 +275,12 @@ void SAL_CALL ToolBarWrapper::updateSettings() throw (::com::sun::star::uno::Run
}
}
-Reference< XIndexAccess > SAL_CALL ToolBarWrapper::getSettings( sal_Bool bWriteable ) throw (::com::sun::star::uno::RuntimeException)
-{
- ResetableGuard aLock( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( bWriteable )
- return Reference< XIndexAccess >( static_cast< OWeakObject * >( new RootItemContainer( m_xConfigData ) ), UNO_QUERY );
- else
- return m_xConfigData;
-}
-
-void SAL_CALL ToolBarWrapper::setSettings( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& xSettings ) throw (::com::sun::star::uno::RuntimeException)
-{
- ResetableGuard aLock( m_aLock );
-
- if ( m_bDisposed )
- throw DisposedException();
-
- if ( xSettings.is() )
- {
- // Create a copy of the data if the container is not const
- Reference< XIndexReplace > xReplace( xSettings, UNO_QUERY );
- if ( xReplace.is() )
- m_xConfigData = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( xSettings ) ), UNO_QUERY );
- else
- m_xConfigData = xSettings;
-
- if ( m_xConfigSource.is() && m_bPersistent )
- {
- ::rtl::OUString aResourceURL( m_aResourceURL );
- Reference< XUIConfigurationManager > xUICfgMgr( m_xConfigSource );
-
- aLock.unlock();
-
- try
- {
- xUICfgMgr->replaceSettings( aResourceURL, m_xConfigData );
- }
- catch( NoSuchElementException& )
- {
- }
- }
- else if ( !m_bPersistent )
- {
- // Transient toolbar => Fill toolbar with new data
- ToolBarManager* pToolBarManager = static_cast< ToolBarManager *>( m_xToolBarManager.get() );
- if ( pToolBarManager )
- pToolBarManager->FillToolbar( m_xConfigData );
- }
- }
-}
-
-// XUIConfigurationListener
-void SAL_CALL ToolBarWrapper::elementInserted( const ::com::sun::star::ui::ConfigurationEvent& ) throw (::com::sun::star::uno::RuntimeException)
-{
-}
-
-void SAL_CALL ToolBarWrapper::elementRemoved( const ::com::sun::star::ui::ConfigurationEvent& ) throw (::com::sun::star::uno::RuntimeException)
-{
-}
-
-void SAL_CALL ToolBarWrapper::elementReplaced( const ::com::sun::star::ui::ConfigurationEvent& ) throw (::com::sun::star::uno::RuntimeException)
+void ToolBarWrapper::impl_fillNewData()
{
+ // Transient toolbar => Fill toolbar with new data
+ ToolBarManager* pToolBarManager = static_cast< ToolBarManager *>( m_xToolBarManager.get() );
+ if ( pToolBarManager )
+ pToolBarManager->FillToolbar( m_xConfigData );
}
// XUIElement interface
diff --git a/framework/source/uielement/uicommanddescription.cxx b/framework/source/uielement/uicommanddescription.cxx
index 1ac950ec463c..174411bfea8a 100644
--- a/framework/source/uielement/uicommanddescription.cxx
+++ b/framework/source/uielement/uicommanddescription.cxx
@@ -53,7 +53,7 @@
// includes of other projects
//_________________________________________________________________________________________________________________
#include <rtl/ustrbuf.hxx>
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <unotools/configmgr.hxx>
#include <tools/string.hxx>
@@ -113,23 +113,14 @@ namespace framework
// Configuration access class for PopupMenuControllerFactory implementation
//*****************************************************************************************************************
-class ConfigurationAccess_UICommand : // interfaces
- public XTypeProvider ,
- public XNameAccess ,
- public XContainerListener ,
- // baseclasses
- // Order is neccessary for right initialization!
+class ConfigurationAccess_UICommand : // Order is neccessary for right initialization!
private ThreadHelpBase ,
- public ::cppu::OWeakObject
+ public ::cppu::WeakImplHelper2<XNameAccess,XContainerListener>
{
public:
ConfigurationAccess_UICommand( const ::rtl::OUString& aModuleName, const Reference< XNameAccess >& xGenericUICommands, const Reference< XMultiServiceFactory >& rServiceManager );
virtual ~ConfigurationAccess_UICommand();
- // XInterface, XTypeProvider
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
-
// XNameAccess
virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
@@ -177,6 +168,10 @@ class ConfigurationAccess_UICommand : // interfaces
Sequence< rtl::OUString > getAllCommands();
sal_Bool fillCache();
sal_Bool addGenericInfoToCache();
+ void impl_fill(const Reference< XNameAccess >& _xConfigAccess,sal_Bool _bPopup,
+ std::vector< ::rtl::OUString >& aImageCommandVector,
+ std::vector< ::rtl::OUString >& aImageRotateVector,
+ std::vector< ::rtl::OUString >& aImageMirrorVector);
private:
typedef ::std::hash_map< ::rtl::OUString,
@@ -202,7 +197,7 @@ class ConfigurationAccess_UICommand : // interfaces
Reference< XNameAccess > m_xGenericUICommands;
Reference< XMultiServiceFactory > m_xServiceManager;
Reference< XMultiServiceFactory > m_xConfigProvider;
- Reference< XMultiServiceFactory > m_xConfigProviderPopups;
+ //Reference< XMultiServiceFactory > m_xConfigProviderPopups;
Reference< XNameAccess > m_xConfigAccess;
Reference< XNameAccess > m_xConfigAccessPopups;
Sequence< rtl::OUString > m_aCommandImageList;
@@ -217,23 +212,6 @@ class ConfigurationAccess_UICommand : // interfaces
//*****************************************************************************************************************
// XInterface, XTypeProvider
//*****************************************************************************************************************
-DEFINE_XINTERFACE_5 ( ConfigurationAccess_UICommand ,
- OWeakObject ,
- DIRECT_INTERFACE ( css::container::XNameAccess ),
- DIRECT_INTERFACE ( css::container::XContainerListener ),
- DIRECT_INTERFACE ( css::lang::XTypeProvider ),
- DERIVED_INTERFACE( css::container::XElementAccess, css::container::XNameAccess ),
- DERIVED_INTERFACE( css::lang::XEventListener, XContainerListener )
- )
-
-DEFINE_XTYPEPROVIDER_5 ( ConfigurationAccess_UICommand ,
- css::container::XNameAccess ,
- css::container::XElementAccess ,
- css::container::XContainerListener ,
- css::lang::XTypeProvider ,
- css::lang::XEventListener
- )
-
ConfigurationAccess_UICommand::ConfigurationAccess_UICommand( const rtl::OUString& aModuleName, const Reference< XNameAccess >& rGenericUICommands, const Reference< XMultiServiceFactory >& rServiceManager ) :
ThreadHelpBase(),
m_aConfigCmdAccess( RTL_CONSTASCII_USTRINGPARAM( CONFIGURATION_ROOT_ACCESS )),
@@ -255,21 +233,14 @@ ConfigurationAccess_UICommand::ConfigurationAccess_UICommand( const rtl::OUStrin
m_aConfigCmdAccess += aModuleName;
m_aConfigCmdAccess += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CONFIGURATION_CMD_ELEMENT_ACCESS ));
- m_xConfigProvider = Reference< XMultiServiceFactory >( rServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationProvider" ))),
- UNO_QUERY );
+ m_xConfigProvider = Reference< XMultiServiceFactory >( rServiceManager->createInstance(SERVICENAME_CFGPROVIDER),UNO_QUERY );
m_aConfigPopupAccess += aModuleName;
m_aConfigPopupAccess += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CONFIGURATION_POP_ELEMENT_ACCESS ));
- m_xConfigProviderPopups = Reference< XMultiServiceFactory >( rServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationProvider" ))),
- UNO_QUERY );
+ //m_xConfigProviderPopups = Reference< XMultiServiceFactory >( rServiceManager->createInstance(SERVICENAME_CFGPROVIDER),UNO_QUERY );
- Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
rtl::OUString aTmp;
- aRet >>= aTmp;
+ ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ) >>= aTmp;
m_aBrandName = aTmp;
}
@@ -336,11 +307,7 @@ throw ( RuntimeException )
sal_Bool SAL_CALL ConfigurationAccess_UICommand::hasByName( const ::rtl::OUString& rCommandURL )
throw (::com::sun::star::uno::RuntimeException)
{
- Any a = getByName( rCommandURL );
- if ( a != Any() )
- return sal_True;
- else
- return sal_False;
+ return getByName( rCommandURL ).hasValue();
}
// XElementAccess
@@ -381,48 +348,36 @@ Any ConfigurationAccess_UICommand::getSequenceFromCache( const ::rtl::OUString&
aPropSeq[0].Value = pIter->second.aContextLabel.getLength() ?
makeAny( pIter->second.aContextLabel ): makeAny( pIter->second.aLabel );
aPropSeq[1].Name = m_aPropName;
- aPropSeq[1].Value = makeAny( pIter->second.aCommandName );
+ aPropSeq[1].Value <<= pIter->second.aCommandName;
aPropSeq[2].Name = m_aPropPopup;
- aPropSeq[2].Value = makeAny( pIter->second.bPopup );
+ aPropSeq[2].Value <<= pIter->second.bPopup;
return makeAny( aPropSeq );
}
return Any();
}
-
-sal_Bool ConfigurationAccess_UICommand::fillCache()
+void ConfigurationAccess_UICommand::impl_fill(const Reference< XNameAccess >& _xConfigAccess,sal_Bool _bPopup,
+ std::vector< ::rtl::OUString >& aImageCommandVector,
+ std::vector< ::rtl::OUString >& aImageRotateVector,
+ std::vector< ::rtl::OUString >& aImageMirrorVector)
{
- RTL_LOGFILE_CONTEXT( aLog, "framework (cd100003) ::ConfigurationAccess_UICommand::fillCache" );
-
- if ( m_bCacheFilled )
- return sal_True;
-
- sal_Int32 i( 0 );
- Any a;
- std::vector< ::rtl::OUString > aImageCommandVector;
- std::vector< ::rtl::OUString > aImageRotateVector;
- std::vector< ::rtl::OUString > aImageMirrorVector;
- Sequence< ::rtl::OUString > aNameSeq;
-
- if ( m_xConfigAccess.is() )
+ if ( _xConfigAccess.is() )
{
- aNameSeq = m_xConfigAccess->getElementNames();
- for ( i = 0; i < aNameSeq.getLength(); i++ )
+ Sequence< ::rtl::OUString> aNameSeq = _xConfigAccess->getElementNames();
+ const sal_Int32 nCount = aNameSeq.getLength();
+ for ( sal_Int32 i = 0; i < nCount; i++ )
{
try
{
- Reference< XNameAccess > xNameAccess;
- a = m_xConfigAccess->getByName( aNameSeq[i] );
- if ( a >>= xNameAccess )
+ Reference< XNameAccess > xNameAccess(_xConfigAccess->getByName( aNameSeq[i] ),UNO_QUERY);
+ if ( xNameAccess.is() )
{
CmdToInfoMap aCmdToInfo;
- a = xNameAccess->getByName( m_aPropUILabel );
- a >>= aCmdToInfo.aLabel;
- a = xNameAccess->getByName( m_aPropUIContextLabel );
- a >>= aCmdToInfo.aContextLabel;
- a = xNameAccess->getByName( m_aPropProperties );
- a >>= aCmdToInfo.nProperties;
+ aCmdToInfo.bPopup = _bPopup;
+ xNameAccess->getByName( m_aPropUILabel ) >>= aCmdToInfo.aLabel;
+ xNameAccess->getByName( m_aPropUIContextLabel ) >>= aCmdToInfo.aContextLabel;
+ xNameAccess->getByName( m_aPropProperties ) >>= aCmdToInfo.nProperties;
m_aCmdInfoCache.insert( CommandToInfoCache::value_type( aNameSeq[i], aCmdToInfo ));
@@ -441,48 +396,21 @@ sal_Bool ConfigurationAccess_UICommand::fillCache()
{
}
}
- }
-
- if ( m_xConfigAccessPopups.is() )
- {
- aNameSeq = m_xConfigAccessPopups->getElementNames();
- for ( i = 0; i < aNameSeq.getLength(); i++ )
- {
- try
- {
- Reference< XNameAccess > xNameAccess;
- a = m_xConfigAccessPopups->getByName( aNameSeq[i] );
- if ( a >>= xNameAccess )
- {
- CmdToInfoMap aCmdToInfo;
-
- aCmdToInfo.bPopup = sal_True;
- a = xNameAccess->getByName( m_aPropUILabel );
- a >>= aCmdToInfo.aLabel;
- a = xNameAccess->getByName( m_aPropUIContextLabel );
- a >>= aCmdToInfo.aContextLabel;
- a = xNameAccess->getByName( m_aPropProperties );
- a >>= aCmdToInfo.nProperties;
+ } // if ( m_xConfigAccessPopups.is() )
+}
+sal_Bool ConfigurationAccess_UICommand::fillCache()
+{
+ RTL_LOGFILE_CONTEXT( aLog, "framework (cd100003) ::ConfigurationAccess_UICommand::fillCache" );
- m_aCmdInfoCache.insert( CommandToInfoCache::value_type( aNameSeq[i], aCmdToInfo ));
+ if ( m_bCacheFilled )
+ return sal_True;
- if ( aCmdToInfo.nProperties & COMMAND_PROPERTY_IMAGE )
- aImageCommandVector.push_back( aNameSeq[i] );
- if ( aCmdToInfo.nProperties & COMMAND_PROPERTY_ROTATE )
- aImageRotateVector.push_back( aNameSeq[i] );
- if ( aCmdToInfo.nProperties & COMMAND_PROPERTY_MIRROR )
- aImageMirrorVector.push_back( aNameSeq[i] );
- }
- }
- catch ( com::sun::star::lang::WrappedTargetException& )
- {
- }
- catch ( com::sun::star::container::NoSuchElementException& )
- {
- }
- }
- }
+ std::vector< ::rtl::OUString > aImageCommandVector;
+ std::vector< ::rtl::OUString > aImageRotateVector;
+ std::vector< ::rtl::OUString > aImageMirrorVector;
+ impl_fill(m_xConfigAccess,sal_False,aImageCommandVector,aImageRotateVector,aImageMirrorVector);
+ impl_fill(m_xConfigAccessPopups,sal_True,aImageCommandVector,aImageRotateVector,aImageMirrorVector);
// Create cached sequences for fast retrieving
m_aCommandImageList = comphelper::containerToSequence( aImageCommandVector );
m_aCommandRotateImageList = comphelper::containerToSequence( aImageRotateVector );
@@ -582,7 +510,6 @@ Sequence< rtl::OUString > ConfigurationAccess_UICommand::getAllCommands()
if ( m_xConfigAccess.is() )
{
- Any a;
Reference< XNameAccess > xNameAccess;
try
@@ -624,14 +551,10 @@ sal_Bool ConfigurationAccess_UICommand::initializeConfigAccess()
try
{
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ));
- aPropValue.Value = makeAny( m_aConfigCmdAccess );
+ aPropValue.Value <<= m_aConfigCmdAccess;
aArgs[0] <<= aPropValue;
- m_xConfigAccess = Reference< XNameAccess >( m_xConfigProvider->createInstanceWithArguments(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationAccess" )),
- aArgs ),
- UNO_QUERY );
+ m_xConfigAccess = Reference< XNameAccess >( m_xConfigProvider->createInstanceWithArguments(SERVICENAME_CFGREADACCESS,aArgs ),UNO_QUERY );
if ( m_xConfigAccess.is() )
{
// Add as container listener
@@ -640,13 +563,9 @@ sal_Bool ConfigurationAccess_UICommand::initializeConfigAccess()
xContainer->addContainerListener( this );
}
- aPropValue.Value = makeAny( m_aConfigPopupAccess );
+ aPropValue.Value <<= m_aConfigPopupAccess;
aArgs[0] <<= aPropValue;
- m_xConfigAccessPopups = Reference< XNameAccess >( m_xConfigProvider->createInstanceWithArguments(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationAccess" )),
- aArgs ),
- UNO_QUERY );
+ m_xConfigAccessPopups = Reference< XNameAccess >( m_xConfigProvider->createInstanceWithArguments(SERVICENAME_CFGREADACCESS,aArgs ),UNO_QUERY );
if ( m_xConfigAccessPopups.is() )
{
// Add as container listener
@@ -711,21 +630,6 @@ void SAL_CALL ConfigurationAccess_UICommand::disposing( const EventObject& aEven
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_4 ( UICommandDescription ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XServiceInfo ),
- DIRECT_INTERFACE( css::container::XNameAccess ),
- DERIVED_INTERFACE( css::container::XElementAccess, css::container::XNameAccess )
- )
-
-DEFINE_XTYPEPROVIDER_4 ( UICommandDescription ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- css::container::XNameAccess ,
- css::container::XElementAccess
- )
-
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( UICommandDescription ,
::cppu::OWeakObject ,
SERVICENAME_UICOMMANDDESCRIPTION ,
@@ -739,12 +643,33 @@ UICommandDescription::UICommandDescription( const Reference< XMultiServiceFactor
m_aPrivateResourceURL( RTL_CONSTASCII_USTRINGPARAM( PRIVATE_RESOURCE_URL )),
m_xServiceManager( xServiceManager )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UICommandDescription::UICommandDescription" );
Reference< XNameAccess > xEmpty;
rtl::OUString aGenericUICommand( ::rtl::OUString::createFromAscii( "GenericCommands" ));
m_xGenericUICommands = new ConfigurationAccess_UICommand( aGenericUICommand, xEmpty, xServiceManager );
- m_xModuleManager = Reference< XModuleManager >( m_xServiceManager->createInstance( SERVICENAME_MODULEMANAGER ),
- UNO_QUERY );
+ impl_fillElements("ooSetupFactoryCommandConfigRef");
+
+ // insert generic commands
+ UICommandsHashMap::iterator pIter = m_aUICommandsHashMap.find( aGenericUICommand );
+ if ( pIter != m_aUICommandsHashMap.end() )
+ pIter->second = m_xGenericUICommands;
+}
+UICommandDescription::UICommandDescription( const Reference< XMultiServiceFactory >& xServiceManager,bool ) :
+ ThreadHelpBase(),
+ m_xServiceManager( xServiceManager )
+{
+}
+UICommandDescription::~UICommandDescription()
+{
+ ResetableGuard aLock( m_aLock );
+ m_aModuleToCommandFileMap.clear();
+ m_aUICommandsHashMap.clear();
+ m_xGenericUICommands.clear();
+}
+void UICommandDescription::impl_fillElements(const sal_Char* _pName)
+{
+ m_xModuleManager.set( m_xServiceManager->createInstance( SERVICENAME_MODULEMANAGER ),UNO_QUERY );
Reference< XNameAccess > xNameAccess( m_xModuleManager, UNO_QUERY_THROW );
Sequence< rtl::OUString > aElementNames = xNameAccess->getElementNames();
Sequence< PropertyValue > aSeq;
@@ -753,13 +678,12 @@ UICommandDescription::UICommandDescription( const Reference< XMultiServiceFactor
for ( sal_Int32 i = 0; i < aElementNames.getLength(); i++ )
{
aModuleIdentifier = aElementNames[i];
- Any a = xNameAccess->getByName( aModuleIdentifier );
- if ( a >>= aSeq )
+ if ( xNameAccess->getByName( aModuleIdentifier ) >>= aSeq )
{
::rtl::OUString aCommandStr;
for ( sal_Int32 y = 0; y < aSeq.getLength(); y++ )
{
- if ( aSeq[y].Name.equalsAscii("ooSetupFactoryCommandConfigRef") )
+ if ( aSeq[y].Name.equalsAscii(_pName) )
{
aSeq[y].Value >>= aCommandStr;
break;
@@ -774,25 +698,17 @@ UICommandDescription::UICommandDescription( const Reference< XMultiServiceFactor
if ( pIter == m_aUICommandsHashMap.end() )
m_aUICommandsHashMap.insert( UICommandsHashMap::value_type( aCommandStr, Reference< XNameAccess >() ));
}
- }
-
- // insert generic commands
- UICommandsHashMap::iterator pIter = m_aUICommandsHashMap.find( aGenericUICommand );
- if ( pIter != m_aUICommandsHashMap.end() )
- pIter->second = m_xGenericUICommands;
+ } // for ( sal_Int32 i = 0; i < aElementNames.getLength(); i++ )
}
-
-UICommandDescription::~UICommandDescription()
+Reference< XNameAccess > UICommandDescription::impl_createConfigAccess(const ::rtl::OUString& _sName)
{
- ResetableGuard aLock( m_aLock );
- m_aModuleToCommandFileMap.clear();
- m_aUICommandsHashMap.clear();
- m_xGenericUICommands.clear();
+ return new ConfigurationAccess_UICommand( _sName,m_xGenericUICommands,m_xServiceManager );
}
Any SAL_CALL UICommandDescription::getByName( const ::rtl::OUString& aName )
throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UICommandDescription::getByName" );
Any a;
ResetableGuard aLock( m_aLock );
@@ -818,7 +734,7 @@ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::la
}
}
}
- else if ( aName.indexOf( m_aPrivateResourceURL ) == 0 )
+ else if ( m_aPrivateResourceURL.getLength() && aName.indexOf( m_aPrivateResourceURL ) == 0 )
{
// special keys to retrieve information about a set of commands
return m_xGenericUICommands->getByName( aName );
@@ -834,6 +750,7 @@ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::la
Sequence< ::rtl::OUString > SAL_CALL UICommandDescription::getElementNames()
throw (::com::sun::star::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UICommandDescription::getElementNames" );
ResetableGuard aLock( m_aLock );
Sequence< rtl::OUString > aSeq( m_aModuleToCommandFileMap.size() );
@@ -852,6 +769,7 @@ throw (::com::sun::star::uno::RuntimeException)
sal_Bool SAL_CALL UICommandDescription::hasByName( const ::rtl::OUString& aName )
throw (::com::sun::star::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UICommandDescription::hasByName" );
ResetableGuard aLock( m_aLock );
ModuleToCommandFileMap::const_iterator pIter = m_aModuleToCommandFileMap.find( aName );
@@ -862,12 +780,14 @@ throw (::com::sun::star::uno::RuntimeException)
Type SAL_CALL UICommandDescription::getElementType()
throw (::com::sun::star::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UICommandDescription::getElementType" );
return( ::getCppuType( (const Reference< XNameAccess >*)NULL ) );
}
sal_Bool SAL_CALL UICommandDescription::hasElements()
throw (::com::sun::star::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UICommandDescription::hasElements" );
// generic UI commands are always available!
return sal_True;
}
diff --git a/framework/source/uifactory/addonstoolboxfactory.cxx b/framework/source/uifactory/addonstoolboxfactory.cxx
index 4cefafe14e7c..ca4fd30afa54 100644
--- a/framework/source/uifactory/addonstoolboxfactory.cxx
+++ b/framework/source/uifactory/addonstoolboxfactory.cxx
@@ -76,19 +76,6 @@ namespace framework
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( AddonsToolBoxFactory ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XServiceInfo ),
- DIRECT_INTERFACE( ::com::sun::star::ui::XUIElementFactory )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( AddonsToolBoxFactory ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- ::com::sun::star::ui::XUIElementFactory
- )
-
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( AddonsToolBoxFactory ,
::cppu::OWeakObject ,
SERVICENAME_TOOLBARFACTORY ,
@@ -101,9 +88,7 @@ AddonsToolBoxFactory::AddonsToolBoxFactory(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
ThreadHelpBase( &Application::GetSolarMutex() )
, m_xServiceManager( xServiceManager )
- , m_xModuleManager( xServiceManager->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ModuleManager" ))),
- UNO_QUERY )
+ , m_xModuleManager( xServiceManager->createInstance(SERVICENAME_MODULEMANAGER),UNO_QUERY )
{
}
diff --git a/framework/source/uifactory/factoryconfiguration.cxx b/framework/source/uifactory/factoryconfiguration.cxx
new file mode 100755
index 000000000000..4250c44c721c
--- /dev/null
+++ b/framework/source/uifactory/factoryconfiguration.cxx
@@ -0,0 +1,344 @@
+/*************************************************************************
+ *
+ * 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: ConfigurationAccess_ControllerFactory.cxx,v $
+ * $Revision: 1.9 $
+ *
+ * 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"
+
+//_________________________________________________________________________________________________________________
+// my own includes
+//_________________________________________________________________________________________________________________
+#include "uifactory/factoryconfiguration.hxx"
+#include <threadhelp/resetableguard.hxx>
+#include "services.h"
+
+//_________________________________________________________________________________________________________________
+// interface includes
+//_________________________________________________________________________________________________________________
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/container/XContainer.hpp>
+
+//_________________________________________________________________________________________________________________
+// includes of other projects
+//_________________________________________________________________________________________________________________
+#include <rtl/ustrbuf.hxx>
+#include <cppuhelper/weak.hxx>
+#include <rtl/logfile.hxx>
+
+//_________________________________________________________________________________________________________________
+// Defines
+//_________________________________________________________________________________________________________________
+//
+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::container;
+using namespace ::com::sun::star::frame;
+
+//_________________________________________________________________________________________________________________
+// Namespace
+//_________________________________________________________________________________________________________________
+//
+
+namespace framework
+{
+rtl::OUString getHashKeyFromStrings( const rtl::OUString& aCommandURL, const rtl::OUString& aModuleName )
+{
+ rtl::OUStringBuffer aKey( aCommandURL );
+ aKey.appendAscii( "-" );
+ aKey.append( aModuleName );
+ return aKey.makeStringAndClear();
+}
+
+//*****************************************************************************************************************
+// XInterface, XTypeProvider
+//*****************************************************************************************************************
+ConfigurationAccess_ControllerFactory::ConfigurationAccess_ControllerFactory( Reference< XMultiServiceFactory >& rServiceManager,const ::rtl::OUString& _sRoot,bool _bAskValue ) :
+ ThreadHelpBase(),
+ m_aPropCommand( RTL_CONSTASCII_USTRINGPARAM( "Command" )),
+ m_aPropModule( RTL_CONSTASCII_USTRINGPARAM( "Module" )),
+ m_aPropController( RTL_CONSTASCII_USTRINGPARAM( "Controller" )),
+ m_aPropValue( RTL_CONSTASCII_USTRINGPARAM( "Value" )),
+ m_sRoot(_sRoot),
+ m_xServiceManager( rServiceManager ),
+ m_bConfigAccessInitialized( sal_False ),
+ m_bAskValue(_bAskValue)
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_ControllerFactory::ConfigurationAccess_ControllerFactory" );
+ m_xConfigProvider = Reference< XMultiServiceFactory >( rServiceManager->createInstance( SERVICENAME_CFGPROVIDER),UNO_QUERY );
+}
+
+ConfigurationAccess_ControllerFactory::~ConfigurationAccess_ControllerFactory()
+{
+ // SAFE
+ ResetableGuard aLock( m_aLock );
+
+ Reference< XContainer > xContainer( m_xConfigAccess, UNO_QUERY );
+ if ( xContainer.is() )
+ xContainer->removeContainerListener( this );
+}
+
+rtl::OUString ConfigurationAccess_ControllerFactory::getServiceFromCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule ) const
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_ControllerFactory::getServiceFromCommandModule" );
+ // SAFE
+ ResetableGuard aLock( m_aLock );
+ MenuControllerMap::const_iterator pIter = m_aMenuControllerMap.find( getHashKeyFromStrings( rCommandURL, rModule ));
+
+ if ( pIter != m_aMenuControllerMap.end() )
+ return pIter->second.m_aImplementationName;
+ else if ( rModule.getLength() )
+ {
+ // Try to detect if we have a generic popup menu controller
+ pIter = m_aMenuControllerMap.find( getHashKeyFromStrings( rCommandURL, rtl::OUString() ));
+
+ if ( pIter != m_aMenuControllerMap.end() )
+ return pIter->second.m_aImplementationName;
+ }
+
+ return rtl::OUString();
+}
+rtl::OUString ConfigurationAccess_ControllerFactory::getValueFromCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule ) const
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_ControllerFactory::getValueFromCommandModule" );
+ // SAFE
+ ResetableGuard aLock( m_aLock );
+
+ MenuControllerMap::const_iterator pIter = m_aMenuControllerMap.find( getHashKeyFromStrings( rCommandURL, rModule ));
+
+ if ( pIter != m_aMenuControllerMap.end() )
+ return pIter->second.m_aValue;
+ else if ( rModule.getLength() )
+ {
+ // Try to detect if we have a generic popup menu controller
+ pIter = m_aMenuControllerMap.find( getHashKeyFromStrings( rCommandURL, rtl::OUString() ));
+
+ if ( pIter != m_aMenuControllerMap.end() )
+ return pIter->second.m_aValue;
+ }
+
+ return rtl::OUString();
+}
+
+
+void ConfigurationAccess_ControllerFactory::addServiceToCommandModule(
+ const rtl::OUString& rCommandURL,
+ const rtl::OUString& rModule,
+ const rtl::OUString& rServiceSpecifier )
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_ControllerFactory::addServiceToCommandModule" );
+ // SAFE
+ ResetableGuard aLock( m_aLock );
+
+ rtl::OUString aHashKey = getHashKeyFromStrings( rCommandURL, rModule );
+ m_aMenuControllerMap.insert( MenuControllerMap::value_type( aHashKey,ControllerInfo(rServiceSpecifier,::rtl::OUString()) ));
+}
+
+void ConfigurationAccess_ControllerFactory::removeServiceFromCommandModule(
+ const rtl::OUString& rCommandURL,
+ const rtl::OUString& rModule )
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_ControllerFactory::removeServiceFromCommandModule" );
+ // SAFE
+ ResetableGuard aLock( m_aLock );
+
+ rtl::OUString aHashKey = getHashKeyFromStrings( rCommandURL, rModule );
+ m_aMenuControllerMap.erase( aHashKey );
+}
+
+// container.XContainerListener
+void SAL_CALL ConfigurationAccess_ControllerFactory::elementInserted( const ContainerEvent& aEvent ) throw(RuntimeException)
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_ControllerFactory::elementInserted" );
+ rtl::OUString aCommand;
+ rtl::OUString aModule;
+ rtl::OUString aService;
+ rtl::OUString aValue;
+
+ // SAFE
+ ResetableGuard aLock( m_aLock );
+
+ if ( impl_getElementProps( aEvent.Element, aCommand, aModule, aService, aValue ))
+ {
+ // Create hash key from command and module as they are together a primary key to
+ // the UNO service that implements the popup menu controller.
+ rtl::OUString aHashKey( getHashKeyFromStrings( aCommand, aModule ));
+ ControllerInfo& rControllerInfo = m_aMenuControllerMap[ aHashKey ];
+ rControllerInfo.m_aImplementationName = aService;
+ rControllerInfo.m_aValue = aValue;
+ }
+}
+
+void SAL_CALL ConfigurationAccess_ControllerFactory::elementRemoved ( const ContainerEvent& aEvent ) throw(RuntimeException)
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_ControllerFactory::elementRemoved" );
+ rtl::OUString aCommand;
+ rtl::OUString aModule;
+ rtl::OUString aService;
+ rtl::OUString aValue;
+
+ // SAFE
+ ResetableGuard aLock( m_aLock );
+
+ if ( impl_getElementProps( aEvent.Element, aCommand, aModule, aService, aValue ))
+ {
+ // Create hash key from command and module as they are together a primary key to
+ // the UNO service that implements the popup menu controller.
+ rtl::OUString aHashKey( getHashKeyFromStrings( aCommand, aModule ));
+ m_aMenuControllerMap.erase( aHashKey );
+ }
+}
+
+void SAL_CALL ConfigurationAccess_ControllerFactory::elementReplaced( const ContainerEvent& aEvent ) throw(RuntimeException)
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_ControllerFactory::elementReplaced" );
+ elementInserted(aEvent);
+}
+
+// lang.XEventListener
+void SAL_CALL ConfigurationAccess_ControllerFactory::disposing( const EventObject& ) throw(RuntimeException)
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_ControllerFactory::disposing" );
+ // SAFE
+ // remove our reference to the config access
+ ResetableGuard aLock( m_aLock );
+ m_xConfigAccess.clear();
+}
+
+void ConfigurationAccess_ControllerFactory::readConfigurationData()
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_ControllerFactory::readConfigurationData" );
+ // SAFE
+ ResetableGuard aLock( m_aLock );
+
+ if ( !m_bConfigAccessInitialized )
+ {
+ Sequence< Any > aArgs( 1 );
+ PropertyValue aPropValue;
+
+ aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ));
+ aPropValue.Value <<= m_sRoot;
+ aArgs[0] <<= aPropValue;
+
+ try
+ {
+ m_xConfigAccess = Reference< XNameAccess >( m_xConfigProvider->createInstanceWithArguments(SERVICENAME_CFGREADACCESS,aArgs ), UNO_QUERY );
+ }
+ catch ( WrappedTargetException& )
+ {
+ }
+
+ m_bConfigAccessInitialized = sal_True;
+ }
+
+ if ( m_xConfigAccess.is() )
+ {
+ // Read and update configuration data
+ updateConfigurationData();
+
+ uno::Reference< container::XContainer > xContainer( m_xConfigAccess, uno::UNO_QUERY );
+ // UNSAFE
+ aLock.unlock();
+
+ if ( xContainer.is() )
+ xContainer->addContainerListener( this );
+ }
+}
+
+void ConfigurationAccess_ControllerFactory::updateConfigurationData()
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_ControllerFactory::updateConfigurationData" );
+ // SAFE
+ ResetableGuard aLock( m_aLock );
+ if ( m_xConfigAccess.is() )
+ {
+ Sequence< rtl::OUString > aPopupMenuControllers = m_xConfigAccess->getElementNames();
+
+ rtl::OUString aCommand;
+ rtl::OUString aModule;
+ rtl::OUString aService;
+ rtl::OUString aHashKey;
+ rtl::OUString aValue;
+
+ m_aMenuControllerMap.clear();
+ for ( sal_Int32 i = 0; i < aPopupMenuControllers.getLength(); i++ )
+ {
+ try
+ {
+ if ( impl_getElementProps( m_xConfigAccess->getByName( aPopupMenuControllers[i] ), aCommand, aModule, aService,aValue ))
+ {
+ // Create hash key from command and module as they are together a primary key to
+ // the UNO service that implements the popup menu controller.
+ aHashKey = getHashKeyFromStrings( aCommand, aModule );
+ m_aMenuControllerMap.insert( MenuControllerMap::value_type( aHashKey, ControllerInfo(aService,aValue) ));
+ }
+ }
+ catch ( NoSuchElementException& )
+ {
+ }
+ catch ( WrappedTargetException& )
+ {
+ }
+ }
+ }
+}
+
+sal_Bool ConfigurationAccess_ControllerFactory::impl_getElementProps( const Any& aElement, rtl::OUString& aCommand, rtl::OUString& aModule, rtl::OUString& aServiceSpecifier,rtl::OUString& aValue ) const
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ConfigurationAccess_ControllerFactory::impl_getElementProps" );
+ Reference< XPropertySet > xPropertySet;
+ aElement >>= xPropertySet;
+
+ if ( xPropertySet.is() )
+ {
+ try
+ {
+ xPropertySet->getPropertyValue( m_aPropCommand ) >>= aCommand;
+ xPropertySet->getPropertyValue( m_aPropModule ) >>= aModule;
+ xPropertySet->getPropertyValue( m_aPropController ) >>= aServiceSpecifier;
+ if ( m_bAskValue )
+ xPropertySet->getPropertyValue( m_aPropValue ) >>= aValue;
+ }
+ catch ( com::sun::star::beans::UnknownPropertyException& )
+ {
+ return sal_False;
+ }
+ catch ( com::sun::star::lang::WrappedTargetException& )
+ {
+ return sal_False;
+ }
+ }
+
+ return sal_True;
+}
+} // namespace framework
diff --git a/framework/source/uifactory/makefile.mk b/framework/source/uifactory/makefile.mk
index a70beb52f388..d5805faba8f2 100644
--- a/framework/source/uifactory/makefile.mk
+++ b/framework/source/uifactory/makefile.mk
@@ -49,6 +49,7 @@ SLOFILES= \
$(SLO)$/toolbarcontrollerfactory.obj \
$(SLO)$/statusbarfactory.obj \
$(SLO)$/statusbarcontrollerfactory.obj \
+ $(SLO)$/factoryconfiguration.obj \
$(SLO)$/windowcontentfactorymanager.obj
# --- Targets ------------------------------------------------------
diff --git a/framework/source/uifactory/menubarfactory.cxx b/framework/source/uifactory/menubarfactory.cxx
index cc538e646ac3..66d7a9af1dc5 100644
--- a/framework/source/uifactory/menubarfactory.cxx
+++ b/framework/source/uifactory/menubarfactory.cxx
@@ -62,6 +62,7 @@
#include <vcl/svapp.hxx>
#include <tools/urlobj.hxx>
#include <rtl/ustrbuf.hxx>
+#include <rtl/logfile.hxx>
//_________________________________________________________________________________________________________________
// Defines
@@ -81,19 +82,6 @@ namespace framework
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( MenuBarFactory ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XServiceInfo ),
- DIRECT_INTERFACE( ::com::sun::star::ui::XUIElementFactory )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( MenuBarFactory ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- ::com::sun::star::ui::XUIElementFactory
- )
-
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( MenuBarFactory ,
::cppu::OWeakObject ,
SERVICENAME_MENUBARFACTORY ,
@@ -108,6 +96,12 @@ MenuBarFactory::MenuBarFactory( const ::com::sun::star::uno::Reference< ::com::s
, m_xModuleManager( xServiceManager->createInstance( SERVICENAME_MODULEMANAGER ), UNO_QUERY )
{
}
+MenuBarFactory::MenuBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager,bool ) :
+ ThreadHelpBase(&Application::GetSolarMutex())
+ , m_xServiceManager( xServiceManager )
+ , m_xModuleManager( xServiceManager->createInstance( SERVICENAME_MODULEMANAGER ), UNO_QUERY )
+{
+}
MenuBarFactory::~MenuBarFactory()
{
@@ -121,12 +115,27 @@ throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::l
{
// SAFE
ResetableGuard aLock( m_aLock );
-
+ MenuBarWrapper* pMenuBarWrapper = new MenuBarWrapper( m_xServiceManager );
+ Reference< ::com::sun::star::ui::XUIElement > xMenuBar( (OWeakObject *)pMenuBarWrapper, UNO_QUERY );
+ Reference< ::com::sun::star::frame::XModuleManager > xModuleManager = m_xModuleManager;
+ aLock.unlock();
+ CreateUIElement(ResourceURL,Args,"MenuOnly","private:resource/menubar/",xMenuBar,xModuleManager,m_xServiceManager);
+ return xMenuBar;
+}
+void MenuBarFactory::CreateUIElement(const ::rtl::OUString& ResourceURL
+ , const Sequence< PropertyValue >& Args
+ ,const char* _pExtraMode
+ ,const char* _pAsciiName
+ ,const Reference< ::com::sun::star::ui::XUIElement >& _xMenuBar
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager >& _xModuleManager
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xServiceManager)
+{
+ Reference< XUIConfigurationManager > xCfgMgr;
Reference< XUIConfigurationManager > xConfigSource;
Reference< XFrame > xFrame;
rtl::OUString aResourceURL( ResourceURL );
sal_Bool bPersistent( sal_True );
- sal_Bool bMenuOnly( sal_False );
+ sal_Bool bExtraMode( sal_False );
for ( sal_Int32 n = 0; n < Args.getLength(); n++ )
{
@@ -138,51 +147,47 @@ throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::l
Args[n].Value >>= aResourceURL;
else if ( Args[n].Name.equalsAscii( "Persistent" ))
Args[n].Value >>= bPersistent;
- else if ( Args[n].Name.equalsAscii( "MenuOnly" ))
- Args[n].Value >>= bMenuOnly;
- }
-
- Reference< XUIConfigurationManager > xCfgMgr;
- if ( aResourceURL.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:resource/menubar/" ))) != 0 )
+ else if ( _pExtraMode && Args[n].Name.equalsAscii( _pExtraMode ))
+ Args[n].Value >>= bExtraMode;
+ } // for ( sal_Int32 n = 0; n < Args.getLength(); n++ )
+ if ( aResourceURL.indexOf( rtl::OUString::createFromAscii(_pAsciiName)) != 0 )
throw IllegalArgumentException();
- else
+
+ // Identify frame and determine document based ui configuration manager/module ui configuration manager
+ if ( xFrame.is() && !xConfigSource.is() )
{
- // Identify frame and determine document based ui configuration manager/module ui configuration manager
- if ( xFrame.is() && !xConfigSource.is() )
- {
- bool bHasSettings( false );
- Reference< XModel > xModel;
+ bool bHasSettings( false );
+ Reference< XModel > xModel;
- Reference< XController > xController = xFrame->getController();
- if ( xController.is() )
- xModel = xController->getModel();
+ Reference< XController > xController = xFrame->getController();
+ if ( xController.is() )
+ xModel = xController->getModel();
- if ( xModel.is() )
+ if ( xModel.is() )
+ {
+ Reference< XUIConfigurationManagerSupplier > xUIConfigurationManagerSupplier( xModel, UNO_QUERY );
+ if ( xUIConfigurationManagerSupplier.is() )
{
- Reference< XUIConfigurationManagerSupplier > xUIConfigurationManagerSupplier( xModel, UNO_QUERY );
- if ( xUIConfigurationManagerSupplier.is() )
- {
- xCfgMgr = xUIConfigurationManagerSupplier->getUIConfigurationManager();
- bHasSettings = xCfgMgr->hasSettings( aResourceURL );
- }
+ xCfgMgr = xUIConfigurationManagerSupplier->getUIConfigurationManager();
+ bHasSettings = xCfgMgr->hasSettings( aResourceURL );
}
+ }
- if ( !bHasSettings )
+ if ( !bHasSettings )
+ {
+ rtl::OUString aModuleIdentifier = _xModuleManager->identify( Reference< XInterface >( xFrame, UNO_QUERY ));
+ if ( aModuleIdentifier.getLength() )
{
- rtl::OUString aModuleIdentifier = m_xModuleManager->identify( Reference< XInterface >( xFrame, UNO_QUERY ));
- if ( aModuleIdentifier.getLength() )
- {
- Reference< ::com::sun::star::ui::XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier(
- m_xServiceManager->createInstance( SERVICENAME_MODULEUICONFIGURATIONMANAGERSUPPLIER ), UNO_QUERY );
- xCfgMgr = xModuleCfgSupplier->getUIConfigurationManager( aModuleIdentifier );
- bHasSettings = xCfgMgr->hasSettings( aResourceURL );
- }
+ Reference< ::com::sun::star::ui::XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier(
+ _xServiceManager->createInstance( SERVICENAME_MODULEUICONFIGURATIONMANAGERSUPPLIER ), UNO_QUERY );
+ xCfgMgr = xModuleCfgSupplier->getUIConfigurationManager( aModuleIdentifier );
+ bHasSettings = xCfgMgr->hasSettings( aResourceURL );
}
}
}
PropertyValue aPropValue;
- Sequence< Any > aPropSeq( 5 );
+ Sequence< Any > aPropSeq( _pExtraMode ? 5 : 4);
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Frame" ));
aPropValue.Value <<= xFrame;
aPropSeq[0] <<= aPropValue;
@@ -195,16 +200,16 @@ throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::l
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Persistent" ));
aPropValue.Value <<= bPersistent;
aPropSeq[3] <<= aPropValue;
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MenuOnly" ));
- aPropValue.Value <<= bMenuOnly;
- aPropSeq[4] <<= aPropValue;
+ if ( _pExtraMode )
+ {
+ aPropValue.Name = rtl::OUString::createFromAscii(_pExtraMode);
+ aPropValue.Value <<= bExtraMode;
+ aPropSeq[4] <<= aPropValue;
+ }
vos::OGuard aGuard( Application::GetSolarMutex() );
- MenuBarWrapper* pMenuBarWrapper = new MenuBarWrapper( m_xServiceManager );
- Reference< ::com::sun::star::ui::XUIElement > xMenuBar( (OWeakObject *)pMenuBarWrapper, UNO_QUERY );
- Reference< XInitialization > xInit( xMenuBar, UNO_QUERY );
+ Reference< XInitialization > xInit( _xMenuBar, UNO_QUERY );
xInit->initialize( aPropSeq );
- return xMenuBar;
}
} // namespace framework
diff --git a/framework/source/uifactory/popupmenucontrollerfactory.cxx b/framework/source/uifactory/popupmenucontrollerfactory.cxx
index b5f6520cde76..eda40528a010 100644
--- a/framework/source/uifactory/popupmenucontrollerfactory.cxx
+++ b/framework/source/uifactory/popupmenucontrollerfactory.cxx
@@ -37,6 +37,7 @@
#include "uifactory/popupmenucontrollerfactory.hxx"
#include <threadhelp/resetableguard.hxx>
#include "services.h"
+#include "uifactory/factoryconfiguration.hxx"
//_________________________________________________________________________________________________________________
// interface includes
@@ -52,6 +53,7 @@
//_________________________________________________________________________________________________________________
#include <rtl/ustrbuf.hxx>
#include <cppuhelper/weak.hxx>
+#include <rtl/logfile.hxx>
//_________________________________________________________________________________________________________________
// Defines
@@ -72,304 +74,9 @@ using namespace ::com::sun::star::frame;
namespace framework
{
-// global function needed by both implementations
-rtl::OUString getHashKeyFromStrings( const rtl::OUString& aCommandURL, const rtl::OUString& aModuleName )
-{
- rtl::OUStringBuffer aKey( aCommandURL );
- aKey.appendAscii( "-" );
- aKey.append( aModuleName );
- return aKey.makeStringAndClear();
-}
-
-
-//*****************************************************************************************************************
-// Configuration access class for PopupMenuControllerFactory implementation
-//*****************************************************************************************************************
-
-class ConfigurationAccess_PopupMenuControllerFactory : // interfaces
- public XTypeProvider ,
- public XContainerListener ,
- // baseclasses
- // Order is neccessary for right initialization!
- private ThreadHelpBase ,
- public ::cppu::OWeakObject
-{
- public:
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
-
- ConfigurationAccess_PopupMenuControllerFactory( Reference< XMultiServiceFactory >& rServiceManager );
- virtual ~ConfigurationAccess_PopupMenuControllerFactory();
-
- void readConfigurationData();
- void updateConfigurationData();
-
- rtl::OUString getServiceFromCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule ) const;
- void addServiceToCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule, const rtl::OUString& rServiceSpecifier );
- void removeServiceFromCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule );
-
- // container.XContainerListener
- virtual void SAL_CALL elementInserted( const ContainerEvent& aEvent ) throw(RuntimeException);
- virtual void SAL_CALL elementRemoved ( const ContainerEvent& aEvent ) throw(RuntimeException);
- virtual void SAL_CALL elementReplaced( const ContainerEvent& aEvent ) throw(RuntimeException);
-
- // lang.XEventListener
- virtual void SAL_CALL disposing( const EventObject& aEvent ) throw(RuntimeException);
-
- private:
- class PopupMenuControllerMap : public std::hash_map< rtl::OUString,
- rtl::OUString,
- OUStringHashCode,
- ::std::equal_to< ::rtl::OUString > >
- {
- inline void free()
- {
- PopupMenuControllerMap().swap( *this );
- }
- };
-
- sal_Bool impl_getElementProps( const Any& aElement, rtl::OUString& aCommand, rtl::OUString& aModule, rtl::OUString& aServiceSpecifier ) const;
-
- rtl::OUString m_aPropCommand;
- rtl::OUString m_aPropModule;
- rtl::OUString m_aPropController;
- PopupMenuControllerMap m_aPopupMenuControllerMap;
- Reference< XMultiServiceFactory > m_xServiceManager;
- Reference< XMultiServiceFactory > m_xConfigProvider;
- Reference< XNameAccess > m_xConfigAccess;
- sal_Bool m_bConfigAccessInitialized;
-};
-
-//*****************************************************************************************************************
-// XInterface, XTypeProvider
-//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( ConfigurationAccess_PopupMenuControllerFactory ,
- OWeakObject ,
- DIRECT_INTERFACE ( XTypeProvider ),
- DIRECT_INTERFACE ( XContainerListener ),
- DERIVED_INTERFACE( css::lang::XEventListener, XContainerListener )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( ConfigurationAccess_PopupMenuControllerFactory ,
- XTypeProvider ,
- XContainerListener ,
- css::lang::XEventListener
- )
-
-ConfigurationAccess_PopupMenuControllerFactory::ConfigurationAccess_PopupMenuControllerFactory( Reference< XMultiServiceFactory >& rServiceManager ) :
- ThreadHelpBase(),
- m_aPropCommand( RTL_CONSTASCII_USTRINGPARAM( "Command" )),
- m_aPropModule( RTL_CONSTASCII_USTRINGPARAM( "Module" )),
- m_aPropController( RTL_CONSTASCII_USTRINGPARAM( "Controller" )),
- m_xServiceManager( rServiceManager ),
- m_bConfigAccessInitialized( sal_False )
-{
- m_xConfigProvider = Reference< XMultiServiceFactory >( rServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationProvider" ))),
- UNO_QUERY );
-}
-
-ConfigurationAccess_PopupMenuControllerFactory::~ConfigurationAccess_PopupMenuControllerFactory()
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- Reference< XContainer > xContainer( m_xConfigAccess, UNO_QUERY );
- if ( xContainer.is() )
- xContainer->removeContainerListener( this );
-}
-
-rtl::OUString ConfigurationAccess_PopupMenuControllerFactory::getServiceFromCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule ) const
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- PopupMenuControllerMap::const_iterator pIter =
- m_aPopupMenuControllerMap.find( getHashKeyFromStrings( rCommandURL, rModule ));
-
- if ( pIter != m_aPopupMenuControllerMap.end() )
- return pIter->second;
- else
- {
- // Try to detect if we have a generic popup menu controller
- pIter = m_aPopupMenuControllerMap.find( getHashKeyFromStrings( rCommandURL, rtl::OUString() ));
-
- if ( pIter != m_aPopupMenuControllerMap.end() )
- return pIter->second;
- }
-
- return rtl::OUString();
-}
-
-void ConfigurationAccess_PopupMenuControllerFactory::addServiceToCommandModule(
- const rtl::OUString& rCommandURL,
- const rtl::OUString& rModule,
- const rtl::OUString& rServiceSpecifier )
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- rtl::OUString aHashKey = getHashKeyFromStrings( rCommandURL, rModule );
- m_aPopupMenuControllerMap.insert( PopupMenuControllerMap::value_type( aHashKey, rServiceSpecifier ));
-}
-
-void ConfigurationAccess_PopupMenuControllerFactory::removeServiceFromCommandModule(
- const rtl::OUString& rCommandURL,
- const rtl::OUString& rModule )
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- rtl::OUString aHashKey = getHashKeyFromStrings( rCommandURL, rModule );
- m_aPopupMenuControllerMap.erase( aHashKey );
-}
-
-// container.XContainerListener
-void SAL_CALL ConfigurationAccess_PopupMenuControllerFactory::elementInserted( const ContainerEvent& /*aEvent*/ ) throw(RuntimeException)
-{
- updateConfigurationData();
-}
-
-void SAL_CALL ConfigurationAccess_PopupMenuControllerFactory::elementRemoved ( const ContainerEvent& /*aEvent*/ ) throw(RuntimeException)
-{
- updateConfigurationData();
-}
-
-void SAL_CALL ConfigurationAccess_PopupMenuControllerFactory::elementReplaced( const ContainerEvent& /*aEvent*/ ) throw(RuntimeException)
-{
- updateConfigurationData();
-}
-
-// lang.XEventListener
-void SAL_CALL ConfigurationAccess_PopupMenuControllerFactory::disposing( const EventObject& ) throw(RuntimeException)
-{
- // SAFE
- // remove our reference to the config access
- ResetableGuard aLock( m_aLock );
- m_xConfigAccess.clear();
-}
-
-void ConfigurationAccess_PopupMenuControllerFactory::readConfigurationData()
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- if ( !m_bConfigAccessInitialized )
- {
- Sequence< Any > aArgs( 1 );
- PropertyValue aPropValue;
-
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ));
- aPropValue.Value <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.UI.Controller/Registered/PopupMenu" ));
- aArgs[0] <<= aPropValue;
-
- try
- {
- m_xConfigAccess = Reference< XNameAccess >( m_xConfigProvider->createInstanceWithArguments(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationAccess" )),
- aArgs ),
- UNO_QUERY );
- }
- catch ( WrappedTargetException& )
- {
- }
-
- m_bConfigAccessInitialized = sal_True;
- }
-
- if ( m_xConfigAccess.is() )
- {
- // Read and update configuration data
- updateConfigurationData();
-
- Reference< XContainer > xContainer( m_xConfigAccess, UNO_QUERY );
- if ( xContainer.is() )
- xContainer->addContainerListener( this );
- }
-}
-
-void ConfigurationAccess_PopupMenuControllerFactory::updateConfigurationData()
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
- if ( m_xConfigAccess.is() )
- {
- Sequence< rtl::OUString > aPopupMenuControllers = m_xConfigAccess->getElementNames();
-
- rtl::OUString aCommand;
- rtl::OUString aModule;
- rtl::OUString aService;
- rtl::OUString aHashKey;
-
- m_aPopupMenuControllerMap.clear();
- for ( sal_Int32 i = 0; i < aPopupMenuControllers.getLength(); i++ )
- {
- try
- {
- if ( impl_getElementProps( m_xConfigAccess->getByName( aPopupMenuControllers[i] ), aCommand, aModule, aService ))
- {
- // Create hash key from command and module as they are together a primary key to
- // the UNO service that implements the popup menu controller.
- aHashKey = getHashKeyFromStrings( aCommand, aModule );
- m_aPopupMenuControllerMap.insert( PopupMenuControllerMap::value_type( aHashKey, aService ));
- }
- }
- catch ( NoSuchElementException& )
- {
- }
- catch ( WrappedTargetException& )
- {
- }
- }
- }
-}
-
-sal_Bool ConfigurationAccess_PopupMenuControllerFactory::impl_getElementProps( const Any& aElement, rtl::OUString& aCommand, rtl::OUString& aModule, rtl::OUString& aServiceSpecifier ) const
-{
- Reference< XPropertySet > xPropertySet;
- aElement >>= xPropertySet;
-
- if ( xPropertySet.is() )
- {
- try
- {
- xPropertySet->getPropertyValue( m_aPropCommand ) >>= aCommand;
- xPropertySet->getPropertyValue( m_aPropModule ) >>= aModule;
- xPropertySet->getPropertyValue( m_aPropController ) >>= aServiceSpecifier;
- }
- catch ( com::sun::star::beans::UnknownPropertyException& )
- {
- return sal_False;
- }
- catch ( com::sun::star::lang::WrappedTargetException& )
- {
- return sal_False;
- }
- }
-
- return sal_True;
-}
-
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_4 ( PopupMenuControllerFactory ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XServiceInfo ),
- DIRECT_INTERFACE( css::lang::XMultiComponentFactory ),
- DIRECT_INTERFACE( ::com::sun::star::frame::XUIControllerRegistration )
- )
-
-DEFINE_XTYPEPROVIDER_4 ( PopupMenuControllerFactory ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- css::lang::XMultiComponentFactory ,
- ::com::sun::star::frame::XUIControllerRegistration
- )
-
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( PopupMenuControllerFactory ,
::cppu::OWeakObject ,
SERVICENAME_POPUPMENUCONTROLLERFACTORY ,
@@ -379,155 +86,11 @@ DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( PopupMenuControllerFactory
DEFINE_INIT_SERVICE ( PopupMenuControllerFactory, {} )
PopupMenuControllerFactory::PopupMenuControllerFactory( const Reference< XMultiServiceFactory >& xServiceManager ) :
- ThreadHelpBase(),
- m_bConfigRead( sal_False ),
- m_xServiceManager( xServiceManager )
+ ToolbarControllerFactory(xServiceManager,true)
{
- m_pConfigAccess = new ConfigurationAccess_PopupMenuControllerFactory( m_xServiceManager );
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PopupMenuControllerFactory::PopupMenuControllerFactory" );
+ m_pConfigAccess = new ConfigurationAccess_ControllerFactory( m_xServiceManager,rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.UI.Controller/Registered/PopupMenu" )) );
m_pConfigAccess->acquire();
}
-PopupMenuControllerFactory::~PopupMenuControllerFactory()
-{
- ResetableGuard aLock( m_aLock );
-
- // reduce reference count
- m_pConfigAccess->release();
-}
-
-// XMultiComponentFactory
-Reference< XInterface > SAL_CALL PopupMenuControllerFactory::createInstanceWithContext(
- const ::rtl::OUString& aServiceSpecifier,
- const Reference< XComponentContext >& )
-throw (Exception, RuntimeException)
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- if ( !m_bConfigRead )
- {
- m_bConfigRead = sal_True;
- m_pConfigAccess->readConfigurationData();
- }
-
- rtl::OUString aServiceName = m_pConfigAccess->getServiceFromCommandModule( aServiceSpecifier, rtl::OUString() );
- if ( aServiceName.getLength() > 0 )
- return m_xServiceManager->createInstance( aServiceName );
- else
- return Reference< XInterface >();
- // SAFE
-}
-
-Reference< XInterface > SAL_CALL PopupMenuControllerFactory::createInstanceWithArgumentsAndContext(
- const ::rtl::OUString& ServiceSpecifier,
- const Sequence< Any >& Arguments,
- const Reference< XComponentContext >& )
-throw (Exception, RuntimeException)
-{
- const rtl::OUString aPropModuleName( RTL_CONSTASCII_USTRINGPARAM( "ModuleName" ));
-
- rtl::OUString aPropName;
- PropertyValue aPropValue;
-
- // Retrieve the optional module name form the Arguments sequence. It is used as a part of
- // the hash map key to support different controller implementation for the same URL but different
- // module!!
- for ( int i = 0; i < Arguments.getLength(); i++ )
- {
- if (( Arguments[i] >>= aPropValue ) && ( aPropValue.Name.equals( aPropModuleName )))
- {
- aPropValue.Value >>= aPropName;
- break;
- }
- }
-
- // Append the command URL to the Arguments sequence so that one controller can be
- // used for more than one command URL.
- Sequence< Any > aNewArgs( Arguments );
-
- sal_Int32 nAppendIndex = aNewArgs.getLength();
- aNewArgs.realloc( aNewArgs.getLength()+1 );
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CommandURL" ));
- aPropValue.Value <<= ServiceSpecifier;
- aNewArgs[nAppendIndex] <<= aPropValue;
-
- // SAFE
- {
- ResetableGuard aLock( m_aLock );
-
- if ( !m_bConfigRead )
- {
- m_bConfigRead = sal_True;
- m_pConfigAccess->readConfigurationData();
- }
-
- rtl::OUString aServiceName = m_pConfigAccess->getServiceFromCommandModule( ServiceSpecifier, aPropName );
- if ( aServiceName.getLength() > 0 )
- return m_xServiceManager->createInstanceWithArguments( aServiceName, aNewArgs );
- else
- return Reference< XInterface >();
- }
- // SAFE
-}
-
-Sequence< ::rtl::OUString > SAL_CALL PopupMenuControllerFactory::getAvailableServiceNames()
-throw (RuntimeException)
-{
- return Sequence< ::rtl::OUString >();
-}
-
-// XUIControllerRegistration
-sal_Bool SAL_CALL PopupMenuControllerFactory::hasController(
- const ::rtl::OUString& aCommandURL,
- const rtl::OUString& aModuleName )
-throw (::com::sun::star::uno::RuntimeException)
-{
- ResetableGuard aLock( m_aLock );
-
- if ( !m_bConfigRead )
- {
- m_bConfigRead = sal_True;
- m_pConfigAccess->readConfigurationData();
- }
-
- return ( m_pConfigAccess->getServiceFromCommandModule( aCommandURL, aModuleName ).getLength() > 0 );
-}
-
-void SAL_CALL PopupMenuControllerFactory::registerController(
- const ::rtl::OUString& aCommandURL,
- const ::rtl::OUString& aModuleName,
- const ::rtl::OUString& aControllerImplementationName )
-throw (RuntimeException)
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- if ( !m_bConfigRead )
- {
- m_bConfigRead = sal_True;
- m_pConfigAccess->readConfigurationData();
- }
-
- m_pConfigAccess->addServiceToCommandModule( aCommandURL, aModuleName, aControllerImplementationName );
- // SAFE
-}
-
-void SAL_CALL PopupMenuControllerFactory::deregisterController(
- const ::rtl::OUString& aCommandURL,
- const rtl::OUString& aModuleName )
-throw (RuntimeException)
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- if ( !m_bConfigRead )
- {
- m_bConfigRead = sal_True;
- m_pConfigAccess->readConfigurationData();
- }
-
- m_pConfigAccess->removeServiceFromCommandModule( aCommandURL, aModuleName );
- // SAFE
-}
-
} // namespace framework
diff --git a/framework/source/uifactory/statusbarcontrollerfactory.cxx b/framework/source/uifactory/statusbarcontrollerfactory.cxx
index be1944845a1e..7ebb032f593b 100644
--- a/framework/source/uifactory/statusbarcontrollerfactory.cxx
+++ b/framework/source/uifactory/statusbarcontrollerfactory.cxx
@@ -35,6 +35,7 @@
// my own includes
//_________________________________________________________________________________________________________________
#include "uifactory/statusbarcontrollerfactory.hxx"
+#include "uifactory/factoryconfiguration.hxx"
#include <threadhelp/resetableguard.hxx>
#include "services.h"
@@ -71,380 +72,9 @@ using namespace ::com::sun::star::frame;
namespace framework
{
-
-// global function needed by both implementations
-static rtl::OUString getHashKeyFromStrings( const rtl::OUString& aCommandURL, const rtl::OUString& aModuleName )
-{
- rtl::OUStringBuffer aKey( aCommandURL );
- aKey.appendAscii( "-" );
- aKey.append( aModuleName );
- return aKey.makeStringAndClear();
-}
-
-
-//*****************************************************************************************************************
-// Configuration access class for StatusbarControllerFactory implementation
-//*****************************************************************************************************************
-
-class ConfigurationAccess_StatusbarControllerFactory : // interfaces
- public XTypeProvider ,
- public XContainerListener ,
- // baseclasses
- // Order is neccessary for right initialization!
- private ThreadHelpBase ,
- public ::cppu::OWeakObject
-{
- public:
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
-
- ConfigurationAccess_StatusbarControllerFactory( Reference< XMultiServiceFactory >& rServiceManager );
- virtual ~ConfigurationAccess_StatusbarControllerFactory();
-
- void readConfigurationData();
-
- rtl::OUString getServiceFromCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule ) const;
- rtl::OUString getValueFromCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule ) const;
- void addServiceToCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule, const rtl::OUString& rServiceSpecifier );
- void removeServiceFromCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule );
-
- // container.XContainerListener
- virtual void SAL_CALL elementInserted( const ContainerEvent& aEvent ) throw(RuntimeException);
- virtual void SAL_CALL elementRemoved ( const ContainerEvent& aEvent ) throw(RuntimeException);
- virtual void SAL_CALL elementReplaced( const ContainerEvent& aEvent ) throw(RuntimeException);
-
- // lang.XEventListener
- virtual void SAL_CALL disposing( const EventObject& aEvent ) throw(RuntimeException);
-
- private:
- struct StatusbarControllerInfo
- {
- rtl::OUString m_aImplementationName;
- rtl::OUString m_aValue;
- };
-
- class StatusbarControllerMap : public std::hash_map< rtl::OUString,
- StatusbarControllerInfo,
- OUStringHashCode,
- ::std::equal_to< ::rtl::OUString > >
- {
- inline void free()
- {
- StatusbarControllerMap().swap( *this );
- }
- };
-
- sal_Bool impl_getElementProps( const Any& aElement,
- rtl::OUString& aCommand,
- rtl::OUString& aModule,
- rtl::OUString& aServiceSpecifier,
- rtl::OUString& aValue ) const;
-
- rtl::OUString m_aPropCommand;
- rtl::OUString m_aPropModule;
- rtl::OUString m_aPropController;
- rtl::OUString m_aPropValue;
- StatusbarControllerMap m_aStatusbarControllerMap;
- Reference< XMultiServiceFactory > m_xServiceManager;
- Reference< XMultiServiceFactory > m_xConfigProvider;
- Reference< XNameAccess > m_xConfigAccess;
- sal_Bool m_bConfigAccessInitialized;
-};
-
-//*****************************************************************************************************************
-// XInterface, XTypeProvider
-//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( ConfigurationAccess_StatusbarControllerFactory ,
- OWeakObject ,
- DIRECT_INTERFACE ( XTypeProvider ),
- DIRECT_INTERFACE ( XContainerListener ),
- DERIVED_INTERFACE( css::lang::XEventListener, XContainerListener )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( ConfigurationAccess_StatusbarControllerFactory ,
- XTypeProvider ,
- XContainerListener ,
- css::lang::XEventListener
- )
-
-ConfigurationAccess_StatusbarControllerFactory::ConfigurationAccess_StatusbarControllerFactory( Reference< XMultiServiceFactory >& rServiceManager ) :
- ThreadHelpBase(),
- m_aPropCommand( RTL_CONSTASCII_USTRINGPARAM( "Command" )),
- m_aPropModule( RTL_CONSTASCII_USTRINGPARAM( "Module" )),
- m_aPropController( RTL_CONSTASCII_USTRINGPARAM( "Controller" )),
- m_aPropValue( RTL_CONSTASCII_USTRINGPARAM( "Value" )),
- m_xServiceManager( rServiceManager ),
- m_bConfigAccessInitialized( sal_False )
-{
- m_xConfigProvider = Reference< XMultiServiceFactory >( rServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationProvider" ))),
- UNO_QUERY );
-}
-
-ConfigurationAccess_StatusbarControllerFactory::~ConfigurationAccess_StatusbarControllerFactory()
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- Reference< XContainer > xContainer( m_xConfigAccess, UNO_QUERY );
- if ( xContainer.is() )
- xContainer->removeContainerListener( this );
-}
-
-rtl::OUString ConfigurationAccess_StatusbarControllerFactory::getServiceFromCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule ) const
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- StatusbarControllerMap::const_iterator pIter =
- m_aStatusbarControllerMap.find( getHashKeyFromStrings( rCommandURL, rModule ));
-
- if ( pIter != m_aStatusbarControllerMap.end() )
- return pIter->second.m_aImplementationName;
- else
- {
- // Try to detect if we have a generic controller
- pIter = m_aStatusbarControllerMap.find( getHashKeyFromStrings( rCommandURL, rtl::OUString() ));
-
- if ( pIter != m_aStatusbarControllerMap.end() )
- return pIter->second.m_aImplementationName;
- }
-
- return rtl::OUString();
-}
-
-rtl::OUString ConfigurationAccess_StatusbarControllerFactory::getValueFromCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule ) const
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- StatusbarControllerMap::const_iterator pIter =
- m_aStatusbarControllerMap.find( getHashKeyFromStrings( rCommandURL, rModule ));
-
- if ( pIter != m_aStatusbarControllerMap.end() )
- return pIter->second.m_aValue;
- else
- {
- // Try to detect if we have a generic popup menu controller
- pIter = m_aStatusbarControllerMap.find( getHashKeyFromStrings( rCommandURL, rtl::OUString() ));
-
- if ( pIter != m_aStatusbarControllerMap.end() )
- return pIter->second.m_aValue;
- }
-
- return rtl::OUString();
-}
-
-void ConfigurationAccess_StatusbarControllerFactory::addServiceToCommandModule(
- const rtl::OUString& rCommandURL,
- const rtl::OUString& rModule,
- const rtl::OUString& rServiceSpecifier )
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- rtl::OUString aHashKey = getHashKeyFromStrings( rCommandURL, rModule );
-
- StatusbarControllerInfo& rControllerInfo = m_aStatusbarControllerMap[ aHashKey ];
- rControllerInfo.m_aImplementationName = rServiceSpecifier;
- rControllerInfo.m_aValue = rtl::OUString();
-}
-
-void ConfigurationAccess_StatusbarControllerFactory::removeServiceFromCommandModule(
- const rtl::OUString& rCommandURL,
- const rtl::OUString& rModule )
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- rtl::OUString aHashKey = getHashKeyFromStrings( rCommandURL, rModule );
- m_aStatusbarControllerMap.erase( aHashKey );
-}
-
-// container.XContainerListener
-void SAL_CALL ConfigurationAccess_StatusbarControllerFactory::elementInserted( const ContainerEvent& aEvent ) throw(RuntimeException)
-{
- rtl::OUString aCommand;
- rtl::OUString aModule;
- rtl::OUString aService;
- rtl::OUString aValue;
-
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- if ( impl_getElementProps( aEvent.Element, aCommand, aModule, aService, aValue ))
- {
- // Create hash key from command and module as they are together a primary key to
- // the UNO service that implements the popup menu controller.
- rtl::OUString aHashKey( getHashKeyFromStrings( aCommand, aModule ));
- StatusbarControllerInfo& rControllerInfo = m_aStatusbarControllerMap[ aHashKey ];
- rControllerInfo.m_aImplementationName = aService;
- rControllerInfo.m_aValue = aValue;
- }
-}
-
-void SAL_CALL ConfigurationAccess_StatusbarControllerFactory::elementRemoved ( const ContainerEvent& aEvent ) throw(RuntimeException)
-{
- rtl::OUString aCommand;
- rtl::OUString aModule;
- rtl::OUString aService;
- rtl::OUString aValue;
-
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- if ( impl_getElementProps( aEvent.Element, aCommand, aModule, aService, aValue ))
- {
- // Create hash key from command and module as they are together a primary key to
- // the UNO service that implements the popup menu controller.
- rtl::OUString aHashKey( getHashKeyFromStrings( aCommand, aModule ));
- m_aStatusbarControllerMap.erase( aHashKey );
- }
-}
-
-void SAL_CALL ConfigurationAccess_StatusbarControllerFactory::elementReplaced( const ContainerEvent& aEvent ) throw(RuntimeException)
-{
- rtl::OUString aCommand;
- rtl::OUString aModule;
- rtl::OUString aService;
- rtl::OUString aValue;
-
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- if ( impl_getElementProps( aEvent.Element, aCommand, aModule, aService, aValue ))
- {
- // Create hash key from command and module as they are together a primary key to
- // the UNO service that implements the popup menu controller.
- rtl::OUString aHashKey( getHashKeyFromStrings( aCommand, aModule ));
- StatusbarControllerInfo& rControllerInfo = m_aStatusbarControllerMap[ aHashKey ];
- rControllerInfo.m_aImplementationName = aService;
- rControllerInfo.m_aValue = aValue;
- }
-}
-
-// lang.XEventListener
-void SAL_CALL ConfigurationAccess_StatusbarControllerFactory::disposing( const EventObject& ) throw(RuntimeException)
-{
- // SAFE
- // remove our reference to the config access
- ResetableGuard aLock( m_aLock );
- m_xConfigAccess.clear();
-}
-
-void ConfigurationAccess_StatusbarControllerFactory::readConfigurationData()
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- if ( !m_bConfigAccessInitialized )
- {
- Sequence< Any > aArgs( 1 );
- PropertyValue aPropValue;
-
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ));
- aPropValue.Value <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.UI.Controller/Registered/StatusBar" ));
- aArgs[0] <<= aPropValue;
-
- try
- {
- m_xConfigAccess = Reference< XNameAccess >( m_xConfigProvider->createInstanceWithArguments(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationAccess" )),
- aArgs ),
- UNO_QUERY );
- }
- catch ( WrappedTargetException& )
- {
- }
-
- m_bConfigAccessInitialized = sal_True;
- }
-
- if ( m_xConfigAccess.is() )
- {
- Sequence< rtl::OUString > aStatusbarControllers = m_xConfigAccess->getElementNames();
-
- Any a;
- rtl::OUString aCommand;
- rtl::OUString aModule;
- rtl::OUString aService;
- rtl::OUString aValue;
- rtl::OUString aHashKey;
- Reference< XPropertySet > xPropertySet;
- for ( sal_Int32 i = 0; i < aStatusbarControllers.getLength(); i++ )
- {
- if ( impl_getElementProps( m_xConfigAccess->getByName( aStatusbarControllers[i] ), aCommand, aModule, aService, aValue ))
- {
- // Create hash key from command and module as they are together a primary key to
- // the UNO service that implements the popup menu controller.
- aHashKey = getHashKeyFromStrings( aCommand, aModule );
- StatusbarControllerInfo& rControllerInfo = m_aStatusbarControllerMap[ aHashKey ];
- rControllerInfo.m_aImplementationName = aService;
- rControllerInfo.m_aValue = aValue;
- }
- }
-
- // UNSAFE
- aLock.unlock();
-
- Reference< XContainer > xContainer( m_xConfigAccess, UNO_QUERY );
- if ( xContainer.is() )
- xContainer->addContainerListener( this );
- }
-}
-
-sal_Bool ConfigurationAccess_StatusbarControllerFactory::impl_getElementProps(
- const Any& aElement,
- rtl::OUString& aCommand,
- rtl::OUString& aModule,
- rtl::OUString& aServiceSpecifier,
- rtl::OUString& aValue ) const
-{
- Reference< XPropertySet > xPropertySet;
- aElement >>= xPropertySet;
-
- if ( xPropertySet.is() )
- {
- try
- {
- xPropertySet->getPropertyValue( m_aPropCommand ) >>= aCommand;
- xPropertySet->getPropertyValue( m_aPropModule ) >>= aModule;
- xPropertySet->getPropertyValue( m_aPropController ) >>= aServiceSpecifier;
- xPropertySet->getPropertyValue( m_aPropValue ) >>= aValue;
- }
- catch ( com::sun::star::beans::UnknownPropertyException& )
- {
- return sal_False;
- }
- catch ( com::sun::star::lang::WrappedTargetException& )
- {
- return sal_False;
- }
- }
-
- return sal_True;
-}
-
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_4 ( StatusbarControllerFactory ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XServiceInfo ),
- DIRECT_INTERFACE( css::lang::XMultiComponentFactory ),
- DIRECT_INTERFACE( ::com::sun::star::frame::XUIControllerRegistration )
- )
-
-DEFINE_XTYPEPROVIDER_4 ( StatusbarControllerFactory ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- css::lang::XMultiComponentFactory ,
- ::com::sun::star::frame::XUIControllerRegistration
- )
-
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( StatusbarControllerFactory ,
::cppu::OWeakObject ,
SERVICENAME_STATUSBARCONTROLLERFACTORY ,
@@ -454,169 +84,11 @@ DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( StatusbarControllerFactory
DEFINE_INIT_SERVICE ( StatusbarControllerFactory, {} )
StatusbarControllerFactory::StatusbarControllerFactory( const Reference< XMultiServiceFactory >& xServiceManager ) :
- ThreadHelpBase(),
- m_bConfigRead( sal_False ),
- m_xServiceManager( xServiceManager )
+ ToolbarControllerFactory(xServiceManager,true)
{
- m_pConfigAccess = new ConfigurationAccess_StatusbarControllerFactory( m_xServiceManager );
+ m_pConfigAccess = new ConfigurationAccess_ControllerFactory( m_xServiceManager,rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.UI.Controller/Registered/StatusBar" )),true );
m_pConfigAccess->acquire();
}
-StatusbarControllerFactory::~StatusbarControllerFactory()
-{
- ResetableGuard aLock( m_aLock );
-
- // reduce reference count
- m_pConfigAccess->release();
-}
-
-// XMultiComponentFactory
-Reference< XInterface > SAL_CALL StatusbarControllerFactory::createInstanceWithContext(
- const ::rtl::OUString& aServiceSpecifier,
- const Reference< XComponentContext >& )
-throw (Exception, RuntimeException)
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- if ( !m_bConfigRead )
- {
- m_bConfigRead = sal_True;
- m_pConfigAccess->readConfigurationData();
- }
-
- rtl::OUString aServiceName = m_pConfigAccess->getServiceFromCommandModule( aServiceSpecifier, rtl::OUString() );
- if ( aServiceName.getLength() > 0 )
- return m_xServiceManager->createInstance( aServiceName );
- else
- return Reference< XInterface >();
- // SAFE
-}
-
-Reference< XInterface > SAL_CALL StatusbarControllerFactory::createInstanceWithArgumentsAndContext(
- const ::rtl::OUString& ServiceSpecifier,
- const Sequence< Any >& Arguments,
- const Reference< XComponentContext >& )
-throw (Exception, RuntimeException)
-{
- const rtl::OUString aPropModuleName( RTL_CONSTASCII_USTRINGPARAM( "ModuleName" ));
- const rtl::OUString aPropValueName( RTL_CONSTASCII_USTRINGPARAM( "Value" ));
-
- rtl::OUString aPropName;
- PropertyValue aPropValue;
-
- // Retrieve the optional module name form the Arguments sequence. It is used as a part of
- // the hash map key to support different controller implementation for the same URL but different
- // module!!
- for ( int i = 0; i < Arguments.getLength(); i++ )
- {
- if (( Arguments[i] >>= aPropValue ) && ( aPropValue.Name.equals( aPropModuleName )))
- {
- aPropValue.Value >>= aPropName;
- break;
- }
- }
-
- Sequence< Any > aNewArgs( Arguments );
-
- sal_Int32 nAppendIndex = aNewArgs.getLength();
- aNewArgs.realloc( aNewArgs.getLength()+2 );
-
- // Append the command URL to the Arguments sequence so that one controller can be
- // used for more than one command URL.
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CommandURL" ));
- aPropValue.Value <<= ServiceSpecifier;
- aNewArgs[nAppendIndex] <<= aPropValue;
-
- // Append the optional value argument. It's an empty string if no additional info
- // is provided to the controller.
- rtl::OUString aValue = m_pConfigAccess->getValueFromCommandModule( ServiceSpecifier, aPropName );
- aPropValue.Name = aPropValueName;
- aPropValue.Value <<= aValue;
- aNewArgs[nAppendIndex+1] <<= aPropValue;
-
- {
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- if ( !m_bConfigRead )
- {
- m_bConfigRead = sal_True;
- m_pConfigAccess->readConfigurationData();
- }
-
- rtl::OUString aServiceName = m_pConfigAccess->getServiceFromCommandModule( ServiceSpecifier, aPropName );
- Reference< XMultiServiceFactory > xServiceManager( m_xServiceManager );
-
- aLock.unlock();
- // SAFE
-
-
- if ( aServiceName.getLength() > 0 )
- return xServiceManager->createInstanceWithArguments( aServiceName, aNewArgs );
- else
- return Reference< XInterface >();
- }
-}
-
-Sequence< ::rtl::OUString > SAL_CALL StatusbarControllerFactory::getAvailableServiceNames()
-throw (RuntimeException)
-{
- return Sequence< ::rtl::OUString >();
-}
-
-// XUIControllerRegistration
-sal_Bool SAL_CALL StatusbarControllerFactory::hasController(
- const ::rtl::OUString& aCommandURL,
- const rtl::OUString& aModuleName )
-throw (::com::sun::star::uno::RuntimeException)
-{
- ResetableGuard aLock( m_aLock );
-
- if ( !m_bConfigRead )
- {
- m_bConfigRead = sal_True;
- m_pConfigAccess->readConfigurationData();
- }
-
- return ( m_pConfigAccess->getServiceFromCommandModule( aCommandURL, aModuleName ).getLength() > 0 );
-}
-
-void SAL_CALL StatusbarControllerFactory::registerController(
- const ::rtl::OUString& aCommandURL,
- const ::rtl::OUString& aModuleName,
- const ::rtl::OUString& aControllerImplementationName )
-throw (RuntimeException)
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- if ( !m_bConfigRead )
- {
- m_bConfigRead = sal_True;
- m_pConfigAccess->readConfigurationData();
- }
-
- m_pConfigAccess->addServiceToCommandModule( aCommandURL, aModuleName, aControllerImplementationName );
- // SAFE
-}
-
-void SAL_CALL StatusbarControllerFactory::deregisterController(
- const ::rtl::OUString& aCommandURL,
- const rtl::OUString& aModuleName )
-throw (RuntimeException)
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- if ( !m_bConfigRead )
- {
- m_bConfigRead = sal_True;
- m_pConfigAccess->readConfigurationData();
- }
-
- m_pConfigAccess->removeServiceFromCommandModule( aCommandURL, aModuleName );
- // SAFE
-}
} // namespace framework
diff --git a/framework/source/uifactory/statusbarfactory.cxx b/framework/source/uifactory/statusbarfactory.cxx
index 3b3c50a8500e..18af37989571 100644
--- a/framework/source/uifactory/statusbarfactory.cxx
+++ b/framework/source/uifactory/statusbarfactory.cxx
@@ -31,6 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_framework.hxx"
#include <uifactory/statusbarfactory.hxx>
+#include <uifactory/menubarfactory.hxx>
//_________________________________________________________________________________________________________________
// my own includes
@@ -76,19 +77,6 @@ namespace framework
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( StatusBarFactory ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XServiceInfo ),
- DIRECT_INTERFACE( ::com::sun::star::ui::XUIElementFactory )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( StatusBarFactory ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- ::com::sun::star::ui::XUIElementFactory
- )
-
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( StatusBarFactory ,
::cppu::OWeakObject ,
SERVICENAME_STATUSBARFACTORY ,
@@ -98,16 +86,9 @@ DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( StatusBarFactory
DEFINE_INIT_SERVICE ( StatusBarFactory, {} )
StatusBarFactory::StatusBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
- ThreadHelpBase( &Application::GetSolarMutex() )
- , m_xServiceManager( xServiceManager )
- , m_xModuleManager( xServiceManager->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ModuleManager" ))),
- UNO_QUERY )
-{
-}
-
-StatusBarFactory::~StatusBarFactory()
+ MenuBarFactory( xServiceManager,true )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarFactory::StatusBarFactory" );
}
// XUIElementFactory
@@ -116,88 +97,15 @@ Reference< XUIElement > SAL_CALL StatusBarFactory::createUIElement(
const Sequence< PropertyValue >& Args )
throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarFactory::createUIElement" );
// SAFE
ResetableGuard aLock( m_aLock );
-
- Reference< XUIConfigurationManager > xConfigSource;
- Reference< XFrame > xFrame;
- rtl::OUString aResourceURL( ResourceURL );
- sal_Bool bPersistent( sal_True );
-
- for ( sal_Int32 n = 0; n < Args.getLength(); n++ )
- {
- if ( Args[n].Name.equalsAscii( "ConfigurationSource" ))
- Args[n].Value >>= xConfigSource;
- else if ( Args[n].Name.equalsAscii( "Frame" ))
- Args[n].Value >>= xFrame;
- else if ( Args[n].Name.equalsAscii( "ResourceURL" ))
- Args[n].Value >>= aResourceURL;
- else if ( Args[n].Name.equalsAscii( "Persistent" ))
- Args[n].Value >>= bPersistent;
- }
-
- Reference< XUIConfigurationManager > xCfgMgr;
- if ( aResourceURL.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:resource/statusbar/" ))) != 0 )
- throw IllegalArgumentException();
- else
- {
- // Identify frame and determine document based ui configuration manager/module ui configuration manager
- if ( xFrame.is() && !xConfigSource.is() )
- {
- bool bHasSettings( false );
- Reference< XModel > xModel;
-
- Reference< XController > xController = xFrame->getController();
- if ( xController.is() )
- xModel = xController->getModel();
-
- if ( xModel.is() )
- {
- Reference< XUIConfigurationManagerSupplier > xUIConfigurationManagerSupplier( xModel, UNO_QUERY );
- if ( xUIConfigurationManagerSupplier.is() )
- {
- xCfgMgr = xUIConfigurationManagerSupplier->getUIConfigurationManager();
- bHasSettings = xCfgMgr->hasSettings( aResourceURL );
- }
- }
-
- if ( !bHasSettings )
- {
- rtl::OUString aModuleIdentifier = m_xModuleManager->identify( Reference< XInterface >( xFrame, UNO_QUERY ));
- if ( aModuleIdentifier.getLength() )
- {
- Reference< ::com::sun::star::ui::XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier(
- m_xServiceManager->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ))),
- UNO_QUERY );
- xCfgMgr = xModuleCfgSupplier->getUIConfigurationManager( aModuleIdentifier );
- bHasSettings = xCfgMgr->hasSettings( aResourceURL );
- }
- }
- }
- }
-
- PropertyValue aPropValue;
- Sequence< Any > aPropSeq( 4 );
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Frame" ));
- aPropValue.Value <<= xFrame;
- aPropSeq[0] <<= aPropValue;
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ConfigurationSource" ));
- aPropValue.Value <<= xCfgMgr;
- aPropSeq[1] <<= aPropValue;
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceURL" ));
- aPropValue.Value <<= aResourceURL;
- aPropSeq[2] <<= aPropValue;
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Persistent" ));
- aPropValue.Value <<= bPersistent;
- aPropSeq[3] <<= aPropValue;
-
- vos::OGuard aGuard( Application::GetSolarMutex() );
- StatusBarWrapper* pStatusBarWrapper = new StatusBarWrapper( m_xServiceManager );
- Reference< ::com::sun::star::ui::XUIElement > xStatusBar( (OWeakObject *)pStatusBarWrapper, UNO_QUERY );
- Reference< XInitialization > xInit( xStatusBar, UNO_QUERY );
- xInit->initialize( aPropSeq );
- return xStatusBar;
+ StatusBarWrapper* pWrapper = new StatusBarWrapper( m_xServiceManager );
+ Reference< ::com::sun::star::ui::XUIElement > xMenuBar( (OWeakObject *)pWrapper, UNO_QUERY );
+ Reference< ::com::sun::star::frame::XModuleManager > xModuleManager = m_xModuleManager;
+ aLock.unlock();
+ MenuBarFactory::CreateUIElement(ResourceURL,Args,NULL,"private:resource/statusbar/",xMenuBar,xModuleManager,m_xServiceManager);
+ return xMenuBar;
}
}
diff --git a/framework/source/uifactory/toolbarcontrollerfactory.cxx b/framework/source/uifactory/toolbarcontrollerfactory.cxx
index f94784f356fc..f75cc4351c2d 100644
--- a/framework/source/uifactory/toolbarcontrollerfactory.cxx
+++ b/framework/source/uifactory/toolbarcontrollerfactory.cxx
@@ -35,6 +35,7 @@
// my own includes
//_________________________________________________________________________________________________________________
#include "uifactory/toolbarcontrollerfactory.hxx"
+#include "uifactory/factoryconfiguration.hxx"
#include <threadhelp/resetableguard.hxx>
#include "services.h"
@@ -72,326 +73,9 @@ using namespace ::com::sun::star::frame;
namespace framework
{
-// global function needed by both implementations
-static rtl::OUString getHashKeyFromStrings( const rtl::OUString& aCommandURL, const rtl::OUString& aModuleName )
-{
- rtl::OUStringBuffer aKey( aCommandURL );
- aKey.appendAscii( "-" );
- aKey.append( aModuleName );
- return aKey.makeStringAndClear();
-}
-
-
-//*****************************************************************************************************************
-// Configuration access class for ToolbarControllerFactory implementation
-//*****************************************************************************************************************
-
-class ConfigurationAccess_ToolbarControllerFactory : // interfaces
- public XTypeProvider ,
- public XContainerListener ,
- // baseclasses
- // Order is neccessary for right initialization!
- private ThreadHelpBase ,
- public ::cppu::OWeakObject
-{
- public:
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
-
- ConfigurationAccess_ToolbarControllerFactory( Reference< XMultiServiceFactory >& rServiceManager );
- virtual ~ConfigurationAccess_ToolbarControllerFactory();
-
- void readConfigurationData();
-
- rtl::OUString getServiceFromCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule ) const;
- void addServiceToCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule, const rtl::OUString& rServiceSpecifier );
- void removeServiceFromCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule );
-
- // container.XContainerListener
- virtual void SAL_CALL elementInserted( const ContainerEvent& aEvent ) throw(RuntimeException);
- virtual void SAL_CALL elementRemoved ( const ContainerEvent& aEvent ) throw(RuntimeException);
- virtual void SAL_CALL elementReplaced( const ContainerEvent& aEvent ) throw(RuntimeException);
-
- // lang.XEventListener
- virtual void SAL_CALL disposing( const EventObject& aEvent ) throw(RuntimeException);
-
- private:
- class ToolbarControllerMap : public std::hash_map< rtl::OUString,
- rtl::OUString,
- OUStringHashCode,
- ::std::equal_to< ::rtl::OUString > >
- {
- inline void free()
- {
- ToolbarControllerMap().swap( *this );
- }
- };
-
- sal_Bool impl_getElementProps( const Any& aElement, rtl::OUString& aCommand, rtl::OUString& aModule, rtl::OUString& aServiceSpecifier ) const;
-
- rtl::OUString m_aPropCommand;
- rtl::OUString m_aPropModule;
- rtl::OUString m_aPropController;
- ToolbarControllerMap m_aToolbarControllerMap;
- Reference< XMultiServiceFactory > m_xServiceManager;
- Reference< XMultiServiceFactory > m_xConfigProvider;
- Reference< XNameAccess > m_xConfigAccess;
- sal_Bool m_bConfigAccessInitialized;
-};
-
-//*****************************************************************************************************************
-// XInterface, XTypeProvider
-//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( ConfigurationAccess_ToolbarControllerFactory ,
- OWeakObject ,
- DIRECT_INTERFACE ( XTypeProvider ),
- DIRECT_INTERFACE ( XContainerListener ),
- DERIVED_INTERFACE( css::lang::XEventListener, XContainerListener )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( ConfigurationAccess_ToolbarControllerFactory ,
- XTypeProvider ,
- XContainerListener ,
- css::lang::XEventListener
- )
-
-ConfigurationAccess_ToolbarControllerFactory::ConfigurationAccess_ToolbarControllerFactory( Reference< XMultiServiceFactory >& rServiceManager ) :
- ThreadHelpBase(),
- m_aPropCommand( RTL_CONSTASCII_USTRINGPARAM( "Command" )),
- m_aPropModule( RTL_CONSTASCII_USTRINGPARAM( "Module" )),
- m_aPropController( RTL_CONSTASCII_USTRINGPARAM( "Controller" )),
- m_xServiceManager( rServiceManager ),
- m_bConfigAccessInitialized( sal_False )
-{
- m_xConfigProvider = Reference< XMultiServiceFactory >( rServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationProvider" ))),
- UNO_QUERY );
-}
-
-ConfigurationAccess_ToolbarControllerFactory::~ConfigurationAccess_ToolbarControllerFactory()
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- Reference< XContainer > xContainer( m_xConfigAccess, UNO_QUERY );
- if ( xContainer.is() )
- xContainer->removeContainerListener( this );
-}
-
-rtl::OUString ConfigurationAccess_ToolbarControllerFactory::getServiceFromCommandModule( const rtl::OUString& rCommandURL, const rtl::OUString& rModule ) const
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- ToolbarControllerMap::const_iterator pIter =
- m_aToolbarControllerMap.find( getHashKeyFromStrings( rCommandURL, rModule ));
-
- if ( pIter != m_aToolbarControllerMap.end() )
- return pIter->second;
- else
- {
- // Try to detect if we have a generic popup menu controller
- pIter = m_aToolbarControllerMap.find( getHashKeyFromStrings( rCommandURL, rtl::OUString() ));
-
- if ( pIter != m_aToolbarControllerMap.end() )
- return pIter->second;
- }
-
- return rtl::OUString();
-}
-
-void ConfigurationAccess_ToolbarControllerFactory::addServiceToCommandModule(
- const rtl::OUString& rCommandURL,
- const rtl::OUString& rModule,
- const rtl::OUString& rServiceSpecifier )
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- rtl::OUString aHashKey = getHashKeyFromStrings( rCommandURL, rModule );
- m_aToolbarControllerMap.insert( ToolbarControllerMap::value_type( aHashKey, rServiceSpecifier ));
-}
-
-void ConfigurationAccess_ToolbarControllerFactory::removeServiceFromCommandModule(
- const rtl::OUString& rCommandURL,
- const rtl::OUString& rModule )
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- rtl::OUString aHashKey = getHashKeyFromStrings( rCommandURL, rModule );
- m_aToolbarControllerMap.erase( aHashKey );
-}
-
-// container.XContainerListener
-void SAL_CALL ConfigurationAccess_ToolbarControllerFactory::elementInserted( const ContainerEvent& aEvent ) throw(RuntimeException)
-{
- rtl::OUString aCommand;
- rtl::OUString aModule;
- rtl::OUString aService;
-
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- if ( impl_getElementProps( aEvent.Element, aCommand, aModule, aService ))
- {
- // Create hash key from command and module as they are together a primary key to
- // the UNO service that implements the popup menu controller.
- rtl::OUString aHashKey( getHashKeyFromStrings( aCommand, aModule ));
- m_aToolbarControllerMap.insert( ToolbarControllerMap::value_type( aHashKey, aService ));
- }
-}
-
-void SAL_CALL ConfigurationAccess_ToolbarControllerFactory::elementRemoved ( const ContainerEvent& aEvent ) throw(RuntimeException)
-{
- rtl::OUString aCommand;
- rtl::OUString aModule;
- rtl::OUString aService;
-
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- if ( impl_getElementProps( aEvent.Element, aCommand, aModule, aService ))
- {
- // Create hash key from command and module as they are together a primary key to
- // the UNO service that implements the popup menu controller.
- rtl::OUString aHashKey( getHashKeyFromStrings( aCommand, aModule ));
- m_aToolbarControllerMap.erase( aHashKey );
- }
-}
-
-void SAL_CALL ConfigurationAccess_ToolbarControllerFactory::elementReplaced( const ContainerEvent& aEvent ) throw(RuntimeException)
-{
- rtl::OUString aCommand;
- rtl::OUString aModule;
- rtl::OUString aService;
-
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- if ( impl_getElementProps( aEvent.Element, aCommand, aModule, aService ))
- {
- // Create hash key from command and module as they are together a primary key to
- // the UNO service that implements the popup menu controller.
- rtl::OUString aHashKey( getHashKeyFromStrings( aCommand, aModule ));
- m_aToolbarControllerMap.erase( aHashKey );
- m_aToolbarControllerMap.insert( ToolbarControllerMap::value_type( aHashKey, aService ));
- }
-}
-
-// lang.XEventListener
-void SAL_CALL ConfigurationAccess_ToolbarControllerFactory::disposing( const EventObject& ) throw(RuntimeException)
-{
- // SAFE
- // remove our reference to the config access
- ResetableGuard aLock( m_aLock );
- m_xConfigAccess.clear();
-}
-
-void ConfigurationAccess_ToolbarControllerFactory::readConfigurationData()
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- if ( !m_bConfigAccessInitialized )
- {
- Sequence< Any > aArgs( 1 );
- PropertyValue aPropValue;
-
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ));
- aPropValue.Value <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.UI.Controller/Registered/ToolBar" ));
- aArgs[0] <<= aPropValue;
-
- try
- {
- m_xConfigAccess = Reference< XNameAccess >( m_xConfigProvider->createInstanceWithArguments(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationAccess" )),
- aArgs ),
- UNO_QUERY );
- }
- catch ( WrappedTargetException& )
- {
- }
-
- m_bConfigAccessInitialized = sal_True;
- }
-
- if ( m_xConfigAccess.is() )
- {
- Sequence< rtl::OUString > aToolbarControllers = m_xConfigAccess->getElementNames();
-
- Any a;
- rtl::OUString aCommand;
- rtl::OUString aModule;
- rtl::OUString aService;
- rtl::OUString aHashKey;
- Reference< XPropertySet > xPropertySet;
- for ( sal_Int32 i = 0; i < aToolbarControllers.getLength(); i++ )
- {
- if ( impl_getElementProps( m_xConfigAccess->getByName( aToolbarControllers[i] ), aCommand, aModule, aService ))
- {
- // Create hash key from command and module as they are together a primary key to
- // the UNO service that implements the popup menu controller.
- aHashKey = getHashKeyFromStrings( aCommand, aModule );
- m_aToolbarControllerMap.insert( ToolbarControllerMap::value_type( aHashKey, aService ));
- }
- }
-
- // UNSAFE
- aLock.unlock();
-
- Reference< XContainer > xContainer( m_xConfigAccess, UNO_QUERY );
- if ( xContainer.is() )
- xContainer->addContainerListener( this );
- }
-}
-
-sal_Bool ConfigurationAccess_ToolbarControllerFactory::impl_getElementProps( const Any& aElement, rtl::OUString& aCommand, rtl::OUString& aModule, rtl::OUString& aServiceSpecifier ) const
-{
- Reference< XPropertySet > xPropertySet;
- aElement >>= xPropertySet;
-
- if ( xPropertySet.is() )
- {
- try
- {
- xPropertySet->getPropertyValue( m_aPropCommand ) >>= aCommand;
- xPropertySet->getPropertyValue( m_aPropModule ) >>= aModule;
- xPropertySet->getPropertyValue( m_aPropController ) >>= aServiceSpecifier;
- }
- catch ( com::sun::star::beans::UnknownPropertyException& )
- {
- return sal_False;
- }
- catch ( com::sun::star::lang::WrappedTargetException& )
- {
- return sal_False;
- }
- }
-
- return sal_True;
-}
-
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_4 ( ToolbarControllerFactory ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XServiceInfo ),
- DIRECT_INTERFACE( css::lang::XMultiComponentFactory ),
- DIRECT_INTERFACE( ::com::sun::star::frame::XUIControllerRegistration )
- )
-
-DEFINE_XTYPEPROVIDER_4 ( ToolbarControllerFactory ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- css::lang::XMultiComponentFactory ,
- ::com::sun::star::frame::XUIControllerRegistration
- )
-
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( ToolbarControllerFactory ,
::cppu::OWeakObject ,
SERVICENAME_TOOLBARCONTROLLERFACTORY ,
@@ -405,10 +89,18 @@ ToolbarControllerFactory::ToolbarControllerFactory( const Reference< XMultiServi
m_bConfigRead( sal_False ),
m_xServiceManager( xServiceManager )
{
- m_pConfigAccess = new ConfigurationAccess_ToolbarControllerFactory( m_xServiceManager );
+ m_pConfigAccess = new ConfigurationAccess_ControllerFactory( m_xServiceManager,rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.UI.Controller/Registered/ToolBar" )) );
m_pConfigAccess->acquire();
}
+ToolbarControllerFactory::ToolbarControllerFactory( const Reference< XMultiServiceFactory >& xServiceManager,bool ) :
+ ThreadHelpBase(),
+ m_bConfigRead( sal_False ),
+ m_xServiceManager( xServiceManager )
+{
+ m_pConfigAccess = NULL;
+}
+
ToolbarControllerFactory::~ToolbarControllerFactory()
{
ResetableGuard aLock( m_aLock );
@@ -447,6 +139,7 @@ Reference< XInterface > SAL_CALL ToolbarControllerFactory::createInstanceWithArg
throw (Exception, RuntimeException)
{
const rtl::OUString aPropModuleName( RTL_CONSTASCII_USTRINGPARAM( "ModuleName" ));
+ const rtl::OUString aPropValueName( RTL_CONSTASCII_USTRINGPARAM( "Value" ));
rtl::OUString aPropName;
PropertyValue aPropValue;
@@ -463,18 +156,30 @@ throw (Exception, RuntimeException)
}
}
- // Append the command URL to the Arguments sequence so that one controller can be
- // used for more than one command URL.
Sequence< Any > aNewArgs( Arguments );
sal_Int32 nAppendIndex = aNewArgs.getLength();
- aNewArgs.realloc( aNewArgs.getLength()+1 );
+ bool bHasValue = m_pConfigAccess->hasValue();
+ aNewArgs.realloc( aNewArgs.getLength() + (bHasValue ? 2 : 1) );
+
+ // Append the command URL to the Arguments sequence so that one controller can be
+ // used for more than one command URL.
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CommandURL" ));
aPropValue.Value <<= ServiceSpecifier;
aNewArgs[nAppendIndex] <<= aPropValue;
- // SAFE
+ if ( bHasValue )
{
+ // Append the optional value argument. It's an empty string if no additional info
+ // is provided to the controller.
+ rtl::OUString aValue = m_pConfigAccess->getValueFromCommandModule( ServiceSpecifier, aPropName );
+ aPropValue.Name = aPropValueName;
+ aPropValue.Value <<= aValue;
+ aNewArgs[nAppendIndex+1] <<= aPropValue;
+ }
+
+ {
+ // SAFE
ResetableGuard aLock( m_aLock );
if ( !m_bConfigRead )
@@ -484,12 +189,17 @@ throw (Exception, RuntimeException)
}
rtl::OUString aServiceName = m_pConfigAccess->getServiceFromCommandModule( ServiceSpecifier, aPropName );
+ Reference< XMultiServiceFactory > xServiceManager( m_xServiceManager );
+
+ aLock.unlock();
+ // SAFE
+
+
if ( aServiceName.getLength() > 0 )
- return m_xServiceManager->createInstanceWithArguments( aServiceName, aNewArgs );
+ return xServiceManager->createInstanceWithArguments( aServiceName, aNewArgs );
else
return Reference< XInterface >();
}
- // SAFE
}
Sequence< ::rtl::OUString > SAL_CALL ToolbarControllerFactory::getAvailableServiceNames()
diff --git a/framework/source/uifactory/toolboxfactory.cxx b/framework/source/uifactory/toolboxfactory.cxx
index 9750a9f30cb4..7219f68ca448 100644
--- a/framework/source/uifactory/toolboxfactory.cxx
+++ b/framework/source/uifactory/toolboxfactory.cxx
@@ -76,19 +76,6 @@ namespace framework
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( ToolBoxFactory ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XServiceInfo ),
- DIRECT_INTERFACE( ::com::sun::star::ui::XUIElementFactory )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( ToolBoxFactory ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- ::com::sun::star::ui::XUIElementFactory
- )
-
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( ToolBoxFactory ,
::cppu::OWeakObject ,
SERVICENAME_TOOLBARFACTORY ,
@@ -98,15 +85,7 @@ DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( ToolBoxFactory
DEFINE_INIT_SERVICE ( ToolBoxFactory, {} )
ToolBoxFactory::ToolBoxFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
- ThreadHelpBase( &Application::GetSolarMutex() )
- , m_xServiceManager( xServiceManager )
- , m_xModuleManager( xServiceManager->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ModuleManager" ))),
- UNO_QUERY )
-{
-}
-
-ToolBoxFactory::~ToolBoxFactory()
+ MenuBarFactory( xServiceManager,true )
{
}
@@ -116,94 +95,13 @@ Reference< XUIElement > SAL_CALL ToolBoxFactory::createUIElement(
const Sequence< PropertyValue >& Args )
throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException )
{
- // SAFE
ResetableGuard aLock( m_aLock );
-
- Reference< XUIConfigurationManager > xConfigSource;
- Reference< XFrame > xFrame;
- rtl::OUString aResourceURL( ResourceURL );
- sal_Bool bPersistent( sal_True );
- sal_Bool bPopupMode( sal_False );
-
- for ( sal_Int32 n = 0; n < Args.getLength(); n++ )
- {
- if ( Args[n].Name.equalsAscii( "ConfigurationSource" ))
- Args[n].Value >>= xConfigSource;
- else if ( Args[n].Name.equalsAsciiL( "Frame", 5 ))
- Args[n].Value >>= xFrame;
- else if ( Args[n].Name.equalsAsciiL( "ResourceURL", 11 ))
- Args[n].Value >>= aResourceURL;
- else if ( Args[n].Name.equalsAsciiL( "Persistent", 10 ))
- Args[n].Value >>= bPersistent;
- else if ( Args[n].Name.equalsAsciiL( "PopupMode", 9 ))
- Args[n].Value >>= bPopupMode;
- }
-
- Reference< XUIConfigurationManager > xCfgMgr;
- if ( aResourceURL.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/" ))) != 0 )
- throw IllegalArgumentException();
- else
- {
- // Identify frame and determine document based ui configuration manager/module ui configuration manager
- if ( xFrame.is() && !xConfigSource.is() )
- {
- bool bHasSettings( false );
- Reference< XModel > xModel;
-
- Reference< XController > xController = xFrame->getController();
- if ( xController.is() )
- xModel = xController->getModel();
-
- if ( xModel.is() )
- {
- Reference< XUIConfigurationManagerSupplier > xUIConfigurationManagerSupplier( xModel, UNO_QUERY );
- if ( xUIConfigurationManagerSupplier.is() )
- {
- xCfgMgr = xUIConfigurationManagerSupplier->getUIConfigurationManager();
- bHasSettings = xCfgMgr->hasSettings( aResourceURL );
- }
- }
-
- if ( !bHasSettings )
- {
- rtl::OUString aModuleIdentifier = m_xModuleManager->identify( Reference< XInterface >( xFrame, UNO_QUERY ));
- if ( aModuleIdentifier.getLength() )
- {
- Reference< ::com::sun::star::ui::XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier(
- m_xServiceManager->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ))),
- UNO_QUERY );
- xCfgMgr = xModuleCfgSupplier->getUIConfigurationManager( aModuleIdentifier );
- bHasSettings = xCfgMgr->hasSettings( aResourceURL );
- }
- }
- }
- }
-
- PropertyValue aPropValue;
- Sequence< Any > aPropSeq( 5 );
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Frame" ));
- aPropValue.Value <<= xFrame;
- aPropSeq[0] <<= aPropValue;
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ConfigurationSource" ));
- aPropValue.Value <<= xCfgMgr;
- aPropSeq[1] <<= aPropValue;
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceURL" ));
- aPropValue.Value <<= aResourceURL;
- aPropSeq[2] <<= aPropValue;
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Persistent" ));
- aPropValue.Value <<= bPersistent;
- aPropSeq[3] <<= aPropValue;
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PopupMode" ));
- aPropValue.Value <<= bPopupMode;
- aPropSeq[4] <<= aPropValue;
-
- vos::OGuard aGuard( Application::GetSolarMutex() );
- ToolBarWrapper* pToolBarWrapper = new ToolBarWrapper( m_xServiceManager );
- Reference< ::com::sun::star::ui::XUIElement > xToolBar( (OWeakObject *)pToolBarWrapper, UNO_QUERY );
- Reference< XInitialization > xInit( xToolBar, UNO_QUERY );
- xInit->initialize( aPropSeq );
- return xToolBar;
+ ToolBarWrapper* pWrapper = new ToolBarWrapper( m_xServiceManager );
+ Reference< ::com::sun::star::ui::XUIElement > xMenuBar( (OWeakObject *)pWrapper, UNO_QUERY );
+ Reference< ::com::sun::star::frame::XModuleManager > xModuleManager = m_xModuleManager;
+ aLock.unlock();
+ CreateUIElement(ResourceURL,Args,"PopupMode","private:resource/toolbar/",xMenuBar,xModuleManager,m_xServiceManager);
+ return xMenuBar;
}
}
diff --git a/framework/source/uifactory/uielementfactorymanager.cxx b/framework/source/uifactory/uielementfactorymanager.cxx
index d93330b83701..3d043f98b088 100644
--- a/framework/source/uifactory/uielementfactorymanager.cxx
+++ b/framework/source/uifactory/uielementfactorymanager.cxx
@@ -35,6 +35,7 @@
// my own includes
//_________________________________________________________________________________________________________________
#include <uifactory/uielementfactorymanager.hxx>
+#include <uifactory/windowcontentfactorymanager.hxx>
#include <threadhelp/resetableguard.hxx>
#include "services.h"
@@ -55,7 +56,7 @@
#include <cppuhelper/weak.hxx>
#include <tools/urlobj.hxx>
#include <vcl/svapp.hxx>
-
+#include <rtl/logfile.hxx>
//_________________________________________________________________________________________________________________
// Defines
//_________________________________________________________________________________________________________________
@@ -93,93 +94,23 @@ rtl::OUString getHashKeyFromStrings( const rtl::OUString& aType, const rtl::OUSt
// Configuration access class for UIElementFactoryManager implementation
//*****************************************************************************************************************
-class ConfigurationAccess_UIElementFactoryManager : // interfaces
- public XTypeProvider ,
- public XContainerListener ,
- // baseclasses
- // Order is neccessary for right initialization!
- private ThreadHelpBase ,
- public ::cppu::OWeakObject
-{
- public:
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
-
- ConfigurationAccess_UIElementFactoryManager( Reference< XMultiServiceFactory >& rServiceManager );
- virtual ~ConfigurationAccess_UIElementFactoryManager();
-
- void readConfigurationData();
- rtl::OUString getFactorySpecifierFromTypeNameModule( const rtl::OUString& rType, const rtl::OUString& rName, const rtl::OUString& rModule ) const;
- void addFactorySpecifierToTypeNameModule( const rtl::OUString& rType, const rtl::OUString& rName, const rtl::OUString& rModule, const rtl::OUString& aServiceSpecifier );
- void removeFactorySpecifierFromTypeNameModule( const rtl::OUString& rType, const rtl::OUString& rName, const rtl::OUString& rModule );
- Sequence< Sequence< PropertyValue > > getFactoriesDescription() const;
-
- // container.XContainerListener
- virtual void SAL_CALL elementInserted( const ContainerEvent& aEvent ) throw(RuntimeException);
- virtual void SAL_CALL elementRemoved ( const ContainerEvent& aEvent ) throw(RuntimeException);
- virtual void SAL_CALL elementReplaced( const ContainerEvent& aEvent ) throw(RuntimeException);
-
- // lang.XEventListener
- virtual void SAL_CALL disposing( const EventObject& aEvent ) throw(RuntimeException);
-
- private:
- class UIElementFactoryManagerMap : public std::hash_map< rtl::OUString,
- rtl::OUString,
- OUStringHashCode,
- ::std::equal_to< ::rtl::OUString > >
- {
- inline void free()
- {
- UIElementFactoryManagerMap().swap( *this );
- }
- };
-
- sal_Bool impl_getElementProps( const Any& rElement, rtl::OUString& rType, rtl::OUString& rName, rtl::OUString& rModule, rtl::OUString& rServiceSpecifier ) const;
-
- rtl::OUString m_aPropType;
- rtl::OUString m_aPropName;
- rtl::OUString m_aPropModule;
- rtl::OUString m_aPropFactory;
- UIElementFactoryManagerMap m_aUIElementFactoryManagerMap;
- Reference< XMultiServiceFactory > m_xServiceManager;
- Reference< XMultiServiceFactory > m_xConfigProvider;
- Reference< XNameAccess > m_xConfigAccess;
- sal_Bool m_bConfigAccessInitialized;
-};
-
-//*****************************************************************************************************************
-// XInterface, XTypeProvider
-//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( ConfigurationAccess_UIElementFactoryManager ,
- OWeakObject ,
- DIRECT_INTERFACE ( XTypeProvider ),
- DIRECT_INTERFACE ( XContainerListener ),
- DERIVED_INTERFACE( css::lang::XEventListener, XContainerListener )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( ConfigurationAccess_UIElementFactoryManager ,
- XTypeProvider ,
- XContainerListener ,
- css::lang::XEventListener
- )
-
-ConfigurationAccess_UIElementFactoryManager::ConfigurationAccess_UIElementFactoryManager( Reference< XMultiServiceFactory >& rServiceManager ) :
+ConfigurationAccess_FactoryManager::ConfigurationAccess_FactoryManager( Reference< XMultiServiceFactory >& rServiceManager,const ::rtl::OUString& _sRoot ) :
ThreadHelpBase(),
m_aPropType( RTL_CONSTASCII_USTRINGPARAM( "Type" )),
m_aPropName( RTL_CONSTASCII_USTRINGPARAM( "Name" )),
m_aPropModule( RTL_CONSTASCII_USTRINGPARAM( "Module" )),
m_aPropFactory( RTL_CONSTASCII_USTRINGPARAM( "FactoryImplementation" )),
+ m_sRoot(_sRoot),
m_xServiceManager( rServiceManager ),
- m_bConfigAccessInitialized( sal_False )
+ m_bConfigAccessInitialized( sal_False ),
+ m_bConfigDirty(true)
{
- m_xConfigProvider = Reference< XMultiServiceFactory >( rServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationProvider" ))),
- UNO_QUERY );
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UIElementFactoryManager::ConfigurationAccess_FactoryManager" );
+ m_xConfigProvider = Reference< XMultiServiceFactory >( rServiceManager->createInstance( SERVICENAME_CFGPROVIDER),UNO_QUERY );
}
-ConfigurationAccess_UIElementFactoryManager::~ConfigurationAccess_UIElementFactoryManager()
+ConfigurationAccess_FactoryManager::~ConfigurationAccess_FactoryManager()
{
// SAFE
ResetableGuard aLock( m_aLock );
@@ -189,19 +120,20 @@ ConfigurationAccess_UIElementFactoryManager::~ConfigurationAccess_UIElementFacto
xContainer->removeContainerListener( this );
}
-rtl::OUString ConfigurationAccess_UIElementFactoryManager::getFactorySpecifierFromTypeNameModule( const rtl::OUString& rType, const rtl::OUString& rName, const rtl::OUString& rModule ) const
+rtl::OUString ConfigurationAccess_FactoryManager::getFactorySpecifierFromTypeNameModule( const rtl::OUString& rType, const rtl::OUString& rName, const rtl::OUString& rModule ) const
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UIElementFactoryManager::getFactorySpecifierFromTypeNameModule" );
// SAFE
ResetableGuard aLock( m_aLock );
- UIElementFactoryManagerMap::const_iterator pIter =
- m_aUIElementFactoryManagerMap.find( getHashKeyFromStrings( rType, rName, rModule ));
- if ( pIter != m_aUIElementFactoryManagerMap.end() )
+ FactoryManagerMap::const_iterator pIter =
+ m_aFactoryManagerMap.find( getHashKeyFromStrings( rType, rName, rModule ));
+ if ( pIter != m_aFactoryManagerMap.end() )
return pIter->second;
else
{
- pIter = m_aUIElementFactoryManagerMap.find( getHashKeyFromStrings( rType, rName, rtl::OUString() ));
- if ( pIter != m_aUIElementFactoryManagerMap.end() )
+ pIter = m_aFactoryManagerMap.find( getHashKeyFromStrings( rType, rName, rtl::OUString() ));
+ if ( pIter != m_aFactoryManagerMap.end() )
return pIter->second;
else
{
@@ -210,13 +142,13 @@ rtl::OUString ConfigurationAccess_UIElementFactoryManager::getFactorySpecifierFr
if ( nIndex > 0 )
{
rtl::OUString aName = rName.copy( 0, nIndex+1 );
- pIter = m_aUIElementFactoryManagerMap.find( getHashKeyFromStrings( rType, aName, rtl::OUString() ));
- if ( pIter != m_aUIElementFactoryManagerMap.end() )
+ pIter = m_aFactoryManagerMap.find( getHashKeyFromStrings( rType, aName, rtl::OUString() ));
+ if ( pIter != m_aFactoryManagerMap.end() )
return pIter->second;
}
- pIter = m_aUIElementFactoryManagerMap.find( getHashKeyFromStrings( rType, rtl::OUString(), rtl::OUString() ));
- if ( pIter != m_aUIElementFactoryManagerMap.end() )
+ pIter = m_aFactoryManagerMap.find( getHashKeyFromStrings( rType, rtl::OUString(), rtl::OUString() ));
+ if ( pIter != m_aFactoryManagerMap.end() )
return pIter->second;
}
}
@@ -224,49 +156,50 @@ rtl::OUString ConfigurationAccess_UIElementFactoryManager::getFactorySpecifierFr
return rtl::OUString();
}
-void ConfigurationAccess_UIElementFactoryManager::addFactorySpecifierToTypeNameModule( const rtl::OUString& rType, const rtl::OUString& rName, const rtl::OUString& rModule, const rtl::OUString& rServiceSpecifier )
+void ConfigurationAccess_FactoryManager::addFactorySpecifierToTypeNameModule( const rtl::OUString& rType, const rtl::OUString& rName, const rtl::OUString& rModule, const rtl::OUString& rServiceSpecifier )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UIElementFactoryManager::addFactorySpecifierToTypeNameModule" );
// SAFE
ResetableGuard aLock( m_aLock );
rtl::OUString aHashKey = getHashKeyFromStrings( rType, rName, rModule );
- UIElementFactoryManagerMap::const_iterator pIter =
- m_aUIElementFactoryManagerMap.find( getHashKeyFromStrings( rType, rName, rModule ));
+ FactoryManagerMap::const_iterator pIter = m_aFactoryManagerMap.find( aHashKey );
- if ( pIter != m_aUIElementFactoryManagerMap.end() )
+ if ( pIter != m_aFactoryManagerMap.end() )
throw ElementExistException();
else
- m_aUIElementFactoryManagerMap.insert( UIElementFactoryManagerMap::value_type( aHashKey, rServiceSpecifier ));
+ m_aFactoryManagerMap.insert( FactoryManagerMap::value_type( aHashKey, rServiceSpecifier ));
}
-void ConfigurationAccess_UIElementFactoryManager::removeFactorySpecifierFromTypeNameModule( const rtl::OUString& rType, const rtl::OUString& rName, const rtl::OUString& rModule )
+void ConfigurationAccess_FactoryManager::removeFactorySpecifierFromTypeNameModule( const rtl::OUString& rType, const rtl::OUString& rName, const rtl::OUString& rModule )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UIElementFactoryManager::removeFactorySpecifierFromTypeNameModule" );
// SAFE
ResetableGuard aLock( m_aLock );
rtl::OUString aHashKey = getHashKeyFromStrings( rType, rName, rModule );
- UIElementFactoryManagerMap::const_iterator pIter =
- m_aUIElementFactoryManagerMap.find( getHashKeyFromStrings( rType, rName, rModule ));
+ FactoryManagerMap::const_iterator pIter = m_aFactoryManagerMap.find( aHashKey );
- if ( pIter == m_aUIElementFactoryManagerMap.end() )
+ if ( pIter == m_aFactoryManagerMap.end() )
throw NoSuchElementException();
else
- m_aUIElementFactoryManagerMap.erase( aHashKey );
+ m_aFactoryManagerMap.erase( aHashKey );
}
-Sequence< Sequence< PropertyValue > > ConfigurationAccess_UIElementFactoryManager::getFactoriesDescription() const
+Sequence< Sequence< PropertyValue > > ConfigurationAccess_FactoryManager::getFactoriesDescription() const
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UIElementFactoryManager::getFactoriesDescription" );
// SAFE
ResetableGuard aLock( m_aLock );
Sequence< Sequence< PropertyValue > > aSeqSeq;
sal_Int32 nIndex( 0 );
- UIElementFactoryManagerMap::const_iterator pIter = m_aUIElementFactoryManagerMap.begin();
- while ( pIter != m_aUIElementFactoryManagerMap.end() )
+ FactoryManagerMap::const_iterator pIter = m_aFactoryManagerMap.begin();
+ while ( pIter != m_aFactoryManagerMap.end() )
{
rtl::OUString aFactory = pIter->first;
if ( aFactory.getLength() > 0 )
@@ -300,8 +233,9 @@ Sequence< Sequence< PropertyValue > > ConfigurationAccess_UIElementFactoryManage
}
// container.XContainerListener
-void SAL_CALL ConfigurationAccess_UIElementFactoryManager::elementInserted( const ContainerEvent& aEvent ) throw(RuntimeException)
+void SAL_CALL ConfigurationAccess_FactoryManager::elementInserted( const ContainerEvent& aEvent ) throw(RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UIElementFactoryManager::elementInserted" );
rtl::OUString aType;
rtl::OUString aName;
rtl::OUString aModule;
@@ -315,12 +249,13 @@ void SAL_CALL ConfigurationAccess_UIElementFactoryManager::elementInserted( cons
// Create hash key from type, name and module as they are together a primary key to
// the UNO service that implements a user interface factory.
rtl::OUString aHashKey( getHashKeyFromStrings( aType, aName, aModule ));
- m_aUIElementFactoryManagerMap.insert( UIElementFactoryManagerMap::value_type( aHashKey, aService ));
+ m_aFactoryManagerMap.insert( FactoryManagerMap::value_type( aHashKey, aService ));
}
}
-void SAL_CALL ConfigurationAccess_UIElementFactoryManager::elementRemoved ( const ContainerEvent& aEvent ) throw(RuntimeException)
+void SAL_CALL ConfigurationAccess_FactoryManager::elementRemoved ( const ContainerEvent& aEvent ) throw(RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UIElementFactoryManager::elementRemoved " );
rtl::OUString aType;
rtl::OUString aName;
rtl::OUString aModule;
@@ -334,12 +269,13 @@ void SAL_CALL ConfigurationAccess_UIElementFactoryManager::elementRemoved ( cons
// Create hash key from command and model as they are together a primary key to
// the UNO service that implements the popup menu controller.
rtl::OUString aHashKey( getHashKeyFromStrings( aType, aName, aModule ));
- m_aUIElementFactoryManagerMap.erase( aHashKey );
+ m_aFactoryManagerMap.erase( aHashKey );
}
}
-void SAL_CALL ConfigurationAccess_UIElementFactoryManager::elementReplaced( const ContainerEvent& aEvent ) throw(RuntimeException)
+void SAL_CALL ConfigurationAccess_FactoryManager::elementReplaced( const ContainerEvent& aEvent ) throw(RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UIElementFactoryManager::elementReplaced" );
rtl::OUString aType;
rtl::OUString aName;
rtl::OUString aModule;
@@ -353,22 +289,24 @@ void SAL_CALL ConfigurationAccess_UIElementFactoryManager::elementReplaced( cons
// Create hash key from command and model as they are together a primary key to
// the UNO service that implements the popup menu controller.
rtl::OUString aHashKey( getHashKeyFromStrings( aType, aName, aModule ));
- m_aUIElementFactoryManagerMap.erase( aHashKey );
- m_aUIElementFactoryManagerMap.insert( UIElementFactoryManagerMap::value_type( aHashKey, aService ));
+ m_aFactoryManagerMap.erase( aHashKey );
+ m_aFactoryManagerMap.insert( FactoryManagerMap::value_type( aHashKey, aService ));
}
}
// lang.XEventListener
-void SAL_CALL ConfigurationAccess_UIElementFactoryManager::disposing( const EventObject& ) throw(RuntimeException)
+void SAL_CALL ConfigurationAccess_FactoryManager::disposing( const EventObject& ) throw(RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UIElementFactoryManager::disposing" );
// SAFE
// remove our reference to the config access
ResetableGuard aLock( m_aLock );
m_xConfigAccess.clear();
}
-void ConfigurationAccess_UIElementFactoryManager::readConfigurationData()
+void ConfigurationAccess_FactoryManager::readConfigurationData()
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UIElementFactoryManager::readConfigurationData" );
// SAFE
ResetableGuard aLock( m_aLock );
@@ -378,16 +316,12 @@ void ConfigurationAccess_UIElementFactoryManager::readConfigurationData()
PropertyValue aPropValue;
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ));
- aPropValue.Value <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.UI.Factories/Registered/UIElementFactories" ));
+ aPropValue.Value <<= m_sRoot;
aArgs[0] <<= aPropValue;
try
{
- m_xConfigAccess = Reference< XNameAccess >( m_xConfigProvider->createInstanceWithArguments(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationAccess" )),
- aArgs ),
- UNO_QUERY );
+ m_xConfigAccess.set( m_xConfigProvider->createInstanceWithArguments(SERVICENAME_CFGREADACCESS,aArgs ), UNO_QUERY );
}
catch ( WrappedTargetException& )
{
@@ -400,7 +334,6 @@ void ConfigurationAccess_UIElementFactoryManager::readConfigurationData()
{
Sequence< rtl::OUString > aUIElementFactories = m_xConfigAccess->getElementNames();
- Any a;
rtl::OUString aType;
rtl::OUString aName;
rtl::OUString aModule;
@@ -414,7 +347,7 @@ void ConfigurationAccess_UIElementFactoryManager::readConfigurationData()
// Create hash key from type, name and module as they are together a primary key to
// the UNO service that implements the user interface element factory.
aHashKey = getHashKeyFromStrings( aType, aName, aModule );
- m_aUIElementFactoryManagerMap.insert( UIElementFactoryManagerMap::value_type( aHashKey, aService ));
+ m_aFactoryManagerMap.insert( FactoryManagerMap::value_type( aHashKey, aService ));
}
}
@@ -426,12 +359,11 @@ void ConfigurationAccess_UIElementFactoryManager::readConfigurationData()
}
}
-sal_Bool ConfigurationAccess_UIElementFactoryManager::impl_getElementProps( const Any& aElement, rtl::OUString& rType, rtl::OUString& rName, rtl::OUString& rModule, rtl::OUString& rServiceSpecifier ) const
+sal_Bool ConfigurationAccess_FactoryManager::impl_getElementProps( const Any& aElement, rtl::OUString& rType, rtl::OUString& rName, rtl::OUString& rModule, rtl::OUString& rServiceSpecifier ) const
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UIElementFactoryManager::impl_getElementProps" );
Reference< XPropertySet > xPropertySet;
- Reference< XNameAccess > xNameAccess;
aElement >>= xPropertySet;
- aElement >>= xNameAccess;
if ( xPropertySet.is() )
{
@@ -458,21 +390,6 @@ sal_Bool ConfigurationAccess_UIElementFactoryManager::impl_getElementProps( cons
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_4 ( UIElementFactoryManager ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XServiceInfo ),
- DIRECT_INTERFACE( ::com::sun::star::ui::XUIElementFactory ),
- DIRECT_INTERFACE( ::com::sun::star::ui::XUIElementFactoryRegistration )
- )
-
-DEFINE_XTYPEPROVIDER_4 ( UIElementFactoryManager ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- ::com::sun::star::ui::XUIElementFactory ,
- ::com::sun::star::ui::XUIElementFactoryRegistration
- )
-
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( UIElementFactoryManager ,
::cppu::OWeakObject ,
SERVICENAME_UIELEMENTFACTORYMANAGER ,
@@ -486,7 +403,8 @@ UIElementFactoryManager::UIElementFactoryManager( const Reference< XMultiService
m_bConfigRead( sal_False ),
m_xServiceManager( xServiceManager )
{
- m_pConfigAccess = new ConfigurationAccess_UIElementFactoryManager( m_xServiceManager );
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UIElementFactoryManager::UIElementFactoryManager" );
+ m_pConfigAccess = new ConfigurationAccess_FactoryManager( m_xServiceManager,rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.UI.Factories/Registered/UIElementFactories" )) );
m_pConfigAccess->acquire();
m_xModuleManager = Reference< XModuleManager >( m_xServiceManager->createInstance( SERVICENAME_MODULEMANAGER ), UNO_QUERY );
}
@@ -499,41 +417,13 @@ UIElementFactoryManager::~UIElementFactoryManager()
m_pConfigAccess->release();
}
-void UIElementFactoryManager::RetrieveTypeNameFromResourceURL( const rtl::OUString& aResourceURL, rtl::OUString& aType, rtl::OUString& aName )
-{
- const sal_Int32 RESOURCEURL_PREFIX_SIZE = 17;
- const char RESOURCEURL_PREFIX[] = "private:resource/";
-
- if (( aResourceURL.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( RESOURCEURL_PREFIX ))) == 0 ) &&
- ( aResourceURL.getLength() > RESOURCEURL_PREFIX_SIZE ))
- {
- rtl::OUString aTmpStr( aResourceURL.copy( RESOURCEURL_PREFIX_SIZE ));
- sal_Int32 nToken = 0;
- sal_Int32 nPart = 0;
- do
- {
- ::rtl::OUString sToken = aTmpStr.getToken( 0, '/', nToken);
- if ( sToken.getLength() )
- {
- if ( nPart == 0 )
- aType = sToken;
- else if ( nPart == 1 )
- aName = sToken;
- else
- break;
- nPart++;
- }
- }
- while( nToken >=0 );
- }
-}
-
// XUIElementFactory
Reference< XUIElement > SAL_CALL UIElementFactoryManager::createUIElement(
const ::rtl::OUString& ResourceURL,
const Sequence< PropertyValue >& Args )
throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UIElementFactoryManager::createUIElement" );
// SAFE
ResetableGuard aLock( m_aLock );
@@ -582,6 +472,7 @@ throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::l
Sequence< Sequence< PropertyValue > > SAL_CALL UIElementFactoryManager::getRegisteredFactories()
throw ( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UIElementFactoryManager::getRegisteredFactories" );
// SAFE
ResetableGuard aLock( m_aLock );
@@ -597,6 +488,7 @@ throw ( RuntimeException )
Reference< XUIElementFactory > SAL_CALL UIElementFactoryManager::getFactory( const ::rtl::OUString& aResourceURL, const ::rtl::OUString& aModuleId )
throw ( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UIElementFactoryManager::getFactory" );
ResetableGuard aLock( m_aLock );
if ( !m_bConfigRead )
@@ -608,7 +500,7 @@ throw ( RuntimeException )
rtl::OUString aType;
rtl::OUString aName;
- RetrieveTypeNameFromResourceURL( aResourceURL, aType, aName );
+ WindowContentFactoryManager::RetrieveTypeNameFromResourceURL( aResourceURL, aType, aName );
Reference< XMultiServiceFactory > xSManager( m_xServiceManager );
@@ -624,6 +516,7 @@ throw ( RuntimeException )
void SAL_CALL UIElementFactoryManager::registerFactory( const ::rtl::OUString& aType, const ::rtl::OUString& aName, const ::rtl::OUString& aModuleId, const ::rtl::OUString& aFactoryImplementationName )
throw ( ElementExistException, RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UIElementFactoryManager::registerFactory" );
// SAFE
ResetableGuard aLock( m_aLock );
@@ -640,6 +533,7 @@ throw ( ElementExistException, RuntimeException )
void SAL_CALL UIElementFactoryManager::deregisterFactory( const ::rtl::OUString& aType, const ::rtl::OUString& aName, const ::rtl::OUString& aModuleId )
throw ( NoSuchElementException, RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "UIElementFactoryManager::deregisterFactory" );
// SAFE
ResetableGuard aLock( m_aLock );
diff --git a/framework/source/uifactory/windowcontentfactorymanager.cxx b/framework/source/uifactory/windowcontentfactorymanager.cxx
index 3a615768b074..fcadc1694e54 100644
--- a/framework/source/uifactory/windowcontentfactorymanager.cxx
+++ b/framework/source/uifactory/windowcontentfactorymanager.cxx
@@ -35,6 +35,7 @@
// my own includes
//_________________________________________________________________________________________________________________
#include <uifactory/windowcontentfactorymanager.hxx>
+#include <uifactory/uielementfactorymanager.hxx>
#include <threadhelp/resetableguard.hxx>
#include "services.h"
@@ -74,298 +75,9 @@ using namespace ::com::sun::star;
namespace framework
{
-// global function needed by both implementations
-static rtl::OUString getHashKeyFromStrings( const rtl::OUString& aType, const rtl::OUString& aName, const rtl::OUString& aModuleName )
-{
- rtl::OUStringBuffer aKey( aType );
- aKey.appendAscii( "^" );
- aKey.append( aName );
- aKey.appendAscii( "^" );
- aKey.append( aModuleName );
- return aKey.makeStringAndClear();
-}
-
-
-//*****************************************************************************************************************
-// Configuration access class for UIElementFactoryManager implementation
-//*****************************************************************************************************************
-
-class ConfigurationAccess_WindowContentFactoryManager : // interfaces
- public lang::XTypeProvider ,
- public container::XContainerListener ,
- // baseclasses
- // Order is neccessary for right initialization!
- private ThreadHelpBase ,
- public ::cppu::OWeakObject
-{
- public:
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
-
- ConfigurationAccess_WindowContentFactoryManager( uno::Reference< lang::XMultiServiceFactory >& rServiceManager );
- virtual ~ConfigurationAccess_WindowContentFactoryManager();
-
- void readConfigurationData();
-
- rtl::OUString getFactorySpecifierFromTypeNameModule( const rtl::OUString& rType, const rtl::OUString& rName, const rtl::OUString& rModule );
-
- // container.XContainerListener
- virtual void SAL_CALL elementInserted( const container::ContainerEvent& aEvent ) throw(uno::RuntimeException);
- virtual void SAL_CALL elementRemoved ( const container::ContainerEvent& aEvent ) throw(uno::RuntimeException);
- virtual void SAL_CALL elementReplaced( const container::ContainerEvent& aEvent ) throw(uno::RuntimeException);
-
- // lang.XEventListener
- virtual void SAL_CALL disposing( const lang::EventObject& aEvent ) throw(uno::RuntimeException);
-
- private:
- class FactoryMap : public std::hash_map< rtl::OUString,
- rtl::OUString,
- OUStringHashCode,
- ::std::equal_to< ::rtl::OUString > >
- {
- inline void free()
- {
- FactoryMap().swap( *this );
- }
- };
-
- sal_Bool impl_getElementProps( const uno::Any& rElement, rtl::OUString& rType, rtl::OUString& rName, rtl::OUString& rModule, rtl::OUString& rServiceSpecifier ) const;
-
- rtl::OUString m_aPropType;
- rtl::OUString m_aPropName;
- rtl::OUString m_aPropModule;
- rtl::OUString m_aPropFactory;
- FactoryMap m_aFactoryMap;
- uno::Reference< lang::XMultiServiceFactory > m_xServiceManager;
- uno::Reference< lang::XMultiServiceFactory > m_xConfigProvider;
- uno::Reference< container::XNameAccess > m_xConfigAccess;
- bool m_bConfigAccessInitialized;
- bool m_bConfigDirty;
-};
-
-//*****************************************************************************************************************
-// XInterface, XTypeProvider
-//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( ConfigurationAccess_WindowContentFactoryManager ,
- OWeakObject ,
- DIRECT_INTERFACE ( lang::XTypeProvider ),
- DIRECT_INTERFACE ( container::XContainerListener ),
- DERIVED_INTERFACE( lang::XEventListener, XContainerListener )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( ConfigurationAccess_WindowContentFactoryManager ,
- lang::XTypeProvider ,
- container::XContainerListener ,
- lang::XEventListener
- )
-
-ConfigurationAccess_WindowContentFactoryManager::ConfigurationAccess_WindowContentFactoryManager( uno::Reference< lang::XMultiServiceFactory >& rServiceManager ) :
- ThreadHelpBase(),
- m_aPropType( RTL_CONSTASCII_USTRINGPARAM( "Type" )),
- m_aPropName( RTL_CONSTASCII_USTRINGPARAM( "Name" )),
- m_aPropModule( RTL_CONSTASCII_USTRINGPARAM( "Module" )),
- m_aPropFactory( RTL_CONSTASCII_USTRINGPARAM( "FactoryImplementation" )),
- m_xServiceManager( rServiceManager ),
- m_bConfigAccessInitialized( false ),
- m_bConfigDirty( true )
-{
- m_xConfigProvider = uno::Reference< lang::XMultiServiceFactory >( rServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationProvider" ))),
- uno::UNO_QUERY );
-}
-
-ConfigurationAccess_WindowContentFactoryManager::~ConfigurationAccess_WindowContentFactoryManager()
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- uno::Reference< container::XContainer > xContainer( m_xConfigAccess, uno::UNO_QUERY );
- if ( xContainer.is() )
- xContainer->removeContainerListener( this );
-}
-
-rtl::OUString ConfigurationAccess_WindowContentFactoryManager::getFactorySpecifierFromTypeNameModule( const rtl::OUString& rType, const rtl::OUString& rName, const rtl::OUString& rModule )
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- // Make sure that we read the configuration data at least once.
- // May be more dependent on the dirty flag!
- readConfigurationData();
-
- FactoryMap::const_iterator pIter =
- m_aFactoryMap.find( getHashKeyFromStrings( rType, rName, rModule ));
- if ( pIter != m_aFactoryMap.end() )
- return pIter->second;
- else
- {
- pIter = m_aFactoryMap.find( getHashKeyFromStrings( rType, rName, rtl::OUString() ));
- if ( pIter != m_aFactoryMap.end() )
- return pIter->second;
- else
- {
- // Support factories which uses a defined prefix for their element names.
- sal_Int32 nIndex = rName.indexOf( '_' );
- if ( nIndex > 0 )
- {
- rtl::OUString aName = rName.copy( 0, nIndex );
- pIter = m_aFactoryMap.find( getHashKeyFromStrings( rType, aName, rtl::OUString() ));
- if ( pIter != m_aFactoryMap.end() )
- return pIter->second;
- }
-
- pIter = m_aFactoryMap.find( getHashKeyFromStrings( rType, rtl::OUString(), rtl::OUString() ));
- if ( pIter != m_aFactoryMap.end() )
- return pIter->second;
- }
- }
-
- return rtl::OUString();
-}
-
-// container.XContainerListener
-void SAL_CALL ConfigurationAccess_WindowContentFactoryManager::elementInserted( const container::ContainerEvent& ) throw(uno::RuntimeException)
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
- m_bConfigDirty = true;
-}
-
-void SAL_CALL ConfigurationAccess_WindowContentFactoryManager::elementRemoved ( const container::ContainerEvent& ) throw(uno::RuntimeException)
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
- m_bConfigDirty = true;
-}
-
-void SAL_CALL ConfigurationAccess_WindowContentFactoryManager::elementReplaced( const container::ContainerEvent& ) throw(uno::RuntimeException)
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
- m_bConfigDirty = true;
-}
-
-// lang.XEventListener
-void SAL_CALL ConfigurationAccess_WindowContentFactoryManager::disposing( const lang::EventObject& ) throw(uno::RuntimeException)
-{
- // SAFE
- // remove our reference to the config access
- ResetableGuard aLock( m_aLock );
- m_xConfigAccess.clear();
-}
-
-void ConfigurationAccess_WindowContentFactoryManager::readConfigurationData()
-{
- // SAFE
- ResetableGuard aLock( m_aLock );
-
- bool bConfigAccessInitialized(m_bConfigAccessInitialized);
- if ( !m_bConfigAccessInitialized )
- {
- uno::Sequence< uno::Any > aArgs( 1 );
- beans::PropertyValue aPropValue;
-
- aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ));
- aPropValue.Value <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.UI.WindowContentFactories/Registered/ContentFactories" ));
- aArgs[0] <<= aPropValue;
-
- try
- {
- m_xConfigAccess = uno::Reference< container::XNameAccess >( m_xConfigProvider->createInstanceWithArguments(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationAccess" )),
- aArgs ),
- uno::UNO_QUERY );
- }
- catch ( lang::WrappedTargetException& )
- {
- }
-
- m_bConfigAccessInitialized = sal_True;
- }
-
- if ( m_xConfigAccess.is() && m_bConfigDirty )
- {
- uno::Sequence< rtl::OUString > aUIElementFactories = m_xConfigAccess->getElementNames();
-
- uno::Any a;
- rtl::OUString aType;
- rtl::OUString aName;
- rtl::OUString aModule;
- rtl::OUString aService;
- rtl::OUString aHashKey;
-
- uno::Reference< beans::XPropertySet > xPropertySet;
-
- m_aFactoryMap.clear();
- for ( sal_Int32 i = 0; i < aUIElementFactories.getLength(); i++ )
- {
- if ( impl_getElementProps( m_xConfigAccess->getByName( aUIElementFactories[i] ), aType, aName, aModule, aService ))
- {
- // Create hash key from type, name and module as they are together a primary key to
- // the UNO service that implements the user interface element factory.
- aHashKey = getHashKeyFromStrings( aType, aName, aModule );
- m_aFactoryMap.insert( FactoryMap::value_type( aHashKey, aService ));
- }
- }
-
- uno::Reference< container::XContainer > xContainer( m_xConfigAccess, uno::UNO_QUERY );
- m_bConfigDirty = false;
-
- aLock.unlock();
- // UNSAFE
-
- if ( xContainer.is() && !bConfigAccessInitialized)
- xContainer->addContainerListener( this );
- }
-}
-
-sal_Bool ConfigurationAccess_WindowContentFactoryManager::impl_getElementProps( const uno::Any& aElement, rtl::OUString& rType, rtl::OUString& rName, rtl::OUString& rModule, rtl::OUString& rServiceSpecifier ) const
-{
- uno::Reference< beans::XPropertySet > xPropertySet;
- uno::Reference< container::XNameAccess > xNameAccess;
- aElement >>= xPropertySet;
- aElement >>= xNameAccess;
-
- if ( xPropertySet.is() )
- {
- try
- {
- xPropertySet->getPropertyValue( m_aPropType ) >>= rType;
- xPropertySet->getPropertyValue( m_aPropName ) >>= rName;
- xPropertySet->getPropertyValue( m_aPropModule ) >>= rModule;
- xPropertySet->getPropertyValue( m_aPropFactory ) >>= rServiceSpecifier;
- }
- catch ( beans::UnknownPropertyException& )
- {
- return sal_False;
- }
- catch ( lang::WrappedTargetException& )
- {
- return sal_False;
- }
- }
-
- return sal_True;
-}
-
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( WindowContentFactoryManager ,
- OWeakObject ,
- DIRECT_INTERFACE( lang::XTypeProvider ),
- DIRECT_INTERFACE( lang::XServiceInfo ),
- DIRECT_INTERFACE( lang::XSingleComponentFactory )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( WindowContentFactoryManager ,
- lang::XTypeProvider ,
- lang::XServiceInfo ,
- lang::XSingleComponentFactory
- )
-
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( WindowContentFactoryManager ,
::cppu::OWeakObject ,
SERVICENAME_WINDOWCONTENTFACTORYMANAGER ,
@@ -379,7 +91,7 @@ WindowContentFactoryManager::WindowContentFactoryManager( const uno::Reference<
m_bConfigRead( sal_False ),
m_xServiceManager( xServiceManager )
{
- m_pConfigAccess = new ConfigurationAccess_WindowContentFactoryManager( m_xServiceManager );
+ m_pConfigAccess = new ConfigurationAccess_FactoryManager( m_xServiceManager,rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.UI.WindowContentFactories/Registered/ContentFactories" )) );
m_pConfigAccess->acquire();
m_xModuleManager = uno::Reference< frame::XModuleManager >( m_xServiceManager->createInstance( SERVICENAME_MODULEMANAGER ), uno::UNO_QUERY );
}
diff --git a/framework/source/xml/eventsconfiguration.cxx b/framework/source/xml/eventsconfiguration.cxx
index 9e29ac33057f..beebd7963dfe 100644
--- a/framework/source/xml/eventsconfiguration.cxx
+++ b/framework/source/xml/eventsconfiguration.cxx
@@ -32,6 +32,7 @@
#include "precompiled_framework.hxx"
#include <xml/eventsconfiguration.hxx>
#include <xml/eventsdocumenthandler.hxx>
+#include <services.h>
#ifndef __FRAMEWORK_XML_SAXNAMESPACEFILTER_HXX_
#include <xml/saxnamespacefilter.hxx>
@@ -74,8 +75,8 @@ static Reference< XParser > GetSaxParser(
)
{
//Reference< XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory();
- //return Reference< XParser >( xServiceManager->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Parser" )), UNO_QUERY);
- return Reference< XParser >( xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Parser" )), UNO_QUERY);
+ //return Reference< XParser >( xServiceManager->createInstance( SERVICENAME_SAXPARSER), UNO_QUERY);
+ return Reference< XParser >( xServiceFactory->createInstance( SERVICENAME_SAXPARSER), UNO_QUERY);
}
static Reference< XDocumentHandler > GetSaxWriter(
@@ -84,8 +85,8 @@ static Reference< XDocumentHandler > GetSaxWriter(
)
{
//Reference< XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory();
- //return Reference< XDocumentHandler >( xServiceManager->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" )), UNO_QUERY) ;
- return Reference< XDocumentHandler >( xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" )), UNO_QUERY) ;
+ //return Reference< XDocumentHandler >( xServiceManager->createInstance( SERVICENAME_SAXWRITER), UNO_QUERY) ;
+ return Reference< XDocumentHandler >( xServiceFactory->createInstance( SERVICENAME_SAXWRITER), UNO_QUERY) ;
}
// #110897#
diff --git a/framework/source/xml/eventsdocumenthandler.cxx b/framework/source/xml/eventsdocumenthandler.cxx
index 896ea6eab3d6..a741b2096e86 100644
--- a/framework/source/xml/eventsdocumenthandler.cxx
+++ b/framework/source/xml/eventsdocumenthandler.cxx
@@ -128,7 +128,6 @@ static EventEntryProperty EventEntries[OReadEventsDocumentHandler::EV_XML_ENTRY_
OReadEventsDocumentHandler::OReadEventsDocumentHandler( EventsConfig& aItems ) :
ThreadHelpBase( &Application::GetSolarMutex() ),
- ::cppu::OWeakObject(),
m_aEventItems( aItems )
{
::rtl::OUString aNamespaceEvent( RTL_CONSTASCII_USTRINGPARAM( XMLNS_EVENT ));
@@ -163,18 +162,6 @@ OReadEventsDocumentHandler::~OReadEventsDocumentHandler()
{
}
-Any SAL_CALL OReadEventsDocumentHandler::queryInterface( const Type & rType )
-throw( RuntimeException )
-{
- Any a = ::cppu::queryInterface(
- rType ,
- SAL_STATIC_CAST( XDocumentHandler*, this ));
- if ( a.hasValue() )
- return a;
-
- return OWeakObject::queryInterface( rType );
-}
-
// XDocumentHandler
void SAL_CALL OReadEventsDocumentHandler::startDocument(void)
throw ( SAXException, RuntimeException )
diff --git a/framework/source/xml/imagesconfiguration.cxx b/framework/source/xml/imagesconfiguration.cxx
index 00a71793d543..9f35a522677c 100644
--- a/framework/source/xml/imagesconfiguration.cxx
+++ b/framework/source/xml/imagesconfiguration.cxx
@@ -31,6 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_framework.hxx"
#include <xml/imagesconfiguration.hxx>
+#include <services.h>
#ifndef __FRAMEWORK_CLASSES_IMAGESDOCUMENTHANDLER_HXX_
#include <xml/imagesdocumenthandler.hxx>
@@ -78,8 +79,8 @@ static Reference< XParser > GetSaxParser(
)
{
//Reference< XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory();
- //return Reference< XParser >( xServiceManager->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Parser" )), UNO_QUERY);
- return Reference< XParser >( xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Parser" )), UNO_QUERY);
+ //return Reference< XParser >( xServiceManager->createInstance( SERVICENAME_SAXPARSER), UNO_QUERY);
+ return Reference< XParser >( xServiceFactory->createInstance( SERVICENAME_SAXPARSER), UNO_QUERY);
}
static Reference< XDocumentHandler > GetSaxWriter(
@@ -88,8 +89,8 @@ static Reference< XDocumentHandler > GetSaxWriter(
)
{
//Reference< XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory();
- //return Reference< XDocumentHandler >( xServiceManager->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" )), UNO_QUERY) ;
- return Reference< XDocumentHandler >( xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" )), UNO_QUERY) ;
+ //return Reference< XDocumentHandler >( xServiceManager->createInstance( SERVICENAME_SAXWRITER), UNO_QUERY) ;
+ return Reference< XDocumentHandler >( xServiceFactory->createInstance( SERVICENAME_SAXWRITER), UNO_QUERY) ;
}
// #110897#
diff --git a/framework/source/xml/imagesdocumenthandler.cxx b/framework/source/xml/imagesdocumenthandler.cxx
index dccf4421ee89..eff0a1f45ab5 100644
--- a/framework/source/xml/imagesdocumenthandler.cxx
+++ b/framework/source/xml/imagesdocumenthandler.cxx
@@ -134,7 +134,6 @@ ImageXMLEntryProperty ImagesEntries[OReadImagesDocumentHandler::IMG_XML_ENTRY_CO
OReadImagesDocumentHandler::OReadImagesDocumentHandler( ImageListsDescriptor& aItems ) :
ThreadHelpBase( &Application::GetSolarMutex() ),
- ::cppu::OWeakObject(),
m_aImageList( aItems ),
m_pImages( 0 ),
m_pExternalImages( 0 )
@@ -175,18 +174,6 @@ OReadImagesDocumentHandler::~OReadImagesDocumentHandler()
{
}
-Any SAL_CALL OReadImagesDocumentHandler::queryInterface( const Type & rType )
-throw( RuntimeException )
-{
- Any a = ::cppu::queryInterface(
- rType ,
- SAL_STATIC_CAST( XDocumentHandler*, this ));
- if ( a.hasValue() )
- return a;
-
- return OWeakObject::queryInterface( rType );
-}
-
// XDocumentHandler
void SAL_CALL OReadImagesDocumentHandler::startDocument(void)
throw ( SAXException, RuntimeException )
diff --git a/framework/source/xml/menuconfiguration.cxx b/framework/source/xml/menuconfiguration.cxx
index fdbbb5195171..7b0520219ef6 100644
--- a/framework/source/xml/menuconfiguration.cxx
+++ b/framework/source/xml/menuconfiguration.cxx
@@ -42,6 +42,7 @@
#include <classes/addonmenu.hxx>
#include <xml/menudocumenthandler.hxx>
#include <xml/saxnamespacefilter.hxx>
+#include <services.h>
#ifndef _FRAMEWORK_SERVICES_LAYOUTMANAGER_HXX_
#include <services/layoutmanager.hxx>
@@ -99,9 +100,7 @@ Reference< XIndexAccess > MenuConfiguration::CreateMenuBarConfigurationFromXML(
Reference< XInputStream >& rInputStream )
throw ( WrappedTargetException )
{
- Reference< XParser > xParser( m_rxServiceManager->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Parser" ))),
- UNO_QUERY);
+ Reference< XParser > xParser( m_rxServiceManager->createInstance(SERVICENAME_SAXPARSER),UNO_QUERY);
// connect stream to input stream to the parser
InputSource aInputSource;
@@ -167,7 +166,7 @@ throw ( WrappedTargetException )
Reference< XDocumentHandler > xWriter;
xWriter = Reference< XDocumentHandler >( m_rxServiceManager->createInstance(
- ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" )), UNO_QUERY) ;
+ SERVICENAME_SAXWRITER), UNO_QUERY) ;
Reference< XActiveDataSource> xDataSource( xWriter , UNO_QUERY );
xDataSource->setOutputStream( rOutputStream );
diff --git a/framework/source/xml/menudocumenthandler.cxx b/framework/source/xml/menudocumenthandler.cxx
index 91363764cfa3..2422d516d0ac 100644
--- a/framework/source/xml/menudocumenthandler.cxx
+++ b/framework/source/xml/menudocumenthandler.cxx
@@ -47,7 +47,6 @@
#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
#include <com/sun/star/lang/XSingleComponentFactory.hpp>
#include <com/sun/star/ui/ItemType.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -55,7 +54,7 @@
// other includes
//_________________________________________________________________________________________________________________
#include <comphelper/processfactory.hxx>
-
+#include <rtl/logfile.hxx>
#include <comphelper/attributelist.hxx>
//_________________________________________________________________________________________________________________
@@ -174,19 +173,6 @@ ReadMenuDocumentHandlerBase::~ReadMenuDocumentHandlerBase()
{
}
-Any SAL_CALL ReadMenuDocumentHandlerBase::queryInterface(
- const Type & rType )
-throw( RuntimeException )
-{
- Any a = ::cppu::queryInterface(
- rType ,
- SAL_STATIC_CAST( XDocumentHandler*, this ));
- if ( a.hasValue() )
- return a;
-
- return OWeakObject::queryInterface( rType );
-}
-
void SAL_CALL ReadMenuDocumentHandlerBase::ignorableWhitespace(
const ::rtl::OUString& )
throw( SAXException, RuntimeException )
@@ -607,14 +593,15 @@ throw( SAXException, RuntimeException )
m_bMenuMode = sal_True;
// Container must be factory to create sub container
- Reference< XComponentContext > xComponentContext;
- Reference< XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY );
- xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))) >>=
- xComponentContext;
+ if ( !m_xComponentContext.is() )
+ {
+ const Reference< XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
+ m_xComponentContext.set(xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY_THROW );
+ }
Reference< XIndexContainer > xSubItemContainer;
if ( m_xContainerFactory.is() )
- xSubItemContainer = Reference< XIndexContainer >( m_xContainerFactory->createInstanceWithContext( xComponentContext ), UNO_QUERY );
+ xSubItemContainer = Reference< XIndexContainer >( m_xContainerFactory->createInstanceWithContext( m_xComponentContext ), UNO_QUERY );
// read attributes for menu
for ( sal_Int16 i=0; i< xAttrList->getLength(); i++ )
diff --git a/framework/source/xml/saxnamespacefilter.cxx b/framework/source/xml/saxnamespacefilter.cxx
index 03108924c0ad..46c69fb750ea 100644
--- a/framework/source/xml/saxnamespacefilter.cxx
+++ b/framework/source/xml/saxnamespacefilter.cxx
@@ -43,6 +43,7 @@
#include <comphelper/attributelist.hxx>
#include <vcl/svapp.hxx>
+#include <rtl/logfile.hxx>
using namespace ::com::sun::star::xml::sax;
using namespace ::com::sun::star::uno;
@@ -54,7 +55,7 @@ namespace framework{
SaxNamespaceFilter::SaxNamespaceFilter( Reference< XDocumentHandler >& rSax1DocumentHandler ) :
- ThreadHelpBase( &Application::GetSolarMutex() ), OWeakObject(),
+ ThreadHelpBase( &Application::GetSolarMutex() ),
m_xLocator( 0 ),
xDocumentHandler( rSax1DocumentHandler ),
m_nDepth( 0 )
@@ -65,17 +66,6 @@ SaxNamespaceFilter::~SaxNamespaceFilter()
{
}
-Any SAL_CALL SaxNamespaceFilter::queryInterface( const Type & rType ) throw( RuntimeException )
-{
- Any a = ::cppu::queryInterface(
- rType ,
- SAL_STATIC_CAST( XDocumentHandler*, this ));
- if ( a.hasValue() )
- return a;
-
- return OWeakObject::queryInterface( rType );
-}
-
// XDocumentHandler
void SAL_CALL SaxNamespaceFilter::startDocument(void)
throw ( SAXException, RuntimeException )
@@ -92,7 +82,7 @@ void SAL_CALL SaxNamespaceFilter::startElement(
throw( SAXException, RuntimeException )
{
XMLNamespaces aXMLNamespaces;
- if ( m_aNamespaceStack.size() > 0 )
+ if ( !m_aNamespaceStack.empty() )
aXMLNamespaces = m_aNamespaceStack.top();
::comphelper::AttributeList* pNewList = new ::comphelper::AttributeList();
diff --git a/framework/source/xml/statusbarconfiguration.cxx b/framework/source/xml/statusbarconfiguration.cxx
index a568251e74ca..352f17e21fbf 100644
--- a/framework/source/xml/statusbarconfiguration.cxx
+++ b/framework/source/xml/statusbarconfiguration.cxx
@@ -34,6 +34,7 @@
#include <xml/statusbarconfiguration.hxx>
#include <xml/statusbardocumenthandler.hxx>
#include <xml/saxnamespacefilter.hxx>
+#include <services.h>
//_________________________________________________________________________________________________________________
// interface includes
@@ -73,14 +74,14 @@ static Reference< XParser > GetSaxParser(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory
)
{
- return Reference< XParser >( xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Parser" )), UNO_QUERY);
+ return Reference< XParser >( xServiceFactory->createInstance( SERVICENAME_SAXPARSER), UNO_QUERY);
}
static Reference< XDocumentHandler > GetSaxWriter(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory
)
{
- return Reference< XDocumentHandler >( xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" )), UNO_QUERY) ;
+ return Reference< XDocumentHandler >( xServiceFactory->createInstance( SERVICENAME_SAXWRITER), UNO_QUERY) ;
}
sal_Bool StatusBarConfiguration::LoadStatusBar(
diff --git a/framework/source/xml/statusbardocumenthandler.cxx b/framework/source/xml/statusbardocumenthandler.cxx
index 710526387bbe..cf5793a80903 100644
--- a/framework/source/xml/statusbardocumenthandler.cxx
+++ b/framework/source/xml/statusbardocumenthandler.cxx
@@ -179,7 +179,6 @@ StatusBarEntryProperty StatusBarEntries[OReadStatusBarDocumentHandler::SB_XML_EN
OReadStatusBarDocumentHandler::OReadStatusBarDocumentHandler(
const Reference< XIndexContainer >& rStatusBarItems ) :
ThreadHelpBase( &Application::GetSolarMutex() ),
- ::cppu::OWeakObject(),
m_aStatusBarItems( rStatusBarItems )
{
::rtl::OUString aNamespaceStatusBar( RTL_CONSTASCII_USTRINGPARAM( XMLNS_STATUSBAR ));
@@ -214,18 +213,6 @@ OReadStatusBarDocumentHandler::~OReadStatusBarDocumentHandler()
{
}
-Any SAL_CALL OReadStatusBarDocumentHandler::queryInterface( const Type & rType )
-throw( RuntimeException )
-{
- Any a = ::cppu::queryInterface(
- rType ,
- SAL_STATIC_CAST( XDocumentHandler*, this ));
- if ( a.hasValue() )
- return a;
-
- return OWeakObject::queryInterface( rType );
-}
-
// XDocumentHandler
void SAL_CALL OReadStatusBarDocumentHandler::startDocument(void)
throw ( SAXException, RuntimeException )
@@ -428,11 +415,11 @@ throw( SAXException, RuntimeException )
aStatusbarItemProp[4].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_WIDTH ));
aStatusbarItemProp[5].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ));
- aStatusbarItemProp[0].Value = makeAny( aCommandURL );
- aStatusbarItemProp[1].Value = makeAny( aHelpURL );
- aStatusbarItemProp[2].Value = makeAny( nOffset );
- aStatusbarItemProp[3].Value = makeAny( nItemBits );
- aStatusbarItemProp[4].Value = makeAny( nWidth );
+ aStatusbarItemProp[0].Value <<= aCommandURL;
+ aStatusbarItemProp[1].Value <<= aHelpURL;
+ aStatusbarItemProp[2].Value <<= nOffset;
+ aStatusbarItemProp[3].Value <<= nItemBits;
+ aStatusbarItemProp[4].Value <<= nWidth;
aStatusbarItemProp[5].Value = makeAny( ::com::sun::star::ui::ItemType::DEFAULT );
m_aStatusBarItems->insertByIndex( m_aStatusBarItems->getCount(), makeAny( aStatusbarItemProp ) );
diff --git a/framework/source/xml/toolboxconfiguration.cxx b/framework/source/xml/toolboxconfiguration.cxx
index 3381912a50e0..1c6ba1e1cfab 100644
--- a/framework/source/xml/toolboxconfiguration.cxx
+++ b/framework/source/xml/toolboxconfiguration.cxx
@@ -35,6 +35,7 @@
#include <xml/toolboxdocumenthandler.hxx>
#include <xml/toolboxlayoutdocumenthandler.hxx>
#include <xml/saxnamespacefilter.hxx>
+#include <services.h>
//_________________________________________________________________________________________________________________
// interface includes
@@ -73,7 +74,7 @@ static Reference< XParser > GetSaxParser(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory
)
{
- return Reference< XParser >( xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Parser" )), UNO_QUERY);
+ return Reference< XParser >( xServiceFactory->createInstance( SERVICENAME_SAXPARSER), UNO_QUERY);
}
static Reference< XDocumentHandler > GetSaxWriter(
@@ -81,7 +82,7 @@ static Reference< XDocumentHandler > GetSaxWriter(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory
)
{
- return Reference< XDocumentHandler >( xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" )), UNO_QUERY) ;
+ return Reference< XDocumentHandler >( xServiceFactory->createInstance( SERVICENAME_SAXWRITER), UNO_QUERY) ;
}
// #110897#
diff --git a/framework/source/xml/toolboxdocumenthandler.cxx b/framework/source/xml/toolboxdocumenthandler.cxx
index 1bcf1b0a8295..78d6f8158413 100644
--- a/framework/source/xml/toolboxdocumenthandler.cxx
+++ b/framework/source/xml/toolboxdocumenthandler.cxx
@@ -140,7 +140,6 @@ ToolBarEntryProperty ToolBoxEntries[OReadToolBoxDocumentHandler::TB_XML_ENTRY_CO
OReadToolBoxDocumentHandler::OReadToolBoxDocumentHandler( const Reference< XIndexContainer >& rItemContainer ) :
ThreadHelpBase( &Application::GetSolarMutex() ),
- ::cppu::OWeakObject(),
m_rItemContainer( rItemContainer ),
m_aType( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE )),
m_aLabel( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL )),
@@ -193,18 +192,6 @@ OReadToolBoxDocumentHandler::~OReadToolBoxDocumentHandler()
{
}
-Any SAL_CALL OReadToolBoxDocumentHandler::queryInterface( const Type & rType )
-throw( RuntimeException )
-{
- Any a = ::cppu::queryInterface(
- rType ,
- SAL_STATIC_CAST( XDocumentHandler*, this ));
- if ( a.hasValue() )
- return a;
-
- return OWeakObject::queryInterface( rType );
-}
-
// XDocumentHandler
void SAL_CALL OReadToolBoxDocumentHandler::startDocument(void)
throw ( SAXException, RuntimeException )
@@ -435,12 +422,12 @@ throw( SAXException, RuntimeException )
aToolbarItemProp[4].Name = m_aStyle;
aToolbarItemProp[5].Name = m_aIsVisible;
- aToolbarItemProp[0].Value = makeAny( aCommandURL );
- aToolbarItemProp[1].Value = makeAny( aHelpURL );
- aToolbarItemProp[2].Value = makeAny( aLabel );
+ aToolbarItemProp[0].Value <<= aCommandURL;
+ aToolbarItemProp[1].Value <<= aHelpURL;
+ aToolbarItemProp[2].Value <<= aLabel;
aToolbarItemProp[3].Value = makeAny( ::com::sun::star::ui::ItemType::DEFAULT );
- aToolbarItemProp[4].Value = makeAny( nItemBits );
- aToolbarItemProp[5].Value = makeAny( bVisible );
+ aToolbarItemProp[4].Value <<= nItemBits;
+ aToolbarItemProp[5].Value <<= bVisible;
m_rItemContainer->insertByIndex( m_rItemContainer->getCount(), makeAny( aToolbarItemProp ) );
}
@@ -693,8 +680,7 @@ void OWriteToolBoxDocumentHandler::WriteToolBoxDocument() throw
{
try
{
- Any a = xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UIName" )));
- a >>= aUIName;
+ xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UIName" ))) >>= aUIName;
}
catch ( UnknownPropertyException& )
{
diff --git a/framework/util/makefile.mk b/framework/util/makefile.mk
index 94409ace992e..60a44dba706f 100644
--- a/framework/util/makefile.mk
+++ b/framework/util/makefile.mk
@@ -60,6 +60,8 @@ LIB1OBJFILES= \
$(SLO)$/rootitemcontainer.obj \
$(SLO)$/constitemcontainer.obj \
$(SLO)$/jobconst.obj \
+ $(SLO)$/popupmenucontrollerbase.obj \
+ $(SLO)$/mischelper.obj \
$(SLO)$/propertysethelper.obj
@@ -118,6 +120,8 @@ SHL1STDLIBS= \
$(CPPUHELPERLIB) \
$(TOOLSLIB) \
$(VOSLIB) \
+ $(VCLLIB) \
+ $(TKLIB) \
$(CPPULIB) \
$(SALLIB)
@@ -174,12 +178,36 @@ SHL3IMPLIB= ifwl
SHL3OBJS= $(SLO)$/mediatypedetectionhelper.obj\
$(SLO)$/registertemp.obj \
- $(SLO)$/substitutepathvars.obj \
- $(SLO)$/pathsettings.obj
+ $(SLO)$/mailtodispatcher.obj \
+ $(SLO)$/oxt_handler.obj \
+ $(SLO)$/toolbarsmenucontroller.obj \
+ $(SLO)$/newmenucontroller.obj \
+ $(SLO)$/macrosmenucontroller.obj \
+ $(SLO)$/langselectionmenucontroller.obj \
+ $(SLO)$/headermenucontroller.obj \
+ $(SLO)$/footermenucontroller.obj \
+ $(SLO)$/fontsizemenucontroller.obj \
+ $(SLO)$/fontmenucontroller.obj \
+ $(SLO)$/tabwindowservice.obj \
+ $(SLO)$/fwktabwindow.obj \
+ $(SLO)$/logotextstatusbarcontroller.obj \
+ $(SLO)$/fwlresid.obj \
+ $(SLO)$/logoimagestatusbarcontroller.obj \
+ $(SLO)$/simpletextstatusbarcontroller.obj \
+ $(SLO)$/uriabbreviation.obj \
+ $(SLO)$/servicehandler.obj \
+ $(SLO)$/license.obj \
+ $(SLO)$/dispatchrecorder.obj \
+ $(SLO)$/dispatchrecordersupplier.obj\
+ $(SLO)$/dispatchhelper.obj \
+ $(SLO)$/popupmenudispatcher.obj \
SHL3STDLIBS= \
$(FWILIB) \
+ $(FWELIB) \
$(SVLLIB) \
+ $(TKLIB) \
+ $(SVTOOLLIB) \
$(UNOTOOLSLIB) \
$(TOOLSLIB) \
$(I18NISOLANGLIB) \
@@ -187,10 +215,11 @@ SHL3STDLIBS= \
$(CPPUHELPERLIB) \
$(COMPHELPERLIB) \
$(CPPULIB) \
+ $(VCLLIB) \
$(SALLIB)
SHL3DEF= $(MISC)$/$(SHL3TARGET).def
-SHL3DEPN= $(SHL1IMPLIBN) $(SHL1TARGETN)
+SHL3DEPN= $(SHL1IMPLIBN) $(SHL1TARGETN) $(SHL2TARGETN)
DEF3NAME= $(SHL3TARGET)
@@ -222,20 +251,15 @@ SHL4OBJS= \
$(SLO)$/contenthandler.obj \
$(SLO)$/controlmenucontroller.obj \
$(SLO)$/desktop.obj \
- $(SLO)$/dispatchhelper.obj \
$(SLO)$/dispatchinformationprovider.obj \
$(SLO)$/dispatchprovider.obj \
- $(SLO)$/dispatchrecorder.obj \
- $(SLO)$/dispatchrecordersupplier.obj\
$(SLO)$/dockingareadefaultacceptor.obj \
$(SLO)$/documentacceleratorconfiguration.obj \
$(SLO)$/dropdownboxtoolbarcontroller.obj \
$(SLO)$/droptargetlistener.obj \
- $(SLO)$/edittoolbarcontroller.obj \
+ $(SLO)$/edittoolbarcontroller.obj \
+ $(SLO)$/factoryconfiguration.obj \
$(SLO)$/filter.obj \
- $(SLO)$/fontmenucontroller.obj \
- $(SLO)$/fontsizemenucontroller.obj \
- $(SLO)$/footermenucontroller.obj \
$(SLO)$/framecontainer.obj \
$(SLO)$/frameloader.obj \
$(SLO)$/frame.obj \
@@ -243,10 +267,10 @@ SHL4OBJS= \
$(SLO)$/globalacceleratorconfiguration.obj \
$(SLO)$/globalsettings.obj \
$(SLO)$/graphicnameaccess.obj \
- $(SLO)$/headermenucontroller.obj \
$(SLO)$/helpagentdispatcher.obj \
$(SLO)$/imagebuttontoolbarcontroller.obj \
$(SLO)$/imagemanager.obj \
+ $(SLO)$/imagemanagerimpl.obj \
$(SLO)$/interceptionhelper.obj \
$(SLO)$/jobdata.obj \
$(SLO)$/jobdispatch.obj \
@@ -255,46 +279,34 @@ SHL4OBJS= \
$(SLO)$/jobresult.obj \
$(SLO)$/joburl.obj \
$(SLO)$/keymapping.obj \
- $(SLO)$/langselectionmenucontroller.obj \
$(SLO)$/langselectionstatusbarcontroller.obj \
$(SLO)$/layoutmanager.obj \
- $(SLO)$/license.obj \
$(SLO)$/loaddispatcher.obj \
$(SLO)$/loaddispatchlistener.obj \
$(SLO)$/loadenv.obj \
- $(SLO)$/logoimagestatusbarcontroller.obj \
- $(SLO)$/logotextstatusbarcontroller.obj \
- $(SLO)$/macrosmenucontroller.obj \
- $(SLO)$/mailtodispatcher.obj \
$(SLO)$/menubarfactory.obj \
$(SLO)$/menubarmanager.obj \
$(SLO)$/menubarmerger.obj \
$(SLO)$/menubarwrapper.obj \
$(SLO)$/menudispatcher.obj \
$(SLO)$/menumanager.obj \
- $(SLO)$/mischelper.obj \
$(SLO)$/moduleacceleratorconfiguration.obj \
$(SLO)$/moduleimagemanager.obj \
$(SLO)$/modulemanager.obj \
$(SLO)$/moduleuicfgsupplier.obj \
$(SLO)$/moduleuiconfigurationmanager.obj \
- $(SLO)$/newmenucontroller.obj \
$(SLO)$/objectmenucontroller.obj \
$(SLO)$/ocomponentaccess.obj \
$(SLO)$/ocomponentenumeration.obj \
$(SLO)$/oframes.obj \
- $(SLO)$/oxt_handler.obj \
+ $(SLO)$/pathsettings.obj \
$(SLO)$/persistentwindowstate.obj \
- $(SLO)$/popupmenucontrollerbase.obj \
$(SLO)$/popupmenucontrollerfactory.obj\
- $(SLO)$/popupmenudispatcher.obj \
$(SLO)$/presethandler.obj \
$(SLO)$/progressbarwrapper.obj \
$(SLO)$/recentfilesmenucontroller.obj \
$(SLO)$/registerservices.obj \
- $(SLO)$/servicehandler.obj \
$(SLO)$/sessionlistener.obj \
- $(SLO)$/simpletextstatusbarcontroller.obj \
$(SLO)$/spinfieldtoolbarcontroller.obj \
$(SLO)$/statusbarcontrollerfactory.obj\
$(SLO)$/statusbarfactory.obj \
@@ -304,10 +316,9 @@ SHL4OBJS= \
$(SLO)$/statusindicatorfactory.obj \
$(SLO)$/statusindicatorinterfacewrapper.obj \
$(SLO)$/statusindicator.obj \
- $(SLO)$/stillinteraction.obj \
+ $(SLO)$/quietinteraction.obj \
$(SLO)$/storageholder.obj \
- $(SLO)$/tabwindowservice.obj \
- $(SLO)$/fwktabwindow.obj \
+ $(SLO)$/substitutepathvars.obj \
$(SLO)$/tagwindowasmodified.obj \
$(SLO)$/targethelper.obj \
$(SLO)$/taskcreator.obj \
@@ -318,14 +329,13 @@ SHL4OBJS= \
$(SLO)$/toolbarmanager.obj \
$(SLO)$/toolbarmerger.obj \
$(SLO)$/toolbar.obj \
- $(SLO)$/toolbarsmenucontroller.obj \
$(SLO)$/toolbarwrapper.obj \
$(SLO)$/toolboxfactory.obj \
$(SLO)$/uicategorydescription.obj \
$(SLO)$/uicommanddescription.obj \
$(SLO)$/uiconfigurationmanager.obj \
+ $(SLO)$/uiconfigurationmanagerimpl.obj \
$(SLO)$/uielementfactorymanager.obj \
- $(SLO)$/uriabbreviation.obj \
$(SLO)$/urltransformer.obj \
$(SLO)$/vclstatusindicator.obj \
$(SLO)$/wakeupthread.obj \
diff --git a/idl/source/objects/bastype.cxx b/idl/source/objects/bastype.cxx
index 9fc48737e34c..4c9d9bb08926 100644
--- a/idl/source/objects/bastype.cxx
+++ b/idl/source/objects/bastype.cxx
@@ -44,50 +44,31 @@
#ifdef IDL_COMPILER
/************************************************************************/
static BOOL ReadRangeSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm,
- long nMin, ULONG nMax, long * pValue )
+ ULONG nMin, ULONG nMax, ULONG* pValue )
{
UINT32 nTokPos = rInStm.Tell();
SvToken * pTok = rInStm.GetToken_Next();
-
if( pTok->Is( pName ) )
{
- BOOL bOk = TRUE;
- BOOL bBraket = rInStm.Read( '(' );
- if( bBraket || rInStm.Read( '=' ) )
+ BOOL bOk = FALSE;
+ if( rInStm.Read( '=' ) )
{
- short nSign = 1;
pTok = rInStm.GetToken_Next();
- if( pTok->IsChar() && pTok->GetChar() == '-' )
- {
- nSign = -1;
- pTok = rInStm.GetToken_Next();
- }
- else if( pTok->IsChar() && pTok->GetChar() == '+' )
- pTok = rInStm.GetToken_Next();
-
if( pTok->IsInteger() )
{
ULONG n = pTok->GetNumber();
- if( nSign == -1 || n <= nMax )
- { // nicht ueber dem Maximum
- if( (nSign == -1 && n < 0x8000000
- && -(long)n >= nMin)
- || ( (nSign == 1 && n >= 0x8000000) || (long)n > nMin) )
- {
- *pValue = (long)n;
- }
- else
- bOk = FALSE;
+ if ( n >= nMin && n <= nMax )
+ {
+ *pValue = n;
+ bOk = TRUE;
}
- if( bOk && bBraket )
- bOk = rInStm.Read( ')' );
}
- else
- bOk = pTok->IsChar() && pTok->GetChar() == ')';
}
+
if( bOk )
return TRUE;
}
+
rInStm.Seek( nTokPos );
return FALSE;
}
@@ -590,7 +571,7 @@ BOOL SvUUId::WriteSvIdl( SvStream & rOutStm )
*************************************************************************/
BOOL SvVersion::ReadSvIdl( SvTokenStream & rInStm )
{
- long n = 0;
+ ULONG n = 0;
UINT32 nTokPos = rInStm.Tell();
if( ReadRangeSvIdl( SvHash_Version(), rInStm, 0 , 0xFFFF, &n ) )
diff --git a/idl/source/prj/command.cxx b/idl/source/prj/command.cxx
index cd3e64c24084..66790b457334 100644
--- a/idl/source/prj/command.cxx
+++ b/idl/source/prj/command.cxx
@@ -93,7 +93,7 @@ char const * SyntaxStrings[] = {
"\t\tAccelConfig, MenuConfig, StatusBarConfig, ToolbarConfig",
"\t\tAutomation*",
"\t\tAutoUpdate",
-"\t\tCachable*, Volatile",
+// "\t\tCachable*, Volatile",
"\t\tContainer",
"\t\tDefault = Identifier",
"\t\tExecMethod = Identifier",
diff --git a/idl/source/prj/globals.cxx b/idl/source/prj/globals.cxx
index 893831a27394..8e7547934616 100644
--- a/idl/source/prj/globals.cxx
+++ b/idl/source/prj/globals.cxx
@@ -132,7 +132,7 @@ SvGlobalHashNames::SvGlobalHashNames()
, MM_SlotId( INS( "SlotId" ) )
, MM_HasCoreId( INS( "HasCoreId" ) )
, MM_Cachable( INS( "Cachable" ) )
- , MM_Volatile( INS( "Volatile" ) )
+// , MM_Volatile( INS( "Volatile" ) )
, MM_Toggle( INS( "Toggle" ) )
, MM_AutoUpdate( INS( "AutoUpdate" ) )
, MM_Synchron( INS( "Synchron" ) )
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index f1df871618f8..bb63e9bb8c8b 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -191,7 +191,7 @@ static sal_Int32 lcl_SkipWhiteSpaces( const OUString &rText, sal_Int32 nStartPos
static sal_Int32 lcl_BacktraceWhiteSpaces( const OUString &rText, sal_Int32 nStartPos )
{
- // note having nStartPos point right behind the string is OK since that one
+ // note: having nStartPos point right behind the string is OK since that one
// is a correct end-of-sentence position to be returned from a grammar checker...
const sal_Int32 nLen = rText.getLength();
@@ -215,14 +215,16 @@ static sal_Int32 lcl_BacktraceWhiteSpaces( const OUString &rText, sal_Int32 nSta
sal_Int32 nPosBefore = nStartPos - 1;
const sal_Unicode *pStart = rText.getStr();
if (0 <= nPosBefore && nPosBefore < nLen && lcl_IsWhiteSpace( pStart[ nPosBefore ] ))
- nStartPos = nPosBefore;
- if (0 <= nStartPos && nStartPos < nLen)
{
- const sal_Unicode *pText = rText.getStr() + nStartPos;
- while (pText > pStart && lcl_IsWhiteSpace( *pText ))
- --pText;
- // now add 1 since we wnat to point to the first char after the last char in the sentence...
- nRes = pText - pStart + 1;
+ nStartPos = nPosBefore;
+ if (0 <= nStartPos && nStartPos < nLen)
+ {
+ const sal_Unicode *pText = rText.getStr() + nStartPos;
+ while (pText > pStart && lcl_IsWhiteSpace( *pText ))
+ --pText;
+ // now add 1 since we want to point to the first char after the last char in the sentence...
+ nRes = pText - pStart + 1;
+ }
}
DBG_ASSERT( 0 <= nRes && nRes <= nLen, "lcl_BacktraceWhiteSpaces return value out of range" );
@@ -577,6 +579,7 @@ void GrammarCheckingIterator::DequeueAndCheck()
sal_Int32 nStartPos = aFPEntryItem.m_nStartIndex;
sal_Int32 nSuggestedEnd = GetSuggestedEndOfSentence( aCurTxt, nStartPos, aCurLocale );
+ DBG_ASSERT( nSuggestedEnd > nStartPos, "nSuggestedEndOfSentencePos calculation failed?" );
linguistic2::ProofreadingResult aRes;
@@ -586,6 +589,15 @@ void GrammarCheckingIterator::DequeueAndCheck()
aGuard.clear();
uno::Sequence< beans::PropertyValue > aEmptyProps;
aRes = xGC->doProofreading( aCurDocId, aCurTxt, aCurLocale, nStartPos, nSuggestedEnd, aEmptyProps );
+
+ //!! work-around to prevent looping if the grammar checker
+ //!! failed to properly identify the sentence end
+ if (aRes.nBehindEndOfSentencePosition <= nStartPos)
+ {
+ DBG_ASSERT( 0, "!! Grammarchecker failed to provide end of sentence !!" );
+ aRes.nBehindEndOfSentencePosition = nSuggestedEnd;
+ }
+
aRes.xFlatParagraph = xFlatPara;
aRes.nStartOfSentencePosition = nStartPos;
}
@@ -718,6 +730,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
::osl::ClearableGuard< ::osl::Mutex > aGuard( MyMutex::get() );
aDocId = GetOrCreateDocId( xComponent );
nSuggestedEndOfSentencePos = GetSuggestedEndOfSentence( rText, nStartPos, aCurLocale );
+ DBG_ASSERT( nSuggestedEndOfSentencePos > nStartPos, "nSuggestedEndOfSentencePos calculation failed?" );
xGC = GetGrammarChecker( aCurLocale );
}
@@ -727,6 +740,15 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
{
uno::Sequence< beans::PropertyValue > aEmptyProps;
aTmpRes = xGC->doProofreading( aDocId, rText, aCurLocale, nStartPos, nSuggestedEndOfSentencePos, aEmptyProps );
+
+ //!! work-around to prevent looping if the grammar checker
+ //!! failed to properly identify the sentence end
+ if (aTmpRes.nBehindEndOfSentencePosition <= nStartPos)
+ {
+ DBG_ASSERT( 0, "!! Grammarchecker failed to provide end of sentence !!" );
+ aTmpRes.nBehindEndOfSentencePosition = nSuggestedEndOfSentencePos;
+ }
+
aTmpRes.xFlatParagraph = xFlatPara;
aTmpRes.nStartOfSentencePosition = nStartPos;
nEndPos = aTmpRes.nBehindEndOfSentencePosition;
diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx
index bd2473528d81..995b0686e2f8 100644
--- a/linguistic/source/lngopt.cxx
+++ b/linguistic/source/lngopt.cxx
@@ -46,7 +46,9 @@
#include <com/sun/star/registry/XSimpleRegistry.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
#include <unotools/processfactory.hxx>
+#include <i18npool/mslangid.hxx>
using namespace utl;
using namespace osl;
@@ -100,13 +102,13 @@ LinguOptions::~LinguOptions()
}
-BOOL LinguOptions::SetLocale_Impl( INT16 &rLanguage, Any &rOld, const Any &rVal)
+BOOL LinguOptions::SetLocale_Impl( INT16 &rLanguage, Any &rOld, const Any &rVal, sal_Int16 nType)
{
BOOL bRes = FALSE;
Locale aNew;
rVal >>= aNew;
- INT16 nNew = LocaleToLanguage( aNew );
+ INT16 nNew = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aNew), nType);
if (nNew != rLanguage)
{
Locale aLocale( CreateLocale( rLanguage ) );
@@ -149,17 +151,17 @@ BOOL LinguOptions::SetValue( Any &rOld, const Any &rVal, INT32 nWID )
case WID_HYPH_MIN_WORD_LENGTH : pnVal = &pData->nHyphMinWordLength; break;
case WID_DEFAULT_LOCALE :
{
- bRes = SetLocale_Impl( pData->nDefaultLanguage, rOld, rVal );
+ bRes = SetLocale_Impl( pData->nDefaultLanguage, rOld, rVal, ::com::sun::star::i18n::ScriptType::LATIN );
break;
}
case WID_DEFAULT_LOCALE_CJK :
{
- bRes = SetLocale_Impl( pData->nDefaultLanguage_CJK, rOld, rVal );
+ bRes = SetLocale_Impl( pData->nDefaultLanguage_CJK, rOld, rVal, ::com::sun::star::i18n::ScriptType::ASIAN );
break;
}
case WID_DEFAULT_LOCALE_CTL :
{
- bRes = SetLocale_Impl( pData->nDefaultLanguage_CTL, rOld, rVal );
+ bRes = SetLocale_Impl( pData->nDefaultLanguage_CTL, rOld, rVal, ::com::sun::star::i18n::ScriptType::COMPLEX );
break;
}
default :
@@ -227,19 +229,19 @@ void LinguOptions::GetValue( Any &rVal, INT32 nWID ) const
case WID_HYPH_MIN_WORD_LENGTH : pnVal = &pData->nHyphMinWordLength; break;
case WID_DEFAULT_LOCALE :
{
- Locale aLocale( CreateLocale( pData->nDefaultLanguage ) );
+ Locale aLocale( MsLangId::convertLanguageToLocale( pData->nDefaultLanguage ) );
rVal.setValue( &aLocale, ::getCppuType((Locale*)0 ));
break;
}
case WID_DEFAULT_LOCALE_CJK :
{
- Locale aLocale( CreateLocale( pData->nDefaultLanguage_CJK ) );
+ Locale aLocale( MsLangId::convertLanguageToLocale( pData->nDefaultLanguage_CJK ) );
rVal.setValue( &aLocale, ::getCppuType((Locale*)0 ));
break;
}
case WID_DEFAULT_LOCALE_CTL :
{
- Locale aLocale( CreateLocale( pData->nDefaultLanguage_CTL ) );
+ Locale aLocale( MsLangId::convertLanguageToLocale( pData->nDefaultLanguage_CTL ) );
rVal.setValue( &aLocale, ::getCppuType((Locale*)0 ));
break;
}
diff --git a/linguistic/source/lngopt.hxx b/linguistic/source/lngopt.hxx
index 3a92baa32faf..b424970a929b 100644
--- a/linguistic/source/lngopt.hxx
+++ b/linguistic/source/lngopt.hxx
@@ -77,7 +77,7 @@ class LinguOptions
BOOL SetLocale_Impl( INT16 &rLanguage,
::com::sun::star::uno::Any &rOld,
- const ::com::sun::star::uno::Any &rVal);
+ const ::com::sun::star::uno::Any &rVal, sal_Int16 nType );
public:
LinguOptions();
diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
index 26143aa76407..355879f036ac 100644
--- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
@@ -1245,7 +1245,7 @@
</node>
<node oor:name="V_SHIFT_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:PasteClipboard</value>
+ <value xml:lang="en-US">.uno:PasteSpecial</value>
</prop>
</node>
<node oor:name="X_MOD1" oor:op="replace">
@@ -1872,7 +1872,19 @@
</node>
</node>
<node oor:name="com.sun.star.presentation.PresentationDocument" oor:op="replace">
- <node oor:name="1_MOD1" oor:op="replace">
+ <node oor:name="PAGEDOWN_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">.uno:NextAnnotation</value>
+ </prop>
+ </node>
+ <node oor:name="PAGEUP_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">.uno:PreviousAnnotation</value>
+ </prop>
+ </node>
+ <node oor:name="1_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:SpacePara1</value>
</prop>
@@ -2200,7 +2212,7 @@
</node>
<node oor:name="V_SHIFT_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:PasteClipboard</value>
+ <value xml:lang="en-US">.uno:PasteSpecial</value>
</prop>
</node>
<node oor:name="X_MOD1" oor:op="replace">
diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu
index 6e25dedba37e..c9747dc9dea0 100644
--- a/officecfg/registry/data/org/openoffice/Office/Common.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu
@@ -567,4 +567,13 @@
</prop>
</node>
</node>
+ <node oor:name="Path">
+ <node oor:name="Current">
+ <prop oor:name="Temp" oor:type="xs:string">
+ <value install:module="macosx">$(userurl)/temp</value>
+ <value install:module="unx">$(temp)</value>
+ <value install:module="wnt">$(temp)</value>
+ </prop>
+ </node>
+ </node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/Paths.xcu b/officecfg/registry/data/org/openoffice/Office/Paths.xcu
index e4bec2eaee19..b979f0f097c3 100644
--- a/officecfg/registry/data/org/openoffice/Office/Paths.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Paths.xcu
@@ -179,12 +179,13 @@
<node oor:name="Temp" oor:op="fuse" oor:mandatory="true">
<prop oor:name="IsSinglePath" oor:finalized="true">
- <value>true</value>
+ <value>true</value>
</prop>
- <node oor:name="InternalPaths" oor:finalized="true" />
- <prop oor:name="UserPaths" oor:finalized="true" />
+ <node oor:name="InternalPaths" oor:finalized="true"/>
+ <prop oor:name="UserPaths" oor:finalized="true"/>
<prop oor:name="WritePath">
- <value>$(temp)</value>
+ <value install:module="macosx">$(userurl)/temp</value>
+ <value install:module="unxwnt">$(temp)</value>
</prop>
</node>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
index 991ea9a64d10..8c76a2dadd9f 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
@@ -681,12 +681,20 @@
</node>
<node oor:name=".uno:NoteVisible" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Show Note</value>
- </prop>
- </node>
+ <value xml:lang="en-US">Show Comment</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertAnnotation" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Comm~ent</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
<node oor:name=".uno:DeleteNote" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Delete Note</value>
+ <value xml:lang="en-US">Delete Comment</value>
</prop>
</node>
<node oor:name=".uno:InputLineVisible" oor:op="replace">
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu
index e574c72b314e..296a16a9e697 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu
@@ -3,64 +3,62 @@
<oor:component-data oor:name="ChartCommands" 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:DiagramData" oor:op="replace">
+
+ <!-- Menu-Insert -->
+ <node oor:name=".uno:InsertMenuTitles" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Chart ~Data Table...</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value xml:lang="en-US">~Titles...</value>
</prop>
</node>
- <node oor:name=".uno:DataRanges" oor:op="replace">
+ <node oor:name=".uno:InsertMenuLegend" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Data ~Ranges...</value>
+ <value xml:lang="en-US">~Legend...</value>
</prop>
</node>
- <node oor:name=".uno:InsertTitle" oor:op="replace">
+ <node oor:name=".uno:InsertMenuAxes" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Title...</value>
+ <value xml:lang="en-US">~Axes...</value>
</prop>
</node>
- <node oor:name=".uno:InsertLegend" oor:op="replace">
+ <node oor:name=".uno:InsertMenuGrids" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Legend...</value>
+ <value xml:lang="en-US">~Grids...</value>
</prop>
</node>
- <node oor:name=".uno:InsertDescription" oor:op="replace">
+ <node oor:name=".uno:InsertMenuDataLabels" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
-
<value xml:lang="en-US">~Data Labels...</value>
</prop>
</node>
- <node oor:name=".uno:InsertAxis" oor:op="replace">
+ <node oor:name=".uno:InsertMenuTrendlines" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Axes...</value>
+ <value xml:lang="en-US">Tre~nd Lines...</value>
</prop>
</node>
- <node oor:name=".uno:ChartTitle" oor:op="replace">
+ <node oor:name=".uno:InsertMenuMeanValues" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Chart Title</value>
+ <value xml:lang="en-US">Mean ~Value Lines</value>
</prop>
</node>
- <node oor:name=".uno:Legend" oor:op="replace">
+ <node oor:name=".uno:InsertMenuYErrorBars" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Y Error ~Bars...</value>
+ </prop>
+ </node>
- <value xml:lang="en-US">~Legend...</value>
+ <!-- Menu - Format -->
+ <node oor:name=".uno:FormatSelection" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Format Selection...</value>
</prop>
</node>
- <node oor:name=".uno:DiagramGrid" oor:op="replace">
+ <node oor:name=".uno:Legend" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Edit Grid</value>
+ <value xml:lang="en-US">~Legend...</value>
</prop>
</node>
<node oor:name=".uno:DiagramWall" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
-
<value xml:lang="en-US">Chart ~Wall...</value>
</prop>
</node>
@@ -74,11 +72,6 @@
<value xml:lang="en-US">Chart ~Area...</value>
</prop>
</node>
- <node oor:name=".uno:View3D" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~3D View...</value>
- </prop>
- </node>
<node oor:name=".uno:DiagramType" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Chart T~ype...</value>
@@ -87,101 +80,91 @@
<value>1</value>
</prop>
</node>
- <node oor:name=".uno:ToggleTitle" oor:op="replace">
+ <node oor:name=".uno:DataRanges" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Title On/Off</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value xml:lang="en-US">~Data Ranges...</value>
</prop>
</node>
- <node oor:name=".uno:ToggleLegend" oor:op="replace">
+ <node oor:name=".uno:DiagramData" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Legend On/Off</value>
+ <value xml:lang="en-US">Chart ~Data Table...</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
</prop>
</node>
- <node oor:name=".uno:ToggleAxisDescr" oor:op="replace">
+ <node oor:name=".uno:View3D" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Show/Hide Axis Description(s)</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value xml:lang="en-US">~3D View...</value>
</prop>
</node>
- <node oor:name=".uno:ToggleGridHorizontal" oor:op="replace">
+
+ <!-- sub menu - format arrangement -->
+
+ <node oor:name=".uno:Forward" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Horizontal Grid On/Off</value>
+ <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:ToggleGridVertical" oor:op="replace">
+ <node oor:name=".uno:Backward" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Vertical Grid On/Off</value>
+ <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:DataInRows" oor:op="replace">
+
+ <!-- sub menu: format title-->
+ <node oor:name=".uno:MainTitle" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Data in Rows</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value xml:lang="en-US">~Main Title...</value>
</prop>
</node>
- <node oor:name=".uno:DataInColumns" oor:op="replace">
+ <node oor:name=".uno:SubTitle" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Data in Columns</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value xml:lang="en-US">~Subtitle...</value>
</prop>
</node>
- <node oor:name=".uno:ToolSelect" oor:op="replace">
+ <node oor:name=".uno:XTitle" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Select Tool</value>
+ <value xml:lang="en-US">~X Axis Title...</value>
</prop>
</node>
- <node oor:name=".uno:ContextType" oor:op="replace">
+ <node oor:name=".uno:YTitle" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">Chart Type</value>
+ <value xml:lang="en-US">~Y Axis Title...</value>
</prop>
</node>
- <node oor:name=".uno:NewArrangement" oor:op="replace">
+ <node oor:name=".uno:ZTitle" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Automatic Layout</value>
+ <value xml:lang="en-US">~Z Axis Title...</value>
</prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ </node>
+ <node oor:name=".uno:SecondaryXTitle" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">S~econdary X Axis Title...</value>
</prop>
</node>
- <node oor:name=".uno:InsertGrids" oor:op="replace">
+ <node oor:name=".uno:SecondaryYTitle" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
-
- <value xml:lang="en-US">~Grids...</value>
+ <value xml:lang="en-US">Se~condary Y Axis Title...</value>
</prop>
</node>
- <node oor:name=".uno:Update" oor:op="replace">
+ <node oor:name=".uno:AllTitles" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Update Chart</value>
+ <value xml:lang="en-US">~All Titles...</value>
</prop>
</node>
+
+ <!-- sub menu: format axis-->
<node oor:name=".uno:DiagramAxisX" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
@@ -200,235 +183,502 @@
<value xml:lang="en-US">~Z Axis...</value>
</prop>
</node>
+ <node oor:name=".uno:DiagramAxisA" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">~Secondary X Axis...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DiagramAxisB" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">S~econdary Y Axis...</value>
+ </prop>
+ </node>
<node oor:name=".uno:DiagramAxisAll" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~All Axes...</value>
</prop>
</node>
- <node oor:name=".uno:InsertTrendlines" oor:op="replace">
+
+ <!-- sub menu: format grid-->
+ <node oor:name=".uno:DiagramGridXMain" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">T~rend Lines...</value>
+ <value xml:lang="en-US">~Y Axis Major Grid...</value>
</prop>
</node>
- <node oor:name=".uno:InsertMeanValues" oor:op="replace">
+ <node oor:name=".uno:DiagramGridYMain" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Mean ~Value Lines</value>
+ <value xml:lang="en-US">~X Axis Major Grid...</value>
</prop>
</node>
- <node oor:name=".uno:InsertYErrorbars" oor:op="replace">
+ <node oor:name=".uno:DiagramGridZMain" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Y Error Bars...</value>
+ <value xml:lang="en-US">~Z Axis Major Grid...</value>
</prop>
</node>
- <node oor:name=".uno:MainTitle" oor:op="replace">
+ <node oor:name=".uno:DiagramGridXHelp" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Main Title...</value>
+ <value xml:lang="en-US">Y Axis Minor ~Grid...</value>
</prop>
</node>
- <node oor:name=".uno:SubTitle" oor:op="replace">
+ <node oor:name=".uno:DiagramGridYHelp" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Subtitle...</value>
+
+ <value xml:lang="en-US">X Axis ~Minor Grid...</value>
</prop>
</node>
- <node oor:name=".uno:XTitle" oor:op="replace">
+ <node oor:name=".uno:DiagramGridZHelp" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~X Axis Title...</value>
+
+ <value xml:lang="en-US">Z Ax~is Minor Grid...</value>
</prop>
</node>
- <node oor:name=".uno:YTitle" oor:op="replace">
+ <node oor:name=".uno:DiagramGridAll" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Y Axis Title...</value>
+ <value xml:lang="en-US">~All Grids...</value>
</prop>
</node>
- <node oor:name=".uno:ZTitle" oor:op="replace">
+
+ <!-- context menu - insert/delete/formatof several elements-->
+
+ <node oor:name=".uno:FormatWall" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Z Axis Title...</value>
+
+ <value xml:lang="en-US">Format Wall...</value>
</prop>
</node>
- <node oor:name=".uno:SecondaryXTitle" oor:op="replace">
+ <node oor:name=".uno:FormatFloor" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">S~econdary X Axis Title...</value>
+ <value xml:lang="en-US">Format Floor...</value>
</prop>
</node>
- <node oor:name=".uno:SecondaryYTitle" oor:op="replace">
+ <node oor:name=".uno:FormatChartArea" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Se~condary Y Axis Title...</value>
+ <value xml:lang="en-US">Format Chart Area...</value>
</prop>
</node>
- <node oor:name=".uno:AllTitles" oor:op="replace">
+
+ <!-- title -->
+ <node oor:name=".uno:InsertTitles" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Insert Titles...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:FormatTitle" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Format Title...</value>
+ </prop>
+ </node>
- <value xml:lang="en-US">~All Titles...</value>
+ <!-- legend -->
+
+ <node oor:name=".uno:InsertLegend" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Insert Legend</value>
</prop>
</node>
- <node oor:name=".uno:DiagramGridXMain" oor:op="replace">
+ <node oor:name=".uno:DeleteLegend" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Y Axis Major Grid...</value>
+ <value xml:lang="en-US">Delete Legend</value>
</prop>
</node>
- <node oor:name=".uno:DiagramGridYMain" oor:op="replace">
+ <node oor:name=".uno:FormatLegend" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~X Axis Major Grid...</value>
+ <value xml:lang="en-US">Format Legend...</value>
</prop>
</node>
- <node oor:name=".uno:DiagramGridZMain" oor:op="replace">
+
+ <!-- axis -->
+
+ <node oor:name=".uno:InsertRemoveAxes" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Z Axis Major Grid...</value>
+ <value xml:lang="en-US">Insert/Delete Axes...</value>
</prop>
</node>
- <node oor:name=".uno:DiagramGridAll" oor:op="replace">
+ <node oor:name=".uno:InsertAxis" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~All Grids...</value>
+
+ <value xml:lang="en-US">Insert Axis</value>
</prop>
</node>
- <node oor:name=".uno:DiagramObjects" oor:op="replace">
+ <node oor:name=".uno:DeleteAxis" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Object Properties...</value>
+
+ <value xml:lang="en-US">Delete Axis</value>
</prop>
</node>
- <node oor:name=".uno:DiagramGridXHelp" oor:op="replace">
+ <node oor:name=".uno:FormatAxis" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Format Axis...</value>
+ </prop>
+ </node>
- <value xml:lang="en-US">Y Axis Minor ~Grid...</value>
+ <node oor:name=".uno:InsertAxisTitle" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Insert Axis Title</value>
</prop>
</node>
- <node oor:name=".uno:DiagramGridYHelp" oor:op="replace">
+
+ <!-- grids -->
+
+ <node oor:name=".uno:InsertMajorGrid" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">X Axis ~Minor Grid...</value>
+ <value xml:lang="en-US">Insert Major Grid</value>
</prop>
</node>
- <node oor:name=".uno:DiagramGridZHelp" oor:op="replace">
+ <node oor:name=".uno:DeleteMajorGrid" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Z Ax~is Minor Grid...</value>
+ <value xml:lang="en-US">Delete Major Grid</value>
</prop>
</node>
- <node oor:name=".uno:ScaleText" oor:op="replace">
+ <node oor:name=".uno:FormatMajorGrid" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Scale Text</value>
+ <value xml:lang="en-US">Format Major Grid...</value>
</prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ </node>
+
+ <node oor:name=".uno:InsertMinorGrid" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Insert Minor Grid</value>
</prop>
</node>
- <node oor:name=".uno:DataDescriptionType" oor:op="replace">
+ <node oor:name=".uno:DeleteMinorGrid" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Caption Type for Chart Data</value>
+ <value xml:lang="en-US">Delete Minor Grid</value>
</prop>
</node>
- <node oor:name=".uno:LegendPosition" oor:op="replace">
+ <node oor:name=".uno:FormatMinorGrid" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Legend Position</value>
+ <value xml:lang="en-US">Format Minor Grid...</value>
</prop>
</node>
- <node oor:name=".uno:DefaultColors" oor:op="replace">
+
+ <!-- trend line -->
+
+ <node oor:name=".uno:InsertTrendline" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Insert Tre~nd Line...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DeleteTrendline" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Delete Tre~nd Line</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:FormatTrendline" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Format Trend Line...</value>
+ </prop>
+ </node>
+
+ <!-- trend line equation -->
+
+ <node oor:name=".uno:InsertTrendlineEquation" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Insert Trend Line ~Equation</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertTrendlineEquationAndR2" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Insert R² and Trend Line Equation</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertR2Value" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Insert R²</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DeleteR2Value" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Delete R²</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DeleteTrendlineEquation" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Delete Trend Line ~Equation</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:FormatTrendlineEquation" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Format Trend Line Equation...</value>
+ </prop>
+ </node>
- <value xml:lang="en-US">Default Colors for Data Series</value>
+ <!-- mean value -->
+
+ <node oor:name=".uno:InsertMeanValue" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Insert Mean ~Value Line</value>
</prop>
</node>
- <node oor:name=".uno:BarWidth" oor:op="replace">
+ <node oor:name=".uno:DeleteMeanValue" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Delete Mean ~Value Line</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:FormatMeanValue" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Bar Width</value>
+ <value xml:lang="en-US">Format Mean Value Line...</value>
</prop>
</node>
- <node oor:name=".uno:NumberOfLines" oor:op="replace">
+
+ <!-- error bars -->
+
+ <node oor:name=".uno:InsertYErrorBars" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Insert Y Error ~Bars...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DeleteYErrorBars" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Delete Y Error ~Bars</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:FormatYErrorBars" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Format Y Error Bars...</value>
+ </prop>
+ </node>
- <value xml:lang="en-US">Number of lines in combination chart</value>
+ <!-- data labels -->
+
+ <node oor:name=".uno:InsertDataLabels" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Insert Data Labels</value>
</prop>
</node>
- <node oor:name=".uno:Forward" oor:op="replace">
+ <node oor:name=".uno:DeleteDataLabels" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Bring ~Forward</value>
+ <value xml:lang="en-US">Delete Data Labels</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:FormatDataLabels" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Format Data Labels...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertDataLabel" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Insert Single Data Label</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DeleteDataLabel" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+
+ <value xml:lang="en-US">Delete Single Data Label</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:FormatDataLabel" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Format Single Data Label...</value>
+ </prop>
+ </node>
+
+ <!-- data series and point -->
+
+ <node oor:name=".uno:FormatDataSeries" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Format Data Series...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:FormatDataPoint" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Format Data Point...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ResetDataPoint" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Reset Data Point</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ResetAllDataPoints" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Reset all Data Points</value>
+ </prop>
+ </node>
+
+
+ <node oor:name=".uno:FormatStockLoss" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Format Stock Loss...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:FormatStockGain" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Format Stock Gain...</value>
+ </prop>
+ </node>
+
+ <!-- some toolbar button commands -->
+
+ <node oor:name=".uno:ChartElementSelector" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Select Chart Element</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
</prop>
</node>
- <node oor:name=".uno:Backward" oor:op="replace">
+
+ <node oor:name=".uno:ToggleGridHorizontal" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Horizontal Grid On/Off</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ScaleText" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Scale Text</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:NewArrangement" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Automatic Layout</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
- <value xml:lang="en-US">Send Back~ward</value>
+ <!-- unused? -->
+ <node oor:name=".uno:Update" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Update Chart</value>
+ </prop>
+ </node>
+
+ <node oor:name=".uno:ToggleTitle" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Title On/Off</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
</prop>
</node>
- <node oor:name=".uno:DiagramAxisA" oor:op="replace">
+ <node oor:name=".uno:ToggleLegend" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Legend On/Off</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ToggleAxisDescr" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Show/Hide Axis Description(s)</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
- <value xml:lang="en-US">~Secondary X Axis...</value>
+ <node oor:name=".uno:ToggleGridVertical" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Vertical Grid On/Off</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
</prop>
</node>
- <node oor:name=".uno:DiagramAxisB" oor:op="replace">
+
+ <node oor:name=".uno:DataInRows" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">S~econdary Y Axis...</value>
+ <value xml:lang="en-US">Data in Rows</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
</prop>
</node>
- </node>
- <node oor:name="Popups">
- <node oor:name=".uno:ArrangeRow" oor:op="replace">
+ <node oor:name=".uno:DataInColumns" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Arrange~ment</value>
+ <value xml:lang="en-US">Data in Columns</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
</prop>
</node>
- <node oor:name=".uno:DiagramAxisMenu" oor:op="replace">
+ <node oor:name=".uno:ToolSelect" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">A~xis</value>
+
+ <value xml:lang="en-US">Select Tool</value>
</prop>
</node>
- <node oor:name=".uno:ChartTitleMenu" oor:op="replace">
+ <node oor:name=".uno:ContextType" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Title</value>
+ <value xml:lang="en-US">Chart Type</value>
</prop>
</node>
- <node oor:name=".uno:DiagramGridMenu" oor:op="replace">
+
+ <node oor:name=".uno:DataDescriptionType" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Grid</value>
+ <value xml:lang="en-US">Caption Type for Chart Data</value>
</prop>
</node>
- <node oor:name=".uno:InsertTrendline" oor:op="replace">
+ <node oor:name=".uno:LegendPosition" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Insert Tre~nd Line...</value>
+
+ <value xml:lang="en-US">Legend Position</value>
</prop>
</node>
- <node oor:name=".uno:InsertMeanValue" oor:op="replace">
+ <node oor:name=".uno:DefaultColors" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Insert Mean ~Value Line</value>
+
+ <value xml:lang="en-US">Default Colors for Data Series</value>
</prop>
</node>
- <node oor:name=".uno:InsertTrendlineEquation" oor:op="replace">
+ <node oor:name=".uno:BarWidth" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Insert Trend Line ~Equation</value>
+
+ <value xml:lang="en-US">Bar Width</value>
</prop>
</node>
- <node oor:name=".uno:InsertYErrorbar" oor:op="replace">
+ <node oor:name=".uno:NumberOfLines" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Insert ~Y Error Bars...</value>
+
+ <value xml:lang="en-US">Number of lines in combination chart</value>
</prop>
</node>
- <node oor:name=".uno:DeleteMeanValue" oor:op="replace">
+ </node>
+
+ <!-- menu items with sub menu -->
+
+ <node oor:name="Popups">
+ <node oor:name=".uno:ArrangeRow" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Delete Mean ~Value Line</value>
+ <value xml:lang="en-US">Arrange~ment</value>
</prop>
</node>
- <node oor:name=".uno:DeleteTrendline" oor:op="replace">
+ <node oor:name=".uno:ChartTitleMenu" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Delete Tre~ndline</value>
+ <value xml:lang="en-US">~Title</value>
</prop>
</node>
- <node oor:name=".uno:DeleteYErrorbar" oor:op="replace">
+ <node oor:name=".uno:DiagramAxisMenu" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Delete ~Y Error Bars</value>
+ <value xml:lang="en-US">A~xis</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DiagramGridMenu" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">~Grid</value>
</prop>
</node>
</node>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
index fb4b18aa9f78..3f3caf1f8be3 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
@@ -221,6 +221,17 @@
<value>com.sun.star.svx.FontHeightToolBoxController</value>
</prop>
</node>
+ <node oor:name="c3" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:ChartElementSelector</value>
+ </prop>
+ <prop oor:name="Module">
+ <value>com.sun.star.chart2.ChartDocument</value>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.comp.chart.ElementSelectorToolbarController</value>
+ </prop>
+ </node>
</node>
<node oor:name="StatusBar">
<node oor:name="c1" oor:op="replace">
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
index 46abbb8aa3d0..b4d7127a2c89 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
@@ -651,7 +651,7 @@
<value xml:lang="en-US">~Page...</value>
</prop>
</node>
- <node oor:name=".uno:PasteClipboard" oor:op="replace">
+ <node oor:name=".uno:PasteSpecial" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Paste ~Special...</value>
@@ -1743,7 +1743,12 @@
<value xml:lang="en-US">~Slide Show</value>
</prop>
</node>
- <node oor:name=".uno:GroupMenu" oor:op="replace">
+ <!--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>
@@ -1925,7 +1930,12 @@
<value>1</value>
</prop>
</node>
- <node oor:name=".uno:InsertColumns" oor:op="replace">
+ <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>
@@ -1934,7 +1944,12 @@
<value>1</value>
</prop>
</node>
- <node oor:name=".uno:DeleteRows" oor:op="replace">
+ <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>
@@ -2051,6 +2066,54 @@
<value>1</value>
</prop>
</node>
+ <node oor:name=".uno:InsertAnnotation" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Comme~nt</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ShowAnnotation" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Comme~nts</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DeleteAnnotation" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">~Delete Comment</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DeleteAllAnnotation" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Delete ~All Comments</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:NextAnnotation" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Next Comment</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:PreviousAnnotation" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Previous Comment</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </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 9e6a1be3c80e..e0db837c21a5 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu
@@ -666,7 +666,21 @@
<value>true</value>
</prop>
</node>
- <node oor:name="private:resource/toolbar/masterviewtoolbar" oor:op="replace">
+ <node oor:name="private:resource/toolbar/commentsbar" 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">Comments</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/masterviewtoolbar" oor:op="replace">
<prop oor:name="Docked" oor:type="xs:boolean">
<value>false</value>
</prop>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index e28c241be9ed..556c9776fad7 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -1951,7 +1951,7 @@
</node>
<node oor:name=".uno:InsertAnnotation" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Not~e</value>
+ <value xml:lang="en-US">Comme~nt</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
@@ -4168,13 +4168,20 @@
</node>
<node oor:name=".uno:ExportDialog" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="de">Dialog exportieren</value>
<value xml:lang="en-US">Export Dialog</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
</prop>
</node>
+ <node oor:name=".uno:ImportDialog" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Import Dialog</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
<node oor:name=".uno:CompileBasic" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Compile</value>
@@ -5151,17 +5158,17 @@
</node> -->
<node oor:name=".uno:DeleteAllNotes" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Delete All Notes</value>
+ <value xml:lang="en-US">Delete All Comments</value>
</prop>
</node>
<node oor:name=".uno:DeleteAuthor" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Delete All Notes by This Author</value>
+ <value xml:lang="en-US">Delete All Comments by This Author</value>
</prop>
</node>
<node oor:name=".uno:DeleteNote" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Delete Note</value>
+ <value xml:lang="en-US">Delete Comment</value>
</prop>
</node>
</node>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu
index 86bf55f3dc51..cc309efb2f59 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu
@@ -196,7 +196,7 @@
<value>false</value>
</prop>
</node>
- <node oor:name="private:resource/toolbar/formtextobjectbar" oor:op="replace">
+ <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>
@@ -761,7 +761,21 @@
<value>true</value>
</prop>
</node>
- <node oor:name="private:resource/toolbar/masterviewtoolbar" oor:op="replace">
+ <node oor:name="private:resource/toolbar/commentsbar" 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">Comments</value>
+ </prop>
+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ <node oor:name="private:resource/toolbar/masterviewtoolbar" oor:op="replace">
<prop oor:name="Docked" oor:type="xs:boolean">
<value>false</value>
</prop>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 55365975b790..0ba86ef6b1aa 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -41,7 +41,7 @@
</node>
<node oor:name=".uno:ShowAnnotations" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Notes</value>
+ <value xml:lang="en-US">Comments</value>
</prop>
</node>
<node oor:name=".uno:InsertScript" oor:op="replace">
@@ -330,7 +330,7 @@
</node>
<node oor:name=".uno:InsertAnnotation" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Note</value>
+ <value xml:lang="en-US">Comme~nt</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/makefile.mk b/officecfg/registry/data/org/openoffice/Office/makefile.mk
index 52f31ee38261..50b67954aeef 100644
--- a/officecfg/registry/data/org/openoffice/Office/makefile.mk
+++ b/officecfg/registry/data/org/openoffice/Office/makefile.mk
@@ -86,6 +86,8 @@ MODULEFILES= \
Common-cjk.xcu \
Common-ctl.xcu \
Common-korea.xcu \
+ Paths-macosx.xcu \
+ Paths-unxwnt.xcu \
Writer-cjk.xcu \
Writer-defaultfontarial.xcu \
Writer-directcursor.xcu \
diff --git a/officecfg/registry/data/org/openoffice/VCL.xcu b/officecfg/registry/data/org/openoffice/VCL.xcu
index 850d5205ddf9..9d145fbcc831 100644
--- a/officecfg/registry/data/org/openoffice/VCL.xcu
+++ b/officecfg/registry/data/org/openoffice/VCL.xcu
@@ -887,27 +887,27 @@
</node>
<node oor:name="pa-IN" oor:op="replace">
<prop oor:name="UI_SANS" oor:op="replace" oor:type="xs:string">
- <value>Lohit Punjabi;Tahoma;Lucidasans;Lucida Sans;Supplement;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;clearlyU;Interface User;WarpSans;Geneva;MS Sans Serif;Helv;Dialog;Albany AMT;Albany;Lucida;Arial;Nimbus Sans L;Helvetica;Charcoal;Chicago;Helmet;Interface System;Sans Serif</value>
- </prop>
+ <value>Raavi;Lohit Punjabi;Saab;Tahoma</value>
+ </prop>
<prop oor:name="CTL_DISPLAY" oor:op="replace" oor:type="xs:string">
- <value>Lohit Punjabi;Tahoma;Lucidasans;Lucida Sans;Arial Unicode MS</value>
+ <value>Raavi;Lohit Punjabi;Saab;Tahoma;Lucidasans;Lucida Sans;Arial Unicode MS</value>
</prop>
<prop oor:name="CTL_HEADING" oor:op="replace" oor:type="xs:string">
- <value>Lohit Punjabi;Tahoma;Lucidasans;Lucida Sans;Arial Unicode MS</value>
+ <value>Raavi;Lohit Punjabi;Saab;Tahoma;Lucidasans;Lucida Sans;Arial Unicode MS</value>
</prop>
<prop oor:name="CTL_PRESENTATION" oor:op="replace" oor:type="xs:string">
- <value>Lohit Punjabi;Tahoma;Lucidasans;Lucida Sans;Arial Unicode MS</value>
+ <value>Raavi;Lohit Punjabi;Saab;Tahoma;Lucidasans;Lucida Sans;Arial Unicode MS</value>
</prop>
<prop oor:name="CTL_SPREADSHEET" oor:op="replace" oor:type="xs:string">
- <value>Lohit Punjabi;Tahoma;Lucidasans;Lucida Sans;Arial Unicode MS</value>
+ <value>Raavi;Lohit Punjabi;Saab;Tahoma;Lucidasans;Lucida Sans;Arial Unicode MS</value>
</prop>
<prop oor:name="CTL_TEXT" oor:op="replace" oor:type="xs:string">
- <value>Lohit Punjabi;Tahoma;Lucidasans;Lucida Sans;Arial Unicode MS</value>
+ <value>Raavi;Lohit Punjabi;Saab;Tahoma;Lucidasans;Lucida Sans;Arial Unicode MS</value>
</prop>
</node>
<node oor:name="ta-IN" oor:op="replace">
<prop oor:name="UI_SANS" oor:op="replace" oor:type="xs:string">
- <value>Lohit Tamil;Tahoma;Lucidasans;Lucida Sans;Supplement;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;clearlyU;Interface User;WarpSans;Geneva;MS Sans Serif;Helv;Dialog;Albany AMT;Albany;Lucida;Arial;Nimbus Sans L;Helvetica;Charcoal;Chicago;Helmet;Interface System;Sans Serif</value>
+ <value>Lohit Tamil;Tahoma;Sans Serif</value>
</prop>
<prop oor:name="CTL_DISPLAY" oor:op="replace" oor:type="xs:string">
<value>Lohit Tamil;Tahoma;Lucidasans;Lucida Sans;Arial Unicode MS</value>
@@ -1643,6 +1643,21 @@
<value>Decorative,Special</value>
</prop>
</node>
+
+ <node oor:name="calibri" oor:op="replace">
+ <prop oor:name="SubstFonts">
+ <value>hiraginomarugothicpronw3;hiraginomarugothicprow3</value>
+ </prop>
+ <prop oor:name="FontType"><value>Normal,SansSerif</value></prop>
+ </node>
+
+ <node oor:name="cambria" oor:op="replace">
+ <prop oor:name="SubstFonts">
+ <value>applelisung</value>
+ </prop>
+ <prop oor:name="FontType"><value>Normal,Serif</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>
@@ -7708,8 +7723,7 @@
<prop oor:name="FontType">
<value>Normal,SansSerif</value>
</prop>
- </node>
-
+ </node>
<node oor:name="sansdemi" oor:op="replace">
<prop oor:name="SubstFonts">
diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index fd7c52ef4df2..1ab6b58b4d13 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -124,8 +124,8 @@
<!-- UIHints: Tools - Options -Spreadsheets - Contents - [Section] Display -->
<info>
<author>NN</author>
- <desc>Indicates whether notes are marked.</desc>
- <label>Note tags</label>
+ <desc>Indicates whether comments are marked.</desc>
+ <label>Comment tags</label>
</info>
<value>true</value>
</prop>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index a9f0b854198e..72c0b768ed84 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -903,6 +903,12 @@ Dymamic border coloring means that when the mouse is hovered over a control, and
<desc>Contains a list of passwords encoded with the master password.</desc>
</info>
</set>
+ <prop oor:name="AuthenticateUsingSystemCredentials" oor:type="oor:string-list">
+ <info>
+ <author>KSO</author>
+ <desc>Contains a list of URLs that should be accessed using system credentials of the user.</desc>
+ </info>
+ </prop>
</group>
<group oor:name="_3D_Engine">
<info>
@@ -1184,6 +1190,42 @@ Dymamic border coloring means that when the mouse is hovered over a control, and
</info>
<value>45000</value>
</prop>
+ <prop oor:name="TransparentSelection" oor:type="xs:boolean">
+ <info>
+ <author>AW</author>
+ <desc>
+ This switch defines if the selections in the applications (text or cells) are visualized using
+ inverse (XOR) when set to false (the old selection method, also used when in HighContrast mode)
+ or a transparent overlay selection using the system's selection color.
+ </desc>
+ <label>This switch defines if for text/cell selections the old inverse or the new transparent selection is to be used.</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="TransparentSelectionPercent" oor:type="xs:short">
+ <info>
+ <author>AW</author>
+ <desc>
+ Specifies the degree of transparence to be used when transparent selection is used. The value is a percent
+ value. Since neither no transparence nor complete transparence makes sense, the value is limited to a range
+ of 10% - 90%. If the given value is outside this range, it is cropped to it.
+ </desc>
+ <label>Specifies the percent of transparence to use if transparent selection is used.</label>
+ </info>
+ <value>75</value>
+ </prop>
+ <prop oor:name="SelectionMaximumLuminancePercent" oor:type="xs:short">
+ <info>
+ <author>AW</author>
+ <desc>
+ Specifies the maximum allowed luminance the system's selection color may have. When the color
+ fetched from the system is brighter (luminacne is bigger), it will be scaled to a luminance
+ of exactly this given value.
+ </desc>
+ <label>Specifies the maximum allowed luminance for the system's selection color.</label>
+ </info>
+ <value>70</value>
+ </prop>
</group>
<group oor:name="AutoCorrect">
<info>
@@ -1621,10 +1663,11 @@ Dymamic border coloring means that when the mouse is hovered over a control, and
</prop>
<prop oor:name="Temp" oor:type="xs:string">
<info>
+ <deprecated>Replaced by org.openoffice.Office.Paths/Temp</deprecated>
<author>MBA</author>
<desc>Specifies the base directory used by the Office to store temp files.</desc>
</info>
- <value>$(temp)</value>
+ <value/>
</prop>
<prop oor:name="Template" oor:type="oor:string-list">
<info>
@@ -2322,14 +2365,19 @@ Dymamic border coloring means that when the mouse is hovered over a control, and
<desc>ODFVER_011</desc>
</info>
</enumeration>
- <enumeration oor:value="3">
+ <enumeration oor:value="4">
<info>
<desc>ODFVER_012</desc>
</info>
</enumeration>
- </constraints>
- <value>3</value>
- </prop>
+ <enumeration oor:value="3">
+ <info>
+ <desc>ODFVER_LATEST</desc>
+ </info>
+ </enumeration>
+ </constraints>
+ <value>3</value>
+ </prop>
</group>
</group>
<group oor:name="Load">
@@ -5967,7 +6015,7 @@ Dymamic border coloring means that when the mouse is hovered over a control, and
<!-- UIHints: Edit Search/Replace -->
<info>
<author>mod</author>
- <desc>Specifies if search includes notes(SwPostItFields)</desc>
+ <desc>Specifies if search includes comments(SwPostItFields)</desc>
</info>
<value>false</value>
</prop>
diff --git a/officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs b/officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs
index c6eec8845e00..cb684017c7c3 100644
--- a/officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs
@@ -197,14 +197,25 @@
<info>
<author>OJ</author>
</info>
- <group oor:name="ApplicationIntegration">
+ <group oor:name="Policies">
<info>
- <desc>Specifies sevaral settings related to integrating data access functionality into the main applications.</desc>
+ <desc>Defines different policies for working with OpenOffice.org Base.</desc>
</info>
- <group oor:name="InstalledFeatures">
+ <group oor:name="Features">
<info>
- <desc>Specifies which data-access related features are available in non-Base applications.</desc>
+ <desc>controls availability of certain database access related features in the OpenOffice.org applications.</desc>
</info>
+ <group oor:name="Base">
+ <info>
+ <desc>controls availability of features within OpenOffice.org Base.</desc>
+ </info>
+ <prop oor:name="CreateLocalDatabase" oor:type="xs:boolean">
+ <info>
+ <desc>Specifies that the user is able to creatte new local database documents in the "Create Database" wizard.</desc>
+ </info>
+ <value>true</value>
+ </prop>
+ </group>
<group oor:name="Writer">
<info>
<desc>Specifies which data-access related features are available in OpenOffice.org Writer.</desc>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
index f29972ca7fcf..c7e4f71c677c 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
@@ -359,18 +359,26 @@
</constraints>
<value>0</value>
</prop>
- <prop oor:name="SimpleHandles" oor:type="xs:boolean">
- <!-- OldPath: Draw/Other -->
- <!-- OldLocation: soffice.cfg -->
- <!-- UIHints: Optionbar -->
+ <prop oor:name="ShowComments" oor:type="xs:boolean">
<info>
- <author>AF</author>
- <desc>Indicates whether to show simple (true) or 3D-handles (false).</desc>
- <label>Simple Handles</label>
+ <author>CL</author>
+ <desc>Indicates whether to show comments (true) or hide them (false).</desc>
+ <label>Show Comments</label>
</info>
<value>true</value>
</prop>
- <prop oor:name="BigHandles" oor:type="xs:boolean">
+ <prop oor:name="SimpleHandles" oor:type="xs:boolean">
+ <!-- OldPath: Draw/Other -->
+ <!-- OldLocation: soffice.cfg -->
+ <!-- UIHints: Optionbar -->
+ <info>
+ <author>AF</author>
+ <desc>Indicates whether to show simple (true) or 3D-handles (false).</desc>
+ <label>Simple Handles</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="BigHandles" oor:type="xs:boolean">
<!-- OldPath: Draw/Other -->
<!-- OldLocation: soffice.cfg -->
<!-- UIHints: Optionbar -->
diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
index 6cf3a7abdc68..bfa2e7dce407 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
@@ -398,7 +398,15 @@
</constraints>
<value>0</value>
</prop>
- <prop oor:name="SimpleHandles" oor:type="xs:boolean">
+ <prop oor:name="ShowComments" oor:type="xs:boolean">
+ <info>
+ <author>CL</author>
+ <desc>Indicates whether to show comments (true) or hide them (false).</desc>
+ <label>Show Comments</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="SimpleHandles" oor:type="xs:boolean">
<!-- OldPath: Impress/Other -->
<!-- OldLocation: soffice.cfg -->
<!-- UIHints: Optionbar -->
diff --git a/officecfg/registry/schema/org/openoffice/Office/UI.xcs b/officecfg/registry/schema/org/openoffice/Office/UI.xcs
index 02e90d75daef..48368c263b34 100644
--- a/officecfg/registry/schema/org/openoffice/Office/UI.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/UI.xcs
@@ -418,11 +418,11 @@
</group>
<group oor:name="CalcNotesBackground">
<info>
- <desc>Specifies the settings used for the background of notes in Calc.</desc>
+ <desc>Specifies the settings used for the background of comments in Calc.</desc>
</info>
<prop oor:name="Color" oor:type="xs:int">
<info>
- <desc>Specifies the color used for the background of notes.</desc>
+ <desc>Specifies the color used for the background of comments.</desc>
</info>
</prop>
</group>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index 1b21017e3f3c..cb22883eba09 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -1097,8 +1097,8 @@
<!-- UIHints: Tools - Options - Text document - Contents - [Section] Display -->
<info>
<author>OS</author>
- <desc>Specifies if notes are displayed.</desc>
- <label>Notes</label>
+ <desc>Specifies if comments are displayed.</desc>
+ <label>Comments</label>
</info>
<value>true</value>
</prop>
@@ -2145,7 +2145,7 @@
<!-- UIHints: Tools - Options - Text document - Print - [Section] Notes -->
<info>
<author>OS</author>
- <desc>Specifies if and how notes are printed.</desc>
+ <desc>Specifies if and how comments are printed.</desc>
</info>
<constraints>
<enumeration oor:value="0">
@@ -2155,7 +2155,7 @@
</enumeration>
<enumeration oor:value="1">
<info>
- <desc>Notes only</desc>
+ <desc>Comments only</desc>
</info>
</enumeration>
<enumeration oor:value="2">
@@ -5659,13 +5659,13 @@
</group>
<group oor:name="Notes">
<info>
- <desc>Contains settings for notes</desc>
+ <desc>Contains settings for comments</desc>
</info>
<prop oor:name="ShowAnkor" oor:type="xs:boolean">
<info>
<author>mod</author>
- <desc>configures if note anchor should be shown or hidden when display is off</desc>
- <label>Notes Ankor on/off</label>
+ <desc>configures if comment anchor should be shown or hidden when display is off</desc>
+ <label>Comments Ankor on/off</label>
</info>
<value>false</value>
</prop>
@@ -6983,7 +6983,7 @@
</prop>
<prop oor:type="xs:boolean" oor:name="ShowNotes">
<info>
- <desc>Show the "notes" heading ? </desc>
+ <desc>Show the "comments" heading ? </desc>
</info>
</prop>
diff --git a/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs b/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs
index 6063ce1b55c9..ebb9fca30962 100644
--- a/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs
@@ -93,8 +93,8 @@
<!-- UIHints: Tools - Option - HTML-Document Contents - [Section] Display -->
<info>
<author>OS</author>
- <desc>Specifies if notes are displayed.</desc>
- <label>Notes</label>
+ <desc>Specifies if comments are displayed.</desc>
+ <label>Comments</label>
</info>
<value>true</value>
</prop>
@@ -686,7 +686,7 @@
<!-- UIHints: Tools - Option - HTML-Document Print - [Section] Notes -->
<info>
<author>OS</author>
- <desc>Specifies if notes are printed and how they are printed.</desc>
+ <desc>Specifies if comments are printed and how they are printed.</desc>
</info>
<constraints>
<enumeration oor:value="0">
@@ -696,7 +696,7 @@
</enumeration>
<enumeration oor:value="1">
<info>
- <desc>Notes only</desc>
+ <desc>Comments only</desc>
</info>
</enumeration>
<enumeration oor:value="2">
diff --git a/officecfg/registry/schema/org/openoffice/Setup.xcs b/officecfg/registry/schema/org/openoffice/Setup.xcs
index 7572879528da..ad6b4d9ce425 100644
--- a/officecfg/registry/schema/org/openoffice/Setup.xcs
+++ b/officecfg/registry/schema/org/openoffice/Setup.xcs
@@ -352,6 +352,13 @@
</info>
<value>false</value>
</prop>
+ <prop oor:name="LastCompatibilityCheckID" oor:type="xs:string">
+ <info>
+ <author>DV</author>
+ <desc>The build ID of the office. On startup the office will compare this ID with the current build id to decide if the extensions dependencies need to be checked.</desc>
+ </info>
+ <value>not checked</value>
+ </prop>
<set oor:name="Factories" oor:node-type="Factory">
<info>
<author>AS</author>
diff --git a/officecfg/util/alllang.xsl b/officecfg/util/alllang.xsl
index 47ae08165928..fd03d973cf71 100644
--- a/officecfg/util/alllang.xsl
+++ b/officecfg/util/alllang.xsl
@@ -61,7 +61,7 @@
<xsl:choose>
<xsl:when test="string-length($locale)">
<xsl:apply-templates select = "@*" mode="locale"/>
- <xsl:apply-templates mode="locale"/>
+ <xsl:apply-templates select = "node|prop" mode="locale"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select = "@*"/>
@@ -85,7 +85,7 @@
<xsl:if test="descendant::value[@xml:lang=$locale]/../value[not (@xml:lang)]">
<xsl:copy>
<xsl:apply-templates select = "@*" mode="locale"/>
- <xsl:apply-templates mode = "locale"/>
+ <xsl:apply-templates select = "node|prop|value" mode = "locale"/>
</xsl:copy>
</xsl:if>
</xsl:when>
@@ -93,7 +93,7 @@
<xsl:if test="descendant::value[@xml:lang = $locale]">
<xsl:copy>
<xsl:apply-templates select = "@*" mode="locale"/>
- <xsl:apply-templates mode = "locale"/>
+ <xsl:apply-templates select = "node|prop|value" mode = "locale"/>
</xsl:copy>
</xsl:if>
</xsl:otherwise>
diff --git a/oovbaapi/genconstidl/makefile.mk b/oovbaapi/genconstidl/makefile.mk
index 42219545c672..95363d56c3e9 100644
--- a/oovbaapi/genconstidl/makefile.mk
+++ b/oovbaapi/genconstidl/makefile.mk
@@ -36,6 +36,8 @@ PRJNAME=oovbaapi
.INCLUDE : settings.mk
+.IF "$(L10N_framework)"==""
+
.IF "$(ENABLE_VBA)"!="YES"
dummy:
@echo "not building vba..."
@@ -70,3 +72,7 @@ CLEAN :
@$(RM) $(MY_GEN_IDL_PATH)$/*.idl
@$(RM) $(foreach,i,$(MYSYMFILES) $(MISC)$/$(i:b).done)
+.ELSE
+ivo:
+ $(ECHO)
+.ENDIF # L10N_framework
diff --git a/oovbaapi/ooo/vba/constants/makefile.mk b/oovbaapi/ooo/vba/constants/makefile.mk
index 9fb0e9144d28..0b092e6f7999 100644
--- a/oovbaapi/ooo/vba/constants/makefile.mk
+++ b/oovbaapi/ooo/vba/constants/makefile.mk
@@ -36,6 +36,7 @@ TARGET=constants
PACKAGE=org$/vba$/constants
# --- Settings -----------------------------------------------------
+
.INCLUDE : $(PRJ)$/util$/makefile.pmk
.IF "$(ENABLE_VBA)"!="YES"
@@ -43,8 +44,8 @@ dummy:
@echo "not building vba..."
.ELSE
+.IF "$(L10N_framework)"==""
# ------------------------------------------------------------------------
-
# I tried to use the IDLFILES target but it failed dismally
MY_GEN_IDL_PATH=$(MISC)$/idl
MY_GEN_UCR_PATH=$(OUT)$/ucr$/$(PACKAGE)
@@ -53,10 +54,12 @@ MYTMPIDLFILES=$(shell @ls $(MY_GEN_IDL_PATH))
MYIDLFILES=$(foreach,i,$(MYTMPIDLFILES) $(MY_GEN_IDL_PATH)$/$(i))
MYURDFILES=$(foreach,i,$(MYIDLFILES) $(MY_GEN_UCR_PATH)$/$(i:b).urd)
MYDBTARGET=$(OUT)$/ucr/constants.db
-
+.ENDIF
+.ENDIF
.INCLUDE : target.mk
+.IF "$(L10N_framework)"==""
ALLTAR: $(MYDBTARGET)
$(MY_GEN_UCR_PATH)$/%.urd: $(MY_GEN_IDL_PATH)$/%.idl
@@ -66,4 +69,3 @@ $(MYDBTARGET) : $(MYURDFILES) $(MYIDLFILES)
$(REGMERGE) $(OUT)$/ucr/constants.db /UCR @$(mktmp $(MYURDFILES))
.ENDIF
-
diff --git a/oovbaapi/ooo/vba/makefile.mk b/oovbaapi/ooo/vba/makefile.mk
index ee63d6373feb..6f9815bfeb72 100644
--- a/oovbaapi/ooo/vba/makefile.mk
+++ b/oovbaapi/ooo/vba/makefile.mk
@@ -44,7 +44,7 @@ dummy:
.ENDIF
# ------------------------------------------------------------------------
-
+.IF "$(L10N_framework)"=""
IDLFILES=\
XErrObject.idl \
XGlobals.idl \
@@ -60,5 +60,5 @@ IDLFILES=\
Globals.idl\
# ------------------------------------------------------------------
-
+.ENDIF
.INCLUDE : target.mk
diff --git a/oovbaapi/util/makefile.mk b/oovbaapi/util/makefile.mk
index 97e592a7c053..9fbd349b080f 100644
--- a/oovbaapi/util/makefile.mk
+++ b/oovbaapi/util/makefile.mk
@@ -45,6 +45,7 @@ dummy:
@echo "not building vba..."
.ENDIF
+.IF "$(L10N_framework)"==""
# ------------------------------------------------------------------
UNOIDLDBFILES= \
$(UCR)$/vba.db \
@@ -53,5 +54,6 @@ UNOIDLDBFILES= \
$(UCR)$/constants.db
# --- Targets ------------------------------------------------------
+.ENDIF
.INCLUDE : target.mk
diff --git a/readlicense_oo/docs/readme/readme.xrm b/readlicense_oo/docs/readme/readme.xrm
index b595911b2a98..60c1267482e4 100755
--- a/readlicense_oo/docs/readme/readme.xrm
+++ b/readlicense_oo/docs/readme/readme.xrm
@@ -158,7 +158,34 @@
<Text id="DLLA3" xml:lang="en-US"></Text>
</Paragraph>
- <Paragraph id="StartupProblemsHeader" style="H3" os="all">
+ <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>
@@ -223,7 +250,7 @@
<Section id="Scroll">
- <Paragraph id="F1a" style="H3" gui="WNT">
+ <Paragraph id="F1a" style="H2" gui="WNT">
<Text id="naso" xml:lang="en-US">ALPS/Synaptics notebook touchpads in Windows</Text>
</Paragraph>
@@ -249,7 +276,7 @@
<Section id="NetscapeAdressBook">
- <Paragraph id="AdressBookHeader" style="H3" os="SOLARIS">
+ <Paragraph id="AdressBookHeader" style="H2" os="SOLARIS">
<Text id="sdfsd32asrc" xml:lang="en-US">Mozilla Address Book Driver</Text>
</Paragraph>
@@ -260,7 +287,7 @@
<Section id="Keyboard">
- <Paragraph id="abc2" style="H3">
+ <Paragraph id="abc2" style="H2">
<Text id="awe1" xml:lang="en-US">Shortcut Keys</Text>
</Paragraph>
@@ -308,7 +335,7 @@
<Section id="FileLocking">
- <Paragraph id="G1" style="H3" gui="UNX">
+ <Paragraph id="G1" style="H2" gui="UNX">
<Text id="gfh6w" xml:lang="en-US">File Locking</Text>
</Paragraph>
@@ -323,7 +350,7 @@
<Section id="Mapi">
- <Paragraph id="G1a" style="H3" gui="WNT">
+ <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>
diff --git a/readlicense_oo/util/makefile.pmk b/readlicense_oo/util/makefile.pmk
index aa66ec0657b9..b5c9099a1aa6 100755
--- a/readlicense_oo/util/makefile.pmk
+++ b/readlicense_oo/util/makefile.pmk
@@ -70,6 +70,12 @@ $(MISC)$/$(GUI)$/$(eq,$(GUI),WNT readme README)_%.html : 'virtual'
chmod g+w $(MISC)$/$(GUI)
.ENDIF # "$(GUI)"=="UNX"
+$(MISC)$/$(GUI)$/$(eq,$(GUI),OS2 readme README)_%.html : 'virtual'
+ $(XSLTPROC) --nonet -o $@ \
+ --stringparam os1 $(OS) --stringparam gui1 $(GUI) --stringparam com1 $(COM) \
+ --stringparam cp1 $(CPUNAME) --stringparam type html --stringparam lang1 $* \
+ ..$/readme.xsl $(MERGEDXRM)
+
# no percent-rule to avoid ambiguous inference chains for README_<lang>.html
$(SYSTEXTDOCS) : $(MISC)$/readme_text.xsl
$(XSLTPROC) --nonet -o $@ \
diff --git a/sandbox/com/sun/star/lib/sandbox/makefile.mk b/sandbox/com/sun/star/lib/sandbox/makefile.mk
index f68414510c42..81e7fdcacefa 100644
--- a/sandbox/com/sun/star/lib/sandbox/makefile.mk
+++ b/sandbox/com/sun/star/lib/sandbox/makefile.mk
@@ -37,6 +37,7 @@ PACKAGE = com$/sun$/star$/lib$/sandbox
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
+.IF "$(L10N_framework)"==""
.IF "$(JDK)" == "gcj"
all:
@@ -81,7 +82,8 @@ JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
RC_SUBDIRSDEPS=$(JAVATARGET)
# --- Targets ------------------------------------------------------
+.ENDIF
+.ENDIF
.INCLUDE : target.mk
-.ENDIF
diff --git a/sandbox/util/makefile.mk b/sandbox/util/makefile.mk
index 3e02636bc86b..ac5684ec8a87 100644
--- a/sandbox/util/makefile.mk
+++ b/sandbox/util/makefile.mk
@@ -34,7 +34,7 @@ PRJNAME = sandbox
TARGET = lib_sandbox_util
# --- Settings -----------------------------------------------------
-
+.IF "$(L10N_framework)"==""
.INCLUDE : settings.mk
JARCLASSDIRS = com$/sun$/star$/lib$/sandbox
@@ -42,5 +42,7 @@ JARTARGET = sandbox.jar
JARCOMPRESS = TRUE
# --- Targets ------------------------------------------------------
+.ENDIF # L10N_framework
.INCLUDE : target.mk
+
diff --git a/scripting/examples/java/makefile.mk b/scripting/examples/java/makefile.mk
index c4a4c2a081dd..b8138c755a62 100755
--- a/scripting/examples/java/makefile.mk
+++ b/scripting/examples/java/makefile.mk
@@ -36,5 +36,7 @@ TARGET=javaexamples
.INCLUDE : ant.mk
.IF "$(SOLAR_JAVA)"!=""
+.IF "$(L10N_framework)"==""
ALLTAR : ANTBUILD
.ENDIF
+.ENDIF
diff --git a/scripting/examples/makefile.mk b/scripting/examples/makefile.mk
index 53660595538e..f071060f0234 100755
--- a/scripting/examples/makefile.mk
+++ b/scripting/examples/makefile.mk
@@ -34,7 +34,7 @@ TARGET=scriptinginstaller
no_common_build_zip=true
.INCLUDE : settings.mk
-
+.IF "$(L10N_framework)"==""
.IF "$(SOLAR_JAVA)"!=""
ZIP1FLAGS=-r
ZIP1TARGET=ScriptsJava
@@ -58,5 +58,5 @@ ZIP5FLAGS=-r
ZIP5TARGET=scriptbindinglib
ZIP5DIR=$(PRJ)$/workben$/bindings
ZIP5LIST=*.xlb Highlight.xdl
-
+.ENDIF
.INCLUDE : target.mk
diff --git a/scripting/java/makefile.mk b/scripting/java/makefile.mk
index bb87b9da2185..9b3255e6be06 100755
--- a/scripting/java/makefile.mk
+++ b/scripting/java/makefile.mk
@@ -35,6 +35,8 @@ TARGET=scriptruntimeforjava
.INCLUDE : ant.mk
+.IF "$(L10N_framework)"==""
.IF "$(SOLAR_JAVA)"!=""
ALLTAR : ANTBUILD
.ENDIF
+.ENDIF
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index 4b1a4489a4a4..b011eaccacc8 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -359,8 +359,9 @@ sal_Bool StringResourceImpl::isReadOnly()
return m_bReadOnly;
}
-void StringResourceImpl::setCurrentLocale( const Locale& locale, sal_Bool FindClosestMatch )
- throw (IllegalArgumentException, RuntimeException)
+void StringResourceImpl::implSetCurrentLocale( const Locale& locale,
+ sal_Bool FindClosestMatch, sal_Bool bUseDefaultIfNoMatch )
+ throw (IllegalArgumentException, RuntimeException)
{
::osl::MutexGuard aGuard( getMutex() );
@@ -370,6 +371,9 @@ void StringResourceImpl::setCurrentLocale( const Locale& locale, sal_Bool FindCl
else
pLocaleItem = getItemForLocale( locale, true );
+ if( pLocaleItem == NULL && bUseDefaultIfNoMatch )
+ pLocaleItem = m_pDefaultLocaleItem;
+
if( pLocaleItem != NULL )
{
loadLocale( pLocaleItem );
@@ -380,6 +384,13 @@ void StringResourceImpl::setCurrentLocale( const Locale& locale, sal_Bool FindCl
}
}
+void StringResourceImpl::setCurrentLocale( const Locale& locale, sal_Bool FindClosestMatch )
+ throw (IllegalArgumentException, RuntimeException)
+{
+ sal_Bool bUseDefaultIfNoMatch = false;
+ implSetCurrentLocale( locale, FindClosestMatch, bUseDefaultIfNoMatch );
+}
+
void StringResourceImpl::setDefaultLocale( const Locale& locale )
throw (IllegalArgumentException, RuntimeException,NoSupportException)
{
@@ -500,7 +511,7 @@ void StringResourceImpl::newLocale( const Locale& locale )
LocaleItem* pCopyFromItem = m_pDefaultLocaleItem;
if( pCopyFromItem == NULL )
pCopyFromItem = m_pCurrentLocaleItem;
- if( pCopyFromItem != NULL )
+ if( pCopyFromItem != NULL && loadLocale( pCopyFromItem ) )
{
const IdToStringMap& rSourceMap = pCopyFromItem->m_aIdToStringMap;
IdToStringMap& rTargetMap = pLocaleItem->m_aIdToStringMap;
@@ -863,7 +874,8 @@ void StringResourcePersistenceImpl::implInitializeCommonParameters
implScanLocales();
sal_Bool FindClosestMatch = true;
- setCurrentLocale( aCurrentLocale, FindClosestMatch );
+ sal_Bool bUseDefaultIfNoMatch = true;
+ implSetCurrentLocale( aCurrentLocale, FindClosestMatch, bUseDefaultIfNoMatch );
}
// -----------------------------------------------------------------------------
diff --git a/scripting/source/stringresource/stringresource.hxx b/scripting/source/stringresource/stringresource.hxx
index e5e3a7c12a35..71d26f05dec7 100644
--- a/scripting/source/stringresource/stringresource.hxx
+++ b/scripting/source/stringresource/stringresource.hxx
@@ -169,6 +169,9 @@ protected:
// Returns the LocalItem for a given locale, if it exists, otherwise NULL
// This method performes a closest match search, at least the language must match
LocaleItem* getClosestMatchItemForLocale( const ::com::sun::star::lang::Locale& locale );
+ void implSetCurrentLocale( const ::com::sun::star::lang::Locale& locale,
+ sal_Bool FindClosestMatch, sal_Bool bUseDefaultIfNoMatch )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
void implModified( void );
void implNotifyListeners( void );
diff --git a/sfx2/inc/guisaveas.hxx b/sfx2/inc/guisaveas.hxx
index 772c3f7c5304..f8b19e1d5754 100644
--- a/sfx2/inc/guisaveas.hxx
+++ b/sfx2/inc/guisaveas.hxx
@@ -41,6 +41,7 @@
#include <com/sun/star/frame/XModuleManager.hpp>
#include <comphelper/sequenceashashmap.hxx>
+#include <sfx2/signaturestate.hxx>
namespace com { namespace sun { namespace star {
@@ -78,7 +79,8 @@ public:
const ::rtl::OUString& aSlotName,
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgsSequence,
sal_Bool bPreselectPassword,
- ::rtl::OUString aUserSelectedName );
+ ::rtl::OUString aUserSelectedName,
+ sal_uInt16 nDocumentSignatureState = SIGNATURESTATE_NOSIGNATURES );
static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SearchForFilter(
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerQuery >& xFilterQuery,
diff --git a/sfx2/inc/pch/precompiled_sfx2.hxx b/sfx2/inc/pch/precompiled_sfx2.hxx
index ad70b76f27ff..03f38a27fe4f 100644
--- a/sfx2/inc/pch/precompiled_sfx2.hxx
+++ b/sfx2/inc/pch/precompiled_sfx2.hxx
@@ -485,7 +485,6 @@
#include "sal/types.h"
#include "setup_native/qswin32.h"
#include "shell/systemshell.hxx"
-#include "sj2/sjapplet.hxx"
#include "sot/clsids.hxx"
#include "sot/exchange.hxx"
#include "sot/factory.hxx"
@@ -542,7 +541,6 @@
#include "svtools/lckbitem.hxx"
#include "svtools/localisationoptions.hxx"
#include "svtools/localresaccess.hxx"
-#include "svtools/loginerr.hxx"
#include "svtools/lstner.hxx"
#include "svtools/memberid.hrc"
#include "svtools/menuoptions.hxx"
diff --git a/sfx2/inc/sfx2/dinfdlg.hxx b/sfx2/inc/sfx2/dinfdlg.hxx
index 1873c6e6c88e..27da2810d49e 100644
--- a/sfx2/inc/sfx2/dinfdlg.hxx
+++ b/sfx2/inc/sfx2/dinfdlg.hxx
@@ -417,12 +417,14 @@ private:
ImageButton m_aRemoveButton;
sal_Int32 m_nLineHeight;
+ sal_Int32 m_nScrollPos;
SvtSysLocale m_aSysLocale;
std::vector< CustomPropertyLine* > m_aCustomPropertiesLines;
CustomPropertyLine* m_pCurrentLine;
SvNumberFormatter m_aNumberFormatter;
Timer m_aEditLoseFocusTimer;
Timer m_aBoxLoseFocusTimer;
+ Link m_aRemovedHdl;
DECL_LINK( TypeHdl, CustomPropertiesTypeBox* );
DECL_LINK( RemoveHdl, CustomPropertiesRemoveButton* );
@@ -449,6 +451,7 @@ public:
bool DoesCustomPropertyExist( const String& rName ) const;
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
GetCustomProperties() const;
+ void SetRemovedHdl( const Link& rLink ) { m_aRemovedHdl = rLink; }
};
// class CustomPropertiesControl -----------------------------------------
@@ -466,12 +469,13 @@ private:
void Initialize();
DECL_LINK( ScrollHdl, ScrollBar* );
+ DECL_LINK( RemovedHdl, void* );
public:
CustomPropertiesControl( Window* pParent, const ResId& rResId );
~CustomPropertiesControl();
- void AddLine( const ::rtl::OUString& sName, com::sun::star::uno::Any& rAny );
+ void AddLine( const ::rtl::OUString& sName, com::sun::star::uno::Any& rAny, bool bInteractive );
inline bool AreAllLinesValid() const { return m_aPropertiesWin.AreAllLinesValid(); }
inline void ClearAllLines() { m_aPropertiesWin.ClearAllLines(); }
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index bebcdc684d89..e8ae3f5d1d85 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -199,8 +199,6 @@ public:
void SetDataAvailableLink( const Link& rLink );
Link GetDataAvailableLink( ) const;
- void SetClassFilter( const SvGlobalName & rFilterClass );
-
sal_uInt32 GetMIMEAndRedirect( String& );
sal_uInt32 GetErrorCode() const;
sal_uInt32 GetError() const
@@ -227,17 +225,14 @@ public:
SvEaMgr* GetEaMgr();
sal_Bool Commit();
- sal_Bool TryStorage();
- SAL_DLLPRIVATE ErrCode Unpack_Impl( const String& );
sal_Bool IsStorage();
sal_Int8 ShowLockedDocumentDialog( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aData, sal_Bool bIsLoading, sal_Bool bOwnLock );
sal_Bool LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI );
void UnlockFile();
- ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetStorage();
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetStorage( sal_Bool bCreateTempIfNo = sal_True );
::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetOutputStorage();
- const SvGlobalName& GetClassFilter();
void ResetError();
sal_Bool UsesCache() const;
void SetUsesCache( sal_Bool );
@@ -253,9 +248,8 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetInputStream();
- void CreateTempFile();
+ void CreateTempFile( sal_Bool bReplace = sal_True );
void CreateTempFileNoCopy();
- void TryToSwitchToRepairedTemp();
::rtl::OUString SwitchDocumentToTempFile();
sal_Bool SwitchDocumentToFile( ::rtl::OUString aURL );
@@ -264,24 +258,19 @@ public:
::rtl::OUString GetBaseURL( bool bForSaving=false );
#if _SOLAR__PRIVATE
-//REMOVE // the storage will be truncated, if it is still not open then the stream will be truncated
-//REMOVE ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetOutputStorage_Impl();
- SAL_DLLPRIVATE ::rtl::OUString GetOutputStorageURL_Impl();
SAL_DLLPRIVATE BOOL HasStorage_Impl() const;
- SAL_DLLPRIVATE sal_Bool BasedOnOriginalFile_Impl();
SAL_DLLPRIVATE void StorageBackup_Impl();
SAL_DLLPRIVATE ::rtl::OUString GetBackup_Impl();
- SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetLastCommitReadStorage_Impl();
- SAL_DLLPRIVATE void CloseReadStorage_Impl();
+ SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetZipStorageToSign_Impl( sal_Bool bReadOnly = sal_True );
+ SAL_DLLPRIVATE void CloseZipStorage_Impl();
// the storage that will be returned by the medium on GetStorage request
SAL_DLLPRIVATE void SetStorage_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewStorage );
SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetInputStream_Impl();
SAL_DLLPRIVATE void CloseAndReleaseStreams_Impl();
-//REMOVE SvStorage* GetStorage_Impl( BOOL bUCBStorage );
SAL_DLLPRIVATE void RefreshName_Impl();
SAL_DLLPRIVATE sal_uInt16 AddVersion_Impl( com::sun::star::util::RevisionTag& rVersion );
SAL_DLLPRIVATE sal_Bool TransferVersionList_Impl( SfxMedium& rMedium );
@@ -320,7 +309,6 @@ public:
SAL_DLLPRIVATE void DataAvailable_Impl();
SAL_DLLPRIVATE void Cancel_Impl();
SAL_DLLPRIVATE void SetPhysicalName_Impl(const String& rName);
- SAL_DLLPRIVATE void MoveTempTo_Impl( SfxMedium* pMedium );
SAL_DLLPRIVATE void CanDisposeStorage_Impl( sal_Bool bDisposeStorage );
SAL_DLLPRIVATE sal_Bool WillDisposeStorageOnClose_Impl();
@@ -340,7 +328,7 @@ public:
const INetURLObject& aDest,
const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& xComEnv );
- SAL_DLLPRIVATE sal_Bool SignContents_Impl( sal_Bool bScriptingContent );
+ SAL_DLLPRIVATE sal_Bool SignContents_Impl( sal_Bool bScriptingContent, const ::rtl::OUString& aODFVersion, sal_Bool bHasValidDocumentSignature );
// the following two methods must be used and make sence only during saving currently
// TODO/LATER: in future the signature state should be controlled by the medium not by the document
@@ -353,6 +341,9 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
static sal_Bool EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL );
static ::rtl::OUString CreateTempCopyWithExt( const ::rtl::OUString& aURL );
+ static sal_Bool CallApproveHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler, ::com::sun::star::uno::Any aRequest, sal_Bool bAllowAbort );
+
+ static sal_Bool SetWritableForUserOnly( const ::rtl::OUString& aURL );
};
SV_DECL_IMPL_REF( SfxMedium )
diff --git a/sfx2/inc/sfx2/docfilt.hxx b/sfx2/inc/sfx2/docfilt.hxx
index dbeba0763c67..47c1cba003e5 100644
--- a/sfx2/inc/sfx2/docfilt.hxx
+++ b/sfx2/inc/sfx2/docfilt.hxx
@@ -75,6 +75,20 @@
#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/docmacromode.hxx b/sfx2/inc/sfx2/docmacromode.hxx
index 4f0f1d2f9d9b..79d0cb016104 100644
--- a/sfx2/inc/sfx2/docmacromode.hxx
+++ b/sfx2/inc/sfx2/docmacromode.hxx
@@ -114,10 +114,11 @@ namespace sfx2
virtual ::rtl::OUString
getDocumentLocation() const = 0;
- /** returns the storage to which the document has last been committed to, for read-only
- access
+ /** returns a zip-storage based on the last commited version of the document,
+ for readonly access
- An implementation is allowed to return <NULL/> here if and only if the document
+ The storage is intended to be used for signing. An implementation is
+ allowed to return <NULL/> here if and only if the document
does not support signing the script storages.
@todo
@@ -126,7 +127,7 @@ namespace sfx2
XStorageBasedDocument.
*/
virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
- getLastCommitDocumentStorage() = 0;
+ getZipStorageToSign() = 0;
/** checks whether the document's storage contains sub storages with macros or scripts
@@ -161,7 +162,20 @@ namespace sfx2
@seealso <sfx2/signaturestate.hxx>
*/
virtual sal_Int16
- getScriptingSignatureState() const = 0;
+ getScriptingSignatureState() = 0;
+
+ /** allows to detect whether there is a trusted scripting signature
+
+ Note: On the medium run, the signature handling of a document should be outsourced
+ into a dedicated class, instead of being hard-wired into the SfxObjectShell. This
+ class could then be used outside the SfxObjectShell (e.g. in Base documents), too.
+ When this happens, this method here should be replaced by a method at this
+ new class.
+
+ @seealso <sfx2/signaturestate.hxx>
+ */
+ virtual sal_Bool
+ hasTrustedScriptingSignature( sal_Bool bAllowUIToAddAuthor ) = 0;
/** shows a warning that the document's signature is broken
diff --git a/sfx2/inc/sfx2/event.hxx b/sfx2/inc/sfx2/event.hxx
index cd83103c8196..653fa2eeb7d8 100644
--- a/sfx2/inc/sfx2/event.hxx
+++ b/sfx2/inc/sfx2/event.hxx
@@ -34,6 +34,8 @@
#include "sfx2/dllapi.h"
#include <tools/string.hxx>
#include <svtools/hint.hxx>
+#include <svtools/eventcfg.hxx>
+#include <rtl/ustring.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -44,33 +46,24 @@ class SfxObjectShell;
class SFX2_DLLPUBLIC SfxEventHint : public SfxHint
{
- USHORT nEventId;
SfxObjectShell* pObjShell;
- String _aArgs;
- BOOL _bDummy;
- BOOL _bAddToHistory;
+ ::rtl::OUString aEventName;
+ USHORT nEventId;
public:
TYPEINFO();
- SfxEventHint( USHORT nId,
- const String& rArgs,
- SfxObjectShell *pObj = 0 )
- : nEventId(nId),
- pObjShell(pObj),
- _aArgs( rArgs ),
- _bAddToHistory(FALSE)
- {}
- SfxEventHint( USHORT nId, SfxObjectShell *pObj = 0 )
- : nEventId(nId),
- pObjShell(pObj),
- _bAddToHistory(FALSE)
+ SfxEventHint( USHORT nId, const ::rtl::OUString& aName, SfxObjectShell *pObj = 0 )
+ : pObjShell(pObj),
+ aEventName(aName),
+ nEventId(nId)
{}
- const String& GetArgs() const { return _aArgs;}
-
USHORT GetEventId() const
{ return nEventId; }
+ ::rtl::OUString GetEventName() const
+ { return aEventName; }
+
SfxObjectShell* GetObjShell() const
{ return pObjShell; }
};
@@ -82,8 +75,6 @@ class SfxNamedHint : public SfxHint
String _aEventName;
SfxObjectShell* _pObjShell;
String _aArgs;
- BOOL _bDummy;
- BOOL _bAddToHistory;
public:
TYPEINFO();
@@ -93,15 +84,13 @@ public:
SfxObjectShell *pObj = 0 )
: _aEventName( rName ),
_pObjShell( pObj),
- _aArgs( rArgs ),
- _bAddToHistory( FALSE )
+ _aArgs( rArgs )
{}
SfxNamedHint( const String& rName,
SfxObjectShell *pObj = 0 )
: _aEventName( rName ),
- _pObjShell( pObj ),
- _bAddToHistory( FALSE )
+ _pObjShell( pObj )
{}
const String& GetArgs() const { return _aArgs;}
diff --git a/sfx2/inc/sfx2/evntconf.hxx b/sfx2/inc/sfx2/evntconf.hxx
index 51362c14c309..cfe8629cd0cf 100644
--- a/sfx2/inc/sfx2/evntconf.hxx
+++ b/sfx2/inc/sfx2/evntconf.hxx
@@ -118,36 +118,9 @@ public:
class SFX2_DLLPUBLIC SfxEventConfiguration
{
-friend class SfxEventConfigItem_Impl;
-
- SvxMacroTableDtor* pAppTable;
- SvxMacroTableDtor* pDocTable;
- sal_Bool bIgnoreConfigure;
-
public:
- SfxEventConfiguration();
- ~SfxEventConfiguration();
-
- void ConfigureEvent(USHORT nId, const SvxMacro&,
- SfxObjectShell* pObjSh);
- void ConfigureEvent(USHORT nId, const String& rMacro,
- SfxObjectShell* pObjSh);
-
- SvxMacroTableDtor* GetDocEventTable(SfxObjectShell*);
-
- static void RegisterEvent( USHORT nId, const String& rName,
- const String& rMacroName );
-
- SAL_DLLPRIVATE BOOL Warn_Impl( SfxObjectShell *pDoc, const SvxMacro* pMacro );
- SAL_DLLPRIVATE void PropagateEvent_Impl( SfxObjectShell *pDoc,
- USHORT nId,
- const SvxMacro* pMacro );
- SAL_DLLPRIVATE static rtl::OUString GetEventName_Impl( ULONG nID );
- SAL_DLLPRIVATE static ULONG GetEventId_Impl( const rtl::OUString& rEventName );
- SAL_DLLPRIVATE ::com::sun::star::uno::Any CreateEventData_Impl( const SvxMacro *pMacro );
-
- SAL_DLLPRIVATE static ULONG GetPos_Impl( USHORT nID, sal_Bool &rFound );
- SAL_DLLPRIVATE static ULONG GetPos_Impl( const String& rName, sal_Bool &rFound );
+ static void ConfigureEvent( ::rtl::OUString aName, const SvxMacro&, SfxObjectShell* pObjSh);
+ static SvxMacro* ConvertToMacro( const com::sun::star::uno::Any& rElement, SfxObjectShell* pDoc, BOOL bBlowUp );
};
#endif
diff --git a/sfx2/inc/sfx2/filedlghelper.hxx b/sfx2/inc/sfx2/filedlghelper.hxx
index f9377f9908ea..e6dc185ef919 100644
--- a/sfx2/inc/sfx2/filedlghelper.hxx
+++ b/sfx2/inc/sfx2/filedlghelper.hxx
@@ -151,7 +151,8 @@ public:
SD_INSERT_SOUND, // insert sound in draw
SD_INSERT_VIDEO, // insert video in draw
SD_EXPORT, // export in draw
- SI_EXPORT // export in impress
+ SI_EXPORT, // export in impress
+ SW_EXPORT // export in writer
};
private:
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index 71f1729840c0..7e3813584de9 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -43,6 +43,7 @@
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/security/DocumentSignatureInformation.hpp>
+#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -236,10 +237,6 @@ private:
//REMOVE sal_Bool SaveInfoAndConfig_Impl( SvStorageRef pNewStg );
- SAL_DLLPRIVATE sal_uInt16 ImplCheckSignaturesInformation(
- const ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation >& aInfos );
-
-
//#endif
protected:
@@ -733,8 +730,11 @@ public:
SAL_DLLPRIVATE void BreakMacroSign_Impl( sal_Bool bBreakMacroSing );
SAL_DLLPRIVATE void CheckSecurityOnLoading_Impl();
SAL_DLLPRIVATE void CheckForBrokenDocSignatures_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler );
+ 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 static SEQUENCE< OUSTRING > GetEventNames_Impl();
+ SAL_DLLPRIVATE SEQUENCE< OUSTRING > GetEventNames_Impl();
SAL_DLLPRIVATE void InitBasicManager_Impl();
SAL_DLLPRIVATE SfxObjectShell_Impl* Get_Impl() { return pImp; }
@@ -797,6 +797,13 @@ public:
SAL_DLLPRIVATE SfxAcceleratorManager* GetAccMgr_Impl();
SAL_DLLPRIVATE SfxToolBoxConfig* GetToolBoxConfig_Impl();
SAL_DLLPRIVATE sal_uInt16 ImplGetSignatureState( sal_Bool bScriptingContent = FALSE );
+
+ SAL_DLLPRIVATE ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation >
+ ImplAnalyzeSignature(
+ sal_Bool bScriptingContent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >& xSigner
+ = ::com::sun::star::uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >() );
+
SAL_DLLPRIVATE void ImplSign( sal_Bool bScriptingContent = FALSE );
SAL_DLLPRIVATE sal_Bool QuerySaveSizeExceededModules_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler );
//#endif
diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc
index fbc5e6f58d1c..1605f689471f 100644
--- a/sfx2/inc/sfx2/sfx.hrc
+++ b/sfx2/inc/sfx2/sfx.hrc
@@ -111,6 +111,9 @@
#define SFX_EVENT_SAVEDOCFAILED (EVENT_SFX_START + 28)
#define SFX_EVENT_SAVETODOCFAILED (EVENT_SFX_START + 29)
+#define SFX_EVENT_TITLECHANGED (EVENT_SFX_START + 30)
+#define SFX_EVENT_MODECHANGED (EVENT_SFX_START + 31)
+
// Events f"ur Controls etc.
#define SFX_EVENT_MOUSEOVER_OBJECT ( EVENT_SFX_START + 100 )
#define SFX_EVENT_MOUSECLICK_OBJECT ( EVENT_SFX_START + 101 )
diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx
index 324080484c81..6ef67b6a009a 100644
--- a/sfx2/inc/sfx2/sfxbasemodel.hxx
+++ b/sfx2/inc/sfx2/sfxbasemodel.hxx
@@ -1513,7 +1513,7 @@ private:
SAL_DLLPRIVATE void impl_store( const OUSTRING& sURL ,
const SEQUENCE< PROPERTYVALUE >& seqArguments ,
sal_Bool bSaveTo ) ;
- SAL_DLLPRIVATE void postEvent_Impl( ULONG nEventID );
+ SAL_DLLPRIVATE void postEvent_Impl( ::rtl::OUString );
SAL_DLLPRIVATE String getEventName_Impl( long nID );
SAL_DLLPRIVATE void NotifyStorageListeners_Impl();
SAL_DLLPRIVATE bool QuerySaveSizeExceededModules( const com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler >& xHandler );
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index e600c812a373..c15c09a09384 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -140,8 +140,10 @@
//#define SID_TITLE (SID_SFX_START + 307)
#define SID_CONTEXT (SID_SFX_START + 310)
-#define SID_CURRENTTIME (SID_SFX_START + 311)
-#define SID_CURRENTDATE (SID_SFX_START + 312)
+
+#define SID_PASTE_SPECIAL (SID_SFX_START + 311)
+#define SID_CLIPBOARD_FORMAT_ITEMS (SID_SFX_START + 312)
+
#define SID_VERSION_VISIBLE (SID_SFX_START + 313)
#define SID_PASTE_UNFORMATTED (SID_SFX_START + 314)
#define SID_PRINTER_NOTFOUND_WARN (SID_SFX_START + 320)
@@ -871,6 +873,7 @@
#define SID_HELP_PI (SID_SFX_START + 962)
#define SID_BASIC_ENABLED (SID_SFX_START + 964)
#define SID_EXPORT_DIALOG (SID_SFX_START + 965)
+#define SID_IMPORT_DIALOG (SID_SFX_START + 966)
#define SID_BASICBREAK (SID_SFX_START +1521)
diff --git a/sfx2/inc/sfx2/signaturestate.hxx b/sfx2/inc/sfx2/signaturestate.hxx
index 48c06fee623b..be035ef25818 100644
--- a/sfx2/inc/sfx2/signaturestate.hxx
+++ b/sfx2/inc/sfx2/signaturestate.hxx
@@ -36,7 +36,12 @@
#define SIGNATURESTATE_NOSIGNATURES (sal_Int16)0
#define SIGNATURESTATE_SIGNATURES_OK (sal_Int16)1
#define SIGNATURESTATE_SIGNATURES_BROKEN (sal_Int16)2
-#define SIGNATURESTATE_SIGNATURES_INVALID (sal_Int16)3 // State was SIGNATURES_OK, but doc is modified now
-#define SIGNATURESTATE_SIGNATURES_NOTVALIDATED (sal_Int16)4 // signature is OK, but certificate could not be validated
+// State was SIGNATURES_OK, but doc is modified now
+#define SIGNATURESTATE_SIGNATURES_INVALID (sal_Int16)3
+// signature is OK, but certificate could not be validated
+#define SIGNATURESTATE_SIGNATURES_NOTVALIDATED (sal_Int16)4
+//signatur and certificate are ok,but not al files are signed, as was the case in
+//OOo 2.x - OOo 3.1.1. This state is only used together with document signatures.
+#define SIGNATURESTATE_SIGNATURES_PARTIAL_OK (sal_Int16)5
#endif // SFX2_SIGNATURESTATE_HXX
diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx
index 3dd4ff3d63a7..d0ac30a9fcd9 100644
--- a/sfx2/inc/sfx2/viewsh.hxx
+++ b/sfx2/inc/sfx2/viewsh.hxx
@@ -38,6 +38,7 @@
#include <com/sun/star/uno/Reference.h>
#include <svtools/lstner.hxx>
#include <com/sun/star/ui/XContextMenuInterceptor.hpp>
+#include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp>
#include <cppuhelper/interfacecontainer.hxx>
#include "shell.hxx"
#include <tools/gen.hxx>
@@ -77,6 +78,9 @@ class NotifyEvent;
#define SFX_PRINTER_CHG_ORIENTATION_FLAG 3
#define SFX_PRINTER_CHG_SIZE_FLAG 4
+#define SFX_PRINTERROR_NONE 0
+#define SFX_PRINTERROR_BUSY 1
+
enum SfxScrollingMode
{
SCROLLING_NO,
@@ -302,6 +306,8 @@ public:
void SetAdditionalPrintOptions( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& );
+ void AddRemoveClipboardListener( const com::sun::star::uno::Reference < com::sun::star::datatransfer::clipboard::XClipboardListener>&, BOOL );
+
#if _SOLAR__PRIVATE
SAL_DLLPRIVATE SfxInPlaceClient* GetUIActiveIPClient_Impl() const;
SAL_DLLPRIVATE void AddContextMenuInterceptor_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::ui::XContextMenuInterceptor >& xInterceptor );
diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi
index 61b897baceae..5da69fa977f3 100644
--- a/sfx2/sdi/appslots.sdi
+++ b/sfx2/sdi/appslots.sdi
@@ -92,14 +92,6 @@ interface Application
ExecMethod = MiscExec_Impl ;
StateMethod = MiscState_Impl ;
]
- SID_CURRENTTIME // ole(no) api(final/play/norec)
- [
- StateMethod = MiscState_Impl ;
- ]
- SID_CURRENTDATE // ole(no) api(final/play/norec)
- [
- StateMethod = MiscState_Impl ;
- ]
SID_LOADCONFIG // ole(no) api(final/play)
[
ExecMethod = MiscExec_Impl ;
diff --git a/sfx2/sdi/makefile.mk b/sfx2/sdi/makefile.mk
index ddf487094cf3..f8def0a3c23c 100644
--- a/sfx2/sdi/makefile.mk
+++ b/sfx2/sdi/makefile.mk
@@ -39,10 +39,13 @@ TARGET=sfxslots
.INCLUDE : settings.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
+.IF "$(L10N_framework)"==""
+
SDI1NAME=$(TARGET)
SDI1EXPORT=sfx
#SIDHRCNAME=sfx.hrc unused???
+.ENDIF
# --- Files --------------------------------------------------------
SVSDI1DEPEND= \
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 32db454b17e5..26f55ccdd178 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -853,7 +853,7 @@ SfxBoolItem BrowseView SID_BROWSER_MODE
[
/* flags: */
AutoUpdate = TRUE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -1041,7 +1041,7 @@ SfxVoidItem ClearHistory SID_CLEARHISTORY
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -1447,60 +1447,6 @@ SfxVoidItem CreateMacro SID_BASICIDE_CREATEMACRO
]
//--------------------------------------------------------------------------
-SfxStringItem CurrentDate SID_CURRENTDATE
-
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Volatile,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = TRUE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- Readonly = TRUE,
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = TRUE,
- ToolBoxConfig = FALSE,
- GroupId = GID_VIEW;
-]
-
-//--------------------------------------------------------------------------
-SfxStringItem CurrentTime SID_CURRENTTIME
-
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Volatile,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = TRUE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- Readonly = TRUE,
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = TRUE,
- ToolBoxConfig = FALSE,
- GroupId = GID_VIEW;
-]
-
-//--------------------------------------------------------------------------
SfxStringItem CurrentURL SID_CURRENT_URL
[
@@ -1842,7 +1788,7 @@ SfxBoolItem EditDoc SID_EDITDOC
[
/* flags: */
AutoUpdate = TRUE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -4287,7 +4233,7 @@ SfxBoolItem Modified SID_MODIFIED
[
/* flags: */
AutoUpdate = TRUE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -5015,7 +4961,7 @@ SfxVoidItem Paste SID_PASTE
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = TRUE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -5035,6 +4981,59 @@ SfxVoidItem Paste SID_PASTE
]
//--------------------------------------------------------------------------
+SfxVoidItem ClipboardFormatItems SID_CLIPBOARD_FORMAT_ITEMS
+(SfxUInt32Item SelectedFormat SID_CLIPBOARD_FORMAT_ITEMS)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* status: */
+ SlotType = SvxClipboardFmtItem
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxInt16Item PasteSpecial SID_PASTE_SPECIAL
+(SfxUInt32Item Format SID_PASTE_SPECIAL)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
SfxStringItem DocPath SID_DOCPATH
[
@@ -5486,7 +5485,7 @@ SfxVoidItem Redo SID_REDO
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -5539,7 +5538,7 @@ SfxBoolItem Reload SID_RELOAD
[
/* flags: */
AutoUpdate = TRUE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -5643,7 +5642,7 @@ SfxStringItem RepeatAction SID_REPEAT
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -5747,7 +5746,7 @@ SfxBoolItem Save SID_SAVEDOC
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = TRUE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -5898,6 +5897,31 @@ SfxVoidItem ExportDialog SID_EXPORT_DIALOG
]
//--------------------------------------------------------------------------
+SfxVoidItem ImportDialog SID_IMPORT_DIALOG
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
SfxVoidItem SaveConfiguration SID_SAVECONFIG
(SfxStringItem FileName SID_CFGFILE)
[
@@ -7154,7 +7178,7 @@ SfxVoidItem Undo SID_UNDO
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -8784,7 +8808,7 @@ SfxInt16Item PasteUnformatted SID_PASTE_UNFORMATTED
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = TRUE,
HasCoreId = FALSE,
HasDialog = FALSE,
diff --git a/sfx2/sdi/sfxslots.sdi b/sfx2/sdi/sfxslots.sdi
index 27336865be73..e439e8c776a0 100644
--- a/sfx2/sdi/sfxslots.sdi
+++ b/sfx2/sdi/sfxslots.sdi
@@ -59,6 +59,7 @@ TypeLibFile( "sfxslots.tlb" )
item String SfxFrameItem; //! Dummy
item String SfxObjectShellItem //! Dummy
item String SfxUsrAnyItem //! Dummy
+ item String SvxClipboardFmtItem; //! Dummy
struct Point
{
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index d74bbd0961d9..53ea87703ac6 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -505,7 +505,7 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame )
if ( pOldContainerFrame )
{
if ( bTaskActivate )
- NotifyEvent( SfxEventHint( SFX_EVENT_DEACTIVATEDOC, pOldContainerFrame->GetObjectShell() ) );
+ NotifyEvent( SfxEventHint( SFX_EVENT_DEACTIVATEDOC, GlobalEventConfig::GetEventName(STR_EVENT_DEACTIVATEDOC), pOldContainerFrame->GetObjectShell() ) );
pOldContainerFrame->DoDeactivate( bTaskActivate, pFrame );
if( pOldContainerFrame->GetProgress() )
@@ -529,7 +529,7 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame )
if ( bTaskActivate && pNewContainerFrame->GetObjectShell() )
{
pNewContainerFrame->GetObjectShell()->PostActivateEvent_Impl( pNewContainerFrame );
- NotifyEvent(SfxEventHint(SFX_EVENT_ACTIVATEDOC, pNewContainerFrame->GetObjectShell() ) );
+ NotifyEvent(SfxEventHint(SFX_EVENT_ACTIVATEDOC, GlobalEventConfig::GetEventName(STR_EVENT_ACTIVATEDOC), pNewContainerFrame->GetObjectShell() ) );
}
SfxProgress *pProgress = pNewContainerFrame->GetProgress();
diff --git a/sfx2/source/appl/app.hrc b/sfx2/source/appl/app.hrc
index 5969833e449a..c08f46effc81 100644
--- a/sfx2/source/appl/app.hrc
+++ b/sfx2/source/appl/app.hrc
@@ -78,27 +78,11 @@
#define RID_RECORDINGTOOLBOX (RID_SFX_APP_START+43)
#define RID_ENVTOOLBOX (RID_SFX_APP_START+44)
-#define STR_EVENT_STARTAPP (RID_SFX_APP_START+50)
-#define STR_EVENT_CLOSEAPP (RID_SFX_APP_START+51)
-#define STR_EVENT_CREATEDOC (RID_SFX_APP_START+52)
-#define STR_EVENT_OPENDOC (RID_SFX_APP_START+53)
-#define STR_EVENT_CLOSEDOC (RID_SFX_APP_START+54)
-#define STR_EVENT_SAVEDOC (RID_SFX_APP_START+55)
-#define STR_EVENT_SAVEASDOC (RID_SFX_APP_START+56)
-#define STR_EVENT_ACTIVATEDOC (RID_SFX_APP_START+57)
-#define STR_EVENT_DEACTIVATEDOC (RID_SFX_APP_START+58)
-#define STR_EVENT_ONERROR (RID_SFX_APP_START+78)
-#define STR_EVENT_PREPARECLOSEDOC (RID_SFX_APP_START+89)
-#define STR_EVENT_MODIFYCHANGED (RID_SFX_APP_START+90)
-#define STR_EVENT_SAVEDOCDONE (RID_SFX_APP_START+95)
-#define STR_EVENT_SAVEASDOCDONE (RID_SFX_APP_START+96)
-
#define STR_QUITAPP (RID_SFX_APP_START+59)
#define STR_EXITANDRETURN (RID_SFX_APP_START+60)
#define STR_ERR_NOFILE (RID_SFX_APP_START+61)
#define STR_EXTHELPSTATUS (RID_SFX_APP_START+62)
-#define STR_EVENT_PRINTDOC (RID_SFX_APP_START+64)
#define STR_ADDRESS_NAME (RID_SFX_APP_START+65)
#define RID_STR_HLPFILENOTEXIST (RID_SFX_APP_START+68)
diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src
index 1337c74e7947..463788d2d6d0 100644
--- a/sfx2/source/appl/app.src
+++ b/sfx2/source/appl/app.src
@@ -502,76 +502,6 @@ ToolBox RID_FULLSCREENTOOLBOX
};
};
-String STR_EVENT_STARTAPP
-{
- Text [ en-US ] = "Start Application" ;
-};
-
-String STR_EVENT_CLOSEAPP
-{
- Text [ en-US ] = "Close Application" ;
-};
-
-String STR_EVENT_CREATEDOC
-{
- Text [ en-US ] = "Create Document" ;
-};
-
-String STR_EVENT_CLOSEDOC
-{
- Text [ en-US ] = "Document is closing" ;
-};
-
-String STR_EVENT_PREPARECLOSEDOC
-{
- Text [ en-US ] = "Close Document" ;
-};
-
-String STR_EVENT_OPENDOC
-{
- Text [ en-US ] = "Open Document" ;
-};
-
-String STR_EVENT_SAVEDOC
-{
- Text [ en-US ] = "Save Document" ;
-};
-
-String STR_EVENT_SAVEASDOC
-{
- Text [ en-US ] = "Save Document As" ;
-};
-
-String STR_EVENT_SAVEDOCDONE
-{
- Text [ en-US ] = "Document has been saved" ;
-};
-
-String STR_EVENT_SAVEASDOCDONE
-{
- Text [ en-US ] = "Document has been saved as" ;
-};
-
-String STR_EVENT_ACTIVATEDOC
-{
- Text [ en-US ] = "Activate Document" ;
-};
-
-String STR_EVENT_DEACTIVATEDOC
-{
- Text [ en-US ] = "Deactivate Document" ;
-};
-
-String STR_EVENT_PRINTDOC
-{
- Text [ en-US ] = "Print Document" ;
-};
-
-String STR_EVENT_MODIFYCHANGED
-{
- Text [ en-US ] = "'Modified' status was changed" ;
-};
-
String STR_ERR_NOTEMPLATE
{
Text [ en-US ] = "The selected template has an incorrect format" ;
@@ -582,7 +512,6 @@ String STR_ERR_NOFILE
Text [ en-US ] = "Can't open file $." ;
};
-
String STR_QUITAPP
{
Text [ en-US ] = "E~xit" ;
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index d15893f8feca..af31659ec24c 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -62,7 +62,7 @@
#include <sot/exchange.hxx>
//#include <svtools/agprop.hxx>
-#include <sj2/sjapplet.hxx>
+//#include <sj2/sjapplet.hxx>
#include <svtools/isethint.hxx>
#include <unotools/configmgr.hxx>
@@ -160,10 +160,12 @@ IMPL_LINK(SfxEventAsyncer_Impl, TimerHdl, Timer*, pAsyncTimer)
SfxObjectShellRef xRef( aHint.GetObjShell() );
pAsyncTimer->Stop();
#ifdef DBG_UTIL
- ::rtl::OUString aName = SfxEventConfiguration::GetEventName_Impl( aHint.GetEventId() );
- ByteString aTmp( "SfxEvent: ");
- aTmp += ByteString( String(aName), RTL_TEXTENCODING_UTF8 );
- DBG_TRACE( aTmp.GetBuffer() );
+ if (!xRef.Is())
+ {
+ ByteString aTmp( "SfxEvent: ");
+ aTmp += ByteString( String( aHint.GetEventName() ), RTL_TEXTENCODING_UTF8 );
+ DBG_TRACE( aTmp.GetBuffer() );
+ }
#endif
SFX_APP()->Broadcast( aHint );
if ( xRef.Is() )
@@ -848,6 +850,8 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
// INet Session neu aufsetzen
if ( bResetSession )
{
+ // no more sj2
+ #if 0
try
{
SjApplet2::settingsChanged();
@@ -856,6 +860,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
{
DBG_ERRORFILE( "SjApplet2::settingsChanged() throws an exception" );
}
+ #endif
}
// geaenderte Daten speichern
@@ -1037,19 +1042,28 @@ SfxEventConfiguration* SfxApplication::GetEventConfig() const
//--------------------------------------------------------------------
void SfxApplication::NotifyEvent( const SfxEventHint& rEventHint, FASTBOOL bSynchron )
{
- DBG_ASSERT(pAppData_Impl->pEventConfig,"Keine Events angemeldet!");
+ //DBG_ASSERT(pAppData_Impl->pEventConfig,"Keine Events angemeldet!");
SfxObjectShell *pDoc = rEventHint.GetObjShell();
if ( pDoc && ( pDoc->IsPreview() || !pDoc->Get_Impl()->bInitialized ) )
return;
+#ifdef DBG_UTIL
+ //::rtl::OUString aName = SfxEventConfiguration::GetEventName_Impl( rEventHint.GetEventId() );
+ //ByteString aTmp( "SfxEvent: ");
+ //aTmp += ByteString( String(aName), RTL_TEXTENCODING_UTF8 );
+ //DBG_TRACE( aTmp.GetBuffer() );
+#endif
+
if ( bSynchron )
{
#ifdef DBG_UTIL
- ::rtl::OUString aName = SfxEventConfiguration::GetEventName_Impl( rEventHint.GetEventId() );
- ByteString aTmp( "SfxEvent: ");
- aTmp += ByteString( String(aName), RTL_TEXTENCODING_UTF8 );
- DBG_TRACE( aTmp.GetBuffer() );
+ if (!pDoc)
+ {
+ ByteString aTmp( "SfxEvent: ");
+ aTmp += ByteString( String( rEventHint.GetEventName() ), RTL_TEXTENCODING_UTF8 );
+ DBG_TRACE( aTmp.GetBuffer() );
+ }
#endif
Broadcast(rEventHint);
if ( pDoc )
diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx
index 243c4c325fcd..23de7317c379 100644
--- a/sfx2/source/appl/appdata.cxx
+++ b/sfx2/source/appl/appdata.cxx
@@ -42,7 +42,6 @@
#include <vos/mutex.hxx>
#include <vcl/menu.hxx>
-#include <svtools/loginerr.hxx>
#include <vcl/msgbox.hxx>
#include <svtools/dateitem.hxx>
#include <vcl/menu.hxx>
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index 748cbc29c707..98439eb5a6dc 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -144,7 +144,6 @@ void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& a
pApp->Broadcast( SfxSimpleHint( SFX_HINT_DEINITIALIZING ) );
pApp->Get_Impl()->pAppDispatch->ReleaseAll();
pApp->Get_Impl()->pAppDispatch->release();
- pApp->NotifyEvent(SfxEventHint( SFX_EVENT_CLOSEAPP) );
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
css::uno::Reference< css::document::XEventListener > xGlobalBroadcaster(xSMGR->createInstance(SERVICE_GLOBALEVENTBROADCASTER), css::uno::UNO_QUERY);
@@ -301,38 +300,6 @@ FASTBOOL SfxApplication::Initialize_Impl()
Registrations_Impl();
-// ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- // TODO/LATER: exchange confusing defines; CREATEDOC -> NEWDOC, DOCCREATED -> CREATEDOC
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_STARTAPP, String(SfxResId(STR_EVENT_STARTAPP)), SfxObjectShell::GetEventNames_Impl()[0] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_CLOSEAPP, String(SfxResId(STR_EVENT_CLOSEAPP)), SfxObjectShell::GetEventNames_Impl()[1] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_CREATEDOC, String(SfxResId(STR_EVENT_CREATEDOC)), SfxObjectShell::GetEventNames_Impl()[2] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_OPENDOC, String(SfxResId(STR_EVENT_OPENDOC)), SfxObjectShell::GetEventNames_Impl()[3] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_SAVEASDOC, String(SfxResId(STR_EVENT_SAVEASDOC)), SfxObjectShell::GetEventNames_Impl()[4] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_SAVEASDOCDONE, String(SfxResId(STR_EVENT_SAVEASDOCDONE)), SfxObjectShell::GetEventNames_Impl()[5] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_SAVEDOC, String(SfxResId(STR_EVENT_SAVEDOC)), SfxObjectShell::GetEventNames_Impl()[6] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_SAVEDOCDONE, String(SfxResId(STR_EVENT_SAVEDOCDONE)), SfxObjectShell::GetEventNames_Impl()[7] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_PREPARECLOSEDOC, String(SfxResId(STR_EVENT_PREPARECLOSEDOC)),SfxObjectShell::GetEventNames_Impl()[8] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_CLOSEDOC, String(SfxResId(STR_EVENT_CLOSEDOC)), SfxObjectShell::GetEventNames_Impl()[9] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_ACTIVATEDOC, String(SfxResId(STR_EVENT_ACTIVATEDOC)), SfxObjectShell::GetEventNames_Impl()[10] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_DEACTIVATEDOC, String(SfxResId(STR_EVENT_DEACTIVATEDOC)), SfxObjectShell::GetEventNames_Impl()[11] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_PRINTDOC, String(SfxResId(STR_EVENT_PRINTDOC)), SfxObjectShell::GetEventNames_Impl()[12] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_MODIFYCHANGED, String(SfxResId(STR_EVENT_MODIFYCHANGED)), SfxObjectShell::GetEventNames_Impl()[13] );
-
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_SAVETODOC, String(), SfxObjectShell::GetEventNames_Impl()[14] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_SAVETODOCDONE, String(), SfxObjectShell::GetEventNames_Impl()[15] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_VIEWCREATED, String(), SfxObjectShell::GetEventNames_Impl()[16] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_PREPARECLOSEVIEW, String(), SfxObjectShell::GetEventNames_Impl()[17] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_CLOSEVIEW, String(), SfxObjectShell::GetEventNames_Impl()[18] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_VISAREACHANGED, String(), SfxObjectShell::GetEventNames_Impl()[19] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_DOCCREATED, String(), SfxObjectShell::GetEventNames_Impl()[20] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_LOADFINISHED, String(), SfxObjectShell::GetEventNames_Impl()[21] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_SAVEASDOCFAILED, String(), SfxObjectShell::GetEventNames_Impl()[22] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_SAVEDOCFAILED, String(), SfxObjectShell::GetEventNames_Impl()[23] );
- SfxEventConfiguration::RegisterEvent(SFX_EVENT_SAVETODOCFAILED, String(), SfxObjectShell::GetEventNames_Impl()[24] );
- SfxEventConfiguration::RegisterEvent(SFX_HINT_TITLECHANGED, String(), SfxObjectShell::GetEventNames_Impl()[25] );
- SfxEventConfiguration::RegisterEvent(SFX_HINT_MODECHANGED, String(), SfxObjectShell::GetEventNames_Impl()[26] );
-
// Subklasse initialisieren
pAppData_Impl->bDowning = sal_False;
Init();
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index c73a40dd75a7..c6cb16f8f3f6 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -48,7 +48,6 @@
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/document/MacroExecMode.hpp>
#include <com/sun/star/document/UpdateDocMode.hpp>
-#include <com/sun/star/task/XInteractionRequest.hpp>
#include <com/sun/star/task/ErrorCodeRequest.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
@@ -81,7 +80,7 @@
#include <svtools/templdlg.hxx>
#include <osl/file.hxx>
#include <svtools/extendedsecurityoptions.hxx>
-#include <svtools/docpasswdrequest.hxx>
+#include <comphelper/docpasswordhelper.hxx>
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
@@ -247,6 +246,50 @@ void SetTemplate_Impl( const String &rFileName,
//--------------------------------------------------------------------
+class SfxDocPasswordVerifier : public ::comphelper::IDocPasswordVerifier
+{
+public:
+ inline explicit SfxDocPasswordVerifier( const Reference< embed::XStorage >& rxStorage ) :
+ mxStorage( rxStorage ) {}
+
+ virtual ::comphelper::DocPasswordVerifierResult
+ verifyPassword( const ::rtl::OUString& rPassword );
+
+private:
+ Reference< embed::XStorage > mxStorage;
+};
+
+::comphelper::DocPasswordVerifierResult SfxDocPasswordVerifier::verifyPassword( const ::rtl::OUString& rPassword )
+{
+ ::comphelper::DocPasswordVerifierResult eResult = ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
+ try
+ {
+ // check the password
+ // if the password correct is the stream will be opened successfuly
+ // and immediatelly closed
+ ::comphelper::OStorageHelper::SetCommonStoragePassword( mxStorage, rPassword );
+
+ mxStorage->openStreamElement(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "content.xml" ) ),
+ embed::ElementModes::READ | embed::ElementModes::NOCREATE );
+
+ // no exception -> success
+ eResult = ::comphelper::DocPasswordVerifierResult_OK;
+ }
+ catch( const packages::WrongPasswordException& )
+ {
+ eResult = ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
+ }
+ catch( const uno::Exception& )
+ {
+ // unknown error, do not try to ask again
+ eResult = ::comphelper::DocPasswordVerifierResult_ABORT;
+ }
+ return eResult;
+}
+
+//--------------------------------------------------------------------
+
sal_uInt32 CheckPasswd_Impl
(
//Window *pWin, // Parent des Dialogs
@@ -268,7 +311,7 @@ sal_uInt32 CheckPasswd_Impl
if( ( !pFile->GetFilter() || pFile->IsStorage() ) )
{
- uno::Reference< embed::XStorage > xStorage = pFile->GetStorage();
+ uno::Reference< embed::XStorage > xStorage = pFile->GetStorage( sal_True );
if( xStorage.is() )
{
uno::Reference< beans::XPropertySet > xStorageProps( xStorage, uno::UNO_QUERY );
@@ -302,56 +345,13 @@ sal_uInt32 CheckPasswd_Impl
Reference< ::com::sun::star::task::XInteractionHandler > xInteractionHandler = pFile->GetInteractionHandler();
if( xInteractionHandler.is() )
{
- sal_Bool bRetry = sal_True;
- sal_Bool bGotPasswd = sal_False;
- ::rtl::OUString aPassword;
- ::com::sun::star::task::PasswordRequestMode nDlgMode = ::com::sun::star::task::PasswordRequestMode_PASSWORD_ENTER;
-
- while( bRetry )
- {
- bRetry = sal_False;
-
- RequestDocumentPassword* pPasswordRequest = new RequestDocumentPassword( nDlgMode,
- INetURLObject( pFile->GetOrigURL() ).GetMainURL( INetURLObject::DECODE_WITH_CHARSET ) );
-
- Reference< XInteractionRequest > rRequest( pPasswordRequest );
- xInteractionHandler->handle( rRequest );
-
- if ( pPasswordRequest->isPassword() )
- {
- aPassword = pPasswordRequest->getPassword();
- bGotPasswd = sal_True;
-
- try
- {
- // check the password
- // if the password correct is the stream will be opened successfuly
- // and immediatelly closed
- ::comphelper::OStorageHelper::SetCommonStoragePassword(
- xStorage,
- aPassword );
-
- xStorage->openStreamElement(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "content.xml" ) ),
- embed::ElementModes::READ | embed::ElementModes::NOCREATE );
- }
- catch( const packages::WrongPasswordException& )
- {
- // reask for the password
- nDlgMode = ::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER;
- bRetry = sal_True;
- }
- catch( const uno::Exception& )
- {
- // do nothing special
- // the error will be detected by loading
- }
- }
- else
- bGotPasswd = sal_False;
- }
+ // use the comphelper password helper to request a password
+ ::rtl::OUString aDocumentName = INetURLObject( pFile->GetOrigURL() ).GetMainURL( INetURLObject::DECODE_WITH_CHARSET );
+ SfxDocPasswordVerifier aVerifier( xStorage );
+ ::rtl::OUString aPassword = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
+ aVerifier, ::rtl::OUString(), xInteractionHandler, aDocumentName, comphelper::DocPasswordRequestType_STANDARD );
- if ( bGotPasswd )
+ if ( aPassword.getLength() > 0 )
{
pSet->Put( SfxStringItem( SID_PASSWORD, aPassword ) );
@@ -392,7 +392,7 @@ ULONG SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String &rFil
const SfxFilter* pFilter = NULL;
SfxMedium aMedium( rFileName, ( STREAM_READ | STREAM_SHARE_DENYNONE ), FALSE );
- if ( !aMedium.GetStorage().is() )
+ if ( !aMedium.GetStorage( sal_True ).is() )
aMedium.GetInStream();
if ( aMedium.GetError() )
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index b51a7bb483dc..184ecb9f1a5c 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -668,17 +668,6 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
rSet.DisableItem(nWhich);
break;
- case SID_CURRENTTIME:
- {
- rSet.Put( SfxStringItem( nWhich, aLocaleWrapper.getTime( Time(), FALSE ) ) );
- break;
- }
- case SID_CURRENTDATE:
- {
- rSet.Put( SfxStringItem( nWhich, aLocaleWrapper.getDate( Date() ) ) );
- break;
- }
-
case SID_HELPTIPS:
{
rSet.Put( SfxBoolItem( SID_HELPTIPS, Help::IsQuickHelpEnabled() ) );
@@ -859,6 +848,12 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
pFact->CreateFrameDialog( NULL, xFrame, rReq.GetSlot(), sPageURL );
pDlg->Execute();
delete pDlg;
+ SfxViewFrame* pView = SfxViewFrame::GetFirst();
+ while ( pView )
+ {
+ pView->GetBindings().InvalidateAll(FALSE);
+ pView = SfxViewFrame::GetNext( *pView );
+ }
}
break;
}
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 90b12b484a01..c9814eb50e6a 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -137,7 +137,7 @@ using namespace ::com::sun::star::io;
#include "brokenpackageint.hxx"
#include "eventsupplier.hxx"
#include "xpackcreator.hxx"
-#include "applet.hxx"
+// #include "applet.hxx"
#include "plugin.hxx"
#include "iframe.hxx"
#include <ownsubfilterservice.hxx>
@@ -2150,6 +2150,7 @@ SFX2_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo(
xNewKey = xKey->createKey( aTempStr );
xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.SpecialEmbeddedObject") );
+ #if 0
// AppletObject
aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
aImpl += ::sfx2::AppletObject::impl_getStaticImplementationName();
@@ -2158,6 +2159,7 @@ SFX2_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo(
aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
xNewKey = xKey->createKey( aTempStr );
xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.SpecialEmbeddedObject") );
+ #endif
// IFrameObject
aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
@@ -2324,11 +2326,13 @@ SFX2_DLLPUBLIC void* SAL_CALL component_getFactory(
IF_NAME_CREATECOMPONENTFACTORY( TestMouseClickHandler )
#endif
IF_NAME_CREATECOMPONENTFACTORY( OPackageStructureCreator )
+ #if 0
if ( ::sfx2::AppletObject::impl_getStaticImplementationName().equals(
::rtl::OUString::createFromAscii( pImplementationName ) ) )
{
xFactory = ::sfx2::AppletObject::impl_createFactory();
}
+ #endif
IF_NAME_CREATECOMPONENTFACTORY( ::sfx2::PluginObject )
IF_NAME_CREATECOMPONENTFACTORY( ::sfx2::IFrameObject )
IF_NAME_CREATECOMPONENTFACTORY( ::sfx2::OwnSubFilterService )
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index f419bc3e3d55..8a6622636c14 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -193,7 +193,10 @@ sal_Bool GetHelpAnchor_Impl( const String& _rURL, String& _rAnchor )
sal_Bool bRet = sal_False;
::rtl::OUString sAnchor;
- ULONG nSolarCount = Application::ReleaseSolarMutex();
+ // --> OD 2009-07-01 #159496#
+ // do not release solar mutex due to crash regarding accessibility
+// ULONG nSolarCount = Application::ReleaseSolarMutex();
+ // <--
try
{
::ucbhelper::Content aCnt( INetURLObject( _rURL ).GetMainURL( INetURLObject::NO_DECODE ),
@@ -215,7 +218,9 @@ sal_Bool GetHelpAnchor_Impl( const String& _rURL, String& _rAnchor )
catch( ::com::sun::star::uno::Exception& )
{
}
- Application::AcquireSolarMutex( nSolarCount );
+ // --> OD 2009-07-01 #159496#
+// Application::AcquireSolarMutex( nSolarCount );
+ // <--
return bRet;
}
diff --git a/sfx2/source/appl/shutdowniconOs2.cxx b/sfx2/source/appl/shutdowniconOs2.cxx
index e527519d1564..6b69b5d0fae8 100644
--- a/sfx2/source/appl/shutdowniconOs2.cxx
+++ b/sfx2/source/appl/shutdowniconOs2.cxx
@@ -51,7 +51,7 @@ using namespace ::osl;
//
// This ObjectID must match the one created in WarpIN scripts!!
//
-#define QUICKSTART_OBJID "OO2B_QUICKSTART"
+#define QUICKSTART_OBJID "OO2_QUICKSTART"
bool ShutdownIcon::IsQuickstarterInstalled()
{
diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx
index 258170789c2f..3c0adfd5c873 100644
--- a/sfx2/source/bastyp/helper.cxx
+++ b/sfx2/source/bastyp/helper.cxx
@@ -820,39 +820,6 @@ ULONG SfxContentHelper::GetSize( const String& rContent )
}
// -----------------------------------------------------------------------
-
-sal_Bool SfxContentHelper::IsYounger( const String& rIsYoung, const String& rIsOlder )
-{
- DateTime aYoungDate, aOlderDate;
- INetURLObject aYoungObj( rIsYoung );
- DBG_ASSERT( aYoungObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" );
- INetURLObject aOlderObj( rIsOlder );
- DBG_ASSERT( aOlderObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" );
- try
- {
- uno::Reference< ucb::XCommandEnvironment > aCmdEnv;
- ::ucbhelper::Content aYoung( aYoungObj.GetMainURL( INetURLObject::NO_DECODE ), aCmdEnv );
- util::DateTime aTempYoungDate;
- aYoung.getPropertyValue( OUString::createFromAscii( "DateModified" ) ) >>= aTempYoungDate;
- CONVERT_DATETIME( aTempYoungDate, aYoungDate );
- ::ucbhelper::Content aOlder( aOlderObj.GetMainURL( INetURLObject::NO_DECODE ), aCmdEnv );
- util::DateTime aTempOlderDate;
- aOlder.getPropertyValue( OUString::createFromAscii( "DateModified" ) ) >>= aTempOlderDate;
- CONVERT_DATETIME( aTempOlderDate, aOlderDate );
- }
- catch( ucb::CommandAbortedException& )
- {
- DBG_ERRORFILE( "CommandAbortedException" );
- }
- catch( uno::Exception& )
- {
- DBG_ERRORFILE( "Any other exception" );
- }
-
- return ( aYoungDate > aOlderDate );
-}
-
-// -----------------------------------------------------------------------
// please don't use it (only used in appbas.cxx and appcfg.cxx)
sal_Bool SfxContentHelper::Exists( const String& rContent )
{
diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx
index 62bc5533e1a9..121b8604e02d 100644
--- a/sfx2/source/bastyp/progress.cxx
+++ b/sfx2/source/bastyp/progress.cxx
@@ -117,20 +117,8 @@ struct SfxProgress_Impl : public SfxCancellable
#define aTypeLibInfo aProgressTypeLibImpl
//========================================================================
-#if defined(_MSC_VER) && (_MSC_VER < 1300)
-inline ULONG Get10ThSec()
-{
-#if defined (MSC) && defined (WIN)
- ULONG n10Ticks = 10 * (ULONG)GetTickCount();
-#else
- ULONG n10Ticks = 10 * (ULONG)clock();
-#endif
-
- return n10Ticks / CLOCKS_PER_SEC;
-}
-#else
extern ULONG Get10ThSec();
-#endif
+
// -----------------------------------------------------------------------
void SfxProgress_Impl::Enable_Impl( BOOL bEnable )
diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx
index 6bca26886b2a..daf9174d20cb 100644
--- a/sfx2/source/config/evntconf.cxx
+++ b/sfx2/source/config/evntconf.cxx
@@ -69,23 +69,6 @@
#include <com/sun/star/uno/Reference.hxx>
// -----------------------------------------------------------------------
-
-#define PROPERTYVALUE ::com::sun::star::beans::PropertyValue
-#define XNAMEREPLACE ::com::sun::star::container::XNameReplace
-#define XEVENTSSUPPLIER ::com::sun::star::document::XEventsSupplier
-#define ANY ::com::sun::star::uno::Any
-#define REFERENCE ::com::sun::star::uno::Reference
-#define SEQUENCE ::com::sun::star::uno::Sequence
-#define UNO_QUERY ::com::sun::star::uno::UNO_QUERY
-
-#define OUSTRING ::rtl::OUString
-
-// -----------------------------------------------------------------------
-
-static const USHORT nCompatVersion = 3;
-static const USHORT nOldVersion = 4;
-static const USHORT nVersion = 5;
-
TYPEINIT1(SfxEventHint, SfxHint);
TYPEINIT1(SfxEventNamesItem, SfxPoolItem);
@@ -176,195 +159,11 @@ void SfxEventNamesItem::AddEvent( const String& rName, const String& rUIName, US
aEventsList.Insert( new SfxEventName( nID, rName, rUIName.Len() ? rUIName : rName ) );
}
-// class SfxAsyncEvent_Impl ----------------------------------------------
-
-class SfxAsyncEvent_Impl : public SfxListener
-{
- String aArgs;
- SfxObjectShell* pSh;
- const SvxMacro* pMacro;
- Timer *pTimer;
-
-public:
-
- virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
- SfxAsyncEvent_Impl( SfxObjectShell *pDoc, const SvxMacro *pMacro, const String& rArgs );
- ~SfxAsyncEvent_Impl();
- DECL_LINK( TimerHdl, Timer*);
-};
-
-// -----------------------------------------------------------------------
-
-void SfxAsyncEvent_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint )
-{
- SfxSimpleHint* pHint = PTR_CAST( SfxSimpleHint, &rHint );
- if( pHint && pHint->GetId() == SFX_HINT_DYING && pTimer->IsActive() )
- {
- pTimer->Stop();
- delete this;
- }
-}
-
-// -----------------------------------------------------------------------
-
-SfxAsyncEvent_Impl::SfxAsyncEvent_Impl( SfxObjectShell *pDoc, const SvxMacro *pMac, const String& rArgs )
- : aArgs( rArgs )
- , pSh( pDoc )
- , pMacro( pMac )
-{
- if( pSh ) StartListening( *pSh );
- pTimer = new Timer;
- pTimer->SetTimeoutHdl( LINK(this, SfxAsyncEvent_Impl, TimerHdl) );
- pTimer->SetTimeout( 0 );
- pTimer->Start();
-}
-
-// -----------------------------------------------------------------------
-
-SfxAsyncEvent_Impl::~SfxAsyncEvent_Impl()
-{
- delete pTimer;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK(SfxAsyncEvent_Impl, TimerHdl, Timer*, pAsyncTimer)
-{
- pAsyncTimer->Stop();
- ScriptType eSType = pMacro->GetScriptType();
- BOOL bIsBasic = ( eSType == STARBASIC );
- if ( bIsBasic && StarBASIC::IsRunning() )
- // Neues eventgebundenes Macro erst ausf"uhren, wenn gerade kein anderes Macro mehr l"auft
- pAsyncTimer->Start();
- else
- {
- SFX_APP()->GetMacroConfig()->ExecuteMacro( pSh, pMacro, aArgs );
- delete this;
- }
-
- return 0L;
-}
-
-SfxEventNamesList *gp_Id_SortList = NULL;
-SfxEventNamesList *gp_Name_SortList = NULL;
-
-//==========================================================================
-
-SfxEventConfiguration::SfxEventConfiguration()
- : pAppTable( NULL )
- , pDocTable( NULL )
-{
- bIgnoreConfigure = sal_False;
-}
-
-//==========================================================================
-
-SfxEventConfiguration::~SfxEventConfiguration()
-{
- delete pDocTable;
-
- if ( gp_Id_SortList )
- {
- delete gp_Id_SortList;
- delete gp_Name_SortList;
- gp_Id_SortList = NULL;
- gp_Name_SortList = NULL;
- }
-}
-
-void SfxEventConfiguration::ConfigureEvent( USHORT nId, const SvxMacro& rMacro, SfxObjectShell *pDoc )
-{
- if ( bIgnoreConfigure )
- return;
-
- SvxMacro *pMacro = NULL;
- if ( rMacro.GetMacName().Len() )
- pMacro = new SvxMacro( rMacro.GetMacName(), rMacro.GetLibName(), rMacro.GetScriptType() );
- if ( pDoc )
- {
- PropagateEvent_Impl( pDoc, nId, pMacro );
- }
- else
- {
- PropagateEvent_Impl( NULL, nId, pMacro );
- }
-}
//==========================================================================
-SvxMacroTableDtor* SfxEventConfiguration::GetDocEventTable( SfxObjectShell*pDoc )
-{
- if ( pDocTable )
- delete pDocTable;
-
- pDocTable = new SvxMacroTableDtor;
-
- if ( pDoc )
- {
- REFERENCE< XEVENTSSUPPLIER > xSup( pDoc->GetModel(), UNO_QUERY );
- uno::Reference < container::XNameReplace > xEvents = xSup->getEvents();
-
- uno::Sequence < ::rtl::OUString > aNames = xEvents->getElementNames();
- for ( sal_Int32 i=0; i<aNames.getLength(); i++ )
- {
- SvxMacro* pMacro = SfxEvents_Impl::ConvertToMacro( xEvents->getByName( aNames[i] ), pDoc, TRUE );
- USHORT nID = (USHORT) GetEventId_Impl( aNames[i] );
- if ( nID && pMacro )
- pDocTable->Insert( nID, pMacro );
- }
- }
-
- return pDocTable;
-}
-
//--------------------------------------------------------------------------
-void SfxEventConfiguration::PropagateEvent_Impl( SfxObjectShell *pDoc,
- USHORT nId,
- const SvxMacro* pMacro )
-{
- REFERENCE< XEVENTSSUPPLIER > xSupplier;
- if ( pDoc )
- {
- xSupplier = REFERENCE< XEVENTSSUPPLIER >( pDoc->GetModel(), UNO_QUERY );
- }
- else
- {
- xSupplier = REFERENCE< XEVENTSSUPPLIER >
- ( ::comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString::createFromAscii("com.sun.star.frame.GlobalEventBroadcaster" )), UNO_QUERY );
- }
-
- if ( xSupplier.is() )
- {
- REFERENCE< XNAMEREPLACE > xEvents = xSupplier->getEvents();
-
- bIgnoreConfigure = sal_True;
-
- OUSTRING aEventName = GetEventName_Impl( nId );
-
- if ( aEventName.getLength() )
- {
- ANY aEventData = CreateEventData_Impl( pMacro );
-
- try
- {
- xEvents->replaceByName( aEventName, aEventData );
- }
- catch( ::com::sun::star::lang::IllegalArgumentException )
- { DBG_ERRORFILE( "PropagateEvents_Impl: caught IllegalArgumentException" ); }
- catch( ::com::sun::star::container::NoSuchElementException )
- { DBG_ERRORFILE( "PropagateEvents_Impl: caught NoSuchElementException" ); }
- }
- else {
- DBG_WARNING( "PropagateEvents_Impl: Got unkown event" );
- }
-
- bIgnoreConfigure = sal_False;
- }
-}
-
-// -------------------------------------------------------------------------------------------------------
-ANY SfxEventConfiguration::CreateEventData_Impl( const SvxMacro *pMacro )
+uno::Any CreateEventData_Impl( const SvxMacro *pMacro )
{
/*
This function converts a SvxMacro into an Any containing three
@@ -376,57 +175,57 @@ ANY SfxEventConfiguration::CreateEventData_Impl( const SvxMacro *pMacro )
If pMacro is NULL, we return an empty property sequence, so PropagateEvent_Impl
can delete an event binding.
*/
- ANY aEventData;
+ uno::Any aEventData;
if ( pMacro )
{
if ( pMacro->GetScriptType() == STARBASIC )
{
- SEQUENCE < PROPERTYVALUE > aProperties(3);
- PROPERTYVALUE *pValues = aProperties.getArray();
+ uno::Sequence < beans::PropertyValue > aProperties(3);
+ beans::PropertyValue *pValues = aProperties.getArray();
- OUSTRING aType = OUSTRING::createFromAscii( STAR_BASIC );;
- OUSTRING aLib = pMacro->GetLibName();
- OUSTRING aMacro = pMacro->GetMacName();
+ ::rtl::OUString aType = ::rtl::OUString::createFromAscii( STAR_BASIC );;
+ ::rtl::OUString aLib = pMacro->GetLibName();
+ ::rtl::OUString aMacro = pMacro->GetMacName();
- pValues[ 0 ].Name = OUSTRING::createFromAscii( PROP_EVENT_TYPE );
+ pValues[ 0 ].Name = ::rtl::OUString::createFromAscii( PROP_EVENT_TYPE );
pValues[ 0 ].Value <<= aType;
- pValues[ 1 ].Name = OUSTRING::createFromAscii( PROP_LIBRARY );
+ pValues[ 1 ].Name = ::rtl::OUString::createFromAscii( PROP_LIBRARY );
pValues[ 1 ].Value <<= aLib;
- pValues[ 2 ].Name = OUSTRING::createFromAscii( PROP_MACRO_NAME );
+ pValues[ 2 ].Name = ::rtl::OUString::createFromAscii( PROP_MACRO_NAME );
pValues[ 2 ].Value <<= aMacro;
aEventData <<= aProperties;
}
else if ( pMacro->GetScriptType() == EXTENDED_STYPE )
{
- SEQUENCE < PROPERTYVALUE > aProperties(2);
- PROPERTYVALUE *pValues = aProperties.getArray();
+ uno::Sequence < beans::PropertyValue > aProperties(2);
+ beans::PropertyValue *pValues = aProperties.getArray();
- OUSTRING aLib = pMacro->GetLibName();
- OUSTRING aMacro = pMacro->GetMacName();
+ ::rtl::OUString aLib = pMacro->GetLibName();
+ ::rtl::OUString aMacro = pMacro->GetMacName();
- pValues[ 0 ].Name = OUSTRING::createFromAscii( PROP_EVENT_TYPE );
+ pValues[ 0 ].Name = ::rtl::OUString::createFromAscii( PROP_EVENT_TYPE );
pValues[ 0 ].Value <<= aLib;
- pValues[ 1 ].Name = OUSTRING::createFromAscii( PROP_SCRIPT );
+ pValues[ 1 ].Name = ::rtl::OUString::createFromAscii( PROP_SCRIPT );
pValues[ 1 ].Value <<= aMacro;
aEventData <<= aProperties;
}
else if ( pMacro->GetScriptType() == JAVASCRIPT )
{
- SEQUENCE < PROPERTYVALUE > aProperties(2);
- PROPERTYVALUE *pValues = aProperties.getArray();
+ uno::Sequence < beans::PropertyValue > aProperties(2);
+ beans::PropertyValue *pValues = aProperties.getArray();
- OUSTRING aMacro = pMacro->GetMacName();
+ ::rtl::OUString aMacro = pMacro->GetMacName();
- pValues[ 0 ].Name = OUSTRING::createFromAscii( PROP_EVENT_TYPE );
+ pValues[ 0 ].Name = ::rtl::OUString::createFromAscii( PROP_EVENT_TYPE );
pValues[ 0 ].Value <<= ::rtl::OUString::createFromAscii(SVX_MACRO_LANGUAGE_JAVASCRIPT);
- pValues[ 1 ].Name = OUSTRING::createFromAscii( PROP_MACRO_NAME );
+ pValues[ 1 ].Name = ::rtl::OUString::createFromAscii( PROP_MACRO_NAME );
pValues[ 1 ].Value <<= aMacro;
aEventData <<= aProperties;
@@ -438,171 +237,68 @@ ANY SfxEventConfiguration::CreateEventData_Impl( const SvxMacro *pMacro )
}
else
{
- SEQUENCE < PROPERTYVALUE > aProperties;
+ uno::Sequence < beans::PropertyValue > aProperties;
aEventData <<= aProperties;
}
return aEventData;
}
-// -------------------------------------------------------------------------------------------------------
-ULONG SfxEventConfiguration::GetPos_Impl( USHORT nId, sal_Bool &rFound )
+//--------------------------------------------------------------------------
+void PropagateEvent_Impl( SfxObjectShell *pDoc, rtl::OUString aEventName, const SvxMacro* pMacro )
{
- rFound = sal_False;
-
- if ( ! gp_Id_SortList->Count() )
- return 0;
-
- // use binary search to find the correct position
- // in the list
-
- int nCompVal = 1;
- long nStart = 0;
- long nEnd = gp_Id_SortList->Count() - 1;
- long nMid = 0;
-
- SfxEventName* pMid;
-
- rFound = sal_False;
-
- while ( nCompVal && ( nStart <= nEnd ) )
- {
- nMid = ( nEnd - nStart ) / 2 + nStart;
- pMid = gp_Id_SortList->GetObject( (USHORT) nMid );
-
- nCompVal = pMid->mnId - nId;
-
- if ( nCompVal < 0 ) // pMid < pData
- nStart = nMid + 1;
- else
- nEnd = nMid - 1;
- }
-
- if ( nCompVal == 0 )
+ uno::Reference < document::XEventsSupplier > xSupplier;
+ if ( pDoc )
{
- rFound = sal_True;
+ xSupplier = uno::Reference < document::XEventsSupplier >( pDoc->GetModel(), uno::UNO_QUERY );
}
else
{
- if ( nCompVal < 0 ) // pMid < pData
- nMid++;
+ xSupplier = uno::Reference < document::XEventsSupplier >
+ ( ::comphelper::getProcessServiceFactory()->createInstance(
+ rtl::OUString::createFromAscii("com.sun.star.frame.GlobalEventBroadcaster" )), uno::UNO_QUERY );
}
- return (USHORT) nMid;
-}
-
-// -------------------------------------------------------------------------------------------------------
-ULONG SfxEventConfiguration::GetPos_Impl( const String& rName, sal_Bool &rFound )
-{
- rFound = sal_False;
-
- if ( ! gp_Name_SortList->Count() )
- return 0;
-
- // use binary search to find the correct position
- // in the list
-
- int nCompVal = 1;
- long nStart = 0;
- long nEnd = gp_Name_SortList->Count() - 1;
- long nMid = 0;
-
- SfxEventName* pMid;
-
- rFound = sal_False;
-
- while ( nCompVal && ( nStart <= nEnd ) )
+ if ( xSupplier.is() )
{
- nMid = ( nEnd - nStart ) / 2 + nStart;
- pMid = gp_Name_SortList->GetObject( (USHORT) nMid );
-
- nCompVal = rName.CompareTo( pMid->maEventName );
-
- if ( nCompVal < 0 ) // pMid < pData
- nStart = nMid + 1;
- else
- nEnd = nMid - 1;
- }
+ uno::Reference < container::XNameReplace > xEvents = xSupplier->getEvents();
+ if ( aEventName.getLength() )
+ {
+ uno::Any aEventData = CreateEventData_Impl( pMacro );
- if ( nCompVal == 0 )
- {
- rFound = sal_True;
- }
- else
- {
- if ( nCompVal < 0 ) // pMid < pData
- nMid++;
+ try
+ {
+ xEvents->replaceByName( aEventName, aEventData );
+ }
+ catch( ::com::sun::star::lang::IllegalArgumentException )
+ { DBG_ERRORFILE( "PropagateEvents_Impl: caught IllegalArgumentException" ); }
+ catch( ::com::sun::star::container::NoSuchElementException )
+ { DBG_ERRORFILE( "PropagateEvents_Impl: caught NoSuchElementException" ); }
+ }
+ else {
+ DBG_WARNING( "PropagateEvents_Impl: Got unkown event" );
+ }
}
-
- return (USHORT) nMid;
}
//--------------------------------------------------------------------------------------------------------
-OUSTRING SfxEventConfiguration::GetEventName_Impl( ULONG nID )
+void SfxEventConfiguration::ConfigureEvent( rtl::OUString aName, const SvxMacro& rMacro, SfxObjectShell *pDoc )
{
- OUSTRING aRet;
-
- if ( gp_Id_SortList )
+ SvxMacro *pMacro = NULL;
+ if ( rMacro.GetMacName().Len() )
+ pMacro = new SvxMacro( rMacro.GetMacName(), rMacro.GetLibName(), rMacro.GetScriptType() );
+ if ( pDoc )
{
- sal_Bool bFound;
- ULONG nPos = GetPos_Impl( (USHORT) nID, bFound );
-
- if ( bFound )
- {
- SfxEventName *pData = gp_Id_SortList->GetObject( nPos );
- aRet = pData->maEventName;
- }
+ PropagateEvent_Impl( pDoc, aName, pMacro );
}
-
- return aRet;
-}
-
-//--------------------------------------------------------------------------------------------------------
-ULONG SfxEventConfiguration::GetEventId_Impl( const OUSTRING& rEventName )
-{
- ULONG nRet = 0;
-
- if ( gp_Name_SortList )
+ else
{
- sal_Bool bFound;
- ULONG nPos = GetPos_Impl( rEventName, bFound );
-
- if ( bFound )
- {
- SfxEventName *pData = gp_Name_SortList->GetObject( nPos );
- nRet = pData->mnId;
- }
+ PropagateEvent_Impl( NULL, aName, pMacro );
}
-
- return nRet;
}
// -------------------------------------------------------------------------------------------------------
-void SfxEventConfiguration::RegisterEvent( USHORT nId,
- const String& rUIName,
- const String& rMacroName )
+SvxMacro* SfxEventConfiguration::ConvertToMacro( const com::sun::star::uno::Any& rElement, SfxObjectShell* pDoc, BOOL bBlowUp )
{
- if ( ! gp_Id_SortList )
- {
- gp_Id_SortList = new SfxEventNamesList;
- gp_Name_SortList = new SfxEventNamesList;
- }
-
- sal_Bool bFound = sal_False;
- ULONG nPos = GetPos_Impl( nId, bFound );
-
- if ( bFound )
- {
- DBG_ERRORFILE( "RegisterEvent: Event already registered?" );
- return;
- }
-
- gp_Id_SortList->Insert( new SfxEventName( nId, rMacroName, rUIName ), nPos );
- nPos = GetPos_Impl( rMacroName, bFound );
-
- DBG_ASSERT( !bFound, "RegisterEvent: Name in List, but ID not?" );
-
- gp_Name_SortList->Insert( new SfxEventName( nId, rMacroName, rUIName ), nPos );
-
- SFX_APP()->GetEventConfig();
+ return SfxEvents_Impl::ConvertToMacro( rElement, pDoc, bBlowUp );
}
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 34deb24bcc32..48c4b16fbf8c 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -145,16 +145,6 @@ IMPL_LINK(SfxAsyncExec_Impl, TimerHdl, Timer*, pTimer)
}
class SfxBindings_Impl
-
-/* [Beschreibung]
-
- Diese Implementations-Struktur der Klasse SfxBindings dient
- der Entkopplung von "Anderungen vom exportierten Interface sowie
- der Verringerung von extern sichtbaren Symbolen.
-
- Eine Instanz exisitiert pro SfxBindings-Instanz f"ur deren Laufzeit.
-*/
-
{
public:
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchRecorder > xRecorder;
@@ -186,20 +176,6 @@ public:
//--------------------------------------------------------------------
struct SfxFoundCache_Impl
-
-/* [Beschreibung]
-
- In Instanzen dieser Struktur werden in <SfxBindings::CreateSet_Impl()>
- weitere Informationen zu den gemeinsam von einem <Slot-Server> zu
- erfragenden Status gesammelt, deren Ids dort in die Ranges eines
- <SfxItemSet>s aufgenommen werden.
-
- Diese Informationen werden w"ahrend der Suche nach den zusammen
- upzudatenden Ids sowieso als Zwischenergebnis ermittelt und nachher
- wieder ben"otigt, daher macht es Sinn, sie f"ur diesen kurzen Zeitraum
- gleich aufzubewahren.
-*/
-
{
sal_uInt16 nSlotId; // die Slot-Id
sal_uInt16 nWhichId; // falls verf"ugbar die Which-Id, sonst nSlotId
@@ -242,20 +218,6 @@ SV_IMPL_OP_PTRARR_SORT(SfxFoundCacheArr_Impl, SfxFoundCache_Impl*);
//==========================================================================
SfxBindings::SfxBindings()
-
-/* [Beschreibung]
-
- Konstruktor der Klasse SfxBindings. Genau eine Instanz wird automatisch
- von der <SfxApplication> vor <SfxApplication::Init()> angelegt. Wird
- eine Instanz ben"otigt, z.B. zum Invalidieren von Slots, sollte diese
- "uber den zugeh"origen <SfxViewFrame> besorgt werden. Bestimmte
- SfxViewFrame Subklassen (z.B. <SfxInPlaceFrame>) legen ihre eigene
- Instanz der SfxBindings an.
-
- <SfxControllerItem> Instanzen k"onnen erst angelegt werden, wenn
- die zugeh"orige SfxBindings Instanz existiert.
-*/
-
: pImp(new SfxBindings_Impl),
pDispatcher(0),
nRegLevel(1) // geht erst auf 0, wenn Dispatcher gesetzt
@@ -324,23 +286,6 @@ SfxBindings::~SfxBindings()
//--------------------------------------------------------------------
void SfxBindings::DeleteControllers_Impl()
-
-/* [Beschreibung]
-
- Interne Methode zum l"oschen noch existierender <SfxControllerItem>
- Instanzen, die bei dieser SfxBindings Instanz angemeldet sind.
-
- Dies sind i.d.R. <SfxPopupWindow>s. Nich sich selbst geh"orende
- SfxControllerItems d"urfen bei Aufruf nur noch existieren, wenn sie
- einem der restlichen SfxPopupWindows geh"oren.
-
-
- [Anmerkung]
-
- Wird beim Beenden der Applikation gerufen, bevor das Applikations-
- Fenster gel"oscht wird.
-*/
-
{
// in der ersten Runde den SfxPopupWindows l"oschen
sal_uInt16 nCount = pImp->pCaches->Count();
@@ -415,20 +360,6 @@ SfxPopupAction SfxBindings::GetPopupAction_Impl() const
//--------------------------------------------------------------------
void SfxBindings::HidePopups( bool bHide )
-
-/* [Beschreibung]
-
- Dieser Methode versteckt und zeigt die <SfxPopupWindows>, die aus
- <SfxToolboxControl>s dieser SfxBindings-Instanz abgerissen wurden bzw.
- floating <SfxChildWindow>-Instanzen dieser SfxBindings-Instanz.
-
-
- [Anmerkung]
-
- Es k"onnten noch weitere Floating-Windows exisitieren, die durch
- diese Methode nicht erfa\st werden.
-*/
-
{
// SfxPopupWindows hiden
HidePopupCtrls_Impl( bHide );
@@ -469,13 +400,6 @@ void SfxBindings::Update_Impl
(
SfxStateCache* pCache // der upzudatende SfxStatusCache
)
-
-/* [Beschreibung]
-
- Interne Methode zum Updaten eines Caches und den von derselben
- Status-Methode in derselben Shell bedienten und dirty Slots.
-*/
-
{
if( pCache->GetDispatch().is() && pCache->GetItemLink() )
{
@@ -558,35 +482,6 @@ void SfxBindings::Update
(
sal_uInt16 nId // die gebundene und upzudatende Slot-Id
)
-
-/* [Beschreibung]
-
- Diese Methode sorgt f"ur synchrones Updaten der auf die Slot-Id nId
- gebundenen <SfxContollerItem> Instanzen, die an dieser SfxBindings
- Instanz angemeldet sind. Vergleichbar zu Window::Update()
- (StarView) erfolgt ein Update nur, wenn entweder ein auf diese
- Slot-Id gebundenes SfxContollerItem dirty ist, oder die Slot-Id
- selbst dirty ist. Dies kann durch einen vorhergehendes Aufruf von
- <SfxBindings::Invalidate(sal_uInt16)> erzwungen werden.
-
-
- [Anmerkung]
-
- Es ist g"unstiger, zun"achst alle zu invalidierenden Slot-Ids per
- <SfxBindings::Invalidate(sal_uInt16)> zu invalidieren und dann
- Update() aufzurufen, als einzelne abwechselnde Invalidate/Update,
- da von derselben Status-Methode bediente Status-Anfragen von
- den SfxBindings automatisch zusammengefa"st werden.
-
-
- [Querverweise]
-
- <SfxShell::Invalidate(sal_uInt16)>
- <SfxBindings::Invalidate(sal_uInt16)>
- <SfxBindings::InvalidateAll(sal_Bool)>
- <SfxBindings::Update()>
-*/
-
{
DBG_MEMTEST();
DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
@@ -654,26 +549,6 @@ void SfxBindings::Update
//--------------------------------------------------------------------
void SfxBindings::Update()
-
-/* [Beschreibung]
-
- Diese Methode sorgt f"ur synchrones Updaten aller <SfxContollerItem>
- Instanzen, die an dieser SfxBindings Instanz angemeldet sind. Vergleichbar
- zu Window::Update() (StarView) erfolgt ein Update nur, wenn entweder ein
- SfxContollerItem dirty ist, in einem Status-Cache der Zeiger auf den
- <Slot-Server> dirty ist. Ersteres kann durch einen Aufruf von
- <SfxBindings::Invalidate(sal_uInt16)> erzwungen werden, letzters durch
- <SfxBindings::InvalidateAll(sal_Bool)>.
-
-
- [Querverweise]
-
- <SfxShell::Invalidate(sal_uInt16)>
- <SfxBindings::Invalidate(sal_uInt16)>
- <SfxBindings::InvalidateAll(sal_Bool)>
- <SfxBindings::Update(sal_uInt16)>
-*/
-
{
DBG_MEMTEST();
DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
@@ -702,19 +577,6 @@ void SfxBindings::SetState
(
const SfxItemSet& rSet // zu setzende Status-Werte
)
-
-/* [Beschreibung]
-
- Diese Methode erlaubt das direkte Setzen neuer Status-Werte, ohne
- den Umweg "uber <SfxBindings::Invalidate()> und das dann im Update
- erfolgende Rufen der Status-Methoden an den <SfxShell>s.
-
-
- [Querverweise]
-
- <SfxBindings::SetState(const SfxPoolItem&)>
-*/
-
{
// wenn gelockt, dann nur invalidieren
if ( nRegLevel )
@@ -759,23 +621,6 @@ void SfxBindings::SetState
(
const SfxPoolItem& rItem // zu setzender Status-Wert
)
-
-/* [Beschreibung]
-
- Diese Methode erlaubt das direkte Setzen eines neuen Status-Wertes,
- ohne den Umweg "uber <SfxBindings::Invalidate()> und das dann im Update
- erfolgende Rufen der Status-Methoden an den <SfxShell>s.
-
- Mit dieser Methode k"onnen nur <SfxPoolItem>s mit Slot, nicht
- aber mit Which-Id gesetzt werden, da kein <SfxItemPool> bekannt ist,
- "uber den gemappt werden k"onnte.
-
-
- [Querverweise]
-
- <SfxBindings::SetState(const SfxItemSet&)>
-*/
-
{
if ( nRegLevel )
{
@@ -824,25 +669,6 @@ SfxStateCache* SfxBindings::GetStateCache
wurde, bzw. an der es einfef"ugt werden
w"urde. */
)
-
-/* [Beschreibung]
-
- Diese Methode sucht die zu einer Slot-Id geh"orige <SfxStatusCache>
- Instanz. Falls die Slot-Id in keinem Controller gebunden ist, wird
- ein 0-Pointer zur"uckgegeben.
-
- Falls pPos != 0, wird erst ab der Position mit der Suche angefangen.
- Dieses ist eine Optimierung, f"ur den Fall, da"s die kleineren
- Ids bereits abgearbeitet wurden.
-
- In *pPos wird der ::com::sun::star::sdbcx::Index innerhalb der SfxBindings zur"uckgegeben,
- unter dem dieser Cache z.Zt. abgelegt ist. Dieser ::com::sun::star::sdbcx::Index ist bis zum
- n"achsten Aufruf von <SfxBindings::EnterRegistrations()> g"ultig.
- W"ahrend der Umkonfiguration (<SfxBindings::IsInRegistrations()> == sal_True)
- kann ist der ::com::sun::star::sdbcx::Index und der R"uckgabewert nur sehr kurzfristig
- g"ultig.
-*/
-
{
DBG_MEMTEST();
DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
@@ -870,27 +696,6 @@ void SfxBindings::InvalidateAll
sal_False
Slot-Server bleiben g"ultig */
)
-
-/* [Beschreibung]
-
- Invalidiert alle <SfxControllerItem> Instanzen, die an dieser
- SfxBindings Instanz angemeldet sind, und bei bWithMsg == sal_True
- ebenfalls die <Slot-Server>-Caches.
-
- Es wird daraufhin ein Timer gestartet, bei dessen Ablauf das Updaten
- beginnt. Somit k"onnen mehrere Invalidierungen vorgenommen werden,
- bevor "uberhaupt etwas passiert.
-
-
- [Querverweise]
-
- <SfxShell::Invalidate(sal_uInt16)>
- <SfxBindings::Invalidate(sal_uInt16)>
- <SfxBindings::Invalidate(sal_uInt16*)>
- <SfxBindings::Update()>
- <SfxBindings::Update(sal_uInt16)>
-*/
-
{
DBG_PROFSTART(SfxBindingsInvalidateAll);
DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" );
@@ -942,26 +747,6 @@ void SfxBindings::Invalidate
const sal_uInt16* pIds /* numerisch sortiertes 0-terminiertes Array
von Slot-Ids (einzel, nicht als Paare!) */
)
-
-/* [Beschreibung]
-
- Invalidiert die <SfxControllerItem> Instanzen der Slot-Ids in 'pIds',
- die an dieser SfxBindings Instanz angemeldet sind.
-
- Es wird daraufhin ein Timer gestartet, bei dessen Ablauf das Updaten
- beginnt. Somit k"onnen mehrere Invalidierungen vorgenommen werden,
- bevor "uberhaupt etwas passiert.
-
-
- [Querverweise]
-
- <SfxShell::Invalidate(sal_uInt16)>
- <SfxBindings::Invalidate(sal_uInt16)>
- <SfxBindings::InvalidateAll(sal_uInt16)>
- <SfxBindings::Update()>
- <SfxBindings::Update(sal_uInt16)>
-*/
-
{
DBG_PROFSTART(SfxBindingsInvalidateAll);
// DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" );
@@ -1032,26 +817,6 @@ void SfxBindings::InvalidateShell
Slot-Ids werden invalidiert */
//! MI: z. Zt. immer bDeep
)
-
-/* [Beschreibung]
-
- Invalidiert alle <SfxControllerItem> Instanzen, die zur Zeit von
- der angegebenen SfxShell Instanz bedient werden und an dieser
- SfxBindings Instanz angemeldet sind
-
- Es wird daraufhin ein Timer gestartet, bei dessen Ablauf das Updaten
- beginnt. Somit k"onnen mehrere Invalidierungen vorgenommen werden,
- bevor "uberhaupt etwas passiert.
-
-
- [Querverweise]
-
- <SfxShell::Invalidate(sal_uInt16)>
- <SfxBindings::Invalidate(sal_uInt16)>
- <SfxBindings::Update()>
- <SfxBindings::Update(sal_uInt16)>
-*/
-
{
DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" );
@@ -1108,24 +873,6 @@ void SfxBindings::Invalidate
(
sal_uInt16 nId // zu invalidierende Slot-Id
)
-
-/* [Beschreibung]
-
- Invalidiert alle <SfxControllerItem> Instanzen, die auf die Slot-Id
- nId gebunden sind und an dieser SfxBindings Instanz angemeldet sind.
-
- Es wird daraufhin ein Timer gestartet, bei dessen Ablauf das Updaten
- beginnt. Somit k"onnen mehrere Invalidierungen vorgenommen werden,
- bevor "uberhaupt etwas passiert.
-
-
- [Querverweise]
- <SfxBindings::Invalidate(sal_uInt16*)>
- <SfxBindings::InvalidateAll(sal_Bool)>
- <SfxBindings::Update()>
- <SfxBindings::Update(sal_uInt16)>
-*/
-
{
DBG_MEMTEST();
// DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" );
@@ -1166,24 +913,6 @@ void SfxBindings::Invalidate
sal_Bool bWithItem, // StateCache clearen ?
sal_Bool bWithMsg // SlotServer neu holen ?
)
-
-/* [Beschreibung]
-
- Invalidiert alle <SfxControllerItem> Instanzen, die auf die Slot-Id
- nId gebunden sind und an dieser SfxBindings Instanz angemeldet sind,
- und bei bWithMsg == sal_True ebenfalls den <Slot-Server>-Cache.
-
- Es wird daraufhin ein Timer gestartet, bei dessen Ablauf das Updaten
- beginnt. Somit k"onnen mehrere Invalidierungen vorgenommen werden,
- bevor "uberhaupt etwas passiert.
-
- [Querverweise]
- <SfxBindings::Invalidate(sal_uInt16*)>
- <SfxBindings::InvalidateAll(sal_Bool)>
- <SfxBindings::Update()>
- <SfxBindings::Update(sal_uInt16)>
-*/
-
{
DBG_MEMTEST();
DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" );
@@ -1214,52 +943,9 @@ void SfxBindings::Invalidate
}
}
-void SfxBindings::Invalidate
-(
- sal_uInt16, // zu invalidierende Slot-Id
- sal_Bool // SlotServer neu holen ?
-)
-
-/* [Beschreibung]
-
- Invalidiert alle <SfxControllerItem> Instanzen, die auf die Slot-Id
- nId gebunden sind und an dieser SfxBindings Instanz angemeldet sind,
- und bei bWithMsg == sal_True ebenfalls den <Slot-Server>-Cache.
-
- Es wird daraufhin ein Timer gestartet, bei dessen Ablauf das Updaten
- beginnt. Somit k"onnen mehrere Invalidierungen vorgenommen werden,
- bevor "uberhaupt etwas passiert.
-
- [Querverweise]
- <SfxBindings::Invalidate(sal_uInt16*)>
- <SfxBindings::InvalidateAll(sal_Bool)>
- <SfxBindings::Update()>
- <SfxBindings::Update(sal_uInt16)>
-*/
-
-{
- DBG_ERROR( "Methode veraltet!" );
-}
-
//--------------------------------------------------------------------
sal_Bool SfxBindings::IsBound( sal_uInt16 nSlotId, sal_uInt16 nStartSearchAt )
-
-/* [Beschreibung]
-
- Stellt fest, ob die angegebene Slot-Id in einem <SfxControllerItem>
- gebunden ist, der an dieser SfxBindings Instanz angemeldet ist.
-
-
- [R"uckgabewert]
-
- sal_Bool sal_True
- Die angegeben Slot-Id ist gebunden.
-
- sal_False
- Die angegeben Slot-Id ist nicht gebunden.
-*/
-
{
DBG_MEMTEST();
DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
@@ -1269,14 +955,6 @@ sal_Bool SfxBindings::IsBound( sal_uInt16 nSlotId, sal_uInt16 nStartSearchAt )
//--------------------------------------------------------------------
sal_uInt16 SfxBindings::GetSlotPos( sal_uInt16 nId, sal_uInt16 nStartSearchAt )
-
-/* [Beschreibung]
-
- Ermittelt den ::com::sun::star::sdbcx::Index der angegebenen Slot-Id in den SfxBindings.
- Falls die Slot-Id nicht gebunden ist, wird der ::com::sun::star::sdbcx::Index zur"uckgegeben,
- an dem sie eingef"ugt w"urde.
-*/
-
{
DBG_MEMTEST();
DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
@@ -1471,30 +1149,6 @@ const SfxPoolItem* SfxBindings::ExecuteSynchron( sal_uInt16 nId, const SfxPoolIt
sal_Bool SfxBindings::Execute( sal_uInt16 nId, const SfxPoolItem** ppItems, sal_uInt16 nModi, SfxCallMode nCallMode,
const SfxPoolItem **ppInternalArgs )
-
-/* [Beschreibung]
-
- F"uhrt den Slot mit der Slot-Id nId "uber den <Slot-Server> Cache
- aus. Dies ist nur bei in dieser SfxBindings INstanz gebundenen
- Slot-Ids m"oglich.
-
-
- [R"uckgabewert]
-
- sal_Bool sal_True
- Das Execute wurde ausgef"uhrt.
-
- sal_False
- Das Execute konnte nicht ausgef"uhrt werden,
- weil der Slot entweder nicht zur Verf"ugung steht
- (in keiner aktiven <SfxShell> vorhanden oder
- disabled) ist oder der Anwender die Ausf"uhrung
- abgebrochen hat (Cancel in einem Dialog).
-
-
- [Querverweise]
- <SfxDispatcher>
-*/
{
DBG_MEMTEST();
DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
@@ -1716,13 +1370,6 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell
//--------------------------------------------------------------------
void SfxBindings::UpdateSlotServer_Impl()
-
-/* [Beschreibung]
-
- Interne Methode zum Updaten der Pointer auf die SlotServer
- nach <SfxBindings::InvalidateAll(sal_Bool)>.
-*/
-
{
DBG_PROFSTART(SfxBindingsUpdateServers);
DBG_MEMTEST();
@@ -1785,16 +1432,6 @@ SfxItemSet* SfxBindings::CreateSet_Impl
const SfxSlotServer** pMsgServer, // out: Slot-Server zu nId
SfxFoundCacheArr_Impl& rFound // out: Liste der Caches der Siblings
)
-
-/* [Beschreibung]
-
- Diese interne Methode sucht zu pCache die Slot-Ids, die von derselben
- Status-Methode bedient werden und ebenfalls gebunden und dirty sind.
- Es wird ein SfxItemSet zusammengestellt, das die Slot-Ids (oder falls
- vorhanden die mit dem Pool der Shell gemappten Which-Ids) enth"alt.
- Die Caches dieser Slots werden in pFoundCaches zur"uckgeliefert.
-*/
-
{
DBG_MEMTEST();
DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
@@ -1942,18 +1579,6 @@ void SfxBindings::UpdateControllers_Impl
const SfxPoolItem* pItem, // item to send to controller
SfxItemState eState // state of item
)
-
-/* [Beschreibung]
-
- Dieses ist eine Hilfsmethode f"ur NextJob_Impl mit der die SfxController,
- welche auf nSlotId gebunden sind, upgedated werden. Dabei wird der
- Wert aus dem SfxPoolItem unter dem Which-Wert nWhich aus dem Set rSet
- genommen.
-
- Falls zu rSlot Enum-Werte in der Slotmap eingetragen sind, und diese
- gebunden sind, werden sie ebenfalls upgedated.
-*/
-
{
DBG_ASSERT( !pFound->pSlot || SFX_KIND_ENUM != pFound->pSlot->GetKind(),
"direct update of enum slot isn't allowed" );
@@ -2059,13 +1684,6 @@ void SfxBindings::UpdateControllers_Impl
//--------------------------------------------------------------------
IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer )
-
-/* [Beschreibung]
-
- Die SfxController werden "uber einen Timer updated. Dieses ist der
- dazugeh"orige interne TimeOut-Handler.
- */
-
{
#ifdef DBG_UTIL
// on Windows very often C++ Exceptions (GPF etc.) are caught by MSVCRT or another MS library
@@ -2178,18 +1796,26 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer )
}
}
- // volatiles wieder von vorne starten
pImp->nMsgPos = 0;
- pImp->aTimer.SetTimeout(TIMEOUT_IDLE);
+
+ // check for volatile slots
+ bool bVolatileSlotsPresent = false;
for ( sal_uInt16 n = 0; n < nCount; ++n )
{
SfxStateCache* pCache = (*pImp->pCaches)[n];
const SfxSlotServer *pSlotServer = pCache->GetSlotServer(*pDispatcher, pImp->xProv);
- if ( pSlotServer &&
- pSlotServer->GetSlot()->IsMode(SFX_SLOT_VOLATILE) )
+ if ( pSlotServer && pSlotServer->GetSlot()->IsMode(SFX_SLOT_VOLATILE) )
+ {
pCache->Invalidate(sal_False);
+ bVolatileSlotsPresent = true;
+ }
}
+ if (bVolatileSlotsPresent)
+ pImp->aTimer.SetTimeout(TIMEOUT_IDLE);
+ else
+ pImp->aTimer.Stop();
+
// Update-Runde ist beendet
pImp->bInNextJob = sal_False;
Broadcast(SfxSimpleHint(SFX_HINT_UPDATEDONE));
@@ -2210,35 +1836,6 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer )
//--------------------------------------------------------------------
sal_uInt16 SfxBindings::EnterRegistrations(const char *pFile, int nLine)
-
-/* [Beschreibung]
-
- Die An- oder Abmeldung von <SfxControllerItem> Instanzen mu"s in
- EnterRegistrations() und LeaveRegistrations() geklammert werden.
- W"ahrend dieser Zeit erfolgen keine Udates der <SfxContollerItem>
- Instanzen (weder der alten noch der neu angemeldeten).
-
- [Parameter]
-
- pFile, nLine Dateiname und Zeilennummer der rufenden
- Methode (nur Debug)
-
- [R"uckgabewert]
-
- sal_uInt16 Level der Registrierung. Dieser kann in
- <SfxBindings::LeaveRegistrations(sal_uInt16)> als
- Parameter angegeben werden, um die Paarigkeit
- der EnterRegistrations() und LeaveRegistrations()
- zu pr"ufen.
-
-
- [Querverweise]
- <SfxBindings::IsInRegistrations()>
- <SfxBindings::Register(SfxControllerItem&)>
- <SfxBindings::Release(SfxControllerItem&)>
- <SfxBindings::LeaveRegistrations()>
-*/
-
{
(void)pFile;
(void)nLine;
@@ -2296,36 +1893,6 @@ sal_uInt16 SfxBindings::EnterRegistrations(const char *pFile, int nLine)
//--------------------------------------------------------------------
void SfxBindings::LeaveRegistrations( sal_uInt16 nLevel, const char *pFile, int nLine )
-
-/* [Beschreibung]
-
- Die An- oder Abmeldung von <SfxControllerItem> Instanzen mu"s in
- EnterRegistrations() und LeaveRegistrations() geklammert werden.
- W"ahrend dieser Zeit erfolgen keine Udates der <SfxContollerItem>
- Instanzen (weder der alten noch der neu angemeldeten).
-
-
- [Parameter]
-
- sal_uInt16 nLevel == USRT_MAX
- keine Paarigkeits-Pr"ufung f"ur diese Klammerung
-
-
- pFile, nLine Dateiname und Zeilennummer der rufenden
- Methode (nur Debug)
-
- < USHRT_MAX
- R"uckgabewert des zugeh"origen EnterRegistrations()
- zum pr"ufen der Paarigkeit.
-
-
- [Querverweise]
- <SfxBindings::IsInRegistrations()>
- <SfxBindings::Register(SfxControllerItem&)>
- <SfxBindings::Release(SfxControllerItem&)>
- <SfxBindings::EnterRegistrations()>
-*/
-
{
(void)nLevel; // unused variable
(void)pFile;
@@ -2425,26 +1992,6 @@ void SfxBindings::LeaveRegistrations( sal_uInt16 nLevel, const char *pFile, int
//--------------------------------------------------------------------
const SfxSlot* SfxBindings::GetSlot(sal_uInt16 nSlotId)
-
-/* [Beschreibung]
-
- Diese Methode liefert einen Pointer auf den zur Zeit gecacheten
- SfxSlot f"ur die angegebene Slot-Id.
-
-
- [R"uckgabewert]
-
- const <SfxSlot>* 0
- Falls die Slot-Id nicht gebunden ist oder
- ein solcher Slot momentan in keiner aktiven
- <SfxShell> vorhanden ist.
-
- != 0
- Falls die Slot-Id gebunden ist und ein solcher
- Slot momentan in einer aktiven <SfxShell>
- vorhanden ist.
-*/
-
{
DBG_MEMTEST();
DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
@@ -2463,17 +2010,6 @@ const SfxSlot* SfxBindings::GetSlot(sal_uInt16 nSlotId)
//--------------------------------------------------------------------
void SfxBindings::SetDispatcher( SfxDispatcher *pDisp )
-
-/* [Beschreibung]
-
- Setzt den zur Zeit von dieser SfxBindings Instanz zu verwendenden
- Dispatcher um.
-
- Falls sich der Dispatcher dadurch "andert, wird intern
- <SFxBindings::InvalidateAll(sal_Bool)> mit sal_True gerufen, also jegliche
- gecachete Information der Bindings weggeworfen.
-*/
-
{
SfxDispatcher *pOldDispat = pDispatcher;
if ( pDisp != pDispatcher )
@@ -2541,17 +2077,11 @@ void SfxBindings::SetDispatcher( SfxDispatcher *pDisp )
//--------------------------------------------------------------------
void SfxBindings::ClearCache_Impl( sal_uInt16 nSlotId )
-
-// interne Methode zum forwarden dieses Methodenaufrufs
-
{
GetStateCache(nSlotId)->ClearCache();
}
//--------------------------------------------------------------------
-
-// interne Methode zum Ansto\sen des Statusupdates
-
void SfxBindings::StartUpdate_Impl( sal_Bool bComplete )
{
if ( pImp->pSubBindings )
@@ -2568,18 +2098,6 @@ void SfxBindings::StartUpdate_Impl( sal_Bool bComplete )
//-------------------------------------------------------------------------
SfxItemState SfxBindings::QueryState( sal_uInt16 nSlot, SfxPoolItem* &rpState )
-/* [Beschreibung]
-
- Wird gerufen, um den Status f"ur 'nSlot' zu erfragen. Wenn der return
- value SFX_ITEM_SET ist, wird ein SfxPoolItem zur"uckgegeben, indem der
- rpState entsprechend gesetzt wird. Es findet dabei ein Eigent"umer"ubergang
- statt, d.h. die aufrufende Methode mu\s das Item l"oschen.
-
- Anmerkung: diese Methode ist sehr teuer und sollte nur gerufen werden,
- wenn kein Controller f"ur das Erfragen des Status angelegt werden kann oder
- der Status unbedingt sofort geliefert werden mu\s.
-*/
-
{
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDisp;
SfxStateCache *pCache = GetStateCache( nSlot );
@@ -2870,15 +2388,6 @@ BOOL SfxBindings::ExecuteCommand_Impl( const String& rCommand )
return FALSE;
}
-//REMOVE SfxConfigManager* SfxBindings::GetConfigManager( USHORT nType ) const
-//{
-//REMOVE SfxConfigManager *pMgr = pDispatcher->GetFrame()->GetObjectShell()->GetConfigManager();
-//REMOVE if ( pMgr && pMgr->HasConfigItem( nType ) )
-//REMOVE return pMgr;
-//REMOVE else
-// return SFX_APP()->GetConfigManager_Impl();
-//}
-
com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > SfxBindings::GetRecorder() const
{
return pImp->xRecorder;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 64aa1a7d9d26..190cc47dc2f6 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -765,6 +765,8 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util
sal_Bool bFailure = sal_False;
const SfxPoolItem* pItem = NULL;
SfxShell* pShell( 0 );
+ // #i102619# Retrieve metric from shell before execution - the shell could be destroyed after execution
+ SfxMapUnit eMapUnit( SFX_MAPUNIT_100TH_MM );
if ( pDispatcher->GetBindings() )
{
if ( !pDispatcher->IsLocked( GetId() ) )
@@ -783,6 +785,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util
lNewArgs[nIndex].Value = makeAny( SfxDispatchController_Impl::getSlaveCommand( aDispatchURL ));
}
+ eMapUnit = GetCoreMetric( pShell->GetPool(), GetId() );
SfxAllItemSet aSet( pShell->GetPool() );
TransformParameters( GetId(), lNewArgs, aSet, pSlot );
if ( aSet.Count() )
@@ -811,6 +814,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util
}
else
{
+ eMapUnit = GetCoreMetric( SFX_APP()->GetPool(), GetId() );
// AppDispatcher
SfxAllItemSet aSet( SFX_APP()->GetPool() );
TransformParameters( GetId(), lNewArgs, aSet );
@@ -850,13 +854,6 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util
aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch;
if ( bSuccess && pItem && !pItem->ISA(SfxVoidItem) )
{
- // Retrieve metric from pool to have correct sub ID when calling QueryValue
- SfxMapUnit eMapUnit( SFX_MAPUNIT_100TH_MM );
- if ( pShell )
- eMapUnit = GetCoreMetric( pShell->GetPool(), GetId() );
- else
- eMapUnit = GetCoreMetric( SFX_APP()->GetPool(), GetId() );
-
USHORT nSubId( 0 );
if ( eMapUnit == SFX_MAPUNIT_TWIP )
nSubId |= CONVERT_TWIPS;
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 6de52384a90c..484e953f1cf4 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -899,7 +899,7 @@ void SfxDocumentPage::ImplUpdateSignatures()
{
String s;
Sequence< security::DocumentSignatureInformation > aInfos;
- aInfos = xD->verifyDocumentContentSignatures( pMedium->GetLastCommitReadStorage_Impl(),
+ aInfos = xD->verifyDocumentContentSignatures( pMedium->GetZipStorageToSign_Impl(),
uno::Reference< io::XInputStream >() );
if( aInfos.getLength() > 1 )
{
@@ -1619,7 +1619,7 @@ CustomPropertiesWindow::CustomPropertiesWindow( Window* pParent, const ResId& rR
m_aValueEdit ( this, SfxResId( SFX_ED_PROPERTY_VALUE ) ),
m_aYesNoButton ( this, SfxResId( SFX_WIN_PROPERTY_YESNO ) ),
m_aRemoveButton ( this, SfxResId( SFX_PB_PROPERTY_REMOVE ) ),
-
+ m_nScrollPos (0),
m_aNumberFormatter( ::comphelper::getProcessServiceFactory(),
Application::GetSettings().GetLanguage() )
@@ -1676,6 +1676,8 @@ IMPL_LINK( CustomPropertiesWindow, RemoveHdl, CustomPropertiesRemoveButton*, pBu
}
}
}
+
+ m_aRemovedHdl.Call(0);
return 0;
}
@@ -1852,6 +1854,7 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny )
Size aSize = (*pCurrent)->GetSizePixel();
Point aPos = (*pCurrent)->GetPosPixel();
aPos.Y() += nPos;
+ aPos.Y() += m_nScrollPos;
(*pNewCurrent)->SetPosSizePixel( aPos, aSize );
(*pNewCurrent)->Show();
pCurrent++;
@@ -1974,10 +1977,12 @@ void CustomPropertiesWindow::ClearAllLines()
delete pLine;
}
m_aCustomPropertiesLines.clear();
+ m_nScrollPos = 0;
}
void CustomPropertiesWindow::DoScroll( sal_Int32 nNewPos )
{
+ m_nScrollPos += nNewPos;
std::vector< CustomPropertyLine* >::iterator pIter;
for ( pIter = m_aCustomPropertiesLines.begin();
pIter != m_aCustomPropertiesLines.end(); ++pIter )
@@ -2141,6 +2146,7 @@ CustomPropertiesControl::CustomPropertiesControl( Window* pParent, const ResId&
XubString sTEST = m_aHeaderBar.GetItemText( HI_NAME );
m_aPropertiesWin.InitControls( &m_aHeaderBar, &m_aVertScroll );
+ m_aPropertiesWin.SetRemovedHdl( LINK( this, CustomPropertiesControl, RemovedHdl ) );
m_aVertScroll.SetRangeMin( 0 );
sal_Int32 nScrollOffset = m_aPropertiesWin.GetLineHeight();
@@ -2156,7 +2162,7 @@ CustomPropertiesControl::CustomPropertiesControl( Window* pParent, const ResId&
Link aScrollLink = LINK( this, CustomPropertiesControl, ScrollHdl );
m_aVertScroll.SetScrollHdl( aScrollLink );
- m_aVertScroll.SetEndScrollHdl( aScrollLink );
+// m_aVertScroll.SetEndScrollHdl( aScrollLink );
}
CustomPropertiesControl::~CustomPropertiesControl()
@@ -2176,10 +2182,20 @@ IMPL_LINK( CustomPropertiesControl, ScrollHdl, ScrollBar*, pScrollBar )
return 0;
}
-void CustomPropertiesControl::AddLine( const ::rtl::OUString& sName, Any& rAny )
+IMPL_LINK( CustomPropertiesControl, RemovedHdl, void*, EMPTYARG )
+{
+ m_aVertScroll.SetRangeMax( m_aPropertiesWin.GetVisibleLineCount() + 1 );
+ if ( m_aPropertiesWin.GetOutputSizePixel().Height() < m_aPropertiesWin.GetVisibleLineCount() * m_aPropertiesWin.GetLineHeight() )
+ m_aVertScroll.DoScrollAction ( SCROLL_LINEUP );
+ return 0;
+}
+
+void CustomPropertiesControl::AddLine( const ::rtl::OUString& sName, Any& rAny, bool bInteractive )
{
m_aPropertiesWin.AddLine( sName, rAny );
m_aVertScroll.SetRangeMax( m_aPropertiesWin.GetVisibleLineCount() + 1 );
+ if ( bInteractive && m_aPropertiesWin.GetOutputSizePixel().Height() < m_aPropertiesWin.GetVisibleLineCount() * m_aPropertiesWin.GetLineHeight() )
+ m_aVertScroll.DoScroll( m_aPropertiesWin.GetVisibleLineCount() + 1 );
}
// class SfxCustomPropertiesPage -----------------------------------------
@@ -2200,7 +2216,7 @@ SfxCustomPropertiesPage::SfxCustomPropertiesPage( Window* pParent, const SfxItem
IMPL_LINK( SfxCustomPropertiesPage, AddHdl, PushButton*, EMPTYARG )
{
Any aAny;
- m_aPropertiesCtrl.AddLine( ::rtl::OUString(), aAny );
+ m_aPropertiesCtrl.AddLine( ::rtl::OUString(), aAny, true );
return 0;
}
@@ -2250,7 +2266,7 @@ void SfxCustomPropertiesPage::Reset( const SfxItemSet& rItemSet )
std::vector< CustomProperty* > aCustomProps = pInfoItem->GetCustomProperties();
for ( sal_uInt32 i = 0; i < aCustomProps.size(); i++ )
{
- m_aPropertiesCtrl.AddLine( aCustomProps[i]->m_sName, aCustomProps[i]->m_aValue );
+ m_aPropertiesCtrl.AddLine( aCustomProps[i]->m_sName, aCustomProps[i]->m_aValue, false );
}
}
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index afcf2aeef353..f31ed1724907 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -236,6 +236,7 @@ SfxDockingWrapper::SfxDockingWrapper( Window* pParentWnd ,
}
Window* pContentWindow = VCLUnoHelper::GetWindow(xWindow);
+ pContentWindow->SetStyle( pContentWindow->GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL );
pTitleDockWindow->SetWrappedWindow(pContentWindow);
}
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 33359a45ec96..5a0d2f4a69a0 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -45,9 +45,7 @@
#include <com/sun/star/ui/dialogs/XFilePreview.hpp>
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
#include <com/sun/star/ui/dialogs/XFilterGroupManager.hpp>
-#ifndef _COM_SUN_STAR_UI_DIALOGS_XFOLDERPICKER_HDL_
#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
-#endif
#include <com/sun/star/ui/dialogs/XFilePicker2.hpp>
#include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -82,12 +80,9 @@
#include <svtools/filter.hxx>
#include <svtools/viewoptions.hxx>
#include <svtools/moduleoptions.hxx>
-#ifndef _SVT_HELPID_HRC
#include <svtools/helpid.hrc>
-#endif
#include <svtools/pickerhelper.hxx>
-#include <svtools/docpasswdrequest.hxx>
-#include <svtools/docmspasswdrequest.hxx>
+#include <comphelper/docpasswordrequest.hxx>
#include <ucbhelper/content.hxx>
#include <ucbhelper/commandenvironment.hxx>
#include <comphelper/storagehelper.hxx>
@@ -99,13 +94,9 @@
#include <sfx2/passwd.hxx>
#include "sfxresid.hxx"
#include <sfx2/sfxsids.hrc>
-#ifndef _SFX_FILEDLGHELPER_HRC
#include "filedlghelper.hrc"
-#endif
#include "filtergrouping.hxx"
-#ifndef SFX2_REQUEST_HXX
#include <sfx2/request.hxx>
-#endif
#include "filedlgimpl.hxx"
#include <sfxlocal.hrc>
@@ -137,6 +128,7 @@ const OUString* GetLastFilterConfigId( FileDialogHelper::Context _eContext )
{
static const OUString aSD_EXPORT_IDENTIFIER( RTL_CONSTASCII_USTRINGPARAM( "SdExportLastFilter" ) );
static const OUString aSI_EXPORT_IDENTIFIER( RTL_CONSTASCII_USTRINGPARAM( "SiExportLastFilter" ) );
+ static const OUString aSW_EXPORT_IDENTIFIER( RTL_CONSTASCII_USTRINGPARAM( "SwExportLastFilter" ) );
const OUString* pRet = NULL;
@@ -144,6 +136,7 @@ const OUString* GetLastFilterConfigId( FileDialogHelper::Context _eContext )
{
case FileDialogHelper::SD_EXPORT: pRet = &aSD_EXPORT_IDENTIFIER; break;
case FileDialogHelper::SI_EXPORT: pRet = &aSI_EXPORT_IDENTIFIER; break;
+ case FileDialogHelper::SW_EXPORT: pRet = &aSW_EXPORT_IDENTIFIER; break;
default: break;
}
@@ -474,6 +467,31 @@ 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 )
@@ -557,38 +575,6 @@ void FileDialogHelper_Impl::updateSelectionBox()
}
// ------------------------------------------------------------------------
-struct CheckMSPasswordCapability
-{
- sal_Bool operator() ( const String rFilterName )
- {
- return rFilterName.EqualsAscii("MS Word 97");
- }
-};
-
-// ------------------------------------------------------------------------
-struct CheckPasswordCapability
-{
- sal_Bool operator() ( const SfxFilter* _pFilter )
- {
- if (!_pFilter)
- return false;
-
-#if 0 // to be enabled in the future
- if (_pFilter->GetFilterName().EqualsAscii("MS Excel 97"))
- // For now, we eanble password protection for Excel 97 as a
- // special case. If we start having more filters supporting
- // export encryption with password, we should probably switch to
- // using a filter flag instead.
- return true;
-#endif
-
- return ( _pFilter->IsOwnFormat() && _pFilter->UsesStorage()
- && ( SOFFICE_FILEFORMAT_60 <= _pFilter->GetVersion() ) )
- || CheckMSPasswordCapability()( _pFilter->GetFilterName() );
- }
-};
-
-// ------------------------------------------------------------------------
void FileDialogHelper_Impl::enablePasswordBox( sal_Bool bInit )
{
if ( ! mbHasPassword )
@@ -598,7 +584,7 @@ void FileDialogHelper_Impl::enablePasswordBox( sal_Bool bInit )
mbIsPwdEnabled = updateExtendedControl(
ExtendedFilePickerElementIds::CHECKBOX_PASSWORD,
- CheckPasswordCapability()( getCurentSfxFilter() )
+ lclCheckPasswordCapability( getCurentSfxFilter() )
);
if( bInit )
@@ -1670,31 +1656,21 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
if( xInteractionHandler.is() )
{
- // TODO: find out a way to set the 1-15 char limits on MS Excel 97 filter.
- if ( CheckMSPasswordCapability()( rFilter ) )
- {
- RequestMSDocumentPassword* pMSPasswordRequest = new RequestMSDocumentPassword(
- ::com::sun::star::task::PasswordRequestMode_PASSWORD_CREATE, *(rpURLList->GetObject(0)) );
-
- uno::Reference< com::sun::star::task::XInteractionRequest > rRequest( pMSPasswordRequest );
- xInteractionHandler->handle( rRequest );
- if ( pMSPasswordRequest->isPassword() )
- rpSet->Put( SfxStringItem( SID_PASSWORD, pMSPasswordRequest->getPassword() ) );
- else
- return ERRCODE_ABORT;
- }
+ // TODO: need a save way to distinguish MS filters from other filters
+ bool bMSType = CheckMSPasswordCapabilityForExport( rFilter );
+ ::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)) );
+
+ uno::Reference< com::sun::star::task::XInteractionRequest > rRequest( pPasswordRequest );
+ xInteractionHandler->handle( rRequest );
+ if ( pPasswordRequest->isPassword() )
+ rpSet->Put( SfxStringItem( SID_PASSWORD, pPasswordRequest->getPassword() ) );
else
- {
- RequestDocumentPassword* pPasswordRequest = new RequestDocumentPassword(
- ::com::sun::star::task::PasswordRequestMode_PASSWORD_CREATE, *(rpURLList->GetObject(0)) );
-
- uno::Reference< com::sun::star::task::XInteractionRequest > rRequest( pPasswordRequest );
- xInteractionHandler->handle( rRequest );
- if ( pPasswordRequest->isPassword() )
- rpSet->Put( SfxStringItem( SID_PASSWORD, pPasswordRequest->getPassword() ) );
- else
- return ERRCODE_ABORT;
- }
+ return ERRCODE_ABORT;
}
}
}
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 2f3ccf86e344..706739cd0571 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -102,8 +102,8 @@ using namespace ::com::sun::star::uno;
static USHORT nLastItemId = USHRT_MAX;
-// filter box has maximum 7 entries visible
-#define MAX_FILTER_ENTRIES 7
+// filter box has maximum 12 entries visible
+#define MAX_FILTER_ENTRIES 12
//=========================================================================
@@ -1299,7 +1299,7 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(USHORT nFlags) // Flags
if(pTreeBox)
aFilterLb.SelectEntry(String(SfxResId(STR_STYLE_FILTER_HIERARCHICAL)));
- // show maximum seven entries
+ // show maximum 12 entries
aFilterLb.SetDropDownLineCount( MAX_FILTER_ENTRIES );
aFilterLb.SetUpdateMode(TRUE);
}
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 03dcbc2c09bb..1423e712242e 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -375,6 +375,7 @@ private:
const css::uno::Sequence< ::rtl::OUString > & i_rValue,
AttrVector const* = 0);
// throw (css::uno::RuntimeException);
+ void createUserDefined();
};
////////////////////////////////////////////////////////////////////////////
@@ -609,23 +610,23 @@ SfxDocumentMetaData::getURLProperties(
css::uno::UNO_QUERY_THROW);
try {
::rtl::OUString dburl =
- ::rtl::OUString::createFromAscii("DocumentBaseURL");
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentBaseURL"));
::rtl::OUString hdn =
- ::rtl::OUString::createFromAscii("HierarchicalDocumentName");
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HierarchicalDocumentName"));
for (sal_Int32 i = 0; i < i_rMedium.getLength(); ++i) {
if (i_rMedium[i].Name.equals(dburl)) {
xPropArg->addProperty(
- ::rtl::OUString::createFromAscii("BaseURI"),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseURI")),
css::beans::PropertyAttribute::MAYBEVOID,
i_rMedium[i].Value);
} else if (i_rMedium[i].Name.equals(hdn)) {
xPropArg->addProperty(
- ::rtl::OUString::createFromAscii("StreamRelPath"),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath")),
css::beans::PropertyAttribute::MAYBEVOID,
i_rMedium[i].Value);
}
}
- xPropArg->addProperty(::rtl::OUString::createFromAscii("StreamName"),
+ xPropArg->addProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamName")),
css::beans::PropertyAttribute::MAYBEVOID,
css::uno::makeAny(::rtl::OUString::createFromAscii(s_metaXml)));
} catch (css::uno::Exception &) {
@@ -902,7 +903,7 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet)
::sax::Converter::convertBool(buf, b);
values.push_back(buf.makeStringAndClear());
as.push_back(std::make_pair(vt,
- ::rtl::OUString::createFromAscii("boolean")));
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("boolean"))));
} else if (type == ::cppu::UnoType< ::rtl::OUString>::get()) {
::rtl::OUString s;
any >>= s;
@@ -910,13 +911,13 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet)
// #i90847# OOo 2.x does stupid things if value-type="string";
// fortunately string is default anyway, so we can just omit it
// as.push_back(std::make_pair(vt,
-// ::rtl::OUString::createFromAscii("string")));
+// ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("string"))));
} else if (type == ::cppu::UnoType<css::util::DateTime>::get()) {
css::util::DateTime dt;
any >>= dt;
values.push_back(dateTimeToText(dt));
as.push_back(std::make_pair(vt,
- ::rtl::OUString::createFromAscii("date")));
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("date"))));
} else if (type == ::cppu::UnoType<css::util::Date>::get()) {
css::util::Date d;
any >>= d;
@@ -926,13 +927,13 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet)
dt.Day = d.Day;
values.push_back(dateTimeToText(dt));
as.push_back(std::make_pair(vt,
- ::rtl::OUString::createFromAscii("date")));
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("date"))));
} else if (type == ::cppu::UnoType<css::util::Time>::get()) {
css::util::Time ut;
any >>= ut;
values.push_back(durationToText(ut));
as.push_back(std::make_pair(vt,
- ::rtl::OUString::createFromAscii("time")));
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("time"))));
} else if (::cppu::UnoType<double>::get().isAssignableFrom(type)) {
// support not just double, but anything that can be converted
double d = 0;
@@ -941,7 +942,7 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet)
::sax::Converter::convertDouble(buf, d);
values.push_back(buf.makeStringAndClear());
as.push_back(std::make_pair(vt,
- ::rtl::OUString::createFromAscii("float")));
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("float"))));
} else {
DBG_WARNING1("SfxDocumentMetaData: unsupported property type: %s",
OUStringToOString(any.getValueTypeName(),
@@ -996,12 +997,10 @@ SfxDocumentMetaData::updateElement(const char *i_name,
// update user-defined meta data in DOM tree
void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes()
{
- css::uno::Reference<css::beans::XPropertySet> xPSet(m_xUserDefined,
- css::uno::UNO_QUERY_THROW);
- std::pair<css::uno::Sequence< ::rtl::OUString>, AttrVector> udStringsAttrs
- = propsToStrings(xPSet);
- (void) setMetaList("meta:user-defined", udStringsAttrs.first,
- &udStringsAttrs.second);
+ createUserDefined();
+ css::uno::Reference<css::beans::XPropertySet> xPSet(m_xUserDefined,css::uno::UNO_QUERY_THROW);
+ std::pair<css::uno::Sequence< ::rtl::OUString>, AttrVector> udStringsAttrs = propsToStrings(xPSet);
+ (void) setMetaList("meta:user-defined", udStringsAttrs.first,&udStringsAttrs.second);
// update elements with attributes
std::vector<std::pair<const char *, ::rtl::OUString> > attributes;
@@ -1009,10 +1008,10 @@ void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes()
|| isValidDateTime(m_TemplateDate)) {
attributes.push_back(std::make_pair(
static_cast<const char*>("xlink:type"),
- ::rtl::OUString::createFromAscii("simple")));
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("simple"))));
attributes.push_back(std::make_pair(
static_cast<const char*>("xlink:actuate"),
- ::rtl::OUString::createFromAscii("onRequest")));
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("onRequest"))));
attributes.push_back(std::make_pair(
static_cast<const char*>("xlink:title"), m_TemplateName));
attributes.push_back(std::make_pair(
@@ -1088,7 +1087,7 @@ SfxDocumentMetaData::checkInit() const // throw (css::uno::RuntimeException)
"SfxDocumentMetaData::checkInit: not initialized"),
*const_cast<SfxDocumentMetaData*>(this));
}
- DBG_ASSERT((m_xDoc.is() && m_xParent.is() && m_xUserDefined.is()),
+ DBG_ASSERT((m_xDoc.is() && m_xParent.is() ),
"SfxDocumentMetaData::checkInit: reference is null");
}
@@ -1117,13 +1116,13 @@ void SAL_CALL SfxDocumentMetaData::init(
m_xDoc->normalize();
// select nodes for standard meta data stuff
- xPath->registerNS(::rtl::OUString::createFromAscii("xlink"),
+ xPath->registerNS(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("xlink")),
::rtl::OUString::createFromAscii(s_nsXLink));
- xPath->registerNS(::rtl::OUString::createFromAscii("dc"),
+ xPath->registerNS(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dc")),
::rtl::OUString::createFromAscii(s_nsDC));
- xPath->registerNS(::rtl::OUString::createFromAscii("office"),
+ xPath->registerNS(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("office")),
::rtl::OUString::createFromAscii(s_nsODF));
- xPath->registerNS(::rtl::OUString::createFromAscii("meta"),
+ xPath->registerNS(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("meta")),
::rtl::OUString::createFromAscii(s_nsODFMeta));
// NB: we do not handle the single-XML-file ODF variant, which would
// have the root element office:document.
@@ -1216,40 +1215,17 @@ void SAL_CALL SfxDocumentMetaData::init(
getMetaAttr("meta:hyperlink-behaviour", "office:target-frame-name");
+ std::vector<css::uno::Reference<css::xml::dom::XNode> > & vec =
+ m_metaList[::rtl::OUString::createFromAscii("meta:user-defined")];
// user-defined meta data: create PropertyBag which only accepts property
// values of allowed types
- css::uno::Sequence<css::uno::Type> types(10);
- types[0] = ::cppu::UnoType<bool>::get();
- types[1] = ::cppu::UnoType< ::rtl::OUString>::get();
- types[2] = ::cppu::UnoType<css::util::DateTime>::get();
- types[3] = ::cppu::UnoType<css::util::Date>::get();
- types[4] = ::cppu::UnoType<css::util::Time>::get();
- types[5] = ::cppu::UnoType<float>::get();
- types[6] = ::cppu::UnoType<double>::get();
- types[7] = ::cppu::UnoType<sal_Int16>::get();
- types[8] = ::cppu::UnoType<sal_Int32>::get();
- types[9] = ::cppu::UnoType<sal_Int64>::get();
- css::uno::Sequence<css::uno::Any> args(2);
- args[0] <<= css::beans::NamedValue(
- ::rtl::OUString::createFromAscii("AllowedTypes"),
- css::uno::makeAny(types));
- // #i94175#: ODF 1.1 allows empty user-defined property names!
- args[1] <<= css::beans::NamedValue(
- ::rtl::OUString::createFromAscii("AllowEmptyPropertyName"),
- css::uno::makeAny(sal_True));
- m_xUserDefined.set(
- xMsf->createInstanceWithContext(::rtl::OUString::createFromAscii(
- "com.sun.star.beans.PropertyBag"), m_xContext),
- css::uno::UNO_QUERY_THROW);
- css::uno::Reference<css::lang::XInitialization> xInit(m_xUserDefined,
- css::uno::UNO_QUERY);
- if (xInit.is()) {
- xInit->initialize(args);
+ if ( !vec.empty() )
+ {
+ createUserDefined();
}
// user-defined meta data: initialize PropertySet from DOM nodes
- std::vector<css::uno::Reference<css::xml::dom::XNode> > & vec =
- m_metaList[::rtl::OUString::createFromAscii("meta:user-defined")];
+
for (std::vector<css::uno::Reference<css::xml::dom::XNode> >::iterator
it = vec.begin(); it != vec.end(); ++it) {
css::uno::Reference<css::xml::dom::XElement> xElem(*it,
@@ -1257,7 +1233,7 @@ void SAL_CALL SfxDocumentMetaData::init(
css::uno::Any any;
::rtl::OUString name = xElem->getAttributeNS(
::rtl::OUString::createFromAscii(s_nsODFMeta),
- ::rtl::OUString::createFromAscii("name"));
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name")));
::rtl::OUString type = xElem->getAttributeNS(
::rtl::OUString::createFromAscii(s_nsODFMeta),
::rtl::OUString::createFromAscii("value-type"));
@@ -1328,10 +1304,7 @@ SfxDocumentMetaData::SfxDocumentMetaData(
css::uno::Reference< css::uno::XComponentContext > const & context) :
BaseMutex(), SfxDocumentMetaData_Base(m_aMutex),
m_xContext(context), m_NotifyListeners(m_aMutex),
- m_isInitialized(false), m_isModified(false),
- m_xDoc(), m_xParent(), m_meta(), m_metaList(), m_xUserDefined(),
- m_TemplateName(), m_TemplateURL(), m_TemplateDate(), m_AutoloadURL(),
- m_AutoloadSecs(), m_DefaultTarget()
+ m_isInitialized(false), m_isModified(false)
{
DBG_ASSERT(context.is(), "SfxDocumentMetaData: context is null");
DBG_ASSERT(context->getServiceManager().is(),
@@ -1843,6 +1816,7 @@ SfxDocumentMetaData::getUserDefinedProperties()
{
::osl::MutexGuard g(m_aMutex);
checkInit();
+ createUserDefined();
return m_xUserDefined;
}
@@ -1895,7 +1869,7 @@ SfxDocumentMetaData::loadFromStorage(
css::uno::Reference<css::beans::XPropertySet> xPropArg =
getURLProperties(Medium);
try {
- xPropArg->getPropertyValue(::rtl::OUString::createFromAscii("BaseURI"))
+ xPropArg->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseURI")))
>>= input.sSystemId;
input.sSystemId += ::rtl::OUString::createFromAscii("/").concat(
::rtl::OUString::createFromAscii(s_metaXml));
@@ -1954,13 +1928,13 @@ SfxDocumentMetaData::storeToStorage(
css::uno::Reference< css::beans::XPropertySet > xStreamProps(xStream,
css::uno::UNO_QUERY_THROW);
xStreamProps->setPropertyValue(
- ::rtl::OUString::createFromAscii("MediaType"),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")),
css::uno::makeAny(::rtl::OUString::createFromAscii("text/xml")));
xStreamProps->setPropertyValue(
- ::rtl::OUString::createFromAscii("Compressed"),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Compressed")),
css::uno::makeAny(static_cast<sal_Bool> (sal_False)));
xStreamProps->setPropertyValue(
- ::rtl::OUString::createFromAscii("UseCommonStoragePasswordEncryption"),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseCommonStoragePasswordEncryption")),
css::uno::makeAny(static_cast<sal_Bool> (sal_False)));
css::uno::Reference<css::io::XOutputStream> xOutStream =
xStream->getOutputStream();
@@ -2194,9 +2168,12 @@ void SAL_CALL SfxDocumentMetaData::setModified( ::sal_Bool bModified )
::osl::MutexGuard g(m_aMutex);
checkInit();
m_isModified = bModified;
- xMB.set(m_xUserDefined, css::uno::UNO_QUERY);
- DBG_ASSERT(xMB.is(),
- "SfxDocumentMetaData::setModified: PropertyBag not Modifiable?");
+ if ( !bModified )
+ {
+ xMB.set(m_xUserDefined, css::uno::UNO_QUERY);
+ DBG_ASSERT(xMB.is(),
+ "SfxDocumentMetaData::setModified: PropertyBag not Modifiable?");
+ }
}
if (bModified) {
try {
@@ -2262,6 +2239,52 @@ void SAL_CALL SfxDocumentMetaData::serialize(
xSAXable->serialize(i_xHandler, i_rNamespaces);
}
+void SfxDocumentMetaData::createUserDefined()
+{
+ if ( !m_xUserDefined.is() )
+ {
+ css::uno::Sequence<css::uno::Type> types(10);
+ types[0] = ::cppu::UnoType<bool>::get();
+ types[1] = ::cppu::UnoType< ::rtl::OUString>::get();
+ types[2] = ::cppu::UnoType<css::util::DateTime>::get();
+ types[3] = ::cppu::UnoType<css::util::Date>::get();
+ types[4] = ::cppu::UnoType<css::util::Time>::get();
+ types[5] = ::cppu::UnoType<float>::get();
+ types[6] = ::cppu::UnoType<double>::get();
+ types[7] = ::cppu::UnoType<sal_Int16>::get();
+ types[8] = ::cppu::UnoType<sal_Int32>::get();
+ types[9] = ::cppu::UnoType<sal_Int64>::get();
+ css::uno::Sequence<css::uno::Any> args(2);
+ args[0] <<= css::beans::NamedValue(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowedTypes")),
+ css::uno::makeAny(types));
+ // #i94175#: ODF 1.1 allows empty user-defined property names!
+ args[1] <<= css::beans::NamedValue(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowEmptyPropertyName")),
+ css::uno::makeAny(sal_True));
+
+ css::uno::Reference<css::lang::XMultiComponentFactory> xMsf (m_xContext->getServiceManager());
+ m_xUserDefined.set(
+ xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.beans.PropertyBag")), m_xContext),
+ css::uno::UNO_QUERY_THROW);
+ css::uno::Reference<css::lang::XInitialization> xInit(m_xUserDefined,
+ css::uno::UNO_QUERY);
+ if (xInit.is()) {
+ xInit->initialize(args);
+ }
+
+ css::uno::Reference<css::util::XModifyBroadcaster> xMB(m_xUserDefined,css::uno::UNO_QUERY);
+ if (xMB.is())
+ {
+ css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > aListener = m_NotifyListeners.getElements();
+ const css::uno::Reference< css::uno::XInterface >* pIter = aListener.getConstArray();
+ const css::uno::Reference< css::uno::XInterface >* pEnd = pIter + aListener.getLength();
+ for(;pIter != pEnd;++pIter )
+ xMB->addModifyListener(css::uno::Reference< css::util::XModifyListener >(*pIter,css::uno::UNO_QUERY));
+ }
+ }
+}
+
} // closing anonymous implementation namespace
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 23093bfa066f..32ae33ec3c8b 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -84,6 +84,7 @@
#include <unotools/tempfile.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/componentcontext.hxx>
+#include <framework/interaction.hxx>
#include <unotools/streamhelper.hxx>
#include <unotools/localedatawrapper.hxx>
#ifndef _MSGBOX_HXX //autogen
@@ -106,6 +107,7 @@
#include <unotools/streamwrap.hxx>
#include <rtl/logfile.hxx>
+#include <osl/file.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -373,10 +375,9 @@ public:
uno::Sequence < util::RevisionTag > aVersions;
- ::utl::TempFile* pTempDir;
::utl::TempFile* pTempFile;
- uno::Reference < embed::XStorage > m_xReadStorage;
+ uno::Reference < embed::XStorage > m_xZipStorage;
Reference < XInputStream > xInputStream;
Reference < XStream > xStream;
@@ -452,7 +453,6 @@ SfxMedium_Impl::SfxMedium_Impl( SfxMedium* pAntiImplP )
nFileVersion( 0 ),
pOrigFilter( 0 ),
aExpireTime( Date() + 10, Time() ),
- pTempDir( NULL ),
pTempFile( NULL ),
nLastStorageError( 0 ),
m_bRemoveBackup( sal_False ),
@@ -470,9 +470,6 @@ SfxMedium_Impl::~SfxMedium_Impl()
if ( pTempFile )
delete pTempFile;
-
- if ( pTempDir )
- delete pTempDir;
}
//================================================================
@@ -491,18 +488,6 @@ SfxMedium_Impl::~SfxMedium_Impl()
pOutStream( 0 )
//------------------------------------------------------------------
-/*
-const SvGlobalName& SfxMedium::GetClassFilter()
-{
- GetMedium_Impl();
- if( GetError() )
- return aFilterClass;
- if( !bSetFilter && GetStorage() )
- SetClassFilter( GetStorage()->GetClassName() );
- return aFilterClass;
-}*/
-
-//------------------------------------------------------------------
void SfxMedium::ResetError()
{
eError = SVSTREAM_OK;
@@ -557,15 +542,6 @@ sal_uInt32 SfxMedium::GetErrorCode() const
}
//------------------------------------------------------------------
-long SfxMedium::GetFileVersion() const
-{
- if ( !pImp->nFileVersion && pFilter )
- return pFilter->GetVersion();
- else
- return pImp->nFileVersion;
-}
-
-//------------------------------------------------------------------
void SfxMedium::CheckFileDate( const util::DateTime& aInitDate )
{
GetInitFileDate( sal_True );
@@ -665,6 +641,7 @@ Reference < XContent > SfxMedium::GetContent() const
return pImp->aContent.get();
}
+//------------------------------------------------------------------
::rtl::OUString SfxMedium::GetBaseURL( bool bForSaving )
{
::rtl::OUString aBaseURL;
@@ -703,7 +680,7 @@ SvStream* SfxMedium::GetInStream()
if ( pInStream )
return pInStream;
- if ( pImp->pTempFile || pImp->pTempDir )
+ if ( pImp->pTempFile )
{
pInStream = new SvFileStream( aName, nStorOpenMode );
@@ -747,7 +724,7 @@ void SfxMedium::CloseInStream_Impl()
if ( pInStream && !GetContent().is() )
{
- CreateTempFile();
+ CreateTempFile( sal_True );
return;
}
@@ -755,7 +732,7 @@ void SfxMedium::CloseInStream_Impl()
if ( pSet )
pSet->ClearItem( SID_INPUTSTREAM );
- CloseReadStorage_Impl();
+ CloseZipStorage_Impl();
pImp->xInputStream = uno::Reference< io::XInputStream >();
if ( !pOutStream )
@@ -775,8 +752,7 @@ SvStream* SfxMedium::GetOutStream()
{
// Create a temp. file if there is none because we always
// need one.
- if ( !pImp->pTempFile )
- CreateTempFile();
+ CreateTempFile( sal_False );
if ( pImp->pTempFile )
{
@@ -844,8 +820,7 @@ void SfxMedium::CreateFileStream()
GetInStream();
if( pInStream )
{
- if ( !pImp->pTempFile )
- CreateTempFile();
+ CreateTempFile( sal_False );
pImp->bIsTemp = sal_True;
CloseInStream_Impl();
}
@@ -942,82 +917,17 @@ sal_Bool SfxMedium::IsPreview_Impl()
}
//------------------------------------------------------------------
-sal_Bool SfxMedium::TryStorage()
-{
- GetStorage();
-
- if ( pImp->xStorage.is() )
- return sal_True;
-
- // this code will be removed when binary filter components are available!
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr( ::comphelper::getProcessServiceFactory() );
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XArchiver >
- xPacker( xSMgr->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.util.Archiver" ) ), ::com::sun::star::uno::UNO_QUERY );
-
- if( !xPacker.is() )
- return sal_False;
-
- // extract extra data
- ::rtl::OUString aPath = GetURLObject().PathToFileName();
- ::rtl::OUString aExtraData = xPacker->getExtraData( aPath );
- const ::rtl::OUString aSig1( DEFINE_CONST_UNICODE( "private:" ) );
- String aTmp( '?' );
- aTmp += String::CreateFromAscii("simpress");//pFilter->GetFilterContainer()->GetName();
- const ::rtl::OUString aSig2( aTmp );
- sal_Int32 nIndex1 = aExtraData.indexOf( aSig1 );
- sal_Int32 nIndex2 = aExtraData.indexOf( aSig2 );
-
- if( nIndex1 != 0 || nIndex2 == -1 )
- return sal_False;
-
- nIndex1 += aSig1.getLength();
- ::rtl::OUString aTempDoku = aExtraData.copy( nIndex1, nIndex2 - nIndex1 );
-
- // create a temp dir to unpack to
- pImp->pTempDir = new ::utl::TempFile( NULL, sal_True );
- pImp->pTempDir->EnableKillingFile( sal_True );
-
- // unpack all files to temp dir
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs;
- com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler > xInteractionHandler = GetInteractionHandler();
- if (xInteractionHandler.is())
- {
- aArgs.realloc(1);
- aArgs.getArray()[0].Name = DEFINE_CONST_UNICODE( "InteractionHandler" );
- aArgs.getArray()[0].Value <<= xInteractionHandler ;
- }
- ::com::sun::star::uno::Sequence< ::rtl::OUString > files(0);
-
- if( !xPacker->unpack( pImp->pTempDir->GetURL(), aPath, files, aArgs ) )
- return sal_False;
-
- String aNewName = pImp->pTempDir->GetURL();
- aNewName += '/';
- aNewName += String( aTempDoku );
- CloseInStream_Impl();
- String aTemp;
- ::utl::LocalFileHelper::ConvertURLToPhysicalName( aNewName, aTemp );
- SetPhysicalName_Impl( aTemp );
- GetStorage();
-
- return pImp->xStorage.is();
-}
-
-//------------------------------------------------------------------
-sal_Bool SfxMedium::BasedOnOriginalFile_Impl()
-{
- return ( !pImp->pTempFile && !( aLogicName.Len() && pImp->m_bSalvageMode )
- && GetURLObject().GetMainURL( INetURLObject::NO_DECODE ).getLength()
- && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) )
- && ::utl::UCBContentHelper::IsDocument( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) );
-}
-
-//------------------------------------------------------------------
void SfxMedium::StorageBackup_Impl()
{
::ucbhelper::Content aOriginalContent;
Reference< ::com::sun::star::ucb::XCommandEnvironment > xDummyEnv;
- if ( BasedOnOriginalFile_Impl() && !pImp->m_aBackupURL.getLength()
+
+ sal_Bool bBasedOnOriginalFile = ( !pImp->pTempFile && !( aLogicName.Len() && pImp->m_bSalvageMode )
+ && GetURLObject().GetMainURL( INetURLObject::NO_DECODE ).getLength()
+ && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) )
+ && ::utl::UCBContentHelper::IsDocument( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) );
+
+ if ( bBasedOnOriginalFile && !pImp->m_aBackupURL.getLength()
&& ::ucbhelper::Content::create( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv, aOriginalContent ) )
{
DoInternalBackup_Impl( aOriginalContent );
@@ -1036,26 +946,6 @@ void SfxMedium::StorageBackup_Impl()
}
//------------------------------------------------------------------
-::rtl::OUString SfxMedium::GetOutputStorageURL_Impl()
-{
- String aStorageName;
-
- if ( aName.Len() )
- {
- if ( !::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aStorageName ) )
- {
- DBG_ERROR("Physical name not convertable!");
- }
- }
- else
- {
- aStorageName = GetURLObject().GetMainURL( INetURLObject::NO_DECODE );
- }
-
- return aStorageName;
-}
-
-//------------------------------------------------------------------
uno::Reference < embed::XStorage > SfxMedium::GetOutputStorage()
{
if ( GetError() )
@@ -1231,24 +1121,38 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
if ( !bResult && !IsReadOnly() )
{
// check whether the file is readonly in fs
+ // the check is only necessary if
// do it only for loading, some contents still might have problems with this property, let them not affect the saving
sal_Bool bContentReadonly = sal_False;
- if ( bLoading )
+ if ( bLoading && ::utl::LocalFileHelper::IsLocalFile( aLogicName ) )
+ {
+ // let the stream be opened to check the possibility to open it for editing
+ GetMedium_Impl();
+ }
+
+ // "IsReadOnly" property does not allow to detect whether the file is readonly always
+ // so we try always to open the file for editing
+ // the file is readonly only in case the read-write stream can not be opened
+ SFX_ITEMSET_ARG( pSet, pWriteStreamItem, SfxUnoAnyItem, SID_STREAM, sal_False);
+ if ( bLoading && !pWriteStreamItem )
{
try
{
// MediaDescriptor does this check also, the duplication should be avoided in future
- pImp->aContent.getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ) ) >>= bContentReadonly;
+ Reference< ::com::sun::star::ucb::XCommandEnvironment > xDummyEnv;
+ ::ucbhelper::Content aContent( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv );
+ aContent.getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ) ) >>= bContentReadonly;
}
catch( uno::Exception )
{}
}
+ // do further checks only if the file not readonly in fs
if ( !bContentReadonly )
{
+ // the special file locking should be used only for file URLs
if ( ::utl::LocalFileHelper::IsLocalFile( aLogicName ) )
{
- // the special file locking should be used only for file URLs
// in case of storing the document should request the output before locking
if ( bLoading )
@@ -1408,222 +1312,82 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
}
//------------------------------------------------------------------
-uno::Reference < embed::XStorage > SfxMedium::GetStorage()
+uno::Reference < embed::XStorage > SfxMedium::GetStorage( sal_Bool bCreateTempIfNo )
{
if ( pImp->xStorage.is() || bTriedStorage )
return pImp->xStorage;
uno::Sequence< uno::Any > aArgs( 2 );
- String aStorageName;
- if ( pImp->pTempFile || pImp->pTempDir )
- {
- // open storage from the temporary file
- if ( !::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aStorageName ) )
- {
- DBG_ERROR("Physical name not convertable!");
- }
+ // the medium should be retrieved before temporary file creation
+ // to let the MediaDescriptor be filled with the streams
+ GetMedium_Impl();
- CloseOutStream();
- // create the set of the streams based on the temporary file
- GetMedium_Impl();
+ if ( bCreateTempIfNo )
+ CreateTempFile( sal_False );
- OSL_ENSURE( pImp->xStream.is(), "It must be possible to create read write stream access!" );
- if ( pImp->xStream.is() )
- {
- aArgs[0] <<= pImp->xStream;
- pImp->bStorageBasedOnInStream = sal_True;
- }
- else
- {
- CloseStreams_Impl();
- aArgs[0] <<= ::rtl::OUString( aName );
- pImp->bStorageBasedOnInStream = sal_False;
- }
+ GetMedium_Impl();
- aArgs[1] <<= ( nStorOpenMode&STREAM_WRITE ? embed::ElementModes::READWRITE : embed::ElementModes::READ );
+ if ( GetError() )
+ return pImp->xStorage;
- try
- {
- pImp->xStorage = uno::Reference< embed::XStorage >(
- ::comphelper::OStorageHelper::GetStorageFactory()->createInstanceWithArguments( aArgs ),
- uno::UNO_QUERY );
- }
- catch( uno::Exception& )
- {
- //TODO/LATER: error handling; Error and LastStorageError
- }
- }
- else
+ SFX_ITEMSET_ARG( GetItemSet(), pRepairItem, SfxBoolItem, SID_REPAIRPACKAGE, sal_False);
+ if ( pRepairItem && pRepairItem->GetValue() )
{
- // open the storage from original location
- {
- GetMedium_Impl();
- if ( GetError() )
- return pImp->xStorage;
-
- try
- {
- if ( IsReadOnly() && ::utl::LocalFileHelper::IsLocalFile( aLogicName ) )
- {
- //TODO/LATER: performance problem if not controlled by special Mode in SfxMedium
- //(should be done only for permanently open storages)
- // create a copy, the following method will close all existing streams
- CreateTempFile();
-
- // create the set of the streams based on the temporary file
- GetMedium_Impl();
-
- OSL_ENSURE( pImp->xStream.is(), "It must be possible to create read write stream access!" );
- if ( pImp->xStream.is() )
- {
- aArgs[0] <<= pImp->xStream;
- pImp->bStorageBasedOnInStream = sal_True;
- }
- else
- {
- CloseStreams_Impl();
- aArgs[0] <<= ::rtl::OUString( aName );
- pImp->bStorageBasedOnInStream = sal_False;
- }
-
- aArgs[1] <<= embed::ElementModes::READWRITE;
-
- }
- else
- {
- // there is no explicit request to open the document readonly
-
- // create a storage on the stream
- if ( pImp->xStream.is() )
- {
- aArgs[0] <<= pImp->xStream;
- aArgs[1] <<= ( ( nStorOpenMode & STREAM_WRITE ) ?
- embed::ElementModes::READWRITE : embed::ElementModes::READ );
-
- pImp->bStorageBasedOnInStream = sal_True;
- }
- else
- {
- // no readwrite stream, but it can be a case of http protocol
- sal_Bool bReadOnly = sal_False;
-
- if ( aLogicName.CompareToAscii( "private:stream", 14 ) != COMPARE_EQUAL
- && GetContent().is() )
- {
- // unfortunately the content can not always have the interaction handler
- // so in some cases it has to be set for some time
- Reference < ::com::sun::star::ucb::XCommandEnvironment > xEnv;
- Reference < ::com::sun::star::ucb::XCommandEnvironment > xOldEnv;
- Reference < ::com::sun::star::task::XInteractionHandler > xInteractionHandler = ((SfxMedium*)this)->GetInteractionHandler();
- if ( xInteractionHandler.is() )
- xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler,
- Reference< ::com::sun::star::ucb::XProgressHandler >() );
-
- if ( xEnv.is() )
- {
- xOldEnv = pImp->aContent.getCommandEnvironment();
- pImp->aContent.setCommandEnvironment( xEnv );
- }
-
- try
- {
- Any aAny = pImp->aContent.getPropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsReadOnly" )) );
-
- if ( ( aAny >>= bReadOnly ) && bReadOnly )
- {
- GetItemSet()->Put( SfxBoolItem(SID_DOC_READONLY, sal_True));
- SetOpenMode( SFX_STREAM_READONLY, sal_False, sal_True );
- }
- }
- catch( uno::Exception& )
- {}
-
- if ( xEnv.is() )
- pImp->aContent.setCommandEnvironment( xOldEnv );
- }
-
- // if the document is opened as readonly the copy should be done according to selected approach
- // if the document is opened for editing the copy should be done to use it as a temporary location for changes before the final transfer
- // the following method will close all existing streams
- CreateTempFile();
-
- // create the set of the streams based on the temporary file
- GetMedium_Impl();
-
- OSL_ENSURE( pImp->xStream.is(), "It must be possible to create read write stream access!" );
- if ( pImp->xStream.is() )
- {
- aArgs[0] <<= pImp->xStream;
- pImp->bStorageBasedOnInStream = sal_True;
- }
- else
- {
- CloseStreams_Impl();
- aArgs[0] <<= ::rtl::OUString( aName );
- pImp->bStorageBasedOnInStream = sal_False;
- }
+ // the storage should be created for repairing mode
+ CreateTempFile( sal_False );
+ GetMedium_Impl();
- if ( bReadOnly )
- aArgs[1] <<= embed::ElementModes::READ;
- else
- aArgs[1] <<= embed::ElementModes::READWRITE;
- }
- }
+ Reference< ::com::sun::star::ucb::XProgressHandler > xProgressHandler;
+ Reference< ::com::sun::star::task::XStatusIndicator > xStatusIndicator;
- SFX_ITEMSET_ARG( GetItemSet(), pRepairItem, SfxBoolItem, SID_REPAIRPACKAGE, sal_False);
- if ( pRepairItem && pRepairItem->GetValue() )
- {
- // the storage should be created for repairing mode
- CreateTempFile();
- Reference< ::com::sun::star::ucb::XProgressHandler > xProgressHandler;
- Reference< ::com::sun::star::task::XStatusIndicator > xStatusIndicator;
-
- SFX_ITEMSET_ARG( GetItemSet(), pxProgressItem, SfxUnoAnyItem, SID_PROGRESS_STATUSBAR_CONTROL, sal_False );
- if( pxProgressItem && ( pxProgressItem->GetValue() >>= xStatusIndicator ) )
- xProgressHandler = Reference< ::com::sun::star::ucb::XProgressHandler >(
- new utl::ProgressHandlerWrap( xStatusIndicator ) );
-
- uno::Sequence< beans::PropertyValue > aAddProps( 2 );
- aAddProps[0].Name = ::rtl::OUString::createFromAscii( "RepairPackage" );
- aAddProps[0].Value <<= (sal_Bool)sal_True;
- aAddProps[1].Name = ::rtl::OUString::createFromAscii( "StatusIndicator" );
- aAddProps[1].Value <<= xProgressHandler;
-
- aArgs.realloc( 3 );
- aArgs[0] <<= ::rtl::OUString( aName );
- aArgs[1] <<= embed::ElementModes::READWRITE;
- aArgs[2] <<= aAddProps;
+ SFX_ITEMSET_ARG( GetItemSet(), pxProgressItem, SfxUnoAnyItem, SID_PROGRESS_STATUSBAR_CONTROL, sal_False );
+ if( pxProgressItem && ( pxProgressItem->GetValue() >>= xStatusIndicator ) )
+ xProgressHandler = Reference< ::com::sun::star::ucb::XProgressHandler >(
+ new utl::ProgressHandlerWrap( xStatusIndicator ) );
- pImp->bStorageBasedOnInStream = sal_False;
- }
+ uno::Sequence< beans::PropertyValue > aAddProps( 2 );
+ aAddProps[0].Name = ::rtl::OUString::createFromAscii( "RepairPackage" );
+ aAddProps[0].Value <<= (sal_Bool)sal_True;
+ aAddProps[1].Name = ::rtl::OUString::createFromAscii( "StatusIndicator" );
+ aAddProps[1].Value <<= xProgressHandler;
- pImp->xStorage = uno::Reference< embed::XStorage >(
- ::comphelper::OStorageHelper::GetStorageFactory()->createInstanceWithArguments( aArgs ),
- uno::UNO_QUERY );
+ // the first arguments will be filled later
+ aArgs.realloc( 3 );
+ aArgs[2] <<= aAddProps;
+ }
- if ( !pImp->xStorage.is() )
- throw uno::RuntimeException();
+ if ( pImp->xStream.is() )
+ {
+ // since the storage is based on temporary stream we open it always read-write
+ aArgs[0] <<= pImp->xStream;
+ aArgs[1] <<= embed::ElementModes::READWRITE;
+ pImp->bStorageBasedOnInStream = sal_True;
+ }
+ else if ( pImp->xInputStream.is() )
+ {
+ // since the storage is based on temporary stream we open it always read-write
+ aArgs[0] <<= pImp->xInputStream;
+ aArgs[1] <<= embed::ElementModes::READ;
+ pImp->bStorageBasedOnInStream = sal_True;
+ }
+ else
+ {
+ CloseStreams_Impl();
+ aArgs[0] <<= ::rtl::OUString( aName );
+ aArgs[1] <<= embed::ElementModes::READ;
+ pImp->bStorageBasedOnInStream = sal_False;
+ }
- if ( pRepairItem && pRepairItem->GetValue() )
- {
- // in repairing mode the mediatype required by filter should be used
- ::rtl::OUString aMediaType;
- ::rtl::OUString aMediaTypePropName( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) );
- uno::Reference < beans::XPropertySet > xPropSet( pImp->xStorage, uno::UNO_QUERY_THROW );
- xPropSet->getPropertyValue( aMediaTypePropName ) >>= aMediaType;
- if ( !aMediaType.getLength() && pFilter )
- xPropSet->setPropertyValue( aMediaTypePropName,
- uno::makeAny( ::rtl::OUString( pFilter->GetMimeType() ) ) );
- }
- }
- catch ( uno::Exception& )
- {
- //TODO/MBA: error handling; Error and LastStorageError
- pImp->bStorageBasedOnInStream = sal_False;
- }
- }
+ try
+ {
+ pImp->xStorage = uno::Reference< embed::XStorage >(
+ ::comphelper::OStorageHelper::GetStorageFactory()->createInstanceWithArguments( aArgs ),
+ uno::UNO_QUERY );
+ }
+ catch( uno::Exception& )
+ {
+ // impossibility to create the storage is no error
}
if( ( pImp->nLastStorageError = GetError() ) != SVSTREAM_OK )
@@ -1631,13 +1395,12 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage()
pImp->xStorage = 0;
if ( pInStream )
pInStream->Seek(0);
- return NULL;
+ return uno::Reference< embed::XStorage >();
}
bTriedStorage = sal_True;
- //TODO/MBA: error handling; Error and LastStorageError
- //if ( aStorage->GetError() == SVSTREAM_OK )
+ // TODO/LATER: Get versionlist on demand
if ( pImp->xStorage.is() )
{
SetPasswordToStorage_Impl();
@@ -1704,15 +1467,6 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage()
bResetStorage = TRUE;
}
- //TODO/MBA: error handling; Error and LastStorageError
- if ( pImp->xStorage.is() )
- { /*
- if( ( pImp->nLastStorageError = aStorage->GetError() ) != SVSTREAM_OK )
- bResetStorage = TRUE;
- else if ( GetFilter() )
- aStorage->SetVersion( GetFilter()->GetVersion() );*/
- }
-
if ( bResetStorage )
{
pImp->xStorage = 0;
@@ -1725,28 +1479,25 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage()
}
//------------------------------------------------------------------
-uno::Reference< embed::XStorage > SfxMedium::GetLastCommitReadStorage_Impl()
+uno::Reference< embed::XStorage > SfxMedium::GetZipStorageToSign_Impl( sal_Bool bReadOnly )
{
- if ( !GetError() && !pImp->m_xReadStorage.is() )
+ if ( !GetError() && !pImp->m_xZipStorage.is() )
{
+ // very careful!!!
+ // if bReadOnly == sal_False and there is no temporary file the original file might be used
GetMedium_Impl();
try
{
- if ( pImp->xInputStream.is() )
+ // we can not sign document if there is no stream
+ // should it be possible at all?
+ if ( !bReadOnly && pImp->xStream.is() )
{
- uno::Sequence< uno::Any > aArgs( 2 );
- aArgs[0] <<= pImp->xInputStream;
- aArgs[1] <<= embed::ElementModes::READ;
- pImp->m_xReadStorage = uno::Reference< embed::XStorage >(
- ::comphelper::OStorageHelper::GetStorageFactory()->createInstanceWithArguments( aArgs ),
- uno::UNO_QUERY );
+ pImp->m_xZipStorage = ::comphelper::OStorageHelper::GetStorageOfFormatFromStream( ZIP_STORAGE_FORMAT_STRING, pImp->xStream, embed::ElementModes::READWRITE );
}
- else if ( GetStorage().is() )
+ else if ( pImp->xInputStream.is() )
{
- uno::Reference< embed::XStorage > xTempStor = ::comphelper::OStorageHelper::GetTemporaryStorage();
- GetStorage()->copyLastCommitTo( xTempStor );
- pImp->m_xReadStorage = xTempStor;
+ pImp->m_xZipStorage = ::comphelper::OStorageHelper::GetStorageOfFormatFromInputStream( ZIP_STORAGE_FORMAT_STRING, pImp->xInputStream );
}
}
catch( uno::Exception& )
@@ -1758,20 +1509,20 @@ uno::Reference< embed::XStorage > SfxMedium::GetLastCommitReadStorage_Impl()
ResetError();
}
- return pImp->m_xReadStorage;
+ return pImp->m_xZipStorage;
}
//------------------------------------------------------------------
-void SfxMedium::CloseReadStorage_Impl()
+void SfxMedium::CloseZipStorage_Impl()
{
- if ( pImp->m_xReadStorage.is() )
+ if ( pImp->m_xZipStorage.is() )
{
try {
- pImp->m_xReadStorage->dispose();
+ pImp->m_xZipStorage->dispose();
} catch( uno::Exception& )
{}
- pImp->m_xReadStorage = uno::Reference< embed::XStorage >();
+ pImp->m_xZipStorage = uno::Reference< embed::XStorage >();
}
}
@@ -1873,11 +1624,12 @@ sal_Bool SfxMedium::StorageCommit_Impl()
try
{
xTrans->commit();
- CloseReadStorage_Impl();
+ CloseZipStorage_Impl();
bResult = sal_True;
}
catch ( embed::UseBackupException& aBackupExc )
{
+ // since the temporary file is created always now, the scenario is close to be impossible
if ( !pImp->pTempFile )
{
OSL_ENSURE( pImp->m_aBackupURL.getLength(), "No backup on storage commit!\n" );
@@ -1924,9 +1676,6 @@ sal_Bool SfxMedium::TransactedTransferForFS_Impl( const INetURLObject& aSource,
Reference< XOutputStream > aDestStream;
::ucbhelper::Content aOriginalContent;
-// actualy it should work even for contents different from file content
-// DBG_ASSERT( ::utl::LocalFileHelper::IsLocalFile( aDest.GetMainURL( INetURLObject::NO_DECODE ) ),
-// "SfxMedium::TransactedTransferForFS() should be used only for local contents!" );
try
{
aOriginalContent = ::ucbhelper::Content( aDest.GetMainURL( INetURLObject::NO_DECODE ), xComEnv );
@@ -2229,57 +1978,10 @@ void SfxMedium::Transfer_Impl()
catch ( uno::Exception& )
{
//TODO/MBA: error handling
- //if ( !GetError() )
- // SetError( xStor->GetError(, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) )) );
}
return;
}
- if ( pFilter && SOFFICE_FILEFORMAT_60 <= pFilter->GetVersion() )
- {
- //TODO/LATER: how?!
- /*
- SFX_ITEMSET_ARG( GetItemSet(), pItem, SfxBoolItem, SID_UNPACK, sal_False);
- if ( pItem && pItem->GetValue() )
- {
- // this file must be stored without packing into a JAR file
- // check for an existing unpacked storage
- SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( GetName(), STREAM_STD_READ );
- if ( !pStream->GetError() )
- {
- String aURL = UCBStorage::GetLinkedFile( *pStream );
- if ( aURL.Len() )
- // remove a possibly existing old folder
- ::utl::UCBContentHelper::Kill( aURL );
-
- DELETEZ( pStream );
- }
-
- // create a new folder based storage
- SvStorageRef xStor = new SvStorage( TRUE, GetName(), STREAM_STD_READWRITE, STORAGE_CREATE_UNPACKED );
-
- // copy package into unpacked storage
- if ( xStor->GetError() == ERRCODE_NONE && GetStorage()->copyToStorage( xStor ) )
- {
- // commit changes, writing will happen now
- xStor->Commit();
-
- // take new unpacked storage as own storage
- if ( pImp->xStorage.is() )
- CloseStorage();
-
- CloseStreams_Impl();
-
- DELETEZ( pImp->pTempFile );
- ::utl::LocalFileHelper::ConvertURLToPhysicalName( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), aName );
- SetStorage_Impl( xStor );
- }
- else if ( !GetError() )
- SetError( xStor->GetError(, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) )) );
- return;
- }*/
- }
-
INetURLObject aDest( GetURLObject() );
// source is the temp file written so far
@@ -2594,7 +2296,7 @@ void SfxMedium::GetMedium_Impl()
// in case the temporary file exists the streams should be initialized from it,
// but the original MediaDescriptor should not be changed
- sal_Bool bFromTempFile = ( pImp->pTempFile || pImp->pTempDir );
+ sal_Bool bFromTempFile = ( pImp->pTempFile != NULL );
if ( !bFromTempFile )
{
@@ -2691,54 +2393,6 @@ void SfxMedium::CancelTransfers()
pImp->xCancelManager->Cancel();
}
-//----------------------------------------------------------------
-/*
-String SfxMedium::GetStatusString( const SvProgressArg* pArg )
-{
- String aString;
- StringList_Impl aSL( SfxResId( RID_DLSTATUS2 ), (USHORT)pArg->eStatus );
- USHORT nTotal = 0;
-
- if ( pArg->eStatus == SVBINDSTATUS_ENDDOWNLOADDATA && nTotal <= 1 )
- return aString;
-
- if( aSL )
- {
- INetURLObject aObj( pArg->rStatus );
- aString = aSL.GetString();
- aString.SearchAndReplaceAscii( "$(HOST)", aObj.GetHost() );
- String aTarget = aObj.GetFull();
- if( aTarget.Len() <= 1 && pArg->eStatus != SVBINDSTATUS_CONNECTING )
- aTarget = aObj.GetHost();
- if( pArg->nMax )
- {
- aTarget += DEFINE_CONST_UNICODE( " (" );
- AddNumber_Impl( aTarget, pArg->nMax );
- aTarget += ')';
- }
-
- aString.SearchAndReplaceAscii( "$(TARGET)",aTarget );
- String aNumber;
- AddNumber_Impl( aNumber, pArg->nProgress );
- if( pArg->nRate )
- {
- aNumber+= DEFINE_CONST_UNICODE( " (" );
- AddNumber_Impl( aNumber, (ULONG)pArg->nRate );
- aNumber+= DEFINE_CONST_UNICODE( "/s)" );
- }
- if( pArg->nMax && pArg->nProgress && pArg->nMax != pArg->nProgress )
- {
- aNumber += DEFINE_CONST_UNICODE( " [" );
- float aPerc = pArg->nProgress / (float)pArg->nMax;
- aNumber += String::CreateFromInt32( (USHORT)(aPerc * 100) );
- aNumber += DEFINE_CONST_UNICODE( "%]" );
- }
- aString.SearchAndReplaceAscii( "$(BYTE)", aNumber );
- }
- return aString;
-}
-*/
-
sal_Bool SfxMedium::IsRemote()
{
return bRemote;
@@ -2898,7 +2552,7 @@ SfxMedium::SfxMedium( const SfxMedium& rMedium, sal_Bool bTemporary )
pFilter = rMedium.pFilter;
Init_Impl();
if( bTemporary )
- CreateTempFile();
+ CreateTempFile( sal_True );
}
//------------------------------------------------------------------
@@ -2977,7 +2631,7 @@ void SfxMedium::Close()
const SvStream *pStream = aStorage->GetSvStream();
if ( pStream && pStream == pInStream )
{
- CloseReadStorage_Impl();
+ CloseZipStorage_Impl();
pInStream = NULL;
pImp->xInputStream = Reference < XInputStream >();
pImp->xLockBytes.Clear();
@@ -3010,7 +2664,7 @@ void SfxMedium::CloseAndRelease()
const SvStream *pStream = aStorage->GetSvStream();
if ( pStream && pStream == pInStream )
{
- CloseReadStorage_Impl();
+ CloseZipStorage_Impl();
pInStream = NULL;
pImp->xInputStream = Reference < XInputStream >();
pImp->xLockBytes.Clear();
@@ -3050,7 +2704,7 @@ void SfxMedium::UnlockFile()
void SfxMedium::CloseAndReleaseStreams_Impl()
{
- CloseReadStorage_Impl();
+ CloseZipStorage_Impl();
uno::Reference< io::XInputStream > xInToClose = pImp->xInputStream;
uno::Reference< io::XOutputStream > xOutToClose;
@@ -3172,26 +2826,6 @@ void SfxMedium::SetPhysicalName_Impl( const String& rNameP )
}
}
-//----------------------------------------------------------------
-void SfxMedium::MoveTempTo_Impl( SfxMedium* pMedium )
-{
- if ( pMedium && pMedium != this && pImp->pTempFile )
- {
- if( pMedium->pImp->pTempFile )
- delete pMedium->pImp->pTempFile;
- pMedium->pImp->pTempFile = pImp->pTempFile;
-
- pImp->pTempFile->EnableKillingFile( sal_True );
- pImp->pTempFile = NULL;
-
- pMedium->aName = pMedium->pImp->pTempFile->GetFileName();
-
- pMedium->CloseInStream();
- pMedium->CloseStorage();
- pMedium->pImp->aContent = ::ucbhelper::Content();
- }
-}
-
//------------------------------------------------------------------
void SfxMedium::SetTemporary( sal_Bool bTemp )
{
@@ -3395,22 +3029,15 @@ SfxMedium::~SfxMedium()
delete pURLObj;
delete pImp;
}
-//------------------------------------------------------------------
+//------------------------------------------------------------------
void SfxMedium::SetItemSet(SfxItemSet *pNewSet)
{
delete pSet;
pSet = pNewSet;
}
-//------------------------------------------------------------------
-void SfxMedium::SetClassFilter( const SvGlobalName & rFilterClass )
-{
- bSetFilter = sal_True;
- aFilterClass = rFilterClass;
-}
//----------------------------------------------------------------
-
const INetURLObject& SfxMedium::GetURLObject() const
{
if( !pURLObj )
@@ -3743,131 +3370,122 @@ sal_Bool SfxMedium::IsReadOnly()
}
//----------------------------------------------------------------
-void SfxMedium::TryToSwitchToRepairedTemp()
+sal_Bool SfxMedium::SetWritableForUserOnly( const ::rtl::OUString& aURL )
{
- // the medium should be opened in repair mode
- SFX_ITEMSET_ARG( GetItemSet(), pRepairItem, SfxBoolItem, SID_REPAIRPACKAGE, FALSE );
- if ( pRepairItem && pRepairItem->GetValue() )
+ // UCB does not allow to allow write access only for the user,
+ // use osl API
+ sal_Bool bResult = sal_False;
+
+ ::osl::DirectoryItem aDirItem;
+ if ( ::osl::DirectoryItem::get( aURL, aDirItem ) == ::osl::FileBase::E_None )
{
- DBG_ASSERT( pImp->xStorage.is(), "Possible performance problem" );
- if ( GetStorage().is() )
+ ::osl::FileStatus aFileStatus( FileStatusMask_Attributes );
+ if ( aDirItem.getFileStatus( aFileStatus ) == osl::FileBase::E_None
+ && aFileStatus.isValid( FileStatusMask_Attributes ) )
{
- ::utl::TempFile* pTmpFile = new ::utl::TempFile();
- pTmpFile->EnableKillingFile( sal_True );
- ::rtl::OUString aNewName = pTmpFile->GetFileName();
-
- if( aNewName.getLength() )
- {
- try
- {
- uno::Reference < embed::XStorage > xNewStorage = comphelper::OStorageHelper::GetStorageFromURL( aNewName,
- embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE );
- //SvStorageRef aNewStorage = new SvStorage( sal_True, aNewName, STREAM_WRITE | STREAM_TRUNC, STORAGE_TRANSACTED );
+ sal_uInt64 nAttributes = aFileStatus.getAttributes();
- pImp->xStorage->copyToStorage( xNewStorage );
- //if ( aNewStorage->GetError() == SVSTREAM_OK )
- {
- CloseInStream();
- CloseStorage();
- if ( pImp->pTempFile )
- DELETEZ( pImp->pTempFile );
-
- pImp->pTempFile = pTmpFile;
- aName = aNewName;
- }
- }
- catch ( uno::Exception& )
- {
- //TODO/MBA: error handling
- //SetError( aNewStorage->GetError(, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) )) );
- }
- }
- else
- SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
+ nAttributes &= ~(Attribute_OwnWrite |
+ Attribute_GrpWrite |
+ Attribute_OthWrite |
+ Attribute_ReadOnly);
+ nAttributes |= Attribute_OwnWrite;
- if (pImp->pTempFile != pTmpFile)
- delete pTmpFile;
+ bResult = ( osl::File::setAttributes( aURL, nAttributes ) == ::osl::FileBase::E_None );
}
- else
- SetError( ERRCODE_IO_CANTREAD, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
+
+ return bResult;
}
//----------------------------------------------------------------
-void SfxMedium::CreateTempFile()
+void SfxMedium::CreateTempFile( sal_Bool bReplace )
{
if ( pImp->pTempFile )
{
+ if ( !bReplace )
+ return;
+
DELETEZ( pImp->pTempFile );
aName = String();
}
- StreamMode nOpenMode = nStorOpenMode;
- BOOL bCopy = ( nStorOpenMode == nOpenMode && ! ( nOpenMode & STREAM_TRUNC ) );
- if ( bCopy && !pInStream )
- {
- if ( GetContent().is() )
- {
- try
- {
- // make sure that the desired file exists before trying to open
- SvMemoryStream aStream(0,0);
- ::utl::OInputStreamWrapper* pInput = new ::utl::OInputStreamWrapper( aStream );
- Reference< XInputStream > xInput( pInput );
-
- InsertCommandArgument aInsertArg;
- aInsertArg.Data = xInput;
-
- aInsertArg.ReplaceExisting = sal_False;
- Any aCmdArg;
- aCmdArg <<= aInsertArg;
- pImp->aContent.executeCommand( ::rtl::OUString::createFromAscii( "insert" ), aCmdArg );
- }
- catch ( Exception& )
- {
- // it is NOT an error when the stream already exists!
- GetInStream();
- }
- }
- }
-
- nStorOpenMode = nOpenMode;
- ResetError();
-
pImp->pTempFile = new ::utl::TempFile();
pImp->pTempFile->EnableKillingFile( sal_True );
aName = pImp->pTempFile->GetFileName();
- if ( !aName.Len() )
+ ::rtl::OUString aTmpURL = pImp->pTempFile->GetURL();
+ if ( !aName.Len() || !aTmpURL.getLength() )
{
SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
return;
}
- if ( bCopy && pInStream )
+ if ( !( nStorOpenMode & STREAM_TRUNC ) )
{
- GetOutStream();
- if ( pOutStream )
+ if ( GetContent().is()
+ && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) )
+ && ::utl::UCBContentHelper::IsDocument( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) )
{
- char *pBuf = new char [8192];
- sal_uInt32 nErr = ERRCODE_NONE;
-
- pInStream->Seek(0);
- pOutStream->Seek(0);
+ // if there is already such a document, we should copy it
+ // if it is a file system use OS copy process
+ sal_Bool bTransferSuccess = sal_False;
+ try
+ {
+ uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > xComEnv;
+ INetURLObject aTmpURLObj( aTmpURL );
+ ::rtl::OUString aFileName = aTmpURLObj.getName( INetURLObject::LAST_SEGMENT,
+ true,
+ INetURLObject::DECODE_WITH_CHARSET );
+ if ( aFileName.getLength() && aTmpURLObj.removeSegment() )
+ {
+ ::ucbhelper::Content aTargetContent( aTmpURLObj.GetMainURL( INetURLObject::NO_DECODE ), xComEnv );
+ if ( aTargetContent.transferContent( pImp->aContent, ::ucbhelper::InsertOperation_COPY, aFileName, NameClash::OVERWRITE ) )
+ {
+ SetWritableForUserOnly( aTmpURL );
+ bTransferSuccess = sal_True;
+ }
+ }
+ }
+ catch( uno::Exception& )
+ {}
- while( !pInStream->IsEof() && nErr == ERRCODE_NONE )
+ if ( !bTransferSuccess )
{
- sal_uInt32 nRead = pInStream->Read( pBuf, 8192 );
- nErr = pInStream->GetError();
- pOutStream->Write( pBuf, nRead );
+ SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
+ return;
}
- delete[] pBuf;
+ CloseOutStream();
CloseInStream();
}
- CloseOutStream_Impl();
+ else if ( pInStream )
+ {
+ // the case when there is no URL-access available or this is a remote protocoll
+ // but there is an input stream
+ GetOutStream();
+ if ( pOutStream )
+ {
+ char *pBuf = new char [8192];
+ sal_uInt32 nErr = ERRCODE_NONE;
+
+ pInStream->Seek(0);
+ pOutStream->Seek(0);
+
+ while( !pInStream->IsEof() && nErr == ERRCODE_NONE )
+ {
+ sal_uInt32 nRead = pInStream->Read( pBuf, 8192 );
+ nErr = pInStream->GetError();
+ pOutStream->Write( pBuf, nRead );
+ }
+
+ delete[] pBuf;
+ CloseInStream();
+ }
+ CloseOutStream_Impl();
+ }
+ else
+ CloseInStream();
}
- else
- CloseInStream();
CloseStorage();
}
@@ -3875,6 +3493,7 @@ void SfxMedium::CreateTempFile()
//----------------------------------------------------------------
void SfxMedium::CreateTempFileNoCopy()
{
+ // this call always replaces the existing temporary file
if ( pImp->pTempFile )
delete pImp->pTempFile;
@@ -3932,100 +3551,120 @@ void SfxMedium::SetCharset( ::rtl::OUString aChs )
pImp->aCharset = aChs;
}
-sal_Bool SfxMedium::SignContents_Impl( sal_Bool bScriptingContent )
+sal_Bool SfxMedium::SignContents_Impl( sal_Bool bScriptingContent, const ::rtl::OUString& aODFVersion, sal_Bool bHasValidDocumentSignature )
{
- DBG_ASSERT( GetStorage().is(), "SfxMedium::SignContents_Impl - Storage doesn't exist!" );
-
sal_Bool bChanges = FALSE;
- ::com::sun::star::uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xD(
- comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ) ), ::com::sun::star::uno::UNO_QUERY );
-
- // TODO/LATER: error handling
- if ( xD.is() && GetStorage().is() )
+ // the medium should be closed to be able to sign, the caller is responsible to close it
+ if ( !IsOpen() && !GetError() )
{
- sal_Int32 nEncrMode = IsReadOnly() ? embed::ElementModes::READ
- : embed::ElementModes::READWRITE;
+ // The component should know if there was a valid document signature, since
+ // it should show a warning in this case
+ uno::Sequence< uno::Any > aArgs( 2 );
+ aArgs[0] <<= aODFVersion;
+ aArgs[1] <<= bHasValidDocumentSignature;
+ ::com::sun::star::uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xSigner(
+ comphelper::getProcessServiceFactory()->createInstanceWithArguments(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ),
+ aArgs ),
+ ::com::sun::star::uno::UNO_QUERY );
- try
+ if ( xSigner.is() )
{
- uno::Reference< embed::XStorage > xMetaInf = GetStorage()->openStorageElement(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "META-INF" ) ),
- nEncrMode );
- if ( !xMetaInf.is() )
- throw uno::RuntimeException();
-
- if ( bScriptingContent )
+ uno::Reference< embed::XStorage > xWriteableZipStor;
+ if ( !IsReadOnly() )
{
- if ( !IsReadOnly() )
+ // we can reuse the temporary file if there is one already
+ CreateTempFile( sal_False );
+ GetMedium_Impl();
+
+ try
{
- uno::Reference< io::XStream > xStream = xMetaInf->openStreamElement(
- xD->getScriptingContentSignatureDefaultStreamName(),
- nEncrMode );
- if ( !xStream.is() )
+ if ( !pImp->xStream.is() )
throw uno::RuntimeException();
- try
+ xWriteableZipStor = ::comphelper::OStorageHelper::GetStorageOfFormatFromStream( ZIP_STORAGE_FORMAT_STRING, pImp->xStream );
+ if ( !xWriteableZipStor.is() )
+ throw uno::RuntimeException();
+
+ uno::Reference< embed::XStorage > xMetaInf = xWriteableZipStor->openStorageElement(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "META-INF" ) ),
+ embed::ElementModes::READWRITE );
+ if ( !xMetaInf.is() )
+ throw uno::RuntimeException();
+
+ if ( bScriptingContent )
{
- // to leave the stream unencrypted as before
- uno::Reference< beans::XPropertySet > xStrmProps( xStream, uno::UNO_QUERY_THROW );
- xStrmProps->setPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseCommonStoragePasswordEncryption" ) ),
- uno::makeAny( (sal_Bool)sal_False ) );
+ // If the signature has already the document signature it will be removed
+ // after the scripting signature is inserted.
+ uno::Reference< io::XStream > xStream(
+ xMetaInf->openStreamElement( xSigner->getScriptingContentSignatureDefaultStreamName(),
+ embed::ElementModes::READWRITE ),
+ uno::UNO_SET_THROW );
+
+ if ( xSigner->signScriptingContent( GetZipStorageToSign_Impl(), xStream ) )
+ {
+ // remove the document signature if any
+ ::rtl::OUString aDocSigName = xSigner->getDocumentContentSignatureDefaultStreamName();
+ if ( aDocSigName.getLength() && xMetaInf->hasByName( aDocSigName ) )
+ xMetaInf->removeElement( aDocSigName );
+
+ uno::Reference< embed::XTransactedObject > xTransact( xMetaInf, uno::UNO_QUERY_THROW );
+ xTransact->commit();
+ xTransact.set( xWriteableZipStor, uno::UNO_QUERY_THROW );
+ xTransact->commit();
+
+ // the temporary file has been written, commit it to the original file
+ Commit();
+ bChanges = TRUE;
+ }
}
- catch ( uno::Exception& )
- {}
-
- if ( xD->signScriptingContent( GetLastCommitReadStorage_Impl(), xStream ) )
+ else
{
- uno::Reference< embed::XTransactedObject > xTrans( xMetaInf, uno::UNO_QUERY );
- xTrans->commit();
- Commit();
- bChanges = TRUE;
+ uno::Reference< io::XStream > xStream(
+ xMetaInf->openStreamElement( xSigner->getDocumentContentSignatureDefaultStreamName(),
+ embed::ElementModes::READWRITE ),
+ uno::UNO_SET_THROW );
+
+ if ( xSigner->signDocumentContent( GetZipStorageToSign_Impl(), xStream ) )
+ {
+ uno::Reference< embed::XTransactedObject > xTransact( xMetaInf, uno::UNO_QUERY_THROW );
+ xTransact->commit();
+ xTransact.set( xWriteableZipStor, uno::UNO_QUERY_THROW );
+ xTransact->commit();
+
+ // the temporary file has been written, commit it to the original file
+ Commit();
+ bChanges = TRUE;
+ }
}
}
- else
- xD->showScriptingContentSignatures( GetLastCommitReadStorage_Impl(), uno::Reference< io::XInputStream >() );
+ catch ( uno::Exception& )
+ {
+ OSL_ENSURE( sal_False, "Couldn't use signing functionality!\n" );
+ }
+
+ CloseAndRelease();
}
else
{
- if ( !IsReadOnly() )
+ try
{
- uno::Reference< io::XStream > xStream = xMetaInf->openStreamElement(
- xD->getDocumentContentSignatureDefaultStreamName(),
- nEncrMode );
- if ( !xStream.is() )
- throw uno::RuntimeException();
-
- try
- {
- // to leave the stream unencrypted as before
- uno::Reference< beans::XPropertySet > xStrmProps( xStream, uno::UNO_QUERY_THROW );
- xStrmProps->setPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseCommonStoragePasswordEncryption" ) ),
- uno::makeAny( (sal_Bool)sal_False ) );
- }
- catch ( uno::Exception& )
- {}
-
- if ( xD->signDocumentContent( GetLastCommitReadStorage_Impl(), xStream ) )
- {
- uno::Reference< embed::XTransactedObject > xTrans( xMetaInf, uno::UNO_QUERY );
- xTrans->commit();
- Commit();
- bChanges = TRUE;
- }
-
+ if ( bScriptingContent )
+ xSigner->showScriptingContentSignatures( GetZipStorageToSign_Impl(), uno::Reference< io::XInputStream >() );
+ else
+ xSigner->showDocumentContentSignatures( GetZipStorageToSign_Impl(), uno::Reference< io::XInputStream >() );
+ }
+ catch( uno::Exception& )
+ {
+ OSL_ENSURE( sal_False, "Couldn't use signing functionality!\n" );
}
- else
- xD->showDocumentContentSignatures( GetLastCommitReadStorage_Impl(), uno::Reference< io::XInputStream >() );
}
}
- catch( uno::Exception& )
- {
- OSL_ENSURE( sal_False, "Couldn't use signing functionality!\n" );
- }
+
+ ResetError();
}
+
return bChanges;
}
@@ -4140,6 +3779,38 @@ BOOL SfxMedium::IsOpen() const
return aResult;
}
+sal_Bool SfxMedium::CallApproveHandler( const uno::Reference< task::XInteractionHandler >& xHandler, uno::Any aRequest, sal_Bool bAllowAbort )
+{
+ sal_Bool bResult = sal_False;
+
+ if ( xHandler.is() )
+ {
+ try
+ {
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > aContinuations( bAllowAbort ? 2 : 1 );
+
+ ::rtl::Reference< ::framework::ContinuationApprove > pApprove( new ::framework::ContinuationApprove() );
+ aContinuations[ 0 ] = pApprove.get();
+
+ if ( bAllowAbort )
+ {
+ ::rtl::Reference< ::framework::ContinuationAbort > pAbort( new ::framework::ContinuationAbort() );
+ aContinuations[ 1 ] = pAbort.get();
+ }
+
+ uno::Reference< task::XInteractionRequest > xRequest( new ::framework::InteractionRequest( aRequest, aContinuations ) );
+ xHandler->handle( xRequest );
+
+ bResult = pApprove->isSelected();
+ }
+ catch( const Exception& )
+ {
+ }
+ }
+
+ return bResult;
+}
+
::rtl::OUString SfxMedium::SwitchDocumentToTempFile()
{
// the method returns empty string in case of failure
@@ -4177,7 +3848,7 @@ BOOL SfxMedium::IsOpen() const
GetMedium_Impl();
LockOrigFileOnDemand( sal_False, sal_False );
- CreateTempFile();
+ CreateTempFile( sal_True );
GetMedium_Impl();
if ( pImp->xStream.is() )
@@ -4235,7 +3906,7 @@ sal_Bool SfxMedium::SwitchDocumentToFile( ::rtl::OUString aURL )
// open the temporary file based document
GetMedium_Impl();
LockOrigFileOnDemand( sal_False, sal_False );
- CreateTempFile();
+ CreateTempFile( sal_True );
GetMedium_Impl();
if ( pImp->xStream.is() )
diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx
index 929e486f824a..d8b6d23b8d03 100644
--- a/sfx2/source/doc/docfilt.cxx
+++ b/sfx2/source/doc/docfilt.cxx
@@ -52,6 +52,20 @@
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/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx
index e56a65d3f551..f1b889821de7 100644
--- a/sfx2/source/doc/docmacromode.cxx
+++ b/sfx2/source/doc/docmacromode.cxx
@@ -33,6 +33,7 @@
#include "sfx2/docmacromode.hxx"
#include "sfx2/signaturestate.hxx"
+#include "sfx2/docfile.hxx"
/** === begin UNO includes === **/
#include <com/sun/star/document/MacroExecMode.hpp>
@@ -85,14 +86,14 @@ namespace sfx2
//====================================================================
struct DocumentMacroMode_Data
{
- IMacroDocumentAccess& rDocumentAccess;
- sal_Bool bMacroDisabledMessageShown;
- sal_Bool bDocMacroDisabledMessageShown;
-
- DocumentMacroMode_Data( IMacroDocumentAccess& _rDocumentAccess )
- :rDocumentAccess( _rDocumentAccess )
- ,bMacroDisabledMessageShown( sal_False )
- ,bDocMacroDisabledMessageShown( sal_False )
+ IMacroDocumentAccess& m_rDocumentAccess;
+ sal_Bool m_bMacroDisabledMessageShown;
+ sal_Bool m_bDocMacroDisabledMessageShown;
+
+ DocumentMacroMode_Data( IMacroDocumentAccess& rDocumentAccess )
+ :m_rDocumentAccess( rDocumentAccess )
+ ,m_bMacroDisabledMessageShown( sal_False )
+ ,m_bDocMacroDisabledMessageShown( sal_False )
{
}
};
@@ -103,85 +104,37 @@ namespace sfx2
namespace
{
//................................................................
- /** calls the given interaction handler with the given interaction request, offering
- the two continuations "Approve" and "Abort"
-
- @return
- <TRUE/> if and only if the given handler handled the the request, and the "Approve"
- continuation was selected.
- */
- sal_Bool lcl_callInterActionHandler( const Reference< XInteractionHandler >& _rxHandler, const Any& _rRequest )
+ void lcl_showGeneralSfxErrorOnce( const Reference< XInteractionHandler >& rxHandler, const sal_Int32 nSfxErrorCode, sal_Bool& rbAlreadyShown )
{
- if ( !_rxHandler.is() )
- return sal_False;
-
- try
- {
- Sequence< Reference< XInteractionContinuation > > aContinuations(2);
-
- ::rtl::Reference< ::framework::ContinuationAbort > pAbort( new ::framework::ContinuationAbort() );
- aContinuations[ 0 ] = pAbort.get();
-
- ::rtl::Reference< ::framework::ContinuationApprove > pApprove( new ::framework::ContinuationApprove() );
- aContinuations[ 1 ] = pApprove.get();
-
- Reference< XInteractionRequest > xRequest( new ::framework::InteractionRequest( _rRequest, aContinuations ) );
- _rxHandler->handle( xRequest );
-
- if ( pApprove->isSelected() )
- return sal_True;
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return sal_False;
- }
-
- //................................................................
- void lcl_showGeneralSfxErrorOnce( const Reference< XInteractionHandler >& _rxHandler, const sal_Int32 _nSfxErrorCode, sal_Bool& _rbAlreadyShown )
- {
- if ( _rbAlreadyShown )
+ if ( rbAlreadyShown )
return;
ErrorCodeRequest aErrorCodeRequest;
- aErrorCodeRequest.ErrCode = _nSfxErrorCode;
-
- _rbAlreadyShown = lcl_callInterActionHandler( _rxHandler, makeAny( aErrorCodeRequest ) );
- }
+ aErrorCodeRequest.ErrCode = nSfxErrorCode;
- //................................................................
- void lcl_showMacrosDisabledError( const Reference< XInteractionHandler >& _rxHandler, sal_Bool& _rbAlreadyShown )
- {
- lcl_showGeneralSfxErrorOnce( _rxHandler, ERRCODE_SFX_MACROS_SUPPORT_DISABLED, _rbAlreadyShown );
+ SfxMedium::CallApproveHandler( rxHandler, makeAny( aErrorCodeRequest ), sal_False );
+ rbAlreadyShown = sal_True;
}
//................................................................
- void lcl_showDocumentMacrosDisabledError( const Reference< XInteractionHandler >& _rxHandler, sal_Bool& _rbAlreadyShown )
+ void lcl_showMacrosDisabledError( const Reference< XInteractionHandler >& rxHandler, sal_Bool& rbAlreadyShown )
{
- lcl_showGeneralSfxErrorOnce( _rxHandler, ERRCODE_SFX_DOCUMENT_MACRO_DISABLED, _rbAlreadyShown );
+ lcl_showGeneralSfxErrorOnce( rxHandler, ERRCODE_SFX_MACROS_SUPPORT_DISABLED, rbAlreadyShown );
}
//................................................................
- sal_Bool lcl_showMacroWarning( const Reference< XInteractionHandler >& _rxHandler,
- const ::rtl::OUString& _rDocumentLocation )
+ void lcl_showDocumentMacrosDisabledError( const Reference< XInteractionHandler >& rxHandler, sal_Bool& rbAlreadyShown )
{
- DocumentMacroConfirmationRequest aRequest;
- aRequest.DocumentURL = _rDocumentLocation;
- return lcl_callInterActionHandler( _rxHandler, makeAny( aRequest ) );
+ lcl_showGeneralSfxErrorOnce( rxHandler, ERRCODE_SFX_DOCUMENT_MACRO_DISABLED, rbAlreadyShown );
}
//................................................................
- sal_Bool lcl_showMacroWarning( const Reference< XInteractionHandler >& _rxHandler,
- const ::rtl::OUString& _rDocumentLocation, const Reference< XStorage >& _rxDocStor,
- const Sequence< DocumentSignatureInformation >& _rDocSigInfo )
+ sal_Bool lcl_showMacroWarning( const Reference< XInteractionHandler >& rxHandler,
+ const ::rtl::OUString& rDocumentLocation )
{
DocumentMacroConfirmationRequest aRequest;
- aRequest.DocumentURL = _rDocumentLocation;
- aRequest.DocumentStorage = _rxDocStor;
- aRequest.DocumentSignatureInformation = _rDocSigInfo;
- aRequest.Classification = InteractionClassification_QUERY;
- return lcl_callInterActionHandler( _rxHandler, makeAny( aRequest ) );
+ aRequest.DocumentURL = rDocumentLocation;
+ return SfxMedium::CallApproveHandler( rxHandler, makeAny( aRequest ), sal_True );
}
}
@@ -189,8 +142,8 @@ namespace sfx2
//= DocumentMacroMode
//====================================================================
//--------------------------------------------------------------------
- DocumentMacroMode::DocumentMacroMode( IMacroDocumentAccess& _rDocumentAccess )
- :m_pData( new DocumentMacroMode_Data( _rDocumentAccess ) )
+ DocumentMacroMode::DocumentMacroMode( IMacroDocumentAccess& rDocumentAccess )
+ :m_pData( new DocumentMacroMode_Data( rDocumentAccess ) )
{
}
@@ -202,26 +155,26 @@ namespace sfx2
//--------------------------------------------------------------------
sal_Bool DocumentMacroMode::allowMacroExecution()
{
- m_pData->rDocumentAccess.setCurrentMacroExecMode( MacroExecMode::ALWAYS_EXECUTE_NO_WARN );
+ m_pData->m_rDocumentAccess.setCurrentMacroExecMode( MacroExecMode::ALWAYS_EXECUTE_NO_WARN );
return sal_True;
}
//--------------------------------------------------------------------
sal_Bool DocumentMacroMode::disallowMacroExecution()
{
- m_pData->rDocumentAccess.setCurrentMacroExecMode( MacroExecMode::NEVER_EXECUTE );
+ m_pData->m_rDocumentAccess.setCurrentMacroExecMode( MacroExecMode::NEVER_EXECUTE );
return sal_False;
}
//--------------------------------------------------------------------
- sal_Bool DocumentMacroMode::adjustMacroMode( const Reference< XInteractionHandler >& _rxInteraction )
+ sal_Bool DocumentMacroMode::adjustMacroMode( const Reference< XInteractionHandler >& rxInteraction )
{
- sal_uInt16 nMacroExecutionMode = m_pData->rDocumentAccess.getCurrentMacroExecMode();
+ sal_uInt16 nMacroExecutionMode = m_pData->m_rDocumentAccess.getCurrentMacroExecMode();
if ( SvtSecurityOptions().IsMacroDisabled() )
{
// no macro should be executed at all
- lcl_showMacrosDisabledError( _rxInteraction, m_pData->bMacroDisabledMessageShown );
+ lcl_showMacrosDisabledError( rxInteraction, m_pData->m_bMacroDisabledMessageShown );
return disallowMacroExecution();
}
@@ -273,9 +226,10 @@ namespace sfx2
try
{
- ::rtl::OUString sReferrer( m_pData->rDocumentAccess.getDocumentLocation() );
+ ::rtl::OUString sReferrer( m_pData->m_rDocumentAccess.getDocumentLocation() );
// get document location from medium name and check whether it is a trusted one
+ // the service is created ohne document version, since it is not of interest here
::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
Reference< XDocumentDigitalSignatures > xSignatures;
if ( aContext.createComponent( "com.sun.star.security.DocumentDigitalSignatures", xSignatures ) )
@@ -295,61 +249,35 @@ namespace sfx2
// at this point it is clear that the document is not in the secure location
if ( nMacroExecutionMode == MacroExecMode::FROM_LIST_NO_WARN )
{
- lcl_showDocumentMacrosDisabledError( _rxInteraction, m_pData->bDocMacroDisabledMessageShown );
+ lcl_showDocumentMacrosDisabledError( rxInteraction, m_pData->m_bDocMacroDisabledMessageShown );
return disallowMacroExecution();
}
// check whether the document is signed with trusted certificate
- if ( xSignatures.is() && nMacroExecutionMode != MacroExecMode::FROM_LIST )
+ if ( nMacroExecutionMode != MacroExecMode::FROM_LIST )
{
- Sequence< DocumentSignatureInformation > aScriptingSignatureInformations;
- Reference < XStorage > xStore( m_pData->rDocumentAccess.getLastCommitDocumentStorage() );
+ // the trusted macro check will also retrieve the signature state ( small optimization )
+ sal_Bool bHasTrustedMacroSignature = m_pData->m_rDocumentAccess.hasTrustedScriptingSignature( nMacroExecutionMode != MacroExecMode::FROM_LIST_AND_SIGNED_NO_WARN );
- sal_uInt16 nSignatureState = m_pData->rDocumentAccess.getScriptingSignatureState();
+ sal_uInt16 nSignatureState = m_pData->m_rDocumentAccess.getScriptingSignatureState();
if ( nSignatureState == SIGNATURESTATE_SIGNATURES_BROKEN )
{
+ // the signature is broken, no macro execution
if ( nMacroExecutionMode != MacroExecMode::FROM_LIST_AND_SIGNED_NO_WARN )
- {
- m_pData->rDocumentAccess.showBrokenSignatureWarning( _rxInteraction );
- return disallowMacroExecution();
- }
+ m_pData->m_rDocumentAccess.showBrokenSignatureWarning( rxInteraction );
+
+ return disallowMacroExecution();
}
- else
+ else if ( bHasTrustedMacroSignature )
{
- if ( ( ( nSignatureState == SIGNATURESTATE_SIGNATURES_OK )
- || ( nSignatureState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED )
- )
- && xStore.is()
- )
- {
- aScriptingSignatureInformations =
- xSignatures->verifyScriptingContentSignatures( xStore, NULL );
- }
+ // there is trusted macro signature, allow macro execution
+ return allowMacroExecution();
}
-
- sal_Int32 nNumOfInfos = aScriptingSignatureInformations.getLength();
-
- // from now on sReferrer is the system file path
- // sReferrer = INetURLObject::decode( sReferrer, '%', INetURLObject::DECODE_WITH_CHARSET );
- ::rtl::OUString aSystemFileURL;
- if ( osl::FileBase::getSystemPathFromFileURL( sReferrer, aSystemFileURL ) == osl::FileBase::E_None )
- sReferrer = aSystemFileURL;
-
- if ( nNumOfInfos )
+ else if ( nSignatureState == SIGNATURESTATE_SIGNATURES_OK
+ || nSignatureState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED )
{
- for ( sal_Int32 i = 0; i < nNumOfInfos; i++ )
- if ( xSignatures->isAuthorTrusted( aScriptingSignatureInformations[i].Signer ) )
- {
- // there's at least one author we trust which signed the doc
- return allowMacroExecution();
- }
-
- if ( nMacroExecutionMode != MacroExecMode::FROM_LIST_AND_SIGNED_NO_WARN )
- {
- sal_Bool bApproved = lcl_showMacroWarning( _rxInteraction,
- sReferrer, xStore, aScriptingSignatureInformations );
- return ( bApproved ? allowMacroExecution() : disallowMacroExecution() );
- }
+ // there is valid signature, but it is not from the trusted author
+ return disallowMacroExecution();
}
}
@@ -359,9 +287,8 @@ namespace sfx2
)
{
if ( nMacroExecutionMode == MacroExecMode::FROM_LIST_AND_SIGNED_WARN )
- {
- lcl_showDocumentMacrosDisabledError( _rxInteraction, m_pData->bDocMacroDisabledMessageShown );
- }
+ lcl_showDocumentMacrosDisabledError( rxInteraction, m_pData->m_bDocMacroDisabledMessageShown );
+
return disallowMacroExecution();
}
}
@@ -381,13 +308,13 @@ namespace sfx2
if ( eAutoConfirm == eNoAutoConfirm )
{
- ::rtl::OUString sReferrer( m_pData->rDocumentAccess.getDocumentLocation() );
+ ::rtl::OUString sReferrer( m_pData->m_rDocumentAccess.getDocumentLocation() );
::rtl::OUString aSystemFileURL;
if ( osl::FileBase::getSystemPathFromFileURL( sReferrer, aSystemFileURL ) == osl::FileBase::E_None )
sReferrer = aSystemFileURL;
- bSecure = lcl_showMacroWarning( _rxInteraction, sReferrer );
+ bSecure = lcl_showMacroWarning( rxInteraction, sReferrer );
}
else
bSecure = ( eAutoConfirm == eAutoConfirmApprove );
@@ -398,7 +325,7 @@ namespace sfx2
//--------------------------------------------------------------------
sal_Bool DocumentMacroMode::isMacroExecutionDisallowed() const
{
- return m_pData->rDocumentAccess.getCurrentMacroExecMode() == MacroExecMode::NEVER_EXECUTE;
+ return m_pData->m_rDocumentAccess.getCurrentMacroExecMode() == MacroExecMode::NEVER_EXECUTE;
}
//--------------------------------------------------------------------
@@ -407,7 +334,7 @@ namespace sfx2
sal_Bool bHasMacroLib = sal_False;
try
{
- Reference< XEmbeddedScripts > xScripts( m_pData->rDocumentAccess.getEmbeddedDocumentScripts() );
+ Reference< XEmbeddedScripts > xScripts( m_pData->m_rDocumentAccess.getEmbeddedDocumentScripts() );
Reference< XLibraryContainer > xContainer;
if ( xScripts.is() )
xContainer.set( xScripts->getBasicLibraries(), UNO_QUERY_THROW );
@@ -457,21 +384,21 @@ namespace sfx2
}
//--------------------------------------------------------------------
- sal_Bool DocumentMacroMode::storageHasMacros( const Reference< XStorage >& _rxStorage )
+ sal_Bool DocumentMacroMode::storageHasMacros( const Reference< XStorage >& rxStorage )
{
sal_Bool bHasMacros = sal_False;
- if ( _rxStorage.is() )
+ if ( rxStorage.is() )
{
try
{
static const ::rtl::OUString s_sBasicStorageName( ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "Basic" ) ) );
static const ::rtl::OUString s_sScriptsStorageName( ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "Scripts" ) ) );
- bHasMacros =( ( _rxStorage->hasByName( s_sBasicStorageName )
- && _rxStorage->isStorageElement( s_sBasicStorageName )
+ bHasMacros =( ( rxStorage->hasByName( s_sBasicStorageName )
+ && rxStorage->isStorageElement( s_sBasicStorageName )
)
- || ( _rxStorage->hasByName( s_sScriptsStorageName )
- && _rxStorage->isStorageElement( s_sScriptsStorageName )
+ || ( rxStorage->hasByName( s_sScriptsStorageName )
+ && rxStorage->isStorageElement( s_sScriptsStorageName )
)
);
}
@@ -484,7 +411,7 @@ namespace sfx2
}
//--------------------------------------------------------------------
- sal_Bool DocumentMacroMode::checkMacrosOnLoading( const Reference< XInteractionHandler >& _rxInteraction )
+ sal_Bool DocumentMacroMode::checkMacrosOnLoading( const Reference< XInteractionHandler >& rxInteraction )
{
sal_Bool bAllow = sal_False;
if ( SvtSecurityOptions().IsMacroDisabled() )
@@ -494,9 +421,9 @@ namespace sfx2
}
else
{
- if ( m_pData->rDocumentAccess.documentStorageHasMacros() || hasMacroLibrary() )
+ if ( m_pData->m_rDocumentAccess.documentStorageHasMacros() || hasMacroLibrary() )
{
- bAllow = adjustMacroMode( _rxInteraction );
+ bAllow = adjustMacroMode( rxInteraction );
}
else if ( !isMacroExecutionDisallowed() )
{
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 7df93afaa63e..099e649506c0 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -72,6 +72,7 @@
#include "sfxurlrelocator.hxx"
#include "doctemplateslocal.hxx"
#include <sfx2/docfac.hxx>
+#include <sfx2/docfile.hxx>
#include "doc.hrc"
//-----------------------------------------------------------------------------
@@ -909,7 +910,8 @@ sal_Bool SfxDocTplService_Impl::CreateNewUniqueFolderWithPrefix( const ::rtl::OU
Content aParent;
- if ( Content::create( aDirPath.GetMainURL( INetURLObject::NO_DECODE ), maCmdEnv, aParent ) )
+ uno::Reference< XCommandEnvironment > aQuietEnv;
+ if ( Content::create( aDirPath.GetMainURL( INetURLObject::NO_DECODE ), aQuietEnv, aParent ) )
{
for ( sal_Int32 nInd = 0; nInd < 32000; nInd++ )
{
@@ -1919,7 +1921,11 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
aStoreArgs[1].Name = ::rtl::OUString::createFromAscii( "DocumentTitle" );
aStoreArgs[1].Value <<= rTemplateName;
- rStorable->storeToURL( aNewTemplateTargetURL, aStoreArgs );
+ ::rtl::OUString aCurrentDocumentURL = rStorable->getLocation();
+ if( !SfxMedium::EqualURLs( aNewTemplateTargetURL, rStorable->getLocation() ))
+ rStorable->storeToURL( aNewTemplateTargetURL, aStoreArgs );
+ else
+ rStorable->store();
// the storing was successful, now the old template with the same name can be removed if it existed
if ( aTemplateToRemoveTargetURL.getLength() )
diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx
index f1e6cc80812e..bd0e65830870 100644
--- a/sfx2/source/doc/graphhelp.cxx
+++ b/sfx2/source/doc/graphhelp.cxx
@@ -374,32 +374,7 @@ sal_Bool GraphicHelper::createThumb_Impl( const GDIMetaFile& rMtf,
if ( aBmp.GetBitCount() != 24 )
aBmp.Convert( BMP_CONVERSION_24BIT );
- // create resulting mask bitmap with metafile output set to black
- GDIMetaFile aMonchromeMtf( rMtf.GetMonochromeMtf( COL_BLACK ) );
- aVDev.DrawWallpaper( Rectangle( aNullPt, aSizePix ), Wallpaper( Color( COL_WHITE ) ) );
- aMonchromeMtf.WindStart();
- aMonchromeMtf.Play( &aVDev, aBackPosPix, aDrawSize );
-
- // watch for overlay mask
- if ( pOverlay )
- {
- Bitmap aOverlayMergeBmp( aVDev.GetBitmap( aOverlayRect.TopLeft(), aOverlayRect.GetSize() ) );
-
- // create ANDed resulting mask at overlay area
- if ( pOverlay->IsTransparent() )
- aVDev.DrawBitmap( aOverlayRect.TopLeft(), aOverlayRect.GetSize(), pOverlay->GetMask() );
- else
- {
- aVDev.SetLineColor( COL_BLACK );
- aVDev.SetFillColor( COL_BLACK );
- aVDev.DrawRect( aOverlayRect);
- }
-
- aOverlayMergeBmp.CombineSimple( aVDev.GetBitmap( aOverlayRect.TopLeft(), aOverlayRect.GetSize() ), BMP_COMBINE_AND );
- aVDev.DrawBitmap( aOverlayRect.TopLeft(), aOverlayRect.GetSize(), aOverlayMergeBmp );
- }
-
- rBmpEx = BitmapEx( aBmp, aVDev.GetBitmap( aNullPt, aVDev.GetOutputSizePixel() ) );
+ rBmpEx = BitmapEx( aBmp );
}
return !rBmpEx.IsEmpty();
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 66cbedfc7a6b..5916fb625787 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -87,6 +87,8 @@
#include <sfxtypes.hxx>
#include "alienwarn.hxx"
+#include "../appl/app.hrc"
+
#define DOCPROPSNUM 17
// flags that specify requested operation
@@ -808,6 +810,9 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
eCtxt = sfx2::FileDialogHelper::SD_EXPORT;
if( aDocServiceName.equalsAscii( "com.sun.star.presentation.PresentationDocument" ) )
eCtxt = sfx2::FileDialogHelper::SI_EXPORT;
+ if( aDocServiceName.equalsAscii( "com.sun.star.text.TextDocument" ) )
+ eCtxt = sfx2::FileDialogHelper::SW_EXPORT;
+
if ( eCtxt != sfx2::FileDialogHelper::UNKNOWN_CONTEXT )
pFileDlg->SetContext( eCtxt );
@@ -836,7 +841,8 @@ 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 ( bSetStandardName || GetStorable()->hasLocation() )
+ if ( !(( nStoreMode & EXPORT_REQUESTED ) && !( nStoreMode & WIDEEXPORT_REQUESTED )) &&
+ ( bSetStandardName || GetStorable()->hasLocation() ))
{
uno::Sequence< beans::PropertyValue > aOldFilterProps;
::rtl::OUString aOldFilterName = GetDocProps().getUnpackedValueOrDefault(
@@ -1223,7 +1229,8 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
const ::rtl::OUString& aSlotName,
uno::Sequence< beans::PropertyValue >& aArgsSequence,
sal_Bool bPreselectPassword,
- ::rtl::OUString aSuggestedName )
+ ::rtl::OUString aSuggestedName,
+ sal_uInt16 nDocumentSignatureState )
{
ModelData_Impl aModelData( *this, xModel, aArgsSequence );
@@ -1304,6 +1311,24 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
}
}
+ if ( !( nStoreMode & EXPORT_REQUESTED ) )
+ {
+ // if it is no export, warn user that the signature will be removed
+ if ( SIGNATURESTATE_SIGNATURES_OK == nDocumentSignatureState
+ || SIGNATURESTATE_SIGNATURES_INVALID == nDocumentSignatureState
+ || SIGNATURESTATE_SIGNATURES_NOTVALIDATED == nDocumentSignatureState
+ || SIGNATURESTATE_SIGNATURES_PARTIAL_OK == nDocumentSignatureState)
+ {
+ if ( QueryBox( NULL, SfxResId( RID_XMLSEC_QUERY_LOSINGSIGNATURE ) ).Execute() != RET_YES )
+ {
+ // the user has decided not to store the document
+ throw task::ErrorCodeIOException( ::rtl::OUString(),
+ uno::Reference< uno::XInterface >(),
+ ERRCODE_IO_ABORT );
+ }
+ }
+ }
+
// preselect a filter for the storing process
uno::Sequence< beans::PropertyValue > aFilterProps = aModelData.GetPreselectedFilter_Impl( nStoreMode );
diff --git a/sfx2/source/doc/makefile.mk b/sfx2/source/doc/makefile.mk
index 4c893288ebb8..1b42844491e0 100644
--- a/sfx2/source/doc/makefile.mk
+++ b/sfx2/source/doc/makefile.mk
@@ -48,14 +48,13 @@ CFLAGS+=-DSYSTEM_LIBXML $(LIBXML_CFLAGS)
SRS1NAME=$(TARGET)
SRC1FILES = \
- doc.src new.src doctdlg.src docvor.src doctempl.src sfxbasemodel.src graphhelp.src
+ doc.src new.src doctdlg.src docvor.src doctempl.src graphhelp.src
SLOFILES = \
$(SLO)$/printhelper.obj \
$(SLO)$/docinf.obj \
$(SLO)$/oleprops.obj \
$(SLO)$/iframe.obj \
- $(SLO)$/applet.obj \
$(SLO)$/plugin.obj \
$(SLO)$/docfile.obj \
$(SLO)$/objuno.obj \
@@ -90,6 +89,8 @@ SLOFILES = \
$(SLO)$/docstoragemodifylistener.obj \
$(SLO)$/querytemplate.obj
+# $(SLO)$/applet.obj \
+
# --- Tagets -------------------------------------------------------
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 866c7b029cb5..f9c675372307 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -1383,54 +1383,6 @@ void SfxObjectShell::UpdateFromTemplate_Impl( )
}
}
-/*
-SfxEventConfigItem_Impl* SfxObjectShell::GetEventConfig_Impl( BOOL bForce )
-{
- if ( bForce && !pImp->pEventConfig )
- {
- pImp->pEventConfig = new SfxEventConfigItem_Impl( SFX_ITEMTYPE_DOCEVENTCONFIG,
- SFX_APP()->GetEventConfig(), this );
- if (pImp->pCfgMgr)
- pImp->pEventConfig->Connect( pImp->pCfgMgr );
- pImp->pEventConfig->Initialize();
- }
-
- return pImp->pEventConfig;
-} */
-
-//REMOVE SvStorageRef SfxObjectShell::GetConfigurationStorage( SotStorage* pStor )
-//REMOVE {
-//REMOVE // configuration storage shall be opened in own storage or a new storage, if the
-//REMOVE // document is getting stored into this storage
-//REMOVE if ( !pStor )
-//REMOVE pStor = GetStorage();
-//REMOVE
-//REMOVE if ( pStor->IsOLEStorage() )
-//REMOVE return (SvStorageRef) SotStorageRef();
-//REMOVE
-//REMOVE // storage is always opened in transacted mode, so changes must be commited
-//REMOVE SotStorageRef xStorage = pStor->OpenSotStorage( DEFINE_CONST_UNICODE("Configurations"),
-//REMOVE IsReadOnly() ? STREAM_STD_READ : STREAM_STD_READWRITE );
-//REMOVE if ( xStorage.Is() && xStorage->GetError() )
-//REMOVE xStorage.Clear();
-//REMOVE return (SvStorageRef) xStorage;
-//REMOVE }
-
-//REMOVE SotStorageStreamRef SfxObjectShell::GetConfigurationStream( const String& rName, BOOL bCreate )
-//REMOVE {
-//REMOVE SotStorageStreamRef xStream;
-//REMOVE SvStorageRef xStorage = GetConfigurationStorage();
-//REMOVE if ( xStorage.Is() )
-//REMOVE {
-//REMOVE xStream = xStorage->OpenSotStream( rName,
-//REMOVE bCreate ? STREAM_STD_READWRITE|STREAM_TRUNC : STREAM_STD_READ );
-//REMOVE if ( xStream.Is() && xStream->GetError() )
-//REMOVE xStream.Clear();
-//REMOVE }
-//REMOVE
-//REMOVE return xStream;
-//REMOVE }
-
SfxObjectShellRef MakeObjectShellForOrganizer_Impl( const String& aTargetURL, BOOL bForWriting )
{
// check for own format
diff --git a/sfx2/source/doc/objembed.cxx b/sfx2/source/doc/objembed.cxx
index 235451b8c3dd..7b7a1bea1ea0 100644
--- a/sfx2/source/doc/objembed.cxx
+++ b/sfx2/source/doc/objembed.cxx
@@ -136,7 +136,7 @@ void SfxObjectShell::SetVisArea( const Rectangle & rVisArea )
if ( IsEnableSetModified() )
SetModified( TRUE );
- SFX_APP()->NotifyEvent(SfxEventHint( SFX_EVENT_VISAREACHANGED, this));
+ SFX_APP()->NotifyEvent(SfxEventHint( SFX_EVENT_VISAREACHANGED, GlobalEventConfig::GetEventName(STR_EVENT_VISAREACHANGED), this));
/*
Size aSize (GetVisArea().GetSize());
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index a7910c463cf9..5e3ace93372a 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -87,6 +87,8 @@
#include <comphelper/configurationhelper.hxx>
#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
+#include <com/sun/star/task/DocumentMacroConfirmationRequest2.hpp>
+#include <com/sun/star/task/InteractionClassification.hpp>
#include <com/sun/star/frame/XModel.hpp>
using namespace ::com::sun::star;
@@ -120,6 +122,7 @@ using namespace ::com::sun::star::container;
#include <vcl/svapp.hxx>
#include <framework/interaction.hxx>
#include <comphelper/storagehelper.hxx>
+#include <comphelper/documentconstants.hxx>
#include <sfx2/signaturestate.hxx>
#include <sfx2/app.hxx>
@@ -285,8 +288,6 @@ sal_uInt32 SfxObjectShell::GetErrorCode() const
sal_uInt32 lError=pImp->lErr;
if(!lError && GetMedium())
lError=GetMedium()->GetErrorCode();
-//REMOVE if(!lError && HasStorage())
-//REMOVE lError= GetStorage()->GetErrorCode();
return lError;
}
@@ -301,9 +302,6 @@ void SfxObjectShell::ResetError()
SfxMedium * pMed = GetMedium();
if( pMed )
pMed->ResetError();
-//REMOVE SvStorage *pStor= HasStorage() ? GetStorage() : 0;
-//REMOVE if( pStor )
-//REMOVE pStor->ResetError();
}
//-------------------------------------------------------------------------
@@ -425,7 +423,7 @@ void SfxObjectShell::ModifyChanged()
Invalidate( SID_MACRO_SIGNATURE );
Broadcast( SfxSimpleHint( SFX_HINT_TITLECHANGED ) ); // xmlsec05, signed state might change in title...
- SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_MODIFYCHANGED, this ) );
+ SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_MODIFYCHANGED, GlobalEventConfig::GetEventName(STR_EVENT_MODIFYCHANGED), this ) );
}
//-------------------------------------------------------------------------
@@ -1139,8 +1137,10 @@ void SfxObjectShell::PostActivateEvent_Impl( SfxViewFrame* pFrame )
{
sal_uInt16 nId = pImp->nEventId;
pImp->nEventId = 0;
- if ( nId )
- pSfxApp->NotifyEvent(SfxEventHint( nId, this ), sal_False);
+ if ( nId == SFX_EVENT_OPENDOC )
+ pSfxApp->NotifyEvent(SfxEventHint( nId, GlobalEventConfig::GetEventName(STR_EVENT_OPENDOC), this ), sal_False);
+ else if (nId == SFX_EVENT_CREATEDOC )
+ pSfxApp->NotifyEvent(SfxEventHint( nId, GlobalEventConfig::GetEventName(STR_EVENT_CREATEDOC), this ), sal_False);
}
}
}
@@ -1234,10 +1234,52 @@ void SfxObjectShell::CheckSecurityOnLoading_Impl()
if ( GetMedium() )
xInteraction = GetMedium()->GetInteractionHandler();
- // check macro security
- pImp->aMacroMode.checkMacrosOnLoading( xInteraction );
// check if there is a broken signature...
CheckForBrokenDocSignatures_Impl( xInteraction );
+
+ CheckEncryption_Impl( xInteraction );
+
+ // check macro security
+ pImp->aMacroMode.checkMacrosOnLoading( xInteraction );
+}
+
+//-------------------------------------------------------------------------
+void SfxObjectShell::CheckEncryption_Impl( const uno::Reference< task::XInteractionHandler >& xHandler )
+{
+ ::rtl::OUString aVersion;
+ sal_Bool bIsEncrypted = sal_False;
+ sal_Bool bHasNonEncrypted = sal_False;
+
+ try
+ {
+ uno::Reference < beans::XPropertySet > xPropSet( GetStorage(), uno::UNO_QUERY_THROW );
+ xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ) ) >>= aVersion;
+ xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasEncryptedEntries" ) ) ) >>= bIsEncrypted;
+ xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasNonEncryptedEntries" ) ) ) >>= bHasNonEncrypted;
+ }
+ catch( uno::Exception& )
+ {
+ }
+
+ if ( aVersion.compareTo( ODFVER_012_TEXT ) >= 0 )
+ {
+ // this is ODF1.2 or later
+ if ( bIsEncrypted && bHasNonEncrypted )
+ {
+ if ( !pImp->m_bIncomplEncrWarnShown )
+ {
+ // this is an encrypted document with nonencrypted streams inside, show the warning
+ ::com::sun::star::task::ErrorCodeRequest aErrorCode;
+ aErrorCode.ErrCode = ERRCODE_SFX_INCOMPLETE_ENCRYPTION;
+
+ SfxMedium::CallApproveHandler( xHandler, uno::makeAny( aErrorCode ), sal_False );
+ pImp->m_bIncomplEncrWarnShown = sal_True;
+ }
+
+ // broken signatures imply no macro execution at all
+ pImp->aMacroMode.disallowMacroExecution();
+ }
+ }
}
//-------------------------------------------------------------------------
@@ -1392,7 +1434,7 @@ void SfxObjectShell::FinishedLoading( sal_uInt16 nFlags )
}
pImp->bInitialized = sal_True;
- SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, this ) );
+ SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, GlobalEventConfig::GetEventName(STR_EVENT_LOADFINISHED), this ) );
// Title is not available until loading has finished
Broadcast( SfxSimpleHint( SFX_HINT_TITLECHANGED ) );
@@ -1476,7 +1518,7 @@ void SfxObjectShell::TemplateDisconnectionAfterLoad()
{
// some further initializations for templates
SetTemplate_Impl( aName, aTemplateName, this );
- pTmpMedium->CreateTempFile();
+ pTmpMedium->CreateTempFile( sal_True );
}
// templates are never readonly
@@ -2086,14 +2128,16 @@ void SfxObjectShell::Invalidate( USHORT nId )
Invalidate_Impl( pFrame->GetBindings(), nId );
}
-bool SfxObjectShell::AdjustMacroMode( const String& /*rScriptType*/, bool _bSuppressUI )
+bool SfxObjectShell::AdjustMacroMode( const String& /*rScriptType*/, bool bSuppressUI )
{
uno::Reference< task::XInteractionHandler > xInteraction;
- if ( pMedium && !_bSuppressUI )
+ if ( pMedium && !bSuppressUI )
xInteraction = pMedium->GetInteractionHandler();
CheckForBrokenDocSignatures_Impl( xInteraction );
+ CheckEncryption_Impl( xInteraction );
+
return pImp->aMacroMode.adjustMacroMode( xInteraction );
}
@@ -2325,16 +2369,15 @@ sal_Bool SfxObjectShell_Impl::setCurrentMacroExecMode( sal_uInt16 nMacroMode )
return sLocation;
}
-uno::Reference< embed::XStorage > SfxObjectShell_Impl::getLastCommitDocumentStorage()
+uno::Reference< embed::XStorage > SfxObjectShell_Impl::getZipStorageToSign()
{
Reference < embed::XStorage > xStore;
SfxMedium* pMedium( rDocShell.GetMedium() );
OSL_PRECOND( pMedium, "SfxObjectShell_Impl::getLastCommitDocumentStorage: no medium!" );
if ( pMedium )
- {
- xStore = pMedium->GetLastCommitReadStorage_Impl();
- }
+ xStore = pMedium->GetZipStorageToSign_Impl();
+
return xStore;
}
@@ -2348,7 +2391,7 @@ Reference< XEmbeddedScripts > SfxObjectShell_Impl::getEmbeddedDocumentScripts()
return Reference< XEmbeddedScripts >( rDocShell.GetModel(), UNO_QUERY );
}
-sal_Int16 SfxObjectShell_Impl::getScriptingSignatureState() const
+sal_Int16 SfxObjectShell_Impl::getScriptingSignatureState()
{
sal_Int16 nSignatureState( rDocShell.GetScriptingSignatureState() );
@@ -2361,6 +2404,72 @@ sal_Int16 SfxObjectShell_Impl::getScriptingSignatureState() const
return nSignatureState;
}
+sal_Bool SfxObjectShell_Impl::hasTrustedScriptingSignature( sal_Bool bAllowUIToAddAuthor )
+{
+ sal_Bool bResult = sal_False;
+
+ try
+ {
+ ::rtl::OUString aVersion;
+ try
+ {
+ uno::Reference < beans::XPropertySet > xPropSet( rDocShell.GetStorage(), uno::UNO_QUERY_THROW );
+ xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ) ) >>= aVersion;
+ }
+ catch( uno::Exception& )
+ {
+ }
+ uno::Sequence< uno::Any > aArgs( 1 );
+ aArgs[0] <<= aVersion;
+
+ uno::Reference< security::XDocumentDigitalSignatures > xSigner( comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ), aArgs ), uno::UNO_QUERY_THROW );
+
+ if ( nScriptingSignatureState == SIGNATURESTATE_UNKNOWN
+ || nScriptingSignatureState == SIGNATURESTATE_SIGNATURES_OK
+ || nScriptingSignatureState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED )
+ {
+ uno::Sequence< security::DocumentSignatureInformation > aInfo = rDocShell.ImplAnalyzeSignature( sal_True, xSigner );
+
+ if ( aInfo.getLength() )
+ {
+ if ( nScriptingSignatureState == SIGNATURESTATE_UNKNOWN )
+ nScriptingSignatureState = rDocShell.ImplCheckSignaturesInformation( aInfo );
+
+ if ( nScriptingSignatureState == SIGNATURESTATE_SIGNATURES_OK
+ || nScriptingSignatureState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED )
+ {
+ for ( sal_Int32 nInd = 0; !bResult && nInd < aInfo.getLength(); nInd++ )
+ {
+ bResult = xSigner->isAuthorTrusted( aInfo[nInd].Signer );
+ }
+
+ if ( !bResult && bAllowUIToAddAuthor )
+ {
+ uno::Reference< task::XInteractionHandler > xInteraction;
+ if ( rDocShell.GetMedium() )
+ xInteraction = rDocShell.GetMedium()->GetInteractionHandler();
+
+ if ( xInteraction.is() )
+ {
+ task::DocumentMacroConfirmationRequest2 aRequest;
+ aRequest.DocumentURL = getDocumentLocation();
+ aRequest.DocumentZipStorage = rDocShell.GetMedium()->GetZipStorageToSign_Impl();
+ aRequest.DocumentSignatureInformation = aInfo;
+ aRequest.DocumentVersion = aVersion;
+ aRequest.Classification = task::InteractionClassification_QUERY;
+ bResult = SfxMedium::CallApproveHandler( xInteraction, uno::makeAny( aRequest ), sal_True );
+ }
+ }
+ }
+ }
+ }
+ }
+ catch( uno::Exception& )
+ {}
+
+ return bResult;
+}
+
void SfxObjectShell_Impl::showBrokenSignatureWarning( const uno::Reference< task::XInteractionHandler >& _rxInteraction ) const
{
if ( !bSignatureErrorIsShown )
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index a47fc1bf4747..8a8512a37af0 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -525,16 +525,6 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
{
SfxErrorContext aEc( ERRCTX_SFX_SAVEASDOC, GetTitle() ); // ???
- // xmlsec05, check with SFX team
- sal_uInt16 nState = GetDocumentSignatureState();
- if ( SIGNATURESTATE_SIGNATURES_OK == nState
- || SIGNATURESTATE_SIGNATURES_INVALID == nState
- || SIGNATURESTATE_SIGNATURES_NOTVALIDATED == nState )
- {
- if ( QueryBox( NULL, SfxResId( RID_XMLSEC_QUERY_LOSINGSIGNATURE ) ).Execute() != RET_YES )
- return;
- }
-
if ( nId == SID_SAVEASDOC )
{
// in case of plugin mode the SaveAs operation means SaveTo
@@ -644,7 +634,8 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
::rtl::OUString::createFromAscii( pSlot->GetUnoName() ),
aDispatchArgs,
bPreselectPassword,
- GetSharedFileURL() );
+ GetSharedFileURL(),
+ GetDocumentSignatureState() );
}
else
{
@@ -654,11 +645,6 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
ERRCODE_IO_ABORT );
}
- // the scripting signature might be preserved
- // pImp->nScriptingSignatureState = SIGNATURESTATE_NOSIGNATURES;
- pImp->nDocumentSignatureState = SIGNATURESTATE_NOSIGNATURES;
- pImp->bSignatureErrorIsShown = sal_False;
-
// merge aDispatchArgs to the request
SfxAllItemSet aResultParams( GetPool() );
TransformParameters( nId,
@@ -1085,7 +1071,11 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
}
case SID_MACRO_SIGNATURE:
{
- rSet.Put( SfxUInt16Item( SID_MACRO_SIGNATURE, GetScriptingSignatureState() ) );
+ // the slot makes sense only if there is a macro in the document
+ if ( pImp->documentStorageHasMacros() || pImp->aMacroMode.hasMacroLibrary() )
+ rSet.Put( SfxUInt16Item( SID_MACRO_SIGNATURE, GetScriptingSignatureState() ) );
+ else
+ rSet.DisableItem( nWhich );
break;
}
}
@@ -1269,6 +1259,7 @@ sal_uInt16 SfxObjectShell::ImplCheckSignaturesInformation( const uno::Sequence<
sal_Bool bCertValid = sal_True;
sal_uInt16 nResult = SIGNATURESTATE_NOSIGNATURES;
int nInfos = aInfos.getLength();
+ bool bCompleteSignature = true;
if( nInfos )
{
//These errors of certificates are allowed
@@ -1293,11 +1284,14 @@ sal_uInt16 SfxObjectShell::ImplCheckSignaturesInformation( const uno::Sequence<
nResult = SIGNATURESTATE_SIGNATURES_BROKEN;
break; // we know enough
}
+ bCompleteSignature &= !aInfos[n].PartialDocumentSignature;
}
}
if ( nResult == SIGNATURESTATE_SIGNATURES_OK && !bCertValid )
nResult = SIGNATURESTATE_SIGNATURES_NOTVALIDATED;
+ else if ( nResult == SIGNATURESTATE_SIGNATURES_OK && bCertValid && !bCompleteSignature)
+ nResult = SIGNATURESTATE_SIGNATURES_PARTIAL_OK;
// this code must not check whether the document is modified
// it should only check the provided info
@@ -1305,41 +1299,61 @@ sal_uInt16 SfxObjectShell::ImplCheckSignaturesInformation( const uno::Sequence<
return nResult;
}
-sal_uInt16 SfxObjectShell::ImplGetSignatureState( sal_Bool bScriptingContent )
+uno::Sequence< security::DocumentSignatureInformation > SfxObjectShell::ImplAnalyzeSignature( sal_Bool bScriptingContent, const uno::Reference< security::XDocumentDigitalSignatures >& xSigner )
{
- sal_Int16* pState = bScriptingContent ? &pImp->nScriptingSignatureState : &pImp->nDocumentSignatureState;
+ uno::Sequence< security::DocumentSignatureInformation > aResult;
+ uno::Reference< security::XDocumentDigitalSignatures > xLocSigner = xSigner;
- if ( *pState == SIGNATURESTATE_UNKNOWN )
+ if ( GetMedium() && GetMedium()->GetName().Len() && IsOwnStorageFormat_Impl( *GetMedium()) && GetMedium()->GetStorage().is() )
{
- *pState = SIGNATURESTATE_NOSIGNATURES;
-
- if ( GetMedium() && GetMedium()->GetName().Len() && IsOwnStorageFormat_Impl( *GetMedium()) && GetMedium()->GetStorage().is() )
+ try
{
- try
+ if ( !xLocSigner.is() )
{
- uno::Reference< security::XDocumentDigitalSignatures > xD(
- comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ) ), uno::UNO_QUERY );
-
- if ( xD.is() )
+ uno::Sequence< uno::Any > aArgs( 1 );
+ aArgs[0] <<= ::rtl::OUString();
+ try
{
- ::com::sun::star::uno::Sequence< security::DocumentSignatureInformation > aInfos;
- if ( bScriptingContent )
- aInfos = xD->verifyScriptingContentSignatures( GetMedium()->GetLastCommitReadStorage_Impl(),
- uno::Reference< io::XInputStream >() );
- else
- aInfos = xD->verifyDocumentContentSignatures( GetMedium()->GetLastCommitReadStorage_Impl(),
- uno::Reference< io::XInputStream >() );
-
- *pState = ImplCheckSignaturesInformation( aInfos );
+ uno::Reference < beans::XPropertySet > xPropSet( GetStorage(), uno::UNO_QUERY_THROW );
+ aArgs[0] = xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ) );
}
+ catch( uno::Exception& )
+ {
+ }
+
+ xLocSigner.set( comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ), aArgs ), uno::UNO_QUERY_THROW );
+
}
- catch( com::sun::star::uno::Exception& )
- {
- }
+
+ if ( bScriptingContent )
+ aResult = xLocSigner->verifyScriptingContentSignatures( GetMedium()->GetZipStorageToSign_Impl(),
+ uno::Reference< io::XInputStream >() );
+ else
+ aResult = xLocSigner->verifyDocumentContentSignatures( GetMedium()->GetZipStorageToSign_Impl(),
+ uno::Reference< io::XInputStream >() );
+ }
+ catch( com::sun::star::uno::Exception& )
+ {
}
}
- if ( *pState == SIGNATURESTATE_SIGNATURES_OK || *pState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED )
+ return aResult;
+}
+
+sal_uInt16 SfxObjectShell::ImplGetSignatureState( sal_Bool bScriptingContent )
+{
+ sal_Int16* pState = bScriptingContent ? &pImp->nScriptingSignatureState : &pImp->nDocumentSignatureState;
+
+ if ( *pState == SIGNATURESTATE_UNKNOWN )
+ {
+ *pState = SIGNATURESTATE_NOSIGNATURES;
+
+ uno::Sequence< security::DocumentSignatureInformation > aInfos = ImplAnalyzeSignature( bScriptingContent );
+ *pState = ImplCheckSignaturesInformation( aInfos );
+ }
+
+ if ( *pState == SIGNATURESTATE_SIGNATURES_OK || *pState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED
+ || *pState == SIGNATURESTATE_SIGNATURES_PARTIAL_OK)
{
if ( IsModified() )
*pState = SIGNATURESTATE_SIGNATURES_INVALID;
@@ -1386,7 +1400,7 @@ void SfxObjectShell::ImplSign( sal_Bool bScriptingContent )
{
// the document might need saving ( new, modified or in ODF1.1 format without signature )
- if ( nVersion == SvtSaveOptions::ODFVER_012 )
+ if ( nVersion >= SvtSaveOptions::ODFVER_012 )
{
if ( (bHasSign && QueryBox( NULL, SfxResId( MSG_XMLSEC_QUERY_SAVESIGNEDBEFORESIGN ) ).Execute() == RET_YES)
@@ -1415,7 +1429,6 @@ void SfxObjectShell::ImplSign( sal_Bool bScriptingContent )
//When the document is modified then we must not show the digital signatures dialog
//If we have come here then the user denied to save.
if (!bHasSign)
-
bNoSig = true;
}
}
@@ -1437,18 +1450,42 @@ void SfxObjectShell::ImplSign( sal_Bool bScriptingContent )
bAllowModifiedBack = sal_True;
}
- if ( ! bNoSig && GetMedium()->SignContents_Impl( bScriptingContent ) )
+ // we have to store to the original document, the original medium should be closed for this time
+ if ( !bNoSig
+ && ConnectTmpStorage_Impl( pMedium->GetStorage(), pMedium ) )
{
- if ( bScriptingContent )
- pImp->nScriptingSignatureState = SIGNATURESTATE_UNKNOWN;// Re-Check
- else
- pImp->nDocumentSignatureState = SIGNATURESTATE_UNKNOWN;// Re-Check
+ GetMedium()->CloseAndRelease();
+
+ // We sign only ODF1.2, that means that if this point has been reached,
+ // the ODF1.2 signing process should be used.
+ // This code still might be called to show the signature of ODF1.1 document.
+ sal_Bool bSigned = GetMedium()->SignContents_Impl(
+ bScriptingContent,
+ aODFVersion,
+ pImp->nDocumentSignatureState == SIGNATURESTATE_SIGNATURES_OK
+ || pImp->nDocumentSignatureState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED
+ || pImp->nDocumentSignatureState == SIGNATURESTATE_SIGNATURES_PARTIAL_OK);
+
+ DoSaveCompleted( GetMedium() );
+
+ if ( bSigned )
+ {
+ if ( bScriptingContent )
+ {
+ pImp->nScriptingSignatureState = SIGNATURESTATE_UNKNOWN;// Re-Check
+
+ // adding of scripting signature removes existing document signature
+ pImp->nDocumentSignatureState = SIGNATURESTATE_UNKNOWN;// Re-Check
+ }
+ else
+ pImp->nDocumentSignatureState = SIGNATURESTATE_UNKNOWN;// Re-Check
- pImp->bSignatureErrorIsShown = sal_False;
+ pImp->bSignatureErrorIsShown = sal_False;
- Invalidate( SID_SIGNATURE );
- Invalidate( SID_MACRO_SIGNATURE );
- Broadcast( SfxSimpleHint(SFX_HINT_TITLECHANGED) );
+ Invalidate( SID_SIGNATURE );
+ Invalidate( SID_MACRO_SIGNATURE );
+ Broadcast( SfxSimpleHint(SFX_HINT_TITLECHANGED) );
+ }
}
if ( bAllowModifiedBack )
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 89f2fe74e2f9..cd73a92196d7 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -36,6 +36,7 @@
#endif
#include <svtools/eitem.hxx>
#include <svtools/stritem.hxx>
+#include <svtools/intitem.hxx>
#include <tools/zcodec.hxx>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/frame/XModel.hpp>
@@ -136,6 +137,12 @@
#include "appbaslib.hxx"
#include "appdata.hxx"
+#ifdef OS2
+#include <osl/file.hxx>
+#include <stdio.h>
+#include <sys/ea.h>
+#endif
+
#include "../appl/app.hrc"
extern sal_uInt32 CheckPasswd_Impl( SfxObjectShell*, SfxItemPool&, SfxMedium* );
@@ -364,7 +371,7 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto
SvtSaveOptions::ODFDefaultVersion nDefVersion = aSaveOpt.GetODFDefaultVersion();
// older versions can not have this property set, it exists only starting from ODF1.2
- if ( nDefVersion == SvtSaveOptions::ODFVER_012 )
+ if ( nDefVersion >= SvtSaveOptions::ODFVER_012 )
aVersion = ODFVER_012_TEXT;
if ( aVersion.getLength() )
@@ -515,7 +522,7 @@ sal_Bool SfxObjectShell::DoInitNew( SfxMedium* pMed )
pImp->bInitialized = sal_True;
SetActivateEvent_Impl( SFX_EVENT_CREATEDOC );
- SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_DOCCREATED, this ) );
+ SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_DOCCREATED, GlobalEventConfig::GetEventName(STR_EVENT_DOCCREATED), this ) );
return sal_True;
}
@@ -659,11 +666,14 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
xStorProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaTypeFallbackUsed" ) ) )
>>= bWarnMediaTypeFallback;
- if ( bWarnMediaTypeFallback && pRepairPackageItem && pRepairPackageItem->GetValue() )
+ if ( pRepairPackageItem && pRepairPackageItem->GetValue() )
{
+ // the macros in repaired documents should be disabled
+ pMedium->GetItemSet()->Put( SfxUInt16Item( SID_MACROEXECMODE, document::MacroExecMode::NEVER_EXECUTE ) );
+
// the mediatype was retrieved by using fallback solution but this is a repairing mode
// so it is acceptable to open the document if there is no contents that required manifest.xml
- bWarnMediaTypeFallback = sal_False; //!NoDependencyFromManifest_Impl( xStorage );
+ bWarnMediaTypeFallback = sal_False;
}
if ( bWarnMediaTypeFallback || !xStorage->getElementNames().getLength() )
@@ -1169,7 +1179,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
sal_Bool bStoreToSameLocation = sal_False;
// the detection whether the script is changed should be done before saving
- sal_Bool bTryToPreservScriptSignature = sal_False;
+ sal_Bool bTryToPreserveScriptSignature = sal_False;
// no way to detect whether a filter is oasis format, have to wait for saving process
sal_Bool bNoPreserveForOasis = sal_False;
if ( bOwnSource && bOwnTarget
@@ -1180,8 +1190,10 @@ sal_Bool SfxObjectShell::SaveTo_Impl
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "MacroSignaturePreserving" ) ) );
// the checking of the library modified state iterates over the libraries, should be done only when required
- bTryToPreservScriptSignature = !pImp->pBasicManager->isAnyContainerModified();
- if ( bTryToPreservScriptSignature )
+ // currently the check is commented out since it is broken, we have to check the signature every time we save
+ // TODO/LATER: let isAnyContainerModified() work!
+ bTryToPreserveScriptSignature = sal_True; // !pImp->pBasicManager->isAnyContainerModified();
+ if ( bTryToPreserveScriptSignature )
{
// check that the storage format stays the same
SvtSaveOptions aSaveOpt;
@@ -1197,11 +1209,11 @@ sal_Bool SfxObjectShell::SaveTo_Impl
{}
// preserve only if the same filter has been used
- bTryToPreservScriptSignature = pMedium->GetFilter() && pFilter && pMedium->GetFilter()->GetFilterName() == pFilter->GetFilterName();
+ bTryToPreserveScriptSignature = pMedium->GetFilter() && pFilter && pMedium->GetFilter()->GetFilterName() == pFilter->GetFilterName();
bNoPreserveForOasis = (
(aODFVersion.equals( ODFVER_012_TEXT ) && nVersion == SvtSaveOptions::ODFVER_011) ||
- (!aODFVersion.getLength() && nVersion == SvtSaveOptions::ODFVER_012)
+ (!aODFVersion.getLength() && nVersion >= SvtSaveOptions::ODFVER_012)
);
}
}
@@ -1467,9 +1479,10 @@ sal_Bool SfxObjectShell::SaveTo_Impl
}
- if ( bOk && GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
+ if ( bOk && GetCreateMode() != SFX_CREATE_MODE_EMBEDDED && !bPasswdProvided )
{
// store the thumbnail representation image
+ // the thumbnail is not stored in case of encrypted document
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Thumbnail creation." ) ) );
if ( !GenerateAndStoreThumbnail( bPasswdProvided,
sal_False,
@@ -1588,120 +1601,115 @@ sal_Bool SfxObjectShell::SaveTo_Impl
bOk = SaveChildren( TRUE );
}
- // if ODF version of oasis format changes on saving the signature should not be preserved
- if ( bOk && bTryToPreservScriptSignature && bNoPreserveForOasis )
- bTryToPreservScriptSignature = ( SotStorage::GetVersion( rMedium.GetStorage() ) == SOFFICE_FILEFORMAT_60 );
-
- uno::Reference< security::XDocumentDigitalSignatures > xDDSigns;
- sal_Bool bScriptSignatureIsCopied = sal_False;
- if ( bOk && bTryToPreservScriptSignature )
+ if ( bOk )
{
- // if the scripting code was not changed and it is signed the signature should be preserved
- // unfortunately at this point we have only information whether the basic code has changed or not
- // so the only way is to check the signature if the basic was not changed
- try
- {
- xDDSigns = uno::Reference< security::XDocumentDigitalSignatures >(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ) ),
- uno::UNO_QUERY_THROW );
+ // if ODF version of oasis format changes on saving the signature should not be preserved
+ if ( bOk && bTryToPreserveScriptSignature && bNoPreserveForOasis )
+ bTryToPreserveScriptSignature = ( SotStorage::GetVersion( rMedium.GetStorage() ) == SOFFICE_FILEFORMAT_60 );
- ::rtl::OUString aScriptSignName = xDDSigns->getScriptingContentSignatureDefaultStreamName();
+ uno::Reference< security::XDocumentDigitalSignatures > xDDSigns;
+ if ( bOk && bTryToPreserveScriptSignature )
+ {
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Copying scripting signature." ) ) );
- if ( aScriptSignName.getLength() )
+ // if the scripting code was not changed and it is signed the signature should be preserved
+ // unfortunately at this point we have only information whether the basic code has changed or not
+ // so the only way is to check the signature if the basic was not changed
+ try
{
- uno::Reference< embed::XStorage > xMetaInf = GetStorage()->openStorageElement(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "META-INF" ) ),
- embed::ElementModes::READ );
- uno::Reference< embed::XStorage > xTargetMetaInf = rMedium.GetStorage()->openStorageElement(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "META-INF" ) ),
- embed::ElementModes::WRITE );
-
- if ( xMetaInf.is() && xTargetMetaInf.is() )
+ // get the ODF version of the new medium
+ uno::Sequence< uno::Any > aArgs( 1 );
+ aArgs[0] <<= ::rtl::OUString();
+ try
+ {
+ uno::Reference < beans::XPropertySet > xPropSet( rMedium.GetStorage(), uno::UNO_QUERY_THROW );
+ aArgs[0] = xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ) );
+ }
+ catch( uno::Exception& )
{
- xMetaInf->copyElementTo( aScriptSignName, xTargetMetaInf, aScriptSignName );
-
- // after loading the UseCommonStoragePassword property might be set to true
- // set it to false here, since this is a rare case when it must be so
- // TODO/LATER: in future it should be done on loading probably
- uno::Reference< beans::XPropertySet > xTargetSignPropSet(
- xTargetMetaInf->openStreamElement( aScriptSignName, embed::ElementModes::WRITE ),
- uno::UNO_QUERY_THROW );
- xTargetSignPropSet->setPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseCommonStoragePasswordEncryption" ) ),
- uno::makeAny( (sal_Bool)sal_False ) );
-
- uno::Reference< embed::XTransactedObject > xTransact( xTargetMetaInf, uno::UNO_QUERY );
- if ( xTransact.is() )
- xTransact->commit();
- bScriptSignatureIsCopied = sal_True;
}
- }
- }
- catch( uno::Exception& )
- {
- }
- }
-
- if ( bOk )
- {
- AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Medium commit." ) ) );
- // transfer data to its destinated location
- // the medium commits the storage or the stream it is based on
- RegisterTransfer( rMedium );
- bOk = rMedium.Commit();
+ xDDSigns = uno::Reference< security::XDocumentDigitalSignatures >(
+ comphelper::getProcessServiceFactory()->createInstanceWithArguments(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ),
+ aArgs ),
+ uno::UNO_QUERY_THROW );
- if ( bOk && bScriptSignatureIsCopied )
- {
- AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Script signature check." ) ) );
+ ::rtl::OUString aScriptSignName = xDDSigns->getScriptingContentSignatureDefaultStreamName();
- // if the script signature was copied it should be checked now
- // usually it should be ok, so no additional actions will be done
- // but if for any reasong ( f.e. binshell change ) it is broken it should be removed here
- // in result the behaviour will work in optimized way in most cases, means in case of signed basic scripts
- OSL_ENSURE( !bScriptSignatureIsCopied || xDDSigns.is(), "The signing could not be done without the service!\n" );
- if ( xDDSigns.is() )
- {
- try
+ if ( aScriptSignName.getLength() )
{
- bOk = sal_False;
- ::com::sun::star::uno::Sequence< security::DocumentSignatureInformation > aInfos =
- xDDSigns->verifyScriptingContentSignatures( rMedium.GetLastCommitReadStorage_Impl(),
- uno::Reference< io::XInputStream >() );
- sal_uInt16 nState = ImplCheckSignaturesInformation( aInfos );
- if ( nState == SIGNATURESTATE_SIGNATURES_OK || nState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED )
- {
- rMedium.SetCachedSignatureState_Impl( nState );
- bOk = sal_True;
- }
- else
+ pMedium->Close();
+
+ // target medium is still not commited, it should not be closed
+ // commit the package storage and close it, but leave the streams open
+ rMedium.StorageCommit_Impl();
+ rMedium.CloseStorage();
+
+ uno::Reference< embed::XStorage > xReadOrig = pMedium->GetZipStorageToSign_Impl();
+ if ( !xReadOrig.is() )
+ throw uno::RuntimeException();
+ uno::Reference< embed::XStorage > xMetaInf = xReadOrig->openStorageElement(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "META-INF" ) ),
+ embed::ElementModes::READ );
+
+ uno::Reference< embed::XStorage > xTarget = rMedium.GetZipStorageToSign_Impl( sal_False );
+ if ( !xTarget.is() )
+ throw uno::RuntimeException();
+ uno::Reference< embed::XStorage > xTargetMetaInf = xTarget->openStorageElement(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "META-INF" ) ),
+ embed::ElementModes::READWRITE );
+
+ if ( xMetaInf.is() && xTargetMetaInf.is() )
{
- // the signature is broken, remove it
- rMedium.SetCachedSignatureState_Impl( SIGNATURESTATE_NOSIGNATURES );
- uno::Reference< embed::XStorage > xTargetMetaInf = rMedium.GetStorage()->openStorageElement(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "META-INF" ) ),
- embed::ElementModes::WRITE );
+ xMetaInf->copyElementTo( aScriptSignName, xTargetMetaInf, aScriptSignName );
+
+ uno::Reference< embed::XTransactedObject > xTransact( xTargetMetaInf, uno::UNO_QUERY );
+ if ( xTransact.is() )
+ xTransact->commit();
+
+ xTargetMetaInf->dispose();
- if ( xTargetMetaInf.is() )
+ // now check the copied signature
+ uno::Sequence< security::DocumentSignatureInformation > aInfos =
+ xDDSigns->verifyScriptingContentSignatures( xTarget,
+ uno::Reference< io::XInputStream >() );
+ sal_uInt16 nState = ImplCheckSignaturesInformation( aInfos );
+ if ( nState == SIGNATURESTATE_SIGNATURES_OK || nState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED
+ || nState == SIGNATURESTATE_SIGNATURES_PARTIAL_OK)
{
- xTargetMetaInf->removeElement( xDDSigns->getScriptingContentSignatureDefaultStreamName() );
- uno::Reference< embed::XTransactedObject > xTransact( xTargetMetaInf, uno::UNO_QUERY );
+ rMedium.SetCachedSignatureState_Impl( nState );
+
+ // commit the ZipStorage from target medium
+ xTransact.set( xTarget, uno::UNO_QUERY );
if ( xTransact.is() )
xTransact->commit();
-
- bOk = rMedium.Commit();
+ }
+ else
+ {
+ // it should not happen, the copies signature is invalid!
+ // throw the changes away
+ OSL_ASSERT( "An invalid signature was copied!" );
}
}
}
- catch( uno::Exception )
- {
- OSL_ENSURE( sal_False, "This exception must not happen!" );
- }
}
+ catch( uno::Exception& )
+ {
+ }
+
+ pMedium->Close();
+ rMedium.CloseZipStorage_Impl();
}
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Medium commit." ) ) );
+
+ // transfer data to its destinated location
+ // the medium commits the storage or the stream it is based on
+ RegisterTransfer( rMedium );
+ bOk = rMedium.Commit();
+
if ( bOk )
{
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing is successful." ) ) );
@@ -1784,6 +1792,66 @@ sal_Bool SfxObjectShell::SaveTo_Impl
catch( Exception& )
{
}
+
+#ifdef OS2
+ {
+#define CHAR_POINTER(THE_OUSTRING) ::rtl::OUStringToOString (THE_OUSTRING, RTL_TEXTENCODING_UTF8).pData->buffer
+ // Header for a single-valued ASCII EA data item
+ typedef struct _EA_ASCII_header {
+ USHORT usAttr; /* value: EAT_ASCII */
+ USHORT usLen; /* length of data */
+ CHAR szType[_MAX_PATH]; /* ASCII data fits in here ... */
+ } EA_ASCII_HEADER;
+ char filePath[_MAX_PATH];
+ char fileExt[_MAX_PATH];
+ char docType[_MAX_PATH];
+ int rc;
+ oslFileError eRet;
+ ::rtl::OUString aSystemFileURL;
+ const ::rtl::OUString aFileURL = rMedium.GetName();
+ // close medium
+ rMedium.Close();
+
+ // convert file URL to system path
+ if (osl::FileBase::getSystemPathFromFileURL( aFileURL, aSystemFileURL) == osl::FileBase::E_None) {
+ EA_ASCII_HEADER eaAscii;
+ struct _ea eaType;
+ strcpy( filePath, CHAR_POINTER( aSystemFileURL));
+ strcpy( docType, CHAR_POINTER( rMedium.GetFilter()->GetServiceName()));
+#if OSL_DEBUG_LEVEL>1
+ printf( "file name: %s\n", filePath);
+ printf( "filter name: %s\n", CHAR_POINTER(rMedium.GetFilter()->GetFilterName()));
+ printf( "service name: %s\n", docType);
+#endif
+ // initialize OS/2 EA data structure
+ eaAscii.usAttr = EAT_ASCII;
+ _splitpath ( filePath, NULL, NULL, NULL, fileExt);
+ if (!stricmp( fileExt, ".pdf"))
+ strcpy( eaAscii.szType, "Acrobat Document");
+ else if (!strcmp( docType, "com.sun.star.text.TextDocument"))
+ strcpy( eaAscii.szType, "OpenOfficeOrg Writer Document");
+ else if (!strcmp( docType, "com.sun.star.sheet.SpreadsheetDocument"))
+ strcpy( eaAscii.szType, "OpenOfficeOrg Calc Document");
+ else if (!strcmp( docType, "com.sun.star.presentation.PresentationDocument"))
+ strcpy( eaAscii.szType, "OpenOfficeOrg Impress Document");
+ else if (!strcmp( docType, "com.sun.star.drawing.DrawingDocument"))
+ strcpy( eaAscii.szType, "OpenOfficeOrg Draw Document");
+ else
+ strcpy( eaAscii.szType, "OpenOfficeOrg Document");
+ eaAscii.usLen = strlen( eaAscii.szType);
+ // fill libc EA data structure
+ eaType.flags = 0;
+ eaType.size = sizeof(USHORT)*2 + eaAscii.usLen;
+ eaType.value = &eaAscii;
+ // put EA to file
+ rc = _ea_put( &eaType, filePath, 0, ".TYPE");
+#if OSL_DEBUG_LEVEL>1
+ printf( "ea name: %s, rc %d, errno %d\n", eaAscii.szType, rc, errno);
+#endif
+ }
+ }
+#endif
+
}
return bOk;
@@ -3189,7 +3257,7 @@ uno::Reference< embed::XStorage > SfxObjectShell::GetStorage()
SetupStorage( pImp->m_xDocStorage, SOFFICE_FILEFORMAT_CURRENT, sal_False );
pImp->m_bCreateTempStor = sal_False;
- SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_STORAGECHANGED, this ) );
+ SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_STORAGECHANGED, GlobalEventConfig::GetEventName(STR_EVENT_STORAGECHANGED), this ) );
}
catch( uno::Exception& )
{
@@ -3349,7 +3417,7 @@ sal_Bool SfxObjectShell::SaveCompleted( const uno::Reference< embed::XStorage >&
if ( bSendNotification )
{
- SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_STORAGECHANGED, this ) );
+ SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_STORAGECHANGED, GlobalEventConfig::GetEventName(STR_EVENT_STORAGECHANGED), this ) );
}
return bResult;
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 3edf1ddb60d7..950ecf9ea239 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -61,6 +61,7 @@
#include <basic/sbstar.hxx>
#include <svtools/stritem.hxx>
#include <basic/sbx.hxx>
+#include <svtools/eventcfg.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/signaturestate.hxx>
@@ -138,47 +139,6 @@ static WeakReference< XInterface > s_xCurrentComponent;
//=========================================================================
-/** This Listener is used to get notified when the XDocumentProperties of the
- XModel change.
- If several changes are done the "bQuiet" member can be used to
- temporarily suppress notifications.
- */
-class SfxDocInfoListener_Impl : public ::cppu::WeakImplHelper1<
- ::com::sun::star::util::XModifyListener >
-{
-
-public:
- SfxObjectShell& m_rShell;
- bool bQuiet;
- bool bGotModified;
-
- SfxDocInfoListener_Impl( SfxObjectShell& i_rDoc )
- : m_rShell(i_rDoc)
- , bQuiet(false)
- { };
-
- virtual void SAL_CALL disposing( const lang::EventObject& )
- throw ( uno::RuntimeException );
- virtual void SAL_CALL modified( const lang::EventObject& )
- throw ( uno::RuntimeException );
-};
-
-void SAL_CALL SfxDocInfoListener_Impl::modified( const lang::EventObject& )
- throw ( uno::RuntimeException )
-{
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
- bGotModified = true;
-
- // notify changes to the SfxObjectShell
- if ( !bQuiet ) {
- m_rShell.FlushDocInfo();
- }
-}
-
-void SAL_CALL SfxDocInfoListener_Impl::disposing( const lang::EventObject& )
- throw ( uno::RuntimeException )
-{
-}
//=========================================================================
@@ -292,7 +252,6 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,pModule( 0 )
,pFrame( 0 )
,pTbxConfig( 0 )
- ,pEventConfig(NULL)
,eFlags( SFXOBJECTSHELL_UNDEFINED )
,pCloser( 0 )
,bReadOnlyUI( sal_False )
@@ -306,6 +265,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,m_bCreateTempStor( sal_False )
,m_xDocInfoListener()
,m_bIsInit( sal_False )
+ ,m_bIncomplEncrWarnShown( sal_False )
{
}
@@ -409,7 +369,7 @@ SfxObjectShell::~SfxObjectShell()
pImp->xModel = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > ();
// don't call GetStorage() here, in case of Load Failure it's possible that a storage was never assigned!
- if ( pMedium && pMedium->HasStorage_Impl() && pMedium->GetStorage() == pImp->m_xDocStorage )
+ if ( pMedium && pMedium->HasStorage_Impl() && pMedium->GetStorage( sal_False ) == pImp->m_xDocStorage )
pMedium->CanDisposeStorage_Impl( sal_False );
if ( pImp->mpObjectContainer )
@@ -622,6 +582,9 @@ sal_uInt16 SfxObjectShell::PrepareClose
}
}
+ SfxApplication *pSfxApp = SFX_APP();
+ pSfxApp->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEDOC, GlobalEventConfig::GetEventName(STR_EVENT_PREPARECLOSEDOC), this) );
+
if( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
{
pImp->bPreparedForClose = sal_True;
@@ -635,8 +598,6 @@ sal_uInt16 SfxObjectShell::PrepareClose
while ( pFrame && (pFrame->GetFrameType() & SFXFRAME_SERVER ) )
pFrame = SfxViewFrame::GetNext( *pFrame, this );
- SfxApplication *pSfxApp = SFX_APP();
- pSfxApp->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEDOC, this) );
sal_Bool bClose = sal_False;
if ( bUI && IsModified() )
{
@@ -927,11 +888,6 @@ SfxObjectShell* SfxObjectShell::GetObjectShell()
SEQUENCE< OUSTRING > SfxObjectShell::GetEventNames()
{
- return GetEventNames_Impl();
-}
-
-SEQUENCE< OUSTRING > SfxObjectShell::GetEventNames_Impl()
-{
static uno::Sequence< ::rtl::OUString >* pEventNameContainer = NULL;
if ( !pEventNameContainer )
@@ -939,88 +895,7 @@ SEQUENCE< OUSTRING > SfxObjectShell::GetEventNames_Impl()
::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( !pEventNameContainer )
{
- static uno::Sequence< ::rtl::OUString > aEventNameContainer( 27 );
- // SFX_EVENT_STARTAPP
- aEventNameContainer[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnStartApp" ) );
-
- // SFX_EVENT_CLOSEAPP
- aEventNameContainer[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnCloseApp" ) );
-
- // SFX_EVENT_CREATEDOC
- aEventNameContainer[2] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnNew" ) );
-
- // SFX_EVENT_OPENDOC
- aEventNameContainer[3] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnLoad" ) );
-
- // SFX_EVENT_SAVEASDOC
- aEventNameContainer[4] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnSaveAs" ) );
-
- // SFX_EVENT_SAVEASDOCDONE
- aEventNameContainer[5] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnSaveAsDone" ) );
-
- // SFX_EVENT_SAVEDOC
- aEventNameContainer[6] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnSave" ) );
-
- // SFX_EVENT_SAVEDOCDONE
- aEventNameContainer[7] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnSaveDone" ) );
-
- // SFX_EVENT_PREPARECLOSEDOC
- aEventNameContainer[8] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnPrepareUnload" ) );
-
- // SFX_EVENT_CLOSEDOC
- aEventNameContainer[9] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnUnload" ) );
-
- // SFX_EVENT_ACTIVATEDOC
- aEventNameContainer[10] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnFocus" ) );
-
- // SFX_EVENT_DEACTIVATEDOC
- aEventNameContainer[11] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnUnfocus" ) );
-
- // SFX_EVENT_PRINTDOC
- aEventNameContainer[12] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnPrint" ) );
-
- // SFX_EVENT_MODIFYCHANGED
- aEventNameContainer[13] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnModifyChanged" ) );
-
- // SFX_EVENT_SAVETODOC
- aEventNameContainer[14] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnCopyTo" ) );
-
- // SFX_EVENT_SAVETODOCDONE
- aEventNameContainer[15] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnCopyToDone" ) );
-
- // SFX_EVENT_VIEWCREATED
- aEventNameContainer[16] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnViewCreated" ) );
-
- // SFX_EVENT_PREPARECLOSEVIEW
- aEventNameContainer[17] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnPrepareViewClosing" ) );
-
- // SFX_EVENT_CLOSEVIEW
- aEventNameContainer[18] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnViewClosed" ) );
-
- // SFX_EVENT_VISAREACHANGED
- aEventNameContainer[19] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnVisAreaChanged" ) );
-
- // SFX_EVENT_DOCCREATED
- aEventNameContainer[20] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnCreate" ) );
-
- // SFX_EVENT_LOADFINISHED
- aEventNameContainer[21] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnLoadFinished" ) );
-
- // SFX_EVENT_SAVEASDOCFAILED
- aEventNameContainer[22] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnSaveAsFailed" ) );
-
- // SFX_EVENT_SAVEDOCFAILED
- aEventNameContainer[23] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnSaveFailed" ) );
-
- // SFX_EVENT_SAVETODOCFAILED
- aEventNameContainer[24] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnCopyToFailed" ) );
-
- // SFX_HINT_TITLECHANGED
- aEventNameContainer[25] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnTitleChanged" ) );
-
- // SFX_HINT_MODECHANGED
- aEventNameContainer[26] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnModeChanged" ) );
-
+ static uno::Sequence< ::rtl::OUString > aEventNameContainer = GlobalEventConfig().getElementNames();
pEventNameContainer = &aEventNameContainer;
}
}
@@ -1028,6 +903,13 @@ SEQUENCE< OUSTRING > SfxObjectShell::GetEventNames_Impl()
return *pEventNameContainer;
}
+SEQUENCE< OUSTRING > SfxObjectShell::GetEventNames_Impl()
+{
+ if (!pImp->xEventNames.getLength())
+ pImp->xEventNames = GetEventNames();
+ return pImp->xEventNames;
+}
+
//--------------------------------------------------------------------
void SfxObjectShell::SetModel( SfxBaseModel* pModel )
@@ -1036,10 +918,10 @@ void SfxObjectShell::SetModel( SfxBaseModel* pModel )
pImp->xModel = pModel;
if ( pModel ) {
pModel->addCloseListener( new SfxModelListener_Impl(this) );
- pImp->m_xDocInfoListener = new SfxDocInfoListener_Impl(*this);
- uno::Reference<util::XModifyBroadcaster> xMB(
- pModel->getDocumentProperties(), uno::UNO_QUERY_THROW);
- xMB->addModifyListener(pImp->m_xDocInfoListener);
+ //pImp->m_xDocInfoListener = new SfxDocInfoListener_Impl(*this);
+ //uno::Reference<util::XModifyBroadcaster> xMB(
+ // pModel->getDocumentProperties(), uno::UNO_QUERY_THROW);
+ //xMB->addModifyListener(pImp->m_xDocInfoListener);
}
}
@@ -1077,7 +959,8 @@ sal_uInt16 SfxObjectShell::GetAutoStyleFilterIndex()
void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComponent )
{
- if ( _rxComponent.get() == s_xCurrentComponent.get().get() )
+ Reference< XInterface > xTest(s_xCurrentComponent);
+ if ( _rxComponent == xTest )
// nothing to do
return;
// note that "_rxComponent.get() == s_xCurrentComponent.get().get()" is /sufficient/, but not
@@ -1085,9 +968,8 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp
// In other words, it's still possible that we here do something which is not necessary,
// but we should have filtered quite some unnecessary calls already.
- s_xCurrentComponent = _rxComponent;
-
BasicManager* pAppMgr = SFX_APP()->GetBasicManager();
+ s_xCurrentComponent = _rxComponent;
if ( pAppMgr )
pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( _rxComponent ) );
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 53673b505d6d..03e6e9170153 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -141,6 +141,52 @@ namespace css = ::com::sun::star;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
+/** This Listener is used to get notified when the XDocumentProperties of the
+ XModel change.
+ If several changes are done the "bQuiet" member can be used to
+ temporarily suppress notifications.
+ */
+class SfxDocInfoListener_Impl : public ::cppu::WeakImplHelper1<
+ ::com::sun::star::util::XModifyListener >
+{
+
+public:
+ SfxObjectShell& m_rShell;
+ bool bQuiet;
+ bool bGotModified;
+
+ SfxDocInfoListener_Impl( SfxObjectShell& i_rDoc )
+ : m_rShell(i_rDoc)
+ , bQuiet(false)
+ { };
+
+ ~SfxDocInfoListener_Impl();
+
+ virtual void SAL_CALL disposing( const lang::EventObject& )
+ throw ( uno::RuntimeException );
+ virtual void SAL_CALL modified( const lang::EventObject& )
+ throw ( uno::RuntimeException );
+};
+SfxDocInfoListener_Impl::~SfxDocInfoListener_Impl()
+{
+}
+void SAL_CALL SfxDocInfoListener_Impl::modified( const lang::EventObject& )
+ throw ( uno::RuntimeException )
+{
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ bGotModified = true;
+
+ // notify changes to the SfxObjectShell
+ if ( !bQuiet ) {
+ m_rShell.FlushDocInfo();
+ }
+}
+
+void SAL_CALL SfxDocInfoListener_Impl::disposing( const lang::EventObject& )
+ throw ( uno::RuntimeException )
+{
+}
+
//________________________________________________________________________________________________________
// impl. declarations
//________________________________________________________________________________________________________
@@ -861,6 +907,8 @@ SfxBaseModel::getDocumentProperties()
uno::UNO_QUERY_THROW);
// xDocProps->initialize(uno::Sequence<uno::Any>());
m_pData->m_xDocumentProperties.set(xDocProps, uno::UNO_QUERY_THROW);
+ uno::Reference<util::XModifyBroadcaster> xMB(m_pData->m_xDocumentProperties, uno::UNO_QUERY_THROW);
+ xMB->addModifyListener(new SfxDocInfoListener_Impl(*m_pData->m_pObjectShell));
}
return m_pData->m_xDocumentProperties;
@@ -1566,7 +1614,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa
SfxAllItemSet *pParams = new SfxAllItemSet( SFX_APP()->GetPool() );
TransformParameters( SID_SAVEDOC, aSeqArgs, *pParams );
- SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOC, m_pData->m_pObjectShell ) );
+ SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOC, GlobalEventConfig::GetEventName(STR_EVENT_SAVEDOC), m_pData->m_pObjectShell ) );
sal_Bool bRet = sal_False;
@@ -1597,14 +1645,12 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa
: ERRCODE_IO_CANTWRITE;
m_pData->m_pObjectShell->ResetError();
- SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEFINISHED, m_pData->m_pObjectShell ) );
-
if ( bRet )
{
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "successful saving." ) ) );
m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl();
- SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCDONE, m_pData->m_pObjectShell ) );
+ SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCDONE, GlobalEventConfig::GetEventName(STR_EVENT_SAVEDOCDONE), m_pData->m_pObjectShell ) );
}
else
{
@@ -1612,7 +1658,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa
m_pData->m_pObjectShell->StoreLog();
// write the contents of the logger to the file
- SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCFAILED, m_pData->m_pObjectShell ) );
+ SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCFAILED, GlobalEventConfig::GetEventName(STR_EVENT_SAVEDOCFAILED), m_pData->m_pObjectShell ) );
throw task::ErrorCodeIOException( ::rtl::OUString(), uno::Reference< uno::XInterface >(), nErrCode );
}
@@ -2498,7 +2544,7 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
impl_getPrintHelper();
}
- postEvent_Impl( pNamedHint->GetEventId() );
+ postEvent_Impl( pNamedHint->GetEventName() );
}
if ( pSimpleHint )
@@ -2507,11 +2553,11 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
{
::rtl::OUString aTitle = m_pData->m_pObjectShell->GetTitle();
addTitle_Impl( m_pData->m_seqArguments, aTitle );
- postEvent_Impl( pSimpleHint->GetId() );
+ postEvent_Impl( GlobalEventConfig::GetEventName( STR_EVENT_TITLECHANGED ) );
}
if ( pSimpleHint->GetId() == SFX_HINT_MODECHANGED )
{
- postEvent_Impl( pSimpleHint->GetId() );
+ postEvent_Impl( GlobalEventConfig::GetEventName( STR_EVENT_MODECHANGED ) );
}
/*
else if ( pSimpleHint->GetId() == SFX_HINT_DYING
@@ -2712,7 +2758,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
if ( !bSaved && m_pData->m_pObjectShell )
{
- SFX_APP()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOC : SFX_EVENT_SAVEASDOC,
+ SFX_APP()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOC : SFX_EVENT_SAVEASDOC, GlobalEventConfig::GetEventName( bSaveTo ? STR_EVENT_SAVETODOC : STR_EVENT_SAVEASDOC ),
m_pData->m_pObjectShell ) );
SfxAllItemSet *aParams = new SfxAllItemSet( SFX_APP()->GetPool() );
@@ -2802,19 +2848,9 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
// TODO/LATER: a general way to set the error context should be available
SfxErrorContext aEc( ERRCTX_SFX_SAVEASDOC, m_pData->m_pObjectShell->GetTitle() );
- ::com::sun::star::uno::Any aInteraction;
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > lContinuations(1);
- ::framework::ContinuationApprove* pApprove = new ::framework::ContinuationApprove();
- lContinuations[0] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >(static_cast< ::com::sun::star::task::XInteractionContinuation* >(pApprove), uno::UNO_QUERY);
-
::com::sun::star::task::ErrorCodeRequest aErrorCode;
aErrorCode.ErrCode = nErrCode;
- aInteraction <<= aErrorCode;
-
- ::framework::InteractionRequest* pRequest = new ::framework::InteractionRequest(aInteraction,lContinuations);
- ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest > xRequest(static_cast< ::com::sun::star::task::XInteractionRequest* >(pRequest), uno::UNO_QUERY);
-
- xHandler->handle(xRequest);
+ SfxMedium::CallApproveHandler( xHandler, uno::makeAny( aErrorCode ), sal_False );
}
}
@@ -2822,11 +2858,11 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
if ( !bSaveTo )
{
m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl();
- SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEASDOCDONE, m_pData->m_pObjectShell ) );
+ SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEASDOCDONE, GlobalEventConfig::GetEventName(STR_EVENT_SAVEASDOCDONE), m_pData->m_pObjectShell ) );
}
else
{
- SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVETODOCDONE, m_pData->m_pObjectShell ) );
+ SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVETODOCDONE, GlobalEventConfig::GetEventName(STR_EVENT_SAVETODOCDONE), m_pData->m_pObjectShell ) );
}
}
else
@@ -2835,7 +2871,7 @@ 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();
- SFX_APP()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOCFAILED : SFX_EVENT_SAVEASDOCFAILED,
+ SFX_APP()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOCFAILED : SFX_EVENT_SAVEASDOCFAILED, GlobalEventConfig::GetEventName( bSaveTo ? STR_EVENT_SAVETODOCFAILED : STR_EVENT_SAVEASDOCFAILED),
m_pData->m_pObjectShell ) );
throw task::ErrorCodeIOException( ::rtl::OUString(), uno::Reference< uno::XInterface >(), nErrCode );
@@ -2845,18 +2881,26 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
//********************************************************************************************************
-void SfxBaseModel::postEvent_Impl( ULONG nEventID )
+void SfxBaseModel::postEvent_Impl( ::rtl::OUString aName )
{
// object already disposed?
if ( impl_isDisposed() )
return;
+ DBG_ASSERT( aName.getLength(), "Empty event name!" );
+ if (!aName.getLength())
+ return;
+
::cppu::OInterfaceContainerHelper* pIC = m_pData->m_aInterfaceContainer.getContainer(
::getCppuType((const uno::Reference< XDOCEVENTLISTENER >*)0) );
if( pIC )
{
- ::rtl::OUString aName = SfxEventConfiguration::GetEventName_Impl( nEventID );
+#ifdef DBG_UTIL
+ ByteString aTmp( "SfxEvent: ");
+ aTmp += ByteString( String(aName), RTL_TEXTENCODING_UTF8 );
+ DBG_TRACE( aTmp.GetBuffer() );
+#endif
document::EventObject aEvent( (frame::XModel *)this, aName );
::cppu::OInterfaceContainerHelper aIC( m_aMutex );
uno::Sequence < uno::Reference < uno::XInterface > > aElements = pIC->getElements();
diff --git a/sfx2/source/doc/sfxbasemodel.src b/sfx2/source/doc/sfxbasemodel.src
deleted file mode 100644
index cbbfa57b2ad0..000000000000
--- a/sfx2/source/doc/sfxbasemodel.src
+++ /dev/null
@@ -1,94 +0,0 @@
-/*************************************************************************
- *
- * 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: sfxbasemodel.src,v $
- * $Revision: 1.10 $
- *
- * 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 "sfxlocal.hrc"
-
-/*
-// the following events names are now hardcoded in the code
-StringArray EVENT_NAMES_ARY
-{
- ItemList =
- {
- < "OnStartApp" ; SFX_EVENT_STARTAPP ; > ;
- < "OnCloseApp" ; SFX_EVENT_CLOSEAPP ; > ;
- < "OnNew" ; SFX_EVENT_CREATEDOC ; > ;
- < "OnLoad" ; SFX_EVENT_OPENDOC ; > ;
- < "OnSaveAs" ; SFX_EVENT_SAVEASDOC ; > ;
- < "OnSaveAsDone" ; SFX_EVENT_SAVEASDOCDONE ; > ;
- < "OnSave" ; SFX_EVENT_SAVEDOC ; > ;
- < "OnSaveDone" ; SFX_EVENT_SAVEDOCDONE ; > ;
- < "OnPrepareUnload" ; SFX_EVENT_PREPARECLOSEDOC ; > ;
- < "OnUnload" ; SFX_EVENT_CLOSEDOC ; > ;
- < "OnFocus" ; SFX_EVENT_ACTIVATEDOC ; > ;
- < "OnUnfocus" ; SFX_EVENT_DEACTIVATEDOC ; > ;
- < "OnPrint" ; SFX_EVENT_PRINTDOC ; > ;
- < "OnModifyChanged" ; SFX_EVENT_MODIFYCHANGED ; > ;
- < "OnCopyTo" ; SFX_EVENT_SAVETODOC ; > ;
- < "OnCopyToDone" ; SFX_EVENT_SAVETODOCDONE ; > ;
- < "OnViewCreated" ; SFX_EVENT_VIEWCREATED ; > ;
- < "OnPrepareViewClosing"; SFX_EVENT_PREPARECLOSEVIEW ; > ;
- < "OnViewClosed" ; SFX_EVENT_CLOSEVIEW ; > ;
- < "OnVisAreaChanged" ; SFX_EVENT_VISAREACHANGED ; > ;
- < "OnCreate" ; SFX_EVENT_DOCCREATED ; > ;
- < "OnLoadFinished" ; SFX_EVENT_LOADFINISHED ; > ;
- < "OnSaveAsFailed" ; SFX_EVENT_SAVEASDOCFAILED ; > ;
- < "OnSaveFailed" ; SFX_EVENT_SAVEDOCFAILED ; > ;
- < "OnCopyToFailed" ; SFX_EVENT_SAVETODOCFAILED ; > ;
- };
-};
-*/
-
-/*
- these events are defined by the applications or aren't used
- any longer
-
- < "OnNewMail" ; SFX_EVENT_NEWMESSAGE ; > ;
- < "OnError" ; SFX_EVENT_ONERROR ; > ;
- < "OnSelect" ; > ;
- < "OnInsertStart" ; > ;
- < "OnInsertDone" ; > ;
- < "OnMailMerge" ; > ;
- < "OnAlphaCharInput" ; > ;
- < "OnNonAlphaCharInput" ; > ;
- < "OnResize" ; > ;
- < "OnMove" ; > ;
- < "OnPageCountChange" ; > ;
- < "OnMouseOver" ; SFX_EVENT_MOUSEOVER_OBJECT ; > ;
- < "OnClick" ; SFX_EVENT_MOUSECLICK_OBJECT ; > ;
- < "OnMouseOut" ; SFX_EVENT_MOUSEOUT_OBJECT ; > ;
- < "OnLoadError" ; > ;
- < "OnLoadCancel" ; > ;
- < "OnLoadDone" ; > ;
- < "OnLoadFinished" ; SFX_EVENT_LOADFINISHED ; > ;
- < "OnSaveFinished" ; SFX_EVENT_SAVEFINISHED ; > ;
- < "OnModifyChanged" ; SFX_EVENT_MODIFYCHANGED ; > ;
- < "OnToggleFullscreen" ; SFX_EVENT_TOGGLEFULLSCREENMODE ; > ;
-*/
diff --git a/sfx2/source/inc/eventsupplier.hxx b/sfx2/source/inc/eventsupplier.hxx
index 97455a9e6482..0940d4bb66e3 100644
--- a/sfx2/source/inc/eventsupplier.hxx
+++ b/sfx2/source/inc/eventsupplier.hxx
@@ -187,7 +187,6 @@ class SfxGlobalEvents_Impl : public ModelCollectionMutexBase
, ::com::sun::star::document::XEventListener
, ::com::sun::star::document::XDocumentEventListener
, ::com::sun::star::container::XSet >
- , public SfxListener
{
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xSMGR;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > m_xEvents;
@@ -197,8 +196,6 @@ class SfxGlobalEvents_Impl : public ModelCollectionMutexBase
TModelList m_lModels;
GlobalEventConfig* pImp;
- void Notify( SfxBroadcaster& aBC, const SfxHint& aHint );
-
public:
SfxGlobalEvents_Impl(const com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& xSMGR);
virtual ~SfxGlobalEvents_Impl();
diff --git a/sfx2/source/inc/helper.hxx b/sfx2/source/inc/helper.hxx
index d246c1f70830..16eabab43a7e 100644
--- a/sfx2/source/inc/helper.hxx
+++ b/sfx2/source/inc/helper.hxx
@@ -70,7 +70,6 @@ public:
static sal_Bool MakeFolder( const String& rFolder );
static ErrCode QueryDiskSpace( const String& rPath, sal_Int64& rFreeBytes );
static ULONG GetSize( const String& rContent );
- static sal_Bool IsYounger( const String& rIsYoung, const String& rIsOlder );
// please don't use this!
static sal_Bool Exists( const String& rContent );
diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx
index eb8719435406..77162423cabe 100644
--- a/sfx2/source/inc/objshimp.hxx
+++ b/sfx2/source/inc/objshimp.hxx
@@ -33,6 +33,8 @@
//#include <hash_map>
#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <rtl/ustring.hxx>
#include <com/sun/star/logging/XSimpleLogRing.hpp>
#include <tools/datetime.hxx>
@@ -72,6 +74,7 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
xBasicLibraries;
::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >
xDialogLibraries;
+ com::sun::star::uno::Sequence < rtl::OUString > xEventNames;
::sfx2::DocumentMacroMode
aMacroMode;
SfxProgress* pProgress;
@@ -141,7 +144,6 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
SfxModule* pModule;
SfxFrame* pFrame;
SfxToolBoxConfig* pTbxConfig;
- SfxEventConfigItem_Impl* pEventConfig;
SfxObjectShellFlags eFlags;
svtools::AsynchronLink* pCloser;
String aBaseURL;
@@ -171,6 +173,9 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
::com::sun::star::uno::Reference< ::com::sun::star::logging::XSimpleLogRing > m_xLogRing;
+ sal_Bool m_bIncomplEncrWarnShown;
+
+
SfxObjectShell_Impl( SfxObjectShell& _rDocShell );
virtual ~SfxObjectShell_Impl();
@@ -180,10 +185,12 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
virtual sal_Int16 getCurrentMacroExecMode() const;
virtual sal_Bool setCurrentMacroExecMode( sal_uInt16 nMacroMode );
virtual ::rtl::OUString getDocumentLocation() const;
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > getLastCommitDocumentStorage();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > getZipStorageToSign();
virtual sal_Bool documentStorageHasMacros() const;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedScripts > getEmbeddedDocumentScripts() const;
- virtual sal_Int16 getScriptingSignatureState() const;
+ virtual sal_Int16 getScriptingSignatureState();
+
+ virtual sal_Bool hasTrustedScriptingSignature( sal_Bool bAllowUIToAddAuthor );
virtual void showBrokenSignatureWarning( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxInteraction ) const;
};
diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx
index ec26c3e6bbaf..a01b1df73c82 100644
--- a/sfx2/source/notify/eventsupplier.cxx
+++ b/sfx2/source/notify/eventsupplier.cxx
@@ -98,12 +98,6 @@ void SAL_CALL SfxEvents_Impl::replaceByName( const OUSTRING & aName, const ANY &
// create Configuration at first, creation might call this method also and that would overwrite everything
// we might have stored before!
- USHORT nID = (USHORT) SfxEventConfiguration::GetEventId_Impl( aName );
- OSL_ENSURE( nID, "SfxEvents_Impl::replaceByName: no ID for the given event!" );
- if ( !nID )
- // throw?
- return;
-
if ( mpObjShell && !mpObjShell->IsLoading() )
mpObjShell->SetModified( TRUE );
@@ -370,7 +364,7 @@ SfxEvents_Impl::SfxEvents_Impl( SfxObjectShell* pShell,
if ( pShell )
maEventNames = pShell->GetEventNames();
else
- maEventNames = SfxObjectShell::GetEventNames_Impl();
+ maEventNames = GlobalEventConfig().getElementNames();
maEventData = SEQUENCE < ANY > ( maEventNames.getLength() );
@@ -646,24 +640,6 @@ SfxGlobalEvents_Impl::~SfxGlobalEvents_Impl()
}
//-----------------------------------------------------------------------------
-void SfxGlobalEvents_Impl::Notify( SfxBroadcaster& /*aBC*/, const SfxHint& aHint )
-{
- SfxEventHint* pNamedHint = PTR_CAST(SfxEventHint, &aHint);
- if (!pNamedHint)
- return;
-
- css::uno::Reference< css::document::XEventsSupplier > xSup;
-
- ::rtl::OUString sName = SfxEventConfiguration::GetEventName_Impl(pNamedHint->GetEventId());
- SfxObjectShell* pShell = pNamedHint->GetObjShell();
- if (pShell)
- xSup = css::uno::Reference< css::document::XEventsSupplier >(pShell->GetModel(), UNO_QUERY);
-
- css::document::EventObject aEvent(xSup, sName);
- notifyEvent(aEvent);
-}
-
-//-----------------------------------------------------------------------------
css::uno::Reference< css::container::XNameReplace > SAL_CALL SfxGlobalEvents_Impl::getEvents()
throw(css::uno::RuntimeException)
{
@@ -708,7 +684,7 @@ void SAL_CALL SfxGlobalEvents_Impl::notifyDocumentEvent( const ::rtl::OUString&
const css::uno::Reference< css::frame::XController2 >& /*_ViewController*/, const css::uno::Any& /*_Supplement*/ )
throw (css::lang::IllegalArgumentException, css::lang::NoSupportException, css::uno::RuntimeException)
{
- // we're a multiplexer only, no change to generate artifical events here
+ // we're a multiplexer only, no chance to generate artifical events here
throw css::lang::NoSupportException(::rtl::OUString(), *this);
}
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 674c209b65cc..42e9a1d04cb6 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -296,7 +296,7 @@ sal_uInt16 SfxFrame::PrepareClose_Impl( sal_Bool bUI, sal_Bool bForBrowsing )
bOther = ( pFrame->GetFrame() != this );
}
- SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEVIEW, pCur) );
+ SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEVIEW, GlobalEventConfig::GetEventName( STR_EVENT_PREPARECLOSEVIEW ), pCur) );
if ( bOther )
// if there are other views only the current view of this frame must be asked
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index 8d7562b0c495..b91e1e6b4998 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -79,6 +79,7 @@
namespace css = ::com::sun::star;
#endif
+#include <sfx2/doctempl.hxx>
#include <sfx2/app.hxx>
#include <sfx2/request.hxx>
#include <sfx2/sfxsids.hrc>
@@ -396,76 +397,88 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< css::bean
return bLoadState;
}
- String sStandardTemplate = SfxObjectFactory::GetStandardTemplate( aServiceName );
- BOOL bUseDefaultTemplate = (sStandardTemplate.Len()>0);
- if( bUseDefaultTemplate )
- {
- // #i21583#
- // Forget the filter, which was detected for the corresponding "private:factory/xxx" URL.
- // We must use the right filter, matching to this document ... not to the private URL!
- const SfxFilter* pTemplateFilter = impl_detectFilterForURL(sStandardTemplate, rArgs, rMatcher);
- if (pTemplateFilter)
- {
- pFilter = pTemplateFilter;
- aFilterName = pTemplateFilter->GetName();
- // standard template set -> load it "AsTemplate"
- aSet.Put( SfxStringItem ( SID_FILE_NAME, sStandardTemplate ) );
- aSet.Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
- }
+ String sTemplateURL;
+ SFX_ITEMSET_ARG( &aSet, pTemplateRegionItem, SfxStringItem, SID_TEMPLATE_REGIONNAME, FALSE );
+ SFX_ITEMSET_ARG( &aSet, pTemplateNameItem, SfxStringItem, SID_TEMPLATE_NAME, FALSE );
+ if ( pTemplateRegionItem && pTemplateNameItem )
+ {
+ SfxDocumentTemplates aTmpFac;
+ aTmpFac.GetFull( pTemplateRegionItem->GetValue(), pTemplateNameItem->GetValue(), sTemplateURL );
+ }
+ else
+ {
+ sTemplateURL = SfxObjectFactory::GetStandardTemplate( aServiceName );
+ }
- // #119268#
- // something is wrong with the set default template (e.g. unknown format, missing file etcpp)
- // The we have to jump into the following special code, where "private:factory/ URL's are handled.
- // We cant "load" such private/factory URL's!
- else
- bUseDefaultTemplate = FALSE;
+ BOOL bUseTemplate = (sTemplateURL.Len()>0);
+ if( bUseTemplate )
+ {
+ // #i21583#
+ // Forget the filter, which was detected for the corresponding "private:factory/xxx" URL.
+ // We must use the right filter, matching to this document ... not to the private URL!
+ const SfxFilter* pTemplateFilter = impl_detectFilterForURL(sTemplateURL, rArgs, rMatcher);
+ if (pTemplateFilter)
+ {
+ pFilter = pTemplateFilter;
+ aFilterName = pTemplateFilter->GetName();
+ // standard template set -> load it "AsTemplate"
+ aSet.Put( SfxStringItem ( SID_FILE_NAME, sTemplateURL ) );
+ aSet.Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
}
- if ( !bUseDefaultTemplate )
- {
- // execute "NewDocument" request
- /* Attention!
- #107913#
- Pointers can't be used to check if two objects are equals!
- E.g. the memory manager can reuse freed memory ...
- and then the holded copy of a pointer will point to another
- (and different!) object - may using the same type then before.
- In such case we compare one object with itself ...
- */
- SfxRequest aReq( SID_NEWDOCDIRECT, SFX_CALLMODE_SYNCHRON, aSet );
- aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, pFrame ) );
- aReq.AppendItem( SfxStringItem( SID_NEWDOCDIRECT, aFact ) );
-
- if ( pDocumentTitleItem )
- aReq.AppendItem( *pDocumentTitleItem );
-
- const SfxPoolItem* pRet = pApp->NewDocDirectExec_ImplOld(aReq);
- if (pRet)
- {
- // default must be set to true, because some return values
- // cant be checked ... but indicates "success"!
- bLoadState = sal_True;
+ // #119268#
+ // something is wrong with the set default template (e.g. unknown format, missing file etcpp)
+ // The we have to jump into the following special code, where "private:factory/ URL's are handled.
+ // We cant "load" such private/factory URL's!
+ else
+ bUseTemplate = FALSE;
+ }
- // On the other side some special slots return a boolean state,
- // which can be set to FALSE.
- SfxBoolItem *pItem = PTR_CAST( SfxBoolItem, pRet );
- if (pItem)
- bLoadState = pItem->GetValue();
- }
- else
- bLoadState = sal_False;
+ if ( !bUseTemplate )
+ {
+ // execute "NewDocument" request
+ /* Attention!
+ #107913#
+ Pointers can't be used to check if two objects are equals!
+ E.g. the memory manager can reuse freed memory ...
+ and then the holded copy of a pointer will point to another
+ (and different!) object - may using the same type then before.
+ In such case we compare one object with itself ...
+ */
+ SfxRequest aReq( SID_NEWDOCDIRECT, SFX_CALLMODE_SYNCHRON, aSet );
+ aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, pFrame ) );
+ aReq.AppendItem( SfxStringItem( SID_NEWDOCDIRECT, aFact ) );
+
+ if ( pDocumentTitleItem )
+ aReq.AppendItem( *pDocumentTitleItem );
+
+ const SfxPoolItem* pRet = pApp->NewDocDirectExec_ImplOld(aReq);
+ if (pRet)
+ {
+ // default must be set to true, because some return values
+ // cant be checked ... but indicates "success"!
+ bLoadState = sal_True;
- if ( !bLoadState && bFrameCreated && wFrame && !wFrame->GetCurrentDocument() )
- {
- css::uno::Reference< css::frame::XFrame > axFrame;
- wFrame->SetFrameInterface_Impl( axFrame );
- wFrame->DoClose();
- }
+ // On the other side some special slots return a boolean state,
+ // which can be set to FALSE.
+ SfxBoolItem *pItem = PTR_CAST( SfxBoolItem, pRet );
+ if (pItem)
+ bLoadState = pItem->GetValue();
+ }
+ else
+ bLoadState = sal_False;
- xFrame.clear();
- xListener.clear();
- return bLoadState;
+ if ( !bLoadState && bFrameCreated && wFrame && !wFrame->GetCurrentDocument() )
+ {
+ css::uno::Reference< css::frame::XFrame > axFrame;
+ wFrame->SetFrameInterface_Impl( axFrame );
+ wFrame->DoClose();
}
+
+ xFrame.clear();
+ xListener.clear();
+ return bLoadState;
+ }
}
else
{
diff --git a/sfx2/source/view/prnmon.cxx b/sfx2/source/view/prnmon.cxx
index 9fdd29db2805..21d484e550ab 100644
--- a/sfx2/source/view/prnmon.cxx
+++ b/sfx2/source/view/prnmon.cxx
@@ -388,7 +388,7 @@ IMPL_LINK_INLINE_END( SfxPrintProgress, PrintErrorNotify, void *, EMPTYARG )
IMPL_LINK( SfxPrintProgress, StartPrintNotify, void *, EMPTYARG )
{
SfxObjectShell *pObjShell = pImp->pViewShell->GetObjectShell();
- SFX_APP()->NotifyEvent(SfxEventHint(SFX_EVENT_PRINTDOC, pObjShell));
+ SFX_APP()->NotifyEvent(SfxEventHint(SFX_EVENT_PRINTDOC, GlobalEventConfig::GetEventName( STR_EVENT_PRINTDOC ), pObjShell));
pObjShell->Broadcast( SfxPrintingHint( com::sun::star::view::PrintableState_JOB_STARTED, NULL, NULL ) );
return 0;
}
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index ca9b4149339e..54ccd29a7dd7 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -1148,9 +1148,9 @@ void SAL_CALL SfxBaseController::dispose() throw( ::com::sun::star::uno::Runtime
if ( m_pData->m_bIsFrameReleasedWithController )
{
- SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEVIEW, pDoc ) );
+ SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEVIEW, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEVIEW ), pDoc ) );
if ( !pView )
- SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEDOC, pDoc) );
+ SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ), pDoc) );
}
REFERENCE< XMODEL > xModel = pDoc->GetModel();
diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx
index 205fdf788ba1..01c48f8f2be0 100644
--- a/sfx2/source/view/topfrm.cxx
+++ b/sfx2/source/view/topfrm.cxx
@@ -210,6 +210,9 @@ long SfxTopWindow_Impl::Notify( NotifyEvent& rNEvt )
if ( nHelpId )
SfxHelp::OpenHelpAgent( pFrame, nHelpId );
+ // if focus was on an external window, the clipboard content might have been changed
+ pView->GetBindings().Invalidate( SID_PASTE );
+ pView->GetBindings().Invalidate( SID_PASTE_SPECIAL );
return sal_True;
}
else if( rNEvt.GetType() == EVENT_KEYINPUT )
@@ -1016,7 +1019,7 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc )
GetCurrentViewFrame()->Resize(TRUE);
}
- SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_VIEWCREATED, pDoc ) );
+ SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), pDoc ) );
return sal_True;
}
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 0769a782de86..592926bca1ce 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -77,6 +77,7 @@
#include <rtl/ustrbuf.hxx>
#include <unotools/localfilehelper.hxx>
+#include <unotools/ucbhelper.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/configurationhelper.hxx>
@@ -453,7 +454,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// 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) &&
- SfxContentHelper::IsYounger( aPhysObj.GetMainURL( INetURLObject::NO_DECODE ), aMedObj.GetMainURL( INetURLObject::NO_DECODE ) ))
+ !::utl::UCBContentHelper::IsYounger( aMedObj.GetMainURL( INetURLObject::NO_DECODE ), aPhysObj.GetMainURL( INetURLObject::NO_DECODE ) ))
|| pMed->IsRemote() ) )
|| pVersionItem )
{
@@ -716,7 +717,9 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// eigentliches Reload
//pNewSet->Put( SfxFrameItem ( SID_DOCFRAME, GetFrame() ) );
- //pNewSet->Put( SfxBoolItem( SID_SILENT, sal_True ) );
+
+ if ( pSilentItem && pSilentItem->GetValue() )
+ pNewSet->Put( SfxBoolItem( SID_SILENT, sal_True ) );
SFX_ITEMSET_ARG(pNewSet, pInteractionItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER, FALSE);
SFX_ITEMSET_ARG(pNewSet, pMacroExecItem , SfxUInt16Item, SID_MACROEXECMODE , FALSE);
@@ -820,6 +823,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
}
xNewObj->GetMedium()->GetItemSet()->ClearItem( SID_RELOAD );
+ xNewObj->GetMedium()->GetItemSet()->ClearItem( SID_SILENT );
UpdateDocument_Impl();
}
@@ -863,7 +867,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
if ( xNewObj.Is() )
{
// Propagate document closure.
- SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_CLOSEDOC, xOldObj ) );
+ SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ), xOldObj ) );
}
// als erledigt recorden
@@ -1141,7 +1145,7 @@ void SfxViewFrame::SetObjectShell_Impl
SwitchToViewShell_Impl( !IsRestoreView_Impl() ? (sal_uInt16) 0 : GetCurViewId() );
rObjSh.PostActivateEvent_Impl( this );
if ( Current() == this )
- SFX_APP()->NotifyEvent(SfxEventHint(SFX_EVENT_ACTIVATEDOC, &rObjSh ) );
+ SFX_APP()->NotifyEvent(SfxEventHint(SFX_EVENT_ACTIVATEDOC, GlobalEventConfig::GetEventName( STR_EVENT_ACTIVATEDOC ), &rObjSh ) );
Notify( rObjSh, SfxSimpleHint(SFX_HINT_TITLECHANGED) );
Notify( rObjSh, SfxSimpleHint(SFX_HINT_DOCCHANGED) );
@@ -1514,6 +1518,8 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
case SFX_HINT_MODECHANGED:
{
// r/o Umschaltung?
+ SfxBindings& rBind = GetBindings();
+ rBind.Invalidate( SID_RELOAD );
SfxDispatcher *pDispat = GetDispatcher();
sal_Bool bWasReadOnly = pDispat->GetReadOnly_Impl();
sal_Bool bIsReadOnly = xObjSh->IsReadOnly();
@@ -1521,8 +1527,9 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
// Dann auch TITLE_CHANGED
UpdateTitle();
- GetBindings().Invalidate( SID_FILE_NAME );
- GetBindings().Invalidate( SID_DOCINFO_TITLE );
+ rBind.Invalidate( SID_FILE_NAME );
+ rBind.Invalidate( SID_DOCINFO_TITLE );
+ rBind.Invalidate( SID_EDITDOC );
pDispat->GetBindings()->InvalidateAll(sal_True);
pDispat->SetReadOnly_Impl( bIsReadOnly );
@@ -1543,8 +1550,11 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
case SFX_HINT_TITLECHANGED:
{
UpdateTitle();
- GetBindings().Invalidate( SID_FILE_NAME );
- GetBindings().Invalidate( SID_DOCINFO_TITLE );
+ SfxBindings& rBind = GetBindings();
+ rBind.Invalidate( SID_FILE_NAME );
+ rBind.Invalidate( SID_DOCINFO_TITLE );
+ rBind.Invalidate( SID_EDITDOC );
+ rBind.Invalidate( SID_RELOAD );
break;
}
@@ -1572,12 +1582,16 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
rBind.Invalidate( SID_DOC_MODIFIED );
rBind.Invalidate( SID_SAVEDOC );
rBind.Invalidate( SID_RELOAD );
+ rBind.Invalidate( SID_EDITDOC );
break;
}
case SFX_EVENT_OPENDOC:
case SFX_EVENT_CREATEDOC:
{
+ SfxBindings& rBind = GetBindings();
+ rBind.Invalidate( SID_RELOAD );
+ rBind.Invalidate( SID_EDITDOC );
if ( !xObjSh->IsReadOnly() )
{
// Im Gegensatz zu oben (TITLE_CHANGED) mu\s das UI nicht
diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx
index 5188f84a43b6..f75d68fe1413 100644
--- a/sfx2/source/view/viewimp.hxx
+++ b/sfx2/source/view/viewimp.hxx
@@ -45,6 +45,8 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <svtools/acceleratorexecute.hxx>
+#include <queue>
+
// forward ---------------------------------------------------------------
class SfxOfficeDispatch;
@@ -54,6 +56,20 @@ typedef SfxShell* SfxShellPtr_Impl;
SV_DECL_PTRARR( SfxShellArr_Impl, SfxShellPtr_Impl, 4, 4 )
// struct SfxViewShell_Impl ----------------------------------------------
+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 );
+};
struct SfxViewShell_Impl
{
@@ -78,6 +94,7 @@ struct SfxViewShell_Impl
USHORT nFamily;
SfxBaseController* pController;
::svt::AcceleratorExecute* pAccExec;
+ SfxAsyncPrintExec_Impl* pPrinterCommandQueue;
com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aPrintOpts;
SfxViewShell_Impl()
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 3c2054a4a881..c944264dd20c 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -53,6 +53,7 @@
#include <tools/datetime.hxx>
#include <sfx2/viewsh.hxx>
+#include <sfx2/dispatch.hxx>
#include "viewimp.hxx"
#include <sfx2/viewfrm.hxx>
#include <sfx2/prnmon.hxx>
@@ -71,6 +72,43 @@ TYPEINIT1(SfxPrintingHint, SfxHint);
// -----------------------------------------------------------------------
+void SfxAsyncPrintExec_Impl::AddRequest( SfxRequest& rReq )
+{
+ if ( rReq.GetArgs() )
+ {
+ // only queue API requests
+ if ( aReqs.empty() )
+ StartListening( *pView->GetObjectShell() );
+
+ aReqs.push( new SfxRequest( rReq ) );
+ }
+}
+
+void SfxAsyncPrintExec_Impl::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+{
+ if ( &rBC == pView->GetObjectShell() )
+ {
+ SfxPrintingHint* pPrintHint = PTR_CAST( SfxPrintingHint, &rHint );
+ if ( pPrintHint && pPrintHint->GetWhich() == com::sun::star::view::PrintableState_JOB_COMPLETED )
+ {
+ while ( aReqs.front() )
+ {
+ SfxRequest* pReq = aReqs.front();
+ aReqs.pop();
+ pView->GetViewFrame()->GetDispatcher()->Execute( pReq->GetSlot(), SFX_CALLMODE_ASYNCHRON, *pReq->GetArgs() );
+ USHORT nSlot = pReq->GetSlot();
+ delete pReq;
+ if ( nSlot == SID_PRINTDOC || nSlot == SID_PRINTDOCDIRECT )
+ // print jobs must be executed before the next command can be dispatched
+ break;
+ }
+
+ if ( aReqs.empty() )
+ EndListening( *pView->GetObjectShell() );
+ }
+ }
+}
+
void DisableRanges( PrintDialog& rDlg, SfxPrinter* pPrinter )
/* [Beschreibung]
@@ -389,13 +427,19 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
{
USHORT nCopies=1;
USHORT nDialogRet = RET_CANCEL;
- BOOL bCollate=FALSE;
+ BOOL bCollate=TRUE;
SfxPrinter* pPrinter = 0;
PrintDialog* pPrintDlg = 0;
SfxDialogExecutor_Impl* pExecutor = 0;
bool bSilent = false;
BOOL bIsAPI = rReq.GetArgs() && rReq.GetArgs()->Count();
+ if ( bIsAPI && GetPrinter( FALSE ) && GetPrinter( FALSE )->IsPrinting() )
+ {
+ pImp->pPrinterCommandQueue->AddRequest( rReq );
+ return;
+ }
+
const USHORT nId = rReq.GetSlot();
switch( nId )
{
@@ -866,8 +910,11 @@ ErrCode SfxViewShell::DoPrint( SfxPrinter *pPrinter,
else if ( pDocPrinter != pPrinter )
{
pProgress->RestoreOnEndPrint( pDocPrinter->Clone() );
- SetPrinter( pPrinter, SFX_PRINTER_PRINTER );
+ USHORT nError = SetPrinter( pPrinter, SFX_PRINTER_PRINTER );
+ if ( nError != SFX_PRINTERROR_NONE )
+ return PRINTER_ACCESSDENIED;
}
+
pProgress->SetWaitMode(FALSE);
// Drucker starten
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 70bbc4a28d02..299c928c748b 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -47,6 +47,9 @@
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/container/XContainerQuery.hpp>
#include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp>
+#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
+#include <cppuhelper/implbase1.hxx>
#include <osl/file.hxx>
#include <vos/mutex.hxx>
@@ -112,6 +115,68 @@ DBG_NAME(SfxViewShell)
//=========================================================================
+class SfxClipboardChangeListener : public ::cppu::WeakImplHelper1<
+ datatransfer::clipboard::XClipboardListener >
+{
+ SfxViewShell* pViewShell;
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const lang::EventObject& rEventObject )
+ throw ( uno::RuntimeException );
+
+ // XClipboardListener
+ virtual void SAL_CALL changedContents( const datatransfer::clipboard::ClipboardEvent& rEventObject )
+ throw ( uno::RuntimeException );
+
+public:
+ SfxClipboardChangeListener( SfxViewShell* pView );
+ virtual ~SfxClipboardChangeListener();
+};
+
+SfxClipboardChangeListener::SfxClipboardChangeListener( SfxViewShell* pView )
+: pViewShell( 0 )
+{
+ uno::Reference < lang::XComponent > xCtrl( pView->GetController(), uno::UNO_QUERY );
+ if ( xCtrl.is() )
+ {
+ xCtrl->addEventListener( uno::Reference < lang::XEventListener > ( static_cast < lang::XEventListener* >( this ) ) );
+ pViewShell = pView;
+ }
+}
+
+SfxClipboardChangeListener::~SfxClipboardChangeListener()
+{
+}
+
+void SAL_CALL SfxClipboardChangeListener::disposing( const lang::EventObject& /*rEventObject*/ )
+throw ( uno::RuntimeException )
+{
+ // either clipboard or ViewShell is going to be destroyed -> no interest in listening anymore
+ const ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( pViewShell )
+ {
+ uno::Reference < lang::XComponent > xCtrl( pViewShell->GetController(), uno::UNO_QUERY );
+ if ( xCtrl.is() )
+ xCtrl->removeEventListener( uno::Reference < lang::XEventListener > ( static_cast < lang::XEventListener* >( this ) ) );
+ pViewShell->AddRemoveClipboardListener( uno::Reference < datatransfer::clipboard::XClipboardListener > (this), FALSE );
+ pViewShell = 0;
+ }
+}
+
+void SAL_CALL SfxClipboardChangeListener::changedContents( const datatransfer::clipboard::ClipboardEvent& )
+ throw ( RuntimeException )
+{
+ const ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if( pViewShell )
+ {
+ SfxBindings& rBind = pViewShell->GetViewFrame()->GetBindings();
+ rBind.Invalidate( SID_PASTE );
+ rBind.Invalidate( SID_PASTE_SPECIAL );
+ rBind.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
+ }
+}
+
+
static ::rtl::OUString RetrieveLabelFromCommand(
const ::rtl::OUString& rCommandURL,
const css::uno::Reference< css::frame::XFrame >& rFrame )
@@ -687,6 +752,7 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet )
case SID_PRINTDOC:
case SID_PRINTDOCDIRECT:
case SID_SETUPPRINTER:
+ case SID_PRINTER_NAME:
{
BOOL bEnabled = pImp->bCanPrint && !pImp->nPrinterLocks;
bEnabled = bEnabled && !Application::GetSettings().GetMiscSettings().GetDisablePrinting();
@@ -720,9 +786,10 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet )
}
if ( !bEnabled )
{
- rSet.DisableItem( SID_PRINTDOC );
+ // will now be handled by requeing the request
+ /* rSet.DisableItem( SID_PRINTDOC );
rSet.DisableItem( SID_PRINTDOCDIRECT );
- rSet.DisableItem( SID_SETUPPRINTER );
+ rSet.DisableItem( SID_SETUPPRINTER ); */
}
break;
}
@@ -1187,6 +1254,7 @@ SfxViewShell::SfxViewShell
{
DBG_CTOR(SfxViewShell, 0);
+ pImp->pPrinterCommandQueue = new SfxAsyncPrintExec_Impl( this );
pImp->pController = 0;
pImp->bIsShowView =
!(SFX_VIEW_NO_SHOW == (nFlags & SFX_VIEW_NO_SHOW));
@@ -1240,6 +1308,8 @@ SfxViewShell::~SfxViewShell()
delete pImp->pAccExec;
pImp->pAccExec = 0;
}
+
+ delete pImp->pPrinterCommandQueue;
delete pImp;
delete pIPClientList;
}
@@ -1926,6 +1996,8 @@ void SfxViewShell::SetController( SfxBaseController* pController )
pImp->pController = pController;
pImp->pController->acquire();
pImp->bControllerSet = TRUE;
+
+ AddRemoveClipboardListener( new SfxClipboardChangeListener( this ), TRUE );
}
Reference < XController > SfxViewShell::GetController()
@@ -2128,3 +2200,25 @@ BOOL SfxViewShell::Escape()
{
return GetViewFrame()->GetBindings().Execute( SID_TERMINATE_INPLACEACTIVATION );
}
+
+void SfxViewShell::AddRemoveClipboardListener( const uno::Reference < datatransfer::clipboard::XClipboardListener >& rClp, BOOL bAdd )
+{
+ try
+ {
+ uno::Reference< datatransfer::clipboard::XClipboard > xClipboard( GetViewFrame()->GetWindow().GetClipboard() );
+ if( !xClipboard.is() )
+ return;
+
+ uno::Reference< datatransfer::clipboard::XClipboardNotifier > xClpbrdNtfr( xClipboard, uno::UNO_QUERY );
+ if( xClpbrdNtfr.is() )
+ {
+ if( bAdd )
+ xClpbrdNtfr->addClipboardListener( rClp );
+ else
+ xClpbrdNtfr->removeClipboardListener( rClp );
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ }
+}
diff --git a/sfx2/util/makefile.mk b/sfx2/util/makefile.mk
index 5ee6e64daca0..6bdb4a8122a6 100644
--- a/sfx2/util/makefile.mk
+++ b/sfx2/util/makefile.mk
@@ -98,7 +98,6 @@ SHL1STDLIBS+=\
$(CPPULIB) \
$(VOSLIB) \
$(SALLIB) \
- $(SJLIB) \
$(LIBXML2LIB) \
diff --git a/shell/inc/internal/basereader.hxx b/shell/inc/internal/basereader.hxx
index 47f7a9b82c40..4da8b7fa95be 100644
--- a/shell/inc/internal/basereader.hxx
+++ b/shell/inc/internal/basereader.hxx
@@ -50,6 +50,8 @@ public:
protected: // protected because its only an implementation relevant class
CBaseReader( const std::string& DocumentName );
+ CBaseReader( void* stream, zlib_filefunc_def* fa );
+
virtual void start_document();
virtual void end_document();
diff --git a/shell/inc/internal/contentreader.hxx b/shell/inc/internal/contentreader.hxx
index 41491df9fa8b..d8b2d77d28c0 100644
--- a/shell/inc/internal/contentreader.hxx
+++ b/shell/inc/internal/contentreader.hxx
@@ -43,6 +43,9 @@ public:
//CContentReader( const std::string& DocumentName );
CContentReader( const std::string& DocumentName, LocaleSet_t const & DocumentLocale );
+ CContentReader( void* stream, LocaleSet_t const & DocumentLocale, zlib_filefunc_def* fa );
+
+
/** Get the chunkbuffer.
@return
diff --git a/shell/inc/internal/metainforeader.hxx b/shell/inc/internal/metainforeader.hxx
index 62248beb845f..1e004b5a3727 100644
--- a/shell/inc/internal/metainforeader.hxx
+++ b/shell/inc/internal/metainforeader.hxx
@@ -45,6 +45,9 @@ public:
virtual ~CMetaInfoReader();
CMetaInfoReader( const std::string& DocumentName );
+
+ CMetaInfoReader( void* stream, zlib_filefunc_def* fa);
+
/** check if the Tag is in the target meta.xml file.
@param TagName
diff --git a/shell/inc/internal/propsheets.hxx b/shell/inc/internal/propsheets.hxx
index 3b14dc574fe3..0ebafcf0aa3a 100644
--- a/shell/inc/internal/propsheets.hxx
+++ b/shell/inc/internal/propsheets.hxx
@@ -92,7 +92,6 @@ private:
private:
long m_RefCnt;
char m_szFileName[MAX_PATH];
- std::auto_ptr<CMetaInfoReader> m_pMetaInfo;
};
#endif
diff --git a/shell/inc/internal/types.hxx b/shell/inc/internal/types.hxx
index 316a5e716d5b..730263060041 100644
--- a/shell/inc/internal/types.hxx
+++ b/shell/inc/internal/types.hxx
@@ -36,6 +36,9 @@
#include <utility>
#include <vector>
#include <stack>
+#include <external/zlib/zlib.h>
+#include <external/zlib/ioapi.h>
+
typedef std::vector<std::wstring> StringList_t;
diff --git a/shell/inc/internal/zipfile.hxx b/shell/inc/internal/zipfile.hxx
index 81da437544fe..2a860bb4c6cd 100644
--- a/shell/inc/internal/zipfile.hxx
+++ b/shell/inc/internal/zipfile.hxx
@@ -35,7 +35,9 @@
#define _WINDOWS
#endif
-#include <external/zlib/unzip.h>
+
+#include <external/zlib/unzip.h>
+
#include <string>
#include <vector>
@@ -69,6 +71,9 @@ public:
*/
static bool IsZipFile(const std::string& FileName);
+ static bool IsZipFile(void* stream);
+
+
/** Returns wheter the version of the specified zip file may be uncompressed with the
currently used zlib version or not
@@ -86,6 +91,7 @@ public:
*/
static bool IsValidZipFileVersionNumber(const std::string& FileName);
+ static bool IsValidZipFileVersionNumber(void* stream);
public:
@@ -103,6 +109,9 @@ public:
*/
ZipFile(const std::string& FileName);
+ ZipFile(void* stream, zlib_filefunc_def* fa);
+
+
/** Destroys a zip file
*/
~ZipFile();
diff --git a/shell/prj/build.lst b/shell/prj/build.lst
index 01077cbcb87d..7a2e91f973ba 100644
--- a/shell/prj/build.lst
+++ b/shell/prj/build.lst
@@ -31,6 +31,7 @@ sl shell\source\backends\wininetbe nmake - w sl_backends_w
sl shell\source\backends\macbe nmake - u sl_backends_macbe sl_inc NULL
sl shell\source\backends\gconfbe nmake - u sl_backends_gconfbe sl_inc NULL
sl shell\source\backends\kdebe nmake - u sl_backends_kdebe sl_inc NULL
+sl shell\source\backends\kde4be nmake - u sl_backends_kde4be sl_inc NULL
sl shell\source\backends\desktopbe nmake - u sl_backends_desktopbe sl_inc NULL
sl shell\source\win32\shlxthandler\ooofilt nmake - w sl_win32_shlxthandler_ooofilt sl_all_zipfile.w sl_all_ooofilereader.w sl_win32_shlxthandler_util.w sl_all sl_inc NULL
sl shell\source\win32\shlxthandler\ooofilt\proxy nmake - w sl_win32_ooofiltproxy sl_inc NULL
diff --git a/shell/source/all/makefile.mk b/shell/source/all/makefile.mk
index 3695abae798c..623aad6d69c1 100755
--- a/shell/source/all/makefile.mk
+++ b/shell/source/all/makefile.mk
@@ -35,6 +35,7 @@ PRJNAME=shell
TARGET=xmlparser
ENABLE_EXCEPTIONS=TRUE
+
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
@@ -61,6 +62,7 @@ CFLAGS+=-DSYSTEM_EXPAT
.ENDIF
SLOFILES=$(SLO)$/xml_parser.obj
+
.IF "$(BUILD_X64)"!=""
SLOFILES_X64=$(SLO_X64)$/xml_parser.obj
.ENDIF # "$(BUILD_X64)"!=""
diff --git a/shell/source/all/ooofilereader/basereader.cxx b/shell/source/all/ooofilereader/basereader.cxx
index 8412de36e458..d9be6740f057 100644
--- a/shell/source/all/ooofilereader/basereader.cxx
+++ b/shell/source/all/ooofilereader/basereader.cxx
@@ -50,6 +50,15 @@ m_ZipFile( DocumentName )
//
//------------------------------
+CBaseReader::CBaseReader(void * sw, zlib_filefunc_def* fa):
+m_ZipFile( sw , fa )
+{
+}
+
+//------------------------------
+//
+//------------------------------
+
CBaseReader::~CBaseReader()
{
}
diff --git a/shell/source/all/ooofilereader/contentreader.cxx b/shell/source/all/ooofilereader/contentreader.cxx
index f1990c741721..111647e70ad6 100644
--- a/shell/source/all/ooofilereader/contentreader.cxx
+++ b/shell/source/all/ooofilereader/contentreader.cxx
@@ -61,6 +61,29 @@ CBaseReader( DocumentName )
}
}
+CContentReader::CContentReader( void* stream, LocaleSet_t const & DocumentLocale, zlib_filefunc_def* fa ) :
+CBaseReader( stream, fa )
+{
+try
+ {
+ m_DefaultLocale = DocumentLocale;
+ Initialize( DOC_CONTENT_NAME );
+ }
+ catch(xml_parser_exception&
+ #if OSL_DEBUG_LEVEL > 0
+ ex
+ #endif
+ )
+ {
+ ENSURE(false, ex.what());
+ }
+ catch(...)
+ {
+ ENSURE(false, "Unknown error");
+ }
+}
+
+
/** destructor.
*/
diff --git a/shell/source/all/ooofilereader/makefile.mk b/shell/source/all/ooofilereader/makefile.mk
index 1e9788cf3f17..b893db45d849 100644
--- a/shell/source/all/ooofilereader/makefile.mk
+++ b/shell/source/all/ooofilereader/makefile.mk
@@ -35,6 +35,7 @@ TARGET=ooofilereader
LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
+
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
@@ -65,7 +66,7 @@ LIB1TARGET=$(SLB)$/$(TARGET).lib
LIB1OBJFILES=$(SLOFILES)
LIB1FILES=$(SLB)$/zipfile.lib\
$(SLB)$/xmlparser.lib
-
+
.IF "$(BUILD_X64)"!=""
SLOFILES_X64=$(SLO_X64)$/basereader.obj\
$(SLO_X64)$/metainforeader.obj\
diff --git a/shell/source/all/ooofilereader/metainforeader.cxx b/shell/source/all/ooofilereader/metainforeader.cxx
index f09d8b3e41d0..cec17b59d3c9 100644
--- a/shell/source/all/ooofilereader/metainforeader.cxx
+++ b/shell/source/all/ooofilereader/metainforeader.cxx
@@ -80,6 +80,48 @@ CBaseReader( DocumentName )
}
}
+CMetaInfoReader::CMetaInfoReader( void* stream, zlib_filefunc_def* fa) :
+CBaseReader( stream, fa)
+{
+try
+ {
+ m_pKeywords_Builder = new CKeywordsTag( );
+ m_pSimple_Builder = new CSimpleTag( );
+ m_pDummy_Builder = new CDummyTag( );
+
+ //retrieve all infomation that is useful
+ m_AllMetaInfo[META_INFO_AUTHOR] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_TITLE] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_SUBJECT] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_KEYWORDS] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_DESCRIPTION] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_DOCUMENT_STATISTIC] = EMPTY_XML_TAG;
+
+ m_AllMetaInfo[META_INFO_GENERATOR] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_CREATION] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_CREATOR] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_MODIFIED] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_LANGUAGE] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_DOCUMENT_NUMBER] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_EDITING_TIME] = EMPTY_XML_TAG;
+
+ Initialize( META_CONTENT_NAME );
+ }
+ catch(xml_parser_exception&
+ #if OSL_DEBUG_LEVEL > 0
+ ex
+ #endif
+ )
+ {
+ ENSURE(false, ex.what());
+ }
+ catch(...)
+ {
+ ENSURE(false, "Unknown error");
+ }
+
+}
+
/** destructor.
*/
diff --git a/shell/source/all/zipfile/makefile.mk b/shell/source/all/zipfile/makefile.mk
index a7f9c95b95cf..9f294ce7aad0 100644
--- a/shell/source/all/zipfile/makefile.mk
+++ b/shell/source/all/zipfile/makefile.mk
@@ -33,6 +33,9 @@ PRJ=..$/..$/..
PRJNAME=shell
TARGET=zipfile
ENABLE_EXCEPTIONS=TRUE
+EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
+
+
# --- Settings -----------------------------------------------------
@@ -45,8 +48,8 @@ SLOFILES=$(SLO)$/zipfile.obj\
$(SLO)$/zipexcptn.obj
SLOFILES_X64=$(SLO_X64)$/zipfile.obj\
- $(SLO_X64)$/zipexcptn.obj
-
+ $(SLO_X64)$/zipexcptn.obj
+
# --- Targets ------------------------------------------------------
.INCLUDE : set_wntx64.mk
diff --git a/shell/source/all/zipfile/zipfile.cxx b/shell/source/all/zipfile/zipfile.cxx
index b174c7a023e3..06fb6cc934d3 100644
--- a/shell/source/all/zipfile/zipfile.cxx
+++ b/shell/source/all/zipfile/zipfile.cxx
@@ -79,6 +79,12 @@ bool ZipFile::IsZipFile(const std::string& /*FileName*/)
return true;
}
+bool ZipFile::IsZipFile(void* /*stream*/)
+{
+ return true;
+}
+
+
/** Returns wheter the version of the specified zip file may be uncompressed with the
currently used zlib version or not
@@ -99,6 +105,12 @@ bool ZipFile::IsValidZipFileVersionNumber(const std::string& /*FileName*/)
return true;
}
+bool ZipFile::IsValidZipFileVersionNumber(void* /* stream*/)
+{
+ return true;
+}
+
+
/** Constructs a zip file from a zip file
@precond The given parameter must be a string with length > 0
@@ -119,6 +131,16 @@ ZipFile::ZipFile(const std::string& FileName)
throw IOException(-1);
}
+ZipFile::ZipFile(void* stream, zlib_filefunc_def* fa)
+{
+ fa->opaque = stream;
+ m_uzFile = unzOpen2((const char *)NULL, fa);
+
+ if (0 == m_uzFile)
+ throw IOException(-1);
+}
+
+
/** Destroys a zip file
*/
ZipFile::~ZipFile()
diff --git a/shell/source/aqua/sysshell/makefile.mk b/shell/source/aqua/sysshell/makefile.mk
index a748e00c154e..b3cf3abdec36 100644
--- a/shell/source/aqua/sysshell/makefile.mk
+++ b/shell/source/aqua/sysshell/makefile.mk
@@ -40,7 +40,6 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
-OBJCXXFLAGS=-x objective-c++ -fobjc-exceptions
CFLAGSCXX+=$(OBJCXXFLAGS)
# --- Files --------------------------------------------------------
diff --git a/shell/source/aqua/sysshell/systemshell.cxx b/shell/source/aqua/sysshell/systemshell.cxx
index a9b4afe1a966..a9535c849f77 100644
--- a/shell/source/aqua/sysshell/systemshell.cxx
+++ b/shell/source/aqua/sysshell/systemshell.cxx
@@ -71,17 +71,49 @@ static rtl::OUString translateToExternalUrl(const rtl::OUString& internalUrl)
return extUrl;
}
+// #i104525# many versions of OSX have problems with some URLs:
+// when an app requests OSX to add one of these URLs to the "Recent Items" list
+// then this app gets killed (TextEdit, Preview, etc. and also OOo)
+static bool isDangerousUrl( const rtl::OUString& rUrl)
+{
+ // use a heuristic that detects all known cases since there is no official comment
+ // on the exact impact and root cause of the OSX bug
+ const int nLen = rUrl.getLength();
+ const sal_Unicode* p = rUrl.getStr();
+ for( int i = 0; i < nLen-3; ++i, ++p) {
+ if( p[0] != '%')
+ continue;
+ // escaped percent?
+ if( (p[1] == '2') && (p[2] == '5'))
+ return true;
+ // escapes are considered to be UTF-8 encoded
+ // => check for invalid UTF-8 leading byte
+ if( (p[1] != 'f') && (p[1] != 'F'))
+ continue;
+ int cLowNibble = p[2];
+ if( (cLowNibble >= '0') && (cLowNibble <= '9'))
+ return false;
+ if( cLowNibble >= 'a')
+ cLowNibble -= 'a' - 'A';
+ if( (cLowNibble < 'A') || (cLowNibble >= 'C'))
+ return true;
+ }
+
+ return false;
+}
+
namespace SystemShell {
//##############################
- void AddToRecentDocumentList(const rtl::OUString& aFileUrl, const rtl::OUString& aMimeType)
+ void AddToRecentDocumentList(const rtl::OUString& aFileUrl, const rtl::OUString& /*aMimeType*/)
{
// Convert file URL for external use (see above)
rtl::OUString externalUrl = translateToExternalUrl(aFileUrl);
if( 0 == externalUrl.getLength() )
externalUrl = aFileUrl;
- if( externalUrl.getLength() )
+ if( externalUrl.getLength()
+ && !isDangerousUrl( externalUrl))
{
NSString* pString = [[NSString alloc] initWithCharacters: externalUrl.getStr() length: externalUrl.getLength()];
NSURL* pURL = [NSURL URLWithString: pString];
diff --git a/shell/source/backends/kde4be/exports.map b/shell/source/backends/kde4be/exports.map
new file mode 100644
index 000000000000..ba501f9ae076
--- /dev/null
+++ b/shell/source/backends/kde4be/exports.map
@@ -0,0 +1,10 @@
+UDK_3_0_0 {
+ global:
+ GetVersionInfo;
+ component_getImplementationEnvironment;
+ component_getFactory;
+ component_writeInfo;
+
+ local:
+ *;
+};
diff --git a/shell/source/backends/kde4be/kde4backend.cxx b/shell/source/backends/kde4be/kde4backend.cxx
new file mode 100644
index 000000000000..7eb093bf7217
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4backend.cxx
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * 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: kde4backend.cxx,v $
+ * $Revision: 1.7 $
+ *
+ * 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_shell.hxx"
+
+#include "kde4backend.hxx"
+#include "kde4commonlayer.hxx"
+#include "kde4inetlayer.hxx"
+#include "kde4vcllayer.hxx"
+#include "kde4pathslayer.hxx"
+
+//------------------------------------------------------------------------------
+
+KDEBackend* KDEBackend::mInstance= 0;
+
+KDEBackend* KDEBackend::createInstance(const uno::Reference<uno::XComponentContext>& xContext)
+{
+ if (mInstance == 0)
+ {
+ mInstance = new KDEBackend (xContext);
+ }
+
+ return mInstance;
+}
+
+//------------------------------------------------------------------------------
+
+KDEBackend::KDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
+ throw (backend::BackendAccessException)
+ : BackendBase(mMutex), m_xContext(xContext)
+{
+}
+
+//------------------------------------------------------------------------------
+
+KDEBackend::~KDEBackend(void)
+{
+}
+
+//------------------------------------------------------------------------------
+
+uno::Reference<backend::XLayer> SAL_CALL KDEBackend::getLayer(
+ const rtl::OUString& aComponent, const rtl::OUString& /* aTimestamp */)
+ throw (backend::BackendAccessException, lang::IllegalArgumentException)
+{
+ uno::Reference<backend::XLayer> xLayer;
+
+ if( aComponent.equalsAscii("org.openoffice.Office.Common" ) )
+ {
+ xLayer = new KDECommonLayer(m_xContext);
+ }
+ else if( aComponent.equalsAscii("org.openoffice.Inet" ) )
+ {
+ xLayer = new KDEInetLayer(m_xContext);
+ }
+ else if( aComponent.equalsAscii("org.openoffice.VCL" ) )
+ {
+ xLayer = new KDEVCLLayer(m_xContext);
+ }
+ else if( aComponent.equalsAscii("org.openoffice.Office.Paths" ) )
+ {
+ xLayer = new KDEPathsLayer(m_xContext);
+ }
+
+ return xLayer;
+}
+
+//------------------------------------------------------------------------------
+
+uno::Reference<backend::XUpdatableLayer> SAL_CALL
+KDEBackend::getUpdatableLayer(const rtl::OUString& /* aComponent */)
+ throw (backend::BackendAccessException,lang::NoSupportException,
+ lang::IllegalArgumentException)
+{
+ throw lang::NoSupportException( rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("KDEBackend: No Update Operation allowed, Read Only access") ),
+ *this) ;
+}
+
+//------------------------------------------------------------------------------
+
+rtl::OUString SAL_CALL KDEBackend::getBackendName(void)
+{
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.KDE4Backend") );
+}
+
+//------------------------------------------------------------------------------
+
+rtl::OUString SAL_CALL KDEBackend::getImplementationName(void)
+ throw (uno::RuntimeException)
+{
+ return getBackendName() ;
+}
+
+//------------------------------------------------------------------------------
+
+uno::Sequence<rtl::OUString> SAL_CALL KDEBackend::getBackendServiceNames(void)
+{
+ uno::Sequence<rtl::OUString> aServices(1) ;
+ aServices[0] = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.KDE4Backend")) ;
+
+ return aServices ;
+}
+
+//------------------------------------------------------------------------------
+
+sal_Bool SAL_CALL KDEBackend::supportsService(const rtl::OUString& aServiceName)
+ throw (uno::RuntimeException)
+{
+ uno::Sequence< rtl::OUString > const svc = getBackendServiceNames();
+
+ for(sal_Int32 i = 0; i < svc.getLength(); ++i )
+ if(svc[i] == aServiceName)
+ return true;
+
+ return false;
+}
+
+//------------------------------------------------------------------------------
+
+uno::Sequence<rtl::OUString>
+SAL_CALL KDEBackend::getSupportedServiceNames(void)
+ throw (uno::RuntimeException)
+{
+ return getBackendServiceNames() ;
+}
+
+// ---------------------------------------------------------------------------------------
diff --git a/shell/source/backends/kde4be/kde4backend.hxx b/shell/source/backends/kde4be/kde4backend.hxx
new file mode 100644
index 000000000000..01599c41a74d
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4backend.hxx
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * 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: kde4backend.hxx,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.
+ *
+ ************************************************************************/
+
+#pragma once
+
+#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
+#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
+#include <cppuhelper/compbase2.hxx>
+
+#ifndef INCLUDED_MAP
+#include <map>
+#define INCLUDED_MAP
+#endif
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+namespace lang = css::lang ;
+namespace backend = css::configuration::backend ;
+
+
+//------------------------------------------------------------------------------
+typedef cppu::WeakComponentImplHelper2<backend::XSingleLayerStratum,
+ lang::XServiceInfo> BackendBase ;
+
+/**
+ Implements the SingleLayerStratum service for KDE access.
+ */
+class KDEBackend : public BackendBase {
+ public :
+
+ static KDEBackend* createInstance(const uno::Reference<uno::XComponentContext>& xContext);
+
+ // XServiceInfo
+ virtual rtl::OUString SAL_CALL getImplementationName( )
+ throw (uno::RuntimeException) ;
+
+ virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& aServiceName )
+ throw (uno::RuntimeException) ;
+
+ virtual uno::Sequence<rtl::OUString> SAL_CALL getSupportedServiceNames( )
+ throw (uno::RuntimeException) ;
+
+ /**
+ Provides the implementation name.
+
+ @return implementation name
+ */
+ static rtl::OUString SAL_CALL getBackendName(void) ;
+
+ /**
+ Provides the supported services names
+
+ @return service names
+ */
+ static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void) ;
+
+ //XSingleLayerStratum
+ virtual uno::Reference<backend::XLayer> SAL_CALL
+ getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
+ throw (backend::BackendAccessException, lang::IllegalArgumentException) ;
+
+ virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
+ getUpdatableLayer( const rtl::OUString& aLayerId )
+ throw (backend::BackendAccessException, lang::NoSupportException,
+ lang::IllegalArgumentException) ;
+
+ protected:
+ /**
+ Service constructor from a service factory.
+
+ @param xContext component context
+ */
+ KDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
+ throw (backend::BackendAccessException);
+
+ /** Destructor */
+ ~KDEBackend(void) ;
+
+ private:
+
+ /** Build KDE/OO mapping table */
+ void initializeMappingTable ();
+
+
+ /** The component context */
+ uno::Reference<uno::XComponentContext> m_xContext;
+
+ /** Mutex for reOOurces protection */
+ osl::Mutex mMutex ;
+
+ static KDEBackend* mInstance;
+};
diff --git a/shell/source/backends/kde4be/kde4be.xml b/shell/source/backends/kde4be/kde4be.xml
new file mode 100644
index 000000000000..ea2d9be6dd6b
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4be.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
+<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
+ <module-name>kde4be</module-name>
+ <component-description>
+ <author> Éric Bischoff </author>
+ <name>com.sun.star.comp.configuration.backend.KDE4Backend</name>
+ <description> The KDE4 configuration backend </description>
+ <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
+ <language>c++</language>
+ <status value="beta"/>
+ <supported-service>com.sun.star.comp.configuration.backend.KDE4Backend</supported-service>
+ <service-dependency>...</service-dependency>
+ <type>com.sun.star.configuration.backend.XBackendChangesListener</type>
+ <type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
+ <type>com.sun.star.configuration.backend.XLayerHandler</type>
+ <type>com.sun.star.configuration.backend.XSingleLayerStratum</type>
+ <type>com.sun.star.lang.XMultiComponentFactory</type>
+ <type>com.sun.star.lang.XServiceInfo</type>
+ <type>com.sun.star.lang.XSingleComponentFactory</type>
+ <type>com.sun.star.lang.XTypeProvider</type>
+ <type>com.sun.star.uno.TypeClass</type>
+ <type>com.sun.star.uno.XAggregation</type>
+ <type>com.sun.star.uno.XComponentContext</type>
+ <type>com.sun.star.uno.XCurrentContext</type>
+ <type>com.sun.star.uno.XWeak</type>
+ <type>com.sun.star.registry.XRegistryKey</type>
+ </component-description>
+ <project-build-dependency>cppuhelper</project-build-dependency>
+ <project-build-dependency>cppu</project-build-dependency>
+ <project-build-dependency>sal</project-build-dependency>
+ <runtime-module-dependency>cppuhelper3$(COM)</runtime-module-dependency>
+ <runtime-module-dependency>cppu3</runtime-module-dependency>
+ <runtime-module-dependency>sal3</runtime-module-dependency>
+</module-description>
diff --git a/shell/source/backends/kde4be/kde4be1-ucd.txt b/shell/source/backends/kde4be/kde4be1-ucd.txt
new file mode 100644
index 000000000000..9671199b26e3
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4be1-ucd.txt
@@ -0,0 +1,6 @@
+[ComponentDescriptor]
+ImplementationName=com.sun.star.comp.configuration.backend.KDE4Backend
+ComponentName=kde4be1.uno.so
+LoaderName=com.sun.star.loader.SharedLibrary
+[SupportedServices]
+com.sun.star.configuration.backend.KDE4Backend
diff --git a/shell/source/backends/kde4be/kde4becdef.cxx b/shell/source/backends/kde4be/kde4becdef.cxx
new file mode 100644
index 000000000000..da0d22ead22e
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4becdef.cxx
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * 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: kde4becdef.cxx,v $
+ * $Revision: 1.8 $
+ *
+ * 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_shell.hxx"
+#include "kde4backend.hxx"
+
+#include <kapplication.h>
+
+#include <cppuhelper/implementationentry.hxx>
+
+#include <com/sun/star/registry/XRegistryKey.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include "uno/current_context.hxx"
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+namespace lang = css::lang ;
+namespace backend = css::configuration::backend ;
+
+//==============================================================================
+
+static uno::Reference<uno::XInterface> SAL_CALL createKDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
+{
+ try {
+ uno::Reference< uno::XCurrentContext > xCurrentContext(uno::getCurrentContext());
+
+ if (xCurrentContext.is())
+ {
+ uno::Any aValue = xCurrentContext->getValueByName(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "system.desktop-environment" ) ) );
+
+ rtl::OUString aDesktopEnvironment;
+ if ( (aValue >>= aDesktopEnvironment) && (aDesktopEnvironment.equalsAscii("KDE")) && (KApplication::kApplication() != NULL) )
+ return * KDEBackend::createInstance(xContext);
+ }
+
+ return uno::Reference<uno::XInterface>();
+
+ } catch (uno::RuntimeException e) {
+ return uno::Reference<uno::XInterface>();
+ }
+
+}
+
+//==============================================================================
+
+static const cppu::ImplementationEntry kImplementations_entries[] =
+{
+ {
+ createKDEBackend,
+ KDEBackend::getBackendName,
+ KDEBackend::getBackendServiceNames,
+ cppu::createSingleComponentFactory,
+ NULL,
+ 0
+ },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
+} ;
+//------------------------------------------------------------------------------
+
+extern "C" void SAL_CALL component_getImplementationEnvironment(
+ const sal_Char **aEnvTypeName,
+ uno_Environment **) {
+ *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
+}
+
+//------------------------------------------------------------------------------
+
+extern "C" sal_Bool SAL_CALL component_writeInfo(void *,
+ void *pRegistryKey) {
+
+ using namespace ::com::sun::star::registry;
+ if (pRegistryKey)
+ {
+ try
+ {
+ uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + KDEBackend::getBackendName()
+ );
+
+ // Register associated service names
+ uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
+ );
+
+ uno::Sequence<rtl::OUString> sServiceNames = KDEBackend::getBackendServiceNames();
+ for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i)
+ xServicesKey->createKey(sServiceNames[i]);
+
+ return sal_True;
+ }
+
+ catch( InvalidRegistryException& )
+ {
+ OSL_ENSURE(sal_False, "InvalidRegistryException caught");
+ }
+ }
+
+ return sal_False;
+}
+
+//------------------------------------------------------------------------------
+
+extern "C" void *component_getFactory(const sal_Char *aImplementationName,
+ void *aServiceManager,
+ void *aRegistryKey) {
+
+ return cppu::component_getFactoryHelper(
+ aImplementationName,
+ aServiceManager,
+ aRegistryKey,
+ kImplementations_entries) ;
+}
+//------------------------------------------------------------------------------
diff --git a/shell/source/backends/kde4be/kde4commonlayer.cxx b/shell/source/backends/kde4be/kde4commonlayer.cxx
new file mode 100644
index 000000000000..1ce844672225
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4commonlayer.cxx
@@ -0,0 +1,157 @@
+/*************************************************************************
+ *
+ * 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: kde4commonlayer.cxx,v $
+ * $Revision: 1.7 $
+ *
+ * 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_shell.hxx"
+
+#include "kde4commonlayer.hxx"
+
+#include <kemailsettings.h>
+#include <kglobalsettings.h>
+
+#include <QFont>
+
+#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
+#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#define SPACE ' '
+
+//==============================================================================
+
+KDECommonLayer::KDECommonLayer(const uno::Reference<uno::XComponentContext>& xContext)
+{
+ //Create instance of LayerContentDescriber Service
+ rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.backend.LayerDescriber"));
+
+ typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
+ uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
+ if( xServiceManager.is() )
+ {
+ m_xLayerContentDescriber = LayerDescriber::query(
+ xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
+ }
+ else
+ {
+ OSL_TRACE("Could not retrieve ServiceManager");
+ }
+}
+
+//------------------------------------------------------------------------------
+
+void SAL_CALL KDECommonLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
+ throw ( backend::MalformedDataException, lang::NullPointerException,
+ lang::WrappedTargetException, uno::RuntimeException)
+{
+ if( ! m_xLayerContentDescriber.is() )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
+ ) ), static_cast < backend::XLayer * > (this) );
+ }
+
+ uno::Sequence<backend::PropertyInfo> aPropInfoList(3);
+ sal_Int32 nProperties = 0;
+
+ // Email client settings
+ KEMailSettings aEmailSettings;
+ QString aClientProgram;
+ ::rtl::OUString sClientProgram;
+
+ aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
+ if ( aClientProgram.isEmpty() )
+ aClientProgram = "kmail";
+ else
+ aClientProgram = aClientProgram.section(SPACE, 0, 0);
+ sClientProgram = (const sal_Unicode *) aClientProgram.utf16();
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/ExternalMailer/Program") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "string" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( sClientProgram );
+
+ // Source code font settings
+ QFont aFixedFont;
+ QString aFontName;
+ :: rtl::OUString sFontName;
+ short nFontHeight;
+
+ aFixedFont = KGlobalSettings::fixedFont();
+ aFontName = aFixedFont.family();
+ sFontName = (const sal_Unicode *) aFontName.utf16();
+ nFontHeight = aFixedFont.pointSize();
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontName") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "string" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( sFontName );
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontHeight") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "short" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( nFontHeight );
+
+ if( nProperties > 0 )
+ {
+ aPropInfoList.realloc(nProperties);
+ m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
+ }
+}
+
+//------------------------------------------------------------------------------
+
+rtl::OUString SAL_CALL KDECommonLayer::getTimestamp(void)
+ throw (uno::RuntimeException)
+{
+ // Return the value as timestamp to avoid regenerating the binary cache
+ // on each office launch.
+
+ KEMailSettings aEmailSettings;
+ QString aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
+ aClientProgram = aClientProgram.section(SPACE, 0, 0);
+
+ QString aFixedFont = KGlobalSettings::fixedFont().toString();
+
+ ::rtl::OUString sTimeStamp,
+ sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
+
+ sTimeStamp = (const sal_Unicode *) aClientProgram.utf16();
+ sTimeStamp += sep;
+ sTimeStamp += (const sal_Unicode *) aFixedFont.utf16();
+
+ return sTimeStamp;
+}
diff --git a/shell/source/backends/kde4be/kde4commonlayer.hxx b/shell/source/backends/kde4be/kde4commonlayer.hxx
new file mode 100644
index 000000000000..9ce4cd4dc962
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4commonlayer.hxx
@@ -0,0 +1,51 @@
+#pragma once
+
+#include "kde4backend.hxx"
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/configuration/backend/XLayer.hpp>
+#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
+#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
+#include <com/sun/star/util/XTimeStamped.hpp>
+#include <cppuhelper/implbase2.hxx>
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+namespace lang = css::lang ;
+namespace backend = css::configuration::backend ;
+namespace util = css::util ;
+
+/**
+ Implementation of the XLayer interface for the KDE values mapped into
+ the org.openoffice.Office.Common configuration component.
+ */
+class KDECommonLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
+{
+public :
+ /**
+ Constructor given the component context
+
+ @param xContext The component context
+ */
+
+ KDECommonLayer(const uno::Reference<uno::XComponentContext>& xContext);
+
+ // XLayer
+ virtual void SAL_CALL readData(
+ const uno::Reference<backend::XLayerHandler>& xHandler)
+ throw ( backend::MalformedDataException,
+ lang::NullPointerException,
+ lang::WrappedTargetException,
+ uno::RuntimeException) ;
+
+ // XTimeStamped
+ virtual rtl::OUString SAL_CALL getTimestamp(void)
+ throw (uno::RuntimeException);
+
+ protected:
+
+ /** Destructor */
+ ~KDECommonLayer(void) {}
+
+ private :
+ uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
+};
diff --git a/shell/source/backends/kde4be/kde4inetlayer.cxx b/shell/source/backends/kde4be/kde4inetlayer.cxx
new file mode 100644
index 000000000000..bc661a093fb7
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4inetlayer.cxx
@@ -0,0 +1,255 @@
+/*************************************************************************
+ *
+ * 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: kde4inetlayer.cxx,v $
+ * $Revision: 1.7 $
+ *
+ * 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_shell.hxx"
+
+#include <kprotocolmanager.h>
+
+#include "kde4inetlayer.hxx"
+#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
+#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#define COMMA ','
+#define SEMI_COLON ';'
+
+//==============================================================================
+
+KDEInetLayer::KDEInetLayer(const uno::Reference<uno::XComponentContext>& xContext)
+{
+ //Create instance of LayerContentDescriber Service
+ rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.backend.LayerDescriber"));
+
+ typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
+ uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
+ if( xServiceManager.is() )
+ {
+ m_xLayerContentDescriber = LayerDescriber::query(
+ xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
+ }
+ else
+ {
+ OSL_TRACE("Could not retrieve ServiceManager");
+ }
+}
+
+//------------------------------------------------------------------------------
+
+void SAL_CALL KDEInetLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
+ throw ( backend::MalformedDataException, lang::NullPointerException,
+ lang::WrappedTargetException, uno::RuntimeException)
+{
+ if( ! m_xLayerContentDescriber.is() )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
+ ) ), static_cast < backend::XLayer * > (this) );
+ }
+
+ uno::Sequence<backend::PropertyInfo> aPropInfoList(8);
+ sal_Int32 nProperties = 0;
+
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ setProxy(aPropInfoList, nProperties, 1,
+ KProtocolManager::noProxyFor(),
+ KProtocolManager::proxyFor( "HTTP" ),
+ KProtocolManager::proxyFor( "FTP" ),
+ KProtocolManager::proxyFor( "HTTPS" ));
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ setProxy(aPropInfoList, nProperties, 1,
+ KProtocolManager::noProxyFor(),
+ KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") ),
+ KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") ),
+ KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") ));
+ break;
+ default: // No proxy is used
+ setProxy(aPropInfoList, nProperties, 0);
+ }
+
+ if ( nProperties > 0 )
+ {
+ aPropInfoList.realloc(nProperties);
+ m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
+ }
+}
+
+//------------------------------------------------------------------------------
+
+rtl::OUString SAL_CALL KDEInetLayer::getTimestamp(void)
+ throw (uno::RuntimeException)
+{
+ // Return the value as timestamp to avoid regenerating the binary cache
+ // on each office launch.
+
+ QString aProxyType, aNoProxyFor, aHTTPProxy, aHTTPSProxy, aFTPProxy;
+
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy:
+ aProxyType = '1';
+ aNoProxyFor = KProtocolManager::noProxyFor();
+ aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
+ aHTTPProxy = KProtocolManager::proxyFor( "HTTPS" );
+ aFTPProxy = KProtocolManager::proxyFor( "FTP" );
+ break;
+ case KProtocolManager::PACProxy:
+ case KProtocolManager::WPADProxy:
+ case KProtocolManager::EnvVarProxy:
+ aProxyType = '1';
+ aNoProxyFor = KProtocolManager::noProxyFor();
+ aHTTPProxy = KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") );
+ aHTTPSProxy = KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") );
+ aFTPProxy = KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") );
+ break;
+ default:
+ aProxyType = '0';
+ }
+
+ ::rtl::OUString sTimeStamp,
+ sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
+
+ sTimeStamp = (const sal_Unicode *) aProxyType.utf16();
+ sTimeStamp += sep;
+ sTimeStamp += (const sal_Unicode *) aNoProxyFor.utf16();
+ sTimeStamp += sep;
+ sTimeStamp += (const sal_Unicode *) aHTTPProxy.utf16();
+ sTimeStamp += sep;
+ sTimeStamp += (const sal_Unicode *) aHTTPSProxy.utf16();
+ sTimeStamp += sep;
+ sTimeStamp += (const sal_Unicode *) aFTPProxy.utf16();
+
+ return sTimeStamp;
+}
+
+//------------------------------------------------------------------------------
+
+void SAL_CALL KDEInetLayer::setProxy
+ (uno::Sequence<backend::PropertyInfo> &aPropInfoList, sal_Int32 &nProperties,
+ int nProxyType, const QString &aNoProxy, const QString &aHTTPProxy, const QString &aFTPProxy, const QString &aHTTPSProxy ) const
+{
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "int" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( (sal_Int32) nProxyType );
+
+ if (nProxyType == 0) return;
+
+ if ( !aNoProxy.isEmpty() )
+ {
+ QString aNoProxyFor(aNoProxy);
+ ::rtl::OUString sNoProxyFor;
+
+ aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON );
+ sNoProxyFor = (const sal_Unicode *) aNoProxyFor.utf16();
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "string" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( sNoProxyFor );
+ }
+
+ if ( !aHTTPProxy.isEmpty() )
+ {
+ KUrl aProxy(aHTTPProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
+ sal_Int32 nPort = aProxy.port();
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyName") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "string" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyPort") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "int" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
+ }
+
+ if ( !aHTTPSProxy.isEmpty() )
+ {
+ KUrl aProxy(aHTTPSProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
+ sal_Int32 nPort = aProxy.port();
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyName") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "string" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "int" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
+ }
+
+ if ( !aFTPProxy.isEmpty() )
+ {
+ KUrl aProxy(aFTPProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
+ sal_Int32 nPort = aProxy.port();
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyName") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "string" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyPort") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "int" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
+ }
+}
+
diff --git a/shell/source/backends/kde4be/kde4inetlayer.hxx b/shell/source/backends/kde4be/kde4inetlayer.hxx
new file mode 100644
index 000000000000..64d00fec45fc
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4inetlayer.hxx
@@ -0,0 +1,59 @@
+#pragma once
+
+#include <QString>
+
+#include "kde4backend.hxx"
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/configuration/backend/XLayer.hpp>
+#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
+#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
+#include <com/sun/star/util/XTimeStamped.hpp>
+#include <cppuhelper/implbase2.hxx>
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+namespace lang = css::lang ;
+namespace backend = css::configuration::backend ;
+namespace util = css::util ;
+
+/**
+ Implementation of the XLayer interface for the KDE values mapped into
+ the org.openoffice.Inet configuration component.
+ */
+class KDEInetLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
+{
+public :
+ /**
+ Constructor given the component context
+
+ @param xContext The component context
+ */
+
+ KDEInetLayer(const uno::Reference<uno::XComponentContext>& xContext);
+
+ // XLayer
+ virtual void SAL_CALL readData(
+ const uno::Reference<backend::XLayerHandler>& xHandler)
+ throw ( backend::MalformedDataException,
+ lang::NullPointerException,
+ lang::WrappedTargetException,
+ uno::RuntimeException) ;
+
+ // XTimeStamped
+ virtual rtl::OUString SAL_CALL getTimestamp(void)
+ throw (uno::RuntimeException);
+
+ protected:
+
+ /** Destructor */
+ ~KDEInetLayer(void) {}
+
+private :
+ uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
+
+ void SAL_CALL setProxy
+ (uno::Sequence<backend::PropertyInfo> &aPropInfoList, sal_Int32 &nProperties,
+ int nProxyType, const QString &aNoProxyfor = QString(),
+ const QString &aHTTPProxy = QString(), const QString &aFTPProxy = QString(), const QString &aHTTPSProxy = QString()) const;
+};
diff --git a/shell/source/backends/kde4be/kde4pathslayer.cxx b/shell/source/backends/kde4be/kde4pathslayer.cxx
new file mode 100644
index 000000000000..2511d0b57405
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4pathslayer.cxx
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * 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: kde4pathslayer.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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_shell.hxx"
+
+#include "kde4pathslayer.hxx"
+
+#include <QString>
+#include <kglobalsettings.h>
+
+#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
+#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
+
+#include <osl/security.hxx>
+#include <osl/file.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#define SPACE ' '
+
+//==============================================================================
+
+KDEPathsLayer::KDEPathsLayer(const uno::Reference<uno::XComponentContext>& xContext)
+{
+ //Create instance of LayerContentDescriber Service
+ rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.backend.LayerDescriber"));
+
+ typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
+ uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
+ if( xServiceManager.is() )
+ {
+ m_xLayerContentDescriber = LayerDescriber::query(
+ xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
+ }
+ else
+ {
+ OSL_TRACE("Could not retrieve ServiceManager");
+ }
+}
+
+//------------------------------------------------------------------------------
+
+void SAL_CALL KDEPathsLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
+ throw ( backend::MalformedDataException, lang::NullPointerException,
+ lang::WrappedTargetException, uno::RuntimeException)
+{
+ if( ! m_xLayerContentDescriber.is() )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
+ ) ), static_cast < backend::XLayer * > (this) );
+ }
+
+ uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
+ sal_Int32 nProperties = 0;
+
+ QString aDocumentsDir( KGlobalSettings::documentPath() );
+ rtl::OUString sDocumentsDir;
+ rtl::OUString sDocumentsURL;
+ if ( aDocumentsDir.endsWith(QChar('/')) )
+ aDocumentsDir.truncate ( aDocumentsDir.length() - 1 );
+ sDocumentsDir = (const sal_Unicode *) aDocumentsDir.utf16();
+ osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData );
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Paths/Variables/Work") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "string" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( sDocumentsURL );
+
+ if( nProperties > 0 )
+ {
+ aPropInfoList.realloc(nProperties);
+ m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
+ }
+}
+
+//------------------------------------------------------------------------------
+
+rtl::OUString SAL_CALL KDEPathsLayer::getTimestamp(void)
+ throw (uno::RuntimeException)
+{
+ // Return the value as timestamp to avoid regenerating the binary cache
+ // on each office launch.
+
+ ::rtl::OUString sTimeStamp,
+ sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
+
+ QString aDocumentsDir;
+ aDocumentsDir = KGlobalSettings::documentPath();
+
+ sTimeStamp += (const sal_Unicode *) aDocumentsDir.utf16();
+
+ return sTimeStamp;
+}
diff --git a/shell/source/backends/kde4be/kde4pathslayer.hxx b/shell/source/backends/kde4be/kde4pathslayer.hxx
new file mode 100644
index 000000000000..40d31a73c4f9
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4pathslayer.hxx
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * 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: kde4pathslayer.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#pragma once
+
+#include "kde4backend.hxx"
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/configuration/backend/XLayer.hpp>
+#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
+#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
+#include <com/sun/star/util/XTimeStamped.hpp>
+
+#include <cppuhelper/implbase2.hxx>
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+namespace lang = css::lang ;
+namespace backend = css::configuration::backend ;
+namespace util = css::util ;
+
+/**
+ Implementation of the XLayer interface for the KDE values mapped into
+ the org.openoffice.Office.Paths configuration component.
+ */
+class KDEPathsLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
+{
+public :
+ /**
+ Constructor given the component context
+
+ @param xContext The component context
+ */
+
+ KDEPathsLayer(const uno::Reference<uno::XComponentContext>& xContext);
+
+ // XLayer
+ virtual void SAL_CALL readData(
+ const uno::Reference<backend::XLayerHandler>& xHandler)
+ throw ( backend::MalformedDataException,
+ lang::NullPointerException,
+ lang::WrappedTargetException,
+ uno::RuntimeException) ;
+
+ // XTimeStamped
+ virtual rtl::OUString SAL_CALL getTimestamp(void)
+ throw (uno::RuntimeException);
+
+ protected:
+
+ /** Destructor */
+ ~KDEPathsLayer(void) {}
+
+ private :
+ uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
+};
diff --git a/shell/source/backends/kde4be/kde4vcllayer.cxx b/shell/source/backends/kde4be/kde4vcllayer.cxx
new file mode 100644
index 000000000000..780c3e4e7ce1
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4vcllayer.cxx
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * 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: kde4vcllayer.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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_shell.hxx"
+
+#include "kde4vcllayer.hxx"
+
+#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
+#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+
+//==============================================================================
+
+KDEVCLLayer::KDEVCLLayer(const uno::Reference<uno::XComponentContext>& xContext)
+{
+ //Create instance of LayerContentDescriber Service
+ rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.backend.LayerDescriber"));
+
+ typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
+ uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
+ if( xServiceManager.is() )
+ {
+ m_xLayerContentDescriber = LayerDescriber::query(
+ xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
+ }
+ else
+ {
+ OSL_TRACE("Could not retrieve ServiceManager");
+ }
+}
+
+//------------------------------------------------------------------------------
+
+void SAL_CALL KDEVCLLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
+ throw ( backend::MalformedDataException, lang::NullPointerException,
+ lang::WrappedTargetException, uno::RuntimeException)
+{
+ if( ! m_xLayerContentDescriber.is() )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
+ ) ), static_cast < backend::XLayer * > (this) );
+ }
+
+ uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
+
+/*
+ Commenting out, does not make much sense without an accessibility bridge
+===========================================================================
+#if defined(QT_ACCESSIBILITY_SUPPORT)
+// Accessibility tools under Qt for UNIX are available starting with Qt 4.0
+ int nVersionMajor = 0;
+ const char *q = qVersion(); // "3.1.0" for example
+ while ('0' <= *q && *q <= '9')
+ nVersionMajor = nVersionMajor * 10 + *q++ - '0';
+ sal_Bool ATToolSupport = (sal_Bool) (nVersionMajor >= 4);
+#else
+ sal_Bool ATToolSupport = sal_False;
+#endif
+===========================================================================
+ End of commented out section
+*/ sal_Bool ATToolSupport = sal_False;
+
+ aPropInfoList[0].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.VCL/Settings/Accessibility/EnableATToolSupport") );
+ aPropInfoList[0].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "string" ) );
+ aPropInfoList[0].Protected = sal_False;
+ aPropInfoList[0].Value = uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) );
+
+ m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
+}
+
+//------------------------------------------------------------------------------
+
+rtl::OUString SAL_CALL KDEVCLLayer::getTimestamp(void)
+ throw (uno::RuntimeException)
+{
+ // Return the value as timestamp to avoid regenerating the binary cache
+ // on each office launch.
+
+ ::rtl::OUString sTimeStamp(
+ RTL_CONSTASCII_USTRINGPARAM( "FALSE" ) );
+
+ return sTimeStamp;
+}
diff --git a/shell/source/backends/kde4be/kde4vcllayer.hxx b/shell/source/backends/kde4be/kde4vcllayer.hxx
new file mode 100644
index 000000000000..16036ee89122
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4vcllayer.hxx
@@ -0,0 +1,53 @@
+#pragma once
+
+#include "kde4backend.hxx"
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/configuration/backend/XLayer.hpp>
+#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
+#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
+#include <com/sun/star/util/XTimeStamped.hpp>
+
+#include <cppuhelper/implbase2.hxx>
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+namespace lang = css::lang ;
+namespace backend = css::configuration::backend ;
+namespace util = css::util ;
+
+/**
+ Implementation of the XLayer interface for the KDE values mapped into
+ the org.openoffice.VCL configuration component.
+ */
+class KDEVCLLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
+{
+public :
+ /**
+ Constructor given the component context
+
+ @param xContext The component context
+ */
+
+ KDEVCLLayer(const uno::Reference<uno::XComponentContext>& xContext);
+
+ // XLayer
+ virtual void SAL_CALL readData(
+ const uno::Reference<backend::XLayerHandler>& xHandler)
+ throw ( backend::MalformedDataException,
+ lang::NullPointerException,
+ lang::WrappedTargetException,
+ uno::RuntimeException) ;
+
+ // XTimeStamped
+ virtual rtl::OUString SAL_CALL getTimestamp(void)
+ throw (uno::RuntimeException);
+
+ protected:
+
+ /** Destructor */
+ ~KDEVCLLayer(void) {}
+
+ private :
+ uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
+};
diff --git a/shell/source/backends/kde4be/makefile.mk b/shell/source/backends/kde4be/makefile.mk
new file mode 100644
index 000000000000..6f92762e5ae1
--- /dev/null
+++ b/shell/source/backends/kde4be/makefile.mk
@@ -0,0 +1,94 @@
+#*************************************************************************
+#
+# 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.5 $
+#
+# 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=shell
+TARGET=kde4be
+
+LIBTARGET=NO
+ENABLE_EXCEPTIONS=TRUE
+
+COMP1TYPELIST=$(TARGET)
+COMPRDB=$(SOLARBINDIR)$/types.rdb
+UNOUCROUT=$(OUT)$/inc$/$(TARGET)
+INCPRE=$(UNOUCROUT)
+
+# --- Settings ---
+
+.INCLUDE : settings.mk
+
+# For some of the included external KDE headers, GCC complains about shadowed
+# symbols in instantiated template code only at the end of a compilation unit,
+# so the only solution is to disable that warning here:
+.IF "$(COM)" == "GCC"
+CFLAGSCXX+=-Wno-shadow
+.ENDIF
+
+UNIXTEXT=$(MISC)/$(TARGET)1-ucd.txt
+
+# no "lib" prefix
+DLLPRE =
+
+.IF "$(ENABLE_KDE4)" == "TRUE"
+
+CFLAGS+=$(KDE4_CFLAGS)
+
+# --- Files ---
+
+SLOFILES=\
+ $(SLO)$/kde4backend.obj \
+ $(SLO)$/kde4commonlayer.obj \
+ $(SLO)$/kde4inetlayer.obj \
+ $(SLO)$/kde4vcllayer.obj \
+ $(SLO)$/kde4pathslayer.obj \
+ $(SLO)$/kde4becdef.obj
+
+SHL1NOCHECK=TRUE
+SHL1TARGET=$(TARGET)1.uno
+SHL1OBJS=$(SLOFILES)
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+
+SHL1IMPLIB=i$(SHL1TARGET)
+SHL1STDLIBS= \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(SALLIB) \
+ $(KDE4_LIBS) -lkio
+
+SHL1VERSIONMAP=exports.map
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+DEF1NAME=$(SHL1TARGET)
+
+.ENDIF
+
+# --- Targets ---
+
+.INCLUDE : target.mk
diff --git a/shell/source/backends/macbe/makefile.mk b/shell/source/backends/macbe/makefile.mk
index dd2b166ce1ce..c8f6891d6f87 100644
--- a/shell/source/backends/macbe/makefile.mk
+++ b/shell/source/backends/macbe/makefile.mk
@@ -50,11 +50,10 @@ DLLPRE =
.IF "$(OS)" != "MACOSX"
dummy:
- @echo "Nothing to build for OS $(OS)."
+ @echo "Nothing to build for OS $(OS)."
.ELSE
-OBJCXXFLAGS=-x objective-c++ -fobjc-exceptions
CFLAGSCXX+=$(OBJCXXFLAGS)
SLOFILES= \
diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx
index 315f78c517ff..4ee0f32eb072 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -97,12 +97,10 @@ void escapeForShell( rtl::OStringBuffer & rBuffer, const rtl::OString & rURL)
{
// escape every non alpha numeric characters (excluding a few "known good") by prepending a '\'
sal_Char c = rURL[n];
- if( ( c < 'A' || c > 'Z' ) && ( c < 'a' || c > 'z' ) && ( c < '0' || c > '9' )
-#ifdef OS2 // YD we don't need to escape ':', '-', '\\', '_'
- && c != ':' && c != '-' && c != '\\' && c != '_'
-#endif
- && c != '/' && c != '.' )
+#ifndef OS2 // YD shell does not support escaped chars
+ if( ( c < 'A' || c > 'Z' ) && ( c < 'a' || c > 'z' ) && ( c < '0' || c > '9' ) && c != '/' && c != '.' )
rBuffer.append( '\\' );
+#endif
rBuffer.append( c );
}
@@ -210,6 +208,19 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar
static_cast < XSystemShellExecute * > (this), ENOENT );
}
+#ifdef OS2
+ OStringBuffer aProg = OUStringToOString(aProgram, osl_getThreadTextEncoding());
+ aProg.append("open-url.exe");
+ OString aUrl = OUStringToOString(aURL, osl_getThreadTextEncoding());
+ if ( -1 == spawnl(P_NOWAIT, aProg.getStr(), aProg.getStr(), aUrl.getStr() , NULL) )
+ {
+ int nerr = errno;
+ throw SystemShellExecuteException(OUString::createFromAscii( strerror( nerr ) ),
+ static_cast < XSystemShellExecute * > (this), nerr );
+ }
+ return;
+#endif
+
OString aTmp = OUStringToOString(aProgram, osl_getThreadTextEncoding());
escapeForShell(aBuffer, aTmp);
diff --git a/shell/source/unix/misc/makefile.mk b/shell/source/unix/misc/makefile.mk
index ba2ed56b83ef..8a5ee366223a 100644
--- a/shell/source/unix/misc/makefile.mk
+++ b/shell/source/unix/misc/makefile.mk
@@ -72,7 +72,7 @@ APP1TARGET = gnome-open-url.bin
APP1OBJS = \
$(OBJ)$/gnome-open-url.obj
APP1LIBS =
-.IF "$(OS)"!="FREEBSD"
+.IF "$(OS)"!="FREEBSD" && "$(OS)"!="NETBSD"
APP1STDLIBS=-ldl
.ENDIF
diff --git a/shell/source/unix/misc/open-url.c b/shell/source/unix/misc/open-url.c
index 00a2e3bff774..f8e76f26ec5d 100644
--- a/shell/source/unix/misc/open-url.c
+++ b/shell/source/unix/misc/open-url.c
@@ -1,35 +1,27 @@
/*************************************************************************
*
- * OpenOffice.org - a multi-platform office productivity suite
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * $RCSfile:$
+ * Copyright 2008 by Sun Microsystems, Inc.
*
- * $Revision:$
+ * OpenOffice.org - a multi-platform office productivity suite
*
- * last change: $Author:$
+ * This file is part of OpenOffice.org.
*
- * The Contents of this file are made available subject to
- * the terms of GNU Lesser General Public License Version 2.1.
+ * 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).
*
- * 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
+ * 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/shell/source/unix/misc/senddoc.c b/shell/source/unix/misc/senddoc.c
index e918ba69c86d..bbe96420699d 100644
--- a/shell/source/unix/misc/senddoc.c
+++ b/shell/source/unix/misc/senddoc.c
@@ -1,35 +1,27 @@
/*************************************************************************
*
- * OpenOffice.org - a multi-platform office productivity suite
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * $RCSfile:$
+ * Copyright 2008 by Sun Microsystems, Inc.
*
- * $Revision:$
+ * OpenOffice.org - a multi-platform office productivity suite
*
- * last change: $Author:$
+ * This file is part of OpenOffice.org.
*
- * The Contents of this file are made available subject to
- * the terms of GNU Lesser General Public License Version 2.1.
+ * 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).
*
- * 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
+ * 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/shell/source/win32/shlxthandler/ooofilt/makefile.mk b/shell/source/win32/shlxthandler/ooofilt/makefile.mk
index 74ecf35ac5fc..22127bc8ddac 100644
--- a/shell/source/win32/shlxthandler/ooofilt/makefile.mk
+++ b/shell/source/win32/shlxthandler/ooofilt/makefile.mk
@@ -36,6 +36,13 @@ LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
USE_DEFFILE=TRUE
+# Do not use the dynamic STLport library.
+# NO_DEFAULT_STL=YES
+
+# Do not use the uwinapi library
+UWINAPILIB=
+
+
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
@@ -43,11 +50,10 @@ USE_DEFFILE=TRUE
CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501
CFLAGS+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820
CDEFS+=-D_WIN32_IE=0x501
+# SCPCDEFS+=-D_STLP_USE_STATIC_LIB
# --- Files --------------------------------------------------------
-#UWINAPILIB=
-
SLOFILES=$(SLO)$/ooofilt.obj\
$(SLO)$/propspec.obj
@@ -71,10 +77,12 @@ SHL1STDLIBS+=$(OLE32LIB)\
$(SHELL32LIB)\
$(KERNEL32LIB)\
$(OLDNAMESLIB)
-
+
+# $(LIBSTLPORTST)
+
SHL1LIBS+=$(SLB)$/util.lib\
$(SLB)$/ooofilereader.lib
-
+
SHL1DEPN=
SHL1OBJS=$(SLOFILES)
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
index e22fb89f94cf..ac8dd676c3b1 100644
--- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
+++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
@@ -46,7 +46,7 @@
//--------------------------------------------------------------------------
#include "internal/contentreader.hxx"
#include "internal/metainforeader.hxx"
-#include "internal/utilities.hxx"
+//#include "internal/utilities.hxx"
#include "internal/registry.hxx"
#include "internal/fileextensions.hxx"
@@ -78,6 +78,8 @@
#include <ntquery.h>
#include "assert.h"
#include "ooofilt.hxx"
+#include <objidl.h>
+#include <stdio.h>
#include "propspec.hxx"
#ifdef __MINGW32__
#include <algorithm>
@@ -117,7 +119,9 @@ COooFilter::COooFilter() :
m_fEof(FALSE),
m_ChunkPosition(0),
m_cAttributes(0),
- m_pAttributes(0)
+ m_pAttributes(0),
+ m_pStream(NULL)
+
{
InterlockedIncrement( &g_lInstances );
}
@@ -172,6 +176,8 @@ SCODE STDMETHODCALLTYPE COooFilter::QueryInterface(
pUnkTemp = (IUnknown *)(IPersistFile *)this;
else if ( IID_IPersist == riid )
pUnkTemp = (IUnknown *)(IPersist *)(IPersistFile *)this;
+ else if (IID_IPersistStream == riid)
+ pUnkTemp = (IUnknown *)(IPersistStream *)this;
else if ( IID_IUnknown == riid )
pUnkTemp = (IUnknown *)(IPersist *)(IPersistFile *)this;
else
@@ -713,6 +719,101 @@ SCODE STDMETHODCALLTYPE COooFilter::SaveCompleted(LPCWSTR /*pszFileName*/)
// File is opened read-only, so "save" is always finished
return S_OK;
}
+
+//M-------------------------------------------------------------------------
+//
+// Method: COooFilter::Load (IPersistStream::Load)
+//
+// Summary: Initializes an object from the stream where it was previously saved
+//
+// Arguments: pStm
+// [in] Pointer to stream from which object should be loaded
+//
+//
+// Returns: S_OK
+// E_OUTOFMEMORY
+// E_FAIL
+//
+//
+//--------------------------------------------------------------------------
+SCODE STDMETHODCALLTYPE COooFilter::Load(IStream *pStm)
+{
+
+ // These next few lines work around the "Seek pointer" bug found on Vista.
+
+ char buf[20];
+ unsigned long count;
+ HRESULT hr;
+ ULARGE_INTEGER NewPosition;
+ LARGE_INTEGER Move;
+ Move.QuadPart = 0;
+ hr = pStm->Seek (Move, STREAM_SEEK_SET, &NewPosition);
+ hr = pStm->Read (buf, 20, &count);
+
+ zlib_filefunc_def z_filefunc;
+ fill_stream_filefunc (&z_filefunc);
+ z_filefunc.opaque = (void*)pStm;
+
+ m_pStream = pStm;
+
+ try
+ {
+ if (m_pMetaInfoReader)
+ delete m_pMetaInfoReader;
+ m_pMetaInfoReader = new CMetaInfoReader((void*)m_pStream, &z_filefunc);
+
+ if (m_pContentReader)
+ delete m_pContentReader;
+ m_pContentReader = new CContentReader((void*)m_pStream, m_pMetaInfoReader->getDefaultLocale(), &z_filefunc);
+ }
+ catch (const std::exception&)
+ {
+ return E_FAIL;
+ }
+ return S_OK;
+}
+
+//M-------------------------------------------------------------------------
+//
+// Method: COooFilter::GetSizeMax (IPersistStream::GetSizeMax)
+//
+// Summary: Returns the size in bytes of the stream neede to save the object.
+//
+// Arguments: pcbSize
+// [out] Pointer to a 64 bit unsigned int indicating the size needed
+//
+// Returns: E_NOTIMPL
+//
+//
+//--------------------------------------------------------------------------
+SCODE STDMETHODCALLTYPE COooFilter::GetSizeMax(ULARGE_INTEGER * /*pcbSize*/)
+{
+ //
+ return E_NOTIMPL;
+}
+
+//M-------------------------------------------------------------------------
+//
+// Method: COooFilter::Save (IPersistStream::Save)
+//
+// Summary: Save object to specified stream
+//
+// Arguments: pStm
+// [in] Pointer to stream
+//
+// fClearDirty
+// [in] Indicates whether to clear dirty flag
+//
+// Returns: E_NOTIMPL
+//
+//
+//--------------------------------------------------------------------------
+SCODE STDMETHODCALLTYPE COooFilter::Save(IStream * /*pStm*/, BOOL )
+{
+ //
+ return E_NOTIMPL;
+}
+
//M-------------------------------------------------------------------------
//
// Method: COooFilter::GetCurFile (IPersistFile::GetCurFile)
@@ -1142,9 +1243,19 @@ namespace /* private */
std::string ClsidEntry_Persist = CLSID_GUID_ENTRY;
SubstitutePlaceholder(ClsidEntry_Persist, GUID_PLACEHOLDER, ClsidToString(PersistentGuid));
+
if (!SetRegistryKey(HKEY_CLASSES_ROOT, ClsidEntry_Persist.c_str(), "", "OpenOffice.org Persistent Handler"))
return E_FAIL;
+ // Add missing entry
+ std::string ClsidEntry_Persist_Entry = CLSID_PERSIST_ENTRY;
+ SubstitutePlaceholder(ClsidEntry_Persist_Entry,
+ GUID_PLACEHOLDER,
+ ClsidToString(PersistentGuid));
+
+ if (!SetRegistryKey(HKEY_CLASSES_ROOT, ClsidEntry_Persist_Entry.c_str(), "", ClsidToString(PersistentGuid).c_str()));
+
+
std::string ClsidEntry_Persist_Addin = CLSID_GUID_PERSIST_ADDIN_ENTRY;
SubstitutePlaceholder(ClsidEntry_Persist_Addin,
GUID_PLACEHOLDER,
@@ -1393,3 +1504,100 @@ STDAPI DllUnregisterServer()
*/
return S_OK;
}
+
+extern "C" {
+
+ // IStream callback
+ voidpf ZCALLBACK cb_sopen (voidpf opaque, const char* filename, int mode) {
+ return opaque;
+ }
+
+ uLong ZCALLBACK cb_sread (voidpf opaque, voidpf stream, void* buf, uLong size) {
+ unsigned long newsize;
+ HRESULT hr;
+
+ hr = ((IStream *)stream)->Read (buf, size, &newsize);
+ if (hr == S_OK){
+ return (unsigned long)newsize;
+ }
+ else {
+ return (uLong)0;
+ }
+ }
+
+ long ZCALLBACK cb_sseek (voidpf opaque, voidpf stream, uLong offset, int origin) {
+ // IStream::Seek parameters
+ HRESULT hr;
+ LARGE_INTEGER Move;
+ DWORD dwOrigin;
+ Move.QuadPart = (__int64)offset;
+
+ switch (origin) {
+ case SEEK_CUR:
+ dwOrigin = STREAM_SEEK_CUR;
+ break;
+ case SEEK_END:
+ dwOrigin = STREAM_SEEK_END;
+ break;
+ case SEEK_SET:
+ dwOrigin = STREAM_SEEK_SET;
+ break;
+ default:
+ return -1;
+ }
+
+ hr = ((IStream*)stream)->Seek (Move, dwOrigin, NULL);
+ if (hr == S_OK){
+ return 0;
+ }
+ else {
+ return -1;
+ }
+ }
+
+ long ZCALLBACK cb_stell (voidpf opaque, voidpf stream) {
+ // IStream::Seek parameters
+ HRESULT hr;
+ LARGE_INTEGER Move;
+ ULARGE_INTEGER NewPosition;
+ Move.QuadPart = 0;
+ NewPosition.QuadPart = 0;
+
+ hr = ((IStream*)stream)->Seek (Move, STREAM_SEEK_CUR, &NewPosition);
+ if (hr == S_OK){
+ return (long) NewPosition.QuadPart;
+ }
+ else {
+ return -1;
+ }
+ }
+
+ int ZCALLBACK cb_sclose (voidpf opaque, voidpf stream) {
+ return 0;
+ }
+
+ int ZCALLBACK cb_serror (voidpf opaque, voidpf stream) {
+ return 0; //RJK - for now
+ }
+
+ uLong ZCALLBACK cb_swrite (voidpf opaque, voidpf stream, const void* buf, uLong size) {
+ HRESULT hr;
+ unsigned long writecount;
+ hr = ((IStream*)stream)->Write (buf, size, &writecount);
+ if (hr == S_OK)
+ return (unsigned int)writecount;
+ else
+ return (uLong)0;
+ }
+
+ void fill_stream_filefunc (zlib_filefunc_def* pzlib_filefunc_def) {
+ pzlib_filefunc_def->zopen_file = cb_sopen;
+ pzlib_filefunc_def->zread_file = cb_sread;
+ pzlib_filefunc_def->zwrite_file = cb_swrite;
+ pzlib_filefunc_def->ztell_file = cb_stell;
+ pzlib_filefunc_def->zseek_file = cb_sseek;
+ pzlib_filefunc_def->zclose_file = cb_sclose;
+ pzlib_filefunc_def->zerror_file = cb_serror;
+ }
+}
+
diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx
index f83e8792507f..9f1566b406bd 100644
--- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx
+++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx
@@ -96,8 +96,7 @@ enum FilterState
FilteringContent, // Filtering the content property
FilteringProperty // Filtering the pseudo property
};
-
-class COooFilter : public IFilter, public IPersistFile
+class COooFilter : public IFilter, public IPersistFile, public IPersistStream
{
public:
// From IUnknown
@@ -144,6 +143,18 @@ public:
virtual SCODE STDMETHODCALLTYPE GetCurFile(
LPWSTR * ppszFileName);
+ // From IPersistStream
+ virtual SCODE STDMETHODCALLTYPE Load(
+ IStream *pStm);
+
+ virtual SCODE STDMETHODCALLTYPE Save(
+ IStream *pStm,
+ BOOL fClearDirty);
+
+ virtual SCODE STDMETHODCALLTYPE GetSizeMax(
+ ULARGE_INTEGER *pcbSize);
+
+
private:
friend class COooFilterCF;
@@ -166,6 +177,8 @@ private:
ULONG m_ChunkPosition; // Chunk pointer to specify the current Chunk;
ULONG m_cAttributes; // Count of attributes
CFullPropSpec * m_pAttributes; // Attributes to filter
+ IStream * m_pStream;
+
};
//C-------------------------------------------------------------------------
@@ -207,6 +220,22 @@ private:
long m_lRefs; // Reference count
};
+extern "C" {
+
+ voidpf ZCALLBACK cb_sopen OF((voidpf opaque, const char * filename, int mode));
+ uLong ZCALLBACK cb_sread OF((voidpf opaque, voidpf stream, void* vuf, uLong size));
+ uLong ZCALLBACK cb_swrite OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
+ long ZCALLBACK cb_stell OF((voidpf opaque, voidpf stream));
+ long ZCALLBACK cb_sseek OF((voidpf opaque, voidpf stream, uLong offset, int origin));
+ int ZCALLBACK cb_sclose OF((voidpf opaque, voidpf stream));
+ int ZCALLBACK cb_serror OF((voidpf opaque, voidpf stream));
+
+ void fill_stream_filefunc (zlib_filefunc_def* pzlib_filefunc_def);
+
+}
+
+
+
diff --git a/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx b/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx
index 623bc7be7772..879cf8c0115b 100644
--- a/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx
+++ b/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx
@@ -147,7 +147,6 @@ extern "C" HRESULT __stdcall DllCanUnloadNow()
extern "C" HRESULT __stdcall DllRegisterServer()
{
Init();
-
if (Forward_DllRegisterServer)
return Forward_DllRegisterServer();
else
diff --git a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
index b8af5acbde78..171bc287715f 100644
--- a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
+++ b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
@@ -177,14 +177,6 @@ HRESULT STDMETHODCALLTYPE CPropertySheet::Initialize(
HRESULT STDMETHODCALLTYPE CPropertySheet::AddPages(LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
{
- try
- {
- m_pMetaInfo = std::auto_ptr<CMetaInfoReader>(new CMetaInfoReader(m_szFileName));
- }
- catch (const std::exception&)
- {
- return E_FAIL;
- }
PROPSHEETPAGE psp;
@@ -317,14 +309,17 @@ BOOL CALLBACK CPropertySheet::PropPageStatisticsProc(HWND hwnd, UINT uiMsg, WPAR
//##################################
void CPropertySheet::InitPropPageSummary(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/)
{
- SetWindowText(GetDlgItem(hwnd,IDC_TITLE), m_pMetaInfo->getTagData( META_INFO_TITLE ).c_str() );
- SetWindowText(GetDlgItem(hwnd,IDC_AUTHOR), m_pMetaInfo->getTagData( META_INFO_AUTHOR ).c_str() );
- SetWindowText(GetDlgItem(hwnd,IDC_SUBJECT), m_pMetaInfo->getTagData( META_INFO_SUBJECT ).c_str() );
- SetWindowText(GetDlgItem(hwnd,IDC_KEYWORDS), m_pMetaInfo->getTagData( META_INFO_KEYWORDS ).c_str() );
+
+ CMetaInfoReader metaInfo(m_szFileName);
+
+ SetWindowText(GetDlgItem(hwnd,IDC_TITLE), metaInfo.getTagData( META_INFO_TITLE ).c_str() );
+ SetWindowText(GetDlgItem(hwnd,IDC_AUTHOR), metaInfo.getTagData( META_INFO_AUTHOR ).c_str() );
+ SetWindowText(GetDlgItem(hwnd,IDC_SUBJECT), metaInfo.getTagData( META_INFO_SUBJECT ).c_str() );
+ SetWindowText(GetDlgItem(hwnd,IDC_KEYWORDS), metaInfo.getTagData( META_INFO_KEYWORDS ).c_str() );
// comments read from meta.xml use "\n" for return, but this will not displayable in Edit control, add
// "\r" before "\n" to form "\r\n" in order to display return in Edit control.
- std::wstring tempStr = m_pMetaInfo->getTagData( META_INFO_DESCRIPTION ).c_str();
+ std::wstring tempStr = metaInfo.getTagData( META_INFO_DESCRIPTION ).c_str();
std::wstring::size_type itor = tempStr.find ( L"\n" , 0 );
while (itor != std::wstring::npos)
{
@@ -332,6 +327,7 @@ void CPropertySheet::InitPropPageSummary(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/)
itor = tempStr.find(L"\n", itor + 2);
}
SetWindowText(GetDlgItem(hwnd,IDC_COMMENTS), tempStr.c_str());
+
}
//---------------------------------
@@ -339,7 +335,10 @@ void CPropertySheet::InitPropPageSummary(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/)
*/
void CPropertySheet::InitPropPageStatistics(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/)
{
- document_statistic_reader_ptr doc_stat_reader = create_document_statistic_reader(m_szFileName, m_pMetaInfo.get());
+
+ CMetaInfoReader metaInfo(m_szFileName);
+
+ document_statistic_reader_ptr doc_stat_reader = create_document_statistic_reader(m_szFileName, &metaInfo);
statistic_group_list_t sgl;
doc_stat_reader->read(&sgl);
@@ -350,6 +349,7 @@ void CPropertySheet::InitPropPageStatistics(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/
GetResString(IDS_PROPERTY_VALUE));
lv_builder->build(sgl);
+
}
diff --git a/shell/source/win32/shlxthandler/util/makefile.mk b/shell/source/win32/shlxthandler/util/makefile.mk
index f5d912c4b185..c0bec9c36d3b 100644
--- a/shell/source/win32/shlxthandler/util/makefile.mk
+++ b/shell/source/win32/shlxthandler/util/makefile.mk
@@ -35,6 +35,7 @@ TARGET=util
#LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
+
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
diff --git a/shell/source/win32/shlxthandler/util/utilities.cxx b/shell/source/win32/shlxthandler/util/utilities.cxx
index 0598b4d335b7..36c19dd0c500 100644
--- a/shell/source/win32/shlxthandler/util/utilities.cxx
+++ b/shell/source/win32/shlxthandler/util/utilities.cxx
@@ -586,5 +586,4 @@ LCID LocaleSetToLCID( const LocaleSet_t & Locale )
return GetSystemDefaultLCID(); //System Default Locale
return MAKELCID( MAKELANGID( usPrimaryLang, usSubLang ), SORT_DEFAULT );
-
}
diff --git a/shell/source/win32/simplemail/smplmailclient.cxx b/shell/source/win32/simplemail/smplmailclient.cxx
index acb113450e7f..82968b747d95 100644
--- a/shell/source/win32/simplemail/smplmailclient.cxx
+++ b/shell/source/win32/simplemail/smplmailclient.cxx
@@ -32,7 +32,7 @@
#include "precompiled_shell.hxx"
#include <osl/diagnose.h>
#include <osl/process.h>
-#include <osl/module.hxx>
+#include <rtl/bootstrap.hxx>
#include "smplmailclient.hxx"
#include "smplmailmsg.hxx"
#include <com/sun/star/system/SimpleMailClientFlags.hpp>
@@ -112,12 +112,10 @@ namespace /* private */
if (senddocUrl.getLength() == 0)
{
- rtl::OUString baseUrl;
- if (!osl::Module::getUrlFromAddress(reinterpret_cast<oslGenericFunction>(getSenddocUrl), baseUrl))
- return rtl::OUString();
-
- senddocUrl = baseUrl.copy(0, baseUrl.lastIndexOf('/') + 1);
- senddocUrl += rtl::OUString::createFromAscii("senddoc.exe");
+ senddocUrl = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "$OOO_BASE_DIR/program/senddoc.exe"));
+ rtl::Bootstrap::expandMacros(senddocUrl); //TODO: detect failure
}
return senddocUrl;
}
diff --git a/sj2/doc/Todo.txt b/sj2/doc/Todo.txt
deleted file mode 100644
index 6520abaa10a8..000000000000
--- a/sj2/doc/Todo.txt
+++ /dev/null
@@ -1,108 +0,0 @@
-Erkenntnisse aus sj/sj1, die in sj2 beachtet werden mssen
-
-
-- Call von C++
-"javascript: ..." nicht wie event behandeln, insbesondere werden
-this und document nicht implizit als Search-Objekte gesetzt.
-
-
-- prototype Eigenschaft von Objekten:
-Manipuliert Klassen-Informationen, falls an einem beliebigen Objekt
-eine Property mit gleichem Namen angelegt wird, so gilt dieses
-Ueberschreiben jedoch nur fuer dieses eine Objekt !!!
-Im Sj/Sj1 Projekt ist dies jedoch nicht erfuellt !
-
-Beispiel:
-function Ctor() { ... }
-
-obj1 = new Ctor(); // obj1 obj2
-obj2 = new Ctor(); //-------------------------
-Ctor.prototype.toString = myToString; // myToString myToString
-obj1.toString = myToString2; // myToString2 myToString
-Ctor.prototype.toString = myToString3; // myToString2 myToString3
-
-
-- toString() und valueOf() Behandlung des BaseObj bei Type-Konversion
-
-========================================================================
-
-Bemerkungen zur Suchreihenfolge und zum Ueberladen von Funktionen:
-
-* fuer jede 'Klasse' (z.B. Math, Date, String) gibt es ein Konstruktor-
- Objekt in der JavaScript-Umgebung.
- In dem Konstruktor-Objekt werden die Properties der Klasse angelegt,
- z.B. sin, cos.
- Der Konstruktor setzt seine Properties an jedem neu erzeugten
- Objekt. Daher hat z.B. jedes Date-Objekt eine (default-behandelte)
- Property setMonth.
- Zum Setzten der Properties des Konstruktor an das neu erzeugte
- Objekt sollte die initProp()-Methode noch einen Bereich der zu
- kopierenden Properties bekommen, damit nicht alle nachtraeglich
- am Konstruktor-Objekt angelegten Properties auch am Objekt gesetzt
- werden.
-
-* jedes Objekt haelt eine Referenz auf seinen Konstruktor (entweder die
- vordefinierten Klassen wie Math, Date oder die Funktion mit der das
- Objekt erzeugt wurde).
-
-* fuer die Suchreihenfolge gibt es folgende drei Moeglichkeiten:
-
- - Default-behandelte Property:
- aStrg = new String( "gulp" );
- aStrg.toString() // --> verwendet toString-Property am
- // String-Konstruktor (default-Behandlung)
-
- - Default-Behandlung ueberladen am Konstruktor:
- aStrg = new String( "gulp" );
- String.prototype.toString = myToString; // UEBERLADEN !
- aStrg.toString() // --> verwendet myToString-Funktion.
- // Das prototype-Objekt wird am String-Ctor.
- // angelegt und ueberschreibt daher die
- // default-behandelte Property am Objekt !!!
- // Der Interpreter muss dann noch an einem
- // ggf. vorhandenen prototype-Objekt am
- // Konstruktor nach der Property suchen.
-
- - ueberladen am Objekt:
- aStrg = new String( "gulp" );
- String.prototype.toString = myToString; // am Ctor. ueberladen
- aStrg.toString = myToString2;
- aStrg.toString() // --> verwendet myToString2-Funktion.
- // Die Property toString wird am Objekt
- // ueberschrieben und somit das Flag, dass
- // die default-Behandlung anzeigt, zurueck
- // gesetzt. D.h. der Interpreter muss das
- // prototype-Objekt des Konstruktors NICHT
- // durchsuchen.
-
-
-========================================================================
-
-DEMNAECHST:
-
-Die Properties der Standard-Objekte (z.B. setSeconds() am Date)
-werden am prototype-Objekt des Konstruktors (z.B. DateCtor) angelegt.
-Bei der Suche nach Properties an einem beliebigen Objekt wird erst
-das Objekt durchsucht und anschliessend das prototype-Objekt des
-Konstruktors fuer das Objekt durchsucht. Dieses Verhalten gleicht
-dem Netscape-Verhalten (Stand 2.7.1997).
-
-ACHTUNG, AB 11.8:
-Das ist so nicht korrekt, da die entsprechenden Properties direkt
-am prototype-Objekt nicht bekannt sind. Die an den Objekten als
-Default geflagten Properties bilden daher das Netscape-Verhalten
-besser ab.
-
-
-========================================================================
-
-WEITERE OFFENE PROBLEME:
-------------------------
-
- * this auf der Wiese funktioniert noch nicht korrekt
-
- * Konversion von Typen ?
-
-
-
-
diff --git a/sj2/doc/concepts.html b/sj2/doc/concepts.html
deleted file mode 100644
index 49f336b131d8..000000000000
--- a/sj2/doc/concepts.html
+++ /dev/null
@@ -1,844 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
- <TITLE></TITLE>
- <META NAME="GENERATOR" CONTENT="StarOffice/4.0 (WinNT/Win95)">
- <META NAME="AUTHOR" CONTENT=" ">
- <META NAME="CREATED" CONTENT="19970401;13233926">
- <META NAME="CHANGEDBY" CONTENT=" ">
- <META NAME="CHANGED" CONTENT="19970529;8045806">
-</HEAD>
-<BODY>
-<H1>Stardivision erweiterte Java Grundkonzepte</H1>
-<H2><A NAME="Exceptions"></A>Exceptions:</H2>
-<P>Die Grundidee von Exceptions ist es einen Fehlerkontext
-aufzuspannen, der erst n&auml;her betrachtet werden mu&szlig;, wenn
-man Fehler korrigieren will. Der Programmcode sollte durch die
-Behandlung von Fehlern nicht undurchsichtig und unleserlich werden.
-Meiner Meinung nach sollten Exceptions deswegen auch nicht als
-zweiter Returnwert vergewaltigt werden.<BR><B>Ziel:</B> Nach dem
-Auftreten einer Exception sollte es m&ouml;glichst einfach sein das
-System in einen definierten arbeitsf&auml;higen Zustand zu
-versetzen.<BR>Es gibt grunds&auml;tzlich drei verschiedenen Arten von
-Exceptions. Diese unterscheiden sich durch den Zustand in dem sie das
-Objekt hinterlassen.</P>
-<OL>
- <LI><P><A NAME="Undefined Exception"></A>Die von der Methode
- benutzten Objekte sind in einem undefinierten Zustand. Jede auf dem
- Objekt aufgerufene Methode mu&szlig; nach einer solchen Exception
- nicht mehr ihre Spezifikation einhalten. Diese Exception wird im
- folgenden mit &#132;Undefined Exception&#147; benannt. Dabei ist zu
- beachten, da&szlig; keine weiteren <A HREF="#Resourcen">Resourcen</A>,
- au&szlig;er die angegebenen, benutzt werden. Au&szlig;erdem werden
- &#132;ReadOnly&#147; Resourcen nicht modifiziert.</P>
- <LI><P><A NAME="Defined Exception"></A>Die von der Methode benutzten
- Objekte sind in einem genau definierten Zustand, der aber von der
- Zusicherung der Methode abweicht. Diese Exception wird im folgenden
- mit &#132;Defined Exception&#147; benannt. Dabei ist zu beachten,
- da&szlig; keine weiteren <A HREF="#Resourcen">Resourcen</A>, au&szlig;er
- die angegebenen, benutzt werden. Au&szlig;erdem werden &#132;ReadOnly&#147;
- Resourcen nicht modifiziert.</P>
- <LI><P><A NAME="Transacted Exception"></A>Die von der Methode
- benutzten Objekte sind in ihrem vorherigen Zustand, der aber von der
- Zusicherung der Methode abweicht. Diese Exception wird im folgenden
- mit &#132;Transacted Exception&#147; benannt. Dabei ist zu beachten,
- da&szlig; keine weiteren <A HREF="#Resourcen">Resourcen</A>, au&szlig;er
- die angegebenen, benutzt werden. Au&szlig;erdem werden &#132;ReadOnly&#147;
- Resourcen nicht modifiziert. Diese Spezifikation trifft auch auf
- &#132;Defined Exception&#147; zu, wegen ihrer Bedeutung f&uuml;hre
- ich sie extra auf.</P>
-</OL>
-<P>Die Benutzbarkeit eines Objektes, nachdem eine Exception
-aufgetreten ist, ist vom obigen Typ der Exception abh&auml;ngig.</P>
-<P><FONT COLOR="#ff0000">Satz 1.1: Nachdem eine &#132;Undefined
-Exception&#147; aufgetreten ist, kann mit dem Objekt sowie allen
-&#132;ReadWrite&#147; Resourcen nicht mehr weiter gearbeitet werden.</FONT></P>
-<P><FONT COLOR="#ff0000">Satz 1.2: Nachdem eine &#132;Defined
-Exception&#147; aufgetreten ist, kann aufgrund des genau definierten
-Zustandes weiter gearbeitet werden.</FONT></P>
-<P><FONT COLOR="#ff0000">Satz 1.3: Nach einer &#132;Transacted
-Exception&#147; ist der gleiche Zustand wie vor dem Aufruf
-wiederhergestellt.</FONT></P>
-<P>Es sollten m&ouml;glichst nur &#132;Transacted Exception&#147;
-ausgel&ouml;st werden. Bei komplizierten Methoden l&auml;&szlig;t
-sich aber eine &#132;Defined Exception&#147; nicht immer vermeiden.
-Eine &#132;Undefined Exception&#147; deutet immer auf eine
-Programmierfehler hin. Der Typ der Exeption kann nur in Zusammenhang
-mit der Methode in der sie Auftritt ermittelt werden.</P>
-<P><FONT COLOR="#ff0000">Satz 1.4: Durch die Klasse der Exception
-kann niemals alleine der Typ (undefined, defined oder transacted)
-entschieden werden.</FONT></P>
-<H2><A NAME="Resourcen"></A>Resourcen (under construction)</H2>
-<P>Die Grundidee von Resourcen ist die Aufteilung eines Gebildes in
-weitere Einheiten. Auf diesen k&ouml;nnen dann verschiedene Auftr&auml;ge
-gleichzeitig arbeiten, wenn sie nicht dieselben Resourcen benutzen.
-Z.B. kann man in einer Textverarbeitung die einzelnen Dokumente als
-Einheiten betrachten. Auftr&auml;ge, die sich nur auf ein Dokument
-beziehen, k&ouml;nnen parallel zu anderen Dokumenten bearbeitet
-werden.<BR>Mit Resourcen sind im System bzw. der Applikation
-vorhandene Objekte, Services, Kan&auml;le ... gemeint, die zur Zeit
-nur von einem Thread benutzt werden k&ouml;nnen. Als Konsequenz
-m&uuml;ssen Resourcen einem Thread zugeordnet werden, bevor dieser
-sie benutzt.<BR><B>Ziel:</B> Es mu&szlig; m&ouml;glich sein, 1.
-Auftr&auml;ge parallel abzuarbeiten, 2. die Frage &#132;Warum k&ouml;nnen
-zwei Auftr&auml;ge nicht parallel arbeiten?&#147; beantwortet zu
-k&ouml;nnen.<BR>Es gibt verschiedene M&ouml;glichkeiten diese
-Zuordnung vorzunehmen. Zwei stelle ich kurz vor.</P>
-<OL>
- <LI><P><A NAME="Prealloc Resource Konzept"></A>Eine Art der
- Zuordnung ist das vorherige Anfordern aller f&uuml;r den Auftrag
- ben&ouml;tigten Resourcen. Ist dies m&ouml;glich, kann der Auftrag
- ohne weitere St&ouml;rungen ablaufen. Die Resourcen d&uuml;rfen
- freigegeben werden, bevor der Auftrag beendet ist. Dies gilt
- nat&uuml;rlich nur f&uuml;r nicht mehr verwendete Resourcen. Es darf
- ebenfalls das Zuordnungsrecht von lesend und schreibend auf lesend
- zur&uuml;ckgenommen werden. Diese Zuornungsart wird im weiteren mit
- &#132;Prealloc Resource Konzept&#147; bezeichnet.</P>
- <LI><P><A NAME="Ondemand Resource Konzept"></A>Eine andere Art der
- Zuordnung ist das Anfordern der Resourcen, wenn sie ben&ouml;tigt
- werden. Dabei kann es zu St&ouml;rungen kommen, wenn sich
- verschiedene Auftr&auml;ge um die gleiche Resource bewerben. Die
- Resourcen d&uuml;rfen freigegeben werden, bevor der Auftrag beendet
- ist. Dies gilt nat&uuml;rlich nur f&uuml;r nicht mehr verwendete
- Resourcen. Es darf ebenfalls das Zuordnungsrecht von lesend und
- schreibend auf lesend zur&uuml;ckgenommen werden. Diese Zuornungsart
- wird im weiteren mit &#132;Ondemand Resource Konzept&#147;
- bezeichnet.</P>
-</OL>
-<P>Es gibt noch weitere M&ouml;glichkeiten Auftr&auml;ge zu
-bearbeiten, die die gleichen Resourcen benutzen. H&auml;ufig findet
-man solche L&ouml;sungen bei Datenbankanwendungen.<BR>In der
-folgenden Tabelle stehen sich die beiden Konzepte mit ihren Vor- und
-Nachteilen und ihren Anforderungen gegen&uuml;ber.</P>
-<TABLE WIDTH=100% BORDER=1 CELLPADDING=5 FRAME=BOX RULES=ALL>
- <COLGROUP>
- <COL WIDTH=85*>
- <COL WIDTH=85*>
- <COL WIDTH=85*>
- </COLGROUP>
- <THEAD>
- <TR>
- <TH WIDTH=33% VALIGN=TOP>
- <P><BR></TH>
- <TD WIDTH=33% VALIGN=TOP><DL>
- <DD>Prealloc Resource Konzept </DD>
- </DL>
- </TD>
- <TD WIDTH=33% VALIGN=TOP>
- <DL>
- <DD>Ondemand Resource Konzept </DD>
- </DL>
- </TD>
- </TR>
- </THEAD>
- <TBODY>
- <TR>
- <TD VALIGN=TOP>
- <P>Alle Resourcen m&uuml;ssen vor der Auftragsausf&uuml;hrung
- bekannt sein.</TD>
- <TD VALIGN=TOP>
- <P>Ja</TD>
- <TD VALIGN=TOP>
- <P>Nein</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P>Nicht mehr ben&ouml;tigte Resourcen d&uuml;rfen freigegeben
- werden.</TD>
- <TD VALIGN=TOP>
- <P>Ja</TD>
- <TD VALIGN=TOP>
- <P>Ja</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P>Es kann zu Verklemmungen oder &#132;Races&#147; kommen.</TD>
- <TD VALIGN=TOP>
- <P>Nein</TD>
- <TD VALIGN=TOP>
- <P>Ja</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P>In Bearbeitung befindliche Auftr&auml;ge m&uuml;ssen, aufgrund
- fehlender Resourcen, abgebrochen werden.</TD>
- <TD VALIGN=TOP>
- <P>Nein</TD>
- <TD VALIGN=TOP>
- <P>Ja</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P>Der Zustand der Resourcen ist zu jedem Zeitpunkt der
- Auftragsabarbeitung bekannt.</TD>
- <TD VALIGN=TOP>
- <P>Ja</TD>
- <TD VALIGN=TOP>
- <P>Nein</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P>Algorithmus zur Resourcevergabe.</TD>
- <TD VALIGN=TOP>
- <P>Einfach, da nur &uuml;berpr&uuml;ft werden mu&szlig;, ob alle
- ben&ouml;tigten Resourcen verf&uuml;gbar sind.</TD>
- <TD VALIGN=TOP>
- <P>Komplex, da neben dem Anfordern von Resourcen auch noch
- &uuml;berpr&uuml;ft werden mu&szlig;, ob das System <A HREF="#lebendig">lebendig</A>
- ist.</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P>Parallelit&auml;t</TD>
- <TD VALIGN=TOP>
- <P>Hoch, da unabh&auml;ngige Auftr&auml;ge meistens nur lesend
- auf gemeinsame Resourcen zugreifen.</TD>
- <TD VALIGN=TOP>
- <P>Sehr hoch, da die ben&ouml;tigten Resourcen erst angefordert
- werden, wenn man sie braucht.</TD>
- </TR>
- </TBODY>
-</TABLE>
-<P ALIGN=LEFT>Meiner Meinung nach ist nur das &#132;Prealloc Resource
-Konzept&#147; ohne richtige Programmierwerkzeuge zur Entwicklung
-paralleler Algorithmen (z.B. Netzprogrammierung) wenigstens ein
-bi&szlig;chen beherschbar.</P>
-<P ALIGN=LEFT>Es stellt sich die Frage wie das &#132;Prealloc
-Resource Konzept&#147; in einem Komponenten-Modell und in einem
-Objekt-Environment integriert werden kann. Ein Objekt-Environment ist
-ein mehr oder weniger dynamische Menge von Objekten die miteinander
-in Verbindung stehen. Aus dem obigen Beispiel k&ouml;nnte man die
-Verbindung der Textverarbeitung zu ihren Dokumenten als
-Objekt-Environment bezeichnen. Ein Objekt in diesem Environment kann
-nun &uuml;ber seine Verbindungen mit anderen Objekten kommunizieren.
-Die Schnittstellen mit denen &uuml;ber die Verbindung kommuniziert
-wird nennt man Komponenten-Modell. Die Idee des Objekt-Environments
-ist es weitere Objekte m&ouml;glichst einfach zu integrieren. So
-k&ouml;nnten in unserem Beispiel weitere Dokumenttypen wie ein
-HTML-Dokument eingebunden werden. Die Schittstellen m&uuml;&szlig;ten
-nur dem, von der Textverarbeitung geforderten, Komponenten-Modell
-gen&uuml;gen. Liefert aber das Modell, wie heute &uuml;blich, keine
-Information &uuml;ber die ben&ouml;tigten Resourcen bei Benutzung der
-Schnittstellen, dann k&ouml;nnen Verklemmungen bzw. Inkonsistenzen
-nicht vermieden werden. Aus diesem Grunde ist es notwendig, das
-Resource-Konzept in das Komponenten-Modell zu integrieren.<BR><B>Ziel:</B>
-Es mu&szlig; ein Kompromi&szlig; zwischen hoher Nebenl&auml;ufigkeit
-und der damit verbundenen Komplexit&auml;t, sowie einfacher
-Programmierung und geringer Nebenl&auml;ufigkeit gefunden
-werden.<BR><B>Folgen:</B> In einem Objekt-Environment m&uuml;ssen die
-einzelnen Objekte also dynamisch auf Verbindungen zu Objekten mit
-hoher oder geringer Nebenl&auml;ufigkeit reagieren. Die Komplexit&auml;t
-dieser Aufgabe darf aber nicht in die Objekte verlagert werden, da
-von einem seriellen Objekt (bzw. dessen Programmierer) nicht die
-Steuerung nebenl&auml;ufiger Auftr&auml;ge verlangt werden
-kann.<BR><B>L&ouml;sungsansatz:</B> Die Behandlung der
-Nebenl&auml;ufigkeit wird nicht in einer einfachen Komponente
-implementiert. Das bedeutet sie mu&szlig; mit einer
-Default-Behandlung zufrieden sein, die minimale Nebel&auml;ufigkeit
-nach sich zieht. Eine Komponente kann sich aber in die Vergabe der
-Resourcen einmischen. So kann sie ihren Grad der Nebenl&auml;ufigkeit
-erh&ouml;hen. Dies ist dann aber auch mit erh&ouml;htem
-Implementationsaufwand zu bezahlen. Auf der anderen Seite macht es
-aber keinen Sinn serielle oder Komponenten mit zu gro&szlig;em
-Resourcebedarf einzubinden, wenn das Objekt-Environment danach
-praktisch nicht mehr lauff&auml;hig ist. Das bedeutet, da&szlig; das
-Objekt-Environment auch Forderungen bez&uuml;glich des Resourcebedarf
-an die Komponenten stellen darf.</P>
-<H3>Anforderungen</H3>
-<OL>
- <LI><P ALIGN=LEFT>Es mu&szlig; ein Modell geben, in dem alle
- vorhandenen Resourcen und deren Beziehung zueinander eingetragen
- werden. Dadurch kann abgesch&auml;tzt werden, welchen Resourcebedarf
- eine Komponente hat. Das &#132;Sch&auml;tzen&#147; ist w&ouml;rtlich
- zu nehmen. (Im Zusammenhang mit <A HREF="#Security">Security</A>
- wird man aber auch noch sehen, da&szlig; der Zugriff auf bestimmte
- Resourcen nicht m&ouml;glich ist.) F&uuml;r das &#132;Prealloc
- Resource Konzept&#147; gilt, es m&uuml;ssen mindestens die
- ben&ouml;tigten Resourcen verf&uuml;gbar sein. Zur Not sind diese
- alle.</P>
- <LI><P ALIGN=LEFT>Eine nebenl&auml;ufige Komponente mu&szlig; in
- jeder ihrer von au&szlig;en erreichbaren Methoden kontrollieren, ob
- die entsprechenden Resourcen f&uuml;r sie angefordert wurden. Damit
- serielle Komponenten diese Methoden nutzen k&ouml;nnen, k&ouml;nnen
- die ben&ouml;tigten Resourcen angefordert werden, wenn vorher noch
- <B>keine einzige</B> durch den ausf&uuml;hrenden Auftrag belegt war.
- Zur Erl&auml;uterung: Serielle Komponenten belegen keine Resourcen.
- Damit w&uuml;rde jeder Aufruf einer nebenl&auml;ufigen Komponente
- scheitern. Um dies zu vermeiden, werden die Resourcen in der
- nebenl&auml;ufigen Komponente angefordert.</P>
- <LI><P ALIGN=LEFT>Serielle Komponenten m&uuml;ssen also damit
- rechnen eine Fehlermeldung &uuml;ber nicht verf&uuml;gbare Resourcen
- zu bekommen.</P>
-</OL>
-<H3>Szenarien</H3>
-<P>Von unserem bisherigen Beispiel ausgehend, gibt es eine
-Applikation in der sich drei Dokumente befinden. Ein serielles
-Textdokument, ein nebenl&auml;ufiges Tabellendokument und ein
-nebenl&auml;ufiges Pr&auml;sentationsdokument. Die Applikation selbst
-ist nebenl&auml;ufig. Die Relationen gehen von der Applikation zu den
-Dokumenten und umgekehrt. Die Dokumente kennen sich nicht.</P>
-<P>Fall 1:<BR>In das serielle Textdokument soll eine Zeichenfolge
-eingef&uuml;gt werden. Da es sich um eine serielle Komponente
-handelt, kann dieses Einf&uuml;gen nicht von selbst ausgel&ouml;st
-werden, es mu&szlig; von einer nebenl&auml;ufigen Komponente, hier
-die Applikation, angesto&szlig;en werden. Die Applikation ist aber
-verpflichtet die Resourcen vorher zu reservieren. F&uuml;r diese
-Absch&auml;tzung gibt es drei realistische M&ouml;glichkeiten. 1. Sie
-reserviert nur das Textdokument selbst. Das bedeutet, das
-Textdokument kann mit keinem anderen Objekt, auch nicht mit der
-Applikation, kommunizieren. 2. Die Applikation und das Textdokument
-wird reserviert. Es ist also nur der Zugriff auf die anderen
-Dokumente verwehrt. 3. Alle Objekte werden reserviert. Geht es nach
-dem &#132;Prealloc Resource Konzept&#147; mu&szlig; 3. gew&auml;hlt
-werden. Aufgrund von Sicherheitsbeschr&auml;nkungen werden wir aber
-noch sehen, das serielle Komponenten in ihrer Auftragsbearbeitung
-gestoppt werden k&ouml;nnen. Wenn der Abbruch eines Auftrags m&ouml;glich
-ist, spielt es aber keine Rolle durch wen (Resourcen oder <A HREF="#Security">Security</A>)
-dies geschehen ist.</P>
-<P>Fall 2:<BR>In das nebenl&auml;ufige Tabellendokument soll eine
-Zeichenfolge eingef&uuml;gt werden. Dieser Auftrag kann von der
-Applikation oder der Komponente selbst ausgel&ouml;st werden. In
-jedem Fall m&uuml;ssen die Resourcen vor der Auftragsbearbeitung
-reserviert werden. Man kann dies auch der Komponente &uuml;berlassen
-(siehe Anforderung 2.), aber man scheitert, wenn zwei Auftr&auml;ge
-zu einem Auftrag zusammengefa&szlig;t werden sollen. Dies passiert
-z.B., wenn der Auftrag &#132;Text ersetzen&#147; aus den Auftr&auml;gen
-&#132;L&ouml;schen&#147; und &#132;Einf&uuml;gen&#147; besteht. Auf
-jeden Fall wird nur das Tabellendokument selbst reserviert, da das
-Einf&uuml;gen keine Auswirkung auf andere Komponenten hat.</P>
-<P>Fall 3:<BR>In das nebenl&auml;ufige Tabellendokument wird der
-Applikationsname aus der Applikation eingef&uuml;gt. Dazu fragt das
-Tabellendokument nach den ben&ouml;tigten Resourcen, um den Namen zu
-holen und ihn einzuf&uuml;gen. Zum Holen wird die Applikation
-ben&ouml;tigt und zum Einf&uuml;gen das Tabellendokument. Beide
-m&uuml;ssen vor der Auftragsausf&uuml;hrung reserviert werden.</P>
-<P>Fall 4:<BR>Das nebenl&auml;ufige Tabellendokument f&uuml;gt
-selektierten Text aus dem seriellen Textdokument ein. Da das
-Textdokument seinen Resourcebedarf nicht mitteilt, wird einer aus
-Fall eins abgesch&auml;tzte Bedarf genommen. Man kann sehen, da&szlig;
-der Auftrag f&uuml;r alle drei M&ouml;glichkeiten erteilt werden
-kann. Seine Nebenl&auml;ufigkeit wird dann durch die Absch&auml;tzung
-eingeschr&auml;nkt. Zus&auml;tzlich m&uuml;ssen nat&uuml;rlich die
-ben&ouml;tigten Resourcen f&uuml;r das Einf&uuml;gen geholt werden.
-Alle m&uuml;ssen vor der Auftragsausf&uuml;hrung reserviert werden.</P>
-<H3>Programmierkonzepte</H3>
-<P>Welche Konzepte k&ouml;nnen in einer objektorientierten Sprache
-wie c++ oder Java oder einer prozeduralen Sprache wie Fortran oder
-&#132;c&#147; eingesetzt werden, um Nebenl&auml;ufigkeit zu
-erreichen. </P>
-<OL>
- <LI><P>Es gibt zwei M&ouml;glichkeiten eine Resource zu belegen. Das
- ist Exclusive (lesen, schreiben) und &#132;ReadOnly&#147;. Eine
- Resource kann von mehreren Auftr&auml;gen benutzt werden, wenn diese
- nur &#132;ReadOnly&#147; ben&ouml;tigen.</P>
- <LI><P>Es gibt Resourcen f&uuml;r die man die Resourceverteilung
- optimieren kann. Ein Objekt welches nicht ge&auml;ndert werden kann
- und das w&auml;hrend der Auftragsausf&uuml;hrung immer konsistent
- ist kann die Anforderung &#132;Exclusiv&#147; automatisch auf
- &#132;ReadOnly&#147; abschw&auml;chen. Dies lohnt sich, wenn man
- serielle Komponenten hat, die nichts &uuml;ber die
- Resourceanforderungen mitteilen. Als Beispiel m&ouml;chte ich eine
- Instanz der Klasse String in Java nennen. Ein weitere Art von
- Resourcen fordern bei Auftr&auml;gen an sie 1. keine weiteren
- Auftr&auml;ge an, 2. beenden sie die Auftr&auml;ge schnell und 3.
- die Reihenfolge der &Auml;nderung an ihnen ist f&uuml;r andere nicht
- wichtig. Dies ist zum Beispiel bei der Speicherverwaltung in c der
- Fall. Diese Art der Resource darf zu einem sp&auml;teren Zeitpunkt
- angefordert werden. Sie mu&szlig; sofort benutzt und wieder
- freigegeben werden. Aus diesem Grund erledigen solche Resourcen das
- Anfordern und Freigeben selbst.</P>
- <LI><P>Bevor ein Auftrag ausgef&uuml;hrt werden kann, m&uuml;ssen
- alle von ihm ben&ouml;tigten Resourcen reserviert werden. Dies ist
- f&uuml;r einen Auftrag, der aus mehreren Teilauftr&auml;gen besteht,
- aufwendig. Eine Optimierung kann darin bestehen die Teilauftr&auml;ge
- asynchron auszuf&uuml;hren. Allerdings dringt diese Verhaltensweise
- nach au&szlig;en. Z.B. m&uuml;ssen Auftr&auml;ge, die diesen dann
- asynchronen Auftrag nutzen, dann auch asynchron sein. Eine weitere
- Optimierung in der Autragsvergabe gibt es, wenn ein Autrag die
- Resourcervergabe nicht &auml;ndert. Es ist dann m&ouml;glich mehr
- Auftr&auml;ge vorzuziehen.</P>
- <LI><P>Es mu&szlig; eine Queue geben, in die Auftr&auml;ge eingef&uuml;gt
- werden k&ouml;nnen. Konfliktfreie Auftr&auml;ge k&ouml;nnen parallel
- ausgef&uuml;hrt werden. <B>Achtung:</B> Der Resourcebedarf eines
- Auftrages kann nur bestimmt werden, wenn alle ben&ouml;tigten
- Resourcen &#132;ReadOnly&#147; reserviert werden k&ouml;nnen, es sei
- denn kein vor ihm laufender Auftrag &auml;ndert die Resourcevergabe.
- Warum ist das so? Ein Auftrag kann eine Resource dahingehend &auml;ndern,
- da&szlig; danach andere Resourcen ben&ouml;tigt werden als vorher.
- Der vorher bestimmte Bedarf ist dann falsch.</P>
- <LI><P>Das Modell der Resourcen kann vergr&ouml;bert oder verfeinert
- werden. In einem Tabellendokument k&ouml;nnte man jede einzelne
- Zelle zu einer Resource machen. Um die Komplexit&auml;t der
- Resourcemodells zu vereinfachen kann man aber weiter alle Zellen der
- Dokument-Resource zuordnen. Wird also aus einer anderen Komponente
- die Zelle angefordert, wird automatisch das ganze Dokument
- reserviert. Daraus ergeben sich zwei Vorteile: 1. F&uuml;r den
- Auftraggeber ist die Vergr&ouml;berung transparent und 2. Kann die
- Resource an dem Objekt reserviert werden, das man ohnehin kennt.</P>
- <LI><P>Das Resource-Modell ist hierarchisch. Eine Resource kann nur
- einer Vergr&ouml;berung zugeordnet werden. Die Tabellenzellen d&uuml;rfen
- also nur dem Tabellendokument zugeordnet werden. Daraus ergibt sich,
- da&szlig; innerhalb einer solchen Hierarchie nebenl&auml;ufig
- gearbeitet werden kann. Es d&uuml;rfen dann aber keine Resourcen
- au&szlig;erhalb der Hierarchie benutzt werden, selbst wenn diese
- reserviert sind.</P>
-</OL>
-<H3>Probleme und L&ouml;sungen</H3>
-<P>&Uuml;ber den Benutzer m&uuml;ssen Daten abgefragt werden, die
-&uuml;ber die Benutzung von Resourcen entscheidet (z.B.
-Dateiname):<BR>Ein solcher Auftrag mu&szlig; in zwei Teilauftr&auml;ge
-unterteilt werden. Der erste erledigt die Abfrage. Danach werden alle
-Resourcen freigegeben und dann fordert der zweite seine Resourcen und
-wird bearbeitet. Eventuell kann ein solcher Auftrag den vorherigen
-ersetzten, um zu verhindern das andere abh&auml;ngige Auftr&auml;ge
-vor dem Aufgeteilten bearbeitet werden.</P>
-<P>Ich habe mich bei einem Objekt als Listener angemeldet:<BR>Es gibt
-zwei Arten von Benachrichtigungen die ich erhalte. 1. Aufgrund der
-Ausf&uuml;hrung eines Auftrages und 2. einen Event von einer
-nebenl&auml;ufigen Komponente. Im ersten Fall &uuml;berpr&uuml;fe ich
-den Resourcebedarf und f&uuml;hre dann den Auftrag aus. Im zweiten
-Fall reserviere ich die ben&ouml;tigten Resourcen und f&uuml;hren den
-Auftrag aus. Sind Resourcen reserviert, ist dies Fall eins, sonst
-Fall zwei.</P>
-<P>Ich bin Broadcaster:<BR>Broadcaste ich aufgrund eines Auftrags tue
-ich nichts weiter. L&ouml;se ich den Broadcast ohne Auftrag aus, mu&szlig;
-ich die Resourcen f&uuml;r die Listener bestimmen und sie vor dem
-Aufruf reservieren. Die einzelnen Listener werden als unabh&auml;ngig
-betrachtet. Im Detail findet folgender Ablauf statt. 1. Die Liste der
-Listener wird kopiert. 2. F&uuml;r den ersten Listener wird der
-Resourcebedarf ermittelt.</P>
-<H3>Implementation</H3>
-<P>Die Basis f&uuml;r die Implementation des Resourcekonzeptes legen
-die Klassen <A HREF="stardiv.resource.Resource.html#Resource">Resource</A>,
-<A HREF="stardiv.resource.ResourceList.html#ResourceList">ResourceList</A>,
-<A HREF="stardiv.resource.ResourceLockException.html#ResourceLockException">ResourceLockException</A>,
-<A HREF="stardiv.resource.Task.html#Task">Task</A>, <A HREF="stardiv.resource.TaskManager.html#TaskManager">TaskManager</A>,
-<A HREF="stardiv.resource.TaskThread.html#Task">TaskThread</A>,
-<A HREF="stardiv.resource.ThreadData.html#ThreadData">ThreadData</A>
-und das Interface <A HREF="stardiv.resource.Resourceable.html#Resourceable">Resourceable</A>
-fest. Um ein Objekt in das Resourcekonzept einbinden zu k&ouml;nnen
-sind folgende Schritte notwendig:<BR>1. Das Resourceable Interface
-mu&szlig; implementiert werden. 2. Ein Konstruktor mit der dem
-Objekte zugewiesenen Resource. 3. Jede public Methode bekommt eine
-*_Resource(...) Methode zur Seite, mit der der Resourcebedarf
-ermittelt werden kann. 4. Innerhalb der public Methode wird der
-Resourcebedarf ermittelt. 5. Mit dieser Information die als
-ResourceListe vorliegt, wird eine Auftrag (Task) erzeugt. 6. Dieser
-Auftrag wird beim TaskManager angemeldet. 7. Nach der Zuteilung durch
-den TaskManager wird der Auftrag ausgef&uuml;hrt. 8. Alle Resourcen
-und der Auftrag werden wieder freigegeben.<BR>Diese Liste ist
-detailliert aber nicht <B>vollst&auml;ndig</B>. In der Klasse
-Resource steht imm eine Beispiel, welches aktuell sein sollte.</P>
-<P>Folgende Programmierrichtlinien gibt es, um das &#132;Prealloc
-Resource Konzept&#147; in Java zu integrieren:</P>
-<OL>
- <LI><P ALIGN=LEFT>Es mu&szlig; das Interface <A HREF="stardiv.resource.Resourceable.html#Resourceable">Resourceable</A>
- implementiert werden. Mit Hilfe dieses Interfaces kann der
- Resourcebedarf eines Objektes erfragt werden. Diese Richtlinien
- gelten dann auch f&uuml;r die Superklasse.</P>
- <LI><P ALIGN=LEFT>???Es mu&szlig; das Interface <A HREF="stardiv.concepts.ModifyTestable.html#ModifyTestable">ModifyTestable</A>
- implementiert werden. Damit kann &uuml;berpr&uuml;ft werden, ob an
- den Resourcen Ver&auml;nderungen vorgenommen wurden.</P>
- <LI><P ALIGN=LEFT>Nur Methoden die &uuml;ber die Lebensdauer des
- Objektes keine ver&auml;nderten Werte liefern d&uuml;rfen immer
- gerufen werden. Das sind zum Beispiel alle Methoden der Klasse
- java.lang.Object.</P>
- <LI><P ALIGN=LEFT>Um den Resourcebedarf einzelner Methoden genauer
- zu ermitteln kann eine Methode mit dem, um _Resource( ResourceList
- aRL, boolean bCheck, ... ) erweiterten Namen, gerufen werden. Ein
- Beispiel befindet sich in der Klasse <A HREF="stardiv.resource.Resource.html#Resource">Resource</A>.</P>
-</OL>
-<H2><A NAME="Security"></A>Security</H2>
-<H2><A NAME="Data Requests"></A>Data Requests</H2>
-<P>Diese Schnittstelle soll das Anfordern von Daten vereinheitlichen.
-Das Problem, welches zu diesem Ansatz f&uuml;hrte, ist das Lesen von
-Daten &uuml;ber einen &#132;langsamen&#147; Internet-Stream. Das
-bedeutet es werden Daten ben&ouml;tigt, die erst noch &uuml;bertragen
-werden m&uuml;ssen. Da das Pull-Modell immer einen eigenen Thread
-vorraussetzt, um die restliche Anwendung nicht zu blockieren, habe
-ich das Push-Modell gew&auml;hlt.<BR><B>Ziel:</B> F&uuml;r die
-Implementation sollte es m&ouml;glichst transparent sein, wie die
-Daten herangeschafft werden. Als zweites soll die Schnittstelle f&uuml;r
-denjenigen einfach sein, der alle Daten sofort bereith&auml;lt.<BR><B>L&ouml;sung:</B>
-Der Datenverarbeiter ist passiv. Das bedeutet, beim Entgegennehmen
-der Daten beginnt er nicht sie zu verarbeiten. Dies mu&szlig; extra
-angesto&szlig;en werden. Zweitens, der Datenverarbeiter h&auml;lt den
-Status des Datenlieferanten. Dies k&ouml;nnen EOF, f&uuml;r alle
-Daten gelesen, READY, f&uuml;r sind Daten da, PENDING, es kommen noch
-weitere Daten und NO_SOURCE, es wurden nicht alle Daten verarbeitet
-und es kommen keine weiteren Daten mehr. <B>Achtung</B> der Status
-ist nur zu bestimmten Zeitpunkten g&uuml;ltig. Der Datenverarbeiter
-darf nur im Zustand PENDING Daten bekommen. Diese Annahme sch&uuml;tzt
-ihn vor der Implementation eines Puffers. Das <A HREF="stardiv.concepts.QueryData.html#QueryData">QueryData</A>
-- Interface ist die Spezifikation f&uuml;r dieses Verhalten.</P>
-<H2><A NAME="Modify"></A>Modify</H2>
-<P>Das Ziel ist nur eine Schnittstelle zu erstellen, mit der ein
-Objekt auf &Auml;nderungen &uuml;berpr&uuml;ft werden kann. Da es f&uuml;r
-ein Objekt verschiedene M&ouml;glichkeiten gibt &Auml;nderungen an
-sich zu pr&uuml;fen (z.B. &Auml;nderungsz&auml;hler, Kopie), mu&szlig;
-die Schnittstelle m&ouml;glichst flexibel sein, um vielen
-Implementationen gerecht zu werden. Die L&ouml;sung sind zwei
-Methoden. Mit der einen (getModifyHandle()) kann der Zeitpunkt
-festgemacht werden, zu dem m&ouml;gliche &Auml;nderungen &uuml;berpr&uuml;ft
-werden sollen. Der R&uuml;ckgabewert ist eine beliebiges Objekt, so
-da&szlig; in ihm die ben&ouml;tigte &Uuml;berpr&uuml;fungsinformation
-(z.B. der &Auml;nderungsz&auml;hler) untergebracht werden kann.
-Danach kann mit der zweiten Methode (isModified(Object)) &uuml;berpr&uuml;ft
-werden, ob eine &Auml;nderung stattgefunden hat. Das Interface f&uuml;r
-dieses Konzept hei&szlig;t <A HREF="stardiv.concepts.ModifyTestable.html#ModifyTestable">ModifyTestable</A>
-.</P>
-<H2><A NAME="LifeConnect"></A>LifeConnect</H2>
-<P>LifeConnect ist die Kommunikation zwischen PlugIns, Applets und
-JavaScript. Die Kommunikation kann in beide Richtungen erfolgen.Unter
-JavaScript kann auf alle Systemklassen zugegriffen werden. Die
-Abbildung der JavaScript-Aufrufe nach Java ist die Aufgabe der Klasse
-<A HREF="stardiv.js.ip.CallJava.html#CallJava">CallJava</A>. Dazu
-wird das in Java 1.1 implementierte Package java.lang.reflect
-benutzt. Da JavaScript eine nicht typisierte Sprache ist, werden die
-Werte nach JavaScript-Regeln in die entsprechenden Javatypen
-umgesetzt. Bez&uuml;glich der Sicherheit wird ein JavaScript-Programm
-auf die gleiche Stufe wie ein Applet gestellt. Um den Zugriff der
-Applets auf JavaScript zu gestatten, mu&szlig; das HTML-Tag MYSCRIPT
-angegeben werden. Auf die Java-Klassen kann in JavaScript mit dem
-Prefix &#132;Package&#147; zugegriffen werden (sun, java und netscape
-ben&ouml;tigen keinen Prefix). Die Klassen netscape.plugin.Plugin,
-netscape.javascript.JSObject und netscape.javascript.JSException
-dienen zur Kommunikation von Java mit JavaScript.</P>
-<P>Konvertierungstabelle anhand der Spezifikation &#132;JavaScript
-Language Specifications&#147; 3.1.2 TypeConversion</P>
-<TABLE WIDTH=100% BORDER=1 CELLPADDING=5 CELLSPACING=0 FRAME=HSIDES RULES=ALL>
- <COLGROUP>
- <COL WIDTH=26*>
- <COL WIDTH=40*>
- <COL WIDTH=47*>
- <COL WIDTH=47*>
- <COL WIDTH=47*>
- <COL WIDTH=47*>
- </COLGROUP>
- <THEAD>
- <TR>
- <TH WIDTH=10% VALIGN=TOP>
- <P><BR></TH>
- <TH WIDTH=16% VALIGN=TOP>
- <P><I>byte</I></TH>
- <TH WIDTH=19% VALIGN=TOP>
- <P><I>short</I></TH>
- <TH WIDTH=19% VALIGN=TOP>
- <P><I>char</I></TH>
- <TH WIDTH=19% VALIGN=TOP>
- <P><I>int</I></TH>
- <TH WIDTH=19% VALIGN=TOP>
- <P><I>long</I></TH>
- </TR>
- </THEAD>
- <TBODY>
- <TR>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>Undef.</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>Fehler</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>Fehler</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>Fehler</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>Fehler</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>Fehler</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>Function</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(10) valueOf/error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(11) valueOf/error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(11) valueOf/error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(12) valueOf/error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(13) valueOf/error</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>Object</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(10) valueOf/error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(11) valueOf/error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(11) valueOf/error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(12) valueOf/error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(13) valueOf/error</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>Object (null)</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(10) 0</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(11) 0</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(11) 0</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(12) 0</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(13) 0</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>double</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(10) Zahl oder Fehler, wenn Bereichs-&uuml;berschreitung</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(11) Zahl oder Fehler, wenn Bereichs-&uuml;berschreitung</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(11) Zahl oder Fehler, wenn Bereichs-&uuml;berschreitung</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(12) Zahl oder Fehler, wenn Bereichs-&uuml;berschreitung</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(13) Zahl oder Fehler, wenn Bereichs-&uuml;berschreitung</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>boolean</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) 0/1</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) 0/1</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) 0/1</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) 0/1</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) 0/1</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>Leer String</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>error</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>String</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(10) error/ Zahl</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(11) error/ Zahl</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(11) error/ Zahl</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(12) error/ Zahl</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(13) error/ Zahl</TD>
- </TR>
- </TBODY>
-</TABLE><DL>
- <DT><BR></DT>
-</DL>
-<TABLE WIDTH=100% BORDER=1 CELLPADDING=5 CELLSPACING=0 FRAME=BOX RULES=ALL>
- <COLGROUP>
- <COL WIDTH=27*>
- <COL WIDTH=59*>
- <COL WIDTH=44*>
- <COL WIDTH=35*>
- <COL WIDTH=36*>
- <COL WIDTH=55*>
- </COLGROUP>
- <THEAD>
- <TR>
- <TH WIDTH=10% VALIGN=TOP>
- <P><BR></TH>
- <TH WIDTH=23% VALIGN=TOP>
- <P><I>float</I></TH>
- <TH WIDTH=17% VALIGN=TOP>
- <P><I>double</I></TH>
- <TH WIDTH=14% VALIGN=TOP>
- <P><I>boolean</I></TH>
- <TH WIDTH=14% VALIGN=TOP>
- <P><I>String</I></TH>
- <TH WIDTH=22% VALIGN=TOP>
- <P><I>Object</I></TH>
- </TR>
- </THEAD>
- <TBODY>
- <TR>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>Undef.</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>Fehler</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>Fehler</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>false</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>&#132;undefined&#147;</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>null</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>Function</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(14) valueOf/error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) valueOf/error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) valueOf/ true</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) JS-Code der Funktion</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(30) netscape .javascript. JSObject</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>Object</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(14) valueOf/error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) valueOf/error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) valueOf/ true</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) valueOf / toString
- </TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(30) Java-Cast/ error</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>Object (null)</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(14) 0</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) 0</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) false</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) &#132;null&#147;</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(30) null</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>double</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(14) Zahl oder Fehler, wenn Bereichs-&uuml;berschreitung</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(30) Zahl</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(7) 0, NaN -&gt; false !0, -+Infinite -&gt; true</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(8) Zahl, NaN, Infinity oder -Infinity</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(9) Number/ error
- </TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>boolean</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) 0/1</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) 0/1</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(30) boolean</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) &#132;false&#147;/ &#147;true&#147;</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) Boolean/ error</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>Leer String</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>error</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) false</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(30) String</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) String/ error</TD>
- </TR>
- <TR>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>String</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(14) error/ Zahl</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) error/ Zahl</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) true</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(30) String</TD>
- <TD VALIGN=TOP>
- <P ALIGN=LEFT>(15) String/ error</TD>
- </TR>
- </TBODY>
-</TABLE>
-<P><BR></P>
-<P>Der Algorithmus zum mappen der polymorphen Methoden in Java:<BR>1.
-Die Anzahl der Parameter mu&szlig; &uuml;bereinstimmen.<BR>2. Die
-Parameter m&uuml;ssen, nach der obigen Tabelle, konvertiert werden
-k&ouml;nnen.<BR>3. Es gibt ein Punktesystem, nach dem die Methode
-ausgew&auml;hlt wird. Die Punkte stehen in Klammern in den
-Tabelleneintr&auml;gen. Die Konvertierungspunkte f&uuml;r Zahlen sind
-typabh&auml;ngig und nicht wertabh&auml;ngig. Dadurch ist
-sichergestellt, das nicht unterschiedliche Methoden bei sich
-&auml;ndernden Werten gerufen werden. Kommt es allerdings zu einem
-Konvertierungsfehler (&Uuml;berlauf), dann wird versucht eine andere
-Methode zu finden.<BR>4. Es wird vorausgesetzt, da&szlig; die
-Methoden &#132;valueOf&#147; und &#132;toString&#147; keine
-Seiteneffekte haben. Sie d&uuml;rfen also beliebig oft aufgerufen
-werden.<BR>5. Es wird nur null auf eine Java-Array abgebildet.</P>
-<H2><A NAME="Testen"></A>Testen</H2>
-<P>Das Ziel dieses Abschnitts ist es Vorgehensweisen zu entwickeln,
-mit denen sich die Java Grundkonzepte testen lassen. Folgende
-Checkliste ist f&uuml;r jede Methode abzuarbeiten.</P>
-<OL>
- <LI><P>Zu jeder Klasse gibt es eine entsprechende Testklasse. Diese
- steht im Package &#132;test&#147;.... Der Name der Klasse wird mit
- &#132;Test&#147; erweitert. Beispiel: stardiv.memory.BitArray wird
- zu test.memory.BitArrayTest. Jede dieser Klassen hat eine Methode
- &#132;public static void main( String [] )&#147;. Diese Methode wird
- aufgerufen, um den Test aller Methoden anzusto&szlig;en. Der Test
- ist nicht interaktiv. Wird ein Fehler festgestellt, wird das
- Programm mit exit( -1 ) verlassen.</P>
- <LI><P>Jede Methode mu&szlig; unabh&auml;ngig von ihren Environment
- getestet werden. Alle Resourcen f&uuml;r die Methode werden als
- Dummy f&uuml;r den Test implementiert. Diese Forderung f&uuml;hrt zu
- sauberen Schnittstellen, da ansonsten f&uuml;r den Test ja ganze
- Objekte implementiert werden m&uuml;ssen.</P>
- <LI><P>Das Testprotokoll protokolliert mit &#132;System.out.println&#147;.
- Vor dem Test der einzelnen Methoden wird in einer Zeile kurz &uuml;ber
- den Test informiert. Scheitert der Test, dann wird eine
- Fehlermeldung ausgegeben in der &#132;failed&#147; enthalten sein
- mu&szlig;. </P>
- <LI><P>Um <A HREF="#Defined Exception">Defined Exception</A> und
- <A HREF="#Transacted Exception">Transacted Exception</A> testen zu
- k&ouml;nnen, sollten die <A HREF="stardiv.concepts.Resource.html#Resource">Resource</A>
- und <A HREF="stardiv.concepts.ModifyTestable.html#ModifyTestable">ModifyTestable</A>
- Interfaces implementiert werden. Es kann damit automatisch gepr&uuml;ft
- werden, ob sich eine Resource unerlaubter Weise ge&auml;ndert hat.</P>
-</OL>
-<H2>Begriffe</H2>
-<P><A NAME="lebendig"></A>Lebendig: Ein System wird als lebendig
-bezeichnet, wenn alle in ihm befindlichen Auftr&auml;ge
-fertiggestellt werden k&ouml;nnen. Sie sich also nicht in einer
-Verklemmung oder einem &#132;Race&#147; befinden.</P>
-</BODY>
-</HTML> \ No newline at end of file
diff --git a/sj2/inc/sjapplet.hxx b/sj2/inc/sjapplet.hxx
deleted file mode 100644
index fa8a18fee827..000000000000
--- a/sj2/inc/sjapplet.hxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/*************************************************************************
- *
- * 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: sjapplet.hxx,v $
- * $Revision: 1.6 $
- *
- * 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 _SJ_SJAPPLET_HXX
-#define _SJ_SJAPPLET_HXX
-
-#include "com/sun/star/uno/Reference.hxx"
-#include <tools/string.hxx>
-
-class INetURLObject;
-class Size;
-class SjJScriptAppletObject;
-class SvCommandList;
-class Window;
-namespace com { namespace sun { namespace star { namespace uno {
- class XComponentContext;
-} } } }
-
-struct SjApplet2_Impl;
-
-enum SjNetAccess
-{
- NET_UNRESTRICTED, NET_NONE, NET_HOST
-};
-
-class SjApplet2
-{
- SjApplet2_Impl * _pImpl;
-
-public:
- static void settingsChanged(void);
-
- SjApplet2();
- virtual ~SjApplet2();
- void Init(
- com::sun::star::uno::Reference<
- com::sun::star::uno::XComponentContext > const & context,
- Window * pParentWin, const INetURLObject & rDocBase,
- const SvCommandList & rCmdList);
- void setSizePixel( const Size & );
- void appletRestart();
- void appletReload();
- void appletStart();
- void appletStop();
- void appletClose();
-
- // Fuer SO3, Wrapper fuer Applet liefern
- SjJScriptAppletObject * GetJScriptApplet();
-
- virtual void appletResize( const Size & ) = 0;
- virtual void showDocument( const INetURLObject &, const XubString & ) = 0;
- virtual void showStatus( const XubString & ) = 0;
-// virtual SjJSbxObject * getJScriptWindowObj() = 0;
-};
-
-
-
-#endif // _REF_HXX
diff --git a/sj2/prj/build.lst b/sj2/prj/build.lst
deleted file mode 100644
index 82fe969d0295..000000000000
--- a/sj2/prj/build.lst
+++ /dev/null
@@ -1,8 +0,0 @@
-j2 sj2 : jvmaccess sandbox svtools NULL
-j2 sj2 usr1 - all j2_mkout NULL
-j2 sj2\stardiv\applet nmake - all j2_starappl j2_contr NULL
-j2 sj2\stardiv\applet\resources nmake - all j2_appres j2_starappl NULL
-j2 sj2\stardiv\controller nmake - all j2_contr NULL
-j2 sj2\stardiv\app nmake - all j2_starapp j2_starappl j2_contr NULL
-j2 sj2\source\jscpp nmake - all j2_jscpp j2_starapp NULL
-j2 sj2\util nmake - all j2_util j2_jscpp NULL
diff --git a/sj2/prj/d.lst b/sj2/prj/d.lst
deleted file mode 100644
index c70fb0ef2b19..000000000000
--- a/sj2/prj/d.lst
+++ /dev/null
@@ -1,9 +0,0 @@
-mkdir: %_DEST%\inc%_EXT%\sj2
-..\%__SRC%\class\classes.jar %_DEST%\bin%_EXT%\classes.jar
-..\inc\sjapplet.hxx %_DEST%\inc%_EXT%\sj2\sjapplet.hxx
-
-..\%__SRC%\lib\sj.lib %_DEST%\lib%_EXT%\sj.lib
-..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%
-..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
-..\%__SRC%\slb\sj.lib %_DEST%\lib%_EXT%\xsj.lib
-..\%__SRC%\bin\j?????_g.dll %_DEST%\bin%_EXT%\j?????_g.dll
diff --git a/sj2/source/inc/java_lang_object.hxx b/sj2/source/inc/java_lang_object.hxx
deleted file mode 100644
index 6b2aba1aad3f..000000000000
--- a/sj2/source/inc/java_lang_object.hxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/*************************************************************************
- *
- * 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: java_lang_object.hxx,v $
- * $Revision: 1.3 $
- *
- * 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 <jni.h>
-#ifdef OS2
-#include <typedefs.h>
-#endif
-
-#ifndef _SJ_JAVA_LANG_OBJECT_HXX
-#define _SJ_JAVA_LANG_OBJECT_HXX
-
-#include <tools/string.hxx>
-
-
-#ifdef HAVE_64BIT_POINTERS
-#error "no 64 bit pointer"
-#else
-#ifdef OS2
-#define INT64_TO_PVOID(x) (void *)x.lo
-inline jlong Make_Os2_Int64( INT32 hi, INT32 lo ) {jlong x = CONST64( hi, lo ); return x; }
-#define PVOID_TO_INT64(x) Make_Os2_Int64( 0, (INT32)x )
-#else //OS2
-#define PVOID_TO_INT64(x) (jlong)(INT32)x
-#define INT64_TO_PVOID(x) (void *)x
-#endif //Os2
-#endif
-
-//=====================================================================
-class java_lang_Class;
-class java_lang_Object
-{
- // Zuweisungsoperator und Copy Konstruktor sind verboten
- java_lang_Object& operator = (java_lang_Object&) { return *this;};
- java_lang_Object(java_lang_Object&) {};
-
- static jclass getMyClass();
- // nur zum Zerstoeren des C++ Pointers in vom JSbxObject
- // abgeleiteten Java Objekten
- //static jclass getJSbxObjectClass();
-
-protected:
- // der JAVA Handle zu dieser Klasse
- jobject object;
- // Klassendefinition
-
- // neu in SJ2:
- static jclass theClass; // die Klasse braucht nur einmal angefordert werden !
- static jclass theJSbxObjectClass; // die Klasse braucht nur einmal angefordert werden !
- static ULONG nObjCount; // Zaehler fuer die Anzahl der Instanzen
-
-public:
- // der Konstruktor, der fuer die abgeleiteten Klassen verwendet
- // werden soll.
- java_lang_Object( JNIEnv * pEnv, jobject myObj );
- // der eigentliche Konstruktor
- java_lang_Object();
-
- virtual ~java_lang_Object();
-
- void saveRef( JNIEnv * pEnv, jobject myObj );
- jobject getJavaObject() const { return object; }
- java_lang_Object * GetWrapper() { return this; }
-
- java_lang_Class * getClass();
-
-};
-
-#endif
diff --git a/sj2/source/jscpp/sjapplet.cxx b/sj2/source/jscpp/sjapplet.cxx
deleted file mode 100644
index 08b07b8c2965..000000000000
--- a/sj2/source/jscpp/sjapplet.cxx
+++ /dev/null
@@ -1,126 +0,0 @@
-/*************************************************************************
- *
- * 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: sjapplet.cxx,v $
- * $Revision: 1.16 $
- *
- * 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 "sal/config.h"
-
-#include "sjapplet.hxx"
-
-#include "osl/diagnose.h"
-#include "rtl/string.hxx"
-#include "rtl/ustring.hxx"
-
-#include "sjapplet_impl.hxx"
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-
-SjApplet2::SjApplet2()
- : _pImpl(new SjApplet2_Impl())
-{
-}
-
-SjApplet2::~SjApplet2()
-{
- delete _pImpl;
-}
-
-//=========================================================================
-void SjApplet2::Init(
- com::sun::star::uno::Reference<
- com::sun::star::uno::XComponentContext > const & context,
- Window * pParentWin, const INetURLObject & rDocBase,
- const SvCommandList & rCmdList)
-{
- try {
- if(_pImpl)
- _pImpl->init(pParentWin, context, rDocBase, rCmdList);
- }
- catch(RuntimeException & runtimeException) {
-#if OSL_DEBUG_LEVEL > 1
- OString message = OUStringToOString(runtimeException.Message, RTL_TEXTENCODING_ASCII_US);
- OSL_TRACE("sjapplet.cxx: SjApplet2::Init - exception occurred: %s\n", message.getStr());
-#else
- (void) runtimeException; // avoid warning
-#endif
-
- delete _pImpl;
- _pImpl = 0;
- }
-}
-
-//=========================================================================
-void SjApplet2::setSizePixel( const Size & rSize )
-{
- if(_pImpl)
- _pImpl->setSize(rSize);
-}
-
-void SjApplet2::appletRestart()
-{
- if(_pImpl)
- _pImpl->restart();
-}
-
-void SjApplet2::appletReload()
-{
- if(_pImpl)
- _pImpl->reload();
-}
-
-void SjApplet2::appletStart()
-{
- if(_pImpl)
- _pImpl->start();
-}
-
-void SjApplet2::appletStop()
-{
- if(_pImpl)
- _pImpl->stop();
-}
-
-void SjApplet2::appletClose()
-{
- if(_pImpl)
- _pImpl->close();
-}
-
-// Fuer SO3, Wrapper fuer Applet liefern
-SjJScriptAppletObject * SjApplet2::GetJScriptApplet()
-{
- OSL_TRACE("SjApplet2::GetJScriptApplet\n");
-
- return NULL;
-}
-
-// Settings are detected by the JavaVM service
-// This function is not necessary anymore
-void SjApplet2::settingsChanged(void)
-{}
diff --git a/sj2/source/jscpp/sjapplet_impl.cxx b/sj2/source/jscpp/sjapplet_impl.cxx
deleted file mode 100644
index fdae4863a80a..000000000000
--- a/sj2/source/jscpp/sjapplet_impl.cxx
+++ /dev/null
@@ -1,617 +0,0 @@
-/*************************************************************************
- *
- * 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: sjapplet_impl.cxx,v $
- * $Revision: 1.32 $
- *
- * 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 "sjapplet_impl.hxx"
-
-#ifdef WNT
-#include <tools/prewin.h>
-#include <windows.h>
-#include <tools/postwin.h>
-#elif (defined QUARTZ)
-#include "premac.h"
-#include <Cocoa/Cocoa.h>
-#include "postmac.h"
-#elif (defined UNX)
-#include <tools/prex.h>
-#include "X11/Xlib.h"
-#include <tools/postx.h>
-#endif
-
-#include "rtl/ustring.hxx"
-#include <rtl/process.h>
-#include <osl/mutex.hxx>
-
-#include <tools/urlobj.hxx>
-#include <tools/debug.hxx>
-
-#include <svtools/ownlist.hxx>
-
-#include <vcl/svapp.hxx>
-#include <vcl/window.hxx>
-#include <vcl/wrkwin.hxx>
-#include <vcl/syschild.hxx>
-#include <vcl/sysdata.hxx>
-#include <com/sun/star/java/XJavaVM.hpp>
-#include "com/sun/star/lang/XMultiComponentFactory.hpp"
-#include "com/sun/star/uno/XComponentContext.hpp"
-#include "jvmaccess/classpath.hxx"
-
-using namespace ::rtl;
-using namespace ::osl;
-#ifdef SOLAR_JAVA
-using namespace ::com::sun::star::java;
-#endif // SOLAR_JAVA
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::uno;
-
-namespace css = ::com::sun::star;
-#ifdef SOLAR_JAVA
-
-static void testJavaException(JNIEnv * pEnv) throw(com::sun::star::uno::RuntimeException)
-{
- jthrowable jtThrowable = pEnv->ExceptionOccurred();
- if(jtThrowable) { // is it a java exception ?
-#if OSL_DEBUG_LEVEL > 1
- pEnv->ExceptionDescribe();
-#endif
- pEnv->ExceptionClear();
-
- jclass jcThrowable = pEnv->FindClass("java/lang/Throwable");
- jmethodID jmThrowable_getMessage = pEnv->GetMethodID(jcThrowable, "getMessage", "()Ljava/lang/String;");
-
- jstring jsMessage = (jstring)pEnv->CallObjectMethod(jtThrowable, jmThrowable_getMessage);
-
- rtl::OUString ouMessage;
- if(jsMessage) {
- const jchar * jcMessage = pEnv->GetStringChars(jsMessage, NULL);
- ouMessage = rtl::OUString(jcMessage);
- pEnv->ReleaseStringChars(jsMessage, jcMessage);
- }
-
- throw css::uno::RuntimeException(ouMessage, css::uno::Reference<XInterface>());
- }
-}
-#else // !SOLAR_JAVA
-static void throwException() throw(com::sun::star::uno::RuntimeException)
-{
- throw css::uno::RuntimeException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Java applets not supported.")), css::uno::Reference<XInterface>());
-}
-#endif
-
-#ifdef SOLAR_JAVA
-#if defined (UNX) && !defined(QUARTZ)
-struct EmbeddedWindow {
- jobject _joWindow;
-
- EmbeddedWindow(JNIEnv * pEnv, SystemEnvData const * pEnvData) throw(com::sun::star::uno::RuntimeException);
- void dispose(JNIEnv * pEnv);
-};
-
-EmbeddedWindow::EmbeddedWindow(JNIEnv * pEnv, SystemEnvData const * pEnvData)
- throw(com::sun::star::uno::RuntimeException) : _joWindow(0)
-{
- // ensure that all operations for the window contained in pEnvData
- // have been processed by the Xserver since java will access that
- // window by a separate connection to the Xserver
- XSync( (Display*)pEnvData->pDisplay, False);
- try
- { //java < 1.5
- jclass jcToolkit = pEnv->FindClass("java/awt/Toolkit"); testJavaException(pEnv);
- jmethodID jmToolkit_getDefaultToolkit = pEnv->GetStaticMethodID(
- jcToolkit, "getDefaultToolkit", "()Ljava/awt/Toolkit;" ); testJavaException(pEnv);
- pEnv->CallStaticObjectMethod(jcToolkit, jmToolkit_getDefaultToolkit); testJavaException(pEnv);
-
- jclass jcMotifAppletViewer = pEnv->FindClass(
- "sun/plugin/navig/motif/MotifAppletViewer");
- if(pEnv->ExceptionOccurred())
- {
- pEnv->ExceptionClear();
- jcMotifAppletViewer = pEnv->FindClass(
- "sun/plugin/viewer/MNetscapePluginContext"); testJavaException(pEnv);
- }
-
- jclass jcClassLoader = pEnv->FindClass("java/lang/ClassLoader"); testJavaException(pEnv);
- jmethodID jmClassLoader_loadLibrary = pEnv->GetStaticMethodID(
- jcClassLoader, "loadLibrary",
- "(Ljava/lang/Class;Ljava/lang/String;Z)V" ); testJavaException(pEnv);
- jstring jsplugin = pEnv->NewStringUTF("javaplugin_jni"); testJavaException(pEnv);
- pEnv->CallStaticVoidMethod(jcClassLoader, jmClassLoader_loadLibrary,
- jcMotifAppletViewer, jsplugin, JNI_FALSE); testJavaException(pEnv);
-
- jmethodID jmMotifAppletViewer_getWidget = pEnv->GetStaticMethodID(
- jcMotifAppletViewer, "getWidget", "(IIIII)I" ); testJavaException(pEnv);
- jint ji_widget = pEnv->CallStaticIntMethod(jcMotifAppletViewer,
- jmMotifAppletViewer_getWidget, pEnvData->aWindow,
- 0, 0, 1, 1); testJavaException(pEnv);
- jclass jcFrame = pEnv->FindClass("sun/awt/motif/MEmbeddedFrame"); testJavaException(pEnv);
- jmethodID jmFrame_rinit = pEnv->GetMethodID(jcFrame, "<init>", "(J)V" ); testJavaException(pEnv);
- jobject joFrame = pEnv->AllocObject(jcFrame); testJavaException(pEnv);
- pEnv->CallVoidMethod(joFrame, jmFrame_rinit, (jlong)ji_widget); testJavaException(pEnv);
- _joWindow = pEnv->NewGlobalRef(joFrame);
- }
- catch (RuntimeException & )
- {
- }
-
- if (_joWindow)
- return;
- //try Java > 1.5
-#ifdef SOLARIS
- jclass jcFrame = pEnv->FindClass("sun/awt/motif/MEmbeddedFrame"); testJavaException(pEnv);
- jobject joFrame = pEnv->AllocObject(jcFrame); testJavaException(pEnv);
- jmethodID jmFrame_rinit = pEnv->GetMethodID(jcFrame, "<init>", "(JZ)V" ); testJavaException(pEnv);
- pEnv->CallVoidMethod(joFrame, jmFrame_rinit, (jlong) pEnvData->aWindow, JNI_FALSE); testJavaException(pEnv);
- _joWindow = pEnv->NewGlobalRef(joFrame);
-#elif LINUX
- jclass jcFrame = pEnv->FindClass("sun/awt/X11/XEmbeddedFrame"); testJavaException(pEnv);
- jobject joFrame = pEnv->AllocObject(jcFrame); testJavaException(pEnv);
- jmethodID jmFrame_rinit = pEnv->GetMethodID(jcFrame, "<init>", "(J)V" ); testJavaException(pEnv);
-
- pEnv->CallVoidMethod(joFrame, jmFrame_rinit, (jlong) pEnvData->aWindow); testJavaException(pEnv);
- _joWindow = pEnv->NewGlobalRef(joFrame);
-#endif
-}
-
-#else // UNX && !QUARTZ
-
-struct EmbeddedWindow {
-jobject _joWindow;
-
-EmbeddedWindow(JNIEnv * pEnv, SystemEnvData const * pEnvData) throw(com::sun::star::uno::RuntimeException);
-void dispose(JNIEnv * pEnv);
-};
-
-
-#ifdef WNT
-EmbeddedWindow::EmbeddedWindow(JNIEnv * pEnv, SystemEnvData const * pEnvData) throw(com::sun::star::uno::RuntimeException)
-{
-jclass jcFrame = pEnv->FindClass("sun/awt/windows/WEmbeddedFrame"); testJavaException(pEnv);
-jmethodID jmFrame_rinit = pEnv->GetMethodID(jcFrame, "<init>", "(I)V"); testJavaException(pEnv);
-
-jobject joFrame = pEnv->AllocObject(jcFrame); testJavaException(pEnv);
-pEnv->CallVoidMethod(joFrame, jmFrame_rinit, (jint)pEnvData->hWnd); testJavaException(pEnv);
-
-_joWindow = pEnv->NewGlobalRef(joFrame);
-}
-
-#elif defined QUARTZ
-EmbeddedWindow::EmbeddedWindow(JNIEnv * pEnv, SystemEnvData const * pEnvData) throw(com::sun::star::uno::RuntimeException)
-{
- /* The WNT code (above) that this code derives from, may be using quite old
- ways of interacting with native windows. More modern approaches seems to
- point towards JAWT_* and com.apple.eawt */
-#if 0
-// FIXME: this is not going to work on cocoa
-jclass jcFrame = pEnv->FindClass("apple/awt/CEmbeddedFrame"); testJavaException(pEnv);
-jmethodID jmFrame_rinit = pEnv->GetMethodID(jcFrame, "<init>", "(I)V"); testJavaException(pEnv);
-
-jobject joFrame = pEnv->AllocObject(jcFrame); testJavaException(pEnv);
-pEnv->CallVoidMethod(joFrame, jmFrame_rinit, (jint)pEnvData->pView); testJavaException(pEnv);
-
-_joWindow = pEnv->NewGlobalRef(joFrame);
-#endif
-}
-
-#else
-
-EmbeddedWindow::EmbeddedWindow(JNIEnv * pEnv, SystemEnvData const * pEnvData) throw(com::sun::star::uno::RuntimeException)
-{
-jclass jcFrame = pEnv->FindClass("java/awt/Frame"); testJavaException(pEnv);
-jmethodID jmFrame_rinit = pEnv->GetMethodID(jcFrame, "<init>", "()V"); testJavaException(pEnv);
-jobject joFrame = pEnv->AllocObject(jcFrame); testJavaException(pEnv);
-pEnv->CallVoidMethod(joFrame, jmFrame_rinit); testJavaException(pEnv);
-
-_joWindow = pEnv->NewGlobalRef(joFrame);
-}
-
-#endif
-
-#endif // UNX && !QUARTZ
-
-void EmbeddedWindow::dispose(JNIEnv * pEnv)
-{
-jclass jcWindow = pEnv->FindClass("java/awt/Window"); testJavaException(pEnv);
-jmethodID jmWindow_dispose = pEnv->GetMethodID(jcWindow, "dispose", "()V" ); testJavaException(pEnv);
-
-pEnv->CallVoidMethod(_joWindow, jmWindow_dispose); testJavaException(pEnv);
-pEnv->DeleteGlobalRef(_joWindow);
-
-_joWindow = 0;
-}
-#endif // SOLAR_JAVA
-
-
-#ifdef SOLAR_JAVA
-SjApplet2_Impl::SjApplet2_Impl() throw(com::sun::star::uno::RuntimeException)
- :
- _joAppletExecutionContext(0),
- _jcAppletExecutionContext(0)
-
-{}
-#else // !SOLAR_JAVA
-SjApplet2_Impl::SjApplet2_Impl() throw(com::sun::star::uno::RuntimeException)
-{}
-#endif
-
-
-SjApplet2_Impl::~SjApplet2_Impl() throw()
-{
-#ifdef SOLAR_JAVA
- if (_joAppletExecutionContext)
- {
- try
- {
- if ( ! _virtualMachine.is())
- return;
- jvmaccess::VirtualMachine::AttachGuard vmAttachGuard(_virtualMachine);
- JNIEnv * pEnv = vmAttachGuard.getEnvironment();
- _pEmbeddedWindow->dispose(pEnv);
- delete _pEmbeddedWindow;
-
- pEnv->DeleteGlobalRef(_joAppletExecutionContext);
- pEnv->DeleteGlobalRef(_jcAppletExecutionContext);
- }
- catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &)
- {
- }
- }
-#endif
-}
-
-void SjApplet2_Impl::init(
- Window * pParentWin,
- css::uno::Reference< css::uno::XComponentContext > const & context,
- const INetURLObject & rDocBase, const SvCommandList & rCmdList)
- throw(com::sun::star::uno::RuntimeException)
-{
-#ifdef SOLAR_JAVA
- _pParentWin = pParentWin;
-
-
- // Java URL erzeugen
- rtl::OUString url = rDocBase.GetMainURL(INetURLObject::DECODE_TO_IURI);
-
- if(!url.getLength())
- url = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///"));
-
- if (url.getLength()) {
- //WorkAround, weil Java mit dem | nicht zurecht kommt
- if(rDocBase.GetProtocol() == INET_PROT_FILE && url.pData->buffer[9] == INET_ENC_DELIM_TOKEN) {
- rtl::OUString tmp = url.copy(0, 9);
- tmp += String(INET_DELIM_TOKEN);
- tmp += url.copy(10);
-
- url = tmp;
- }
- }
-
-
-#if OSL_DEBUG_LEVEL > 1
- rtl::OString tmp = rtl::OUStringToOString(url, RTL_TEXTENCODING_ASCII_US);
- OSL_TRACE("SjApplet2_Impl::init - mainUrl: %s\n", tmp.getStr());
-#endif
-
- css::uno::Reference<XJavaVM> _xJavaVM = css::uno::Reference<XJavaVM>(
- (css::uno::Reference< css::lang::XMultiComponentFactory >(
- context->getServiceManager(), css::uno::UNO_QUERY_THROW)->
- createInstanceWithContext(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.java.JavaVirtualMachine")),
- context)),
- UNO_QUERY);
- Sequence<sal_Int8> processID(17);
- rtl_getGlobalProcessId((sal_uInt8 *)processID.getArray());
- processID[16] = 0;
-
- OSL_ENSURE(sizeof (sal_Int64)
- >= sizeof (jvmaccess::VirtualMachine *),
- "Pointer cannot be represented as sal_Int64");
- sal_Int64 nPointer = reinterpret_cast< sal_Int64 >(
- static_cast< jvmaccess::VirtualMachine * >(0));
- _xJavaVM->getJavaVM(processID) >>= nPointer;
- _virtualMachine = reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer);
- if (!_virtualMachine.is())
- return;
-
- try
- {
- jvmaccess::VirtualMachine::AttachGuard vmAttachGuard(_virtualMachine);
-
- JNIEnv * pEnv = vmAttachGuard.getEnvironment();
-
- _jcAppletExecutionContext = jvmaccess::ClassPath::loadClass(
- context, pEnv,
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "vnd.sun.star.expand:$ORIGIN/classes/classes.jar")),
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "stardiv.applet.AppletExecutionContext")));
- testJavaException(pEnv);
- _jcAppletExecutionContext = (jclass) pEnv->NewGlobalRef(_jcAppletExecutionContext ); testJavaException(pEnv);
-
- jclass jcURL = pEnv->FindClass("java/net/URL"); testJavaException(pEnv);
- jmethodID jmURL_rinit = pEnv->GetMethodID(jcURL, "<init>", "(Ljava/lang/String;)V"); testJavaException(pEnv);
- jobject joDocBase = pEnv->AllocObject(jcURL); testJavaException(pEnv);
- jstring jsURL = pEnv->NewString(url.getStr(), url.getLength()); testJavaException(pEnv);
- pEnv->CallVoidMethod(joDocBase, jmURL_rinit, jsURL); testJavaException(pEnv);
-
- jclass jcHashtable = pEnv->FindClass("java/util/Hashtable"); testJavaException(pEnv);
- jmethodID jmHashtable_rinit = pEnv->GetMethodID(jcHashtable, "<init>", "()V"); testJavaException(pEnv);
- jmethodID jmHashtable_put = pEnv->GetMethodID(jcHashtable, "put",
- "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); testJavaException(pEnv);
- jobject joParameters = pEnv->AllocObject(jcHashtable); testJavaException(pEnv);
- pEnv->CallVoidMethod(joParameters, jmHashtable_rinit); testJavaException(pEnv);
-
- for(sal_uInt32 i = 0; i < rCmdList.Count(); ++i) {
- const SvCommand & rCmd = rCmdList[i];
- String aCmd = rCmd.GetCommand();
- String aLoweredCmd = aCmd.ToLowerAscii();
-
-#if OSL_DEBUG_LEVEL > 1
- rtl::OUString command = aCmd;
- rtl::OUString value = rCmd.GetArgument();
- rtl::OString cmd_tmp = rtl::OUStringToOString(command, RTL_TEXTENCODING_ASCII_US);
- rtl::OString value_tmp = rtl::OUStringToOString(value, RTL_TEXTENCODING_ASCII_US);
- OSL_TRACE("command: %s=%s", cmd_tmp.getStr(), value_tmp.getStr());
-#endif
- jstring jsCommand = pEnv->NewString(aLoweredCmd.GetBuffer(), aLoweredCmd.Len()); testJavaException(pEnv);
- jstring jsArg = pEnv->NewString(rCmd.GetArgument().GetBuffer(), rCmd.GetArgument().Len()); testJavaException(pEnv);
- pEnv->CallObjectMethod(joParameters, jmHashtable_put, jsCommand, jsArg); testJavaException(pEnv);
- }
-
- SystemEnvData const * pEnvData = ((SystemChildWindow *)pParentWin)->GetSystemData();
- _pEmbeddedWindow = new EmbeddedWindow(pEnv, pEnvData);
-
- jmethodID jmAppletExecutionContext_rinit = pEnv->GetMethodID(_jcAppletExecutionContext, "<init>",
- "(Ljava/net/URL;Ljava/util/Hashtable;Ljava/awt/Container;J)V"); testJavaException(pEnv);
- jmethodID jmAppletExecutionContext_init = pEnv->GetMethodID(_jcAppletExecutionContext, "init", "()V"); testJavaException(pEnv);
- jmethodID jmAppletExecutionContext_startUp = pEnv->GetMethodID(_jcAppletExecutionContext, "startUp", "()V"); testJavaException(pEnv);
-
- _joAppletExecutionContext = pEnv->AllocObject(_jcAppletExecutionContext); testJavaException(pEnv);
- _joAppletExecutionContext = pEnv->NewGlobalRef(_joAppletExecutionContext); testJavaException(pEnv);
- pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_rinit,
- joDocBase, joParameters, _pEmbeddedWindow->_joWindow, (jlong)0); testJavaException(pEnv);
- pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_init); testJavaException(pEnv);
- pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_startUp); testJavaException(pEnv);
-
- }
- catch(jvmaccess::VirtualMachine::AttachGuard::CreationException & )
- {
- throw RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "sjapplet_impl.cxx: Could not create jvmaccess::"
- "VirtualMachine::AttachGuard!")), 0);
- }
-
-#else // !SOLAR_JAVA
- throwException();
-#endif
-}
-
-void SjApplet2_Impl::setSize(const Size & rSize) throw(com::sun::star::uno::RuntimeException)
-{
-
-#ifdef SOLAR_JAVA
- try
- {
- if ( ! _virtualMachine.is())
- return;
- jvmaccess::VirtualMachine::AttachGuard vmAttachGuard(_virtualMachine);
- JNIEnv * pEnv = vmAttachGuard.getEnvironment();
-
- _pParentWin->SetSizePixel(rSize);
-
- jmethodID jmAppletExecutionContext_resize = pEnv->GetMethodID(
- _jcAppletExecutionContext, "appletResize", "(II)V");
- testJavaException(pEnv);
- pEnv->CallVoidMethod(_joAppletExecutionContext,
- jmAppletExecutionContext_resize, (jint)rSize.Width(),
- (jint)rSize.Height());
- testJavaException(pEnv);
- }
- catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &)
- {
- throw RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "SjApplet2_Impl::setSize, Could not create jvmaccess::"
- "VirtualMachine::AttachGuard!")), 0);
- }
-#else // !SOLAR_JAVA
- throwException();
-#endif
-}
-
-void SjApplet2_Impl::restart() throw(com::sun::star::uno::RuntimeException)
-{
-#ifdef SOLAR_JAVA
- try
- {
- if ( ! _virtualMachine.is())
- return;
- jvmaccess::VirtualMachine::AttachGuard vmAttachGuard(_virtualMachine);
- JNIEnv * pEnv = vmAttachGuard.getEnvironment();
- jmethodID jmAppletExecutionContext_restart = pEnv->GetMethodID(
- _jcAppletExecutionContext, "restart", "()V");
- testJavaException(pEnv);
- pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_restart);
- testJavaException(pEnv);
- }
- catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &)
- {
- throw RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "SjApplet2_Impl::restart, Could not create jvmaccess::"
- "VirtualMachine::AttachGuard!")), 0);
- }
-#else // !SOLAR_JAVA
- throwException();
-#endif
-}
-
-void SjApplet2_Impl::reload() throw(com::sun::star::uno::RuntimeException)
-{
-#ifdef SOLAR_JAVA
- try
- {
- if ( ! _virtualMachine.is())
- return;
- jvmaccess::VirtualMachine::AttachGuard vmAttachGuard(_virtualMachine);
- JNIEnv * pEnv = vmAttachGuard.getEnvironment();
- jmethodID jmAppletExecutionContext_reload = pEnv->GetMethodID(
- _jcAppletExecutionContext, "reload", "()V");
- testJavaException(pEnv);
- pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_reload);
- testJavaException(pEnv);
- }
- catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &)
- {
- throw RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "SjApplet2_Impl::reload, Could not create jvmaccess::"
- "VirtualMachine::AttachGuard!")), 0);
- }
-#else // !SOLAR_JAVA
- throwException();
-#endif
-}
-
-void SjApplet2_Impl::start() throw(com::sun::star::uno::RuntimeException)
-{
-#ifdef SOLAR_JAVA
- try
- {
- if ( ! _virtualMachine.is())
- return;
- jvmaccess::VirtualMachine::AttachGuard vmAttachGuard(_virtualMachine);
- JNIEnv * pEnv = vmAttachGuard.getEnvironment();
- jmethodID jmAppletExecutionContext_sendStart = pEnv->GetMethodID(
- _jcAppletExecutionContext, "sendStart", "()V");
- testJavaException(pEnv);
- pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_sendStart);
- testJavaException(pEnv);
- }
- catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &)
- {
- throw RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "SjApplet2_Impl::restart, Could not create jvmaccess::"
- "VirtualMachine::AttachGuard!")), 0);
- }
-#else // !SOLAR_JAVA
- throwException();
-#endif
-}
-
-void SjApplet2_Impl::stop() throw(com::sun::star::uno::RuntimeException)
-{
-#ifdef SOLAR_JAVA
- try
- {
- if ( ! _virtualMachine.is())
- return;
- jvmaccess::VirtualMachine::AttachGuard vmAttachGuard(_virtualMachine);
- JNIEnv * pEnv = vmAttachGuard.getEnvironment();
- jmethodID jmAppletExecutionContext_sendStop = pEnv->GetMethodID(
- _jcAppletExecutionContext, "sendStop", "()V");
- testJavaException(pEnv);
- pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_sendStop);
- testJavaException(pEnv);
- }
- catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &)
- {
- throw RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "SjApplet2_Impl::restart, Could not create jvmaccess::"
- "VirtualMachine::AttachGuard!")), 0);
- }
-#else // !SOLAR_JAVA
- throwException();
-#endif
-}
-
-void SjApplet2_Impl::close() throw(com::sun::star::uno::RuntimeException)
-{
-#ifdef SOLAR_JAVA
- try
- {
- if ( ! _virtualMachine.is())
- return;
- jvmaccess::VirtualMachine::AttachGuard vmAttachGuard(_virtualMachine);
- JNIEnv * pEnv = vmAttachGuard.getEnvironment();
-
- jmethodID jmAppletExecutionContext_shutdown = pEnv->GetMethodID(
- _jcAppletExecutionContext, "shutdown", "()V");
- testJavaException(pEnv);
- pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_shutdown);
- testJavaException(pEnv);
-
- jmethodID jmWaitForDispose= pEnv->GetMethodID(
- _jcAppletExecutionContext,"waitForDispose","()V");
- testJavaException(pEnv);
- //blocks until the applet has destroyed itself and the container was disposed
- //(stardiv.applet.AppletExecutionContext.dispose)
- pEnv->CallVoidMethod(_joAppletExecutionContext, jmWaitForDispose);
-
- // now that the applet is disposed, we dispose the AppletExecutionContext, that will end the thread
- // which dispatches the applet methods, such as init, start, stop , destroy.
- jmethodID jmAppletExecutionContext_dispose= pEnv->GetMethodID(
- _jcAppletExecutionContext,"dispose", "()V");
- testJavaException(pEnv);
- pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_dispose);
- testJavaException(pEnv);
-
- if( _pParentWin )
- {
- WorkWindow* pAppWin = Application::GetAppWindow();
- if(pAppWin)
- {
- while(_pParentWin->GetChildCount())
- {
- Window* pChild = _pParentWin->GetChild(0);
- pChild->Show( FALSE );
- pChild->SetParent( pAppWin );
- }
- }
- }
- }
- catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &)
- {
- throw RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "SjApplet2_Impl::close, Could not create jvmaccess::"
- "VirtualMachine::AttachGuard!")), 0);
- }
-#else // !SOLAR_JAVA
- throwException();
-#endif
-}
-
diff --git a/sj2/source/jscpp/sjapplet_impl.hxx b/sj2/source/jscpp/sjapplet_impl.hxx
deleted file mode 100644
index 61867984f407..000000000000
--- a/sj2/source/jscpp/sjapplet_impl.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-#include <cstdarg>
-
-#ifdef SOLAR_JAVA
-#include <jni.h>
-#endif // SOLAR_JAVA
-
-#ifdef SOLAR_JAVA
-#include <com/sun/star/java/XJavaVM.hpp>
-#include <com/sun/star/java/XJavaThreadRegister_11.hpp>
-#else
-#include <com/sun/star/uno/RuntimeException.hpp>
-#endif // SOLAR_JAVA
-
-#include "rtl/ref.hxx"
-#include "com/sun/star/uno/Reference.hxx"
-#include "jvmaccess/virtualmachine.hxx"
-
-class Window;
-class INetURLObject;
-class SvCommandList;
-class Size;
-namespace com { namespace sun { namespace star { namespace uno {
- class XComponentContext;
-} } } }
-
-#ifdef SOLAR_JAVA
-struct EmbeddedWindow;
-#endif // SOLAR_JAVA
-
-struct SjApplet2_Impl {
-#ifdef SOLAR_JAVA
- Window * _pParentWin;
-
- rtl::Reference<jvmaccess::VirtualMachine> _virtualMachine;
-
- jobject _joAppletExecutionContext;
- jclass _jcAppletExecutionContext;
-
- EmbeddedWindow * _pEmbeddedWindow;
-#endif // SOLAR_JAVA
- SjApplet2_Impl() throw(com::sun::star::uno::RuntimeException);
- ~SjApplet2_Impl() throw();
-
- void init(Window * pParentWin,
- com::sun::star::uno::Reference<
- com::sun::star::uno::XComponentContext > const & context,
- const INetURLObject & rDocBase,
- const SvCommandList & rCmdList) throw(com::sun::star::uno::RuntimeException);
-
- void setSize(const Size & rSize) throw(com::sun::star::uno::RuntimeException);
- void restart() throw(com::sun::star::uno::RuntimeException);
- void reload() throw(com::sun::star::uno::RuntimeException);
- void start() throw(com::sun::star::uno::RuntimeException);
- void stop() throw(com::sun::star::uno::RuntimeException);
- void close() throw(com::sun::star::uno::RuntimeException);
-};
diff --git a/sj2/stardiv/app/AppletMessageHandler.java b/sj2/stardiv/app/AppletMessageHandler.java
deleted file mode 100644
index 07782c11183c..000000000000
--- a/sj2/stardiv/app/AppletMessageHandler.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*************************************************************************
- *
- * 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: AppletMessageHandler.java,v $
- * $Revision: 1.3 $
- *
- * 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 stardiv.app;
-
-import java.util.ResourceBundle;
-import java.util.MissingResourceException;
-import java.text.MessageFormat;
-
-/**
- * An hanlder of localized messages.
- *
- * @version 1.8, 03/03/97
- * @author Koji Uno
- */
-public class AppletMessageHandler {
- private static ResourceBundle rb;
- private String baseKey = null;
-
- static {
- try {
- rb = ResourceBundle.getBundle("stardiv.app.MsgAppletViewer");
- } catch (MissingResourceException e) {
- System.out.println(e.getMessage());
- }
- };
-
- public AppletMessageHandler(String baseKey) {
- this.baseKey = baseKey;
- }
-
- public String getMessage(String key) {
- return (String)rb.getString(getQualifiedKey(key));
- }
-
- public String getMessage(String key, Object arg){
- String basemsgfmt = (String)rb.getString(getQualifiedKey(key));
- MessageFormat msgfmt = new MessageFormat(basemsgfmt);
- Object msgobj[] = new Object[1];
- if (arg == null) {
- arg = "null"; // mimic java.io.PrintStream.print(String)
- }
- msgobj[0] = arg;
- return msgfmt.format(msgobj);
- }
-
- public String getMessage(String key, Object arg1, Object arg2) {
- String basemsgfmt = (String)rb.getString(getQualifiedKey(key));
- MessageFormat msgfmt = new MessageFormat(basemsgfmt);
- Object msgobj[] = new Object[2];
- if (arg1 == null) {
- arg1 = "null";
- }
- if (arg2 == null) {
- arg2 = "null";
- }
- msgobj[0] = arg1;
- msgobj[1] = arg2;
- return msgfmt.format(msgobj);
- }
-
- public String getMessage(String key, Object arg1, Object arg2, Object arg3) {
- String basemsgfmt = (String)rb.getString(getQualifiedKey(key));
- MessageFormat msgfmt = new MessageFormat(basemsgfmt);
- Object msgobj[] = new Object[3];
- if (arg1 == null) {
- arg1 = "null";
- }
- if (arg2 == null) {
- arg2 = "null";
- }
- if (arg3 == null) {
- arg3 = "null";
- }
- msgobj[0] = arg1;
- msgobj[1] = arg2;
- msgobj[2] = arg3;
- return msgfmt.format(msgobj);
- }
-
- public String getMessage(String key, Object arg[]) {
- String basemsgfmt = (String)rb.getString(getQualifiedKey(key));
- MessageFormat msgfmt = new MessageFormat(basemsgfmt);
- return msgfmt.format(arg);
- }
-
- public String getQualifiedKey(String subKey) {
- return baseKey + "." + subKey;
- }
-}
diff --git a/sj2/stardiv/app/AppletProps.java b/sj2/stardiv/app/AppletProps.java
deleted file mode 100644
index b1ad41e638e0..000000000000
--- a/sj2/stardiv/app/AppletProps.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*************************************************************************
- *
- * 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: AppletProps.java,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.
- *
- ************************************************************************/
-
-package stardiv.app;
-
-import stardiv.app.AppletMessageHandler;
-import stardiv.applet.AppletExecutionContext;
-
-import java.awt.*;
-import java.io.*;
-import java.util.Properties;
-import sun.net.www.http.HttpClient;
-import sun.net.ftp.FtpClient;
-
-public class AppletProps extends Frame {
- TextField proxyHost;
- TextField proxyPort;
- Choice networkMode;
- Choice accessMode;
- Choice unsignedMode;
-
- AppletExecutionContext appletExecutionContext;
-
- AppletProps(AppletExecutionContext appletExecutionContext) {
- this.appletExecutionContext = appletExecutionContext;
-
- setTitle(amh.getMessage("title"));
- Panel p = new Panel();
- p.setLayout(new GridLayout(0, 2));
-
- p.add(new Label(amh.getMessage("label.http.server", "Http proxy server:")));
- p.add(proxyHost = new TextField());
-
- p.add(new Label(amh.getMessage("label.http.proxy")));
- p.add(proxyPort = new TextField());
-
- p.add(new Label(amh.getMessage("label.network")));
- p.add(networkMode = new Choice());
- networkMode.addItem(amh.getMessage("choice.network.item.none"));
- networkMode.addItem(amh.getMessage("choice.network.item.applethost"));
- networkMode.addItem(amh.getMessage("choice.network.item.unrestricted"));
-
- String securityMode = System.getProperty("appletviewer.security.mode");
- securityMode = (securityMode == null) ? "none" : securityMode;
- securityMode = securityMode.equals("host") ? "applethost" : securityMode;
- networkMode.select(amh.getMessage("choice.network.item." + securityMode));
-
- p.add(new Label(amh.getMessage("label.class")));
- p.add(accessMode = new Choice());
- accessMode.addItem(amh.getMessage("choice.class.item.restricted"));
- accessMode.addItem(amh.getMessage("choice.class.item.unrestricted"));
-
- accessMode.select(Boolean.getBoolean("package.restrict.access.sun")
- ? amh.getMessage("choice.class.item.restricted")
- : amh.getMessage("choice.class.item.unrestricted"));
-
- p.add(new Label(amh.getMessage("label.unsignedapplet")));
- p.add(unsignedMode = new Choice());
- unsignedMode.addItem(amh.getMessage("choice.unsignedapplet.no"));
- unsignedMode.addItem(amh.getMessage("choice.unsignedapplet.yes"));
-
- add("Center", p);
- p = new Panel();
- p.add(new Button(amh.getMessage("button.apply")));
- p.add(new Button(amh.getMessage("button.reset")));
- p.add(new Button(amh.getMessage("button.cancel")));
- add("South", p);
- setLocation(200, 150);
- pack();
- reset();
- }
-
- void reset() {
- // if (Boolean.getBoolean("package.restrict.access.sun")) {
- // accessMode.select(amh.getMessage("choice.class.item.restricted"));
- // } else {
- // accessMode.select(amh.getMessage("choice.class.item.unrestricted"));
- // }
-
- if (System.getProperty("http.proxyHost") != null) {
- proxyHost.setText(System.getProperty("http.proxyHost"));
- proxyPort.setText(System.getProperty("http.proxyPort"));
- // HttpClient.proxyPort = Integer.valueOf(System.getProperty("http.proxyPort")).intValue();
- }
- else {
- proxyHost.setText("");
- proxyPort.setText("");
- }
-
- // if (Boolean.getBoolean("appletviewer.security.allowUnsigned")) {
- // unsignedMode.select(amh.getMessage("choice.unsignedapplet.yes"));
- // } else {
- // unsignedMode.select(amh.getMessage("choice.unsignedapplet.no"));
- // }
- }
-
- void apply() {
- // Get properties, set version
- Properties props = System.getProperties();
- if (proxyHost.getText().length() > 0) {
- props.put("http.proxyHost", proxyHost.getText().trim());
- props.put("http.proxyPort", proxyPort.getText().trim());
- } else {
- props.remove("http.proxyHost");
- }
- if ("None".equals(networkMode.getSelectedItem())) {
- props.put("appletviewer.security.mode", "none");
- } else if ("Unrestricted".equals(networkMode.getSelectedItem())) {
- props.put("appletviewer.security.mode", "unrestricted");
- } else {
- props.put("appletviewer.security.mode", "host");
- }
-
- if ("Restricted".equals(accessMode.getSelectedItem())) {
- props.put("package.restrict.access.sun", "true");
- props.put("package.restrict.access.netscape", "true");
- props.put("package.restrict.access.stardiv", "true");
- } else {
- props.put("package.restrict.access.sun", "false");
- props.put("package.restrict.access.netscape", "false");
- props.put("package.restrict.access.stardiv", "false");
- }
-
- if ("Yes".equals(unsignedMode.getSelectedItem())) {
- props.put("appletviewer.security.allowUnsigned", "true");
- } else {
- props.put("appletviewer.security.allowUnsigned", "false");
- }
-
- // Save properties
- try {
- reset();
-
- FileOutputStream out = new FileOutputStream(AppletViewer.theUserPropertiesFile);
- props.save(out, "AppletViewer");
- out.close();
- setVisible( false );
- } catch (IOException e) {
- System.out.println(amh.getMessage("apply.exception", e));
- e.printStackTrace();
- reset();
- }
- }
-
- public boolean action(Event evt, Object obj) {
- if (amh.getMessage("button.apply").equals(obj)) {
- apply();
- return true;
- }
- if (amh.getMessage("button.reset").equals(obj)) {
- reset();
- return true;
- }
- if (amh.getMessage("button.cancel").equals(obj)) {
- setVisible( false );
- return true;
- }
- return false;
- }
-
- private static AppletMessageHandler amh = new AppletMessageHandler("appletprops");
-
-}
diff --git a/sj2/stardiv/app/AppletViewer.java b/sj2/stardiv/app/AppletViewer.java
deleted file mode 100644
index db54daecd3f7..000000000000
--- a/sj2/stardiv/app/AppletViewer.java
+++ /dev/null
@@ -1,995 +0,0 @@
-/*************************************************************************
- *
- * 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: AppletViewer.java,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.
- *
- ************************************************************************/
-package stardiv.app;
-
-import java.awt.Toolkit;
-
-import java.net.InetAddress;
-
-//import stardiv.applet.AppletMessageHandler;
-import stardiv.applet.AppletExecutionContext;
-import stardiv.applet.DocumentProxy;
-
-//import stardiv.js.ip.RootTaskManager;
-//import stardiv.js.ip.BaseObj;
-//import stardiv.js.ide.Ide;
-//import stardiv.js.ne.RunTime;
-//import stardiv.js.base.IdentifierPool;
-//import stardiv.js.base.Identifier;
-//import stardiv.memory.AtomUnion;
-//import stardiv.js.ip.Ctor;
-import stardiv.controller.SjSettings;
-
-import java.util.*;
-import java.io.*;
-import java.awt.*;
-import java.awt.event.*;
-import java.applet.*;
-import java.net.URL;
-import java.net.MalformedURLException;
-
-
-/**
- * A frame to show the applet tag in.
- */
-class TextFrame extends Frame {
- /**
- * Create the tag frame.
- */
- TextFrame(int x, int y, String title, String text) {
- setTitle(title);
- TextArea txt = new TextArea(20, 60);
- txt.setText(text);
- txt.setEditable(false);
-
- add("Center", txt);
-
- Panel p = new Panel();
- add("South", p);
- Button b = new Button(amh.getMessage("button.dismiss", "Dismiss"));
- p.add(b);
-
- class ActionEventListener implements ActionListener {
- public void actionPerformed(ActionEvent evt) {
- dispose();
- }
- }
- b.addActionListener(new ActionEventListener());
-
- pack();
- setLocation(x, y);
- setVisible(true);
-
- WindowListener windowEventListener = new WindowAdapter() {
-
- public void windowClosing(WindowEvent evt) {
- dispose();
- }
- };
-
- addWindowListener(windowEventListener);
- }
- private static AppletMessageHandler amh = new AppletMessageHandler("textframe");
-
-}
-
-/**
- * The toplevel applet viewer.
- */
-public class AppletViewer extends Frame implements Observer {
- com.sun.star.lib.sandbox.ResourceViewer resourceViewer;
-
- /**
- * Some constants...
- */
- private static String defaultSaveFile = "Applet.ser";
-
- /**
- * Look here for the properties file
- */
- public static File theUserPropertiesFile;
- public static File theAppletViewerPropsFile;
-
- //private Ide aIde;
- //private RootTaskManager aRTM;
- //private BaseObj aRootObj;
-
- private AppletExecutionContext appletExecutionContext = null;
- Hashtable atts = null;
-
- static DocumentProxy documentViewer = null;
-
- /**
- * The status line.
- */
- Label label;
-
- /**
- * output status messages to this stream
- */
-
- PrintStream statusMsgStream;
-
- static Vector contexts = new Vector();
-
- private final class UserActionListener implements ActionListener {
- public void actionPerformed(ActionEvent evt) {
- processUserAction(evt);
- }
- }
-
- static {
- String sep = File.separator;
-
- File userHome = new File(System.getProperty("user.home"));
-
- File AVHome = new File(userHome, ".hotjava");
- // ensure the props folder can be made
- AVHome.mkdirs();
-
- theUserPropertiesFile = new File(AVHome, "properties");
- File JH = new File(System.getProperty("java.home"));
- theAppletViewerPropsFile = new File(JH, "lib" + sep + "appletviewer.properties");
- };
-
- /**
- * Create the applet viewer
- */
- public AppletViewer(int x, int y, URL doc, Hashtable atts, PrintStream statusMsgStream) {
-// resourceViewer = new stardiv.util.ResourceViewer();
-// resourceViewer.show();
- //sun.awt.ScreenUpdater does not exist in Java 1.4
-// System.err.println("#*#*#*:" + sun.awt.ScreenUpdater.updater);
- this.statusMsgStream = statusMsgStream;
- this.atts = atts;
-
- setTitle(amh.getMessage("tool.title", atts.get("code")));
-
- MenuBar mb = new MenuBar();
-
- Menu m = new Menu(amh.getMessage("menu.applet"));
-
- addMenuItem(m, "menuitem.restart");
- addMenuItem(m, "menuitem.reload");
- addMenuItem(m, "menuitem.stop");
- addMenuItem(m, "menuitem.save");
- addMenuItem(m, "menuitem.start");
- addMenuItem(m, "menuitem.clone");
- m.add(new MenuItem("-"));
- addMenuItem(m, "menuitem.tag");
- addMenuItem(m, "menuitem.info");
- addMenuItem(m, "menuitem.edit").setEnabled( false );
- addMenuItem(m, "menuitem.encoding");
- m.add(new MenuItem("-"));
- addMenuItem(m, "menuitem.print");
- m.add(new MenuItem("-"));
- addMenuItem(m, "menuitem.props");
- m.add(new MenuItem("-"));
- addMenuItem(m, "menuitem.close");
- // if (factory.isStandalone()) {
- addMenuItem(m, "menuitem.quit");
- // }
-
- mb.add(m);
-
- setMenuBar(mb);
-
- addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent evt) {
- appletExecutionContext.shutdown();
- }
-
- public void windowIconified(WindowEvent evt) {
- appletExecutionContext.sendLoad();
- }
-
- public void windowDeiconified(WindowEvent evt) {
- appletExecutionContext.sendStart();
- }
- });
-
- add("South", label = new Label(amh.getMessage("label.hello")));
-
- appletExecutionContext = new AppletExecutionContext(doc, atts, this, 0);
- appletExecutionContext.init();
-
- appletExecutionContext.addObserver(this);
- contexts.addElement(appletExecutionContext);
-
- pack();
- setVisible(true);
-
-// appletExecutionContext.send();
- appletExecutionContext.startUp();
-
-/*
- if( atts.get( "mayscript" ) != null ) {
- aIde = new Ide();
- aRTM = aIde.getActRootTaskManager();
- aRootObj = new BaseObj( aRTM );
- //Ctor aCtor = new AppletCtor( aRTM, "Window" );
- //aRootObj.initProperties( aCtor, aCtor.getStaticPropCount(), aCtor.getBasePropCount() );
- //aRootObj.setCtor( aCtor );
- aRTM.setRootObj( aRootObj );
- RunTime aRT = new RunTime( aRootObj, aRTM );
- aIde.setRootObj( aRootObj );
-
- AtomUnion aAU = new AtomUnion();
- BaseObj aDocument = new BaseObj( aRTM );
- aAU.setObject( aDocument );
- Identifier aId = IdentifierPool.aGlobalPool.addIdentifier( "RootObject" );
- aRootObj.newProperty( aId, aAU );
- IdentifierPool.aGlobalPool.releaseIdentifier( aId );
-
- String pName = (String)atts.get( "name" );
- if( pName != null ) {
- BaseObj aApplet = new BaseObj( aRTM );
- aAU.setObject( aApplet );
- aId = IdentifierPool.aGlobalPool.addIdentifier( pName );
- aDocument.newProperty( aId, aAU );
- IdentifierPool.aGlobalPool.releaseIdentifier( aId );
- }
- }
- */
- }
-
- public MenuItem addMenuItem(Menu m, String s) {
- MenuItem mItem = new MenuItem(amh.getMessage(s));
- mItem.addActionListener(new UserActionListener());
- return m.add(mItem);
- }
-
- /**
- * Ignore.
- */
- public void showDocument(URL url) {
- }
-
- /**
- * Ignore.
- */
- public void showDocument(URL url, String target) {
- }
-
- /**
- * Show status.
- */
- public void showStatus(String status) {
- label.setText(status);
- }
-
- public void update(Observable observable, Object status) {
- showStatus((String)status);
- }
-
- public Object getJavaScriptJSObjectWindow() {
- //if( aRootObj != null )
- // return aRootObj.getJSObject();
- return null;
- }
-
-
- /**
- * System parameters.
- */
- static Hashtable systemParam = new Hashtable();
-
- static {
- systemParam.put("codebase", "codebase");
- systemParam.put("code", "code");
- systemParam.put("alt", "alt");
- systemParam.put("width", "width");
- systemParam.put("height", "height");
- systemParam.put("align", "align");
- systemParam.put("vspace", "vspace");
- systemParam.put("hspace", "hspace");
- }
-
- /**
- * Print the HTML tag.
- */
- public static void printTag(PrintStream out, Hashtable atts) {
- out.print("<applet");
-
- String v = (String)atts.get("codebase");
- if (v != null) {
- out.print(" codebase=\"" + v + "\"");
- }
-
- v = (String)atts.get("code");
- if (v == null) {
- v = "applet.class";
- }
- out.print(" code=\"" + v + "\"");
- v = (String)atts.get("width");
- if (v == null) {
- v = "150";
- }
- out.print(" width=" + v);
-
- v = (String)atts.get("height");
- if (v == null) {
- v = "100";
- }
- out.print(" height=" + v);
-
- v = (String)atts.get("name");
- if (v != null) {
- out.print(" name=\"" + v + "\"");
- }
- out.println(">");
-
- // A very slow sorting algorithm
- int len = atts.size();
- String params[] = new String[len];
- len = 0;
- for (Enumeration e = atts.keys() ; e.hasMoreElements() ;) {
- String param = (String)e.nextElement();
- int i = 0;
- for (; i < len ; i++) {
- if (params[i].compareTo(param) >= 0) {
- break;
- }
- }
- System.arraycopy(params, i, params, i + 1, len - i);
- params[i] = param;
- len++;
- }
-
- for (int i = 0 ; i < len ; i++) {
- String param = params[i];
- if (systemParam.get(param) == null) {
- out.println("<param name=" + param +
- " value=\"" + atts.get(param) + "\">");
- }
- }
- out.println("</applet>");
- }
-
- /**
- * Make sure the atrributes are uptodate.
- */
- public void updateAtts() {
- Dimension d = getSize();
- Insets in = getInsets();
- atts.put("width", new Integer(d.width - (in.left + in.right)).toString());
- atts.put("height", new Integer(d.height - (in.top + in.bottom)).toString());
- }
-
- /**
- * Save the applet to a well known file (for now) as a serialized object
- */
- void appletSave() {
- // REMIND -- should check that the applet has really stopped
- FileDialog fd = new FileDialog(this, "Serialize Applet into File", FileDialog.SAVE);
- // needed for a bug under Solaris...
- fd.setDirectory(System.getProperty("user.dir"));
- fd.setFile(defaultSaveFile);
- fd.show();
- String fname = fd.getFile();
- if (fname == null) {
- return; // cancelled
- }
- String dname = fd.getDirectory();
- File file = new File(dname, fname);
-
- try {
- OutputStream s = new FileOutputStream(file);
- ObjectOutputStream os = new ObjectOutputStream(s);
- showStatus(amh.getMessage("appletsave.err1",
- appletExecutionContext.getApplet().toString(), file.toString()));
- os.writeObject(appletExecutionContext.getApplet());
- } catch (IOException ex) {
- System.err.println(amh.getMessage("appletsave.err2", ex));
- }
- }
-
- /**
- * Clone the viewer and the applet.
- */
- void appletClone() {
- Point p = getLocation();
- updateAtts();
- // factory.createAppletViewer(p.x + 30, p.y + 10,
- // pHelper.panel.documentURL, (Hashtable)pHelper.panel.atts.clone());
- }
-
- /**
- * Show the applet tag.
- */
- void appletTag() {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- updateAtts();
- printTag(new PrintStream(out), atts);
- showStatus(amh.getMessage("applettag"));
-
- Point p = getLocation();
- new TextFrame(p.x + 50, p.y + 20, amh.getMessage("applettag.textframe"), out.toString());
- }
-
- /**
- * Show the applet info.
- */
- void appletInfo() {
- String str = appletExecutionContext.getApplet().getAppletInfo();
- if (str == null) {
- str = amh.getMessage("appletinfo.applet");
- }
- str += "\n\n";
-
- String atts[][] = appletExecutionContext.getApplet().getParameterInfo();
- if (atts != null) {
- for (int i = 0 ; i < atts.length ; i++) {
- str += atts[i][0] + " -- " + atts[i][1] + " -- " + atts[i][2] + "\n";
- }
- } else {
- str += amh.getMessage("appletinfo.param");
- }
-
- Point p = getLocation();
- new TextFrame(p.x + 50, p.y + 20, amh.getMessage("appletinfo.textframe"), str);
-
- }
-
- /**
- * Show character encoding type
- */
- void appletCharacterEncoding() {
- showStatus(amh.getMessage("appletencoding", encoding));
- }
-
- /**
- * Edit the applet.
- */
- void appletEdit() {
- }
-
- /**
- * Print the applet.
- */
- void appletPrint() {
- PrintJob pj = Toolkit.getDefaultToolkit().
- getPrintJob(this, amh.getMessage("appletprint.printjob"), (Properties)null);
-
-
- if (pj != null) {
- Dimension pageDim = pj.getPageDimension();
- int pageRes = pj.getPageResolution();
- boolean lastFirst = pj.lastPageFirst();
-
- Graphics g = pj.getGraphics();
- if (g != null) {
- appletExecutionContext.getApplet().printComponents(g);
- g.dispose();
- } else {
- statusMsgStream.println(amh.getMessage("appletprint.fail"));
- }
- statusMsgStream.println(amh.getMessage("appletprint.finish"));
- pj.end();
-
- } else {
- statusMsgStream.println(amh.getMessage("appletprint.cancel"));
- }
- }
-
- /**
- * Properties.
- */
- AppletProps props;
- public synchronized void networkProperties() {
- if (props == null) {
- props = new AppletProps(appletExecutionContext);
- }
- props.addNotify();
- props.setVisible(true);
- }
-
- /**
- * Close this viewer.
- * Stop, Destroy, Dispose and Quit an AppletView, then
- * reclaim resources and exit the program if this is
- * the last applet.
- */
- public void appletClose() {
- appletExecutionContext.shutdown();
- contexts.removeElement(this);
-
- if (contexts.size() == 0) {
- appletSystemExit();
- }
- }
-
-
-// public static void writeClasses() {
-// try {
-// java.io.FileOutputStream file = new FileOutputStream("classes.txt");
-// java.io.PrintStream printStream = new java.io.PrintStream(file);
-
-// printStream.println("- .* .*");
-// Enumeration elements = stardiv.util.HardClassContext.classList.elements();
-// while(elements.hasMoreElements()) {
-// String string = (String)elements.nextElement();
-
-// String packageName = "";
-// String className = string;
-
-// int lastIndex = string.lastIndexOf('.');
-// if(lastIndex > -1) {
-// packageName = string.substring(0, lastIndex);
-// className = string.substring(lastIndex + 1);
-// }
-
-// printStream.print("+ ");
-// int index;
-// while((index = packageName.indexOf('.')) > -1) {
-// printStream.print(packageName.substring(0, index) + "\\\\");
-// packageName = packageName.substring(index + 1);
-// }
-// printStream.print(packageName + " ");
-
-// while((index = className.indexOf('$')) > -1) {
-// printStream.print(className.substring(0, index) + "\\$");
-// className = className.substring(index + 1);
-// }
-// printStream.println(className + "\\.class");
-// }
-// file.close();
-// }
-// catch(java.io.IOException eio) {
-// System.err.println("IOException:" + eio);
-// }
-// }
-
- /**
- * Exit the program.
- * Exit from the program (if not stand alone) - do no clean-up
- */
- private void appletSystemExit() {
- // if (factory.isStandalone())
- System.exit(0);
- }
-
- /**
- * Quit all viewers.
- * Shutdown all viewers properly then
- * exit from the program (if not stand alone)
- */
- protected void appletQuit() {
- appletExecutionContext.shutdown();
- appletSystemExit();
- }
-
- /**
- * Handle events.
- */
- public void processUserAction(ActionEvent evt) {
-
- String label = ((MenuItem)evt.getSource()).getLabel();
-
- if (amh.getMessage("menuitem.restart").equals(label)) {
- appletExecutionContext.restart();
- return;
- }
-
- if (amh.getMessage("menuitem.reload").equals(label)) {
- appletExecutionContext.reload();
- return;
- }
-
- if (amh.getMessage("menuitem.clone").equals(label)) {
- appletClone();
- return;
- }
-
- if (amh.getMessage("menuitem.stop").equals(label)) {
- appletExecutionContext.sendStop();
- return;
- }
-
- if (amh.getMessage("menuitem.save").equals(label)) {
- appletSave();
- return;
- }
-
- if (amh.getMessage("menuitem.start").equals(label)) {
- appletExecutionContext.sendStart();
- return;
- }
-
- if (amh.getMessage("menuitem.tag").equals(label)) {
- appletTag();
- return;
- }
-
- if (amh.getMessage("menuitem.info").equals(label)) {
- appletInfo();
- return;
- }
-
- if (amh.getMessage("menuitem.encoding").equals(label)) {
- appletCharacterEncoding();
- return;
- }
-
- if (amh.getMessage("menuitem.edit").equals(label)) {
- appletEdit();
- return;
- }
-
- if (amh.getMessage("menuitem.print").equals(label)) {
- appletPrint();
- return;
- }
-
- if (amh.getMessage("menuitem.props").equals(label)) {
- networkProperties();
- return;
- }
-
- if (amh.getMessage("menuitem.close").equals(label)) {
- appletClose();
- return;
- }
-
- if (/*factory.isStandalone() && */amh.getMessage("menuitem.quit").equals(label)) {
- appletQuit();
- return;
- }
- //statusMsgStream.println("evt = " + evt);
- }
-
- /**
- * Prepare the enviroment for executing applets.
- */
- public static void init() {
- Properties props = new Properties();
- props.put( "http.proxyHost", "wwwproxy" );
- props.put( "http.proxyPort", "3128" );
- props.put( "ftpProxySet", "true" );
- props.put( "ftpProxyHost", "wwwproxy" );
- props.put( "ftpProxyPort", "3128" );
- props.put( "ftpProxyPort", "3128" );
- props.put( "stardiv.debug.trace", "window" );
- props.put( "stardiv.debug.warning", "window" );
- props.put( "stardiv.debug.error", "window" );
- props.put( "stardiv.security.defaultSecurityManager", "true" );
-
- // Try loading the appletviewer properties file to get messages, etc.
-// try {
-// FileInputStream in = new FileInputStream(theAppletViewerPropsFile);
-// props.load(new BufferedInputStream(in));
-// in.close();
-// } catch (Exception e) {
-// System.out.println(amh.getMessage("init.err"));
-// }
-
- // Try loading the saved user properties file to override some
- // of the above defaults.
- try {
- FileInputStream in = new FileInputStream(theUserPropertiesFile);
- props.load(new BufferedInputStream(in));
- in.close();
- } catch (Exception e) {
- /* is it really necessary to say this?
- This is always the case the first time we run..
- System.out.println("[no properties loaded, using defaults]"); */
- }
-
- // Install a property list.
-
- SjSettings.changeProperties(props);
- }
-
- /**
- * The current character.
- */
- static int c;
-
- /**
- * Scan spaces.
- */
- public static void skipSpace(Reader in) throws IOException {
- while ((c >= 0) && ((c == ' ') || (c == '\t') || (c == '\n') || (c == '\r'))) {
- c = in.read();
- }
- }
-
- /**
- * Scan identifier
- */
- public static String scanIdentifier(Reader in) throws IOException {
- StringBuffer buf = new StringBuffer();
- while (true) {
- if (((c >= 'a') && (c <= 'z')) ||
- ((c >= 'A') && (c <= 'Z')) ||
- ((c >= '0') && (c <= '9')) || (c == '_')) {
- buf.append((char)c);
- c = in.read();
- } else {
- return buf.toString();
- }
- }
- }
-
- /**
- * Scan tag
- */
- public static Hashtable scanTag(Reader in) throws IOException {
- Hashtable atts = new Hashtable();
- skipSpace(in);
- while (c >= 0 && c != '>') {
- String att = scanIdentifier(in);
- String val = "";
- skipSpace(in);
- if (c == '=') {
- int quote = -1;
- c = in.read();
- skipSpace(in);
- if ((c == '\'') || (c == '\"')) {
- quote = c;
- c = in.read();
- }
- StringBuffer buf = new StringBuffer();
- while ((c > 0) &&
- (((quote < 0) && (c != ' ') && (c != '\t') &&
- (c != '\n') && (c != '\r') && (c != '>'))
- || ((quote >= 0) && (c != quote)))) {
- buf.append((char)c);
- c = in.read();
- }
- if (c == quote) {
- c = in.read();
- }
- skipSpace(in);
- val = buf.toString();
- }
- //statusMsgStream.println("PUT " + att + " = '" + val + "'");
- atts.put(att.toLowerCase(), val);
- skipSpace(in);
- }
- return atts;
- }
-
- static int x = 100;
- static int y = 50;
-
- static String encoding = null;
-
- static private Reader makeReader(InputStream is) {
- if (encoding != null) {
- try {
- return new BufferedReader(new InputStreamReader(is, encoding));
- } catch (IOException x) { }
- }
- InputStreamReader r = new InputStreamReader(is);
- encoding = r.getEncoding();
- return new BufferedReader(r);
- }
-
- /**
- * Scan an html file for <applet> tags
- */
- public static void parse(URL url) throws IOException {
- parse(url, System.out);
- }
-
- public static void parse(URL url, PrintStream statusMsgStream) throws IOException {
-
- // warning messages
- String requiresNameWarning = amh.getMessage("parse.warning.requiresname");
- String paramOutsideWarning = amh.getMessage("parse.warning.paramoutside");
- String requiresCodeWarning = amh.getMessage("parse.warning.requirescode");
- String requiresHeightWarning = amh.getMessage("parse.warning.requiresheight");
- String requiresWidthWarning = amh.getMessage("parse.warning.requireswidth");
- String appNotLongerSupportedWarning = amh.getMessage("parse.warning.appnotLongersupported");
-
- java.net.URLConnection conn = url.openConnection();
- Reader in = makeReader(conn.getInputStream());
- /* The original URL may have been redirected - this
- * sets it to whatever URL/codebase we ended up getting
- */
- url = conn.getURL();
-
- Hashtable atts = null;
- while(true) {
- c = in.read();
- if (c == -1)
- break;
-
- if (c == '<') {
- c = in.read();
- if (c == '/') {
- c = in.read();
- String nm = scanIdentifier(in);
- if (nm.equalsIgnoreCase("applet")) {
- if (atts != null) {
- new AppletViewer(x, y, url, atts, System.out);
- x += 50;
- y += 20;
- // make sure we don't go too far!
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- if (x > d.width - 30)
- x = 100;
- if (y > d.height - 30)
- y = 50;
- }
- atts = null;
- }
- }
- else {
- String nm = scanIdentifier(in);
- if (nm.equalsIgnoreCase("param")) {
- Hashtable t = scanTag(in);
- String att = (String)t.get("name");
- if (att == null) {
- statusMsgStream.println(requiresNameWarning);
- } else {
- String val = (String)t.get("value");
- if (val == null) {
- statusMsgStream.println(requiresNameWarning);
- } else if (atts != null) {
- atts.put(att.toLowerCase(), val);
- } else {
- statusMsgStream.println(paramOutsideWarning);
- }
- }
- }
- else if (nm.equalsIgnoreCase("applet")) {
- atts = scanTag(in);
- if (atts.get("code") == null && atts.get("object") == null) {
- statusMsgStream.println(requiresCodeWarning);
- atts = null;
- } else if (atts.get("width") == null) {
- statusMsgStream.println(requiresWidthWarning);
- atts = null;
- } else if (atts.get("height") == null) {
- statusMsgStream.println(requiresHeightWarning);
- atts = null;
- }
- }
- else if (nm.equalsIgnoreCase("app")) {
- statusMsgStream.println(appNotLongerSupportedWarning);
- Hashtable atts2 = scanTag(in);
- nm = (String)atts2.get("class");
- if (nm != null) {
- atts2.remove("class");
- atts2.put("code", nm + ".class");
- }
- nm = (String)atts2.get("src");
- if (nm != null) {
- atts2.remove("src");
- atts2.put("codebase", nm);
- }
- if (atts2.get("width") == null) {
- atts2.put("width", "100");
- }
- if (atts2.get("height") == null) {
- atts2.put("height", "100");
- }
- printTag(statusMsgStream, atts2);
- statusMsgStream.println();
- }
- }
- }
- }
- in.close();
- }
-
- /**
- * Print usage
- */
- static void usage() {
- System.out.println(amh.getMessage("usage"));
- }
-
- static boolean didInitialize = false;
-
- /**
- * mainInit can be called by direct clients
- */
- public static void mainInit() {
- if (! didInitialize) {
- didInitialize = true;
-
- init();
-
- }
- }
-
- /**
- * Main
- */
- public static void main(String argv[]) {
- mainInit();
-
- // Parse arguments
- if (argv.length == 0) {
- System.out.println(amh.getMessage("main.err.inputfile"));
- usage();
- return;
- }
-
- // Parse the documents
- for (int i = 0 ; i < argv.length ; i++) {
- try {
- URL url = null;
-
- if (argv[i].equals("-encoding")) {
- if(i + 1 < argv.length) {
- i++;
- encoding = argv[i];
- continue;
- } else {
- usage();
- System.exit(1);
- }
- }
- else
- if (argv[i].indexOf(':') <= 1) {
- String userDir = System.getProperty("user.dir");
- String prot;
- // prepend native separator to path iff not present
- if (userDir.charAt(0) == '/' ||
- userDir.charAt(0) == java.io.File.separatorChar) {
- prot = "file:";
- } else {
- prot = "file:/";
- }
- url = new URL(prot + userDir.replace(File.separatorChar, '/')
- + "/");
- url = new URL(url, argv[i]);
- } else {
- url = new URL(argv[i]);
- }
-
- parse(url);
- documentViewer = DocumentProxy.getDocumentProxy(url, Toolkit.getDefaultToolkit());
- } catch (MalformedURLException e) {
- System.out.println(amh.getMessage("main.err.badurl", argv[i], e.getMessage()));
- System.exit(1);
- } catch (IOException e) {
- System.out.println(amh.getMessage("main.err.io", e.getMessage()));
- if (argv[i].indexOf(':') < 0) {
- System.out.println(amh.getMessage("main.err.readablefile", argv[i]));
- } else {
- System.out.println(amh.getMessage("main.err.correcturl", argv[i]));
- }
- System.exit(1);
- }
- }
- /*
- if (documentViewer.countApplets() == 0) {
- System.out.println(amh.getMessage("main.warning"));
- usage();
- System.exit(1);
- }*/
- }
- private static AppletMessageHandler amh = new AppletMessageHandler("appletviewer");
-}
diff --git a/sj2/stardiv/app/MsgAppletViewer.java b/sj2/stardiv/app/MsgAppletViewer.java
deleted file mode 100644
index 4f15a57758b6..000000000000
--- a/sj2/stardiv/app/MsgAppletViewer.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*************************************************************************
- *
- * 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: MsgAppletViewer.java,v $
- * $Revision: 1.3 $
- *
- * 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 stardiv.app;
-
-import java.util.ListResourceBundle;
-
-public class MsgAppletViewer extends ListResourceBundle {
-
- public Object[][] getContents() {
- return contents;
- }
-
- static final Object[][] contents = {
- {"textframe.button.dismiss", "Dismiss"},
- {"appletviewer.tool.title", "Applet Viewer: {0}"},
- {"appletviewer.menu.applet", "Applet"},
- {"appletviewer.menuitem.restart", "Restart"},
- {"appletviewer.menuitem.reload", "Reload"},
- {"appletviewer.menuitem.stop", "Stop"},
- {"appletviewer.menuitem.save", "Save..."},
- {"appletviewer.menuitem.start", "Start"},
- {"appletviewer.menuitem.clone", "Clone..."},
- {"appletviewer.menuitem.tag", "Tag..."},
- {"appletviewer.menuitem.info", "Info..."},
- {"appletviewer.menuitem.edit", "Edit"},
- {"appletviewer.menuitem.encoding", "Character Encoding"},
- {"appletviewer.menuitem.print", "Print..."},
- {"appletviewer.menuitem.props", "Properties..."},
- {"appletviewer.menuitem.close", "Close"},
- {"appletviewer.menuitem.quit", "Quit"},
- {"appletviewer.label.hello", "Hello..."},
- {"appletviewer.status.start", "starting applet..."},
- {"appletviewer.appletsave.err1", "serializing an {0} to {1}"},
- {"appletviewer.appletsave.err2", "in appletSave: {0}"},
- {"appletviewer.applettag", "Tag shown"},
- {"appletviewer.applettag.textframe", "Applet HTML Tag"},
- {"appletviewer.appletinfo.applet", "-- no applet info --"},
- {"appletviewer.appletinfo.param", "-- no parameter info --"},
- {"appletviewer.appletinfo.textframe", "Applet Info"},
- {"appletviewer.appletprint.printjob", "Print Applet"},
- {"appletviewer.appletprint.fail", "Printing failed."},
- {"appletviewer.appletprint.finish", "Finished printing."},
- {"appletviewer.appletprint.cancel", "Printing cancelled."},
- {"appletviewer.appletencoding", "Character Encoding: {0}"},
- {"appletviewer.init.err", "[no appletviewer.properties file found!]"},
- {"appletviewer.parse.warning.requiresname", "Warning: <param name=... value=...> tag requires name attribute."},
- {"appletviewer.parse.warning.paramoutside", "Warning: <param> tag outside <applet> ... </applet>."},
- {"appletviewer.parse.warning.requirescode", "Warning: <applet> tag requires code attribute."},
- {"appletviewer.parse.warning.requiresheight", "Warning: <applet> tag requires height attribute."},
- {"appletviewer.parse.warning.requireswidth", "Warning: <applet> tag requires width attribute."},
- {"appletviewer.parse.warning.appnotLongersupported", "Warning: <app> tag no longer supported, use <applet> instead:"},
- {"appletviewer.usage", "usage: appletviewer [-debug] [-J<javaflag>] [-encoding <character encoding type> ] url|file ..."},
- {"appletviewer.main.err.inputfile", "No input files specified."},
- {"appletviewer.main.err.badurl", "Bad URL: {0} ( {1} )"},
- {"appletviewer.main.err.io", "I/O exception while reading: {0}"},
- {"appletviewer.main.err.readablefile", "Make sure that {0} is a file and is readable."},
- {"appletviewer.main.err.correcturl", "Is {0} the correct URL?"},
- {"appletviewer.main.warning", "Warning: No Applets were started. Make sure the input contains an <applet> tag."},
- {"appletioexception.loadclass.throw.interrupted", "class loading interrupted: {0}"},
- {"appletioexception.loadclass.throw.notloaded", "class not loaded: {0}"},
- {"appletclassloader.loadcode.verbose", "Opening stream to: {0} to get {1}"},
- {"appletclassloader.filenotfound", "File not found when looking for: {0}"},
- {"appletclassloader.fileformat", "File format exception when loading: {0}"},
- {"appletclassloader.fileioexception", "I/O exception when loading: {0}"},
- {"appletclassloader.fileexception", "{0} exception when loading: {1}"},
- {"appletclassloader.filedeath", "{0} killed when loading: {1}"},
- {"appletclassloader.fileerror", "{0} error when loading: {1}"},
- {"appletclassloader.findclass.verbose.findclass", "{0} find class {1}"},
- {"appletclassloader.findclass.verbose.openstream", "Opening stream to: {0} to get {1}"},
- {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource for name: {0}"},
- {"appletclassloader.getresource.verbose.found", "Found resource: {0} as a system resource"},
- {"appletclassloader.getresourceasstream.verbose", "Found resource: {0} as a system resource"},
- {"appletcopyright.title", "Copyright Notice"},
- {"appletcopyright.button.accept", "Accept"},
- {"appletcopyright.button.reject", "Reject"},
- {"appletcopyright.defaultcontent", "Copyright (c) 1995, 1996, 1997 Sun Microsystems, Inc."},
- {"appletcopyright.copyrightfile", "COPYRIGHT"},
- {"appletcopyright.copyrightencoding", "8859_1"},
- {"appletpanel.runloader.err", "Either object or code parameter!"},
- {"appletpanel.runloader.exception", "exception while deserializing {0}"},
- {"appletpanel.destroyed", "Applet destroyed."},
- {"appletpanel.loaded", "Applet loaded."},
- {"appletpanel.started", "Applet started."},
- {"appletpanel.inited", "Applet initialized."},
- {"appletpanel.stopped", "Applet stopped."},
- {"appletpanel.disposed", "Applet disposed."},
- {"appletpanel.nocode", "APPLET tag missing CODE parameter."},
- {"appletpanel.notfound", "load: class {0} not found."},
- {"appletpanel.nocreate", "load: {0} can''t be instantiated."},
- {"appletpanel.noconstruct", "load: {0} is not public or has no public constructor."},
- {"appletpanel.death", "killed"},
- {"appletpanel.exception", "exception: {0}."},
- {"appletpanel.exception2", "exception: {0}: {1}."},
- {"appletpanel.error", "error: {0}."},
- {"appletpanel.error2", "error: {0}: {1}."},
- {"appletpanel.notloaded", "Init: applet not loaded."},
- {"appletpanel.notinited", "Start: applet not initialized."},
- {"appletpanel.notstarted", "Stop: applet not started."},
- {"appletpanel.notstopped", "Destroy: applet not stopped."},
- {"appletpanel.notdestroyed", "Dispose: applet not destroyed."},
- {"appletpanel.notdisposed", "Load: applet not disposed."},
- {"appletpanel.bail", "Interrupted: bailing out."},
- {"appletpanel.filenotfound", "File not found when looking for: {0}"},
- {"appletpanel.fileformat", "File format exception when loading: {0}"},
- {"appletpanel.fileioexception", "I/O exception when loading: {0}"},
- {"appletpanel.fileexception", "{0} exception when loading: {1}"},
- {"appletpanel.filedeath", "{0} killed when loading: {1}"},
- {"appletpanel.fileerror", "{0} error when loading: {1}"},
- {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream requires non-null loader"},
- {"appletprops.title", "AppletViewer Properties"},
- {"appletprops.label.http.server", "Http proxy server:"},
- {"appletprops.label.http.proxy", "Http proxy port:"},
- {"appletprops.label.network", "Network access:"},
- {"appletprops.choice.network.item.none", "None"},
- {"appletprops.choice.network.item.applethost", "Applet Host"},
- {"appletprops.choice.network.item.unrestricted", "Unrestricted"},
- {"appletprops.label.class", "Class access:"},
- {"appletprops.choice.class.item.restricted", "Restricted"},
- {"appletprops.choice.class.item.unrestricted", "Unrestricted"},
- {"appletprops.label.unsignedapplet", "Allow unsigned applets:"},
- {"appletprops.choice.unsignedapplet.no", "No"},
- {"appletprops.choice.unsignedapplet.yes", "Yes"},
- {"appletprops.button.apply", "Apply"},
- {"appletprops.button.cancel", "Cancel"},
- {"appletprops.button.reset", "Reset"},
- {"appletprops.apply.exception", "Failed to save properties: {0}"},
- {"appletsecurityexception.checkcreateclassloader", "Security Exception: classloader"},
- {"appletsecurityexception.checkaccess.thread", "Security Exception: thread"},
- {"appletsecurityexception.checkaccess.threadgroup", "Security Exception: threadgroup: {0}"},
- {"appletsecurityexception.checkexit", "Security Exception: exit: {0}"},
- {"appletsecurityexception.checkexec", "Security Exception: exec: {0}"},
- {"appletsecurityexception.checklink", "Security Exception: link: {0}"},
- {"appletsecurityexception.checkpropsaccess", "Security Exception: properties"},
- {"appletsecurityexception.checkpropsaccess.key", "Security Exception: properties access {0}"},
- {"appletsecurityexception.checkread.exception1", "Security Exception: {0}, {1}"},
- {"appletsecurityexception.checkread.exception2", "Security Exception: file.read: {0}"},
- {"appletsecurityexception.checkread", "Security Exception: file.read: {0} == {1}"},
- {"appletsecurityexception.checkwrite.exception", "Security Exception: {0}, {1}"},
- {"appletsecurityexception.checkwrite", "Security Exception: file.write: {0} == {1}"},
- {"appletsecurityexception.checkread.fd", "Security Exception: fd.read"},
- {"appletsecurityexception.checkwrite.fd", "Security Exception: fd.write"},
- {"appletsecurityexception.checklisten", "Security Exception: socket.listen: {0}"},
- {"appletsecurityexception.checkaccept", "Security Exception: socket.accept: {0}:{1}"},
- {"appletsecurityexception.checkconnect.networknone", "Security Exception: socket.connect: {0}->{1}"},
- {"appletsecurityexception.checkconnect.networkhost1", "Security Exception: Couldn''t connect to {0} with origin from {1}."},
- {"appletsecurityexception.checkconnect.networkhost2", "Security Exception: Couldn''t resolve IP for host {0} or for {1}. "},
- {"appletsecurityexception.checkconnect.networkhost3", "Security Exception: Could not resolve IP for host {0}. See the trustProxy property."},
- {"appletsecurityexception.checkconnect", "Security Exception: connect: {0}->{1}"},
- {"appletsecurityexception.checkpackageaccess", "Security Exception: cannot access package: {0}"},
- {"appletsecurityexception.checkpackagedefinition", "Security Exception: cannot define package: {0}"},
- {"appletsecurityexception.cannotsetfactory", "Security Exception: cannot set factory"},
- {"appletsecurityexception.checkmemberaccess", "Security Exception: check member access"},
- {"appletsecurityexception.checkgetprintjob", "Security Exception: getPrintJob"},
- {"appletsecurityexception.checksystemclipboardaccess", "Security Exception: getSystemClipboard"},
- {"appletsecurityexception.checkawteventqueueaccess", "Security Exception: getEventQueue"},
- {"appletsecurityexception.checksecurityaccess", "Security Exception: security operation: {0}"},
- {"appletsecurityexception.getsecuritycontext.unknown", "unknown class loader type. unable to check for getContext"},
- {"appletsecurityexception.checkread.unknown", "unknown class loader type. unable to check for checking read {0}"},
- {"appletsecurityexception.checkconnect.unknown", "unknown class loader type. unable to check for checking connect"},
- {"appletsecurityexception.getresource.noclassaccess", "Cannot use getResource to access .class file: {0} in JDK1.1"},
- };
-}
diff --git a/sj2/stardiv/applet/AppletExecutionContext.java b/sj2/stardiv/applet/AppletExecutionContext.java
deleted file mode 100644
index d69b440572ac..000000000000
--- a/sj2/stardiv/applet/AppletExecutionContext.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/*************************************************************************
- *
- * 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: AppletExecutionContext.java,v $
- * $Revision: 1.9 $
- *
- * 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 stardiv.applet;
-
-import java.applet.Applet;
-import java.applet.AppletStub;
-import java.applet.AppletContext;
-import java.applet.AudioClip;
-
-import java.awt.BorderLayout;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Panel;
-import java.awt.Toolkit;
-import java.awt.Window;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-
-import java.net.URL;
-import java.net.MalformedURLException;
-
-import java.util.Hashtable;
-import java.util.Vector;
-
-import sun.misc.Queue;
-
-import com.sun.star.lib.sandbox.ClassContextProxy;
-import com.sun.star.lib.sandbox.ExecutionContext;
-import com.sun.star.lib.sandbox.JarEntry;
-import com.sun.star.lib.sandbox.ResourceProxy;
-import com.sun.star.lib.sandbox.SandboxSecurity;
-import com.sun.star.lib.sandbox.CodeSource;
-
-import stardiv.controller.SjSettings;
-
-public final class AppletExecutionContext extends ExecutionContext
- implements AppletStub, LiveConnectable
-{
- private static final boolean DEBUG = false; // Enable / disable debug output
-
- private Applet _applet;
- private Container _container;
-
- private DocumentProxy _documentProxy;
- private Hashtable _parameters;
-
- private String _className;
- private Vector _jarResourceProxys = new Vector();
-
- private URL _documentBase = null;
- private URL _baseURL = null;
-
- private Toolkit _toolkit;
-
- //************** C++ WRAPPER ******************
- private long pCppJSbxObject;
-
- synchronized public void ClearNativeHandle() {
- pCppJSbxObject = 0;
- if(DEBUG)System.err.println("### AppletExecutionContext.ClearNativeHandle");
- }
-
- public AppletExecutionContext(long pCppJSbxObject) {
- this.pCppJSbxObject = pCppJSbxObject;
- }
- //************** C++ WRAPPER ******************
-
- public AppletExecutionContext( URL documentBase,
- Hashtable parameters,
- Container container,
- long pCppJSbxObject)
- {
- this(pCppJSbxObject);
-
- if(DEBUG) System.err.println("#### AppletExecutionContext.<init>:" + documentBase + " " + parameters + " " + container + " " + pCppJSbxObject);
- _documentBase = documentBase;
- _parameters = parameters;
- _container = container;
-
- _toolkit = container.getToolkit();
-
- _documentProxy = DocumentProxy.getDocumentProxy(documentBase, _toolkit);
- addObserver(_documentProxy);
- }
-
- public void init() {
- _baseURL = null;
-
- try {
- String codeBase = getParameter("codebase");
-
- if (!codeBase.endsWith("/")) {
- codeBase += "/";
- }
- _baseURL = new URL(_documentBase, codeBase);
- }
- catch (MalformedURLException e) {
- if(DEBUG) System.err.println("#### AppletExecutionContext: Could not create base Url");
- }
-
- if(_baseURL == null)
- _baseURL = _documentBase;
-
- if(DEBUG) System.err.println("##### " + getClass().getName() + ".init - baseUrl:" + _baseURL);
-
- _className = getParameter("code");
- String defaultExtension = ".class";
- String oldExtension = ".java";
-
- int extensionIndex = _className.lastIndexOf('.');
- String extension = "";
-
- if (extensionIndex != -1) {
- extension = _className.substring(extensionIndex);
-
- if(!extension.equals(defaultExtension) && !extension.equals(oldExtension)) {
- extension = defaultExtension;
- }
- else
- _className = _className.substring(0, extensionIndex);
- }
-
- String nm = "applet-" + _className;
-
- _documentProxy.addExecutionContext(this, _className);
-
- super.init(nm, ClassContextProxy.create(_baseURL, null, null, false));
-
- // Set the property stardiv.security.noExit to true. That value will be used in
- // SjSettings.changeProperties in the constructor of the SecurityManager SandboxSecurity
- if (System.getSecurityManager() == null)
- System.setProperty("stardiv.security.noExit", "true");
- // SjSettings.changeProperties puts a lot of applet relating properties into the system properties
- // and it sets the SecurityManager
- SjSettings.changeProperties( System.getProperties());
-
- if(DEBUG) System.err.println("#####" + getClass().getName() + ".init: _className=" + _className + " _baseURL=" + _baseURL);
- }
-
- void sDispose(long timeout) {
- if(DEBUG) System.err.println("#### AppletExecutionContext.sDispose");
-
- _container = null;
- _jarResourceProxys = null;
-
- super.dispose(timeout);
- }
-
- public void dispose(long timeout) {
- sDispose(timeout); // call direct
-
-/* Deadlock with TKT
- class DisposeEvent extends java.awt.AWTEvent
- implements java.awt.peer.ActiveEvent,
- java.awt.ActiveEvent
- {
- private AppletExecutionContext executionContext;
- private long timeout;
-
- public DisposeEvent(AppletExecutionContext executionContext, long timeout) {
- super(executionContext, 0);
-
- this.executionContext = executionContext;
- this.timeout = timeout;
- }
-
- public void dispatch() {
- executionContext.sDispose(timeout);
- }
- }
-
- toolkit.getSystemEventQueue().postEvent(new DisposeEvent(this, timeout));
-*/
- }
-
- protected int getIntParameter(String name) {
- int value = 0;
- String string = getParameter(name);
- if(string != null)
- value = Integer.valueOf(string).intValue();
-
- return value;
- }
-
- protected void xload()
- throws ClassNotFoundException,
- InstantiationException,
- IllegalAccessException
- {
- String archives = getParameter("archive");
-
- try {
- if(archives != null) {
- int index = archives.indexOf(",");
- while(index > -1) {
- try { // try to load archive
- loadArchive(archives.substring(0, index));
- }
- catch(MalformedURLException malformedURLException) {
- System.err.println("#### can't load archive:" + archives.substring(0, index));
- }
- catch(IOException ioException) {
- System.err.println("#### can't load archive:" + archives.substring(0, index) + " reason:" + ioException);
- }
-
- archives = archives.substring(index + 1).trim();
-
- index = archives.indexOf(",");
- }
- if(archives.length() > 0) loadArchive(archives);
- }
-
- Class appletClass = classContext.loadClass(_className);
- synchronized(_className) {
- _applet = (Applet)appletClass.newInstance();
- _applet.setStub(this);
-
- appletResize(_container.getSize().width, _container.getSize().height);
-
- _className.notifyAll();
- }
- }
- catch(IOException eio) {
- throw new ClassNotFoundException(eio.getMessage());
- }
- }
-
- protected void xinit() {
- java.awt.Dimension size = new Dimension(getIntParameter("width"), getIntParameter("height"));
-
- _container.setLayout(null);
- _container.setVisible(true);
- _container.setSize(size);
- _container.add(_applet);
-
- _applet.setVisible(false);
- _applet.setSize(size);
-
- _container.validate();
-
- _applet.init();
- }
-
- protected void xstart() {
- _applet.setVisible(true);
- _container.validate();
-
- _applet.start();
- }
-
- protected void xstop() {
- _applet.stop();
- }
-
- protected void xdestroy() {
- if(DEBUG) System.err.println("##### " + getClass().getName() + ".xdestroy");
-
- _applet.destroy();
- _applet.setVisible(false);
- _applet.setStub(null);
-
- _documentProxy.removeExecutionContext(_applet.getClass().getName());
- }
-
- protected void xdispose() {
- if(DEBUG) System.err.println("##### " + getClass().getName() + ".xdispose");
-
- if(_container != null) {
- _container.remove(_applet);
-
- if(_container instanceof Window)
- ((Window)_container).dispose();
- }
-
- _applet = null;
- }
-
- private void loadArchive(String archive) throws MalformedURLException, IOException {
- ResourceProxy jarResourceProxy = ResourceProxy.load(new URL(_baseURL, archive), null /*_protectionDomain*/);
- jarResourceProxy.loadJar(_baseURL);
- _jarResourceProxys.addElement(jarResourceProxy);
- }
-
- public Applet getApplet() {
- synchronized(_className) {
- if(_applet == null) {
- if(DEBUG)System.err.println("#### AppletExecutionContext.getApplet - waiting for applet");
- try {
- _className.wait();
- }
- catch(InterruptedException interruptedException) {
- System.err.println("#### AppletExecutionContext.getApplet:" + interruptedException);
- }
- if(DEBUG)System.err.println("#### AppletExecutionContext.getApplet - got it");
- }
- }
- return _applet;
- }
-
- /*
- * Methods for AppletStub interface
- */
- public void appletResize(int width, int height) {
- if(DEBUG) System.err.println("##### " + getClass().getName() + ".appletResize: " + width + " " + height);
-
- _container.setSize(width, height);
- if(_applet != null)
- _applet.setSize(width, height);
- }
-
- public AppletContext getAppletContext() {
- return _documentProxy;
- }
-
- public URL getCodeBase() {
- return classContext.getBase();
- }
-
- public URL getDocumentBase() {
- return _documentProxy.getDocumentBase();
- }
-
- public String getParameter(String name) {
- String string = (String)_parameters.get(name.toLowerCase());
- if(string != null)
- string = string.trim();
-
- return string;
- }
-
- public boolean isActive() {
- return getStatus() == STARTED && pCppJSbxObject != 0;
- }
-
- public void finalize() {
- if(DEBUG) System.err.println("#### AppletExecutionContext finalized");
- }
-
- // sollte eigentlich im DocumentProxy sein, geht aber nicht
- private native void xshowStatus(String status);
- private native void xshowDocument(URL url, String aTarget);
-
- void printStatus(String status) {
- if(pCppJSbxObject != 0) xshowStatus(status);
- }
-
- void printDocument(URL url, String aTarget) {
- if(pCppJSbxObject != 0) xshowDocument(url, aTarget);
- }
-
- native public Object getJavaScriptJSObjectWindow();
-}
diff --git a/sj2/stardiv/applet/Document.java b/sj2/stardiv/applet/Document.java
deleted file mode 100644
index ac677f19d914..000000000000
--- a/sj2/stardiv/applet/Document.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*************************************************************************
- *
- * 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: Document.java,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.
- *
- ************************************************************************/
-package stardiv.applet;
-
-import java.awt.Image;
-
-// import java.applet.Applet;
-// import java.applet.AppletContext;
-// import java.applet.AudioClip;
-
-
-import java.io.IOException;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Observer;
-import java.util.Observable;
-
-import java.net.URL;
-
-import java.applet.Applet;
-import java.applet.AppletContext;
-import java.applet.AudioClip;
-
-import com.sun.star.lib.sandbox.ExecutionContext;
-import com.sun.star.lib.sandbox.ResourceProxy;
-
-class Document implements LiveConnectable {
- private Hashtable executionContexts = new Hashtable();
- private URL documentBase = null;
- private java.awt.Toolkit toolkit;
-
- Document(URL url, java.awt.Toolkit toolkit) {
- // Create the document base.
- //For example, suppose an applet is contained within the document:
- //http://java.sun.com/products/jdk/1.2/index.html
- //The document base is:
- //http://java.sun.com/products/jdk/1.2/
-
- String s= url.toString();
- int index= s.lastIndexOf('/');
- if( index != -1)
- {
- s=s.substring(0, index + 1);
- }
- try{
- documentBase = new URL(s);
- }catch(Exception e){
- }
- this.toolkit = toolkit;
- }
-
- void addExecutionContext(ExecutionContext executionContext, String name) {
- executionContexts.put(name, executionContext);
- }
-
- void removeExecutionContext(String name) {
- executionContexts.remove(name);
- }
-
- Enumeration getExecutionContexts() {
- return executionContexts.elements();
- }
-
- URL getDocumentBase() {
- return documentBase;
- }
-
- ExecutionContext getExecutionContext(String name) {
- return (ExecutionContext)executionContexts.get(name);
- }
-
- Enumeration getExcutionContexts() {
- return executionContexts.elements();
- }
-
- /**
- * Get the javascript environment for this applet.
- */
- /*
- public native Object getJavaScriptJSObjectWindow();
- public native void appletResize( int width, int height );
- public native void showDocument( URL url, String aTarget );
- public native void showStatus( String status );
- */
-
- public AudioClip getAudioClip(URL url) {
- ResourceProxy resourceProxy = ResourceProxy.load(url, null);
- AudioClip audioClip = resourceProxy.getAudioClip();
-
- return audioClip;
- }
-
- public Image getImage(URL url) {
- ResourceProxy resourceProxy = ResourceProxy.load(url, null);
- Image image = toolkit.createImage(resourceProxy.getImageProducer());
-
- return image;
- }
-
- AppletExecutionContext getAppletExecutionContext() {
- AppletExecutionContext appletExecutionContext = null;
-
- for(Enumeration e = executionContexts.elements(); e.hasMoreElements();) {
- Object object = e.nextElement();
- if(object instanceof AppletExecutionContext) {
- appletExecutionContext = (AppletExecutionContext)object;
- }
- }
- return appletExecutionContext;
- }
-
-
- void showDocument(URL url, String aTarget) {
- AppletExecutionContext appletExecutionContext = getAppletExecutionContext();
- if(appletExecutionContext != null) appletExecutionContext.printDocument(url, aTarget);
- }
-
- public void showDocument(URL url) {
- showDocument(url, "_top");
- }
-
- void showStatus(String status) {
- status = (status == null) ? "" : status;
-
- AppletExecutionContext appletExecutionContext = getAppletExecutionContext();
- if(appletExecutionContext != null) appletExecutionContext.printStatus(status);
- }
-
- public Object getJavaScriptJSObjectWindow() {
- Object object = null;
-
- AppletExecutionContext appletExecutionContext = getAppletExecutionContext();
- if(appletExecutionContext != null)
- object = appletExecutionContext.getJavaScriptJSObjectWindow();
-
- return object;
- }
-}
diff --git a/sj2/stardiv/applet/DocumentProxy.java b/sj2/stardiv/applet/DocumentProxy.java
deleted file mode 100644
index 8de93fa9c6f0..000000000000
--- a/sj2/stardiv/applet/DocumentProxy.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*************************************************************************
- *
- * 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: DocumentProxy.java,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.
- *
- ************************************************************************/
-package stardiv.applet;
-
-import java.awt.Toolkit;
-import java.awt.Image;
-
-import java.applet.Applet;
-import java.applet.AppletContext;
-import java.applet.AudioClip;
-
-import java.io.IOException;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Observer;
-import java.util.Observable;
-import java.util.Iterator;
-import java.io.InputStream;
-
-import java.net.URL;
-
-import com.sun.star.lib.sandbox.Cachable;
-import com.sun.star.lib.sandbox.ExecutionContext;
-import com.sun.star.lib.sandbox.WeakRef;
-import com.sun.star.lib.sandbox.WeakTable;
-import com.sun.star.lib.sandbox.ResourceProxy;
-
-public class DocumentProxy implements AppletContext, Cachable, Observer, LiveConnectable {
- static private int instances;
-
- synchronized static public DocumentProxy getDocumentProxy(URL url, Toolkit toolkit) {
- DocumentProxy documentProxy = (DocumentProxy)WeakTable.get("Document: " + url);
-
- if(documentProxy == null) {
- documentProxy = new DocumentProxy(url, toolkit);
- WeakTable.put("Document: " + url, documentProxy);
- }
-
- return documentProxy;
- }
-
- // AppletContext. This method is new since 1.4. We insert it so as to
- // have the project buildable
- public void setStream( String key,InputStream stream)
- throws java.io.IOException {
- }
- // AppletContext. This method is new since 1.4. We insert it so as to
- // have the project buildable
- public InputStream getStream( String key) {
- return null;
- }
- // AppletContext. This method is new since 1.4. We insert it so as to
- // have the project buildable
- public Iterator getStreamKeys() {
- return null;
- }
-
-
- /*
- ** interface cachable methods
- */
- private Document document;
- private WeakRef weakRef;
-
- public DocumentProxy() {
- instances ++;
- }
-
- public Object getHardObject() {
- return document;
- }
-
- public void setWeakRef(WeakRef weakRef) {
- document = (Document)weakRef.getRef();
-
- weakRef.incRefCnt();
- this.weakRef = weakRef;
- }
-
- public void finalize() {
- weakRef.decRefCnt();
- instances --;
- }
-
- /*
- ** DocumentProxy methods
- */
- private Toolkit toolkit;
-
- private DocumentProxy(URL url, Toolkit toolkit) {
- this();
- document = new Document(url, toolkit);
- }
-
- void addExecutionContext(ExecutionContext executionContext, String name) {
- document.addExecutionContext(executionContext, name);
- }
-
- void removeExecutionContext(String name) {
- document.removeExecutionContext(name);
- }
-
- public URL getDocumentBase() {
- return document.getDocumentBase();
- }
-
- /*
- ** AppletContext interface methods
- */
- public Applet getApplet(String name) {
- return ((AppletExecutionContext)document.getExecutionContext(name)).getApplet();
- }
-
- public Enumeration getApplets() {
- return new Enumeration() {
- Enumeration contexts = document.getExecutionContexts();
-
- public boolean hasMoreElements() {
- return contexts.hasMoreElements();
- }
-
- public Object nextElement() {
- return ((AppletExecutionContext)contexts.nextElement()).getApplet();
- }
- };
- }
-
- public AudioClip getAudioClip(URL url) {
- return document.getAudioClip(url);
- }
-
- public Image getImage(URL url) {
- return document.getImage(url);
- }
-
- public void showDocument(URL url) {
- document.showDocument(url);
- }
-
- /**
- * Get the javascript environment for this applet.
- */
- /*
- public native Object getJavaScriptJSObjectWindow();
- public native void appletResize( int width, int height );
- public native void showDocument( URL url, String aTarget );
- public native void showStatus( String status );
- */
-
- public void showDocument(URL url, String aTarget) {
- document.showDocument(url, aTarget);
- }
-
- public void showStatus(String status) {
- document.showStatus(status);
- }
-
- public void update(Observable observable, Object object) {
- showStatus((String)object);
- }
-
- public Object getJavaScriptJSObjectWindow() {
- return document.getJavaScriptJSObjectWindow();
- }
-}
-
diff --git a/sj2/stardiv/applet/makefile.mk b/sj2/stardiv/applet/makefile.mk
deleted file mode 100644
index 3096d15eceba..000000000000
--- a/sj2/stardiv/applet/makefile.mk
+++ /dev/null
@@ -1,78 +0,0 @@
-#*************************************************************************
-#
-# 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=sj2
-TARGET=applet
-
-PACKAGE=stardiv$/applet
-
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-.IF "$(JDK)" == "gcj"
-all:
- @echo This dir cannot be build with gcj because of com.sun.star.lib.sandbox.ResourceProxy
-.ELSE
-
-# --- Files --------------------------------------------------------
-
-JARFILES= \
- sandbox.jar
-
-JAVAFILES=\
- AppletExecutionContext.java \
- Document.java \
- DocumentProxy.java \
- LiveConnectable.java
-
-#.IF "$(GUI)"=="WNT"
-#JAVAFILES += WNativeAppletViewerFrame.java
-#.ENDIF
-
-JAVACLASSFILES= \
- $(CLASSDIR)$/$(PACKAGE)$/DocumentProxy.class \
- $(CLASSDIR)$/$(PACKAGE)$/Document.class \
- $(CLASSDIR)$/$(PACKAGE)$/LiveConnectable.class \
- $(CLASSDIR)$/$(PACKAGE)$/AppletExecutionContext.class
-
-.ENDIF
-
-#.IF "$(GUI)"=="WNT"
-#JAVACLASSFILES += $(CLASSDIR)$/stardiv$/applet$/WNativeAppletViewerFrame.class
-#.ENDIF
-
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.INCLUDE : $(PRJ)$/util$/target.pmk
diff --git a/sj2/stardiv/applet/resources/MsgAppletViewer.java b/sj2/stardiv/applet/resources/MsgAppletViewer.java
deleted file mode 100644
index e50dd2463482..000000000000
--- a/sj2/stardiv/applet/resources/MsgAppletViewer.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*************************************************************************
- *
- * 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: MsgAppletViewer.java,v $
- * $Revision: 1.3 $
- *
- * 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 stardiv.applet.resources;
-
-import java.util.ListResourceBundle;
-
-public class MsgAppletViewer extends ListResourceBundle {
-
- public Object[][] getContents() {
- return contents;
- }
-
- static final Object[][] contents = {
- {"textframe.button.dismiss", "Dismiss"},
- {"appletviewer.tool.title", "Applet Viewer: {0}"},
- {"appletviewer.menu.applet", "Applet"},
- {"appletviewer.menuitem.restart", "Restart"},
- {"appletviewer.menuitem.reload", "Reload"},
- {"appletviewer.menuitem.stop", "Stop"},
- {"appletviewer.menuitem.save", "Save..."},
- {"appletviewer.menuitem.start", "Start"},
- {"appletviewer.menuitem.clone", "Clone..."},
- {"appletviewer.menuitem.tag", "Tag..."},
- {"appletviewer.menuitem.info", "Info..."},
- {"appletviewer.menuitem.edit", "Edit"},
- {"appletviewer.menuitem.encoding", "Character Encoding"},
- {"appletviewer.menuitem.print", "Print..."},
- {"appletviewer.menuitem.props", "Properties..."},
- {"appletviewer.menuitem.close", "Close"},
- {"appletviewer.menuitem.quit", "Quit"},
- {"appletviewer.label.hello", "Hello..."},
- {"appletviewer.status.start", "starting applet..."},
- {"appletviewer.appletsave.err1", "serializing an {0} to {1}"},
- {"appletviewer.appletsave.err2", "in appletSave: {0}"},
- {"appletviewer.applettag", "Tag shown"},
- {"appletviewer.applettag.textframe", "Applet HTML Tag"},
- {"appletviewer.appletinfo.applet", "-- no applet info --"},
- {"appletviewer.appletinfo.param", "-- no parameter info --"},
- {"appletviewer.appletinfo.textframe", "Applet Info"},
- {"appletviewer.appletprint.printjob", "Print Applet"},
- {"appletviewer.appletprint.fail", "Printing failed."},
- {"appletviewer.appletprint.finish", "Finished printing."},
- {"appletviewer.appletprint.cancel", "Printing cancelled."},
- {"appletviewer.appletencoding", "Character Encoding: {0}"},
- {"appletviewer.init.err", "[no appletviewer.properties file found!]"},
- {"appletviewer.parse.warning.requiresname", "Warning: <param name=... value=...> tag requires name attribute."},
- {"appletviewer.parse.warning.paramoutside", "Warning: <param> tag outside <applet> ... </applet>."},
- {"appletviewer.parse.warning.requirescode", "Warning: <applet> tag requires code attribute."},
- {"appletviewer.parse.warning.requiresheight", "Warning: <applet> tag requires height attribute."},
- {"appletviewer.parse.warning.requireswidth", "Warning: <applet> tag requires width attribute."},
- {"appletviewer.parse.warning.appnotLongersupported", "Warning: <app> tag no longer supported, use <applet> instead:"},
- {"appletviewer.usage", "usage: appletviewer [-debug] [-J<javaflag>] [-encoding <character encoding type> ] url|file ..."},
- {"appletviewer.main.err.inputfile", "No input files specified."},
- {"appletviewer.main.err.badurl", "Bad URL: {0} ( {1} )"},
- {"appletviewer.main.err.io", "I/O exception while reading: {0}"},
- {"appletviewer.main.err.readablefile", "Make sure that {0} is a file and is readable."},
- {"appletviewer.main.err.correcturl", "Is {0} the correct URL?"},
- {"appletviewer.main.warning", "Warning: No Applets were started. Make sure the input contains an <applet> tag."},
- {"appletpanel.runloader.err", "Either object or code parameter!"},
- {"appletpanel.runloader.exception", "exception while deserializing {0}"},
- {"appletpanel.destroyed", "Applet destroyed."},
- {"appletpanel.loaded", "Applet loaded."},
- {"appletpanel.started", "Applet started."},
- {"appletpanel.inited", "Applet initialized."},
- {"appletpanel.stopped", "Applet stopped."},
- {"appletpanel.disposed", "Applet disposed."},
- {"appletpanel.nocode", "APPLET tag missing CODE parameter."},
- {"appletpanel.notfound", "load: class {0} not found."},
- {"appletpanel.nocreate", "load: {0} can''t be instantiated."},
- {"appletpanel.noconstruct", "load: {0} is not public or has no public constructor."},
- {"appletpanel.death", "killed"},
- {"appletpanel.exception", "exception: {0}."},
- {"appletpanel.exception2", "exception: {0}: {1}."},
- {"appletpanel.error", "error: {0}."},
- {"appletpanel.error2", "error: {0}: {1}."},
- {"appletpanel.notloaded", "Init: applet not loaded."},
- {"appletpanel.notinited", "Start: applet not initialized."},
- {"appletpanel.notstarted", "Stop: applet not started."},
- {"appletpanel.notstopped", "Destroy: applet not stopped."},
- {"appletpanel.notdestroyed", "Dispose: applet not destroyed."},
- {"appletpanel.notdisposed", "Load: applet not disposed."},
- {"appletpanel.bail", "Interrupted: bailing out."},
- {"appletpanel.filenotfound", "File not found when looking for: {0}"},
- {"appletpanel.fileformat", "File format exception when loading: {0}"},
- {"appletpanel.fileioexception", "I/O exception when loading: {0}"},
- {"appletpanel.fileexception", "{0} exception when loading: {1}"},
- {"appletpanel.filedeath", "{0} killed when loading: {1}"},
- {"appletpanel.fileerror", "{0} error when loading: {1}"},
- {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream requires non-null loader"},
- {"appletprops.title", "AppletViewer Properties"},
- {"appletprops.label.http.server", "Http proxy server:"},
- {"appletprops.label.http.proxy", "Http proxy port:"},
- {"appletprops.label.network", "Network access:"},
- {"appletprops.choice.network.item.none", "None"},
- {"appletprops.choice.network.item.applethost", "Applet Host"},
- {"appletprops.choice.network.item.unrestricted", "Unrestricted"},
- {"appletprops.label.class", "Class access:"},
- {"appletprops.choice.class.item.restricted", "Restricted"},
- {"appletprops.choice.class.item.unrestricted", "Unrestricted"},
- {"appletprops.label.unsignedapplet", "Allow unsigned applets:"},
- {"appletprops.choice.unsignedapplet.no", "No"},
- {"appletprops.choice.unsignedapplet.yes", "Yes"},
- {"appletprops.button.apply", "Apply"},
- {"appletprops.button.cancel", "Cancel"},
- {"appletprops.button.reset", "Reset"},
- {"appletprops.apply.exception", "Failed to save properties: {0}"},
- };
-}
diff --git a/sj2/stardiv/applet/resources/makefile.mk b/sj2/stardiv/applet/resources/makefile.mk
deleted file mode 100644
index af89ef8a807d..000000000000
--- a/sj2/stardiv/applet/resources/makefile.mk
+++ /dev/null
@@ -1,54 +0,0 @@
-#*************************************************************************
-#
-# 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.3 $
-#
-# 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=sj2
-TARGET=applet_resource
-
-PACKAGE=stardiv$/applet$/resources
-
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-JAVAFILES=\
- MsgAppletViewer.java
-
-JAVACLASSFILES=\
- $(CLASSDIR)$/$(PACKAGE)$/MsgAppletViewer.class
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.INCLUDE : $(PRJ)$/util$/target.pmk
-
diff --git a/sj2/stardiv/controller/SjSettings.java b/sj2/stardiv/controller/SjSettings.java
deleted file mode 100644
index 1dd00613c144..000000000000
--- a/sj2/stardiv/controller/SjSettings.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*************************************************************************
- *
- * 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: SjSettings.java,v $
- * $Revision: 1.8 $
- *
- * 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 stardiv.controller;
-
-import java.util.Properties;
-import java.util.Hashtable;
-import java.util.Enumeration;
-
-import com.sun.star.lib.sandbox.SandboxSecurity;
-
-/**
- * Ueber diese Klasse werden alle globalen Einstellungen, die fuer das Sj Projekt
- * wichtig sind, dokumentiert und modifiziert.
- *
- * @version $Version: 1.0 $
- * @author Markus Meyer
- *
- */
-public class SjSettings {
- /**
- * The following properties are used to setup the environment for
- * the stardiv packages.<BR>
- * "appletviewer.security.mode"="unrestricted" | "host" | "none": Set the
- * security level of the default SecurityManager. The default is "host".<BR>
- * "stardiv.security.defaultSecurityManager"="true" | "false": Create and set
- * the stardiv.security.AppletSecurity, if the property is "true". This occures
- * only in the first call.<BR>
- * "stardiv.security.noExit"="true" | "false": no exit is allowed. Use this property
- * if you are running more than one java application in the virtual machine. This occures
- * only in the first call.<BR>
- * "stardiv.security.disableSecurity"="true" | "false": disable security checking. Only usefull
- * if a SecurityManager is installed. The default is "false".<BR>
- * if you are running more than one java application in the virtual machine. This occures
- * only in the first call.<BR>
- * "stardiv.js.debugOnError"="true" | "false": Start the javascript ide, if an error
- * occures. The default is "false".<BR>
- * "stardiv.js.debugImmediate"="true" | "false": Start the javascript ide, if a script
- * starts. The default is "false".<BR>
- * "stardiv.debug.trace"="messageBox" | "window" | "file" | "none": The trace pipe is
- * set to one of the four mediums. The Default is "none".<BR>
- * "stardiv.debug.error"="messageBox" | "window" | "file" | "none": The error pipe is
- * set to one of the four mediums. The Default is "none".<BR>
- * "stardiv.debug.warning"="messageBox" | "window" | "file" | "none": The warning pipe is
- * set to one of the four mediums. The Default is "none".<BR>
- * If the properties http.proxyHost, http.proxyPort, http.maxConnections,
- * http.keepAlive or http.nonProxyHosts are changed, the method
- * sun.net.www.http.HttpClient.resetProperties() is called.<BR>
- * If the properties ftpProxySet, ftpProxyHost or ftpProxyPort are changed,
- * the static variables useFtpProxy, ftpProxyHost and ftpProxyPort in the class
- * sun.net.ftp.FtpClient are set.<BR>
- * <B>If you are writing your own SecurityManager and ClassLoader, please implement the
- * interfaces stardiv.security.ClassLoaderExtension and
- * stardiv.security.SecurityManagerExtension. Be shure to set the
- * stardiv.security.ClassLoaderFactory, to enable dynamic class loading, otherwise
- * the stardiv.security.AppletClassLoader is used. Set the factory with
- * SjSettings.setClassLoaderFactory().</B>
- */
- static public synchronized void changeProperties( Properties pChangeProps )
- {
- SecurityManager pSM = System.getSecurityManager();
- if( pSM != null )
- pSM.checkPropertiesAccess();
- Properties props = new Properties( System.getProperties() );
- boolean bInited = Boolean.getBoolean( "stardiv.controller.SjSettings.inited" );
-
-
- if( !bInited )
- {
- // check the awt.toolkit property: if none is set use com.sun.star.comp.jawt.peer.Toolkit
- //if ( props.getProperty("awt.toolkit") == null )
- // props.put("awt.toolkit", "com.sun.star.comp.jawt.peer.Toolkit");
-
- // Define a number of standard properties
- props.put("acl.read", "+");
- props.put("acl.read.default", "");
- props.put("acl.write", "+");
- props.put("acl.write.default", "");
-
- // Standard browser properties
- props.put("browser", "stardiv.applet.AppletViewerFrame");
- props.put("browser.version", "4.02");
- props.put("browser.vendor", "Sun Microsystems, Inc.");
- props.put("http.agent", "JDK/1.1");
-
- // Define which packages can be accessed by applets
- props.put("package.restrict.access.sun", "true");
- props.put("package.restrict.access.netscape", "true");
- props.put("package.restrict.access.stardiv", "true");
-
- // Define which packages can be extended by applets
- props.put("package.restrict.definition.java", "true");
- props.put("package.restrict.definition.sun", "true");
- props.put("package.restrict.definition.netscape", "true");
- props.put("package.restrict.definition.stardiv", "true");
-
- // Define which properties can be read by applets.
- // A property named by "key" can be read only when its twin
- // property "key.applet" is true. The following ten properties
- // are open by default. Any other property can be explicitly
- // opened up by the browser user setting key.applet=true in
- // ~/.hotjava/properties. Or vice versa, any of the following can
- // be overridden by the user's properties.
- props.put("java.version.applet", "true");
- props.put("java.vendor.applet", "true");
- props.put("java.vendor.url.applet", "true");
- props.put("java.class.version.applet", "true");
- props.put("os.name.applet", "true");
- props.put("os.version.applet", "true");
- props.put("os.arch.applet", "true");
- props.put("file.separator.applet", "true");
- props.put("path.separator.applet", "true");
- props.put("line.separator.applet", "true");
-
- }
-
- // put new and changed properties to the property table
- if( pChangeProps != null )
- {
- Enumeration aEnum = pChangeProps.propertyNames();
- while( aEnum.hasMoreElements() )
- {
- String aKey = (String)aEnum.nextElement();
- props.put( aKey, pChangeProps.getProperty( aKey ) );
- }
- }
-
- // Install a property list.
- if( !bInited )
- props.put( "stardiv.controller.SjSettings.inited", "true" );
- System.setProperties(props);
- if( !bInited )
- {
- // Security Manager setzten
- boolean bNoExit = Boolean.getBoolean( "stardiv.security.noExit" );
- //Create and install the security manager
- if (System.getSecurityManager() == null)
- System.setSecurityManager(new SandboxSecurity(bNoExit));
-
-// if( Boolean.getBoolean("stardiv.controller.installConsole") )
-// Console.installConsole();
- }
- }
-
- private static boolean equalsImpl( Object p1, Object p2 )
- {
- return p1 == p2 || (p1 != null && p2 != null && p1.equals( p2 ) );
- }
-}
-
-
-
diff --git a/sj2/stardiv/controller/makefile.mk b/sj2/stardiv/controller/makefile.mk
deleted file mode 100644
index 8776f7f7fdac..000000000000
--- a/sj2/stardiv/controller/makefile.mk
+++ /dev/null
@@ -1,58 +0,0 @@
-#*************************************************************************
-#
-# 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.6 $
-#
-# 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=sj2
-TARGET=controller
-
-PACKAGE=stardiv$/controller
-JARFILES=sandbox.jar tkt.jar
-
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-.IF "$(JDK)" == "gcj"
-all:
- @echo This dir cannot be build with gcj because of com.sun.star.lib.sandbox.ResourceProxy
-.ELSE
-
-# --- Files --------------------------------------------------------
-
-JAVACLASSFILES= \
- $(CLASSDIR)$/$(PACKAGE)$/SjSettings.class
-
-# --- Targets ------------------------------------------------------
-.ENDIF
-
-.INCLUDE : target.mk
-
-.INCLUDE : $(PRJ)$/util$/target.pmk
-
diff --git a/sj2/stardiv/security/resources/MsgAppletViewer.java b/sj2/stardiv/security/resources/MsgAppletViewer.java
deleted file mode 100644
index a2f567878c3e..000000000000
--- a/sj2/stardiv/security/resources/MsgAppletViewer.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*************************************************************************
- *
- * 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: MsgAppletViewer.java,v $
- * $Revision: 1.3 $
- *
- * 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 stardiv.security.resources;
-
-import java.util.ListResourceBundle;
-
-/* Alle Resourcen aus AppletClassLoader, Applet und AppletSecurityException.
-*/
-public class MsgAppletViewer extends ListResourceBundle {
-
- public Object[][] getContents() {
- return contents;
- }
-
- static final Object[][] contents = {
- {"appletclassloader.loadcode.verbose", "Opening stream to: {0} to get {1}"},
- {"appletclassloader.filenotfound", "File not found when looking for: {0}"},
- {"appletclassloader.fileformat", "File format exception when loading: {0}"},
- {"appletclassloader.fileioexception", "I/O exception when loading: {0}"},
- {"appletclassloader.fileexception", "{0} exception when loading: {1}"},
- {"appletclassloader.filedeath", "{0} killed when loading: {1}"},
- {"appletclassloader.fileerror", "{0} error when loading: {1}"},
- {"appletclassloader.findclass.verbose.findclass", "{0} find class {1}"},
- {"appletclassloader.findclass.verbose.openstream", "Opening stream to: {0} to get {1}"},
- {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource for name: {0}"},
- {"appletclassloader.getresource.verbose.found", "Found resource: {0} as a system resource"},
- {"appletclassloader.getresourceasstream.verbose", "Found resource: {0} as a system resource"},
- {"appletioexception.loadclass.throw.interrupted", "class loading interrupted: {0}"},
- {"appletioexception.loadclass.throw.notloaded", "class not loaded: {0}"},
- {"appletsecurityexception.checkcreateclassloader", "Security Exception: classloader"},
- {"appletsecurityexception.checkaccess.thread", "Security Exception: thread"},
- {"appletsecurityexception.checkaccess.threadgroup", "Security Exception: threadgroup: {0}"},
- {"appletsecurityexception.checkexit", "Security Exception: exit: {0}"},
- {"appletsecurityexception.checkexec", "Security Exception: exec: {0}"},
- {"appletsecurityexception.checklink", "Security Exception: link: {0}"},
- {"appletsecurityexception.checkpropsaccess", "Security Exception: properties"},
- {"appletsecurityexception.checkpropsaccess.key", "Security Exception: properties access {0}"},
- {"appletsecurityexception.checkread.exception1", "Security Exception: {0}, {1}"},
- {"appletsecurityexception.checkread.exception2", "Security Exception: file.read: {0}"},
- {"appletsecurityexception.checkread", "Security Exception: file.read: {0} == {1}"},
- {"appletsecurityexception.checkwrite.exception", "Security Exception: {0}, {1}"},
- {"appletsecurityexception.checkwrite", "Security Exception: file.write: {0} == {1}"},
- {"appletsecurityexception.checkread.fd", "Security Exception: fd.read"},
- {"appletsecurityexception.checkwrite.fd", "Security Exception: fd.write"},
- {"appletsecurityexception.checklisten", "Security Exception: socket.listen: {0}"},
- {"appletsecurityexception.checkaccept", "Security Exception: socket.accept: {0}:{1}"},
- {"appletsecurityexception.checkconnect.networknone", "Security Exception: socket.connect: {0}->{1}"},
- {"appletsecurityexception.checkconnect.networkhost1", "Security Exception: Couldn''t connect to {0} with origin from {1}."},
- {"appletsecurityexception.checkconnect.networkhost2", "Security Exception: Couldn''t resolve IP for host {0} or for {1}. "},
- {"appletsecurityexception.checkconnect.networkhost3", "Security Exception: Could not resolve IP for host {0}. See the trustProxy property."},
- {"appletsecurityexception.checkconnect", "Security Exception: connect: {0}->{1}"},
- {"appletsecurityexception.checkpackageaccess", "Security Exception: cannot access package: {0}"},
- {"appletsecurityexception.checkpackagedefinition", "Security Exception: cannot define package: {0}"},
- {"appletsecurityexception.cannotsetfactory", "Security Exception: cannot set factory"},
- {"appletsecurityexception.checkmemberaccess", "Security Exception: check member access"},
- {"appletsecurityexception.checkgetprintjob", "Security Exception: getPrintJob"},
- {"appletsecurityexception.checksystemclipboardaccess", "Security Exception: getSystemClipboard"},
- {"appletsecurityexception.checkawteventqueueaccess", "Security Exception: getEventQueue"},
- {"appletsecurityexception.checksecurityaccess", "Security Exception: security operation: {0}"},
- {"appletsecurityexception.getsecuritycontext.unknown", "unknown class loader type. unable to check for getContext"},
- {"appletsecurityexception.checkread.unknown", "unknown class loader type. unable to check for checking read {0}"},
- {"appletsecurityexception.checkconnect.unknown", "unknown class loader type. unable to check for checking connect"},
- };
-}
diff --git a/sj2/stardiv/security/resources/makefile.mk b/sj2/stardiv/security/resources/makefile.mk
deleted file mode 100644
index f57edbbc4ac9..000000000000
--- a/sj2/stardiv/security/resources/makefile.mk
+++ /dev/null
@@ -1,54 +0,0 @@
-#*************************************************************************
-#
-# 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.3 $
-#
-# 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=sj2
-TARGET=security_resource
-
-PACKAGE=stardiv$/security$/resources
-
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-JAVAFILES=\
- MsgAppletViewer.java
-
-JAVACLASSFILES=\
- $(CLASSDIR)$/stardiv$/security$/resources$/MsgAppletViewer.class
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.INCLUDE : $(PRJ)$/util$/target.pmk
-
diff --git a/sj2/util/makefile.pmk b/sj2/util/makefile.pmk
deleted file mode 100644
index 6976b55b38c7..000000000000
--- a/sj2/util/makefile.pmk
+++ /dev/null
@@ -1,46 +0,0 @@
-#*************************************************************************
-#
-# 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.pmk,v $
-#
-# $Revision: 1.5 $
-#
-# 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.
-#
-#*************************************************************************
-
-JAVAPREPRO=
-.IF "$(JDK_VERSION)" == "110"
-JAVAPREPRO=-jdk11
-.ENDIF
-.IF "$(PRODUCT)" != ""
-JAVAPREPRO=$(JAVAPREPRO) + " -product"
-.ENDIF
-
-ENABLE_EXCEPTIONS=TRUE
-
-JARFILES=sandbox.jar tkt.jar
-
-# --- Settings -----------------------------------------------------
-.INCLUDE : settings.mk
-
diff --git a/sj2/util/target.pmk b/sj2/util/target.pmk
deleted file mode 100644
index 56da2446993c..000000000000
--- a/sj2/util/target.pmk
+++ /dev/null
@@ -1,42 +0,0 @@
-#*************************************************************************
-#
-# 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: target.pmk,v $
-#
-# $Revision: 1.3 $
-#
-# 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 "$(depend)" == ""
-ONLYZIP: $(SLOFILES)
- cd $(PRJ)$/util
- nmake debug=t
-
-TEST:
-
-DOC:
-
-PREPRO:
- $(JAVAI) $(JAVACPS) $(CLASSPATH) stardiv.app.Javac $(JAVAPREPRO) $(JAVAFILES)
-.ENDIF
diff --git a/svx/inc/AccessibleSelectionBase.hxx b/svx/inc/AccessibleSelectionBase.hxx
index 335ddf7c96e4..09767025d84a 100644
--- a/svx/inc/AccessibleSelectionBase.hxx
+++ b/svx/inc/AccessibleSelectionBase.hxx
@@ -74,79 +74,3 @@ namespace accessibility
}
#endif // _SVX_ACCESSIBILITY_ACCESSIBLE_SELECTION_BASE_HXX
-/*************************************************************************
- *
- * 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: AccessibleSelectionBase.hxx,v $
- * $Revision: 1.6 $
- *
- * 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_ACCESSIBILITY_ACCESSIBLE_SELECTION_BASE_HXX
-#define _SVX_ACCESSIBILITY_ACCESSIBLE_SELECTION_BASE_HXX
-
-#include <comphelper/accessibleselectionhelper.hxx>
-#include "svx/svxdllapi.h"
-
-namespace accessibility
-{
-/** @descr
- This base class provides a base implementation of the
- <type>XAccessibleSelection</type> interface.
- The following methods have to be implemented if this
- class is used:
-
- <method>implGetMutex</method>,
- <method>implGetAccessibleContext</method>,
- <method>implIsSelected</method>,
- <method>implSelect</method>,
-*/
- class SVX_DLLPUBLIC AccessibleSelectionBase : public ::comphelper::OCommonAccessibleSelection,
- public ::com::sun::star::accessibility::XAccessibleSelection
- {
- protected:
-
- virtual ::osl::Mutex& implGetMutex() = 0;
-
- public:
-
- // XAccessibleSelection - default implementations
- virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
-
- public:
-
- AccessibleSelectionBase();
- virtual ~AccessibleSelectionBase();
- };
-
-}
-
-#endif // _SVX_ACCESSIBILITY_ACCESSIBLE_SELECTION_BASE_HXX
diff --git a/svx/inc/AccessibleStaticTextBase.hxx b/svx/inc/AccessibleStaticTextBase.hxx
index 5ee498be5695..60a31117185f 100644
--- a/svx/inc/AccessibleStaticTextBase.hxx
+++ b/svx/inc/AccessibleStaticTextBase.hxx
@@ -44,6 +44,7 @@
class SvxEditSource;
+class SvxEditViewForwarder;
namespace accessibility
{
@@ -266,6 +267,9 @@ namespace accessibility
protected:
Rectangle GetParagraphBoundingBox() const;
+ sal_Int32 GetParagraphCount() const;
+ sal_Int32 GetParagraphIndex() const;
+ sal_Int32 GetLineCount( sal_Int32 nParagraph ) const;
private:
diff --git a/svx/inc/ActionDescriptionProvider.hxx b/svx/inc/ActionDescriptionProvider.hxx
index 01b128db09cd..b34ca9a1d312 100644
--- a/svx/inc/ActionDescriptionProvider.hxx
+++ b/svx/inc/ActionDescriptionProvider.hxx
@@ -66,71 +66,3 @@ public:
};
#endif
-/*************************************************************************
- *
- * 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: ActionDescriptionProvider.hxx,v $
- * $Revision: 1.3 $
- *
- * 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_ACTIONDESCRIPTIONPROVIDER_HXX
-#define _SVX_ACTIONDESCRIPTIONPROVIDER_HXX
-
-#include "svx/svxdllapi.h"
-
-// header for class OUString
-#include <rtl/ustring.hxx>
-
-//-----------------------------------------------------------------------------
-/** This class provides localized descriptions for some basic actions done with objects.
-The strings are intended to be provided to the user e.g. as description for undo actions in the menu.
-The name of the object acted on and the type of action needs to be given as input parameter.
-*/
-
-class SVX_DLLPUBLIC ActionDescriptionProvider
-{
-public:
- enum ActionType
- {
- INSERT
- , DELETE
- , CUT
- , MOVE
- , RESIZE
- , ROTATE
- , TRANSFORM
- , FORMAT
- , MOVE_TOTOP
- , MOVE_TOBOTTOM
- , POS_SIZE
- };
-
-public:
- static ::rtl::OUString createDescription( ActionType eActionType
- , const ::rtl::OUString& rObjectName );
-};
-
-#endif
diff --git a/svx/inc/EnhancedCustomShapeFunctionParser.hxx b/svx/inc/EnhancedCustomShapeFunctionParser.hxx
index 9c9a8574aa8f..411a16d60e31 100755
--- a/svx/inc/EnhancedCustomShapeFunctionParser.hxx
+++ b/svx/inc/EnhancedCustomShapeFunctionParser.hxx
@@ -32,14 +32,14 @@
#define _ENHANCEDCUSTOMSHAPEFUNCTIONPARSER_HXX
#include <sal/config.h>
-#ifndef BOOST_SHARED_PTR_HPP_INCLUDED
#include <boost/shared_ptr.hpp>
-#endif
#include "EnhancedCustomShapeFunctionParser.hxx"
#include <com/sun/star/drawing/EnhancedCustomShapeParameter.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
#include <vector>
+#include <svx/svxdllapi.h>
+
struct EnhancedCustomShapeEquation
{
sal_Int32 nOperation;
@@ -97,7 +97,7 @@ enum ExpressionFunct
#define EXPRESSION_FLAG_SUMANGLE_MODE 1
-void FillEquationParameter( const com::sun::star::drawing::EnhancedCustomShapeParameter&, const sal_Int32, EnhancedCustomShapeEquation& );
+SVX_DLLPUBLIC void FillEquationParameter( const com::sun::star::drawing::EnhancedCustomShapeParameter&, const sal_Int32, EnhancedCustomShapeEquation& );
class ExpressionNode
{
@@ -200,7 +200,7 @@ public:
@return the generated function object.
*/
- static ExpressionNodeSharedPtr parseFunction( const ::rtl::OUString& rFunction, const EnhancedCustomShape2d& rCustoShape );
+ SVX_DLLPUBLIC static ExpressionNodeSharedPtr parseFunction( const ::rtl::OUString& rFunction, const EnhancedCustomShape2d& rCustoShape );
private:
// disabled constructor/destructor, since this is
diff --git a/svx/inc/accessibility.hrc b/svx/inc/accessibility.hrc
index c202c4611ffe..5688f7a8033e 100644
--- a/svx/inc/accessibility.hrc
+++ b/svx/inc/accessibility.hrc
@@ -80,8 +80,6 @@
// text paragraphs and bullets
#define RID_SVXSTR_A11Y_TEXTHELPER_START (RID_SVXSTR_ACCESSIBILITY_START + 70)
-#define RID_SVXSTR_A11Y_PARAGRAPH_DESCRIPTION (RID_SVXSTR_A11Y_TEXTHELPER_START + 0)
-#define RID_SVXSTR_A11Y_PARAGRAPH_NAME (RID_SVXSTR_A11Y_TEXTHELPER_START + 1)
#define RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION (RID_SVXSTR_A11Y_TEXTHELPER_START + 2)
#define RID_SVXSTR_A11Y_IMAGEBULLET_NAME (RID_SVXSTR_A11Y_TEXTHELPER_START + 3)
diff --git a/svx/inc/acorrcfg.hxx b/svx/inc/acorrcfg.hxx
index fe28610df8d6..046cf1a6198a 100644
--- a/svx/inc/acorrcfg.hxx
+++ b/svx/inc/acorrcfg.hxx
@@ -134,141 +134,3 @@ public:
#endif
-
-/*************************************************************************
- *
- * 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: acorrcfg.hxx,v $
- * $Revision: 1.7 $
- *
- * 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 _SVXACCFG_HXX
-#define _SVXACCFG_HXX
-
-// include ---------------------------------------------------------------
-
-#include "svx/svxdllapi.h"
-#include <unotools/configitem.hxx>
-/* -----------------------------12.10.00 11:40--------------------------------
-
- ---------------------------------------------------------------------------*/
-class SvxAutoCorrect;
-class SvxAutoCorrCfg;
-class SVX_DLLPUBLIC SvxBaseAutoCorrCfg : public utl::ConfigItem
-{
- SvxAutoCorrCfg& rParent;
- com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
-
-public:
- SvxBaseAutoCorrCfg(SvxAutoCorrCfg& rParent);
- ~SvxBaseAutoCorrCfg();
-
- void Load(sal_Bool bInit);
- virtual void Commit();
- virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames);
- void SetModified() {ConfigItem::SetModified();}
-};
-/* -----------------------------12.10.00 11:40--------------------------------
-
- ---------------------------------------------------------------------------*/
-class SVX_DLLPUBLIC SvxSwAutoCorrCfg : public utl::ConfigItem
-{
- SvxAutoCorrCfg& rParent;
- com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
-
-public:
- SvxSwAutoCorrCfg(SvxAutoCorrCfg& rParent);
- ~SvxSwAutoCorrCfg();
-
- void Load(sal_Bool bInit);
- virtual void Commit();
- virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames);
- void SetModified() {ConfigItem::SetModified();}
-};
-/*--------------------------------------------------------------------
- Beschreibung: Konfiguration fuer Auto Correction
- --------------------------------------------------------------------*/
-class SVX_DLLPUBLIC SvxAutoCorrCfg
-{
- friend class SvxBaseAutoCorrCfg;
- friend class SvxSwAutoCorrCfg;
-
- SvxAutoCorrect* pAutoCorrect;
-
- SvxBaseAutoCorrCfg aBaseConfig;
- SvxSwAutoCorrCfg aSwConfig;
-
- // Flags f"ur Autotext:
- sal_Bool bFileRel;
- sal_Bool bNetRel;
- // Tiphilfe f"ur Autotext w"ahrend der Eingabe
- sal_Bool bAutoTextTip;
- sal_Bool bAutoTextPreview;
- sal_Bool bAutoFmtByInput;
- sal_Bool bSearchInAllCategories;
-
-public:
- void SetModified()
- {
- aBaseConfig.SetModified();
- aSwConfig.SetModified();
- }
- void Commit()
- {
- aBaseConfig.Commit();
- aSwConfig.Commit();
- }
-
- SvxAutoCorrect* GetAutoCorrect() { return pAutoCorrect; }
- const SvxAutoCorrect* GetAutoCorrect() const { return pAutoCorrect; }
- // der Pointer geht in den Besitz des ConfigItems!
- void SetAutoCorrect( SvxAutoCorrect* );
-
- sal_Bool IsAutoFmtByInput() const { return bAutoFmtByInput; }
- void SetAutoFmtByInput( sal_Bool bSet ) { bAutoFmtByInput = bSet;aSwConfig.SetModified();}
-
- sal_Bool IsSaveRelFile() const { return bFileRel; }
- void SetSaveRelFile( sal_Bool bSet ) { bFileRel = bSet; aSwConfig.SetModified(); }
-
- sal_Bool IsSaveRelNet() const { return bNetRel; }
- void SetSaveRelNet( sal_Bool bSet ) { bNetRel = bSet; aSwConfig.SetModified();}
-
- sal_Bool IsAutoTextPreview() const {return bAutoTextPreview;}
- void SetAutoTextPreview(sal_Bool bSet) {bAutoTextPreview = bSet; aSwConfig.SetModified();}
-
- sal_Bool IsAutoTextTip() const { return bAutoTextTip; }
- void SetAutoTextTip(sal_Bool bSet ) { bAutoTextTip = bSet;aSwConfig.SetModified();}
-
- sal_Bool IsSearchInAllCategories() const { return bSearchInAllCategories;}
- void SetSearchInAllCategories(sal_Bool bSet ) { bSearchInAllCategories = bSet; aSwConfig.SetModified(); }
-
- SvxAutoCorrCfg();
- virtual ~SvxAutoCorrCfg();
- static SvxAutoCorrCfg* Get();
-};
-
-
-#endif
-
diff --git a/svx/inc/anchorid.hxx b/svx/inc/anchorid.hxx
index 072bcaae4177..db897fb3e11e 100644
--- a/svx/inc/anchorid.hxx
+++ b/svx/inc/anchorid.hxx
@@ -43,50 +43,3 @@ enum SvxAnchorIds
#endif
-
-/*************************************************************************
- *
- * 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: anchorid.hxx,v $
- * $Revision: 1.3 $
- *
- * 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_ANCHORID_HXX
-#define _SVX_ANCHORID_HXX
-
-
-enum SvxAnchorIds
-{
- SVX_OBJ_AT_CNTNT = 0x01, //Absatzgebundener Rahmen
- SVX_OBJ_IN_CNTNT = 0x02, //Zeichengebundener Rahmen
- SVX_OBJ_PAGE = 0x04, //Seitengebundener Rahmen
- SVX_OBJ_AT_FLY = 0x08 //Rahmengebundener Rahmen
-// SVX_OBJ_AUTO_CNTNT = 0x10 //Automatisch positionierter, absatzgebundener Rahmen
-};
-
-
-
-#endif
-
diff --git a/svx/inc/asiancfg.hxx b/svx/inc/asiancfg.hxx
index 5a445f36b1ee..303da7e76630 100644
--- a/svx/inc/asiancfg.hxx
+++ b/svx/inc/asiancfg.hxx
@@ -70,77 +70,3 @@ public:
};
#endif
-
-/*************************************************************************
- *
- * 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: asiancfg.hxx,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 _SVX_ASIANCFG_HXX
-#define _SVX_ASIANCFG_HXX
-
-#include <unotools/configitem.hxx>
-#include <com/sun/star/uno/Sequence.h>
-#include "svx/svxdllapi.h"
-
-namespace com{namespace sun{namespace star{
-namespace lang{
- struct Locale;
-}}}}
-//-----------------------------------------------------------------------------
-struct SvxAsianConfig_Impl;
-class SVX_DLLPUBLIC SvxAsianConfig : public utl::ConfigItem
-{
- SvxAsianConfig_Impl* pImpl;
-
-public:
- SvxAsianConfig(sal_Bool bEnableNotify = sal_True);
- virtual ~SvxAsianConfig();
-
- void Load();
- virtual void Commit();
- virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames);
-
- sal_Bool IsKerningWesternTextOnly() const;
- void SetKerningWesternTextOnly(sal_Bool bSet);
-
- sal_Int16 GetCharDistanceCompression() const;
- void SetCharDistanceCompression(sal_Int16 nSet);
-
- com::sun::star::uno::Sequence<com::sun::star::lang::Locale>
- GetStartEndCharLocales();
-
- sal_Bool GetStartEndChars( const com::sun::star::lang::Locale& rLocale,
- rtl::OUString& rStartChars,
- rtl::OUString& rEndChars );
- void SetStartEndChars( const com::sun::star::lang::Locale& rLocale,
- const rtl::OUString* pStartChars,
- const rtl::OUString* pEndChars );
-};
-
-#endif
-
diff --git a/svx/inc/bolnitem.hxx b/svx/inc/bolnitem.hxx
index f8ec8d319325..bfb55d676866 100644
--- a/svx/inc/bolnitem.hxx
+++ b/svx/inc/bolnitem.hxx
@@ -84,91 +84,3 @@ private:
#endif
-
-/*************************************************************************
- *
- * 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: bolnitem.hxx,v $
- * $Revision: 1.7 $
- *
- * 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_BOLNITEM_HXX
-#define _SVX_BOLNITEM_HXX
-
-// include ---------------------------------------------------------------
-
-
-
-#include <svtools/poolitem.hxx>
-#include "svx/svxdllapi.h"
-
-
-
-// class SvxLineItem -----------------------------------------------------
-
-
-/*
-[Beschreibung]
-Dieses Item transportiert eine SvxBorderLine.
-*/
-
-class SvxBorderLine;
-
-class SVX_DLLPUBLIC SvxLineItem : public SfxPoolItem
-{
-public:
- TYPEINFO();
-
- SvxLineItem( const USHORT nId );
- SvxLineItem( const SvxLineItem& rCpy );
- ~SvxLineItem();
- SvxLineItem &operator=( const SvxLineItem& rLine );
-
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
- virtual int operator==( const SfxPoolItem& ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
- SfxMapUnit eCoreMetric,
- SfxMapUnit ePresMetric,
- String &rText, const IntlWrapper * = 0 ) const;
-
- virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual SfxPoolItem* Create(SvStream &, USHORT) const;
- virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const;
- virtual int ScaleMetrics( long nMult, long nDiv );
- virtual int HasMetrics() const;
-
- const SvxBorderLine* GetLine () const { return pLine; }
- void SetLine ( const SvxBorderLine *pNew );
-
-private:
- SvxBorderLine* pLine;
-};
-
-
-
-
-#endif
-
diff --git a/svx/inc/bulitem.hxx b/svx/inc/bulitem.hxx
index 84eda79feecc..b0adc0d4dd9f 100644
--- a/svx/inc/bulitem.hxx
+++ b/svx/inc/bulitem.hxx
@@ -161,168 +161,3 @@ public:
#endif
-
-/*************************************************************************
- *
- * 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: bulitem.hxx,v $
- * $Revision: 1.6 $
- *
- * 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_BULITEM_HXX
-#define _SVX_BULITEM_HXX
-
-// include ---------------------------------------------------------------
-
-#include "svx/svxdllapi.h"
-
-
-// define ----------------------------------------------------------------
-
-// Styles
-#define BS_ABC_BIG 0
-#define BS_ABC_SMALL 1
-#define BS_ROMAN_BIG 2
-#define BS_ROMAN_SMALL 3
-#define BS_123 4
-#define BS_NONE 5
-#define BS_BULLET 6
-#define BS_BMP 128
-
-// Justification
-#define BJ_HLEFT 0x01
-#define BJ_HRIGHT 0x02
-#define BJ_HCENTER 0x04
-#define BJ_VTOP 0x08
-#define BJ_VBOTTOM 0x10
-#define BJ_VCENTER 0x20
-
-// Valid-Bits
-// Erstmal nur die Werte, die vom Dialog geaendert werden...
-#define VALID_FONTCOLOR 0x0001
-#define VALID_FONTNAME 0x0002
-#define VALID_SYMBOL 0x0004
-#define VALID_BITMAP 0x0008
-#define VALID_SCALE 0x0010
-#define VALID_START 0x0020
-#define VALID_STYLE 0x0040
-#define VALID_PREVTEXT 0x0080
-#define VALID_FOLLOWTEXT 0x0100
-#include <svtools/poolitem.hxx>
-#include <vcl/font.hxx>
-#include <goodies/grfmgr.hxx>
-
-// class SvxBulletItem ---------------------------------------------------
-
-class SVX_DLLPUBLIC SvxBulletItem : public SfxPoolItem
-{
- Font aFont;
- GraphicObject* pGraphicObject;
- String aPrevText;
- String aFollowText;
- USHORT nStart;
- USHORT nStyle;
- long nWidth;
- USHORT nScale;
- sal_Unicode cSymbol;
- BYTE nJustify;
- USHORT nValidMask; // Nur temporaer fuer GetAttribs/SetAttribs, wegen des grossen Bullets
-
-#ifdef _SVX_BULITEM_CXX
- void SetDefaultFont_Impl();
- void SetDefaults_Impl();
-#endif
-
-public:
- TYPEINFO();
-
- SvxBulletItem( USHORT nWhich = 0 );
- SvxBulletItem( BYTE nStyle, const Font& rFont, USHORT nStart = 0, USHORT nWhich = 0 );
- SvxBulletItem( const Font& rFont, sal_Unicode cSymbol, USHORT nWhich=0 );
- SvxBulletItem( const Bitmap&, USHORT nWhich = 0 );
- SvxBulletItem( const GraphicObject&, USHORT nWhich = 0 );
- SvxBulletItem( SvStream& rStrm, USHORT nWhich = 0 );
- SvxBulletItem( const SvxBulletItem& );
- ~SvxBulletItem();
-
- virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream&, USHORT nVersion ) const;
- virtual SvStream& Store( SvStream & , USHORT nItemVersion ) const;
-
- String GetFullText() const;
- sal_Unicode GetSymbol() const { return cSymbol; }
- String GetPrevText() const { return aPrevText; }
- String GetFollowText() const { return aFollowText; }
-
- USHORT GetStart() const { return nStart; }
- long GetWidth() const { return nWidth; }
- USHORT GetStyle() const { return nStyle; }
- BYTE GetJustification() const { return nJustify; }
- Font GetFont() const { return aFont; }
- USHORT GetScale() const { return nScale; }
-
- Bitmap GetBitmap() const;
- void SetBitmap( const Bitmap& rBmp );
-
- const GraphicObject& GetGraphicObject() const;
- void SetGraphicObject( const GraphicObject& rGraphicObject );
-
- void SetSymbol( sal_Unicode c) { cSymbol = c; }
- void SetPrevText( const String& rStr) { aPrevText = rStr;}
- void SetFollowText(const String& rStr) { aFollowText=rStr;}
-
- void SetStart( USHORT nNew ) { nStart = nNew; }
- void SetWidth( long nNew ) { nWidth = nNew; }
- void SetStyle( USHORT nNew ) { nStyle = nNew; }
- void SetJustification( BYTE nNew ) { nJustify = nNew; }
- void SetFont( const Font& rNew) { aFont = rNew; }
- void SetScale( USHORT nNew ) { nScale = nNew; }
-
- virtual USHORT GetVersion(USHORT nFileVersion) const;
- virtual int operator==( const SfxPoolItem& ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
- SfxMapUnit eCoreMetric,
- SfxMapUnit ePresMetric,
- String &rText, const IntlWrapper * = 0 ) const;
-
- static void StoreFont( SvStream&, const Font& );
- static Font CreateFont( SvStream&, USHORT nVer );
-
- USHORT& GetValidMask() { return nValidMask; }
- USHORT GetValidMask() const { return nValidMask; }
- USHORT IsValid( USHORT nFlag ) const { return nValidMask & nFlag; }
- void SetValid( USHORT nFlag, BOOL bValid )
- {
- if ( bValid )
- nValidMask |= nFlag;
- else
- nValidMask &= ~nFlag;
- }
- void CopyValidProperties( const SvxBulletItem& rCopyFrom );
-};
-
-
-#endif
-
diff --git a/svx/inc/charhiddenitem.hxx b/svx/inc/charhiddenitem.hxx
index 8a09f1c978e4..ea36786a503b 100644
--- a/svx/inc/charhiddenitem.hxx
+++ b/svx/inc/charhiddenitem.hxx
@@ -62,71 +62,3 @@ public:
};
#endif
-
-
-/*************************************************************************
- *
- * 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: charhiddenitem.hxx,v $
- * $Revision: 1.6 $
- *
- * 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_CHARHIDDENITEM_HXX
-#define _SVX_CHARHIDDENITEM_HXX
-
-// include ---------------------------------------------------------------
-
-#include <svtools/poolitem.hxx>
-#include <svtools/eitem.hxx>
-#include "svx/svxdllapi.h"
-
-// class SvxCharHiddenItem -------------------------------------------------
-/*
- [Description]
- This item marks text as hidden
-*/
-
-class SVX_DLLPUBLIC SvxCharHiddenItem : public SfxBoolItem
-{
-public:
- TYPEINFO();
-
- SvxCharHiddenItem( const BOOL bHidden /*= FALSE*/, const USHORT nId );
-
- virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
- SfxMapUnit eCoreMetric,
- SfxMapUnit ePresMetric,
- String &rText, const IntlWrapper * = 0 ) const;
-
- inline SvxCharHiddenItem& operator=(const SvxCharHiddenItem& rHidden) {
- SetValue(rHidden.GetValue());
- return *this;
- }
-};
-
-#endif
-
-
diff --git a/svx/inc/fontitem.hxx b/svx/inc/fontitem.hxx
index 8f092b4640f2..da0ee972954b 100644
--- a/svx/inc/fontitem.hxx
+++ b/svx/inc/fontitem.hxx
@@ -111,7 +111,7 @@ public:
return *this;
}
- static void EnableStoreUnicodeNames( BOOL bEnable ) { bEnableStoreUnicodeNames = bEnable; }
+ static void EnableStoreUnicodeNames( BOOL bEnable );
};
diff --git a/svx/inc/gallery1.hxx b/svx/inc/gallery1.hxx
index f38bf0dda5d9..e3665a47c707 100644
--- a/svx/inc/gallery1.hxx
+++ b/svx/inc/gallery1.hxx
@@ -144,7 +144,7 @@ private:
void ImplLoadImports();
void ImplWriteImportList();
- GalleryThemeEntry* ImplGetThemeEntry( const String& rThemeName );
+ SVX_DLLPUBLIC GalleryThemeEntry* ImplGetThemeEntry( const String& rThemeName );
GalleryThemeEntry* ImplGetThemeEntry( ULONG nThemeId );
GalleryImportThemeEntry* ImplGetImportThemeEntry( const String& rImportName );
@@ -168,7 +168,7 @@ public:
SVX_DLLPUBLIC BOOL CreateTheme( const String& rThemeName, UINT32 nNumFrom = 0 );
BOOL CreateImportTheme( const INetURLObject& rURL, const String& rFileName );
BOOL RenameTheme( const String& rOldName, const String& rNewName );
- BOOL RemoveTheme( const String& rThemeName );
+ SVX_DLLPUBLIC BOOL RemoveTheme( const String& rThemeName );
SVX_DLLPUBLIC GalleryTheme* AcquireTheme( const String& rThemeName, SfxListener& rListener );
SVX_DLLPUBLIC void ReleaseTheme( GalleryTheme* pTheme, SfxListener& rListener );
diff --git a/svx/inc/galobj.hxx b/svx/inc/galobj.hxx
index fd1988383d8e..ce2b481bdcdf 100644
--- a/svx/inc/galobj.hxx
+++ b/svx/inc/galobj.hxx
@@ -122,8 +122,8 @@ public:
BOOL IsValid() const { return bIsValid; }
BOOL IsThumbBitmap() const { return bIsThumbBmp; }
- const String GetTitle() const;
- void SetTitle( const String& rTitle );
+ SVX_DLLPUBLIC const String GetTitle() const;
+ SVX_DLLPUBLIC void SetTitle( const String& rTitle );
friend SvStream& operator<<( SvStream& rOut, const SgaObject& rObj );
friend SvStream& operator>>( SvStream& rIn, SgaObject& rObj );
diff --git a/svx/inc/galtheme.hxx b/svx/inc/galtheme.hxx
index 459ef98b9a84..15a1c6fbb1e2 100644
--- a/svx/inc/galtheme.hxx
+++ b/svx/inc/galtheme.hxx
@@ -107,12 +107,12 @@ private:
BOOL bAbortActualize;
void ImplCreateSvDrawStorage();
- SgaObject* ImplReadSgaObject( GalleryObject* pEntry );
+ SVX_DLLPUBLIC SgaObject* ImplReadSgaObject( GalleryObject* pEntry );
BOOL ImplWriteSgaObject( const SgaObject& rObj, ULONG nPos, GalleryObject* pExistentEntry );
void ImplRead();
void ImplWrite();
const GalleryObject* ImplGetGalleryObject( ULONG nPos ) const { return aObjectList.GetObject( nPos ); }
- const GalleryObject* ImplGetGalleryObject( const INetURLObject& rURL );
+ SVX_DLLPUBLIC const GalleryObject* ImplGetGalleryObject( const INetURLObject& rURL );
ULONG ImplGetGalleryObjectPos( const GalleryObject* pObj ) const { return aObjectList.GetPos( pObj ); }
INetURLObject ImplGetURL( const GalleryObject* pObject ) const;
INetURLObject ImplCreateUniqueURL( SgaObjKind eObjKind, ULONG nFormat = CVT_UNKNOWN );
@@ -129,11 +129,11 @@ public:
ULONG GetObjectCount() const { return aObjectList.Count(); }
- SgaObject* AcquireObject( ULONG nPos );
- void ReleaseObject( SgaObject* pObj );
+ SVX_DLLPUBLIC SgaObject* AcquireObject( ULONG nPos );
+ SVX_DLLPUBLIC void ReleaseObject( SgaObject* pObj );
- BOOL InsertObject( const SgaObject& rObj, ULONG nPos = LIST_APPEND );
- BOOL RemoveObject( ULONG nPos );
+ SVX_DLLPUBLIC BOOL InsertObject( const SgaObject& rObj, ULONG nPos = LIST_APPEND );
+ SVX_DLLPUBLIC BOOL RemoveObject( ULONG nPos );
BOOL ChangeObjectPos( ULONG nOldPos, ULONG nNewPos );
const String& GetName() const { return IsImported() ? aImportName : pThm->GetThemeName(); }
@@ -194,11 +194,11 @@ public:
BOOL GetThumb( ULONG nPos, Bitmap& rBmp, BOOL bProgress = FALSE );
- BOOL GetGraphic( ULONG nPos, Graphic& rGraphic, BOOL bProgress = FALSE );
- BOOL InsertGraphic( const Graphic& rGraphic, ULONG nInsertPos = LIST_APPEND );
+ SVX_DLLPUBLIC BOOL GetGraphic( ULONG nPos, Graphic& rGraphic, BOOL bProgress = FALSE );
+ SVX_DLLPUBLIC BOOL InsertGraphic( const Graphic& rGraphic, ULONG nInsertPos = LIST_APPEND );
- BOOL GetModel( ULONG nPos, SdrModel& rModel, BOOL bProgress = FALSE );
- BOOL InsertModel( const FmFormModel& rModel, ULONG nInsertPos = LIST_APPEND );
+ SVX_DLLPUBLIC BOOL GetModel( ULONG nPos, SdrModel& rModel, BOOL bProgress = FALSE );
+ SVX_DLLPUBLIC BOOL InsertModel( const FmFormModel& rModel, ULONG nInsertPos = LIST_APPEND );
BOOL GetModelStream( ULONG nPos, SotStorageStreamRef& rModelStreamRef, BOOL bProgress = FALSE );
BOOL InsertModelStream( const SotStorageStreamRef& rModelStream, ULONG nInsertPos = LIST_APPEND );
diff --git a/svx/inc/optgenrl.hrc b/svx/inc/optgenrl.hrc
index 1972689529fc..4c519d5ebb70 100644
--- a/svx/inc/optgenrl.hrc
+++ b/svx/inc/optgenrl.hrc
@@ -63,6 +63,7 @@
#define ED_EMAIL 38
#define GB_ADDRESS 39
#define CB_USEDATA 40
+#define FT_NAME_EASTERN 41
#define STR_US_STATE 10
#define STR_QUERY_REG 11
@@ -74,7 +75,7 @@
#define LINEH 12
#define FLINEH 8
#define LEFT 12
-#define MID 96
+#define MID 100
#define RIGHT 248
#define TOP 10
#define LINE(y) (14+y*15)
diff --git a/svx/inc/svdglob.hxx b/svx/inc/svdglob.hxx
index c4856be30083..4526579d0658 100644
--- a/svx/inc/svdglob.hxx
+++ b/svx/inc/svdglob.hxx
@@ -33,11 +33,11 @@
#include <tools/contnr.hxx>
-#ifndef _RESID_HXX //autogen
#include <tools/resid.hxx>
-#endif
#include <tools/string.hxx>
+#include <svx/svxdllapi.h>
+
//************************************************************
// Vorausdeklarationen
//************************************************************
@@ -64,7 +64,7 @@ public:
// IDs von SDR_StringCacheBegin (256) bis
// SDR_StringCacheEnd (weiss ich grad' nicht).
// Hierzu siehe auch SvdStr.Hrc
-String ImpGetResStr(sal_uInt16 nResID);
+SVX_DLLPUBLIC String ImpGetResStr(sal_uInt16 nResID);
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/svx/inc/svdstr.hrc b/svx/inc/svdstr.hrc
index cb1b85079f37..280a9dba6122 100644
--- a/svx/inc/svdstr.hrc
+++ b/svx/inc/svdstr.hrc
@@ -324,7 +324,13 @@
#define STR_UndoNewLayer (STR_UndoBegin +13)
#define STR_UndoDelLayer (STR_UndoBegin +14)
#define STR_UndoMovLayer (STR_UndoBegin +15)
-#define STR_UndoEnd (STR_UndoMovLayer)
+
+// --> OD 2009-07-09 #i73249#
+#define STR_UndoObjName (STR_UndoBegin +16)
+#define STR_UndoObjTitle (STR_UndoBegin +17)
+#define STR_UndoObjDescription (STR_UndoBegin +18)
+// <--
+#define STR_UndoEnd (STR_UndoObjDescription)
#define STR_LayerBegin (STR_UndoEnd+1)
diff --git a/svx/inc/svx/AccessibleContextBase.hxx b/svx/inc/svx/AccessibleContextBase.hxx
index 9e36f99eaf0d..009c9b4fa619 100644
--- a/svx/inc/svx/AccessibleContextBase.hxx
+++ b/svx/inc/svx/AccessibleContextBase.hxx
@@ -1,37 +1,5 @@
/*************************************************************************
*
-<<<<<<< AccessibleContextBase.hxx
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: AccessibleContextBase.hxx,v $
- *
- * $Revision: 1.4 $
- *
- * last change: $Author: rt $ $Date: 2008-07-07 14:27:26 $
- *
- * 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
-=======
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2008 by Sun Microsystems, Inc.
@@ -57,7 +25,6 @@
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
->>>>>>> 1.3
*
************************************************************************/
diff --git a/svx/inc/svx/AccessibleControlShape.hxx b/svx/inc/svx/AccessibleControlShape.hxx
index bf8cdec82815..82a56aafb2bf 100644
--- a/svx/inc/svx/AccessibleControlShape.hxx
+++ b/svx/inc/svx/AccessibleControlShape.hxx
@@ -31,13 +31,9 @@
#ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_CONTROL_SHAPE_HXX
#define _SVX_ACCESSIBILITY_ACCESSIBLE_CONTROL_SHAPE_HXX
-#ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_MANAGER_HXX
#include <svx/AccessibleShape.hxx>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_ACTION_HPP_
#include <com/sun/star/accessibility/XAccessibleAction.hpp>
-#endif
#include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
#include <com/sun/star/util/XModeChangeBroadcaster.hpp>
#include <com/sun/star/container/XContainerListener.hpp>
diff --git a/svx/inc/svx/AccessibleShape.hxx b/svx/inc/svx/AccessibleShape.hxx
index f545771728ed..018737934c74 100755
--- a/svx/inc/svx/AccessibleShape.hxx
+++ b/svx/inc/svx/AccessibleShape.hxx
@@ -1,37 +1,5 @@
/*************************************************************************
*
-<<<<<<< AccessibleShape.hxx
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: AccessibleShape.hxx,v $
- *
- * $Revision: 1.4 $
- *
- * last change: $Author: rt $ $Date: 2008-07-07 14:28:01 $
- *
- * 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
-=======
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2008 by Sun Microsystems, Inc.
@@ -57,7 +25,6 @@
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
->>>>>>> 1.3
*
************************************************************************/
diff --git a/svx/inc/svx/SmartTagMgr.hxx b/svx/inc/svx/SmartTagMgr.hxx
index f7a33e41b705..ef9ed696ba80 100644
--- a/svx/inc/svx/SmartTagMgr.hxx
+++ b/svx/inc/svx/SmartTagMgr.hxx
@@ -102,7 +102,7 @@ private:
std::vector< com::sun::star::uno::Reference< com::sun::star::smarttags::XSmartTagAction > > maActionList;
std::set< rtl::OUString > maDisabledSmartTagTypes;
std::multimap < rtl::OUString, ActionReference > maSmartTagMap;
- com::sun::star::uno::Reference< com::sun::star::i18n::XBreakIterator > mxBreakIter;
+ mutable com::sun::star::uno::Reference< com::sun::star::i18n::XBreakIterator > mxBreakIter;
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxMSF;
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext> mxContext;
com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > mxConfigurationSettings;
@@ -129,6 +129,8 @@ private:
*/
void AssociateActionsWithRecognizers();
+ void CreateBreakIterator() const;
+
public:
SmartTagMgr( const rtl::OUString& rApplicationName );
diff --git a/svx/source/inc/dbcharsethelper.hxx b/svx/inc/svx/dbcharsethelper.hxx
index 6b5c1769faba..444538db33f0 100644..100755
--- a/svx/source/inc/dbcharsethelper.hxx
+++ b/svx/inc/svx/dbcharsethelper.hxx
@@ -30,8 +30,8 @@
#ifndef SVX_DBCHARSETHELPER_HXX
#define SVX_DBCHARSETHELPER_HXX
-
-#include "dbtoolsclient.hxx"
+#include "svx/svxdllapi.h"
+#include "svx/dbtoolsclient.hxx"
//........................................................................
namespace svxform
@@ -41,7 +41,7 @@ namespace svxform
//====================================================================
//= ODataAccessCharsetHelper
//====================================================================
- class ODataAccessCharsetHelper : public ODbtoolsClient
+ class SVX_DLLPUBLIC ODataAccessCharsetHelper : public ODbtoolsClient
{
protected:
mutable ::rtl::Reference< ::connectivity::simple::IDataAccessCharSet > m_xCharsetHelper;
diff --git a/svx/source/inc/dbtoolsclient.hxx b/svx/inc/svx/dbtoolsclient.hxx
index 15174b85ef69..ff606c99da7e 100644..100755
--- a/svx/source/inc/dbtoolsclient.hxx
+++ b/svx/inc/svx/dbtoolsclient.hxx
@@ -36,6 +36,7 @@
#include <osl/module.h>
#include <tools/solar.h>
#include <unotools/sharedunocomponent.hxx>
+#include "svx/svxdllapi.h"
//........................................................................
namespace svxform
@@ -50,7 +51,7 @@ namespace svxform
/** base class for classes which want to use dbtools features with load-on-call
of the dbtools lib.
*/
- class ODbtoolsClient
+ class SVX_DLLPUBLIC ODbtoolsClient
{
private:
static ::osl::Mutex s_aMutex;
@@ -82,7 +83,7 @@ namespace svxform
//====================================================================
//= OStaticDataAccessTools
//====================================================================
- class OStaticDataAccessTools : public ODbtoolsClient
+ class SVX_DLLPUBLIC OStaticDataAccessTools : public ODbtoolsClient
{
protected:
mutable ::rtl::Reference< ::connectivity::simple::IDataAccessTools > m_xDataAccessTools;
@@ -214,7 +215,7 @@ namespace svxform
//====================================================================
//= DBToolsObjectFactory
//====================================================================
- class DBToolsObjectFactory : public ODbtoolsClient
+ class SVX_DLLPUBLIC DBToolsObjectFactory : public ODbtoolsClient
{
public:
DBToolsObjectFactory();
diff --git a/svx/inc/svx/dialogs.hrc b/svx/inc/svx/dialogs.hrc
index 13e835a3d378..6e6162ef61f2 100644
--- a/svx/inc/svx/dialogs.hrc
+++ b/svx/inc/svx/dialogs.hrc
@@ -251,8 +251,10 @@
// ResId fuer FontSubstitution
#define RID_SVX_FONT_SUBSTITUTION (RID_SVX_START + 18)
+// insert row&col dialog
+#define DLG_INS_ROW_COL (RID_SVX_START + 156)
+
//InetDlg
-//#define RID_SVXDLG_INTERNET (RID_SVX_START + 156)
#define RID_SVXPAGE_INET_MAIL (RID_SVX_START + 155)
#define RID_SVXPAGE_INET_PROXY (RID_SVX_START + 157)
#define RID_SVXPAGE_INET_CACHE (RID_SVX_START + 158)
@@ -598,6 +600,7 @@
#define RID_SVXSTR_XMLSEC_SIG_OK_NO_VERIFY (RID_SVX_START + 223)
#define RID_SVXSTR_XMLSEC_SIG_NOT_OK (RID_SVX_START + 224)
#define RID_SVXSTR_XMLSEC_NO_SIG (RID_SVX_START + 225)
+#define RID_SVXSTR_XMLSEC_SIG_CERT_OK_PARTIAL_SIG (RID_SVX_START + 226)
// Strings von der Hatch-Tabpage
#define RID_SVXSTR_WRITE_DATA_ERROR (RID_SVX_START + 229)
@@ -1236,7 +1239,7 @@
#define RID_SVXSTR_MENU_ADDCOMMANDS_DESCRIPTION (RID_SVX_START + 1050)
#define RID_SVXSTR_EVENT_STARTAPP (RID_SVX_START + 1051)
#define RID_SVXSTR_EVENT_CLOSEAPP (RID_SVX_START + 1052)
-#define RID_SVXSTR_EVENT_CREATEDOC (RID_SVX_START + 1053)
+#define RID_SVXSTR_EVENT_NEWDOC (RID_SVX_START + 1053)
#define RID_SVXSTR_EVENT_CLOSEDOC (RID_SVX_START + 1054)
#define RID_SVXSTR_EVENT_PREPARECLOSEDOC (RID_SVX_START + 1055)
#define RID_SVXSTR_EVENT_OPENDOC (RID_SVX_START + 1056)
@@ -1367,9 +1370,28 @@
#define STR_LINKEDDOC_NO_SYSTEM_FILE (RID_SVX_START + 1169)
#define RID_SVXSTR_EVENT_SUBCOMPONENT_OPENED (RID_SVX_START + 1170)
#define RID_SVXSTR_EVENT_SUBCOMPONENT_CLOSED (RID_SVX_START + 1171)
+
+#define RID_SVXSTR_EVENT_CREATEDOC (RID_SVX_START + 1172)
+#define RID_SVXSTR_EVENT_LOADDOCFINISHED (RID_SVX_START + 1173)
+#define RID_SVXSTR_EVENT_SAVEDOCFAILED (RID_SVX_START + 1174)
+#define RID_SVXSTR_EVENT_SAVEASDOCFAILED (RID_SVX_START + 1175)
+#define RID_SVXSTR_EVENT_COPYTODOC (RID_SVX_START + 1176)
+#define RID_SVXSTR_EVENT_COPYTODOCDONE (RID_SVX_START + 1177)
+#define RID_SVXSTR_EVENT_COPYTODOCFAILED (RID_SVX_START + 1178)
+#define RID_SVXSTR_EVENT_VIEWCREATED (RID_SVX_START + 1179)
+#define RID_SVXSTR_EVENT_PREPARECLOSEVIEW (RID_SVX_START + 1180)
+#define RID_SVXSTR_EVENT_CLOSEVIEW (RID_SVX_START + 1181)
+#define RID_SVXSTR_EVENT_TITLECHANGED (RID_SVX_START + 1182)
+#define RID_SVXSTR_EVENT_MODECHANGED (RID_SVX_START + 1183)
+#define RID_SVXSTR_EVENT_VISAREACHANGED (RID_SVX_START + 1184)
+#define RID_SVXSTR_EVENT_STORAGECHANGED (RID_SVX_START + 1185)
+#define RID_SVXSTR_EVENT_MAILMERGE_END (RID_SVX_START + 1186)
+#define RID_SVXSTR_EVENT_FIELDMERGE (RID_SVX_START + 1187)
+#define RID_SVXSTR_EVENT_FIELDMERGE_FINISHED (RID_SVX_START + 1188)
+#define RID_SVXSTR_EVENT_LAYOUT_FINISHED (RID_SVX_START + 1189)
// if you add here, remember to adjust RID_SVXSTR_NEXTFREE
-#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1172)
+#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1190)
// ----------------------------------------------------------------------------
// if we have _a_lot_ time, we should group the resource ids by type, instead
diff --git a/svx/inc/svx/editeng.hxx b/svx/inc/svx/editeng.hxx
index d5176034a301..65168297274e 100644
--- a/svx/inc/svx/editeng.hxx
+++ b/svx/inc/svx/editeng.hxx
@@ -219,6 +219,8 @@ public:
USHORT GetLineCount( USHORT nParagraph ) const;
xub_StrLen GetLineLen( USHORT nParagraph, USHORT nLine ) const;
+ void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const;
+ USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
sal_uInt32 GetLineHeight( USHORT nParagraph, USHORT nLine = 0 );
USHORT GetFirstLineOffset( USHORT nParagraph );
ParagraphInfos GetParagraphInfos( USHORT nPara );
diff --git a/svx/inc/svx/escherex.hxx b/svx/inc/svx/escherex.hxx
index 2f6552510c7e..a93814b2a825 100644
--- a/svx/inc/svx/escherex.hxx
+++ b/svx/inc/svx/escherex.hxx
@@ -304,6 +304,8 @@
#define ESCHER_ShpInst_ActionButtonMovie 200
#define ESCHER_ShpInst_HostControl 201
#define ESCHER_ShpInst_TextBox 202
+
+#define ESCHER_ShpInst_COUNT 203
#define ESCHER_ShpInst_Max 0x0FFF
#define ESCHER_ShpInst_Nil ESCHER_ShpInst_Max
@@ -960,10 +962,35 @@ namespace com { namespace sun { namespace star {
struct Gradient;
}
namespace drawing {
+ struct EnhancedCustomShapeAdjustmentValue;
class XShape;
}
}}}
+struct SVX_DLLPUBLIC EscherConnectorListEntry
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnector;
+ ::com::sun::star::awt::Point maPointA;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnectToA;
+ ::com::sun::star::awt::Point maPointB;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnectToB;
+
+ sal_uInt32 GetConnectorRule( sal_Bool bFirst );
+
+ EscherConnectorListEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rC,
+ const ::com::sun::star::awt::Point& rPA,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rSA ,
+ const ::com::sun::star::awt::Point& rPB,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rSB ) :
+ mXConnector ( rC ),
+ maPointA ( rPA ),
+ mXConnectToA( rSA ),
+ maPointB ( rPB ),
+ mXConnectToB( rSB ) {}
+
+ sal_uInt32 GetClosestPoint( const Polygon& rPoly, const ::com::sun::star::awt::Point& rP );
+};
+
struct SVX_DLLPUBLIC EscherExContainer
{
sal_uInt32 nContPos;
@@ -1108,8 +1135,19 @@ public:
#define ESCHER_CREATEPOLYGON_POLYLINE 2
#define ESCHER_CREATEPOLYGON_POLYPOLYGON 4
-struct EscherPropSortStruct;
class GraphicAttr;
+class SdrObjCustomShape;
+
+struct EscherPropSortStruct
+{
+ sal_uInt8* pBuf;
+ sal_uInt32 nPropSize;
+ sal_uInt32 nPropValue;
+ sal_uInt16 nPropId;
+};
+
+typedef std::vector< EscherPropSortStruct > EscherProperties;
+
class SVX_DLLPUBLIC EscherPropertyContainer
{
EscherGraphicProvider* pGraphicProvider;
@@ -1155,6 +1193,10 @@ class SVX_DLLPUBLIC EscherPropertyContainer
sal_Bool GetOpt( sal_uInt16 nPropertyID, sal_uInt32& rPropValue ) const;
+ sal_Bool GetOpt( sal_uInt16 nPropertyID, EscherPropSortStruct& rPropValue ) const;
+
+ EscherProperties GetOpts() const;
+
void Commit( SvStream& rSt, sal_uInt16 nVersion = 3, sal_uInt16 nRecType = ESCHER_OPT );
sal_Bool CreateOLEGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXOleObject );
@@ -1202,6 +1244,14 @@ class SVX_DLLPUBLIC EscherPropertyContainer
static PolyPolygon GetPolyPolygon( const ::com::sun::star::uno::Any& rSource );
static MSO_SPT GetCustomShapeType( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, sal_uInt32& nMirrorFlags );
static MSO_SPT GetCustomShapeType( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, sal_uInt32& nMirrorFlags, rtl::OUString& rShapeType );
+
+ // helper functions which are also used in ooxml export
+ static sal_Bool GetLineArrow( const sal_Bool bLineStart,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ ESCHER_LineEnd& reLineEnd, sal_Int32& rnArrowLength, sal_Int32& rnArrowWidth );
+ static sal_Bool IsDefaultObject( SdrObjCustomShape* pCustoShape );
+ static void LookForPolarHandles( const MSO_SPT eShapeType, sal_Int32& nAdjustmentsWhichNeedsToBeConverted );
+ static sal_Bool GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue );
};
// ---------------------------------------------------------------------------------------------
@@ -1338,7 +1388,7 @@ class SVX_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGraphicPr
BOOL mbOleEmf; // OLE is EMF instead of WMF
- BOOL DoSeek( UINT32 nKey );
+ virtual BOOL DoSeek( UINT32 nKey );
public:
@@ -1349,7 +1399,7 @@ class SVX_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGraphicPr
/// Wenn pPicStreamMergeBSE angegeben ist, werden die BLIPs
/// aus diesem Stream in die MsofbtBSE Records des EscherStream
/// gemerged, wie es fuer Excel (und Word?) benoetigt wird.
- void Flush( SvStream* pPicStreamMergeBSE = NULL );
+ virtual void Flush( SvStream* pPicStreamMergeBSE = NULL );
virtual ~EscherEx();
@@ -1360,13 +1410,13 @@ class SVX_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGraphicPr
void InsertPersistOffset( UINT32 nKey, UINT32 nOffset ); // Es wird nicht geprueft, ob sich jener schluessel schon in der PersistantTable befindet
BOOL SeekToPersistOffset( UINT32 nKey );
- BOOL InsertAtPersistOffset( UINT32 nKey, UINT32 nValue );// nValue wird im Stream an entrsprechender Stelle eingefuegt(overwrite modus), ohne dass sich die
+ virtual BOOL InsertAtPersistOffset( UINT32 nKey, UINT32 nValue );// nValue wird im Stream an entrsprechender Stelle eingefuegt(overwrite modus), ohne dass sich die
// aktuelle StreamPosition aendert
SvStream& GetStream() const { return *mpOutStrm; }
ULONG GetStreamPos() const { return mpOutStrm->Tell(); }
- BOOL SeekBehindRecHeader( UINT16 nRecType ); // der stream muss vor einem gueltigen Record Header oder Atom stehen
+ virtual BOOL SeekBehindRecHeader( UINT16 nRecType ); // der stream muss vor einem gueltigen Record Header oder Atom stehen
// features beim erzeugen folgender Container:
//
@@ -1378,23 +1428,26 @@ class SVX_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGraphicPr
virtual void OpenContainer( UINT16 nEscherContainer, int nRecInstance = 0 );
virtual void CloseContainer();
- void BeginAtom();
- void EndAtom( UINT16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
- void AddAtom( UINT32 nAtomSitze, UINT16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
- void AddClientAnchor( const Rectangle& rRectangle );
+ virtual void BeginAtom();
+ virtual void EndAtom( UINT16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
+ virtual void AddAtom( UINT32 nAtomSitze, UINT16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
+ virtual void AddChildAnchor( const Rectangle& rRectangle );
+ virtual void AddClientAnchor( const Rectangle& rRectangle );
- UINT32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 );
+ virtual UINT32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 );
UINT32 EnterGroup( const Rectangle* pBoundRect = NULL );
UINT32 GetGroupLevel() const { return mnGroupLevel; };
- BOOL SetGroupSnapRect( UINT32 nGroupLevel, const Rectangle& rRect );
- BOOL SetGroupLogicRect( UINT32 nGroupLevel, const Rectangle& rRect );
- void LeaveGroup();
+ virtual BOOL SetGroupSnapRect( UINT32 nGroupLevel, const Rectangle& rRect );
+ virtual BOOL SetGroupLogicRect( UINT32 nGroupLevel, const Rectangle& rRect );
+ virtual void LeaveGroup();
// ein ESCHER_Sp wird geschrieben ( Ein ESCHER_DgContainer muss dazu geoeffnet sein !!)
- void AddShape( UINT32 nShpInstance, UINT32 nFlagIds, UINT32 nShapeID = 0 );
+ virtual void AddShape( UINT32 nShpInstance, UINT32 nFlagIds, UINT32 nShapeID = 0 );
// reserviert eine ShapeId
UINT32 GetShapeID();
+ virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect );
+
UINT32 GetColor( const UINT32 nColor, BOOL bSwap = TRUE );
UINT32 GetColor( const Color& rColor, BOOL bSwap = TRUE );
diff --git a/svx/inc/svx/fntctrl.hxx b/svx/inc/svx/fntctrl.hxx
index d87d75ab3690..a0de3b2d3048 100644
--- a/svx/inc/svx/fntctrl.hxx
+++ b/svx/inc/svx/fntctrl.hxx
@@ -71,6 +71,7 @@ public:
SvxFont& GetCJKFont();
SvxFont& GetCTLFont();
void SetColor( const Color& rColor );
+ void ResetColor();
void SetBackColor( const Color& rColor );
void UseResourceText( BOOL bUse = TRUE );
void Paint( const Rectangle& );
diff --git a/svx/inc/svx/framelink.hxx b/svx/inc/svx/framelink.hxx
index 257816fd9c5c..012e0f103ac3 100644
--- a/svx/inc/svx/framelink.hxx
+++ b/svx/inc/svx/framelink.hxx
@@ -325,7 +325,7 @@ inline double GetVerDiagAngle( const Rectangle& rRect )
@param fAngle
Inner (right) angle between diagonal and horizontal frame border.
*/
-long GetTLDiagOffset( long nVerOffs, long nDiagOffs, double fAngle );
+SVX_DLLPUBLIC long GetTLDiagOffset( long nVerOffs, long nDiagOffs, double fAngle );
/** Returns an X coordinate for a diagonal frame border in the specified height.
@@ -434,7 +434,7 @@ long GetTRDiagOffset( long nVerOffs, long nDiagOffs, double fAngle );
True, if rLBorder and rRBorder can be drawn in one step without
interruption at their connection point.
*/
-bool CheckFrameBorderConnectable(
+SVX_DLLPUBLIC bool CheckFrameBorderConnectable(
const Style& rLBorder, /// Style of the left frame border to connect.
const Style& rRBorder, /// Style of the right frame border to connect.
@@ -486,7 +486,7 @@ bool CheckFrameBorderConnectable(
| \ / |
rLFromB \ / rRFromB
*/
-void DrawHorFrameBorder(
+SVX_DLLPUBLIC void DrawHorFrameBorder(
OutputDevice& rDev, /// The output device used to draw the frame border.
const Point& rLPos, /// Reference point for left end of the processed frame border.
@@ -603,7 +603,7 @@ void SVX_DLLPUBLIC DrawHorFrameBorder(
rBFromB
|
*/
-void DrawVerFrameBorder(
+SVX_DLLPUBLIC void DrawVerFrameBorder(
OutputDevice& rDev, /// The output device used to draw the frame border.
const Point& rTPos, /// Reference point for top end of the processed frame border.
@@ -698,7 +698,7 @@ void SVX_DLLPUBLIC DrawVerFrameBorderSlanted(
The function preserves all settings of the passed output device.
*/
-void DrawDiagFrameBorders(
+SVX_DLLPUBLIC void DrawDiagFrameBorders(
OutputDevice& rDev, /// The output device used to draw the frame border.
const Rectangle& rRect, /// Rectangle for both diagonal frame borders.
diff --git a/svx/inc/svx/langbox.hxx b/svx/inc/svx/langbox.hxx
index 8aebc88e380e..476d78c53d03 100644
--- a/svx/inc/svx/langbox.hxx
+++ b/svx/inc/svx/langbox.hxx
@@ -78,6 +78,7 @@ private:
SVX_DLLPRIVATE void Init();
SVX_DLLPRIVATE USHORT ImplInsertImgEntry( const String& rEntry, USHORT nPos, bool bChecked );
+ SVX_DLLPRIVATE USHORT ImplInsertLanguage(LanguageType, USHORT, sal_Int16 );
public:
SvxLanguageBox( Window* pParent, WinBits nWinStyle, BOOL bCheck = FALSE);
@@ -89,6 +90,7 @@ public:
BOOL bCheckSpellAvail = FALSE );
USHORT InsertLanguage( const LanguageType eLangType, USHORT nPos = LISTBOX_APPEND );
+ USHORT InsertDefaultLanguage( sal_Int16 nType, USHORT nPos = LISTBOX_APPEND );
USHORT InsertLanguage( const LanguageType eLangType,
BOOL bCheckEntry, USHORT nPos = LISTBOX_APPEND );
void RemoveLanguage( const LanguageType eLangType );
diff --git a/svx/inc/svx/msdffimp.hxx b/svx/inc/svx/msdffimp.hxx
index a172add3ddb4..248a31dcf71f 100644
--- a/svx/inc/svx/msdffimp.hxx
+++ b/svx/inc/svx/msdffimp.hxx
@@ -36,9 +36,7 @@
#include <tools/solar.h> // UINTXX
#include <svtools/svarray.hxx>
-#ifndef _SV_COLOR_HXX //autogen
#include <tools/color.hxx>
-#endif
#include <tools/gen.hxx>
#include <tools/table.hxx>
#include <svx/msdffdef.hxx>
@@ -48,7 +46,7 @@
#include <map>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include "svx/svxdllapi.h"
+#include <svx/svxdllapi.h>
#include <sot/storage.hxx>
diff --git a/svx/inc/svx/numfmtsh.hxx b/svx/inc/svx/numfmtsh.hxx
index 8e2eb238d3bd..5e6fe3737f94 100644
--- a/svx/inc/svx/numfmtsh.hxx
+++ b/svx/inc/svx/numfmtsh.hxx
@@ -212,8 +212,8 @@ public:
short GetListPos4Entry(sal_uInt32 nIdx);
short GetListPos4Entry( const String& rFmtString );
- void GetCurrencySymbols(SvStringsDtor& rList,const XubString& rStrEurope,USHORT* pPos);
- void GetCurrencySymbols(SvStringsDtor& rList,const XubString& rStrEurope, BOOL bFlag);
+ void GetCurrencySymbols( SvStringsDtor& rList, USHORT* pPos );
+ void GetCurrencySymbols( SvStringsDtor& rList, BOOL bFlag );
USHORT FindCurrencyTableEntry( const String& rFmtString, BOOL &bTestBanking );
BOOL IsInTable(USHORT nPos,BOOL bTmpBanking,const String &rFmtString);
diff --git a/svx/inc/svx/obj3d.hxx b/svx/inc/svx/obj3d.hxx
index 6d77b0612e90..46c79b45e4d1 100644
--- a/svx/inc/svx/obj3d.hxx
+++ b/svx/inc/svx/obj3d.hxx
@@ -92,8 +92,8 @@ class E3dObjList : public SdrObjList
public:
TYPEINFO();
E3dObjList(SdrModel* pNewModel = 0, SdrPage* pNewPage = 0, E3dObjList* pNewUpList = 0);
- E3dObjList(const E3dObjList& rSrcList);
- virtual ~E3dObjList();
+ SVX_DLLPUBLIC E3dObjList(const E3dObjList& rSrcList);
+ SVX_DLLPUBLIC virtual ~E3dObjList();
virtual void NbcInsertObject(SdrObject* pObj, ULONG nPos=CONTAINER_APPEND, const SdrInsertReason* pReason=NULL);
virtual void InsertObject(SdrObject* pObj, ULONG nPos=CONTAINER_APPEND, const SdrInsertReason* pReason=NULL);
diff --git a/svx/inc/svx/sdasaitm.hxx b/svx/inc/svx/sdasaitm.hxx
index b945a8341808..2301e0021b42 100644
--- a/svx/inc/svx/sdasaitm.hxx
+++ b/svx/inc/svx/sdasaitm.hxx
@@ -54,9 +54,9 @@ class SdrCustomShapeAdjustmentItem : public SfxPoolItem
public :
TYPEINFO();
- SdrCustomShapeAdjustmentItem();
+ SVX_DLLPUBLIC SdrCustomShapeAdjustmentItem();
SdrCustomShapeAdjustmentItem( SvStream& rIn, sal_uInt16 nVersion );
- ~SdrCustomShapeAdjustmentItem();
+ SVX_DLLPUBLIC ~SdrCustomShapeAdjustmentItem();
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePresentation,
@@ -76,8 +76,8 @@ class SdrCustomShapeAdjustmentItem : public SfxPoolItem
#endif
sal_uInt32 GetCount() const { return aAdjustmentValueList.Count(); };
- const SdrCustomShapeAdjustmentValue& GetValue( sal_uInt32 nIndex ) const;
- void SetValue( sal_uInt32 nIndex,
+ SVX_DLLPUBLIC const SdrCustomShapeAdjustmentValue& GetValue( sal_uInt32 nIndex ) const;
+ SVX_DLLPUBLIC void SetValue( sal_uInt32 nIndex,
const SdrCustomShapeAdjustmentValue& rVal );
};
diff --git a/svx/inc/svx/sdgcpitm.hxx b/svx/inc/svx/sdgcpitm.hxx
index 41efd3e7abee..4df0e005111d 100644
--- a/svx/inc/svx/sdgcpitm.hxx
+++ b/svx/inc/svx/sdgcpitm.hxx
@@ -38,7 +38,7 @@
// SdrGrafCropItem -
//------------------
-class SdrGrafCropItem : public SvxGrfCrop
+class SVX_DLLPUBLIC SdrGrafCropItem : public SvxGrfCrop
{
public:
diff --git a/svx/inc/svx/sdr/animation/objectanimator.hxx b/svx/inc/svx/sdr/animation/objectanimator.hxx
index 6f1b0900c030..3fcb52463bc8 100644
--- a/svx/inc/svx/sdr/animation/objectanimator.hxx
+++ b/svx/inc/svx/sdr/animation/objectanimator.hxx
@@ -48,7 +48,7 @@ namespace sdr
public:
// basic constructor and destructor
primitiveAnimator();
- virtual ~primitiveAnimator();
+ SVX_DLLPUBLIC virtual ~primitiveAnimator();
};
} // end of namespace animation
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/animation/scheduler.hxx b/svx/inc/svx/sdr/animation/scheduler.hxx
index 589cbde9bd75..03fc8eccd9b4 100644
--- a/svx/inc/svx/sdr/animation/scheduler.hxx
+++ b/svx/inc/svx/sdr/animation/scheduler.hxx
@@ -33,6 +33,7 @@
#include <sal/types.h>
#include <vcl/timer.hxx>
+#include <svx/svxdllapi.h>
//////////////////////////////////////////////////////////////////////////////
// event class
@@ -52,7 +53,7 @@ namespace sdr
public:
// constructor/destructor
Event(sal_uInt32 nTime);
- virtual ~Event();
+ SVX_DLLPUBLIC virtual ~Event();
// access to mpNext
Event* GetNext() const;
@@ -83,7 +84,7 @@ namespace sdr
public:
// constructor/destructor
EventList();
- virtual ~EventList();
+ SVX_DLLPUBLIC virtual ~EventList();
// insert/remove time dependent
void Insert(Event* pNew);
@@ -123,10 +124,10 @@ namespace sdr
public:
// constructor/destructor
Scheduler();
- virtual ~Scheduler();
+ SVX_DLLPUBLIC virtual ~Scheduler();
// From baseclass Timer, the timeout call
- virtual void Timeout();
+ SVX_DLLPUBLIC virtual void Timeout();
// get time
sal_uInt32 GetTime();
diff --git a/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx
index e0dcb51e9460..1759eb18d319 100644
--- a/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx
+++ b/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx
@@ -35,6 +35,7 @@
#include <sal/types.h>
#include <svx/xenum.hxx>
#include <svx/outlobj.hxx>
+#include <svx/sdtaitm.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -68,6 +69,10 @@ namespace drawinglayer
// #i101556# use versioning from text attributes to detect changes
sal_uInt32 maPropertiesVersion;
+ // text alignments
+ SdrTextHorzAdjust maSdrTextHorzAdjust;
+ SdrTextVertAdjust maSdrTextVertAdjust;
+
// bitfield
unsigned mbContour : 1;
unsigned mbFitToSize : 1;
@@ -75,6 +80,7 @@ namespace drawinglayer
unsigned mbBlink : 1;
unsigned mbScroll : 1;
unsigned mbInEditMode : 1;
+ unsigned mbFixedCellHeight : 1;
public:
SdrTextAttribute(
@@ -85,12 +91,15 @@ namespace drawinglayer
sal_Int32 aTextUpperDistance,
sal_Int32 aTextRightDistance,
sal_Int32 aTextLowerDistance,
+ SdrTextHorzAdjust aSdrTextHorzAdjust,
+ SdrTextVertAdjust aSdrTextVertAdjust,
bool bContour,
bool bFitToSize,
bool bHideContour,
bool bBlink,
bool bScroll,
- bool bInEditMode);
+ bool bInEditMode,
+ bool bFixedCellHeight);
~SdrTextAttribute();
// copy constructor and assigment operator
@@ -109,12 +118,15 @@ namespace drawinglayer
bool isBlink() const { return mbBlink; }
bool isScroll() const { return mbScroll; }
bool isInEditMode() const { return mbInEditMode; }
+ bool isFixedCellHeight() const { return mbFixedCellHeight; }
const SdrFormTextAttribute* getSdrFormTextAttribute() const { return mpSdrFormTextAttribute; }
sal_Int32 getTextLeftDistance() const { return maTextLeftDistance; }
sal_Int32 getTextUpperDistance() const { return maTextUpperDistance; }
sal_Int32 getTextRightDistance() const { return maTextRightDistance; }
sal_Int32 getTextLowerDistance() const { return maTextLowerDistance; }
sal_uInt32 getPropertiesVersion() const { return maPropertiesVersion; }
+ SdrTextHorzAdjust getSdrTextHorzAdjust() const { return maSdrTextHorzAdjust; }
+ SdrTextVertAdjust getSdrTextVertAdjust() const { return maSdrTextVertAdjust; }
// animation timing generation
void getBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const;
diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx
index d75c2bfa3919..27235de9e097 100644
--- a/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx
+++ b/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx
@@ -64,15 +64,15 @@ namespace sdr
ViewContactOfSdrOle2Obj(SdrOle2Obj& rOle2Obj);
virtual ~ViewContactOfSdrOle2Obj();
- // helper for creating a OLE sequence for this object for a specified Graphic. This is locally
- // used from createViewIndependentPrimitive2DSequence and also allows the VOC which knows about
- // HighContrast mode to easily do the same with the HighContrast OLE metafile. It also allows
- // to give a hint for scaling down the content what is needed for EmptyPresObjs
- drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequenceWithGivenGraphic(const Graphic& rOLEGraphic, bool bScaleContent) const;
+ // helper for creating a OLE sequence for this object. It takes care od attributes, needed
+ // scaling (e.g. for EmptyPresObj's), the correct graphic and other stuff. It is used from
+ // createViewIndependentPrimitive2DSequence with false, and with evtl. HighContrast true
+ // from the VOC which knows that
+ drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequenceWithParameters(bool bHighContrast) const;
protected:
// This method is responsible for creating the graphical visualisation data
- // ONLY based on model data
+ // ONLY based on model data, just wraps to call createPrimitive2DSequenceWithParameters(false)
virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
};
} // end of namespace contact
diff --git a/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx b/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx
index 9acc34c8dcc8..23a720467710 100644
--- a/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx
@@ -40,7 +40,7 @@ namespace sdr
{
namespace overlay
{
- class OverlayAnimatedBitmapEx : public OverlayObjectWithBasePosition
+ class SVX_DLLPUBLIC OverlayAnimatedBitmapEx : public OverlayObjectWithBasePosition
{
protected:
// the Bitmaps
diff --git a/svx/inc/svx/sdr/overlay/overlayobject.hxx b/svx/inc/svx/sdr/overlay/overlayobject.hxx
index e5aca5651976..ae31df8f6dee 100644
--- a/svx/inc/svx/sdr/overlay/overlayobject.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayobject.hxx
@@ -133,8 +133,9 @@ namespace sdr
OverlayManager* getOverlayManager() const { return mpOverlayManager; }
// the access method for Primitive2DSequence. Will use createPrimitive2DSequence and
- // setPrimitive2DSequence if needed
- const drawinglayer::primitive2d::Primitive2DSequence& getOverlayObjectPrimitive2DSequence() const;
+ // setPrimitive2DSequence if needed. Overloading may be used to allow disposal of last
+ // created primitives to react on changed circumstances and to re-create primitives
+ virtual drawinglayer::primitive2d::Primitive2DSequence getOverlayObjectPrimitive2DSequence() const;
// access to visibility state
bool isVisible() const { return mbIsVisible; }
diff --git a/svx/inc/svx/sdr/overlay/overlayselection.hxx b/svx/inc/svx/sdr/overlay/overlayselection.hxx
new file mode 100644
index 000000000000..17f32ee419e9
--- /dev/null
+++ b/svx/inc/svx/sdr/overlay/overlayselection.hxx
@@ -0,0 +1,98 @@
+/*************************************************************************
+ *
+ * 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: overlayline.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 _SDR_OVERLAY_OVERLAYSELECTION_HXX
+#define _SDR_OVERLAY_OVERLAYSELECTION_HXX
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+#include <vcl/region.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ // overlay type definition
+ enum OverlayType
+ {
+ OVERLAY_INVERT,
+ OVERLAY_SOLID,
+ OVERLAY_TRANSPARENT
+ };
+
+ class SVX_DLLPUBLIC OverlaySelection : public OverlayObject
+ {
+ protected:
+ // type of overlay
+ OverlayType meOverlayType;
+
+ // geometry of overlay
+ std::vector< basegfx::B2DRange > maRanges;
+
+ // Values of last primitive creation. These are checked in getOverlayObjectPrimitive2DSequence
+ // to evtl. get rid of last Primitive2DSequence. This ensures that these values are up-to-date
+ // and are usable when creating primitives
+ OverlayType maLastOverlayType;
+ sal_uInt16 mnLastTransparence;
+
+ // bitfield
+ unsigned mbBorder : 1;
+
+ // geometry creation for OverlayObject, can use local *Last* values
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+ public:
+ OverlaySelection(
+ OverlayType eType,
+ const Color& rColor,
+ const std::vector< basegfx::B2DRange >& rRanges,
+ bool bBorder);
+ virtual ~OverlaySelection();
+
+ // data read access
+ OverlayType getOverlayType() const { return meOverlayType; }
+ const std::vector< basegfx::B2DRange >& getRanges() const { return maRanges; }
+ bool getBorder() const { return mbBorder; }
+
+ // overloaded to check conditions for last createOverlayObjectPrimitive2DSequence
+ virtual drawinglayer::primitive2d::Primitive2DSequence getOverlayObjectPrimitive2DSequence() const;
+
+ // data write access
+ void setRanges(const std::vector< basegfx::B2DRange >& rNew);
+ };
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_OVERLAY_OVERLAYSELECTION_HXX
+
+// eof
diff --git a/svx/inc/svx/sdr/primitive2d/primitiveFactory2d.hxx b/svx/inc/svx/sdr/primitive2d/primitiveFactory2d.hxx
index 85368fc8db86..aa3785995b25 100644
--- a/svx/inc/svx/sdr/primitive2d/primitiveFactory2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/primitiveFactory2d.hxx
@@ -36,6 +36,8 @@
#include <cppuhelper/compbase1.hxx>
#include <comphelper/broadcasthelper.hxx>
+#include <svx/svxdllapi.h>
+
//////////////////////////////////////////////////////////////////////////////
// UNO API helper methods
@@ -43,7 +45,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL XPrimitiveFactory2DProvider_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
+ SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL XPrimitiveFactory2DProvider_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -73,8 +75,8 @@ namespace drawinglayer
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXDrawPage( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aParms ) throw (::com::sun::star::uno::RuntimeException);
// UNO API helpers
- static rtl::OUString getImplementationName_Static();
- static com::sun::star::uno::Sequence< rtl::OUString > getSupportedServiceNames_Static();
+ SVX_DLLPUBLIC static rtl::OUString getImplementationName_Static();
+ SVX_DLLPUBLIC static com::sun::star::uno::Sequence< rtl::OUString > getSupportedServiceNames_Static();
};
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx
index b5b8867b1ae5..01bb7794e9f3 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx
@@ -76,7 +76,7 @@ namespace drawinglayer
const ::basegfx::B2DPolygon& getTail() const { return maTail; }
double getCornerRadiusX() const { return mfCornerRadiusX; }
double getCornerRadiusY() const { return mfCornerRadiusY; }
- bool hasCornerRadius() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); }
+ bool isCornerRadiusUsed() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); }
// provide unique ID
DeclPrimitrive2DIDBlock()
diff --git a/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx
index a29ecb890df6..4eddc4386a0d 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx
@@ -56,6 +56,8 @@ namespace drawinglayer
// defines if SdrTextWordWrapItem was set at SdrObjCustomShape which means
// that the text needs to be block formatted
unsigned mbWordWrap : 1;
+ // #SJ# Allow text clipping against TextBox in special cases (used for SC)
+ unsigned mbForceTextClipToTextRange : 1;
protected:
// local decomposition.
@@ -66,13 +68,15 @@ namespace drawinglayer
const attribute::SdrShadowTextAttribute& rSdrSTAttribute,
const Primitive2DSequence& rSubPrimitives,
const basegfx::B2DHomMatrix& rTextBox,
- bool bWordWrap);
+ bool bWordWrap,
+ bool bForceTextClipToTextRange);
// data access
const attribute::SdrShadowTextAttribute& getSdrSTAttribute() const { return maSdrSTAttribute; }
const Primitive2DSequence& getSubPrimitives() const { return maSubPrimitives; }
const basegfx::B2DHomMatrix& getTextBox() const { return maTextBox; }
bool getWordWrap() const { return mbWordWrap; }
+ bool isForceTextClipToTextRange() const { return mbForceTextClipToTextRange; }
// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
diff --git a/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx b/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx
index 2f4702e62b07..798e5b53d6de 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx
@@ -77,8 +77,8 @@ namespace drawinglayer
bool bCellText,
bool bWordWrap);
- Primitive2DReference createShadowPrimitive(
- const Primitive2DSequence& rSource,
+ Primitive2DSequence createEmbeddedShadowPrimitive(
+ const Primitive2DSequence& rContent,
const attribute::SdrShadowAttribute& rShadow);
} // end of namespace primitive2d
diff --git a/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx
index 7ee46630bf5b..1e68a61432a0 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx
@@ -63,8 +63,8 @@ namespace drawinglayer
{
private:
attribute::SdrLineShadowTextAttribute maSdrLSTAttribute;
- ::basegfx::B2DPoint maStart;
- ::basegfx::B2DPoint maEnd;
+ basegfx::B2DPoint maStart;
+ basegfx::B2DPoint maEnd;
MeasureTextPosition meHorizontal;
MeasureTextPosition meVertical;
double mfDistance;
@@ -80,9 +80,9 @@ namespace drawinglayer
// internal decomposition helper
Primitive2DReference impCreatePart(
- const ::basegfx::B2DHomMatrix& rObjectMatrix,
- const ::basegfx::B2DPoint& rStart,
- const ::basegfx::B2DPoint& rEnd,
+ const basegfx::B2DHomMatrix& rObjectMatrix,
+ const basegfx::B2DPoint& rStart,
+ const basegfx::B2DPoint& rEnd,
bool bLeftActive,
bool bRightActive) const;
@@ -93,7 +93,8 @@ namespace drawinglayer
public:
SdrMeasurePrimitive2D(
const attribute::SdrLineShadowTextAttribute& rSdrLSTAttribute,
- const ::basegfx::B2DPoint& rStart, const ::basegfx::B2DPoint& rEnd,
+ const basegfx::B2DPoint& rStart,
+ const basegfx::B2DPoint& rEnd,
MeasureTextPosition eHorizontal,
MeasureTextPosition eVertical,
double fDistance,
@@ -107,8 +108,8 @@ namespace drawinglayer
// data access
const attribute::SdrLineShadowTextAttribute& getSdrLSTAttribute() const { return maSdrLSTAttribute; }
- const ::basegfx::B2DPoint& getStart() const { return maStart; }
- const ::basegfx::B2DPoint& getEnd() const { return maEnd; }
+ const basegfx::B2DPoint& getStart() const { return maStart; }
+ const basegfx::B2DPoint& getEnd() const { return maEnd; }
MeasureTextPosition getHorizontal() const { return meHorizontal; }
MeasureTextPosition getVertical() const { return meVertical; }
double getDistance() const { return mfDistance; }
diff --git a/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx
new file mode 100644
index 000000000000..70e28d599a44
--- /dev/null
+++ b/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * 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: sdrcaptionprimitive2d.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_SDR_PRIMITIVE2D_SDROLECONTENTPRIMITIVE2D_HXX
+#define INCLUDED_SDR_PRIMITIVE2D_SDROLECONTENTPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/svdobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefinitions
+
+class SdrOle2Obj;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrOleContentPrimitive2D : public BasePrimitive2D
+ {
+ private:
+ SdrObjectWeakRef mpSdrOle2Obj;
+ basegfx::B2DHomMatrix maObjectTransform;
+
+ // bitfield
+ unsigned mbHighContrast : 1;
+
+ protected:
+ // local decomposition.
+ virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ public:
+ SdrOleContentPrimitive2D(
+ const SdrOle2Obj& rSdrOle2Obj,
+ const basegfx::B2DHomMatrix& rObjectTransform,
+ bool bHighContrast);
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // The default implementation will use getDecomposition results to create the range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ // data access
+ const basegfx::B2DHomMatrix& getObjectTransform() const { return maObjectTransform; }
+ bool getHighContrast() const { return mbHighContrast; }
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_SDR_PRIMITIVE2D_SDROLECONTENTPRIMITIVE2D_HXX
+
+// eof
diff --git a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx
index 6a3983835ef9..650cc1a882c5 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx
@@ -49,28 +49,35 @@ namespace drawinglayer
class SdrRectanglePrimitive2D : public BasePrimitive2D
{
private:
- ::basegfx::B2DHomMatrix maTransform;
+ basegfx::B2DHomMatrix maTransform;
attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute;
double mfCornerRadiusX; // [0.0..1.0] relative to 1/2 width
double mfCornerRadiusY; // [0.0..1.0] relative to 1/2 height
+ // bitfield
+ // flag which decides if this is a text frame. If Yes, the HitArea
+ // should be the filled geometry
+ bool mbTextFrame : 1;
+
protected:
// local decomposition.
virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
public:
SdrRectanglePrimitive2D(
- const ::basegfx::B2DHomMatrix& rTransform,
+ const basegfx::B2DHomMatrix& rTransform,
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
- double fCornerRadiusX = 0.0,
- double fCornerRadiusY = 0.0);
+ double fCornerRadiusX,
+ double fCornerRadiusY,
+ bool bTextFrame);
// data access
- const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
+ const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; }
double getCornerRadiusX() const { return mfCornerRadiusX; }
double getCornerRadiusY() const { return mfCornerRadiusY; }
- bool hasCornerRadius() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); }
+ bool isCornerRadiusUsed() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); }
+ bool getTextFrame() const { return mbTextFrame; }
// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
diff --git a/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx
index 6dd60b45d2d5..132a3ecc2538 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx
@@ -40,6 +40,7 @@
#include <tools/color.hxx>
#include <svx/sdr/attribute/sdrformtextattribute.hxx>
#include <tools/weakbase.hxx>
+#include <svx/sdtaitm.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -82,11 +83,6 @@ namespace drawinglayer
Color maLastTextBackgroundColor;
// bitfield
- // remember if last decomposition was with or without spell checker. In this special
- // case the get2DDecomposition implementation has to take care of this aspect. This is
- // needed since different views do different text decompositons regarding spell checking.
- unsigned mbLastSpellCheck : 1;
-
// is there a PageNumber, Header, Footer or DateTimeField used? Evaluated at construction
unsigned mbContainsPageField : 1;
unsigned mbContainsPageCountField : 1;
@@ -96,9 +92,6 @@ namespace drawinglayer
// support for XTEXT_PAINTSHAPE_BEGIN/XTEXT_PAINTSHAPE_END Metafile comments
Primitive2DSequence encapsulateWithTextHierarchyBlockPrimitive2D(const Primitive2DSequence& rCandidate) const;
- bool getLastSpellCheck() const { return (bool)mbLastSpellCheck; }
- void setLastSpellCheck(bool bNew) { mbLastSpellCheck = bNew; }
-
public:
SdrTextPrimitive2D(
const SdrText* pSdrText,
@@ -217,7 +210,12 @@ namespace drawinglayer
// text range transformation from unit range ([0.0 .. 1.0]) to text range
basegfx::B2DHomMatrix maTextRangeTransform;
+ // text alignments
+ SdrTextHorzAdjust maSdrTextHorzAdjust;
+ SdrTextVertAdjust maSdrTextVertAdjust;
+
// bitfield
+ unsigned mbFixedCellHeight : 1;
unsigned mbUnlimitedPage : 1; // force layout with no text break
unsigned mbCellText : 1; // this is a cell text as block text
unsigned mbWordWrap : 1; // for CustomShapes text layout
@@ -231,12 +229,18 @@ namespace drawinglayer
const SdrText* pSdrText,
const OutlinerParaObject& rOutlinerParaObjectPtr,
const basegfx::B2DHomMatrix& rTextRangeTransform,
+ SdrTextHorzAdjust aSdrTextHorzAdjust,
+ SdrTextVertAdjust aSdrTextVertAdjust,
+ bool bFixedCellHeight,
bool bUnlimitedPage,
bool bCellText,
bool bWordWrap);
// get data
const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; }
+ SdrTextHorzAdjust getSdrTextHorzAdjust() const { return maSdrTextHorzAdjust; }
+ SdrTextVertAdjust getSdrTextVertAdjust() const { return maSdrTextVertAdjust; }
+ bool isFixedCellHeight() const { return mbFixedCellHeight; }
bool getUnlimitedPage() const { return mbUnlimitedPage; }
bool getCellText() const { return mbCellText; }
bool getWordWrap() const { return mbWordWrap; }
@@ -265,6 +269,9 @@ namespace drawinglayer
// text range transformation from unit range ([0.0 .. 1.0]) to text range
basegfx::B2DHomMatrix maTextRangeTransform;
+ // bitfield
+ unsigned mbFixedCellHeight : 1;
+
protected:
// local decomposition.
virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
@@ -273,10 +280,12 @@ namespace drawinglayer
SdrStretchTextPrimitive2D(
const SdrText* pSdrText,
const OutlinerParaObject& rOutlinerParaObjectPtr,
- const basegfx::B2DHomMatrix& rTextRangeTransform);
+ const basegfx::B2DHomMatrix& rTextRangeTransform,
+ bool bFixedCellHeight);
// get data
const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; }
+ bool isFixedCellHeight() const { return mbFixedCellHeight; }
// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
diff --git a/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx b/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx
index 623158f21d68..d1b857f510c3 100644
--- a/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx
@@ -58,6 +58,7 @@
#define PRIMITIVE2D_ID_OVERLAYHELPLINESTRIPEDPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 19)
#define PRIMITIVE2D_ID_OVERLAYROLLINGRECTANGLEPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 20)
#define PRIMITIVE2D_ID_SDRCONTROLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 21)
+#define PRIMITIVE2D_ID_SDROLECONTENTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 22)
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/inc/svx/sdtfchim.hxx b/svx/inc/svx/sdtfchim.hxx
index e52296dfe579..d8fa20507980 100644
--- a/svx/inc/svx/sdtfchim.hxx
+++ b/svx/inc/svx/sdtfchim.hxx
@@ -32,28 +32,28 @@
#include <svx/svddef.hxx>
-class SdrTextFixedCellHeightItem : public SfxBoolItem
+class SVX_DLLPUBLIC SdrTextFixedCellHeightItem : public SfxBoolItem
{
public:
TYPEINFO();
SdrTextFixedCellHeightItem( BOOL bUseFixedCellHeight = FALSE );
- SdrTextFixedCellHeightItem( SvStream & rStream, sal_uInt16 nVersion );
+ SVX_DLLPRIVATE SdrTextFixedCellHeightItem( SvStream & rStream, sal_uInt16 nVersion );
- virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePresentation,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePresentation,
SfxMapUnit eCoreMetric, SfxMapUnit ePresentationMetric,
String &rText, const IntlWrapper * = 0) const;
- virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItem ) const;
- virtual SvStream& Store( SvStream&, sal_uInt16 nVersion ) const;
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
- virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItem ) const;
+ SVX_DLLPRIVATE virtual SvStream& Store( SvStream&, sal_uInt16 nVersion ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ SVX_DLLPRIVATE virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
#ifdef SDR_ISPOOLABLE
- virtual int IsPoolable() const;
+ SVX_DLLPRIVATE virtual int IsPoolable() const;
#endif
};
diff --git a/svx/inc/svx/svdetc.hxx b/svx/inc/svx/svdetc.hxx
index 493c8476c459..c0327d83457d 100644
--- a/svx/inc/svx/svdetc.hxx
+++ b/svx/inc/svx/svdetc.hxx
@@ -81,7 +81,7 @@ friend class SdrAttrObj;
Fraction aMapFraction;
private:
- SVX_DLLPRIVATE static SdrEngineDefaults& GetDefaults();
+ static SdrEngineDefaults& GetDefaults();
public:
SdrEngineDefaults();
@@ -272,7 +272,7 @@ protected:
public:
SdrLinkList(): aList(1024,4,4) {}
~SdrLinkList() { Clear(); }
- void Clear();
+ SVX_DLLPUBLIC void Clear();
unsigned GetLinkCount() const { return (unsigned)aList.Count(); }
Link& GetLink(unsigned nNum) { return *((Link*)(aList.GetObject(nNum))); }
const Link& GetLink(unsigned nNum) const { return *((Link*)(aList.GetObject(nNum))); }
@@ -299,7 +299,7 @@ class OLEObjCache : public Container
public:
OLEObjCache();
- ~OLEObjCache();
+ SVX_DLLPUBLIC ~OLEObjCache();
void SetSize(ULONG nNewSize);
void InsertObj(SdrOle2Obj* pObj);
@@ -309,6 +309,9 @@ public:
class SVX_DLLPUBLIC SdrGlobalData
{
+ const SvtSysLocale* pSysLocale; // follows always locale settings
+ const CharClass* pCharClass; // follows always SysLocale
+ const LocaleDataWrapper* pLocaleData; // follows always SysLocale
public:
SdrLinkList aUserMakeObjHdl;
SdrLinkList aUserMakeObjUserDataHdl;
@@ -317,10 +320,11 @@ public:
ResMgr* pResMgr;
ULONG nExchangeFormat;
OLEObjCache aOLEObjCache;
- const SvtSysLocale* pSysLocale; // follows always locale settings
- const CharClass* pCharClass; // follows always SysLocale
- const LocaleDataWrapper* pLocaleData; // follows always SysLocale
+
+ const SvtSysLocale* GetSysLocale(); // follows always locale settings
+ const CharClass* GetCharClass(); // follows always SysLocale
+ const LocaleDataWrapper* GetLocaleData(); // follows always SysLocale
public:
SdrGlobalData();
~SdrGlobalData();
diff --git a/svx/inc/svx/svdfppt.hxx b/svx/inc/svx/svdfppt.hxx
index 5a73bea5052f..63f196876e93 100644
--- a/svx/inc/svx/svdfppt.hxx
+++ b/svx/inc/svx/svdfppt.hxx
@@ -1337,6 +1337,8 @@ class PPTConvertOCXControls : public SvxMSConvertOCXControls
#define PPT_PST_NewlyAddedAtomByXP11008 11008
#define PPT_PST_NewlyAddedAtomByXP11010 11010
+#define PPT_PST_Comment10 12000
+#define PPT_PST_CommentAtom10 12001
#define PPT_PST_NewlyAddedAtomByXP12004 12004
#define PPT_PST_NewlyAddedAtomByXP12010 12010
#define PPT_PST_NewlyAddedAtomByXP12011 12011
diff --git a/svx/inc/svx/svdhdl.hxx b/svx/inc/svx/svdhdl.hxx
index 11d400b85b8a..4960323feeb7 100644
--- a/svx/inc/svx/svdhdl.hxx
+++ b/svx/inc/svx/svdhdl.hxx
@@ -58,7 +58,6 @@ class SdrHdlList;
class SdrMarkView;
class SdrObject;
class SdrPageView;
-class SdrHdlBitmapSet;
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -155,12 +154,6 @@ class SVX_DLLPUBLIC SdrHdl
friend class SdrMarkView; // fuer den Zugriff auf nObjHdlNum
friend class SdrHdlList;
- static SdrHdlBitmapSet* pSimpleSet;
- static SdrHdlBitmapSet* pModernSet;
-
- // #101928#
- static SdrHdlBitmapSet* pHighContrastSet;
-
// #101928#
BitmapEx ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd, sal_Bool bFine, sal_Bool bIsHighContrast);
diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx
index 34c16511aacb..2873b77ac2ea 100644
--- a/svx/inc/svx/svdmodel.hxx
+++ b/svx/inc/svx/svdmodel.hxx
@@ -689,7 +689,7 @@ public:
void SetModelStorage( SotStorage* pStor ) { pModelStorage = pStor; }
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoModel();
- void setUnoModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xModel ) { mxUnoModel = xModel; }
+ void setUnoModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xModel );
// these functions are used by the api to disable repaints during a
// set of api calls.
diff --git a/svx/inc/svx/svdoashp.hxx b/svx/inc/svx/svdoashp.hxx
index 1344bff74413..faf1aa7055aa 100644
--- a/svx/inc/svx/svdoashp.hxx
+++ b/svx/inc/svx/svdoashp.hxx
@@ -105,7 +105,7 @@ private:
// #i37011# render geometry shadow
SdrObject* mpLastShadowGeometry;
- static SVX_DLLPRIVATE com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeEngine > GetCustomShapeEngine( const SdrObjCustomShape* pCustomShape );
+ static com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeEngine > GetCustomShapeEngine( const SdrObjCustomShape* pCustomShape );
// SVX_DLLPRIVATE com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeHandle > >
// SdrObjCustomShape::GetInteraction( const SdrObjCustomShape* pCustomShape ) const;
@@ -134,7 +134,7 @@ public:
const SdrObject* GetSdrObjectShadowFromCustomShape() const;
sal_Bool GetTextBounds( Rectangle& rTextBound ) const;
sal_Bool IsTextPath() const;
- static SVX_DLLPRIVATE basegfx::B2DPolyPolygon GetLineGeometry( const SdrObjCustomShape* pCustomShape, const sal_Bool bBezierAllowed );
+ static basegfx::B2DPolyPolygon GetLineGeometry( const SdrObjCustomShape* pCustomShape, const sal_Bool bBezierAllowed );
protected:
diff --git a/svx/inc/svx/svdoedge.hxx b/svx/inc/svx/svdoedge.hxx
index 4fa4fd7c0d31..227afd9ab027 100644
--- a/svx/inc/svx/svdoedge.hxx
+++ b/svx/inc/svx/svdoedge.hxx
@@ -73,7 +73,7 @@ protected:
public:
SdrObjConnection() { ResetVars(); }
- ~SdrObjConnection();
+ SVX_DLLPUBLIC ~SdrObjConnection();
void ResetVars();
FASTBOOL TakeGluePoint(SdrGluePoint& rGP, FASTBOOL bSetAbsolutePos) const;
diff --git a/svx/inc/svx/svdoole2.hxx b/svx/inc/svx/svdoole2.hxx
index 605e9463bdab..2b5a19f7b60b 100644
--- a/svx/inc/svx/svdoole2.hxx
+++ b/svx/inc/svx/svdoole2.hxx
@@ -184,10 +184,8 @@ public:
sal_Bool CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHeight, Size& aObjAreaSize );
sal_Bool AddOwnLightClient();
- bool executeOldDoPaintPreparations(SdrPageView* pPageVew) const; //remove me with the next incompatible build
-
// handy to get the empty replacement bitmap without accessing all the old stuff
- Bitmap GetEmtyOLEReplacementBitmap() const;
+ static Bitmap GetEmtyOLEReplacementBitmap();
void SetWindow(const com::sun::star::uno::Reference < com::sun::star::awt::XWindow >& _xWindow);
};
diff --git a/svx/inc/svx/svdotext.hxx b/svx/inc/svx/svdotext.hxx
index 36afd7a670ab..6ffa4ab5bd22 100644
--- a/svx/inc/svx/svdotext.hxx
+++ b/svx/inc/svx/svdotext.hxx
@@ -259,7 +259,7 @@ protected:
// Flag for allowing text animation. Default is sal_true.
BOOL mbTextAnimationAllowed : 1;
- SVX_DLLPRIVATE SdrOutliner& ImpGetDrawOutliner() const;
+ SdrOutliner& ImpGetDrawOutliner() const;
private:
SVX_DLLPRIVATE void ImpCheckMasterCachable();
@@ -575,20 +575,19 @@ public:
public:
//////////////////////////////////////////////////////////////////////////////
// text primitive decomposition helpers
- bool impCheckSpellCheckForDecomposeTextPrimitive() const;
- bool impDecomposeContourTextPrimitive(
+ void impDecomposeContourTextPrimitive(
drawinglayer::primitive2d::Primitive2DSequence& rTarget,
const drawinglayer::primitive2d::SdrContourTextPrimitive2D& rSdrContourTextPrimitive,
const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
- bool impDecomposePathTextPrimitive(
+ void impDecomposePathTextPrimitive(
drawinglayer::primitive2d::Primitive2DSequence& rTarget,
const drawinglayer::primitive2d::SdrPathTextPrimitive2D& rSdrPathTextPrimitive,
const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
- bool impDecomposeBlockTextPrimitive(
+ void impDecomposeBlockTextPrimitive(
drawinglayer::primitive2d::Primitive2DSequence& rTarget,
const drawinglayer::primitive2d::SdrBlockTextPrimitive2D& rSdrBlockTextPrimitive,
const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
- bool impDecomposeStretchTextPrimitive(
+ void impDecomposeStretchTextPrimitive(
drawinglayer::primitive2d::Primitive2DSequence& rTarget,
const drawinglayer::primitive2d::SdrStretchTextPrimitive2D& rSdrStretchTextPrimitive,
const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
diff --git a/svx/inc/svx/svdpntv.hxx b/svx/inc/svx/svdpntv.hxx
index 8654e3a79db0..48523dc97c3b 100644
--- a/svx/inc/svx/svdpntv.hxx
+++ b/svx/inc/svx/svdpntv.hxx
@@ -109,7 +109,7 @@ namespace sdr
////////////////////////////////////////////////////////////////////////////////////////////////////
-class SvxViewHint : public SfxHint
+class SVX_DLLPUBLIC SvxViewHint : public SfxHint
{
public:
enum HintType { SVX_HINT_VIEWCHANGED };
diff --git a/svx/inc/svx/svdundo.hxx b/svx/inc/svx/svdundo.hxx
index 1b8c0f76b8b2..717b1a070c6f 100644
--- a/svx/inc/svx/svdundo.hxx
+++ b/svx/inc/svx/svdundo.hxx
@@ -484,6 +484,35 @@ public:
virtual bool CanSdrRepeat(SdrView& rView) const;
};
+// --> OD 2009-07-09 #i73249#
+class SdrUndoObjStrAttr : public SdrUndoObj
+{
+public:
+ enum ObjStrAttrType
+ {
+ OBJ_NAME,
+ OBJ_TITLE,
+ OBJ_DESCRIPTION
+ };
+
+protected:
+ const ObjStrAttrType meObjStrAttr;
+ const String msOldStr;
+ const String msNewStr;
+
+public:
+ SdrUndoObjStrAttr( SdrObject& rNewObj,
+ const ObjStrAttrType eObjStrAttr,
+ const String& sOldStr,
+ const String& sNewStr);
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual String GetComment() const;
+};
+// <--
+
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// @@ @@@@ @@ @@ @@@@@ @@@@@
@@ -754,7 +783,7 @@ protected:
SdrUndoPageMasterPage(SdrPage& rChangedPage);
public:
- virtual ~SdrUndoPageMasterPage();
+ SVX_DLLPUBLIC virtual ~SdrUndoPageMasterPage();
};
//************************************************************
@@ -827,6 +856,13 @@ public:
virtual SdrUndoAction* CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer );
virtual SdrUndoAction* CreateUndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText );
+ // --> OD 2009-07-09 #i73249#
+ virtual SdrUndoAction* CreateUndoObjectStrAttr( SdrObject& rObject,
+ SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType,
+ String sOldStr,
+ String sNewStr );
+ // <--
+
// layer
virtual SdrUndoAction* CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel);
virtual SdrUndoAction* CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel);
diff --git a/svx/inc/svx/svx3ditems.hxx b/svx/inc/svx/svx3ditems.hxx
index a77a9c3f8459..e956edb69803 100644
--- a/svx/inc/svx/svx3ditems.hxx
+++ b/svx/inc/svx/svx3ditems.hxx
@@ -48,12 +48,12 @@ public:
class Svx3DBackscaleItem : public SfxUInt16Item {
public:
- Svx3DBackscaleItem(sal_uInt16 nVal = 100);
+ SVX_DLLPUBLIC Svx3DBackscaleItem(sal_uInt16 nVal = 100);
};
class Svx3DDepthItem : public SfxUInt32Item {
public:
- Svx3DDepthItem(sal_uInt32 nVal = 1000);
+ SVX_DLLPUBLIC Svx3DDepthItem(sal_uInt32 nVal = 1000);
};
class SVX_DLLPUBLIC Svx3DHorizontalSegmentsItem : public SfxUInt32Item {
@@ -63,12 +63,12 @@ public:
class Svx3DVerticalSegmentsItem : public SfxUInt32Item {
public:
- Svx3DVerticalSegmentsItem(sal_uInt32 nVal = 24);
+ SVX_DLLPUBLIC Svx3DVerticalSegmentsItem(sal_uInt32 nVal = 24);
};
class Svx3DEndAngleItem : public SfxUInt32Item {
public:
- Svx3DEndAngleItem(sal_uInt32 nVal = 3600);
+ SVX_DLLPUBLIC Svx3DEndAngleItem(sal_uInt32 nVal = 3600);
};
class SVX_DLLPUBLIC Svx3DDoubleSidedItem : public SfxBoolItem {
@@ -85,29 +85,29 @@ public:
virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
};
-class Svx3DNormalsKindItem : public SfxUInt16Item {
+class SVX_DLLPUBLIC Svx3DNormalsKindItem : public SfxUInt16Item {
public:
Svx3DNormalsKindItem(sal_uInt16 nVal = 0);
// use drawing::NormalsKind
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
- virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+ SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
};
class Svx3DNormalsInvertItem : public SfxBoolItem {
public:
- Svx3DNormalsInvertItem(BOOL bVal = 0);
+ SVX_DLLPUBLIC Svx3DNormalsInvertItem(BOOL bVal = 0);
};
-class Svx3DTextureProjectionXItem : public SfxUInt16Item {
+class SVX_DLLPUBLIC Svx3DTextureProjectionXItem : public SfxUInt16Item {
public:
Svx3DTextureProjectionXItem(sal_uInt16 nVal = 0);
// use drawing::TextureProjectionMode
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
- virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+ SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
};
class SVX_DLLPUBLIC Svx3DTextureProjectionYItem : public SfxUInt16Item {
@@ -122,7 +122,7 @@ public:
class Svx3DShadow3DItem : public SfxBoolItem {
public:
- Svx3DShadow3DItem(BOOL bVal = 0);
+ SVX_DLLPUBLIC Svx3DShadow3DItem(BOOL bVal = 0);
};
class Svx3DMaterialColorItem : public SvxColorItem {
@@ -132,68 +132,68 @@ public:
class Svx3DMaterialEmissionItem : public SvxColorItem {
public:
- Svx3DMaterialEmissionItem(const Color& rCol = Color(0x00000000));
+ SVX_DLLPUBLIC Svx3DMaterialEmissionItem(const Color& rCol = Color(0x00000000));
};
class Svx3DMaterialSpecularItem : public SvxColorItem {
public:
- Svx3DMaterialSpecularItem(const Color& rCol = Color(0x00ffffff));
+ SVX_DLLPUBLIC Svx3DMaterialSpecularItem(const Color& rCol = Color(0x00ffffff));
};
class Svx3DMaterialSpecularIntensityItem : public SfxUInt16Item {
public:
- Svx3DMaterialSpecularIntensityItem(sal_uInt16 nVal = 15);
+ SVX_DLLPUBLIC Svx3DMaterialSpecularIntensityItem(sal_uInt16 nVal = 15);
};
-class Svx3DTextureKindItem : public SfxUInt16Item {
+class SVX_DLLPUBLIC Svx3DTextureKindItem : public SfxUInt16Item {
public:
Svx3DTextureKindItem(sal_uInt16 nVal = 3);
// use drawing::TextureKind
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
- virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+ SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
};
-class Svx3DTextureModeItem : public SfxUInt16Item {
+class SVX_DLLPUBLIC Svx3DTextureModeItem : public SfxUInt16Item {
public:
Svx3DTextureModeItem(sal_uInt16 nVal = 2);
// use drawing:TextureMode
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
- virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+ SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
};
class Svx3DTextureFilterItem : public SfxBoolItem {
public:
- Svx3DTextureFilterItem(BOOL bVal = 0);
+ SVX_DLLPUBLIC Svx3DTextureFilterItem(BOOL bVal = 0);
};
// Svx3D _3DSCENE_ Items
-class Svx3DPerspectiveItem : public SfxUInt16Item {
+class SVX_DLLPUBLIC Svx3DPerspectiveItem : public SfxUInt16Item {
public:
Svx3DPerspectiveItem(sal_uInt16 nVal = (sal_uInt16)PR_PERSPECTIVE);
// use drawing::ProjectionMode
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
- virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+ SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
};
class Svx3DDistanceItem : public SfxUInt32Item {
public:
- Svx3DDistanceItem(sal_uInt32 nVal = 100);
+ SVX_DLLPUBLIC Svx3DDistanceItem(sal_uInt32 nVal = 100);
};
class Svx3DFocalLengthItem : public SfxUInt32Item {
public:
- Svx3DFocalLengthItem(sal_uInt32 nVal = 100);
+ SVX_DLLPUBLIC Svx3DFocalLengthItem(sal_uInt32 nVal = 100);
};
class Svx3DTwoSidedLightingItem : public SfxBoolItem {
public:
- Svx3DTwoSidedLightingItem(BOOL bVal = 0);
+ SVX_DLLPUBLIC Svx3DTwoSidedLightingItem(BOOL bVal = 0);
};
class SVX_DLLPUBLIC Svx3DLightcolor1Item : public SvxColorItem {
@@ -323,17 +323,17 @@ public:
class Svx3DShadowSlantItem : public SfxUInt16Item {
public:
- Svx3DShadowSlantItem(sal_uInt16 nVal = 0);
+ SVX_DLLPUBLIC Svx3DShadowSlantItem(sal_uInt16 nVal = 0);
};
-class Svx3DShadeModeItem : public SfxUInt16Item {
+class SVX_DLLPUBLIC Svx3DShadeModeItem : public SfxUInt16Item {
public:
Svx3DShadeModeItem(sal_uInt16 nVal = 2);
// use drawing::ShadeMode
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
- virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+ SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
};
//////////////////////////////////////////////////////////////////////////////
@@ -362,19 +362,19 @@ public:
};
// #107245# Item to replace bExtrudeCloseFront and bLatheCloseFront
-class Svx3DCloseFrontItem : public SfxBoolItem {
+class SVX_DLLPUBLIC Svx3DCloseFrontItem : public SfxBoolItem {
public:
Svx3DCloseFrontItem(BOOL bVal = 1);
- virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
- virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
+ SVX_DLLPRIVATE virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
};
// #107245# Item to replace bExtrudeCloseBack and bLatheCloseBack
-class Svx3DCloseBackItem : public SfxBoolItem {
+class SVX_DLLPUBLIC Svx3DCloseBackItem : public SfxBoolItem {
public:
Svx3DCloseBackItem(BOOL bVal = 1);
- virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
- virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
+ SVX_DLLPRIVATE virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
};
#endif // _SVX3DITEMS_HXX
diff --git a/svx/inc/svx/svxdlg.hxx b/svx/inc/svx/svxdlg.hxx
index 233c7956f18a..e4b3b6152022 100644
--- a/svx/inc/svx/svxdlg.hxx
+++ b/svx/inc/svx/svxdlg.hxx
@@ -347,6 +347,13 @@ public:
virtual sal_Int32 getColumns() const = 0;
};
+class SvxAbstractInsRowColDlg : public VclAbstractDialog
+{
+public:
+ virtual bool isInsertBefore() const = 0;
+ virtual sal_uInt16 getInsertCount() const = 0;
+};
+
//-------------------------------------------------------------
class SVX_DLLPUBLIC SvxAbstractDialogFactory : public SfxAbstractDialogFactory
@@ -543,6 +550,8 @@ public:
virtual SvxAbstractSplittTableDialog* CreateSvxSplittTableDialog( Window* pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal )=0;
virtual SvxAbstractNewTableDialog* CreateSvxNewTableDialog( Window* pParent ) = 0;
+
+ virtual SvxAbstractInsRowColDlg* CreateSvxInsRowColDlg( Window* pParent, bool bCol, ULONG nHelpId ) = 0;
};
#endif
diff --git a/svx/inc/svx/svxfont.hxx b/svx/inc/svx/svxfont.hxx
index b0165d73f978..cab43c06628c 100644
--- a/svx/inc/svx/svxfont.hxx
+++ b/svx/inc/svx/svxfont.hxx
@@ -70,7 +70,8 @@ public:
inline void SetCaseMap( const SvxCaseMap eNew ) { eCaseMap = eNew; }
inline LanguageType GetLanguage() const { return eLang; }
- inline void SetLanguage( const LanguageType eNewLan ) { eLang = eNewLan; }
+ inline void SetLanguage( const LanguageType eNewLan )
+ { eLang = eNewLan; Font::SetLanguage(eNewLan); }
// Is-Methoden:
inline BOOL IsCaseMap() const { return SVX_CASEMAP_NOT_MAPPED != eCaseMap; }
diff --git a/svx/inc/svx/svxids.hrc b/svx/inc/svx/svxids.hrc
index 6ed62ada704d..900250a4ed8b 100644
--- a/svx/inc/svx/svxids.hrc
+++ b/svx/inc/svx/svxids.hrc
@@ -377,7 +377,6 @@
#define SID_FRAME_UP (SID_SC_START + 407)
#define SID_FRAME_DOWN (SID_SC_START + 408)
#define SID_ENTER_STRING (SID_SC_START + 476)
-#define SID_INSERT_POSTIT (SID_SC_START + 276)
#define SID_ATTR_SECIALCHAR (SID_SC_START + 581)
#define SID_ATTR_SPECIALCHAR (SID_SC_START + 581)
@@ -831,7 +830,11 @@
#define SID_OFASLOTS_START ( SID_SVX_START + 425 )
//#define SID_SD_AUTOPILOT ( SID_SVX_START + 425 ) -> sfxsids.hrc
#define SID_AUTOPILOT SID_SD_AUTOPILOT
-// 4 defines of Writer's old wizards have been removed here
+
+#define SID_TABLE_INSERT_COL_DLG ( SID_SVX_START + 426 )
+#define SID_TABLE_INSERT_ROW_DLG ( SID_SVX_START + 427 )
+#define SID_TABLE_PARAM_INSERT_AFTER ( SID_SVX_START + 428 )
+
#define SID_TABLEDESIGN ( SID_SVX_START + 429 )
#define SID_MN_AUTOPILOT ( SID_SVX_START + 430 )
#define SID_GENERAL_OPTIONS ( SID_SVX_START + 432 )
@@ -1174,7 +1177,6 @@
#define SID_ATTR_CHAR_WIDTH_FIT_TO_LINE ( SID_SVX_START + 919 )
#define SID_ATTR_CHAR_RELIEF ( SID_SVX_START + 920 )
#define SID_LANGUAGE_OPTIONS ( SID_SVX_START + 921 )
-#define SID_CLIPBOARD_FORMAT_ITEMS ( SID_SVX_START + 922 )
#define SID_GETUNDOSTRINGS ( SID_SVX_START + 923 )
#define SID_GETREDOSTRINGS ( SID_SVX_START + 924 )
#define SID_PARA_VERTALIGN ( SID_SVX_START + 925 )
@@ -1350,10 +1352,18 @@
#define SID_TRANSLITERATE_SENTENCE_CASE (SID_SVX_START+1093)
#define SID_TRANSLITERATE_TITLE_CASE (SID_SVX_START+1094)
#define SID_TRANSLITERATE_TOGGLE_CASE (SID_SVX_START+1095)
-
+#define SID_INSERT_POSTIT (SID_SVX_START+1096)
+#define SID_DELETE_POSTIT (SID_SVX_START+1097)
+#define SID_NEXT_POSTIT (SID_SVX_START+1098)
+#define SID_PREVIOUS_POSTIT (SID_SVX_START+1099)
+#define SID_DELETEALL_POSTIT (SID_SVX_START+1100)
+#define SID_SHOW_POSTIT (SID_SVX_START+1101)
+#define SID_REPLYTO_POSTIT (SID_SVX_START+1102)
+#define SID_DELETEALLBYAUTHOR_POSTIT (SID_SVX_START+1103)
+#define SID_OBJECT_MIRROR (SID_SVX_START+1104)
// IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
-#define SID_SVX_FIRSTFREE SID_TRANSLITERATE_TOGGLE_CASE + 1
+#define SID_SVX_FIRSTFREE SID_OBJECT_MIRROR + 1
// --------------------------------------------------------------------------
// Overflow check for slot IDs
diff --git a/svx/inc/svx/sxfiitm.hxx b/svx/inc/svx/sxfiitm.hxx
index 27690098aad6..3228dee660e7 100644
--- a/svx/inc/svx/sxfiitm.hxx
+++ b/svx/inc/svx/sxfiitm.hxx
@@ -40,7 +40,7 @@
class SdrFractionItem: public SfxPoolItem {
Fraction nValue;
public:
- TYPEINFO();
+ TYPEINFO_VISIBILITY( SVX_DLLPUBLIC );
SdrFractionItem(USHORT nId=0): SfxPoolItem(nId) {}
SdrFractionItem(USHORT nId, const Fraction& rVal): SfxPoolItem(nId), nValue(rVal) {}
SdrFractionItem(USHORT nId, SvStream& rIn);
diff --git a/svx/inc/svx/tstpitem.hxx b/svx/inc/svx/tstpitem.hxx
index c8333252b8f0..58c9a6400aed 100644
--- a/svx/inc/svx/tstpitem.hxx
+++ b/svx/inc/svx/tstpitem.hxx
@@ -53,11 +53,13 @@ private:
long nTabPos;
SvxTabAdjust eAdjustment;
- sal_Unicode cDecimal;
+ mutable sal_Unicode m_cDecimal;
sal_Unicode cFill;
SVX_DLLPRIVATE friend SvStream& operator<<( SvStream&, SvxTabStop& );
+ void fillDecimal() const;
+
public:
SvxTabStop();
#if (_MSC_VER < 1300)
@@ -78,8 +80,8 @@ public:
SvxTabAdjust& GetAdjustment() { return eAdjustment; }
SvxTabAdjust GetAdjustment() const { return eAdjustment; }
- sal_Unicode& GetDecimal() { return cDecimal; }
- sal_Unicode GetDecimal() const { return cDecimal; }
+ sal_Unicode& GetDecimal() { fillDecimal(); return m_cDecimal; }
+ sal_Unicode GetDecimal() const { fillDecimal(); return m_cDecimal; }
sal_Unicode& GetFill() { return cFill; }
sal_Unicode GetFill() const { return cFill; }
@@ -91,7 +93,7 @@ public:
{
return ( nTabPos == rTS.nTabPos &&
eAdjustment == rTS.eAdjustment &&
- cDecimal == rTS.cDecimal &&
+ m_cDecimal == rTS.m_cDecimal &&
cFill == rTS.cFill );
}
@@ -105,7 +107,7 @@ public:
{
nTabPos = rTS.nTabPos;
eAdjustment = rTS.eAdjustment;
- cDecimal = rTS.cDecimal;
+ m_cDecimal = rTS.m_cDecimal;
cFill = rTS.cFill;
return *this;
}
diff --git a/svx/inc/svx/unoedsrc.hxx b/svx/inc/svx/unoedsrc.hxx
index 3eafa5795893..a4777b6469b4 100644
--- a/svx/inc/svx/unoedsrc.hxx
+++ b/svx/inc/svx/unoedsrc.hxx
@@ -31,6 +31,8 @@
#ifndef _SVX_UNOEDSRC_HXX
#define _SVX_UNOEDSRC_HXX
+#include <com/sun/star/accessibility/TextSegment.hpp>
+
#include <tools/solar.h>
#include <i18npool/lang.h>
#include <tools/link.hxx>
@@ -358,6 +360,36 @@ public:
*/
virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const = 0;
+ /** Query bounds of line in paragraph
+
+ @param rStart [output param; 0 .. text_len]
+ The index in the paragraph text that belongs to the chara at the start of the line
+
+ @param rEnd [output param; 0 .. text_len]
+ The index in the paragraph text that follows the last chara in the line
+
+ @param nParagraph[0 .. n-1]
+ Index of paragraph to query line length in
+
+ @param nLine[0 .. m-1]
+ Index of line in paragraph to query line length of
+
+ */
+ virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const = 0;
+
+ /** Query the line number for a index in the paragraphs text
+
+ @param nPara[0 .. n-1]
+ Index of paragraph to query line length in
+
+ @param nIndex[0 .. m-1]
+ Index of of the chara in the paragraph text
+
+ @returns [0 .. k-1]
+ The line number of the chara in the paragraph
+ */
+ virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const = 0;
+
/** Delete given text range and reformat text
@param rSelection
diff --git a/svx/inc/svx/unofored.hxx b/svx/inc/svx/unofored.hxx
index e912e5e4e593..a9c72f766a35 100644
--- a/svx/inc/svx/unofored.hxx
+++ b/svx/inc/svx/unofored.hxx
@@ -81,6 +81,8 @@ public:
virtual sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const;
virtual USHORT GetLineCount( USHORT nPara ) const;
virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const;
+ virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const;
+ virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( BOOL bFull=FALSE );
diff --git a/svx/inc/svx/unoforou.hxx b/svx/inc/svx/unoforou.hxx
index 91ef33cae3b7..75adcc620a47 100644
--- a/svx/inc/svx/unoforou.hxx
+++ b/svx/inc/svx/unoforou.hxx
@@ -102,6 +102,8 @@ public:
virtual sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const;
virtual USHORT GetLineCount( USHORT nPara ) const;
virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const;
+ virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nPara, USHORT nLine ) const;
+ virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( BOOL bFull=FALSE );
diff --git a/svx/inc/svx/unoprov.hxx b/svx/inc/svx/unoprov.hxx
index 319a587b59ff..ebe1e375f58c 100644
--- a/svx/inc/svx/unoprov.hxx
+++ b/svx/inc/svx/unoprov.hxx
@@ -166,7 +166,7 @@ namespace comphelper { class PropertySetInfo; }
class SvxPropertySetInfoPool
{
public:
- static comphelper::PropertySetInfo* getOrCreate( sal_Int32 nServiceId ) throw();
+ SVX_DLLPUBLIC static comphelper::PropertySetInfo* getOrCreate( sal_Int32 nServiceId ) throw();
private:
static comphelper::PropertySetInfo* mpInfos[SVXUNO_SERVICEID_LASTID+1];
diff --git a/svx/inc/svx/unoshtxt.hxx b/svx/inc/svx/unoshtxt.hxx
index e8d8e2b76f6c..6027191d222e 100644
--- a/svx/inc/svx/unoshtxt.hxx
+++ b/svx/inc/svx/unoshtxt.hxx
@@ -35,9 +35,14 @@
#include <svx/unoedsrc.hxx>
#include "svx/svxdllapi.h"
-namespace com { namespace sun { namespace star { namespace uno {
- class XInterface;
-} } } }
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XInterface;
+ }
+ namespace accessibility {
+ struct TextSegment;
+ }
+} } }
class SvxTextForwarder;
class SdrObject;
@@ -80,7 +85,7 @@ public:
// static sal_Bool hasLevels( const SdrObject* pObject );
- // the viewforwarder interface
+ // the SvxViewForwarder interface
virtual BOOL IsValid() const;
virtual Rectangle GetVisArea() const;
virtual Point LogicToPixel( const Point&, const MapMode& ) const;
diff --git a/svx/inc/svx/unotext.hxx b/svx/inc/svx/unotext.hxx
index 1a5b446be144..63ce0a28b739 100644
--- a/svx/inc/svx/unotext.hxx
+++ b/svx/inc/svx/unotext.hxx
@@ -231,6 +231,8 @@ public:
virtual sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const;
virtual USHORT GetLineCount( USHORT nPara ) const;
virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const;
+ virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const;
+ virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( BOOL bFull=FALSE );
@@ -673,9 +675,9 @@ public:
};
-const SvxItemPropertySet* ImplGetSvxUnoOutlinerTextCursorSvxPropertySet();
-const SfxItemPropertyMapEntry* ImplGetSvxUnoOutlinerTextCursorPropertyMap();
-const SvxItemPropertySet* ImplGetSvxTextPortionSvxPropertySet();
-const SfxItemPropertyMapEntry* ImplGetSvxTextPortionPropertyMap();
+SVX_DLLPUBLIC const SvxItemPropertySet* ImplGetSvxUnoOutlinerTextCursorSvxPropertySet();
+SVX_DLLPUBLIC const SfxItemPropertyMapEntry* ImplGetSvxUnoOutlinerTextCursorPropertyMap();
+SVX_DLLPUBLIC const SvxItemPropertySet* ImplGetSvxTextPortionSvxPropertySet();
+SVX_DLLPUBLIC const SfxItemPropertyMapEntry* ImplGetSvxTextPortionPropertyMap();
#endif
diff --git a/svx/inc/svx/xflbckit.hxx b/svx/inc/svx/xflbckit.hxx
index 8f4de04218df..2744982b8639 100644
--- a/svx/inc/svx/xflbckit.hxx
+++ b/svx/inc/svx/xflbckit.hxx
@@ -46,13 +46,13 @@ public:
TYPEINFO();
XFillBackgroundItem( BOOL bFill = FALSE );
- XFillBackgroundItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBackgroundItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
diff --git a/svx/inc/svx/xflbmpit.hxx b/svx/inc/svx/xflbmpit.hxx
index ff15f038dcd3..42117613cba4 100644
--- a/svx/inc/svx/xflbmpit.hxx
+++ b/svx/inc/svx/xflbmpit.hxx
@@ -45,18 +45,18 @@ class SVX_DLLPUBLIC XFillBmpPosItem : public SfxEnumItem
public:
TYPEINFO();
XFillBmpPosItem( RECT_POINT eRP = RP_MM );
- XFillBmpPosItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBmpPosItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
- virtual USHORT GetValueCount() const;
- RECT_POINT GetValue() const { return (RECT_POINT) SfxEnumItem::GetValue(); }
+ SVX_DLLPRIVATE virtual USHORT GetValueCount() const;
+ SVX_DLLPRIVATE RECT_POINT GetValue() const { return (RECT_POINT) SfxEnumItem::GetValue(); }
};
diff --git a/svx/inc/svx/xflbmsli.hxx b/svx/inc/svx/xflbmsli.hxx
index f57f4dc811d1..332bbf9792b7 100644
--- a/svx/inc/svx/xflbmsli.hxx
+++ b/svx/inc/svx/xflbmsli.hxx
@@ -45,12 +45,12 @@ class SVX_DLLPUBLIC XFillBmpSizeLogItem : public SfxBoolItem
public:
TYPEINFO();
XFillBmpSizeLogItem( BOOL bLog = TRUE );
- XFillBmpSizeLogItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBmpSizeLogItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
diff --git a/svx/inc/svx/xflbmsxy.hxx b/svx/inc/svx/xflbmsxy.hxx
index c9da8290daa0..78263dd2c5e3 100644
--- a/svx/inc/svx/xflbmsxy.hxx
+++ b/svx/inc/svx/xflbmsxy.hxx
@@ -45,12 +45,12 @@ class SVX_DLLPUBLIC XFillBmpSizeXItem : public SfxMetricItem
public:
TYPEINFO();
XFillBmpSizeXItem( long nSizeX = 0 );
- XFillBmpSizeXItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBmpSizeXItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
@@ -58,7 +58,7 @@ public:
// Dieses Item nimmt sowohl metrische als auch
// Prozentwerte ( sind negativ ) auf; das muessen
// wir hier beruecksichtigen
- virtual FASTBOOL HasMetrics() const;
+ SVX_DLLPRIVATE virtual FASTBOOL HasMetrics() const;
};
/*************************************************************************
@@ -72,12 +72,12 @@ class SVX_DLLPUBLIC XFillBmpSizeYItem : public SfxMetricItem
public:
TYPEINFO();
XFillBmpSizeYItem( long nSizeY = 0 );
- XFillBmpSizeYItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBmpSizeYItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
@@ -85,7 +85,7 @@ public:
// Dieses Item nimmt sowohl metrische als auch
// Prozentwerte ( sind negativ ) auf; das muessen
// wir hier beruecksichtigen
- virtual FASTBOOL HasMetrics() const;
+ SVX_DLLPRIVATE virtual FASTBOOL HasMetrics() const;
};
#endif
diff --git a/svx/inc/svx/xflboxy.hxx b/svx/inc/svx/xflboxy.hxx
index 6e9024399ef0..9f0c37f9b6b3 100644
--- a/svx/inc/svx/xflboxy.hxx
+++ b/svx/inc/svx/xflboxy.hxx
@@ -45,12 +45,12 @@ class SVX_DLLPUBLIC XFillBmpPosOffsetXItem : public SfxUInt16Item
public:
TYPEINFO();
XFillBmpPosOffsetXItem( USHORT nOffPosX = 0 );
- XFillBmpPosOffsetXItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBmpPosOffsetXItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
@@ -68,12 +68,12 @@ class SVX_DLLPUBLIC XFillBmpPosOffsetYItem : public SfxUInt16Item
public:
TYPEINFO();
XFillBmpPosOffsetYItem( USHORT nOffPosY = 0 );
- XFillBmpPosOffsetYItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBmpPosOffsetYItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
diff --git a/svx/inc/svx/xflbtoxy.hxx b/svx/inc/svx/xflbtoxy.hxx
index e01eb79ff146..828435432bb1 100644
--- a/svx/inc/svx/xflbtoxy.hxx
+++ b/svx/inc/svx/xflbtoxy.hxx
@@ -45,12 +45,12 @@ class SVX_DLLPUBLIC XFillBmpTileOffsetXItem : public SfxUInt16Item
public:
TYPEINFO();
XFillBmpTileOffsetXItem( USHORT nOffX = 0 );
- XFillBmpTileOffsetXItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBmpTileOffsetXItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
@@ -68,12 +68,12 @@ class SVX_DLLPUBLIC XFillBmpTileOffsetYItem : public SfxUInt16Item
public:
TYPEINFO();
XFillBmpTileOffsetYItem( USHORT nOffX = 0 );
- XFillBmpTileOffsetYItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBmpTileOffsetYItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
diff --git a/svx/inc/svx/xsflclit.hxx b/svx/inc/svx/xsflclit.hxx
index 0b065597fc8f..802d247180a8 100644
--- a/svx/inc/svx/xsflclit.hxx
+++ b/svx/inc/svx/xsflclit.hxx
@@ -36,24 +36,24 @@
//------------------------------
// class XSecondaryFillColorItem
//------------------------------
-class XSecondaryFillColorItem : public XColorItem
+class SVX_DLLPUBLIC XSecondaryFillColorItem : public XColorItem
{
public:
TYPEINFO();
- XSecondaryFillColorItem() {}
- XSecondaryFillColorItem(INT32 nIndex, const Color& rTheColor);
+ SVX_DLLPRIVATE XSecondaryFillColorItem() {}
+ SVX_DLLPRIVATE XSecondaryFillColorItem(INT32 nIndex, const Color& rTheColor);
XSecondaryFillColorItem(const String& rName, const Color& rTheColor);
- XSecondaryFillColorItem(SvStream& rIn);
+ SVX_DLLPRIVATE XSecondaryFillColorItem(SvStream& rIn);
- virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
- virtual SfxPoolItem* Create(SvStream& rIn, USHORT nVer) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create(SvStream& rIn, USHORT nVer) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
- virtual USHORT GetVersion( USHORT nFileFormatVersion ) const;
+ SVX_DLLPRIVATE virtual USHORT GetVersion( USHORT nFileFormatVersion ) const;
};
diff --git a/svx/inc/unoapi.hxx b/svx/inc/unoapi.hxx
index 128e11d5dc77..afd6cbec14a9 100644
--- a/svx/inc/unoapi.hxx
+++ b/svx/inc/unoapi.hxx
@@ -97,12 +97,12 @@ SVX_DLLPUBLIC sal_Bool SvxFieldUnitToMeasureUnit( const short nVcl, short& eApi
/** if the given name is a predefined name for the current language it is replaced by
the corresponding api name.
*/
-void SvxUnogetApiNameForItem( const sal_Int16 nWhich, const String& rInternalName, rtl::OUString& rApiName ) throw();
+SVX_DLLPUBLIC void SvxUnogetApiNameForItem( const sal_Int16 nWhich, const String& rInternalName, rtl::OUString& rApiName ) throw();
/** if the given name is a predefined api name it is replaced by the predefined name
for the current language.
*/
-void SvxUnogetInternalNameForItem( const sal_Int16 nWhich, const rtl::OUString& rApiName, String& rInternalName ) throw();
+SVX_DLLPUBLIC void SvxUnogetInternalNameForItem( const sal_Int16 nWhich, const rtl::OUString& rApiName, String& rInternalName ) throw();
/** returns the which id for the given property name. This only works for
properties of shapes (map SVXMAP_SHAPE is used for searching)
@@ -115,10 +115,10 @@ void SvxUnogetInternalNameForItem( const sal_Int16 nWhich, const rtl::OUString&
//SVX_DLLPUBLIC sal_Int16 SvxUnoGetWhichIdForNamedProperty( const ::rtl::OUString & rPropName );
/** converts the given any with a metric to 100th/mm if needed */
-void SvxUnoConvertToMM( const SfxMapUnit eSourceMapUnit, com::sun::star::uno::Any & rMetric ) throw();
+SVX_DLLPUBLIC void SvxUnoConvertToMM( const SfxMapUnit eSourceMapUnit, com::sun::star::uno::Any & rMetric ) throw();
/** converts the given any with a metric from 100th/mm to the given metric if needed */
-void SvxUnoConvertFromMM( const SfxMapUnit eDestinationMapUnit, com::sun::star::uno::Any & rMetric ) throw();
+SVX_DLLPUBLIC void SvxUnoConvertFromMM( const SfxMapUnit eDestinationMapUnit, com::sun::star::uno::Any & rMetric ) throw();
#endif // _SVX_UNOAPI_HXX_
diff --git a/svx/inc/unoedhlp.hxx b/svx/inc/unoedhlp.hxx
index 83e8d52034d0..b732ba867af1 100644
--- a/svx/inc/unoedhlp.hxx
+++ b/svx/inc/unoedhlp.hxx
@@ -49,7 +49,7 @@ class EditEngine;
case denotes the destination position, the two parameters the
start and the end of the moved paragraph range.
*/
-class SvxEditSourceHint : public TextHint
+class SVX_DLLPUBLIC SvxEditSourceHint : public TextHint
{
private:
ULONG mnStart;
diff --git a/svx/inc/unolingu.hxx b/svx/inc/unolingu.hxx
index d81fe9177587..8dc76a291ceb 100644
--- a/svx/inc/unolingu.hxx
+++ b/svx/inc/unolingu.hxx
@@ -67,7 +67,7 @@ class SvxLinguConfigUpdate
public:
- static void UpdateAll( sal_Bool bForceCheck = sal_False );
+ SVX_DLLPUBLIC static void UpdateAll( sal_Bool bForceCheck = sal_False );
static BOOL IsNeedUpdateAll( sal_Bool bForceCheck = sal_False );
};
diff --git a/svx/inc/xexch.hxx b/svx/inc/xexch.hxx
index cd44f82cfd85..4042303be3ae 100644
--- a/svx/inc/xexch.hxx
+++ b/svx/inc/xexch.hxx
@@ -60,7 +60,7 @@ public:
// Zuweisungsoperator
XFillExchangeData& operator=( const XFillExchangeData& rXFillExchangeData );
- friend SvStream& operator<<( SvStream& rOStm, const XFillExchangeData& rXFillExchangeData );
+ SVX_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStm, const XFillExchangeData& rXFillExchangeData );
SVX_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, XFillExchangeData& rXFillExchangeData );
static ULONG RegisterClipboardFormatName();
diff --git a/svx/inc/xmlgrhlp.hxx b/svx/inc/xmlgrhlp.hxx
index f36733706ab5..77e6eb0be322 100644
--- a/svx/inc/xmlgrhlp.hxx
+++ b/svx/inc/xmlgrhlp.hxx
@@ -95,7 +95,7 @@ private:
SVX_DLLPRIVATE sal_Bool ImplWriteGraphic( const ::rtl::OUString& rPictureStorageName,
const ::rtl::OUString& rPictureStreamName,
const ::rtl::OUString& rGraphicId );
- SVX_DLLPRIVATE void ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, sal_uInt32 nInsertPos );
+ SVX_DLLPRIVATE void ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, sal_uInt32 nInsertPos, rtl::OUString& rRequestedFileName );
protected:
SvXMLGraphicHelper();
@@ -142,9 +142,9 @@ namespace svx
uses eCreateMode == GRAPHICHELPER_MODE_READ, bDirect == TRUE in
SvXMLGraphicHelper
*/
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvXMLGraphicImportHelper_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL SvXMLGraphicImportHelper_getSupportedServiceNames() throw();
-::rtl::OUString SAL_CALL SvXMLGraphicImportHelper_getImplementationName() throw();
+SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvXMLGraphicImportHelper_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
+SVX_DLLPUBLIC ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL SvXMLGraphicImportHelper_getSupportedServiceNames() throw();
+SVX_DLLPUBLIC ::rtl::OUString SAL_CALL SvXMLGraphicImportHelper_getImplementationName() throw();
/** Create this with createInstanceWithArguments. service name
"com.sun.star.comp.Svx.GraphicExportHelper", one argument which is the
@@ -158,9 +158,9 @@ namespace svx
uses eCreateMode == GRAPHICHELPER_MODE_WRITE, bDirect == TRUE in
SvXMLGraphicHelper
*/
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvXMLGraphicExportHelper_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL SvXMLGraphicExportHelper_getSupportedServiceNames() throw();
-::rtl::OUString SAL_CALL SvXMLGraphicExportHelper_getImplementationName() throw();
+SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvXMLGraphicExportHelper_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
+SVX_DLLPUBLIC ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL SvXMLGraphicExportHelper_getSupportedServiceNames() throw();
+SVX_DLLPUBLIC ::rtl::OUString SAL_CALL SvXMLGraphicExportHelper_getImplementationName() throw();
}
#endif
diff --git a/svx/inc/xoutbmp.hxx b/svx/inc/xoutbmp.hxx
index 3cefd9b60f1f..6bbbb0b1073a 100644
--- a/svx/inc/xoutbmp.hxx
+++ b/svx/inc/xoutbmp.hxx
@@ -95,6 +95,6 @@ public:
// - DitherBitmap -
// ----------------
-BOOL DitherBitmap( Bitmap& rBitmap );
+SVX_DLLPUBLIC BOOL DitherBitmap( Bitmap& rBitmap );
#endif // _XOUTBMP_HXX
diff --git a/svx/prj/d.lst b/svx/prj/d.lst
index 147cfd57d862..7edc2fbc9c11 100644
--- a/svx/prj/d.lst
+++ b/svx/prj/d.lst
@@ -10,7 +10,7 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\global\accelerator\es
..\%__SRC%\inc\svxslots.ilb %_DEST%\inc%_EXT%\svxslots.ilb
..\%__SRC%\inc\*.ilb* %_DEST%\inc%_EXT%\*.ilb*
..\%__SRC%\lib\lib*.* %_DEST%\lib%_EXT%\lib*.*
-..\%__SRC%\lib\isvx.lib %_DEST%\lib%_EXT%\isvx.lib
+..\%__SRC%\lib\isvx*.lib %_DEST%\lib%_EXT%\isvx*.lib
..\%__SRC%\bin\gengal* %_DEST%\bin%_EXT%\gengal*
..\%__SRC%\bin\gengalrc %_DEST%\bin%_EXT%\gengal.ini
..\%__SRC%\bin\cui*.dll %_DEST%\bin%_EXT%\cui*.dll
@@ -554,6 +554,8 @@ mkdir: %_DEST%\inc%_EXT%\svx
..\inc\svx\SmartTagCtl.hxx %_DEST%\inc%_EXT%\svx\SmartTagCtl.hxx
..\inc\svx\databaselocationinput.hxx %_DEST%\inc%_EXT%\svx\databaselocationinput.hxx
..\inc\xlinjoit.hxx %_DEST%\inc%_EXT%\svx\xlinjoit.hxx
+..\inc\svx\dbcharsethelper.hxx %_DEST%\inc%_EXT%\svx\dbcharsethelper.hxx
+..\inc\svx\dbtoolsclient.hxx %_DEST%\inc%_EXT%\svx\dbtoolsclient.hxx
mkdir: %_DEST%\inc%_EXT%\svx\sdr
mkdir: %_DEST%\inc%_EXT%\svx\sdr\properties
@@ -604,6 +606,7 @@ mkdir: %_DEST%\inc%_EXT%\svx\sdr\overlay
..\inc\svx\sdr\overlay\overlaypolypolygon.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaypolypolygon.hxx
..\inc\svx\sdr\overlay\overlayobjectcell.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayobjectcell.hxx
..\inc\svx\sdr\overlay\overlayprimitive2dsequenceobject.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayprimitive2dsequenceobject.hxx
+..\inc\svx\sdr\overlay\overlayselection.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayselection.hxx
..\inc\svx\sdr\overlay\overlaytools.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaytools.hxx
mkdir: %_DEST%\inc%_EXT%\svx\sdr\animation
diff --git a/svx/sdi/makefile.mk b/svx/sdi/makefile.mk
index 60f3cc3fb5c3..2ea64ddedbba 100644
--- a/svx/sdi/makefile.mk
+++ b/svx/sdi/makefile.mk
@@ -39,6 +39,8 @@ TARGET=svxslots
.INCLUDE : settings.mk
+.IF "$(L10N_framework)"==""
+
SDI1NAME=$(TARGET)
SDI1EXPORT=svx
@@ -53,6 +55,6 @@ SVSDI1DEPEND= \
svxitems.sdi
# --- Targets -------------------------------------------------------
-
+.ENDIF
.INCLUDE : target.mk
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 1a3b39b26eff..b414195457bc 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -2049,34 +2049,6 @@ SfxVoidItem ClearOutline SID_OUTLINE_DELETEALL
]
//--------------------------------------------------------------------------
-SfxVoidItem ClipboardFormatItems SID_CLIPBOARD_FORMAT_ITEMS
-(SfxUInt32Item SelectedFormat SID_CLIPBOARD_FORMAT_ITEMS)
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = TRUE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- /* status: */
- SlotType = SvxClipboardFmtItem
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = FALSE,
- GroupId = GID_EDIT;
-]
-
-//--------------------------------------------------------------------------
SvxColorItem Color SID_ATTR_CHAR_COLOR
[
@@ -3872,7 +3844,7 @@ SfxObjectItem FmFilterNavigatorController SID_FM_FILTER_NAVIGATOR_CONTROL
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -4881,7 +4853,7 @@ SfxStringListItem GetRedoStrings SID_GETREDOSTRINGS
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = TRUE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -4908,7 +4880,7 @@ SfxStringListItem GetUndoStrings SID_GETUNDOSTRINGS
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = TRUE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -6057,6 +6029,185 @@ SfxVoidItem InsertAnnotation SID_INSERT_POSTIT
]
//--------------------------------------------------------------------------
+SfxBoolItem ShowAnnotation SID_SHOW_POSTIT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+
+SfxVoidItem ReplyToAnnotation SID_REPLYTO_POSTIT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ 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_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+
+SfxVoidItem DeleteAnnotation SID_DELETE_POSTIT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+
+SfxVoidItem DeleteAllAnnotation SID_DELETEALL_POSTIT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+SfxVoidItem DeleteAllAnnotationByAuthor SID_DELETEALLBYAUTHOR_POSTIT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ 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_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+
+SfxVoidItem NextAnnotation SID_NEXT_POSTIT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+
+SfxVoidItem PreviousAnnotation SID_PREVIOUS_POSTIT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
SfxVoidItem InsertApplet SID_INSERT_APPLET
(SfxStringItem Class FN_PARAM_1,
SfxStringItem ClassLocation FN_PARAM_2,
@@ -7568,7 +7719,7 @@ SfxVoidItem OutlineBullet SID_OUTLINE_BULLET
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = TRUE,
@@ -8550,7 +8701,7 @@ SfxBoolItem ReadOnlyMode SID_READONLY_MODE
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = TRUE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -9422,7 +9573,7 @@ SfxVoidItem Select SID_SELECT
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -11026,7 +11177,7 @@ SfxBoolItem TwainSelect SID_TWAIN_SELECT
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = TRUE,
@@ -11051,7 +11202,7 @@ SfxVoidItem TwainTransfer SID_TWAIN_TRANSFER
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = TRUE,
@@ -14986,3 +15137,54 @@ SfxVoidItem RecheckDocument SID_RECHECK_DOCUMENT
GroupId = GID_DOCUMENT;
]
+//--------------------------------------------------------------------------
+
+SfxVoidItem InsertColumnDialog SID_TABLE_INSERT_COL_DLG
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_TABLE;
+]
+
+//--------------------------------------------------------------------------
+
+SfxVoidItem InsertRowDialog SID_TABLE_INSERT_ROW_DLG
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_TABLE;
+]
diff --git a/svx/sdi/svxitems.sdi b/svx/sdi/svxitems.sdi
index 795f2aea1177..65a59bccf3b6 100644
--- a/svx/sdi/svxitems.sdi
+++ b/svx/sdi/svxitems.sdi
@@ -668,7 +668,6 @@ struct SvxCharRotate
};
item SvxCharRotate SvxCharRotateItem;
-item String SvxClipboardFmtItem; // dummy
item String SfxSetItem; // dummy
item INT16 SvxRotateModeItem; // enum
item INT16 SvxOrientationItem; // enum
@@ -700,4 +699,3 @@ struct ZoomSlider
INT16 SvxMaxZoom MID_ZOOMSLIDER_MAXZOOM;
};
item ZoomSlider SvxZoomSliderItem;
-
diff --git a/svx/source/accessibility/AccessibleEditableTextPara.cxx b/svx/source/accessibility/AccessibleEditableTextPara.cxx
index 27963bfdffc4..1c0ce04bb1d6 100644
--- a/svx/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/svx/source/accessibility/AccessibleEditableTextPara.cxx
@@ -806,7 +806,7 @@ namespace accessibility
// must provide XAccesibleText by hand, since it comes publicly inherited by XAccessibleEditableText
if ( rType == ::getCppuType((uno::Reference< XAccessibleText > *)0) )
{
- uno::Reference< XAccessibleText > aAccText = this;
+ uno::Reference< XAccessibleText > aAccText = static_cast< XAccessibleEditableText * >(this);
aRet <<= aAccText;
}
else if ( rType == ::getCppuType((uno::Reference< XAccessibleEditableText > *)0) )
@@ -912,65 +912,18 @@ namespace accessibility
{
DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- // append first 40 characters from text, or first line, if shorter
- // (writer takes first sentence here, but that's not supported
- // from EditEngine)
- // throws if defunc
- ::rtl::OUString aLine;
-
- if( getCharacterCount() )
- aLine = getTextAtIndex(0, AccessibleTextType::LINE).SegmentText;
-
- // Get the string from the resource for the specified id.
- String sStr = ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_PARAGRAPH_DESCRIPTION ) );
- String sParaIndex = ::rtl::OUString::valueOf( GetParagraphIndex() );
- sStr.SearchAndReplace( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "$(ARG)" )),
- sParaIndex );
-
- if( aLine.getLength() > MaxDescriptionLen )
- {
- ::rtl::OUString aCurrWord;
- sal_Int32 i;
-
- // search backward from MaxDescriptionLen for previous word start
- for( aCurrWord=getTextAtIndex(MaxDescriptionLen, AccessibleTextType::WORD).SegmentText,
- i=MaxDescriptionLen,
- aLine=::rtl::OUString();
- i>=0;
- --i )
- {
- if( getTextAtIndex(i, AccessibleTextType::WORD).SegmentText != aCurrWord )
- {
- if( i == 0 )
- // prevent completely empty string
- aLine = getTextAtIndex(0, AccessibleTextType::WORD).SegmentText;
- else
- aLine = getTextRange(0, i);
- }
- }
- }
+// ::vos::OGuard aGuard( Application::GetSolarMutex() );
- return ::rtl::OUString( sStr ) + aLine;
+ return ::rtl::OUString();
}
::rtl::OUString SAL_CALL AccessibleEditableTextPara::getAccessibleName() throw (uno::RuntimeException)
{
DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- // throws if defunc
- sal_Int32 nPara( GetParagraphIndex() );
-
- // Get the string from the resource for the specified id.
- String sStr = ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_PARAGRAPH_NAME) );
- String sParaIndex = ::rtl::OUString::valueOf( nPara );
- sStr.SearchAndReplace( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "$(ARG)" )),
- sParaIndex );
+// ::vos::OGuard aGuard( Application::GetSolarMutex() );
- return ::rtl::OUString( sStr );
+ return ::rtl::OUString();
}
uno::Reference< XAccessibleRelationSet > SAL_CALL AccessibleEditableTextPara::getAccessibleRelationSet() throw (uno::RuntimeException)
@@ -2113,6 +2066,99 @@ namespace accessibility
return aOutSequence;
}
+ // XAccessibleMultiLineText
+ sal_Int32 SAL_CALL AccessibleEditableTextPara::getLineNumberAtIndex( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+ {
+ DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
+
+ sal_Int32 nRes = -1;
+ sal_Int32 nPara = GetParagraphIndex();
+
+ SvxTextForwarder &rCacheTF = GetTextForwarder();
+ const bool bValidPara = 0 <= nPara && nPara < rCacheTF.GetParagraphCount();
+ DBG_ASSERT( bValidPara, "getLineNumberAtIndex: current paragraph index out of range" );
+ if (bValidPara)
+ {
+ // we explicitly allow for the index to point at the character right behind the text
+ if (0 <= nIndex && nIndex <= rCacheTF.GetTextLen( static_cast< USHORT >(nPara) ))
+ nRes = rCacheTF.GetLineNumberAtIndex( static_cast< USHORT >(nPara), static_cast< USHORT >(nIndex) );
+ else
+ throw lang::IndexOutOfBoundsException();
+ }
+ return nRes;
+ }
+
+ // XAccessibleMultiLineText
+ ::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleEditableTextPara::getTextAtLineNumber( sal_Int32 nLineNo ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+ {
+ DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
+
+ ::com::sun::star::accessibility::TextSegment aResult;
+ sal_Int32 nPara = GetParagraphIndex();
+ SvxTextForwarder &rCacheTF = GetTextForwarder();
+ const bool bValidPara = 0 <= nPara && nPara < rCacheTF.GetParagraphCount();
+ DBG_ASSERT( bValidPara, "getTextAtLineNumber: current paragraph index out of range" );
+ if (bValidPara)
+ {
+ if (0 <= nLineNo && nLineNo < rCacheTF.GetLineCount( static_cast< USHORT >(nPara) ))
+ {
+ USHORT nStart = 0, nEnd = 0;
+ rCacheTF.GetLineBoundaries( nStart, nEnd, static_cast< USHORT >(nPara), static_cast< USHORT >(nLineNo) );
+ if (nStart != 0xFFFF && nEnd != 0xFFFF)
+ {
+ try
+ {
+ aResult.SegmentText = getTextRange( nStart, nEnd );
+ aResult.SegmentStart = nStart;
+ aResult.SegmentEnd = nEnd;
+ }
+ catch (lang::IndexOutOfBoundsException)
+ {
+ // this is not the exception that should be raised in this function ...
+ DBG_ASSERT( 0, "unexpected exception" );
+ }
+ }
+ }
+ else
+ throw lang::IndexOutOfBoundsException();
+ }
+ return aResult;
+ }
+
+ // XAccessibleMultiLineText
+ ::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleEditableTextPara::getTextAtLineWithCaret( ) throw (uno::RuntimeException)
+ {
+ DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
+
+ ::com::sun::star::accessibility::TextSegment aResult;
+ try
+ {
+ aResult = getTextAtLineNumber( getNumberOfLineWithCaret() );
+ }
+ catch (lang::IndexOutOfBoundsException &)
+ {
+ // this one needs to be catched since this interface does not allow for it.
+ }
+ return aResult;
+ }
+
+ // XAccessibleMultiLineText
+ sal_Int32 SAL_CALL AccessibleEditableTextPara::getNumberOfLineWithCaret( ) throw (uno::RuntimeException)
+ {
+ DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
+
+ sal_Int32 nRes = -1;
+ try
+ {
+ nRes = getLineNumberAtIndex( getCaretPosition() );
+ }
+ catch (lang::IndexOutOfBoundsException &)
+ {
+ // this one needs to be catched since this interface does not allow for it.
+ }
+ return nRes;
+ }
+
// XServiceInfo
::rtl::OUString SAL_CALL AccessibleEditableTextPara::getImplementationName (void) throw (uno::RuntimeException)
diff --git a/svx/source/accessibility/AccessibleEditableTextPara.hxx b/svx/source/accessibility/AccessibleEditableTextPara.hxx
index 5cf8c5361d20..4e297f44c3b5 100644
--- a/svx/source/accessibility/AccessibleEditableTextPara.hxx
+++ b/svx/source/accessibility/AccessibleEditableTextPara.hxx
@@ -34,12 +34,10 @@
#include <tools/gen.hxx>
#include <tools/string.hxx>
#include <cppuhelper/weakref.hxx>
-#include <cppuhelper/compbase7.hxx>
+#include <cppuhelper/compbase8.hxx>
#include <cppuhelper/typeprovider.hxx>
-
-#ifndef _CPPUHELPER_INTERFACECONTAINER_H_
#include <cppuhelper/interfacecontainer.hxx>
-#endif
+
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/accessibility/XAccessible.hpp>
@@ -47,6 +45,8 @@
#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
#include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp>
+#include <com/sun/star/accessibility/XAccessibleMultiLineText.hpp>
+
#include <comphelper/accessibletexthelper.hxx>
#include <comphelper/broadcasthelper.hxx>
#include "AccessibleParaManager.hxx"
@@ -55,12 +55,13 @@
namespace accessibility
{
- typedef ::cppu::WeakComponentImplHelper7< ::com::sun::star::accessibility::XAccessible,
+ typedef ::cppu::WeakComponentImplHelper8< ::com::sun::star::accessibility::XAccessible,
::com::sun::star::accessibility::XAccessibleContext,
::com::sun::star::accessibility::XAccessibleComponent,
::com::sun::star::accessibility::XAccessibleEditableText,
::com::sun::star::accessibility::XAccessibleEventBroadcaster,
::com::sun::star::accessibility::XAccessibleTextAttributes,
+ ::com::sun::star::accessibility::XAccessibleMultiLineText,
::com::sun::star::lang::XServiceInfo > AccessibleTextParaInterfaceBase;
/** This class implements the actual text paragraphs for the EditEngine/Outliner UAA
@@ -128,7 +129,7 @@ namespace accessibility
virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException);
- // XAccessibleText (this comes implicitely inherited by XAccessibleEditableText)
+ // XAccessibleText (this comes implicitely inherited by XAccessibleEditableText AND by XAccessibleMultiLineText)
virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
@@ -163,6 +164,12 @@ namespace accessibility
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getDefaultAttributes( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& RequestedAttributes ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getRunAttributes( ::sal_Int32 Index, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& RequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ // XAccessibleMultiLineText
+ virtual ::sal_Int32 SAL_CALL getLineNumberAtIndex( ::sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtLineNumber( ::sal_Int32 nLineNo ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtLineWithCaret( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getNumberOfLineWithCaret( ) throw (::com::sun::star::uno::RuntimeException);
+
// XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName (void) throw (::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService (const ::rtl::OUString& sServiceName) throw (::com::sun::star::uno::RuntimeException);
diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
index 072d6347f3f4..15da06a17054 100644
--- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx
+++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
@@ -161,6 +161,8 @@ namespace accessibility
sal_Bool GetAttributeRun( USHORT&, USHORT&, USHORT, USHORT ) const { return sal_False; }
USHORT GetLineCount( USHORT nPara ) const { return nPara == 0 ? 1 : 0; }
USHORT GetLineLen( USHORT, USHORT ) const { return 0; }
+ void GetLineBoundaries( /*out*/USHORT & rStart, /*out*/USHORT & rEnd, USHORT /*nParagraph*/, USHORT /*nLine*/ ) const { rStart = rEnd = 0; }
+ USHORT GetLineNumberAtIndex( USHORT /*nPara*/, USHORT /*nIndex*/ ) const { return 0; }
// the following two methods would, strictly speaking, require
// a switch to a real EditSource, too. Fortunately, the
@@ -338,6 +340,13 @@ namespace accessibility
if( mbEditSourceEmpty )
Switch2ProxyEditSource();
}
+ else if (pSdrHint && pSdrHint->GetObject()!=NULL)
+ {
+ // When the SdrObject just got a para outliner object then
+ // switch the edit source.
+ if (pSdrHint->GetObject()->GetOutlinerParaObject() != NULL)
+ Switch2ProxyEditSource();
+ }
// forward messages
Broadcast( rHint );
diff --git a/svx/source/accessibility/AccessibleImageBullet.cxx b/svx/source/accessibility/AccessibleImageBullet.cxx
index 2ea02d03bf28..694043d69f4e 100644
--- a/svx/source/accessibility/AccessibleImageBullet.cxx
+++ b/svx/source/accessibility/AccessibleImageBullet.cxx
@@ -172,16 +172,8 @@ namespace accessibility
::vos::OGuard aGuard( Application::GetSolarMutex() );
- // throws if defunc
- sal_Int32 nPara( GetParagraphIndex() );
-
// Get the string from the resource for the specified id.
- String sStr = ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION) );
- String sParaIndex = ::rtl::OUString::valueOf( nPara );
- sStr.SearchAndReplace( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "$(ARG)" )),
- sParaIndex );
-
- return ::rtl::OUString( sStr );
+ return ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION) );
}
::rtl::OUString SAL_CALL AccessibleImageBullet::getAccessibleName() throw (uno::RuntimeException)
@@ -190,16 +182,8 @@ namespace accessibility
::vos::OGuard aGuard( Application::GetSolarMutex() );
- // throws if defunc
- sal_Int32 nPara( GetParagraphIndex() );
-
// Get the string from the resource for the specified id.
- String sStr = ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_NAME) );
- String sParaIndex = ::rtl::OUString::valueOf( nPara );
- sStr.SearchAndReplace( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "$(ARG)" )),
- sParaIndex );
-
- return ::rtl::OUString( sStr );
+ return ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_NAME) );
}
uno::Reference< XAccessibleRelationSet > SAL_CALL AccessibleImageBullet::getAccessibleRelationSet() throw (uno::RuntimeException)
diff --git a/svx/source/accessibility/AccessibleStaticTextBase.cxx b/svx/source/accessibility/AccessibleStaticTextBase.cxx
index b611b62b47e6..333c555bb746 100644
--- a/svx/source/accessibility/AccessibleStaticTextBase.cxx
+++ b/svx/source/accessibility/AccessibleStaticTextBase.cxx
@@ -173,12 +173,16 @@ namespace accessibility
AccessibleEditableTextPara& GetParagraph( sal_Int32 nPara ) const;
sal_Int32 GetParagraphCount() const;
+ sal_Int32 GetParagraphIndex() const;
+ sal_Int32 GetLineCount( sal_Int32 nParagraph ) const;
+
EPosition Index2Internal( sal_Int32 nFlatIndex ) const
{
DBG_CHKTHIS( AccessibleStaticTextBase_Impl, NULL );
return ImpCalcInternal( nFlatIndex, false );
}
+
EPosition Range2Internal( sal_Int32 nFlatIndex ) const
{
DBG_CHKTHIS( AccessibleStaticTextBase_Impl, NULL );
@@ -327,6 +331,26 @@ namespace accessibility
return mpTextParagraph->GetTextForwarder().GetParagraphCount();
}
+ sal_Int32 AccessibleStaticTextBase_Impl::GetParagraphIndex() const
+ {
+ DBG_CHKTHIS( AccessibleStaticTextBase_Impl, NULL );
+
+ sal_Int32 nIndex = -1;
+ if( mpTextParagraph )
+ nIndex = mpTextParagraph->GetParagraphIndex();
+ return nIndex;
+ }
+
+ sal_Int32 AccessibleStaticTextBase_Impl::GetLineCount( sal_Int32 nParagraph ) const
+ {
+ DBG_CHKTHIS( AccessibleStaticTextBase_Impl, NULL );
+
+ sal_Int32 nIndex = 0;
+ if( mpTextParagraph )
+ nIndex = mpTextParagraph->GetTextForwarder().GetLineCount( static_cast< USHORT >(nParagraph) );
+ return nIndex;
+ }
+
sal_Int32 AccessibleStaticTextBase_Impl::Internal2Index( EPosition nEEIndex ) const
{
sal_Int32 aRes(0);
@@ -1001,10 +1025,25 @@ namespace accessibility
return ::comphelper::concatSequences( aRunAttrSeq, aDiffVec.getAsConstList() );
}
- Rectangle AccessibleStaticTextBase::GetParagraphBoundingBox() const
- {
- return mpImpl->GetParagraphBoundingBox();
- }
+ Rectangle AccessibleStaticTextBase::GetParagraphBoundingBox() const
+ {
+ return mpImpl->GetParagraphBoundingBox();
+ }
+
+ sal_Int32 AccessibleStaticTextBase::GetParagraphIndex() const
+ {
+ return mpImpl->GetParagraphIndex();
+ }
+
+ sal_Int32 AccessibleStaticTextBase::GetParagraphCount() const
+ {
+ return mpImpl->GetParagraphCount();
+ }
+
+ sal_Int32 AccessibleStaticTextBase::GetLineCount( sal_Int32 nParagraph ) const
+ {
+ return mpImpl->GetLineCount( nParagraph );
+ }
} // end of namespace accessibility
diff --git a/svx/source/accessibility/accessibility.src b/svx/source/accessibility/accessibility.src
index 323ff7982876..418236a0107d 100644
--- a/svx/source/accessibility/accessibility.src
+++ b/svx/source/accessibility/accessibility.src
@@ -196,19 +196,9 @@ String RID_SVXSTR_GRAPHCTRL_ACC_DESCRIPTION
Text [ en-US ] = "This is where you can edit the contour." ;
};
-String RID_SVXSTR_A11Y_PARAGRAPH_DESCRIPTION
-{
- Text [ en-US ] = "Paragraph: $(ARG) " ;
-};
-
-String RID_SVXSTR_A11Y_PARAGRAPH_NAME
-{
- Text [ en-US ] = "Paragraph $(ARG)" ;
-};
-
String RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION
{
- Text [ en-US ] = "Image bullet in paragraph: $(ARG)" ;
+ Text [ en-US ] = "Image bullet in paragraph" ;
};
String RID_SVXSTR_A11Y_IMAGEBULLET_NAME
diff --git a/svx/source/accessibility/makefile.mk b/svx/source/accessibility/makefile.mk
index f953adc1dda0..8b1802bf1a25 100755
--- a/svx/source/accessibility/makefile.mk
+++ b/svx/source/accessibility/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=accessibility
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
@@ -42,7 +43,12 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES = \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
+ $(SLO)$/AccessibleStringWrap.obj
+
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
$(SLO)$/charmapacc.obj \
$(SLO)$/svxrectctaccessiblecontext.obj \
$(SLO)$/GraphCtlAccessibleContext.obj \
@@ -63,13 +69,14 @@ SLOFILES = \
$(SLO)$/AccessibleStaticTextBase.obj \
$(SLO)$/AccessibleParaManager.obj \
$(SLO)$/AccessibleEditableTextPara.obj \
- $(SLO)$/AccessibleStringWrap.obj \
$(SLO)$/AccessibleImageBullet.obj \
$(SLO)$/ShapeTypeHandler.obj \
$(SLO)$/SvxShapeTypes.obj \
$(SLO)$/AccessibleControlShape.obj \
$(SLO)$/DGColorNameLookUp.obj \
$(SLO)$/AccessibleFrameSelector.obj
+
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
SRS2NAME = accessibility
SRC2FILES = accessibility.src
diff --git a/svx/source/cui/autocdlg.cxx b/svx/source/cui/autocdlg.cxx
index 5d957b831d54..330459b224f1 100644
--- a/svx/source/cui/autocdlg.cxx
+++ b/svx/source/cui/autocdlg.cxx
@@ -2308,7 +2308,7 @@ OfaAutoCompleteTabPage::OfaAutoCompleteTabPage( Window* pParent,
aCBAppendSpace (this, SVX_RES(CB_APPEND_SPACE)),
aCBAsTip (this, SVX_RES(CB_AS_TIP)),
aCBCollect (this, SVX_RES(CB_COLLECT)),
- aCBKeepList (this, SVX_RES(CB_KEEP_LIST)),
+ aCBRemoveList (this, SVX_RES(CB_REMOVE_LIST)),
aFTExpandKey (this, SVX_RES(FT_EXPAND_KEY)),
aDCBExpandKey (this, SVX_RES(DCB_EXPAND_KEY)),
aFTMinWordlen (this, SVX_RES(FT_MIN_WORDLEN)),
@@ -2369,7 +2369,7 @@ BOOL OfaAutoCompleteTabPage::FillItemSet( SfxItemSet& )
bCheck = aCBCollect.IsChecked();
bModified |= pOpt->bAutoCmpltCollectWords != bCheck;
pOpt->bAutoCmpltCollectWords = bCheck;
- bCheck = aCBKeepList.IsChecked();
+ bCheck = !aCBRemoveList.IsChecked(); // inverted value!
bModified |= pOpt->bAutoCmpltKeepList != bCheck;
pOpt->bAutoCmpltKeepList = bCheck;
bCheck = aCBAppendSpace.IsChecked();
@@ -2416,7 +2416,7 @@ void OfaAutoCompleteTabPage::Reset( const SfxItemSet& )
aCBActiv.Check( 0 != pOpt->bAutoCompleteWords );
aCBCollect.Check( 0 != pOpt->bAutoCmpltCollectWords );
- aCBKeepList.Check( 0 != pOpt->bAutoCmpltKeepList);
+ aCBRemoveList.Check( !pOpt->bAutoCmpltKeepList ); //inverted value!
aCBAppendSpace.Check( 0 != pOpt->bAutoCmpltAppendBlanc );
aCBAsTip.Check( 0 != pOpt->bAutoCmpltShowAsTip );
@@ -2487,7 +2487,7 @@ IMPL_LINK( OfaAutoCompleteTabPage, CheckHdl, CheckBox*, pBox )
aDCBExpandKey.Enable( bEnable );
}
else if(&aCBCollect == pBox)
- aCBKeepList.Enable( bEnable );
+ aCBRemoveList.Enable( bEnable );
return 0;
}
diff --git a/svx/source/cui/autocdlg.hrc b/svx/source/cui/autocdlg.hrc
index d3c34e3e48a2..6a698b4397d7 100644
--- a/svx/source/cui/autocdlg.hrc
+++ b/svx/source/cui/autocdlg.hrc
@@ -129,7 +129,7 @@
#define CB_ACTIV 121
#define CB_COLLECT 122
#define CB_APPEND_SPACE 123
-#define CB_KEEP_LIST 124
+#define CB_REMOVE_LIST 124
#define CB_AS_TIP 125
#define FT_MIN_WORDLEN 126
#define FT_MAX_ENTRIES 127
diff --git a/svx/source/cui/autocdlg.hxx b/svx/source/cui/autocdlg.hxx
index d9d16f8ed064..dba6ce826cc3 100644
--- a/svx/source/cui/autocdlg.hxx
+++ b/svx/source/cui/autocdlg.hxx
@@ -406,7 +406,7 @@ class OfaAutoCompleteTabPage : public SfxTabPage
CheckBox aCBAsTip; //Show as tip
CheckBox aCBCollect;//Collect words
- CheckBox aCBKeepList;//...save the list for later use...
+ CheckBox aCBRemoveList;//...save the list for later use...
//--removed--CheckBox aCBEndless;//
FixedText aFTExpandKey;
diff --git a/svx/source/cui/autocdlg.src b/svx/source/cui/autocdlg.src
index 9ec079a5daae..a087bd7d59dc 100644
--- a/svx/source/cui/autocdlg.src
+++ b/svx/source/cui/autocdlg.src
@@ -656,12 +656,12 @@ TabPage RID_OFAPAGE_AUTOCOMPLETE_OPTIONS
Size = MAP_APPFONT( 116, 10 );
Text [ en-US ] = "C~ollect words";
};
- CheckBox CB_KEEP_LIST
+ CheckBox CB_REMOVE_LIST
{
Pos = MAP_APPFONT( 10, 59 );
Size = MAP_APPFONT( 110, 40 );
WordBreak = TRUE;
- Text [ en-US ] = "~When closing a document, save the list for later use in other documents.";
+ Text [ en-US ] = "~When closing a document, remove the words collected from it from the list";
};
FixedText FT_EXPAND_KEY
{
diff --git a/svx/source/cui/commonlingui.src b/svx/source/cui/commonlingui.src
index b69d3449db4c..c229953ad3c8 100644
--- a/svx/source/cui/commonlingui.src
+++ b/svx/source/cui/commonlingui.src
@@ -47,7 +47,7 @@ Window RID_SVX_WND_COMMON_LINGU
{
HelpId=HID_SPELLDLG_SETWORD;
Pos = MAP_APPFONT( 51, 9 );
- Size = MAP_APPFONT( 149, 10 );
+ Size = MAP_APPFONT( 164, 10 );
Border =FALSE;
TabStop = TRUE;
};
@@ -62,7 +62,7 @@ Window RID_SVX_WND_COMMON_LINGU
Edit ED_NEWWORD
{
Pos = MAP_APPFONT( 51, 24 );
- Size = MAP_APPFONT( 122, 12 );
+ Size = MAP_APPFONT( 137, 12 );
Border = TRUE;
};
@@ -75,21 +75,21 @@ Window RID_SVX_WND_COMMON_LINGU
PushButton BTN_IGNORE
{
- Pos = MAP_APPFONT( 209, 6 );
+ Pos = MAP_APPFONT( 224, 6 );
Size = MAP_APPFONT( 55, 14 );
Text [ en-US ] = "~Ignore" ;
};
PushButton BTN_IGNOREALL
{
- Pos = MAP_APPFONT( 209, 22 );
+ Pos = MAP_APPFONT( 224, 22 );
Size = MAP_APPFONT( 55, 14 );
Text [ en-US ] = "Always I~gnore" ;
};
PushButton BTN_CHANGE
{
- Pos = MAP_APPFONT( 209, 40 );
+ Pos = MAP_APPFONT( 224, 40 );
Size = MAP_APPFONT( 55, 14 );
Text [ en-US ] = "~Replace" ;
DefButton = TRUE ;
@@ -97,14 +97,14 @@ Window RID_SVX_WND_COMMON_LINGU
PushButton BTN_CHANGEALL
{
- Pos = MAP_APPFONT( 209, 56 );
+ Pos = MAP_APPFONT( 224, 56 );
Size = MAP_APPFONT( 55, 14 );
Text [ en-US ] = "Always R~eplace" ;
};
PushButton BTN_OPTIONS
{
- Pos = MAP_APPFONT( 209, 129 );
+ Pos = MAP_APPFONT( 224, 129 );
Size = MAP_APPFONT( 55, 14 );
Hide = TRUE ;
Text [ en-US ] = "Options..." ;
@@ -119,19 +119,19 @@ Window RID_SVX_WND_COMMON_LINGU
GroupBox GB_AUDIT
{
Pos = MAP_APPFONT( 1, 1 );
- Size = MAP_APPFONT( 268, 148 );
+ Size = MAP_APPFONT( 283, 148 );
Hide=TRUE;
};
HelpButton BTN_SPL_HELP
{
- Pos = MAP_APPFONT( 145, 153 );
+ Pos = MAP_APPFONT( 160, 153 );
Size = MAP_APPFONT( 55, 14 );
};
CancelButton BTN_SPL_CANCEL
{
- Pos = MAP_APPFONT ( 209 , 153 ) ;
+ Pos = MAP_APPFONT ( 224 , 153 ) ;
Size = MAP_APPFONT ( 55 , 14 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~Close" ;
diff --git a/svx/source/cui/cuioptgenrl.hxx b/svx/source/cui/cuioptgenrl.hxx
index a19b20c16028..22ef5481651f 100644
--- a/svx/source/cui/cuioptgenrl.hxx
+++ b/svx/source/cui/cuioptgenrl.hxx
@@ -80,6 +80,7 @@ private:
SvxUserEdit aCompanyEdit;
FixedText aNameLbl;
FixedText aNameLblRuss;
+ FixedText aNameLblEastern;
SvxUserEdit aFirstName;
SvxUserEdit aFatherName;
SvxUserEdit aName;
diff --git a/svx/source/cui/dlgfact.cxx b/svx/source/cui/dlgfact.cxx
index 5fe71d5eb8af..996d0f63f9e9 100644
--- a/svx/source/cui/dlgfact.cxx
+++ b/svx/source/cui/dlgfact.cxx
@@ -112,6 +112,7 @@
#include "newtabledlg.hxx"
#include "macroass.hxx"
#include "acccfg.hxx"
+#include "insrc.hxx"
using namespace ::com::sun::star;
using namespace ::com::sun::star::frame;
@@ -2385,3 +2386,8 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateOptionsDialog(
{
return new VclAbstractDialog_Impl( new OfaTreeOptionsDialog( pParent, rExtensionId ) );
}
+
+SvxAbstractInsRowColDlg* AbstractDialogFactory_Impl::CreateSvxInsRowColDlg( Window* pParent, bool bCol, ULONG nHelpId )
+{
+ return new SvxInsRowColDlg( pParent, bCol, nHelpId );
+}
diff --git a/svx/source/cui/dlgfact.hxx b/svx/source/cui/dlgfact.hxx
index e6c1325b4b38..e52c21fc597a 100644
--- a/svx/source/cui/dlgfact.hxx
+++ b/svx/source/cui/dlgfact.hxx
@@ -810,6 +810,8 @@ public:
virtual VclAbstractDialog* CreateOptionsDialog(
Window* pParent, const rtl::OUString& rExtensionId, const rtl::OUString& rApplicationContext );
+
+ virtual SvxAbstractInsRowColDlg* CreateSvxInsRowColDlg( Window* pParent, bool bCol, ULONG nHelpId );
};
#endif
diff --git a/svx/source/cui/hangulhanjadlg.src b/svx/source/cui/hangulhanjadlg.src
index 91439e285f7d..920f99e03aec 100644
--- a/svx/source/cui/hangulhanjadlg.src
+++ b/svx/source/cui/hangulhanjadlg.src
@@ -37,7 +37,7 @@
ModalDialog RID_SVX_MDLG_HANGULHANJA
{
HelpId = HID_DIALOG_HANGULHANJA;
- Size = MAP_APPFONT( 287, 175 );
+ Size = MAP_APPFONT( 302, 175 );
OutputSize = TRUE;
Closeable = TRUE ;
Moveable = TRUE ;
@@ -47,7 +47,7 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
PushButton PB_FIND
{
- Pos = MAP_APPFONT( 192, 23 );
+ Pos = MAP_APPFONT( 207, 23 );
Size = MAP_APPFONT( 30, 14 );
Text [ en-US ] = "~Find";
@@ -56,7 +56,7 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
Control CTL_SUGGESTIONS
{
Pos = MAP_APPFONT( 51, 46 );
- Size = MAP_APPFONT( 171, 30 );
+ Size = MAP_APPFONT( 186, 30 );
TabStop = TRUE ;
};
@@ -71,7 +71,7 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
RadioButton RB_SIMPLE_CONVERSION
{
Pos = MAP_APPFONT( 51, 81 );
- Size = MAP_APPFONT( 55, 8 );
+ Size = MAP_APPFONT( 60, 8 );
Group = TRUE;
@@ -80,16 +80,16 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
RadioButton RB_HANJA_HANGUL_BRACKETED
{
- Pos = MAP_APPFONT( 109, 81 );
- Size = MAP_APPFONT( 55, 8 );
+ Pos = MAP_APPFONT( 114, 81 );
+ Size = MAP_APPFONT( 60, 8 );
Text [ en-US ] = "Hanja (Han~gul)";
};
RadioButton RB_HANGUL_HANJA_BRACKETED
{
- Pos = MAP_APPFONT( 167, 81 );
- Size = MAP_APPFONT( 55, 8 );
+ Pos = MAP_APPFONT( 177, 81 );
+ Size = MAP_APPFONT( 60, 8 );
Text [ en-US ] = "Hang~ul (Hanja)";
};
@@ -97,7 +97,7 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
RadioButton RB_HANGUL_HANJA_ABOVE
{
Pos = MAP_APPFONT( 51, 95 );
- Size = MAP_APPFONT( 55, 16 );
+ Size = MAP_APPFONT( 60, 16 );
// this is the _primary_ text
Text [ en-US ] = "Hangu~l";
@@ -105,8 +105,8 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
RadioButton RB_HANGUL_HANJA_BELOW
{
- Pos = MAP_APPFONT( 109, 95 );
- Size = MAP_APPFONT( 55, 16 );
+ Pos = MAP_APPFONT( 114, 95 );
+ Size = MAP_APPFONT( 60, 16 );
// this is the _primary_ text
Text [ en-US ] = "Hang~ul";
@@ -114,8 +114,8 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
RadioButton RB_HANJA_HANGUL_ABOVE
{
- Pos = MAP_APPFONT( 51, 114 );
- Size = MAP_APPFONT( 55, 16 );
+ Pos = MAP_APPFONT( 56, 114 );
+ Size = MAP_APPFONT( 60, 16 );
// this is the _primary_ text
Text [ en-US ] = "Han~ja";
@@ -123,8 +123,8 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
RadioButton RB_HANJA_HANGUL_BELOW
{
- Pos = MAP_APPFONT( 109, 114 );
- Size = MAP_APPFONT( 55, 16 );
+ Pos = MAP_APPFONT( 114, 114 );
+ Size = MAP_APPFONT( 60, 16 );
// this is the _primary_ text
Text [ en-US ] = "Ha~nja";
@@ -141,14 +141,14 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
CheckBox CB_HANGUL_ONLY
{
Pos = MAP_APPFONT( 51, 134 );
- Size = MAP_APPFONT( 55, 8 );
+ Size = MAP_APPFONT( 60, 8 );
Text [ en-US ] = "Hangul ~only";
};
CheckBox CB_HANJA_ONLY
{
- Pos = MAP_APPFONT( 109, 134 );
+ Pos = MAP_APPFONT( 114, 134 );
Size = MAP_APPFONT( 55, 8 );
Text [ en-US ] = "Hanja onl~y";
@@ -157,12 +157,12 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
// this element is only for determining where our radio button group ends (in both directions)
FixedText FT_RESIZE_ANCHOR
{
- Pos = MAP_APPFONT( 226, 133 );
+ Pos = MAP_APPFONT( 241, 133 );
};
CheckBox CB_REPLACE_BY_CHARACTER
{
- Pos = MAP_APPFONT( 226, 81 );
+ Pos = MAP_APPFONT( 241, 81 );
Size = MAP_APPFONT( 55, 24 );
WordBreak = TRUE;
diff --git a/svx/source/cui/insrc.cxx b/svx/source/cui/insrc.cxx
new file mode 100644
index 000000000000..10b0a5d713a3
--- /dev/null
+++ b/svx/source/cui/insrc.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: insrc.cxx,v $
+ * $Revision: 1.10 $
+ *
+ * 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"
+#ifdef SVX_DLLIMPLEMENTATION
+#undef SVX_DLLIMPLEMENTATION
+#endif
+
+#include <svx/dialmgr.hxx>
+#include <svx/svxdlg.hxx>
+#include <svx/dialogs.hrc>
+#include "insrc.hxx"
+#include "insrc.hrc"
+
+bool SvxInsRowColDlg::isInsertBefore() const
+{
+ return !aAfterBtn.IsChecked();
+}
+
+sal_uInt16 SvxInsRowColDlg::getInsertCount() const
+{
+ return static_cast< sal_uInt16 >( aCountEdit.GetValue() );
+}
+
+SvxInsRowColDlg::SvxInsRowColDlg(Window* pParent, bool bCol, ULONG nHelpId )
+ : ModalDialog( pParent, SVX_RES(DLG_INS_ROW_COL) ),
+ aCount( this, SVX_RES( FT_COUNT ) ),
+ aCountEdit( this, SVX_RES( ED_COUNT ) ),
+ aInsFL( this, SVX_RES( FL_INS ) ),
+ aBeforeBtn( this, SVX_RES( CB_POS_BEFORE ) ),
+ aAfterBtn( this, SVX_RES( CB_POS_AFTER ) ),
+ aPosFL( this, SVX_RES( FL_POS ) ),
+ aRow(SVX_RES(STR_ROW)),
+ aCol(SVX_RES(STR_COL)),
+ aOKBtn( this, SVX_RES( BT_OK ) ),
+ aCancelBtn( this, SVX_RES( BT_CANCEL ) ),
+ aHelpBtn( this, SVX_RES( BT_HELP ) ),
+ bColumn( bCol )
+{
+ FreeResource();
+ String aTmp( GetText() );
+ if( bColumn )
+ {
+ aTmp += aCol;
+ }
+ else
+ {
+ aTmp += aRow;
+ }
+ SetText( aTmp );
+ SetHelpId( nHelpId );
+}
+
+short SvxInsRowColDlg::Execute(void)
+{
+ return ModalDialog::Execute();
+}
+
+
+
diff --git a/sj2/stardiv/app/AppletViewerFactory.java b/svx/source/cui/insrc.hrc
index da73f0648187..e07c7cb2f1d5 100644
--- a/sj2/stardiv/app/AppletViewerFactory.java
+++ b/svx/source/cui/insrc.hrc
@@ -6,8 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: AppletViewerFactory.java,v $
- * $Revision: 1.3 $
+ * $RCSfile: insrc.hrc,v $
+ * $Revision: 1.4 $
*
* This file is part of OpenOffice.org.
*
@@ -27,20 +27,17 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#define FT_COUNT 1
+#define ED_COUNT 2
+#define FL_INS 3
-/*
- * AppletViewerFactory.java
- */
+#define CB_POS_BEFORE 10
+#define CB_POS_AFTER 11
+#define FL_POS 12
-package stardiv.app;
+#define STR_ROW 20
+#define STR_COL 21
-import java.util.Hashtable;
-import java.net.URL;
-import java.awt.MenuBar;
-
-public
-interface AppletViewerFactory {
- public AppletViewer createAppletViewer(int x, int y, URL doc, Hashtable atts);
- public MenuBar getBaseMenuBar();
- public boolean isStandalone();
-}
+#define BT_OK 100
+#define BT_CANCEL 101
+#define BT_HELP 102
diff --git a/svx/source/cui/insrc.hxx b/svx/source/cui/insrc.hxx
new file mode 100644
index 000000000000..e187313bdd03
--- /dev/null
+++ b/svx/source/cui/insrc.hxx
@@ -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: insrc.hxx,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 _SVX_INSRC_HXX
+#define _SVX_INSRC_HXX
+
+#include <svx/stddlg.hxx>
+
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+#include <vcl/button.hxx>
+#include <vcl/group.hxx>
+#include <vcl/button.hxx>
+
+#include <tools/string.hxx>
+
+class SvxInsRowColDlg : public SvxAbstractInsRowColDlg, public ModalDialog
+{
+ FixedText aCount;
+ NumericField aCountEdit;
+ FixedLine aInsFL;
+
+ RadioButton aBeforeBtn;
+ RadioButton aAfterBtn;
+ FixedLine aPosFL;
+
+ String aRow;
+ String aCol;
+
+ OKButton aOKBtn;
+ CancelButton aCancelBtn;
+ HelpButton aHelpBtn;
+
+ bool bColumn;
+
+public:
+ SvxInsRowColDlg( Window* pParent, bool bCol, ULONG nHelpId );
+
+ virtual short Execute(void);
+
+ virtual bool isInsertBefore() const;
+ virtual sal_uInt16 getInsertCount() const;
+};
+
+#endif
+
diff --git a/svx/source/cui/insrc.src b/svx/source/cui/insrc.src
new file mode 100644
index 000000000000..6023e94604ef
--- /dev/null
+++ b/svx/source/cui/insrc.src
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * 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: insrc.src,v $
+ * $Revision: 1.32 $
+ *
+ * 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 <svx/dialogs.hrc>
+#include "insrc.hrc"
+
+ModalDialog DLG_INS_ROW_COL
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 136 , 84 ) ;
+ Text [ en-US ] = "Insert" ;
+ Moveable = TRUE ;
+ OKButton BT_OK
+ {
+ Pos = MAP_APPFONT ( 80 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ };
+ CancelButton BT_CANCEL
+ {
+ Pos = MAP_APPFONT ( 80 , 23 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ HelpButton BT_HELP
+ {
+ Pos = MAP_APPFONT ( 80 , 43 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ RadioButton CB_POS_BEFORE
+ {
+ Pos = MAP_APPFONT ( 12 , 49 ) ;
+ Size = MAP_APPFONT ( 56 , 10 ) ;
+ Text [ en-US ] = "~Before" ;
+ TabStop = TRUE ;
+ };
+ RadioButton CB_POS_AFTER
+ {
+ Pos = MAP_APPFONT ( 12 , 62 ) ;
+ Size = MAP_APPFONT ( 56 , 10 ) ;
+ Text [ en-US ] = "A~fter" ;
+ TabStop = TRUE ;
+ Check = TRUE ;
+ };
+ NumericField ED_COUNT
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 44 , 14 ) ;
+ Size = MAP_APPFONT ( 24 , 12 ) ;
+ TabStop = TRUE ;
+ Left = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 1 ;
+ Maximum = 99 ;
+ Value = 1 ;
+ First = 1 ;
+ Last = 5 ;
+ };
+ FixedLine FL_INS
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 68 , 8 ) ;
+ Text [ en-US ] = "Insert" ;
+ };
+ FixedLine FL_POS
+ {
+ Pos = MAP_APPFONT ( 6 , 38 ) ;
+ Size = MAP_APPFONT ( 68 , 8 ) ;
+ Text [ en-US ] = "Position";
+ };
+ FixedText FT_COUNT
+ {
+ Pos = MAP_APPFONT ( 12 , 16 ) ;
+ Size = MAP_APPFONT ( 30 , 8 ) ;
+ Text [ en-US ] = "~Number" ;
+ Left = TRUE ;
+ };
+ String STR_ROW
+ {
+ Text [ en-US ] = " Rows" ;
+ };
+ String STR_COL
+ {
+ Text [ en-US ] = " Columns" ;
+ };
+};
diff --git a/svx/source/cui/macropg.cxx b/svx/source/cui/macropg.cxx
index 6eeba1b0e703..0ee76246abe3 100644
--- a/svx/source/cui/macropg.cxx
+++ b/svx/source/cui/macropg.cxx
@@ -271,22 +271,42 @@ void _SvxMacroTabPage::InitResources()
// the event name to UI string mappings for App Events
aDisplayNames.push_back( EventDisplayName( "OnStartApp", RID_SVXSTR_EVENT_STARTAPP ) );
aDisplayNames.push_back( EventDisplayName( "OnCloseApp", RID_SVXSTR_EVENT_CLOSEAPP ) );
- aDisplayNames.push_back( EventDisplayName( "OnNew", RID_SVXSTR_EVENT_CREATEDOC ) );
+ aDisplayNames.push_back( EventDisplayName( "OnCreate", RID_SVXSTR_EVENT_CREATEDOC ) );
+ aDisplayNames.push_back( EventDisplayName( "OnNew", RID_SVXSTR_EVENT_NEWDOC ) );
+ aDisplayNames.push_back( EventDisplayName( "OnLoadFinished", RID_SVXSTR_EVENT_LOADDOCFINISHED ) );
aDisplayNames.push_back( EventDisplayName( "OnLoad", RID_SVXSTR_EVENT_OPENDOC ) );
- aDisplayNames.push_back( EventDisplayName( "OnSaveAs", RID_SVXSTR_EVENT_SAVEASDOC ) );
- aDisplayNames.push_back( EventDisplayName( "OnSaveAsDone", RID_SVXSTR_EVENT_SAVEASDOCDONE ) );
- aDisplayNames.push_back( EventDisplayName( "OnSave", RID_SVXSTR_EVENT_SAVEDOC ) );
- aDisplayNames.push_back( EventDisplayName( "OnSaveDone", RID_SVXSTR_EVENT_SAVEDOCDONE ) );
aDisplayNames.push_back( EventDisplayName( "OnPrepareUnload", RID_SVXSTR_EVENT_PREPARECLOSEDOC ) );
aDisplayNames.push_back( EventDisplayName( "OnUnload", RID_SVXSTR_EVENT_CLOSEDOC ) ) ;
+ aDisplayNames.push_back( EventDisplayName( "OnViewCreated", RID_SVXSTR_EVENT_VIEWCREATED ) );
+ aDisplayNames.push_back( EventDisplayName( "OnPrepareViewClosing", RID_SVXSTR_EVENT_PREPARECLOSEVIEW ) );
+ aDisplayNames.push_back( EventDisplayName( "OnViewClosed", RID_SVXSTR_EVENT_CLOSEVIEW ) ) ;
aDisplayNames.push_back( EventDisplayName( "OnFocus", RID_SVXSTR_EVENT_ACTIVATEDOC ) );
aDisplayNames.push_back( EventDisplayName( "OnUnfocus", RID_SVXSTR_EVENT_DEACTIVATEDOC ) );
+ aDisplayNames.push_back( EventDisplayName( "OnSave", RID_SVXSTR_EVENT_SAVEDOC ) );
+ aDisplayNames.push_back( EventDisplayName( "OnSaveDone", RID_SVXSTR_EVENT_SAVEDOCDONE ) );
+ aDisplayNames.push_back( EventDisplayName( "OnSaveFailed", RID_SVXSTR_EVENT_SAVEDOCFAILED ) );
+ aDisplayNames.push_back( EventDisplayName( "OnSaveAs", RID_SVXSTR_EVENT_SAVEASDOC ) );
+ aDisplayNames.push_back( EventDisplayName( "OnSaveAsDone", RID_SVXSTR_EVENT_SAVEASDOCDONE ) );
+ aDisplayNames.push_back( EventDisplayName( "OnSaveAsFailed", RID_SVXSTR_EVENT_SAVEASDOCFAILED ) );
+ aDisplayNames.push_back( EventDisplayName( "OnCopyTo", RID_SVXSTR_EVENT_COPYTODOC ) );
+ aDisplayNames.push_back( EventDisplayName( "OnCopyToDone", RID_SVXSTR_EVENT_COPYTODOCDONE ) );
+ aDisplayNames.push_back( EventDisplayName( "OnCopyToFailed", RID_SVXSTR_EVENT_COPYTODOCFAILED ) );
aDisplayNames.push_back( EventDisplayName( "OnPrint", RID_SVXSTR_EVENT_PRINTDOC ) );
aDisplayNames.push_back( EventDisplayName( "OnModifyChanged", RID_SVXSTR_EVENT_MODIFYCHANGED ) );
+ aDisplayNames.push_back( EventDisplayName( "OnTitleChanged", RID_SVXSTR_EVENT_TITLECHANGED ) );
+// aDisplayNames.push_back( EventDisplayName( "OnModeChanged", RID_SVXSTR_EVENT_MODECHANGED ) );
+// aDisplayNames.push_back( EventDisplayName( "OnVisAreaChanged", RID_SVXSTR_EVENT_VISAREACHANGED ) );
+// aDisplayNames.push_back( EventDisplayName( "OnStorageChanged", RID_SVXSTR_EVENT_STORAGECHANGED ) );
+
+ // application specific events
aDisplayNames.push_back( EventDisplayName( "OnMailMerge", RID_SVXSTR_EVENT_MAILMERGE ) );
+ aDisplayNames.push_back( EventDisplayName( "OnMailMergeFinished", RID_SVXSTR_EVENT_MAILMERGE_END ) );
+ aDisplayNames.push_back( EventDisplayName( "OnFieldMerge", RID_SVXSTR_EVENT_FIELDMERGE ) );
+ aDisplayNames.push_back( EventDisplayName( "OnFieldMergeFinished", RID_SVXSTR_EVENT_FIELDMERGE_FINISHED ) );
aDisplayNames.push_back( EventDisplayName( "OnPageCountChange", RID_SVXSTR_EVENT_PAGECOUNTCHANGE ) );
aDisplayNames.push_back( EventDisplayName( "OnSubComponentOpened", RID_SVXSTR_EVENT_SUBCOMPONENT_OPENED ) );
aDisplayNames.push_back( EventDisplayName( "OnSubComponentClosed", RID_SVXSTR_EVENT_SUBCOMPONENT_CLOSED ) );
+// aDisplayNames.push_back( EventDisplayName( "OnLayoutFinished", RID_SVXSTR_EVENT_LAYOUT_FINISHED ) );
// the event name to UI string mappings for forms & dialogs
//
@@ -571,9 +591,14 @@ void _SvxMacroTabPage::DisplayAppEvents( bool appEvents)
rListBox.Select( _pE );
rListBox.MakeVisible( _pE );
}
+
pE = rListBox.GetEntry(0);
if( pE )
+ {
rListBox.Select( pE );
+ rListBox.MakeVisible( pE );
+ }
+
rListBox.SetUpdateMode( TRUE );
EnableButtons( String() );
}
diff --git a/svx/source/cui/macropg.src b/svx/source/cui/macropg.src
index 0de8a8c5e1dd..92e1e718ba61 100644
--- a/svx/source/cui/macropg.src
+++ b/svx/source/cui/macropg.src
@@ -165,19 +165,19 @@ String RID_SVXSTR_EVENT_CLOSEAPP
Text [ en-US ] = "Close Application" ;
};
-String RID_SVXSTR_EVENT_CREATEDOC
+String RID_SVXSTR_EVENT_NEWDOC
{
- Text [ en-US ] = "Create Document" ;
+ Text [ en-US ] = "New Document" ;
};
String RID_SVXSTR_EVENT_CLOSEDOC
{
- Text [ en-US ] = "Document is closing" ;
+ Text [ en-US ] = "Document closed" ;
};
String RID_SVXSTR_EVENT_PREPARECLOSEDOC
{
- Text [ en-US ] = "Close Document" ;
+ Text [ en-US ] = "Document is going to be closed" ;
};
String RID_SVXSTR_EVENT_OPENDOC
@@ -226,7 +226,19 @@ String RID_SVXSTR_EVENT_MODIFYCHANGED
};
String RID_SVXSTR_EVENT_MAILMERGE
{
- Text [ en-US ] = "Print form letters" ;
+ Text [ en-US ] = "Printing of form letters started" ;
+};
+String RID_SVXSTR_EVENT_MAILMERGE_END
+{
+ Text [ en-US ] = "Printing of form letters finished" ;
+};
+String RID_SVXSTR_EVENT_FIELDMERGE
+{
+ Text [ en-US ] = "Merging of form fields started" ;
+};
+String RID_SVXSTR_EVENT_FIELDMERGE_FINISHED
+{
+ Text [ en-US ] = "Merging of form fields finished" ;
};
String RID_SVXSTR_EVENT_PAGECOUNTCHANGE
{
@@ -372,3 +384,78 @@ String RID_SVXSTR_EVENT_CHANGED
{
Text [ en-US ] = "Changed" ;
};
+
+String RID_SVXSTR_EVENT_CREATEDOC
+{
+ Text [ en-US ] = "Document created" ;
+};
+
+String RID_SVXSTR_EVENT_LOADDOCFINISHED
+{
+ Text [ en-US ] = "Document loading finished" ;
+};
+
+String RID_SVXSTR_EVENT_SAVEDOCFAILED
+{
+ Text [ en-US ] = "Saving of document failed" ;
+};
+
+String RID_SVXSTR_EVENT_SAVEASDOCFAILED
+{
+ Text [ en-US ] = "'Save as' has failed" ;
+};
+
+String RID_SVXSTR_EVENT_COPYTODOC
+{
+ Text [ en-US ] = "Storing or exporting copy of document" ;
+};
+
+String RID_SVXSTR_EVENT_COPYTODOCDONE
+{
+ Text [ en-US ] = "Document copy has been created" ;
+};
+
+String RID_SVXSTR_EVENT_COPYTODOCFAILED
+{
+ Text [ en-US ] = "Creating of document copy failed" ;
+};
+
+String RID_SVXSTR_EVENT_VIEWCREATED
+{
+ Text [ en-US ] = "View created" ;
+};
+
+String RID_SVXSTR_EVENT_PREPARECLOSEVIEW
+{
+ Text [ en-US ] = "View is going to be closed" ;
+};
+
+String RID_SVXSTR_EVENT_CLOSEVIEW
+{
+ Text [ en-US ] = "View closed" ;
+};
+
+String RID_SVXSTR_EVENT_TITLECHANGED
+{
+ Text [ en-US ] = "Document title changed" ;
+};
+
+String RID_SVXSTR_EVENT_MODECHANGED
+{
+ Text [ en-US ] = "Document mode changed" ;
+};
+
+String RID_SVXSTR_EVENT_VISAREACHANGED
+{
+ Text [ en-US ] = "Visible area changed" ;
+};
+
+String RID_SVXSTR_EVENT_STORAGECHANGED
+{
+ Text [ en-US ] = "Document has got a new storage" ;
+};
+
+String RID_SVXSTR_EVENT_LAYOUT_FINISHED
+{
+ Text [ en-US ] = "Document layout finished" ;
+};
diff --git a/svx/source/cui/makefile.mk b/svx/source/cui/makefile.mk
index 7db32bb15f7a..7a1db4a85f19 100755
--- a/svx/source/cui/makefile.mk
+++ b/svx/source/cui/makefile.mk
@@ -100,7 +100,8 @@ SRC1FILES = \
textattr.src \
treeopt.src \
webconninfo.src \
- zoom.src
+ zoom.src \
+ insrc.src
SRS2NAME=cuidrawdlgs
SRC2FILES = \
@@ -221,7 +222,8 @@ SLOFILES+=\
$(SLO)$/macroass.obj \
$(SLO)$/cfg.obj \
$(SLO)$/cfgutil.obj \
- $(SLO)$/optchart.obj
+ $(SLO)$/optchart.obj \
+ $(SLO)$/insrc.obj
.IF "$(GUI)"=="WNT"
SLOFILES+=$(SLO)$/winpluginlib.obj
diff --git a/svx/source/cui/numfmt.cxx b/svx/source/cui/numfmt.cxx
index a3b426c6110e..d6978ea008b8 100644
--- a/svx/source/cui/numfmt.cxx
+++ b/svx/source/cui/numfmt.cxx
@@ -292,7 +292,6 @@ SvxNumberFormatTabPage::SvxNumberFormatTabPage( Window* pParent,
pNumFmtShell ( NULL ),
nInitFormat ( ULONG_MAX ),
- aStrEurope ( THIS_SVX_RES( STR_EUROPE) ),
sAutomaticEntry ( THIS_SVX_RES( STR_AUTO_ENTRY)),
pLastActivWindow( NULL )
{
@@ -1887,7 +1886,7 @@ void SvxNumberFormatTabPage::FillCurrencyBox()
USHORT nPos=0;
USHORT nSelPos=0;
- pNumFmtShell->GetCurrencySymbols(aList,aStrEurope,&nSelPos);
+ pNumFmtShell->GetCurrencySymbols( aList, &nSelPos);
for(USHORT i=1;i<aList.Count();i++)
{
diff --git a/svx/source/cui/numfmt.hrc b/svx/source/cui/numfmt.hrc
index 7f63e02b57d5..102c5a212ac6 100644
--- a/svx/source/cui/numfmt.hrc
+++ b/svx/source/cui/numfmt.hrc
@@ -64,10 +64,9 @@
#define IB_INFO 31
#define IL_ICON 32
#define LB_CURRENCY 33
-#define STR_EUROPE 34
-#define CB_SOURCEFORMAT 35
-#define IL_ICON_HC 36
-#define STR_AUTO_ENTRY 37
+#define CB_SOURCEFORMAT 34
+#define IL_ICON_HC 35
+#define STR_AUTO_ENTRY 36
#define TBX_ADDREMOVE 1
#define IID_ADD 1
diff --git a/svx/source/cui/numfmt.hxx b/svx/source/cui/numfmt.hxx
index ff9d0813f6e5..e14f397cf0ba 100644
--- a/svx/source/cui/numfmt.hxx
+++ b/svx/source/cui/numfmt.hxx
@@ -170,7 +170,6 @@ private:
long nCurFormatHeight;
long nStdFormatY;
long nStdFormatHeight;
- LocalizedString aStrEurope;
LocalizedString sAutomaticEntry;
Window* pLastActivWindow;
diff --git a/svx/source/cui/numfmt.src b/svx/source/cui/numfmt.src
index ab71ae446998..96269bb9ec09 100644
--- a/svx/source/cui/numfmt.src
+++ b/svx/source/cui/numfmt.src
@@ -256,10 +256,6 @@ TabPage RID_SVXPAGE_NUMBERFORMAT
IdCount = { 3 ; };
};
- String STR_EUROPE
- {
- Text [ en-US ] = "Europe";
- };
String STR_AUTO_ENTRY
{
Text [ en-US ] = "Automatic";
diff --git a/svx/source/cui/optaccessibility.cxx b/svx/source/cui/optaccessibility.cxx
index 749e98a7d5c2..eb7cac6d8c5d 100644
--- a/svx/source/cui/optaccessibility.cxx
+++ b/svx/source/cui/optaccessibility.cxx
@@ -145,14 +145,14 @@ BOOL SvxAccessibilityOptionsTabPage::FillItemSet( SfxItemSet& )
if(m_pImpl->m_aConfig.IsModified())
m_pImpl->m_aConfig.Commit();
-#ifndef UNX
AllSettings aAllSettings = Application::GetSettings();
MiscSettings aMiscSettings = aAllSettings.GetMiscSettings();
+#ifndef UNX
aMiscSettings.SetEnableATToolSupport( m_aAccessibilityTool.IsChecked() );
+#endif
aAllSettings.SetMiscSettings(aMiscSettings);
Application::SetSettings(aAllSettings);
Application::MergeSystemSettings( aAllSettings );
-#endif
return FALSE;
}
diff --git a/svx/source/cui/optgdlg.cxx b/svx/source/cui/optgdlg.cxx
index ca8c361fa615..9a53de6bea72 100644
--- a/svx/source/cui/optgdlg.cxx
+++ b/svx/source/cui/optgdlg.cxx
@@ -103,6 +103,7 @@
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
#include <com/sun/star/container/XSet.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
#include <vcl/svapp.hxx>
@@ -136,7 +137,6 @@ int OfaMiscTabPage::DeactivatePage( SfxItemSet* pSet_ )
return LEAVE_PAGE;
}
-# ifdef ENABLE_GTK
namespace
{
::rtl::OUString impl_SystemFileOpenServiceName()
@@ -146,13 +146,35 @@ namespace
if ( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "gnome" ) )
{
+ #ifdef ENABLE_GTK
return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.GtkFilePicker" );
+ #else
+ return rtl::OUString();
+ #endif
+ }
+ else if ( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde4" ) )
+ {
+ #ifdef ENABLE_KDE4
+ return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.KDE4FilePicker" );
+ #else
+ return rtl::OUString();
+ #endif
}
else if ( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde" ) )
{
+ #ifdef ENABLE_KDE
return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.KDEFilePicker" );
+ #else
+ return rtl::OUString();
+ #endif
}
+ #if defined WNT
return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFilePicker" );
+ #elif (defined MACOSX && defined QUARTZ)
+ return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.AquaFilePicker" );
+ #else
+ return rtl::OUString();
+ #endif
}
sal_Bool lcl_HasSystemFilePicker()
@@ -180,8 +202,6 @@ namespace
}
}
-#endif
-
// -----------------------------------------------------------------------
OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
@@ -210,20 +230,11 @@ OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
{
FreeResource();
- //system fileopen only available in Windows and with gtk vclplug based
- //picker and on MacOSX (aqua version)
-#if !defined( WNT ) && !defined( ENABLE_GTK ) && !(defined(MACOSX) && defined(QUARTZ))
- aFileDlgFL.Hide();
- aFileDlgCB.Hide();
-#else
-# ifdef ENABLE_GTK
if (!lcl_HasSystemFilePicker())
{
aFileDlgFL.Hide();
aFileDlgCB.Hide();
}
-# endif
-#endif
#if ! defined(QUARTZ)
aPrintDlgFL.Hide();
@@ -691,6 +702,12 @@ OfaViewTabPage::OfaViewTabPage(Window* pParent, const SfxItemSet& rSet ) :
aMousePosLB ( this, SVX_RES( LB_MOUSEPOS ) ),
aMouseMiddleFT ( this, SVX_RES( FT_MOUSEMIDDLE ) ),
aMouseMiddleLB ( this, SVX_RES( LB_MOUSEMIDDLE ) ),
+
+ // #i97672#
+ maSelectionFL(this, SVX_RES(FL_SELECTION)),
+ maSelectionCB(this, SVX_RES(CB_SELECTION)),
+ maSelectionMF(this, SVX_RES(MF_SELECTION)),
+
nSizeLB_InitialSelection(0),
nStyleLB_InitialSelection(0),
pAppearanceCfg(new SvtTabAppearanceCfg),
@@ -753,6 +770,9 @@ OfaViewTabPage::OfaViewTabPage(Window* pParent, const SfxItemSet& rSet ) :
#endif
+ // #i97672#
+ maSelectionCB.SetToggleHdl( LINK( this, OfaViewTabPage, OnSelectionToggled ) );
+
FreeResource();
if( ! Application::ValidateSystemFont() )
@@ -807,6 +827,15 @@ IMPL_LINK( OfaViewTabPage, OnAntialiasingToggled, void*, NOTINTERESTEDIN )
}
#endif
+// #i97672#
+IMPL_LINK( OfaViewTabPage, OnSelectionToggled, void*, NOTINTERESTEDIN )
+{
+ (void)NOTINTERESTEDIN;
+ const bool bSelectionEnabled(maSelectionCB.IsChecked());
+ maSelectionMF.Enable(bSelectionEnabled);
+ return 0;
+}
+
/*-----------------06.12.96 11.50-------------------
--------------------------------------------------*/
@@ -828,6 +857,7 @@ BOOL OfaViewTabPage::FillItemSet( SfxItemSet& )
BOOL bModified = FALSE;
BOOL bMenuOptModified = FALSE;
+ bool bRepaintWindows(false);
SvtMiscOptions aMiscOptions;
UINT16 nSizeLB_NewSelection = aIconSizeLB.GetSelectEntryPos();
@@ -953,16 +983,30 @@ BOOL OfaViewTabPage::FillItemSet( SfxItemSet& )
{
mpDrawinglayerOpt->SetAntiAliasing(aUseAntiAliase.IsChecked());
bModified = TRUE;
+ bRepaintWindows = true;
+ }
+ }
- // react on AA change; invalidate all windows to force
- // a repaint when changing from AA to non-AA or vice-versa
- Window* pAppWindow = Application::GetFirstTopLevelWindow();
+ // #i97672#
+ if(maSelectionCB.IsEnabled())
+ {
+ const bool bNewSelection(maSelectionCB.IsChecked());
+ const sal_uInt16 nNewTransparence((sal_uInt16)maSelectionMF.GetValue());
- while(pAppWindow)
- {
- pAppWindow->Invalidate();
- pAppWindow = Application::GetNextTopLevelWindow(pAppWindow);
- }
+ if(bNewSelection != (bool)mpDrawinglayerOpt->IsTransparentSelection())
+ {
+ mpDrawinglayerOpt->SetTransparentSelection(maSelectionCB.IsChecked());
+ bModified = TRUE;
+ bRepaintWindows = true;
+ }
+
+ // #i104150# even read the value when maSelectionMF is disabled; it may have been
+ // modified by enabling-modify-disabling by the user
+ if(nNewTransparence != mpDrawinglayerOpt->GetTransparentSelectionPercent())
+ {
+ mpDrawinglayerOpt->SetTransparentSelectionPercent(nNewTransparence);
+ bModified = TRUE;
+ bRepaintWindows = true;
}
}
@@ -993,6 +1037,17 @@ BOOL OfaViewTabPage::FillItemSet( SfxItemSet& )
pAppearanceCfg->SetApplicationDefaults ( GetpApp() );
}
+ if(bRepaintWindows)
+ {
+ Window* pAppWindow = Application::GetFirstTopLevelWindow();
+
+ while(pAppWindow)
+ {
+ pAppWindow->Invalidate();
+ pAppWindow = Application::GetNextTopLevelWindow(pAppWindow);
+ }
+ }
+
return bModified;
}
@@ -1082,6 +1137,27 @@ void OfaViewTabPage::Reset( const SfxItemSet& )
aUseAntiAliase.SaveValue();
}
+ {
+ // #i97672# Selection
+ // check if transparent selection is possible on this system
+ const bool bTransparentSelectionPossible(
+ !GetSettings().GetStyleSettings().GetHighContrastMode()
+ && supportsOperation(OutDevSupport_TransparentRect));
+
+ // enter values
+ if(bTransparentSelectionPossible)
+ {
+ maSelectionCB.Check(mpDrawinglayerOpt->IsTransparentSelection());
+ }
+ else
+ {
+ maSelectionCB.Enable(false);
+ }
+
+ maSelectionMF.SetValue(mpDrawinglayerOpt->GetTransparentSelectionPercent());
+ maSelectionMF.Enable(mpDrawinglayerOpt->IsTransparentSelection() && bTransparentSelectionPossible);
+ }
+
#if defined( UNX )
aFontAntiAliasing.SaveValue();
aAAPointLimit.SaveValue();
@@ -1202,8 +1278,13 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe
// initialize user interface language selection
SvtLanguageTable* pLanguageTable = new SvtLanguageTable;
- String aStr( pLanguageTable->GetString( LANGUAGE_SYSTEM ) );
- aUserInterfaceLB.InsertEntry(aStr);
+ const String aStr( pLanguageTable->GetString( LANGUAGE_SYSTEM ) );
+
+ String aUILang(aStr);
+ aUILang += String::CreateFromAscii(" - ");
+ aUILang += pLanguageTable->GetString( Application::GetSettings().GetUILanguage() );
+
+ aUserInterfaceLB.InsertEntry(aUILang);
aUserInterfaceLB.SetEntryData(0, 0);
aUserInterfaceLB.SelectEntryPos(0);
try
@@ -1265,16 +1346,24 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe
}
aWesternLanguageLB.SetLanguageList( LANG_LIST_WESTERN | LANG_LIST_ONLY_KNOWN, TRUE, FALSE, TRUE );
- aAsianLanguageLB .SetLanguageList( LANG_LIST_CJK | LANG_LIST_ONLY_KNOWN, TRUE, FALSE, TRUE );
+ aWesternLanguageLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::LATIN );
+ aAsianLanguageLB.SetLanguageList( LANG_LIST_CJK | LANG_LIST_ONLY_KNOWN, TRUE, FALSE, TRUE );
+ aAsianLanguageLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::ASIAN );
aComplexLanguageLB.SetLanguageList( LANG_LIST_CTL | LANG_LIST_ONLY_KNOWN, TRUE, FALSE, TRUE );
- aLocaleSettingLB .SetLanguageList( LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, FALSE, FALSE, FALSE);
- aLocaleSettingLB.InsertLanguage( LANGUAGE_SYSTEM );
+ aComplexLanguageLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::COMPLEX );
+
+ aLocaleSettingLB.SetLanguageList( LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, FALSE, FALSE, FALSE);
+ aLocaleSettingLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::WEAK );
- // insert SYSTEM entry, no specific currency
- aCurrencyLB.InsertEntry( aStr );
+ const NfCurrencyTable& rCurrTab = SvNumberFormatter::GetTheCurrencyTable();
+ const NfCurrencyEntry& rCurr = SvNumberFormatter::GetCurrencyEntry( LANGUAGE_SYSTEM );
+ // insert SYSTEM entry
+ String aDefaultCurr(aStr);
+ aDefaultCurr += String::CreateFromAscii(" - ");
+ aDefaultCurr += rCurr.GetBankSymbol();
+ aCurrencyLB.InsertEntry( aDefaultCurr );
// all currencies
String aTwoSpace( RTL_CONSTASCII_USTRINGPARAM( " " ) );
- const NfCurrencyTable& rCurrTab = SvNumberFormatter::GetTheCurrencyTable();
USHORT nCurrCount = rCurrTab.Count();
// first entry is SYSTEM, skip it
for ( USHORT j=1; j < nCurrCount; ++j )
@@ -1497,7 +1586,7 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
if(!bCurrentDocCBChecked)
{
Any aValue;
- Locale aLocale = SvxCreateLocale( eSelectLang );
+ Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false );
aValue <<= aLocale;
OUString aPropName( C2U("DefaultLocale") );
pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
@@ -1506,7 +1595,8 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
}
if(pCurrentDocShell)
{
- rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_LANGUAGE));
+ rSet.Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, ::com::sun::star::i18n::ScriptType::LATIN),
+ SID_ATTR_LANGUAGE));
bRet = TRUE;
}
}
@@ -1517,7 +1607,7 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
if(!bCurrentDocCBChecked)
{
Any aValue;
- Locale aLocale = SvxCreateLocale( eSelectLang );
+ Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false );
aValue <<= aLocale;
OUString aPropName( C2U("DefaultLocale_CJK") );
pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
@@ -1526,7 +1616,8 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
}
if(pCurrentDocShell)
{
- rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_CHAR_CJK_LANGUAGE));
+ rSet.Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, ::com::sun::star::i18n::ScriptType::ASIAN),
+ SID_ATTR_CHAR_CJK_LANGUAGE));
bRet = TRUE;
}
}
@@ -1537,7 +1628,7 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
if(!bCurrentDocCBChecked)
{
Any aValue;
- Locale aLocale = SvxCreateLocale( eSelectLang );
+ Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false );
aValue <<= aLocale;
OUString aPropName( C2U("DefaultLocale_CTL") );
pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
@@ -1546,7 +1637,8 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
}
if(pCurrentDocShell)
{
- rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_CHAR_CTL_LANGUAGE));
+ rSet.Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, ::com::sun::star::i18n::ScriptType::COMPLEX),
+ SID_ATTR_CHAR_CTL_LANGUAGE));
bRet = TRUE;
}
}
@@ -1646,13 +1738,18 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet )
aWestLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale"));
Locale aLocale;
aWestLang >>= aLocale;
- eCurLang = SvxLocaleToLanguage( aLocale );
+
+ eCurLang = MsLangId::convertLocaleToLanguage( aLocale );
+
aCJKLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale_CJK"));
+ aLocale = Locale();
aCJKLang >>= aLocale;
- eCurLangCJK = SvxLocaleToLanguage( aLocale );
+ eCurLangCJK = MsLangId::convertLocaleToLanguage( aLocale );
+
aCTLLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale_CTL"));
+ aLocale = Locale();
aCTLLang >>= aLocale;
- eCurLangCTL = SvxLocaleToLanguage( aLocale );
+ eCurLangCTL = MsLangId::convertLocaleToLanguage( aLocale );
}
catch(Exception&)
{
@@ -1664,13 +1761,25 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet )
aCurrentDocCB.Check(bLanguageCurrentDoc_Impl);
const SfxPoolItem* pLang;
if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_LANGUAGE, FALSE, &pLang))
- eCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
+ {
+ LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
+ if (MsLangId::resolveSystemLanguageByScriptType(eCurLang, ::com::sun::star::i18n::ScriptType::LATIN) != eTempCurLang)
+ eCurLang = eTempCurLang;
+ }
if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_CHAR_CJK_LANGUAGE, FALSE, &pLang))
- eCurLangCJK = ((const SvxLanguageItem*)pLang)->GetValue();
+ {
+ LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
+ if (MsLangId::resolveSystemLanguageByScriptType(eCurLangCJK, ::com::sun::star::i18n::ScriptType::ASIAN) != eTempCurLang)
+ eCurLangCJK = eTempCurLang;
+ }
if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_CHAR_CTL_LANGUAGE, FALSE, &pLang))
- eCurLangCTL = ((const SvxLanguageItem*)pLang)->GetValue();
+ {
+ LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
+ if (MsLangId::resolveSystemLanguageByScriptType(eCurLangCTL, ::com::sun::star::i18n::ScriptType::COMPLEX) != eTempCurLang)
+ eCurLangCTL = eTempCurLang;
+ }
}
if(LANGUAGE_NONE == eCurLang || LANGUAGE_DONTKNOW == eCurLang)
aWesternLanguageLB.SelectLanguage(LANGUAGE_NONE);
diff --git a/svx/source/cui/optgdlg.hrc b/svx/source/cui/optgdlg.hrc
index b8dc903879ed..3ad985caa706 100644
--- a/svx/source/cui/optgdlg.hrc
+++ b/svx/source/cui/optgdlg.hrc
@@ -91,6 +91,10 @@
#define ROW_FT_MOUSEMIDDLE (ROW_LB_MOUSEPOS + RSC_CD_DROPDOWN_HEIGHT + ROWSPACE)
#define ROW_LB_MOUSEMIDDLE (ROW_FT_MOUSEMIDDLE + RSC_CD_FIXEDTEXT_HEIGHT + ROWSPACE)
+// #i97672#
+#define ROW_FL_SELECTION (ROW_LB_MOUSEMIDDLE + RSC_CD_DROPDOWN_HEIGHT + RSC_SP_FLGR_SPACE_X)
+#define ROW_CB_SELECTION (ROW_FL_SELECTION + RSC_CD_FIXEDLINE_HEIGHT + ROWSPACE)
+
// tabpage general -------------------------------------------------------
#define FL_HELP 10
@@ -150,6 +154,11 @@
#define CB_USE_HARDACCELL 68
#define CB_USE_ANTIALIASE 69
+// #i97672#
+#define FL_SELECTION 70
+#define CB_SELECTION 71
+#define MF_SELECTION 72
+
// tabpage languages -----------------------------------------------------
#define FL_UI_LANG 1
diff --git a/svx/source/cui/optgdlg.hxx b/svx/source/cui/optgdlg.hxx
index c44087708b31..4b86896fa58f 100644
--- a/svx/source/cui/optgdlg.hxx
+++ b/svx/source/cui/optgdlg.hxx
@@ -129,6 +129,11 @@ private:
FixedText aMouseMiddleFT;
ListBox aMouseMiddleLB;
+ // #i97672#
+ FixedLine maSelectionFL;
+ CheckBox maSelectionCB;
+ MetricField maSelectionMF;
+
UINT16 nSizeLB_InitialSelection;
UINT16 nStyleLB_InitialSelection;
BOOL bSfxSymbolsAuto;
@@ -140,6 +145,9 @@ private:
#if defined( UNX )
DECL_LINK( OnAntialiasingToggled, void* );
#endif
+ // #i97672#
+ DECL_LINK( OnSelectionToggled, void* );
+
public:
OfaViewTabPage( Window* pParent, const SfxItemSet& rSet );
~OfaViewTabPage();
diff --git a/svx/source/cui/optgdlg.src b/svx/source/cui/optgdlg.src
index 7f3ad6968079..f663a7ed44ef 100644
--- a/svx/source/cui/optgdlg.src
+++ b/svx/source/cui/optgdlg.src
@@ -404,6 +404,38 @@ TabPage OFA_TP_VIEW
};
};
+ // #i97672#
+ FixedLine FL_SELECTION
+ {
+ Pos = MAP_APPFONT ( 133 , ROW_FL_SELECTION ) ;
+ Size = MAP_APPFONT ( 120 , 8 ) ;
+ Text [ en-US ] = "Selection";
+ };
+
+ CheckBox CB_SELECTION
+ {
+ Pos = MAP_APPFONT ( 139, ROW_CB_SELECTION + (((12 - RSC_CD_CHECKBOX_HEIGHT) / 2) + 1)) ;
+ Size = MAP_APPFONT ( 118 - 34 , RSC_CD_CHECKBOX_HEIGHT ) ;
+ Text [ en-US ] = "Transparency" ;
+ };
+
+ MetricField MF_SELECTION
+ {
+ Pos = MAP_APPFONT ( 139 + (95 - 12), ROW_CB_SELECTION ) ;
+ Size = MAP_APPFONT ( 31 , 12 ) ;
+ Border = TRUE ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 10 ;
+ Maximum = 90 ;
+ DecimalDigits = 0 ;
+ First = 10 ;
+ Last = 90 ;
+ SpinSize = 5 ;
+ Unit = FUNIT_CUSTOM ;
+ CustomUnitText [ en-US ] = "%" ;
+ };
};
// *******************************************************************
@@ -428,13 +460,13 @@ TabPage OFA_TP_LANGUAGES
FixedText FT_USERINTERFACE
{
Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
+ Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "~User interface";
};
ListBox LB_USERINTERFACE
{
- Pos = MAP_APPFONT ( 135 , 14 ) ;
- Size = MAP_APPFONT ( 113 , 60 ) ;
+ Pos = MAP_APPFONT ( 123 , 14 ) ;
+ Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ;
Border = TRUE ;
TabStop = TRUE ;
@@ -449,13 +481,13 @@ TabPage OFA_TP_LANGUAGES
FixedText FT_LOCALESETTING
{
Pos = MAP_APPFONT ( 12 , 31 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
+ Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "Locale setting";
};
ListBox LB_LOCALESETTING
{
- Pos = MAP_APPFONT ( 135 , 30 ) ;
- Size = MAP_APPFONT ( 113 , 60 ) ;
+ Pos = MAP_APPFONT ( 123 , 30 ) ;
+ Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ;
Border = TRUE ;
TabStop = TRUE ;
@@ -464,13 +496,13 @@ TabPage OFA_TP_LANGUAGES
FixedText FT_DECIMALSEPARATOR
{
Pos = MAP_APPFONT ( 12 , 46 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
+ Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "Decimal separator key";
};
CheckBox CB_DECIMALSEPARATOR
{
- Pos = MAP_APPFONT ( 135 , 46) ;
- Size = MAP_APPFONT ( 119 , RSC_CD_CHECKBOX_HEIGHT ) ;
+ Pos = MAP_APPFONT ( 123 , 46) ;
+ Size = MAP_APPFONT ( 125 , RSC_CD_CHECKBOX_HEIGHT ) ;
Text [ en-US ] = "~Same as locale setting ( %1 )";
};
FixedImage FI_CURRENCY
@@ -482,13 +514,13 @@ TabPage OFA_TP_LANGUAGES
FixedText FT_CURRENCY
{
Pos = MAP_APPFONT ( 12 , 61 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
+ Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "~Default currency";
};
ListBox LB_CURRENCY
{
- Pos = MAP_APPFONT ( 135 , 59 ) ;
- Size = MAP_APPFONT ( 113 , 60 ) ;
+ Pos = MAP_APPFONT ( 123 , 59 ) ;
+ Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ;
Border = TRUE ;
TabStop = TRUE ;
@@ -509,14 +541,14 @@ TabPage OFA_TP_LANGUAGES
FixedText FT_WEST_LANG
{
Pos = MAP_APPFONT ( 12 , 90 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
+ Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "Western";
};
ListBox LB_WEST_LANG
{
- Pos = MAP_APPFONT ( 135 , 88 ) ;
- Size = MAP_APPFONT ( 113 , 60 ) ;
+ Pos = MAP_APPFONT ( 123 , 88 ) ;
+ Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ;
Border = TRUE ;
TabStop = TRUE ;
@@ -531,13 +563,13 @@ TabPage OFA_TP_LANGUAGES
FixedText FT_ASIAN_LANG
{
Pos = MAP_APPFONT ( 12 , 106 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
+ Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "Asian";
};
ListBox LB_ASIAN_LANG
{
- Pos = MAP_APPFONT ( 135 , 104 ) ;
- Size = MAP_APPFONT ( 113 , 60 ) ;
+ Pos = MAP_APPFONT ( 123 , 104 ) ;
+ Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ;
Border = TRUE ;
TabStop = TRUE ;
@@ -552,13 +584,13 @@ TabPage OFA_TP_LANGUAGES
FixedText FT_COMPLEX_LANG
{
Pos = MAP_APPFONT ( 12 , 122 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
+ Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "C~TL";
};
ListBox LB_COMPLEX_LANG
{
- Pos = MAP_APPFONT ( 135 , 120 ) ;
- Size = MAP_APPFONT ( 113 , 60 ) ;
+ Pos = MAP_APPFONT ( 123 , 120 ) ;
+ Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ;
Border = TRUE ;
TabStop = TRUE ;
@@ -566,8 +598,8 @@ TabPage OFA_TP_LANGUAGES
};
CheckBox CB_CURRENT_DOC
{
- Pos = MAP_APPFONT ( 135 , 135 ) ;
- Size = MAP_APPFONT ( 113 , RSC_CD_CHECKBOX_HEIGHT ) ;
+ Pos = MAP_APPFONT ( 123 , 135 ) ;
+ Size = MAP_APPFONT ( 125 , RSC_CD_CHECKBOX_HEIGHT ) ;
Text [ en-US ] = "For the current document only";
};
FixedLine FL_ENHANCED
diff --git a/svx/source/cui/optgenrl.cxx b/svx/source/cui/optgenrl.cxx
index 1766dd58de72..7159cfdd7e61 100644
--- a/svx/source/cui/optgenrl.cxx
+++ b/svx/source/cui/optgenrl.cxx
@@ -103,6 +103,7 @@ SvxGeneralTabPage::SvxGeneralTabPage( Window* pParent, const SfxItemSet& rCoreSe
aCompanyEdit ( this, SVX_RES( ED_COMPANY ), INDEX_NOTSET, &aCompanyLbl ),
aNameLbl ( this, SVX_RES( FT_NAME ), true ),
aNameLblRuss ( this, SVX_RES( FT_NAME_RUSS ), true ),
+ aNameLblEastern ( this, SVX_RES( FT_NAME_EASTERN ), true ),
aFirstName ( this, SVX_RES( ED_FIRSTNAME ), 0, &aNameLbl ),
aFatherName ( this, SVX_RES( ED_FATHERNAME ) ),
aName ( this, SVX_RES( ED_NAME ), 1, &aNameLbl ),
@@ -189,6 +190,23 @@ SvxGeneralTabPage::SvxGeneralTabPage( Window* pParent, const SfxItemSet& rCoreSe
aFirstName.SetZOrder( &aName, WINDOW_ZORDER_BEHIND );
aFatherName.SetZOrder( &aFirstName, WINDOW_ZORDER_BEHIND );
}
+ else if ( LANGUAGE_JAPANESE == eLang ||
+ LANGUAGE_KOREAN == eLang ||
+ LANGUAGE_CHINESE_TRADITIONAL == eLang ||
+ LANGUAGE_CHINESE_SIMPLIFIED == eLang)
+ {
+ aUsCityEdit.Hide();
+ aUsStateEdit.Hide();
+ aUsZipEdit.Hide();
+ aNameLbl.Hide();
+ aNameLblEastern.Show();
+
+ // swap "first name" field and "last name" field
+ Point aPosTmp = aFirstName.GetPosPixel();
+ aFirstName.SetPosPixel( aName.GetPosPixel() );
+ aName.SetPosPixel( aPosTmp );
+ aFirstName.SetZOrder( &aName, WINDOW_ZORDER_BEHIND );
+ }
else
{
aUsCityEdit.Hide();
diff --git a/svx/source/cui/optsave.cxx b/svx/source/cui/optsave.cxx
index 67ac02536b47..29708444fe93 100644
--- a/svx/source/cui/optsave.cxx
+++ b/svx/source/cui/optsave.cxx
@@ -245,38 +245,57 @@ SfxSaveTabPage::SfxSaveTabPage( Window* pParent, const SfxItemSet& rCoreSet ) :
SvtModuleOptions aModuleOpt;
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SMATH ) )
+ {
aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_MATH ));
+ aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_MATH ));
+ }
else
{
pImpl->aDefaultArr[APP_MATH] = aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_MATH);
pImpl->aDefaultReadonlyArr[APP_MATH] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::E_MATH);
}
+
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SDRAW ) )
+ {
aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_DRAW ));
+ aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_DRAW ));
+ }
else
{
pImpl->aDefaultArr[APP_DRAW] = aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_DRAW);
pImpl->aDefaultReadonlyArr[APP_DRAW] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::E_DRAW);
}
+
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) )
+ {
aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_IMPRESS ));
+ aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_IMPRESS ));
+ }
else
{
pImpl->aDefaultArr[APP_IMPRESS] = aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_IMPRESS);
pImpl->aDefaultReadonlyArr[APP_IMPRESS] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::E_IMPRESS);
}
+
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SCALC ) )
+ {
aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_CALC ));
+ aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_CALC ));
+ }
else
{
pImpl->aDefaultArr[APP_CALC] = aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_CALC);
pImpl->aDefaultReadonlyArr[APP_CALC] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::E_CALC);
}
+
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SWRITER ) )
{
aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_WRITER ));
aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_WRITER_WEB ));
aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_WRITER_GLOBAL ));
+ aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_WRITER ));
+ aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_WRITER_WEB ));
+ aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_WRITER_GLOBAL ));
}
else
{
@@ -718,18 +737,23 @@ OUString lcl_ExtracUIName(const Sequence<PropertyValue> rProperties)
---------------------------------------------------------------------------*/
IMPL_LINK( SfxSaveTabPage, FilterHdl_Impl, ListBox *, pBox )
{
- if(&aDocTypeLB == pBox)
+ USHORT nCurPos = aDocTypeLB.GetSelectEntryPos();
+
+ long nData = -1;
+ if(nCurPos < APP_COUNT)
+ nData = (long) aDocTypeLB.GetEntryData(nCurPos);
+
+ if ( nData >= 0 && nData < APP_COUNT )
{
- USHORT nAppPos = pBox->GetSelectEntryPos();
- if ( nAppPos < APP_COUNT )
+ if(&aDocTypeLB == pBox)
{
aSaveAsLB.Clear();
- const OUString* pFilters = pImpl->aFilterArr[nAppPos].getConstArray();
- if(!pImpl->aUIFilterArr[nAppPos].getLength())
+ const OUString* pFilters = pImpl->aFilterArr[nData].getConstArray();
+ if(!pImpl->aUIFilterArr[nData].getLength())
{
- pImpl->aUIFilterArr[nAppPos].realloc(pImpl->aFilterArr[nAppPos].getLength());
- OUString* pUIFilters = pImpl->aUIFilterArr[nAppPos].getArray();
- for(int nFilter = 0; nFilter < pImpl->aFilterArr[nAppPos].getLength(); nFilter++)
+ pImpl->aUIFilterArr[nData].realloc(pImpl->aFilterArr[nData].getLength());
+ OUString* pUIFilters = pImpl->aUIFilterArr[nData].getArray();
+ for(int nFilter = 0; nFilter < pImpl->aFilterArr[nData].getLength(); nFilter++)
{
Any aProps = pImpl->xFact->getByName(pFilters[nFilter]);
Sequence<PropertyValue> aProperties;
@@ -737,37 +761,36 @@ IMPL_LINK( SfxSaveTabPage, FilterHdl_Impl, ListBox *, pBox )
pUIFilters[nFilter] = lcl_ExtracUIName(aProperties);
}
}
- const OUString* pUIFilters = pImpl->aUIFilterArr[nAppPos].getConstArray();
+ const OUString* pUIFilters = pImpl->aUIFilterArr[nData].getConstArray();
OUString sSelect;
- for(int i = 0; i < pImpl->aUIFilterArr[nAppPos].getLength(); i++)
+ for(int i = 0; i < pImpl->aUIFilterArr[nData].getLength(); i++)
{
USHORT nEntryPos = aSaveAsLB.InsertEntry(pUIFilters[i]);
- if ( pImpl->aODFArr[nAppPos][i] )
+ if ( pImpl->aODFArr[nData][i] )
aSaveAsLB.SetEntryData( nEntryPos, (void*)pImpl );
- if(pFilters[i] == pImpl->aDefaultArr[nAppPos])
+ if(pFilters[i] == pImpl->aDefaultArr[nData])
sSelect = pUIFilters[i];
}
if(sSelect.getLength())
aSaveAsLB.SelectEntry(sSelect);
- aSaveAsFI.Show(pImpl->aDefaultReadonlyArr[nAppPos]);
- aSaveAsFT.Enable(!pImpl->aDefaultReadonlyArr[nAppPos]);
- aSaveAsLB.Enable(!pImpl->aDefaultReadonlyArr[nAppPos]);
+ aSaveAsFI.Show(pImpl->aDefaultReadonlyArr[nData]);
+ aSaveAsFT.Enable(!pImpl->aDefaultReadonlyArr[nData]);
+ aSaveAsLB.Enable(!pImpl->aDefaultReadonlyArr[nData]);
}
- }
- else
- {
- OUString sSelect = pBox->GetSelectEntry();
- USHORT nPos = aDocTypeLB.GetSelectEntryPos();
- const OUString* pFilters = pImpl->aFilterArr[nPos].getConstArray();
- OUString* pUIFilters = pImpl->aUIFilterArr[nPos].getArray();
- for(int i = 0; i < pImpl->aUIFilterArr[nPos].getLength(); i++)
- if(pUIFilters[i] == sSelect)
- {
- sSelect = pFilters[i];
- break;
- }
+ else
+ {
+ OUString sSelect = pBox->GetSelectEntry();
+ const OUString* pFilters = pImpl->aFilterArr[nData].getConstArray();
+ OUString* pUIFilters = pImpl->aUIFilterArr[nData].getArray();
+ for(int i = 0; i < pImpl->aUIFilterArr[nData].getLength(); i++)
+ if(pUIFilters[i] == sSelect)
+ {
+ sSelect = pFilters[i];
+ break;
+ }
- pImpl->aDefaultArr[nPos] = sSelect;
+ pImpl->aDefaultArr[nData] = sSelect;
+ }
}
ODFVersionHdl_Impl( &aSaveAsLB );
@@ -777,7 +800,7 @@ IMPL_LINK( SfxSaveTabPage, FilterHdl_Impl, ListBox *, pBox )
IMPL_LINK( SfxSaveTabPage, ODFVersionHdl_Impl, ListBox *, EMPTYARG )
{
long nVersion = long( aODFVersionLB.GetEntryData( aODFVersionLB.GetSelectEntryPos() ) );
- bool bShown = SvtSaveOptions::ODFDefaultVersion( nVersion ) == SvtSaveOptions::ODFVER_012;
+ bool bShown = SvtSaveOptions::ODFDefaultVersion( nVersion ) != SvtSaveOptions::ODFVER_LATEST;
if ( bShown )
{
bool bHasODFFormat = false;
@@ -795,8 +818,8 @@ IMPL_LINK( SfxSaveTabPage, ODFVersionHdl_Impl, ListBox *, EMPTYARG )
|| ( aSaveAsLB.GetEntryData( aSaveAsLB.GetSelectEntryPos() ) != NULL );
}
- aODFWarningFI.Show( !bShown );
- aODFWarningFT.Show( !bShown );
+ aODFWarningFI.Show( bShown );
+ aODFWarningFT.Show( bShown );
return 0;
}
diff --git a/svx/source/cui/selector.cxx b/svx/source/cui/selector.cxx
index 39e22e5ab9f2..83e4aa2b1612 100644
--- a/svx/source/cui/selector.cxx
+++ b/svx/source/cui/selector.cxx
@@ -1053,6 +1053,7 @@ SvxScriptSelectorDialog::SvxScriptSelectorDialog(
aCategories.SetSelectHdl(
LINK( this, SvxScriptSelectorDialog, SelectHdl ) );
aCommands.SetSelectHdl( LINK( this, SvxScriptSelectorDialog, SelectHdl ) );
+ aCommands.SetDoubleClickHdl( LINK( this, SvxScriptSelectorDialog, FunctionDoubleClickHdl ) );
aOKButton.SetClickHdl( LINK( this, SvxScriptSelectorDialog, ClickHdl ) );
aCancelButton.SetClickHdl( LINK( this, SvxScriptSelectorDialog, ClickHdl ) );
@@ -1140,6 +1141,14 @@ IMPL_LINK( SvxScriptSelectorDialog, SelectHdl, Control*, pCtrl )
return 0;
}
+IMPL_LINK( SvxScriptSelectorDialog, FunctionDoubleClickHdl, Control*, pCtrl )
+{
+ (void)pCtrl;
+ if ( aOKButton.IsEnabled() )
+ return ClickHdl( &aOKButton );
+ return 0;
+}
+
// Check if command is selected and enable the OK button accordingly
// Grab the help text for this id if available and update the description field
void
diff --git a/svx/source/cui/selector.hxx b/svx/source/cui/selector.hxx
index fe6152131c9d..10346f251563 100644
--- a/svx/source/cui/selector.hxx
+++ b/svx/source/cui/selector.hxx
@@ -216,6 +216,7 @@ class SvxScriptSelectorDialog : public ModelessDialog
DECL_LINK( ClickHdl, Button * );
DECL_LINK( SelectHdl, Control* );
+ DECL_LINK( FunctionDoubleClickHdl, Control* );
void UpdateUI();
void ResizeControls();
diff --git a/svx/source/cui/showcols.cxx b/svx/source/cui/showcols.cxx
index bf225508310e..734b59e1f6fe 100644
--- a/svx/source/cui/showcols.cxx
+++ b/svx/source/cui/showcols.cxx
@@ -36,19 +36,17 @@
#endif
#include "showcols.hxx"
-#ifndef _SVX_FMRESIDS_HRC
#include "fmresids.hrc"
-#endif
#include <tools/shl.hxx>
#include <svx/dialmgr.hxx>
#include <vcl/msgbox.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <comphelper/extract.hxx>
#include <comphelper/types.hxx>
-#include "fmstatic.hxx" //CHINA001
-IMPLEMENT_CONSTASCII_USTRING(CUIFM_PROP_HIDDEN, "Hidden");
-IMPLEMENT_CONSTASCII_USTRING(CUIFM_PROP_LABEL,"Label");
+#define CUIFM_PROP_HIDDEN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Hidden" ) )
+#define CUIFM_PROP_LABEL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" ) )
+
//==========================================================================
// FmShowColsDialog
//==========================================================================
diff --git a/svx/source/cui/svuidlg.src b/svx/source/cui/svuidlg.src
index a00a09e919e6..cc8f2db676ae 100644
--- a/svx/source/cui/svuidlg.src
+++ b/svx/source/cui/svuidlg.src
@@ -156,37 +156,37 @@ ModalDialog MD_UPDATE_BASELINKS
};
CancelButton 1
{
- Pos = MAP_APPFONT ( 275 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT ( 270 , 6 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Close" ;
};
HelpButton 1
{
- Pos = MAP_APPFONT ( 275 , 26 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT ( 270 , 26 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
};
PushButton PB_UPDATE_NOW
{
- Pos = MAP_APPFONT ( 275 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT ( 270 , 43 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Update" ;
};
PushButton PB_OPEN_SOURCE
{
- Pos = MAP_APPFONT ( 275 , 60 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT ( 270 , 60 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Open" ;
};
PushButton PB_CHANGE_SOURCE
{
- Pos = MAP_APPFONT ( 275 , 77 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT ( 270 , 77 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Modify..." ;
};
PushButton PB_BREAK_LINK
{
- Pos = MAP_APPFONT ( 275 , 94 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT ( 270 , 94 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Break Link" ;
};
FixedText FT_FILES2
diff --git a/svx/source/cui/treeopt.cxx b/svx/source/cui/treeopt.cxx
index 7491b2bb1cc5..744f9d5c1dbe 100644
--- a/svx/source/cui/treeopt.cxx
+++ b/svx/source/cui/treeopt.cxx
@@ -64,6 +64,8 @@
#include <com/sun/star/awt/XContainerWindowEventHandler.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/awt/XTabController.hpp>
#include <vcl/help.hxx>
#ifndef _LINGUISTIC_MISC_HHX_
#include <linguistic/misc.hxx>
@@ -2745,10 +2747,23 @@ void ExtensionsTabPage::CreateDialogWithHandler()
if ( !bWithHandler || m_xEventHdl.is() )
{
+ SetStyle( GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL );
Reference< awt::XWindowPeer > xParent( VCLUnoHelper::GetInterface( this ), UNO_QUERY );
m_xPage = Reference < awt::XWindow >(
m_xWinProvider->createContainerWindow(
m_sPageURL, rtl::OUString(), xParent, m_xEventHdl ), UNO_QUERY );
+
+ Reference< awt::XControl > xPageControl( m_xPage, UNO_QUERY );
+ if ( xPageControl.is() )
+ {
+ Reference< awt::XWindowPeer > xWinPeer( xPageControl->getPeer() );
+ if ( xWinPeer.is() )
+ {
+ Window* pWindow = VCLUnoHelper::GetWindow( xWinPeer );
+ if ( pWindow )
+ pWindow->SetStyle( pWindow->GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL );
+ }
+ }
}
}
catch ( ::com::sun::star::lang::IllegalArgumentException& )
diff --git a/svx/source/cui/webconninfo.cxx b/svx/source/cui/webconninfo.cxx
index 8fdf6a26d2bd..997c246abf1e 100644
--- a/svx/source/cui/webconninfo.cxx
+++ b/svx/source/cui/webconninfo.cxx
@@ -44,9 +44,10 @@
#include <com/sun/star/task/UrlRecord.hpp>
#include <com/sun/star/task/XPasswordContainer.hpp>
#include <com/sun/star/task/XMasterPasswordHandling.hpp>
+#include "com/sun/star/task/XUrlContainer.hpp"
#include <comphelper/processfactory.hxx>
-#include <svtools/docpasswdrequest.hxx>
+#include <comphelper/docpasswordrequest.hxx>
#include "webconninfo.hxx"
#include "webconninfo.hrc"
@@ -116,7 +117,7 @@ WebConnectionInfoDialog::WebConnectionInfoDialog( Window* pParent ) :
,m_aButtonsFL ( this, SVX_RES( FL_BUTTONS ) )
,m_aCloseBtn ( this, SVX_RES( PB_CLOSE ) )
,m_aHelpBtn ( this, SVX_RES( PB_HELP ) )
-
+ ,m_nPos ( -1 )
{
static long aStaticTabs[]= { 3, 0, 150, 250 };
m_aPasswordsLB.SetTabs( aStaticTabs );
@@ -211,6 +212,7 @@ void WebConnectionInfoDialog::FillPasswordList()
uno::Sequence< task::UrlRecord > aURLEntries = xPasswdContainer->getAllPersistent( xInteractionHandler );
sal_Int32 nCount = 0;
for ( sal_Int32 nURLInd = 0; nURLInd < aURLEntries.getLength(); nURLInd++ )
+ {
for ( sal_Int32 nUserInd = 0; nUserInd < aURLEntries[nURLInd].UserList.getLength(); nUserInd++ )
{
::rtl::OUString aUIEntry( aURLEntries[nURLInd].Url );
@@ -219,6 +221,25 @@ void WebConnectionInfoDialog::FillPasswordList()
SvLBoxEntry* pEntry = m_aPasswordsLB.InsertEntry( aUIEntry );
pEntry->SetUserData( (void*)(nCount++) );
}
+ }
+
+ // remember pos of first url container entry.
+ m_nPos = nCount;
+
+ uno::Reference< task::XUrlContainer > xUrlContainer(
+ xPasswdContainer, uno::UNO_QUERY_THROW );
+
+ uno::Sequence< rtl::OUString > aUrls
+ = xUrlContainer->getUrls( sal_True /* OnlyPersistent */ );
+
+ for ( sal_Int32 nURLIdx = 0; nURLIdx < aUrls.getLength(); nURLIdx++ )
+ {
+ ::rtl::OUString aUIEntry( aUrls[ nURLIdx ] );
+ aUIEntry += ::rtl::OUString::valueOf( (sal_Unicode)'\t' );
+ aUIEntry += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*" ) );
+ SvLBoxEntry* pEntry = m_aPasswordsLB.InsertEntry( aUIEntry );
+ pEntry->SetUserData( (void*)(nCount++) );
+ }
}
}
catch( uno::Exception& )
@@ -230,22 +251,29 @@ IMPL_LINK( WebConnectionInfoDialog, RemovePasswordHdl, PushButton*, EMPTYARG )
{
try
{
- uno::Reference< task::XPasswordContainer > xPasswdContainer(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ),
- uno::UNO_QUERY_THROW );
-
- uno::Reference< task::XInteractionHandler > xInteractionHandler(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.InteractionHandler" ) ) ),
- uno::UNO_QUERY_THROW );
-
SvLBoxEntry* pEntry = m_aPasswordsLB.GetCurEntry();
if ( pEntry )
{
::rtl::OUString aURL = m_aPasswordsLB.GetEntryText( pEntry, 0 );
::rtl::OUString aUserName = m_aPasswordsLB.GetEntryText( pEntry, 1 );
- xPasswdContainer->removePersistent( aURL, aUserName );
+
+ uno::Reference< task::XPasswordContainer > xPasswdContainer(
+ comphelper::getProcessServiceFactory()->createInstance(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.task.PasswordContainer" ) ) ),
+ uno::UNO_QUERY_THROW );
+
+ sal_Int32 nPos = (sal_Int32)(sal_IntPtr)pEntry->GetUserData();
+ if ( nPos < m_nPos )
+ {
+ xPasswdContainer->removePersistent( aURL, aUserName );
+ }
+ else
+ {
+ uno::Reference< task::XUrlContainer > xUrlContainer(
+ xPasswdContainer, uno::UNO_QUERY_THROW );
+ xUrlContainer->removeUrl( aURL );
+ }
m_aPasswordsLB.RemoveEntry( pEntry );
}
}
@@ -262,11 +290,20 @@ IMPL_LINK( WebConnectionInfoDialog, RemoveAllPasswordsHdl, PushButton*, EMPTYARG
{
uno::Reference< task::XPasswordContainer > xPasswdContainer(
comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.task.PasswordContainer" ) ) ),
uno::UNO_QUERY_THROW );
// should the master password be requested before?
xPasswdContainer->removeAllPersistent();
+
+ uno::Reference< task::XUrlContainer > xUrlContainer(
+ xPasswdContainer, uno::UNO_QUERY_THROW );
+ uno::Sequence< rtl::OUString > aUrls
+ = xUrlContainer->getUrls( sal_True /* OnlyPersistent */ );
+ for ( sal_Int32 nURLIdx = 0; nURLIdx < aUrls.getLength(); nURLIdx++ )
+ xUrlContainer->removeUrl( aUrls[ nURLIdx ] );
+
m_aPasswordsLB.Clear();
}
catch( uno::Exception& )
@@ -280,35 +317,38 @@ IMPL_LINK( WebConnectionInfoDialog, ChangePasswordHdl, PushButton*, EMPTYARG )
{
try
{
- uno::Reference< task::XPasswordContainer > xPasswdContainer(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ),
- uno::UNO_QUERY_THROW );
-
- uno::Reference< task::XInteractionHandler > xInteractionHandler(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.InteractionHandler" ) ) ),
- uno::UNO_QUERY_THROW );
-
-
SvLBoxEntry* pEntry = m_aPasswordsLB.GetCurEntry();
if ( pEntry )
{
::rtl::OUString aURL = m_aPasswordsLB.GetEntryText( pEntry, 0 );
::rtl::OUString aUserName = m_aPasswordsLB.GetEntryText( pEntry, 1 );
- RequestDocumentPassword* pPasswordRequest = new RequestDocumentPassword(
- task::PasswordRequestMode_PASSWORD_CREATE,
- aURL );
-
+ ::comphelper::DocPasswordRequest* pPasswordRequest
+ = new ::comphelper::DocPasswordRequest(
+ ::comphelper::DocPasswordRequestType_STANDARD,
+ task::PasswordRequestMode_PASSWORD_CREATE, aURL );
uno::Reference< task::XInteractionRequest > rRequest( pPasswordRequest );
+
+ uno::Reference< task::XInteractionHandler > xInteractionHandler(
+ comphelper::getProcessServiceFactory()->createInstance(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.task.InteractionHandler" ) ) ),
+ uno::UNO_QUERY_THROW );
xInteractionHandler->handle( rRequest );
+
if ( pPasswordRequest->isPassword() )
{
String aNewPass = pPasswordRequest->getPassword();
uno::Sequence< ::rtl::OUString > aPasswd( 1 );
aPasswd[0] = aNewPass;
- xPasswdContainer->addPersistent( aURL, aUserName, aPasswd, xInteractionHandler );
+
+ uno::Reference< task::XPasswordContainer > xPasswdContainer(
+ comphelper::getProcessServiceFactory()->createInstance(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.task.PasswordContainer" ) ) ),
+ uno::UNO_QUERY_THROW );
+ xPasswdContainer->addPersistent(
+ aURL, aUserName, aPasswd, xInteractionHandler );
}
}
}
@@ -330,7 +370,11 @@ IMPL_LINK( WebConnectionInfoDialog, EntrySelectedHdl, void*, EMPTYARG )
else
{
m_aRemoveBtn.Enable( TRUE );
- m_aChangeBtn.Enable( TRUE );
+
+ // url container entries (-> use system credentials) have
+ // no password
+ sal_Int32 nPos = (sal_Int32)(sal_IntPtr)pEntry->GetUserData();
+ m_aChangeBtn.Enable( nPos < m_nPos );
}
return 0;
diff --git a/svx/source/cui/webconninfo.hxx b/svx/source/cui/webconninfo.hxx
index 775d5072393c..f24b9f0dd4c8 100644
--- a/svx/source/cui/webconninfo.hxx
+++ b/svx/source/cui/webconninfo.hxx
@@ -65,6 +65,7 @@ namespace svx
FixedLine m_aButtonsFL;
CancelButton m_aCloseBtn;
HelpButton m_aHelpBtn;
+ sal_Int32 m_nPos;
DECL_LINK( HeaderBarClickedHdl, SvxSimpleTable* );
DECL_LINK( RemovePasswordHdl, PushButton* );
diff --git a/svx/source/cui/zoom.src b/svx/source/cui/zoom.src
index dca32260ab8d..197d1e2f2959 100644
--- a/svx/source/cui/zoom.src
+++ b/svx/source/cui/zoom.src
@@ -37,48 +37,48 @@ ModalDialog RID_SVXDLG_ZOOM
HelpId = SID_ATTR_ZOOM ;
OutputSize = TRUE ;
SvLook = TRUE ;
- Size = MAP_APPFONT ( 218 , 112 ) ;
+ Size = MAP_APPFONT ( 242 , 112 ) ;
Moveable = TRUE ;
Text [ en-US ] = "Zoom & View Layout";
FixedLine FL_ZOOM
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
+ Size = MAP_APPFONT ( 112 , 8 ) ;
Text [ en-US ] = "Zoom factor";
};
RadioButton BTN_OPTIMAL
{
Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 91 , 10 ) ;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "~Optimal" ;
};
RadioButton BTN_WHOLE_PAGE
{
Pos = MAP_APPFONT ( 12 , 27 ) ;
- Size = MAP_APPFONT ( 91 , 10 ) ;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "~Fit width and height" ;
};
RadioButton BTN_PAGE_WIDTH
{
Pos = MAP_APPFONT ( 12 , 40 ) ;
- Size = MAP_APPFONT ( 91 , 10 ) ;
+ Size = MAP_APPFONT ( 105, 10 ) ;
Text [ en-US ] = "Fit ~width" ;
};
RadioButton BTN_100
{
Pos = MAP_APPFONT ( 12 , 53 ) ;
- Size = MAP_APPFONT ( 91 , 10 ) ;
+ Size = MAP_APPFONT ( 105, 10 ) ;
Text = "~100 %" ;
};
RadioButton BTN_USER
{
Pos = MAP_APPFONT ( 12 , 67 ) ;
- Size = MAP_APPFONT ( 59 , 10 ) ;
+ Size = MAP_APPFONT ( 72 , 10 ) ;
Text [ en-US ] = "~Variable" ;
};
MetricField ED_USER
{
- Pos = MAP_APPFONT ( 74 , 66 ) ;
+ Pos = MAP_APPFONT ( 86 , 66 ) ;
Size = MAP_APPFONT ( 32 , 12 ) ;
Border = TRUE ;
Group = TRUE ;
@@ -91,31 +91,31 @@ ModalDialog RID_SVXDLG_ZOOM
};
FixedLine FL_VIEWLAYOUT
{
- Pos = MAP_APPFONT ( 112 , 3 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
+ Pos = MAP_APPFONT ( 124 , 3 ) ;
+ Size = MAP_APPFONT ( 112 , 8 ) ;
Text [ en-US ] = "View layout";
};
RadioButton BTN_AUTOMATIC
{
- Pos = MAP_APPFONT ( 118 , 14 ) ;
- Size = MAP_APPFONT ( 91 , 10 ) ;
+ Pos = MAP_APPFONT ( 130 , 14 ) ;
+ Size = MAP_APPFONT ( 106 , 10 ) ;
Text [ en-US ] = "~Automatic" ;
};
RadioButton BTN_SINGLE
{
- Pos = MAP_APPFONT ( 118 , 27 ) ;
- Size = MAP_APPFONT ( 91 , 10 ) ;
+ Pos = MAP_APPFONT ( 130, 27 ) ;
+ Size = MAP_APPFONT ( 106, 10 ) ;
Text [ en-US ] = "~Single page" ;
};
RadioButton BTN_COLUMNS
{
- Pos = MAP_APPFONT ( 118 , 41 ) ;
- Size = MAP_APPFONT ( 64 , 10 ) ;
+ Pos = MAP_APPFONT ( 130, 41 ) ;
+ Size = MAP_APPFONT ( 75 , 10 ) ;
Text [ en-US ] = "~Columns" ;
};
MetricField ED_COLUMNS
{
- Pos = MAP_APPFONT ( 185 , 40 ) ;
+ Pos = MAP_APPFONT ( 209 , 40 ) ;
Size = MAP_APPFONT ( 24 , 12 ) ;
Border = TRUE ;
Group = TRUE ;
@@ -128,29 +128,29 @@ ModalDialog RID_SVXDLG_ZOOM
};
CheckBox CHK_BOOK
{
- Pos = MAP_APPFONT ( 124 , 55 ) ;
+ Pos = MAP_APPFONT ( 136 , 55 ) ;
Size = MAP_APPFONT ( 85 , 10 ) ;
Text [ en-US ] = "~Book mode" ;
};
FixedLine FL_BOTTOM
{
Pos = MAP_APPFONT ( 6 , 81 ) ;
- Size = MAP_APPFONT ( 206 , 8 ) ;
+ Size = MAP_APPFONT ( 230 , 8 ) ;
};
OKButton BTN_ZOOM_OK
{
- Pos = MAP_APPFONT ( 53 , 92 ) ;
+ Pos = MAP_APPFONT ( 77 , 92 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
DefButton = TRUE ;
};
CancelButton BTN_ZOOM_CANCEL
{
- Pos = MAP_APPFONT ( 106 , 92 ) ;
+ Pos = MAP_APPFONT ( 130 , 92 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
};
HelpButton BTN_ZOOM_HELP
{
- Pos = MAP_APPFONT ( 162 , 92 ) ;
+ Pos = MAP_APPFONT ( 186 , 92 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
};
};
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index fb95a5bfbb15..804db0c58a16 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -55,6 +55,12 @@
#include <svx/xlnedwit.hxx>
#include <svx/xlnstcit.hxx>
#include <svx/xlnedcit.hxx>
+#include <svx/xflgrit.hxx>
+#include <svx/xflhtit.hxx>
+#include <svx/xbtmpit.hxx>
+#include <svx/xgrad.hxx>
+#include <svx/xbitmap.hxx>
+#include <svx/xhatch.hxx>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
#ifndef __COM_SUN_STAR_DRAWING_ENHANCEDCUSTOMSHAPESEGMENTCOMMAND_HPP__
@@ -64,6 +70,7 @@
#include <boost/shared_ptr.hpp>
#endif
#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/color/bcolortools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
// #i76201#
@@ -724,23 +731,23 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) :
/*const sal_Int32* pDefData =*/ ApplyShapeAttributes( rGeometryItem );
switch( eSpType )
{
- case mso_sptCan : nColorData = 0x20200000; break;
- case mso_sptCube : nColorData = 0x302d0000; break;
- case mso_sptActionButtonBlank : nColorData = 0x502ad400; break;
- case mso_sptActionButtonHome : nColorData = 0x702ad4ad; break;
- case mso_sptActionButtonHelp : nColorData = 0x602ad4a0; break;
- case mso_sptActionButtonInformation : nColorData = 0x702ad4a5; break;
- case mso_sptActionButtonBackPrevious : nColorData = 0x602ad4a0; break;
- case mso_sptActionButtonForwardNext : nColorData = 0x602ad4a0; break;
- case mso_sptActionButtonBeginning : nColorData = 0x602ad4a0; break;
- case mso_sptActionButtonEnd : nColorData = 0x602ad4a0; break;
- case mso_sptActionButtonReturn : nColorData = 0x602ad4a0; break;
- case mso_sptActionButtonDocument : nColorData = 0x702ad4da; break;
- case mso_sptActionButtonSound : nColorData = 0x602ad4a0; break;
- case mso_sptActionButtonMovie : nColorData = 0x602ad4a0; break;
- case mso_sptBevel : nColorData = 0x502ad400; break;
- case mso_sptFoldedCorner : nColorData = 0x20d00000; break;
- case mso_sptSmileyFace : nColorData = 0x20d00000; break;
+ case mso_sptCan : nColorData = 0x20400000; break;
+ case mso_sptCube : nColorData = 0x302e0000; break;
+ case mso_sptActionButtonBlank : nColorData = 0x502ce400; break;
+ case mso_sptActionButtonHome : nColorData = 0x702ce4ce; break;
+ case mso_sptActionButtonHelp : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonInformation : nColorData = 0x702ce4c5; break;
+ case mso_sptActionButtonBackPrevious : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonForwardNext : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonBeginning : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonEnd : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonReturn : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonDocument : nColorData = 0x702ce4ec; break;
+ case mso_sptActionButtonSound : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonMovie : nColorData = 0x602ce4c0; break;
+ case mso_sptBevel : nColorData = 0x502ce400; break;
+ case mso_sptFoldedCorner : nColorData = 0x20e00000; break;
+ case mso_sptSmileyFace : nColorData = 0x20e00000; break;
case mso_sptNil :
{
if( sShapeType.getLength() > 4 &&
@@ -751,38 +758,17 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) :
}
break;
case mso_sptCurvedLeftArrow :
- {
- if ( ( seqAdjustmentValues.getLength() > 2 ) && ( seqAdjustmentValues[ 2 ].State == com::sun::star::beans::PropertyState_DIRECT_VALUE ) )
- {
- double fValue;
- seqAdjustmentValues[ 2 ].Value >>= fValue;
- fValue = 21600 - fValue;
- seqAdjustmentValues[ 2 ].Value <<= fValue;
- }
- nFlags |= DFF_CUSTOMSHAPE_FLIP_H;
- }
- break;
+ case mso_sptCurvedRightArrow :
case mso_sptCurvedUpArrow :
- {
- if ( ( seqAdjustmentValues.getLength() > 2 ) && ( seqAdjustmentValues[ 2 ].State == com::sun::star::beans::PropertyState_DIRECT_VALUE ) )
- {
- double fValue;
- seqAdjustmentValues[ 2 ].Value >>= fValue;
- fValue = 21600 - fValue;
- seqAdjustmentValues[ 2 ].Value <<= fValue;
- }
- nFlags |= DFF_CUSTOMSHAPE_FLIP_V | DFF_CUSTOMSHAPE_EXCH;
- }
- break;
- case mso_sptCurvedDownArrow : nFlags |= DFF_CUSTOMSHAPE_EXCH; break;
- case mso_sptRibbon2 : nColorData = 0x30dd0000; break;
- case mso_sptRibbon : nColorData = 0x30dd0000; break;
+ case mso_sptCurvedDownArrow : nColorData = 0x2d000000; break;
+ case mso_sptRibbon2 : nColorData = 0x30ee0000; break;
+ case mso_sptRibbon : nColorData = 0x30ee0000; break;
- case mso_sptEllipseRibbon2 : nColorData = 0x30dd0000; break;
- case mso_sptEllipseRibbon : nColorData = 0x30dd0000; break;
+ case mso_sptEllipseRibbon2 : nColorData = 0x30ee0000; break;
+ case mso_sptEllipseRibbon : nColorData = 0x30ee0000; break;
- case mso_sptVerticalScroll : nColorData = 0x30dd0000; break;
- case mso_sptHorizontalScroll : nColorData = 0x30dd0000; break;
+ case mso_sptVerticalScroll : nColorData = 0x30ee0000; break;
+ case mso_sptHorizontalScroll : nColorData = 0x30ee0000; break;
default:
break;
}
@@ -1043,41 +1029,48 @@ sal_Bool EnhancedCustomShape2d::GetParameter( double& rRetValue, const EnhancedC
// nLumDat 27-24 = nLumDatEntry 0
// nLumDat 23-20 = nLumDatEntry 1 ...
// each 4bit entry is to be interpreted as a 10 percent signed luminance changing
-Color EnhancedCustomShape2d::GetColorData( const Color& rFillColor, sal_uInt32 nIndex )
+sal_Int32 EnhancedCustomShape2d::GetLuminanceChange( sal_uInt32 nIndex ) const
{
- Color aRetColor;
+ const sal_uInt32 nCount = nColorData >> 28;
+ if ( !nCount )
+ return 0;
- sal_uInt32 i, nColor, nTmp, nCount = nColorData >> 28;
+ if ( nIndex >= nCount )
+ nIndex = nCount - 1;
+
+ const sal_Int32 nLumDat = nColorData << ( ( 1 + nIndex ) << 2 );
+ return ( nLumDat >> 28 ) * 10;
+}
- if ( nCount )
+Color EnhancedCustomShape2d::GetColorData( const Color& rFillColor, sal_uInt32 nIndex ) const
+{
+ const sal_Int32 nLuminance = GetLuminanceChange(nIndex);
+ if( !nLuminance )
+ return rFillColor;
+
+ basegfx::BColor aHSVColor=
+ basegfx::tools::rgb2hsv(
+ basegfx::BColor(rFillColor.GetRed()/255.0,
+ rFillColor.GetGreen()/255.0,
+ rFillColor.GetBlue()/255.0));
+ if( nLuminance > 0 )
+ {
+ aHSVColor.setGreen(
+ aHSVColor.getGreen() * (1.0-nLuminance/100.0));
+ aHSVColor.setBlue(
+ nLuminance/100.0 +
+ (1.0-nLuminance/100.0)*aHSVColor.getBlue());
+ }
+ else if( nLuminance < 0 )
{
- if ( nIndex >= nCount )
- nIndex = nCount - 1;
-
- sal_uInt32 nFillColor = (sal_uInt32)rFillColor.GetRed() |
- ((sal_uInt32)rFillColor.GetGreen() << 8 ) |
- ((sal_uInt32)rFillColor.GetBlue() << 16 );
-
- sal_Int32 nLumDat = nColorData << ( ( 1 + nIndex ) << 2 );
- sal_Int32 nLuminance = ( nLumDat >> 28 ) * 12;
-
- nTmp = nFillColor;
- nColor = 0;
- for ( i = 0; i < 3; i++ )
- {
- sal_Int32 nC = (sal_uInt8)nTmp;
- nTmp >>= 8;
- nC += ( ( nLuminance * nC ) >> 8 );
- if ( nC < 0 )
- nC = 0;
- else if ( nC &~ 0xff )
- nC = 0xff;
- nColor >>= 8;
- nColor |= nC << 16;
- }
- aRetColor = Color( (sal_uInt8)nColor, (sal_uInt8)( nColor >> 8 ), (sal_uInt8)( nColor >> 16 ) );
+ aHSVColor.setBlue(
+ (1.0+nLuminance/100.0)*aHSVColor.getBlue());
}
- return aRetColor;
+
+ aHSVColor = basegfx::tools::hsv2rgb(aHSVColor);
+ return Color( (sal_uInt8)static_cast< sal_Int32 >( basegfx::clamp(aHSVColor.getRed(),0.0,1.0) * 255.0 + 0.5 ),
+ (sal_uInt8)static_cast< sal_Int32 >( basegfx::clamp(aHSVColor.getGreen(),0.0,1.0) * 255.0 + 0.5 ),
+ (sal_uInt8)static_cast< sal_Int32 >( basegfx::clamp(aHSVColor.getBlue(),0.0,1.0) * 255.0 + 0.5 ) );
}
Rectangle EnhancedCustomShape2d::GetTextRect() const
@@ -1708,6 +1701,19 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
if(aNewB2DPolyPolygon.count())
{
+ if( !bLineGeometryNeededOnly )
+ {
+ // hack aNewB2DPolyPolygon to fill logic rect - this is
+ // needed to produce gradient fills that look like mso
+ aNewB2DPolygon.clear();
+ aNewB2DPolygon.append(basegfx::B2DPoint(0,0));
+ aNewB2DPolyPolygon.append(aNewB2DPolygon);
+
+ aNewB2DPolygon.clear();
+ aNewB2DPolygon.append(basegfx::B2DPoint(aLogicRect.GetWidth(),
+ aLogicRect.GetHeight()));
+ aNewB2DPolyPolygon.append(aNewB2DPolygon);
+ }
// #i37011#
bool bForceCreateTwoObjects(false);
@@ -1877,6 +1883,78 @@ void CorrectCalloutArrows( MSO_SPT eSpType, sal_uInt32 nLineObjectCount, std::ve
}
}
+void EnhancedCustomShape2d::AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rCustomShapeSet,
+ sal_uInt32& nColorIndex, sal_uInt32 nColorCount)
+{
+ if ( !rObj.IsLine() )
+ {
+ const XFillStyle eFillStyle = ((const XFillStyleItem&)rObj.GetMergedItem(XATTR_FILLSTYLE)).GetValue();
+ switch( eFillStyle )
+ {
+ default:
+ case XFILL_SOLID:
+ {
+ Color aFillColor;
+ if ( nColorCount )
+ {
+ aFillColor = GetColorData(
+ ((XFillColorItem&)rCustomShapeSet.Get( XATTR_FILLCOLOR )).GetColorValue(),
+ std::min(nColorIndex, nColorCount-1) );
+ rObj.SetMergedItem( XFillColorItem( String(), aFillColor ) );
+ }
+ break;
+ }
+ case XFILL_GRADIENT:
+ {
+ XGradient aXGradient(((const XFillGradientItem&)rObj.GetMergedItem(XATTR_FILLGRADIENT)).GetGradientValue());
+ if ( nColorCount )
+ {
+ aXGradient.SetStartColor(
+ GetColorData(
+ aXGradient.GetStartColor(),
+ std::min(nColorIndex, nColorCount-1) ));
+ aXGradient.SetEndColor(
+ GetColorData(
+ aXGradient.GetEndColor(),
+ std::min(nColorIndex, nColorCount-1) ));
+ }
+
+ rObj.SetMergedItem( XFillGradientItem( String(), aXGradient ) );
+ break;
+ }
+ case XFILL_HATCH:
+ {
+ XHatch aXHatch(((const XFillHatchItem&)rObj.GetMergedItem(XATTR_FILLHATCH)).GetHatchValue());
+ if ( nColorCount )
+ {
+ aXHatch.SetColor(
+ GetColorData(
+ aXHatch.GetColor(),
+ std::min(nColorIndex, nColorCount-1) ));
+ }
+
+ rObj.SetMergedItem( XFillHatchItem( String(), aXHatch ) );
+ break;
+ }
+ case XFILL_BITMAP:
+ {
+ Bitmap aBitmap(((const XFillBitmapItem&)rObj.GetMergedItem(XATTR_FILLBITMAP)).GetBitmapValue().GetBitmap());
+ if ( nColorCount )
+ {
+ aBitmap.Adjust(
+ static_cast< short > ( GetLuminanceChange(
+ std::min(nColorIndex, nColorCount-1))));
+ }
+
+ rObj.SetMergedItem( XFillBitmapItem( String(), aBitmap ) );
+ break;
+ }
+ }
+
+ if ( nColorIndex < nColorCount )
+ nColorIndex++;
+ }
+}
SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnly )
{
@@ -1901,18 +1979,10 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl
if ( vObjectList.size() )
{
const SfxItemSet& rCustomShapeSet = pCustomShapeObj->GetMergedItemSet();
- // For primitive rendering, shadow handling is done completely based on the geometry, so i removed it here
- // const sal_Bool bShadow(((SdrShadowItem&)rCustomShapeSet.Get( SDRATTR_SHADOW )).GetValue());
- Color aBasicColor( COL_WHITE );
Color aFillColor;
sal_uInt32 nColorCount = nColorData >> 28;
sal_uInt32 nColorIndex = 0;
- if ( nColorCount )
- {
- aBasicColor = ((XFillColorItem&)rCustomShapeSet.Get( XATTR_FILLCOLOR )).GetColorValue();
- }
-
// #i37011# remove invisible objects
if(vObjectList.size())
{
@@ -1937,26 +2007,7 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl
if(1L == vObjectList.size())
{
// a single object, correct some values
- SdrPathObj* pObj(vObjectList[0L]);
-
-// For primitive rendering, shadow handling is done completely based on the geometry, so i removed it here
-// if(bShadow)
-// {
-// pObj->SetMergedItem(SdrShadowItem(sal_True));
-// }
-
- if(!pObj->IsLine())
- {
- if ( nColorIndex < nColorCount )
- {
- aFillColor = GetColorData( aBasicColor, nColorIndex++ );
- }
-
- if ( nColorCount )
- {
- pObj->SetMergedItem( XFillColorItem( String(), aFillColor ) );
- }
- }
+ AdaptObjColor(*vObjectList[0L],rCustomShapeSet,nColorIndex,nColorCount);
}
else
{
@@ -1975,16 +2026,7 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl
else
{
nAreaObjectCount++;
-
- if ( nColorIndex < nColorCount )
- {
- aFillColor = GetColorData( aBasicColor, nColorIndex++ );
- }
-
- if ( nColorCount )
- {
- pObj->SetMergedItem( XFillColorItem( String(), aFillColor ) );
- }
+ AdaptObjColor(*pObj,rCustomShapeSet,nColorIndex,nColorCount);
}
}
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.hxx b/svx/source/customshapes/EnhancedCustomShape2d.hxx
index 7f42ad751edc..6be05a9e588d 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.hxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.hxx
@@ -32,28 +32,19 @@
#define _ENHANCEDCUSTOMSHAPE2D_HXX
#include <svx/msdffdef.hxx>
-#include <svx/msdffimp.hxx>
#include <svx/sdasitm.hxx>
#include <com/sun/star/uno/Sequence.h>
-#ifndef _com_sun_star_beans_PropertyValues_hpp__
#include <com/sun/star/beans/PropertyValues.hpp>
-#endif
#include <com/sun/star/awt/Point.hpp>
#include <svtools/itemset.hxx>
-#ifndef __com_sun_star_drawing_EnhancedCustomShapeParameterPair_hpp__
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
-#endif
#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameter.hpp>
-#ifndef __COM_SUN_STAR_DRAWING_ENHANCEDCUSTOMSHAPETEXTFRAME_HPP__
#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
-#endif
#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
#include <EnhancedCustomShapeFunctionParser.hxx>
-#ifndef BOOST_SHARED_PTR_HPP_INCLUDED
#include <boost/shared_ptr.hpp>
-#endif
#include <vector>
#define DFF_CUSTOMSHAPE_FLIP_V 1
@@ -84,6 +75,7 @@ class SvxMSDffAdjustmentHandle;
// between X_RANGE and Y_RANGE
class SdrPathObj;
+
class EnhancedCustomShape2d : public SfxItemSet
{
SdrObject* pCustomShapeObj;
@@ -128,7 +120,10 @@ class EnhancedCustomShape2d : public SfxItemSet
sal_Int32 nRotateAngle;
sal_Bool SetAdjustValueAsDouble( const double& rValue, const sal_Int32 nIndex );
- Color GetColorData( const Color& rFillColor, sal_uInt32 nIndex );
+ sal_Int32 GetLuminanceChange( sal_uInt32 nIndex ) const;
+ Color GetColorData( const Color& rFillColor, sal_uInt32 nIndex ) const;
+ void AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rCustomShapeSet,
+ sal_uInt32& nColorIndex, sal_uInt32 nColorCount);
sal_Bool GetParameter( double& rParameterReturnValue, const com::sun::star::drawing::EnhancedCustomShapeParameter&,
const sal_Bool bReplaceGeoWidth, const sal_Bool bReplaceGeoHeight ) const;
Point GetPoint( const com::sun::star::drawing::EnhancedCustomShapeParameterPair&,
@@ -164,17 +159,17 @@ class EnhancedCustomShape2d : public SfxItemSet
sal_Bool IsFlipHorz() { return bFlipH; };
sal_Int32 GetRotateAngle() { return nRotateAngle; };
- SdrObject* CreateLineGeometry();
- SdrObject* CreateObject( sal_Bool bLineGeometryNeededOnly );
- void ApplyGluePoints( SdrObject* pObj );
- Rectangle GetTextRect() const;
+ SVX_DLLPUBLIC SdrObject* CreateLineGeometry();
+ SVX_DLLPUBLIC SdrObject* CreateObject( sal_Bool bLineGeometryNeededOnly );
+ SVX_DLLPUBLIC void ApplyGluePoints( SdrObject* pObj );
+ SVX_DLLPUBLIC Rectangle GetTextRect() const;
- sal_uInt32 GetHdlCount() const;
- sal_Bool GetHandlePosition( const sal_uInt32 nIndex, Point& rReturnPosition ) const;
- sal_Bool SetHandleControllerPosition( const sal_uInt32 nIndex, const com::sun::star::awt::Point& rPosition );
+ SVX_DLLPUBLIC sal_uInt32 GetHdlCount() const;
+ SVX_DLLPUBLIC sal_Bool GetHandlePosition( const sal_uInt32 nIndex, Point& rReturnPosition ) const;
+ SVX_DLLPUBLIC sal_Bool SetHandleControllerPosition( const sal_uInt32 nIndex, const com::sun::star::awt::Point& rPosition );
- EnhancedCustomShape2d( SdrObject* pSdrObjCustomShape );
- ~EnhancedCustomShape2d();
+ SVX_DLLPUBLIC EnhancedCustomShape2d( SdrObject* pSdrObjCustomShape );
+ SVX_DLLPUBLIC ~EnhancedCustomShape2d();
enum EnumFunc
{
@@ -198,15 +193,15 @@ class EnhancedCustomShape2d : public SfxItemSet
double GetEquationValueAsDouble( const sal_Int32 nIndex ) const;
sal_Int32 GetAdjustValueAsInteger( const sal_Int32 nIndex, const sal_Int32 nDefault = 0 ) const;
- static rtl::OUString GetEquation( const sal_uInt16 nFlags, sal_Int16 nPara1, sal_Int16 nPara2, sal_Int16 nPara3 );
+ SVX_DLLPUBLIC static rtl::OUString GetEquation( const sal_uInt16 nFlags, sal_Int16 nPara1, sal_Int16 nPara2, sal_Int16 nPara3 );
static void AppendEnhancedCustomShapeEquationParameter( rtl::OUString& rParameter, const sal_Int16 nPara, const sal_Bool bIsSpecialValue );
static void SetEnhancedCustomShapeEquationParameter( com::sun::star::drawing::EnhancedCustomShapeParameter&
rParameter, const sal_Int16 nPara, const sal_Bool bIsSpecialValue );
- static void SetEnhancedCustomShapeParameter( com::sun::star::drawing::EnhancedCustomShapeParameter&
+ SVX_DLLPUBLIC static void SetEnhancedCustomShapeParameter( com::sun::star::drawing::EnhancedCustomShapeParameter&
rParameter, const sal_Int32 nValue );
- static void SetEnhancedCustomShapeHandleParameter( com::sun::star::drawing::EnhancedCustomShapeParameter&
+ SVX_DLLPUBLIC static void SetEnhancedCustomShapeHandleParameter( com::sun::star::drawing::EnhancedCustomShapeParameter&
rParameter, const sal_Int32 nPara, const sal_Bool bIsSpecialValue, sal_Bool bHorz );
static sal_Bool ConvertSequenceToEnhancedCustomShape2dHandle( const com::sun::star::beans::PropertyValues& rHandleProperties,
EnhancedCustomShape2d::Handle& rDestinationHandle );
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.hxx b/svx/source/customshapes/EnhancedCustomShape3d.hxx
index 3451007a2b28..6d885d51e012 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.hxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.hxx
@@ -31,14 +31,15 @@
#ifndef _ENHANCEDCUSTOMSHAPE3D_HXX
#define _ENHANCEDCUSTOMSHAPE3D_HXX
-#include <svx/msdffimp.hxx>
#include <vector>
-//#include <poly3d.hxx>
-//#include <goodies/point3d.hxx>
#include <com/sun/star/drawing/ProjectionMode.hpp>
#include <basegfx/point/b3dpoint.hxx>
#include <basegfx/polygon/b3dpolygon.hxx>
+#include <tools/gen.hxx>
+
+class SdrObject;
+
class EnhancedCustomShape3d
{
class Transformation2D
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 426c94adcab8..abe6178cc800 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -683,7 +683,7 @@ void FitTextOutlinesToShapeOutlines( const PolyPolygon& aOutlines2d, FWData& rFW
break;
const Polygon& rOutlinePoly( aOutlines2d[ nOutline2dIdx++ ] );
const sal_uInt16 nPointCount = rOutlinePoly.GetSize();
- if ( nPointCount )
+ if ( nPointCount > 1 )
{
std::vector< double > vDistances;
vDistances.reserve( nPointCount );
@@ -745,7 +745,7 @@ void FitTextOutlinesToShapeOutlines( const PolyPolygon& aOutlines2d, FWData& rFW
const Polygon& rOutlinePoly2( aOutlines2d[ nOutline2dIdx++ ] );
const sal_uInt16 nPointCount = rOutlinePoly.GetSize();
const sal_uInt16 nPointCount2 = rOutlinePoly2.GetSize();
- if ( nPointCount && nPointCount2 )
+ if ( ( nPointCount > 1 ) && ( nPointCount2 > 1 ) )
{
std::vector< double > vDistances;
vDistances.reserve( nPointCount );
diff --git a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx
index 8f447de5b51c..022b7505cb44 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx
@@ -44,7 +44,7 @@
#include <typeinfo>
#define BOOST_SPIRIT_DEBUG
#endif
-#include <boost/spirit/core.hpp>
+#include <boost/spirit/include/classic_core.hpp>
#if (OSL_DEBUG_LEVEL > 0)
#include <iostream>
diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx
index 9cb3c414de37..0b41dda45eaa 100644
--- a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx
@@ -54,10 +54,6 @@ static const SvxMSDffTextRect TextRect[] =
{
{ { 0, 0 }, { 0, 0 } }
};
-static const sal_Int32 BoundRect[] =
-{
- 0, 0, 21600, 21600
-};
static const mso_CustomShape mso =
{
(SvxMSDffVertPair*)mso_sptVert, sizeof( mso_sptVert ) / sizeof( SvxMSDffVertPair ),
@@ -668,10 +664,6 @@ static const SvxMSDffVertPair mso_sptCanGluePoints[] =
{
{ 44, 6 MSO_I }, { 44, 0 }, { 0, 10800 }, { 44, 21600 }, { 88, 10800 }
};
-static const sal_Int32 mso_sptCanBoundRect[] =
-{
- 0, 0, 88, 21600
-};
static const SvxMSDffHandle mso_sptCanHandle[] =
{
{ MSDFF_HANDLE_FLAGS_RANGE,
@@ -1197,60 +1189,422 @@ static const mso_CustomShape msoBentUpArrow =
(SvxMSDffHandle*)mso_sptBentUpArrowHandle, sizeof( mso_sptBentUpArrowHandle ) / sizeof( SvxMSDffHandle )
};
-static const SvxMSDffVertPair mso_sptCurvedArrowVert[] = // adjustment1 : y 10800 - 21600, adjustment2 : y 16424 - 21600
-{ // adjustment3 : x 0 - 21600
- { 21600, 0 },
- { 9675, 0 }, { 0, 10 MSO_I }, { 0, 9 MSO_I }, // ccp
- { 0, 11 MSO_I },
- { 0, 14 MSO_I }, { 15 MSO_I, 1 MSO_I }, { 2 MSO_I, 1 MSO_I }, // ccp
- { 2 MSO_I, 21600 }, { 21600, 7 MSO_I }, { 2 MSO_I, 0 MSO_I }, { 2 MSO_I, 16 MSO_I },// pppp
- { 2 MSO_I, 16 MSO_I }, { 80, 8 MSO_I }, { 80, 8 MSO_I }, // ccp
- { 80, 8 MSO_I }, { 21600, 5 MSO_I }, { 21600, 0 } // ccp
-};
-static const sal_uInt16 mso_sptCurvedArrowSegm[] =
-{
- 0x4000, 0x2001, 0x0001, 0x2001, 0x0004, 0x2002, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptCurvedArrowCalc[] =
-{
- { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 0
- { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, // 1
- { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, // 2
- { 0x8000, { 21600, 0, DFF_Prop_adjust2Value } }, // 3
- { 0xa000, { DFF_Prop_adjust2Value, 0, DFF_Prop_adjustValue } }, // 4
- { 0xa000, { 0x0404, 0, 0x0403 } }, // 5
- { 0x2001, { 0x0405, 1, 2 } }, // 6
- { 0xa000, { DFF_Prop_adjust2Value, 0, 0x0406 } }, // 7
- { 0x2001, { DFF_Prop_adjust2Value, 1, 2 } }, // 8
- { 0xa000, { 0x0408, 0, 0x0406 } }, // 9
- { 0x2001, { 0x0409, 10000, 22326 } }, // 10
- { 0x6000, { 0x0409, 0x0405, 0 } }, // 11
- { 0xa000, { DFF_Prop_adjust2Value, 0, 0x040b } }, // 12
- { 0x2001, { 0x040c, 10000, 23148 } }, // 13
- { 0x6000, { 0x040d, 0x040b, 0 } }, // 14
- { 0x2001, { DFF_Prop_adjust3Value, 10000, 25467 } }, // 15
- { 0x6000, { DFF_Prop_adjustValue, 0x0403, 0 } } // 16
-};
-static const sal_Int32 mso_sptCurvedArrowDefault[] =
-{
- 3, 13000, 19400, 14400
-};
-static const SvxMSDffTextRectangles mso_sptCurvedArrowTextRect[] = // todo
+
+static const SvxMSDffVertPair mso_sptCurvedDownVert[] =
{
- { { 0, 0 }, { 21600, 21600 } }
+ { 0, 0 }, { 3 MSO_I, 21 MSO_I }, { 0, 21600 }, { 4 MSO_I, 0 },
+ { 0, 0 }, { 3 MSO_I, 21 MSO_I }, { 4 MSO_I, 0 }, { 17 MSO_I, 24 MSO_I },
+ { 15 MSO_I, 0 }, { 1 MSO_I, 21 MSO_I }, { 17 MSO_I, 24 MSO_I }, { 15 MSO_I, 21600 },
+ { 15 MSO_I, 0 }, { 1 MSO_I, 21 MSO_I }, { 7 MSO_I, 0 }, { 13 MSO_I, 2 MSO_I },
+ { 14 MSO_I, 2 MSO_I }, { 8 MSO_I, 21600 }, { 12 MSO_I, 2 MSO_I },
+ { 0, 0 }, { 3 MSO_I, 21 MSO_I }, { 11 MSO_I, 2 MSO_I }, { 17 MSO_I, 24 MSO_I },
+ { 0, 0 }, { 3 MSO_I, 21 MSO_I }, { 17 MSO_I, 24 MSO_I }, { 4 MSO_I, 0 }
+};
+static const sal_uInt16 mso_sptCurvedDownSegm[] =
+{
+ 0xa508,
+ 0xa304,
+ 0x6000,
+ 0x8000,
+ 0xa604,
+ 0x0003,
+ 0xa308,
+ 0x6000,
+ 0x8000
+};
+static const SvxMSDffCalculationData mso_sptCurvedDownCalc[] =
+{
+ { 0x2000, { DFF_Prop_adjustValue, 0, 0 } },
+ { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } },
+ { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } },
+ { 0xa000, { DFF_Prop_adjustValue, 21600, DFF_Prop_adjust2Value } },
+ { 0x2001, { 0x403, 1, 2 } },
+ { 0x6000, { DFF_Prop_adjust2Value, DFF_Prop_adjust2Value, 21600 } },
+ { 0xe000, { 0x405, DFF_Prop_adjust2Value, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x406, 1, 2 } },
+ { 0x4002, { 21600, DFF_Prop_adjustValue, 0 } },
+ { 0x8000, { 21600, 0, DFF_Prop_adjust3Value } },
+ { 0xa00f, { 0x409, 21600, 0x404 } },
+ { 0x6000, { 0x404, 0x40a, 0 } },
+ { 0x6000, { 0x40b, DFF_Prop_adjust2Value, 21600 } },
+ { 0x6000, { 0x407, 0x40a, 0 } },
+ { 0xa000, { 0x40c, 21600, DFF_Prop_adjustValue } },
+ { 0xa000, { 0x405, 0, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x40f, 1, 2 } },
+ { 0x6002, { 0x404, 0x407, 0 } },
+ { 0x6000, { DFF_Prop_adjustValue, DFF_Prop_adjust2Value, 21600 } },
+ { 0x2001, { 0x412, 1, 2 } },
+ { 0xa000, { 0x411, 0, 0x413 } },
+ { 0x0001, { 21600, 2, 1 } },
+ { 0xa000, { 0x411, 0, 0x404 } },
+ { 0x600f, { 0x416, 0x404, 21600 } },
+ { 0x8000, { 21600, 0, 0x417 } },
+ { 0x2000, { 0x408, 128, 0 } },
+ { 0x2001, { 0x405, 1, 2 } },
+ { 0x2000, { 0x405, 0, 128 } },
+ { 0xe000, { DFF_Prop_adjustValue, 0x411, 0x40c } },
+ { 0x600f, { 0x414, 0x404, 21600 } },
+ { 0x8000, { 21600, 0, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x41e, 1, 2 } },
+ { 0x0001, { 21600, 21600, 1 } },
+ { 0x6001, { 0x409, 0x409, 1 } },
+ { 0xa000, { 0x420, 0, 0x421 } },
+ { 0x200d, { 0x422, 0, 0 } },
+ { 0x2000, { 0x423, 21600, 0 } },
+ { 0x8001, { 21600, 21600, 0x424 } },
+ { 0x2000, { 0x425, 64, 0 } },
+ { 0x2001, { DFF_Prop_adjustValue, 1, 2 } },
+ { 0x600f, { 0x41f, 0x427, 21600 } },
+ { 0x8000, { 21600, 0, 0x428 } },
+ { 0x2000, { 0x429, 64, 0 } },
+ { 0x2001, { 0x404, 1, 2 } },
+ { 0xa000, { DFF_Prop_adjust2Value, 0, 0x42b } },
+ { 0x0001, { 21600, 2195, 16384 } },
+ { 0x0001, { 21600, 14189, 16384 } }
};
-static const mso_CustomShape msoCurvedArrow =
+static const sal_Int32 mso_sptCurvedDownDefault[] =
{
- (SvxMSDffVertPair*)mso_sptCurvedArrowVert, sizeof( mso_sptCurvedArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptCurvedArrowSegm, sizeof( mso_sptCurvedArrowSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptCurvedArrowCalc, sizeof( mso_sptCurvedArrowCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptCurvedArrowDefault,
- (SvxMSDffTextRectangles*)mso_sptCurvedArrowTextRect, sizeof( mso_sptCurvedArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
+ 3, 12960, 19440, 14400
+};
+static const SvxMSDffTextRectangles mso_sptCurvedDownTextRect[] =
+{
+ { { 43 MSO_I, 45 MSO_I }, { 44 MSO_I, 46 MSO_I } }
+};
+static const SvxMSDffVertPair mso_sptCurvedDownGluePoints[] =
+{
+ { 17 MSO_I, 0 }, { 16 MSO_I, 21600 }, { 12 MSO_I, 2 MSO_I }, { 8 MSO_I, 21600 }, { 14 MSO_I, 2 MSO_I }
+};
+static const SvxMSDffHandle mso_sptCurvedDownHandles[] =
+{
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL,
+ 0x100, 21600, 10800, 10800, 3 + 0x26, 3 + 0x1b, 0, 10800 },
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL,
+ 0x101, 21600, 10800, 10800, 3 + 0x19, 21600, 0, 10800 },
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL,
+ 21600, 0x102, 10800, 10800, 3375, 21600, 3 + 0x2a, 21600 }
+};
+static const mso_CustomShape msoCurvedDownArrow =
+{
+ (SvxMSDffVertPair*)mso_sptCurvedDownVert, sizeof( mso_sptCurvedDownVert ) / sizeof( SvxMSDffVertPair ),
+ (sal_uInt16*)mso_sptCurvedDownSegm, sizeof( mso_sptCurvedDownSegm ) >> 1,
+ (SvxMSDffCalculationData*)mso_sptCurvedDownCalc, sizeof( mso_sptCurvedDownCalc ) / sizeof( SvxMSDffCalculationData ),
+ (sal_Int32*)mso_sptCurvedDownDefault,
+ (SvxMSDffTextRectangles*)mso_sptCurvedDownTextRect, sizeof( mso_sptCurvedDownTextRect ) / sizeof( SvxMSDffTextRectangles ),
21600, 21600,
0x80000000, 0x80000000,
- NULL, 0,
- NULL, 0 // handles
+ (SvxMSDffVertPair*)mso_sptCurvedDownGluePoints, sizeof( mso_sptCurvedDownGluePoints ) / sizeof( SvxMSDffVertPair ),
+ (SvxMSDffHandle*)mso_sptCurvedDownHandles, sizeof( mso_sptCurvedDownHandles ) / sizeof( SvxMSDffHandle )
+};
+
+static const SvxMSDffVertPair mso_sptCurvedUpVert[] =
+{
+ { 0, 22 MSO_I }, { 3 MSO_I, 21 MSO_I }, { 0, 0 }, { 4 MSO_I, 21 MSO_I },
+ { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 7 MSO_I, 21 MSO_I }, { 12 MSO_I, 2 MSO_I },
+ { 13 MSO_I, 2 MSO_I }, { 8 MSO_I, 0 }, { 11 MSO_I, 2 MSO_I },
+ { 0, 22 MSO_I }, { 3 MSO_I, 21 MSO_I }, { 10 MSO_I, 2 MSO_I }, { 16 MSO_I, 24 MSO_I },
+ { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 16 MSO_I, 24 MSO_I }, { 14 MSO_I, 0 },
+ { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 7 MSO_I, 21 MSO_I }, { 16 MSO_I, 24 MSO_I }
+};
+static const sal_uInt16 mso_sptCurvedUpSegm[] =
+{
+ 0xa408,
+ 0x0003,
+ 0xa508,
+ 0x6000,
+ 0x8000,
+ 0xa604,
+ 0xaa00,
+ 0x8000
+};
+static const SvxMSDffCalculationData mso_sptCurvedUpCalc[] =
+{
+ { 0x2000, { DFF_Prop_adjustValue, 0, 0 } },
+ { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } },
+ { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } },
+ { 0xa000, { DFF_Prop_adjustValue, 21600, DFF_Prop_adjust2Value } },
+ { 0x2001, { 0x403, 1, 2 } },
+ { 0x6000, { DFF_Prop_adjust2Value, DFF_Prop_adjust2Value, 21600 } },
+ { 0xe000, { 0x405, DFF_Prop_adjust2Value, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x406, 1, 2 } },
+ { 0x4002, { 21600, DFF_Prop_adjustValue, 0 } },
+ { 0xa00f, { DFF_Prop_adjust3Value, 21600, 0x404 } },
+ { 0x6000, { 0x404, 0x409, 0 } },
+ { 0x6000, { 0x40a, DFF_Prop_adjust2Value, 21600 } },
+ { 0x6000, { 0x407, 0x409, 0 } },
+ { 0xa000, { 0x40b, 21600, DFF_Prop_adjustValue } },
+ { 0xa000, { 0x405, 0, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x40e, 1, 2 } },
+ { 0x6002, { 0x404, 0x407, 0 } },
+ { 0x6000, { DFF_Prop_adjustValue, DFF_Prop_adjust2Value, 21600 } },
+ { 0x2001, { 0x411, 1, 2 } },
+ { 0xa000, { 0x410, 0, 0x412 } },
+ { 0x0000, { 21600, 0, 0 } },
+ { 0x0000, { 21600, 0, 0 } },
+ { 0x0000, { 0, 0, 21600 } },
+ { 0xa000, { 0x410, 0, 0x404 } },
+ { 0x600f, { 0x417, 0x404, 21600 } },
+ { 0x2000, { 0x408, 128, 0 } },
+ { 0x2001, { 0x405, 1, 2 } },
+ { 0x2000, { 0x405, 0, 128 } },
+ { 0xe000, { DFF_Prop_adjustValue, 0x410, 0x40b } },
+ { 0x8000, { 21600, 0, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x41d, 1, 2 } },
+ { 0x0001, { 21600, 21600, 1 } },
+ { 0x6001, { DFF_Prop_adjust3Value, DFF_Prop_adjust3Value, 1 } },
+ { 0xa000, { 0x41f, 0, 0x420 } },
+ { 0x200d, { 0x421, 0, 0 } },
+ { 0x2000, { 0x422, 21600, 0 } },
+ { 0x8001, { 21600, 21600, 0x423 } },
+ { 0x2000, { 0x424, 64, 0 } },
+ { 0x2001, { DFF_Prop_adjustValue, 1, 2 } },
+ { 0x600f, { 0x41e, 0x426, 21600 } },
+ { 0x2000, { 0x427, 0, 64 } },
+ { 0x2001, { 0x404, 1, 2 } },
+ { 0xa000, { DFF_Prop_adjust2Value, 0, 0x429 } },
+ { 0x0001, { 21600, 2195, 16384 } },
+ { 0x0001, { 21600, 14189, 16384 } }
+};
+static const sal_Int32 mso_sptCurvedUpDefault[] =
+{
+ 3, 12960, 19440, 7200
+};
+static const SvxMSDffTextRectangles mso_sptCurvedUpTextRect[] =
+{
+ { { 41 MSO_I, 43 MSO_I }, { 42 MSO_I, 44 MSO_I } }
+};
+static const SvxMSDffVertPair mso_sptCurvedUpGluePoints[] =
+{
+ { 8 MSO_I, 0 }, { 11 MSO_I, 2 MSO_I }, { 15 MSO_I, 0 }, { 16 MSO_I, 21 MSO_I }, { 13 MSO_I, 2 MSO_I }
+};
+static const SvxMSDffHandle mso_sptCurvedUpHandles[] =
+{
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL,
+ 0x100, 0, 10800, 10800, 3 + 37, 3 + 27, 0, 10800 },
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL,
+ 0x101, 0, 10800, 10800, 3 + 25, 3 + 20, 0, 10800 },
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL,
+ 21600, 0x102, 10800, 10800, 3375, 21600, 0, 3 + 40 }
+};
+static const mso_CustomShape msoCurvedUpArrow =
+{
+ (SvxMSDffVertPair*)mso_sptCurvedUpVert, sizeof( mso_sptCurvedUpVert ) / sizeof( SvxMSDffVertPair ),
+ (sal_uInt16*)mso_sptCurvedUpSegm, sizeof( mso_sptCurvedUpSegm ) >> 1,
+ (SvxMSDffCalculationData*)mso_sptCurvedUpCalc, sizeof( mso_sptCurvedUpCalc ) / sizeof( SvxMSDffCalculationData ),
+ (sal_Int32*)mso_sptCurvedUpDefault,
+ (SvxMSDffTextRectangles*)mso_sptCurvedUpTextRect, sizeof( mso_sptCurvedUpTextRect ) / sizeof( SvxMSDffTextRectangles ),
+ 21600, 21600,
+ 0x80000000, 0x80000000,
+ (SvxMSDffVertPair*)mso_sptCurvedUpGluePoints, sizeof( mso_sptCurvedUpGluePoints ) / sizeof( SvxMSDffVertPair ),
+ (SvxMSDffHandle*)mso_sptCurvedUpHandles, sizeof( mso_sptCurvedUpHandles ) / sizeof( SvxMSDffHandle )
+};
+
+static const SvxMSDffVertPair mso_sptCurvedRightVert[] =
+{
+ { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 22 MSO_I, 0 }, { 0, 4 MSO_I }, { 0, 15 MSO_I }, { 23 MSO_I, 1 MSO_I }, { 0, 7 MSO_I }, { 2 MSO_I, 13 MSO_I },
+ { 2 MSO_I, 14 MSO_I }, { 22 MSO_I, 8 MSO_I }, { 2 MSO_I, 12 MSO_I },
+ { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 2 MSO_I, 11 MSO_I }, { 26 MSO_I, 17 MSO_I }, { 0, 15 MSO_I }, { 23 MSO_I, 1 MSO_I }, { 26 MSO_I, 17 MSO_I }, { 22 MSO_I, 15 MSO_I },
+ { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 0, 4 MSO_I }, { 26 MSO_I, 17 MSO_I }
+};
+static const sal_uInt16 mso_sptCurvedRightSegm[] =
+{
+ 0xa408,
+ 0x0003,
+ 0xa508,
+ 0x6000,
+ 0x8000,
+ 0xa404,
+ 0xaa00,
+ 0x8000
+};
+static const SvxMSDffCalculationData mso_sptCurvedRightCalc[] =
+{
+ { 0x2000, { DFF_Prop_adjustValue, 0, 0 } },
+ { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } },
+ { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } },
+ { 0xa000, { DFF_Prop_adjustValue, 21600, DFF_Prop_adjust2Value } },
+ { 0x2001, { 0x403, 1, 2 } },
+ { 0x6000, { DFF_Prop_adjust2Value, DFF_Prop_adjust2Value, 21600 } },
+ { 0xe000, { 0x405, DFF_Prop_adjust2Value, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x406, 1, 2 } },
+ { 0x4002, { 21600, DFF_Prop_adjustValue, 0 } },
+ { 0x8000, { 21600, 0, DFF_Prop_adjust3Value } },
+ { 0xa00f, { 0x409, 21600, 0x404 } },
+ { 0x6000, { 0x404, 0x40a, 0 } },
+ { 0x6000, { 0x40b, DFF_Prop_adjust2Value, 21600 } },
+ { 0x6000, { 0x407, 0x40a, 0 } },
+ { 0xa000, { 0x40c, 21600, DFF_Prop_adjustValue } },
+ { 0xa000, { 0x405, 0, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x40f, 1, 2 } },
+ { 0x6002, { 0x404, 0x407, 0 } },
+ { 0x6000, { DFF_Prop_adjustValue, DFF_Prop_adjust2Value, 21600 } },
+ { 0x2001, { 0x412, 1, 2 } },
+ { 0xa000, { 0x411, 0, 0x413 } },
+ { 0x0000, { 21600, 0, 0 } },
+ { 0x0000, { 21600, 0, 0 } },
+ { 0x0001, { 21600, 2, 1 } },
+ { 0xa000, { 0x411, 0, 0x404 } },
+ { 0x600f, { 0x418, 0x404, 21600 } },
+ { 0x8000, { 21600, 0, 0x419 } },
+ { 0x2000, { 0x408, 128, 0 } },
+ { 0x2001, { 0x405, 1, 2 } },
+ { 0x2000, { 0x405, 0, 128 } },
+ { 0xe000, { DFF_Prop_adjustValue, 0x411, 0x40c } },
+ { 0x600f, { 0x414, 0x404, 21600 } },
+ { 0x8000, { 21600, 0, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x420, 1, 2 } },
+ { 0x0001, { 21600, 21600, 1 } },
+ { 0x6001, { 0x409, 0x409, 1 } },
+ { 0xa000, { 0x422, 0, 0x423 } },
+ { 0x200d, { 0x424, 0, 0 } },
+ { 0x2000, { 0x425, 21600, 0 } },
+ { 0x8001, { 21600, 21600, 0x426 } },
+ { 0x2000, { 0x427, 64, 0 } },
+ { 0x2001, { DFF_Prop_adjustValue, 1, 2 } },
+ { 0x600f, { 0x421, 0x429, 21600 } },
+ { 0x8000, { 21600, 0, 0x42a } },
+ { 0x2000, { 0x42b, 64, 0 } },
+ { 0x2001, { 0x404, 1, 2 } },
+ { 0xa000, { DFF_Prop_adjust2Value, 0, 0x42d } },
+ { 0x0001, { 21600, 2195, 16384 } },
+ { 0x0001, { 21600, 14189, 16384 } }
+};
+static const sal_Int32 mso_sptCurvedRightDefault[] =
+{
+ 3, 12960, 19440, 14400
+};
+static const SvxMSDffTextRectangles mso_sptCurvedRightTextRect[] =
+{
+ { { 47 MSO_I, 45 MSO_I }, { 48 MSO_I, 46 MSO_I } }
+};
+static const SvxMSDffVertPair mso_sptCurvedRightGluePoints[] =
+{
+ { 0, 17 MSO_I }, { 2 MSO_I, 14 MSO_I }, { 22 MSO_I, 8 MSO_I }, { 2 MSO_I, 12 MSO_I }, { 22 MSO_I, 16 MSO_I }
+};
+static const SvxMSDffHandle mso_sptCurvedRightHandles[] =
+{
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL,
+ 21600, 0x100, 10800, 10800, 0, 10800, 3 + 40, 3 + 29 },
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL,
+ 21600, 0x101, 10800, 10800, 0, 10800, 3 + 27, 3 + 21 },
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL,
+ 0x102, 21600, 10800, 10800, 3 + 44, 3 + 22, 3375, 21600 }
+};
+static const mso_CustomShape msoCurvedRightArrow =
+{
+ (SvxMSDffVertPair*)mso_sptCurvedRightVert, sizeof( mso_sptCurvedRightVert ) / sizeof( SvxMSDffVertPair ),
+ (sal_uInt16*)mso_sptCurvedRightSegm, sizeof( mso_sptCurvedRightSegm ) >> 1,
+ (SvxMSDffCalculationData*)mso_sptCurvedRightCalc, sizeof( mso_sptCurvedRightCalc ) / sizeof( SvxMSDffCalculationData ),
+ (sal_Int32*)mso_sptCurvedRightDefault,
+ (SvxMSDffTextRectangles*)mso_sptCurvedRightTextRect, sizeof( mso_sptCurvedRightTextRect ) / sizeof( SvxMSDffTextRectangles ),
+ 21600, 21600,
+ 0x80000000, 0x80000000,
+ (SvxMSDffVertPair*)mso_sptCurvedRightGluePoints, sizeof( mso_sptCurvedRightGluePoints ) / sizeof( SvxMSDffVertPair ),
+ (SvxMSDffHandle*)mso_sptCurvedRightHandles, sizeof( mso_sptCurvedRightHandles ) / sizeof( SvxMSDffHandle )
+};
+
+static const SvxMSDffVertPair mso_sptCurvedLeftVert[] =
+{
+ { 22 MSO_I, 0 }, { 21 MSO_I, 3 MSO_I }, { 0, 0 }, { 21 MSO_I, 4 MSO_I }, { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 21 MSO_I, 7 MSO_I }, { 2 MSO_I, 12 MSO_I },
+ { 2 MSO_I, 13 MSO_I }, { 0, 8 MSO_I }, { 2 MSO_I, 11 MSO_I },
+ { 22 MSO_I, 0 }, { 21 MSO_I, 3 MSO_I }, { 2 MSO_I, 10 MSO_I }, { 24 MSO_I, 16 MSO_I }, { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 24 MSO_I, 16 MSO_I }, { 0, 14 MSO_I },
+ { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 21 MSO_I, 7 MSO_I }, { 24 MSO_I, 16 MSO_I }
+};
+static const sal_uInt16 mso_sptCurvedLeftSegm[] =
+{
+ 0xa608,
+ 0x0003,
+ 0xa308,
+ 0x6000,
+ 0x8000,
+ 0xa404,
+ 0xaa00,
+ 0x8000
+};
+static const SvxMSDffCalculationData mso_sptCurvedLeftCalc[] =
+{
+ { 0x2000, { DFF_Prop_adjustValue, 0, 0 } },
+ { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } },
+ { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } },
+ { 0xa000, { DFF_Prop_adjustValue, 21600, DFF_Prop_adjust2Value } },
+ { 0x2001, { 0x403, 1, 2 } },
+ { 0x6000, { DFF_Prop_adjust2Value, DFF_Prop_adjust2Value, 21600 } },
+ { 0xe000, { 0x405, DFF_Prop_adjust2Value, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x406, 1, 2 } },
+ { 0x4002, { 21600, DFF_Prop_adjustValue, 0 } },
+ { 0xa00f, { DFF_Prop_adjust3Value, 21600, 0x404 } },
+ { 0x6000, { 0x404, 0x409, 0 } },
+ { 0x6000, { 0x40a, DFF_Prop_adjust2Value, 21600 } },
+ { 0x6000, { 0x407, 0x409, 0 } },
+ { 0xa000, { 0x40b, 21600, DFF_Prop_adjustValue } },
+ { 0xa000, { 0x405, 0, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x40e, 1, 2 } },
+ { 0x6002, { 0x404, 0x407, 0 } },
+ { 0x6000, { DFF_Prop_adjustValue, DFF_Prop_adjust2Value, 21600 } },
+ { 0x2001, { 0x411, 1, 2 } },
+ { 0xa000, { 0x410, 0, 0x412 } },
+ { 0x0000, { 21600, 0, 0 } },
+ { 0x0000, { 21600, 0, 0 } },
+ { 0x0000, { 0, 0, 21600 } },
+ { 0xa000, { 0x410, 0, 0x404 } },
+ { 0x600f, { 0x417, 0x404, 21600 } },
+ { 0x2000, { 0x408, 128, 0 } },
+ { 0x2001, { 0x405, 1, 2 } },
+ { 0x2000, { 0x405, 0, 128 } },
+ { 0xe000, { DFF_Prop_adjustValue, 0x410, 0x40b } },
+ { 0x8000, { 21600, 0, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x41d, 1, 2 } },
+ { 0x0001, { 21600, 21600, 1 } },
+ { 0x6001, { DFF_Prop_adjust3Value, DFF_Prop_adjust3Value, 1 } },
+ { 0xa000, { 0x41f, 0, 0x420 } },
+ { 0x200d, { 0x421, 0, 0 } },
+ { 0x2000, { 0x422, 21600, 0 } },
+ { 0x8001, { 21600, 21600, 0x423 } },
+ { 0x2000, { 0x424, 64, 0 } },
+ { 0x2001, { DFF_Prop_adjustValue, 1, 2 } },
+ { 0x600f, { 0x41e, 0x426, 21600 } },
+ { 0x2000, { 0x427, 0, 64 } },
+ { 0x2001, { 0x404, 1, 2 } },
+ { 0xa000, { DFF_Prop_adjust2Value, 0, 0x429 } },
+ { 0x0001, { 21600, 2195, 16384 } },
+ { 0x0001, { 21600, 14189, 16384 } }
+};
+static const sal_Int32 mso_sptCurvedLeftDefault[] =
+{
+ 3, 12960, 19440, 7200
+};
+static const SvxMSDffTextRectangles mso_sptCurvedLeftTextRect[] =
+{
+ { { 43 MSO_I, 41 MSO_I }, { 44 MSO_I, 42 MSO_I } }
};
+static const SvxMSDffVertPair mso_sptCurvedLeftGluePoints[] =
+{
+ { 0, 15 MSO_I }, { 2 MSO_I, 11 MSO_I }, { 0, 8 MSO_I }, { 2 MSO_I, 13 MSO_I }, { 21 MSO_I, 16 MSO_I }
+};
+static const SvxMSDffHandle mso_sptCurvedLeftHandles[] =
+{
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL,
+ 0, 0x100, 10800, 10800, 0, 10800, 3 + 37, 3 + 27 },
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL,
+ 0, 0x101, 10800, 10800, 0, 10800, 3 + 25, 3 + 20 },
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL,
+ 0x102, 21600, 10800, 10800, 0, 3 + 40, 3375, 21600 }
+};
+static const mso_CustomShape msoCurvedLeftArrow =
+{
+ (SvxMSDffVertPair*)mso_sptCurvedLeftVert, sizeof( mso_sptCurvedLeftVert ) / sizeof( SvxMSDffVertPair ),
+ (sal_uInt16*)mso_sptCurvedLeftSegm, sizeof( mso_sptCurvedLeftSegm ) >> 1,
+ (SvxMSDffCalculationData*)mso_sptCurvedLeftCalc, sizeof( mso_sptCurvedLeftCalc ) / sizeof( SvxMSDffCalculationData ),
+ (sal_Int32*)mso_sptCurvedLeftDefault,
+ (SvxMSDffTextRectangles*)mso_sptCurvedLeftTextRect, sizeof( mso_sptCurvedLeftTextRect ) / sizeof( SvxMSDffTextRectangles ),
+ 21600, 21600,
+ 0x80000000, 0x80000000,
+ (SvxMSDffVertPair*)mso_sptCurvedLeftGluePoints, sizeof( mso_sptCurvedLeftGluePoints ) / sizeof( SvxMSDffVertPair ),
+ (SvxMSDffHandle*)mso_sptCurvedLeftHandles, sizeof( mso_sptCurvedLeftHandles ) / sizeof( SvxMSDffHandle )
+};
+
+
+
+
static const SvxMSDffVertPair mso_sptStripedRightArrowVert[] = // adjustment1 : x 3375 - 21600
{ // adjustment2 : y 0 - 10800
@@ -3046,10 +3400,6 @@ static const SvxMSDffVertPair mso_sptHeartGluePoints[] =
{
{ 10800, 2180 }, { 3090, 10800 }, { 10800, 21600 }, { 18490, 10800 }
};
-static const sal_Int32 mso_sptHeartBoundRect[] =
-{
- -9, 0, 21606, 21602
-};
static const mso_CustomShape msoHeart =
{
(SvxMSDffVertPair*)mso_sptHeartVert, sizeof( mso_sptHeartVert ) / sizeof( SvxMSDffVertPair ),
@@ -7772,10 +8122,10 @@ const mso_CustomShape* GetCustomShapeContent( MSO_SPT eSpType )
case mso_sptUturnArrow : pCustomShape = &msoUturnArrow; break;
case mso_sptLeftUpArrow : pCustomShape = &msoLeftUpArrow; break;
case mso_sptBentUpArrow : pCustomShape = &msoBentUpArrow; break;
- case mso_sptCurvedRightArrow : pCustomShape = &msoCurvedArrow; break;
- case mso_sptCurvedLeftArrow : pCustomShape = &msoCurvedArrow; break;
- case mso_sptCurvedUpArrow : pCustomShape = &msoCurvedArrow; break;
- case mso_sptCurvedDownArrow : pCustomShape = &msoCurvedArrow; break;
+ case mso_sptCurvedRightArrow : pCustomShape = &msoCurvedRightArrow; break;
+ case mso_sptCurvedLeftArrow : pCustomShape = &msoCurvedLeftArrow; break;
+ case mso_sptCurvedUpArrow : pCustomShape = &msoCurvedUpArrow; break;
+ case mso_sptCurvedDownArrow : pCustomShape = &msoCurvedDownArrow; break;
case mso_sptStripedRightArrow : pCustomShape = &msoStripedRightArrow; break;
case mso_sptNotchedRightArrow : pCustomShape = &msoNotchedRightArrow; break;
case mso_sptHomePlate : pCustomShape = &msoHomePlate; break;
diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.hxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.hxx
index b3544b8185da..8f43d8ac23a2 100644
--- a/svx/source/customshapes/EnhancedCustomShapeGeometry.hxx
+++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.hxx
@@ -93,12 +93,12 @@ struct mso_CustomShape
#define MSO_I | (sal_Int32)0x80000000
sal_Bool SortFilledObjectsToBackByDefault( MSO_SPT eSpType );
-sal_Bool IsCustomShapeFilledByDefault( MSO_SPT eSpType );
-sal_Int16 GetCustomShapeConnectionTypeDefault( MSO_SPT eSpType );
+SVX_DLLPUBLIC sal_Bool IsCustomShapeFilledByDefault( MSO_SPT eSpType );
+SVX_DLLPUBLIC sal_Int16 GetCustomShapeConnectionTypeDefault( MSO_SPT eSpType );
// #i28269#
-sal_Bool IsCustomShapeStrokedByDefault( MSO_SPT eSpType );
+SVX_DLLPUBLIC sal_Bool IsCustomShapeStrokedByDefault( MSO_SPT eSpType );
-const mso_CustomShape* GetCustomShapeContent( MSO_SPT eSpType );
+SVX_DLLPUBLIC const mso_CustomShape* GetCustomShapeContent( MSO_SPT eSpType );
#endif
diff --git a/svx/source/customshapes/EnhancedCustomShapeTypeNames.hxx b/svx/source/customshapes/EnhancedCustomShapeTypeNames.hxx
index 7b23629d625d..544500c34091 100644
--- a/svx/source/customshapes/EnhancedCustomShapeTypeNames.hxx
+++ b/svx/source/customshapes/EnhancedCustomShapeTypeNames.hxx
@@ -33,12 +33,10 @@
#include <svx/msdffdef.hxx>
#include <rtl/ustring.hxx>
-class EnhancedCustomShapeTypeNames
+namespace EnhancedCustomShapeTypeNames
{
- public :
-
- static MSO_SPT Get( const rtl::OUString& );
- static rtl::OUString Get( const MSO_SPT );
-};
+ SVX_DLLPUBLIC MSO_SPT Get( const rtl::OUString& );
+ SVX_DLLPUBLIC rtl::OUString Get( const MSO_SPT );
+}
#endif
diff --git a/svx/source/customshapes/makefile.mk b/svx/source/customshapes/makefile.mk
index a81910b83038..edd6f7d33ed0 100644
--- a/svx/source/customshapes/makefile.mk
+++ b/svx/source/customshapes/makefile.mk
@@ -32,6 +32,7 @@
PRJ=..$/..
PRJNAME=svx
TARGET=customshapes
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
# --- Settings ----------------------------------
@@ -48,18 +49,27 @@ ENABLE_EXCEPTIONS=TRUE
NOOPTFILES= $(SLO)$/EnhancedCustomShapeFunctionParser.obj
.ENDIF
+ENVCFLAGS += -DBOOST_SPIRIT_USE_OLD_NAMESPACE
+
# --- Files -------------------------------------
-SLOFILES= $(SLO)$/EnhancedCustomShapeEngine.obj \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/EnhancedCustomShapeTypeNames.obj \
$(SLO)$/EnhancedCustomShapeGeometry.obj \
$(SLO)$/EnhancedCustomShape2d.obj \
+ $(SLO)$/EnhancedCustomShapeFunctionParser.obj
+
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/EnhancedCustomShapeEngine.obj \
$(SLO)$/EnhancedCustomShape3d.obj \
$(SLO)$/EnhancedCustomShapeFontWork.obj \
$(SLO)$/EnhancedCustomShapeHandle.obj \
- $(SLO)$/EnhancedCustomShapeFunctionParser.obj \
$(SLO)$/tbxcustomshapes.obj
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
# --- Targets ----------------------------------
.INCLUDE : target.mk
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 5076b06f52c5..5018bd28a640 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -36,6 +36,7 @@
#include <sfx2/printer.hxx> // SfxPrinter
#include <vcl/metric.hxx>
#include <vcl/svapp.hxx>
+#include <unicode/uchar.h>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/i18n/XBreakIterator.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -244,7 +245,25 @@ void FontPrevWin_Impl::_CheckScript()
do
{
nChg = (xub_StrLen)xBreak->endOfScript( aText, nChg, nScript );
- aScriptChg.Insert( nChg, nCnt );
+ if (nChg < aText.Len() && nChg > 0 &&
+ (com::sun::star::i18n::ScriptType::WEAK ==
+ xBreak->getScriptType(aText, nChg - 1)))
+ {
+ int8_t nType = u_charType(aText.GetChar(nChg) );
+ if (nType == U_NON_SPACING_MARK || nType == U_ENCLOSING_MARK ||
+ nType == U_COMBINING_SPACING_MARK )
+ {
+ aScriptChg.Insert( nChg - 1, nCnt );
+ }
+ else
+ {
+ aScriptChg.Insert( nChg, nCnt );
+ }
+ }
+ else
+ {
+ aScriptChg.Insert( nChg, nCnt );
+ }
aScriptType.Insert( nScript, nCnt );
aTextWidth.Insert( ULONG(0), nCnt++ );
@@ -604,6 +623,14 @@ void SvxFontPrevWindow::SetColor(const Color &rColor)
pImpl->pColor = new Color( rColor );
Invalidate();
}
+// -----------------------------------------------------------------------
+
+void SvxFontPrevWindow::ResetColor()
+{
+ delete pImpl->pColor;
+ pImpl->pColor = 0;
+ Invalidate();
+}
// -----------------------------------------------------------------------
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index 40c94d2128c3..d835dd1a129e 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -819,11 +819,12 @@ void IMapWindow::DoMacroAssign()
if ( pSdrObj )
{
- SfxItemSet aSet( *pIMapPool, SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG );
+ SfxItemSet aSet( *pIMapPool, SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG, 0 );
SfxEventNamesItem aNamesItem(SID_EVENTCONFIG);
aNamesItem.AddEvent( String::CreateFromAscii( "MouseOver" ), String(), SFX_EVENT_MOUSEOVER_OBJECT );
aNamesItem.AddEvent( String::CreateFromAscii( "MouseOut" ), String(), SFX_EVENT_MOUSEOUT_OBJECT );
+ aSet.Put( aNamesItem );
SvxMacroItem aMacroItem(SID_ATTR_MACROITEM);
IMapObject* pIMapObj = GetIMapObj( pSdrObj );
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 16e04efeefbe..c196178a4d16 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -37,8 +37,9 @@
#include <com/sun/star/linguistic2/XLinguServiceManager.hdl>
#endif
#include <com/sun/star/linguistic2/XAvailableLocales.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
#include <linguistic/misc.hxx>
-#include<rtl/ustring.hxx>
+#include <rtl/ustring.hxx>
#include <unotools/localedatawrapper.hxx>
#include <svtools/langtab.hxx>
@@ -315,6 +316,13 @@ void SvxLanguageBox::SetLanguageList( INT16 nLangList,
USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, USHORT nPos )
{
+ return ImplInsertLanguage( nLangType, nPos, ::com::sun::star::i18n::ScriptType::WEAK );
+}
+
+//------------------------------------------------------------------------
+
+USHORT SvxLanguageBox::ImplInsertLanguage( const LanguageType nLangType, USHORT nPos, sal_Int16 nType )
+{
LanguageType nLang = MsLangId::getReplacementForObsoleteLanguage( nLangType);
// For obsolete and to be replaced languages check whether an entry of the
// replacement already exists and if so don't add an entry with identical
@@ -329,6 +337,15 @@ USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, USHORT nPos
String aStrEntry = m_pLangTable->GetString( nLang );
if (LANGUAGE_NONE == nLang && m_bHasLangNone && m_bLangNoneIsLangAll)
aStrEntry = m_aAllString;
+
+ LanguageType nRealLang = nLang;
+ if (nRealLang == LANGUAGE_SYSTEM)
+ {
+ nRealLang = MsLangId::resolveSystemLanguageByScriptType(nRealLang, nType);
+ aStrEntry.AppendAscii(" - ");
+ aStrEntry.Append(m_pLangTable->GetString( nRealLang ));
+ }
+
aStrEntry = ApplyLreOrRleEmbedding( aStrEntry );
USHORT nAt = 0;
@@ -343,7 +360,7 @@ USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, USHORT nPos
m_pSpellUsedLang = new Sequence< INT16 >( xSpell->getLanguages() );
}
bFound = m_pSpellUsedLang ?
- lcl_SeqHasLang( *m_pSpellUsedLang, nLang ) : FALSE;
+ lcl_SeqHasLang( *m_pSpellUsedLang, nRealLang ) : FALSE;
nAt = ImplInsertImgEntry( aStrEntry, nPos, bFound );
}
@@ -356,6 +373,13 @@ USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, USHORT nPos
//------------------------------------------------------------------------
+USHORT SvxLanguageBox::InsertDefaultLanguage( sal_Int16 nType, USHORT nPos )
+{
+ return ImplInsertLanguage( LANGUAGE_SYSTEM, nPos, nType );
+}
+
+//------------------------------------------------------------------------
+
USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType,
BOOL bCheckEntry, USHORT nPos )
{
diff --git a/svx/source/dialog/makefile.mk b/svx/source/dialog/makefile.mk
index 04865246a915..c54081365a11 100644
--- a/svx/source/dialog/makefile.mk
+++ b/svx/source/dialog/makefile.mk
@@ -31,6 +31,7 @@
PRJ=..$/..
PRJNAME=svx
TARGET=dialogs
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
@@ -76,9 +77,28 @@ SRC1FILES = \
SRS2NAME=drawdlgs
SRC2FILES = \
- sdstring.src \
+ sdstring.src
-SLOFILES= \
+LIB1TARGET=$(SLB)$/$(TARGET)-core.lib
+
+LIB1OBJFILES= \
+ $(SLO)$/dialmgr.obj\
+ $(SLO)$/dlgutil.obj \
+ $(SLO)$/framelink.obj\
+ $(SLO)$/hangulhanja.obj \
+ $(SLO)$/hyphen.obj \
+ $(SLO)$/impgrf.obj \
+ $(SLO)$/langbox.obj \
+ $(SLO)$/opengrf.obj \
+ $(SLO)$/simptabl.obj \
+ $(SLO)$/splwrap.obj \
+ $(SLO)$/svxdlg.obj \
+ $(SLO)$/stddlg.obj \
+ $(SLO)$/thesdlg.obj
+
+LIB2TARGET=$(SLB)$/$(TARGET).lib
+
+LIB2OBJFILES= \
$(SLO)$/charmap.obj \
$(SLO)$/checklbx.obj \
$(SLO)$/connctrl.obj \
@@ -86,31 +106,23 @@ SLOFILES= \
$(SLO)$/ctredlin.obj \
$(SLO)$/databaseregistrationui.obj \
$(SLO)$/dialcontrol.obj \
- $(SLO)$/dialmgr.obj\
$(SLO)$/dlgctl3d.obj \
$(SLO)$/dlgctrl.obj \
- $(SLO)$/dlgutil.obj \
$(SLO)$/docrecovery.obj \
$(SLO)$/fntctrl.obj \
$(SLO)$/fontlb.obj \
$(SLO)$/fontwork.obj \
- $(SLO)$/framelink.obj\
$(SLO)$/framelinkarray.obj \
$(SLO)$/frmdirlbox.obj \
$(SLO)$/frmsel.obj \
$(SLO)$/graphctl.obj \
$(SLO)$/grfflt.obj \
- $(SLO)$/hangulhanja.obj \
$(SLO)$/hdft.obj \
$(SLO)$/hyperdlg.obj \
- $(SLO)$/hyphen.obj \
$(SLO)$/hyprlink.obj \
$(SLO)$/imapdlg.obj \
$(SLO)$/imapwnd.obj \
- $(SLO)$/impgrf.obj \
- $(SLO)$/langbox.obj \
$(SLO)$/measctrl.obj \
- $(SLO)$/opengrf.obj \
$(SLO)$/orienthelper.obj \
$(SLO)$/pagectrl.obj \
$(SLO)$/paraprev.obj \
@@ -122,21 +134,16 @@ SLOFILES= \
$(SLO)$/rlrcitem.obj \
$(SLO)$/rubydialog.obj \
$(SLO)$/rulritem.obj \
- $(SLO)$/simptabl.obj \
$(SLO)$/SpellDialogChildWindow.obj \
- $(SLO)$/splwrap.obj \
$(SLO)$/srchctrl.obj \
$(SLO)$/srchdlg.obj \
- $(SLO)$/stddlg.obj \
$(SLO)$/strarray.obj \
$(SLO)$/svxbmpnumvalueset.obj\
$(SLO)$/svxbox.obj \
- $(SLO)$/svxdlg.obj \
$(SLO)$/svxgrahicitem.obj \
$(SLO)$/svxruler.obj \
$(SLO)$/swframeexample.obj \
$(SLO)$/swframeposstrings.obj \
- $(SLO)$/thesdlg.obj \
$(SLO)$/txencbox.obj \
$(SLO)$/txenctab.obj \
$(SLO)$/wrapfield.obj \
@@ -144,15 +151,17 @@ SLOFILES= \
$(SLO)$/_contdlg.obj
.IF "$(GUI)"=="UNX"
-SLOFILES += $(SLO)$/sendreportunx.obj
+LIB2OBJFILES += $(SLO)$/sendreportunx.obj
.ELSE
.IF "$(GUI)"=="WNT"
-SLOFILES += $(SLO)$/sendreportw32.obj
+LIB2OBJFILES += $(SLO)$/sendreportw32.obj
.ELSE
-SLOFILES += $(SLO)$/sendreportgen.obj
+LIB2OBJFILES += $(SLO)$/sendreportgen.obj
.ENDIF
.ENDIF
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
# --- Targets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 8d0ec6ac4d59..918234222135 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -394,7 +394,7 @@ void SvxJSearchOptionsDialog::SetTransliterationFlags( INT32 nSettings )
aCalcStr ( THIS_SVX_RES( STR_WORDCALC ) ), \
pImpl ( NULL ), \
pSearchList ( NULL ), \
- pReplaceList ( NULL ), \
+ pReplaceList ( new SearchAttrItemList ), \
pSearchItem ( NULL ), \
pSearchController ( NULL ), \
pOptionsController ( NULL ), \
diff --git a/svx/source/dialog/txencbox.cxx b/svx/source/dialog/txencbox.cxx
index 1215c685514e..0c96191c3db8 100644
--- a/svx/source/dialog/txencbox.cxx
+++ b/svx/source/dialog/txencbox.cxx
@@ -34,7 +34,7 @@
#include "txencbox.hxx"
#include "txenctab.hxx"
#include <svx/dialogs.hrc>
-#include "dbcharsethelper.hxx"
+#include "svx/dbcharsethelper.hxx"
#include <vcl/svapp.hxx>
#include <rtl/tencinfo.h>
#include <rtl/locale.h>
diff --git a/svx/source/editeng/editeng.cxx b/svx/source/editeng/editeng.cxx
index 9a0b1d593f40..059dae19c8f8 100644
--- a/svx/source/editeng/editeng.cxx
+++ b/svx/source/editeng/editeng.cxx
@@ -86,11 +86,9 @@
#include <vcl/help.hxx>
#include <svx/xpoly.hxx>
#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
-#ifndef _COM_SUN_STAR_I18N_XINPUTSEQUENCECHECKER_HPP_
#include <com/sun/star/i18n/InputSequenceCheckMode.hpp>
-#endif
-#include <srchdlg.hxx>
+#include <sfx2/srchdefs.hxx>
#if OSL_DEBUG_LEVEL > 1
#include <svx/frmdiritem.hxx>
@@ -99,18 +97,11 @@
// Spaeter -> TOOLS\STRING.H (fuer Grep: WS_TARGET)
-//using namespace ::rtl;
-//using namespace ::utl;
using namespace ::com::sun::star;
-//using namespace ::com::sun::star::util;
using namespace ::com::sun::star::uno;
-//using namespace ::com::sun::star::lang;
-//using namespace ::com::sun::star::beans;
-//using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::linguistic2;
-
DBG_NAME( EditEngine )
DBG_NAMEEX( EditView )
@@ -706,15 +697,35 @@ sal_uInt16 EditEngine::GetParagraphCount() const
sal_uInt16 EditEngine::GetLineCount( sal_uInt16 nParagraph ) const
{
DBG_CHKTHIS( EditEngine, 0 );
+ if ( !pImpEditEngine->IsFormatted() )
+ pImpEditEngine->FormatDoc();
return pImpEditEngine->GetLineCount( nParagraph );
}
sal_uInt16 EditEngine::GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const
{
DBG_CHKTHIS( EditEngine, 0 );
+ if ( !pImpEditEngine->IsFormatted() )
+ pImpEditEngine->FormatDoc();
return pImpEditEngine->GetLineLen( nParagraph, nLine );
}
+void EditEngine::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const
+{
+ DBG_CHKTHIS( EditEngine, 0 );
+ if ( !pImpEditEngine->IsFormatted() )
+ pImpEditEngine->FormatDoc();
+ return pImpEditEngine->GetLineBoundaries( rStart, rEnd, nParagraph, nLine );
+}
+
+USHORT EditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const
+{
+ DBG_CHKTHIS( EditEngine, 0 );
+ if ( !pImpEditEngine->IsFormatted() )
+ pImpEditEngine->FormatDoc();
+ return pImpEditEngine->GetLineNumberAtIndex( nPara, nIndex );
+}
+
sal_uInt32 EditEngine::GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine )
{
DBG_CHKTHIS( EditEngine, 0 );
diff --git a/svx/source/editeng/eertfpar.cxx b/svx/source/editeng/eertfpar.cxx
index e0628d086767..a659b0e513f0 100644
--- a/svx/source/editeng/eertfpar.cxx
+++ b/svx/source/editeng/eertfpar.cxx
@@ -43,6 +43,19 @@
#include <svtools/rtftoken.h>
+// alle Werte auf default; wird nach einlesen der Bitmap aufgerufen !
+void SvxRTFPictureType::ResetValues()
+{ // setze alle Werte RTF-Defaults
+ eStyle = RTF_BITMAP;
+ nMode = HEX_MODE;
+ nType = nGoalWidth = nGoalHeight = 0;
+ nWidth = nHeight = nWidthBytes = 0;
+ uPicLen = 0;
+ nBitsPerPixel = nPlanes = 1;
+ nScalX = nScalY = 100; // Skalierung in Prozent
+ nCropT = nCropB = nCropL = nCropR = 0;
+}
+
ImportInfo::ImportInfo( ImportState eSt, SvParser* pPrsrs, const ESelection& rSel )
: aSelection( rSel )
{
diff --git a/svx/source/editeng/impedit.cxx b/svx/source/editeng/impedit.cxx
index 2e27bd744637..16f0c1f5277d 100644
--- a/svx/source/editeng/impedit.cxx
+++ b/svx/source/editeng/impedit.cxx
@@ -670,6 +670,8 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US
USHORT nTextPortionStart = 0;
USHORT nPara = pEditEngine->pImpEditEngine->aEditDoc.GetPos( aPaM.GetNode() );
+ if (nPara == USHRT_MAX) // #i94322
+ return;
ParaPortion* pParaPortion = pEditEngine->pImpEditEngine->GetParaPortions().GetObject( nPara );
nShowCursorFlags |= nExtraCursorFlags;
diff --git a/svx/source/editeng/impedit.hxx b/svx/source/editeng/impedit.hxx
index 5df4b0f5ed29..25b7cec4f449 100644
--- a/svx/source/editeng/impedit.hxx
+++ b/svx/source/editeng/impedit.hxx
@@ -813,6 +813,8 @@ public:
sal_uInt32 CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, BOOL bIgnoreExtraSpace );
sal_uInt16 GetLineCount( sal_uInt16 nParagraph ) const;
sal_uInt16 GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
+ void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const;
+ USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
sal_uInt16 GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine );
sal_uInt32 GetParaHeight( sal_uInt16 nParagraph );
diff --git a/svx/source/editeng/impedit2.cxx b/svx/source/editeng/impedit2.cxx
index 1299cfd1520a..f8cd7e67a4c9 100644
--- a/svx/source/editeng/impedit2.cxx
+++ b/svx/source/editeng/impedit2.cxx
@@ -1777,7 +1777,7 @@ void ImpEditEngine::InitScriptTypes( USHORT nPara )
::rtl::OUString aOUText( aText );
USHORT nTextLen = (USHORT)aOUText.getLength();
- long nPos = 0;
+ sal_Int32 nPos = 0;
short nScriptType = _xBI->getScriptType( aOUText, nPos );
rTypes.Insert( ScriptTypePosInfo( nScriptType, (USHORT)nPos, nTextLen ), rTypes.Count() );
nPos = _xBI->endOfScript( aOUText, nPos, nScriptType );
@@ -1795,6 +1795,17 @@ void ImpEditEngine::InitScriptTypes( USHORT nPara )
}
else
{
+ if ( _xBI->getScriptType( aOUText, nPos - 1 ) == i18n::ScriptType::WEAK )
+ {
+ switch ( u_charType(aOUText.iterateCodePoints(&nPos, 0) ) ) {
+ case U_NON_SPACING_MARK:
+ case U_ENCLOSING_MARK:
+ case U_COMBINING_SPACING_MARK:
+ --nPos;
+ rTypes[rTypes.Count()-1].nEndPos--;
+ break;
+ }
+ }
rTypes.Insert( ScriptTypePosInfo( nScriptType, (USHORT)nPos, nTextLen ), rTypes.Count() );
}
@@ -3289,9 +3300,9 @@ USHORT ImpEditEngine::GetLineCount( USHORT nParagraph ) const
xub_StrLen ImpEditEngine::GetLineLen( USHORT nParagraph, USHORT nLine ) const
{
- DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" );
+ DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineLen: Out of range" );
ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph );
- DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetLineHeight" );
+ DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetLineLen" );
if ( pPPortion && ( nLine < pPPortion->GetLines().Count() ) )
{
EditLine* pLine = pPPortion->GetLines().GetObject( nLine );
@@ -3302,6 +3313,48 @@ xub_StrLen ImpEditEngine::GetLineLen( USHORT nParagraph, USHORT nLine ) const
return 0xFFFF;
}
+void ImpEditEngine::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const
+{
+ DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" );
+ ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph );
+ DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetLineBoundaries" );
+ rStart = rEnd = 0xFFFF; // default values in case of error
+ if ( pPPortion && ( nLine < pPPortion->GetLines().Count() ) )
+ {
+ EditLine* pLine = pPPortion->GetLines().GetObject( nLine );
+ DBG_ASSERT( pLine, "Zeile nicht gefunden: GetLineBoundaries" );
+ rStart = pLine->GetStart();
+ rEnd = pLine->GetEnd();
+ }
+}
+
+USHORT ImpEditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const
+{
+ USHORT nLineNo = 0xFFFF;
+ ContentNode* pNode = GetEditDoc().SaveGetObject( nPara );
+ DBG_ASSERT( pNode, "GetLineNumberAtIndex: invalid paragraph index" );
+ if (pNode)
+ {
+ // we explicitly allow for the index to point at the character right behind the text
+ const bool bValidIndex = /*0 <= nIndex &&*/ nIndex <= pNode->Len();
+ DBG_ASSERT( bValidIndex, "GetLineNumberAtIndex: invalid index" );
+ const USHORT nLineCount = GetLineCount( nPara );
+ if (nIndex == pNode->Len())
+ nLineNo = nLineCount > 0 ? nLineCount - 1 : 0;
+ else if (bValidIndex) // nIndex < pNode->Len()
+ {
+ USHORT nStart = USHRT_MAX, nEnd = USHRT_MAX;
+ for (USHORT i = 0; i < nLineCount && nLineNo == 0xFFFF; ++i)
+ {
+ GetLineBoundaries( nStart, nEnd, nPara, i );
+ if (nStart <= nIndex && nIndex < nEnd)
+ nLineNo = i;
+ }
+ }
+ }
+ return nLineNo;
+}
+
USHORT ImpEditEngine::GetLineHeight( USHORT nParagraph, USHORT nLine )
{
DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" );
diff --git a/svx/source/engine3d/helperhittest3d.cxx b/svx/source/engine3d/helperhittest3d.cxx
index 3df2e40b8145..821c0ba07c32 100644
--- a/svx/source/engine3d/helperhittest3d.cxx
+++ b/svx/source/engine3d/helperhittest3d.cxx
@@ -92,7 +92,12 @@ namespace drawinglayer
basegfx::B3DPoint maBack;
// the found cut points
- ::std::vector< basegfx::B3DPoint > mo_rResult;
+ ::std::vector< basegfx::B3DPoint > maResult;
+
+ // #i102956# the transformation change from TransformPrimitive3D processings
+ // needs to be remembered to be able to transform found cuts to the
+ // basic coordinate system the processor starts with
+ basegfx::B3DHomMatrix maCombinedTransform;
// as tooling, the process() implementation takes over API handling and calls this
// virtual render method when the primitive implementation is BasePrimitive3D-based.
@@ -105,11 +110,12 @@ namespace drawinglayer
: BaseProcessor3D(rViewInformation),
maFront(rFront),
maBack(rBack),
- mo_rResult()
+ maResult(),
+ maCombinedTransform()
{}
// data access
- const ::std::vector< basegfx::B3DPoint >& getCutPoints() const { return mo_rResult; }
+ const ::std::vector< basegfx::B3DPoint >& getCutPoints() const { return maResult; }
};
void CutFindProcessor::processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate)
@@ -119,9 +125,8 @@ namespace drawinglayer
{
case PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D :
{
- // transform group. Remember current transformations
+ // transform group.
const primitive3d::TransformPrimitive3D& rPrimitive = static_cast< const primitive3d::TransformPrimitive3D& >(rCandidate);
- const geometry::ViewInformation3D aLastViewInformation3D(getViewInformation3D());
// remember old and transform front, back to object coordinates
const basegfx::B3DPoint aLastFront(maFront);
@@ -131,7 +136,8 @@ namespace drawinglayer
maFront *= aInverseTrans;
maBack *= aInverseTrans;
- // create new transformation; add new object transform from right side
+ // remember current and create new transformation; add new object transform from right side
+ const geometry::ViewInformation3D aLastViewInformation3D(getViewInformation3D());
const geometry::ViewInformation3D aNewViewInformation3D(
aLastViewInformation3D.getObjectTransformation() * rPrimitive.getTransformation(),
aLastViewInformation3D.getOrientation(),
@@ -141,10 +147,15 @@ namespace drawinglayer
aLastViewInformation3D.getExtendedInformationSequence());
updateViewInformation(aNewViewInformation3D);
+ // #i102956# remember needed back-transform for found cuts (combine from right side)
+ const basegfx::B3DHomMatrix aLastCombinedTransform(maCombinedTransform);
+ maCombinedTransform = maCombinedTransform * rPrimitive.getTransformation();
+
// let break down
process(rPrimitive.getChildren());
// restore transformations and front, back
+ maCombinedTransform = aLastCombinedTransform;
updateViewInformation(aLastViewInformation3D);
maFront = aLastFront;
maBack = aLastBack;
@@ -207,7 +218,10 @@ namespace drawinglayer
if(basegfx::tools::isInside(rPolyPolygon, aCutPoint, false))
{
- mo_rResult.push_back(aCutPoint);
+ // #i102956# add result. Do not forget to do this in the coordinate
+ // system the processor get started with, so use the collected
+ // combined transformation from processed TransformPrimitive3D's
+ maResult.push_back(maCombinedTransform * aCutPoint);
}
}
}
@@ -376,9 +390,9 @@ SVX_DLLPUBLIC void getAllHit3DObjectsSortedFrontToBack(
::std::vector< basegfx::B3DPoint > aHitsWithObject;
getAllHit3DObjectWithRelativePoint(aFront, aBack, *pCandidate, aViewInfo3D, aHitsWithObject);
- if(aHitsWithObject.size())
+ for(sal_uInt32 a(0); a < aHitsWithObject.size(); a++)
{
- const basegfx::B3DPoint aPointInViewCoordinates(aViewInfo3D.getObjectToView() * aHitsWithObject[0]);
+ const basegfx::B3DPoint aPointInViewCoordinates(aViewInfo3D.getObjectToView() * aHitsWithObject[a]);
aDepthAndObjectResults.push_back(ImplPairDephAndObject(pCandidate, aPointInViewCoordinates.getZ()));
}
}
diff --git a/svx/source/engine3d/makefile.mk b/svx/source/engine3d/makefile.mk
index 4c03f949e939..bb590bd76c71 100644
--- a/svx/source/engine3d/makefile.mk
+++ b/svx/source/engine3d/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=engine3d
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
@@ -42,7 +43,8 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES= \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/e3dsceneupdater.obj \
$(SLO)$/helperminimaldepth3d.obj \
$(SLO)$/helperhittest3d.obj \
@@ -57,16 +59,21 @@ SLOFILES= \
$(SLO)$/svx3ditems.obj \
$(SLO)$/deflt3d.obj \
$(SLO)$/e3dundo.obj \
- $(SLO)$/volume3d.obj \
- $(SLO)$/viewpt3d.obj \
$(SLO)$/viewpt3d2.obj \
$(SLO)$/camera3d.obj \
$(SLO)$/objfac3d.obj \
$(SLO)$/dragmt3d.obj \
$(SLO)$/view3d.obj \
- $(SLO)$/view3d1.obj \
+ $(SLO)$/view3d1.obj
+
+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=\
diff --git a/svx/source/fmcomp/dbaexchange.cxx b/svx/source/fmcomp/dbaexchange.cxx
index d92b1dd4bbca..99abbd9853f7 100644
--- a/svx/source/fmcomp/dbaexchange.cxx
+++ b/svx/source/fmcomp/dbaexchange.cxx
@@ -61,7 +61,6 @@ namespace svx
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::datatransfer;
- using namespace ::svxform;
using namespace ::comphelper;
//====================================================================
diff --git a/svx/source/fmcomp/dbaobjectex.cxx b/svx/source/fmcomp/dbaobjectex.cxx
index 21381d9c8709..26c0d04a891e 100644
--- a/svx/source/fmcomp/dbaobjectex.cxx
+++ b/svx/source/fmcomp/dbaobjectex.cxx
@@ -60,7 +60,6 @@ namespace svx
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::datatransfer;
- using namespace ::svxform;
using namespace ::comphelper;
//====================================================================
diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx
index 20de4e139b9d..c210919bd09d 100644
--- a/svx/source/fmcomp/fmgridcl.cxx
+++ b/svx/source/fmcomp/fmgridcl.cxx
@@ -889,9 +889,6 @@ void FmGridHeader::PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupMe
break;
case SID_FM_SHOWCOLS_MORE:
{
- //CHINA001 FmShowColsDialog dlg(NULL);
- //CHINA001 dlg.SetColumns(xCols);
- //CHINA001 dlg.Execute();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
@@ -960,24 +957,14 @@ void FmGridHeader::PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupMe
}
else
{
- // Standardlabel setzen
- ::rtl::OUString sLabelBase = String( SVX_RES( RID_STR_COLUMN ) );
- // disambiguate the name
- Reference< XNameAccess > xColNames( xCols, UNO_QUERY );
- ::rtl::OUString sLabel;
- for ( sal_Int32 i=1; i<65535; ++i )
- {
- sLabel = sLabelBase;
- sLabel += ::rtl::OUString::valueOf( (sal_Int32)i );
- if ( !xColNames->hasByName( sLabel ) )
- break;
- }
- // no fallback in case the name is not unique (which is rather improbable) ....
+ FormControlFactory factory( ::comphelper::getProcessServiceFactory() );
+
+ ::rtl::OUString sLabel = factory.getDefaultUniqueName_ByComponentType(
+ Reference< XNameAccess >( xCols, UNO_QUERY_THROW ), xNewCol );
xNewCol->setPropertyValue( FM_PROP_LABEL, makeAny( sLabel ) );
xNewCol->setPropertyValue( FM_PROP_NAME, makeAny( sLabel ) );
- FormControlFactory determine( ::comphelper::getProcessServiceFactory() );
- determine.initializeControlModel( DocumentClassification::classifyHostDocument( xCols ), xNewCol );
+ factory.initializeControlModel( DocumentClassification::classifyHostDocument( xCols ), xNewCol );
xCols->insertByIndex( nPos, makeAny( xNewCol ) );
}
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index 8f5a895e0c33..0bfc7c768973 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -1919,7 +1919,7 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
sal_Bool bVoid = !Value.hasValue();
- if ( 0 == PropertyName.compareToAscii( FM_PROP_TEXTLINECOLOR ) )
+ if ( 0 == PropertyName.compareTo( FM_PROP_TEXTLINECOLOR ) )
{
::Color aTextLineColor( bVoid ? COL_TRANSPARENT : ::comphelper::getINT32( Value ) );
if (bVoid)
@@ -1953,21 +1953,21 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
if (isDesignMode())
pGrid->Invalidate();
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_FONTEMPHASISMARK ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_FONTEMPHASISMARK ) )
{
Font aGridFont = pGrid->GetControlFont();
sal_Int16 nValue = ::comphelper::getINT16(Value);
aGridFont.SetEmphasisMark( nValue );
pGrid->SetControlFont( aGridFont );
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_FONTRELIEF ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_FONTRELIEF ) )
{
Font aGridFont = pGrid->GetControlFont();
sal_Int16 nValue = ::comphelper::getINT16(Value);
aGridFont.SetRelief( (FontRelief)nValue );
pGrid->SetControlFont( aGridFont );
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_HELPURL ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_HELPURL ) )
{
String sHelpURL(::comphelper::getString(Value));
String sPattern;
@@ -1978,11 +1978,11 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
pGrid->SetHelpId(sID.ToInt32());
}
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_DISPLAYSYNCHRON ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_DISPLAYSYNCHRON ) )
{
pGrid->setDisplaySynchron(::comphelper::getBOOL(Value));
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_CURSORCOLOR ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_CURSORCOLOR ) )
{
if (bVoid)
pGrid->SetCursorColor(COL_TRANSPARENT);
@@ -1991,13 +1991,13 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
if (isDesignMode())
pGrid->Invalidate();
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_ALWAYSSHOWCURSOR ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_ALWAYSSHOWCURSOR ) )
{
pGrid->EnablePermanentCursor(::comphelper::getBOOL(Value));
if (isDesignMode())
pGrid->Invalidate();
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_FONT ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_FONT ) )
{
if ( bVoid )
pGrid->SetControlFont( Font() );
@@ -2031,7 +2031,7 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
}
}
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_BACKGROUNDCOLOR ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_BACKGROUNDCOLOR ) )
{
if ( bVoid )
{
@@ -2044,7 +2044,7 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
pGrid->SetControlBackground( aColor );
}
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_TEXTCOLOR ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_TEXTCOLOR ) )
{
if ( bVoid )
{
@@ -2057,7 +2057,7 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
pGrid->SetControlForeground( aColor );
}
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_ROWHEIGHT ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_ROWHEIGHT ) )
{
sal_Int32 nLogHeight(0);
if (Value >>= nLogHeight)
@@ -2070,17 +2070,17 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
else if (bVoid)
pGrid->SetDataRowHeight(0);
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_HASNAVIGATION ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_HASNAVIGATION ) )
{
if (Value.getValueType() == ::getBooleanCppuType())
pGrid->EnableNavigationBar(*(sal_Bool*)Value.getValue());
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_RECORDMARKER ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_RECORDMARKER ) )
{
if (Value.getValueType() == ::getBooleanCppuType())
pGrid->EnableHandle(*(sal_Bool*)Value.getValue());
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_ENABLED ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_ENABLED ) )
{
if (Value.getValueType() == ::getBooleanCppuType())
{
@@ -2134,37 +2134,37 @@ Any FmXGridPeer::getProperty( const ::rtl::OUString& _rPropertyName ) throw( Run
FmGridControl* pGrid = (FmGridControl*) GetWindow();
Window* pDataWindow = &pGrid->GetDataWindow();
- if ( 0 == _rPropertyName.compareToAscii( FM_PROP_NAME ) )
+ if ( 0 == _rPropertyName.compareTo( FM_PROP_NAME ) )
{
Font aFont = pDataWindow->GetControlFont();
aProp <<= ImplCreateFontDescriptor( aFont );
}
- else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_TEXTCOLOR ) )
+ else if ( 0 == _rPropertyName.compareTo( FM_PROP_TEXTCOLOR ) )
{
aProp <<= (sal_Int32)pDataWindow->GetControlForeground().GetColor();
}
- else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_BACKGROUNDCOLOR ) )
+ else if ( 0 == _rPropertyName.compareTo( FM_PROP_BACKGROUNDCOLOR ) )
{
aProp <<= (sal_Int32)pDataWindow->GetControlBackground().GetColor();
}
- else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_ROWHEIGHT ) )
+ else if ( 0 == _rPropertyName.compareTo( FM_PROP_ROWHEIGHT ) )
{
sal_Int32 nPixelHeight = pGrid->GetDataRowHeight();
// take the zoom factor into account
nPixelHeight = pGrid->CalcReverseZoom(nPixelHeight);
aProp <<= (sal_Int32)pGrid->PixelToLogic(Point(0,nPixelHeight),MAP_10TH_MM).Y();
}
- else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_HASNAVIGATION ) )
+ else if ( 0 == _rPropertyName.compareTo( FM_PROP_HASNAVIGATION ) )
{
sal_Bool bHasNavBar = pGrid->HasNavigationBar();
aProp <<= (sal_Bool)bHasNavBar;
}
- else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_RECORDMARKER ) )
+ else if ( 0 == _rPropertyName.compareTo( FM_PROP_RECORDMARKER ) )
{
sal_Bool bHasHandle = pGrid->HasHandle();
aProp <<= (sal_Bool)bHasHandle;
}
- else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_ENABLED ) )
+ else if ( 0 == _rPropertyName.compareTo( FM_PROP_ENABLED ) )
{
aProp <<= (sal_Bool)pDataWindow->IsEnabled();
}
@@ -2948,7 +2948,7 @@ IMPL_LINK(FmXGridPeer, OnExecuteGridSlot, void*, pSlot)
if (m_pDispatchers[i].is())
{
// commit any changes done so far, if it's not the undoRecord URL
- if ( 0 == pUrls->Complete.compareToAscii( FMURL_RECORD_UNDO ) || commit() )
+ if ( 0 == pUrls->Complete.compareTo( FMURL_RECORD_UNDO ) || commit() )
m_pDispatchers[i]->dispatch(*pUrls, Sequence< PropertyValue>());
return 1; // handled
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index ad645992d53d..ff7cfd422eb8 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -30,55 +30,52 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include "gridcell.hxx"
-#include "fmtools.hxx"
-#include <stdio.h>
-#ifndef _SVX_FMPROP_HRC
+
+
#include "fmprop.hrc"
-#endif
+#include "fmresids.hrc"
+#include "fmtools.hxx"
+#include "gridcell.hxx"
#include "gridcols.hxx"
#include "sdbdatacolumn.hxx"
+
+#include <com/sun/star/awt/LineEndFormat.hpp>
+#include <com/sun/star/awt/MouseWheelBehavior.hpp>
#include <com/sun/star/awt/VisualEffect.hpp>
-#include <com/sun/star/sdbc/XStatement.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/form/FormComponentType.hpp>
+#include <com/sun/star/form/XBoundComponent.hpp>
#include <com/sun/star/script/XEventAttacherManager.hpp>
-#ifndef _COM_SUN_STAR_SDDB_XCOLUMNSSUPPLIER_HPP_
-#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#endif
#include <com/sun/star/sdb/XSQLQueryComposerFactory.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/form/XBoundComponent.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/form/FormComponentType.hpp>
-#include <com/sun/star/util/XNumberFormatter.hpp>
+#include <com/sun/star/sdbc/DataType.hpp>
+#include <com/sun/star/sdbc/XStatement.hpp>
+#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <com/sun/star/util/NumberFormat.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/awt/LineEndFormat.hpp>
-#include <com/sun/star/awt/MouseWheelBehavior.hpp>
-#ifndef _COM_SUN_STAR_SCRTIP_XEVENTATTACHERMANAGER_HPP_
-#include <com/sun/star/script/XEventAttacherManager.hpp>
-#endif
-#include <svtools/fmtfield.hxx>
-#include <svtools/numuno.hxx>
-#include <svtools/calendar.hxx>
-#include <vcl/longcurr.hxx>
-#include <svx/dialmgr.hxx>
-#ifndef _SVX_FMRESIDS_HRC
-#include "fmresids.hrc"
-#endif
-#include <tools/shl.hxx>
-#include <tools/diagnose_ex.h>
+#include <com/sun/star/util/XNumberFormatter.hpp>
+
+#include <comphelper/extract.hxx>
#include <comphelper/numbers.hxx>
#include <comphelper/property.hxx>
-#include <comphelper/extract.hxx>
+#include <connectivity/formattedcolumnvalue.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <i18npool/lang.h>
-#include <connectivity/formattedcolumnvalue.hxx>
-#include <math.h>
#include <rtl/math.hxx>
+#include <svtools/calendar.hxx>
+#include <svtools/fmtfield.hxx>
+#include <svtools/numuno.hxx>
#include <svtools/svmedit.hxx>
+#include <svx/dialmgr.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <tools/diagnose_ex.h>
+#include <tools/shl.hxx>
+#include <vcl/longcurr.hxx>
+
+#include <math.h>
+#include <stdio.h>
using namespace ::connectivity;
using namespace ::connectivity::simple;
@@ -228,13 +225,15 @@ void DbGridColumn::CreateControl(sal_Int32 _nFieldPos, const Reference< ::com::s
{
switch (nTypeId)
{
- case TYPE_CHECKBOX: m_pCell = new FmXCheckBoxCell(this, pCellControl); break;
- case TYPE_LISTBOX: m_pCell = new FmXListBoxCell(this, pCellControl); break;
+ case TYPE_CHECKBOX: m_pCell = new FmXCheckBoxCell( this, *pCellControl ); break;
+ case TYPE_LISTBOX: m_pCell = new FmXListBoxCell( this, *pCellControl ); break;
+ case TYPE_COMBOBOX: m_pCell = new FmXComboBoxCell( this, *pCellControl ); break;
default:
- m_pCell = new FmXEditCell(this, pCellControl);
+ m_pCell = new FmXEditCell( this, *pCellControl );
}
}
m_pCell->acquire();
+ m_pCell->init();
impl_toggleScriptManager_nothrow( true );
@@ -651,10 +650,10 @@ void DbCellControl::_propertyChanged(const PropertyChangeEvent& _rEvent) throw(R
Reference< XPropertySet > xSourceProps( _rEvent.Source, UNO_QUERY );
- if ( _rEvent.PropertyName.equalsAscii( FM_PROP_VALUE )
- || _rEvent.PropertyName.equalsAscii( FM_PROP_STATE )
- || _rEvent.PropertyName.equalsAscii( FM_PROP_TEXT )
- || _rEvent.PropertyName.equalsAscii( FM_PROP_EFFECTIVE_VALUE )
+ if ( _rEvent.PropertyName.equals( FM_PROP_VALUE )
+ || _rEvent.PropertyName.equals( FM_PROP_STATE )
+ || _rEvent.PropertyName.equals( FM_PROP_TEXT )
+ || _rEvent.PropertyName.equals( FM_PROP_EFFECTIVE_VALUE )
)
{ // it was one of the known "value" properties
if ( !isValuePropertyLocked() )
@@ -662,11 +661,11 @@ void DbCellControl::_propertyChanged(const PropertyChangeEvent& _rEvent) throw(R
implValuePropertyChanged( );
}
}
- else if ( _rEvent.PropertyName.equalsAscii( FM_PROP_READONLY ) )
+ else if ( _rEvent.PropertyName.equals( FM_PROP_READONLY ) )
{
implAdjustReadOnly( xSourceProps );
}
- else if ( _rEvent.PropertyName.equalsAscii( FM_PROP_ENABLED ) )
+ else if ( _rEvent.PropertyName.equals( FM_PROP_ENABLED ) )
{
implAdjustEnabled( xSourceProps );
}
@@ -2429,7 +2428,7 @@ DbComboBox::DbComboBox(DbGridColumn& _rColumn)
//------------------------------------------------------------------------------
void DbComboBox::_propertyChanged( const PropertyChangeEvent& _rEvent ) throw( RuntimeException )
{
- if ( _rEvent.PropertyName.equalsAscii( FM_PROP_STRINGITEMLIST ) )
+ if ( _rEvent.PropertyName.equals( FM_PROP_STRINGITEMLIST ) )
{
SetList(_rEvent.NewValue);
}
@@ -2558,7 +2557,7 @@ DbListBox::DbListBox(DbGridColumn& _rColumn)
//------------------------------------------------------------------------------
void DbListBox::_propertyChanged( const ::com::sun::star::beans::PropertyChangeEvent& _rEvent ) throw( RuntimeException )
{
- if ( _rEvent.PropertyName.equalsAscii( FM_PROP_STRINGITEMLIST ) )
+ if ( _rEvent.PropertyName.equals( FM_PROP_STRINGITEMLIST ) )
{
SetList(_rEvent.NewValue);
}
@@ -3199,13 +3198,33 @@ TYPEINIT0(FmXGridCell);
DBG_NAME(FmXGridCell);
//-----------------------------------------------------------------------------
-FmXGridCell::FmXGridCell(DbGridColumn* pColumn, DbCellControl* pControl)
+FmXGridCell::FmXGridCell( DbGridColumn* pColumn, DbCellControl* _pControl )
:OComponentHelper(m_aMutex)
,m_pColumn(pColumn)
- ,m_pCellControl(pControl)
+ ,m_pCellControl( _pControl )
+ ,m_aWindowListeners( m_aMutex )
+ ,m_aFocusListeners( m_aMutex )
+ ,m_aKeyListeners( m_aMutex )
+ ,m_aMouseListeners( m_aMutex )
+ ,m_aMouseMotionListeners( m_aMutex )
{
DBG_CTOR(FmXGridCell,NULL);
+}
+
+//-----------------------------------------------------------------------------
+void FmXGridCell::init()
+{
+ Window* pEventWindow( getEventWindow() );
+ if ( pEventWindow )
+ pEventWindow->AddEventListener( LINK( this, FmXGridCell, OnWindowEvent ) );
+}
+//-----------------------------------------------------------------------------
+Window* FmXGridCell::getEventWindow() const
+{
+ if ( m_pCellControl )
+ return &m_pCellControl->GetWindow();
+ return NULL;
}
//-----------------------------------------------------------------------------
@@ -3236,25 +3255,34 @@ void FmXGridCell::SetTextLineColor(const Color& _rColor)
// XTypeProvider
//------------------------------------------------------------------
-Sequence< sal_Int8 > SAL_CALL FmXGridCell::getImplementationId() throw(RuntimeException)
-{
- static ::cppu::OImplementationId* pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+Sequence< Type > SAL_CALL FmXGridCell::getTypes( ) throw (RuntimeException)
+{
+ Sequence< uno::Type > aTypes = ::comphelper::concatSequences(
+ ::cppu::OComponentHelper::getTypes(),
+ FmXGridCell_Base::getTypes()
+ );
+ if ( m_pCellControl )
+ aTypes = ::comphelper::concatSequences(
+ aTypes,
+ FmXGridCell_WindowBase::getTypes()
+ );
+ return aTypes;
}
+//------------------------------------------------------------------
+IMPLEMENT_GET_IMPLEMENTATION_ID( FmXGridCell )
+
// OComponentHelper
//-----------------------------------------------------------------------------
void FmXGridCell::disposing()
{
+ lang::EventObject aEvent( *this );
+ m_aWindowListeners.disposeAndClear( aEvent );
+ m_aFocusListeners.disposeAndClear( aEvent );
+ m_aKeyListeners.disposeAndClear( aEvent );
+ m_aMouseListeners.disposeAndClear( aEvent );
+ m_aMouseMotionListeners.disposeAndClear( aEvent );
+
OComponentHelper::disposing();
m_pColumn = NULL;
DELETEZ(m_pCellControl);
@@ -3263,12 +3291,13 @@ void FmXGridCell::disposing()
//------------------------------------------------------------------
Any SAL_CALL FmXGridCell::queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(RuntimeException)
{
- Any aReturn = OComponentHelper::queryAggregation(_rType);
- if (!aReturn.hasValue())
- aReturn = ::cppu::queryInterface(_rType,
- static_cast< ::com::sun::star::awt::XControl* >(this),
- static_cast< ::com::sun::star::form::XBoundControl* >(this)
- );
+ Any aReturn = OComponentHelper::queryAggregation( _rType );
+
+ if ( !aReturn.hasValue() )
+ aReturn = FmXGridCell_Base::queryInterface( _rType );
+
+ if ( !aReturn.hasValue() && ( m_pCellControl != NULL ) )
+ aReturn = FmXGridCell_WindowBase::queryInterface( _rType );
return aReturn;
}
@@ -3305,6 +3334,231 @@ void FmXGridCell::setLock(sal_Bool _bLock) throw( RuntimeException )
}
}
+//------------------------------------------------------------------
+void SAL_CALL FmXGridCell::setPosSize( ::sal_Int32 _XX, ::sal_Int32 _Y, ::sal_Int32 _Width, ::sal_Int32 _Height, ::sal_Int16 _Flags ) throw (RuntimeException)
+{
+ OSL_ENSURE( false, "FmXGridCell::setPosSize: not implemented" );
+ (void)_XX;
+ (void)_Y;
+ (void)_Width;
+ (void)_Height;
+ (void)_Flags;
+ // not allowed to tamper with this for a grid cell
+}
+
+//------------------------------------------------------------------
+awt::Rectangle SAL_CALL FmXGridCell::getPosSize( ) throw (RuntimeException)
+{
+ OSL_ENSURE( false, "FmXGridCell::getPosSize: not implemented" );
+ return awt::Rectangle();
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXGridCell::setVisible( ::sal_Bool _Visible ) throw (RuntimeException)
+{
+ OSL_ENSURE( false, "FmXGridCell::setVisible: not implemented" );
+ (void)_Visible;
+ // not allowed to tamper with this for a grid cell
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXGridCell::setEnable( ::sal_Bool _Enable ) throw (RuntimeException)
+{
+ OSL_ENSURE( false, "FmXGridCell::setEnable: not implemented" );
+ (void)_Enable;
+ // not allowed to tamper with this for a grid cell
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXGridCell::setFocus( ) throw (RuntimeException)
+{
+ OSL_ENSURE( false, "FmXGridCell::setFocus: not implemented" );
+ // not allowed to tamper with this for a grid cell
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXGridCell::addWindowListener( const Reference< awt::XWindowListener >& _rxListener ) throw (RuntimeException)
+{
+ m_aWindowListeners.addInterface( _rxListener );
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXGridCell::removeWindowListener( const Reference< awt::XWindowListener >& _rxListener ) throw (RuntimeException)
+{
+ m_aWindowListeners.removeInterface( _rxListener );
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXGridCell::addFocusListener( const Reference< awt::XFocusListener >& _rxListener ) throw (RuntimeException)
+{
+ m_aFocusListeners.addInterface( _rxListener );
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXGridCell::removeFocusListener( const Reference< awt::XFocusListener >& _rxListener ) throw (RuntimeException)
+{
+ m_aFocusListeners.removeInterface( _rxListener );
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXGridCell::addKeyListener( const Reference< awt::XKeyListener >& _rxListener ) throw (RuntimeException)
+{
+ m_aKeyListeners.addInterface( _rxListener );
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXGridCell::removeKeyListener( const Reference< awt::XKeyListener >& _rxListener ) throw (RuntimeException)
+{
+ m_aKeyListeners.removeInterface( _rxListener );
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXGridCell::addMouseListener( const Reference< awt::XMouseListener >& _rxListener ) throw (RuntimeException)
+{
+ m_aMouseListeners.addInterface( _rxListener );
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXGridCell::removeMouseListener( const Reference< awt::XMouseListener >& _rxListener ) throw (RuntimeException)
+{
+ m_aMouseListeners.removeInterface( _rxListener );
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXGridCell::addMouseMotionListener( const Reference< awt::XMouseMotionListener >& _rxListener ) throw (RuntimeException)
+{
+ m_aMouseMotionListeners.addInterface( _rxListener );
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXGridCell::removeMouseMotionListener( const Reference< awt::XMouseMotionListener >& _rxListener ) throw (RuntimeException)
+{
+ m_aMouseMotionListeners.removeInterface( _rxListener );
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXGridCell::addPaintListener( const Reference< awt::XPaintListener >& _rxListener ) throw (RuntimeException)
+{
+ OSL_ENSURE( false, "FmXGridCell::addPaintListener: not implemented" );
+ (void)_rxListener;
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXGridCell::removePaintListener( const Reference< awt::XPaintListener >& _rxListener ) throw (RuntimeException)
+{
+ OSL_ENSURE( false, "FmXGridCell::removePaintListener: not implemented" );
+ (void)_rxListener;
+}
+
+//------------------------------------------------------------------
+IMPL_LINK( FmXGridCell, OnWindowEvent, VclWindowEvent*, _pEvent )
+{
+ ENSURE_OR_THROW( _pEvent, "illegal event pointer" );
+ ENSURE_OR_THROW( _pEvent->GetWindow(), "illegal window" );
+ onWindowEvent( _pEvent->GetId(), *_pEvent->GetWindow(), _pEvent->GetData() );
+ return 1L;
+}
+
+//------------------------------------------------------------------------------
+void FmXGridCell::onFocusGained( const awt::FocusEvent& _rEvent )
+{
+ m_aFocusListeners.notifyEach( &awt::XFocusListener::focusGained, _rEvent );
+}
+
+//------------------------------------------------------------------------------
+void FmXGridCell::onFocusLost( const awt::FocusEvent& _rEvent )
+{
+ m_aFocusListeners.notifyEach( &awt::XFocusListener::focusLost, _rEvent );
+}
+
+//------------------------------------------------------------------------------
+void FmXGridCell::onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData )
+{
+ switch ( _nEventId )
+ {
+ case VCLEVENT_CONTROL_GETFOCUS:
+ case VCLEVENT_WINDOW_GETFOCUS:
+ case VCLEVENT_CONTROL_LOSEFOCUS:
+ case VCLEVENT_WINDOW_LOSEFOCUS:
+ {
+ if ( ( _rWindow.IsCompoundControl()
+ && ( _nEventId == VCLEVENT_CONTROL_GETFOCUS
+ || _nEventId == VCLEVENT_CONTROL_LOSEFOCUS
+ )
+ )
+ || ( !_rWindow.IsCompoundControl()
+ && ( _nEventId == VCLEVENT_WINDOW_GETFOCUS
+ || _nEventId == VCLEVENT_WINDOW_LOSEFOCUS
+ )
+ )
+ )
+ {
+ if ( !m_aFocusListeners.getLength() )
+ break;
+
+ bool bFocusGained = ( _nEventId == VCLEVENT_CONTROL_GETFOCUS ) || ( _nEventId == VCLEVENT_WINDOW_GETFOCUS );
+
+ awt::FocusEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.FocusFlags = _rWindow.GetGetFocusFlags();
+ aEvent.Temporary = sal_False;
+
+ if ( bFocusGained )
+ onFocusGained( aEvent );
+ else
+ onFocusLost( aEvent );
+ }
+ }
+ break;
+ case VCLEVENT_WINDOW_MOUSEBUTTONDOWN:
+ case VCLEVENT_WINDOW_MOUSEBUTTONUP:
+ {
+ if ( !m_aMouseListeners.getLength() )
+ break;
+
+ const bool bButtonDown = ( _nEventId == VCLEVENT_WINDOW_MOUSEBUTTONDOWN );
+
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *static_cast< const ::MouseEvent* >( _pEventData ), *this ) );
+ m_aMouseListeners.notifyEach( bButtonDown ? &awt::XMouseListener::mousePressed : &awt::XMouseListener::mouseReleased, aEvent );
+ }
+ break;
+ case VCLEVENT_WINDOW_MOUSEMOVE:
+ {
+ const MouseEvent& rMouseEvent = *static_cast< const ::MouseEvent* >( _pEventData );
+ if ( rMouseEvent.IsEnterWindow() || rMouseEvent.IsLeaveWindow() )
+ {
+ if ( m_aMouseListeners.getLength() != 0 )
+ {
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( rMouseEvent, *this ) );
+ m_aMouseListeners.notifyEach( rMouseEvent.IsEnterWindow() ? &awt::XMouseListener::mouseEntered: &awt::XMouseListener::mouseExited, aEvent );
+ }
+ }
+ else if ( !rMouseEvent.IsEnterWindow() && !rMouseEvent.IsLeaveWindow() )
+ {
+ if ( m_aMouseMotionListeners.getLength() != 0 )
+ {
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( rMouseEvent, *this ) );
+ aEvent.ClickCount = 0;
+ const bool bSimpleMove = ( ( rMouseEvent.GetMode() & MOUSE_SIMPLEMOVE ) != 0 );
+ m_aMouseMotionListeners.notifyEach( bSimpleMove ? &awt::XMouseMotionListener::mouseMoved: &awt::XMouseMotionListener::mouseDragged, aEvent );
+ }
+ }
+ }
+ break;
+ case VCLEVENT_WINDOW_KEYINPUT:
+ case VCLEVENT_WINDOW_KEYUP:
+ {
+ if ( !m_aKeyListeners.getLength() )
+ break;
+
+ const bool bKeyPressed = ( _nEventId == VCLEVENT_WINDOW_KEYINPUT );
+ awt::KeyEvent aEvent( VCLUnoHelper::createKeyEvent( *static_cast< const ::KeyEvent* >( _pEventData ), *this ) );
+ m_aKeyListeners.notifyEach( bKeyPressed ? &awt::XKeyListener::keyPressed: &awt::XKeyListener::keyReleased, aEvent );
+ }
+ break;
+ }
+}
+
/*************************************************************************/
TYPEINIT1(FmXDataCell, FmXGridCell);
//------------------------------------------------------------------------------
@@ -3326,6 +3580,12 @@ void FmXDataCell::UpdateFromColumn()
/*************************************************************************/
TYPEINIT1(FmXTextCell, FmXDataCell);
+FmXTextCell::FmXTextCell( DbGridColumn* pColumn, DbCellControl& _rControl )
+ :FmXDataCell( pColumn, _rControl )
+ ,m_bFastPaint( sal_True )
+{
+}
+
//------------------------------------------------------------------------------
void FmXTextCell::PaintFieldToCell(OutputDevice& rDev,
const Rectangle& rRect,
@@ -3372,15 +3632,16 @@ void FmXTextCell::PaintFieldToCell(OutputDevice& rDev,
DBG_NAME(FmXEditCell);
//------------------------------------------------------------------------------
-FmXEditCell::FmXEditCell(DbGridColumn* pColumn, DbCellControl* pControl)
- :FmXTextCell(pColumn, pControl)
+FmXEditCell::FmXEditCell( DbGridColumn* pColumn, DbCellControl& _rControl )
+ :FmXTextCell( pColumn, _rControl )
,m_aTextListeners(m_aMutex)
+ ,m_aChangeListeners( m_aMutex )
,m_pEditImplementation( NULL )
,m_bOwnEditImplementation( false )
{
DBG_CTOR(FmXEditCell,NULL);
- DbTextField* pTextField = PTR_CAST( DbTextField, pControl );
+ DbTextField* pTextField = PTR_CAST( DbTextField, &_rControl );
if ( pTextField )
{
@@ -3390,11 +3651,9 @@ FmXEditCell::FmXEditCell(DbGridColumn* pColumn, DbCellControl* pControl)
}
else
{
- m_pEditImplementation = new EditImplementation( *static_cast< Edit* >( pControl->GetControl() ) );
+ m_pEditImplementation = new EditImplementation( static_cast< Edit& >( _rControl.GetWindow() ) );
m_bOwnEditImplementation = true;
}
-
- m_pEditImplementation->SetModifyHdl( LINK( this, FmXEditCell, OnTextChanged ) );
}
//------------------------------------------------------------------
@@ -3416,6 +3675,7 @@ void FmXEditCell::disposing()
{
::com::sun::star::lang::EventObject aEvt(*this);
m_aTextListeners.disposeAndClear(aEvt);
+ m_aChangeListeners.disposeAndClear(aEvt);
m_pEditImplementation->SetModifyHdl( Link() );
if ( m_bOwnEditImplementation )
@@ -3428,27 +3688,26 @@ void FmXEditCell::disposing()
//------------------------------------------------------------------
Any SAL_CALL FmXEditCell::queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(RuntimeException)
{
- Any aReturn = FmXDataCell::queryAggregation(_rType);
- if (!aReturn.hasValue())
- aReturn = ::cppu::queryInterface(_rType,
- static_cast< ::com::sun::star::awt::XTextComponent* >(this)
- );
+ Any aReturn = FmXTextCell::queryAggregation( _rType );
+
+ if ( !aReturn.hasValue() )
+ aReturn = FmXEditCell_Base::queryInterface( _rType );
+
return aReturn;
}
//-------------------------------------------------------------------------
Sequence< ::com::sun::star::uno::Type > SAL_CALL FmXEditCell::getTypes( ) throw(RuntimeException)
{
- Sequence< ::com::sun::star::uno::Type > aTypes = OComponentHelper::getTypes();
-
- sal_Int32 nLen = aTypes.getLength();
- aTypes.realloc(nLen + 2);
- aTypes.getArray()[nLen++] = ::getCppuType(static_cast< Reference< ::com::sun::star::awt::XControl >* >(NULL));
- aTypes.getArray()[nLen++] = ::getCppuType(static_cast< Reference< ::com::sun::star::awt::XTextComponent >* >(NULL));
-
- return aTypes;
+ return ::comphelper::concatSequences(
+ FmXTextCell::getTypes(),
+ FmXEditCell_Base::getTypes()
+ );
}
+//------------------------------------------------------------------------------
+IMPLEMENT_GET_IMPLEMENTATION_ID( FmXEditCell )
+
// ::com::sun::star::awt::XTextComponent
//------------------------------------------------------------------------------
void SAL_CALL FmXEditCell::addTextListener(const Reference< ::com::sun::star::awt::XTextListener >& l) throw( RuntimeException )
@@ -3473,7 +3732,7 @@ void SAL_CALL FmXEditCell::setText( const ::rtl::OUString& aText ) throw( Runtim
// In JAVA wird auch ein textChanged ausgeloest, in VCL nicht.
// ::com::sun::star::awt::Toolkit soll JAVA-komform sein...
- OnTextChanged( NULL );
+ onTextChanged();
}
}
@@ -3583,30 +3842,70 @@ void SAL_CALL FmXEditCell::setMaxTextLen( sal_Int16 nLen ) throw( RuntimeExcepti
}
//------------------------------------------------------------------------------
-IMPL_LINK( FmXEditCell, OnTextChanged, void*, EMPTYARG )
+void SAL_CALL FmXEditCell::addChangeListener( const Reference< form::XChangeListener >& _Listener ) throw (RuntimeException)
{
- if ( m_pEditImplementation )
+ m_aChangeListeners.addInterface( _Listener );
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL FmXEditCell::removeChangeListener( const Reference< form::XChangeListener >& _Listener ) throw (RuntimeException)
+{
+ m_aChangeListeners.removeInterface( _Listener );
+}
+
+//------------------------------------------------------------------------------
+void FmXEditCell::onTextChanged()
+{
+ ::com::sun::star::awt::TextEvent aEvent;
+ aEvent.Source = *this;
+ m_aTextListeners.notifyEach( &awt::XTextListener::textChanged, aEvent );
+}
+
+//------------------------------------------------------------------------------
+void FmXEditCell::onFocusGained( const awt::FocusEvent& _rEvent )
+{
+ FmXTextCell::onFocusGained( _rEvent );
+ m_sValueOnEnter = getText();
+}
+
+//------------------------------------------------------------------------------
+void FmXEditCell::onFocusLost( const awt::FocusEvent& _rEvent )
+{
+ FmXTextCell::onFocusLost( _rEvent );
+
+ if ( getText() != m_sValueOnEnter )
{
- ::cppu::OInterfaceIteratorHelper aIt( m_aTextListeners );
- ::com::sun::star::awt::TextEvent aEvt;
- aEvt.Source = *this;
- while( aIt.hasMoreElements() )
- ((::com::sun::star::awt::XTextListener *)aIt.next())->textChanged( aEvt );
+ lang::EventObject aEvent( *this );
+ m_aChangeListeners.notifyEach( &XChangeListener::changed, aEvent );
}
- return 1;
+}
+
+//------------------------------------------------------------------------------
+void FmXEditCell::onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData )
+{
+ switch ( _nEventId )
+ {
+ case VCLEVENT_EDIT_MODIFY:
+ {
+ if ( m_pEditImplementation && m_aTextListeners.getLength() )
+ onTextChanged();
+ return;
+ }
+ }
+
+ FmXTextCell::onWindowEvent( _nEventId, _rWindow, _pEventData );
}
/*************************************************************************/
DBG_NAME(FmXCheckBoxCell);
//------------------------------------------------------------------------------
-FmXCheckBoxCell::FmXCheckBoxCell(DbGridColumn* pColumn, DbCellControl* pControl)
- :FmXDataCell(pColumn, pControl)
+FmXCheckBoxCell::FmXCheckBoxCell( DbGridColumn* pColumn, DbCellControl& _rControl )
+ :FmXDataCell( pColumn, _rControl )
,m_aItemListeners(m_aMutex)
- ,m_pBox(&((CheckBoxControl*)pControl->GetControl())->GetBox())
+ ,m_aActionListeners( m_aMutex )
+ ,m_pBox( & static_cast< CheckBoxControl& >( _rControl.GetWindow() ).GetBox() )
{
DBG_CTOR(FmXCheckBoxCell,NULL);
-
- ((CheckBoxControl*)pControl->GetControl())->SetClickHdl( LINK( this, FmXCheckBoxCell, OnClick ) );
}
//------------------------------------------------------------------
@@ -3627,8 +3926,9 @@ void FmXCheckBoxCell::disposing()
{
::com::sun::star::lang::EventObject aEvt(*this);
m_aItemListeners.disposeAndClear(aEvt);
+ m_aActionListeners.disposeAndClear(aEvt);
- ((CheckBoxControl*)m_pCellControl->GetControl())->SetClickHdl(Link());
+ static_cast< CheckBoxControl& >( m_pCellControl->GetWindow() ).SetClickHdl(Link());
m_pBox = NULL;
FmXDataCell::disposing();
@@ -3637,27 +3937,26 @@ void FmXCheckBoxCell::disposing()
//------------------------------------------------------------------
Any SAL_CALL FmXCheckBoxCell::queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(RuntimeException)
{
- Any aReturn = FmXDataCell::queryAggregation(_rType);
- if (!aReturn.hasValue())
- aReturn = ::cppu::queryInterface(_rType,
- static_cast< ::com::sun::star::awt::XCheckBox* >(this)
- );
+ Any aReturn = FmXDataCell::queryAggregation( _rType );
+
+ if ( !aReturn.hasValue() )
+ aReturn = FmXCheckBoxCell_Base::queryInterface( _rType );
+
return aReturn;
}
//-------------------------------------------------------------------------
Sequence< ::com::sun::star::uno::Type > SAL_CALL FmXCheckBoxCell::getTypes( ) throw(RuntimeException)
{
- Sequence< ::com::sun::star::uno::Type > aTypes = OComponentHelper::getTypes();
-
- sal_Int32 nLen = aTypes.getLength();
- aTypes.realloc(nLen + 2);
- aTypes.getArray()[nLen++] = ::getCppuType(static_cast< Reference< ::com::sun::star::awt::XControl >* >(NULL));
- aTypes.getArray()[nLen++] = ::getCppuType(static_cast< Reference< ::com::sun::star::awt::XCheckBox >* >(NULL));
-
- return aTypes;
+ return ::comphelper::concatSequences(
+ FmXDataCell::getTypes(),
+ FmXCheckBoxCell_Base::getTypes()
+ );
}
+//------------------------------------------------------------------------------
+IMPLEMENT_GET_IMPLEMENTATION_ID( FmXCheckBoxCell )
+
//------------------------------------------------------------------
void SAL_CALL FmXCheckBoxCell::addItemListener( const Reference< ::com::sun::star::awt::XItemListener >& l ) throw( RuntimeException )
{
@@ -3671,17 +3970,6 @@ void SAL_CALL FmXCheckBoxCell::removeItemListener( const Reference< ::com::sun::
}
//------------------------------------------------------------------
-void SAL_CALL FmXCheckBoxCell::setLabel( const ::rtl::OUString& rLabel ) throw( RuntimeException )
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- if (m_pBox)
- {
- UpdateFromColumn();
- m_pBox->SetText( rLabel );
- }
-}
-
-//------------------------------------------------------------------
void SAL_CALL FmXCheckBoxCell::setState( short n ) throw( RuntimeException )
{
::osl::MutexGuard aGuard( m_aMutex );
@@ -3716,42 +4004,89 @@ void SAL_CALL FmXCheckBoxCell::enableTriState( sal_Bool b ) throw( RuntimeExcept
}
//------------------------------------------------------------------
-IMPL_LINK( FmXCheckBoxCell, OnClick, void*, EMPTYARG )
+void SAL_CALL FmXCheckBoxCell::addActionListener( const Reference< awt::XActionListener >& _Listener ) throw (RuntimeException)
{
- if (m_pBox)
+ m_aActionListeners.addInterface( _Listener );
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXCheckBoxCell::removeActionListener( const Reference< awt::XActionListener >& _Listener ) throw (RuntimeException)
+{
+ m_aActionListeners.removeInterface( _Listener );
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXCheckBoxCell::setLabel( const ::rtl::OUString& _Label ) throw (RuntimeException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( m_pColumn )
+ {
+ DbGridControl& rGrid( m_pColumn->GetParent() );
+ rGrid.SetColumnTitle( rGrid.GetColumnId( m_pColumn->GetFieldPos() ), _Label );
+ }
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXCheckBoxCell::setActionCommand( const ::rtl::OUString& _Command ) throw (RuntimeException)
+{
+ m_aActionCommand = _Command;
+}
+
+//------------------------------------------------------------------
+Window* FmXCheckBoxCell::getEventWindow() const
+{
+ return m_pBox;
+}
+
+//------------------------------------------------------------------
+void FmXCheckBoxCell::onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData )
+{
+ switch ( _nEventId )
+ {
+ case VCLEVENT_CHECKBOX_TOGGLE:
{
// check boxes are to be committed immediately (this holds for ordinary check box controls in
// documents, and this must hold for check boxes in grid columns, too
// 91210 - 22.08.2001 - frank.schoenheit@sun.com
m_pCellControl->Commit();
- // notify our listeners
- ::cppu::OInterfaceIteratorHelper aIt( m_aItemListeners );
-
- ::com::sun::star::awt::ItemEvent aEvent;
- aEvent.Source = *this;
- aEvent.Highlighted = sal_False;
- aEvent.Selected = m_pBox->GetState();
+ Reference< XWindow > xKeepAlive( this );
+ if ( m_aItemListeners.getLength() && m_pBox )
+ {
+ awt::ItemEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Highlighted = sal_False;
+ aEvent.Selected = m_pBox->GetState();
+ m_aItemListeners.notifyEach( &awt::XItemListener::itemStateChanged, aEvent );
+ }
+ if ( m_aActionListeners.getLength() )
+ {
+ awt::ActionEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.ActionCommand = m_aActionCommand;
+ m_aActionListeners.notifyEach( &awt::XActionListener::actionPerformed, aEvent );
+ }
+ }
+ break;
- while ( aIt.hasMoreElements() )
- static_cast< awt::XItemListener* >( aIt.next() )->itemStateChanged( aEvent );
+ default:
+ FmXDataCell::onWindowEvent( _nEventId, _rWindow, _pEventData );
+ break;
}
- return 1;
}
/*************************************************************************/
DBG_NAME(FmXListBoxCell);
//------------------------------------------------------------------------------
-FmXListBoxCell::FmXListBoxCell(DbGridColumn* pColumn, DbCellControl* pControl)
- :FmXTextCell(pColumn, pControl)
+FmXListBoxCell::FmXListBoxCell(DbGridColumn* pColumn, DbCellControl& _rControl)
+ :FmXTextCell( pColumn, _rControl )
,m_aItemListeners(m_aMutex)
,m_aActionListeners(m_aMutex)
- ,m_pBox((ListBox*)pControl->GetControl())
+ ,m_pBox( &static_cast< ListBox& >( _rControl.GetWindow() ) )
{
DBG_CTOR(FmXListBoxCell,NULL);
- m_pBox->AddEventListener( LINK( this, FmXListBoxCell, OnSelect ) );
m_pBox->SetDoubleClickHdl( LINK( this, FmXListBoxCell, OnDoubleClick ) );
}
@@ -3786,26 +4121,25 @@ void FmXListBoxCell::disposing()
Any SAL_CALL FmXListBoxCell::queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(RuntimeException)
{
Any aReturn = FmXTextCell::queryAggregation(_rType);
- if (!aReturn.hasValue())
- aReturn = ::cppu::queryInterface(_rType,
- static_cast< ::com::sun::star::awt::XListBox* >(this)
- );
+
+ if ( !aReturn.hasValue() )
+ aReturn = FmXListBoxCell_Base::queryInterface( _rType );
+
return aReturn;
}
//-------------------------------------------------------------------------
Sequence< ::com::sun::star::uno::Type > SAL_CALL FmXListBoxCell::getTypes( ) throw(RuntimeException)
{
- Sequence< ::com::sun::star::uno::Type > aTypes = OComponentHelper::getTypes();
-
- sal_Int32 nLen = aTypes.getLength();
- aTypes.realloc(nLen + 2);
- aTypes.getArray()[nLen++] = ::getCppuType(static_cast< Reference< ::com::sun::star::awt::XControl >* >(NULL));
- aTypes.getArray()[nLen++] = ::getCppuType(static_cast< Reference< ::com::sun::star::awt::XListBox >* >(NULL));
-
- return aTypes;
+ return ::comphelper::concatSequences(
+ FmXTextCell::getTypes(),
+ FmXListBoxCell_Base::getTypes()
+ );
}
+//------------------------------------------------------------------------------
+IMPLEMENT_GET_IMPLEMENTATION_ID( FmXListBoxCell )
+
//------------------------------------------------------------------
void SAL_CALL FmXListBoxCell::addItemListener(const Reference< ::com::sun::star::awt::XItemListener >& l) throw( RuntimeException )
{
@@ -4042,10 +4376,10 @@ void SAL_CALL FmXListBoxCell::makeVisible(sal_Int16 nEntry) throw( RuntimeExcept
}
//------------------------------------------------------------------
-IMPL_LINK(FmXListBoxCell, OnSelect, VclWindowEvent*, _pEvent )
+void FmXListBoxCell::onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData )
{
- if ( ( _pEvent->GetWindow() == m_pBox )
- && ( _pEvent->GetId() == VCLEVENT_LISTBOX_SELECT )
+ if ( ( &_rWindow == m_pBox )
+ && ( _nEventId == VCLEVENT_LISTBOX_SELECT )
)
{
OnDoubleClick( NULL );
@@ -4059,8 +4393,10 @@ IMPL_LINK(FmXListBoxCell, OnSelect, VclWindowEvent*, _pEvent )
? m_pBox->GetSelectEntryPos() : 0xFFFF;
m_aItemListeners.notifyEach( &awt::XItemListener::itemStateChanged, aEvent );
+ return;
}
- return 1;
+
+ FmXTextCell::onWindowEvent( _nEventId, _rWindow, _pEventData );
}
@@ -4083,6 +4419,203 @@ IMPL_LINK( FmXListBoxCell, OnDoubleClick, void*, EMPTYARG )
/*************************************************************************/
+
+DBG_NAME( FmXComboBoxCell );
+
+//------------------------------------------------------------------------------
+FmXComboBoxCell::FmXComboBoxCell( DbGridColumn* pColumn, DbCellControl& _rControl )
+ :FmXTextCell( pColumn, _rControl )
+ ,m_aItemListeners( m_aMutex )
+ ,m_aActionListeners( m_aMutex )
+ ,m_pComboBox( &static_cast< ComboBox& >( _rControl.GetWindow() ) )
+{
+ DBG_CTOR( FmXComboBoxCell, NULL );
+}
+
+//------------------------------------------------------------------------------
+FmXComboBoxCell::~FmXComboBoxCell()
+{
+ if ( !OComponentHelper::rBHelper.bDisposed )
+ {
+ acquire();
+ dispose();
+ }
+
+ DBG_DTOR( FmXComboBoxCell, NULL );
+}
+
+//-----------------------------------------------------------------------------
+void FmXComboBoxCell::disposing()
+{
+ ::com::sun::star::lang::EventObject aEvt(*this);
+ m_aItemListeners.disposeAndClear(aEvt);
+ m_aActionListeners.disposeAndClear(aEvt);
+
+ FmXTextCell::disposing();
+}
+
+//------------------------------------------------------------------
+Any SAL_CALL FmXComboBoxCell::queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(RuntimeException)
+{
+ Any aReturn = FmXTextCell::queryAggregation(_rType);
+
+ if ( !aReturn.hasValue() )
+ aReturn = FmXComboBoxCell_Base::queryInterface( _rType );
+
+ return aReturn;
+}
+
+//-------------------------------------------------------------------------
+Sequence< Type > SAL_CALL FmXComboBoxCell::getTypes( ) throw(RuntimeException)
+{
+ return ::comphelper::concatSequences(
+ FmXTextCell::getTypes(),
+ FmXComboBoxCell_Base::getTypes()
+ );
+}
+
+//------------------------------------------------------------------------------
+IMPLEMENT_GET_IMPLEMENTATION_ID( FmXComboBoxCell )
+
+//------------------------------------------------------------------
+void SAL_CALL FmXComboBoxCell::addItemListener(const Reference< awt::XItemListener >& l) throw( RuntimeException )
+{
+ m_aItemListeners.addInterface( l );
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXComboBoxCell::removeItemListener(const Reference< awt::XItemListener >& l) throw( RuntimeException )
+{
+ m_aItemListeners.removeInterface( l );
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXComboBoxCell::addActionListener(const Reference< awt::XActionListener >& l) throw( RuntimeException )
+{
+ m_aActionListeners.addInterface( l );
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXComboBoxCell::removeActionListener(const Reference< awt::XActionListener >& l) throw( RuntimeException )
+{
+ m_aActionListeners.removeInterface( l );
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXComboBoxCell::addItem( const ::rtl::OUString& _Item, sal_Int16 _Pos ) throw( RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( m_pComboBox )
+ m_pComboBox->InsertEntry( _Item, _Pos );
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXComboBoxCell::addItems( const Sequence< ::rtl::OUString >& _Items, sal_Int16 _Pos ) throw( RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( m_pComboBox )
+ {
+ sal_uInt16 nP = _Pos;
+ for ( sal_uInt16 n = 0; n < _Items.getLength(); n++ )
+ {
+ m_pComboBox->InsertEntry( _Items.getConstArray()[n], nP );
+ if ( _Pos != -1 )
+ nP++;
+ }
+ }
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXComboBoxCell::removeItems( sal_Int16 _Pos, sal_Int16 _Count ) throw( RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( m_pComboBox )
+ {
+ for ( sal_uInt16 n = _Count; n; )
+ m_pComboBox->RemoveEntry( _Pos + (--n) );
+ }
+}
+
+//------------------------------------------------------------------
+sal_Int16 SAL_CALL FmXComboBoxCell::getItemCount() throw( RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ return m_pComboBox ? m_pComboBox->GetEntryCount() : 0;
+}
+
+//------------------------------------------------------------------
+::rtl::OUString SAL_CALL FmXComboBoxCell::getItem( sal_Int16 _Pos ) throw( RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ String sItem;
+ if ( m_pComboBox )
+ sItem = m_pComboBox->GetEntry( _Pos );
+ return sItem;
+}
+//------------------------------------------------------------------
+Sequence< ::rtl::OUString > SAL_CALL FmXComboBoxCell::getItems() throw( RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ Sequence< ::rtl::OUString > aItems;
+ if ( m_pComboBox )
+ {
+ sal_uInt16 nEntries = m_pComboBox->GetEntryCount();
+ aItems.realloc( nEntries );
+ ::rtl::OUString* pItem = aItems.getArray();
+ for ( sal_uInt16 n=0; n<nEntries; ++n, ++pItem )
+ *pItem = m_pComboBox->GetEntry( n );
+ }
+ return aItems;
+}
+
+//------------------------------------------------------------------
+sal_Int16 SAL_CALL FmXComboBoxCell::getDropDownLineCount() throw( RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ sal_Int16 nLines = 0;
+ if ( m_pComboBox )
+ nLines = m_pComboBox->GetDropDownLineCount();
+
+ return nLines;
+}
+
+//------------------------------------------------------------------
+void SAL_CALL FmXComboBoxCell::setDropDownLineCount(sal_Int16 nLines) throw( RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( m_pComboBox )
+ m_pComboBox->SetDropDownLineCount( nLines );
+}
+
+//------------------------------------------------------------------------------
+void FmXComboBoxCell::onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData )
+{
+
+ switch ( _nEventId )
+ {
+ case VCLEVENT_COMBOBOX_SELECT:
+ {
+ awt::ItemEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Highlighted = sal_False;
+
+ // Bei Mehrfachselektion 0xFFFF, sonst die ID
+ aEvent.Selected = ( m_pComboBox->GetSelectEntryCount() == 1 )
+ ? m_pComboBox->GetSelectEntryPos()
+ : 0xFFFF;
+ m_aItemListeners.notifyEach( &awt::XItemListener::itemStateChanged, aEvent );
+ }
+ break;
+
+ default:
+ FmXTextCell::onWindowEvent( _nEventId, _rWindow, _pEventData );
+ break;
+ }
+}
+
+/*************************************************************************/
TYPEINIT1(FmXFilterCell, FmXGridCell);
//------------------------------------------------------------------------------
@@ -4093,8 +4626,8 @@ Reference< XInterface > FmXFilterCell_CreateInstance(const Reference< ::com::su
DBG_NAME(FmXFilterCell);
//------------------------------------------------------------------------------
-FmXFilterCell::FmXFilterCell(DbGridColumn* pColumn, DbCellControl* pControl)
- :FmXGridCell(pColumn, pControl)
+FmXFilterCell::FmXFilterCell(DbGridColumn* pColumn, DbCellControl* pControl )
+ :FmXGridCell( pColumn, pControl )
,m_aTextListeners(m_aMutex)
{
DBG_CTOR(FmXFilterCell,NULL);
@@ -4180,26 +4713,25 @@ void FmXFilterCell::disposing()
Any SAL_CALL FmXFilterCell::queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(RuntimeException)
{
Any aReturn = FmXGridCell::queryAggregation(_rType);
- if (!aReturn.hasValue())
- aReturn = ::cppu::queryInterface(_rType,
- static_cast< ::com::sun::star::awt::XTextComponent* >(this)
- );
+
+ if ( !aReturn.hasValue() )
+ aReturn = FmXFilterCell_Base::queryInterface( _rType );
+
return aReturn;
}
//-------------------------------------------------------------------------
Sequence< ::com::sun::star::uno::Type > SAL_CALL FmXFilterCell::getTypes( ) throw(RuntimeException)
{
- Sequence< ::com::sun::star::uno::Type > aTypes = OComponentHelper::getTypes();
-
- sal_Int32 nLen = aTypes.getLength();
- aTypes.realloc(nLen + 2);
- aTypes.getArray()[nLen++] = ::getCppuType(static_cast< Reference< ::com::sun::star::awt::XControl >* >(NULL));
- aTypes.getArray()[nLen++] = ::getCppuType(static_cast< Reference< ::com::sun::star::awt::XTextComponent >* >(NULL));
-
- return aTypes;
+ return ::comphelper::concatSequences(
+ FmXGridCell::getTypes(),
+ FmXFilterCell_Base::getTypes()
+ );
}
+//------------------------------------------------------------------------------
+IMPLEMENT_GET_IMPLEMENTATION_ID( FmXFilterCell )
+
// ::com::sun::star::awt::XTextComponent
//------------------------------------------------------------------------------
void SAL_CALL FmXFilterCell::addTextListener(const Reference< ::com::sun::star::awt::XTextListener >& l) throw( RuntimeException )
diff --git a/svx/source/fmcomp/gridcols.cxx b/svx/source/fmcomp/gridcols.cxx
index cab60f046cf3..da7fe3447b0a 100644
--- a/svx/source/fmcomp/gridcols.cxx
+++ b/svx/source/fmcomp/gridcols.cxx
@@ -36,23 +36,6 @@
#include "fmservs.hxx"
#include "fmtools.hxx"
-namespace svxform
-{
-
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_TEXTFIELD, "TextField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_COMBOBOX, "ComboBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_CHECKBOX, "CheckBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_TIMEFIELD, "TimeField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_DATEFIELD, "DateField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_NUMERICFIELD, "NumericField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_CURRENCYFIELD, "CurrencyField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_PATTERNFIELD, "PatternField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_LISTBOX, "ListBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_FORMATTEDFIELD, "FormattedField");
-
-} // namespace svxform
-using namespace ::svxform;
-
//------------------------------------------------------------------------------
const ::comphelper::StringSequence& getColumnTypes()
{
@@ -81,7 +64,7 @@ sal_Int32 getColumnTypeByModelName(const ::rtl::OUString& aModelName)
const ::rtl::OUString aCompatibleModelPrefix = ::rtl::OUString::createFromAscii("stardiv.one.form.component.");
sal_Int32 nTypeId = -1;
- if (aModelName == ::svxform::FM_COMPONENT_EDIT)
+ if (aModelName == FM_COMPONENT_EDIT)
nTypeId = TYPE_TEXTFIELD;
else
{
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 3ef1d68916ec..f53168a273ac 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -36,7 +36,7 @@
#endif
#include <svx/gridctrl.hxx>
#include "gridcell.hxx"
-#include "dbtoolsclient.hxx"
+#include "svx/dbtoolsclient.hxx"
#include "fmtools.hxx"
#include <svtools/stringtransfer.hxx>
@@ -698,25 +698,6 @@ void DbGridControl::NavigationBar::SetState(sal_uInt16 nWhich)
else
pWnd->SetText(aText);
- {
- vos::OGuard aPaintSafety(Application::GetSolarMutex());
- // we want to update only the window, not our parent, so lock the latter
- // (In fact, if we are in DbGridControl::RecalcRows, perhaps as a result of an setDataSource or
- // a VisibleRowsChanged, the grid will be frozen and a SeekRow triggered implicitly by the update
- // of pWnd will fail.)
- // (the SetUpdateMode call goes to the data window : it's sufficient to prevent SeekRow's, but it
- // avoids the Invalidate which would be triggered by BrowseBox::SetUpdateMode (which lead to massive
- // flicker when scrolling))
- // FS - 06.10.99
-
- // don't use SetUpdateMode in those situations as all necessary paints get lost DG
- // so update only if necessary (DG)
- if (pParent->IsPaintEnabled())
- {
- pWnd->Update();
- pWnd->Flush();
- }
- }
pParent->SetRealRowCount(aText);
} break;
}
diff --git a/svx/source/fmcomp/makefile.mk b/svx/source/fmcomp/makefile.mk
index a2387ef180f4..1e86308f9c44 100644
--- a/svx/source/fmcomp/makefile.mk
+++ b/svx/source/fmcomp/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=fmcomp
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
@@ -48,25 +49,20 @@ SRC1FILES= \
gridctrl.src \
showcols.src
-#SLOFILES= \
-# $(SLO)$/dbaexchange.obj \
-# $(SLO)$/gridcols.obj \
-# $(SLO)$/gridctrl.obj \
-# $(SLO)$/gridcell.obj \
-# $(SLO)$/fmgridcl.obj \
-# $(SLO)$/fmgridif.obj \
-# $(SLO)$/trace.obj
-
-SLOFILES= \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/dbaexchange.obj \
- $(SLO)$/dbaobjectex.obj \
$(SLO)$/gridcols.obj \
$(SLO)$/gridctrl.obj \
$(SLO)$/gridcell.obj \
$(SLO)$/fmgridcl.obj \
$(SLO)$/fmgridif.obj \
- $(SLO)$/trace.obj \
+ $(SLO)$/trace.obj \
$(SLO)$/xmlexchg.obj
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/dbaobjectex.obj
+
.INCLUDE : target.mk
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 01e65ff891a3..791bebc772c8 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -452,9 +452,11 @@ namespace svxform
bool bIsDocModified = false;
m_pNaviWin->DisableNotify( true );
- if ( TBI_ITEM_ADD == _nToolBoxID
- || TBI_ITEM_ADD_ELEMENT == _nToolBoxID
- || TBI_ITEM_ADD_ATTRIBUTE == _nToolBoxID )
+ switch ( _nToolBoxID )
+ {
+ case TBI_ITEM_ADD:
+ case TBI_ITEM_ADD_ELEMENT:
+ case TBI_ITEM_ADD_ATTRIBUTE:
{
bHandled = true;
Reference< css::xforms::XModel > xModel( m_xUIHelper, UNO_QUERY );
@@ -643,7 +645,9 @@ namespace svxform
}
}
}
- else if ( TBI_ITEM_EDIT == _nToolBoxID )
+ break;
+
+ case TBI_ITEM_EDIT:
{
bHandled = true;
SvLBoxEntry* pEntry = m_aItemList.FirstSelected();
@@ -737,7 +741,9 @@ namespace svxform
}
}
}
- else if ( TBI_ITEM_REMOVE == _nToolBoxID )
+ break;
+
+ case TBI_ITEM_REMOVE:
{
bHandled = true;
if ( DGTInstance == m_eGroup && m_sInstanceURL.Len() > 0 )
@@ -748,6 +754,18 @@ namespace svxform
}
bIsDocModified = RemoveEntry();
}
+ break;
+
+ case MID_INSERT_CONTROL:
+ {
+ OSL_ENSURE( false, "XFormsPage::DoToolboxAction: MID_INSERT_CONTROL not implemented, yet!" );
+ }
+ break;
+
+ default:
+ OSL_ENSURE( false, "XFormsPage::DoToolboxAction: unknown ID!" );
+ break;
+ }
m_pNaviWin->DisableNotify( false );
EnableMenuItems( NULL );
diff --git a/svx/source/form/datanavi.src b/svx/source/form/datanavi.src
index 29ea1797073b..4d48ead413b8 100644
--- a/svx/source/form/datanavi.src
+++ b/svx/source/form/datanavi.src
@@ -512,7 +512,8 @@ Menu RID_MENU_DATANAVIGATOR
{
ItemList =
{
- MenuItem
+ // MID_INSERT_CONTROL not implemented, yet (#i99890#)
+ /*MenuItem
{
Identifier = MID_INSERT_CONTROL ;
HelpId = HID_XFORMS_MID_INSERT_CONTROL ;
@@ -521,7 +522,7 @@ Menu RID_MENU_DATANAVIGATOR
MenuItem
{
Separator = TRUE;
- };
+ };*/
MenuItem
{
Identifier = TBI_ITEM_ADD ;
diff --git a/svx/source/form/dbcharsethelper.cxx b/svx/source/form/dbcharsethelper.cxx
index 0d3e3ebaf764..4e2f86eab25c 100644
--- a/svx/source/form/dbcharsethelper.cxx
+++ b/svx/source/form/dbcharsethelper.cxx
@@ -30,7 +30,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include "dbcharsethelper.hxx"
+#include "svx/dbcharsethelper.hxx"
//........................................................................
namespace svxform
diff --git a/svx/source/form/dbtoolsclient.cxx b/svx/source/form/dbtoolsclient.cxx
index 0c1e1b40564b..88f55ff2cd50 100644
--- a/svx/source/form/dbtoolsclient.cxx
+++ b/svx/source/form/dbtoolsclient.cxx
@@ -34,7 +34,7 @@
#include <com/sun/star/sdbc/XDataSource.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/sdb/SQLContext.hpp>
-#include "dbtoolsclient.hxx"
+#include "svx/dbtoolsclient.hxx"
#include <osl/diagnose.h>
#include <connectivity/formattedcolumnvalue.hxx>
diff --git a/svx/source/form/fmPropBrw.cxx b/svx/source/form/fmPropBrw.cxx
index d968342d6ef5..ccce6b50ee20 100644
--- a/svx/source/form/fmPropBrw.cxx
+++ b/svx/source/form/fmPropBrw.cxx
@@ -190,7 +190,7 @@ using namespace ::svxform;
case FormComponentType::IMAGECONTROL:
nClassNameResourceId = RID_STR_PROPTITLE_IMAGECONTROL; break;
case FormComponentType::HIDDENCONTROL:
- nClassNameResourceId = RID_STR_HIDDEN_CLASSNAME; break;
+ nClassNameResourceId = RID_STR_PROPTITLE_HIDDEN; break;
case FormComponentType::SCROLLBAR:
nClassNameResourceId = RID_STR_PROPTITLE_SCROLLBAR; break;
case FormComponentType::SPINBUTTON:
@@ -199,7 +199,7 @@ using namespace ::svxform;
nClassNameResourceId = RID_STR_PROPTITLE_NAVBAR; break;
case FormComponentType::CONTROL:
default:
- nClassNameResourceId = RID_STR_CONTROL_CLASSNAME; break;
+ nClassNameResourceId = RID_STR_CONTROL; break;
}
if ( !nClassNameResourceId )
@@ -218,6 +218,7 @@ FmPropBrw::FmPropBrw( const Reference< XMultiServiceFactory >& _xORB, SfxBinding
:SfxFloatingWindow(_pBindings, _pMgr, _pParent, WinBits(WB_STDMODELESS|WB_SIZEABLE|WB_3DLOOK|WB_ROLLABLE) )
,SfxControllerItem(SID_FM_PROPERTY_CONTROL, *_pBindings)
,m_bInitialStateChange(sal_True)
+ ,m_bInStateChange( false )
,m_xORB(_xORB)
{
DBG_CTOR(FmPropBrw,NULL);
@@ -668,11 +669,12 @@ void FmPropBrw::impl_ensurePropertyBrowser_nothrow( FmFormShell* _pFormShell )
//-----------------------------------------------------------------------
void FmPropBrw::StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState)
{
+ if (!pState || SID_FM_PROPERTY_CONTROL != nSID)
+ return;
+
+ m_bInStateChange = true;
try
{
- if (!pState || SID_FM_PROPERTY_CONTROL != nSID)
- return;
-
if (eState >= SFX_ITEM_AVAILABLE)
{
FmFormShell* pShell = PTR_CAST(FmFormShell,((SfxObjectItem*)pState)->GetShell());
@@ -719,5 +721,5 @@ void FmPropBrw::StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPool
{
DBG_ERROR("FmPropBrw::StateChanged: Exception occured!");
}
-
+ m_bInStateChange = false;
}
diff --git a/svx/source/form/fmctrler.cxx b/svx/source/form/fmctrler.cxx
index 935bdbc74fe8..48db5acbb01e 100644
--- a/svx/source/form/fmctrler.cxx
+++ b/svx/source/form/fmctrler.cxx
@@ -129,6 +129,7 @@ struct ColumnInfo
Reference< XColumn > xColumn;
sal_Int32 nNullable;
sal_Bool bAutoIncrement;
+ sal_Bool bReadOnly;
::rtl::OUString sName;
// information about the control(s) bound to this column
@@ -148,6 +149,7 @@ struct ColumnInfo
:xColumn()
,nNullable( ColumnValue::NULLABLE_UNKNOWN )
,bAutoIncrement( sal_False )
+ ,bReadOnly( sal_False )
,sName()
,xFirstControlWithInputRequired()
,xFirstGridWithInputRequiredColumn()
@@ -202,6 +204,7 @@ ColumnInfoCache::ColumnInfoCache( const Reference< XColumnsSupplier >& _rxColSup
OSL_VERIFY( xColumnProps->getPropertyValue( FM_PROP_ISNULLABLE ) >>= aColInfo.nNullable );
OSL_VERIFY( xColumnProps->getPropertyValue( FM_PROP_AUTOINCREMENT ) >>= aColInfo.bAutoIncrement );
OSL_VERIFY( xColumnProps->getPropertyValue( FM_PROP_NAME ) >>= aColInfo.sName );
+ OSL_VERIFY( xColumnProps->getPropertyValue( FM_PROP_ISREADONLY ) >>= aColInfo.bReadOnly );
m_aColumns.push_back( aColInfo );
}
@@ -227,6 +230,7 @@ namespace
OSL_VERIFY( _rxControlModel->getPropertyValue( FM_PROP_INPUT_REQUIRED ) >>= bInputRequired );
return ( bInputRequired != sal_False );
}
+
void lcl_resetColumnControlInfo( ColumnInfo& _rColInfo )
{
_rColInfo.xFirstControlWithInputRequired.clear();
@@ -2956,7 +2960,6 @@ void FmXFormController::setFilter(::std::vector<FmFieldInfo>& rFieldInfos)
aRow[(*iter).xText] = sCriteria;
}
}
- break;
}
}
}
@@ -3502,6 +3505,9 @@ sal_Bool SAL_CALL FmXFormController::approveRowChange(const RowChangeEvent& _rEv
if ( rColInfo.bAutoIncrement )
continue;
+ if ( rColInfo.bReadOnly )
+ continue;
+
if ( !rColInfo.xFirstControlWithInputRequired.is() && !rColInfo.xFirstGridWithInputRequiredColumn.is() )
continue;
diff --git a/svx/source/form/fmdocumentclassification.cxx b/svx/source/form/fmdocumentclassification.cxx
index 70c37f223ffd..1d9c3ed0bf1d 100644
--- a/svx/source/form/fmdocumentclassification.cxx
+++ b/svx/source/form/fmdocumentclassification.cxx
@@ -34,7 +34,7 @@
#ifndef SVX_SOURCE_FORM_FMDOCUMENTCLASSIFICATION_HXX
#include "fmdocumentclassification.hxx"
#endif
-#include "dbtoolsclient.hxx"
+#include "svx/dbtoolsclient.hxx"
/** === begin UNO includes === **/
#include <com/sun/star/container/XChild.hpp>
diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx
index a2add33b849b..ed4cd890ec9e 100644
--- a/svx/source/form/fmpgeimp.cxx
+++ b/svx/source/form/fmpgeimp.cxx
@@ -38,9 +38,10 @@
#include "fmprop.hrc"
#include "fmservs.hxx"
#include "fmobj.hxx"
+#include "formcontrolfactory.hxx"
#include "svditer.hxx"
#include "fmresids.hrc"
-#include "dbtoolsclient.hxx"
+#include "svx/dbtoolsclient.hxx"
#include "treevisitor.hxx"
#include <com/sun/star/sdb/CommandType.hpp>
@@ -551,18 +552,12 @@ Reference< ::com::sun::star::form::XForm > FmFormPageImpl::findPlaceInFormCompo
xFormProps->setPropertyValue(FM_PROP_COMMANDTYPE, makeAny(nCommandType));
Reference< ::com::sun::star::container::XNameAccess > xNamedSet( getForms(), UNO_QUERY );
- ::rtl::OUString aName;
- if ((CommandType::TABLE == nCommandType) || (CommandType::QUERY == nCommandType))
- {
- // Namen der ::com::sun::star::form ueber den Titel der CursorSource setzen
- aName = getUniqueName(rCursorSource, xNamedSet);
- }
- else
- // ansonsten StandardformName verwenden
- aName = getUniqueName(::rtl::OUString(String(SVX_RES(RID_STR_STDFORMNAME))), xNamedSet);
+ const bool bTableOrQuery = ( CommandType::TABLE == nCommandType ) || ( CommandType::QUERY == nCommandType );
+ ::rtl::OUString sName = FormControlFactory::getUniqueName( xNamedSet,
+ bTableOrQuery ? rCursorSource : ::rtl::OUString( String( SVX_RES( RID_STR_STDFORMNAME ) ) ) );
- xFormProps->setPropertyValue(FM_PROP_NAME, makeAny(aName));
+ xFormProps->setPropertyValue( FM_PROP_NAME, makeAny( sName ) );
if( bUndo )
{
@@ -574,7 +569,7 @@ Reference< ::com::sun::star::form::XForm > FmFormPageImpl::findPlaceInFormCompo
xContainer->getCount()));
}
- getForms()->insertByName(aName, makeAny(xForm));
+ getForms()->insertByName( sName, makeAny( xForm ) );
if( bUndo )
pModel->EndUndo();
@@ -672,7 +667,6 @@ Reference< XForm > FmFormPageImpl::findFormForDataSource(
//------------------------------------------------------------------------------
::rtl::OUString FmFormPageImpl::setUniqueName(const Reference< XFormComponent > & xFormComponent, const Reference< XForm > & xControls)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPageImpl::setUniqueName" );
#if OSL_DEBUG_LEVEL > 0
try
{
@@ -696,9 +690,10 @@ Reference< XForm > FmFormPageImpl::findFormForDataSource(
// setzen eines default Namens ueber die ClassId
sal_Int16 nClassId( FormComponentType::CONTROL );
xSet->getPropertyValue( FM_PROP_CLASSID ) >>= nClassId;
- Reference< XServiceInfo > xSI( xSet, UNO_QUERY );
- ::rtl::OUString sDefaultName = getDefaultName( nClassId, xControls, xSI );
+ ::rtl::OUString sDefaultName = FormControlFactory::getDefaultUniqueName_ByComponentType(
+ Reference< XNameAccess >( xControls, UNO_QUERY ), xSet );
+
// bei Radiobuttons, die einen Namen haben, diesen nicht ueberschreiben!
if (!sName.getLength() || nClassId != ::com::sun::star::form::FormComponentType::RADIOBUTTON)
{
@@ -711,78 +706,6 @@ Reference< XForm > FmFormPageImpl::findFormForDataSource(
return sName;
}
-
-UniString FmFormPageImpl::getDefaultName( sal_Int16 _nClassId, const Reference< XServiceInfo >& _rxObject )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPageImpl::getDefaultName" );
- sal_uInt16 nResId;
-
- switch (_nClassId)
- {
- case FormComponentType::COMMANDBUTTON: nResId = RID_STR_BUTTON_CLASSNAME; break;
- case FormComponentType::RADIOBUTTON: nResId = RID_STR_RADIOBUTTON_CLASSNAME; break;
- case FormComponentType::CHECKBOX: nResId = RID_STR_CHECKBOX_CLASSNAME; break;
- case FormComponentType::LISTBOX: nResId = RID_STR_LISTBOX_CLASSNAME; break;
- case FormComponentType::COMBOBOX: nResId = RID_STR_COMBOBOX_CLASSNAME; break;
- case FormComponentType::GROUPBOX: nResId = RID_STR_GROUPBOX_CLASSNAME; break;
- case FormComponentType::IMAGEBUTTON: nResId = RID_STR_IMAGE_CLASSNAME; break;
- case FormComponentType::FIXEDTEXT: nResId = RID_STR_FIXEDTEXT_CLASSNAME; break;
- case FormComponentType::GRIDCONTROL: nResId = RID_STR_GRID_CLASSNAME; break;
- case FormComponentType::FILECONTROL: nResId = RID_STR_FILECONTROL_CLASSNAME; break;
- case FormComponentType::DATEFIELD: nResId = RID_STR_DATEFIELD_CLASSNAME; break;
- case FormComponentType::TIMEFIELD: nResId = RID_STR_TIMEFIELD_CLASSNAME; break;
- case FormComponentType::NUMERICFIELD: nResId = RID_STR_NUMERICFIELD_CLASSNAME; break;
- case FormComponentType::CURRENCYFIELD: nResId = RID_STR_CURRENCYFIELD_CLASSNAME; break;
- case FormComponentType::PATTERNFIELD: nResId = RID_STR_PATTERNFIELD_CLASSNAME; break;
- case FormComponentType::IMAGECONTROL: nResId = RID_STR_IMAGECONTROL_CLASSNAME; break;
- case FormComponentType::HIDDENCONTROL: nResId = RID_STR_HIDDEN_CLASSNAME; break;
- case FormComponentType::SCROLLBAR: nResId = RID_STR_CLASSNAME_SCROLLBAR; break;
- case FormComponentType::SPINBUTTON: nResId = RID_STR_CLASSNAME_SPINBUTTON; break;
- case FormComponentType::NAVIGATIONBAR: nResId = RID_STR_NAVBAR_CLASSNAME; break;
-
- case FormComponentType::TEXTFIELD:
- nResId = RID_STR_EDIT_CLASSNAME;
- if ( _rxObject.is() && _rxObject->supportsService( FM_SUN_COMPONENT_FORMATTEDFIELD ) )
- nResId = RID_STR_FORMATTED_CLASSNAME;
- break;
-
- default:
- nResId = RID_STR_CONTROL_CLASSNAME; break;
- }
-
- return SVX_RES(nResId);
-}
-
-//------------------------------------------------------------------------------
-::rtl::OUString FmFormPageImpl::getDefaultName(
- sal_Int16 _nClassId, const Reference< XForm >& _rxControls, const Reference< XServiceInfo >& _rxObject ) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPageImpl::getDefaultName" );
- ::rtl::OUString aClassName=getDefaultName( _nClassId, _rxObject );
-
- Reference< ::com::sun::star::container::XNameAccess > xNamedSet( _rxControls, UNO_QUERY );
- return getUniqueName(aClassName, xNamedSet);
-}
-
-//------------------------------------------------------------------
-::rtl::OUString FmFormPageImpl::getUniqueName(const ::rtl::OUString& rName, const Reference< ::com::sun::star::container::XNameAccess > & xNamedSet) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPageImpl::getUniqueName" );
- Reference< ::com::sun::star::container::XIndexAccess > xIndexSet(xNamedSet, UNO_QUERY);
- ::rtl::OUString sName( rName );
-
- if ( !xIndexSet.is() )
- return sName;
-
- sal_Int32 n = 0;
- ::rtl::OUString sClassName = rName;
-
- while ( xNamedSet->hasByName( sName ) )
- sName = sClassName + ::rtl::OUString::valueOf(++n);
-
- return sName;
-}
-
//------------------------------------------------------------------
void FmFormPageImpl::formObjectInserted( const FmFormObj& _object )
{
diff --git a/svx/source/form/fmprop.cxx b/svx/source/form/fmprop.cxx
deleted file mode 100644
index e328e79b9514..000000000000
--- a/svx/source/form/fmprop.cxx
+++ /dev/null
@@ -1,195 +0,0 @@
-/*************************************************************************
- *
- * 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: fmprop.cxx,v $
- * $Revision: 1.22 $
- *
- * 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"
-
-#ifndef _SVX_FMPROP_HRC
-#include "fmprop.hrc"
-#endif
-#include "fmstatic.hxx"
-
-#include <set>
-
-namespace svxform
-{
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_NAME,"Name");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CLASSID,"ClassId");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ROWCOUNT,"RowCount");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ROWCOUNTFINAL,"IsRowCountFinal");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FETCHSIZE,"FetchSize");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUE,"Value");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TEXT,"Text");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LABEL,"Label");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CANINSERT,"CanInsert");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CANUPDATE,"CanUpdate");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CANDELETE,"CanDelete");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_NAVIGATION,"NavigationBarMode");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HASNAVIGATION,"HasNavigationBar");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CYCLE,"Cycle");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CONTROLSOURCE,"DataField");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ENABLED,"Enabled");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_READONLY,"ReadOnly");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISREADONLY,"IsReadOnly");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FILTER,"Filter");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_AUTOINCREMENT,"IsAutoIncrement");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATAENTRY,"DataEntry");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_WIDTH,"Width");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SEARCHABLE,"IsSearchable");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_MULTILINE,"MultiLine");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TARGET_URL,"TargetURL");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULTCONTROL,"DefaultControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_MAXTEXTLEN,"MaxTextLen");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EDITMASK,"EditMask");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SPIN,"Spin");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATE,"Date");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIME,"Time");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_STATE,"State");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TRISTATE,"TriState");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_STRINGITEMLIST,"StringItemList");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_TEXT,"DefaultText");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULTCHECKED,"DefaultState");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FORMATKEY,"FormatKey");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FORMATSSUPPLIER,"FormatsSupplier");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LISTSOURCETYPE,"ListSourceType");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LISTSOURCE,"ListSource");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SELECT_SEQ,"SelectedItems");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUE_SEQ,"ValueItemList");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_SELECT_SEQ,"DefaultSelection");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ALIGN,"Align");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_DATE,"DefaultDate");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_TIME,"DefaultTime");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_VALUE,"DefaultValue");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DECIMAL_ACCURACY,"DecimalAccuracy");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURSORSOURCE,"DataSelection");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURSORSOURCETYPE,"DataSelectionType");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FIELDTYPE,"Type");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_REFVALUE,"RefValue");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUEMIN,"ValueMin");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUEMAX,"ValueMax");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_STRICTFORMAT,"StrictFormat");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LITERALMASK,"LiteralMask");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUESTEP,"ValueStep");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SHOWTHOUSANDSEP,"ShowThousandsSeparator");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURRENCYSYMBOL,"CurrencySymbol");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATEFORMAT,"DateFormat");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATEMIN,"DateMin");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATEMAX,"DateMax");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATE_SHOW_CENTURY,"DateShowCentury");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIMEFORMAT, "TimeFormat");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIMEMIN, "TimeMin");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIMEMAX,"TimeMax");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LINECOUNT,"LineCount");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BOUNDCOLUMN, "BoundColumn");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FONT,"FontDescriptor");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BACKGROUNDCOLOR,"BackgroundColor");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TEXTCOLOR,"TextColor");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BORDER,"Border");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DROPDOWN,"Dropdown");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ROWHEIGHT,"RowHeight");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HELPTEXT, "HelpText");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HELPURL, "HelpURL");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_RECORDMARKER, "HasRecordMarker");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BOUNDFIELD, "BoundField");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_VALUE, "EffectiveValue");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_DEFAULT, "EffectiveDefault");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_MIN, "EffectiveMin");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_MAX, "EffectiveMax");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HIDDEN, "Hidden");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FILTERPROPOSAL, "UseFilterValueProposal");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FIELDSOURCE, "FieldSource");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TABLENAME, "TableName");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FILTERSUPPLIER, "FilterSupplier");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURRENTFILTER, "CurrentFilter");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SELECTED_FIELDS, "SelectedFields");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SELECTED_TABLES, "SelectedTables");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_THREADSAFE, "ThreadSafe");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISFILTERAPPLIED, "IsFilterApplied");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CONTROLLABEL, "LabelControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURSORCOLOR, "CursorColor");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ALWAYSSHOWCURSOR, "AlwaysShowCursor");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DISPLAYSYNCHRON, "DisplayIsSynchron");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISMODIFIED, "IsModified");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISNEW, "IsNew");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_PRIVILEGES, "Privileges");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_COMMAND,"Command");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_COMMANDTYPE,"CommandType");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_RESULTSET_CONCURRENCY, "ResultSetConcurrency");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_INSERTONLY, "IgnoreResult");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_RESULTSET_TYPE, "ResultSetType");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ESCAPE_PROCESSING, "EscapeProcessing");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_APPLYFILTER, "ApplyFilter");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISNULLABLE, "IsNullable");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ACTIVECOMMAND, "ActiveCommand");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISCURRENCY, "IsCurrency");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_URL, "URL");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ACTIVE_CONNECTION, "ActiveConnection");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SORT, "Order");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATASOURCE, "DataSourceName");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_REALNAME,"RealName");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CONTROLSOURCEPROPERTY,"DataFieldProperty");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TEXTLINECOLOR, "TextLineColor");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FONTEMPHASISMARK, "FontEmphasisMark");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FONTRELIEF, "FontRelief");
-
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SCROLLVALUE_MIN, "ScrollValueMin" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SCROLLVALUE_MAX, "ScrollValueMax" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_DEFAULT_SCROLLVALUE, "DefaultScrollValue" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_LINEINCREMENT, "LineIncrement" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_BLOCKINCREMENT, "BlockIncrement" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_ORIENTATION, "Orientation" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_REPEAT, "Repeat" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_REPEATDELAY, "RepeatDelay" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SYMBOLCOLOR, "SymbolColor" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_VISIBILESIZE, "VisibleSize" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SPINVALUE_MIN, "SpinValueMin" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SPINVALUE_MAX, "SpinValueMax" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_DEFAULT_SPINVALUE, "DefaultSpinValue" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SPININCREMENT, "SpinIncrement" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_LINEENDFORMAT, "LineEndFormat" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_TOGGLE, "Toggle" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_FOCUSONCLICK, "FocusOnClick" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_HIDEINACTIVESELECTION, "HideInactiveSelection" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_VISUALEFFECT, "VisualEffect" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_BORDERCOLOR, "BorderColor" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_DYNAMIC_CONTROL_BORDER, "DynamicControlBorder" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_FOCUS, "ControlBorderColorOnFocus" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_MOUSE, "ControlBorderColorOnHover" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_INVALID,"ControlBorderColorOnInvalid" );
-
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_BUTTON_TYPE, "ButtonType" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_FORM_OPERATIONS, "FormOperations" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_INPUT_REQUIRED, "InputRequired" );
-
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_WRITING_MODE, "WritingMode" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_MOUSE_WHEEL_BEHAVIOR, "MouseWheelBehavior" );
-
-} // namespace svxform
-
diff --git a/svx/source/form/fmservs.cxx b/svx/source/form/fmservs.cxx
index fd4ab39e2f91..b9f40b6ddda2 100644
--- a/svx/source/form/fmservs.cxx
+++ b/svx/source/form/fmservs.cxx
@@ -31,76 +31,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <com/sun/star/container/XSet.hpp>
-#include "fmstatic.hxx"
#include <cppuhelper/factory.hxx>
#include <comphelper/processfactory.hxx>
-
-namespace svxform
-{
-
- // -----------------------
- // service names for compatibility
- // -----------------------
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_EDIT,"stardiv.one.form.component.Edit"); // compatibility
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_TEXTFIELD,"stardiv.one.form.component.TextField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_LISTBOX,"stardiv.one.form.component.ListBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_COMBOBOX,"stardiv.one.form.component.ComboBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_RADIOBUTTON,"stardiv.one.form.component.RadioButton");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_GROUPBOX,"stardiv.one.form.component.GroupBox"); // compatibility
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_FIXEDTEXT,"stardiv.one.form.component.FixedText"); // compatibility
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_COMMANDBUTTON,"stardiv.one.form.component.CommandButton");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_CHECKBOX,"stardiv.one.form.component.CheckBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_GRID,"stardiv.one.form.component.Grid"); // compatibility
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_GRIDCONTROL,"stardiv.one.form.component.GridControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_IMAGEBUTTON,"stardiv.one.form.component.ImageButton");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_FILECONTROL,"stardiv.one.form.component.FileControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_TIMEFIELD,"stardiv.one.form.component.TimeField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_DATEFIELD,"stardiv.one.form.component.DateField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_NUMERICFIELD,"stardiv.one.form.component.NumericField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_CURRENCYFIELD,"stardiv.one.form.component.CurrencyField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_PATTERNFIELD,"stardiv.one.form.component.PatternField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_HIDDEN,"stardiv.one.form.component.Hidden");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_HIDDENCONTROL,"stardiv.one.form.component.HiddenControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_IMAGECONTROL,"stardiv.one.form.component.ImageControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_FORMATTEDFIELD,"stardiv.one.form.component.FormattedField");
-
- IMPLEMENT_CONSTASCII_USTRING(FM_CONTROL_GRID,"stardiv.one.form.control.Grid"); // compatibility
- IMPLEMENT_CONSTASCII_USTRING(FM_CONTROL_GRIDCONTROL,"stardiv.one.form.control.GridControl");
-
- // -----------------------
- // new (sun) service names
- // -----------------------
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_FORM,"com.sun.star.form.component.Form");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_TEXTFIELD,"com.sun.star.form.component.TextField");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_LISTBOX,"com.sun.star.form.component.ListBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_COMBOBOX,"com.sun.star.form.component.ComboBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_RADIOBUTTON,"com.sun.star.form.component.RadioButton");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_GROUPBOX,"com.sun.star.form.component.GroupBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_FIXEDTEXT,"com.sun.star.form.component.FixedText");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_COMMANDBUTTON,"com.sun.star.form.component.CommandButton");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_CHECKBOX,"com.sun.star.form.component.CheckBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_GRIDCONTROL,"com.sun.star.form.component.GridControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_IMAGEBUTTON,"com.sun.star.form.component.ImageButton");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_FILECONTROL,"com.sun.star.form.component.FileControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_TIMEFIELD,"com.sun.star.form.component.TimeField");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_DATEFIELD,"com.sun.star.form.component.DateField");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_NUMERICFIELD,"com.sun.star.form.component.NumericField");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_CURRENCYFIELD,"com.sun.star.form.component.CurrencyField");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_PATTERNFIELD,"com.sun.star.form.component.PatternField");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_HIDDENCONTROL,"com.sun.star.form.component.HiddenControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_IMAGECONTROL,"com.sun.star.form.component.DatabaseImageControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_FORMATTEDFIELD,"com.sun.star.form.component.FormattedField");
- IMPLEMENT_CONSTASCII_USTRING( FM_SUN_COMPONENT_SCROLLBAR, "com.sun.star.form.component.ScrollBar" );
- IMPLEMENT_CONSTASCII_USTRING( FM_SUN_COMPONENT_SPINBUTTON, "com.sun.star.form.component.SpinButton" );
- IMPLEMENT_CONSTASCII_USTRING( FM_SUN_COMPONENT_NAVIGATIONBAR,"com.sun.star.form.component.NavigationToolBar" );
-
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_CONTROL_GRIDCONTROL,"com.sun.star.form.control.GridControl");
-
- IMPLEMENT_CONSTASCII_USTRING(FM_NUMBER_FORMATTER,"com.sun.star.util.NumberFormatter");
- IMPLEMENT_CONSTASCII_USTRING(FM_FORM_CONTROLLER,"com.sun.star.form.FormController");
- IMPLEMENT_CONSTASCII_USTRING(SRV_SDB_CONNECTION,"com.sun.star.sdb.Connection");
- IMPLEMENT_CONSTASCII_USTRING(SRV_SDB_INTERACTION_HANDLER,"com.sun.star.sdb.InteractionHandler");
-} // namespace svxform
+#include "fmservs.hxx"
// ------------------------------------------------------------------------
#define DECL_SERVICE(ImplName) \
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 87149994839b..8c5ca61f6691 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -785,7 +785,7 @@ 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, ........, ........\n", this );
+ OSL_TRACE( "--- FmXFormShell::disposing : %p, ........, ........", this );
impl_checkDisposed();
FmXFormShell_BASE::disposing();
@@ -3936,7 +3936,7 @@ 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, ........\n", this, &_rCurrentView );
+ OSL_TRACE( "--- FmXFormShell::viewDeactivated: %p, %p, ........", this, &_rCurrentView );
if ( _rCurrentView.GetImpl() && !_rCurrentView.IsDesignMode() )
{
@@ -3971,7 +3971,7 @@ void FmXFormShell::viewDeactivated( FmFormView& _rCurrentView, sal_Bool _bDeacti
// remove callbacks at the page
if ( pPage )
{
- OSL_TRACE( "--- FmXFormShell::resetHandler : %p, ........, %p\n", this, pPage );
+ OSL_TRACE( "--- FmXFormShell::resetHandler : %p, ........, %p", this, pPage );
pPage->GetImpl().SetFormsCreationHdl( Link() );
}
UpdateForms( sal_True );
@@ -4010,7 +4010,7 @@ 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, ........\n", this, &_rCurrentView );
+ OSL_TRACE( "--- FmXFormShell::viewActivated : %p, %p, ........", this, &_rCurrentView );
FmFormPage* pPage = _rCurrentView.GetCurPage();
@@ -4040,7 +4040,7 @@ void FmXFormShell::viewActivated( FmFormView& _rCurrentView, sal_Bool _bSyncActi
// set callbacks at the page
if ( pPage )
{
- OSL_TRACE( "--- FmXFormShell::setHandler : %p, ........, %p\n", this, pPage );
+ OSL_TRACE( "--- FmXFormShell::setHandler : %p, ........, %p", this, pPage );
pPage->GetImpl().SetFormsCreationHdl( LINK( this, FmXFormShell, OnFormsCreated ) );
}
diff --git a/svx/source/form/fmstring.src b/svx/source/form/fmstring.src
index 2572c2ed2239..8b42ccadc6a6 100644
--- a/svx/source/form/fmstring.src
+++ b/svx/source/form/fmstring.src
@@ -84,107 +84,16 @@ Resource RID_RSC_TABWIN_PREFIX
};
String RID_STR_FORMSHELL
{
- Text [ en-US ] = "Form";
+ Text = "Form Shell";
};
String RID_STR_STDFORMNAME
{
- Text = "Standard";
-};
-String RID_STR_FORMATTED_CLASSNAME
-{
- Text = "FormattedField";
-};
-String RID_STR_CONTROL_CLASSNAME
-{
- Text = "Control";
-};
-String RID_STR_CHECKBOX_CLASSNAME
-{
- Text = "CheckBox";
-};
-String RID_STR_RADIOBUTTON_CLASSNAME
-{
- Text = "OptionButton";
-};
-String RID_STR_BUTTON_CLASSNAME
-{
- Text = "PushButton";
-};
-String RID_STR_FIXEDTEXT_CLASSNAME
-{
- Text = "LabelField";
-};
-String RID_STR_IMAGE_CLASSNAME
-{
- Text = "ImageButton";
-};
-String RID_STR_GRID_CLASSNAME
-{
- Text = "TableControl";
-};
-String RID_STR_GROUPBOX_CLASSNAME
-{
- Text = "GroupBox";
-};
-String RID_STR_LISTBOX_CLASSNAME
-{
- Text = "ListBox";
-};
-String RID_STR_COMBOBOX_CLASSNAME
-{
- Text = "ComboBox";
-};
-String RID_STR_EDIT_CLASSNAME
-{
- Text = "TextBox";
+ Text [ en-US ]= "Form";
};
-String RID_STR_FILECONTROL_CLASSNAME
+String RID_STR_PROPTITLE_HIDDEN
{
- Text = "FileSelection";
+ Text [ en-US ] = "Hidden Control";
};
-String RID_STR_DATEFIELD_CLASSNAME
-{
- Text = "DateField";
-};
-String RID_STR_TIMEFIELD_CLASSNAME
-{
- Text = "TimeField";
-};
-String RID_STR_NUMERICFIELD_CLASSNAME
-{
- Text = "NumericalField";
-};
-String RID_STR_CURRENCYFIELD_CLASSNAME
-{
- Text = "CurrencyField";
-};
-String RID_STR_PATTERNFIELD_CLASSNAME
-{
- Text = "PatternField";
-};
-String RID_STR_IMAGECONTROL_CLASSNAME
-{
- Text = "ImageControl";
-};
-String RID_STR_HIDDEN_CLASSNAME
-{
- Text = "HiddenControl";
-};
-String RID_STR_NAVBAR_CLASSNAME
-{
- Text [ en-US ] = "NavigationBar";
-};
-
-String RID_STR_CLASSNAME_SCROLLBAR
-{
- Text [ en-US ] = "Scrollbar";
-};
-
-String RID_STR_CLASSNAME_SPINBUTTON
-{
- Text [ en-US ] = "SpinButton";
-};
-
String RID_STR_CONTROL
{
Text [ en-US ] = "Control";
@@ -282,7 +191,7 @@ String RID_STR_TIME
};
String RID_STR_PROPTITLE_PUSHBUTTON
{
- Text [ en-US ] = "Button";
+ Text [ en-US ] = "Push Button";
};
String RID_STR_PROPTITLE_RADIOBUTTON
{
@@ -294,7 +203,7 @@ String RID_STR_PROPTITLE_CHECKBOX
};
String RID_STR_PROPTITLE_FIXEDTEXT
{
- Text [ en-US ] = "Label field";
+ Text [ en-US ] = "Label Field";
};
String RID_STR_PROPTITLE_GROUPBOX
{
diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx
index f7e59ce41888..10c0978288a6 100644
--- a/svx/source/form/fmtextcontrolshell.cxx
+++ b/svx/source/form/fmtextcontrolshell.cxx
@@ -94,7 +94,6 @@ namespace svx
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
- using namespace ::svxform;
//====================================================================
typedef USHORT WhichId;
diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx
index 95f1ae30f41c..df8b51b8b82f 100644
--- a/svx/source/form/fmtools.cxx
+++ b/svx/source/form/fmtools.cxx
@@ -37,7 +37,7 @@
#include <com/sun/star/sdbcx/Privilege.hpp>
#include <com/sun/star/lang/Locale.hpp>
#include "fmtools.hxx"
-#include "dbtoolsclient.hxx"
+#include "svx/dbtoolsclient.hxx"
#include "fmservs.hxx"
#include <svx/fmglob.hxx>
#include <vcl/stdtext.hxx>
@@ -100,7 +100,6 @@
#include <connectivity/dbtools.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/sequence.hxx>
-#include "fmstatic.hxx"
#include <comphelper/extract.hxx>
#include <comphelper/uno3.hxx>
#include <connectivity/dbexception.hxx>
@@ -109,14 +108,6 @@
#include <algorithm>
#include <rtl/logfile.hxx>
-namespace svxform
-{
-
- IMPLEMENT_CONSTASCII_USTRING(DATA_MODE,"DataMode");
- IMPLEMENT_CONSTASCII_USTRING(FILTER_MODE,"FilterMode");
-
-} // namespace svxform
-
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::lang;
diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx
index 6f4dff9d7fb3..2436113312cc 100644
--- a/svx/source/form/fmundo.cxx
+++ b/svx/source/form/fmundo.cxx
@@ -55,7 +55,7 @@
#include <rtl/logfile.hxx>
#include <svx/dialmgr.hxx>
#include "fmpgeimp.hxx"
-#include "dbtoolsclient.hxx"
+#include "svx/dbtoolsclient.hxx"
#include <svtools/macitem.hxx>
#include <tools/shl.hxx>
#include <tools/diagnose_ex.h>
@@ -459,7 +459,7 @@ void SAL_CALL FmXUndoEnvironment::propertyChange(const PropertyChangeEvent& evt)
return;
// if it's a "default value" property of a control model, set the according "value" property
- static const sal_Char* pDefaultValueProperties[] = {
+ static ::rtl::OUString pDefaultValueProperties[] = {
FM_PROP_DEFAULT_TEXT, FM_PROP_DEFAULTCHECKED, FM_PROP_DEFAULT_DATE, FM_PROP_DEFAULT_TIME,
FM_PROP_DEFAULT_VALUE, FM_PROP_DEFAULT_SELECT_SEQ, FM_PROP_EFFECTIVE_DEFAULT
};
@@ -472,7 +472,7 @@ void SAL_CALL FmXUndoEnvironment::propertyChange(const PropertyChangeEvent& evt)
"FmXUndoEnvironment::propertyChange: inconsistence!");
for (sal_Int32 i=0; i<nDefaultValueProps; ++i)
{
- if (0 == evt.PropertyName.compareToAscii(pDefaultValueProperties[i]))
+ if (0 == evt.PropertyName.compareTo(pDefaultValueProperties[i]))
{
try
{
diff --git a/svx/source/form/fmurl.cxx b/svx/source/form/fmurl.cxx
deleted file mode 100644
index 32a40c0949e4..000000000000
--- a/svx/source/form/fmurl.cxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/*************************************************************************
- *
- * 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: fmurl.cxx,v $
- * $Revision: 1.7 $
- *
- * 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 "fmurl.hxx"
-
-
-namespace svxform
-{
-
- IMPLEMENT_CONSTASCII_USTRING(FMURL_FORMSLOTS_PREFIX, ".uno:FormController/");
-
- IMPLEMENT_CONSTASCII_USTRING(FMURL_FORM_POSITION, ".uno:FormController/positionForm" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_FORM_RECORDCOUNT, ".uno:FormController/RecordCount" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_MOVEFIRST, ".uno:FormController/moveToFirst" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_MOVEPREV, ".uno:FormController/moveToPrev" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_MOVENEXT, ".uno:FormController/moveToNext" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_MOVELAST, ".uno:FormController/moveToLast" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_MOVETONEW, ".uno:FormController/moveToNew" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_UNDO, ".uno:FormController/undoRecord" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_SAVE, ".uno:FormController/saveRecord" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_DELETE, ".uno:FormController/deleteRecord" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_FORM_REFRESH, ".uno:FormController/refreshForm" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_FORM_REFRESH_CURRENT_CONTROL,
- ".uno:FormController/refreshCurrentControl" );
-
- IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_SORT_UP, ".uno:FormController/sortUp" );
- IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_SORT_DOWN, ".uno:FormController/sortDown" );
- IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_SORT, ".uno:FormController/sort" );
- IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_AUTO_FILTER, ".uno:FormController/autoFilter" );
- IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_FILTER, ".uno:FormController/filter" );
- IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_APPLY_FILTER, ".uno:FormController/applyFilter" );
- IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_REMOVE_FILTER,".uno:FormController/removeFilterOrder" );
-
- IMPLEMENT_CONSTASCII_USTRING(FMURL_CONFIRM_DELETION,".uno:FormSlots/ConfirmDeletion");
-
- IMPLEMENT_CONSTASCII_USTRING(FMURL_COMPONENT_FORMGRIDVIEW,".component:DB/FormGridView");
- IMPLEMENT_CONSTASCII_USTRING(FMURL_GRIDVIEW_CLEARVIEW,".uno:FormSlots/ClearView");
- IMPLEMENT_CONSTASCII_USTRING(FMURL_GRIDVIEW_ADDCOLUMN,".uno:FormSlots/AddGridColumn");
- IMPLEMENT_CONSTASCII_USTRING(FMURL_GRIDVIEW_ATTACHTOFORM,".uno:FormSlots/AttachToForm");
-
- IMPLEMENT_CONSTASCII_USTRING(FMARG_ATTACHTO_MASTERFORM,"MasterForm");
- IMPLEMENT_CONSTASCII_USTRING(FMARG_ADDCOL_COLUMNTYPE,"ColumnType");
- IMPLEMENT_CONSTASCII_USTRING(FMARG_ADDCOL_COLUMNPOS,"ColumnPosition");
-
-} // namespace svxform
diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx
index 94ce048f4ed2..222407a36021 100644
--- a/svx/source/form/fmview.cxx
+++ b/svx/source/form/fmview.cxx
@@ -342,7 +342,7 @@ void FmFormView::GrabFirstControlFocus( sal_Bool _bForceSync )
//------------------------------------------------------------------------
SdrPageView* FmFormView::ShowSdrPage(SdrPage* pPage)
{
- OSL_TRACE( "--- FmFormView::ShowSdrPage : ........, %p, %p\n", this, pPage );
+ OSL_TRACE( "--- FmFormView::ShowSdrPage : ........, %p, %p", this, pPage );
SdrPageView* pPV = E3dView::ShowSdrPage(pPage);
@@ -380,7 +380,7 @@ SdrPageView* FmFormView::ShowSdrPage(SdrPage* pPage)
//------------------------------------------------------------------------
void FmFormView::HideSdrPage()
{
- OSL_TRACE( "--- FmFormView::HideSdrPage : ........, %p, %p\n", this, GetCurPage() );
+ OSL_TRACE( "--- FmFormView::HideSdrPage : ........, %p, %p", this, GetCurPage() );
// --- 1. deactivate controls
if ( !IsDesignMode() )
diff --git a/svx/source/form/formcontrolfactory.cxx b/svx/source/form/formcontrolfactory.cxx
index 570fb4df15c3..de1a7d76b526 100644
--- a/svx/source/form/formcontrolfactory.cxx
+++ b/svx/source/form/formcontrolfactory.cxx
@@ -30,11 +30,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include "dbtoolsclient.hxx"
+#include "svx/dbtoolsclient.hxx"
#include "formcontrolfactory.hxx"
#include "fmcontrollayout.hxx"
#include "fmprop.hrc"
#include "fmresids.hrc"
+#include "fmservs.hxx"
#include "svx/dialmgr.hxx"
#include "svx/svdouno.hxx"
@@ -739,6 +740,75 @@ namespace svxform
}
}
+ //------------------------------------------------------------------------------
+ ::rtl::OUString FormControlFactory::getDefaultName( sal_Int16 _nClassId, const Reference< XServiceInfo >& _rxObject )
+ {
+ sal_uInt16 nResId(0);
+
+ switch ( _nClassId )
+ {
+ case FormComponentType::COMMANDBUTTON: nResId = RID_STR_PROPTITLE_PUSHBUTTON; break;
+ case FormComponentType::RADIOBUTTON: nResId = RID_STR_PROPTITLE_RADIOBUTTON; break;
+ case FormComponentType::CHECKBOX: nResId = RID_STR_PROPTITLE_CHECKBOX; break;
+ case FormComponentType::LISTBOX: nResId = RID_STR_PROPTITLE_LISTBOX; break;
+ case FormComponentType::COMBOBOX: nResId = RID_STR_PROPTITLE_COMBOBOX; break;
+ case FormComponentType::GROUPBOX: nResId = RID_STR_PROPTITLE_GROUPBOX; break;
+ case FormComponentType::IMAGEBUTTON: nResId = RID_STR_PROPTITLE_IMAGEBUTTON; break;
+ case FormComponentType::FIXEDTEXT: nResId = RID_STR_PROPTITLE_FIXEDTEXT; break;
+ case FormComponentType::GRIDCONTROL: nResId = RID_STR_PROPTITLE_DBGRID; break;
+ case FormComponentType::FILECONTROL: nResId = RID_STR_PROPTITLE_FILECONTROL; break;
+ case FormComponentType::DATEFIELD: nResId = RID_STR_PROPTITLE_DATEFIELD; break;
+ case FormComponentType::TIMEFIELD: nResId = RID_STR_PROPTITLE_TIMEFIELD; break;
+ case FormComponentType::NUMERICFIELD: nResId = RID_STR_PROPTITLE_NUMERICFIELD; break;
+ case FormComponentType::CURRENCYFIELD: nResId = RID_STR_PROPTITLE_CURRENCYFIELD; break;
+ case FormComponentType::PATTERNFIELD: nResId = RID_STR_PROPTITLE_PATTERNFIELD; break;
+ case FormComponentType::IMAGECONTROL: nResId = RID_STR_PROPTITLE_IMAGECONTROL; break;
+ case FormComponentType::HIDDENCONTROL: nResId = RID_STR_PROPTITLE_HIDDEN; break;
+ case FormComponentType::SCROLLBAR: nResId = RID_STR_PROPTITLE_SCROLLBAR; break;
+ case FormComponentType::SPINBUTTON: nResId = RID_STR_PROPTITLE_SPINBUTTON; break;
+ case FormComponentType::NAVIGATIONBAR: nResId = RID_STR_PROPTITLE_NAVBAR; break;
+
+ case FormComponentType::TEXTFIELD:
+ nResId = RID_STR_PROPTITLE_EDIT;
+ if ( _rxObject.is() && _rxObject->supportsService( FM_SUN_COMPONENT_FORMATTEDFIELD ) )
+ nResId = RID_STR_PROPTITLE_FORMATTED;
+ break;
+
+ default:
+ nResId = RID_STR_CONTROL; break;
+ }
+
+ return String( SVX_RES( nResId ) );
+ }
+
+ //------------------------------------------------------------------------------
+ ::rtl::OUString FormControlFactory::getDefaultUniqueName_ByComponentType( const Reference< XNameAccess >& _rxContainer,
+ const Reference< XPropertySet >& _rxObject )
+ {
+ sal_Int16 nClassId = FormComponentType::CONTROL;
+ OSL_VERIFY( _rxObject->getPropertyValue( FM_PROP_CLASSID ) >>= nClassId );
+ ::rtl::OUString sBaseName = getDefaultName( nClassId, Reference< XServiceInfo >( _rxObject, UNO_QUERY ) );
+
+ return getUniqueName( _rxContainer, sBaseName );
+ }
+
+ //------------------------------------------------------------------------------
+ ::rtl::OUString FormControlFactory::getUniqueName( const Reference< XNameAccess >& _rxContainer, const ::rtl::OUString& _rBaseName )
+ {
+ sal_Int32 n = 0;
+ ::rtl::OUString sName;
+ do
+ {
+ ::rtl::OUStringBuffer aBuf( _rBaseName );
+ aBuf.appendAscii( " " );
+ aBuf.append( ++n );
+ sName = aBuf.makeStringAndClear();
+ }
+ while ( _rxContainer->hasByName( sName ) );
+
+ return sName;
+ }
+
//........................................................................
} // namespace svxform
//........................................................................
diff --git a/svx/source/form/formcontrolling.cxx b/svx/source/form/formcontrolling.cxx
index 9c9c76b9d403..104d2f423eb5 100644
--- a/svx/source/form/formcontrolling.cxx
+++ b/svx/source/form/formcontrolling.cxx
@@ -57,7 +57,6 @@ namespace svx
{
//........................................................................
- using namespace ::svxform;
/** === begin UNO using === **/
using ::com::sun::star::uno::Reference;
using ::com::sun::star::lang::XMultiServiceFactory;
diff --git a/svx/source/form/makefile.mk b/svx/source/form/makefile.mk
index 3d405edc00f1..b649be94d106 100644
--- a/svx/source/form/makefile.mk
+++ b/svx/source/form/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=form
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
@@ -53,7 +54,8 @@ SRC1FILES= \
formshell.src \
datanavi.src
-SLOFILES = \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/formtoolbars.obj \
$(SLO)$/fmdocumentclassification.obj \
$(SLO)$/fmcontrolbordermanager.obj \
@@ -61,7 +63,6 @@ SLOFILES = \
$(SLO)$/fmtextcontroldialogs.obj \
$(SLO)$/fmtextcontrolfeature.obj \
$(SLO)$/fmtextcontrolshell.obj \
- $(SLO)$/dbcharsethelper.obj \
$(SLO)$/ParseContext.obj \
$(SLO)$/typeconversionclient.obj \
$(SLO)$/confirmdelete.obj \
@@ -69,9 +70,7 @@ SLOFILES = \
$(SLO)$/sqlparserclient.obj \
$(SLO)$/dataaccessdescriptor.obj \
$(SLO)$/fmpage.obj \
- $(SLO)$/fmPropBrw.obj \
$(SLO)$/fmundo.obj \
- $(SLO)$/fmprop.obj \
$(SLO)$/fmmodel.obj \
$(SLO)$/navigatortree.obj \
$(SLO)$/navigatortreemodel.obj \
@@ -81,21 +80,14 @@ SLOFILES = \
$(SLO)$/fmvwimp.obj \
$(SLO)$/fmdpage.obj \
$(SLO)$/fmitems.obj \
- $(SLO)$/tbxform.obj \
$(SLO)$/fmobj.obj \
$(SLO)$/fmdmod.obj \
- $(SLO)$/fmobjfac.obj \
- $(SLO)$/fmsrccfg.obj \
$(SLO)$/fmservs.obj \
$(SLO)$/typemap.obj \
$(SLO)$/fmexch.obj \
- $(SLO)$/tabwin.obj \
- $(SLO)$/fmurl.obj \
- $(SLO)$/filtnav.obj \
$(SLO)$/fmtools.obj \
$(SLO)$/fmshimp.obj \
$(SLO)$/fmshell.obj \
- $(SLO)$/fmsrcimp.obj \
$(SLO)$/fmview.obj \
$(SLO)$/sdbdatacolumn.obj \
$(SLO)$/formcontrolling.obj \
@@ -105,13 +97,22 @@ SLOFILES = \
$(SLO)$/datalistener.obj \
$(SLO)$/fmscriptingenv.obj \
$(SLO)$/stringlistresource.obj \
- $(SLO)$/databaselocationinput.obj \
$(SLO)$/delayedevent.obj \
$(SLO)$/formcontrolfactory.obj
-.IF "$(OS)$(CPU)"=="SOLARISI"
-NOOPTFILES=$(SLO)$/fmprop.obj
-.ENDIF
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/dbcharsethelper.obj \
+ $(SLO)$/fmPropBrw.obj \
+ $(SLO)$/tbxform.obj \
+ $(SLO)$/fmobjfac.obj \
+ $(SLO)$/fmsrccfg.obj \
+ $(SLO)$/tabwin.obj \
+ $(SLO)$/filtnav.obj \
+ $(SLO)$/fmsrcimp.obj \
+ $(SLO)$/databaselocationinput.obj
+
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
# --- Targets ----------------------------------
diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx
index b57863ffd5ae..f90f0d8c2ce4 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -1573,7 +1573,7 @@ namespace svxform
aBaseName = SVX_RES( RID_STR_STDFORMNAME );
else if( pEntryData->ISA(FmControlData) )
- aBaseName = SVX_RES( RID_STR_CONTROL_CLASSNAME );
+ aBaseName = SVX_RES( RID_STR_CONTROL );
//////////////////////////////////////////////////////////////////////
// Neuen Namen erstellen
diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx
index e28ff0204366..4ad118418981 100644
--- a/svx/source/form/tabwin.cxx
+++ b/svx/source/form/tabwin.cxx
@@ -52,7 +52,7 @@
#endif
#include <svx/fmshell.hxx>
#include "fmshimp.hxx"
-#include "dbtoolsclient.hxx"
+#include "svx/dbtoolsclient.hxx"
#include <svx/fmpage.hxx>
#ifndef _SVX_FMPGEIMP_HXX
diff --git a/svx/source/gengal/makefile.mk b/svx/source/gengal/makefile.mk
index 703f730433c9..ae1f36e5f742 100644
--- a/svx/source/gengal/makefile.mk
+++ b/svx/source/gengal/makefile.mk
@@ -66,7 +66,7 @@ APP1STDLIBS=$(TOOLSLIB) \
$(SALLIB) \
$(VCLLIB) \
$(UCBHELPERLIB) \
- $(SVXLIB)
+ $(SVXCORELIB)
#.IF "$(COM)"=="GCC"
#ADDOPTFILES=$(OBJ)$/gengal.obj
diff --git a/svx/source/inc/AccessibleStringWrap.hxx b/svx/source/inc/AccessibleStringWrap.hxx
index 032c5b5472c7..e85e36b7b8ac 100644
--- a/svx/source/inc/AccessibleStringWrap.hxx
+++ b/svx/source/inc/AccessibleStringWrap.hxx
@@ -34,6 +34,8 @@
#include <sal/types.h>
#include <tools/string.hxx>
+#include <svx/svxdllapi.h>
+
class OutputDevice;
class SvxFont;
class Rectangle;
@@ -49,10 +51,10 @@ class AccessibleStringWrap
{
public:
- AccessibleStringWrap( OutputDevice& rDev, SvxFont& rFont, const String& rText );
+ SVX_DLLPUBLIC AccessibleStringWrap( OutputDevice& rDev, SvxFont& rFont, const String& rText );
- sal_Bool GetCharacterBounds( sal_Int32 nIndex, Rectangle& rRect );
- sal_Int32 GetIndexAtPoint( const Point& rPoint );
+ SVX_DLLPUBLIC sal_Bool GetCharacterBounds( sal_Int32 nIndex, Rectangle& rRect );
+ SVX_DLLPUBLIC sal_Int32 GetIndexAtPoint( const Point& rPoint );
private:
diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx
index 81e77be20b8e..deac560db58b 100644
--- a/svx/source/inc/datanavi.hxx
+++ b/svx/source/inc/datanavi.hxx
@@ -307,10 +307,10 @@ namespace svxform
};
//========================================================================
- class DataNavigatorManager : public SfxChildWindow
+ class SVX_DLLPUBLIC DataNavigatorManager : public SfxChildWindow
{
public:
- DataNavigatorManager( Window* pParent, sal_uInt16 nId,
+ SVX_DLLPRIVATE DataNavigatorManager( Window* pParent, sal_uInt16 nId,
SfxBindings* pBindings, SfxChildWinInfo* pInfo );
SFX_DECL_CHILDWINDOW( DataNavigatorManager );
};
diff --git a/svx/source/inc/filtnav.hxx b/svx/source/inc/filtnav.hxx
index 5f48c24e1085..2bb298836d02 100644
--- a/svx/source/inc/filtnav.hxx
+++ b/svx/source/inc/filtnav.hxx
@@ -43,13 +43,8 @@
#include <vcl/image.hxx>
#include <svtools/svtreebx.hxx>
-#ifndef _DIALOG_HXX //autogen
#include <vcl/dialog.hxx>
-#endif
-
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
#include <vcl/dockwin.hxx>
#include "fmtools.hxx"
#include "fmexch.hxx"
diff --git a/svx/source/inc/fmPropBrw.hxx b/svx/source/inc/fmPropBrw.hxx
index 6d7e6bde0259..285cb90320d2 100644
--- a/svx/source/inc/fmPropBrw.hxx
+++ b/svx/source/inc/fmPropBrw.hxx
@@ -57,6 +57,7 @@ class FmFormShell;
class FmPropBrw : public SfxFloatingWindow, public SfxControllerItem
{
sal_Bool m_bInitialStateChange;
+ bool m_bInStateChange;
::rtl::OUString m_sLastActivePage;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
m_xInspectorContext;
diff --git a/svx/source/inc/fmctrler.hxx b/svx/source/inc/fmctrler.hxx
index 5684a4c0bd55..7a973e129280 100644
--- a/svx/source/inc/fmctrler.hxx
+++ b/svx/source/inc/fmctrler.hxx
@@ -273,7 +273,7 @@ public:
// XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
- static FmXFormController* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent );
+ SVX_DLLPUBLIC static FmXFormController* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent );
// XDispatch
virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& _rURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArgs ) throw (::com::sun::star::uno::RuntimeException);
@@ -462,7 +462,7 @@ public:
--m_nCurrentFilterPosition;
}
- void setCurrentFilterPosition(sal_Int32 nPos);
+ SVX_DLLPUBLIC void setCurrentFilterPosition(sal_Int32 nPos);
sal_Int32 getCurrentFilterPosition() const {return m_nCurrentFilterPosition;}
protected:
diff --git a/svx/source/inc/fmexch.hxx b/svx/source/inc/fmexch.hxx
index f85f61fdd126..689d02396d23 100644
--- a/svx/source/inc/fmexch.hxx
+++ b/svx/source/inc/fmexch.hxx
@@ -36,6 +36,8 @@
#include <com/sun/star/container/XNameContainer.hpp>
#include <tools/link.hxx>
+#include <svx/svxdllapi.h>
+
class FmFormShell;
class FmFormPage;
class SvLBoxEntry;
@@ -63,7 +65,7 @@ namespace svxform
//====================================================================
//= OLocalExchange
//====================================================================
- class OLocalExchange : public TransferableHelper
+ class SVX_DLLPUBLIC OLocalExchange : public TransferableHelper
{
private:
Link m_aClipboardListener;
@@ -110,7 +112,7 @@ namespace svxform
//= OLocalExchangeHelper
//====================================================================
/// a helper for navigator windows (SvTreeListBox'es) which allow DnD within themself
- class OLocalExchangeHelper
+ class SVX_DLLPUBLIC OLocalExchangeHelper
{
protected:
Window* m_pDragSource;
@@ -130,13 +132,13 @@ namespace svxform
inline sal_Bool isDataExchangeActive( ) const { return isDragSource() || isClipboardOwner(); }
inline void clear() { if ( isDataExchangeActive() ) m_pTransferable->clear(); }
- void setClipboardListener( const Link& _rListener ) { if ( m_pTransferable ) m_pTransferable->setClipboardListener( _rListener ); }
+ SVX_DLLPRIVATE void setClipboardListener( const Link& _rListener ) { if ( m_pTransferable ) m_pTransferable->setClipboardListener( _rListener ); }
protected:
- virtual OLocalExchange* createExchange() const = 0;
+ SVX_DLLPRIVATE virtual OLocalExchange* createExchange() const = 0;
protected:
- void implReset();
+ SVX_DLLPRIVATE void implReset();
};
//====================================================================
diff --git a/svx/source/inc/fmexpl.hxx b/svx/source/inc/fmexpl.hxx
index 7b66a9968f13..df60ba931739 100644
--- a/svx/source/inc/fmexpl.hxx
+++ b/svx/source/inc/fmexpl.hxx
@@ -595,10 +595,10 @@ namespace svxform
};
//========================================================================
- class NavigatorFrameManager : public SfxChildWindow
+ class SVX_DLLPUBLIC NavigatorFrameManager : public SfxChildWindow
{
public:
- NavigatorFrameManager( Window *pParent, sal_uInt16 nId, SfxBindings *pBindings,
+ SVX_DLLPRIVATE NavigatorFrameManager( Window *pParent, sal_uInt16 nId, SfxBindings *pBindings,
SfxChildWinInfo *pInfo );
SFX_DECL_CHILDWINDOW( NavigatorFrameManager );
};
diff --git a/svx/source/inc/fmobj.hxx b/svx/source/inc/fmobj.hxx
index e37b6a32e74e..4099f241b72a 100644
--- a/svx/source/inc/fmobj.hxx
+++ b/svx/source/inc/fmobj.hxx
@@ -62,8 +62,8 @@ class FmFormObj: public SdrUnoObj
// only to be used for comparison with the current ref device!
public:
- FmFormObj(const ::rtl::OUString& rModelName,sal_Int32 _nType);
- FmFormObj(sal_Int32 _nType);
+ SVX_DLLPUBLIC FmFormObj(const ::rtl::OUString& rModelName,sal_Int32 _nType);
+ SVX_DLLPUBLIC FmFormObj(sal_Int32 _nType);
TYPEINFO();
diff --git a/svx/source/inc/fmpgeimp.hxx b/svx/source/inc/fmpgeimp.hxx
index 90a7a4027b46..880ecb21d7e5 100644
--- a/svx/source/inc/fmpgeimp.hxx
+++ b/svx/source/inc/fmpgeimp.hxx
@@ -133,29 +133,15 @@ protected:
sal_Int32 nCommandType
);
- ::rtl::OUString getDefaultName(
- sal_Int16 _nClassId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm>& _rxControls,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo >& _rxObject
- ) const;
-
public:
-
- static UniString getDefaultName(
- sal_Int16 nClassId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo >& _rxObject
- );
-
::rtl::OUString setUniqueName(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent>& xFormComponent, const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm>& xControls);
- ::rtl::OUString getUniqueName(const ::rtl::OUString& rName, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& xNamedSet) const;
void formObjectInserted( const FmFormObj& _object );
void formObjectRemoved( const FmFormObj& _object );
/** returns an object mapping from control models to drawing shapes.
*/
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XMap >
- getControlToShapeMap();
+ SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::container::XMap > getControlToShapeMap();
private:
/** validates whether <member>xCurrentForm</member> is still valid and to be used
diff --git a/svx/source/inc/fmprop.hrc b/svx/source/inc/fmprop.hrc
index 3deec41981d4..34d88b325731 100644
--- a/svx/source/inc/fmprop.hrc
+++ b/svx/source/inc/fmprop.hrc
@@ -30,9 +30,6 @@
#ifndef _SVX_FMPROP_HRC
#define _SVX_FMPROP_HRC
-#ifndef _FM_STATIC_HXX_
-#include "fmstatic.hxx"
-#endif
// PropertyId's, welche eine Zuordnung zu einen PropertyName haben, das koennten
// auch in Zukunft WhichIds sein -> Itemset
#define FM_ATTR_START 0
@@ -40,151 +37,145 @@
#define FM_ATTR_FILTER ( FM_ATTR_START + 1 )
#define FM_ATTR_FORM_OPERATIONS ( FM_ATTR_START + 2 )
-
-namespace svxform
-{
- DECLARE_CONSTASCII_USTRING(FM_PROP_NAME);
- DECLARE_CONSTASCII_USTRING(FM_PROP_CLASSID);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ALIGN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ROWCOUNT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ROWCOUNTFINAL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FETCHSIZE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_VALUE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_VALUEMIN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_VALUEMAX);
- DECLARE_CONSTASCII_USTRING(FM_PROP_VALUESTEP);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TEXT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_LABEL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_NAVIGATION);
- DECLARE_CONSTASCII_USTRING(FM_PROP_CYCLE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_CONTROLSOURCE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ENABLED);
- DECLARE_CONSTASCII_USTRING(FM_PROP_SPIN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_READONLY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FILTER);
- DECLARE_CONSTASCII_USTRING(FM_PROP_AUTOINCREMENT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_WIDTH);
- DECLARE_CONSTASCII_USTRING(FM_PROP_SEARCHABLE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_MULTILINE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TARGET_URL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULTCONTROL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_MAXTEXTLEN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DATE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TIME);
- DECLARE_CONSTASCII_USTRING(FM_PROP_STATE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TRISTATE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_STRINGITEMLIST);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULT_TEXT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULTCHECKED);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULT_DATE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULT_TIME);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULT_VALUE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FORMATKEY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FORMATSSUPPLIER);
- DECLARE_CONSTASCII_USTRING(FM_PROP_LISTSOURCETYPE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_LISTSOURCE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_SELECT_SEQ);
- DECLARE_CONSTASCII_USTRING(FM_PROP_VALUE_SEQ);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULT_SELECT_SEQ);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DECIMAL_ACCURACY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_EDITMASK);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ISREADONLY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FIELDTYPE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_REFVALUE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_STRICTFORMAT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DATASOURCE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_LITERALMASK);
- DECLARE_CONSTASCII_USTRING(FM_PROP_SHOWTHOUSANDSEP);
- DECLARE_CONSTASCII_USTRING(FM_PROP_CURRENCYSYMBOL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DATEFORMAT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DATEMIN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DATEMAX);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DATE_SHOW_CENTURY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TIMEFORMAT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TIMEMIN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TIMEMAX);
- DECLARE_CONSTASCII_USTRING(FM_PROP_LINECOUNT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_BOUNDCOLUMN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_HASNAVIGATION);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FONT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_BACKGROUNDCOLOR);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TEXTCOLOR);
- DECLARE_CONSTASCII_USTRING(FM_PROP_BORDER);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DROPDOWN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ROWHEIGHT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_HELPTEXT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_HELPURL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_RECORDMARKER);
- DECLARE_CONSTASCII_USTRING(FM_PROP_BOUNDFIELD);
- DECLARE_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_VALUE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_DEFAULT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_MIN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_MAX);
- DECLARE_CONSTASCII_USTRING(FM_PROP_HIDDEN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FILTERPROPOSAL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FIELDSOURCE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TABLENAME);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FILTERSUPPLIER);
- DECLARE_CONSTASCII_USTRING(FM_PROP_CURRENTFILTER);
- DECLARE_CONSTASCII_USTRING(FM_PROP_SELECTED_FIELDS);
- DECLARE_CONSTASCII_USTRING(FM_PROP_SELECTED_TABLES);
- DECLARE_CONSTASCII_USTRING(FM_PROP_THREADSAFE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_CONTROLLABEL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_CURSORCOLOR);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ALWAYSSHOWCURSOR);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DISPLAYSYNCHRON);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ISMODIFIED);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ISNEW);
- DECLARE_CONSTASCII_USTRING(FM_PROP_PRIVILEGES);
- DECLARE_CONSTASCII_USTRING(FM_PROP_COMMAND);
- DECLARE_CONSTASCII_USTRING(FM_PROP_COMMANDTYPE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_RESULTSET_CONCURRENCY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_INSERTONLY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_RESULTSET_TYPE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ESCAPE_PROCESSING);
- DECLARE_CONSTASCII_USTRING(FM_PROP_APPLYFILTER);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ISNULLABLE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ACTIVECOMMAND);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ISCURRENCY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_URL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ACTIVE_CONNECTION);
- DECLARE_CONSTASCII_USTRING(FM_PROP_SORT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_CONTROLSOURCEPROPERTY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_REALNAME);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TEXTLINECOLOR);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FONTEMPHASISMARK);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FONTRELIEF);
- DECLARE_CONSTASCII_USTRING( FM_PROP_SCROLLVALUE_MIN );
- DECLARE_CONSTASCII_USTRING( FM_PROP_SCROLLVALUE_MAX );
- DECLARE_CONSTASCII_USTRING( FM_PROP_DEFAULT_SCROLLVALUE );
- DECLARE_CONSTASCII_USTRING( FM_PROP_LINEINCREMENT );
- DECLARE_CONSTASCII_USTRING( FM_PROP_BLOCKINCREMENT );
- DECLARE_CONSTASCII_USTRING( FM_PROP_ORIENTATION );
- DECLARE_CONSTASCII_USTRING( FM_PROP_REPEAT );
- DECLARE_CONSTASCII_USTRING( FM_PROP_REPEATDELAY );
- DECLARE_CONSTASCII_USTRING( FM_PROP_SYMBOLCOLOR );
- DECLARE_CONSTASCII_USTRING( FM_PROP_VISIBILESIZE );
- DECLARE_CONSTASCII_USTRING( FM_PROP_SPINVALUE_MIN );
- DECLARE_CONSTASCII_USTRING( FM_PROP_SPINVALUE_MAX );
- DECLARE_CONSTASCII_USTRING( FM_PROP_DEFAULT_SPINVALUE );
- DECLARE_CONSTASCII_USTRING( FM_PROP_SPININCREMENT );
- DECLARE_CONSTASCII_USTRING( FM_PROP_LINEENDFORMAT );
- DECLARE_CONSTASCII_USTRING( FM_PROP_TOGGLE );
- DECLARE_CONSTASCII_USTRING( FM_PROP_FOCUSONCLICK );
- DECLARE_CONSTASCII_USTRING( FM_PROP_HIDEINACTIVESELECTION );
- DECLARE_CONSTASCII_USTRING( FM_PROP_VISUALEFFECT );
- DECLARE_CONSTASCII_USTRING( FM_PROP_BORDERCOLOR );
- DECLARE_CONSTASCII_USTRING( FM_PROP_DYNAMIC_CONTROL_BORDER );
- DECLARE_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_FOCUS );
- DECLARE_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_MOUSE );
- DECLARE_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_INVALID );
- DECLARE_CONSTASCII_USTRING( FM_PROP_BUTTON_TYPE );
- DECLARE_CONSTASCII_USTRING( FM_PROP_FORM_OPERATIONS );
- DECLARE_CONSTASCII_USTRING( FM_PROP_INPUT_REQUIRED );
- DECLARE_CONSTASCII_USTRING( FM_PROP_WRITING_MODE );
- DECLARE_CONSTASCII_USTRING( FM_PROP_MOUSE_WHEEL_BEHAVIOR );
-
-} // namespace svxform
+#define FM_PROP_NAME rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) )
+#define FM_PROP_CLASSID rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ClassId" ) )
+#define FM_PROP_ALIGN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Align" ) )
+#define FM_PROP_ROWCOUNT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowCount" ) )
+#define FM_PROP_ROWCOUNTFINAL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsRowCountFinal" ) )
+#define FM_PROP_FETCHSIZE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FetchSize" ) )
+#define FM_PROP_VALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Value" ) )
+#define FM_PROP_VALUEMIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ValueMin" ) )
+#define FM_PROP_VALUEMAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ValueMax" ) )
+#define FM_PROP_VALUESTEP rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ValueStep" ) )
+#define FM_PROP_TEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) )
+#define FM_PROP_LABEL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" ) )
+#define FM_PROP_NAVIGATION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NavigationBarMode" ) )
+#define FM_PROP_CYCLE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cycle" ) )
+#define FM_PROP_CONTROLSOURCE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataField" ) )
+#define FM_PROP_ENABLED rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" ) )
+#define FM_PROP_SPIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Spin" ) )
+#define FM_PROP_READONLY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ReadOnly" ) )
+#define FM_PROP_FILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Filter" ) )
+#define FM_PROP_AUTOINCREMENT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAutoIncrement" ) )
+#define FM_PROP_WIDTH rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ) )
+#define FM_PROP_SEARCHABLE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSearchable" ) )
+#define FM_PROP_MULTILINE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiLine" ) )
+#define FM_PROP_TARGET_URL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetURL" ) )
+#define FM_PROP_DEFAULTCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultControl" ) )
+#define FM_PROP_MAXTEXTLEN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxTextLen" ) )
+#define FM_PROP_DATE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Date" ) )
+#define FM_PROP_TIME rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Time" ) )
+#define FM_PROP_STATE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "State" ) )
+#define FM_PROP_TRISTATE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TriState" ) )
+#define FM_PROP_STRINGITEMLIST rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StringItemList" ) )
+#define FM_PROP_DEFAULT_TEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultText" ) )
+#define FM_PROP_DEFAULTCHECKED rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultState" ) )
+#define FM_PROP_DEFAULT_DATE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultDate" ) )
+#define FM_PROP_DEFAULT_TIME rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultTime" ) )
+#define FM_PROP_DEFAULT_VALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultValue" ) )
+#define FM_PROP_FORMATKEY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FormatKey" ) )
+#define FM_PROP_FORMATSSUPPLIER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FormatsSupplier" ) )
+#define FM_PROP_LISTSOURCETYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ListSourceType" ) )
+#define FM_PROP_LISTSOURCE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ListSource" ) )
+#define FM_PROP_SELECT_SEQ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedItems" ) )
+#define FM_PROP_VALUE_SEQ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ValueItemList" ) )
+#define FM_PROP_DEFAULT_SELECT_SEQ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultSelection" ) )
+#define FM_PROP_DECIMAL_ACCURACY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DecimalAccuracy" ) )
+#define FM_PROP_EDITMASK rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EditMask" ) )
+#define FM_PROP_ISREADONLY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) )
+#define FM_PROP_FIELDTYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Type" ) )
+#define FM_PROP_REFVALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RefValue" ) )
+#define FM_PROP_STRICTFORMAT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StrictFormat" ) )
+#define FM_PROP_DATASOURCE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataSourceName" ) )
+#define FM_PROP_LITERALMASK rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LiteralMask" ) )
+#define FM_PROP_SHOWTHOUSANDSEP rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ShowThousandsSeparator" ) )
+#define FM_PROP_CURRENCYSYMBOL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CurrencySymbol" ) )
+#define FM_PROP_DATEFORMAT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateFormat" ) )
+#define FM_PROP_DATEMIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateMin" ) )
+#define FM_PROP_DATEMAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateMax" ) )
+#define FM_PROP_DATE_SHOW_CENTURY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateShowCentury" ) )
+#define FM_PROP_TIMEFORMAT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TimeFormat" ) )
+#define FM_PROP_TIMEMIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TimeMin" ) )
+#define FM_PROP_TIMEMAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TimeMax" ) )
+#define FM_PROP_LINECOUNT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LineCount" ) )
+#define FM_PROP_BOUNDCOLUMN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BoundColumn" ) )
+#define FM_PROP_HASNAVIGATION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasNavigationBar" ) )
+#define FM_PROP_FONT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FontDescriptor" ) )
+#define FM_PROP_BACKGROUNDCOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BackgroundColor" ) )
+#define FM_PROP_TEXTCOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextColor" ) )
+#define FM_PROP_BORDER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Border" ) )
+#define FM_PROP_DROPDOWN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Dropdown" ) )
+#define FM_PROP_ROWHEIGHT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowHeight" ) )
+#define FM_PROP_HELPTEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpText" ) )
+#define FM_PROP_HELPURL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpURL" ) )
+#define FM_PROP_RECORDMARKER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasRecordMarker" ) )
+#define FM_PROP_BOUNDFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BoundField" ) )
+#define FM_PROP_EFFECTIVE_VALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EffectiveValue" ) )
+#define FM_PROP_EFFECTIVE_DEFAULT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EffectiveDefault" ) )
+#define FM_PROP_EFFECTIVE_MIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EffectiveMin" ) )
+#define FM_PROP_EFFECTIVE_MAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EffectiveMax" ) )
+#define FM_PROP_HIDDEN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Hidden" ) )
+#define FM_PROP_FILTERPROPOSAL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseFilterValueProposal" ) )
+#define FM_PROP_FIELDSOURCE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FieldSource" ) )
+#define FM_PROP_TABLENAME rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TableName" ) )
+#define FM_PROP_FILTERSUPPLIER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterSupplier" ) )
+#define FM_PROP_CURRENTFILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CurrentFilter" ) )
+#define FM_PROP_SELECTED_FIELDS rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedFields" ) )
+#define FM_PROP_SELECTED_TABLES rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedTables" ) )
+#define FM_PROP_THREADSAFE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ThreadSafe" ) )
+#define FM_PROP_CONTROLLABEL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LabelControl" ) )
+#define FM_PROP_CURSORCOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CursorColor" ) )
+#define FM_PROP_ALWAYSSHOWCURSOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AlwaysShowCursor" ) )
+#define FM_PROP_DISPLAYSYNCHRON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisplayIsSynchron" ) )
+#define FM_PROP_ISMODIFIED rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsModified" ) )
+#define FM_PROP_ISNEW rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsNew" ) )
+#define FM_PROP_PRIVILEGES rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Privileges" ) )
+#define FM_PROP_COMMAND rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Command" ) )
+#define FM_PROP_COMMANDTYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CommandType" ) )
+#define FM_PROP_RESULTSET_CONCURRENCY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResultSetConcurrency" ) )
+#define FM_PROP_INSERTONLY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IgnoreResult" ) )
+#define FM_PROP_RESULTSET_TYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResultSetType" ) )
+#define FM_PROP_ESCAPE_PROCESSING rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EscapeProcessing" ) )
+#define FM_PROP_APPLYFILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ApplyFilter" ) )
+#define FM_PROP_ISNULLABLE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsNullable" ) )
+#define FM_PROP_ACTIVECOMMAND rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ActiveCommand" ) )
+#define FM_PROP_ISCURRENCY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsCurrency" ) )
+#define FM_PROP_URL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) )
+#define FM_PROP_ACTIVE_CONNECTION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ActiveConnection" ) )
+#define FM_PROP_SORT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Order" ) )
+#define FM_PROP_CONTROLSOURCEPROPERTY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataFieldProperty" ) )
+#define FM_PROP_REALNAME rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RealName" ) )
+#define FM_PROP_TEXTLINECOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextLineColor" ) )
+#define FM_PROP_FONTEMPHASISMARK rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FontEmphasisMark" ) )
+#define FM_PROP_FONTRELIEF rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FontRelief" ) )
+#define FM_PROP_SCROLLVALUE_MIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ScrollValueMin" ) )
+#define FM_PROP_SCROLLVALUE_MAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ScrollValueMax" ) )
+#define FM_PROP_DEFAULT_SCROLLVALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultScrollValue" ) )
+#define FM_PROP_LINEINCREMENT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LineIncrement" ) )
+#define FM_PROP_BLOCKINCREMENT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BlockIncrement" ) )
+#define FM_PROP_ORIENTATION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Orientation" ) )
+#define FM_PROP_REPEAT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Repeat" ) )
+#define FM_PROP_REPEATDELAY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RepeatDelay" ) )
+#define FM_PROP_SYMBOLCOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SymbolColor" ) )
+#define FM_PROP_VISIBILESIZE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleSize" ) )
+#define FM_PROP_SPINVALUE_MIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SpinValueMin" ) )
+#define FM_PROP_SPINVALUE_MAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SpinValueMax" ) )
+#define FM_PROP_DEFAULT_SPINVALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultSpinValue" ) )
+#define FM_PROP_SPININCREMENT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SpinIncrement" ) )
+#define FM_PROP_LINEENDFORMAT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LineEndFormat" ) )
+#define FM_PROP_TOGGLE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Toggle" ) )
+#define FM_PROP_FOCUSONCLICK rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FocusOnClick" ) )
+#define FM_PROP_HIDEINACTIVESELECTION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HideInactiveSelection" ) )
+#define FM_PROP_VISUALEFFECT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VisualEffect" ) )
+#define FM_PROP_BORDERCOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BorderColor" ) )
+#define FM_PROP_DYNAMIC_CONTROL_BORDER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DynamicControlBorder" ) )
+#define FM_PROP_CONTROL_BORDER_COLOR_FOCUS rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlBorderColorOnFocus" ) )
+#define FM_PROP_CONTROL_BORDER_COLOR_MOUSE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlBorderColorOnHover" ) )
+#define FM_PROP_CONTROL_BORDER_COLOR_INVALID rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlBorderColorOnInvalid" ) )
+#define FM_PROP_BUTTON_TYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ButtonType" ) )
+#define FM_PROP_FORM_OPERATIONS rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FormOperations" ) )
+#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" ) )
#endif // _SVX_FMPROP_HRC
-
diff --git a/svx/source/inc/fmresids.hrc b/svx/source/inc/fmresids.hrc
index e9f39396cca6..95a478fc5aee 100644
--- a/svx/source/inc/fmresids.hrc
+++ b/svx/source/inc/fmresids.hrc
@@ -214,29 +214,29 @@
#define RID_STR_SVT_SQL_SYNTAX_COLUMN (RID_FORMS_START + 98)
#define RID_STR_PROPTITLE_SCROLLBAR (RID_FORMS_START + 99)
#define RID_STR_PROPTITLE_SPINBUTTON (RID_FORMS_START + 100)
-#define RID_STR_EDIT_CLASSNAME (RID_FORMS_START + 101)
-#define RID_STR_BUTTON_CLASSNAME (RID_FORMS_START + 102)
-#define RID_STR_FIXEDTEXT_CLASSNAME (RID_FORMS_START + 103)
-#define RID_STR_CHECKBOX_CLASSNAME (RID_FORMS_START + 104)
-#define RID_STR_RADIOBUTTON_CLASSNAME (RID_FORMS_START + 105)
-#define RID_STR_LISTBOX_CLASSNAME (RID_FORMS_START + 106)
-#define RID_STR_COMBOBOX_CLASSNAME (RID_FORMS_START + 107)
-#define RID_STR_FORMATTED_CLASSNAME (RID_FORMS_START + 108)
-#define RID_STR_GROUPBOX_CLASSNAME (RID_FORMS_START + 109)
-#define RID_STR_CONTROL_CLASSNAME (RID_FORMS_START + 110)
-#define RID_STR_IMAGE_CLASSNAME (RID_FORMS_START + 111)
-#define RID_STR_GRID_CLASSNAME (RID_FORMS_START + 112)
-#define RID_STR_FILECONTROL_CLASSNAME (RID_FORMS_START + 113)
-#define RID_STR_DATEFIELD_CLASSNAME (RID_FORMS_START + 114)
-#define RID_STR_TIMEFIELD_CLASSNAME (RID_FORMS_START + 115)
-#define RID_STR_NUMERICFIELD_CLASSNAME (RID_FORMS_START + 116)
-#define RID_STR_CURRENCYFIELD_CLASSNAME (RID_FORMS_START + 117)
-#define RID_STR_PATTERNFIELD_CLASSNAME (RID_FORMS_START + 118)
-#define RID_STR_IMAGECONTROL_CLASSNAME (RID_FORMS_START + 119)
-#define RID_STR_HIDDEN_CLASSNAME (RID_FORMS_START + 120)
-#define RID_STR_CLASSNAME_SCROLLBAR (RID_FORMS_START + 121)
-#define RID_STR_CLASSNAME_SPINBUTTON (RID_FORMS_START + 122)
-#define RID_STR_NAVBAR_CLASSNAME (RID_FORMS_START + 123)
+#define RID_STR_PROPTITLE_HIDDEN (RID_FORMS_START + 101)
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
+ // FREE
#define RID_STR_DATANAVIGATOR (RID_FORMS_START + 124)
#define RID_STR_DATANAV_SUBM_PARENT (RID_FORMS_START + 125)
#define RID_STR_DATANAV_SUBM_ID (RID_FORMS_START + 126)
diff --git a/svx/source/inc/fmservs.hxx b/svx/source/inc/fmservs.hxx
index e538ee994d8f..201a5a351224 100644
--- a/svx/source/inc/fmservs.hxx
+++ b/svx/source/inc/fmservs.hxx
@@ -30,76 +30,64 @@
#ifndef _SVX_FMSERVS_HXX
#define _SVX_FMSERVS_HXX
-#include "fmstatic.hxx"
+#include <svx/svxdllapi.h>
+
+#define FM_NUMBER_FORMATTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.NumberFormatter" ) )
+#define FM_COMPONENT_EDIT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.Edit" ) )
+#define FM_COMPONENT_TEXTFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.TextField" ) )
+#define FM_COMPONENT_LISTBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.ListBox" ) )
+#define FM_COMPONENT_COMBOBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.ComboBox" ) )
+#define FM_COMPONENT_RADIOBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.RadioButton" ) )
+#define FM_COMPONENT_GROUPBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.GroupBox" ) )
+#define FM_COMPONENT_FIXEDTEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.FixedText" ) )
+#define FM_COMPONENT_COMMANDBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.CommandButton" ) )
+#define FM_COMPONENT_CHECKBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.CheckBox" ) )
+#define FM_COMPONENT_GRID rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.Grid" ) )
+#define FM_COMPONENT_GRIDCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.GridControl" ) )
+#define FM_COMPONENT_IMAGEBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.ImageButton" ) )
+#define FM_COMPONENT_FILECONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.FileControl" ) )
+#define FM_COMPONENT_TIMEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.TimeField" ) )
+#define FM_COMPONENT_DATEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.DateField" ) )
+#define FM_COMPONENT_NUMERICFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.NumericField" ) )
+#define FM_COMPONENT_CURRENCYFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.CurrencyField" ) )
+#define FM_COMPONENT_PATTERNFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.PatternField" ) )
+#define FM_COMPONENT_FORMATTEDFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.FormattedField" ) )
+#define FM_COMPONENT_HIDDEN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.Hidden" ) )
+#define FM_COMPONENT_HIDDENCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.HiddenControl" ) )
+#define FM_COMPONENT_IMAGECONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.ImageControl" ) )
+#define FM_CONTROL_GRID rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.control.Grid" ) )
+#define FM_CONTROL_GRIDCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.control.GridControl" ) )
+#define FM_FORM_CONTROLLER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.FormController" ) )
+#define SRV_SDB_CONNECTION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.Connection" ) )
+#define SRV_SDB_INTERACTION_HANDLER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.InteractionHandler" ) )
+#define FM_SUN_COMPONENT_FORM rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.Form" ) )
+#define FM_SUN_COMPONENT_TEXTFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.TextField" ) )
+#define FM_SUN_COMPONENT_LISTBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ListBox" ) )
+#define FM_SUN_COMPONENT_COMBOBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ComboBox" ) )
+#define FM_SUN_COMPONENT_RADIOBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.RadioButton" ) )
+#define FM_SUN_COMPONENT_GROUPBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.GroupBox" ) )
+#define FM_SUN_COMPONENT_FIXEDTEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.FixedText" ) )
+#define FM_SUN_COMPONENT_COMMANDBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.CommandButton" ) )
+#define FM_SUN_COMPONENT_CHECKBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.CheckBox" ) )
+#define FM_SUN_COMPONENT_GRIDCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.GridControl" ) )
+#define FM_SUN_COMPONENT_IMAGEBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ImageButton" ) )
+#define FM_SUN_COMPONENT_FILECONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.FileControl" ) )
+#define FM_SUN_COMPONENT_TIMEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.TimeField" ) )
+#define FM_SUN_COMPONENT_DATEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.DateField" ) )
+#define FM_SUN_COMPONENT_NUMERICFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.NumericField" ) )
+#define FM_SUN_COMPONENT_CURRENCYFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.CurrencyField" ) )
+#define FM_SUN_COMPONENT_PATTERNFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.PatternField" ) )
+#define FM_SUN_COMPONENT_HIDDENCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.HiddenControl" ) )
+#define FM_SUN_COMPONENT_IMAGECONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.DatabaseImageControl" ) )
+#define FM_SUN_COMPONENT_FORMATTEDFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.FormattedField" ) )
+#define FM_SUN_COMPONENT_SCROLLBAR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ScrollBar" ) )
+#define FM_SUN_COMPONENT_SPINBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.SpinButton" ) )
+#define FM_SUN_COMPONENT_NAVIGATIONBAR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.NavigationToolBar" ) )
+#define FM_SUN_CONTROL_GRIDCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.control.GridControl" ) )
namespace svxform
{
-
- DECLARE_CONSTASCII_USTRING(FM_NUMBER_FORMATTER);
-
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_EDIT); // alter service name (5.0)
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_TEXTFIELD);
-
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_LISTBOX);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_COMBOBOX);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_RADIOBUTTON);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_GROUPBOX);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_FIXEDTEXT);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_COMMANDBUTTON);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_CHECKBOX);
-
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_GRID); // alter service name (5.0)
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_GRIDCONTROL);
-
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_IMAGEBUTTON);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_FILECONTROL);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_TIMEFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_DATEFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_NUMERICFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_CURRENCYFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_PATTERNFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_FORMATTEDFIELD);
-
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_HIDDEN); // alter service name (5.0)
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_HIDDENCONTROL);
-
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_IMAGECONTROL);
-
- DECLARE_CONSTASCII_USTRING(FM_CONTROL_GRID);
- DECLARE_CONSTASCII_USTRING(FM_CONTROL_GRIDCONTROL);
-
- DECLARE_CONSTASCII_USTRING(FM_FORM_CONTROLLER);
- DECLARE_CONSTASCII_USTRING(SRV_SDB_CONNECTION);
- DECLARE_CONSTASCII_USTRING(SRV_SDB_INTERACTION_HANDLER);
-
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_FORM);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_TEXTFIELD);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_LISTBOX);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_COMBOBOX);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_RADIOBUTTON);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_GROUPBOX);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_FIXEDTEXT);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_COMMANDBUTTON);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_CHECKBOX);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_GRIDCONTROL);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_IMAGEBUTTON);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_FILECONTROL);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_TIMEFIELD);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_DATEFIELD);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_NUMERICFIELD);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_CURRENCYFIELD);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_PATTERNFIELD);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_HIDDENCONTROL);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_IMAGECONTROL);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_FORMATTEDFIELD);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_SCROLLBAR);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_SPINBUTTON);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_NAVIGATIONBAR);
-
- DECLARE_CONSTASCII_USTRING(FM_SUN_CONTROL_GRIDCONTROL);
-
- void ImplSmartRegisterUnoServices();
-
+ SVX_DLLPUBLIC void ImplSmartRegisterUnoServices();
} // namespace svxform
#endif // _SVX_FMSERVS_HXX
diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx
index d3e8e8ce0327..85644ea5daba 100644
--- a/svx/source/inc/fmshimp.hxx
+++ b/svx/source/inc/fmshimp.hxx
@@ -79,7 +79,7 @@
#include <cppuhelper/compbase4.hxx>
#include <cppuhelper/compbase6.hxx>
#include <unotools/configitem.hxx>
-#include "dbtoolsclient.hxx"
+#include "svx/dbtoolsclient.hxx"
#include "formcontrolling.hxx"
#include "fmdocumentclassification.hxx"
@@ -422,7 +422,7 @@ public:
/** retrieves the current selection
*/
- void getCurrentSelection( InterfaceBag& /* [out] */ _rSelection ) const;
+ SVX_DLLPUBLIC void getCurrentSelection( InterfaceBag& /* [out] */ _rSelection ) const;
/** sets a new current selection as indicated by a mark list
@return
@@ -631,7 +631,7 @@ public:
// ========================================================================
SV_DECL_PTRARR_DEL(StatusForwarderArray, SfxStatusForwarder*, 16, 0)
-class SAL_DLLPRIVATE ControlConversionMenuController : public SfxMenuControl
+class SVX_DLLPUBLIC ControlConversionMenuController : public SfxMenuControl
{
protected:
StatusForwarderArray m_aStatusForwarders;
@@ -639,11 +639,11 @@ protected:
PopupMenu* m_pConversionMenu;
public:
- ControlConversionMenuController(sal_uInt16 nId, Menu& rMenu, SfxBindings& rBindings);
- virtual ~ControlConversionMenuController();
+ SVX_DLLPRIVATE ControlConversionMenuController(sal_uInt16 nId, Menu& rMenu, SfxBindings& rBindings);
+ SVX_DLLPRIVATE virtual ~ControlConversionMenuController();
SFX_DECL_MENU_CONTROL();
- virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState);
+ SVX_DLLPRIVATE virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState);
};
//==================================================================
diff --git a/svx/source/inc/fmstatic.hxx b/svx/source/inc/fmstatic.hxx
deleted file mode 100644
index cd58a79df753..000000000000
--- a/svx/source/inc/fmstatic.hxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/*************************************************************************
- *
- * 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: fmstatic.hxx,v $
- * $Revision: 1.6 $
- *
- * 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 _FM_STATIC_HXX_
-#define _FM_STATIC_HXX_
-#include <tools/string.hxx>
-
-struct ConstAsciiString
-{
- const sal_Char* ascii;
- sal_Int32 length;
-
- inline operator const ::rtl::OUString () const;
- inline operator const sal_Char* () const { return ascii; }
-
- inline ConstAsciiString(const sal_Char* _pAsciiZeroTerminated, const sal_Int32 _nLength);
- inline ~ConstAsciiString();
-
-private:
- mutable ::rtl::OUString* ustring;
-};
-
-//------------------------------------------------------------
-inline ConstAsciiString::ConstAsciiString(const sal_Char* _pAsciiZeroTerminated, const sal_Int32 _nLength)
- :ascii(_pAsciiZeroTerminated)
- ,length(_nLength)
- ,ustring(NULL)
-{
-}
-
-//------------------------------------------------------------
-inline ConstAsciiString::~ConstAsciiString()
-{
- delete ustring;
- ustring = NULL;
-}
-
-//------------------------------------------------------------
-inline ConstAsciiString::operator const ::rtl::OUString () const
-{
- if (!ustring)
- ustring = new ::rtl::OUString(ascii, length, RTL_TEXTENCODING_ASCII_US);
- return *ustring;
-}
-
-#define DECLARE_CONSTASCII_USTRING(name) \
- extern ConstAsciiString name
-
-#define IMPLEMENT_CONSTASCII_USTRING(name, asciivalue) \
- ConstAsciiString name(asciivalue, sizeof(asciivalue) - 1)
-
-
-#endif // _FM_STATIC_HXX_
-
diff --git a/svx/source/inc/fmtools.hxx b/svx/source/inc/fmtools.hxx
index 44495a1002e9..935e84c6448e 100644
--- a/svx/source/inc/fmtools.hxx
+++ b/svx/source/inc/fmtools.hxx
@@ -96,7 +96,8 @@
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/component.hxx>
-#include "fmstatic.hxx"
+
+#include <svx/svxdllapi.h>
#include <set>
@@ -109,19 +110,12 @@ class Window;
// display info about a simple ::com::sun::star::sdbc::SQLException
void displayException(const ::com::sun::star::sdbc::SQLException&, Window* _pParent = NULL);
void displayException(const ::com::sun::star::sdbc::SQLWarning&, Window* _pParent = NULL);
-void displayException(const ::com::sun::star::sdb::SQLContext&, Window* _pParent = NULL);
+SVX_DLLPUBLIC void displayException(const ::com::sun::star::sdb::SQLContext&, Window* _pParent = NULL);
void displayException(const ::com::sun::star::sdb::SQLErrorEvent&, Window* _pParent = NULL);
void displayException(const ::com::sun::star::uno::Any&, Window* _pParent = NULL);
-// StringConversion
-namespace svxform
-{
- // modes for the XModeSelector
- DECLARE_CONSTASCII_USTRING(DATA_MODE);
- DECLARE_CONSTASCII_USTRING(FILTER_MODE);
-
-} // namespace svxform
-
+#define DATA_MODE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataMode" ) )
+#define FILTER_MODE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterMode" ) )
// Kopieren von Persistenten Objecten
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> cloneUsingProperties(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XPersistObject>& _xObj);
@@ -139,7 +133,7 @@ String getFormComponentAccessPath(const ::com::sun::star::uno::Reference< ::com:
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel> getXModel(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xIface);
-::rtl::OUString getLabelName(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xControlModel);
+SVX_DLLPUBLIC ::rtl::OUString getLabelName(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xControlModel);
// ===================================================================================================
// = class CursorWrapper - eine Hilfsklasse, die parallel mit je einem ::com::sun::star::uno::Reference<XDatabaseUpdateCursor>,
@@ -159,7 +153,7 @@ public:
// Construction/Destruction
CursorWrapper() { }
CursorWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxCursor, sal_Bool bUseCloned = sal_False);
- CursorWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _rxCursor, sal_Bool bUseCloned = sal_False);
+ SVX_DLLPUBLIC CursorWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _rxCursor, sal_Bool bUseCloned = sal_False);
// bei bUseCloned == sal_True wird der Cursor ueber das XCloneable-Interface (dass er besitzen muss) gedoubled und
// erst dann benutzt
diff --git a/svx/source/inc/fmurl.hxx b/svx/source/inc/fmurl.hxx
index 3f90948620da..21030d294a10 100644
--- a/svx/source/inc/fmurl.hxx
+++ b/svx/source/inc/fmurl.hxx
@@ -31,46 +31,33 @@
#ifndef _SVX_FMURL_HXX
#define _SVX_FMURL_HXX
-#include "fmstatic.hxx"
-
-namespace svxform
-{
-
- DECLARE_CONSTASCII_USTRING(FMURL_FORMSLOTS_PREFIX);
-
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_POSITION);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_RECORDCOUNT);
- DECLARE_CONSTASCII_USTRING(FMURL_RECORD_MOVEFIRST);
- DECLARE_CONSTASCII_USTRING(FMURL_RECORD_MOVEPREV);
- DECLARE_CONSTASCII_USTRING(FMURL_RECORD_MOVENEXT);
- DECLARE_CONSTASCII_USTRING(FMURL_RECORD_MOVELAST);
- DECLARE_CONSTASCII_USTRING(FMURL_RECORD_MOVETONEW);
- DECLARE_CONSTASCII_USTRING(FMURL_RECORD_UNDO);
- DECLARE_CONSTASCII_USTRING(FMURL_RECORD_SAVE);
- DECLARE_CONSTASCII_USTRING(FMURL_RECORD_DELETE);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_REFRESH);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_REFRESH_CURRENT_CONTROL);
-
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_SORT_UP);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_SORT_DOWN);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_SORT);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_AUTO_FILTER);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_FILTER);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_APPLY_FILTER);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_REMOVE_FILTER);
-
- DECLARE_CONSTASCII_USTRING(FMURL_CONFIRM_DELETION);
-
- DECLARE_CONSTASCII_USTRING(FMURL_COMPONENT_FORMGRIDVIEW);
- DECLARE_CONSTASCII_USTRING(FMURL_GRIDVIEW_CLEARVIEW);
- DECLARE_CONSTASCII_USTRING(FMURL_GRIDVIEW_ADDCOLUMN);
- DECLARE_CONSTASCII_USTRING(FMURL_GRIDVIEW_ATTACHTOFORM);
-
- DECLARE_CONSTASCII_USTRING(FMARG_ATTACHTO_MASTERFORM);
- DECLARE_CONSTASCII_USTRING(FMARG_ADDCOL_COLUMNTYPE);
- DECLARE_CONSTASCII_USTRING(FMARG_ADDCOL_COLUMNPOS);
-
-} // namespace svxform
+#define FMURL_FORMSLOTS_PREFIX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/" ) )
+#define FMURL_FORM_POSITION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/positionForm" ) )
+#define FMURL_FORM_RECORDCOUNT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/RecordCount" ) )
+#define FMURL_RECORD_MOVEFIRST rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/moveToFirst" ) )
+#define FMURL_RECORD_MOVEPREV rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/moveToPrev" ) )
+#define FMURL_RECORD_MOVENEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/moveToNext" ) )
+#define FMURL_RECORD_MOVELAST rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/moveToLast" ) )
+#define FMURL_RECORD_MOVETONEW rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/moveToNew" ) )
+#define FMURL_RECORD_UNDO rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/undoRecord" ) )
+#define FMURL_RECORD_SAVE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/saveRecord" ) )
+#define FMURL_RECORD_DELETE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/deleteRecord" ) )
+#define FMURL_FORM_REFRESH rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/refreshForm" ) )
+#define FMURL_FORM_REFRESH_CURRENT_CONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/refreshCurrentControl" ) )
+#define FMURL_FORM_SORT_UP rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/sortUp" ) )
+#define FMURL_FORM_SORT_DOWN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/sortDown" ) )
+#define FMURL_FORM_SORT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/sort" ) )
+#define FMURL_FORM_AUTO_FILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/autoFilter" ) )
+#define FMURL_FORM_FILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/filter" ) )
+#define FMURL_FORM_APPLY_FILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/applyFilter" ) )
+#define FMURL_FORM_REMOVE_FILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/removeFilterOrder" ) )
+#define FMURL_CONFIRM_DELETION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormSlots/ConfirmDeletion" ) )
+#define FMURL_COMPONENT_FORMGRIDVIEW rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".component:DB/FormGridView" ) )
+#define FMURL_GRIDVIEW_CLEARVIEW rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormSlots/ClearView" ) )
+#define FMURL_GRIDVIEW_ADDCOLUMN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormSlots/AddGridColumn" ) )
+#define FMURL_GRIDVIEW_ATTACHTOFORM rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormSlots/AttachToForm" ) )
+#define FMARG_ATTACHTO_MASTERFORM rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MasterForm" ) )
+#define FMARG_ADDCOL_COLUMNTYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColumnType" ) )
+#define FMARG_ADDCOL_COLUMNPOS rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColumnPosition" ) )
#endif // _SVX_FMURL_HXX
-
diff --git a/svx/source/inc/formcontrolfactory.hxx b/svx/source/inc/formcontrolfactory.hxx
index 2868308d6f7c..432ad25bdea0 100644
--- a/svx/source/inc/formcontrolfactory.hxx
+++ b/svx/source/inc/formcontrolfactory.hxx
@@ -37,6 +37,8 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/util/XNumberFormats.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
/** === end UNO includes === **/
#include <memory>
@@ -94,6 +96,21 @@ namespace svxform
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats >& _rxNumberFormats
);
+ static ::rtl::OUString getDefaultName(
+ const sal_Int16 nClassId,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo >& _rxObject
+ );
+
+ static ::rtl::OUString getDefaultUniqueName_ByComponentType(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxContainer,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject
+ );
+
+ static ::rtl::OUString getUniqueName(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxContainer,
+ const ::rtl::OUString& _rBaseName
+ );
+
private:
::std::auto_ptr< FormControlFactory_Data > m_pData;
};
diff --git a/svx/source/inc/formtoolbars.hxx b/svx/source/inc/formtoolbars.hxx
index 5e8eae756b89..2090b7e6b667 100644
--- a/svx/source/inc/formtoolbars.hxx
+++ b/svx/source/inc/formtoolbars.hxx
@@ -31,14 +31,13 @@
#ifndef SVX_SOURCE_INC_FORMTOOLBARS_HXX
#define SVX_SOURCE_INC_FORMTOOLBARS_HXX
-/** === begin UNO includes === **/
-/** === end UNO includes === **/
-
#include "fmdocumentclassification.hxx"
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <tools/solar.h>
+#include <svx/svxdllapi.h>
+
//........................................................................
namespace svxform
{
@@ -58,7 +57,7 @@ namespace svxform
@param _rxFrame
the frame to analyze
*/
- FormToolboxes(
+ SVX_DLLPUBLIC FormToolboxes(
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame
);
@@ -66,16 +65,16 @@ namespace svxform
/** retrieves the URI for the toolbox associated with the given slot, depending
on the type of our document
*/
- ::rtl::OUString
+ SVX_DLLPUBLIC ::rtl::OUString
getToolboxResourceName( USHORT _nSlotId ) const;
/** toggles the toolbox associated with the given slot
*/
- void toggleToolbox( USHORT _nSlotId ) const;
+ SVX_DLLPUBLIC void toggleToolbox( USHORT _nSlotId ) const;
/** determines whether the toolbox associated with the given slot is currently visible
*/
- bool isToolboxVisible( USHORT _nSlotId ) const;
+ SVX_DLLPUBLIC bool isToolboxVisible( USHORT _nSlotId ) const;
/** ensures that a given toolbox is visible
*/
diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx
index 6a552da6edb7..cb747e3a894c 100644
--- a/svx/source/inc/gridcell.hxx
+++ b/svx/source/inc/gridcell.hxx
@@ -42,20 +42,24 @@
#include <com/sun/star/form/XBoundControl.hpp>
#include <com/sun/star/awt/XTextComponent.hpp>
#include <com/sun/star/awt/XListBox.hpp>
+#include <com/sun/star/awt/XComboBox.hpp>
#include <com/sun/star/awt/TextAlign.hpp>
#include <com/sun/star/awt/XControlModel.hpp>
#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/awt/XCheckBox.hpp>
+#include <com/sun/star/awt/XButton.hpp>
#include <com/sun/star/beans/XFastPropertySet.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/form/XChangeBroadcaster.hpp>
/** === end UNO includes === **/
-#include <tools/rtti.hxx>
-
#include <comphelper/propmultiplex.hxx>
#include <comphelper/componentcontext.hxx>
-
#include <cppuhelper/component.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <tools/diagnose_ex.h>
+#include <tools/rtti.hxx>
class DbCellControl;
class Edit;
@@ -282,7 +286,11 @@ public:
virtual ~DbCellControl();
- Window* GetControl() const { return m_pWindow; }
+ Window& GetWindow() const
+ {
+ ENSURE_OR_THROW( m_pWindow, "no window" );
+ return *m_pWindow;
+ }
// control alignment
inline sal_Bool isAlignedController() const { return m_bAlignedController; }
@@ -732,20 +740,34 @@ protected:
//==================================================================
// Base class providing the access to a grid cell
//==================================================================
-class FmXGridCell : public ::cppu::OComponentHelper,
- public ::com::sun::star::awt::XControl,
- public ::com::sun::star::form::XBoundControl
+typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::XControl
+ , ::com::sun::star::form::XBoundControl
+ > FmXGridCell_Base;
+typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XWindow
+ > FmXGridCell_WindowBase;
+class FmXGridCell :public ::cppu::OComponentHelper
+ ,public FmXGridCell_Base
+ ,public FmXGridCell_WindowBase
{
protected:
- ::osl::Mutex m_aMutex;
- DbGridColumn* m_pColumn;
- DbCellControl* m_pCellControl;
+ ::osl::Mutex m_aMutex;
+ DbGridColumn* m_pColumn;
+ DbCellControl* m_pCellControl;
+
+private:
+ ::cppu::OInterfaceContainerHelper m_aWindowListeners;
+ ::cppu::OInterfaceContainerHelper m_aFocusListeners;
+ ::cppu::OInterfaceContainerHelper m_aKeyListeners;
+ ::cppu::OInterfaceContainerHelper m_aMouseListeners;
+ ::cppu::OInterfaceContainerHelper m_aMouseMotionListeners;
+protected:
virtual ~FmXGridCell();
+
public:
TYPEINFO();
- FmXGridCell(DbGridColumn* pColumn, DbCellControl* pControl);
-
+ FmXGridCell( DbGridColumn* pColumn, DbCellControl* pControl );
+ void init();
DECLARE_UNO3_AGG_DEFAULTS(FmXGridCell, OComponentHelper);
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException);
@@ -754,6 +776,7 @@ public:
void SetTextLineColor(const Color& _rColor);
// 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);
// OComponentHelper
@@ -781,6 +804,25 @@ public:
virtual sal_Bool SAL_CALL getLock() throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setLock(sal_Bool _bLock) throw(::com::sun::star::uno::RuntimeException);
+ // XWindow
+ virtual void SAL_CALL setPosSize( ::sal_Int32 X, ::sal_Int32 Y, ::sal_Int32 Width, ::sal_Int32 Height, ::sal_Int16 Flags ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Rectangle SAL_CALL getPosSize( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( ::sal_Bool Visible ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setEnable( ::sal_Bool Enable ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFocus( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
sal_Bool Commit() {return m_pCellControl->Commit();}
void ImplInitWindow( Window& rParent, const InitWindowFacet _eInitWhat )
{ m_pCellControl->ImplInitWindow( rParent, _eInitWhat ); }
@@ -788,6 +830,17 @@ public:
sal_Bool isAlignedController() const { return m_pCellControl->isAlignedController(); }
void AlignControl(sal_Int16 nAlignment)
{ m_pCellControl->AlignControl(nAlignment);}
+
+protected:
+ virtual Window* getEventWindow() const;
+ virtual void onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData );
+
+ // default implementations call our focus listeners, don't forget to call them if you override this
+ virtual void onFocusGained( const ::com::sun::star::awt::FocusEvent& _rEvent );
+ virtual void onFocusLost( const ::com::sun::star::awt::FocusEvent& _rEvent );
+
+private:
+ DECL_LINK( OnWindowEvent, VclWindowEvent* );
};
//==================================================================
@@ -795,7 +848,10 @@ class FmXDataCell : public FmXGridCell
{
public:
TYPEINFO();
- FmXDataCell(DbGridColumn* pColumn, DbCellControl* pControl):FmXGridCell(pColumn, pControl){}
+ FmXDataCell( DbGridColumn* pColumn, DbCellControl& _rControl )
+ :FmXGridCell( pColumn, &_rControl )
+ {
+ }
virtual void PaintFieldToCell(OutputDevice& rDev,
const Rectangle& rRect,
@@ -831,11 +887,7 @@ protected:
public:
TYPEINFO();
- FmXTextCell( DbGridColumn* pColumn, DbCellControl* pControl )
- :FmXDataCell( pColumn, pControl )
- ,m_bFastPaint( sal_True )
- {
- }
+ FmXTextCell( DbGridColumn* pColumn, DbCellControl& _rControl );
virtual void PaintFieldToCell(OutputDevice& rDev,
const Rectangle& rRect,
@@ -849,23 +901,31 @@ public:
};
//==================================================================
+typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::XTextComponent
+ , ::com::sun::star::form::XChangeBroadcaster
+ > FmXEditCell_Base;
class FmXEditCell : public FmXTextCell,
- public ::com::sun::star::awt::XTextComponent
+ public FmXEditCell_Base
{
+private:
+ ::rtl::OUString m_sValueOnEnter;
+
protected:
::cppu::OInterfaceContainerHelper m_aTextListeners;
+ ::cppu::OInterfaceContainerHelper m_aChangeListeners;
::svt::IEditImplementation* m_pEditImplementation;
bool m_bOwnEditImplementation;
virtual ~FmXEditCell();
public:
- FmXEditCell(DbGridColumn* pColumn, DbCellControl* pControl);
+ FmXEditCell( DbGridColumn* pColumn, DbCellControl& _rControl );
DECLARE_UNO3_AGG_DEFAULTS(FmXEditCell, FmXTextCell);
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException);
// 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);
// OComponentHelper
virtual void SAL_CALL disposing();
@@ -884,26 +944,43 @@ public:
virtual void SAL_CALL setMaxTextLen(sal_Int16 nLen) throw(::com::sun::star::uno::RuntimeException);
virtual sal_Int16 SAL_CALL getMaxTextLen() throw(::com::sun::star::uno::RuntimeException);
+ // XChangeBroadcaster
+ virtual void SAL_CALL addChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XChangeListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XChangeListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+
protected:
- DECL_LINK( OnTextChanged, void* );
+ virtual void onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData );
+
+ virtual void onFocusGained( const ::com::sun::star::awt::FocusEvent& _rEvent );
+ virtual void onFocusLost( const ::com::sun::star::awt::FocusEvent& _rEvent );
+
+private:
+ void onTextChanged();
};
//==================================================================
+typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::XCheckBox
+ , ::com::sun::star::awt::XButton
+ > FmXCheckBoxCell_Base;
class FmXCheckBoxCell : public FmXDataCell,
- public ::com::sun::star::awt::XCheckBox
+ public FmXCheckBoxCell_Base
{
::cppu::OInterfaceContainerHelper m_aItemListeners;
+ ::cppu::OInterfaceContainerHelper m_aActionListeners;
+ ::rtl::OUString m_aActionCommand;
CheckBox* m_pBox;
+
protected:
virtual ~FmXCheckBoxCell();
-public:
- FmXCheckBoxCell(DbGridColumn* pColumn, DbCellControl* pControl);
+public:
+ FmXCheckBoxCell( DbGridColumn* pColumn, DbCellControl& _rControl );
// UNO
DECLARE_UNO3_AGG_DEFAULTS(FmXCheckBoxCell, FmXDataCell);
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException);
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);
// OComponentHelper
virtual void SAL_CALL disposing();
@@ -916,26 +993,37 @@ public:
virtual void SAL_CALL setLabel(const ::rtl::OUString& Label) throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL enableTriState(sal_Bool b) throw(::com::sun::star::uno::RuntimeException);
+ // XButton
+ virtual void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw (::com::sun::star::uno::RuntimeException);
+ //virtual void SAL_CALL setLabel( const ::rtl::OUString& Label ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setActionCommand( const ::rtl::OUString& Command ) throw (::com::sun::star::uno::RuntimeException);
+
protected:
- DECL_LINK( OnClick, void* );
+ virtual Window* getEventWindow() const;
+ virtual void onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData );
};
//==================================================================
-class FmXListBoxCell : public FmXTextCell,
- public ::com::sun::star::awt::XListBox
+typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XListBox
+ > FmXListBoxCell_Base;
+class FmXListBoxCell :public FmXTextCell
+ ,public FmXListBoxCell_Base
{
::cppu::OInterfaceContainerHelper m_aItemListeners,
m_aActionListeners;
ListBox* m_pBox;
+
protected:
virtual ~FmXListBoxCell();
-public:
- FmXListBoxCell(DbGridColumn* pColumn, DbCellControl* pControl);
+public:
+ FmXListBoxCell( DbGridColumn* pColumn, DbCellControl& _rControl );
DECLARE_UNO3_AGG_DEFAULTS(FmXListBoxCell, FmXTextCell);
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException);
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);
// OComponentHelper
virtual void SAL_CALL disposing();
@@ -965,14 +1053,60 @@ public:
virtual void SAL_CALL SAL_CALL makeVisible(sal_Int16 nEntry) throw(::com::sun::star::uno::RuntimeException);
protected:
- DECL_LINK( OnSelect, VclWindowEvent* );
+ virtual void onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData );
+
DECL_LINK( OnDoubleClick, void* );
};
//==================================================================
+typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XComboBox
+ > FmXComboBoxCell_Base;
+class FmXComboBoxCell :public FmXTextCell
+ ,public FmXComboBoxCell_Base
+{
+private:
+ ::cppu::OInterfaceContainerHelper m_aItemListeners,
+ m_aActionListeners;
+ ComboBox* m_pComboBox;
+
+protected:
+ virtual ~FmXComboBoxCell();
+
+public:
+ FmXComboBoxCell( DbGridColumn* pColumn, DbCellControl& _rControl );
+
+ DECLARE_UNO3_AGG_DEFAULTS(FmXListBoxCell, FmXTextCell);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException);
+ 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);
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing();
+
+ // XComboBox
+ virtual void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& _Listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& _Listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& _Listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& _Listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addItem( const ::rtl::OUString& _Item, ::sal_Int16 _Pos ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addItems( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _Items, ::sal_Int16 _Pos ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeItems( ::sal_Int16 nPos, ::sal_Int16 nCount ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getItemCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getItem( ::sal_Int16 _Pos ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getItems( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getDropDownLineCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDropDownLineCount( ::sal_Int16 _Lines ) throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ virtual void onWindowEvent( const ULONG _nEventId, const Window& _rWindow, const void* _pEventData );
+};
+
+//==================================================================
+typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::XTextComponent
+ , ::com::sun::star::lang::XUnoTunnel
+ > FmXFilterCell_Base;
class FmXFilterCell :public FmXGridCell
- ,public ::com::sun::star::awt::XTextComponent
- ,public ::com::sun::star::lang::XUnoTunnel
+ ,public FmXFilterCell_Base
{
::cppu::OInterfaceContainerHelper m_aTextListeners;
protected:
@@ -985,6 +1119,7 @@ public:
DECLARE_UNO3_AGG_DEFAULTS(FmXFilterCell, FmXGridCell);
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException);
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);
// XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/svx/source/inc/gridcols.hxx b/svx/source/inc/gridcols.hxx
index a68e28270591..3b4c3582f314 100644
--- a/svx/source/inc/gridcols.hxx
+++ b/svx/source/inc/gridcols.hxx
@@ -30,25 +30,20 @@
#ifndef _SVX_GRIDCOLS_HXX
#define _SVX_GRIDCOLS_HXX
-#include "fmstatic.hxx"
+#include <sal/types.h>
-namespace svxform
-{
-
- // list of possible controls
- DECLARE_CONSTASCII_USTRING(FM_COL_TEXTFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COL_CHECKBOX);
- DECLARE_CONSTASCII_USTRING(FM_COL_COMBOBOX);
- DECLARE_CONSTASCII_USTRING(FM_COL_LISTBOX);
- DECLARE_CONSTASCII_USTRING(FM_COL_NUMERICFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COL_DATEFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COL_TIMEFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COL_CURRENCYFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COL_PATTERNFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COL_FORMATTEDFIELD);
-
-} // namespace svxform
+namespace rtl { class OUString; }
+#define FM_COL_TEXTFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextField" ) )
+#define FM_COL_COMBOBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ComboBox" ) )
+#define FM_COL_CHECKBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CheckBox" ) )
+#define FM_COL_TIMEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TimeField" ) )
+#define FM_COL_DATEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateField" ) )
+#define FM_COL_NUMERICFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NumericField" ) )
+#define FM_COL_CURRENCYFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CurrencyField" ) )
+#define FM_COL_PATTERNFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PatternField" ) )
+#define FM_COL_LISTBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ListBox" ) )
+#define FM_COL_FORMATTEDFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FormattedField" ) )
// column type ids
#define TYPE_CHECKBOX 0
diff --git a/svx/source/inc/sqlparserclient.hxx b/svx/source/inc/sqlparserclient.hxx
index 2f7e43073b8b..65f96cf80523 100644
--- a/svx/source/inc/sqlparserclient.hxx
+++ b/svx/source/inc/sqlparserclient.hxx
@@ -31,7 +31,7 @@
#ifndef SVX_SQLPARSERCLIENT_HXX
#define SVX_SQLPARSERCLIENT_HXX
-#include "dbtoolsclient.hxx"
+#include "svx/dbtoolsclient.hxx"
#include "ParseContext.hxx"
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -43,7 +43,7 @@ namespace svxform
//====================================================================
//= OSQLParserClient
//====================================================================
- class OSQLParserClient : public ODbtoolsClient
+ class SVX_DLLPUBLIC OSQLParserClient : public ODbtoolsClient
,public ::svxform::OParseContextClient
{
private:
diff --git a/svx/source/inc/stringlistresource.hxx b/svx/source/inc/stringlistresource.hxx
index 496993f7fbe1..76c7d1c92df7 100644
--- a/svx/source/inc/stringlistresource.hxx
+++ b/svx/source/inc/stringlistresource.hxx
@@ -31,11 +31,10 @@
#ifndef SVX_STRINGLISTRESOURCE_HXX
#define SVX_STRINGLISTRESOURCE_HXX
-/** === begin UNO includes === **/
-/** === end UNO includes === **/
-
#include <tools/rc.hxx>
+#include <svx/svxdllapi.h>
+
#include <memory>
//........................................................................
@@ -52,8 +51,8 @@ namespace svx
class StringListResource : public Resource
{
public:
- StringListResource( const ResId& _rResId );
- ~StringListResource();
+ SVX_DLLPUBLIC StringListResource( const ResId& _rResId );
+ SVX_DLLPUBLIC ~StringListResource();
inline void get( ::std::vector< String >& _rStrings )
{
diff --git a/svx/source/inc/tabwin.hxx b/svx/source/inc/tabwin.hxx
index e83e0c0f80bd..be46c05a58d5 100644
--- a/svx/source/inc/tabwin.hxx
+++ b/svx/source/inc/tabwin.hxx
@@ -42,7 +42,7 @@
//#endif
#include <comphelper/propmultiplex.hxx>
#include <svtools/transfer.hxx>
-#include "dbtoolsclient.hxx"
+#include "svx/dbtoolsclient.hxx"
//==================================================================
class FmFieldWin;
diff --git a/svx/source/inc/typeconversionclient.hxx b/svx/source/inc/typeconversionclient.hxx
index 947cc4eddd07..2cfaaabe5173 100644
--- a/svx/source/inc/typeconversionclient.hxx
+++ b/svx/source/inc/typeconversionclient.hxx
@@ -31,7 +31,7 @@
#ifndef SVX_TYPECONVERSION_CLIENT_HXX
#define SVX_TYPECONVERSION_CLIENT_HXX
-#include "dbtoolsclient.hxx"
+#include "svx/dbtoolsclient.hxx"
//........................................................................
namespace svxform
diff --git a/svx/source/inc/unoedprx.hxx b/svx/source/inc/unoedprx.hxx
index 070367f26dd9..4758b17dd621 100644
--- a/svx/source/inc/unoedprx.hxx
+++ b/svx/source/inc/unoedprx.hxx
@@ -79,6 +79,9 @@ public:
virtual sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const;
virtual USHORT GetLineCount( USHORT nPara ) const;
virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const;
+ virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const;
+ virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
+
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( BOOL bFull=FALSE );
@@ -118,12 +121,13 @@ public:
SvxAccessibleTextEditViewAdapter();
virtual ~SvxAccessibleTextEditViewAdapter();
+ // SvxViewForwarder interface
virtual BOOL IsValid() const;
-
virtual Rectangle GetVisArea() const;
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const;
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const;
+ // SvxEditViewForwarder interface
virtual sal_Bool GetSelection( ESelection& rSelection ) const;
virtual sal_Bool SetSelection( const ESelection& rSelection );
virtual sal_Bool Copy();
diff --git a/svx/source/inc/unogalthemeprovider.hxx b/svx/source/inc/unogalthemeprovider.hxx
index dd8391e89c12..555e7f380ab3 100644
--- a/svx/source/inc/unogalthemeprovider.hxx
+++ b/svx/source/inc/unogalthemeprovider.hxx
@@ -36,6 +36,8 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/gallery/XGalleryThemeProvider.hpp>
+#include <svx/svxdllapi.h>
+
class Gallery;
namespace unogallery {
@@ -60,8 +62,8 @@ public:
GalleryThemeProvider();
~GalleryThemeProvider();
- static ::rtl::OUString getImplementationName_Static() throw();
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw();
+ SVX_DLLPUBLIC static ::rtl::OUString getImplementationName_Static() throw();
+ SVX_DLLPUBLIC static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw();
protected:
diff --git a/svx/source/inc/unopolyhelper.hxx b/svx/source/inc/unopolyhelper.hxx
index 8b299aa9ddb9..373b6ecc0f4a 100644
--- a/svx/source/inc/unopolyhelper.hxx
+++ b/svx/source/inc/unopolyhelper.hxx
@@ -33,6 +33,8 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <svx/svxdllapi.h>
+
namespace com { namespace sun { namespace star { namespace drawing {
struct PolyPolygonBezierCoords;
} } } }
@@ -48,7 +50,7 @@ basegfx::B2DPolyPolygon SvxConvertPolyPolygonBezierToB2DPolyPolygon( const com::
/** convert a B2DPolyPolygon to a drawing::PolyPolygonBezierCoords
*/
-void SvxConvertB2DPolyPolygonToPolyPolygonBezier( const basegfx::B2DPolyPolygon& rPolyPoly, com::sun::star::drawing::PolyPolygonBezierCoords& rRetval );
+SVX_DLLPUBLIC void SvxConvertB2DPolyPolygonToPolyPolygonBezier( const basegfx::B2DPolyPolygon& rPolyPoly, com::sun::star::drawing::PolyPolygonBezierCoords& rRetval );
#endif
diff --git a/svx/source/intro/intro_tmpl.hrc b/svx/source/intro/intro_tmpl.hrc
index 0f1b36e0c9f6..ad3a628213be 100644
--- a/svx/source/intro/intro_tmpl.hrc
+++ b/svx/source/intro/intro_tmpl.hrc
@@ -269,9 +269,9 @@ ItemList = \
< "Darin Fisher" ; > ; \
< "Nicole M. Follet-Dunn" ; > ; \
< "Kenneth Foskey" ; > ; \
- < "Peter Frandsen" ; > ; \
< "Duncan Foster" ; > ; \
< "Tim Foster" ; > ; \
+ < "Peter Frandsen" ; > ; \
< "Gary Frederick" ; > ; \
< "Nils Fuhrmann" ; > ; \
< "Jan Funken" ; > ; \
diff --git a/svx/source/items/algitem.cxx b/svx/source/items/algitem.cxx
index c291c9b1be69..447d11f6d6ea 100644
--- a/svx/source/items/algitem.cxx
+++ b/svx/source/items/algitem.cxx
@@ -45,6 +45,7 @@
#include <com/sun/star/table/TableOrientation.hpp>
#include <com/sun/star/table/CellHoriJustify.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
+#include "com/sun/star/style/VerticalAlignment.hpp"
#include <com/sun/star/util/SortField.hpp>
#include <com/sun/star/util/SortFieldType.hpp>
#include <com/sun/star/table/CellOrientation.hpp>
@@ -275,42 +276,89 @@ SfxItemPresentation SvxVerJustifyItem::GetPresentation
//------------------------------------------------------------------------
-sal_Bool SvxVerJustifyItem::QueryValue( uno::Any& rVal, BYTE /*nMemberId*/ ) const
+sal_Bool SvxVerJustifyItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
{
- table::CellVertJustify eUno = table::CellVertJustify_STANDARD;
- switch ( (SvxCellVerJustify)GetValue() )
+ nMemberId &= ~CONVERT_TWIPS;
+ switch ( nMemberId )
{
- case SVX_VER_JUSTIFY_STANDARD: eUno = table::CellVertJustify_STANDARD; break;
- case SVX_VER_JUSTIFY_TOP: eUno = table::CellVertJustify_TOP; break;
- case SVX_VER_JUSTIFY_CENTER: eUno = table::CellVertJustify_CENTER; break;
- case SVX_VER_JUSTIFY_BOTTOM: eUno = table::CellVertJustify_BOTTOM; break;
- default: ; //prevent warning
+ case MID_HORJUST_ADJUST:
+ {
+ style::VerticalAlignment eUno = style::VerticalAlignment_TOP;
+ switch ( (SvxCellVerJustify)GetValue() )
+ {
+ case SVX_VER_JUSTIFY_TOP: eUno = style::VerticalAlignment_TOP; break;
+ case SVX_VER_JUSTIFY_CENTER: eUno = style::VerticalAlignment_MIDDLE; break;
+ case SVX_VER_JUSTIFY_BOTTOM: eUno = style::VerticalAlignment_BOTTOM; break;
+ default: ; //prevent warning
+ }
+ rVal <<= eUno;
+ break;
+ }
+ default:
+ {
+ table::CellVertJustify eUno = table::CellVertJustify_STANDARD;
+ switch ( (SvxCellVerJustify)GetValue() )
+ {
+ case SVX_VER_JUSTIFY_STANDARD: eUno = table::CellVertJustify_STANDARD; break;
+ case SVX_VER_JUSTIFY_TOP: eUno = table::CellVertJustify_TOP; break;
+ case SVX_VER_JUSTIFY_CENTER: eUno = table::CellVertJustify_CENTER; break;
+ case SVX_VER_JUSTIFY_BOTTOM: eUno = table::CellVertJustify_BOTTOM; break;
+ default: ; //prevent warning
+ }
+ rVal <<= eUno;
+ break;
+ }
}
- rVal <<= eUno;
return sal_True;
}
-sal_Bool SvxVerJustifyItem::PutValue( const uno::Any& rVal, BYTE /*nMemberId*/ )
+sal_Bool SvxVerJustifyItem::PutValue( const uno::Any& rVal, BYTE nMemberId )
{
- table::CellVertJustify eUno;
- if(!(rVal >>= eUno))
+ nMemberId &= ~CONVERT_TWIPS;
+ switch ( nMemberId )
{
- sal_Int32 nValue = 0;
- if(!(rVal >>= nValue))
- return sal_False;
- eUno = (table::CellVertJustify)nValue;
- }
+ case MID_HORJUST_ADJUST:
+ {
+ // property contains ParagraphAdjust values as sal_Int16
+ style::VerticalAlignment nVal = style::VerticalAlignment_TOP;
+ if(!(rVal >>= nVal))
+ return sal_False;
- SvxCellVerJustify eSvx = SVX_VER_JUSTIFY_STANDARD;
- switch (eUno)
- {
- case table::CellVertJustify_STANDARD: eSvx = SVX_VER_JUSTIFY_STANDARD; break;
- case table::CellVertJustify_TOP: eSvx = SVX_VER_JUSTIFY_TOP; break;
- case table::CellVertJustify_CENTER: eSvx = SVX_VER_JUSTIFY_CENTER; break;
- case table::CellVertJustify_BOTTOM: eSvx = SVX_VER_JUSTIFY_BOTTOM; break;
- default: ; //prevent warning
+ SvxCellVerJustify eSvx = SVX_VER_JUSTIFY_STANDARD;
+ switch (nVal)
+ {
+ case style::VerticalAlignment_TOP: eSvx = SVX_VER_JUSTIFY_TOP; break;
+ case style::VerticalAlignment_MIDDLE: eSvx = SVX_VER_JUSTIFY_CENTER; break;
+ case style::VerticalAlignment_BOTTOM: eSvx = SVX_VER_JUSTIFY_BOTTOM; break;
+ default:;
+ }
+ SetValue( (USHORT)eSvx );
+ break;
+ }
+ default:
+ {
+ table::CellVertJustify eUno;
+ if(!(rVal >>= eUno))
+ {
+ sal_Int32 nValue = 0;
+ if(!(rVal >>= nValue))
+ return sal_False;
+ eUno = (table::CellVertJustify)nValue;
+ }
+
+ SvxCellVerJustify eSvx = SVX_VER_JUSTIFY_STANDARD;
+ switch (eUno)
+ {
+ case table::CellVertJustify_STANDARD: eSvx = SVX_VER_JUSTIFY_STANDARD; break;
+ case table::CellVertJustify_TOP: eSvx = SVX_VER_JUSTIFY_TOP; break;
+ case table::CellVertJustify_CENTER: eSvx = SVX_VER_JUSTIFY_CENTER; break;
+ case table::CellVertJustify_BOTTOM: eSvx = SVX_VER_JUSTIFY_BOTTOM; break;
+ default: ; //prevent warning
+ }
+ SetValue( (USHORT)eSvx );
+ break;
+ }
}
- SetValue( (USHORT)eSvx );
return sal_True;
}
diff --git a/svx/source/items/makefile.mk b/svx/source/items/makefile.mk
index c6cae5464735..ef4bf0b00149 100644
--- a/svx/source/items/makefile.mk
+++ b/svx/source/items/makefile.mk
@@ -38,6 +38,7 @@ PROJECTPCHSOURCE=$(PRJ)$/util$/svxpch
PRJNAME=svx
TARGET=items
+LIBTARGET=NO
# --- Settings -----------------------------------------------------
@@ -51,41 +52,45 @@ SRC1FILES = \
svxerr.src \
svxitems.src
-SLOFILES= \
- $(SLO)$/ofaitem.obj \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/writingmodeitem.obj \
$(SLO)$/frmitems.obj \
$(SLO)$/paraitem.obj \
$(SLO)$/textitem.obj \
- $(SLO)$/postattr.obj \
$(SLO)$/flditem.obj \
- $(SLO)$/hlnkitem.obj \
$(SLO)$/svxfont.obj \
- $(SLO)$/pageitem.obj \
- $(SLO)$/viewlayoutitem.obj \
- $(SLO)$/paperinf.obj \
+ $(SLO)$/paperinf.obj \
$(SLO)$/drawitem.obj \
- $(SLO)$/algitem.obj \
$(SLO)$/itemtype.obj \
- $(SLO)$/rotmodit.obj \
- $(SLO)$/numinf.obj \
- $(SLO)$/svxerr.obj \
- $(SLO)$/numfmtsh.obj \
- $(SLO)$/zoomitem.obj \
$(SLO)$/chrtitem.obj \
$(SLO)$/bulitem.obj \
$(SLO)$/e3ditem.obj \
$(SLO)$/numitem.obj \
$(SLO)$/grfitem.obj \
$(SLO)$/clipfmtitem.obj \
- $(SLO)$/svxempty.obj \
$(SLO)$/xmlcnitm.obj \
$(SLO)$/customshapeitem.obj \
- $(SLO)$/charhiddenitem.obj \
+ $(SLO)$/charhiddenitem.obj
+
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/ofaitem.obj \
+ $(SLO)$/postattr.obj \
+ $(SLO)$/hlnkitem.obj \
+ $(SLO)$/pageitem.obj \
+ $(SLO)$/viewlayoutitem.obj \
+ $(SLO)$/algitem.obj \
+ $(SLO)$/rotmodit.obj \
+ $(SLO)$/numinf.obj \
+ $(SLO)$/svxerr.obj \
+ $(SLO)$/numfmtsh.obj \
+ $(SLO)$/zoomitem.obj \
+ $(SLO)$/svxempty.obj \
$(SLO)$/SmartTagItem.obj \
$(SLO)$/zoomslideritem.obj \
-
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
EXCEPTIONSFILES= \
$(SLO)$/paraitem.obj \
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index d4dd02f74a3b..ca6333753769 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -45,6 +45,7 @@
#include <svtools/langtab.hxx>
#include <vcl/svapp.hxx>
+#include <comphelper/processfactory.hxx>
#include <svx/numfmtsh.hxx>
// class SvxNumberFormatShell --------------------------------------------
@@ -1523,22 +1524,22 @@ String SvxNumberFormatShell::GetStandardName() const
return pFormatter->GetStandardName( eCurLanguage);
}
-void SvxNumberFormatShell::GetCurrencySymbols(SvStringsDtor& rList,const XubString& rStrEurope, sal_uInt16* pPos)
+void SvxNumberFormatShell::GetCurrencySymbols( SvStringsDtor& rList, sal_uInt16* pPos )
{
const NfCurrencyEntry* pTmpCurrencyEntry=SvNumberFormatter::MatchSystemCurrency();
sal_Bool bFlag=(pTmpCurrencyEntry==NULL);
- GetCurrencySymbols(rList,rStrEurope, bFlag);
+ GetCurrencySymbols( rList, bFlag);
if(pPos!=NULL)
{
const NfCurrencyTable& rCurrencyTable=SvNumberFormatter::GetTheCurrencyTable();
- sal_uInt16 nCount=rCurrencyTable.Count();
+ sal_uInt16 nTableCount=rCurrencyTable.Count();
*pPos=0;
- nCount=aCurCurrencyList.Count();
+ sal_uInt16 nCount=aCurCurrencyList.Count();
if(bFlag)
{
@@ -1549,8 +1550,9 @@ void SvxNumberFormatShell::GetCurrencySymbols(SvStringsDtor& rList,const XubStri
{
for(sal_uInt16 i=1;i<nCount;i++)
{
- if(aCurCurrencyList[i]!=(sal_uInt16)-1 &&
- pTmpCurrencyEntry==rCurrencyTable[aCurCurrencyList[i]])
+ const sal_uInt16 j = aCurCurrencyList[i];
+ if (j != (sal_uInt16)-1 && j < nTableCount &&
+ pTmpCurrencyEntry == rCurrencyTable[j])
{
*pPos=i;
nCurCurrencyEntryPos=i;
@@ -1562,7 +1564,7 @@ void SvxNumberFormatShell::GetCurrencySymbols(SvStringsDtor& rList,const XubStri
}
-void SvxNumberFormatShell::GetCurrencySymbols(SvStringsDtor& rList,const XubString& /*rStrEurope*/, sal_Bool bFlag)
+void SvxNumberFormatShell::GetCurrencySymbols( SvStringsDtor& rList, sal_Bool bFlag )
{
aCurCurrencyList.Remove(0,aCurCurrencyList.Count());
@@ -1574,9 +1576,9 @@ void SvxNumberFormatShell::GetCurrencySymbols(SvStringsDtor& rList,const XubStri
sal_uInt16 nStart=1;
sal_uInt16 i,j;
- XubString aString(rCurrencyTable[0]->GetSymbol());
+ XubString aString( ApplyLreOrRleEmbedding( rCurrencyTable[0]->GetSymbol()));
aString += sal_Unicode(' ');
- aString += pLanguageTable->GetString(rCurrencyTable[0]->GetLanguage());
+ aString += ApplyLreOrRleEmbedding( pLanguageTable->GetString( rCurrencyTable[0]->GetLanguage()));
WSStringPtr pStr = new XubString(aString);
rList.Insert( pStr,rList.Count());
@@ -1591,41 +1593,54 @@ void SvxNumberFormatShell::GetCurrencySymbols(SvStringsDtor& rList,const XubStri
++nStart;
}
- for(i=1;i<nCount;i++)
- {
- XubString _aString(rCurrencyTable[i]->GetSymbol());
- _aString += sal_Unicode(' ');
- _aString += pLanguageTable->GetString(rCurrencyTable[i]->GetLanguage());
+ CollatorWrapper aCollator( ::comphelper::getProcessServiceFactory());
+ aCollator.loadDefaultCollator( Application::GetSettings().GetLocale(), 0);
- pStr = new XubString(_aString);
+ const String aTwoSpace( RTL_CONSTASCII_USTRINGPARAM( " "));
+ for(i=1;i<nCount;i++)
+ {
+ XubString aStr( ApplyLreOrRleEmbedding( rCurrencyTable[i]->GetBankSymbol()));
+ aStr += aTwoSpace;
+ aStr += ApplyLreOrRleEmbedding( rCurrencyTable[i]->GetSymbol());
+ aStr += aTwoSpace;
+ aStr += ApplyLreOrRleEmbedding( pLanguageTable->GetString( rCurrencyTable[i]->GetLanguage()));
+
+ pStr = new XubString(aStr);
+#if 0
+ fprintf( stderr, "currency entry: %s\n", ByteString( *pStr, RTL_TEXTENCODING_UTF8).GetBuffer());
+#endif
for(j=nStart;j<rList.Count();j++)
{
const StringPtr pTestStr=rList[j];
-
- if(*pTestStr>aString) break;
+ if (aCollator.compareString( *pStr, *pTestStr) < 0)
+ break; // insert before first greater than
}
rList.Insert( pStr,j);
aCurCurrencyList.Insert(i,j);
}
+ // Append ISO codes to symbol list.
+ // XXX If this is to be changed, various other places would had to be
+ // adapted that assume this order!
sal_uInt16 nCont = rList.Count();
for(i=1;i<nCount;i++)
{
- sal_Bool bTest=sal_True;
- pStr = new XubString(rCurrencyTable[i]->GetBankSymbol());
+ bool bInsert = true;
+ pStr = new XubString( ApplyLreOrRleEmbedding( rCurrencyTable[i]->GetBankSymbol()));
- for(j=nCont;j<rList.Count();j++)
+ for (j = nCont; j < rList.Count() && bInsert; ++j)
{
const StringPtr pTestStr=rList[j];
if(*pTestStr==*pStr)
- bTest=sal_False;
+ bInsert = false;
else
- if(*pTestStr>*pStr) break;
+ if (aCollator.compareString( *pStr, *pTestStr) < 0)
+ break; // insert before first greater than
}
- if(bTest)
+ if(bInsert)
{
rList.Insert( pStr,j);
aCurCurrencyList.Insert(i,j);
diff --git a/svx/source/items/numitem.cxx b/svx/source/items/numitem.cxx
index 18a9d18fb559..0a9b7786a476 100644
--- a/svx/source/items/numitem.cxx
+++ b/svx/source/items/numitem.cxx
@@ -71,14 +71,9 @@ using namespace ::com::sun::star::style;
sal_Int32 SvxNumberType::nRefCount = 0;
com::sun::star::uno::Reference<com::sun::star::text::XNumberingFormatter> SvxNumberType::xFormatter = 0;
-/* -----------------------------22.02.01 14:24--------------------------------
-
- ---------------------------------------------------------------------------*/
-SvxNumberType::SvxNumberType(sal_Int16 nType) :
- nNumType(nType),
- bShowSymbol(sal_True)
+void lcl_getFormatter(com::sun::star::uno::Reference<com::sun::star::text::XNumberingFormatter>& _xFormatter)
{
- if(!xFormatter.is())
+ if(!_xFormatter.is())
{
try
{
@@ -87,12 +82,20 @@ SvxNumberType::SvxNumberType(sal_Int16 nType) :
::rtl::OUString::createFromAscii( "com.sun.star.text.DefaultNumberingProvider" ) );
Reference<XDefaultNumberingProvider> xRet(xI, UNO_QUERY);
DBG_ASSERT(xRet.is(), "service missing: \"com.sun.star.text.DefaultNumberingProvider\"");
- xFormatter = Reference<XNumberingFormatter> (xRet, UNO_QUERY);
+ _xFormatter = Reference<XNumberingFormatter> (xRet, UNO_QUERY);
}
catch(Exception& )
{
}
}
+}
+/* -----------------------------22.02.01 14:24--------------------------------
+
+ ---------------------------------------------------------------------------*/
+SvxNumberType::SvxNumberType(sal_Int16 nType) :
+ nNumType(nType),
+ bShowSymbol(sal_True)
+{
nRefCount++;
}
/* -----------------------------22.02.01 14:31--------------------------------
@@ -126,6 +129,7 @@ String SvxNumberType::GetNumStr( ULONG nNo ) const
* --------------------------------------------------*/
String SvxNumberType::GetNumStr( ULONG nNo, const Locale& rLocale ) const
{
+ lcl_getFormatter(xFormatter);
String aTmpStr;
if(!xFormatter.is())
return aTmpStr;
diff --git a/svx/source/items/paraitem.cxx b/svx/source/items/paraitem.cxx
index 80af583638e8..d97ba065441d 100644
--- a/svx/source/items/paraitem.cxx
+++ b/svx/source/items/paraitem.cxx
@@ -889,7 +889,7 @@ SvxTabStop::SvxTabStop()
{
nTabPos = 0;
eAdjustment = SVX_TAB_ADJUST_LEFT;
- cDecimal = SvtSysLocale().GetLocaleData().getNumDecimalSep().GetChar(0);
+ m_cDecimal = cDfltDecimalChar;
cFill = cDfltFillChar;
}
@@ -900,10 +900,15 @@ SvxTabStop::SvxTabStop( const long nPos, const SvxTabAdjust eAdjst,
{
nTabPos = nPos;
eAdjustment = eAdjst;
- cDecimal = ( cDfltDecimalChar == cDec ) ? SvtSysLocale().GetLocaleData().getNumDecimalSep().GetChar(0) : cDec;
+ m_cDecimal = cDec;
cFill = cFil;
}
-
+// -----------------------------------------------------------------------------
+void SvxTabStop::fillDecimal() const
+{
+ if ( cDfltDecimalChar == m_cDecimal )
+ m_cDecimal = SvtSysLocale().GetLocaleData().getNumDecimalSep().GetChar(0);
+}
// -----------------------------------------------------------------------
XubString SvxTabStop::GetValueString() const
@@ -918,7 +923,7 @@ XubString SvxTabStop::GetValueString() const
aStr += cpDelim;
aStr += sal_Unicode('[');
aStr += XubString( ResId( RID_SVXITEMS_TAB_DECIMAL_CHAR, DIALOG_MGR() ) );
- aStr += cDecimal;
+ aStr += GetDecimal();
aStr += sal_Unicode(']');
aStr += cpDelim;
aStr += cpDelim;
diff --git a/svx/source/items/textitem.cxx b/svx/source/items/textitem.cxx
index 50c18cd14b17..2d1e5b6ebf9f 100644
--- a/svx/source/items/textitem.cxx
+++ b/svx/source/items/textitem.cxx
@@ -485,6 +485,13 @@ SfxItemPresentation SvxFontItem::GetPresentation
return SFX_ITEM_PRESENTATION_NONE;
}
+//------------------------------------------------------------------------
+
+void SvxFontItem::EnableStoreUnicodeNames( BOOL bEnable )
+{
+ bEnableStoreUnicodeNames = bEnable;
+}
+
// class SvxPostureItem --------------------------------------------------
SvxPostureItem::SvxPostureItem( const FontItalic ePosture, const USHORT nId ) :
diff --git a/svx/source/mnuctrls/clipboardctl.cxx b/svx/source/mnuctrls/clipboardctl.cxx
index 82dc919bb729..3cd538e4c079 100644
--- a/svx/source/mnuctrls/clipboardctl.cxx
+++ b/svx/source/mnuctrls/clipboardctl.cxx
@@ -143,16 +143,6 @@ void SvxClipBoardControl::StateChanged( USHORT nSID, SfxItemState eState, const
GetToolBox().SetItemBits( GetId(), GetToolBox().GetItemBits( GetId() ) & ~TIB_DROPDOWN );
GetToolBox().Invalidate( GetToolBox().GetItemRect( GetId() ) );
}
- #ifdef UNIX
- // #b6673979# enable some slots hardly, because UNIX clipboard does not notify all changes
- // Can be removed if follow up task will be fixed directly within applications.
- else
- if ( SID_PASTE == nSID )
- {
- bDisabled = false;
- GetToolBox().EnableItem( GetId(), true );
- }
- #endif
else
{
// enable the item as a whole
diff --git a/svx/source/msfilter/escherex.cxx b/svx/source/msfilter/escherex.cxx
index c327cec80d1b..5bb1b77efc35 100644
--- a/svx/source/msfilter/escherex.cxx
+++ b/svx/source/msfilter/escherex.cxx
@@ -156,14 +156,6 @@ EscherExClientAnchor_Base::~EscherExClientAnchor_Base()
// ---------------------------------------------------------------------------------------------
-struct EscherPropSortStruct
-{
- sal_uInt8* pBuf;
- sal_uInt32 nPropSize;
- sal_uInt32 nPropValue;
- sal_uInt16 nPropId;
-};
-
void EscherPropertyContainer::ImplInit()
{
nSortCount = 0;
@@ -275,21 +267,40 @@ void EscherPropertyContainer::AddOpt( sal_uInt16 nPropID, sal_Bool bBlib, sal_uI
}
}
-sal_Bool EscherPropertyContainer::GetOpt( sal_uInt16 nPropId, sal_uInt32& nPropValue ) const
+sal_Bool EscherPropertyContainer::GetOpt( sal_uInt16 nPropId, sal_uInt32& rPropValue ) const
+{
+ EscherPropSortStruct aPropStruct;
+
+ if ( GetOpt( nPropId, aPropStruct ) )
+ {
+ rPropValue = aPropStruct.nPropValue;
+ return sal_True;
+ }
+ return sal_False;
+}
+
+sal_Bool EscherPropertyContainer::GetOpt( sal_uInt16 nPropId, EscherPropSortStruct& rPropValue ) const
{
- sal_Bool bRetValue = sal_False;
for( sal_uInt32 i = 0; i < nSortCount; i++ )
{
if ( ( pSortStruct[ i ].nPropId &~0xc000 ) == ( nPropId &~0xc000 ) )
{
- nPropValue = pSortStruct[ i ].nPropValue;
- bRetValue = sal_True;
- break;
+ rPropValue = pSortStruct[ i ];
+ return sal_True;
}
}
- return bRetValue;
+ return sal_False;
}
+EscherProperties EscherPropertyContainer::GetOpts() const
+{
+ EscherProperties aVector;
+
+ for ( sal_uInt32 i = 0; i < nSortCount; ++i )
+ aVector.push_back( pSortStruct[ i ] );
+
+ return aVector;
+}
extern "C" int __LOADONCALLAPI EscherPropSortFunc( const void* p1, const void* p2 )
{
@@ -715,7 +726,7 @@ void EscherPropertyContainer::CreateTextProperties(
AddOpt( ESCHER_Prop_lTxid, nTextId );
}
-static sal_Bool GetLineArrow( const sal_Bool bLineStart,
+sal_Bool EscherPropertyContainer::GetLineArrow( const sal_Bool bLineStart,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
ESCHER_LineEnd& reLineEnd, sal_Int32& rnArrowLength, sal_Int32& rnArrowWidth )
{
@@ -2084,6 +2095,68 @@ void ConvertEnhancedCustomShapeEquation( SdrObjCustomShape* pCustoShape,
}
}
+sal_Bool EscherPropertyContainer::IsDefaultObject( SdrObjCustomShape* pCustoShape )
+{
+ sal_Bool bIsDefaultObject = sal_False;
+ if ( pCustoShape )
+ {
+ if ( pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_EQUATIONS )
+ && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_VIEWBOX )
+ && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_PATH )
+ && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_GLUEPOINTS )
+ && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_SEGMENTS )
+ && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_STRETCHX )
+ && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_STRETCHY )
+// && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_HANDLES )
+ && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_TEXTFRAMES ) )
+ bIsDefaultObject = sal_True;
+ }
+
+ return bIsDefaultObject;
+}
+
+void EscherPropertyContainer::LookForPolarHandles( const MSO_SPT eShapeType, sal_Int32& nAdjustmentsWhichNeedsToBeConverted )
+{
+ const mso_CustomShape* pDefCustomShape = GetCustomShapeContent( eShapeType );
+ if ( pDefCustomShape && pDefCustomShape->nHandles && pDefCustomShape->pHandles )
+ {
+ sal_Int32 k, nkCount = pDefCustomShape->nHandles;
+ const SvxMSDffHandle* pData = pDefCustomShape->pHandles;
+ for ( k = 0; k < nkCount; k++, pData++ )
+ {
+ if ( pData->nFlags & MSDFF_HANDLE_FLAGS_POLAR )
+ {
+ if ( ( pData->nPositionY >= 0x256 ) || ( pData->nPositionY <= 0x107 ) )
+ nAdjustmentsWhichNeedsToBeConverted |= ( 1 << k );
+ }
+ }
+ }
+}
+
+sal_Bool EscherPropertyContainer::GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue )
+{
+ if ( rkProp.State != beans::PropertyState_DIRECT_VALUE )
+ return FALSE;
+
+ sal_Bool bUseFixedFloat = ( nAdjustmentsWhichNeedsToBeConverted & ( 1 << nIndex ) ) != 0;
+ if ( rkProp.Value.getValueTypeClass() == uno::TypeClass_DOUBLE )
+ {
+ double fValue;
+ rkProp.Value >>= fValue;
+ if ( bUseFixedFloat )
+ fValue *= 65536.0;
+ nValue = (sal_Int32)fValue;
+ }
+ else
+ {
+ rkProp.Value >>= nValue;
+ if ( bUseFixedFloat )
+ nValue <<= 16;
+ }
+
+ return TRUE;
+}
+
void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeType, const uno::Reference< drawing::XShape > & rXShape )
{
uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY );
@@ -2108,22 +2181,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
sal_Int32 nAdjustmentsWhichNeedsToBeConverted = 0;
uno::Sequence< beans::PropertyValues > aHandlesPropSeq;
sal_Bool bPredefinedHandlesUsed = sal_True;
-
-
- sal_Bool bIsDefaultObject = sal_False;
- if ( pCustoShape )
- {
- if ( pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_EQUATIONS )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_VIEWBOX )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_PATH )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_GLUEPOINTS )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_SEGMENTS )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_STRETCHX )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_STRETCHY )
-// && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_HANDLES )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_TEXTFRAMES ) )
- bIsDefaultObject = sal_True;
- }
+ sal_Bool bIsDefaultObject = IsDefaultObject( pCustoShape );
// convert property "Equations" into std::vector< EnhancedCustomShapeEquationEquation >
std::vector< EnhancedCustomShapeEquation > aEquations;
@@ -3185,46 +3243,12 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
if ( pAdjustmentValuesProp->Value >>= aAdjustmentSeq )
{
if ( bPredefinedHandlesUsed )
- {
- const mso_CustomShape* pDefCustomShape = GetCustomShapeContent( eShapeType );
- if ( pDefCustomShape && pDefCustomShape->nHandles && pDefCustomShape->pHandles )
- {
- sal_Int32 k, nkCount = pDefCustomShape->nHandles;
- const SvxMSDffHandle* pData = pDefCustomShape->pHandles;
- for ( k = 0; k < nkCount; k++, pData++ )
- {
- if ( pData->nFlags & MSDFF_HANDLE_FLAGS_POLAR )
- {
- if ( ( pData->nPositionY >= 0x256 ) || ( pData->nPositionY <= 0x107 ) )
- nAdjustmentsWhichNeedsToBeConverted |= ( 1 << k );
- }
- }
- }
- }
+ LookForPolarHandles( eShapeType, nAdjustmentsWhichNeedsToBeConverted );
+
sal_Int32 k, nValue = 0, nAdjustmentValues = aAdjustmentSeq.getLength();
for ( k = 0; k < nAdjustmentValues; k++ )
- {
- const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp = aAdjustmentSeq[ k ];
- if ( rkProp.State == beans::PropertyState_DIRECT_VALUE )
- {
- sal_Bool bUseFixedFloat = ( nAdjustmentsWhichNeedsToBeConverted & ( 1 << k ) ) != 0;
- if ( rkProp.Value.getValueTypeClass() == uno::TypeClass_DOUBLE )
- {
- double fValue;
- rkProp.Value >>= fValue;
- if ( bUseFixedFloat )
- fValue *= 65536.0;
- nValue = (sal_Int32)fValue;
- }
- else
- {
- rkProp.Value >>= nValue;
- if ( bUseFixedFloat )
- nValue <<= 16;
- }
+ if( GetAdjustmentValue( aAdjustmentSeq[ k ], k, nAdjustmentsWhichNeedsToBeConverted, nValue ) )
AddOpt( (sal_uInt16)( DFF_Prop_adjustValue + k ), (sal_uInt32)nValue );
- }
- }
}
}
}
@@ -3923,30 +3947,6 @@ struct EscherConnectorRule
sal_uInt32 ncptiB; // Connection site Index of shape B
};
-struct EscherConnectorListEntry
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnector;
- ::com::sun::star::awt::Point maPointA;
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnectToA;
- ::com::sun::star::awt::Point maPointB;
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnectToB;
-
- sal_uInt32 GetConnectorRule( sal_Bool bFirst );
-
- EscherConnectorListEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rC,
- const ::com::sun::star::awt::Point& rPA,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rSA ,
- const ::com::sun::star::awt::Point& rPB,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rSB ) :
- mXConnector ( rC ),
- maPointA ( rPA ),
- mXConnectToA( rSA ),
- maPointB ( rPB ),
- mXConnectToB( rSB ) {}
-
- sal_uInt32 GetClosestPoint( const Polygon& rPoly, const ::com::sun::star::awt::Point& rP );
-};
-
struct EscherShapeListEntry
{
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > aXShape;
@@ -4650,6 +4650,17 @@ void EscherEx::AddAtom( UINT32 nAtomSize, UINT16 nRecType, int nRecVersion, int
// ---------------------------------------------------------------------------------------------
+void EscherEx::AddChildAnchor( const Rectangle& rRect )
+{
+ AddAtom( 16, ESCHER_ChildAnchor );
+ GetStream() << (INT32)rRect.Left()
+ << (INT32)rRect.Top()
+ << (INT32)rRect.Right()
+ << (INT32)rRect.Bottom();
+}
+
+// ---------------------------------------------------------------------------------------------
+
void EscherEx::AddClientAnchor( const Rectangle& rRect )
{
AddAtom( 8, ESCHER_ClientAnchor );
@@ -4699,15 +4710,10 @@ UINT32 EscherEx::EnterGroup( const String& rShapeName, const Rectangle* pBoundRe
if( rShapeName.Len() > 0 )
aPropOpt.AddOpt( ESCHER_Prop_wzName, rShapeName );
- aPropOpt.Commit( *mpOutStrm );
+ Commit( aPropOpt, aRect );
if ( mnGroupLevel > 1 )
- {
- AddAtom( 16, ESCHER_ChildAnchor );
- *mpOutStrm << (INT32)aRect.Left()
- << (INT32)aRect.Top()
- << (INT32)aRect.Right()
- << (INT32)aRect.Bottom();
- }
+ AddChildAnchor( aRect );
+
EscherExHostAppData* pAppData = mpImplEscherExSdr->ImplGetHostData();
if( pAppData )
{
@@ -4805,6 +4811,13 @@ UINT32 EscherEx::GetShapeID()
// ---------------------------------------------------------------------------------------------
+void EscherEx::Commit( EscherPropertyContainer& rProps, const Rectangle& )
+{
+ rProps.Commit( GetStream() );
+}
+
+// ---------------------------------------------------------------------------------------------
+
UINT32 EscherEx::GetColor( const UINT32 nSOColor, BOOL bSwap )
{
if ( bSwap )
diff --git a/svx/source/msfilter/eschesdo.cxx b/svx/source/msfilter/eschesdo.cxx
index 8057eded6131..65157df81baa 100644
--- a/svx/source/msfilter/eschesdo.cxx
+++ b/svx/source/msfilter/eschesdo.cxx
@@ -736,16 +736,10 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
if( rObj.GetAngle() )
ImplFlipBoundingBox( rObj, aPropOpt );
- aPropOpt.Commit( mpEscherEx->GetStream() );
+ mpEscherEx->Commit( aPropOpt, rObj.GetRect() );
if( mpEscherEx->GetGroupLevel() > 1 )
- {
- mpEscherEx->AddAtom( 16, ESCHER_ChildAnchor );
- const Rectangle& rRect = rObj.GetRect();
- mpEscherEx->GetStream() << (INT32)rRect.Left()
- << (INT32)rRect.Top()
- << (INT32)rRect.Right()
- << (INT32)rRect.Bottom();
- }
+ mpEscherEx->AddChildAnchor( rObj.GetRect() );
+
if ( mpHostAppData )
{ //! with AdditionalText the App has to control whether these are written or not
mpHostAppData->WriteClientAnchor( *mpEscherEx, rObj.GetRect() );
@@ -839,15 +833,10 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
rObj.GetRect() );
}
rObj.SetAngle( nAngle );
- aPropOpt.Commit( mpEscherEx->GetStream() );
+ mpEscherEx->Commit( aPropOpt, rObj.GetRect() );
// write the childanchor
- mpEscherEx->AddAtom( 16, ESCHER_ChildAnchor );
- const Rectangle& rRect = rObj.GetRect();
- mpEscherEx->GetStream() << (INT32)rRect.Left()
- << (INT32)rRect.Top()
- << (INT32)rRect.Right()
- << (INT32)rRect.Bottom();
+ mpEscherEx->AddChildAnchor( rObj.GetRect() );
#if defined EES_WRITE_EPP
// ClientAnchor
diff --git a/svx/source/msfilter/makefile.mk b/svx/source/msfilter/makefile.mk
index 85c120f88d1b..adbe8b104860 100644
--- a/svx/source/msfilter/makefile.mk
+++ b/svx/source/msfilter/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=msfilter
+LIBTARGET=NO
AUTOSEG=true
# --- Settings -----------------------------------------------------
@@ -42,7 +43,8 @@ AUTOSEG=true
# --- Files --------------------------------------------------------
-SLOFILES=\
+LIB1TARGET= $(SLB)$/$(TARGET)-msfilter.lib
+LIB1OBJFILES= \
$(SLO)$/countryid.obj \
$(SLO)$/escherex.obj \
$(SLO)$/eschesdo.obj \
@@ -54,6 +56,12 @@ SLOFILES=\
$(SLO)$/mscodec.obj \
$(SLO)$/msfiltertracer.obj
+LIB2TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB2OBJFILES= \
+ $(SLO)$/svxmsbas2.obj
+
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
EXCEPTIONSFILES= \
$(SLO)$/eschesdo.obj \
$(SLO)$/escherex.obj \
diff --git a/svx/source/msfilter/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx
index 5a8c149fa2bf..0e751e3181e7 100644
--- a/svx/source/msfilter/msdffimp.cxx
+++ b/svx/source/msfilter/msdffimp.cxx
@@ -1912,12 +1912,7 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co
XGradientStyle eGrad = XGRAD_LINEAR;
sal_Int32 nChgColors = 0;
- if ( !nAngle )
- nChgColors ^= 1;
-
- if ( !nFocus )
- nChgColors ^= 1;
- else if ( nFocus < 0 ) // Bei negativem Focus sind die Farben zu tauschen
+ if ( nFocus < 0 ) // Bei negativem Focus sind die Farben zu tauschen
{
nFocus =- nFocus;
nChgColors ^= 1;
@@ -1925,8 +1920,8 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co
if( nFocus > 40 && nFocus < 60 )
{
eGrad = XGRAD_AXIAL; // Besser gehts leider nicht
- nChgColors ^= 1;
}
+
USHORT nFocusX = (USHORT)nFocus;
USHORT nFocusY = (USHORT)nFocus;
@@ -3785,6 +3780,10 @@ Color SvxMSDffManager::MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nConte
nColorCode &= 0x00ffffff;
sal_uInt8 nUpper = (sal_uInt8)( nColorCode >> 24 );
+
+ // sj: below change from 0x1b to 0x19 was done because of i84812 (0x02 -> rgb color),
+ // now I have some problems to fix i104685 (there the color value is 0x02000000 whichs requires
+ // a 0x2 scheme color to be displayed properly), the color docu seems to be incomplete
if( nUpper & 0x19 ) // if( nUpper & 0x1f )
{
if( ( nUpper & 0x08 ) || ( ( nUpper & 0x10 ) == 0 ) )
@@ -4754,13 +4753,13 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
if ( ( nGroupRotateAngle > 4500 && nGroupRotateAngle <= 13500 )
|| ( nGroupRotateAngle > 22500 && nGroupRotateAngle <= 31500 ) )
{
- sal_Int32 nHalfWidth = ( aGlobalChildRect.GetWidth() + 1 ) >> 1;
- sal_Int32 nHalfHeight = ( aGlobalChildRect.GetHeight() + 1 ) >> 1;
- Point aTopLeft( aGlobalChildRect.Left() + nHalfWidth - nHalfHeight,
- aGlobalChildRect.Top() + nHalfHeight - nHalfWidth );
- Size aNewSize( aGlobalChildRect.GetHeight(), aGlobalChildRect.GetWidth() );
+ sal_Int32 nHalfWidth = ( aClientRect.GetWidth() + 1 ) >> 1;
+ sal_Int32 nHalfHeight = ( aClientRect.GetHeight() + 1 ) >> 1;
+ Point aTopLeft( aClientRect.Left() + nHalfWidth - nHalfHeight,
+ aClientRect.Top() + nHalfHeight - nHalfWidth );
+ Size aNewSize( aClientRect.GetHeight(), aClientRect.GetWidth() );
Rectangle aNewRect( aTopLeft, aNewSize );
- aGlobalChildRect = aNewRect;
+ aClientRect = aNewRect;
}
// now importing the inner objects of the group
@@ -4955,6 +4954,16 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
ApplyAttributes( rSt, aSet, aObjData );
pRet->SetMergedItemSet(aSet);
}
+ else if ( aObjData.eShapeType == mso_sptLine )
+ {
+ basegfx::B2DPolygon aPoly;
+ aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Left(), aObjData.aBoundRect.Top()));
+ aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), aObjData.aBoundRect.Bottom()));
+ pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly));
+ pRet->SetModel( pSdrModel );
+ ApplyAttributes( rSt, aSet, aObjData );
+ pRet->SetMergedItemSet(aSet);
+ }
else
{
if ( GetCustomShapeContent( aObjData.eShapeType ) || IsProperty( DFF_Prop_pVertices ) )
diff --git a/svx/source/msfilter/svxmsbas.cxx b/svx/source/msfilter/svxmsbas.cxx
index 17674c4254ca..48823640af61 100644
--- a/svx/source/msfilter/svxmsbas.cxx
+++ b/svx/source/msfilter/svxmsbas.cxx
@@ -403,53 +403,4 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName,
return bRet;
}
-ULONG SvxImportMSVBasic::SaveOrDelMSVBAStorage( BOOL bSaveInto,
- const String& rStorageName )
-{
- ULONG nRet = ERRCODE_NONE;
- uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() );
- String aDstStgName( GetMSBasicStorageName() );
- SotStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName,
- STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYALL ) );
- if( xVBAStg.Is() && !xVBAStg->GetError() )
- {
- xVBAStg = 0;
- if( bSaveInto )
- {
- BasicManager *pBasicMan = rDocSh.GetBasicManager();
- if( pBasicMan && pBasicMan->IsBasicModified() )
- nRet = ERRCODE_SVX_MODIFIED_VBASIC_STORAGE;
-
- SotStorageRef xSrc = SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName, STREAM_STD_READ );
- SotStorageRef xDst = xRoot->OpenSotStorage( rStorageName, STREAM_READWRITE | STREAM_TRUNC );
- xSrc->CopyTo( xDst );
- xDst->Commit();
- ErrCode nError = xDst->GetError();
- if ( nError == ERRCODE_NONE )
- nError = xSrc->GetError();
- if ( nError != ERRCODE_NONE )
- xRoot->SetError( nError );
- }
- }
-
- return nRet;
-}
-
-// check if the MS-VBA-Storage exists in the RootStorage of the DocShell.
-// If it exists, then return the WarningId for losing the information.
-ULONG SvxImportMSVBasic::GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocSh)
-{
- uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() );
- SvStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, GetMSBasicStorageName(),
- STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYALL ));
- return ( xVBAStg.Is() && !xVBAStg->GetError() )
- ? ERRCODE_SVX_VBASIC_STORAGE_EXIST
- : ERRCODE_NONE;
-}
-
-String SvxImportMSVBasic::GetMSBasicStorageName()
-{
- return String( RTL_CONSTASCII_USTRINGPARAM( "_MS_VBA_Macros" ) );
-}
-
/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/svx/source/msfilter/svxmsbas2.cxx b/svx/source/msfilter/svxmsbas2.cxx
new file mode 100644
index 000000000000..afd772bbd7e4
--- /dev/null
+++ b/svx/source/msfilter/svxmsbas2.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: svxmsbas.cxx,v $
+ * $Revision: 1.24 $
+ *
+ * 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 <basic/basmgr.hxx>
+#include <sfx2/objsh.hxx>
+#include <svxerr.hxx>
+#include <svxmsbas.hxx>
+
+using namespace com::sun::star;
+
+ULONG SvxImportMSVBasic::SaveOrDelMSVBAStorage( BOOL bSaveInto,
+ const String& rStorageName )
+{
+ ULONG nRet = ERRCODE_NONE;
+ uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() );
+ String aDstStgName( GetMSBasicStorageName() );
+ SotStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName,
+ STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYALL ) );
+ if( xVBAStg.Is() && !xVBAStg->GetError() )
+ {
+ xVBAStg = 0;
+ if( bSaveInto )
+ {
+ BasicManager *pBasicMan = rDocSh.GetBasicManager();
+ if( pBasicMan && pBasicMan->IsBasicModified() )
+ nRet = ERRCODE_SVX_MODIFIED_VBASIC_STORAGE;
+
+ SotStorageRef xSrc = SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName, STREAM_STD_READ );
+ SotStorageRef xDst = xRoot->OpenSotStorage( rStorageName, STREAM_READWRITE | STREAM_TRUNC );
+ xSrc->CopyTo( xDst );
+ xDst->Commit();
+ ErrCode nError = xDst->GetError();
+ if ( nError == ERRCODE_NONE )
+ nError = xSrc->GetError();
+ if ( nError != ERRCODE_NONE )
+ xRoot->SetError( nError );
+ }
+ }
+
+ return nRet;
+}
+
+// check if the MS-VBA-Storage exists in the RootStorage of the DocShell.
+// If it exists, then return the WarningId for losing the information.
+ULONG SvxImportMSVBasic::GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocSh)
+{
+ uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() );
+ SvStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, GetMSBasicStorageName(),
+ STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYALL ));
+ return ( xVBAStg.Is() && !xVBAStg->GetError() )
+ ? ERRCODE_SVX_VBASIC_STORAGE_EXIST
+ : ERRCODE_NONE;
+}
+
+String SvxImportMSVBasic::GetMSBasicStorageName()
+{
+ return String( RTL_CONSTASCII_USTRINGPARAM( "_MS_VBA_Macros" ) );
+}
diff --git a/svx/source/options/makefile.mk b/svx/source/options/makefile.mk
index c4828b81f324..d68703983ebd 100644
--- a/svx/source/options/makefile.mk
+++ b/svx/source/options/makefile.mk
@@ -36,6 +36,7 @@ PROJECTPCHSOURCE=$(PRJ)$/util\svxpch
PRJNAME=svx
TARGET=options
+LIBTARGET=NO
# --- Settings -----------------------------------------------------
@@ -62,39 +63,23 @@ SRC1FILES=\
optchart.src \
optimprove.src
-#EXCEPTIONSFILES=\
-# $(SLO)$/optasian.obj \
-# $(SLO)$/optlingu.obj \
-# $(SLO)$/optaccessibility.obj \
-# $(SLO)$/optsave.obj \
-# $(SLO)$/optpath.obj
-
-#SLOFILES=\
-# $(EXCEPTIONSFILES) \
-# $(SLO)$/asiancfg.obj \
-# $(SLO)$/htmlcfg.obj \
-# $(SLO)$/optcolor.obj \
-# $(SLO)$/optjsearch.obj \
-# $(SLO)$/optitems.obj \
-# $(SLO)$/optgenrl.obj \
-# $(SLO)$/adritem.obj \
-# $(SLO)$/optgrid.obj \
-# $(SLO)$/optinet2.obj \
-# $(SLO)$/optextbr.obj \
-# $(SLO)$/srchcfg.obj \
-# $(SLO)$/optctl.obj
-
EXCEPTIONSFILES=\
$(SLO)$/optlingu.obj
-SLOFILES=\
- $(EXCEPTIONSFILES) \
- $(SLO)$/asiancfg.obj \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
+ $(SLO)$/asiancfg.obj
+
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/optlingu.obj \
$(SLO)$/htmlcfg.obj \
$(SLO)$/optitems.obj \
$(SLO)$/optgrid.obj \
$(SLO)$/srchcfg.obj
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
# --- Targets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/svx/source/options/optgenrl.src b/svx/source/options/optgenrl.src
index 52e031f1099f..cff6f8d4216c 100644
--- a/svx/source/options/optgenrl.src
+++ b/svx/source/options/optgenrl.src
@@ -74,6 +74,14 @@ TabPage RID_SFXPAGE_GENERAL
Hide = TRUE;
Text [ en-US ] = "Last Name/First name/Father's name/Initials";
};
+ FixedText FT_NAME_EASTERN
+ {
+ Pos = MAP_APPFONT ( LEFT , FLINE ( 1 ) ) ;
+ Size = MAP_APPFONT ( MID-LEFT-2 , FLINEH ) ;
+ LeftLabel = TRUE ;
+ Hide = TRUE;
+ Text [ en-US ] = "Last/First ~name/Initials" ;
+ };
Edit ED_FATHERNAME
{
Border = TRUE ;
diff --git a/svx/source/options/optimprove.src b/svx/source/options/optimprove.src
index 148d7391c905..86fc6d1c1a5d 100644
--- a/svx/source/options/optimprove.src
+++ b/svx/source/options/optimprove.src
@@ -87,7 +87,7 @@ TabPage RID_SVXPAGE_IMPROVEMENT
{
Pos = MAP_APPFONT ( 12 , 132 ) ;
Size = MAP_APPFONT ( 80 , 8 ) ;
- Text [ en-US ] = "Number of reports send:" ;
+ Text [ en-US ] = "Number of reports sent:" ;
};
FixedText FT_NR_REPORTS_VALUE
{
diff --git a/svx/source/options/optsave.src b/svx/source/options/optsave.src
index afa1c4b6d0c8..374f53ef618f 100644
--- a/svx/source/options/optsave.src
+++ b/svx/source/options/optsave.src
@@ -149,8 +149,9 @@ TabPage RID_SFXPAGE_SAVE
DropDown = TRUE;
StringList [ en-US ] =
{
- < "1.0/1.1 (OpenOffice.org 2.x)" ; 2 ; > ;
- < "1.2 (recommended)" ; 3 ; > ;
+ < "1.0/1.1" ; 2 ; > ;
+ < "1.2" ; 4 ; > ;
+ < "1.2 Extended (recommended)"; 0x7fffffff ; > ;
};
};
CheckBox BTN_NOPRETTYPRINTING
@@ -219,7 +220,8 @@ TabPage RID_SFXPAGE_SAVE
Pos = MAP_APPFONT ( 23 , 169 ) ;
Size = MAP_APPFONT ( 239 , 8 ) ;
Hide = TRUE;
- Text [ en-US ] = "Not using ODF 1.2 may cause infomation to be lost.";
+ Text [ en-US ] = "Not using ODF 1.2 Extended may cause infomation to be lost.";
+ Text [ x-comment ] = "EN-US, the term 'extended' must not be translated.";
};
Image IMG_ODF_WARNING
{
diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx
index 33c958fa6268..ae6204d15bef 100644
--- a/svx/source/sdr/attribute/sdrtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrtextattribute.cxx
@@ -57,12 +57,15 @@ namespace drawinglayer
sal_Int32 aTextUpperDistance,
sal_Int32 aTextRightDistance,
sal_Int32 aTextLowerDistance,
+ SdrTextHorzAdjust aSdrTextHorzAdjust,
+ SdrTextVertAdjust aSdrTextVertAdjust,
bool bContour,
bool bFitToSize,
bool bHideContour,
bool bBlink,
bool bScroll,
- bool bInEditMode)
+ bool bInEditMode,
+ bool bFixedCellHeight)
: mpSdrText(&rSdrText),
maOutlinerParaObject(rOutlinerParaObject),
mpSdrFormTextAttribute(0),
@@ -71,12 +74,15 @@ namespace drawinglayer
maTextRightDistance(aTextRightDistance),
maTextLowerDistance(aTextLowerDistance),
maPropertiesVersion(0),
+ maSdrTextHorzAdjust(aSdrTextHorzAdjust),
+ maSdrTextVertAdjust(aSdrTextVertAdjust),
mbContour(bContour),
mbFitToSize(bFitToSize),
mbHideContour(bHideContour),
mbBlink(bBlink),
mbScroll(bScroll),
- mbInEditMode(bInEditMode)
+ mbInEditMode(bInEditMode),
+ mbFixedCellHeight(bFixedCellHeight)
{
if(XFT_NONE != eFormTextStyle)
{
@@ -108,12 +114,16 @@ namespace drawinglayer
maTextUpperDistance(rCandidate.getTextUpperDistance()),
maTextRightDistance(rCandidate.getTextRightDistance()),
maTextLowerDistance(rCandidate.getTextLowerDistance()),
+ maPropertiesVersion(rCandidate.getPropertiesVersion()),
+ maSdrTextHorzAdjust(rCandidate.getSdrTextHorzAdjust()),
+ maSdrTextVertAdjust(rCandidate.getSdrTextVertAdjust()),
mbContour(rCandidate.isContour()),
mbFitToSize(rCandidate.isFitToSize()),
mbHideContour(rCandidate.isHideContour()),
mbBlink(rCandidate.isBlink()),
mbScroll(rCandidate.isScroll()),
- mbInEditMode(rCandidate.isInEditMode())
+ mbInEditMode(rCandidate.isInEditMode()),
+ mbFixedCellHeight(rCandidate.isFixedCellHeight())
{
if(rCandidate.getSdrFormTextAttribute())
{
@@ -142,36 +152,52 @@ namespace drawinglayer
maTextUpperDistance = rCandidate.getTextUpperDistance();
maTextRightDistance = rCandidate.getTextRightDistance();
maTextLowerDistance = rCandidate.getTextLowerDistance();
+ maPropertiesVersion = rCandidate.getPropertiesVersion();
+
+ maSdrTextHorzAdjust = rCandidate.getSdrTextHorzAdjust();
+ maSdrTextVertAdjust = rCandidate.getSdrTextVertAdjust();
+
mbContour = rCandidate.isContour();
mbFitToSize = rCandidate.isFitToSize();
mbHideContour = rCandidate.isHideContour();
mbBlink = rCandidate.isBlink();
mbScroll = rCandidate.isScroll();
mbInEditMode = rCandidate.isInEditMode();
+ mbFixedCellHeight = rCandidate.isFixedCellHeight();
return *this;
}
bool SdrTextAttribute::operator==(const SdrTextAttribute& rCandidate) const
{
- return (getOutlinerParaObject() == rCandidate.getOutlinerParaObject()
+ return (
+ // compares OPO and it's contents, but traditionally not the RedLining
+ // which is not seen as model, but as temporary information
+ getOutlinerParaObject() == rCandidate.getOutlinerParaObject()
+
// #i102062# for primitive visualisation, the WrongList (SpellChecking)
// is important, too, so use isWrongListEqual since there is no WrongList
// comparison in the regular OutlinerParaObject compare (since it's
// not-persistent data)
&& getOutlinerParaObject().isWrongListEqual(rCandidate.getOutlinerParaObject())
+
&& pointerOrContentEqual(getSdrFormTextAttribute(), rCandidate.getSdrFormTextAttribute())
&& getTextLeftDistance() == rCandidate.getTextLeftDistance()
&& getTextUpperDistance() == rCandidate.getTextUpperDistance()
&& getTextRightDistance() == rCandidate.getTextRightDistance()
&& getTextLowerDistance() == rCandidate.getTextLowerDistance()
&& getPropertiesVersion() == rCandidate.getPropertiesVersion()
+
+ && getSdrTextHorzAdjust() == rCandidate.getSdrTextHorzAdjust()
+ && getSdrTextVertAdjust() == rCandidate.getSdrTextVertAdjust()
+
&& isContour() == rCandidate.isContour()
&& isFitToSize() == rCandidate.isFitToSize()
&& isHideContour() == rCandidate.isHideContour()
&& isBlink() == rCandidate.isBlink()
&& isScroll() == rCandidate.isScroll()
- && isInEditMode() == rCandidate.isInEditMode());
+ && isInEditMode() == rCandidate.isInEditMode()
+ && isFixedCellHeight() == rCandidate.isFixedCellHeight());
}
void SdrTextAttribute::getBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index b083a1014299..6a92cb27ff8c 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -305,6 +305,9 @@ namespace sdr
pSdrText,
*pOPO,
aTextRangeTransform,
+ SDRTEXTHORZADJUST_LEFT,
+ SDRTEXTVERTADJUST_TOP,
+ false,
false,
false,
false);
diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
index 0f4716e2d513..5f632f60ab85 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
@@ -66,10 +66,11 @@ namespace sdr
// no need to correct if no extra text range
if(aTextRange != aObjectRange)
{
+ const double fExtraTextRotation(GetCustomShapeObj().GetExtraTextRotation());
const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat());
// only correct when rotation and/or shear is used
- if(rGeoStat.nShearWink || rGeoStat.nDrehWink)
+ if(rGeoStat.nShearWink || rGeoStat.nDrehWink || !basegfx::fTools::equalZero(fExtraTextRotation))
{
// text range needs to be corrected by
// aObjectRange.getCenter() - aRotObjectRange.getCenter() since it's
@@ -93,6 +94,11 @@ namespace sdr
aRotMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000);
}
+ if(!basegfx::fTools::equalZero(fExtraTextRotation))
+ {
+ aRotMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180);
+ }
+
aRotMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY());
aRotObjectRange.transform(aRotMatrix);
@@ -210,7 +216,11 @@ namespace sdr
// create primitive
const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrCustomShapePrimitive2D(
- *pAttribute, xGroup, aTextBoxMatrix, bWordWrap));
+ *pAttribute,
+ xGroup,
+ aTextBoxMatrix,
+ bWordWrap,
+ false)); // #SJ# New parameter to force to clipped BlockText for SC
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
index e1b2867b0d66..3c239b12113c 100644
--- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
@@ -45,6 +45,7 @@
#include <svtools/colorcfg.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <vcl/svapp.hxx>
+#include <svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -71,7 +72,8 @@ namespace sdr
{
}
- drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createPrimitive2DSequenceWithGivenGraphic(const Graphic& rOLEGraphic, bool bScaleContent) const
+ drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createPrimitive2DSequenceWithParameters(
+ bool bHighContrast) const
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
SdrText* pSdrText = GetOle2Obj().getText(0);
@@ -103,80 +105,24 @@ namespace sdr
pAttribute = new drawinglayer::attribute::SdrLineFillShadowTextAttribute(0, 0, 0, 0, 0, 0);
}
- // Prepare OLE filling. This is normally the metafile describing OLE content, but may also
- // be the empty OLE bitmap for empty/not loaded OLEs
- const GraphicObject aGraphicObject(rOLEGraphic);
- const GraphicAttr aGraphicAttr;
- drawinglayer::primitive2d::Primitive2DSequence xOLEContent;
-
- if(bScaleContent)
- {
- // Create outline and placeholder graphic with some scaling
- // #i94431# for some reason, i forgot to take the PrefMapMode of the graphic
- // into account. Since EmptyPresObj's are only used in Draw/Impress, it is
- // safe to assume 100th mm as target.
- Size aPrefSize(rOLEGraphic.GetPrefSize());
-
- if(MAP_PIXEL == rOLEGraphic.GetPrefMapMode().GetMapUnit())
- {
- aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM);
- }
- else
- {
- aPrefSize = Application::GetDefaultDevice()->LogicToLogic(aPrefSize, rOLEGraphic.GetPrefMapMode(), MAP_100TH_MM);
- }
-
- const double fOffsetX((aObjectRange.getWidth() - aPrefSize.getWidth()) / 2.0);
- const double fOffsetY((aObjectRange.getHeight() - aPrefSize.getHeight()) / 2.0);
-
- if(basegfx::fTools::moreOrEqual(fOffsetX, 0.0) && basegfx::fTools::moreOrEqual(fOffsetY, 0.0))
- {
- // if content fits into frame, create it
- basegfx::B2DHomMatrix aInnerObjectMatrix;
-
- aInnerObjectMatrix.scale(aPrefSize.getWidth(), aPrefSize.getHeight());
- aInnerObjectMatrix.translate(fOffsetX, fOffsetY);
- aInnerObjectMatrix.shearX(fShearX);
- aInnerObjectMatrix.rotate(fRotate);
- aInnerObjectMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY());
-
- drawinglayer::primitive2d::Primitive2DReference xScaledContent(
- new drawinglayer::primitive2d::GraphicPrimitive2D(aInnerObjectMatrix, aGraphicObject, aGraphicAttr));
- xOLEContent = drawinglayer::primitive2d::Primitive2DSequence(&xScaledContent, 1);
- }
- }
- else
- {
- // create graphic primitive for content
- drawinglayer::primitive2d::Primitive2DReference xDirectContent(
- new drawinglayer::primitive2d::GraphicPrimitive2D(aObjectMatrix, aGraphicObject, aGraphicAttr));
- xOLEContent = drawinglayer::primitive2d::Primitive2DSequence(&xDirectContent, 1);
- }
+ // #i102063# embed OLE content in an own primitive; this will be able to decompose accessing
+ // the weak SdrOle2 reference and will also implement getB2DRange() for fast BoundRect
+ // calculations without OLE Graphic access (which may trigger e.g. chart recalculation).
+ // It will also take care of HighContrast and ScaleContent
+ const drawinglayer::primitive2d::Primitive2DReference xOleContent(
+ new drawinglayer::primitive2d::SdrOleContentPrimitive2D(
+ GetOle2Obj(),
+ aObjectMatrix,
+ bHighContrast));
// create primitive. Use Ole2 primitive here. Prepare attribute settings, will be used soon anyways.
+ const drawinglayer::primitive2d::Primitive2DSequence xOLEContent(&xOleContent, 1);
const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrOle2Primitive2D(
xOLEContent,
aObjectMatrix,
*pAttribute));
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
delete pAttribute;
-
- // a standard gray outline is created for scaled content
- if(bScaleContent)
- {
- const svtools::ColorConfig aColorConfig;
- const svtools::ColorConfigValue aColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES));
-
- if(aColor.bIsVisible)
- {
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0, 0, 1, 1)));
- const Color aVclColor(aColor.nColor);
- aOutline.transform(aObjectMatrix);
- const drawinglayer::primitive2d::Primitive2DReference xOutline(
- new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aVclColor.getBColor()));
- drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xOutline);
- }
- }
}
return xRetval;
@@ -184,21 +130,8 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createViewIndependentPrimitive2DSequence() const
{
- const Graphic* pOLEGraphic = GetOle2Obj().GetGraphic();
-
- if(pOLEGraphic)
- {
- // there is a graphic set, use it
- return createPrimitive2DSequenceWithGivenGraphic(*pOLEGraphic, GetOle2Obj().IsEmptyPresObj());
- }
- else
- {
- // no graphic, use default empty OLE bitmap
- const Bitmap aEmptyOLEBitmap(GetOle2Obj().GetEmtyOLEReplacementBitmap());
- const Graphic aEmtyOLEGraphic(aEmptyOLEBitmap);
-
- return createPrimitive2DSequenceWithGivenGraphic(aEmtyOLEGraphic, true);
- }
+ // do as if no HC and call standard creator
+ return createPrimitive2DSequenceWithParameters(false);
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
index c48d110faaf2..8ba8ae8ab4c9 100644
--- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
@@ -105,8 +105,14 @@ namespace sdr
drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY);
// create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrRectanglePrimitive2D(
- aObjectMatrix, *pAttribute, fCornerRadiusX, fCornerRadiusY));
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrRectanglePrimitive2D(
+ aObjectMatrix,
+ *pAttribute,
+ fCornerRadiusX,
+ fCornerRadiusY,
+ GetRectObj().IsTextFrame()));
+
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
diff --git a/svx/source/sdr/contact/viewcontactofunocontrol.cxx b/svx/source/sdr/contact/viewcontactofunocontrol.cxx
index 99710ca308c9..9d6548a1b791 100644
--- a/svx/source/sdr/contact/viewcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewcontactofunocontrol.cxx
@@ -148,7 +148,9 @@ namespace sdr { namespace contact {
return *new UnoControlWindowContact( *pPageViewContact, *this );
}
- return *new UnoControlDefaultContact( _rObjectContact, *this );
+ // if we're not working for a ObjectContactOfPageView, then we can't use a ViewObjectContactOfUnoControl, or any
+ // of its derivees. Fall back to a "normal" SdrObj's contact object.
+ return *new ViewObjectContactOfSdrObj( _rObjectContact, *this );
}
//--------------------------------------------------------------------
diff --git a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
index 902e8e7d8153..5e9ab788e392 100644
--- a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
@@ -220,6 +220,11 @@ namespace sdr
SdrGrafObj& rGrafObj = getSdrGrafObj();
rGrafObj.ForceSwapIn();
+ // #i103720# forget event to avoid possible deletion by the following ActionChanged call
+ // which may use createPrimitive2DSequence/impPrepareGraphicWithAsynchroniousLoading again.
+ // Deletion is actally done by the scheduler who leaded to coming here
+ mpAsynchLoadEvent = 0;
+
// Invalidate all paint areas and check existing animation (which may have changed).
GetViewContact().ActionChanged();
}
@@ -230,11 +235,15 @@ namespace sdr
void ViewObjectContactOfGraphic::forgetAsynchGraphicLoadingEvent(sdr::event::AsynchGraphicLoadingEvent* pEvent)
{
(void) pEvent; // suppress warning
- DBG_ASSERT(mpAsynchLoadEvent, "ViewObjectContactOfGraphic::forgetAsynchGraphicLoadingEvent: I did not trigger a event, why am i called (?)");
- DBG_ASSERT(mpAsynchLoadEvent == pEvent, "ViewObjectContactOfGraphic::forgetAsynchGraphicLoadingEvent: Forced to forget another event then i have scheduled (?)");
- // forget event
- mpAsynchLoadEvent = 0;
+ if(mpAsynchLoadEvent)
+ {
+ OSL_ENSURE(!pEvent || mpAsynchLoadEvent == pEvent,
+ "ViewObjectContactOfGraphic::forgetAsynchGraphicLoadingEvent: Forced to forget another event then i have scheduled (?)");
+
+ // forget event
+ mpAsynchLoadEvent = 0;
+ }
}
SdrGrafObj& ViewObjectContactOfGraphic::getSdrGrafObj()
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
index 6145e0acc301..635ae9c7fcc8 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
@@ -60,197 +60,176 @@ namespace sdr
return static_cast< ViewContactOfSdrOle2Obj& >(GetViewContact()).GetOle2Obj();
}
- drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfSdrOle2Obj::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
+ drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfSdrOle2Obj::createPrimitive2DSequence(
+ const DisplayInfo& /*rDisplayInfo*/) const
{
// this method is overloaded to do some things the old SdrOle2Obj::DoPaintObject did.
- // In the future, some of these may be solved different, but ATM try to stay compatible
- // with the old behaviour
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
- const SdrOle2Obj& rSdrOle2 = getSdrOle2Object();
- sal_Int32 nState = -1;
+ // In the future, some of these may be solved different, but ATM try to stay compatible
+ // with the old behaviour
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
+ const SdrOle2Obj& rSdrOle2 = getSdrOle2Object();
+ sal_Int32 nState(-1);
+
+ {
+ const svt::EmbeddedObjectRef& xObjRef = rSdrOle2.getEmbeddedObjectRef();
+ if ( xObjRef.is() )
+ nState = xObjRef->getCurrentState();
+ }
+
+ const bool bIsOutplaceActive(nState == embed::EmbedStates::ACTIVE);
+ const bool bIsInplaceActive((nState == embed::EmbedStates::INPLACE_ACTIVE) || (nState == embed::EmbedStates::UI_ACTIVE));
+ const bool bIsChart(rSdrOle2.IsChart());
+ bool bDone(false);
+
+ if(!bDone && bIsInplaceActive)
+ {
+ if( !GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile() )
{
- const svt::EmbeddedObjectRef& xObjRef = rSdrOle2.getEmbeddedObjectRef();
- if ( xObjRef.is() )
- nState = xObjRef->getCurrentState();
+ //no need to create a primitive sequence here as the OLE object does render itself
+ //in case of charts the superfluous creation of a metafile is strongly performance relevant!
+ bDone = true;
}
- const bool bIsOutplaceActive = (nState == embed::EmbedStates::ACTIVE);
- const bool bIsInplaceActive = (nState == embed::EmbedStates::INPLACE_ACTIVE) || (nState == embed::EmbedStates::UI_ACTIVE);
- const bool bIsChart = rSdrOle2.IsChart();
+ }
- bool bDone = false;
- if( !bDone && bIsInplaceActive )
+ if( !bDone )
+ {
+ const Rectangle& rObjectRectangle(rSdrOle2.GetGeoRect());
+ const basegfx::B2DRange aObjectRange(rObjectRectangle.Left(), rObjectRectangle.Top(), rObjectRectangle.Right(), rObjectRectangle.Bottom());
+
+ // create object transform
+ basegfx::B2DHomMatrix aObjectTransform;
+ aObjectTransform.set(0, 0, aObjectRange.getWidth());
+ aObjectTransform.set(1, 1, aObjectRange.getHeight());
+ aObjectTransform.set(0, 2, aObjectRange.getMinX());
+ aObjectTransform.set(1, 2, aObjectRange.getMinY());
+
+ if(bIsChart)
{
- if( !GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile() )
+ //charts must be painted resolution dependent!! #i82893#, #i75867#
+
+ // for chart, to not lose the current better quality visualisation which
+ // uses a direct paint, use a primtive wrapper for that exceptional case. The renderers
+ // will then ATM paint it to an OutputDevice directly.
+ // In later versions this should be replaced by getting the Primitive2DSequnce from
+ // the chart and using it.
+ // to be able to render something in non-VCL using renderers, the wrapper is a
+ // GroupPrimitive2D which automatically decomposes to the already created Metafile
+ // content.
+ // For being completely compatible, ATM Window and VDEV PrettyPrinting is suppressed.
+ // It works in the VCL renderers, though. So for activating again with VCL primitive
+ // renderers, change conditions here.
+
+ // determine if embedding and PrettyPrinting shall be done at all
+ uno::Reference< frame::XModel > xChartModel;
+ bool bDoChartPrettyPrinting(true);
+
+ // the original ChartPrettyPainter does not do it for Window
+ if(bDoChartPrettyPrinting && GetObjectContact().isOutputToWindow())
{
- bDone = true;
- //no need to create a primitive sequence here as the OLE object does render itself
- //in case of charts the superfluous creation of a metafile is strongly performance relevant!
+ bDoChartPrettyPrinting = false;
}
- }
-
- if( !bDone )
- {
- const Rectangle& rObjectRectangle(rSdrOle2.GetGeoRect());
- const basegfx::B2DRange aObjectRange(rObjectRectangle.Left(), rObjectRectangle.Top(), rObjectRectangle.Right(), rObjectRectangle.Bottom());
- // create object transform
- basegfx::B2DHomMatrix aObjectTransform;
- aObjectTransform.set(0, 0, aObjectRange.getWidth());
- aObjectTransform.set(1, 1, aObjectRange.getHeight());
- aObjectTransform.set(0, 2, aObjectRange.getMinX());
- aObjectTransform.set(1, 2, aObjectRange.getMinY());
-
- if(bIsChart)
+ // the original ChartPrettyPainter does not do it for VDEV
+ if(bDoChartPrettyPrinting && GetObjectContact().isOutputToVirtualDevice())
{
- //charts must be painted resolution dependent!! #i82893#, #i75867#
-
- // for chart, to not lose the current better quality visualisation which
- // uses a direct paint, use a primtive wrapper for that exceptional case. The renderers
- // will then ATM paint it to an OutputDevice directly.
- // In later versions this should be replaced by getting the Primitive2DSequnce from
- // the chart and using it.
- // to be able to render something in non-VCL using renderers, the wrapper is a
- // GroupPrimitive2D which automatically decomposes to the already created Metafile
- // content.
- // For being completely compatible, ATM Window and VDEV PrettyPrinting is suppressed.
- // It works in the VCL renderers, though. So for activating again with VCL primitive
- // renderers, change conditions here.
-
- // determine if embedding and PrettyPrinting shall be done at all
- uno::Reference< frame::XModel > xChartModel;
- bool bDoChartPrettyPrinting(true);
-
- // the original ChartPrettyPainter does not do it for Window
- if(bDoChartPrettyPrinting && GetObjectContact().isOutputToWindow())
+ if(GetObjectContact().isOutputToPDFFile())
{
- bDoChartPrettyPrinting = false;
+ // #i97982#
+ // For PDF files, allow PrettyPrinting
}
-
- // the original ChartPrettyPainter does not do it for VDEV
- if(bDoChartPrettyPrinting && GetObjectContact().isOutputToVirtualDevice())
+ else
{
- if(GetObjectContact().isOutputToPDFFile())
- {
- // #i97982#
- // For PDF files, allow PrettyPrinting
- }
- else
- {
- bDoChartPrettyPrinting = false;
- }
+ bDoChartPrettyPrinting = false;
}
+ }
- // the chart model is needed. Check if it's available
- if(bDoChartPrettyPrinting)
- {
- // get chart model
- xChartModel = rSdrOle2.getXModel();
-
- if(!xChartModel.is())
- {
- bDoChartPrettyPrinting = false;
- }
- }
+ // the chart model is needed. Check if it's available
+ if(bDoChartPrettyPrinting)
+ {
+ // get chart model
+ xChartModel = rSdrOle2.getXModel();
- if(bDoChartPrettyPrinting)
+ if(!xChartModel.is())
{
- // embed MetaFile data in a specialized Wrapper Primitive which holds also the ChartModel needed
- // for PrettyPrinting
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::ChartPrimitive2D(
- xChartModel, aObjectTransform, xRetval));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- bDone = true;
+ bDoChartPrettyPrinting = false;
}
}
- if( !bDone )
+ if(bDoChartPrettyPrinting)
{
- //old stuff that should be reworked
- {
- //if no replacement image is available load the OLE object
- if(!rSdrOle2.GetGraphic()) //try to fetch the metafile - this can lead to the actual creation of the metafile what can be extremely expensive (e.g. for big charts)!!! #i101925#
- {
- // try to create embedded object
- rSdrOle2.GetObjRef(); //this loads the OLE object if it is not loaded already
- }
- const svt::EmbeddedObjectRef& xObjRef = rSdrOle2.getEmbeddedObjectRef();
- if(xObjRef.is())
- {
- const sal_Int64 nMiscStatus(xObjRef->getStatus(rSdrOle2.GetAspect()));
-
- // this hack (to change model data during PAINT argh(!)) should be reworked
- if(!rSdrOle2.IsResizeProtect() && (nMiscStatus & embed::EmbedMisc::EMBED_NEVERRESIZE))
- {
- const_cast< SdrOle2Obj* >(&rSdrOle2)->SetResizeProtect(true);
- }
-
- SdrPageView* pPageView = GetObjectContact().TryToGetSdrPageView();
- if(pPageView && (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE))
- {
- // connect plugin object
- pPageView->GetView().DoConnect(const_cast< SdrOle2Obj* >(&rSdrOle2));
- }
- }
- }//end old stuff to rework
+ // embed MetaFile data in a specialized Wrapper Primitive which holds also the ChartModel needed
+ // for PrettyPrinting
+ const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::ChartPrimitive2D(
+ xChartModel, aObjectTransform, xRetval));
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ bDone = true;
+ }
+ }
- if(GetObjectContact().isDrawModeHighContrast())
+ if( !bDone )
+ {
+ //old stuff that should be reworked
+ {
+ //if no replacement image is available load the OLE object
+ if(!rSdrOle2.GetGraphic()) //try to fetch the metafile - this can lead to the actual creation of the metafile what can be extremely expensive (e.g. for big charts)!!! #i101925#
+ {
+ // try to create embedded object
+ rSdrOle2.GetObjRef(); //this loads the OLE object if it is not loaded already
+ }
+ const svt::EmbeddedObjectRef& xObjRef = rSdrOle2.getEmbeddedObjectRef();
+ if(xObjRef.is())
{
- // directly call at the corresponding VC and force OLE Graphic to HighContrast
- const ViewContactOfSdrOle2Obj& rVC = static_cast< const ViewContactOfSdrOle2Obj& >(GetViewContact());
- Graphic* pOLEHighContrastGraphic = rSdrOle2.getEmbeddedObjectRef().GetHCGraphic();
+ const sal_Int64 nMiscStatus(xObjRef->getStatus(rSdrOle2.GetAspect()));
- if(pOLEHighContrastGraphic)
+ // this hack (to change model data during PAINT argh(!)) should be reworked
+ if(!rSdrOle2.IsResizeProtect() && (nMiscStatus & embed::EmbedMisc::EMBED_NEVERRESIZE))
{
- // there is a graphic set, use it
- xRetval = rVC.createPrimitive2DSequenceWithGivenGraphic(*pOLEHighContrastGraphic, rSdrOle2.IsEmptyPresObj());
+ const_cast< SdrOle2Obj* >(&rSdrOle2)->SetResizeProtect(true);
}
- else
- {
- // no HighContrast graphic, use default empty OLE bitmap
- const Bitmap aEmptyOLEBitmap(rSdrOle2.GetEmtyOLEReplacementBitmap());
- const Graphic aEmtyOLEGraphic(aEmptyOLEBitmap);
- xRetval = rVC.createPrimitive2DSequenceWithGivenGraphic(aEmtyOLEGraphic, true);
+ SdrPageView* pPageView = GetObjectContact().TryToGetSdrPageView();
+ if(pPageView && (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE))
+ {
+ // connect plugin object
+ pPageView->GetView().DoConnect(const_cast< SdrOle2Obj* >(&rSdrOle2));
}
}
- else
- {
- // call parent which will use the regular createViewIndependentPrimitive2DSequence
- // at the corresponding VC
- xRetval = ViewObjectContactOfSdrObj::createPrimitive2DSequence(rDisplayInfo);
- }
+ }//end old stuff to rework
- }
+ // create OLE primitive stuff directly at VC with HC as parameter
+ const ViewContactOfSdrOle2Obj& rVC = static_cast< const ViewContactOfSdrOle2Obj& >(GetViewContact());
+ xRetval = rVC.createPrimitive2DSequenceWithParameters(GetObjectContact().isDrawModeHighContrast());
+ }
- if(bIsOutplaceActive)
+ if(bIsOutplaceActive)
+ {
+ // do not shade when printing or PDF exporting
+ if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile())
{
- // do not shade when printing or PDF exporting
- if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile())
- {
- // shade the representation if the object is activated outplace
- basegfx::B2DPolygon aObjectOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
- aObjectOutline.transform(aObjectTransform);
-
- // Use a FillHatchPrimitive2D with necessary attributes
- const drawinglayer::attribute::FillHatchAttribute aFillHatch(
- drawinglayer::attribute::HATCHSTYLE_SINGLE, // single hatch
- 125.0, // 1.25 mm
- 45.0 * F_PI180, // 45 degree diagonal
- Color(COL_BLACK).getBColor(), // black color
- false); // no filling
-
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolyPolygonHatchPrimitive2D(
- basegfx::B2DPolyPolygon(aObjectOutline),
- Color(COL_BLACK).getBColor(),
- aFillHatch));
-
- drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xReference);
- }
+ // shade the representation if the object is activated outplace
+ basegfx::B2DPolygon aObjectOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ aObjectOutline.transform(aObjectTransform);
+
+ // Use a FillHatchPrimitive2D with necessary attributes
+ const drawinglayer::attribute::FillHatchAttribute aFillHatch(
+ drawinglayer::attribute::HATCHSTYLE_SINGLE, // single hatch
+ 125.0, // 1.25 mm
+ 45.0 * F_PI180, // 45 degree diagonal
+ Color(COL_BLACK).getBColor(), // black color
+ false); // no filling
+
+ const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolyPolygonHatchPrimitive2D(
+ basegfx::B2DPolyPolygon(aObjectOutline),
+ Color(COL_BLACK).getBColor(),
+ aFillHatch));
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xReference);
}
-
}
- return xRetval;
+ }
+
+ return xRetval;
}
ViewObjectContactOfSdrOle2Obj::ViewObjectContactOfSdrOle2Obj(ObjectContact& rObjectContact, ViewContact& rViewContact)
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 92003865fde0..667129e27653 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -30,12 +30,18 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
+
#include <svx/sdr/contact/viewobjectcontactofunocontrol.hxx>
#include <svx/sdr/contact/viewcontactofunocontrol.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/sdr/properties/properties.hxx>
#include <svx/sdr/contact/objectcontactofpageview.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
+#include <svx/svdouno.hxx>
+#include <svx/svdpagv.hxx>
+#include <svx/svdview.hxx>
+#include <svx/sdrpagewindow.hxx>
+#include "sdrpaintwindow.hxx"
/** === begin UNO includes === **/
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -53,23 +59,21 @@
#include <com/sun/star/container/XContainerListener.hpp>
#include <com/sun/star/container/XContainer.hpp>
/** === end UNO includes === **/
-#include <svx/svdouno.hxx>
-#include <svx/svdpagv.hxx>
-#include <svx/svdview.hxx>
-#include <svx/sdrpagewindow.hxx>
-#include "sdrpaintwindow.hxx"
+
#include <toolkit/helper/formpdfexport.hxx>
#include <vcl/pdfextoutdevdata.hxx>
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/scopeguard.hxx>
#include <cppuhelper/implbase4.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/diagnose_ex.h>
-
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <drawinglayer/primitive2d/controlprimitive2d.hxx>
+
#include <boost/shared_ptr.hpp>
+#include <boost/bind.hpp>
//........................................................................
namespace sdr { namespace contact {
@@ -220,10 +224,17 @@ namespace sdr { namespace contact {
void ControlHolder::setPosSize( const Rectangle& _rPosSize ) const
{
// no check whether we're valid, this is the responsibility of the caller
- m_xControlWindow->setPosSize(
- _rPosSize.Left(), _rPosSize.Top(), _rPosSize.GetWidth(), _rPosSize.GetHeight(),
- POSSIZE
- );
+
+ // don't call setPosSize when pos/size did not change
+ // #i104181# / 2009-08-18 / frank.schoenheit@sun.com
+ ::Rectangle aCurrentRect( getPosSize() );
+ if ( aCurrentRect != _rPosSize )
+ {
+ m_xControlWindow->setPosSize(
+ _rPosSize.Left(), _rPosSize.Top(), _rPosSize.GetWidth(), _rPosSize.GetHeight(),
+ POSSIZE
+ );
+ }
}
//--------------------------------------------------------------------
@@ -447,7 +458,10 @@ namespace sdr { namespace contact {
{
private:
/// the instance whose IMPL we are
- ViewObjectContactOfUnoControl* m_pAntiImpl;
+ ViewObjectContactOfUnoControl* m_pAntiImpl;
+
+ /// are we currently inside impl_ensureControl_nothrow?
+ bool m_bCreatingControl;
/** thread safety
@@ -830,6 +844,7 @@ namespace sdr { namespace contact {
//--------------------------------------------------------------------
ViewObjectContactOfUnoControl_Impl::ViewObjectContactOfUnoControl_Impl( ViewObjectContactOfUnoControl* _pAntiImpl )
:m_pAntiImpl( _pAntiImpl )
+ ,m_bCreatingControl( false )
,m_pOutputDeviceForWindow( NULL )
,m_bControlIsVisible( false )
,m_bIsDesignModeListening( false )
@@ -971,9 +986,36 @@ namespace sdr { namespace contact {
return rPageWindow.GetPaintWindow().GetOutputDevice();
}
+ namespace
+ {
+ static void lcl_resetFlag( bool& rbFlag )
+ {
+ rbFlag = false;
+ }
+ }
+
//--------------------------------------------------------------------
bool ViewObjectContactOfUnoControl_Impl::impl_ensureControl_nothrow( IPageViewAccess& _rPageView, const OutputDevice& _rDevice )
{
+ if ( m_bCreatingControl )
+ {
+ OSL_ENSURE( false, "ViewObjectContactOfUnoControl_Impl::impl_ensureControl_nothrow: reentrance is not really good here!" );
+ // We once had a situation where this was called reentrantly, which lead to all kind of strange effects. All
+ // those affected the grid control, which is the only control so far which is visible in design mode (and
+ // not only in alive mode).
+ // Creating the control triggered an Window::Update on some of its child windows, which triggered a
+ // Paint on parent of the grid control (e.g. the SwEditWin), which triggered a reentrant call to this method,
+ // which it is not really prepared for.
+ //
+ // /me thinks that re-entrance should be caught on a higher level, i.e. the Drawing Layer should not allow
+ // reentrant paint requests. For the moment, until /me can discuss this with AW, catch it here.
+ // 2009-08-27 / #i104544# frank.schoenheit@sun.com
+ return false;
+ }
+
+ m_bCreatingControl = true;
+ ::comphelper::ScopeGuard aGuard( ::boost::bind( lcl_resetFlag, ::boost::ref( m_bCreatingControl ) ) );
+
if ( m_aControl.is() )
{
if ( m_pOutputDeviceForWindow == &_rDevice )
diff --git a/svx/source/sdr/overlay/makefile.mk b/svx/source/sdr/overlay/makefile.mk
index bb6489606283..d202992c090d 100644
--- a/svx/source/sdr/overlay/makefile.mk
+++ b/svx/source/sdr/overlay/makefile.mk
@@ -56,6 +56,7 @@ SLOFILES=\
$(SLO)$/overlaypolypolygon.obj \
$(SLO)$/overlayprimitive2dsequenceobject.obj \
$(SLO)$/overlayrollingrectangle.obj \
+ $(SLO)$/overlayselection.obj \
$(SLO)$/overlaytools.obj \
$(SLO)$/overlaytriangle.obj
diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
index 2b664e816d42..3fedc40f37cf 100644
--- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
+++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
@@ -39,6 +39,7 @@
#include <vcl/bitmap.hxx>
#include <tools/stream.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <vcl/cursor.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -255,15 +256,21 @@ namespace sdr
maBufferRememberedRangePixel.getMaxX(), maBufferRememberedRangePixel.getMaxY());
aBufferRememberedRangeLogic.transform(getOutputDevice().GetInverseViewTransformation());
+ // prepare cursor handling
const bool bTargetIsWindow(OUTDEV_WINDOW == rmOutputDevice.GetOutDevType());
- Cursor* pCursor = 0;
+ bool bCursorWasEnabled(false);
- // #i75172# switch off VCL cursor during overlay refresh
+ // #i80730# switch off VCL cursor during overlay refresh
if(bTargetIsWindow)
{
Window& rWindow = static_cast< Window& >(rmOutputDevice);
- pCursor = rWindow.GetCursor();
- rWindow.SetCursor(0);
+ Cursor* pCursor = rWindow.GetCursor();
+
+ if(pCursor && pCursor->IsVisible())
+ {
+ pCursor->Hide();
+ bCursorWasEnabled = true;
+ }
}
if(DoRefreshWithPreRendering())
@@ -363,49 +370,19 @@ namespace sdr
OverlayManager::ImpDrawMembers(aBufferRememberedRangeLogic, getOutputDevice());
}
- // VCL hack for transparent child windows
- // Problem is e.g. a radiobuttion form control in life mode. The used window
- // is a transparence vcl childwindow. This flag only allows the parent window to
- // paint into the child windows area, but there is no mechanism which takes
- // care for a repaint of the child window. A transparent child window is NOT
- // a window which always keeps it's content consistent over the parent, but it's
- // more like just a paint flag for the parent.
- // To get the update, the windows in question are updated manulally here.
- if(bTargetIsWindow)
+ // #i80730# restore visibility of VCL cursor
+ if(bCursorWasEnabled)
{
Window& rWindow = static_cast< Window& >(rmOutputDevice);
+ Cursor* pCursor = rWindow.GetCursor();
- if(rWindow.IsChildTransparentModeEnabled() && rWindow.GetChildCount())
+ if(pCursor)
{
- const Rectangle aRegionRectanglePixel(
- maBufferRememberedRangePixel.getMinX(), maBufferRememberedRangePixel.getMinY(),
- maBufferRememberedRangePixel.getMaxX(), maBufferRememberedRangePixel.getMaxY());
-
- for(sal_uInt16 a(0); a < rWindow.GetChildCount(); a++)
- {
- Window* pCandidate = rWindow.GetChild(a);
-
- if(pCandidate && pCandidate->IsPaintTransparent())
- {
- const Rectangle aCandidatePosSizePixel(pCandidate->GetPosPixel(), pCandidate->GetSizePixel());
-
- if(aCandidatePosSizePixel.IsOver(aRegionRectanglePixel))
- {
- pCandidate->Invalidate(INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN);
- pCandidate->Update();
- }
- }
- }
+ // check if cursor still exists. It may have been deleted from someone
+ pCursor->Show();
}
}
- // #i75172# restore VCL cursor
- if(bTargetIsWindow)
- {
- Window& rWindow = static_cast< Window& >(rmOutputDevice);
- rWindow.SetCursor(pCursor);
- }
-
// forget remembered Region
maBufferRememberedRangePixel.reset();
}
diff --git a/svx/source/sdr/overlay/overlayobject.cxx b/svx/source/sdr/overlay/overlayobject.cxx
index 4c05fbd48a23..5cddc3c63627 100644
--- a/svx/source/sdr/overlay/overlayobject.cxx
+++ b/svx/source/sdr/overlay/overlayobject.cxx
@@ -107,7 +107,7 @@ namespace sdr
OSL_ENSURE(0 == getOverlayManager(), "OverlayObject is destructed which is still registered at OverlayManager (!)");
}
- const drawinglayer::primitive2d::Primitive2DSequence& OverlayObject::getOverlayObjectPrimitive2DSequence() const
+ drawinglayer::primitive2d::Primitive2DSequence OverlayObject::getOverlayObjectPrimitive2DSequence() const
{
if(!getPrimitive2DSequence().hasElements())
{
diff --git a/svx/source/sdr/overlay/overlayselection.cxx b/svx/source/sdr/overlay/overlayselection.cxx
new file mode 100644
index 000000000000..2411ca3c31b4
--- /dev/null
+++ b/svx/source/sdr/overlay/overlayselection.cxx
@@ -0,0 +1,233 @@
+/*************************************************************************
+ *
+ * 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: overlayline.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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/sdr/overlay/overlayselection.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/outdev.hxx>
+#include <drawinglayer/primitive2d/invertprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ // combine rages geometrically to a single, ORed polygon
+ basegfx::B2DPolyPolygon impCombineRangesToPolyPolygon(const std::vector< basegfx::B2DRange >& rRanges)
+ {
+ const sal_uInt32 nCount(rRanges.size());
+ basegfx::B2DPolyPolygon aRetval;
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ const basegfx::B2DPolygon aDiscretePolygon(basegfx::tools::createPolygonFromRect(rRanges[a]));
+
+ if(0 == a)
+ {
+ aRetval.append(aDiscretePolygon);
+ }
+ else
+ {
+ aRetval = basegfx::tools::solvePolygonOperationOr(aRetval, basegfx::B2DPolyPolygon(aDiscretePolygon));
+ }
+ }
+
+ return aRetval;
+ }
+
+ // check if wanted type OVERLAY_TRANSPARENT or OVERLAY_SOLID
+ // is possible. If not, fallback to invert mode (classic mode)
+ OverlayType impCheckPossibleOverlayType(OverlayType aOverlayType)
+ {
+ if(OVERLAY_INVERT != aOverlayType)
+ {
+ const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+
+ if(!aSvtOptionsDrawinglayer.IsTransparentSelection())
+ {
+ // not possible when switched off by user
+ return OVERLAY_INVERT;
+ }
+ else
+ {
+ const OutputDevice *pOut = Application::GetDefaultDevice();
+
+ if(pOut->GetSettings().GetStyleSettings().GetHighContrastMode())
+ {
+ // not possible when in high contrast mode
+ return OVERLAY_INVERT;
+ }
+
+ if(!pOut->supportsOperation(OutDevSupport_TransparentRect))
+ {
+ // not possible when no fast transparence paint is supported on the system
+ return OVERLAY_INVERT;
+ }
+ }
+ }
+
+ return aOverlayType;
+ }
+
+ drawinglayer::primitive2d::Primitive2DSequence OverlaySelection::createOverlayObjectPrimitive2DSequence()
+ {
+ drawinglayer::primitive2d::Primitive2DSequence aRetval;
+ const sal_uInt32 nCount(getRanges().size());
+
+ if(nCount)
+ {
+ // create range primitives
+ const basegfx::BColor aRGBColor(getBaseColor().getBColor());
+ aRetval.realloc(nCount);
+
+ for(sal_uInt32 a(0);a < nCount; a++)
+ {
+ const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(maRanges[a]));
+ aRetval[a] = drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+ basegfx::B2DPolyPolygon(aPolygon),
+ aRGBColor));
+ }
+
+ if(OVERLAY_INVERT == maLastOverlayType)
+ {
+ // embed all in invert primitive
+ const drawinglayer::primitive2d::Primitive2DReference aInvert(
+ new drawinglayer::primitive2d::InvertPrimitive2D(
+ aRetval));
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aInvert, 1);
+ }
+ else if(OVERLAY_TRANSPARENT == maLastOverlayType)
+ {
+ // embed all rectangles in transparent paint
+ const double fTransparence(mnLastTransparence / 100.0);
+ const drawinglayer::primitive2d::Primitive2DReference aUnifiedAlpha(
+ new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ aRetval,
+ fTransparence));
+
+ if(getBorder())
+ {
+ const basegfx::B2DPolyPolygon aPolyPolygon(impCombineRangesToPolyPolygon(getRanges()));
+ const drawinglayer::primitive2d::Primitive2DReference aSelectionOutline(
+ new drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D(
+ aPolyPolygon,
+ aRGBColor));
+
+ // add both to result
+ aRetval.realloc(2);
+ aRetval[0] = aUnifiedAlpha;
+ aRetval[1] = aSelectionOutline;
+ }
+ else
+ {
+ // just add transparent part
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlpha, 1);
+ }
+ }
+ }
+
+ return aRetval;
+ }
+
+ OverlaySelection::OverlaySelection(
+ OverlayType eType,
+ const Color& rColor,
+ const std::vector< basegfx::B2DRange >& rRanges,
+ bool bBorder)
+ : OverlayObject(rColor),
+ meOverlayType(eType),
+ maRanges(rRanges),
+ maLastOverlayType(eType),
+ mnLastTransparence(0),
+ mbBorder(bBorder)
+ {
+ // no AA for selection overlays
+ allowAntiAliase(false);
+ }
+
+ OverlaySelection::~OverlaySelection()
+ {
+ if(getOverlayManager())
+ {
+ getOverlayManager()->remove(*this);
+ }
+ }
+
+ drawinglayer::primitive2d::Primitive2DSequence OverlaySelection::getOverlayObjectPrimitive2DSequence() const
+ {
+ // get current values
+ const OverlayType aNewOverlayType(impCheckPossibleOverlayType(meOverlayType));
+ const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+ const sal_uInt16 nNewTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent());
+
+ if(getPrimitive2DSequence().hasElements())
+ {
+ if(aNewOverlayType != maLastOverlayType
+ || nNewTransparence != mnLastTransparence)
+ {
+ // conditions of last local decomposition have changed, delete
+ const_cast< OverlaySelection* >(this)->setPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DSequence());
+ }
+ }
+
+ if(!getPrimitive2DSequence().hasElements())
+ {
+ // remember new values
+ const_cast< OverlaySelection* >(this)->maLastOverlayType = aNewOverlayType;
+ const_cast< OverlaySelection* >(this)->mnLastTransparence = nNewTransparence;
+ }
+
+ // call base implementation
+ return OverlayObject::getOverlayObjectPrimitive2DSequence();
+ }
+
+ void OverlaySelection::setRanges(const std::vector< basegfx::B2DRange >& rNew)
+ {
+ if(rNew != maRanges)
+ {
+ maRanges = rNew;
+ objectChange();
+ }
+ }
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/primitive2d/makefile.mk b/svx/source/sdr/primitive2d/makefile.mk
index e9e976d434ed..7510b6a23b35 100644
--- a/svx/source/sdr/primitive2d/makefile.mk
+++ b/svx/source/sdr/primitive2d/makefile.mk
@@ -51,6 +51,7 @@ SLOFILES=\
$(SLO)$/sdrcaptionprimitive2d.obj \
$(SLO)$/sdrgrafprimitive2d.obj \
$(SLO)$/sdrole2primitive2d.obj \
+ $(SLO)$/sdrolecontentprimitive2d.obj \
$(SLO)$/sdrpathprimitive2d.obj \
$(SLO)$/sdrprimitivetools.obj \
$(SLO)$/sdrmeasureprimitive2d.obj \
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 277ee70f82ca..4e57166b4723 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -76,6 +76,7 @@
#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <drawinglayer/attribute/sdrallattribute3d.hxx>
#include <svx/rectenum.hxx>
+#include <svx/sdtfchim.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -519,7 +520,7 @@ namespace drawinglayer
}
}
- const SdrFitToSizeType eFit = rTextObj.GetFitToSize();
+ const SdrFitToSizeType eFit(rTextObj.GetFitToSize());
const SdrTextAniKind eAniKind(rTextObj.GetTextAniKind());
pRetval = new attribute::SdrTextAttribute(
@@ -530,12 +531,15 @@ namespace drawinglayer
pUpper ? *pUpper : rTextObj.GetTextUpperDistance(),
pRight ? *pRight : rTextObj.GetTextRightDistance(),
pLower ? *pLower : rTextObj.GetTextLowerDistance(),
+ rTextObj.GetTextHorizontalAdjust(rSet),
+ rTextObj.GetTextVerticalAdjust(rSet),
((const SdrTextContourFrameItem&)rSet.Get(SDRATTR_TEXT_CONTOURFRAME)).GetValue(),
(SDRTEXTFIT_PROPORTIONAL == eFit || SDRTEXTFIT_ALLLINES == eFit),
((const XFormTextHideFormItem&)rSet.Get(XATTR_FORMTXTHIDEFORM)).GetValue(),
SDRTEXTANI_BLINK == eAniKind,
SDRTEXTANI_SCROLL == eAniKind || SDRTEXTANI_ALTERNATE == eAniKind || SDRTEXTANI_SLIDE == eAniKind,
- bInEditMode);
+ bInEditMode,
+ ((const SdrTextFixedCellHeightItem&)rSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue());
}
return pRetval;
diff --git a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
index 80067901483b..3c8feb7ff2b2 100644
--- a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
@@ -50,62 +50,95 @@ namespace drawinglayer
Primitive2DSequence SdrCaptionPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
+ Primitive2DSequence aHitTestContent;
// create unit outline polygon
- ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromRect(::basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), getCornerRadiusX(), getCornerRadiusY()));
+ const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(
+ basegfx::B2DRange(0.0, 0.0, 1.0, 1.0),
+ getCornerRadiusX(),
+ getCornerRadiusY()));
// add fill
if(getSdrLFSTAttribute().getFill())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ *getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
+ }
+ else
+ {
+ // if no fill, create one for HitTest and BoundRect fallback
+ appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ attribute::SdrFillAttribute(0.0, basegfx::BColor(0.0, 0.0, 0.0)),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
if(getSdrLFSTAttribute().getLine())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(getTail(), getTransform(), *getSdrLFSTAttribute().getLine(), getSdrLFSTAttribute().getLineStartEnd()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aUnitOutline,
+ getTransform(),
+ *getSdrLFSTAttribute().getLine()));
+
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ getTail(),
+ getTransform(),
+ *getSdrLFSTAttribute().getLine(),
+ getSdrLFSTAttribute().getLineStartEnd()));
}
else
{
- // if initially no line is defined, create one for HitTest and BoundRect
- Primitive2DSequence aLineSequence(2);
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
-
- aLineSequence[0] = createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline);
- aLineSequence[1] = createPolygonLinePrimitive(getTail(), getTransform(), aBlackHairline);
+ // if initially no line is defined, create one for HitTest and BoundRect. It
+ // is sufficient to use the tail; the body is already ensured with fill creation
+ appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
+ createPolygonLinePrimitive(
+ getTail(),
+ getTransform(),
+ attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0))));
+ }
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(aLineSequence)));
+ // add HitTest and BoundRect helper geometry (if exists)
+ if(aHitTestContent.hasElements())
+ {
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ Primitive2DReference(new HitTestPrimitive2D(aHitTestContent)));
}
// add text
if(getSdrLFSTAttribute().getText())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ *getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false));
}
// add shadow
if(getSdrLFSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
}
return aRetval;
}
SdrCaptionPrimitive2D::SdrCaptionPrimitive2D(
- const ::basegfx::B2DHomMatrix& rTransform,
+ const basegfx::B2DHomMatrix& rTransform,
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
- const ::basegfx::B2DPolygon& rTail,
+ const basegfx::B2DPolygon& rTail,
double fCornerRadiusX,
double fCornerRadiusY)
: BasePrimitive2D(),
@@ -118,7 +151,7 @@ namespace drawinglayer
// transform maTail to unit polygon
if(getTail().count())
{
- ::basegfx::B2DHomMatrix aInverse(getTransform());
+ basegfx::B2DHomMatrix aInverse(getTransform());
aInverse.invert();
maTail.transform(aInverse);
}
diff --git a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
index 5ee00133588f..0edbe1a35046 100644
--- a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
@@ -78,15 +78,7 @@ namespace drawinglayer
// add shadow
if(getSdrLSTAttribute().getShadow())
{
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLSTAttribute().getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
index 51be7cd03033..497266433d67 100644
--- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
@@ -56,22 +56,18 @@ namespace drawinglayer
{
const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(
- basegfx::B2DPolyPolygon(aUnitOutline), getTextBox(), *getSdrSTAttribute().getText(), 0, false, getWordWrap()));
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTextBox(),
+ *getSdrSTAttribute().getText(),
+ 0,
+ isForceTextClipToTextRange(), // #SJ# use CellText mode; text upper-left
+ getWordWrap()));
}
// add shadow
- if(getSdrSTAttribute().getShadow())
+ if(aRetval.hasElements() && getSdrSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrSTAttribute().getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrSTAttribute().getShadow());
}
return aRetval;
@@ -81,12 +77,14 @@ namespace drawinglayer
const attribute::SdrShadowTextAttribute& rSdrSTAttribute,
const Primitive2DSequence& rSubPrimitives,
const basegfx::B2DHomMatrix& rTextBox,
- bool bWordWrap)
+ bool bWordWrap,
+ bool bForceTextClipToTextRange)
: BasePrimitive2D(),
maSdrSTAttribute(rSdrSTAttribute),
maSubPrimitives(rSubPrimitives),
maTextBox(rTextBox),
- mbWordWrap(bWordWrap)
+ mbWordWrap(bWordWrap),
+ mbForceTextClipToTextRange(bForceTextClipToTextRange)
{
}
@@ -99,7 +97,8 @@ namespace drawinglayer
return (getSdrSTAttribute() == rCompare.getSdrSTAttribute()
&& getSubPrimitives() == rCompare.getSubPrimitives()
&& getTextBox() == rCompare.getTextBox()
- && getWordWrap() == rCompare.getWordWrap());
+ && getWordWrap() == rCompare.getWordWrap()
+ && isForceTextClipToTextRange() == rCompare.isForceTextClipToTextRange());
}
return false;
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 366b934b5473..09769a2a013e 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -67,13 +67,13 @@ namespace drawinglayer
namespace primitive2d
{
Primitive2DReference createPolyPolygonFillPrimitive(
- const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon,
- const ::basegfx::B2DHomMatrix& rObjectTransform,
+ const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrFillAttribute& rFill,
const attribute::FillGradientAttribute* pFillGradient)
{
// prepare fully scaled polygon
- ::basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
+ basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
aScaledPolyPolygon.transform(rObjectTransform);
BasePrimitive2D* pNewFillPrimitive = 0L;
@@ -87,7 +87,7 @@ namespace drawinglayer
}
else if(rFill.isBitmap())
{
- const ::basegfx::B2DRange aRange(::basegfx::tools::getRange(aScaledPolyPolygon));
+ const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon));
pNewFillPrimitive = new PolyPolygonBitmapPrimitive2D(aScaledPolyPolygon, rFill.getColor(), rFill.getBitmap()->getFillBitmapAttribute(aRange));
}
else
@@ -110,7 +110,7 @@ namespace drawinglayer
// create FillGradientPrimitive2D for transparence and add to new sequence
// fillGradientPrimitive is enough here (compared to PolyPolygonGradientPrimitive2D) since float transparence will be masked anyways
- const ::basegfx::B2DRange aRange(::basegfx::tools::getRange(aScaledPolyPolygon));
+ const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon));
const Primitive2DReference xRefB(new FillGradientPrimitive2D(aRange, *pFillGradient));
const Primitive2DSequence aAlpha(&xRefB, 1L);
@@ -125,13 +125,13 @@ namespace drawinglayer
}
Primitive2DReference createPolygonLinePrimitive(
- const ::basegfx::B2DPolygon& rUnitPolygon,
- const ::basegfx::B2DHomMatrix& rObjectTransform,
+ const basegfx::B2DPolygon& rUnitPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrLineAttribute& rLine,
const attribute::SdrLineStartEndAttribute* pStroke)
{
// prepare fully scaled polygon
- ::basegfx::B2DPolygon aScaledPolygon(rUnitPolygon);
+ basegfx::B2DPolygon aScaledPolygon(rUnitPolygon);
aScaledPolygon.transform(rObjectTransform);
// create line and stroke attribute
@@ -168,14 +168,14 @@ namespace drawinglayer
}
Primitive2DReference createTextPrimitive(
- const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon,
- const ::basegfx::B2DHomMatrix& rObjectTransform,
+ const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrTextAttribute& rText,
const attribute::SdrLineAttribute* pStroke,
bool bCellText,
bool bWordWrap)
{
- ::basegfx::B2DHomMatrix aAnchorTransform(rObjectTransform);
+ basegfx::B2DHomMatrix aAnchorTransform(rObjectTransform);
SdrTextPrimitive2D* pNew = 0;
if(rText.isContour())
@@ -185,20 +185,20 @@ namespace drawinglayer
{
// take line width into account and shrink contour polygon accordingly
// decompose to get scale
- ::basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale, aTranslate;
double fRotate, fShearX;
rObjectTransform.decompose(aScale, aTranslate, fRotate, fShearX);
// scale outline to object's size to allow growing with value relative to that size
// and also to keep aspect ratio
- ::basegfx::B2DHomMatrix aScaleTransform;
+ basegfx::B2DHomMatrix aScaleTransform;
aScaleTransform.set(0, 0, fabs(aScale.getX()));
aScaleTransform.set(1, 1, fabs(aScale.getY()));
- ::basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon);
+ basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon);
aScaledUnitPolyPolygon.transform(aScaleTransform);
// grow the polygon. To shrink, use negative value (half width)
- aScaledUnitPolyPolygon = ::basegfx::tools::growInNormalDirection(aScaledUnitPolyPolygon, -(pStroke->getWidth() * 0.5));
+ aScaledUnitPolyPolygon = basegfx::tools::growInNormalDirection(aScaledUnitPolyPolygon, -(pStroke->getWidth() * 0.5));
// scale back to unit polygon
aScaleTransform.set(0, 0, 0.0 != aScale.getX() ? 1.0 / aScale.getX() : 1.0);
@@ -225,7 +225,7 @@ namespace drawinglayer
else if(rText.getSdrFormTextAttribute())
{
// text on path, use scaled polygon
- ::basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
+ basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
aScaledPolyPolygon.transform(rObjectTransform);
pNew = new SdrPathTextPrimitive2D(
&rText.getSdrText(),
@@ -237,29 +237,29 @@ namespace drawinglayer
{
// rObjectTransform is the whole SdrObject transformation from unit rectangle
// to it's size and position. Decompose to allow working with single values.
- ::basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale, aTranslate;
double fRotate, fShearX;
rObjectTransform.decompose(aScale, aTranslate, fRotate, fShearX);
// extract mirroring
- const bool bMirrorX(::basegfx::fTools::less(aScale.getX(), 0.0));
- const bool bMirrorY(::basegfx::fTools::less(aScale.getY(), 0.0));
+ const bool bMirrorX(basegfx::fTools::less(aScale.getX(), 0.0));
+ const bool bMirrorY(basegfx::fTools::less(aScale.getY(), 0.0));
aScale = basegfx::absolute(aScale);
// Get the real size, since polygon ountline and scale
// from the object transformation may vary (e.g. ellipse segments)
- ::basegfx::B2DHomMatrix aJustScaleTransform;
+ basegfx::B2DHomMatrix aJustScaleTransform;
aJustScaleTransform.set(0, 0, aScale.getX());
aJustScaleTransform.set(1, 1, aScale.getY());
- ::basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon);
+ basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon);
aScaledUnitPolyPolygon.transform(aJustScaleTransform);
- const ::basegfx::B2DRange aSnapRange(::basegfx::tools::getRange(aScaledUnitPolyPolygon));
+ const basegfx::B2DRange aSnapRange(basegfx::tools::getRange(aScaledUnitPolyPolygon));
// create a range describing the wanted text position and size (aTextAnchorRange). This
// means to use the text distance values here
- const ::basegfx::B2DPoint aTopLeft(aSnapRange.getMinX() + rText.getTextLeftDistance(), aSnapRange.getMinY() + rText.getTextUpperDistance());
- const ::basegfx::B2DPoint aBottomRight(aSnapRange.getMaxX() - rText.getTextRightDistance(), aSnapRange.getMaxY() - rText.getTextLowerDistance());
- ::basegfx::B2DRange aTextAnchorRange;
+ const basegfx::B2DPoint aTopLeft(aSnapRange.getMinX() + rText.getTextLeftDistance(), aSnapRange.getMinY() + rText.getTextUpperDistance());
+ const basegfx::B2DPoint aBottomRight(aSnapRange.getMaxX() - rText.getTextRightDistance(), aSnapRange.getMaxY() - rText.getTextLowerDistance());
+ basegfx::B2DRange aTextAnchorRange;
aTextAnchorRange.expand(aTopLeft);
aTextAnchorRange.expand(aBottomRight);
@@ -282,7 +282,8 @@ namespace drawinglayer
pNew = new SdrStretchTextPrimitive2D(
&rText.getSdrText(),
rText.getOutlinerParaObject(),
- aAnchorTransform);
+ aAnchorTransform,
+ rText.isFixedCellHeight());
}
else // text in range
{
@@ -291,6 +292,9 @@ namespace drawinglayer
&rText.getSdrText(),
rText.getOutlinerParaObject(),
aAnchorTransform,
+ rText.getSdrTextHorzAdjust(),
+ rText.getSdrTextVertAdjust(),
+ rText.isFixedCellHeight(),
rText.isScroll(),
bCellText,
bWordWrap);
@@ -331,16 +335,16 @@ namespace drawinglayer
const bool bHorizontal(SDRTEXTANI_LEFT == eDirection || SDRTEXTANI_RIGHT == eDirection);
// decompose to get separated values for the scroll box
- ::basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale, aTranslate;
double fRotate, fShearX;
aAnchorTransform.decompose(aScale, aTranslate, fRotate, fShearX);
// build transform from scaled only to full AnchorTransform and inverse
- ::basegfx::B2DHomMatrix aSRT;
+ basegfx::B2DHomMatrix aSRT;
aSRT.shearX(fShearX);
aSRT.rotate(fRotate);
aSRT.translate(aTranslate.getX(), aTranslate.getY());
- ::basegfx::B2DHomMatrix aISRT(aSRT);
+ basegfx::B2DHomMatrix aISRT(aSRT);
aISRT.invert();
// bring the primitive back to scaled only and get scaled range, create new clone for this
@@ -355,13 +359,13 @@ namespace drawinglayer
geometry::ViewInformation2D aViewInformation2D(xViewParameters);
// get range
- const ::basegfx::B2DRange aScaledRange(pNew->getB2DRange(aViewInformation2D));
+ const basegfx::B2DRange aScaledRange(pNew->getB2DRange(aViewInformation2D));
// create left outside and right outside transformations. Also take care
// of the clip rectangle
- ::basegfx::B2DHomMatrix aLeft, aRight;
- ::basegfx::B2DPoint aClipTopLeft(0.0, 0.0);
- ::basegfx::B2DPoint aClipBottomRight(aScale.getX(), aScale.getY());
+ basegfx::B2DHomMatrix aLeft, aRight;
+ basegfx::B2DPoint aClipTopLeft(0.0, 0.0);
+ basegfx::B2DPoint aClipBottomRight(aScale.getX(), aScale.getY());
if(bHorizontal)
{
@@ -410,10 +414,10 @@ namespace drawinglayer
const Primitive2DSequence aContent(&xRefA, 1L);
// scrolling needs an encapsulating clipping primitive
- const ::basegfx::B2DRange aClipRange(aClipTopLeft, aClipBottomRight);
- ::basegfx::B2DPolygon aClipPolygon(::basegfx::tools::createPolygonFromRect(aClipRange));
+ const basegfx::B2DRange aClipRange(aClipTopLeft, aClipBottomRight);
+ basegfx::B2DPolygon aClipPolygon(basegfx::tools::createPolygonFromRect(aClipRange));
aClipPolygon.transform(aSRT);
- return Primitive2DReference(new MaskPrimitive2D(::basegfx::B2DPolyPolygon(aClipPolygon), aContent));
+ return Primitive2DReference(new MaskPrimitive2D(basegfx::B2DPolyPolygon(aClipPolygon), aContent));
}
else
{
@@ -441,36 +445,43 @@ namespace drawinglayer
}
}
- Primitive2DReference createShadowPrimitive(
- const Primitive2DSequence& rSource,
+ Primitive2DSequence createEmbeddedShadowPrimitive(
+ const Primitive2DSequence& rContent,
const attribute::SdrShadowAttribute& rShadow)
{
- // create Shadow primitives. Need to be added in front, should use already created primitives
- if(rSource.hasElements())
+ if(rContent.hasElements())
{
+ Primitive2DSequence aRetval(2);
+ basegfx::B2DHomMatrix aShadowOffset;
+
// prepare shadow offset
- ::basegfx::B2DHomMatrix aShadowOffset;
aShadowOffset.set(0, 2, rShadow.getOffset().getX());
aShadowOffset.set(1, 2, rShadow.getOffset().getY());
// create shadow primitive and add content
- const Primitive2DReference xRefShadow(new ShadowPrimitive2D(aShadowOffset, rShadow.getColor(), rSource));
+ aRetval[0] = Primitive2DReference(
+ new ShadowPrimitive2D(
+ aShadowOffset,
+ rShadow.getColor(),
+ rContent));
if(0.0 != rShadow.getTransparence())
{
// create SimpleTransparencePrimitive2D
- const Primitive2DSequence aContent(&xRefShadow, 1L);
- return Primitive2DReference(new UnifiedAlphaPrimitive2D(aContent, rShadow.getTransparence()));
- }
- else
- {
- // return directly
- return xRefShadow;
+ const Primitive2DSequence aTempContent(&aRetval[0], 1);
+
+ aRetval[0] = Primitive2DReference(
+ new UnifiedAlphaPrimitive2D(
+ aTempContent,
+ rShadow.getTransparence()));
}
+
+ aRetval[1] = Primitive2DReference(new GroupPrimitive2D(rContent));
+ return aRetval;
}
else
{
- return Primitive2DReference();
+ return rContent;
}
}
} // end of namespace primitive2d
diff --git a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
index 814c20b681ac..ed3062184f1a 100644
--- a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
@@ -100,16 +100,7 @@ namespace drawinglayer
// add shadow
if(getSdrLFSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
}
return aRetval;
@@ -206,16 +197,7 @@ namespace drawinglayer
// add shadow
if(getSdrLFSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
index f1f88684dc6c..f5f2f4e876dc 100644
--- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
@@ -110,16 +110,7 @@ namespace drawinglayer
// add shadow
if(getSdrLFSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
index 8d66e8b34d14..94e59f79c3de 100644
--- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
@@ -52,71 +52,71 @@ namespace drawinglayer
namespace primitive2d
{
Primitive2DReference SdrMeasurePrimitive2D::impCreatePart(
- const ::basegfx::B2DHomMatrix& rObjectMatrix,
- const ::basegfx::B2DPoint& rStart,
- const ::basegfx::B2DPoint& rEnd,
+ const basegfx::B2DHomMatrix& rObjectMatrix,
+ const basegfx::B2DPoint& rStart,
+ const basegfx::B2DPoint& rEnd,
bool bLeftActive,
bool bRightActive) const
{
- ::basegfx::B2DPolygon aPolygon;
+ basegfx::B2DPolygon aPolygon;
aPolygon.append(rStart);
aPolygon.append(rEnd);
- if(!maSdrLSTAttribute.getLineStartEnd() || (!bLeftActive && !bRightActive))
+ if(!getSdrLSTAttribute().getLineStartEnd() || (!bLeftActive && !bRightActive))
{
- return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *maSdrLSTAttribute.getLine(), 0L);
+ return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *getSdrLSTAttribute().getLine(), 0L);
}
if(bLeftActive && bRightActive)
{
- return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *maSdrLSTAttribute.getLine(), maSdrLSTAttribute.getLineStartEnd());
+ return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *getSdrLSTAttribute().getLine(), getSdrLSTAttribute().getLineStartEnd());
}
- const attribute::SdrLineStartEndAttribute* pLineStartEnd = maSdrLSTAttribute.getLineStartEnd();
- const ::basegfx::B2DPolyPolygon aEmpty;
+ const attribute::SdrLineStartEndAttribute* pLineStartEnd = getSdrLSTAttribute().getLineStartEnd();
+ const basegfx::B2DPolyPolygon aEmpty;
const attribute::SdrLineStartEndAttribute aLineStartEnd(
bLeftActive ? pLineStartEnd->getStartPolyPolygon() : aEmpty, bRightActive ? pLineStartEnd->getEndPolyPolygon() : aEmpty,
bLeftActive ? pLineStartEnd->getStartWidth() : 0.0, bRightActive ? pLineStartEnd->getEndWidth() : 0.0,
bLeftActive ? pLineStartEnd->isStartActive() : false, bRightActive ? pLineStartEnd->isEndActive() : false,
bLeftActive ? pLineStartEnd->isStartCentered() : false, bRightActive? pLineStartEnd->isEndCentered() : false);
- return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *maSdrLSTAttribute.getLine(), &aLineStartEnd);
+ return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *getSdrLSTAttribute().getLine(), &aLineStartEnd);
}
Primitive2DSequence SdrMeasurePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
SdrBlockTextPrimitive2D* pBlockText = 0L;
- ::basegfx::B2DRange aTextRange;
- double fTextX((maStart.getX() + maEnd.getX()) * 0.5);
- double fTextY((maStart.getX() + maEnd.getX()) * 0.5);
- const ::basegfx::B2DVector aLine(maEnd - maStart);
+ basegfx::B2DRange aTextRange;
+ double fTextX((getStart().getX() + getEnd().getX()) * 0.5);
+ double fTextY((getStart().getX() + getEnd().getX()) * 0.5);
+ const basegfx::B2DVector aLine(getEnd() - getStart());
const double fDistance(aLine.getLength());
const double fAngle(atan2(aLine.getY(), aLine.getX()));
bool bAutoUpsideDown(false);
- const attribute::SdrTextAttribute* pTextAttribute = maSdrLSTAttribute.getText();
+ const attribute::SdrTextAttribute* pTextAttribute = getSdrLSTAttribute().getText();
- ::basegfx::B2DHomMatrix aObjectMatrix;
+ basegfx::B2DHomMatrix aObjectMatrix;
aObjectMatrix.rotate(fAngle);
- aObjectMatrix.translate(maStart.getX(), maStart.getY());
+ aObjectMatrix.translate(getStart().getX(), getStart().getY());
if(pTextAttribute)
{
- ::basegfx::B2DHomMatrix aTextMatrix;
+ basegfx::B2DHomMatrix aTextMatrix;
double fTestAngle(fAngle);
- if(mbTextRotation)
+ if(getTextRotation())
{
aTextMatrix.rotate(-90.0 * F_PI180);
fTestAngle -= (90.0 * F_PI180);
- if(mbTextAutoAngle && fTestAngle < -F_PI)
+ if(getTextAutoAngle() && fTestAngle < -F_PI)
{
fTestAngle += F_2PI;
}
}
- if(mbTextAutoAngle)
+ if(getTextAutoAngle())
{
if(fTestAngle > (F_PI / 4.0) || fTestAngle < (-F_PI * (3.0 / 4.0)))
{
@@ -129,14 +129,17 @@ namespace drawinglayer
&pTextAttribute->getSdrText(),
pTextAttribute->getOutlinerParaObject(),
aTextMatrix,
+ SDRTEXTHORZADJUST_CENTER,
+ SDRTEXTVERTADJUST_CENTER,
pTextAttribute->isScroll(),
false,
+ false,
false);
aTextRange = pBlockText->getB2DRange(aViewInformation);
}
// prepare line attribute and result
- const attribute::SdrLineAttribute* pLineAttribute(maSdrLSTAttribute.getLine());
+ const attribute::SdrLineAttribute* pLineAttribute(getSdrLSTAttribute().getLine());
if(!pLineAttribute)
{
@@ -147,7 +150,7 @@ namespace drawinglayer
{
bool bArrowsOutside(false);
bool bMainLineSplitted(false);
- const attribute::SdrLineStartEndAttribute* pLineStartEnd = maSdrLSTAttribute.getLineStartEnd();
+ const attribute::SdrLineStartEndAttribute* pLineStartEnd = getSdrLSTAttribute().getLineStartEnd();
double fStartArrowW(0.0);
double fStartArrowH(0.0);
double fEndArrowW(0.0);
@@ -157,7 +160,7 @@ namespace drawinglayer
{
if(pLineStartEnd->isStartActive())
{
- const ::basegfx::B2DRange aArrowRange(::basegfx::tools::getRange(pLineStartEnd->getStartPolyPolygon()));
+ const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(pLineStartEnd->getStartPolyPolygon()));
fStartArrowW = pLineStartEnd->getStartWidth();
fStartArrowH = aArrowRange.getHeight() * fStartArrowW / aArrowRange.getWidth();
@@ -169,7 +172,7 @@ namespace drawinglayer
if(pLineStartEnd->isEndActive())
{
- const ::basegfx::B2DRange aArrowRange(::basegfx::tools::getRange(pLineStartEnd->getEndPolyPolygon()));
+ const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(pLineStartEnd->getEndPolyPolygon()));
fEndArrowW = pLineStartEnd->getEndWidth();
fEndArrowH = aArrowRange.getHeight() * fEndArrowW / aArrowRange.getWidth();
@@ -189,8 +192,8 @@ namespace drawinglayer
bArrowsOutside = true;
}
- MeasureTextPosition eHorizontal(meHorizontal);
- MeasureTextPosition eVertical(meVertical);
+ MeasureTextPosition eHorizontal(getHorizontal());
+ MeasureTextPosition eVertical(getVertical());
if(MEASURETEXTPOSITION_AUTOMATIC == eVertical)
{
@@ -237,7 +240,7 @@ namespace drawinglayer
}
// switch text above/below?
- if(mbBelow || (bAutoUpsideDown && !mbTextRotation))
+ if(getBelow() || (bAutoUpsideDown && !getTextRotation()))
{
if(MEASURETEXTPOSITION_NEGATIVE == eVertical)
{
@@ -249,9 +252,9 @@ namespace drawinglayer
}
}
- const double fMainLineOffset(mbBelow ? mfDistance : -mfDistance);
- const ::basegfx::B2DPoint aMainLeft(0.0, fMainLineOffset);
- const ::basegfx::B2DPoint aMainRight(fDistance, fMainLineOffset);
+ const double fMainLineOffset(getBelow() ? getDistance() : -getDistance());
+ const basegfx::B2DPoint aMainLeft(0.0, fMainLineOffset);
+ const basegfx::B2DPoint aMainRight(fDistance, fMainLineOffset);
// main line
if(bArrowsOutside)
@@ -271,8 +274,8 @@ namespace drawinglayer
}
}
- const ::basegfx::B2DPoint aMainLeftLeft(aMainLeft.getX() - fLenLeft, aMainLeft.getY());
- const ::basegfx::B2DPoint aMainRightRight(aMainRight.getX() + fLenRight, aMainRight.getY());
+ const basegfx::B2DPoint aMainLeftLeft(aMainLeft.getX() - fLenLeft, aMainLeft.getY());
+ const basegfx::B2DPoint aMainRightRight(aMainRight.getX() + fLenRight, aMainRight.getY());
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainLeftLeft, aMainLeft, false, true));
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainRight, aMainRightRight, true, false));
@@ -287,8 +290,8 @@ namespace drawinglayer
if(bMainLineSplitted)
{
const double fHalfLength((fDistance - (aTextRange.getWidth() + (fStartArrowH + fEndArrowH) * 0.25)) * 0.5);
- const ::basegfx::B2DPoint aMainInnerLeft(aMainLeft.getX() + fHalfLength, aMainLeft.getY());
- const ::basegfx::B2DPoint aMainInnerRight(aMainRight.getX() - fHalfLength, aMainRight.getY());
+ const basegfx::B2DPoint aMainInnerLeft(aMainLeft.getX() + fHalfLength, aMainLeft.getY());
+ const basegfx::B2DPoint aMainInnerRight(aMainRight.getX() - fHalfLength, aMainRight.getY());
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainLeft, aMainInnerLeft, true, false));
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainInnerRight, aMainRight, false, true));
@@ -300,19 +303,19 @@ namespace drawinglayer
}
// left/right help line value preparation
- const double fTopEdge(mbBelow ? mfUpper + mfDistance : -mfUpper - mfDistance);
- const double fBottomLeft(mbBelow ? mfLower - mfLeftDelta : mfLeftDelta - mfLower);
- const double fBottomRight(mbBelow ? mfLower - mfRightDelta : mfRightDelta - mfLower);
+ const double fTopEdge(getBelow() ? getUpper() + getDistance() : -getUpper() - getDistance());
+ const double fBottomLeft(getBelow() ? getLower() - getLeftDelta() : getLeftDelta() - getLower());
+ const double fBottomRight(getBelow() ? getLower() - getRightDelta() : getRightDelta() - getLower());
// left help line
- const ::basegfx::B2DPoint aLeftUp(0.0, fTopEdge);
- const ::basegfx::B2DPoint aLeftDown(0.0, fBottomLeft);
+ const basegfx::B2DPoint aLeftUp(0.0, fTopEdge);
+ const basegfx::B2DPoint aLeftDown(0.0, fBottomLeft);
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aLeftDown, aLeftUp, false, false));
// right help line
- const ::basegfx::B2DPoint aRightUp(fDistance, fTopEdge);
- const ::basegfx::B2DPoint aRightDown(fDistance, fBottomRight);
+ const basegfx::B2DPoint aRightUp(fDistance, fTopEdge);
+ const basegfx::B2DPoint aRightDown(fDistance, fBottomRight);
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aRightDown, aRightUp, false, false));
@@ -395,7 +398,7 @@ namespace drawinglayer
}
}
- if(!maSdrLSTAttribute.getLine())
+ if(!getSdrLSTAttribute().getLine())
{
// embed line geometry to invisible line group
const Primitive2DReference xHiddenLines(new HitTestPrimitive2D(aRetval));
@@ -408,7 +411,7 @@ namespace drawinglayer
if(pBlockText)
{
// create transformation to text primitive end position
- ::basegfx::B2DHomMatrix aChange;
+ basegfx::B2DHomMatrix aChange;
// handle auto text rotation
if(bAutoUpsideDown)
@@ -432,18 +435,9 @@ namespace drawinglayer
}
// add shadow
- if(maSdrLSTAttribute.getShadow())
+ if(getSdrLSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *maSdrLSTAttribute.getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLSTAttribute().getShadow());
}
return aRetval;
@@ -451,8 +445,8 @@ namespace drawinglayer
SdrMeasurePrimitive2D::SdrMeasurePrimitive2D(
const attribute::SdrLineShadowTextAttribute& rSdrLSTAttribute,
- const ::basegfx::B2DPoint& rStart,
- const ::basegfx::B2DPoint& rEnd,
+ const basegfx::B2DPoint& rStart,
+ const basegfx::B2DPoint& rEnd,
MeasureTextPosition eHorizontal,
MeasureTextPosition eVertical,
double fDistance,
@@ -486,19 +480,19 @@ namespace drawinglayer
{
const SdrMeasurePrimitive2D& rCompare = (SdrMeasurePrimitive2D&)rPrimitive;
- return (maStart == rCompare.maStart
- && maEnd == rCompare.maEnd
- && meHorizontal == rCompare.meHorizontal
- && meVertical == rCompare.meVertical
- && mfDistance == rCompare.mfDistance
- && mfUpper == rCompare.mfUpper
- && mfLower == rCompare.mfLower
- && mfLeftDelta == rCompare.mfLeftDelta
- && mfRightDelta == rCompare.mfRightDelta
- && mbBelow == rCompare.mbBelow
- && mbTextRotation == rCompare.mbTextRotation
- && mbTextAutoAngle == rCompare.mbTextAutoAngle
- && maSdrLSTAttribute == rCompare.maSdrLSTAttribute);
+ return (getStart() == rCompare.getStart()
+ && getEnd() == rCompare.getEnd()
+ && getHorizontal() == rCompare.getHorizontal()
+ && getVertical() == rCompare.getVertical()
+ && getDistance() == rCompare.getDistance()
+ && getUpper() == rCompare.getUpper()
+ && getLower() == rCompare.getLower()
+ && getLeftDelta() == rCompare.getLeftDelta()
+ && getRightDelta() == rCompare.getRightDelta()
+ && getBelow() == rCompare.getBelow()
+ && getTextRotation() == rCompare.getTextRotation()
+ && getTextAutoAngle() == rCompare.getTextAutoAngle()
+ && getSdrLSTAttribute() == rCompare.getSdrLSTAttribute());
}
return false;
diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
index 2cedb1bfce29..ab5d23962719 100644
--- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
@@ -116,16 +116,7 @@ namespace drawinglayer
// add shadow
if(!bBehaveCompatibleToPaintVersion && getSdrLFSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
new file mode 100644
index 000000000000..67fee9215b73
--- /dev/null
+++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
@@ -0,0 +1,200 @@
+/*************************************************************************
+ *
+ * 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: sdrcaptionprimitive2d.cxx,v $
+ *
+ * $Revision: 1.2.18.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.
+ *
+ ************************************************************************/
+
+#include "precompiled_svx.hxx"
+#include <svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx>
+#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
+#include <svx/svdoole2.hxx>
+#include <vcl/svapp.hxx>
+#include <drawinglayer/primitive2d/graphicprimitive2d.hxx>
+#include <svtools/colorcfg.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence SdrOleContentPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
+ {
+ Primitive2DSequence aRetval;
+ const SdrOle2Obj* pSource = (mpSdrOle2Obj.is() ? static_cast< SdrOle2Obj* >(mpSdrOle2Obj.get()) : 0);
+ bool bScaleContent(false);
+ Graphic aGraphic;
+
+ if(pSource)
+ {
+ Graphic* pOLEGraphic = (getHighContrast())
+ ? pSource->getEmbeddedObjectRef().GetHCGraphic()
+ : pSource->GetGraphic();
+
+ if(pOLEGraphic)
+ {
+ aGraphic = *pOLEGraphic;
+ bScaleContent = pSource->IsEmptyPresObj();
+ }
+ }
+
+ if(GRAPHIC_NONE == aGraphic.GetType())
+ {
+ // no source, use fallback ressource emty OLE graphic
+ const Bitmap aEmptyOLEBitmap(SdrOle2Obj::GetEmtyOLEReplacementBitmap());
+ aGraphic = Graphic(aEmptyOLEBitmap);
+ bScaleContent = true;
+ }
+
+ if(GRAPHIC_NONE != aGraphic.GetType())
+ {
+ const GraphicObject aGraphicObject(aGraphic);
+ const GraphicAttr aGraphicAttr;
+ drawinglayer::primitive2d::Primitive2DSequence xOLEContent;
+
+ if(bScaleContent)
+ {
+ // get transformation atoms
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ getObjectTransform().decompose(aScale, aTranslate, fRotate, fShearX);
+
+ // get PrefSize from the graphic in 100th mm
+ Size aPrefSize(aGraphic.GetPrefSize());
+
+ if(MAP_PIXEL == aGraphic.GetPrefMapMode().GetMapUnit())
+ {
+ aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM);
+ }
+ else
+ {
+ aPrefSize = Application::GetDefaultDevice()->LogicToLogic(aPrefSize, aGraphic.GetPrefMapMode(), MAP_100TH_MM);
+ }
+
+ const double fOffsetX((aScale.getX() - aPrefSize.getWidth()) / 2.0);
+ const double fOffsetY((aScale.getY() - aPrefSize.getHeight()) / 2.0);
+
+ if(basegfx::fTools::moreOrEqual(fOffsetX, 0.0) && basegfx::fTools::moreOrEqual(fOffsetY, 0.0))
+ {
+ // if content fits into frame, create it
+ basegfx::B2DHomMatrix aInnerObjectMatrix;
+
+ aInnerObjectMatrix.scale(aPrefSize.getWidth(), aPrefSize.getHeight());
+ aInnerObjectMatrix.translate(fOffsetX, fOffsetY);
+ aInnerObjectMatrix.shearX(fShearX);
+ aInnerObjectMatrix.rotate(fRotate);
+ aInnerObjectMatrix.translate(aTranslate.getX(), aTranslate.getY());
+
+ const drawinglayer::primitive2d::Primitive2DReference aGraphicPrimitive(
+ new drawinglayer::primitive2d::GraphicPrimitive2D(
+ aInnerObjectMatrix,
+ aGraphicObject,
+ aGraphicAttr));
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aGraphicPrimitive);
+ }
+ }
+ else
+ {
+ // create graphic primitive for content
+ const drawinglayer::primitive2d::Primitive2DReference aGraphicPrimitive(
+ new drawinglayer::primitive2d::GraphicPrimitive2D(
+ getObjectTransform(),
+ aGraphicObject,
+ aGraphicAttr));
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aGraphicPrimitive);
+ }
+
+ // a standard gray outline is created for scaled content
+ if(bScaleContent)
+ {
+ const svtools::ColorConfig aColorConfig;
+ const svtools::ColorConfigValue aColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES));
+
+ if(aColor.bIsVisible)
+ {
+ basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ const Color aVclColor(aColor.nColor);
+ aOutline.transform(getObjectTransform());
+ const drawinglayer::primitive2d::Primitive2DReference xOutline(
+ new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aVclColor.getBColor()));
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, xOutline);
+ }
+ }
+ }
+
+ // get graphic and check scale content state
+ return aRetval;
+ }
+
+ SdrOleContentPrimitive2D::SdrOleContentPrimitive2D(
+ const SdrOle2Obj& rSdrOle2Obj,
+ const basegfx::B2DHomMatrix& rObjectTransform,
+ bool bHighContrast)
+ : BasePrimitive2D(),
+ mpSdrOle2Obj(const_cast< SdrOle2Obj* >(&rSdrOle2Obj)),
+ maObjectTransform(rObjectTransform),
+ mbHighContrast(bHighContrast)
+ {
+ }
+
+ bool SdrOleContentPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const SdrOleContentPrimitive2D& rCompare = (SdrOleContentPrimitive2D&)rPrimitive;
+ const bool bBothNot(!mpSdrOle2Obj.is() && !rCompare.mpSdrOle2Obj.is());
+ const bool bBothAndEqual(mpSdrOle2Obj.is() && rCompare.mpSdrOle2Obj.is()
+ && mpSdrOle2Obj.get() == rCompare.mpSdrOle2Obj.get());
+
+ return ((bBothNot || bBothAndEqual)
+ && getObjectTransform() == rCompare.getObjectTransform()
+ && getHighContrast() == rCompare.getHighContrast());
+ }
+
+ return false;
+ }
+
+ basegfx::B2DRange SdrOleContentPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ basegfx::B2DRange aRange(0.0, 0.0, 1.0, 1.0);
+ aRange.transform(getObjectTransform());
+
+ return aRange;
+ }
+
+ // provide unique ID
+ ImplPrimitrive2DIDBlock(SdrOleContentPrimitive2D, PRIMITIVE2D_ID_SDROLECONTENTPRIMITIVE2D)
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
index 3b6a653a7bc6..91ed0bd2adce 100644
--- a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
@@ -52,22 +52,22 @@ namespace drawinglayer
Primitive2DSequence aRetval;
// add fill
- if(maSdrLFSTAttribute.getFill() && maUnitPolyPolygon.isClosed())
+ if(getSdrLFSTAttribute().getFill() && getUnitPolyPolygon().isClosed())
{
// take care for orientations
- ::basegfx::B2DPolyPolygon aOrientedUnitPolyPolygon(::basegfx::tools::correctOrientations(maUnitPolyPolygon));
+ basegfx::B2DPolyPolygon aOrientedUnitPolyPolygon(basegfx::tools::correctOrientations(getUnitPolyPolygon()));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(aOrientedUnitPolyPolygon, maTransform, *maSdrLFSTAttribute.getFill(), maSdrLFSTAttribute.getFillFloatTransGradient()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(aOrientedUnitPolyPolygon, getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(maSdrLFSTAttribute.getLine())
+ if(getSdrLFSTAttribute().getLine())
{
- Primitive2DSequence aTemp(maUnitPolyPolygon.count());
+ Primitive2DSequence aTemp(getUnitPolyPolygon().count());
- for(sal_uInt32 a(0L); a < maUnitPolyPolygon.count(); a++)
+ for(sal_uInt32 a(0L); a < getUnitPolyPolygon().count(); a++)
{
- aTemp[a] = createPolygonLinePrimitive(maUnitPolyPolygon.getB2DPolygon(a), maTransform, *maSdrLFSTAttribute.getLine(), maSdrLFSTAttribute.getLineStartEnd());
+ aTemp[a] = createPolygonLinePrimitive(getUnitPolyPolygon().getB2DPolygon(a), getTransform(), *getSdrLFSTAttribute().getLine(), getSdrLFSTAttribute().getLineStartEnd());
}
appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, aTemp);
@@ -76,44 +76,35 @@ namespace drawinglayer
{
// if initially no line is defined, create one for HitTest and BoundRect
const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- Primitive2DSequence xHiddenLineSequence(maUnitPolyPolygon.count());
+ Primitive2DSequence xHiddenLineSequence(getUnitPolyPolygon().count());
- for(sal_uInt32 a(0); a < maUnitPolyPolygon.count(); a++)
+ for(sal_uInt32 a(0); a < getUnitPolyPolygon().count(); a++)
{
- xHiddenLineSequence[a] = createPolygonLinePrimitive(maUnitPolyPolygon.getB2DPolygon(a), maTransform, aBlackHairline);
+ xHiddenLineSequence[a] = createPolygonLinePrimitive(getUnitPolyPolygon().getB2DPolygon(a), getTransform(), aBlackHairline);
}
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
}
// add text
- if(maSdrLFSTAttribute.getText())
+ if(getSdrLFSTAttribute().getText())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(maUnitPolyPolygon, maTransform, *maSdrLFSTAttribute.getText(), maSdrLFSTAttribute.getLine(), false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(getUnitPolyPolygon(), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false));
}
// add shadow
- if(maSdrLFSTAttribute.getShadow())
+ if(getSdrLFSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *maSdrLFSTAttribute.getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
}
return aRetval;
}
SdrPathPrimitive2D::SdrPathPrimitive2D(
- const ::basegfx::B2DHomMatrix& rTransform,
+ const basegfx::B2DHomMatrix& rTransform,
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
- const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon)
+ const basegfx::B2DPolyPolygon& rUnitPolyPolygon)
: BasePrimitive2D(),
maTransform(rTransform),
maSdrLFSTAttribute(rSdrLFSTAttribute),
@@ -127,9 +118,9 @@ namespace drawinglayer
{
const SdrPathPrimitive2D& rCompare = (SdrPathPrimitive2D&)rPrimitive;
- return (maUnitPolyPolygon == rCompare.maUnitPolyPolygon
- && maTransform == rCompare.maTransform
- && maSdrLFSTAttribute == rCompare.maSdrLFSTAttribute);
+ return (getUnitPolyPolygon() == rCompare.getUnitPolyPolygon()
+ && getTransform() == rCompare.getTransform()
+ && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute());
}
return false;
diff --git a/svx/source/sdr/primitive2d/sdrprimitivetools.cxx b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
index 6c665cbef4c9..25b39ebb07d5 100644
--- a/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
+++ b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
@@ -37,6 +37,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <vcl/lazydelete.hxx>
//////////////////////////////////////////////////////////////////////////////
// helper methods
@@ -47,11 +48,11 @@ namespace drawinglayer
{
BitmapEx createDefaultCross_3x3(const basegfx::BColor& rBColor)
{
- static BitmapEx* pRetVal = NULL;
+ static vcl::DeleteOnDeinit< BitmapEx > aRetVal(0);
static basegfx::BColor aColor;
::osl::Mutex m_mutex;
- if(pRetVal == NULL || rBColor != aColor)
+ if(!aRetVal.get() || rBColor != aColor)
{
// copy values
aColor = rBColor;
@@ -81,23 +82,21 @@ namespace drawinglayer
aContent.ReleaseAccess(pWContent);
aMask.ReleaseAccess(pWMask);
- if( pRetVal )
- delete pRetVal;
-
- pRetVal = new BitmapEx(aContent, aMask);
+ // create and exchange at aRetVal
+ delete aRetVal.set(new BitmapEx(aContent, aMask));
}
- return *pRetVal;
+ return aRetVal.get() ? *aRetVal.get() : BitmapEx();
}
BitmapEx createDefaultGluepoint_7x7(const basegfx::BColor& rBColorA, const basegfx::BColor& rBColorB)
{
- static BitmapEx* pRetVal = NULL;
+ static vcl::DeleteOnDeinit< BitmapEx > aRetVal(0);
static basegfx::BColor aColorA;
static basegfx::BColor aColorB;
::osl::Mutex m_mutex;
- if(pRetVal == NULL || rBColorA != aColorA || rBColorB != aColorB)
+ if(!aRetVal.get() || rBColorA != aColorA || rBColorB != aColorB)
{
// copy values
aColorA = rBColorA;
@@ -171,13 +170,11 @@ namespace drawinglayer
aContent.ReleaseAccess(pWContent);
aMask.ReleaseAccess(pWMask);
- if( pRetVal )
- delete pRetVal;
-
- pRetVal = new BitmapEx(aContent, aMask);
+ // create and exchange at aRetVal
+ delete aRetVal.set(new BitmapEx(aContent, aMask));
}
- return *pRetVal;
+ return aRetVal.get() ? *aRetVal.get() : BitmapEx();
}
// #i99123#
diff --git a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
index 97aaf2735630..64ac716b40e9 100644
--- a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
@@ -50,65 +50,90 @@ namespace drawinglayer
Primitive2DSequence SdrRectanglePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
+ Primitive2DSequence aHitTestContent;
// create unit outline polygon
- ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromRect(::basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), getCornerRadiusX(), getCornerRadiusY()));
+ const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(
+ basegfx::B2DRange(0.0, 0.0, 1.0, 1.0),
+ getCornerRadiusX(),
+ getCornerRadiusY()));
// add fill
if(getSdrLFSTAttribute().getFill())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ *getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
+ }
+ else if(getTextFrame())
+ {
+ // if no fill and it's a text frame, create a fill for HitTest and
+ // BoundRect fallback
+ appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ attribute::SdrFillAttribute(0.0, basegfx::BColor(0.0, 0.0, 0.0)),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
if(getSdrLFSTAttribute().getLine())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aUnitOutline,
+ getTransform(),
+ *getSdrLFSTAttribute().getLine()));
}
- else
+ else if(!getTextFrame())
{
- // if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
- const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
+ // if initially no line is defined and it's not a text frame, create
+ // a line for HitTest and BoundRect
+ appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
+ createPolygonLinePrimitive(
+ aUnitOutline,
+ getTransform(),
+ attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0))));
+ }
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ // add HitTest and BoundRect helper geometry (if exists)
+ if(aHitTestContent.hasElements())
+ {
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ Primitive2DReference(new HitTestPrimitive2D(aHitTestContent)));
}
// add text
if(getSdrLFSTAttribute().getText())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false));
}
// add shadow
if(getSdrLFSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
}
return aRetval;
}
SdrRectanglePrimitive2D::SdrRectanglePrimitive2D(
- const ::basegfx::B2DHomMatrix& rTransform,
+ const basegfx::B2DHomMatrix& rTransform,
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
double fCornerRadiusX,
- double fCornerRadiusY)
+ double fCornerRadiusY,
+ bool bTextFrame)
: BasePrimitive2D(),
maTransform(rTransform),
maSdrLFSTAttribute(rSdrLFSTAttribute),
mfCornerRadiusX(fCornerRadiusX),
- mfCornerRadiusY(fCornerRadiusY)
+ mfCornerRadiusY(fCornerRadiusY),
+ mbTextFrame(bTextFrame)
{
}
@@ -121,7 +146,8 @@ namespace drawinglayer
return (getCornerRadiusX() == rCompare.getCornerRadiusX()
&& getCornerRadiusY() == rCompare.getCornerRadiusY()
&& getTransform() == rCompare.getTransform()
- && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute());
+ && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute()
+ && getTextFrame() == rCompare.getTextFrame());
}
return false;
diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
index 0cad266f69d1..748270c36977 100644
--- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
@@ -116,7 +116,6 @@ namespace drawinglayer
mnLastPageNumber(0),
mnLastPageCount(0),
maLastTextBackgroundColor(),
- mbLastSpellCheck(false),
mbContainsPageField(false),
mbContainsPageCountField(false),
mbContainsOtherFields(false)
@@ -137,7 +136,13 @@ namespace drawinglayer
{
const SdrTextPrimitive2D& rCompare = (SdrTextPrimitive2D&)rPrimitive;
- return (getOutlinerParaObject() == rCompare.getOutlinerParaObject());
+ return (
+
+ // compare OPO and content, but not WrongList
+ getOutlinerParaObject() == rCompare.getOutlinerParaObject()
+
+ // also compare WrongList (not-persistent data, but visualized)
+ && getOutlinerParaObject().isWrongListEqual(rCompare.getOutlinerParaObject()));
}
return false;
@@ -145,9 +150,6 @@ namespace drawinglayer
Primitive2DSequence SdrTextPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
- const bool bCurrentSpellCheck(getSdrText()
- ? getSdrText()->GetObject().impCheckSpellCheckForDecomposeTextPrimitive()
- : false);
uno::Reference< drawing::XDrawPage > xCurrentlyVisualizingPage;
bool bCurrentlyVisualizingPageIsSet(false);
Color aNewTextBackgroundColor;
@@ -157,10 +159,10 @@ namespace drawinglayer
if(getLocalDecomposition().hasElements())
{
- bool bDoDelete(getLastSpellCheck() != bCurrentSpellCheck);
+ bool bDoDelete(false);
// check visualized page
- if(!bDoDelete && (mbContainsPageField || mbContainsPageCountField || mbContainsOtherFields))
+ if(mbContainsPageField || mbContainsPageCountField || mbContainsOtherFields)
{
// get visualized page and remember
xCurrentlyVisualizingPage = rViewInformation.getVisualizedPage();
@@ -236,7 +238,6 @@ namespace drawinglayer
aNewTextBackgroundColor = rDrawOutliner.GetBackgroundColor();
}
- const_cast< SdrTextPrimitive2D* >(this)->setLastSpellCheck(bCurrentSpellCheck);
const_cast< SdrTextPrimitive2D* >(this)->mxLastVisualizingPage = xCurrentlyVisualizingPage;
const_cast< SdrTextPrimitive2D* >(this)->mnLastPageNumber = nCurrentlyValidPageNumber;
const_cast< SdrTextPrimitive2D* >(this)->mnLastPageCount = nCurrentlyValidPageCount;
@@ -258,15 +259,7 @@ namespace drawinglayer
Primitive2DSequence SdrContourTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
- const bool bCurrentSpellCheck(getSdrText()
- ? getSdrText()->GetObject().impDecomposeContourTextPrimitive(aRetval, *this, aViewInformation)
- : false);
-
- if(getLastSpellCheck() != bCurrentSpellCheck)
- {
- // remember last spell check state; this is part of the decomposition source data definition
- const_cast< SdrContourTextPrimitive2D* >(this)->setLastSpellCheck(bCurrentSpellCheck);
- }
+ getSdrText()->GetObject().impDecomposeContourTextPrimitive(aRetval, *this, aViewInformation);
return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval);
}
@@ -319,15 +312,7 @@ namespace drawinglayer
Primitive2DSequence SdrPathTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
- const bool bCurrentSpellCheck(getSdrText()
- ? getSdrText()->GetObject().impDecomposePathTextPrimitive(aRetval, *this, aViewInformation)
- : false);
-
- if(getLastSpellCheck() != bCurrentSpellCheck)
- {
- // remember last spell check state; this is part of the decomposition source data definition
- const_cast< SdrPathTextPrimitive2D* >(this)->setLastSpellCheck(bCurrentSpellCheck);
- }
+ getSdrText()->GetObject().impDecomposePathTextPrimitive(aRetval, *this, aViewInformation);
return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval);
}
@@ -383,15 +368,7 @@ namespace drawinglayer
Primitive2DSequence SdrBlockTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
- const bool bCurrentSpellCheck(getSdrText()
- ? getSdrText()->GetObject().impDecomposeBlockTextPrimitive(aRetval, *this, aViewInformation)
- : false);
-
- if(getLastSpellCheck() != bCurrentSpellCheck)
- {
- // remember last spell check state; this is part of the decomposition source data definition
- const_cast< SdrBlockTextPrimitive2D* >(this)->setLastSpellCheck(bCurrentSpellCheck);
- }
+ getSdrText()->GetObject().impDecomposeBlockTextPrimitive(aRetval, *this, aViewInformation);
return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval);
}
@@ -400,11 +377,17 @@ namespace drawinglayer
const SdrText* pSdrText,
const OutlinerParaObject& rOutlinerParaObject,
const basegfx::B2DHomMatrix& rTextRangeTransform,
+ SdrTextHorzAdjust aSdrTextHorzAdjust,
+ SdrTextVertAdjust aSdrTextVertAdjust,
+ bool bFixedCellHeight,
bool bUnlimitedPage,
bool bCellText,
bool bWordWrap)
: SdrTextPrimitive2D(pSdrText, rOutlinerParaObject),
maTextRangeTransform(rTextRangeTransform),
+ maSdrTextHorzAdjust(aSdrTextHorzAdjust),
+ maSdrTextVertAdjust(aSdrTextVertAdjust),
+ mbFixedCellHeight(bFixedCellHeight),
mbUnlimitedPage(bUnlimitedPage),
mbCellText(bCellText),
mbWordWrap(bWordWrap)
@@ -418,6 +401,9 @@ namespace drawinglayer
const SdrBlockTextPrimitive2D& rCompare = (SdrBlockTextPrimitive2D&)rPrimitive;
return (getTextRangeTransform() == rCompare.getTextRangeTransform()
+ && getSdrTextHorzAdjust() == rCompare.getSdrTextHorzAdjust()
+ && getSdrTextVertAdjust() == rCompare.getSdrTextVertAdjust()
+ && isFixedCellHeight() == rCompare.isFixedCellHeight()
&& getUnlimitedPage() == rCompare.getUnlimitedPage()
&& getCellText() == rCompare.getCellText()
&& getWordWrap() == rCompare.getWordWrap());
@@ -432,6 +418,9 @@ namespace drawinglayer
getSdrText(),
getOutlinerParaObject(),
rTransform * getTextRangeTransform(),
+ getSdrTextHorzAdjust(),
+ getSdrTextVertAdjust(),
+ isFixedCellHeight(),
getUnlimitedPage(),
getCellText(),
getWordWrap());
@@ -452,15 +441,7 @@ namespace drawinglayer
Primitive2DSequence SdrStretchTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
- const bool bCurrentSpellCheck(getSdrText()
- ? getSdrText()->GetObject().impDecomposeStretchTextPrimitive(aRetval, *this, aViewInformation)
- : false);
-
- if(getLastSpellCheck() != bCurrentSpellCheck)
- {
- // remember last spell check state; this is part of the decomposition source data definition
- const_cast< SdrStretchTextPrimitive2D* >(this)->setLastSpellCheck(bCurrentSpellCheck);
- }
+ getSdrText()->GetObject().impDecomposeStretchTextPrimitive(aRetval, *this, aViewInformation);
return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval);
}
@@ -468,9 +449,11 @@ namespace drawinglayer
SdrStretchTextPrimitive2D::SdrStretchTextPrimitive2D(
const SdrText* pSdrText,
const OutlinerParaObject& rOutlinerParaObject,
- const basegfx::B2DHomMatrix& rTextRangeTransform)
+ const basegfx::B2DHomMatrix& rTextRangeTransform,
+ bool bFixedCellHeight)
: SdrTextPrimitive2D(pSdrText, rOutlinerParaObject),
- maTextRangeTransform(rTextRangeTransform)
+ maTextRangeTransform(rTextRangeTransform),
+ mbFixedCellHeight(bFixedCellHeight)
{
}
@@ -480,7 +463,8 @@ namespace drawinglayer
{
const SdrStretchTextPrimitive2D& rCompare = (SdrStretchTextPrimitive2D&)rPrimitive;
- return (getTextRangeTransform() == rCompare.getTextRangeTransform());
+ return (getTextRangeTransform() == rCompare.getTextRangeTransform()
+ && isFixedCellHeight() == rCompare.isFixedCellHeight());
}
return false;
@@ -491,7 +475,8 @@ namespace drawinglayer
return new SdrStretchTextPrimitive2D(
getSdrText(),
getOutlinerParaObject(),
- rTransform * getTextRangeTransform());
+ rTransform * getTextRangeTransform(),
+ isFixedCellHeight());
}
// provide unique ID
diff --git a/svx/source/smarttags/SmartTagMgr.cxx b/svx/source/smarttags/SmartTagMgr.cxx
index 2eafb7ba6290..76252d25dbd3 100644
--- a/svx/source/smarttags/SmartTagMgr.cxx
+++ b/svx/source/smarttags/SmartTagMgr.cxx
@@ -70,10 +70,7 @@ SmartTagMgr::SmartTagMgr( const rtl::OUString& rApplicationName )
maActionList(),
maDisabledSmartTagTypes(),
maSmartTagMap(),
- mxBreakIter(),
mxMSF( ::comphelper::getProcessServiceFactory() ),
- mxContext(),
- mxConfigurationSettings(),
mbLabelTextWithSmartTags(true)
{
}
@@ -93,10 +90,6 @@ void SmartTagMgr::Init( const rtl::OUString& rConfigurationGroupName )
if ( mxContext.is() )
{
- // get the break iterator
- mxBreakIter = Reference< i18n::XBreakIterator >(
- mxMSF->createInstance( C2U( "com.sun.star.i18n.BreakIterator" ) ), UNO_QUERY);
-
PrepareConfiguration( rConfigurationGroupName );
ReadConfiguration( true, true );
RegisterListener();
@@ -104,6 +97,14 @@ void SmartTagMgr::Init( const rtl::OUString& rConfigurationGroupName )
}
}
}
+void SmartTagMgr::CreateBreakIterator() const
+{
+ if ( !mxBreakIter.is() && mxMSF.is() && mxContext.is() )
+ {
+ // get the break iterator
+ mxBreakIter.set(mxMSF->createInstance( C2U( "com.sun.star.i18n.BreakIterator" ) ), UNO_QUERY);
+ }
+}
/** Dispatches the recognize call to all installed smart tag recognizers
*/
@@ -129,10 +130,13 @@ void SmartTagMgr::Recognize( const rtl::OUString& rText,
}
if ( bCallRecognizer )
+ {
+ CreateBreakIterator();
maRecognizerList[i]->recognize( rText, nStart, nLen,
smarttags::SmartTagRecognizerMode_PARAGRAPH,
rLocale, xMarkup, maApplicationName, xController,
mxBreakIter );
+ }
}
}
diff --git a/svx/source/stbctrls/stbctrls.src b/svx/source/stbctrls/stbctrls.src
index 2d9b875d6c2a..74c7c78bc897 100644
--- a/svx/source/stbctrls/stbctrls.src
+++ b/svx/source/stbctrls/stbctrls.src
@@ -1,4 +1,4 @@
-/*************************************************************************
+/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -87,6 +87,11 @@ String RID_SVXSTR_XMLSEC_NO_SIG
Text [ en-US ] = "Digital Signature: The document is not signed.";
};
+String RID_SVXSTR_XMLSEC_SIG_CERT_OK_PARTIAL_SIG
+{
+ Text [ en-US ] = "Digital Signature: The document signature and the certificate are OK, but not all parts of the document are signed.";
+};
+
// PopupMenu -------------------------------------------------------------
Menu RID_SVXMNU_ZOOM
{
diff --git a/svx/source/stbctrls/xmlsecctrl.cxx b/svx/source/stbctrls/xmlsecctrl.cxx
index a994df0900a6..890cde02e428 100644
--- a/svx/source/stbctrls/xmlsecctrl.cxx
+++ b/svx/source/stbctrls/xmlsecctrl.cxx
@@ -143,6 +143,9 @@ void XmlSecStatusBarControl::StateChanged( USHORT nSID, SfxItemState eState, con
nResId = RID_SVXSTR_XMLSEC_SIG_NOT_OK;
else if ( mpImpl->mnState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED )
nResId = RID_SVXSTR_XMLSEC_SIG_OK_NO_VERIFY;
+ else if ( mpImpl->mnState == SIGNATURESTATE_SIGNATURES_PARTIAL_OK )
+ nResId = RID_SVXSTR_XMLSEC_SIG_CERT_OK_PARTIAL_SIG;
+
GetStatusBar().SetQuickHelpText( GetId(), SVX_RESSTR( nResId ) );
}
@@ -192,7 +195,8 @@ void XmlSecStatusBarControl::Paint( const UserDrawEvent& rUsrEvt )
++aRect.Top();
pDev->DrawImage( aRect.TopLeft(), mpImpl->maImageBroken );
}
- else if( mpImpl->mnState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED )
+ else if( mpImpl->mnState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED
+ || mpImpl->mnState == SIGNATURESTATE_SIGNATURES_PARTIAL_OK)
{
++aRect.Top();
pDev->DrawImage( aRect.TopLeft(), mpImpl->maImageNotValidated );
diff --git a/svx/source/svdraw/makefile.mk b/svx/source/svdraw/makefile.mk
index 28eeb84e29d1..e777ad70d3f1 100644
--- a/svx/source/svdraw/makefile.mk
+++ b/svx/source/svdraw/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=svdraw
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
@@ -42,11 +43,11 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES=\
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/svdxcgv.obj \
$(SLO)$/svdmodel.obj \
$(SLO)$/svdpage.obj \
- $(SLO)$/svdoimp.obj \
$(SLO)$/svdobj.obj \
$(SLO)$/svdedtv1.obj \
$(SLO)$/svdcrtv.obj \
@@ -59,7 +60,6 @@ SLOFILES=\
$(SLO)$/svdotextdecomposition.obj \
$(SLO)$/svdotextpathdecomposition.obj \
$(SLO)$/svdouno.obj \
- $(SLO)$/svdfppt.obj \
$(SLO)$/svdpagv.obj \
$(SLO)$/svddrgmt.obj \
$(SLO)$/svdpntv.obj \
@@ -96,7 +96,6 @@ SLOFILES=\
$(SLO)$/svdglev.obj \
$(SLO)$/svdglue.obj \
$(SLO)$/svdhlpln.obj \
- $(SLO)$/svdibrow.obj \
$(SLO)$/svditer.obj \
$(SLO)$/svdlayer.obj \
$(SLO)$/svdmark.obj \
@@ -106,18 +105,29 @@ SLOFILES=\
$(SLO)$/sdrpagewindow.obj \
$(SLO)$/sdrpaintwindow.obj \
$(SLO)$/svdpoev.obj \
- $(SLO)$/svdscrol.obj \
$(SLO)$/svdtrans.obj \
$(SLO)$/svdundo.obj \
$(SLO)$/svdviter.obj \
$(SLO)$/clonelist.obj \
- $(SLO)$/ActionDescriptionProvider.obj \
$(SLO)$/svdedtv.obj \
$(SLO)$/selectioncontroller.obj \
$(SLO)$/polypolygoneditor.obj \
- $(SLO)$/svdomedia.obj \
+ $(SLO)$/svdibrow.obj \
+ $(SLO)$/svdomedia.obj
+
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/svdoimp.obj \
+ $(SLO)$/svdscrol.obj \
+ $(SLO)$/ActionDescriptionProvider.obj \
$(SLO)$/impgrfll.obj
+LIB3TARGET= $(SLB)$/$(TARGET)-msfilter.lib
+LIB3OBJFILES= \
+ $(SLO)$/svdfppt.obj \
+
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) $(LIB3OBJFILES)
+
SRS1NAME=svdstr
SRC1FILES= svdstr.src
diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx
index 341ce6dd90c0..6773b8edf6f5 100644
--- a/svx/source/svdraw/svdcrtv.cxx
+++ b/svx/source/svdraw/svdcrtv.cxx
@@ -831,7 +831,11 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, BOOL bFull*/)
if(pCircObj && OBJ_CIRC != pCircObj->GetObjIdentifier())
{
- bUseSolidDragging = false;
+ // #i103058# Allow SolidDragging with four points
+ if(aDragStat.GetPointAnz() < 4)
+ {
+ bUseSolidDragging = false;
+ }
}
}
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index e427e42d80ab..eb6412b20259 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -1135,11 +1135,20 @@ void SdrDragObjOwn::createSdrDragEntries()
void SdrDragObjOwn::TakeSdrDragComment(XubString& rStr) const
{
- const SdrObject* pObj = GetDragObj();
-
- if(pObj)
+ // #i103058# get info string from the clone preferred, the original will
+ // not be changed. For security, use original as fallback
+ if(mpClone)
{
- rStr = pObj->getSpecialDragComment(DragStat());
+ rStr = mpClone->getSpecialDragComment(DragStat());
+ }
+ else
+ {
+ const SdrObject* pObj = GetDragObj();
+
+ if(pObj)
+ {
+ rStr = pObj->getSpecialDragComment(DragStat());
+ }
}
}
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index 69459b1bff35..8236ca1f19ac 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -282,7 +282,11 @@ BOOL SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl
// #103894# Expand test for HDL_ANCHOR_TR
BOOL bNotDraggable = (HDL_ANCHOR == eDragHdl || HDL_ANCHOR_TR == eDragHdl);
- if(bDragHdl)
+ if(pHdl && (pHdl->GetKind() == HDL_SMARTTAG) && pForcedMeth )
+ {
+ // just use the forced method for smart tags
+ }
+ else if(bDragHdl)
{
mpCurrentSdrDragMethod = new SdrDragMovHdl(*this);
}
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index 8b893788363a..b95c13864776 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -937,7 +937,12 @@ void SdrEditView::ReplaceObjectAtView(SdrObject* pOldObj, SdrPageView& rPV, SdrO
const bool bUndo = IsUndoEnabled();
if( bUndo )
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoReplaceObject(*pOldObj,*pNewObj));
+
+ if( IsObjMarked( pOldObj ) )
+ MarkObj( pOldObj, &rPV, TRUE /*unmark!*/ );
+
pOL->ReplaceObject(pNewObj,pOldObj->GetOrdNum());
+
if( !bUndo )
SdrObject::Free( pOldObj );
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index bd6bf457bdbf..6f4ee781dc37 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -82,14 +82,17 @@ using namespace ::com::sun::star;
******************************************************************************/
SdrGlobalData::SdrGlobalData() :
+ pSysLocale(NULL),
+ pCharClass(NULL),
+ pLocaleData(NULL),
pOutliner(NULL),
pDefaults(NULL),
pResMgr(NULL),
nExchangeFormat(0)
{
- pSysLocale = new SvtSysLocale;
- pCharClass = pSysLocale->GetCharClassPtr();
- pLocaleData = pSysLocale->GetLocaleDataPtr();
+ //pSysLocale = new SvtSysLocale;
+ //pCharClass = pSysLocale->GetCharClassPtr();
+ //pLocaleData = pSysLocale->GetLocaleDataPtr();
svx::ExtrusionBar::RegisterInterface();
svx::FontworkBar::RegisterInterface();
@@ -103,7 +106,24 @@ SdrGlobalData::~SdrGlobalData()
//! do NOT delete pCharClass and pLocaleData
delete pSysLocale;
}
-
+const SvtSysLocale* SdrGlobalData::GetSysLocale()
+{
+ if ( !pSysLocale )
+ pSysLocale = new SvtSysLocale;
+ return pSysLocale;
+}
+const CharClass* SdrGlobalData::GetCharClass()
+{
+ if ( !pCharClass )
+ pCharClass = GetSysLocale()->GetCharClassPtr();
+ return pCharClass;
+}
+const LocaleDataWrapper* SdrGlobalData::GetLocaleData()
+{
+ if ( !pLocaleData )
+ pLocaleData = GetSysLocale()->GetLocaleDataPtr();
+ return pLocaleData;
+}
////////////////////////////////////////////////////////////////////////////////////////////////////
OLEObjCache::OLEObjCache()
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 49e3fc87ae68..30c3ff62531a 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -476,6 +476,12 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaChordAction& rAct)
bool ImpSdrGDIMetaFileImport::CheckLastLineMerge(const basegfx::B2DPolygon& rSrcPoly)
{
+ // #i102706# Do not merge closed polygons
+ if(rSrcPoly.isClosed())
+ {
+ return false;
+ }
+
// #i73407# reformulation to use new B2DPolygon classes
if(bLastObjWasLine && (aOldLineColor == aVD.GetLineColor()) && rSrcPoly.count())
{
@@ -489,6 +495,12 @@ bool ImpSdrGDIMetaFileImport::CheckLastLineMerge(const basegfx::B2DPolygon& rSrc
bool bOk(false);
basegfx::B2DPolygon aDstPoly(pLastPoly->GetPathPoly().getB2DPolygon(0L));
+ // #i102706# Do not merge closed polygons
+ if(aDstPoly.isClosed())
+ {
+ return false;
+ }
+
if(aDstPoly.count())
{
const sal_uInt32 nMaxDstPnt(aDstPoly.count() - 1L);
diff --git a/svx/source/svdraw/svdfppt.cxx b/svx/source/svdraw/svdfppt.cxx
index e12ed76d52ce..d0b01f6a820f 100644
--- a/svx/source/svdraw/svdfppt.cxx
+++ b/svx/source/svdraw/svdfppt.cxx
@@ -39,6 +39,11 @@
#include <sot/storinfo.hxx>
#include <sot/stg.hxx>
#include <com/sun/star/embed/Aspects.hpp>
+#include <com/sun/star/office/XAnnotation.hpp>
+#include <com/sun/star/office/XAnnotationAccess.hpp>
+#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/geometry/RealPoint2D.hpp>
+#include <com/sun/star/util/DateTime.hpp>
#include <unotools/streamwrap.hxx>
@@ -120,6 +125,7 @@
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#include <svx/writingmodeitem.hxx>
#include <vcl/print.hxx>
#include <svx/svxfont.hxx>
@@ -2562,9 +2568,11 @@ sal_Bool SdrPowerPointImport::SeekToContentOfProgTag( sal_Int32 nVersion, SvStre
sal_uInt32 nOldPos = rSt.Tell();
DffRecordHeader aProgTagsHd, aProgTagBinaryDataHd;
-
rSourceHd.SeekToContent( rSt );
- if ( SeekToRec( rSt, PPT_PST_ProgTags, rSourceHd.GetRecEndFilePos(), &aProgTagsHd ) )
+ sal_Bool bFound = rSourceHd.nRecType == PPT_PST_ProgTags;
+ if ( !bFound )
+ bFound = SeekToRec( rSt, PPT_PST_ProgTags, rSourceHd.GetRecEndFilePos(), &aProgTagsHd );
+ if ( bFound )
{
while( SeekToRec( rSt, PPT_PST_ProgBinaryTag, aProgTagsHd.GetRecEndFilePos(), &aProgTagBinaryDataHd ) )
{
@@ -2859,6 +2867,75 @@ SdrPage* SdrPowerPointImport::MakeBlancPage( sal_Bool bMaster ) const
return pRet;
}
+void ImportComment10( SvxMSDffManager& rMan, SvStream& rStCtrl, SdrPage* pPage, DffRecordHeader& rComment10Hd )
+{
+ rtl::OUString sAuthor;
+ rtl::OUString sText;
+ rtl::OUString sInitials;
+
+ sal_Int32 nIndex = 0;
+ util::DateTime aDateTime;
+ sal_Int32 nPosX = 0;
+ sal_Int32 nPosY = 0;
+
+ while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < rComment10Hd.GetRecEndFilePos() ) )
+ {
+ DffRecordHeader aCommentHd;
+ rStCtrl >> aCommentHd;
+ switch( aCommentHd.nRecType )
+ {
+ case PPT_PST_CString :
+ {
+ String aString;
+ SvxMSDffManager::MSDFFReadZString( rStCtrl, aString, aCommentHd.nRecLen, TRUE );
+ switch ( aCommentHd.nRecInstance )
+ {
+ case 0 : sAuthor = aString; break;
+ case 1 : sText = aString; break;
+ case 2 : sInitials = aString; break;
+ }
+ }
+ break;
+
+ case PPT_PST_CommentAtom10 :
+ {
+ rStCtrl >> nIndex
+ >> aDateTime.Year
+ >> aDateTime.Month
+ >> aDateTime.Day // DayOfWeek
+ >> aDateTime.Day
+ >> aDateTime.Hours
+ >> aDateTime.Minutes
+ >> aDateTime.Seconds
+ >> aDateTime.HundredthSeconds
+ >> nPosX
+ >> nPosY;
+
+ aDateTime.HundredthSeconds /= 10;
+ }
+ break;
+ }
+ aCommentHd.SeekToEndOfRecord( rStCtrl );
+ }
+ Point aPosition( nPosX, nPosY );
+ rMan.Scale( aPosition );
+
+ try
+ {
+ uno::Reference< office::XAnnotationAccess > xAnnotationAccess( pPage->getUnoPage(), UNO_QUERY_THROW );
+ uno::Reference< office::XAnnotation > xAnnotation( xAnnotationAccess->createAndInsertAnnotation() );
+ xAnnotation->setPosition( geometry::RealPoint2D( aPosition.X() / 100.0, aPosition.Y() / 100.0 ) );
+ xAnnotation->setAuthor( sAuthor );
+ xAnnotation->setDateTime( aDateTime );
+ uno::Reference< text::XText > xText( xAnnotation->getTextRange() );
+ xText->setString( sText );
+ }
+ catch( uno::Exception& )
+ {
+
+ }
+}
+
// be sure not to import masterpages with this method
// be sure not to import masterpages with this method
@@ -2895,6 +2972,21 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
}
break;
+ case PPT_PST_ProgTags :
+ {
+ DffRecordHeader aContentDataHd;
+ if ( SeekToContentOfProgTag( 10, rStCtrl, aHd, aContentDataHd ) )
+ {
+ DffRecordHeader aComment10Hd;
+ while( ( rStCtrl.GetError() == 0 ) && SeekToRec( rStCtrl, PPT_PST_Comment10, aContentDataHd.GetRecEndFilePos(), &aComment10Hd ) )
+ {
+ ImportComment10( *this, rStCtrl, pRet, aComment10Hd );
+ aComment10Hd.SeekToEndOfRecord( rStCtrl );
+ }
+ }
+ }
+ break;
+
case PPT_PST_PPDrawing :
{
DffRecordHeader aPPDrawHd;
@@ -3819,21 +3911,20 @@ BOOL PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, Svx
nHardCount += pParaObj->GetAttrib( PPT_ParaAttr_BulletOfs, nBulletOfs, nDestinationInstance );
if ( nIsBullet )
- {
rNumberFormat.SetNumberingType( SVX_NUM_CHAR_SPECIAL );
- UINT32 nFontHeight = 24;
- PPTPortionObj* pPtr = pParaObj->First();
- if ( pPtr )
- pPtr->GetAttrib( PPT_CharAttr_FontHeight, nFontHeight, nDestinationInstance );
+ UINT32 nFontHeight = 24;
+ PPTPortionObj* pPtr = pParaObj->First();
+ if ( pPtr )
+ pPtr->GetAttrib( PPT_CharAttr_FontHeight, nFontHeight, nDestinationInstance );
+ if ( nIsBullet )
nHardCount += ImplGetExtNumberFormat( rManager, rNumberFormat, pParaObj->pParaSet->mnDepth,
pParaObj->mnInstance, nDestinationInstance, rStartNumbering, nFontHeight, pParaObj );
- if ( rNumberFormat.GetNumberingType() != SVX_NUM_BITMAP )
- pParaObj->UpdateBulletRelSize( nBulletHeight );
- if ( nHardCount )
- ImplGetNumberFormat( rManager, rNumberFormat, pParaObj->pParaSet->mnDepth );
- }
+ if ( rNumberFormat.GetNumberingType() != SVX_NUM_BITMAP )
+ pParaObj->UpdateBulletRelSize( nBulletHeight );
+ if ( nHardCount )
+ ImplGetNumberFormat( rManager, rNumberFormat, pParaObj->pParaSet->mnDepth );
if ( nHardCount )
{
@@ -3847,7 +3938,6 @@ BOOL PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, Svx
case SVX_NUM_CHARS_UPPER_LETTER_N :
case SVX_NUM_CHARS_LOWER_LETTER_N :
{
- PPTPortionObj* pPtr = pParaObj->First();
if ( pPtr )
{
sal_uInt32 nFont;
@@ -5566,11 +5656,6 @@ BOOL PPTPortionObj::GetAttrib( UINT32 nAttr, UINT32& nRetValue, UINT32 nDestinat
if ( nRetValue != nTmp )
bIsHardAttribute = 1;
}
- if ( nRetValue && ( nDestinationInstance == TSS_TYPE_TEXT_IN_SHAPE ) )
- {
- nRetValue = 0; // no inheritance for standard textobjects
- bIsHardAttribute = 1; // this attribute must be hard formatted
- }
}
break;
case PPT_CharAttr_Font :
@@ -6215,10 +6300,10 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >&
if ( pRule )
{
pRule->SetLevel( pParaSet->mnDepth, aNumberFormat );
- if ( nDestinationInstance == 0xffffffff )
+ sal_uInt16 i, n;
+ for ( i = 0; i < pRule->GetLevelCount(); i++ )
{
- sal_uInt16 i, n;
- for ( i = 0; i < pRule->GetLevelCount(); i++ )
+ if ( i != pParaSet->mnDepth )
{
n = i > 4 ? 4 : i;
@@ -7429,6 +7514,15 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell >& xCell )
xPropSet->setPropertyValue( sLeftBorder, Any( nLeftDist ) );
xPropSet->setPropertyValue( sBottomBorder, Any( nLowerDist ) );
+ static const rtl::OUString sTextVerticalAdjust( RTL_CONSTASCII_USTRINGPARAM( "TextVerticalAdjust" ) );
+ const SdrTextVertAdjust eTextVertAdjust(((const SdrTextVertAdjustItem&)pObj->GetMergedItem(SDRATTR_TEXT_VERTADJUST)).GetValue());
+ drawing::TextVerticalAdjust eVA( drawing::TextVerticalAdjust_TOP );
+ if ( eTextVertAdjust == SDRTEXTVERTADJUST_CENTER )
+ eVA = drawing::TextVerticalAdjust_CENTER;
+ else if ( eTextVertAdjust == SDRTEXTVERTADJUST_BOTTOM )
+ eVA = drawing::TextVerticalAdjust_BOTTOM;
+ xPropSet->setPropertyValue( sTextVerticalAdjust, Any( eVA ) );
+
SfxItemSet aSet( pObj->GetMergedItemSet() );
XFillStyle eFillStyle(((XFillStyleItem&)pObj->GetMergedItem( XATTR_FILLSTYLE )).GetValue());
::com::sun::star::drawing::FillStyle eFS( com::sun::star::drawing::FillStyle_NONE );
@@ -7601,6 +7695,11 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
CreateTableRows( xColumnRowRange->getRows(), aRows, pGroup->GetSnapRect().Bottom() );
CreateTableColumns( xColumnRowRange->getColumns(), aColumns, pGroup->GetSnapRect().Right() );
+ sal_Int32 nCellCount = aRows.size() * aColumns.size();
+ sal_Int32 *pMergedCellIndexTable = new sal_Int32[ nCellCount ];
+ for ( sal_Int32 i = 0; i < nCellCount; i++ )
+ pMergedCellIndexTable[ i ] = i;
+
aGroupIter.Reset();
while( aGroupIter.IsMore() )
{
@@ -7621,7 +7720,16 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
ApplyCellAttributes( pObj, xCell );
if ( ( nRowCount > 1 ) || ( nColumnCount > 1 ) ) // cell merging
+ {
MergeCells( xTable, nColumn, nRow, nColumnCount, nRowCount );
+ for ( sal_Int32 nRowIter = 0; nRowIter < nRowCount; nRowIter++ )
+ {
+ for ( sal_Int32 nColumnIter = 0; nColumnIter < nColumnCount; nColumnIter++ )
+ { // now set the correct index for the merged cell
+ pMergedCellIndexTable[ ( ( nRow + nRowIter ) * aColumns.size() ) + nColumn + nColumnIter ] = nTableIndex;
+ }
+ }
+ }
// applying text
OutlinerParaObject* pParaObject = pObj->GetOutlinerParaObject();
@@ -7633,13 +7741,30 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
}
}
}
- else
+ }
+ aGroupIter.Reset();
+ while( aGroupIter.IsMore() )
+ {
+ SdrObject* pObj( aGroupIter.Next() );
+ if ( IsLine( pObj ) )
{
std::vector< sal_Int32 > vPositions; // containing cell indexes + cell position
GetLinePositions( pObj, aRows, aColumns, vPositions, pGroup->GetSnapRect() );
+
+ // correcting merged cell position
+ std::vector< sal_Int32 >::iterator aIter( vPositions.begin() );
+ while( aIter != vPositions.end() )
+ {
+ sal_Int32 nOldPosition = *aIter & 0xffff;
+ sal_Int32 nOldFlags = *aIter & 0xffff0000;
+ sal_Int32 nNewPosition = pMergedCellIndexTable[ nOldPosition ] | nOldFlags;
+ *aIter++ = nNewPosition;
+ }
ApplyCellLineAttributes( pObj, xTable, vPositions, aColumns.size() );
}
}
+ delete[] pMergedCellIndexTable;
+
// we are replacing the whole group object by a single table object, so
// possibly connections to the group object have to be removed.
if ( pSolverContainer )
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 727e7f0bafcc..936c073f6e84 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -68,6 +68,7 @@
#include <sdrpaintwindow.hxx>
#include <vcl/svapp.hxx>
#include <svx/sdr/overlay/overlaypolypolygon.hxx>
+#include <vcl/lazydelete.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
// #i15222#
@@ -275,9 +276,23 @@ const BitmapEx& SdrHdlBitmapSet::GetBitmapEx(BitmapMarkerKind eKindOfMarker, UIN
////////////////////////////////////////////////////////////////////////////////////////////////////
-SdrHdlBitmapSet* SdrHdl::pSimpleSet = NULL;
-SdrHdlBitmapSet* SdrHdl::pModernSet = NULL;
-SdrHdlBitmapSet* SdrHdl::pHighContrastSet = NULL;
+SdrHdlBitmapSet& getSimpleSet()
+{
+ static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aSimpleSet(new SdrHdlBitmapSet(SIP_SA_MARKERS));
+ return *aSimpleSet.get();
+}
+
+SdrHdlBitmapSet& getModernSet()
+{
+ static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aModernSet(new SdrHdlBitmapSet(SIP_SA_MARKERS));
+ return *aModernSet.get();
+}
+
+SdrHdlBitmapSet& getHighContrastSet()
+{
+ static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aHighContrastSet(new SdrHdlBitmapSet(SIP_SA_MARKERS));
+ return *aHighContrastSet.get();
+}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -296,18 +311,6 @@ SdrHdl::SdrHdl():
bPlusHdl(FALSE),
mbMoveOutside(false)
{
- if(!pSimpleSet)
- pSimpleSet = new SdrHdlBitmapSet(SIP_SA_MARKERS);
- DBG_ASSERT(pSimpleSet, "Could not construct SdrHdlBitmapSet()!");
-
- if(!pModernSet)
- pModernSet = new SdrHdlBitmapSet(SIP_SA_FINE_MARKERS);
- DBG_ASSERT(pModernSet, "Could not construct SdrHdlBitmapSet()!");
-
- // #101928#
- if(!pHighContrastSet)
- pHighContrastSet = new SdrHdlBitmapSet(SIP_SA_ACCESSIBILITY_MARKERS);
- DBG_ASSERT(pHighContrastSet, "Could not construct SdrHdlBitmapSet()!");
}
SdrHdl::SdrHdl(const Point& rPnt, SdrHdlKind eNewKind):
@@ -326,18 +329,6 @@ SdrHdl::SdrHdl(const Point& rPnt, SdrHdlKind eNewKind):
bPlusHdl(FALSE),
mbMoveOutside(false)
{
- if(!pSimpleSet)
- pSimpleSet = new SdrHdlBitmapSet(SIP_SA_MARKERS);
- DBG_ASSERT(pSimpleSet, "Could not construct SdrHdlBitmapSet()!");
-
- if(!pModernSet)
- pModernSet = new SdrHdlBitmapSet(SIP_SA_FINE_MARKERS);
- DBG_ASSERT(pModernSet, "Could not construct SdrHdlBitmapSet()!");
-
- // #101928#
- if(!pHighContrastSet)
- pHighContrastSet = new SdrHdlBitmapSet(SIP_SA_ACCESSIBILITY_MARKERS);
- DBG_ASSERT(pHighContrastSet, "Could not construct SdrHdlBitmapSet()!");
}
SdrHdl::~SdrHdl()
@@ -670,17 +661,17 @@ BitmapEx SdrHdl::ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd,
{
if(bIsHighContrast)
{
- return pHighContrastSet->GetBitmapEx(eKindOfMarker, nInd);
+ return getHighContrastSet().GetBitmapEx(eKindOfMarker, nInd);
}
else
{
if(bFine)
{
- return pModernSet->GetBitmapEx(eKindOfMarker, nInd);
+ return getModernSet().GetBitmapEx(eKindOfMarker, nInd);
}
else
{
- return pSimpleSet->GetBitmapEx(eKindOfMarker, nInd);
+ return getSimpleSet().GetBitmapEx(eKindOfMarker, nInd);
}
}
}
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 28435b26ff9f..0eab890b49f0 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1882,6 +1882,11 @@ uno::Reference< uno::XInterface > SdrModel::getUnoModel()
return mxUnoModel;
}
+void SdrModel::setUnoModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xModel )
+{
+ mxUnoModel = xModel;
+}
+
uno::Reference< uno::XInterface > SdrModel::createUnoModel()
{
DBG_ERROR( "SdrModel::createUnoModel() - base implementation should not be called!" );
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 7273bb49889a..f80b14503914 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -208,6 +208,12 @@ void __EXPORT SdrMarkView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
bMarkedObjRectDirty=TRUE;
bMarkedPointsRectsDirty=TRUE;
}
+/* removed for now since this breaks existing code who iterates over the mark list and sequentially replaces objects
+ if( eKind==HINT_OBJREMOVED && IsObjMarked( const_cast<SdrObject*>(pSdrHint->GetObject()) ) )
+ {
+ MarkObj( const_cast<SdrObject*>(pSdrHint->GetObject()), GetSdrPageView(), TRUE );
+ }
+*/
}
SdrSnapView::Notify(rBC,rHint);
}
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index e272a51a4a7a..7ba4aec3e565 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -129,6 +129,10 @@
#include "svx/shapepropertynotifier.hxx"
#include <svx/sdrhittesthelper.hxx>
+// --> OD 2009-07-10 #i73249#
+#include <svx/svdundo.hxx>
+// <--
+
using namespace ::com::sun::star;
// #104018# replace macros above with type-detecting methods
@@ -759,7 +763,29 @@ void SdrObject::SetName(const String& rStr)
if(pPlusData && pPlusData->aObjName != rStr)
{
+ // --> OD 2009-07-09 #i73249#
+ // Undo/Redo for setting object's name
+ bool bUndo( false );
+ if ( GetModel() && GetModel()->IsUndoEnabled() )
+ {
+ bUndo = true;
+ SdrUndoAction* pUndoAction =
+ GetModel()->GetSdrUndoFactory().CreateUndoObjectStrAttr(
+ *this,
+ SdrUndoObjStrAttr::OBJ_NAME,
+ GetName(),
+ rStr );
+ GetModel()->BegUndo( pUndoAction->GetComment() );
+ GetModel()->AddUndo( pUndoAction );
+ }
+ // <--
pPlusData->aObjName = rStr;
+ // --> OD 2009-07-09 #i73249#
+ if ( bUndo )
+ {
+ GetModel()->EndUndo();
+ }
+ // <--
SetChanged();
BroadcastObjectChange();
}
@@ -784,7 +810,29 @@ void SdrObject::SetTitle(const String& rStr)
if(pPlusData && pPlusData->aObjTitle != rStr)
{
+ // --> OD 2009-07-13 #i73249#
+ // Undo/Redo for setting object's title
+ bool bUndo( false );
+ if ( GetModel() && GetModel()->IsUndoEnabled() )
+ {
+ bUndo = true;
+ SdrUndoAction* pUndoAction =
+ GetModel()->GetSdrUndoFactory().CreateUndoObjectStrAttr(
+ *this,
+ SdrUndoObjStrAttr::OBJ_TITLE,
+ GetTitle(),
+ rStr );
+ GetModel()->BegUndo( pUndoAction->GetComment() );
+ GetModel()->AddUndo( pUndoAction );
+ }
+ // <--
pPlusData->aObjTitle = rStr;
+ // --> OD 2009-07-13 #i73249#
+ if ( bUndo )
+ {
+ GetModel()->EndUndo();
+ }
+ // <--
SetChanged();
BroadcastObjectChange();
}
@@ -809,7 +857,29 @@ void SdrObject::SetDescription(const String& rStr)
if(pPlusData && pPlusData->aObjDescription != rStr)
{
+ // --> OD 2009-07-13 #i73249#
+ // Undo/Redo for setting object's description
+ bool bUndo( false );
+ if ( GetModel() && GetModel()->IsUndoEnabled() )
+ {
+ bUndo = true;
+ SdrUndoAction* pUndoAction =
+ GetModel()->GetSdrUndoFactory().CreateUndoObjectStrAttr(
+ *this,
+ SdrUndoObjStrAttr::OBJ_DESCRIPTION,
+ GetDescription(),
+ rStr );
+ GetModel()->BegUndo( pUndoAction->GetComment() );
+ GetModel()->AddUndo( pUndoAction );
+ }
+ // <--
pPlusData->aObjDescription = rStr;
+ // --> OD 2009-07-13 #i73249#
+ if ( bUndo )
+ {
+ GetModel()->EndUndo();
+ }
+ // <--
SetChanged();
BroadcastObjectChange();
}
@@ -2863,8 +2933,8 @@ void SdrObject::impl_setUnoShape( const uno::Reference< uno::XInterface >& _rxUn
{
maWeakUnoShape = _rxUnoShape;
mpSvxShape = SvxShape::getImplementation( _rxUnoShape );
- OSL_ENSURE( mpSvxShape || !_rxUnoShape.is(),
- "SdrObject::setUnoShape: not sure it's a good idea to have an XShape which is not implemented by SvxShape ..." );
+// OSL_ENSURE( mpSvxShape || !_rxUnoShape.is(),
+// "SdrObject::setUnoShape: not sure it's a good idea to have an XShape which is not implemented by SvxShape ..." );
}
/** only for internal use! */
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index 7d41191c99a9..102b5b1eb824 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -401,26 +401,35 @@ bool SdrCaptionObj::applySpecialDrag(SdrDragStat& rDrag)
String SdrCaptionObj::getSpecialDragComment(const SdrDragStat& rDrag) const
{
- const SdrHdl* pHdl = rDrag.GetHdl();
+ const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj());
- if(pHdl && 0 == pHdl->GetPolyNum())
+ if(bCreateComment)
{
- return SdrRectObj::getSpecialDragComment(rDrag);
+ return String();
}
else
{
- XubString aStr;
+ const SdrHdl* pHdl = rDrag.GetHdl();
- if(!pHdl)
+ if(pHdl && 0 == pHdl->GetPolyNum())
{
- ImpTakeDescriptionStr(STR_DragCaptFram, aStr);
+ return SdrRectObj::getSpecialDragComment(rDrag);
}
else
{
- ImpTakeDescriptionStr(STR_DragCaptTail, aStr);
- }
+ XubString aStr;
+
+ if(!pHdl)
+ {
+ ImpTakeDescriptionStr(STR_DragCaptFram, aStr);
+ }
+ else
+ {
+ ImpTakeDescriptionStr(STR_DragCaptTail, aStr);
+ }
- return aStr;
+ return aStr;
+ }
}
}
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index 6af31224ee45..b3175566d561 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -589,23 +589,56 @@ bool SdrCircObj::applySpecialDrag(SdrDragStat& rDrag)
String SdrCircObj::getSpecialDragComment(const SdrDragStat& rDrag) const
{
- const bool bWink(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind());
+ const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj());
- if(bWink)
+ if(bCreateComment)
{
XubString aStr;
- const sal_Int32 nWink(1 == rDrag.GetHdl()->GetPointNum() ? nStartWink : nEndWink);
+ ImpTakeDescriptionStr(STR_ViewCreateObj, aStr);
+ const sal_uInt32 nPntAnz(rDrag.GetPointAnz());
+
+ if(OBJ_CIRC != meCircleKind && nPntAnz > 2)
+ {
+ ImpCircUser* pU = (ImpCircUser*)rDrag.GetUser();
+ sal_Int32 nWink;
+
+ aStr.AppendAscii(" (");
+
+ if(3 == nPntAnz)
+ {
+ nWink = pU->nStart;
+ }
+ else
+ {
+ nWink = pU->nEnd;
+ }
- ImpTakeDescriptionStr(STR_DragCircAngle, aStr);
- aStr.AppendAscii(" (");
- aStr += GetWinkStr(nWink,FALSE);
- aStr += sal_Unicode(')');
+ aStr += GetWinkStr(nWink,FALSE);
+ aStr += sal_Unicode(')');
+ }
return aStr;
}
else
{
- return SdrTextObj::getSpecialDragComment(rDrag);
+ const bool bWink(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind());
+
+ if(bWink)
+ {
+ XubString aStr;
+ const sal_Int32 nWink(1 == rDrag.GetHdl()->GetPointNum() ? nStartWink : nEndWink);
+
+ ImpTakeDescriptionStr(STR_DragCircAngle, aStr);
+ aStr.AppendAscii(" (");
+ aStr += GetWinkStr(nWink,FALSE);
+ aStr += sal_Unicode(')');
+
+ return aStr;
+ }
+ else
+ {
+ return SdrTextObj::getSpecialDragComment(rDrag);
+ }
}
}
@@ -698,6 +731,14 @@ FASTBOOL SdrCircObj::MovCreate(SdrDragStat& rStat)
SetBoundRectDirty();
bSnapRectDirty=TRUE;
SetXPolyDirty();
+
+ // #i103058# push current angle settings to ItemSet to
+ // allow FullDrag visualisation
+ if(rStat.GetPointAnz() >= 4)
+ {
+ ImpSetCircInfoToAttr();
+ }
+
return TRUE;
}
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index abadbf094981..e55eeaae42b7 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -1920,11 +1920,21 @@ bool SdrEdgeObj::applySpecialDrag(SdrDragStat& rDragStat)
return true;
}
-String SdrEdgeObj::getSpecialDragComment(const SdrDragStat& /*rDrag*/) const
+String SdrEdgeObj::getSpecialDragComment(const SdrDragStat& rDrag) const
{
- XubString aStr;
- ImpTakeDescriptionStr(STR_DragEdgeTail,aStr);
- return aStr;
+ const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj());
+
+ if(bCreateComment)
+ {
+ return String();
+ }
+ else
+ {
+ XubString aStr;
+ ImpTakeDescriptionStr(STR_DragEdgeTail, aStr);
+
+ return aStr;
+ }
}
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 01ef392e941a..a2b6991773e1 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -1867,6 +1867,14 @@ void SdrOle2Obj::NbcSetSnapRect(const Rectangle& rRect)
SdrRectObj::NbcSetSnapRect(rRect);
if( pModel && !pModel->isLocked() )
ImpSetVisAreaSize();
+
+ if ( xObjRef.is() && IsChart() )
+ {
+ //#i103460# charts do not necessaryly have an own size within ODF files,
+ //for this case they need to use the size settings from the surrounding frame,
+ //which is made available with this method as there is no other way
+ xObjRef.SetDefaultSizeForChart( Size( rRect.GetWidth(), rRect.GetHeight() ) );
+ }
}
// -----------------------------------------------------------------------------
@@ -2208,14 +2216,7 @@ sal_Bool SdrOle2Obj::AddOwnLightClient()
//////////////////////////////////////////////////////////////////////////////
-bool SdrOle2Obj::executeOldDoPaintPreparations(SdrPageView* /*pPageVew*/) const
-{
- //#i101925# moved this stuff to method ViewObjectContactOfSdrOle2Obj::createPrimitive2DSequence and reorganized it further to avoid superfluous metafile creation for charts
- //this method can be removed with the next incompatible build
- return false;
-}
-
-Bitmap SdrOle2Obj::GetEmtyOLEReplacementBitmap() const
+Bitmap SdrOle2Obj::GetEmtyOLEReplacementBitmap()
{
return Bitmap(ResId(BMP_SVXOLEOBJ, *ImpGetResMgr()));
}
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 1e9c9b57c52d..f44efe3c5dfa 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -951,32 +951,86 @@ bool ImpPathForDragAndCreate::endPathDrag(SdrDragStat& rDrag)
String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag) const
{
- ImpSdrPathDragData* pDragData = mpSdrPathDragData;
+ XubString aStr;
+ const SdrHdl* pHdl = rDrag.GetHdl();
+ const bool bCreateComment(rDrag.GetView() && &mrSdrPathObject == rDrag.GetView()->GetCreateObj());
- if(!pDragData)
+ if(bCreateComment && rDrag.GetUser())
{
- // getSpecialDragComment is also used from create, so fallback to GetUser()
- // when mpSdrPathDragData is not set
- pDragData = (ImpSdrPathDragData*)rDrag.GetUser();
- }
+ // #i103058# re-add old creation comment mode
+ ImpPathCreateUser* pU = (ImpPathCreateUser*)rDrag.GetUser();
+ const SdrObjKind eKindMerk(meObjectKind);
+ mrSdrPathObject.meKind = pU->eAktKind;
+ mrSdrPathObject.ImpTakeDescriptionStr(STR_ViewCreateObj, aStr);
+ mrSdrPathObject.meKind = eKindMerk;
- if(!pDragData)
- {
- DBG_ERROR("ImpPathForDragAndCreate::MovDrag(): ImpSdrPathDragData ist ungueltig");
- return String();
- }
+ Point aPrev(rDrag.GetPrev());
+ Point aNow(rDrag.GetNow());
- // Hier auch mal pDragData verwenden !!!
- XubString aStr;
+ if(pU->bLine)
+ aNow = pU->aLineEnd;
- const SdrHdl* pHdl = rDrag.GetHdl();
+ aNow -= aPrev;
+ aStr.AppendAscii(" (");
- if(!mrSdrPathObject.GetModel() || !pHdl)
+ XubString aMetr;
+
+ if(pU->bCircle)
+ {
+ mrSdrPathObject.GetModel()->TakeWinkStr(Abs(pU->nCircRelWink), aMetr);
+ aStr += aMetr;
+ aStr.AppendAscii(" r=");
+ mrSdrPathObject.GetModel()->TakeMetricStr(pU->nCircRadius, aMetr, TRUE);
+ aStr += aMetr;
+ }
+
+ aStr.AppendAscii("dx=");
+ mrSdrPathObject.GetModel()->TakeMetricStr(aNow.X(), aMetr, TRUE);
+ aStr += aMetr;
+
+ aStr.AppendAscii(" dy=");
+ mrSdrPathObject.GetModel()->TakeMetricStr(aNow.Y(), aMetr, TRUE);
+ aStr += aMetr;
+
+ if(!IsFreeHand(meObjectKind))
+ {
+ INT32 nLen(GetLen(aNow));
+ aStr.AppendAscii(" l=");
+ mrSdrPathObject.GetModel()->TakeMetricStr(nLen, aMetr, TRUE);
+ aStr += aMetr;
+
+ INT32 nWink(GetAngle(aNow));
+ aStr += sal_Unicode(' ');
+ mrSdrPathObject.GetModel()->TakeWinkStr(nWink, aMetr);
+ aStr += aMetr;
+ }
+
+ aStr += sal_Unicode(')');
+ }
+ else if(!mrSdrPathObject.GetModel() || !pHdl)
{
+ // #i103058# fallback when no model and/or Handle, both needed
+ // for else-path
mrSdrPathObject.ImpTakeDescriptionStr(STR_DragPathObj, aStr);
}
else
{
+ // #i103058# standard for modification; model and handle needed
+ ImpSdrPathDragData* pDragData = mpSdrPathDragData;
+
+ if(!pDragData)
+ {
+ // getSpecialDragComment is also used from create, so fallback to GetUser()
+ // when mpSdrPathDragData is not set
+ pDragData = (ImpSdrPathDragData*)rDrag.GetUser();
+ }
+
+ if(!pDragData)
+ {
+ DBG_ERROR("ImpPathForDragAndCreate::MovDrag(): ImpSdrPathDragData ist ungueltig");
+ return String();
+ }
+
if(!pDragData->IsMultiPointDrag() && pDragData->bEliminate)
{
// Punkt von ...
@@ -2150,12 +2204,26 @@ bool SdrPathObj::applySpecialDrag(SdrDragStat& rDrag)
String SdrPathObj::getSpecialDragComment(const SdrDragStat& rDrag) const
{
String aRetval;
- ImpPathForDragAndCreate aDragAndCreate(*((SdrPathObj*)this));
- bool bDidWork(aDragAndCreate.beginPathDrag((SdrDragStat&)rDrag));
- if(bDidWork)
+ if(mpDAC)
{
- aRetval = aDragAndCreate.getSpecialDragComment(rDrag);
+ // #i103058# also get a comment when in creation
+ const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj());
+
+ if(bCreateComment)
+ {
+ aRetval = mpDAC->getSpecialDragComment(rDrag);
+ }
+ }
+ else
+ {
+ ImpPathForDragAndCreate aDragAndCreate(*((SdrPathObj*)this));
+ bool bDidWork(aDragAndCreate.beginPathDrag((SdrDragStat&)rDrag));
+
+ if(bDidWork)
+ {
+ aRetval = aDragAndCreate.getSpecialDragComment(rDrag);
+ }
}
return aRetval;
diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx
index 837b75bcf849..7d69955ec441 100644
--- a/svx/source/svdraw/svdorect.cxx
+++ b/svx/source/svdraw/svdorect.cxx
@@ -419,33 +419,42 @@ bool SdrRectObj::applySpecialDrag(SdrDragStat& rDrag)
String SdrRectObj::getSpecialDragComment(const SdrDragStat& rDrag) const
{
- const bool bRad(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind());
+ const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj());
- if(bRad)
+ if(bCreateComment)
{
- Point aPt(rDrag.GetNow());
+ return String();
+ }
+ else
+ {
+ const bool bRad(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind());
- // -sin fuer Umkehrung
- if(aGeo.nDrehWink)
- RotatePoint(aPt, aRect.TopLeft(), -aGeo.nSin, aGeo.nCos);
+ if(bRad)
+ {
+ Point aPt(rDrag.GetNow());
- sal_Int32 nRad(aPt.X() - aRect.Left());
+ // -sin fuer Umkehrung
+ if(aGeo.nDrehWink)
+ RotatePoint(aPt, aRect.TopLeft(), -aGeo.nSin, aGeo.nCos);
- if(nRad < 0)
- nRad = 0;
+ sal_Int32 nRad(aPt.X() - aRect.Left());
- XubString aStr;
+ if(nRad < 0)
+ nRad = 0;
- ImpTakeDescriptionStr(STR_DragRectEckRad, aStr);
- aStr.AppendAscii(" (");
- aStr += GetMetrStr(nRad);
- aStr += sal_Unicode(')');
+ XubString aStr;
- return aStr;
- }
- else
- {
- return SdrTextObj::getSpecialDragComment(rDrag);
+ ImpTakeDescriptionStr(STR_DragRectEckRad, aStr);
+ aStr.AppendAscii(" (");
+ aStr += GetMetrStr(nRad);
+ aStr += sal_Unicode(')');
+
+ return aStr;
+ }
+ else
+ {
+ return SdrTextObj::getSpecialDragComment(rDrag);
+ }
}
}
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 76c29de8d480..93d3651e3f01 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -119,6 +119,12 @@ namespace
// the visible area for contour text decomposition
basegfx::B2DVector maScale;
+ // #SJ# ClipRange for BlockText decomposition; only text portions completely
+ // inside are to be accepted, so this is different from geometric clipping
+ // (which would allow e.g. upper parts of portions to remain). Only used for
+ // BlockText (see there)
+ basegfx::B2DRange maClipRange;
+
DECL_LINK(decomposeContourTextPrimitive, DrawPortionInfo* );
DECL_LINK(decomposeBlockTextPrimitive, DrawPortionInfo* );
DECL_LINK(decomposeStretchTextPrimitive, DrawPortionInfo* );
@@ -137,7 +143,14 @@ namespace
public:
impTextBreakupHandler(SdrOutliner& rOutliner)
- : mrOutliner(rOutliner)
+ : maTextPortionPrimitives(),
+ maLinePrimitives(),
+ maParagraphPrimitives(),
+ mrOutliner(rOutliner),
+ maNewTransformA(),
+ maNewTransformB(),
+ maScale(),
+ maClipRange()
{
}
@@ -153,10 +166,14 @@ namespace
mrOutliner.SetDrawBulletHdl(Link());
}
- void decomposeBlockTextPrimitive(const basegfx::B2DHomMatrix& rNewTransformA, const basegfx::B2DHomMatrix& rNewTransformB)
+ void decomposeBlockTextPrimitive(
+ const basegfx::B2DHomMatrix& rNewTransformA,
+ const basegfx::B2DHomMatrix& rNewTransformB,
+ const basegfx::B2DRange& rClipRange)
{
maNewTransformA = rNewTransformA;
maNewTransformB = rNewTransformB;
+ maClipRange = rClipRange;
mrOutliner.SetDrawPortionHdl(LINK(this, impTextBreakupHandler, decomposeBlockTextPrimitive));
mrOutliner.SetDrawBulletHdl(LINK(this, impTextBreakupHandler, decomposeBlockBulletPrimitive));
mrOutliner.StripPortions();
@@ -198,30 +215,23 @@ namespace
{
if(rInfo.mrText.Len() && rInfo.mnTextLen)
{
- basegfx::B2DVector aSize;
- drawinglayer::primitive2d::FontAttributes aFontAttributes(drawinglayer::primitive2d::getFontAttributesFromVclFont(
- aSize,
- rInfo.mrFont,
- rInfo.IsRTL(),
- false));
+ basegfx::B2DVector aFontScaling;
+ drawinglayer::primitive2d::FontAttributes aFontAttributes(
+ drawinglayer::primitive2d::getFontAttributesFromVclFont(
+ aFontScaling,
+ rInfo.mrFont,
+ rInfo.IsRTL(),
+ false));
basegfx::B2DHomMatrix aNewTransform;
- // #i100489# need extra scale factor for DXArray which collects all scalings
- // which are needed to get the DXArray to unit coordinates
- double fDXArrayScaleFactor(aSize.getX());
-
// add font scale to new transform
- aNewTransform.scale(aSize.getX(), aSize.getY());
+ aNewTransform.scale(aFontScaling.getX(), aFontScaling.getY());
// look for proportional font scaling, evtl scale accordingly
if(100 != rInfo.mrFont.GetPropr())
{
const double fFactor(rInfo.mrFont.GetPropr() / 100.0);
aNewTransform.scale(fFactor, fFactor);
-
- // #i100489# proportional font scaling influences the DXArray,
- // add to factor
- fDXArrayScaleFactor *= fFactor;
}
// apply font rotate
@@ -254,7 +264,7 @@ namespace
}
const double fEscapement(nEsc / -100.0);
- aNewTransform.translate(0.0, fEscapement * aSize.getY());
+ aNewTransform.translate(0.0, fEscapement * aFontScaling.getY());
}
// apply transformA
@@ -273,13 +283,11 @@ namespace
if(!bDisableTextArray && rInfo.mpDXArray && rInfo.mnTextLen)
{
- // #i100489# use fDXArrayScaleFactor here
- const double fScaleFactor(basegfx::fTools::equalZero(fDXArrayScaleFactor) ? 1.0 : 1.0 / fDXArrayScaleFactor);
aDXArray.reserve(rInfo.mnTextLen);
for(xub_StrLen a(0); a < rInfo.mnTextLen; a++)
{
- aDXArray.push_back((double)rInfo.mpDXArray[a] * fScaleFactor);
+ aDXArray.push_back((double)rInfo.mpDXArray[a]);
}
}
@@ -455,6 +463,17 @@ namespace
fEnd = fTextWidth - fEnd;
}
+ // need to take FontScaling out of values; it's already part of
+ // aNewTransform and would be double applied
+ const double fFontScaleX(aFontScaling.getX());
+
+ if(!basegfx::fTools::equal(fFontScaleX, 1.0)
+ && !basegfx::fTools::equalZero(fFontScaleX))
+ {
+ fStart /= fFontScaleX;
+ fEnd /= fFontScaleX;
+ }
+
maTextPortionPrimitives.push_back(new drawinglayer::primitive2d::WrongSpellPrimitive2D(
aNewTransform,
fStart,
@@ -588,6 +607,43 @@ namespace
{
if(pInfo)
{
+ // #SJ# Is clipping wanted? This is text clipping; only accept a portion
+ // if it's completely in the range
+ if(!maClipRange.isEmpty())
+ {
+ // Test start position first; this allows to not get the text range at
+ // all if text is far outside
+ const basegfx::B2DPoint aStartPosition(pInfo->mrStartPos.X(), pInfo->mrStartPos.Y());
+
+ if(!maClipRange.isInside(aStartPosition))
+ {
+ return 0;
+ }
+
+ // Start position is inside. Get TextBoundRect and TopLeft next
+ drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ aTextLayouterDevice.setFont(pInfo->mrFont);
+
+ const basegfx::B2DRange aTextBoundRect(
+ aTextLayouterDevice.getTextBoundRect(
+ pInfo->mrText, pInfo->mnTextStart, pInfo->mnTextLen));
+ const basegfx::B2DPoint aTopLeft(aTextBoundRect.getMinimum() + aStartPosition);
+
+ if(!maClipRange.isInside(aTopLeft))
+ {
+ return 0;
+ }
+
+ // TopLeft is inside. Get BottomRight and check
+ const basegfx::B2DPoint aBottomRight(aTextBoundRect.getMaximum() + aStartPosition);
+
+ if(!maClipRange.isInside(aBottomRight))
+ {
+ return 0;
+ }
+
+ // all inside, clip was successful
+ }
impHandleDrawPortionInfo(*pInfo);
}
@@ -655,16 +711,7 @@ namespace
//////////////////////////////////////////////////////////////////////////////
// primitive decompositions
-bool SdrTextObj::impCheckSpellCheckForDecomposeTextPrimitive() const
-{
- // #i102062# asked TL who killed this feature (CWS tl56). Obviously, there
- // is no more support for EE_CNTRL_NOREDLINES anymore; redlining is always
- // on nowadays. Unfortunately, not false, but true should be returned then.
- // Trying if this is all...
- return true;
-}
-
-bool SdrTextObj::impDecomposeContourTextPrimitive(
+void SdrTextObj::impDecomposeContourTextPrimitive(
drawinglayer::primitive2d::Primitive2DSequence& rTarget,
const drawinglayer::primitive2d::SdrContourTextPrimitive2D& rSdrContourTextPrimitive,
const drawinglayer::geometry::ViewInformation2D& aViewInformation) const
@@ -716,10 +763,9 @@ bool SdrTextObj::impDecomposeContourTextPrimitive(
rOutliner.setVisualizedPage(0);
rTarget = aConverter.getPrimitive2DSequence();
- return false;
}
-bool SdrTextObj::impDecomposeBlockTextPrimitive(
+void SdrTextObj::impDecomposeBlockTextPrimitive(
drawinglayer::primitive2d::Primitive2DSequence& rTarget,
const drawinglayer::primitive2d::SdrBlockTextPrimitive2D& rSdrBlockTextPrimitive,
const drawinglayer::geometry::ViewInformation2D& aViewInformation) const
@@ -735,19 +781,15 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive(
// prepare outliner
const bool bIsCell(rSdrBlockTextPrimitive.getCellText());
- const SfxItemSet& rTextItemSet = rSdrBlockTextPrimitive.getSdrText()
- ? rSdrBlockTextPrimitive.getSdrText()->GetItemSet()
- : GetObjectItemSet();
SdrOutliner& rOutliner = ImpGetDrawOutliner();
- SdrTextVertAdjust eVAdj = GetTextVerticalAdjust(rTextItemSet);
- SdrTextHorzAdjust eHAdj = GetTextHorizontalAdjust(rTextItemSet);
+ SdrTextHorzAdjust eHAdj = rSdrBlockTextPrimitive.getSdrTextHorzAdjust();
+ SdrTextVertAdjust eVAdj = rSdrBlockTextPrimitive.getSdrTextVertAdjust();
const sal_uInt32 nOriginalControlWord(rOutliner.GetControlWord());
const Size aNullSize;
// set visualizing page at Outliner; needed e.g. for PageNumberField decomposition
rOutliner.setVisualizedPage(GetSdrPageFromXDrawPage(aViewInformation.getVisualizedPage()));
-
- rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)rTextItemSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue());
+ rOutliner.SetFixedCellHeight(rSdrBlockTextPrimitive.isFixedCellHeight());
rOutliner.SetControlWord(nOriginalControlWord|EE_CNTRL_AUTOPAGESIZE);
rOutliner.SetMinAutoPaperSize(aNullSize);
rOutliner.SetMaxAutoPaperSize(Size(1000000,1000000));
@@ -903,19 +945,27 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive(
aNewTransformB.rotate(fRotate);
aNewTransformB.translate(aTranslate.getX(), aTranslate.getY());
+ // #SJ# create ClipRange (if needed)
+ basegfx::B2DRange aClipRange;
+
+ if(bIsCell)
+ {
+ aClipRange.expand(basegfx::B2DTuple(0.0, 0.0));
+ aClipRange.expand(basegfx::B2DTuple(aAnchorTextSize.Width(), aAnchorTextSize.Height()));
+ }
+
// now break up text primitives.
impTextBreakupHandler aConverter(rOutliner);
- aConverter.decomposeBlockTextPrimitive(aNewTransformA, aNewTransformB);
+ aConverter.decomposeBlockTextPrimitive(aNewTransformA, aNewTransformB, aClipRange);
// cleanup outliner
rOutliner.Clear();
rOutliner.setVisualizedPage(0);
rTarget = aConverter.getPrimitive2DSequence();
- return false;
}
-bool SdrTextObj::impDecomposeStretchTextPrimitive(
+void SdrTextObj::impDecomposeStretchTextPrimitive(
drawinglayer::primitive2d::Primitive2DSequence& rTarget,
const drawinglayer::primitive2d::SdrStretchTextPrimitive2D& rSdrStretchTextPrimitive,
const drawinglayer::geometry::ViewInformation2D& aViewInformation) const
@@ -932,13 +982,10 @@ bool SdrTextObj::impDecomposeStretchTextPrimitive(
// prepare outliner
SdrOutliner& rOutliner = ImpGetDrawOutliner();
const sal_uInt32 nOriginalControlWord(rOutliner.GetControlWord());
- const SfxItemSet& rTextItemSet = rSdrStretchTextPrimitive.getSdrText()
- ? rSdrStretchTextPrimitive.getSdrText()->GetItemSet()
- : GetObjectItemSet();
const Size aNullSize;
rOutliner.SetControlWord(nOriginalControlWord|EE_CNTRL_STRETCHING|EE_CNTRL_AUTOPAGESIZE);
- rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)rTextItemSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue());
+ rOutliner.SetFixedCellHeight(rSdrStretchTextPrimitive.isFixedCellHeight());
rOutliner.SetMinAutoPaperSize(aNullSize);
rOutliner.SetMaxAutoPaperSize(Size(1000000,1000000));
rOutliner.SetPaperSize(aNullSize);
@@ -996,7 +1043,6 @@ bool SdrTextObj::impDecomposeStretchTextPrimitive(
rOutliner.setVisualizedPage(0);
rTarget = aConverter.getPrimitive2DSequence();
- return false;
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index f3bdeeb4811c..f6a30d40b3d5 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -365,12 +365,13 @@ namespace
for(sal_uInt32 a(0L); a < rTextPortions.size() && fPolyStart < fPolyEnd; a++)
{
const impPathTextPortion* pCandidate = rTextPortions[a];
- basegfx::B2DVector aSize;
- const drawinglayer::primitive2d::FontAttributes aCandidateFontAttributes(drawinglayer::primitive2d::getFontAttributesFromVclFont(
- aSize,
- pCandidate->getFont(),
- pCandidate->isRTL(),
- false));
+ basegfx::B2DVector aFontScaling;
+ const drawinglayer::primitive2d::FontAttributes aCandidateFontAttributes(
+ drawinglayer::primitive2d::getFontAttributesFromVclFont(
+ aFontScaling,
+ pCandidate->getFont(),
+ pCandidate->isRTL(),
+ false));
if(pCandidate && pCandidate->getTextLength())
{
@@ -397,7 +398,7 @@ namespace
basegfx::B2DPoint aEndPos(aStartPos);
// add font scaling
- aNewTransformA.scale(aSize.getX(), aSize.getY());
+ aNewTransformA.scale(aFontScaling.getX(), aFontScaling.getY());
// prepare scaling of text primitive
if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust())
@@ -512,15 +513,16 @@ namespace
pCandidate->getDoubleDXArray().begin() + nPortionIndex,
pCandidate->getDoubleDXArray().begin() + nPortionIndex + nNextGlyphLen);
- drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pNew = new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
- aNewTransformB * aNewShadowTransform * aNewTransformA,
- pCandidate->getText(),
- nPortionIndex,
- nNextGlyphLen,
- aNewDXArray,
- aCandidateFontAttributes,
- pCandidate->getLocale(),
- aRGBShadowColor);
+ drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pNew =
+ new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
+ aNewTransformB * aNewShadowTransform * aNewTransformA,
+ pCandidate->getText(),
+ nPortionIndex,
+ nNextGlyphLen,
+ aNewDXArray,
+ aCandidateFontAttributes,
+ pCandidate->getLocale(),
+ aRGBShadowColor);
mrShadowDecomposition.push_back(pNew);
}
@@ -536,15 +538,16 @@ namespace
pCandidate->getDoubleDXArray().begin() + nPortionIndex,
pCandidate->getDoubleDXArray().begin() + nPortionIndex + nNextGlyphLen);
- drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pNew = new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
- aNewTransformB * aNewTransformA,
- pCandidate->getText(),
- nPortionIndex,
- nNextGlyphLen,
- aNewDXArray,
- aCandidateFontAttributes,
- pCandidate->getLocale(),
- aRGBColor);
+ drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pNew =
+ new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
+ aNewTransformB * aNewTransformA,
+ pCandidate->getText(),
+ nPortionIndex,
+ nNextGlyphLen,
+ aNewDXArray,
+ aCandidateFontAttributes,
+ pCandidate->getLocale(),
+ aRGBColor);
mrDecomposition.push_back(pNew);
}
@@ -671,7 +674,7 @@ namespace
//////////////////////////////////////////////////////////////////////////////
// primitive decomposition
-bool SdrTextObj::impDecomposePathTextPrimitive(
+void SdrTextObj::impDecomposePathTextPrimitive(
drawinglayer::primitive2d::Primitive2DSequence& rTarget,
const drawinglayer::primitive2d::SdrPathTextPrimitive2D& rSdrPathTextPrimitive,
const drawinglayer::geometry::ViewInformation2D& aViewInformation) const
@@ -789,8 +792,6 @@ bool SdrTextObj::impDecomposePathTextPrimitive(
// concatenate all results
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(rTarget, aRetvalA);
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(rTarget, aRetvalB);
-
- return false;
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/svdraw/svdstr.src b/svx/source/svdraw/svdstr.src
index 32c457cf3d02..144db41d515f 100644
--- a/svx/source/svdraw/svdstr.src
+++ b/svx/source/svdraw/svdstr.src
@@ -1127,6 +1127,20 @@ String STR_UndoMovLayer
{
Text [ en-US ] = "Change order of layers" ;
};
+// --> OD 2009-07-09 #i73249#
+String STR_UndoObjName
+{
+ Text [ en-US ] = "Change object name of %1 to" ;
+};
+String STR_UndoObjTitle
+{
+ Text [ en-US ] = "Change object title of %1" ;
+};
+String STR_UndoObjDescription
+{
+ Text [ en-US ] = "Change object description of %1" ;
+};
+// <--
String STR_StandardLayerName
{
Text [ en-US ] = "Standard" ;
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index b49d087d0251..08cee1eb17d3 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -1219,6 +1219,95 @@ bool SdrUndoObjSetText::CanSdrRepeat(SdrView& rView) const
return bOk;
}
+// --> OD 2009-07-09 #i73249#
+SdrUndoObjStrAttr::SdrUndoObjStrAttr( SdrObject& rNewObj,
+ const ObjStrAttrType eObjStrAttr,
+ const String& sOldStr,
+ const String& sNewStr)
+ : SdrUndoObj( rNewObj ),
+ meObjStrAttr( eObjStrAttr ),
+ msOldStr( sOldStr ),
+ msNewStr( sNewStr )
+{
+}
+
+void SdrUndoObjStrAttr::Undo()
+{
+ ImpShowPageOfThisObject();
+
+ switch ( meObjStrAttr )
+ {
+ case OBJ_NAME:
+ {
+ pObj->SetName( msOldStr );
+ }
+ break;
+ case OBJ_TITLE:
+ {
+ pObj->SetTitle( msOldStr );
+ }
+ break;
+ case OBJ_DESCRIPTION:
+ {
+ pObj->SetDescription( msOldStr );
+ }
+ break;
+ }
+}
+
+void SdrUndoObjStrAttr::Redo()
+{
+ switch ( meObjStrAttr )
+ {
+ case OBJ_NAME:
+ {
+ pObj->SetName( msNewStr );
+ }
+ break;
+ case OBJ_TITLE:
+ {
+ pObj->SetTitle( msNewStr );
+ }
+ break;
+ case OBJ_DESCRIPTION:
+ {
+ pObj->SetDescription( msNewStr );
+ }
+ break;
+ }
+
+ ImpShowPageOfThisObject();
+}
+
+String SdrUndoObjStrAttr::GetComment() const
+{
+ String aStr;
+ switch ( meObjStrAttr )
+ {
+ case OBJ_NAME:
+ {
+ ImpTakeDescriptionStr( STR_UndoObjName, aStr );
+ aStr += sal_Unicode(' ');
+ aStr += sal_Unicode('\'');
+ aStr += msNewStr;
+ aStr += sal_Unicode('\'');
+ }
+ break;
+ case OBJ_TITLE:
+ {
+ ImpTakeDescriptionStr( STR_UndoObjTitle, aStr );
+ }
+ break;
+ case OBJ_DESCRIPTION:
+ {
+ ImpTakeDescriptionStr( STR_UndoObjDescription, aStr );
+ }
+ break;
+ }
+
+ return aStr;
+}
+
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//
@@ -1726,6 +1815,15 @@ SdrUndoAction* SdrUndoFactory::CreateUndoObjectSetText( SdrObject& rNewObj, sal_
return new SdrUndoObjSetText( rNewObj, nText );
}
+SdrUndoAction* SdrUndoFactory::CreateUndoObjectStrAttr( SdrObject& rObject,
+ SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType,
+ String sOldStr,
+ String sNewStr )
+{
+ return new SdrUndoObjStrAttr( rObject, eObjStrAttrType, sOldStr, sNewStr );
+}
+
+
// layer
SdrUndoAction* SdrUndoFactory::CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
{
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 23f3981228e1..b9a197ed89fb 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -697,17 +697,16 @@ Graphic SdrExchangeView::GetObjGraphic( const SdrModel* pModel, const SdrObject*
aOut.EnableOutput( FALSE );
aOut.SetMapMode( aMap );
aMtf.Record( &aOut );
-
- // aXOut.SetOffset( Point( -aBoundRect.Left(), -aBoundRect.Top() ) );
- // #i92760# offset set in wrong direction, corrected
- MapMode aOffsetMapMode(aOut.GetMapMode());
- aOffsetMapMode.SetOrigin(Point(-aBoundRect.Left(), -aBoundRect.Top()));
- aOut.SetMapMode(aOffsetMapMode);
-
pObj->SingleObjectPainter( aOut ); // #110094#-17
-
aMtf.Stop();
aMtf.WindStart();
+
+ // #i99268# replace the original offset from using XOutDev's SetOffset
+ // NOT (as tried with #i92760#) with another MapMode which gets recorded
+ // by the Metafile itself (what always leads to problems), but by hardly
+ // moving the result
+ aMtf.Move(-aBoundRect.Left(), -aBoundRect.Top());
+
aMtf.SetPrefMapMode( aMap );
aMtf.SetPrefSize( aBoundRect.GetSize() );
diff --git a/svx/source/svrtf/makefile.mk b/svx/source/svrtf/makefile.mk
index 8dbbd79a82fe..950036034d41 100644
--- a/svx/source/svrtf/makefile.mk
+++ b/svx/source/svrtf/makefile.mk
@@ -36,6 +36,7 @@ PROJECTPCHSOURCE=$(PRJ)$/util$/svxpch
PRJNAME=svx
TARGET=svxrtf
+LIBTARGET=NO
AUTOSEG=true
# --- Settings -----------------------------------------------------
@@ -48,11 +49,17 @@ AUTOSEG=true
EXCEPTIONSFILES= \
$(SLO)$/svxrtf.obj
-SLOFILES = \
- $(SLO)$/rtfgrf.obj \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/rtfitem.obj \
$(SLO)$/svxrtf.obj
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/rtfgrf.obj
+
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
# ==========================================================================
.INCLUDE : target.mk
diff --git a/svx/source/svrtf/rtfgrf.cxx b/svx/source/svrtf/rtfgrf.cxx
index 417c72cf02b1..de90302586d0 100644
--- a/svx/source/svrtf/rtfgrf.cxx
+++ b/svx/source/svrtf/rtfgrf.cxx
@@ -559,17 +559,4 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType )
return bValidBmp;
}
- // alle Werte auf default; wird nach einlesen der Bitmap aufgerufen !
-void SvxRTFPictureType::ResetValues()
-{ // setze alle Werte RTF-Defaults
- eStyle = RTF_BITMAP;
- nMode = HEX_MODE;
- nType = nGoalWidth = nGoalHeight = 0;
- nWidth = nHeight = nWidthBytes = 0;
- uPicLen = 0;
- nBitsPerPixel = nPlanes = 1;
- nScalX = nScalY = 100; // Skalierung in Prozent
- nCropT = nCropB = nCropL = nCropR = 0;
-}
-
/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/svx/source/svrtf/rtfitem.cxx b/svx/source/svrtf/rtfitem.cxx
index bab67c91b1ef..889298b89f35 100644
--- a/svx/source/svrtf/rtfitem.cxx
+++ b/svx/source/svrtf/rtfitem.cxx
@@ -1257,12 +1257,16 @@ ATTR_SETEMPHASIS:
ReadTabAttr( nToken, *pSet );
/*
- cmc: #i76140, he who reads the { must read the }
+ cmc: #i76140, he who consumed the { must consume the }
We rewound to a state of { being the current
- token so it is our responsibility to read the }
- token.
+ token so it is our responsibility to consume the }
+ token if we consumed the {. We will not have consumed
+ the { if it belonged to our caller, i.e. if the { we
+ are handling is the "firsttoken" passed to us then
+ the *caller* must consume it, not us. Otherwise *we*
+ should consume it.
*/
- if (nToken == BRACELEFT)
+ if (nToken == BRACELEFT && !bFirstToken)
{
nToken = GetNextToken();
DBG_ASSERT( nToken == BRACERIGHT,
diff --git a/svx/source/svxlink/fileobj.cxx b/svx/source/svxlink/fileobj.cxx
index f2628f181d31..d159c7f78abe 100644
--- a/svx/source/svxlink/fileobj.cxx
+++ b/svx/source/svxlink/fileobj.cxx
@@ -121,37 +121,6 @@ BOOL SvFileObject::GetData( ::com::sun::star::uno::Any & rData,
// relativen Datei Links aufzuloesen!!!! Wird ueber den
// LinkManager und damit von dessen Storage erledigt.
rData <<= rtl::OUString( sFileNm );
-
-/*
-===========================================================================
-JP 28.02.96: noch eine Baustelle:
- Idee: hier das Medium und die DocShell anlegen, Doc laden
- und ueber OLE-SS (GetObj(...)) den Bereich als
- PseudoObject erfragen. Dieses mit den Daten oder
- dessen Daten verschicken.
-
-===========================================================================
-
- SfxMedium aMed( aFileNm.GetFull(), STREAM_READ, TRUE );
- aMed.DownLoad(); // nur mal das Medium anfassen (DownLoaden)
-
- if( aMed.IsStorage() )
- pSvData->SetData( SvStorageRef( aMed.GetStorage() ),
- TRANSFER_COPY );
- else
- {
- SvStream* pStream = aMed.GetInStream();
- if( !pStream )
- return FALSE;
-
- UINT32 nLen = pStream->Seek( STREAM_SEEK_TO_END );
- pStream->Seek( STREAM_SEEK_TO_BEGIN );
-
- void* pData = SvMemAlloc( nLen );
- pStream->Read( pData, nLen );
- pSvData->SetData( pData, nLen, TRANSFER_MOVE );
- }
-*/
}
break;
diff --git a/svx/source/table/accessiblecell.cxx b/svx/source/table/accessiblecell.cxx
index 6f4bea3cbd40..d76d5e1b3079 100644
--- a/svx/source/table/accessiblecell.cxx
+++ b/svx/source/table/accessiblecell.cxx
@@ -573,4 +573,15 @@ sal_Int32 SAL_CALL AccessibleCell::getAccessibleIndexInParent (void) throw (Runt
return mnIndexInParent;
}
+::rtl::OUString SAL_CALL AccessibleCell::getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException)
+{
+ ThrowIfDisposed ();
+ ::vos::OGuard aSolarGuard (::Application::GetSolarMutex());
+
+ if( mxCell.is() )
+ return mxCell->getName();
+
+ return AccessibleCellBase::getAccessibleName();
+}
+
} // end of namespace accessibility
diff --git a/svx/source/table/accessiblecell.hxx b/svx/source/table/accessiblecell.hxx
index 166495ecc83d..95c8d684fe3b 100644
--- a/svx/source/table/accessiblecell.hxx
+++ b/svx/source/table/accessiblecell.hxx
@@ -85,6 +85,7 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL getAccessibleChild(sal_Int32 nIndex) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL getAccessibleStateSet(void) throw(::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(void) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException);
// XAccessibleComponent
virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint) throw (::com::sun::star::uno::RuntimeException);
diff --git a/svx/source/table/accessibletableshape.cxx b/svx/source/table/accessibletableshape.cxx
index 89e18137eeb0..455d39eee467 100644
--- a/svx/source/table/accessibletableshape.cxx
+++ b/svx/source/table/accessibletableshape.cxx
@@ -160,6 +160,8 @@ Reference< XAccessible > AccessibleTableShapeImpl::getAccessibleChild( sal_Int32
maChildMap[xCell] = xAccessibleCell;
+ xAccessibleCell->Init();
+
Reference< XAccessible > xChild( xAccessibleCell.get() );
return xChild;
}
@@ -501,10 +503,11 @@ Reference< XAccessible > SAL_CALL AccessibleTableShape::getAccessibleCellAt( sal
::vos::OGuard aSolarGuard (::Application::GetSolarMutex());
checkCellPosition( nColumn, nRow );
- (void)nRow;
- (void)nColumn;
- Reference< XAccessible > xRet;
- return xRet;
+ sal_Int32 nChildIndex = 0;
+ if( mxImpl->mxTable.is() )
+ nChildIndex = mxImpl->mxTable->getColumnCount() * nRow + nColumn;
+
+ return getAccessibleChild( nChildIndex );
}
//--------------------------------------------------------------------
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 4ac7b4754f8d..42034f2bd0cb 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -278,19 +278,6 @@ namespace sdr
void CellProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
{
TextProperties::SetStyleSheet( pNewStyleSheet, bDontRemoveHardAttr );
-
- if( bDontRemoveHardAttr && pNewStyleSheet )
- {
- GetObjectItemSet();
-
- const SfxItemSet& rStyleAttribs = pNewStyleSheet->GetItemSet();
-
- for ( USHORT nWhich = SDRATTR_START; nWhich <= SDRATTR_TABLE_LAST; nWhich++ )
- {
- if ( rStyleAttribs.GetItemState( nWhich ) == SFX_ITEM_ON )
- mpItemSet->ClearItem( nWhich );
- }
- }
}
} // end of namespace properties
} // end of namespace sdr
@@ -1757,5 +1744,71 @@ void SAL_CALL Cell::disposing( const EventObject& /*Source*/ ) throw (RuntimeExc
dispose();
}
+static OUString getCellName( sal_Int32 nCol, sal_Int32 nRow )
+{
+ rtl::OUStringBuffer aBuf;
+
+ if (nCol < 26*26)
+ {
+ if (nCol < 26)
+ aBuf.append( static_cast<sal_Unicode>( 'A' +
+ static_cast<sal_uInt16>(nCol)));
+ else
+ {
+ aBuf.append( static_cast<sal_Unicode>( 'A' +
+ (static_cast<sal_uInt16>(nCol) / 26) - 1));
+ aBuf.append( static_cast<sal_Unicode>( 'A' +
+ (static_cast<sal_uInt16>(nCol) % 26)));
+ }
+ }
+ else
+ {
+ String aStr;
+ while (nCol >= 26)
+ {
+ sal_Int32 nC = nCol % 26;
+ aStr += static_cast<sal_Unicode>( 'A' +
+ static_cast<sal_uInt16>(nC));
+ nCol = nCol - nC;
+ nCol = nCol / 26 - 1;
+ }
+ aStr += static_cast<sal_Unicode>( 'A' +
+ static_cast<sal_uInt16>(nCol));
+ aStr.Reverse();
+ aBuf.append( aStr);
+ }
+ aBuf.append( OUString::valueOf(nRow+1) );
+ return aBuf.makeStringAndClear();
+}
+
+OUString Cell::getName()
+{
+ // todo: optimize!
+ OUString sName;
+ if( mxTable.is() ) try
+ {
+ Reference< XCell > xThis( static_cast< XCell* >( this ) );
+
+ sal_Int32 nRowCount = mxTable->getRowCount();
+ sal_Int32 nColCount = mxTable->getColumnCount();
+ for( sal_Int32 nRow = 0; nRow < nRowCount; nRow++ )
+ {
+ for( sal_Int32 nCol = 0; nCol < nColCount; nCol++ )
+ {
+ Reference< XCell > xCell( mxTable->getCellByPosition( nCol, nRow ) );
+ if( xCell == xThis )
+ {
+ return getCellName( nCol, nRow );
+ }
+ }
+ }
+ }
+ catch( Exception& )
+ {
+ }
+
+ return sName;
+}
+
} }
diff --git a/svx/source/table/cell.hxx b/svx/source/table/cell.hxx
index e48fe5bf74d9..901fe4735e51 100644
--- a/svx/source/table/cell.hxx
+++ b/svx/source/table/cell.hxx
@@ -58,7 +58,7 @@ namespace sdr { namespace table {
// -----------------------------------------------------------------------------
-class Cell : public SdrText,
+class SVX_DLLPUBLIC Cell : public SdrText,
public SvxUnoTextBase,
public ::com::sun::star::table::XMergeableCell,
public ::com::sun::star::awt::XLayoutConstrains,
@@ -68,156 +68,158 @@ class Cell : public SdrText,
friend class CellUndo;
public:
- static rtl::Reference< Cell > create( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject );
+ SVX_DLLPRIVATE static rtl::Reference< Cell > create( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject );
// private
- void dispose();
+ SVX_DLLPRIVATE void dispose();
// SdrTextShape proxy
bool IsTextEditActive();
- bool hasText() const;
+ SVX_DLLPRIVATE bool hasText() const;
- void cloneFrom( const CellRef& rCell );
+ SVX_DLLPRIVATE void cloneFrom( const CellRef& rCell );
- void setCellRect( ::Rectangle& rCellRect ) { maCellRect = rCellRect; }
- const ::Rectangle& getCellRect() const { return maCellRect; }
- ::Rectangle& getCellRect() { return maCellRect; }
+ SVX_DLLPRIVATE void setCellRect( ::Rectangle& rCellRect ) { maCellRect = rCellRect; }
+ SVX_DLLPRIVATE const ::Rectangle& getCellRect() const { return maCellRect; }
+ SVX_DLLPRIVATE ::Rectangle& getCellRect() { return maCellRect; }
OutlinerParaObject* GetEditOutlinerParaObject() const;
- void SetStyleSheet( SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr );
- virtual SfxStyleSheet* GetStyleSheet() const;
+ SVX_DLLPRIVATE void SetStyleSheet( SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr );
+ SVX_DLLPRIVATE virtual SfxStyleSheet* GetStyleSheet() const;
SfxStyleSheetPool* GetStyleSheetPool() const;
- virtual const Rectangle& GetCurrentBoundRect() const;
- virtual void TakeTextAnchorRect(Rectangle& rAnchorRect) const;
+ SVX_DLLPRIVATE virtual const Rectangle& GetCurrentBoundRect() const;
+ SVX_DLLPRIVATE virtual void TakeTextAnchorRect(Rectangle& rAnchorRect) const;
- virtual const SfxItemSet& GetItemSet() const;
- void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, sal_Bool bClearAllItems);
+ SVX_DLLPRIVATE virtual const SfxItemSet& GetItemSet() const;
+ SVX_DLLPRIVATE void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, sal_Bool bClearAllItems);
void SetMergedItem(const SfxPoolItem& rItem);
- sal_Int32 getMinimumWidth();
- sal_Int32 getMinimumHeight();
+ SVX_DLLPRIVATE sal_Int32 getMinimumWidth();
+ SVX_DLLPRIVATE sal_Int32 getMinimumHeight();
- long GetTextLeftDistance() const;
- long GetTextRightDistance() const;
- long GetTextUpperDistance() const;
- long GetTextLowerDistance() const;
+ SVX_DLLPRIVATE long GetTextLeftDistance() const;
+ SVX_DLLPRIVATE long GetTextRightDistance() const;
+ SVX_DLLPRIVATE long GetTextUpperDistance() const;
+ SVX_DLLPRIVATE long GetTextLowerDistance() const;
- SdrTextVertAdjust GetTextVerticalAdjust() const;
+ SVX_DLLPRIVATE SdrTextVertAdjust GetTextVerticalAdjust() const;
SdrTextHorzAdjust GetTextHorizontalAdjust() const;
- virtual void SetModel(SdrModel* pNewModel);
+ SVX_DLLPRIVATE virtual void SetModel(SdrModel* pNewModel);
- void merge( sal_Int32 nColumnSpan, sal_Int32 nRowSpan );
- void mergeContent( const CellRef& xSourceCell );
- void replaceContentAndFormating( const CellRef& xSourceCell );
+ SVX_DLLPRIVATE void merge( sal_Int32 nColumnSpan, sal_Int32 nRowSpan );
+ SVX_DLLPRIVATE void mergeContent( const CellRef& xSourceCell );
+ SVX_DLLPRIVATE void replaceContentAndFormating( const CellRef& xSourceCell );
- void setMerged();
+ SVX_DLLPRIVATE void setMerged();
// XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& Type ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw ();
- virtual void SAL_CALL release() throw ();
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& Type ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL acquire() throw ();
+ SVX_DLLPRIVATE 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);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE 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);
- 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);
+ SVX_DLLPRIVATE virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
// XLayoutConstrains
- virtual ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw (::com::sun::star::uno::RuntimeException);
// XMergeableCell
- virtual ::sal_Int32 SAL_CALL getRowSpan() throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getColumnSpan() throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL isMerged() throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::sal_Int32 SAL_CALL getRowSpan() throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::sal_Int32 SAL_CALL getColumnSpan() throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::sal_Bool SAL_CALL isMerged() throw (::com::sun::star::uno::RuntimeException);
// XCell
- virtual ::rtl::OUString SAL_CALL getFormula() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setFormula( const ::rtl::OUString& aFormula ) throw (::com::sun::star::uno::RuntimeException);
- virtual double SAL_CALL getValue() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setValue( double nValue ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::table::CellContentType SAL_CALL getType() throw (::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getError() throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::rtl::OUString SAL_CALL getFormula() throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setFormula( const ::rtl::OUString& aFormula ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual double SAL_CALL getValue() throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setValue( double nValue ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::table::CellContentType SAL_CALL getType() throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual sal_Int32 SAL_CALL getError() throw (::com::sun::star::uno::RuntimeException);
// ::com::sun::star::beans::XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
// XMultiPropertySet
- virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
// ::com::sun::star::beans::XPropertyState
- virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
// XMultiPropertyStates
- virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
// XFastPropertySet
- virtual void SAL_CALL setFastPropertyValue( ::sal_Int32 nHandle, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getFastPropertyValue( ::sal_Int32 nHandle ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setFastPropertyValue( ::sal_Int32 nHandle, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Any SAL_CALL getFastPropertyValue( ::sal_Int32 nHandle ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
// XText
- virtual void SAL_CALL insertTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent, ::sal_Bool bAbsorb ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL insertTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent, ::sal_Bool bAbsorb ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL removeTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
// XSimpleText
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& aTextPosition ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL insertString( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::rtl::OUString& aString, ::sal_Bool bAbsorb ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL insertControlCharacter( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, ::sal_Int16 nControlCharacter, ::sal_Bool bAbsorb ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& aTextPosition ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL insertString( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::rtl::OUString& aString, ::sal_Bool bAbsorb ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL insertControlCharacter( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, ::sal_Int16 nControlCharacter, ::sal_Bool bAbsorb ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
// XTextRange
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getString( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setString( const ::rtl::OUString& aString ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::rtl::OUString SAL_CALL getString( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setString( const ::rtl::OUString& aString ) 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);
+ SVX_DLLPRIVATE virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SetOutlinerParaObject( OutlinerParaObject* pTextObject );
+ SVX_DLLPRIVATE virtual void SetOutlinerParaObject( OutlinerParaObject* pTextObject );
- void AddUndo();
+ SVX_DLLPRIVATE void AddUndo();
using SvxUnoTextRangeBase::setPropertyValue;
using SvxUnoTextRangeBase::getPropertyValue;
- sdr::properties::TextProperties* CloneProperties( SdrObject& rNewObj, Cell& rNewCell );
+ SVX_DLLPRIVATE sdr::properties::TextProperties* CloneProperties( SdrObject& rNewObj, Cell& rNewCell );
- static sdr::properties::TextProperties* CloneProperties( sdr::properties::TextProperties* pProperties, SdrObject& rNewObj, Cell& rNewCell );
+ SVX_DLLPRIVATE static sdr::properties::TextProperties* CloneProperties( sdr::properties::TextProperties* pProperties, SdrObject& rNewObj, Cell& rNewCell );
- void notifyModified();
+ SVX_DLLPRIVATE void notifyModified();
+
+ ::rtl::OUString getName();
protected:
- virtual const SfxItemSet& GetObjectItemSet();
- virtual void SetObjectItem(const SfxPoolItem& rItem);
+ SVX_DLLPRIVATE virtual const SfxItemSet& GetObjectItemSet();
+ SVX_DLLPRIVATE virtual void SetObjectItem(const SfxPoolItem& rItem);
- ::com::sun::star::uno::Any GetAnyForItem( SfxItemSet& aSet, const SfxItemPropertySimpleEntry* pMap );
+ SVX_DLLPRIVATE ::com::sun::star::uno::Any GetAnyForItem( SfxItemSet& aSet, const SfxItemPropertySimpleEntry* pMap );
private:
- Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) throw();
- virtual ~Cell() throw();
+ SVX_DLLPRIVATE Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) throw();
+ SVX_DLLPRIVATE virtual ~Cell() throw();
const SvxItemPropertySet* mpPropSet;
diff --git a/svx/source/table/cellcursor.cxx b/svx/source/table/cellcursor.cxx
index 681546b9ebd9..f3b33a12f932 100644
--- a/svx/source/table/cellcursor.cxx
+++ b/svx/source/table/cellcursor.cxx
@@ -269,7 +269,9 @@ void SAL_CALL CellCursor::merge( ) throw (NoSupportException, RuntimeException)
throw DisposedException();
SdrModel* pModel = mxTable->getSdrTableObj()->GetModel();
- if( pModel )
+ const bool bUndo = pModel && mxTable->getSdrTableObj()->IsInserted() && pModel->IsUndoEnabled();
+
+ if( bUndo )
pModel->BegUndo( ImpGetResStr(STR_TABLE_MERGE) );
try
@@ -283,8 +285,11 @@ void SAL_CALL CellCursor::merge( ) throw (NoSupportException, RuntimeException)
DBG_ERROR("sdr::table::CellCursor::merge(), exception caught!");
}
- if( pModel )
+ if( bUndo )
pModel->EndUndo();
+
+ if( pModel )
+ pModel->SetChanged();
}
// -----------------------------------------------------------------------------
@@ -530,7 +535,8 @@ void SAL_CALL CellCursor::split( sal_Int32 nColumns, sal_Int32 nRows ) throw (No
throw DisposedException();
SdrModel* pModel = mxTable->getSdrTableObj()->GetModel();
- if( pModel )
+ const bool bUndo = pModel && mxTable->getSdrTableObj()->IsInserted() && pModel->IsUndoEnabled();
+ if( bUndo )
pModel->BegUndo( ImpGetResStr(STR_TABLE_SPLIT) );
try
@@ -550,8 +556,11 @@ void SAL_CALL CellCursor::split( sal_Int32 nColumns, sal_Int32 nRows ) throw (No
throw NoSupportException();
}
- if( pModel )
+ if( bUndo )
pModel->EndUndo();
+
+ if( pModel )
+ pModel->SetChanged();
}
// -----------------------------------------------------------------------------
diff --git a/svx/source/table/celleditsource.hxx b/svx/source/table/celleditsource.hxx
index 72d0f18c582f..1d097dc6ede5 100644
--- a/svx/source/table/celleditsource.hxx
+++ b/svx/source/table/celleditsource.hxx
@@ -73,7 +73,7 @@ public:
void lock();
void unlock();
- // the viewforwarder interface
+ // the SvxViewForwarder interface
virtual BOOL IsValid() const;
virtual Rectangle GetVisArea() const;
virtual Point LogicToPixel( const Point&, const MapMode& ) const;
diff --git a/svx/source/table/makefile.mk b/svx/source/table/makefile.mk
index 8789cd4da86b..ae0dc5eb685a 100644
--- a/svx/source/table/makefile.mk
+++ b/svx/source/table/makefile.mk
@@ -36,6 +36,7 @@ PROJECTPCHSOURCE=$(PRJ)$/util$/svxpch
PRJNAME=svx
TARGET=table
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE;
# --- Settings -----------------------------------------------------
@@ -45,9 +46,9 @@ ENABLE_EXCEPTIONS=TRUE;
# --- Files --------------------------------------------------------
-SLOFILES= \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/propertyset.obj\
- $(SLO)$/celleditsource.obj\
$(SLO)$/cell.obj\
$(SLO)$/cellrange.obj\
$(SLO)$/cellcursor.obj\
@@ -61,13 +62,19 @@ SLOFILES= \
$(SLO)$/tablelayouter.obj\
$(SLO)$/tablehandles.obj\
$(SLO)$/tablecontroller.obj\
- $(SLO)$/tabledesign.obj\
- $(SLO)$/tableundo.obj\
- $(SLO)$/accessibletableshape.obj\
+ $(SLO)$/tableundo.obj
+
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/celleditsource.obj \
+ $(SLO)$/tabledesign.obj \
+ $(SLO)$/accessibletableshape.obj \
$(SLO)$/accessiblecell.obj \
$(SLO)$/tablertfexporter.obj \
$(SLO)$/tablertfimporter.obj
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
SRS1NAME=table
SRC1FILES= table.src
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 3c6ec81cabdb..d7f64c852fc6 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -493,7 +493,7 @@ void SvxTableController::GetState( SfxItemSet& rSet )
// --------------------------------------------------------------------
-void SvxTableController::onInsert( sal_uInt16 nSId )
+void SvxTableController::onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs )
{
::sdr::table::SdrTableObj* pTableObj = dynamic_cast< ::sdr::table::SdrTableObj* >( mxTableObj.get() );
if( !pTableObj )
@@ -501,6 +501,21 @@ void SvxTableController::onInsert( sal_uInt16 nSId )
if( mxTable.is() ) try
{
+ //
+ bool bInsertAfter = true;
+ sal_uInt16 nCount = 0;
+ if( pArgs )
+ {
+ const SfxPoolItem* pItem = 0;
+ pArgs->GetItemState(nSId, FALSE, &pItem);
+ if (pItem)
+ {
+ nCount = ((const SfxInt16Item* )pItem)->GetValue();
+ if(SFX_ITEM_SET == pArgs->GetItemState(SID_TABLE_PARAM_INSERT_AFTER, TRUE, &pItem))
+ bInsertAfter = ((const SfxBoolItem* )pItem)->GetValue();
+ }
+ }
+
CellPos aStart, aEnd;
if( hasSelectedCells() )
{
@@ -508,9 +523,12 @@ void SvxTableController::onInsert( sal_uInt16 nSId )
}
else
{
- aStart.mnCol = mxTable->getColumnCount() - 1;
- aStart.mnRow = mxTable->getRowCount() - 1;
- aEnd = aStart;
+ if( bInsertAfter )
+ {
+ aStart.mnCol = mxTable->getColumnCount() - 1;
+ aStart.mnRow = mxTable->getRowCount() - 1;
+ aEnd = aStart;
+ }
}
if( pTableObj->IsTextEditActive() )
@@ -535,8 +553,9 @@ void SvxTableController::onInsert( sal_uInt16 nSId )
}
Reference< XTableColumns > xCols( mxTable->getColumns() );
- const sal_Int32 nNewColumns = aEnd.mnCol - aStart.mnCol + 1;
- xCols->insertByIndex( aEnd.mnCol + 1, nNewColumns );
+ const sal_Int32 nNewColumns = (nCount == 0) ? (aEnd.mnCol - aStart.mnCol + 1) : nCount;
+ const sal_Int32 nNewStartColumn = aEnd.mnCol + (bInsertAfter ? 1 : 0);
+ xCols->insertByIndex( nNewStartColumn, nNewColumns );
for( sal_Int32 nOffset = 0; nOffset < nNewColumns; nOffset++ )
{
@@ -549,10 +568,7 @@ void SvxTableController::onInsert( sal_uInt16 nSId )
if( bUndo )
mpModel->EndUndo();
- if( mpModel )
- mpModel->SetChanged();
-
- aStart.mnCol = aEnd.mnCol+1;
+ aStart.mnCol = nNewStartColumn;
aStart.mnRow = 0;
aEnd.mnCol = aStart.mnCol + nNewColumns - 1;
aEnd.mnRow = mxTable->getRowCount() - 1;
@@ -570,8 +586,9 @@ void SvxTableController::onInsert( sal_uInt16 nSId )
}
Reference< XTableRows > xRows( mxTable->getRows() );
- const sal_Int32 nNewRows = aEnd.mnRow - aStart.mnRow + 1;
- xRows->insertByIndex( aEnd.mnRow + 1, nNewRows );
+ const sal_Int32 nNewRows = (nCount == 0) ? (aEnd.mnRow - aStart.mnRow + 1) : nCount;
+ const sal_Int32 nNewRowStart = aEnd.mnRow + (bInsertAfter ? 1 : 0);
+ xRows->insertByIndex( nNewRowStart, nNewRows );
for( sal_Int32 nOffset = 0; nOffset < nNewRows; nOffset++ )
{
@@ -582,16 +599,10 @@ void SvxTableController::onInsert( sal_uInt16 nSId )
}
if( bUndo )
- {
mpModel->EndUndo();
- mpModel->SetChanged();
- }
-
- if( mpModel )
- mpModel->SetChanged();
aStart.mnCol = 0;
- aStart.mnRow = aEnd.mnRow+1;
+ aStart.mnRow = nNewRowStart;
aEnd.mnCol = mxTable->getColumnCount() - 1;
aEnd.mnRow = aStart.mnRow + nNewRows - 1;
break;
@@ -759,7 +770,7 @@ void SvxTableController::Execute( SfxRequest& rReq )
{
case SID_TABLE_INSERT_ROW:
case SID_TABLE_INSERT_COL:
- onInsert( nSId );
+ onInsert( nSId, rReq.GetArgs() );
break;
case SID_TABLE_DELETE_ROW:
case SID_TABLE_DELETE_COL:
@@ -859,7 +870,8 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs )
pModel->AddUndo( new TableStyleUndo( *pTableObj ) );
}
-/*
+ pTableObj->setTableStyle( xNewTableStyle );
+
const sal_Int32 nRowCount = mxTable->getRowCount();
const sal_Int32 nColCount = mxTable->getColumnCount();
for( sal_Int32 nRow = 0; nRow < nRowCount; nRow++ )
@@ -869,9 +881,26 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs )
CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) );
if( xCell.is() )
{
- if( bUndo )
- xCell->AddUndo();
- xCell->setAllPropertiesToDefault();
+ SfxItemSet aSet( xCell->GetItemSet() );
+ bool bChanges = false;
+ const SfxItemSet& rStyleAttribs = xCell->GetStyleSheet()->GetItemSet();
+
+ for ( USHORT nWhich = SDRATTR_START; nWhich <= SDRATTR_TABLE_LAST; nWhich++ )
+ {
+ if( (rStyleAttribs.GetItemState( nWhich ) == SFX_ITEM_ON) && (aSet.GetItemState( nWhich ) == SFX_ITEM_ON) )
+ {
+ aSet.ClearItem( nWhich );
+ bChanges = true;
+ }
+ }
+
+ if( bChanges )
+ {
+ if( bUndo )
+ xCell->AddUndo();
+
+ xCell->SetMergedItemSetAndBroadcast( aSet, sal_True );
+ }
}
}
catch( Exception& e )
@@ -880,9 +909,6 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs )
DBG_ERROR( "svx::SvxTableController::SetTableStyle(), exception caught!" );
}
}
-*/
-
- pTableObj->setTableStyle( xNewTableStyle );
if( bUndo )
pModel->EndUndo();
@@ -1047,9 +1073,6 @@ void SvxTableController::SplitMarkedCells()
if( bUndo )
mpModel->EndUndo();
-
- if( mpModel )
- mpModel->SetChanged();
}
aEnd.mnRow += mxTable->getRowCount() - nRowCount;
aEnd.mnCol += mxTable->getColumnCount() - nColCount;
@@ -1490,7 +1513,7 @@ bool SvxTableController::executeAction( sal_uInt16 nAction, bool bSelect, Window
CellPos aNextCell( pTableObj->getNextCell( aSelectionEnd, true ) );
if( aSelectionEnd == aNextCell )
{
- onInsert( SID_TABLE_INSERT_ROW );
+ onInsert( SID_TABLE_INSERT_ROW, 0 );
aNextCell = pTableObj->getNextCell( aSelectionEnd, true );
}
gotoCell( aNextCell, false, pWindow, nAction );
diff --git a/svx/source/table/tablecontroller.hxx b/svx/source/table/tablecontroller.hxx
index 4caf7cd957a1..e13fad84179e 100644
--- a/svx/source/table/tablecontroller.hxx
+++ b/svx/source/table/tablecontroller.hxx
@@ -43,6 +43,7 @@
class SdrObjEditView;
class SdrObject;
+class SfxItemSet;
namespace sdr { namespace table {
@@ -50,97 +51,97 @@ const sal_Int16 SELTYPE_NONE = 0;
const sal_Int16 SELTYPE_MOUSE = 1;
const sal_Int16 SELTYPE_KEYS = 2;
-class SvxTableController: public sdr::SelectionController
+class SVX_DLLPUBLIC SvxTableController: public sdr::SelectionController
{
public:
- SvxTableController( SdrObjEditView* pView, const SdrObject* pObj );
- virtual ~SvxTableController();
+ SVX_DLLPRIVATE SvxTableController( SdrObjEditView* pView, const SdrObject* pObj );
+ SVX_DLLPRIVATE virtual ~SvxTableController();
- virtual bool onKeyInput(const KeyEvent& rKEvt, Window* pWin);
- virtual bool onMouseButtonDown(const MouseEvent& rMEvt, Window* pWin);
- virtual bool onMouseButtonUp(const MouseEvent& rMEvt, Window* pWin);
- virtual bool onMouseMove(const MouseEvent& rMEvt, Window* pWin);
+ SVX_DLLPRIVATE virtual bool onKeyInput(const KeyEvent& rKEvt, Window* pWin);
+ SVX_DLLPRIVATE virtual bool onMouseButtonDown(const MouseEvent& rMEvt, Window* pWin);
+ SVX_DLLPRIVATE virtual bool onMouseButtonUp(const MouseEvent& rMEvt, Window* pWin);
+ SVX_DLLPRIVATE virtual bool onMouseMove(const MouseEvent& rMEvt, Window* pWin);
- virtual bool DeleteMarked();
+ SVX_DLLPRIVATE virtual bool DeleteMarked();
- virtual void onSelectionHasChanged();
+ SVX_DLLPRIVATE virtual void onSelectionHasChanged();
- virtual void GetState( SfxItemSet& rSet );
- virtual void Execute( SfxRequest& rReq );
+ SVX_DLLPRIVATE virtual void GetState( SfxItemSet& rSet );
+ SVX_DLLPRIVATE virtual void Execute( SfxRequest& rReq );
- virtual bool GetStyleSheet( SfxStyleSheet* &rpStyleSheet ) const;
- virtual bool SetStyleSheet( SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr );
+ SVX_DLLPRIVATE virtual bool GetStyleSheet( SfxStyleSheet* &rpStyleSheet ) const;
+ SVX_DLLPRIVATE virtual bool SetStyleSheet( SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr );
// slots
- void onInsert( sal_uInt16 nSId );
- void onDelete( sal_uInt16 nSId );
- void onSelect( sal_uInt16 nSId );
- void onFormatTable( SfxRequest& rReq );
- void MergeMarkedCells();
- void SplitMarkedCells();
- void DistributeColumns();
- void DistributeRows();
- void SetVertical( sal_uInt16 nSId );
+ SVX_DLLPRIVATE void onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs = 0 );
+ SVX_DLLPRIVATE void onDelete( sal_uInt16 nSId );
+ SVX_DLLPRIVATE void onSelect( sal_uInt16 nSId );
+ SVX_DLLPRIVATE void onFormatTable( SfxRequest& rReq );
+ SVX_DLLPRIVATE void MergeMarkedCells();
+ SVX_DLLPRIVATE void SplitMarkedCells();
+ SVX_DLLPRIVATE void DistributeColumns();
+ SVX_DLLPRIVATE void DistributeRows();
+ SVX_DLLPRIVATE void SetVertical( sal_uInt16 nSId );
- static rtl::Reference< sdr::SelectionController > create( SdrObjEditView* pView, const SdrObject* pObj, const rtl::Reference< sdr::SelectionController >& xRefController );
+ SVX_DLLPRIVATE static rtl::Reference< sdr::SelectionController > create( SdrObjEditView* pView, const SdrObject* pObj, const rtl::Reference< sdr::SelectionController >& xRefController );
- void MergeAttrFromSelectedCells(SfxItemSet& rAttr, bool bOnlyHardAttr) const;
- void SetAttrToSelectedCells(const SfxItemSet& rAttr, bool bReplaceAll);
+ SVX_DLLPRIVATE void MergeAttrFromSelectedCells(SfxItemSet& rAttr, bool bOnlyHardAttr) const;
+ SVX_DLLPRIVATE void SetAttrToSelectedCells(const SfxItemSet& rAttr, bool bReplaceAll);
- virtual bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const;
- virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll);
+ SVX_DLLPRIVATE virtual bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const;
+ SVX_DLLPRIVATE virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll);
- virtual bool GetMarkedObjModel( SdrPage* pNewPage );
- virtual bool PasteObjModel( const SdrModel& rModel );
+ SVX_DLLPRIVATE virtual bool GetMarkedObjModel( SdrPage* pNewPage );
+ SVX_DLLPRIVATE virtual bool PasteObjModel( const SdrModel& rModel );
- bool hasSelectedCells() const { return mbCellSelectionMode || mpView->IsTextEdit(); }
+ SVX_DLLPRIVATE bool hasSelectedCells() const { return mbCellSelectionMode || mpView->IsTextEdit(); }
void getSelectedCells( CellPos& rFirstPos, CellPos& rLastPos );
void setSelectedCells( const CellPos& rFirstPos, const CellPos& rLastPos );
void clearSelection();
void selectAll();
- void onTableModified();
+ SVX_DLLPRIVATE void onTableModified();
private:
SvxTableController(SvxTableController &); // not defined
void operator =(SvxTableController &); // not defined
// internals
- void ApplyBorderAttr( const SfxItemSet& rAttr );
- void UpdateTableShape();
+ SVX_DLLPRIVATE void ApplyBorderAttr( const SfxItemSet& rAttr );
+ SVX_DLLPRIVATE void UpdateTableShape();
- void SetTableStyle( const SfxItemSet* pArgs );
- void SetTableStyleSettings( const SfxItemSet* pArgs );
+ SVX_DLLPRIVATE void SetTableStyle( const SfxItemSet* pArgs );
+ SVX_DLLPRIVATE void SetTableStyleSettings( const SfxItemSet* pArgs );
- bool PasteObject( SdrTableObj* pPasteTableObj );
+ SVX_DLLPRIVATE bool PasteObject( SdrTableObj* pPasteTableObj );
- bool checkTableObject();
- bool updateTableObject();
- const CellPos& getSelectionStart();
- void setSelectionStart( const CellPos& rPos );
- const CellPos& getSelectionEnd();
- ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellCursor > getSelectionCursor();
- void checkCell( CellPos& rPos );
+ SVX_DLLPRIVATE bool checkTableObject();
+ SVX_DLLPRIVATE bool updateTableObject();
+ SVX_DLLPRIVATE const CellPos& getSelectionStart();
+ SVX_DLLPRIVATE void setSelectionStart( const CellPos& rPos );
+ SVX_DLLPRIVATE const CellPos& getSelectionEnd();
+ SVX_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellCursor > getSelectionCursor();
+ SVX_DLLPRIVATE void checkCell( CellPos& rPos );
- void MergeRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow );
+ SVX_DLLPRIVATE void MergeRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow );
- void EditCell( const CellPos& rPos, ::Window* pWindow, const ::com::sun::star::awt::MouseEvent* pMouseEvent = 0, sal_uInt16 nAction = 0 );
- bool StopTextEdit();
+ SVX_DLLPRIVATE void EditCell( const CellPos& rPos, ::Window* pWindow, const ::com::sun::star::awt::MouseEvent* pMouseEvent = 0, sal_uInt16 nAction = 0 );
+ SVX_DLLPRIVATE bool StopTextEdit();
- void DeleteTable();
+ SVX_DLLPRIVATE void DeleteTable();
- sal_uInt16 getKeyboardAction( const KeyEvent& rKEvt, Window* pWindow );
- bool executeAction( sal_uInt16 nAction, bool bSelect, Window* pWindow );
- void gotoCell( const CellPos& rCell, bool bSelect, Window* pWindow, sal_uInt16 nAction = 0 );
+ SVX_DLLPRIVATE sal_uInt16 getKeyboardAction( const KeyEvent& rKEvt, Window* pWindow );
+ SVX_DLLPRIVATE bool executeAction( sal_uInt16 nAction, bool bSelect, Window* pWindow );
+ SVX_DLLPRIVATE void gotoCell( const CellPos& rCell, bool bSelect, Window* pWindow, sal_uInt16 nAction = 0 );
- void StartSelection( const CellPos& rPos );
- void UpdateSelection( const CellPos& rPos );
- void RemoveSelection();
- void updateSelectionOverlay();
- void destroySelectionOverlay();
+ SVX_DLLPRIVATE void StartSelection( const CellPos& rPos );
+ SVX_DLLPRIVATE void UpdateSelection( const CellPos& rPos );
+ SVX_DLLPRIVATE void RemoveSelection();
+ SVX_DLLPRIVATE void updateSelectionOverlay();
+ SVX_DLLPRIVATE void destroySelectionOverlay();
- void findMergeOrigin( CellPos& rPos );
+ SVX_DLLPRIVATE void findMergeOrigin( CellPos& rPos );
DECL_LINK( UpdateHdl, void * );
diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx
index 5c1aca5a4542..2d19a9994c41 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -128,6 +128,7 @@ basegfx::B2ITuple TableLayouter::getCellSize( const CellPos& rPos ) const
return basegfx::B2ITuple( width, height );
}
+
// -----------------------------------------------------------------------------
bool TableLayouter::getCellArea( const CellPos& rPos, basegfx::B2IRectangle& rArea ) const
diff --git a/svx/source/table/tablemodel.cxx b/svx/source/table/tablemodel.cxx
index ce79dad77b4c..34ef52f6d701 100644
--- a/svx/source/table/tablemodel.cxx
+++ b/svx/source/table/tablemodel.cxx
@@ -795,6 +795,9 @@ void TableModel::insertColumns( sal_Int32 nIndex, sal_Int32 nCount )
if( bUndo )
pModel->EndUndo();
+ if( pModel )
+ pModel->SetChanged();
+
}
catch( Exception& )
{
@@ -900,10 +903,10 @@ void TableModel::removeColumns( sal_Int32 nIndex, sal_Int32 nCount )
maRows[nRows]->removeColumns( nIndex, nCount );
if( bUndo )
- {
pModel->EndUndo();
+
+ if( pModel )
pModel->SetChanged();
- }
}
catch( Exception& )
{
@@ -970,6 +973,9 @@ void TableModel::insertRows( sal_Int32 nIndex, sal_Int32 nCount )
if( bUndo )
pModel->EndUndo();
+ if( pModel )
+ pModel->SetChanged();
+
updateRows();
setModified(sal_True);
}
@@ -1056,10 +1062,10 @@ void TableModel::removeRows( sal_Int32 nIndex, sal_Int32 nCount )
remove_range<RowVector,RowVector::iterator>( maRows, nIndex, nCount );
if( bUndo )
- {
pModel->EndUndo();
+
+ if( pModel )
pModel->SetChanged();
- }
}
catch( Exception& )
{
diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx
index f740bf60258c..45a24211f7b2 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -687,17 +687,7 @@ namespace sdr
if(pNewShadowAttribute)
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const drawinglayer::primitive2d::Primitive2DReference xShadow(drawinglayer::primitive2d::createShadowPrimitive(xRetval, *pNewShadowAttribute));
-
- if(xShadow.is())
- {
- drawinglayer::primitive2d::Primitive2DSequence xContentWithShadow(2);
- xContentWithShadow[0] = xShadow;
- xContentWithShadow[1] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::GroupPrimitive2D(xRetval));
- xRetval = xContentWithShadow;
- }
-
+ xRetval = drawinglayer::primitive2d::createEmbeddedShadowPrimitive(xRetval, *pNewShadowAttribute);
delete pNewShadowAttribute;
}
}
diff --git a/svx/source/tbxctrls/makefile.mk b/svx/source/tbxctrls/makefile.mk
index 02bbd865d4fb..9bca3b979841 100644
--- a/svx/source/tbxctrls/makefile.mk
+++ b/svx/source/tbxctrls/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=tbxctrls
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
@@ -42,10 +43,17 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES= \
- $(SLO)$/formatpaintbrushctrl.obj\
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/fontworkgallery.obj\
$(SLO)$/extrusioncontrols.obj \
+ $(SLO)$/tbcontrl.obj \
+ $(SLO)$/toolbarmenu.obj \
+ $(SLO)$/tbxcolorupdate.obj
+
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/formatpaintbrushctrl.obj\
$(SLO)$/colrctrl.obj \
$(SLO)$/fillctrl.obj \
$(SLO)$/grafctrl.obj \
@@ -53,16 +61,15 @@ SLOFILES= \
$(SLO)$/layctrl.obj \
$(SLO)$/lboxctrl.obj \
$(SLO)$/linectrl.obj \
- $(SLO)$/tbcontrl.obj \
$(SLO)$/tbxalign.obj \
$(SLO)$/tbxdrctl.obj \
$(SLO)$/verttexttbxctrl.obj \
- $(SLO)$/toolbarmenu.obj \
$(SLO)$/subtoolboxcontrol.obj \
$(SLO)$/tbxcolor.obj \
- $(SLO)$/tbxcolorupdate.obj \
$(SLO)$/tbunocontroller.obj
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
SRS1NAME=$(TARGET)
SRC1FILES = \
fontworkgallery.src \
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 392b4c608ac6..efa49025bbc4 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -292,6 +292,7 @@ class SvxLineWindow_Impl : public SfxPopupWindow
{
private:
ValueSet aLineSet;
+ bool m_bIsWriter;
#if _SOLAR__PRIVATE
void MakeLineBitmap( USHORT nNo, Bitmap& rBmp, const Size& rSize, String& rStr,
@@ -1335,6 +1336,14 @@ SvxLineWindow_Impl::SvxLineWindow_Impl( USHORT nId, const Reference< XFrame >& r
aLineSet( this, WinBits( WB_3DLOOK | WB_ITEMBORDER | WB_DOUBLEBORDER | WB_NAMEFIELD | WB_NONEFIELD | WB_NO_DIRECTSELECT ) )
{
+ try
+ {
+ Reference< lang::XServiceInfo > xServices( rFrame->getController()->getModel(), UNO_QUERY_THROW );
+ m_bIsWriter = xServices->supportsService(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument")));
+ }
+ catch(const uno::Exception& )
+ {
+ }
Size aBmpSize( 55, 12 );
CreateBitmaps();
@@ -1598,7 +1607,7 @@ IMPL_LINK( SvxLineWindow_Impl, SelectHdl, void *, EMPTYARG )
Any a;
Sequence< PropertyValue > aArgs( 1 );
aArgs[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "LineStyle" ));
- aLineItem.QueryValue( a );
+ aLineItem.QueryValue( a, m_bIsWriter ? CONVERT_TWIPS : 0 );
aArgs[0].Value = a;
/* #i33380# DR 2004-09-03 Moved the following line above the Dispatch() call.
@@ -2631,7 +2640,6 @@ SfxPopupWindowType SvxFrameLineStyleToolBoxControl::GetPopupWindowType() const
SfxPopupWindow* SvxFrameLineStyleToolBoxControl::CreatePopupWindow()
{
SvxLineWindow_Impl* pLineWin = new SvxLineWindow_Impl( GetSlotId(), m_xFrame, &GetToolBox() );
-
pLineWin->StartPopupMode( &GetToolBox(), TRUE );
pLineWin->StartSelection();
SetPopupWindow( pLineWin );
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src
index 180724093424..601f2594a080 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src
@@ -40,7 +40,7 @@
#define FULL_WIDTH (220)
#define FULL_HEIGHT (120)
-#define EDITBUTTON_WIDTH (70)
+#define EDITBUTTON_WIDTH (75)
#define COL_1 (RSC_SP_DLG_INNERBORDER_LEFT)
#define COL_2 (COL_1+RSC_SP_FLGR_SPACE_X)
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 098ddb6c31c0..5d1af9af2190 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -201,13 +201,13 @@ namespace svx
SdrModel* mpDoc;
};
- Reference< XInterface > SAL_CALL GraphicExporter_createInstance(const Reference< XMultiServiceFactory > & )
+ SVX_DLLPUBLIC Reference< XInterface > SAL_CALL GraphicExporter_createInstance(const Reference< XMultiServiceFactory > & )
throw( Exception )
{
return (XWeak*)new GraphicExporter();
}
- Sequence< OUString > SAL_CALL GraphicExporter_getSupportedServiceNames()
+ SVX_DLLPUBLIC Sequence< OUString > SAL_CALL GraphicExporter_getSupportedServiceNames()
throw()
{
Sequence< OUString > aSupportedServiceNames( 1 );
@@ -215,7 +215,7 @@ namespace svx
return aSupportedServiceNames;
}
- OUString SAL_CALL GraphicExporter_getImplementationName()
+ SVX_DLLPUBLIC OUString SAL_CALL GraphicExporter_getImplementationName()
throw()
{
return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.GraphicExporter" ) );
diff --git a/svx/source/unodraw/UnoGraphicExporter.hxx b/svx/source/unodraw/UnoGraphicExporter.hxx
index e8a4621ac63f..a2fbc38dd3d9 100644
--- a/svx/source/unodraw/UnoGraphicExporter.hxx
+++ b/svx/source/unodraw/UnoGraphicExporter.hxx
@@ -35,9 +35,9 @@
namespace svx
{
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GraphicExporter_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
- ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL GraphicExporter_getSupportedServiceNames() throw();
- ::rtl::OUString SAL_CALL GraphicExporter_getImplementationName() throw();
+ SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GraphicExporter_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
+ SVX_DLLPUBLIC ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL GraphicExporter_getSupportedServiceNames() throw();
+ SVX_DLLPUBLIC ::rtl::OUString SAL_CALL GraphicExporter_getImplementationName() throw();
}
#endif
diff --git a/svx/source/unodraw/gluepts.cxx b/svx/source/unodraw/gluepts.cxx
index 1210a3847a96..d742cf63ece8 100644
--- a/svx/source/unodraw/gluepts.cxx
+++ b/svx/source/unodraw/gluepts.cxx
@@ -49,19 +49,15 @@ using namespace ::cppu;
const USHORT NON_USER_DEFINED_GLUE_POINTS = 4;
-class SvxUnoGluePointAccess : public WeakImplHelper2< container::XIndexContainer, container::XIdentifierContainer >,
- public SfxListener
+class SvxUnoGluePointAccess : public WeakImplHelper2< container::XIndexContainer, container::XIdentifierContainer >
{
private:
- SdrObject* mpObject;
+ SdrObjectWeakRef mpObject;
public:
SvxUnoGluePointAccess( SdrObject* pObject ) throw();
virtual ~SvxUnoGluePointAccess() throw();
- // SfxListener
- virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) throw ();
-
// XIdentifierContainer
virtual sal_Int32 SAL_CALL insert( const uno::Any& aElement ) throw (lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException);
virtual void SAL_CALL removeByIdentifier( sal_Int32 Identifier ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
@@ -223,52 +219,16 @@ static void convert( const drawing::GluePoint2& rUnoGlue, SdrGluePoint& rSdrGlue
SvxUnoGluePointAccess::SvxUnoGluePointAccess( SdrObject* pObject ) throw()
: mpObject( pObject )
{
- StartListening( *mpObject->GetModel() );
-
}
SvxUnoGluePointAccess::~SvxUnoGluePointAccess() throw()
{
- if( mpObject && mpObject->GetModel())
- EndListening( *mpObject->GetModel() );
-}
-
-void SvxUnoGluePointAccess::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw()
-{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
-
- if( pSdrHint && mpObject)
- {
- if( pSdrHint->GetKind() == HINT_OBJREMOVED )
- {
- if( mpObject == pSdrHint->GetObject() )
- mpObject = NULL;
- }
- else if( pSdrHint->GetKind() == HINT_MODELCLEARED )
- {
- mpObject = NULL;
- }
- // #110094#-9
- //else if( pSdrHint->GetKind() == HINT_OBJLISTCLEAR )
- //{
- // SdrObjList* pObjList = mpObject ? mpObject->GetObjList() : NULL;
- // while( pObjList )
- // {
- // if( pSdrHint->GetObjList() == pObjList )
- // {
- // mpObject = NULL;
- // break;
- // }
- // pObjList = pObjList->GetUpList();
- // }
- //}
- }
}
// XIdentifierContainer
sal_Int32 SAL_CALL SvxUnoGluePointAccess::insert( const uno::Any& aElement ) throw (lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
- if( mpObject )
+ if( mpObject.is() )
{
SdrGluePointList* pList = mpObject->ForceGluePointList();
if( pList )
@@ -298,7 +258,7 @@ sal_Int32 SAL_CALL SvxUnoGluePointAccess::insert( const uno::Any& aElement ) thr
void SAL_CALL SvxUnoGluePointAccess::removeByIdentifier( sal_Int32 Identifier ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
- if( mpObject && ( Identifier >= NON_USER_DEFINED_GLUE_POINTS ))
+ if( mpObject.is() && ( Identifier >= NON_USER_DEFINED_GLUE_POINTS ))
{
const USHORT nId = (USHORT)(Identifier - NON_USER_DEFINED_GLUE_POINTS) + 1;
@@ -327,7 +287,7 @@ void SAL_CALL SvxUnoGluePointAccess::removeByIdentifier( sal_Int32 Identifier )
// XIdentifierReplace
void SAL_CALL SvxUnoGluePointAccess::replaceByIdentifer( sal_Int32 Identifier, const uno::Any& aElement ) throw (lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
- if( mpObject && mpObject->IsNode() )
+ if( mpObject.is() && mpObject->IsNode() )
{
struct drawing::GluePoint2 aGluePoint;
if( (Identifier < NON_USER_DEFINED_GLUE_POINTS) || !(aElement >>= aGluePoint))
@@ -361,7 +321,7 @@ void SAL_CALL SvxUnoGluePointAccess::replaceByIdentifer( sal_Int32 Identifier, c
// XIdentifierAccess
uno::Any SAL_CALL SvxUnoGluePointAccess::getByIdentifier( sal_Int32 Identifier ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
- if( mpObject && mpObject->IsNode() )
+ if( mpObject.is() && mpObject->IsNode() )
{
struct drawing::GluePoint2 aGluePoint;
@@ -401,21 +361,29 @@ uno::Any SAL_CALL SvxUnoGluePointAccess::getByIdentifier( sal_Int32 Identifier )
uno::Sequence< sal_Int32 > SAL_CALL SvxUnoGluePointAccess::getIdentifiers() throw (uno::RuntimeException)
{
- const SdrGluePointList* pList = mpObject->GetGluePointList();
- const USHORT nCount = pList ? pList->GetCount() : 0;
+ if( mpObject.is() )
+ {
+ const SdrGluePointList* pList = mpObject->GetGluePointList();
+ const USHORT nCount = pList ? pList->GetCount() : 0;
- USHORT i;
+ USHORT i;
- uno::Sequence< sal_Int32 > aIdSequence( nCount + NON_USER_DEFINED_GLUE_POINTS );
- sal_Int32 *pIdentifier = aIdSequence.getArray();
+ uno::Sequence< sal_Int32 > aIdSequence( nCount + NON_USER_DEFINED_GLUE_POINTS );
+ sal_Int32 *pIdentifier = aIdSequence.getArray();
- for( i = 0; i < NON_USER_DEFINED_GLUE_POINTS; i++ )
- *pIdentifier++ = (sal_Int32)i;
+ for( i = 0; i < NON_USER_DEFINED_GLUE_POINTS; i++ )
+ *pIdentifier++ = (sal_Int32)i;
- for( i = 0; i < nCount; i++ )
- *pIdentifier++ = (sal_Int32) ( (*pList)[i].GetId() + NON_USER_DEFINED_GLUE_POINTS ) - 1;
+ for( i = 0; i < nCount; i++ )
+ *pIdentifier++ = (sal_Int32) ( (*pList)[i].GetId() + NON_USER_DEFINED_GLUE_POINTS ) - 1;
- return aIdSequence;
+ return aIdSequence;
+ }
+ else
+ {
+ uno::Sequence< sal_Int32 > aEmpty;
+ return aEmpty;
+ }
}
/* deprecated */
@@ -425,7 +393,7 @@ void SAL_CALL SvxUnoGluePointAccess::insertByIndex( sal_Int32, const uno::Any& E
throw(lang::IllegalArgumentException, lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- if( mpObject )
+ if( mpObject.is() )
{
SdrGluePointList* pList = mpObject->ForceGluePointList();
if( pList )
@@ -455,7 +423,7 @@ void SAL_CALL SvxUnoGluePointAccess::insertByIndex( sal_Int32, const uno::Any& E
void SAL_CALL SvxUnoGluePointAccess::removeByIndex( sal_Int32 Index )
throw(lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
{
- if( mpObject )
+ if( mpObject.is() )
{
SdrGluePointList* pList = mpObject->ForceGluePointList();
if( pList )
@@ -487,7 +455,7 @@ void SAL_CALL SvxUnoGluePointAccess::replaceByIndex( sal_Int32 Index, const uno:
throw lang::IllegalArgumentException();
Index -= 4;
- if( mpObject && Index >= 0 )
+ if( mpObject.is() && Index >= 0 )
{
SdrGluePointList* pList = const_cast< SdrGluePointList* >( mpObject->GetGluePointList() );
if( pList && Index < pList->GetCount() )
@@ -509,7 +477,7 @@ sal_Int32 SAL_CALL SvxUnoGluePointAccess::getCount()
throw(uno::RuntimeException)
{
sal_Int32 nCount = 0;
- if( mpObject )
+ if( mpObject.is() )
{
// each node has a default of 4 glue points
// and any number of user defined glue points
@@ -529,7 +497,7 @@ sal_Int32 SAL_CALL SvxUnoGluePointAccess::getCount()
uno::Any SAL_CALL SvxUnoGluePointAccess::getByIndex( sal_Int32 Index )
throw(lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
{
- if( Index >= 0 && mpObject && mpObject->IsNode() )
+ if( Index >= 0 && mpObject.is() && mpObject->IsNode() )
{
struct drawing::GluePoint2 aGluePoint;
@@ -571,7 +539,7 @@ uno::Type SAL_CALL SvxUnoGluePointAccess::getElementType()
sal_Bool SAL_CALL SvxUnoGluePointAccess::hasElements()
throw( uno::RuntimeException)
{
- return mpObject && mpObject->IsNode();
+ return mpObject.is() && mpObject->IsNode();
}
/**
diff --git a/svx/source/unodraw/makefile.mk b/svx/source/unodraw/makefile.mk
index 9b71d644f39d..4b8ecb093df4 100644
--- a/svx/source/unodraw/makefile.mk
+++ b/svx/source/unodraw/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=unodraw
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
@@ -42,21 +43,18 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES = \
- $(SLO)$/UnoNamespaceMap.obj \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/UnoGraphicExporter.obj \
- $(SLO)$/unopool.obj \
$(SLO)$/XPropertyTable.obj \
$(SLO)$/UnoNameItemTable.obj \
$(SLO)$/unoshape.obj \
$(SLO)$/unoipset.obj \
- $(SLO)$/unoctabl.obj \
$(SLO)$/unoshap2.obj \
$(SLO)$/unoshap3.obj \
$(SLO)$/unoshap4.obj \
$(SLO)$/unopage.obj \
$(SLO)$/unoshtxt.obj \
- $(SLO)$/unoshcol.obj \
$(SLO)$/unoprov.obj \
$(SLO)$/unomod.obj \
$(SLO)$/unonrule.obj \
@@ -69,10 +67,19 @@ SLOFILES = \
$(SLO)$/unomtabl.obj \
$(SLO)$/unodtabl.obj \
$(SLO)$/gluepts.obj \
- $(SLO)$/recoveryui.obj \
$(SLO)$/tableshape.obj \
$(SLO)$/shapepropertynotifier.obj
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/UnoNamespaceMap.obj \
+ $(SLO)$/unopool.obj \
+ $(SLO)$/unoctabl.obj \
+ $(SLO)$/unoshcol.obj \
+ $(SLO)$/recoveryui.obj
+
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
SRS1NAME=unodraw
SRC1FILES = \
unodraw.src
diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx
index fdac6b7a9c1a..7f7aedf860e9 100644
--- a/svx/source/unodraw/unomod.cxx
+++ b/svx/source/unodraw/unomod.cxx
@@ -215,9 +215,14 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createTextField(
{
uno::Reference< uno::XInterface > xRet;
- const OUString aTextFieldPrexit( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextField.") );
+ const OUString aTextFieldPrexit( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.textfield.") );
- if( ServiceSpecifier.compareTo( aTextFieldPrexit, aTextFieldPrexit.getLength() ) == 0 )
+ // #i93308# up to OOo 3.2 we used this wrong namespace name with the capital T & F. This is
+ // fixed since OOo 3.2 but for compatibility we will still provide support for the wrong notation.
+ const OUString aTextFieldPrexit2( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextField.") );
+
+ if( (ServiceSpecifier.compareTo( aTextFieldPrexit, aTextFieldPrexit.getLength() ) == 0) ||
+ (ServiceSpecifier.compareTo( aTextFieldPrexit2, aTextFieldPrexit2.getLength() ) == 0) )
{
OUString aFieldType( ServiceSpecifier.copy( aTextFieldPrexit.getLength() ) );
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 9b68e94239c5..d6d0913c4070 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -65,6 +65,7 @@
#include "shapeimpl.hxx"
#include "svx/unoshprp.hxx"
#include <svx/svdoashp.hxx>
+#include "unopolyhelper.hxx"
// #i29181#
#include "svdviter.hxx"
@@ -1833,7 +1834,7 @@ bool SvxGraphicObject::getPropertyValueImpl( const ::rtl::OUString& rName, const
}
else
{
- const GraphicObject& rGrafObj = static_cast< SdrGrafObj*>( mpObj.get() )->GetGraphicObject();
+ const GraphicObject& rGrafObj = static_cast< SdrGrafObj*>( mpObj.get() )->GetGraphicObject(true);
OUString aURL( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX));
aURL += OUString::createFromAscii( rGrafObj.GetUniqueID().GetBuffer() );
rValue <<= aURL;
diff --git a/svx/source/unodraw/unoshap3.cxx b/svx/source/unodraw/unoshap3.cxx
index dc24ad21ddca..f7826c546d60 100644
--- a/svx/source/unodraw/unoshap3.cxx
+++ b/svx/source/unodraw/unoshap3.cxx
@@ -760,7 +760,10 @@ Svx3DLatheObject::~Svx3DLatheObject() throw()
{
}
-static bool PolyPolygonShape3D_to_B3dPolyPolygon( const Any& rValue, basegfx::B3DPolyPolygon& rResultPolygon )
+bool PolyPolygonShape3D_to_B3dPolyPolygon(
+ const Any& rValue,
+ basegfx::B3DPolyPolygon& rResultPolygon,
+ bool bCorrectPolygon)
{
drawing::PolyPolygonShape3D aSourcePolyPolygon;
if( !(rValue >>= aSourcePolyPolygon) )
@@ -791,7 +794,14 @@ static bool PolyPolygonShape3D_to_B3dPolyPolygon( const Any& rValue, basegfx::B3
pInnerSequenceX++;
pInnerSequenceY++;
pInnerSequenceZ++;
- basegfx::tools::checkClosed(aNewPolygon);
+
+ // #i101520# correction is needed for imported polygons of old format,
+ // see callers
+ if(bCorrectPolygon)
+ {
+ basegfx::tools::checkClosed(aNewPolygon);
+ }
+
rResultPolygon.append(aNewPolygon);
}
return true;
@@ -855,7 +865,9 @@ bool Svx3DLatheObject::setPropertyValueImpl( const ::rtl::OUString& rName, const
{
// Polygondefinition in das Objekt packen
basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
- if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon ) )
+
+ // #i101520# Probably imported
+ if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, true ) )
{
// #105127# SetPolyPoly3D sets the Svx3DVerticalSegmentsItem to the number
// of points of the polygon. Thus, value gets lost. To avoid this, rescue
@@ -973,7 +985,9 @@ bool Svx3DExtrudeObject::setPropertyValueImpl( const ::rtl::OUString& rName, con
{
// Polygondefinition in das Objekt packen
basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
- if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon ) )
+
+ // #i101520# Probably imported
+ if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, true ) )
{
// Polygon setzen
const basegfx::B3DHomMatrix aIdentity;
@@ -1082,7 +1096,9 @@ bool Svx3DPolygonObject::setPropertyValueImpl( const ::rtl::OUString& rName, con
{
// Polygondefinition in das Objekt packen
basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
- if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon ) )
+
+ // #i101520# Direct API data (e.g. from chart)
+ if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, false ) )
{
// Polygon setzen
static_cast<E3dPolygonObj*>(mpObj.get())->SetPolyPolygon3D(aNewB3DPolyPolygon);
@@ -1094,7 +1110,9 @@ bool Svx3DPolygonObject::setPropertyValueImpl( const ::rtl::OUString& rName, con
{
// Normalendefinition in das Objekt packen
basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
- if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon ) )
+
+ // #i101520# Direct API data (e.g. from chart)
+ if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, false ) )
{
// Polygon setzen
static_cast<E3dPolygonObj*>(mpObj.get())->SetPolyNormals3D(aNewB3DPolyPolygon);
@@ -1106,7 +1124,9 @@ bool Svx3DPolygonObject::setPropertyValueImpl( const ::rtl::OUString& rName, con
{
// Texturdefinition in das Objekt packen
basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
- if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon ) )
+
+ // #i101520# Direct API data (e.g. from chart)
+ if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, false ) )
{
// Polygon setzen
const basegfx::B3DHomMatrix aIdentity;
diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx
index 08e83fc889fb..81439effcfc1 100644
--- a/svx/source/unodraw/unoshtxt.cxx
+++ b/svx/source/unodraw/unoshtxt.cxx
@@ -620,25 +620,29 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder()
mpTextForwarder->flushCache();
OutlinerParaObject* pOutlinerParaObject = NULL;
- bool bTextEditActive = false;
SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject );
if( pTextObj && pTextObj->getActiveText() == mpText )
pOutlinerParaObject = pTextObj->GetEditOutlinerParaObject(); // Get the OutlinerParaObject if text edit is active
+ bool bOwnParaObj(false);
if( pOutlinerParaObject )
- bTextEditActive = true; // text edit active
+ bOwnParaObj = true; // text edit active
else
pOutlinerParaObject = mpText->GetOutlinerParaObject();
- if( pOutlinerParaObject && ( bTextEditActive || !mpObject->IsEmptyPresObj() || mpObject->GetPage()->IsMasterPage() ) )
+ if( pOutlinerParaObject && ( bOwnParaObj || !mpObject->IsEmptyPresObj() || mpObject->GetPage()->IsMasterPage() ) )
{
mpOutliner->SetText( *pOutlinerParaObject );
// #91254# put text to object and set EmptyPresObj to FALSE
- if( mpText && bTextEditActive && pOutlinerParaObject && mpObject->IsEmptyPresObj() && pTextObj->IsRealyEdited() )
+ if( mpText && bOwnParaObj && pOutlinerParaObject && mpObject->IsEmptyPresObj() && pTextObj->IsRealyEdited() )
{
mpObject->SetEmptyPresObj( FALSE );
static_cast< SdrTextObj* >( mpObject)->NbcSetOutlinerParaObjectForText( pOutlinerParaObject, mpText );
+
+ // #i103982# Here, due to mpObject->NbcSetOutlinerParaObjectForText, we LOSE ownership of the
+ // OPO, so do NOT delete it when leaving this method (!)
+ bOwnParaObj = false;
}
}
else
@@ -676,7 +680,7 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder()
mbDataValid = TRUE;
- if( bTextEditActive )
+ if( bOwnParaObj )
delete pOutlinerParaObject;
}
diff --git a/svx/source/unoedit/makefile.mk b/svx/source/unoedit/makefile.mk
index e808dbe02799..802ded5aa7c1 100644
--- a/svx/source/unoedit/makefile.mk
+++ b/svx/source/unoedit/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=unoedit
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
@@ -42,13 +43,10 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES = \
- $(SLO)$/UnoForbiddenCharsTable.obj \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/unoedsrc.obj \
$(SLO)$/unoedhlp.obj \
- $(SLO)$/unopracc.obj \
- $(SLO)$/unoedprx.obj \
- $(SLO)$/unoviwed.obj \
$(SLO)$/unoviwou.obj \
$(SLO)$/unofored.obj \
$(SLO)$/unoforou.obj \
@@ -56,6 +54,15 @@ SLOFILES = \
$(SLO)$/unotext2.obj \
$(SLO)$/unofield.obj
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/UnoForbiddenCharsTable.obj \
+ $(SLO)$/unopracc.obj \
+ $(SLO)$/unoedprx.obj \
+ $(SLO)$/unoviwed.obj
+
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
# --- Tagets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/svx/source/unoedit/unoedprx.cxx b/svx/source/unoedit/unoedprx.cxx
index 7c31f8b14ffc..e7bbcea519b8 100644
--- a/svx/source/unoedit/unoedprx.cxx
+++ b/svx/source/unoedit/unoedprx.cxx
@@ -1044,6 +1044,16 @@ USHORT SvxAccessibleTextAdapter::GetLineLen( USHORT nPara, USHORT nLine ) const
return static_cast< USHORT >(aEndIndex.GetIndex());
}
+void SvxAccessibleTextAdapter::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const
+{
+ mrTextForwarder->GetLineBoundaries( rStart, rEnd, nParagraph, nLine );
+}
+
+USHORT SvxAccessibleTextAdapter::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const
+{
+ return mrTextForwarder->GetLineNumberAtIndex( nPara, nIndex );
+}
+
sal_Bool SvxAccessibleTextAdapter::Delete( const ESelection& rSel )
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
diff --git a/svx/source/unoedit/unofored.cxx b/svx/source/unoedit/unofored.cxx
index 685e5973b39f..c06c37ae2070 100644
--- a/svx/source/unoedit/unofored.cxx
+++ b/svx/source/unoedit/unofored.cxx
@@ -471,6 +471,17 @@ USHORT SvxEditEngineForwarder::GetLineLen( USHORT nPara, USHORT nLine ) const
return rEditEngine.GetLineLen(nPara, nLine);
}
+void SvxEditEngineForwarder::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nPara, USHORT nLine ) const
+{
+ rEditEngine.GetLineBoundaries(rStart, rEnd, nPara, nLine);
+}
+
+USHORT SvxEditEngineForwarder::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const
+{
+ return rEditEngine.GetLineNumberAtIndex(nPara, nIndex);
+}
+
+
sal_Bool SvxEditEngineForwarder::QuickFormatDoc( BOOL )
{
rEditEngine.QuickFormatDoc();
diff --git a/svx/source/unoedit/unoforou.cxx b/svx/source/unoedit/unoforou.cxx
index c46551d52d4f..c54f76d5f4dc 100644
--- a/svx/source/unoedit/unoforou.cxx
+++ b/svx/source/unoedit/unoforou.cxx
@@ -430,6 +430,16 @@ USHORT SvxOutlinerForwarder::GetLineLen( USHORT nPara, USHORT nLine ) const
return rOutliner.GetLineLen(nPara, nLine);
}
+void SvxOutlinerForwarder::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nPara, USHORT nLine ) const
+{
+ return rOutliner.GetEditEngine().GetLineBoundaries( rStart, rEnd, nPara, nLine );
+}
+
+USHORT SvxOutlinerForwarder::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const
+{
+ return rOutliner.GetEditEngine().GetLineNumberAtIndex( nPara, nIndex );
+}
+
sal_Bool SvxOutlinerForwarder::QuickFormatDoc( BOOL )
{
rOutliner.QuickFormatDoc();
@@ -480,7 +490,7 @@ sal_Bool SvxOutlinerForwarder::SetDepth( USHORT nPara, sal_Int16 nNewDepth )
{
rOutliner.SetDepth( pPara, nNewDepth );
- const bool bOutlinerText = (pSdrObject->GetObjInventor() == SdrInventor) && (pSdrObject->GetObjIdentifier() == OBJ_OUTLINETEXT);
+ const bool bOutlinerText = pSdrObject && (pSdrObject->GetObjInventor() == SdrInventor) && (pSdrObject->GetObjIdentifier() == OBJ_OUTLINETEXT);
if( bOutlinerText )
rOutliner.SetLevelDependendStyleSheet( nPara );
diff --git a/svx/source/unoedit/unotext.cxx b/svx/source/unoedit/unotext.cxx
index 4a550fb8537d..a46533657f1c 100644
--- a/svx/source/unoedit/unotext.cxx
+++ b/svx/source/unoedit/unotext.cxx
@@ -2647,6 +2647,16 @@ USHORT SvxDummyTextSource::GetLineLen( USHORT, USHORT ) const
return 0;
}
+void SvxDummyTextSource::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT /*nParagraph*/, USHORT /*nLine*/ ) const
+{
+ rStart = rEnd = 0;
+}
+
+USHORT SvxDummyTextSource::GetLineNumberAtIndex( USHORT /*nPara*/, USHORT /*nIndex*/ ) const
+{
+ return 0;
+}
+
sal_Bool SvxDummyTextSource::QuickFormatDoc( BOOL )
{
return sal_False;
diff --git a/svx/source/unoedit/unoviwou.cxx b/svx/source/unoedit/unoviwou.cxx
index aff102a09900..3826a4d6a330 100644
--- a/svx/source/unoedit/unoviwou.cxx
+++ b/svx/source/unoedit/unoviwou.cxx
@@ -35,6 +35,7 @@
#include <svx/unoviwou.hxx>
#include <svx/outliner.hxx>
+#include <svx/editeng.hxx>
#include <svx/svdotext.hxx>
diff --git a/svx/source/unogallery/makefile.mk b/svx/source/unogallery/makefile.mk
index a63b79bb6f67..a699208f4f01 100755
--- a/svx/source/unogallery/makefile.mk
+++ b/svx/source/unogallery/makefile.mk
@@ -38,14 +38,10 @@ ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
-CXXFILES= \
- unogalthemeprovider.cxx \
- unogaltheme.cxx \
- unogalitem.cxx
-
SLOFILES= \
$(SLO)$/unogalthemeprovider.obj \
$(SLO)$/unogaltheme.obj \
diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx
index ebeeffe742b8..126f49fe0b50 100644
--- a/svx/source/unogallery/unogalthemeprovider.cxx
+++ b/svx/source/unogallery/unogalthemeprovider.cxx
@@ -92,7 +92,7 @@ GalleryThemeProvider::~GalleryThemeProvider()
// ------------------------------------------------------------------------------
-::rtl::OUString GalleryThemeProvider::getImplementationName_Static()
+SVX_DLLPUBLIC ::rtl::OUString GalleryThemeProvider::getImplementationName_Static()
throw()
{
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.gallery.GalleryThemeProvider" ) );
@@ -100,7 +100,7 @@ GalleryThemeProvider::~GalleryThemeProvider()
// ------------------------------------------------------------------------------
-uno::Sequence< ::rtl::OUString > GalleryThemeProvider::getSupportedServiceNames_Static()
+SVX_DLLPUBLIC uno::Sequence< ::rtl::OUString > GalleryThemeProvider::getSupportedServiceNames_Static()
throw()
{
uno::Sequence< ::rtl::OUString > aSeq( 1 );
diff --git a/svx/source/xml/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx
index e6f7221623fd..ab9eb5aeb36d 100644
--- a/svx/source/xml/xmleohlp.cxx
+++ b/svx/source/xml/xmleohlp.cxx
@@ -326,11 +326,29 @@ sal_Bool SvXMLEmbeddedObjectHelper::ImplGetStorageNames(
}
else
{
- sal_Int32 nPathStart = 0;
- if( 0 == aURLNoPar.compareToAscii( "./", 2 ) )
- nPathStart = 2;
- if( _nPos >= nPathStart )
- rContainerStorageName = aURLNoPar.copy( nPathStart, _nPos-nPathStart);
+ //eliminate 'superfluous' slashes at start and end
+ //#i103076# load objects with all allowed xlink:href syntaxes
+ {
+ //eliminate './' at start
+ sal_Int32 nStart = 0;
+ sal_Int32 nCount = aURLNoPar.getLength();
+ if( 0 == aURLNoPar.compareToAscii( "./", 2 ) )
+ {
+ nStart = 2;
+ nCount -= 2;
+ }
+
+ //eliminate '/' at end
+ sal_Int32 nEnd = aURLNoPar.lastIndexOf( '/' );
+ if( nEnd == aURLNoPar.getLength()-1 && nEnd != (nStart-1) )
+ nCount--;
+
+ aURLNoPar = aURLNoPar.copy( nStart, nCount );
+ }
+
+ _nPos = aURLNoPar.lastIndexOf( '/' );
+ if( _nPos >= 0 )
+ rContainerStorageName = aURLNoPar.copy( 0, _nPos );
rObjectStorageName = aURLNoPar.copy( _nPos+1 );
}
}
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 4cc56d5ca427..7ab6a44fd3fb 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -670,17 +670,16 @@ sal_Bool SvXMLGraphicHelper::ImplWriteGraphic( const ::rtl::OUString& rPictureSt
// -----------------------------------------------------------------------------
-void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, sal_uInt32 nInsertPos )
+void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, sal_uInt32 nInsertPos, rtl::OUString& rRequestedFileName )
{
+ rtl::OUString aURLString( rURLStr );
::rtl::OUString aPictureStorageName, aPictureStreamName;
-
- if( ( maURLSet.find( rURLStr ) != maURLSet.end() ) )
+ if( ( maURLSet.find( aURLString ) != maURLSet.end() ) )
{
URLPairVector::iterator aIter( maGrfURLs.begin() ), aEnd( maGrfURLs.end() );
-
while( aIter != aEnd )
{
- if( rURLStr == (*aIter).first )
+ if( aURLString == (*aIter).first )
{
maGrfURLs[ nInsertPos ].second = (*aIter).second;
aIter = aEnd;
@@ -689,7 +688,7 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, s
aIter++;
}
}
- else if( ImplGetStreamNames( rURLStr, aPictureStorageName, aPictureStreamName ) )
+ else if( ImplGetStreamNames( aURLString, aPictureStorageName, aPictureStreamName ) )
{
URLPair& rURLPair = maGrfURLs[ nInsertPos ];
@@ -718,22 +717,23 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, s
String aStreamName( aGraphicObjectId );
Graphic aGraphic( (Graphic&) aGrfObject.GetGraphic() );
const GfxLink aGfxLink( aGraphic.GetLink() );
+ String aExtension;
if( aGfxLink.GetDataSize() )
{
switch( aGfxLink.GetType() )
{
- case( GFX_LINK_TYPE_EPS_BUFFER ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".eps" ) ); break;
- case( GFX_LINK_TYPE_NATIVE_GIF ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".gif" ) ); break;
- case( GFX_LINK_TYPE_NATIVE_JPG ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".jpg" ) ); break;
- case( GFX_LINK_TYPE_NATIVE_PNG ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".png" ) ); break;
- case( GFX_LINK_TYPE_NATIVE_TIF ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".tif" ) ); break;
- case( GFX_LINK_TYPE_NATIVE_WMF ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".wmf" ) ); break;
- case( GFX_LINK_TYPE_NATIVE_MET ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".met" ) ); break;
- case( GFX_LINK_TYPE_NATIVE_PCT ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".pct" ) ); break;
+ case( GFX_LINK_TYPE_EPS_BUFFER ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".eps" ) ); break;
+ case( GFX_LINK_TYPE_NATIVE_GIF ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".gif" ) ); break;
+ case( GFX_LINK_TYPE_NATIVE_JPG ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".jpg" ) ); break;
+ case( GFX_LINK_TYPE_NATIVE_PNG ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".png" ) ); break;
+ case( GFX_LINK_TYPE_NATIVE_TIF ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".tif" ) ); break;
+ case( GFX_LINK_TYPE_NATIVE_WMF ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".wmf" ) ); break;
+ case( GFX_LINK_TYPE_NATIVE_MET ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".met" ) ); break;
+ case( GFX_LINK_TYPE_NATIVE_PCT ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".pct" ) ); break;
default:
- aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".grf" ) );
+ aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".grf" ) );
break;
}
}
@@ -742,30 +742,52 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, s
if( aGrfObject.GetType() == GRAPHIC_BITMAP )
{
if( aGrfObject.IsAnimated() )
- aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".gif" ) );
+ aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".gif" ) );
else
- aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".png" ) );
+ aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".png" ) );
}
else if( aGrfObject.GetType() == GRAPHIC_GDIMETAFILE )
{
// SJ: first check if this metafile is just a eps file, then we will store the eps instead of svm
GDIMetaFile& rMtf( (GDIMetaFile&)aGraphic.GetGDIMetaFile() );
if ( ImplCheckForEPS( rMtf ) )
- aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".eps" ) );
+ aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".eps" ) );
else
- aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".svm" ) );
+ aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".svm" ) );
}
}
+ rtl::OUString aURLEntry;
+ const String sPictures( RTL_CONSTASCII_USTRINGPARAM( "Pictures/" ) );
+
+ if ( rRequestedFileName.getLength() )
+ {
+ aURLEntry = sPictures;
+ aURLEntry += rRequestedFileName;
+ aURLEntry += aExtension;
+
+ URLPairVector::iterator aIter( maGrfURLs.begin() ), aEnd( maGrfURLs.end() );
+ while( aIter != aEnd )
+ {
+ if( aURLEntry == (*aIter).second )
+ break;
+ aIter++;
+ }
+ if ( aIter == aEnd )
+ aStreamName = rRequestedFileName;
+ }
+
+ aStreamName += aExtension;
+
if( mbDirect && aStreamName.Len() )
ImplWriteGraphic( aPictureStorageName, aStreamName, aGraphicObjectId );
- rURLPair.second = String( RTL_CONSTASCII_USTRINGPARAM( "Pictures/" ) );
+ rURLPair.second = sPictures;
rURLPair.second += aStreamName;
}
}
- maURLSet.insert( rURLStr );
+ maURLSet.insert( aURLString );
}
}
@@ -820,14 +842,45 @@ void SvXMLGraphicHelper::Destroy( SvXMLGraphicHelper* pSvXMLGraphicHelper )
// -----------------------------------------------------------------------------
// XGraphicObjectResolver
-::rtl::OUString SAL_CALL SvXMLGraphicHelper::resolveGraphicObjectURL( const ::rtl::OUString& aURL )
+::rtl::OUString SAL_CALL SvXMLGraphicHelper::resolveGraphicObjectURL( const ::rtl::OUString& rURL )
throw(uno::RuntimeException)
{
::osl::MutexGuard aGuard( maMutex );
const sal_Int32 nIndex = maGrfURLs.size();
+ rtl::OUString aURL( rURL );
+ rtl::OUString aUserData;
+ rtl::OUString aRequestedFileName;
+
+ sal_Int32 nUser = rURL.indexOf( '?', 0 );
+ if ( nUser >= 0 )
+ {
+ aURL = rtl::OUString( rURL.copy( 0, nUser ) );
+ nUser++;
+ aUserData = rURL.copy( nUser, rURL.getLength() - nUser );
+ }
+ if ( aUserData.getLength() )
+ {
+ sal_Int32 nIndex2 = 0;
+ do
+ {
+ rtl::OUString aToken = aUserData.getToken( 0, ';', nIndex2 );
+ sal_Int32 n = aToken.indexOf( '=' );
+ if ( ( n > 0 ) && ( ( n + 1 ) < aToken.getLength() ) )
+ {
+ rtl::OUString aParam( aToken.copy( 0, n ) );
+ rtl::OUString aValue( aToken.copy( n + 1, aToken.getLength() - ( n + 1 ) ) );
+
+ const rtl::OUString sRequestedName( RTL_CONSTASCII_USTRINGPARAM("requestedName") );
+ if ( aParam.match( sRequestedName ) )
+ aRequestedFileName = aValue;
+ }
+ }
+ while ( nIndex2 >= 0 );
+ }
+
maGrfURLs.push_back( ::std::make_pair( aURL, ::rtl::OUString() ) );
- ImplInsertGraphicURL( aURL, nIndex );
+ ImplInsertGraphicURL( aURL, nIndex, aRequestedFileName );
return maGrfURLs[ nIndex ].second;
}
diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx
index e211c98f6834..70e8af36c838 100644
--- a/svx/source/xml/xmlxtimp.cxx
+++ b/svx/source/xml/xmlxtimp.cxx
@@ -394,7 +394,7 @@ sal_Bool SvxXMLXTableImport::load( const OUString& rUrl, const uno::Reference< X
if( aMedium.IsStorage() )
{
- uno::Reference < embed::XStorage > xStorage( aMedium.GetStorage(), uno::UNO_QUERY_THROW );
+ uno::Reference < embed::XStorage > xStorage( aMedium.GetStorage( sal_False ), uno::UNO_QUERY_THROW );
const String aContentStmName( RTL_CONSTASCII_USTRINGPARAM( "Content.xml" ) );
xIStm.set( xStorage->openStreamElement( aContentStmName, embed::ElementModes::READ ), uno::UNO_QUERY_THROW );
diff --git a/svx/util/hidother.src b/svx/util/hidother.src
index 86c0edea64d3..6ef00e2640a2 100644
--- a/svx/util/hidother.src
+++ b/svx/util/hidother.src
@@ -392,4 +392,5 @@ hidspecial HID_MACRO_HEADERTABLISTBOX { HelpID = HID_MACRO_HEADERTABLI
hidspecial HID_PASTE_DLG { HelpId = HID_PASTE_DLG; };
hidspecial HID_LINKDLG_TABLB { HelpId = HID_LINKDLG_TABLB; };
+hidspecial HID_OPTIONS_JAVA_LIST { HelpId = HID_OPTIONS_JAVA_LIST; };
diff --git a/svx/util/makefile.mk b/svx/util/makefile.mk
index f212284fa401..3dcf5ca250f3 100644
--- a/svx/util/makefile.mk
+++ b/svx/util/makefile.mk
@@ -52,11 +52,6 @@ RSCLOCINC+=-I$(PRJ)$/source$/svdraw
LIB1TARGET= $(SLB)$/$(TARGET).lib
LIB1FILES=\
- $(SLB)$/animation.lib \
- $(SLB)$/overlay.lib \
- $(SLB)$/attribute.lib \
- $(SLB)$/primitive2d.lib \
- $(SLB)$/primitive3d.lib \
$(SLB)$/svdraw.lib \
$(SLB)$/form.lib
@@ -67,10 +62,6 @@ LIB1FILES+=$(SLB)$/ibrwimp.lib
LIB2TARGET= $(SLB)$/$(TARGET)_2.lib
LIB2FILES=\
$(SLB)$/items.lib \
- $(SLB)$/svxlink.lib \
- $(SLB)$/svxrtf.lib \
- $(SLB)$/editeng.lib \
- $(SLB)$/outliner.lib \
$(SLB)$/dialogs.lib \
$(SLB)$/mnuctrls.lib \
$(SLB)$/options.lib \
@@ -83,40 +74,112 @@ LIB3TARGET= $(SLB)$/$(TARGET)_3.lib
LIB3FILES=\
$(SLB)$/unodraw.lib \
$(SLB)$/unogallery.lib\
- $(SLB)$/gal.lib \
$(SLB)$/accessibility.lib \
- $(SLB)$/customshapes.lib\
- $(SLB)$/toolbars.lib \
- $(SLB)$/properties.lib \
- $(SLB)$/contact.lib \
- $(SLB)$/event.lib
+ $(SLB)$/customshapes.lib
LIB4TARGET= $(SLB)$/$(TARGET)_4.lib
LIB4FILES=\
$(SLB)$/fmcomp.lib \
$(SLB)$/engine3d.lib \
- $(SLB)$/msfilter.lib \
- $(SLB)$/xout.lib \
- $(SLB)$/xml.lib \
$(SLB)$/table.lib
+# Objects needed for the svxcore library.
+LIB5TARGET= $(SLB)$/$(TARGET)_5.lib
+LIB5FILES=\
+ $(SLB)$/accessibility-core.lib \
+ $(SLB)$/animation.lib \
+ $(SLB)$/attribute.lib \
+ $(SLB)$/contact.lib \
+ $(SLB)$/customshapes-core.lib \
+ $(SLB)$/dialogs-core.lib \
+ $(SLB)$/editeng.lib \
+ $(SLB)$/engine3d-core.lib \
+ $(SLB)$/event.lib \
+ $(SLB)$/fmcomp-core.lib \
+ $(SLB)$/form-core.lib \
+ $(SLB)$/gal.lib \
+ $(SLB)$/items-core.lib \
+ $(SLB)$/msfilter-core.lib \
+ $(SLB)$/options-core.lib
+
+LIB6TARGET= $(SLB)$/$(TARGET)_6.lib
+LIB6FILES=\
+ $(SLB)$/outliner.lib \
+ $(SLB)$/overlay.lib \
+ $(SLB)$/primitive2d.lib \
+ $(SLB)$/primitive3d.lib \
+ $(SLB)$/properties.lib \
+ $(SLB)$/svdraw-core.lib \
+ $(SLB)$/svxlink.lib \
+ $(SLB)$/svxrtf-core.lib \
+ $(SLB)$/table-core.lib \
+ $(SLB)$/tbxctrls-core.lib \
+ $(SLB)$/toolbars.lib \
+ $(SLB)$/unodraw-core.lib \
+ $(SLB)$/unoedit-core.lib \
+ $(SLB)$/xml.lib \
+ $(SLB)$/xout.lib
+
+# Objects needed for the svxmsfilter library.
+LIB7TARGET= $(SLB)$/$(TARGET)_7.lib
+LIB7FILES=\
+ $(SLB)$/msfilter-msfilter.lib \
+ $(SLB)$/svdraw-msfilter.lib \
+ $(SLB)$/svxrtf.lib
+
HELPIDFILES= ..$/inc$/helpid.hrc
-# svx
-SHL1TARGET= svx$(DLLPOSTFIX)
-SHL1IMPLIB= i$(TARGET)
+# svxcore
+SHL1TARGET= svxcore$(DLLPOSTFIX)
+SHL1IMPLIB= isvxcore
SHL1USE_EXPORTS=name
+SHL1LIBS= $(LIB5TARGET) $(LIB6TARGET)
-SHL1LIBS= $(LIB1TARGET) $(LIB2TARGET) $(LIB3TARGET) $(LIB4TARGET)
SHL1STDLIBS= \
- $(AVMEDIALIB) \
+ $(AVMEDIALIB) \
+ $(SFX2LIB) \
+ $(XMLOFFLIB) \
+ $(GOODIESLIB) \
+ $(BASEGFXLIB) \
+ $(DRAWINGLAYERLIB) \
+ $(LNGLIB) \
+ $(BASICLIB) \
+ $(SVTOOLLIB) \
+ $(TKLIB) \
+ $(VCLLIB) \
+ $(SVLLIB) \
+ $(SOTLIB) \
+ $(UNOTOOLSLIB) \
+ $(TOOLSLIB) \
+ $(I18NISOLANGLIB) \
+ $(I18NPAPERLIB) \
+ $(COMPHELPERLIB) \
+ $(UCBHELPERLIB) \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(VOSLIB) \
+ $(SALLIB) \
+ $(ICUUCLIB)
+
+SHL1DEF= $(MISC)$/$(SHL1TARGET).def
+DEF1NAME= $(SHL1TARGET)
+DEFLIB1NAME=$(TARGET)_5 $(TARGET)_6
+
+# svx
+SHL2TARGET= svx$(DLLPOSTFIX)
+SHL2IMPLIB= i$(TARGET)
+SHL2USE_EXPORTS=name
+SHL2DEPN=$(SHL1TARGETN)
+
+SHL2LIBS= $(LIB1TARGET) $(LIB2TARGET) $(LIB3TARGET) $(LIB4TARGET)
+SHL2STDLIBS= \
+ $(SVXCORELIB) \
$(SFX2LIB) \
$(XMLOFFLIB) \
$(GOODIESLIB) \
$(BASEGFXLIB) \
$(DRAWINGLAYERLIB) \
$(BASICLIB) \
- $(LNGLIB) \
$(SVTOOLLIB) \
$(TKLIB) \
$(VCLLIB) \
@@ -125,7 +188,6 @@ SHL1STDLIBS= \
$(UNOTOOLSLIB) \
$(TOOLSLIB) \
$(I18NISOLANGLIB) \
- $(I18NPAPERLIB) \
$(XMLSCRIPTLIB) \
$(COMPHELPERLIB) \
$(UCBHELPERLIB) \
@@ -136,25 +198,26 @@ SHL1STDLIBS= \
$(ICUUCLIB)
.IF "$(GUI)"=="WNT"
-SHL1STDLIBS+=$(SHELLLIB)
+SHL2STDLIBS+=$(SHELLLIB)
.ENDIF # WNT
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-DEF1NAME= $(SHL1TARGET)
-DEFLIB1NAME=$(TARGET) $(TARGET)_2 $(TARGET)_3 $(TARGET)_4
+SHL2DEF= $(MISC)$/$(SHL2TARGET).def
+DEF2NAME= $(SHL2TARGET)
+DEFLIB2NAME=$(TARGET) $(TARGET)_2 $(TARGET)_3 $(TARGET)_4
# cui
-SHL2TARGET= cui$(DLLPOSTFIX)
-SHL2VERSIONMAP= cui.map
-SHL2IMPLIB=icui
-SHL2DEPN=$(SHL1TARGETN)
+SHL3TARGET= cui$(DLLPOSTFIX)
+SHL3VERSIONMAP= cui.map
+SHL3IMPLIB=icui
+SHL3DEPN=$(SHL2TARGETN)
-SHL2DEF= $(MISC)$/$(SHL2TARGET).def
-DEF2NAME= $(SHL2TARGET)
+SHL3DEF= $(MISC)$/$(SHL3TARGET).def
+DEF3NAME= $(SHL3TARGET)
-SHL2LIBS= $(SLB)$/cui.lib
+SHL3LIBS= $(SLB)$/cui.lib
-SHL2STDLIBS= \
+SHL3STDLIBS= \
+ $(SVXCORELIB) \
$(SVXLIB) \
$(AVMEDIALIB) \
$(SFX2LIB) \
@@ -175,18 +238,50 @@ SHL2STDLIBS= \
$(CPPULIB) \
$(VOSLIB) \
$(SALLIB) \
- $(JVMFWKLIB)
+ $(JVMFWKLIB) \
+ $(ICUUCLIB)
.IF "$(debug)$(dbgutil)"!=""
SHL2STDLIBS += $(CPPUHELPERLIB)
.ENDIF # "$(debug)$(dbgutil)"!=""
.IF "$(GUI)"=="WNT"
-SHL2STDLIBS+= \
+SHL3STDLIBS+= \
$(SHLWAPILIB) \
$(ADVAPI32LIB)
.ENDIF # WNT
+# svxmsfilter library
+SHL4TARGET= svxmsfilter$(DLLPOSTFIX)
+SHL4IMPLIB= isvxmsfilter
+SHL4USE_EXPORTS=name
+SHL4DEPN=$(SHL1TARGETN)
+SHL4LIBS= $(LIB7TARGET)
+
+SHL4STDLIBS= \
+ $(SVXCORELIB) \
+ $(SFX2LIB) \
+ $(XMLOFFLIB) \
+ $(GOODIESLIB) \
+ $(BASEGFXLIB) \
+ $(BASICLIB) \
+ $(SVTOOLLIB) \
+ $(TKLIB) \
+ $(VCLLIB) \
+ $(SVLLIB) \
+ $(SOTLIB) \
+ $(UNOTOOLSLIB) \
+ $(TOOLSLIB) \
+ $(XMLSCRIPTLIB) \
+ $(COMPHELPERLIB) \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(SALLIB)
+
+SHL4DEF= $(MISC)$/$(SHL4TARGET).def
+DEF4NAME= $(SHL4TARGET)
+DEFLIB4NAME=$(TARGET)_7
+
# ------------------------------------------------------------------------------
# Resource files
diff --git a/svx/util/makefile.pmk b/svx/util/makefile.pmk
index 27f185e936bd..b2aae3329111 100644
--- a/svx/util/makefile.pmk
+++ b/svx/util/makefile.pmk
@@ -36,4 +36,12 @@ CDEFS += -DSVX_DLLIMPLEMENTATION
CFLAGS+=-DENABLE_GTK
.ENDIF
+.IF "$(ENABLE_KDE)" != ""
+CFLAGS+=-DENABLE_KDE
+.ENDIF
+
+.IF "$(ENABLE_KDE4)" != ""
+CFLAGS+=-DENABLE_KDE4
+.ENDIF
+
VISIBILITY_HIDDEN=TRUE
diff --git a/ucb/inc/makefile.mk b/ucb/inc/makefile.mk
index 90c4f96a1f68..c98dc5fe07e2 100644
--- a/ucb/inc/makefile.mk
+++ b/ucb/inc/makefile.mk
@@ -41,6 +41,7 @@ TARGET=inc
# --- Targets -------------------------------------------------------
.INCLUDE : target.mk
+.IF "$(L10N_framework)"==""
.IF "$(ENABLE_PCH)"!=""
ALLTAR : \
@@ -48,4 +49,4 @@ ALLTAR : \
$(SLO)$/precompiled_ex.pch
.ENDIF # "$(ENABLE_PCH)"!=""
-
+.ENDIF # L10N_framework
diff --git a/ucb/source/cacher/makefile.mk b/ucb/source/cacher/makefile.mk
index dd4d9b398229..09717b3f0f7e 100644
--- a/ucb/source/cacher/makefile.mk
+++ b/ucb/source/cacher/makefile.mk
@@ -39,6 +39,7 @@ NO_BSYMBOLIC=TRUE
UCB_MAJOR=1
.INCLUDE: settings.mk
+.IF "$(L10N_framework)"==""
SLOFILES=\
$(SLO)$/contentresultsetwrapper.obj \
@@ -65,6 +66,7 @@ SHL1IMPLIB=i$(TARGET)
SHL1VERSIONMAP=exports.map
DEF1NAME=$(SHL1TARGET)
+.ENDIF # L10N_framework
.INCLUDE: target.mk
diff --git a/ucb/source/core/makefile.mk b/ucb/source/core/makefile.mk
index 963aa038dab0..e70b5ca879ef 100644
--- a/ucb/source/core/makefile.mk
+++ b/ucb/source/core/makefile.mk
@@ -39,6 +39,7 @@ NO_BSYMBOLIC=TRUE
UCB_MAJOR=1
.INCLUDE: settings.mk
+.IF "$(L10N_framework)"==""
SLOFILES=\
$(SLO)$/identify.obj \
@@ -72,5 +73,7 @@ SHL1VERSIONMAP=exports.map
DEF1NAME=$(SHL1TARGET)
+.ENDIF # L10N_framework
+
.INCLUDE: target.mk
diff --git a/ucb/source/regexp/makefile.mk b/ucb/source/regexp/makefile.mk
index 898a4d5adbdb..8d0b938402e8 100644
--- a/ucb/source/regexp/makefile.mk
+++ b/ucb/source/regexp/makefile.mk
@@ -36,8 +36,10 @@ AUTOSEG=true
ENABLE_EXCEPTIONS=true
.INCLUDE : settings.mk
+.IF "$(L10N_framework)"==""
SLOFILES=\
$(SLO)$/regexp.obj
+.ENDIF # L10N_framework
.INCLUDE : target.mk
diff --git a/ucb/source/sorter/makefile.mk b/ucb/source/sorter/makefile.mk
index cbe4e360ee29..bcd3b644476a 100644
--- a/ucb/source/sorter/makefile.mk
+++ b/ucb/source/sorter/makefile.mk
@@ -38,6 +38,7 @@ ENABLE_EXCEPTIONS=TRUE
UCB_MAJOR=1
.INCLUDE: settings.mk
+.IF "$(L10N_framework)"==""
SLOFILES=\
$(SLO)$/sortdynres.obj \
@@ -60,6 +61,7 @@ SHL1IMPLIB=i$(TARGET)
SHL1VERSIONMAP=exports.map
DEF1NAME=$(SHL1TARGET)
+.ENDIF # L10N_framework
.INCLUDE: target.mk
diff --git a/ucb/source/ucp/expand/makefile.mk b/ucb/source/ucp/expand/makefile.mk
index 03e0e5a638ee..6b4ffc8581be 100644
--- a/ucb/source/ucp/expand/makefile.mk
+++ b/ucb/source/ucp/expand/makefile.mk
@@ -39,6 +39,8 @@ NO_BSYMBOLIC = TRUE
.INCLUDE : settings.mk
DLLPRE =
+.IF "$(L10N_framework)"==""
+
SLOFILES= \
$(SLO)$/ucpexpand.obj
@@ -58,4 +60,6 @@ SHL1DEF = $(MISC)$/$(SHL1TARGET).def
DEF1NAME = $(SHL1TARGET)
+.ENDIF # L10N_framework
+
.INCLUDE : target.mk
diff --git a/ucb/source/ucp/file/makefile.mk b/ucb/source/ucp/file/makefile.mk
index 31fbaf8f1eba..d03983bca000 100644
--- a/ucb/source/ucp/file/makefile.mk
+++ b/ucb/source/ucp/file/makefile.mk
@@ -39,6 +39,7 @@ NO_BSYMBOLIC=TRUE
UCPFILE_MAJOR=1
.INCLUDE: settings.mk
+.IF "$(L10N_framework)"==""
SLOFILES=\
$(SLO)$/prov.obj \
@@ -77,6 +78,7 @@ DEF1EXPORTFILE=exports2.dxp
.ENDIF
DEF1NAME=$(SHL1TARGET)
+.ENDIF # L10N_framework
.INCLUDE: target.mk
diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx
index c90afa97bf3c..e4533d872275 100644
--- a/ucb/source/ucp/ftp/ftpcontent.cxx
+++ b/ucb/source/ucp/ftp/ftpcontent.cxx
@@ -322,6 +322,7 @@ Any SAL_CALL FTPContent::execute(
aAccount);
rtl::Reference<ucbhelper::SimpleAuthenticationRequest>
p( new ucbhelper::SimpleAuthenticationRequest(
+ m_aFTPURL.ident(false, false),
m_aFTPURL.host(), // ServerName
ucbhelper::SimpleAuthenticationRequest::ENTITY_NA,
aRealm,
diff --git a/ucb/source/ucp/ftp/makefile.mk b/ucb/source/ucp/ftp/makefile.mk
index 05254484eb0d..75f5512c728c 100644
--- a/ucb/source/ucp/ftp/makefile.mk
+++ b/ucb/source/ucp/ftp/makefile.mk
@@ -45,7 +45,7 @@ UCPFTP_MAJOR=1
.INCLUDE: settings.mk
# --- General -----------------------------------------------------
-
+.IF "$(L10N_framework)"==""
# first target ( shared library )
SLOFILES1=\
@@ -93,6 +93,7 @@ SHL1LIBS= \
DEF1NAME=$(SHL1TARGET)
+.ENDIF # L10N_framework
.INCLUDE: target.mk
diff --git a/ucb/source/ucp/gio/gio_mount.cxx b/ucb/source/ucp/gio/gio_mount.cxx
index b3f562e503fc..2756262ce91d 100644
--- a/ucb/source/ucp/gio/gio_mount.cxx
+++ b/ucb/source/ucp/gio/gio_mount.cxx
@@ -123,7 +123,7 @@ static void ooo_mount_operation_ask_password (GMountOperation *op,
aDomain = rtl::OUString(default_domain, strlen(default_domain), RTL_TEXTENCODING_UTF8);
uno::Reference< ucbhelper::SimpleAuthenticationRequest > xRequest
- = new ucbhelper::SimpleAuthenticationRequest (aHostName, eDomain, aDomain, eUserName, aUserName, ePassword, aPassword);
+ = new ucbhelper::SimpleAuthenticationRequest (rtl::OUString() /* FIXME: provide URL here */, aHostName, eDomain, aDomain, eUserName, aUserName, ePassword, aPassword);
xIH->handle( xRequest.get() );
diff --git a/ucb/source/ucp/gio/makefile.mk b/ucb/source/ucp/gio/makefile.mk
index a0f33f8dbb6d..2e7009e52ab2 100644
--- a/ucb/source/ucp/gio/makefile.mk
+++ b/ucb/source/ucp/gio/makefile.mk
@@ -39,6 +39,7 @@ USE_DEFFILE=TRUE
NO_BSYMBOLIC=TRUE
.INCLUDE: settings.mk
+.IF "$(L10N_framework)"==""
UNIXTEXT=$(MISC)/$(TARGET)-ucd.txt
@@ -79,5 +80,6 @@ SHL1STDLIBS+=$(PKGCONFIG_LIBS)
SHL1VERSIONMAP= exports.map
.ENDIF # "$(ENABLE_GIO)"!=""
+.ENDIF # L10N_framework
.INCLUDE: target.mk
diff --git a/ucb/source/ucp/gvfs/content.cxx b/ucb/source/ucp/gvfs/content.cxx
index ab00cec0907e..743043c09fc7 100644
--- a/ucb/source/ucp/gvfs/content.cxx
+++ b/ucb/source/ucp/gvfs/content.cxx
@@ -1609,7 +1609,8 @@ extern "C" {
}
rtl::Reference< ucbhelper::SimpleAuthenticationRequest > xRequest
- = new ucbhelper::SimpleAuthenticationRequest (aHostName, eDomain, aDomain,
+ = new ucbhelper::SimpleAuthenticationRequest (GnomeToOUString(in->uri),
+ aHostName, eDomain, aDomain,
eUserName, aUserName,
ePassword, aPassword);
diff --git a/ucb/source/ucp/gvfs/makefile.mk b/ucb/source/ucp/gvfs/makefile.mk
index 0f7ae15db9d8..889e3ffd415d 100644
--- a/ucb/source/ucp/gvfs/makefile.mk
+++ b/ucb/source/ucp/gvfs/makefile.mk
@@ -39,6 +39,7 @@ USE_DEFFILE=TRUE
NO_BSYMBOLIC=TRUE
.INCLUDE: settings.mk
+.IF "$(L10N_framework)"==""
UNIXTEXT=$(MISC)/$(TARGET)-ucd.txt
@@ -83,6 +84,7 @@ SHL1STDLIBS+=$(PKGCONFIG_LIBS)
SHL1VERSIONMAP= exports.map
.ENDIF # "$(ENABLE_GNOMEVFS)"!=""
+.ENDIF # L10N_framework
.INCLUDE: target.mk
diff --git a/ucb/source/ucp/hierarchy/makefile.mk b/ucb/source/ucp/hierarchy/makefile.mk
index 9500b024829d..b71ee7fa1817 100644
--- a/ucb/source/ucp/hierarchy/makefile.mk
+++ b/ucb/source/ucp/hierarchy/makefile.mk
@@ -44,6 +44,7 @@ UCPHIER_MAJOR=1
.INCLUDE: settings.mk
# --- General -----------------------------------------------------
+.IF "$(L10N_framework)"==""
SLOFILES=\
$(SLO)$/hierarchyservices.obj \
@@ -82,5 +83,6 @@ DEF1NAME=$(SHL1TARGET)
# --- Targets ----------------------------------------------------------
+.ENDIF # L10N_framework
.INCLUDE: target.mk
diff --git a/ucb/source/ucp/package/makefile.mk b/ucb/source/ucp/package/makefile.mk
index 64e76da3ea24..4b4f066ac1cf 100644
--- a/ucb/source/ucp/package/makefile.mk
+++ b/ucb/source/ucp/package/makefile.mk
@@ -50,6 +50,7 @@ NO_BSYMBOLIC=TRUE
.INCLUDE: settings.mk
# --- General -----------------------------------------------------
+.IF "$(L10N_framework)"==""
SLOFILES=\
$(SLO)$/pkgservices.obj \
@@ -86,5 +87,6 @@ DEF1NAME=$(SHL1TARGET)
# --- Targets ----------------------------------------------------------
+.ENDIF # L10N_framework
.INCLUDE: target.mk
diff --git a/ucb/source/ucp/tdoc/makefile.mk b/ucb/source/ucp/tdoc/makefile.mk
index 78b3123fa220..1c2c44b124de 100644
--- a/ucb/source/ucp/tdoc/makefile.mk
+++ b/ucb/source/ucp/tdoc/makefile.mk
@@ -43,6 +43,7 @@ NO_BSYMBOLIC=TRUE
.INCLUDE: settings.mk
# --- General -----------------------------------------------------
+.IF "$(L10N_framework)"==""
# no "lib" prefix
DLLPRE =
@@ -89,6 +90,8 @@ SYMBOLPREFIX=$(TARGET)
DEF1NAME=$(SHL1TARGET)
+.ENDIF # L10N_framework
+
# --- Targets ----------------------------------------------------------
.INCLUDE: target.mk
diff --git a/ucb/source/ucp/webdav/DAVAuthListener.hxx b/ucb/source/ucp/webdav/DAVAuthListener.hxx
index 4744b06f9649..548a4a0a97fa 100644
--- a/ucb/source/ucp/webdav/DAVAuthListener.hxx
+++ b/ucb/source/ucp/webdav/DAVAuthListener.hxx
@@ -49,7 +49,8 @@ class DAVAuthListener : public salhelper::SimpleReferenceObject
const ::rtl::OUString & inHostName,
::rtl::OUString & inoutUserName,
::rtl::OUString & outPassWord,
- const sal_Bool & bAllowPersistentStoring) = 0;
+ sal_Bool bAllowPersistentStoring,
+ sal_Bool bCanUseSystemCredentials ) = 0;
};
} // namespace webdav_ucp
diff --git a/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx b/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx
index e697773eb198..db06b24b22bc 100644
--- a/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx
+++ b/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx
@@ -54,9 +54,9 @@ namespace webdav_ucp
DAVAuthListener_Impl(
const com::sun::star::uno::Reference<
- com::sun::star::ucb::XCommandEnvironment>& xEnv )
- : m_xEnv( xEnv
- )
+ com::sun::star::ucb::XCommandEnvironment>& xEnv,
+ const ::rtl::OUString & inURL )
+ : m_xEnv( xEnv ), m_aURL( inURL )
{
}
@@ -64,11 +64,14 @@ namespace webdav_ucp
const ::rtl::OUString & inHostName,
::rtl::OUString & inoutUserName,
::rtl::OUString & outPassWord,
- const sal_Bool & bAllowPersistentStoring);
+ sal_Bool bAllowPersistentStoring,
+ sal_Bool bCanUseSystemCredentials );
private:
- com::sun::star::uno::Reference<
+ const com::sun::star::uno::Reference<
com::sun::star::ucb::XCommandEnvironment > m_xEnv;
+ const rtl::OUString m_aURL;
+
rtl::OUString m_aPrevPassword;
rtl::OUString m_aPrevUsername;
};
diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
index 0def59082476..67f8e5a386f0 100644
--- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx
+++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
@@ -60,7 +60,8 @@ int DAVAuthListener_Impl::authenticate(
const ::rtl::OUString & inHostName,
::rtl::OUString & inoutUserName,
::rtl::OUString & outPassWord,
- const sal_Bool & bAllowPersistentStoring)
+ sal_Bool bAllowPersistentStoring,
+ sal_Bool bCanUseSystemCredentials )
{
if ( m_xEnv.is() )
{
@@ -77,12 +78,14 @@ int DAVAuthListener_Impl::authenticate(
outPassWord = m_aPrevPassword;
rtl::Reference< ucbhelper::SimpleAuthenticationRequest > xRequest
- = new ucbhelper::SimpleAuthenticationRequest( inHostName,
+ = new ucbhelper::SimpleAuthenticationRequest( m_aURL,
+ inHostName,
inRealm,
inoutUserName,
outPassWord,
::rtl::OUString(),
- bAllowPersistentStoring);
+ bAllowPersistentStoring,
+ bCanUseSystemCredentials );
xIH->handle( xRequest.get() );
rtl::Reference< ucbhelper::InteractionContinuation > xSelection
@@ -99,8 +102,23 @@ int DAVAuthListener_Impl::authenticate(
ucbhelper::InteractionSupplyAuthentication > & xSupp
= xRequest->getAuthenticationSupplier();
- inoutUserName = xSupp->getUserName();
- outPassWord = xSupp->getPassword();
+ sal_Bool bUseSystemCredentials = sal_False;
+
+ if ( bCanUseSystemCredentials )
+ bUseSystemCredentials = xSupp->getUseSystemCredentials();
+
+ if ( bUseSystemCredentials )
+ {
+ // This is the (strange) way to tell neon to use
+ // system credentials.
+ inoutUserName = rtl::OUString();
+ outPassWord = rtl::OUString();
+ }
+ else
+ {
+ inoutUserName = xSupp->getUserName();
+ outPassWord = xSupp->getPassword();
+ }
// #102871# - Remember username and password.
m_aPrevUsername = inoutUserName;
@@ -186,7 +204,7 @@ void DAVResourceAccess::OPTIONS(
rCapabilities,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv) );
}
catch ( DAVException & e )
@@ -231,7 +249,7 @@ void DAVResourceAccess::PROPFIND(
rResources,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -273,7 +291,7 @@ void DAVResourceAccess::PROPFIND(
rResInfo,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) ) ;
}
catch ( DAVException & e )
@@ -313,7 +331,7 @@ void DAVResourceAccess::PROPPATCH(
rValues,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -353,7 +371,7 @@ void DAVResourceAccess::HEAD(
rResource,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -391,7 +409,7 @@ uno::Reference< io::XInputStream > DAVResourceAccess::GET(
xStream = m_xSession->GET( getRequestURI(),
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -432,7 +450,7 @@ void DAVResourceAccess::GET(
rStream,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -474,7 +492,7 @@ uno::Reference< io::XInputStream > DAVResourceAccess::GET(
rResource,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -519,7 +537,7 @@ void DAVResourceAccess::GET(
rResource,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -601,7 +619,7 @@ void DAVResourceAccess::PUT(
xSeekableStream,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -655,7 +673,7 @@ uno::Reference< io::XInputStream > DAVResourceAccess::POST(
xSeekableStream,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -719,7 +737,7 @@ void DAVResourceAccess::POST(
rOutputStream,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -762,7 +780,7 @@ void DAVResourceAccess::MKCOL(
m_xSession->MKCOL( getRequestURI(),
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -802,7 +820,7 @@ void DAVResourceAccess::COPY(
rDestinationURI,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ),
bOverwrite );
}
@@ -843,7 +861,7 @@ void DAVResourceAccess::MOVE(
rDestinationURI,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ),
bOverwrite );
}
@@ -882,7 +900,7 @@ void DAVResourceAccess::DESTROY(
m_xSession->DESTROY( getRequestURI(),
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx
index 4ceeef476d66..b455ffebbb9b 100644
--- a/ucb/source/ucp/webdav/NeonSession.cxx
+++ b/ucb/source/ucp/webdav/NeonSession.cxx
@@ -32,6 +32,7 @@
#include "precompiled_ucb.hxx"
#include <hash_map>
+#include <vector>
#include <string.h>
#include <rtl/string.h>
#include <ne_socket.h>
@@ -40,7 +41,10 @@
#include <ne_locks.h>
#include <ne_ssl.h>
#include "libxml/parser.h"
-#include <rtl/ustrbuf.hxx>
+#include "rtl/ustrbuf.hxx"
+#include "comphelper/sequence.hxx"
+#include "ucbhelper/simplecertificatevalidationrequest.hxx"
+
#include "DAVAuthListener.hxx"
#include "NeonTypes.hxx"
#include "NeonSession.hxx"
@@ -48,12 +52,9 @@
#include "NeonPropFindRequest.hxx"
#include "NeonHeadRequest.hxx"
#include "NeonUri.hxx"
-#ifndef _LINKSEQUENCE_HXX_
#include "LinkSequence.hxx"
-#endif
-
-#include <com/sun/star/xml/crypto/XSEInitializer.hpp>
#include "UCBDeadPropertyValue.hxx"
+
#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
#include <com/sun/star/security/XCertificate.hpp>
#include <com/sun/star/security/CertificateValidity.hpp>
@@ -61,18 +62,10 @@
#include <com/sun/star/security/CertificateContainer.hpp>
#include <com/sun/star/security/XCertificateContainer.hpp>
#include <com/sun/star/task/XMasterPasswordHandling.hpp>
-
-
-#ifndef _SIMPLECERTIFICATIONVALIDATIONREQUEST_HXX_
-#include "ucbhelper/simplecertificatevalidationrequest.hxx"
-#endif
-
-#include <cppuhelper/bootstrap.hxx>
-
+#include <com/sun/star/xml/crypto/XSEInitializer.hpp>
using namespace com::sun::star;
using namespace webdav_ucp;
-using namespace com::sun::star::security;
#define SEINITIALIZER_COMPONENT "com.sun.star.xml.crypto.SEInitializer"
@@ -255,6 +248,9 @@ extern "C" void NeonSession_ResponseBlockWriter( void * inUserData,
// -------------------------------------------------------------------
extern "C" int NeonSession_NeonAuth( void * inUserData,
+#ifdef NE_FEATURE_SSPI
+ const char * inAuthProtocol,
+#endif
const char * inRealm,
int attempt,
char * inoutUserName,
@@ -271,8 +267,6 @@ extern "C" int NeonSession_NeonAuth( void * inUserData,
* cancel the request. (if non-zero, username and password are
* ignored.) */
-
-
#if 0
// Give'em only a limited mumber of retries..
if ( attempt > 9 )
@@ -330,18 +324,41 @@ extern "C" int NeonSession_NeonAuth( void * inUserData,
//thePassWord = rtl::OUString::createFromAscii( inoutPassWord );
}
- //i97003 (tkr): Ask XMasterPasswordHandling if we should store the credentials persistently and give this information to the SimpleAuthenticationRequest
- uno::Reference< ::com::sun::star::task::XMasterPasswordHandling > xMasterPasswordHandling =
- uno::Reference< ::com::sun::star::task::XMasterPasswordHandling >(
- theSession->getMSF().get()->createInstance( rtl::OUString::createFromAscii( "com.sun.star.task.PasswordContainer" )), uno::UNO_QUERY );
- // -
+ bool bCanUseSystemCreds = false;
+
+#ifdef NE_FEATURE_SSPI
+ bCanUseSystemCreds = (attempt == 0) && // avoid endless loops
+ ne_has_support( NE_FEATURE_SSPI ) && // Windows-only feature.
+ ( ne_strcasecmp( inAuthProtocol, "NTLM" ) == 0 ) ||
+ ( 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);
+ xMasterPasswordHandling.is()
+ ? xMasterPasswordHandling->
+ isPersistentStoringAllowed()
+ : sal_False,
+ bCanUseSystemCreds);
rtl::OString aUser(
rtl::OUStringToOString( theUserName, RTL_TEXTENCODING_UTF8 ) );
@@ -368,7 +385,6 @@ extern "C" int NeonSession_NeonAuth( void * inUserData,
rtl::OUStringToOString( thePassWord, RTL_TEXTENCODING_UTF8 ) );
return theRetVal;
-
}
// -------------------------------------------------------------------
@@ -378,101 +394,144 @@ namespace {
// Helper function
::rtl::OUString GetHostnamePart( const ::rtl::OUString& _rRawString )
{
- ::rtl::OUString sPart;
- ::rtl::OUString sPartId = ::rtl::OUString::createFromAscii( "CN=" );
- sal_Int32 nContStart = _rRawString.indexOf( sPartId );
- if ( nContStart != -1 )
- {
- nContStart = nContStart + sPartId.getLength();
- sal_Int32 nContEnd = _rRawString.indexOf( sal_Unicode( ',' ), nContStart );
- sPart = _rRawString.copy( nContStart, nContEnd - nContStart );
- }
- return sPart;
+ ::rtl::OUString sPart;
+ ::rtl::OUString sPartId = ::rtl::OUString::createFromAscii( "CN=" );
+ sal_Int32 nContStart = _rRawString.indexOf( sPartId );
+ if ( nContStart != -1 )
+ {
+ nContStart = nContStart + sPartId.getLength();
+ sal_Int32 nContEnd
+ = _rRawString.indexOf( sal_Unicode( ',' ), nContStart );
+ sPart = _rRawString.copy( nContStart, nContEnd - nContStart );
+ }
+ return sPart;
}
}
+
// -------------------------------------------------------------------
extern "C" int NeonSession_CertificationNotify( void *userdata,
int failures,
const ne_ssl_certificate *cert )
{
- NeonSession * pSession = static_cast< NeonSession * >( userdata );
- uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecurityEnv;
- uno::Reference< ::com::sun::star::security::XCertificateContainer > xCertificateContainer;
+ OSL_ASSERT( cert );
+ NeonSession * pSession = static_cast< NeonSession * >( userdata );
+ uno::Reference< security::XCertificateContainer > xCertificateContainer;
+ try
+ {
+ xCertificateContainer
+ = uno::Reference< security::XCertificateContainer >(
+ pSession->getMSF()->createInstance(
+ rtl::OUString::createFromAscii(
+ "com.sun.star.security.CertificateContainer" ) ),
+ uno::UNO_QUERY );
+ }
+ catch ( uno::Exception const & )
+ {
+ }
- xCertificateContainer = uno::Reference< ::com::sun::star::security::XCertificateContainer >(
- pSession->getMSF().get()->createInstance( rtl::OUString::createFromAscii( "com.sun.star.security.CertificateContainer" )), uno::UNO_QUERY );
-
- // YD if xmlsecurity is not built (os2), we cannot continue.
- if (!xCertificateContainer.is())
+ if ( !xCertificateContainer.is() )
return 1;
- char * dn;
-
failures = 0;
- dn = ne_ssl_readable_dname( ne_ssl_cert_subject( cert ) );
-
+ char * dn = ne_ssl_readable_dname( ne_ssl_cert_subject( cert ) );
rtl::OUString cert_subject( dn, strlen( dn ), RTL_TEXTENCODING_UTF8, 0 );
free( dn );
- CertificateContainerStatus certificateContainer;
- certificateContainer = xCertificateContainer.get()->hasCertificate( pSession->getHostName(), cert_subject );
+ security::CertificateContainerStatus certificateContainer(
+ xCertificateContainer->hasCertificate(
+ pSession->getHostName(), cert_subject ) );
- if( certificateContainer != CertificateContainerStatus_NOCERT )
+ if ( certificateContainer != security::CertificateContainerStatus_NOCERT )
+ return
+ certificateContainer == security::CertificateContainerStatus_TRUSTED
+ ? 0
+ : 1;
+
+ uno::Reference< xml::crypto::XSEInitializer > xSEInitializer;
+ try
+ {
+ xSEInitializer = uno::Reference< xml::crypto::XSEInitializer >(
+ pSession->getMSF()->createInstance(
+ rtl::OUString::createFromAscii( SEINITIALIZER_COMPONENT ) ),
+ uno::UNO_QUERY );
+ }
+ catch ( uno::Exception const & )
{
- if( certificateContainer == CertificateContainerStatus_TRUSTED )
- return 0;
- else
- return 1;
}
- rtl::OUString sSEInitializer;
- ::com::sun::star::uno::Reference< com::sun::star::xml::crypto::XSEInitializer > mxSEInitializer;
- ::com::sun::star::uno::Reference< com::sun::star::xml::crypto::XXMLSecurityContext > mxSecurityContext;
-
- sSEInitializer = rtl::OUString::createFromAscii( SEINITIALIZER_COMPONENT );
- mxSEInitializer = uno::Reference< com::sun::star::xml::crypto::XSEInitializer > (
- pSession->getMSF().get()->createInstance( sSEInitializer ), uno::UNO_QUERY );
-
- if ( mxSEInitializer.is() )
- mxSecurityContext = mxSEInitializer->createSecurityContext( rtl::OUString::createFromAscii( "" ) );
+ if ( !xSEInitializer.is() )
+ return 1;
- xSecurityEnv = mxSecurityContext->getSecurityEnvironment();
+ uno::Reference< xml::crypto::XXMLSecurityContext > xSecurityContext(
+ xSEInitializer->createSecurityContext( rtl::OUString() ) );
+ uno::Reference< xml::crypto::XSecurityEnvironment > xSecurityEnv(
+ xSecurityContext->getSecurityEnvironment() );
- char * rawCert;
+ //The end entity certificate
+ char * eeCertB64 = ne_ssl_cert_export( cert );
- rawCert = ne_ssl_cert_export( cert );
+ rtl::OString sEECertB64( eeCertB64 );
- ::rtl::OString sRawCert( rawCert );
+ uno::Reference< com::sun::star::security::XCertificate > xEECert(
+ xSecurityEnv->createCertificateFromAscii(
+ rtl::OStringToOUString( sEECertB64, RTL_TEXTENCODING_ASCII_US ) ) );
- uno::Reference< com::sun::star::security::XCertificate> xCert = xSecurityEnv->createCertificateFromAscii( ::rtl::OStringToOUString( sRawCert, RTL_TEXTENCODING_ASCII_US ) );
+ ne_free( eeCertB64 );
+ eeCertB64 = 0;
- sal_Int64 certValidity = xSecurityEnv->verifyCertificate( xCert );
+ std::vector< uno::Reference< security::XCertificate > > vecCerts;
+ const ne_ssl_certificate * issuerCert = cert;
+ do
+ {
+ //get the intermediate certificate
+ //the returned value is const ! Therfore it does not need to be freed
+ //with ne_ssl_cert_free, which takes a non-const argument
+ issuerCert = ne_ssl_cert_signedby( issuerCert );
+ if ( NULL == issuerCert )
+ break;
+
+ char * imCertB64 = ne_ssl_cert_export( issuerCert );
+ rtl::OString sInterMediateCertB64( imCertB64 );
+ ne_free( imCertB64 );
+
+ uno::Reference< security::XCertificate> xImCert(
+ xSecurityEnv->createCertificateFromAscii(
+ rtl::OStringToOUString(
+ sInterMediateCertB64, RTL_TEXTENCODING_ASCII_US ) ) );
+ if ( xImCert.is() )
+ vecCerts.push_back( xImCert );
+ }
+ while ( 1 );
+ sal_Int64 certValidity = xSecurityEnv->verifyCertificate( xEECert,
+ ::comphelper::containerToSequence( vecCerts ) );
- if ( pSession->isDomainMatch( GetHostnamePart( xCert.get()->getSubjectName())) )
+ if ( pSession->isDomainMatch(
+ GetHostnamePart( xEECert.get()->getSubjectName() ) ) )
{
- //if host name matched with certificate then look if the certificate was ok
- if( certValidity == ::security::CertificateValidity::VALID )
+ // if host name matched with certificate then look if the
+ // certificate was ok
+ if( certValidity == security::CertificateValidity::VALID )
return 0;
}
- const uno::Reference< ucb::XCommandEnvironment > xEnv =
- pSession->getRequestEnvironment().m_xEnv.get();
-
+ const uno::Reference< ucb::XCommandEnvironment > xEnv(
+ pSession->getRequestEnvironment().m_xEnv );
if ( xEnv.is() )
{
- failures = static_cast<int>(certValidity);
+ failures = static_cast< int >( certValidity );
- uno::Reference< task::XInteractionHandler > xIH
- = xEnv->getInteractionHandler();
+ uno::Reference< task::XInteractionHandler > xIH(
+ xEnv->getInteractionHandler() );
if ( xIH.is() )
{
- rtl::Reference< ucbhelper::SimpleCertificateValidationRequest > xRequest
- = new ucbhelper::SimpleCertificateValidationRequest((sal_Int32)failures, xCert, pSession->getHostName() );
+ rtl::Reference< ucbhelper::SimpleCertificateValidationRequest >
+ xRequest( new ucbhelper::SimpleCertificateValidationRequest(
+ (sal_Int32)failures, xEECert, pSession->getHostName() ) );
xIH->handle( xRequest.get() );
rtl::Reference< ucbhelper::InteractionContinuation > xSelection
@@ -480,31 +539,34 @@ extern "C" int NeonSession_CertificationNotify( void *userdata,
if ( xSelection.is() )
{
- uno::Reference< task::XInteractionApprove > xApprove(
+ uno::Reference< task::XInteractionApprove > xApprove(
xSelection.get(), uno::UNO_QUERY );
- if ( xApprove.is() )
+ if ( xApprove.is() )
{
- xCertificateContainer->addCertificate(pSession->getHostName(), cert_subject, sal_True );
+ xCertificateContainer->addCertificate(
+ pSession->getHostName(), cert_subject, sal_True );
return 0;
- } else {
- // Dont trust Cert
- xCertificateContainer->addCertificate(pSession->getHostName(), cert_subject, sal_False );
+ }
+ else
+ {
+ // Don't trust cert
+ xCertificateContainer->addCertificate(
+ pSession->getHostName(), cert_subject, sal_False );
return 1;
}
-
}
- } else
+ }
+ else
{
- // Dont trust Cert
- xCertificateContainer->addCertificate(pSession->getHostName(), cert_subject, sal_False );
+ // Don't trust cert
+ xCertificateContainer->addCertificate(
+ pSession->getHostName(), cert_subject, sal_False );
return 1;
}
-
-
}
-
return 1;
}
+
// -------------------------------------------------------------------
extern "C" void NeonSession_PreSendRequest( ne_request * req,
void * userdata,
@@ -574,9 +636,10 @@ extern "C" void NeonSession_PreSendRequest( ne_request * req,
++it1;
}
- }
}
+} // namespace
+
// -------------------------------------------------------------------
// Constructor
// -------------------------------------------------------------------
@@ -725,7 +788,6 @@ void NeonSession::Init()
// ne_buffer *header);
ne_hook_pre_send( m_pHttpSession, NeonSession_PreSendRequest, this );
-
#if 0
/* Hook called after the request is sent. May return:
* NE_OK everything is okay
@@ -772,15 +834,8 @@ void NeonSession::Init()
ne_redirect_register( m_pHttpSession );
// authentication callbacks.
-
- // Note: Calling ne_set_[server|proxy]_auth more than once per
- // m_pHttpSession instance sometimes(?) crashes Neon! ( last
- // checked: 0.22.0)
- //ne_set_server_auth( m_pHttpSession, NeonSession_NeonAuth, this );
ne_add_server_auth( m_pHttpSession, NE_AUTH_ALL, NeonSession_NeonAuth, this );
- //ne_set_proxy_auth ( m_pHttpSession, NeonSession_NeonAuth, this );
ne_add_proxy_auth ( m_pHttpSession, NE_AUTH_ALL, NeonSession_NeonAuth, this );
-
}
}
diff --git a/ucb/source/ucp/webdav/makefile.mk b/ucb/source/ucp/webdav/makefile.mk
index 496b33b82220..c8891723cd2c 100644
--- a/ucb/source/ucp/webdav/makefile.mk
+++ b/ucb/source/ucp/webdav/makefile.mk
@@ -50,6 +50,7 @@ NO_BSYMBOLIC=TRUE
# --- Settings ---------------------------------------------------------
.INCLUDE: settings.mk
+.IF "$(L10N_framework)"==""
.IF "$(DISABLE_NEON)" == "TRUE"
@@ -160,6 +161,7 @@ DEF1NAME=$(SHL1TARGET)
.ENDIF #"$(DISABLE_NEON)" == "TRUE"
+.ENDIF # L10N_framework
# --- Targets ----------------------------------------------------------
.INCLUDE: target.mk
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index 62de20f87a74..996fd24e531d 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -68,6 +68,8 @@
#include "com/sun/star/task/ErrorCodeRequest.hpp"
#include "com/sun/star/task/MasterPasswordRequest.hpp"
#include "com/sun/star/task/NoMasterException.hpp"
+#include "com/sun/star/task/DocumentMacroConfirmationRequest.hpp"
+#include "com/sun/star/task/DocumentMacroConfirmationRequest2.hpp"
#include "com/sun/star/task/XInteractionAbort.hpp"
#include "com/sun/star/task/XInteractionApprove.hpp"
#include "com/sun/star/task/XInteractionDisapprove.hpp"
@@ -75,8 +77,10 @@
#include "com/sun/star/task/XInteractionRequest.hpp"
#include "com/sun/star/task/XInteractionRetry.hpp"
#include "com/sun/star/task/XPasswordContainer.hpp"
+#include "com/sun/star/task/XUrlContainer.hpp"
#include "com/sun/star/task/XInteractionAskLater.hpp"
#include "com/sun/star/ucb/AuthenticationRequest.hpp"
+#include "com/sun/star/ucb/URLAuthenticationRequest.hpp"
#include "com/sun/star/ucb/CertificateValidationRequest.hpp"
#include "com/sun/star/ucb/HandleCookiesRequest.hpp"
#include "com/sun/star/ucb/InteractiveAppException.hpp"
@@ -97,22 +101,24 @@
#include "com/sun/star/ucb/XInteractionCookieHandling.hpp"
#include "com/sun/star/ucb/XInteractionReplaceExistingData.hpp"
#include "com/sun/star/ucb/XInteractionSupplyAuthentication.hpp"
+#include "com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp"
#include "com/sun/star/ucb/XInteractionSupplyName.hpp"
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include "com/sun/star/uno/RuntimeException.hpp"
#include "com/sun/star/xforms/InvalidDataOnSubmitException.hpp"
#include <com/sun/star/security/CertificateValidity.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
#include "vos/mutex.hxx"
#include "tools/rcid.h"
#include "vcl/svapp.hxx"
#include "svtools/svtools.hrc"
-#include "svtools/loginerr.hxx"
#include "svtools/httpcook.hxx"
#include "svtools/sfxecode.hxx"
#include "toolkit/helper/vclunohelper.hxx"
#include "comphelper/sequenceashashmap.hxx"
+#include "comphelper/documentconstants.hxx"
#include "unotools/configmgr.hxx"
#include "ids.hrc"
@@ -131,6 +137,8 @@
#include "filechanged.hxx"
#include "trylater.hxx"
#include "lockfailed.hxx"
+#include "loginerr.hxx"
+
#include <comphelper/processfactory.hxx>
#include <svtools/zforlist.hxx>
using namespace com::sun;
@@ -198,6 +206,8 @@ getContinuations(
star::uno::Reference< star::task::XInteractionAbort > * pAbort,
star::uno::Reference< star::ucb::XInteractionSupplyAuthentication > *
pSupplyAuthentication,
+ star::uno::Reference< star::ucb::XInteractionSupplyAuthentication2 > *
+ pSupplyAuthentication2,
star::uno::Reference< star::task::XInteractionPassword > * pPassword,
star::uno::Reference< star::ucb::XInteractionSupplyName > *
pSupplyName,
@@ -244,7 +254,16 @@ getContinuations(
star::ucb::XInteractionSupplyAuthentication >(
rContinuations[i], star::uno::UNO_QUERY);
if (pSupplyAuthentication->is())
+ {
+ // is it even a supplyauthentication2, which is derived from
+ // supplyauthentication?
+ if (pSupplyAuthentication2 && !pSupplyAuthentication2->is())
+ *pSupplyAuthentication2
+ = star::uno::Reference<
+ star::ucb::XInteractionSupplyAuthentication2 >(
+ rContinuations[i], star::uno::UNO_QUERY);
continue;
+ }
}
if (pPassword && !pPassword->is())
{
@@ -438,10 +457,12 @@ public:
star::uno::Reference< star::task::XInteractionRequest > const &
rRequest)
: osl::Condition(),
- m_rRequest(rRequest)
+ m_rRequest(rRequest),
+ bHandled( false )
{
}
star::uno::Reference< star::task::XInteractionRequest > m_rRequest;
+ bool bHandled;
star::beans::Optional< rtl::OUString > m_aResult;
};
@@ -450,13 +471,13 @@ long UUIInteractionHelper::handlerequest(
{
HandleData* pHND = (HandleData*) pHandleData;
UUIInteractionHelper* pUUI = (UUIInteractionHelper*) pInteractionHelper;
- pUUI->handle_impl(pHND->m_rRequest);
+ pHND->bHandled = pUUI->handle_impl(pHND->m_rRequest);
pHND->set();
return 0;
}
-void
+bool
UUIInteractionHelper::handleRequest(
star::uno::Reference< star::task::XInteractionRequest > const & rRequest)
throw (star::uno::RuntimeException)
@@ -477,9 +498,10 @@ UUIInteractionHelper::handleRequest(
ULONG locks = Application::ReleaseSolarMutex();
aHD.wait();
Application::AcquireSolarMutex(locks);
+ return aHD.bHandled;
}
else
- handle_impl(rRequest);
+ return handle_impl(rRequest);
}
long UUIInteractionHelper::getstringfromrequest(
@@ -604,7 +626,7 @@ bool UUIInteractionHelper::handleMessageboxRequests(
star::task::XInteractionDisapprove > xDisapprove;
getContinuations(
rRequest->getContinuations(),
- &xApprove, &xDisapprove, 0, 0, 0, 0, 0, 0);
+ &xApprove, &xDisapprove, 0, 0, 0, 0, 0, 0, 0);
if( xApprove.is() && xDisapprove.is() )
{
@@ -1091,11 +1113,21 @@ bool UUIInteractionHelper::handleDialogRequests(
{
star::uno::Any aAnyRequest(rRequest->getRequest());
+ star::ucb::URLAuthenticationRequest aURLAuthenticationRequest;
+ if (aAnyRequest >>= aURLAuthenticationRequest)
+ {
+ handleAuthenticationRequest(aURLAuthenticationRequest,
+ rRequest->getContinuations(),
+ aURLAuthenticationRequest.URL);
+ return true;
+ }
+
star::ucb::AuthenticationRequest aAuthenticationRequest;
if (aAnyRequest >>= aAuthenticationRequest)
{
handleAuthenticationRequest(aAuthenticationRequest,
- rRequest->getContinuations());
+ rRequest->getContinuations(),
+ rtl::OUString());
return true;
}
@@ -1252,7 +1284,23 @@ bool UUIInteractionHelper::handleErrorHandlerRequests(
if (aAnyRequest >>= aMacroConfirmRequest)
{
handleMacroConfirmRequest(
- aMacroConfirmRequest,
+ aMacroConfirmRequest.DocumentURL,
+ aMacroConfirmRequest.DocumentStorage,
+ ODFVER_012_TEXT,
+ aMacroConfirmRequest.DocumentSignatureInformation,
+ rRequest->getContinuations()
+ );
+ return true;
+ }
+
+ star::task::DocumentMacroConfirmationRequest2 aMacroConfirmRequest2;
+ if (aAnyRequest >>= aMacroConfirmRequest2)
+ {
+ handleMacroConfirmRequest(
+ aMacroConfirmRequest2.DocumentURL,
+ aMacroConfirmRequest2.DocumentZipStorage,
+ aMacroConfirmRequest2.DocumentVersion,
+ aMacroConfirmRequest2.DocumentSignatureInformation,
rRequest->getContinuations()
);
return true;
@@ -1282,7 +1330,7 @@ bool UUIInteractionHelper::handleErrorHandlerRequests(
return false;
}
-void
+bool
UUIInteractionHelper::handle_impl(
star::uno::Reference< star::task::XInteractionRequest > const & rRequest)
throw (star::uno::RuntimeException)
@@ -1290,7 +1338,7 @@ UUIInteractionHelper::handle_impl(
try
{
if (!rRequest.is())
- return;
+ return false;
////////////////////////////////////////////////////////////
// Display Messagebox
@@ -1323,14 +1371,34 @@ UUIInteractionHelper::handle_impl(
Reference< uno::XInterface > xIfc =
m_xServiceFactory->createInstance(aIt->ServiceName);
- Reference< com::sun::star::task::XInteractionHandler2 > xInteractionHandler =
- Reference< com::sun::star::task::XInteractionHandler2 >( xIfc, UNO_QUERY );
- OSL_ENSURE( xInteractionHandler.is(), "Custom Interactionhandler does not implement mandatory interface XInteractionHandler2!" );
+ Reference< com::sun::star::lang::XInitialization > xInitialization =
+ Reference< com::sun::star::lang::XInitialization >( xIfc, UNO_QUERY );
+
+ OSL_ENSURE( xInitialization.is(), "Custom Interactionhandler does not implement mandatory interface XInitialization!" );
+ if (xInitialization.is())
+ {
+ uno::Sequence< uno::Any > propertyValues(1);
+ beans::PropertyValue aProperty;
+
+ aProperty.Name = rtl::OUString::createFromAscii( "Parent" );
+ aProperty.Value <<= getParentXWindow();
+ propertyValues[ 0 ] <<= aProperty;
+
+ xInitialization->initialize(propertyValues);
+ }
+
+ Reference< task::XInteractionHandler2 >
+ xInteractionHandler( xIfc, UNO_QUERY );
+
+ OSL_ENSURE( xInteractionHandler.is(),
+ "Custom Interactionhandler does not implement "
+ "mandatory interface XInteractionHandler2!" );
if (xInteractionHandler.is())
if (xInteractionHandler->handleInteractionRequest(rRequest))
- break;
+ return true;
}
+ return false;
}
}
}
@@ -1341,6 +1409,7 @@ UUIInteractionHelper::handle_impl(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
star::uno::Reference< star::uno::XInterface >());
}
+ return true;
}
void UUIInteractionHelper::GetInteractionHandlerList(InteractionHandlerDataList &rdataList)
@@ -1452,6 +1521,15 @@ void UUIInteractionHelper::GetInteractionHandlerList(InteractionHandlerDataList
Window * UUIInteractionHelper::getParentProperty() SAL_THROW(())
{
+ star::uno::Reference< star::awt::XWindow > xWindow = getParentXWindow();
+ if ( xWindow.is() )
+ return VCLUnoHelper::GetWindow(xWindow);
+
+ return 0;
+}
+
+star::uno::Reference< ::com::sun::star::awt::XWindow> UUIInteractionHelper::getParentXWindow() SAL_THROW(())
+{
osl::MutexGuard aGuard(m_aPropertyMutex);
for (sal_Int32 i = 0; i < m_aProperties.getLength(); ++i)
{
@@ -1462,7 +1540,7 @@ Window * UUIInteractionHelper::getParentProperty() SAL_THROW(())
{
star::uno::Reference< star::awt::XWindow > xWindow;
aProperty.Value >>= xWindow;
- return VCLUnoHelper::GetWindow(xWindow);
+ return xWindow;
}
}
return 0;
@@ -1488,7 +1566,8 @@ rtl::OUString UUIInteractionHelper::getContextProperty() SAL_THROW(())
bool
UUIInteractionHelper::initPasswordContainer(
- star::uno::Reference< star::task::XPasswordContainer > * pContainer)
+ star::uno::Reference< star::task::XPasswordContainer > * pContainer,
+ star::uno::Reference< star::task::XUrlContainer > * pUrlContainer)
const SAL_THROW(())
{
OSL_ENSURE(pContainer, "specification violation");
@@ -1503,11 +1582,17 @@ UUIInteractionHelper::initPasswordContainer(
RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.task.PasswordContainer"))),
star::uno::UNO_QUERY);
+
+ if ( pContainer->is() )
+ {
+ *pUrlContainer = star::uno::Reference< star::task::XUrlContainer >( *pContainer, UNO_QUERY );
+ OSL_ENSURE( pUrlContainer->is(), "Got no XUrlContainer!" );
+ }
}
catch (star::uno::Exception const &)
{}
OSL_ENSURE(pContainer->is(), "unexpected situation");
- return pContainer->is();
+ return pContainer->is() && pUrlContainer->is();
}
@@ -1686,6 +1771,7 @@ void UUIInteractionHelper::executeLoginDialog(LoginErrorInfo & rInfo,
!= 0;
bool bSavePassword = rInfo.GetIsPersistentPassword()
|| rInfo.GetIsSavePassword();
+ bool bCanUseSysCreds = rInfo.GetCanUseSystemCredentials();
sal_uInt16 nFlags = 0;
if (rInfo.GetPath().Len() == 0)
@@ -1700,6 +1786,9 @@ void UUIInteractionHelper::executeLoginDialog(LoginErrorInfo & rInfo,
if (!bSavePassword)
nFlags |= LF_NO_SAVEPASSWORD;
+ if (!bCanUseSysCreds)
+ nFlags |= LF_NO_USESYSCREDS;
+
std::auto_ptr< ResMgr >
xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
UniString aRealm(rRealm); // Forte compiler needs it spelled out...
@@ -1728,12 +1817,18 @@ void UUIInteractionHelper::executeLoginDialog(LoginErrorInfo & rInfo,
xDialog->SetSavePassword(rInfo.GetIsSavePassword());
}
+ if ( bCanUseSysCreds )
+ 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());
+
+ if ( bCanUseSysCreds )
+ rInfo.SetIsUseSystemCredentials( xDialog->IsUseSystemCredentials() );
}
catch (std::bad_alloc const &)
{
@@ -2095,12 +2190,87 @@ UUIInteractionHelper::getInteractionHandler() const
return xIH;
}
+namespace
+{
+bool fillContinuation(
+ bool bUseSystemCredentials,
+ const star::ucb::AuthenticationRequest & rRequest,
+ const star::task::UrlRecord & aRec,
+ const star::uno::Reference< star::ucb::XInteractionSupplyAuthentication > &
+ xSupplyAuthentication,
+ const star::uno::Reference< star::ucb::XInteractionSupplyAuthentication2 > &
+ xSupplyAuthentication2,
+ bool bCanUseSystemCredentials,
+ bool bCheckForEqualPasswords )
+{
+ if ( bUseSystemCredentials )
+ {
+ // "use system creds" record found.
+ // Wants client that we use it?
+ if ( xSupplyAuthentication2.is() &&
+ bCanUseSystemCredentials )
+ {
+ xSupplyAuthentication2->setUseSystemCredentials( sal_True );
+ return true;
+ }
+ return false;
+ }
+ else if (aRec.UserList.getLength() != 0)
+ {
+ if (aRec.UserList[0].Passwords.getLength() == 0)
+ {
+ // Password sequence can be empty, for instance if master
+ // password was not given (e.g. master pw dialog canceled)
+ // pw container does not throw NoMasterException in this case.
+ // bug???
+ return false;
+ }
+
+ // "user/pass" record found.
+ if (!bCheckForEqualPasswords || !rRequest.HasPassword
+ || rRequest.Password != aRec.UserList[0].Passwords[0]) // failed login attempt?
+ {
+ if (xSupplyAuthentication->canSetUserName())
+ xSupplyAuthentication->
+ setUserName(aRec.UserList[0].UserName.getStr());
+
+ if (xSupplyAuthentication->canSetPassword())
+ xSupplyAuthentication->
+ setPassword(aRec.UserList[0].Passwords[0].getStr());
+ if (aRec.UserList[0].Passwords.getLength() > 1)
+ {
+ if (rRequest.HasRealm)
+ {
+ if (xSupplyAuthentication->canSetRealm())
+ xSupplyAuthentication->
+ setRealm(aRec.UserList[0].Passwords[1].
+ getStr());
+ }
+ else if (xSupplyAuthentication->canSetAccount())
+ xSupplyAuthentication->
+ setAccount(aRec.UserList[0].Passwords[1].
+ getStr());
+ }
+
+ if ( xSupplyAuthentication2.is() &&
+ bCanUseSystemCredentials )
+ xSupplyAuthentication2->setUseSystemCredentials( sal_False );
+
+ return true;
+ }
+ }
+ return false;
+}
+
+}
+
void
UUIInteractionHelper::handleAuthenticationRequest(
star::ucb::AuthenticationRequest const & rRequest,
star::uno::Sequence< star::uno::Reference<
star::task::XInteractionContinuation > > const &
- rContinuations)
+ rContinuations,
+ const rtl::OUString & rURL)
SAL_THROW((star::uno::RuntimeException))
{
star::uno::Reference< star::task::XInteractionHandler > xIH;
@@ -2109,9 +2279,12 @@ UUIInteractionHelper::handleAuthenticationRequest(
star::uno::Reference< star::task::XInteractionAbort > xAbort;
star::uno::Reference< star::ucb::XInteractionSupplyAuthentication >
xSupplyAuthentication;
+ star::uno::Reference< star::ucb::XInteractionSupplyAuthentication2 >
+ xSupplyAuthentication2;
getContinuations(
rContinuations,
- 0, 0, &xRetry, &xAbort, &xSupplyAuthentication, 0, 0, 0 );
+ 0, 0, &xRetry, &xAbort,
+ &xSupplyAuthentication, &xSupplyAuthentication2, 0, 0, 0 );
bool bRemember;
bool bRememberPersistent;
if (xSupplyAuthentication.is())
@@ -2134,90 +2307,103 @@ UUIInteractionHelper::handleAuthenticationRequest(
bRememberPersistent = false;
}
+ sal_Bool bCanUseSystemCredentials;
+ sal_Bool bDefaultUseSystemCredentials;
+ if (xSupplyAuthentication2.is())
+ {
+ bCanUseSystemCredentials
+ = xSupplyAuthentication2->canUseSystemCredentials(
+ bDefaultUseSystemCredentials );
+ }
+ else
+ {
+ bCanUseSystemCredentials = sal_False;
+ bDefaultUseSystemCredentials = sal_False;
+ }
+
com::sun::star::uno::Reference< com::sun::star::task::XPasswordContainer >
xContainer;
+ com::sun::star::uno::Reference< com::sun::star::task::XUrlContainer >
+ xUrlContainer;
+
+ if ( bCanUseSystemCredentials && initPasswordContainer( &xContainer, &xUrlContainer ) )
+ {
+ // Runtime / Persistent info avail for current auth request?
+
+ rtl::OUString aResult = xUrlContainer->findUrl(
+ rURL.getLength() ? rURL : rRequest.ServerName );
+ if ( aResult.getLength() > 0 )
+ {
+ if ( fillContinuation( true,
+ rRequest,
+ star::task::UrlRecord(),
+ xSupplyAuthentication,
+ xSupplyAuthentication2,
+ bCanUseSystemCredentials,
+ false ) )
+ {
+ xSupplyAuthentication->select();
+ return;
+ }
+ }
+ }
// xContainer works with userName passwdSequences pairs:
if (rRequest.HasUserName
&& rRequest.HasPassword
- && initPasswordContainer(&xContainer))
+ && initPasswordContainer(&xContainer, &xUrlContainer))
{
xIH = getInteractionHandler();
try
{
if (rRequest.UserName.getLength() == 0)
{
- star::task::UrlRecord
- aRec(xContainer->find(rRequest.ServerName, xIH));
- if (aRec.UserList.getLength() != 0)
+ star::task::UrlRecord aRec;
+ if ( rURL.getLength() )
+ aRec = xContainer->find(rURL, xIH);
+
+ if ( aRec.UserList.getLength() == 0 )
+ {
+ // compat: try server name.
+ aRec = xContainer->find(rRequest.ServerName, xIH);
+ }
+
+ if ( fillContinuation( false,
+ rRequest,
+ aRec,
+ xSupplyAuthentication,
+ xSupplyAuthentication2,
+ bCanUseSystemCredentials,
+ false ) )
{
- if (xSupplyAuthentication->canSetUserName())
- xSupplyAuthentication->
- setUserName(aRec.UserList[0].UserName.getStr());
- if (xSupplyAuthentication->canSetPassword())
- {
- OSL_ENSURE(aRec.UserList[0].Passwords.getLength() != 0,
- "empty password list");
- xSupplyAuthentication->
- setPassword(
- aRec.UserList[0].Passwords[0].getStr());
- }
- if (aRec.UserList[0].Passwords.getLength() > 1)
- {
- if (rRequest.HasRealm)
- {
- if (xSupplyAuthentication->canSetRealm())
- xSupplyAuthentication->
- setRealm(aRec.UserList[0].Passwords[1].
- getStr());
- }
- else if (xSupplyAuthentication->canSetAccount())
- xSupplyAuthentication->
- setAccount(aRec.UserList[0].Passwords[1].
- getStr());
- }
xSupplyAuthentication->select();
return;
}
}
else
{
- star::task::UrlRecord
- aRec(xContainer->findForName(rRequest.ServerName,
- rRequest.UserName,
- xIH));
- if (aRec.UserList.getLength() != 0)
+ star::task::UrlRecord aRec;
+ if ( rURL.getLength() )
+ aRec = xContainer->findForName(
+ rURL, rRequest.UserName, xIH);
+
+ if ( aRec.UserList.getLength() == 0 )
{
- OSL_ENSURE(aRec.UserList[0].Passwords.getLength() != 0,
- "empty password list");
- if (!rRequest.HasPassword
- || rRequest.Password != aRec.UserList[0].Passwords[0])
- {
- if (xSupplyAuthentication->canSetUserName())
- xSupplyAuthentication->
- setUserName(
- aRec.UserList[0].UserName.getStr());
- if (xSupplyAuthentication->canSetPassword())
- xSupplyAuthentication->
- setPassword(aRec.UserList[0].Passwords[0].
- getStr());
- if (aRec.UserList[0].Passwords.getLength() > 1)
- {
- if (rRequest.HasRealm)
- {
- if (xSupplyAuthentication->canSetRealm())
- xSupplyAuthentication->
- setRealm(aRec.UserList[0].Passwords[1].
- getStr());
- }
- else if (xSupplyAuthentication->canSetAccount())
- xSupplyAuthentication->
- setAccount(aRec.UserList[0].Passwords[1].
- getStr());
- }
- xSupplyAuthentication->select();
- return;
- }
+ // compat: try server name.
+ aRec = xContainer->findForName(
+ rRequest.ServerName, rRequest.UserName, xIH);
+ }
+
+ if ( fillContinuation( false,
+ rRequest,
+ aRec,
+ xSupplyAuthentication,
+ xSupplyAuthentication2,
+ bCanUseSystemCredentials,
+ true ) )
+ {
+ xSupplyAuthentication->select();
+ return;
}
}
}
@@ -2237,6 +2423,8 @@ UUIInteractionHelper::handleAuthenticationRequest(
aInfo.SetErrorText(rRequest.Diagnostic);
aInfo.SetPersistentPassword(bRememberPersistent);
aInfo.SetSavePassword(bRemember);
+ aInfo.SetCanUseSystemCredentials( bCanUseSystemCredentials );
+ aInfo.SetIsUseSystemCredentials( bDefaultUseSystemCredentials );
aInfo.SetModifyAccount(rRequest.HasAccount
&& xSupplyAuthentication.is()
&& xSupplyAuthentication->canSetAccount());
@@ -2269,34 +2457,51 @@ UUIInteractionHelper::handleAuthenticationRequest(
else if (xSupplyAuthentication->canSetAccount())
xSupplyAuthentication->setAccount(aInfo.GetAccount());
+ if ( xSupplyAuthentication2.is() && bCanUseSystemCredentials )
+ xSupplyAuthentication2->setUseSystemCredentials(
+ aInfo.GetIsUseSystemCredentials() );
+
xSupplyAuthentication->select();
}
- // Empty user name can not be valid:
- if (aInfo.GetUserName().Len() != 0
- && initPasswordContainer(&xContainer))
+
+ if ( aInfo.GetIsUseSystemCredentials() )
+ {
+ if (aInfo.GetIsSavePassword())
+ {
+ if ( initPasswordContainer(&xContainer, &xUrlContainer) )
+ xUrlContainer->addUrl(
+ rURL.getLength() ? rURL : rRequest.ServerName,
+ bRememberPersistent );
+ }
+ }
+ else if (aInfo.GetUserName().Len() != 0 // Empty user name can not be valid:
+ && initPasswordContainer(&xContainer, &xUrlContainer))
{
- star::uno::Sequence< rtl::OUString >
- aPassList(aInfo.GetAccount().Len() == 0 ? 1 : 2);
- aPassList[0] = aInfo.GetPassword();
- if (aInfo.GetAccount().Len() != 0)
- aPassList[1] = aInfo.GetAccount();
try
{
if (aInfo.GetIsSavePassword())
{
+ star::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 (!xIH.is())
xIH = getInteractionHandler();
if (bRememberPersistent)
- xContainer->addPersistent(rRequest.ServerName,
- aInfo.GetUserName(),
- aPassList,
- xIH);
+ xContainer->addPersistent(
+ rURL.getLength() ? rURL : rRequest.ServerName,
+ aInfo.GetUserName(),
+ aPassList,
+ xIH);
else
- xContainer->add(rRequest.ServerName,
- aInfo.GetUserName(),
- aPassList,
- xIH);
+ xContainer->add(
+ rURL.getLength() ? rURL : rRequest.ServerName,
+ aInfo.GetUserName(),
+ aPassList,
+ xIH);
}
}
catch (star::task::NoMasterException const &)
@@ -2351,7 +2556,7 @@ UUIInteractionHelper::handleCertificateValidationRequest(
star::uno::Reference< star::task::XInteractionAbort > xAbort;
getContinuations(
- rContinuations, &xApprove, 0, 0, &xAbort, 0, 0, 0, 0);
+ rContinuations, &xApprove, 0, 0, &xAbort, 0, 0, 0, 0, 0);
sal_Int32 failures = rRequest.CertificateValidity;
@@ -2478,7 +2683,7 @@ UUIInteractionHelper::handleNameClashResolveRequest(
xReplaceExistingData;
getContinuations(
rContinuations,
- 0, 0, 0, &xAbort, 0, 0, &xSupplyName, &xReplaceExistingData);
+ 0, 0, 0, &xAbort, 0, 0, 0, &xSupplyName, &xReplaceExistingData);
OSL_ENSURE( xAbort.is(),
"NameClashResolveRequest must contain Abort continuation" );
@@ -2539,7 +2744,7 @@ UUIInteractionHelper::handleMasterPasswordRequest(
xSupplyAuthentication;
getContinuations(
rContinuations,
- 0, 0, &xRetry, &xAbort, &xSupplyAuthentication, 0, 0, 0);
+ 0, 0, &xRetry, &xAbort, &xSupplyAuthentication, 0, 0, 0, 0);
LoginErrorInfo aInfo;
// in case of master password a hash code is returned
@@ -2582,7 +2787,7 @@ UUIInteractionHelper::handlePasswordRequest(
star::uno::Reference< star::task::XInteractionPassword >
xPassword;
getContinuations(
- rContinuations, 0, 0, &xRetry, &xAbort, 0, &xPassword, 0, 0);
+ rContinuations, 0, 0, &xRetry, &xAbort, 0, 0, &xPassword, 0, 0);
LoginErrorInfo aInfo;
executePasswordDialog(aInfo, nMode, aDocumentName);
@@ -2623,7 +2828,7 @@ UUIInteractionHelper::handleMSPasswordRequest(
star::uno::Reference< star::task::XInteractionPassword >
xPassword;
getContinuations(
- rContinuations, 0, 0, &xRetry, &xAbort, 0, &xPassword, 0, 0);
+ rContinuations, 0, 0, &xRetry, &xAbort, 0, 0, &xPassword, 0, 0);
LoginErrorInfo aInfo;
executeMSPasswordDialog(aInfo, nMode, aDocumentName);
@@ -3039,13 +3244,13 @@ UUIInteractionHelper::handleGenericErrorRequest(
ErrCode nError = (ErrCode)nErrorCode;
sal_Bool bWarning = !ERRCODE_TOERROR(nError);
- if ( nError == ERRCODE_SFX_BROKENSIGNATURE )
+ if ( nError == ERRCODE_SFX_BROKENSIGNATURE
+ || nError == ERRCODE_SFX_INCOMPLETE_ENCRYPTION )
{
- // the broken signature warning needs a special title
+ // the security warning need a special title
String aErrorString;
ErrorHandler::GetErrorString( nErrorCode, aErrorString );
-
std::auto_ptr< ResMgr >
xManager( ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) );
::rtl::OUString aTitle;
@@ -3059,7 +3264,8 @@ UUIInteractionHelper::handleGenericErrorRequest(
} catch( star::uno::Exception& )
{}
- ::rtl::OUString aErrTitle = String( ResId( STR_WARNING_BROKENSIGNATURE_TITLE, *xManager.get() ) );
+ ::rtl::OUString aErrTitle = String( ResId( nError == ERRCODE_SFX_BROKENSIGNATURE ? STR_WARNING_BROKENSIGNATURE_TITLE : STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE, *xManager.get() ) );
+
if ( aTitle.getLength() && aErrTitle.getLength() )
aTitle += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " - " ) );
aTitle += aErrTitle;
@@ -3095,7 +3301,10 @@ namespace
void
UUIInteractionHelper::handleMacroConfirmRequest(
- const star::task::DocumentMacroConfirmationRequest& _rRequest,
+ const ::rtl::OUString& aDocumentURL,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xZipStorage,
+ const ::rtl::OUString& aDocumentVersion,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > aSignInfo,
star::uno::Sequence< star::uno::Reference<
star::task::XInteractionContinuation > > const & rContinuations
)
@@ -3109,17 +3318,17 @@ UUIInteractionHelper::handleMacroConfirmRequest(
std::auto_ptr< ResMgr > pResMgr( ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) );
if ( pResMgr.get() )
{
- bool bShowSignatures = _rRequest.DocumentSignatureInformation.getLength() > 0;
+ bool bShowSignatures = aSignInfo.getLength() > 0;
MacroWarning aWarning( getParentProperty(), bShowSignatures, *pResMgr.get() );
- aWarning.SetDocumentURL( _rRequest.DocumentURL );
- if ( _rRequest.DocumentSignatureInformation.getLength() > 1 )
+ aWarning.SetDocumentURL( aDocumentURL );
+ if ( aSignInfo.getLength() > 1 )
{
- aWarning.SetStorage( _rRequest.DocumentStorage, _rRequest.DocumentSignatureInformation );
+ aWarning.SetStorage( xZipStorage, aDocumentVersion, aSignInfo );
}
- else if ( _rRequest.DocumentSignatureInformation.getLength() == 1 )
+ else if ( aSignInfo.getLength() == 1 )
{
- aWarning.SetCertificate( _rRequest.DocumentSignatureInformation[ 0 ].Signer );
+ aWarning.SetCertificate( aSignInfo[ 0 ].Signer );
}
bApprove = aWarning.Execute() == RET_OK;
@@ -3380,7 +3589,7 @@ UUIInteractionHelper::handleErrorRequest(
star::uno::Reference< star::task::XInteractionAbort > xAbort;
getContinuations(
rContinuations,
- &xApprove, &xDisapprove, &xRetry, &xAbort, 0, 0, 0, 0);
+ &xApprove, &xDisapprove, &xRetry, &xAbort, 0, 0, 0, 0, 0);
// The following mapping uses the bit mask
// Approve = 8,
@@ -3498,7 +3707,7 @@ UUIInteractionHelper::handleBrokenPackageRequest(
star::uno::Reference< star::task::XInteractionDisapprove > xDisapprove;
star::uno::Reference< star::task::XInteractionAbort > xAbort;
getContinuations(
- rContinuations, &xApprove, &xDisapprove, 0, &xAbort, 0, 0, 0, 0);
+ rContinuations, &xApprove, &xDisapprove, 0, &xAbort, 0, 0, 0, 0, 0);
ErrCode nErrorCode;
if( xApprove.is() && xDisapprove.is() )
@@ -3603,7 +3812,7 @@ UUIInteractionHelper::handleLockedDocumentRequest(
star::uno::Reference< star::task::XInteractionDisapprove > xDisapprove;
star::uno::Reference< star::task::XInteractionAbort > xAbort;
getContinuations(
- rContinuations, &xApprove, &xDisapprove, 0, &xAbort, 0, 0, 0, 0);
+ rContinuations, &xApprove, &xDisapprove, 0, &xAbort, 0, 0, 0, 0, 0);
if ( !xApprove.is() || !xDisapprove.is() || !xAbort.is() )
return;
@@ -3681,7 +3890,7 @@ UUIInteractionHelper::handleChangedByOthersRequest(
star::uno::Reference< star::task::XInteractionApprove > xApprove;
star::uno::Reference< star::task::XInteractionAbort > xAbort;
getContinuations(
- rContinuations, &xApprove, 0, 0, &xAbort, 0, 0, 0, 0);
+ rContinuations, &xApprove, 0, 0, &xAbort, 0, 0, 0, 0, 0);
if ( !xApprove.is() || !xAbort.is() )
return;
@@ -3721,7 +3930,7 @@ UUIInteractionHelper::handleLockFileIgnoreRequest(
star::uno::Reference< star::task::XInteractionApprove > xApprove;
star::uno::Reference< star::task::XInteractionAbort > xAbort;
getContinuations(
- rContinuations, &xApprove, 0, 0, &xAbort, 0, 0, 0, 0);
+ rContinuations, &xApprove, 0, 0, &xAbort, 0, 0, 0, 0, 0);
if ( !xApprove.is() || !xAbort.is() )
return;
diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx
index 4053f919bf7b..bea53e436c6d 100644
--- a/uui/source/iahndl.hxx
+++ b/uui/source/iahndl.hxx
@@ -36,13 +36,15 @@
#define INCLUDED_VECTOR
#endif
#include "osl/mutex.hxx"
-#include "com/sun/star/beans/Optional.hpp"
#include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/Sequence.hxx"
+
+#include "com/sun/star/beans/Optional.hpp"
+#include "com/sun/star/embed/XStorage.hpp"
#include "com/sun/star/task/InteractionClassification.hpp"
#include "com/sun/star/task/PasswordRequestMode.hpp"
-#include "com/sun/star/task/DocumentMacroConfirmationRequest.hpp"
#include "com/sun/star/task/FutureDocumentVersionProductUpdateRequest.hpp"
+#include "com/sun/star/security/DocumentSignatureInformation.hpp"
#include "tools/solar.h"
#include "tools/errcode.hxx"
#include "vcl/wintypes.hxx"
@@ -98,6 +100,7 @@ namespace com { namespace sun { namespace star {
class XInteractionHandler;
class XInteractionRequest;
class XPasswordContainer;
+ class XUrlContainer;
}
namespace ucb {
class AuthenticationRequest;
@@ -136,7 +139,7 @@ public:
~UUIInteractionHelper() SAL_THROW(());
- void
+ bool
handleRequest(com::sun::star::uno::Reference<
com::sun::star::task::XInteractionRequest > const &
rRequest)
@@ -149,7 +152,7 @@ public:
throw (com::sun::star::uno::RuntimeException);
private:
- void
+ bool
handle_impl(com::sun::star::uno::Reference<
com::sun::star::task::XInteractionRequest > const &
rRequest)
@@ -174,12 +177,17 @@ private:
Window * getParentProperty() SAL_THROW(());
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> getParentXWindow() SAL_THROW(());
+
rtl::OUString getContextProperty() SAL_THROW(());
bool
initPasswordContainer(com::sun::star::uno::Reference<
com::sun::star::task::XPasswordContainer > *
- pContainer)
+ pContainer,
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XUrlContainer > *
+ pUrlContainer)
const SAL_THROW(());
com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler >
@@ -246,7 +254,8 @@ private:
com::sun::star::uno::Sequence<
com::sun::star::uno::Reference<
com::sun::star::task::XInteractionContinuation > > const &
- rContinuations)
+ rContinuations,
+ rtl::OUString const & rURL)
SAL_THROW((com::sun::star::uno::RuntimeException));
void
@@ -360,7 +369,10 @@ private:
void
handleMacroConfirmRequest(
- const ::com::sun::star::task::DocumentMacroConfirmationRequest& _rRequest,
+ const ::rtl::OUString& aDocumentURL,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xZipStorage,
+ const ::rtl::OUString& aDocumentVersion,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > aSignInfo,
com::sun::star::uno::Sequence<
com::sun::star::uno::Reference<
com::sun::star::task::XInteractionContinuation > > const &
diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc
index bfe6a48aed94..08624a3dda4e 100644
--- a/uui/source/ids.hrc
+++ b/uui/source/ids.hrc
@@ -87,7 +87,8 @@
#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 + 36)
+#define RID_DLG_NEWER_VERSION_WARNING (RID_UUI_START + 53)
+#define STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE (RID_UUI_START + 54)
#define ERRCODE_UUI_IO_ABORT (ERRCODE_AREA_UUI + 0)
#define ERRCODE_UUI_IO_ACCESSDENIED (ERRCODE_AREA_UUI + 1)
diff --git a/uui/source/ids.src b/uui/source/ids.src
index 3f0e422c1449..cb011f27a7c0 100644
--- a/uui/source/ids.src
+++ b/uui/source/ids.src
@@ -50,6 +50,11 @@ String( STR_WARNING_BROKENSIGNATURE_TITLE )
Text [ en-US ] = "Invalid Document Signature" ;
};
+String( STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE )
+{
+ Text [ en-US ] = "Non-Encrypted Streams" ;
+};
+
Resource RID_UUI_ERRHDL
{
String (ERRCODE_UUI_IO_ABORT & ERRCODE_RES_MASK)
@@ -313,7 +318,7 @@ Resource RID_UUI_ERRHDL
String (ERRCODE_UUI_IO_BROKENPACKAGE & ERRCODE_RES_MASK)
{
- Text [ en-US ] = "The file '$(ARG1)' is corrupt and therefore cannot be opened. Should %PRODUCTNAME repair the file?";
+ Text [ en-US ] = "The file '$(ARG1)' is corrupt and therefore cannot be opened. %PRODUCTNAME can try to repair the file.\n\nThe corruption could be the result of document manipulation or of structural document damage due to data transmission.\n\nWe recommend that you do not trust the content of the repaired document.\nExecution of macros is disabled for this document.\n\nShould %PRODUCTNAME repair the file?\n";
};
String (ERRCODE_UUI_IO_BROKENPACKAGE_CANTREPAIR & ERRCODE_RES_MASK)
diff --git a/uui/source/interactionhandler.cxx b/uui/source/interactionhandler.cxx
index 78336ac8be13..87b510964d8e 100644
--- a/uui/source/interactionhandler.cxx
+++ b/uui/source/interactionhandler.cxx
@@ -31,10 +31,10 @@
#include "iahndl.hxx"
#include "interactionhandler.hxx"
-using namespace com::sun;
+using namespace com::sun::star;
UUIInteractionHandler::UUIInteractionHandler(
- star::uno::Reference< star::lang::XMultiServiceFactory > const &
+ uno::Reference< lang::XMultiServiceFactory > const &
rServiceFactory)
SAL_THROW(())
: m_xServiceFactory(rServiceFactory),
@@ -48,16 +48,16 @@ UUIInteractionHandler::~UUIInteractionHandler()
}
rtl::OUString SAL_CALL UUIInteractionHandler::getImplementationName()
- throw (star::uno::RuntimeException)
+ throw (uno::RuntimeException)
{
return rtl::OUString::createFromAscii(m_aImplementationName);
}
sal_Bool SAL_CALL
UUIInteractionHandler::supportsService(rtl::OUString const & rServiceName)
- throw (star::uno::RuntimeException)
+ throw (uno::RuntimeException)
{
- star::uno::Sequence< rtl::OUString >
+ uno::Sequence< rtl::OUString >
aNames(getSupportedServiceNames_static());
for (sal_Int32 i = 0; i < aNames.getLength(); ++i)
if (aNames[i] == rServiceName)
@@ -65,17 +65,17 @@ UUIInteractionHandler::supportsService(rtl::OUString const & rServiceName)
return false;
}
-star::uno::Sequence< rtl::OUString > SAL_CALL
+uno::Sequence< rtl::OUString > SAL_CALL
UUIInteractionHandler::getSupportedServiceNames()
- throw (star::uno::RuntimeException)
+ throw (uno::RuntimeException)
{
return getSupportedServiceNames_static();
}
void SAL_CALL
UUIInteractionHandler::initialize(
- star::uno::Sequence< star::uno::Any > const & rArguments)
- throw (star::uno::Exception)
+ uno::Sequence< uno::Any > const & rArguments)
+ throw (uno::Exception)
{
delete m_pImpl;
m_pImpl = new UUIInteractionHelper(m_xServiceFactory, rArguments);
@@ -83,26 +83,40 @@ UUIInteractionHandler::initialize(
void SAL_CALL
UUIInteractionHandler::handle(
- star::uno::Reference< star::task::XInteractionRequest > const & rRequest)
- throw (star::uno::RuntimeException)
+ uno::Reference< task::XInteractionRequest > const & rRequest)
+ throw (uno::RuntimeException)
{
try
{
m_pImpl->handleRequest(rRequest);
}
- catch (star::uno::RuntimeException const & ex)
+ catch (uno::RuntimeException const & ex)
{
- throw star::uno::RuntimeException(ex.Message, *this);
+ throw uno::RuntimeException(ex.Message, *this);
}
}
+::sal_Bool SAL_CALL UUIInteractionHandler::handleInteractionRequest(
+ const uno::Reference< task::XInteractionRequest >& _Request ) throw ( uno::RuntimeException )
+{
+ try
+ {
+ return m_pImpl->handleRequest( _Request );
+ }
+ catch (uno::RuntimeException const & ex)
+ {
+ throw uno::RuntimeException( ex.Message, *this );
+ }
+ return sal_False;
+}
+
char const UUIInteractionHandler::m_aImplementationName[]
= "com.sun.star.comp.uui.UUIInteractionHandler";
-star::uno::Sequence< rtl::OUString >
+uno::Sequence< rtl::OUString >
UUIInteractionHandler::getSupportedServiceNames_static()
{
- star::uno::Sequence< rtl::OUString > aNames(3);
+ uno::Sequence< rtl::OUString > aNames(3);
aNames[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.task.InteractionHandler"));
// added to indicate support for configuration.backend.MergeRecoveryRequest
@@ -114,11 +128,11 @@ UUIInteractionHandler::getSupportedServiceNames_static()
return aNames;
}
-star::uno::Reference< star::uno::XInterface > SAL_CALL
+uno::Reference< uno::XInterface > SAL_CALL
UUIInteractionHandler::createInstance(
- star::uno::Reference< star::lang::XMultiServiceFactory > const &
+ uno::Reference< lang::XMultiServiceFactory > const &
rServiceFactory)
- SAL_THROW((star::uno::Exception))
+ SAL_THROW((uno::Exception))
{
try
{
@@ -126,7 +140,7 @@ UUIInteractionHandler::createInstance(
}
catch (std::bad_alloc const &)
{
- throw star::uno::RuntimeException(
+ throw uno::RuntimeException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
0);
}
diff --git a/uui/source/interactionhandler.hxx b/uui/source/interactionhandler.hxx
index 954271dd724e..5f3216f5d20b 100644
--- a/uui/source/interactionhandler.hxx
+++ b/uui/source/interactionhandler.hxx
@@ -33,7 +33,7 @@
#include "com/sun/star/lang/XInitialization.hpp"
#include "com/sun/star/lang/XServiceInfo.hpp"
-#include "com/sun/star/task/XInteractionHandler.hpp"
+#include "com/sun/star/task/XInteractionHandler2.hpp"
#include "cppuhelper/implbase3.hxx"
class UUIInteractionHelper;
@@ -41,7 +41,7 @@ class UUIInteractionHelper;
class UUIInteractionHandler:
public cppu::WeakImplHelper3< com::sun::star::lang::XServiceInfo,
com::sun::star::lang::XInitialization,
- com::sun::star::task::XInteractionHandler >
+ com::sun::star::task::XInteractionHandler2 >
{
public:
static char const m_aImplementationName[];
@@ -95,6 +95,10 @@ private:
rRequest)
throw (com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL
+ handleInteractionRequest(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& _Request
+ ) throw ( ::com::sun::star::uno::RuntimeException );
};
#endif // UUI_INTERACTIONHANDLER_HXX
diff --git a/uui/source/logindlg.cxx b/uui/source/logindlg.cxx
index 4d58e07e37da..195dcaaf2648 100644
--- a/uui/source/logindlg.cxx
+++ b/uui/source/logindlg.cxx
@@ -55,6 +55,7 @@ void LoginDialog::HideControls_Impl( USHORT nFlags )
FASTBOOL bPathHide = FALSE;
FASTBOOL bErrorHide = FALSE;
FASTBOOL bAccountHide = FALSE;
+ FASTBOOL bUseSysCredsHide = FALSE;
if ( ( nFlags & LF_NO_PATH ) == LF_NO_PATH )
{
@@ -104,6 +105,12 @@ void LoginDialog::HideControls_Impl( USHORT nFlags )
bAccountHide = TRUE;
}
+ if ( ( nFlags & LF_NO_USESYSCREDS ) == LF_NO_USESYSCREDS )
+ {
+ aUseSysCredsCB.Hide();
+ bUseSysCredsHide = TRUE;
+ }
+
if ( bErrorHide )
{
long nOffset = aLoginGB.GetPosPixel().Y() -
@@ -147,6 +154,9 @@ void LoginDialog::HideControls_Impl( USHORT nFlags )
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 );
@@ -174,6 +184,9 @@ void LoginDialog::HideControls_Impl( USHORT nFlags )
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 );
@@ -186,6 +199,19 @@ void LoginDialog::HideControls_Impl( USHORT nFlags )
Point aTmpPnt = aSavePasswdBtn.GetPosPixel();
aTmpPnt.Y() -= nOffset;
aSavePasswdBtn.SetPosPixel( aTmpPnt );
+ aTmpPnt = aUseSysCredsCB.GetPosPixel();
+ aTmpPnt.Y() -= nOffset;
+ aUseSysCredsCB.SetPosPixel( aTmpPnt );
+ Size aNewSz = GetSizePixel();
+ aNewSz.Height() -= nOffset;
+ SetSizePixel( aNewSz );
+ }
+
+ if ( bUseSysCredsHide )
+ {
+ long nOffset = aUseSysCredsCB.GetPosPixel().Y() -
+ aSavePasswdBtn.GetPosPixel().Y();
+
Size aNewSz = GetSizePixel();
aNewSz.Height() -= nOffset;
SetSizePixel( aNewSz );
@@ -193,6 +219,25 @@ void LoginDialog::HideControls_Impl( USHORT nFlags )
};
// -----------------------------------------------------------------------
+void LoginDialog::EnableUseSysCredsControls_Impl( BOOL bUseSysCredsEnabled )
+{
+ aErrorInfo.Enable( !bUseSysCredsEnabled );
+ aErrorGB.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 );
+ aAccountED.Enable( !bUseSysCredsEnabled );
+}
+
+// -----------------------------------------------------------------------
IMPL_LINK( LoginDialog, OKHdl_Impl, OKButton *, EMPTYARG )
{
@@ -221,6 +266,14 @@ IMPL_LINK( LoginDialog, PathHdl_Impl, PushButton *, EMPTYARG )
// -----------------------------------------------------------------------
+IMPL_LINK( LoginDialog, UseSysCredsHdl_Impl, CheckBox *, EMPTYARG )
+{
+ EnableUseSysCredsControls_Impl( aUseSysCredsCB.IsChecked() );
+ return 1;
+}
+
+// -----------------------------------------------------------------------
+
LoginDialog::LoginDialog
(
Window* pParent,
@@ -247,6 +300,7 @@ LoginDialog::LoginDialog
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 ) ),
aOKBtn ( this, ResId( BTN_LOGIN_OK, *pResMgr ) ),
aCancelBtn ( this, ResId( BTN_LOGIN_CANCEL, *pResMgr ) ),
@@ -261,6 +315,10 @@ LoginDialog::LoginDialog
}
else
aRequest = aRequestInfo.GetText();
+
+ if ( !( ( nFlags & LF_NO_USESYSCREDS ) == LF_NO_USESYSCREDS ) )
+ EnableUseSysCredsControls_Impl( aUseSysCredsCB.IsChecked() );
+
aRequest.SearchAndReplaceAscii("%1", rServer);
aRequestInfo.SetText(aRequest);
@@ -271,6 +329,7 @@ LoginDialog::LoginDialog
aOKBtn.SetClickHdl( LINK( this, LoginDialog, OKHdl_Impl ) );
aPathBtn.SetClickHdl( LINK( this, LoginDialog, PathHdl_Impl ) );
+ aUseSysCredsCB.SetClickHdl( LINK( this, LoginDialog, UseSysCredsHdl_Impl ) );
HideControls_Impl( nFlags );
};
@@ -285,6 +344,17 @@ void LoginDialog::SetName( const String& rNewName )
// -----------------------------------------------------------------------
+void LoginDialog::SetUseSystemCredentials( BOOL bUse )
+{
+ if ( aUseSysCredsCB.IsVisible() )
+ {
+ aUseSysCredsCB.Check( bUse );
+ EnableUseSysCredsControls_Impl( bUse );
+ }
+}
+
+// -----------------------------------------------------------------------
+
void LoginDialog::ClearPassword()
{
aPasswordED.SetText( String() );
diff --git a/uui/source/logindlg.hrc b/uui/source/logindlg.hrc
index 20b5a5c86d46..a9c1ff853d85 100644
--- a/uui/source/logindlg.hrc
+++ b/uui/source/logindlg.hrc
@@ -50,6 +50,7 @@
#define ED_LOGIN_ACCOUNT 31
#define CB_LOGIN_SAVEPASSWORD 32
#define GB_LOGIN_LOGIN 33
+#define CB_LOGIN_USESYSCREDS 34
#define BTN_LOGIN_OK 50
#define BTN_LOGIN_CANCEL 51
diff --git a/uui/source/logindlg.hxx b/uui/source/logindlg.hxx
index a6e92797d26f..c88bc7a93aad 100644
--- a/uui/source/logindlg.hxx
+++ b/uui/source/logindlg.hxx
@@ -48,6 +48,7 @@
#define LF_PATH_READONLY 0x0020 // "path" readonly
#define LF_USERNAME_READONLY 0x0040 // "name" readonly
#define LF_NO_ACCOUNT 0x0080 // hide "account"
+#define LF_NO_USESYSCREDS 0x0100 // hide "use system cedentials"
//............................................................................
//............................................................................
@@ -70,15 +71,18 @@ class LoginDialog : public ModalDialog
FixedText aAccountFT;
Edit aAccountED;
CheckBox aSavePasswdBtn;
+ CheckBox aUseSysCredsCB;
FixedLine aLoginGB;
OKButton aOKBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
void HideControls_Impl( USHORT nFlags );
+ void EnableUseSysCredsControls_Impl( BOOL bUseSysCredsEnabled );
DECL_LINK( OKHdl_Impl, OKButton * );
DECL_LINK( PathHdl_Impl, PushButton * );
+ DECL_LINK( UseSysCredsHdl_Impl, CheckBox * );
public:
LoginDialog( Window* pParent, USHORT nFlags,
@@ -103,6 +107,9 @@ public:
{ 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 )
diff --git a/uui/source/logindlg.src b/uui/source/logindlg.src
index 39b98ffea1a4..7450a389e7e5 100644
--- a/uui/source/logindlg.src
+++ b/uui/source/logindlg.src
@@ -45,7 +45,7 @@ ModalDialog DLG_UUI_LOGIN
Moveable = TRUE ;
OutputSize = TRUE ;
SVLook = TRUE ;
- Size = MAP_APPFONT ( 265 , 158 ) ;
+ Size = MAP_APPFONT ( 265 , 170 ) ;
FixedText INFO_LOGIN_ERROR
{
Pos = MAP_APPFONT ( 12 , 14 ) ;
@@ -139,6 +139,12 @@ ModalDialog DLG_UUI_LOGIN
Size = MAP_APPFONT ( 185 , 10 ) ;
Text [ en-US ] = "~Save password" ;
};
+ CheckBox CB_LOGIN_USESYSCREDS
+ {
+ Pos = MAP_APPFONT ( 12 , 148 ) ;
+ Size = MAP_APPFONT ( 185 , 10 ) ;
+ Text [ en-US ] = "~Use System Credentials" ;
+ };
FixedLine GB_LOGIN_LOGIN
{
Pos = MAP_APPFONT ( 7 , 44 ) ;
diff --git a/uui/source/loginerr.hxx b/uui/source/loginerr.hxx
new file mode 100644
index 000000000000..6fc00c3b1eac
--- /dev/null
+++ b/uui/source/loginerr.hxx
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * 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: loginerr.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 _LOGINERR_HXX
+#define _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
+
+class LoginErrorInfo
+{
+private:
+ String _aTitle;
+ String _aServer;
+ String _aAccount;
+ String _aUserName;
+ String _aPassword;
+ String _aPath;
+ String _aErrorText;
+ BYTE _nFlags;
+ USHORT _nRet;
+
+public:
+ LoginErrorInfo()
+ : _nFlags( LOGINERROR_FLAG_MODIFY_USER_NAME ),
+ _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 ); }
+ BOOL GetCanUseSystemCredentials() const
+ { return ( _nFlags & LOGINERROR_FLAG_CAN_USE_SYSCREDS ); }
+ BOOL GetIsUseSystemCredentials() const
+ { return ( _nFlags & LOGINERROR_FLAG_IS_USE_SYSCREDS ) ==
+ LOGINERROR_FLAG_IS_USE_SYSCREDS; }
+ BYTE GetFlags() const { return _nFlags; }
+ USHORT GetResult() const { return _nRet; }
+
+ void SetTitle( const String& aTitle )
+ { _aTitle = aTitle; }
+ void SetServer( const String& aServer )
+ { _aServer = aServer; }
+ void SetAccount( const String& aAccount )
+ { _aAccount = aAccount; }
+ void SetUserName( const String& aUserName )
+ { _aUserName = aUserName; }
+ void SetPassword( const String& aPassword )
+ { _aPassword = aPassword; }
+ void SetPath( const String& aPath )
+ { _aPath = aPath; }
+ void SetErrorText( const String& aErrorText )
+ { _aErrorText = aErrorText; }
+ void SetFlags( BYTE nFlags )
+ { _nFlags = nFlags; }
+ inline void SetSavePassword( BOOL bSet );
+ inline void SetPersistentPassword( 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; }
+};
+
+inline void LoginErrorInfo::SetSavePassword( BOOL bSet )
+{
+ if ( bSet )
+ _nFlags |= LOGINERROR_FLAG_SET_SAVE_PASSWORD;
+ else
+ _nFlags &= ~LOGINERROR_FLAG_SET_SAVE_PASSWORD;
+}
+
+inline void LoginErrorInfo::SetPersistentPassword( BOOL bSet )
+{
+ if ( bSet )
+ _nFlags |= LOGINERROR_FLAG_PERSISTENT_PASSWORD;
+ else
+ _nFlags &= ~LOGINERROR_FLAG_PERSISTENT_PASSWORD;
+}
+
+inline void LoginErrorInfo::SetCanUseSystemCredentials( BOOL bSet )
+{
+ if ( bSet )
+ _nFlags |= LOGINERROR_FLAG_CAN_USE_SYSCREDS;
+ else
+ _nFlags &= ~LOGINERROR_FLAG_CAN_USE_SYSCREDS;
+}
+
+inline void LoginErrorInfo::SetIsUseSystemCredentials( BOOL bSet )
+{
+ if ( bSet )
+ _nFlags |= LOGINERROR_FLAG_IS_USE_SYSCREDS;
+ else
+ _nFlags &= ~LOGINERROR_FLAG_IS_USE_SYSCREDS;
+}
+
+inline void LoginErrorInfo::SetModifyAccount( BOOL bSet )
+{
+ if ( bSet )
+ _nFlags |= LOGINERROR_FLAG_MODIFY_ACCOUNT;
+ else
+ _nFlags &= ~LOGINERROR_FLAG_MODIFY_ACCOUNT;
+}
+
+inline void LoginErrorInfo::SetModifyUserName( BOOL bSet )
+{
+ if ( bSet )
+ _nFlags |= LOGINERROR_FLAG_MODIFY_USER_NAME;
+ else
+ _nFlags &= ~LOGINERROR_FLAG_MODIFY_USER_NAME;
+}
+
+#endif
diff --git a/uui/source/masterpassworddlg.src b/uui/source/masterpassworddlg.src
index 88e0993b8a2d..ad0f025febea 100644
--- a/uui/source/masterpassworddlg.src
+++ b/uui/source/masterpassworddlg.src
@@ -58,10 +58,10 @@ ModalDialog DLG_UUI_MASTERPASSWORD
Size = MAP_APPFONT ( 169 , 13 ) ;
PassWord = TRUE ;
};
- FixedLine FL_FIXED_LINE
- {
- Pos = MAP_APPFONT( 0, 35 );
- Size = MAP_APPFONT( 175, 6 );
+ FixedLine FL_FIXED_LINE
+ {
+ Pos = MAP_APPFONT( 0, 35 );
+ Size = MAP_APPFONT( 175, 6 );
};
OKButton BTN_MASTERPASSWORD_OK
diff --git a/uui/source/passcrtdlg.cxx b/uui/source/passcrtdlg.cxx
index 636cd4510ecc..a6db44697918 100644
--- a/uui/source/passcrtdlg.cxx
+++ b/uui/source/passcrtdlg.cxx
@@ -61,6 +61,7 @@ IMPL_LINK( PasswordCreateDialog, OKHdl_Impl, OKButton *, EMPTYARG )
String aErrorMsg( ResId( STR_ERROR_PASSWORDS_NOT_IDENTICAL, *pResourceMgr ));
ErrorBox aErrorBox( this, WB_OK, aErrorMsg );
aErrorBox.Execute();
+ aEDPasswordCrt.SetText( String() );
aEDPasswordRepeat.SetText( String() );
aEDPasswordCrt.GrabFocus();
}
@@ -81,7 +82,7 @@ PasswordCreateDialog::PasswordCreateDialog( Window* _pParent, ResMgr * pResMgr,
,aCancelBtn ( this, ResId( BTN_PASSCRT_CANCEL, *pResMgr ) )
,aHelpBtn ( this, ResId( BTN_PASSCRT_HELP, *pResMgr ) )
,pResourceMgr ( pResMgr )
- ,nMinLen( bMSCryptoMode ? 1 : 5 )
+ ,nMinLen(1) // if it should be changed for ODF, it must stay 1 for bMSCryptoMode
{
FreeResource();
diff --git a/uui/source/passcrtdlg.hrc b/uui/source/passcrtdlg.hrc
index 54a09494e2ab..c36bec4bc9a6 100644
--- a/uui/source/passcrtdlg.hrc
+++ b/uui/source/passcrtdlg.hrc
@@ -43,5 +43,4 @@
#define FT_PASSWORD_CRT 9
#define FT_MSPASSWORD_WARNING 10
-
#endif // UUI_PASSCRTDLG_HRC
diff --git a/uui/source/passcrtdlg.src b/uui/source/passcrtdlg.src
index 13f1ea688620..81629d955343 100644
--- a/uui/source/passcrtdlg.src
+++ b/uui/source/passcrtdlg.src
@@ -91,7 +91,7 @@ ModalDialog DLG_UUI_PASSWORD_CRT
{
Pos = MAP_APPFONT( 4, 64 );
Size = MAP_APPFONT( 137, 40 );
- Text [ en-US ] = "WARNING: If you lose or forget the password, it cannot be recovered. It is advisable to keep passwords in a safe place. Passwords are case-sensitive and at least five characters long.";
+ Text [ en-US ] = "WARNING: If you lose or forget the password, it cannot be recovered. It is advisable to keep passwords in a safe place. Passwords are case-sensitive.";
WordBreak = TRUE;
};
FixedText FT_MSPASSWORD_WARNING
diff --git a/uui/source/passworddlg.hrc b/uui/source/passworddlg.hrc
index 37938b0228ae..95a5e8a78673 100644
--- a/uui/source/passworddlg.hrc
+++ b/uui/source/passworddlg.hrc
@@ -28,16 +28,16 @@
*
************************************************************************/
-#ifndef PASSWORDDLG_HRC
-#define PASSWORDDLG_HRC
+#ifndef PASSWORDDLG_HRC
+#define PASSWORDDLG_HRC
-// local identifiers
-#define BTN_PASSWORD_OK 1
-#define ED_PASSWORD 2
-#define FT_PASSWORD 3
-#define FL_FIXED_LINE_1 4
-#define BTN_PASSWORD_HELP 5
-#define BTN_PASSWORD_CANCEL 6
+// local identifiers
+#define BTN_PASSWORD_OK 1
+#define ED_PASSWORD 2
+#define FT_PASSWORD 3
+#define FL_FIXED_LINE_1 4
+#define BTN_PASSWORD_HELP 5
+#define BTN_PASSWORD_CANCEL 6
-#endif // PASSWORDDLG_HRC
+#endif // PASSWORDDLG_HRC
diff --git a/uui/source/passworddlg.src b/uui/source/passworddlg.src
index 41845b7488d1..c9b8dfe0847e 100644
--- a/uui/source/passworddlg.src
+++ b/uui/source/passworddlg.src
@@ -50,7 +50,7 @@ ModalDialog DLG_UUI_PASSWORD
{
Pos = MAP_APPFONT( 3, 4 );
Size = MAP_APPFONT( 139, 28 );
- Text [ en-US ] = "Enter password to open the file: \n";
+ Text [ en-US ] = "Enter password to open file: \n";
WordBreak = TRUE;
};
@@ -67,6 +67,7 @@ ModalDialog DLG_UUI_PASSWORD
Pos = MAP_APPFONT( 27, 56 );
Size = MAP_APPFONT( 37, 15 );
DefButton = TRUE ;
+ DefButton = TRUE;
};
CancelButton BTN_PASSWORD_CANCEL
diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx
index 0b2759cbbde8..776c3b4385f2 100644
--- a/uui/source/secmacrowarnings.cxx
+++ b/uui/source/secmacrowarnings.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
#include <comphelper/sequence.hxx>
+#include "comphelper/documentconstants.hxx"
#include <comphelper/processfactory.hxx>
#include <vcl/msgbox.hxx>
@@ -122,8 +123,10 @@ IMPL_LINK( MacroWarning, ViewSignsBtnHdl, void*, EMPTYARG )
{
DBG_ASSERT( mxCert.is(), "*MacroWarning::ViewSignsBtnHdl(): no certificate set!" );
+ uno::Sequence< uno::Any > aArgs( 1 );
+ aArgs[0] = uno::makeAny( maODFVersion );
uno::Reference< security::XDocumentDigitalSignatures > xD(
- comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ) ), uno::UNO_QUERY );
+ comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ), aArgs ), uno::UNO_QUERY );
if( xD.is() )
{
if( mxCert.is() )
@@ -139,8 +142,10 @@ IMPL_LINK( MacroWarning, EnableBtnHdl, void*, EMPTYARG )
{
if( mbSignedMode && maAlwaysTrustCB.IsChecked() )
{ // insert path into trusted path list
+ uno::Sequence< uno::Any > aArgs( 1 );
+ aArgs[0] = uno::makeAny( maODFVersion );
uno::Reference< security::XDocumentDigitalSignatures > xD(
- comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ) ), uno::UNO_QUERY );
+ comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ), aArgs ), uno::UNO_QUERY );
if( xD.is() )
{
if( mxCert.is() )
@@ -337,21 +342,23 @@ void MacroWarning::FitControls()
}
void MacroWarning::SetStorage( const cssu::Reference < css::embed::XStorage >& rxStore,
- const cssu::Sequence< security::DocumentSignatureInformation >& _rInfos )
+ const ::rtl::OUString& aODFVersion,
+ const cssu::Sequence< security::DocumentSignatureInformation >& rInfos )
{
mxStore = rxStore;
- sal_Int32 nCnt = _rInfos.getLength();
+ maODFVersion = aODFVersion;
+ sal_Int32 nCnt = rInfos.getLength();
if( mxStore.is() && nCnt > 0 )
{
- mpInfos = &_rInfos;
+ mpInfos = &rInfos;
String aCN_Id( String::CreateFromAscii( "CN" ) );
String s;
- s = GetContentPart( _rInfos[ 0 ].Signer->getSubjectName(), aCN_Id );
+ s = GetContentPart( rInfos[ 0 ].Signer->getSubjectName(), aCN_Id );
for( sal_Int32 i = 1 ; i < nCnt ; ++i )
{
s.AppendAscii( "\n" );
- s += GetContentPart( _rInfos[ i ].Signer->getSubjectName(), aCN_Id );
+ s += GetContentPart( rInfos[ i ].Signer->getSubjectName(), aCN_Id );
}
maSignsFI.SetText( s );
diff --git a/uui/source/secmacrowarnings.hxx b/uui/source/secmacrowarnings.hxx
index a3bac1dcdb9f..17280ecbbac1 100644
--- a/uui/source/secmacrowarnings.hxx
+++ b/uui/source/secmacrowarnings.hxx
@@ -60,6 +60,7 @@ private:
cssu::Reference< css::security::XCertificate > mxCert;
cssu::Reference< css::embed::XStorage > mxStore;
+ ::rtl::OUString maODFVersion;
const cssu::Sequence< css::security::DocumentSignatureInformation >* mpInfos;
FixedImage maSymbolImg;
@@ -96,6 +97,7 @@ public:
void SetDocumentURL( const String& rDocURL );
void SetStorage( const cssu::Reference < css::embed::XStorage >& rxStore,
+ const ::rtl::OUString& aODFVersion,
const cssu::Sequence< css::security::DocumentSignatureInformation >& _rInfos );
void SetCertificate( const cssu::Reference< css::security::XCertificate >& _rxCert );
};
diff --git a/xmlhelp/inc/xmlhelp/compilehelp.hxx b/xmlhelp/inc/xmlhelp/compilehelp.hxx
deleted file mode 100644
index 7e4712977d21..000000000000
--- a/xmlhelp/inc/xmlhelp/compilehelp.hxx
+++ /dev/null
@@ -1,70 +0,0 @@
-/*************************************************************************
- *
- * 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: compilehelp.hxx,v $
- * $Revision: 1.3 $
- *
- * 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 COMPILE_HXX
-#define COMPILE_HXX
-
-#include <xmlhelp/helplinkerdllapi.h>
-#include <rtl/ustring.hxx>
-
-enum HelpProcessingErrorClass
-{
- HELPPROCESSING_NO_ERROR,
- HELPPROCESSING_GENERAL_ERROR, // Missing files, options etc.
- HELPPROCESSING_INTERNAL_ERROR, // Unexpected problems
- HELPPROCESSING_XMLPARSING_ERROR // Errors thrown by libxml
-};
-
-struct HelpProcessingErrorInfo
-{
- HelpProcessingErrorClass m_eErrorClass;
- rtl::OUString m_aErrorMsg;
- rtl::OUString m_aXMLParsingFile;
- sal_Int32 m_nXMLParsingLine;
-
- HelpProcessingErrorInfo( void )
- : m_eErrorClass( HELPPROCESSING_NO_ERROR )
- , m_nXMLParsingLine( -1 )
- {}
-
- HelpProcessingErrorInfo& operator=( const struct HelpProcessingException& e );
-};
-
-
-// Returns true in case of success, false in case of error
-HELPLINKER_DLLPUBLIC bool compileExtensionHelp
-(
- const rtl::OUString& aExtensionName,
- const rtl::OUString& aExtensionLanguageRoot,
- sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles,
- HelpProcessingErrorInfo& o_rHelpProcessingErrorInfo
-);
-
-#endif
diff --git a/xmlhelp/prj/build.lst b/xmlhelp/prj/build.lst
index b360e5f763ee..3f468f593a1a 100644
--- a/xmlhelp/prj/build.lst
+++ b/xmlhelp/prj/build.lst
@@ -1,4 +1,4 @@
-xh xmlhelp : ucbhelper LIBXSLT:libxslt unoil BERKELEYDB:berkeleydb svtools LUCENE:lucene unotools javaunohelper NULL
+xh xmlhelp : ucbhelper transex3 LIBXSLT:libxslt unoil BERKELEYDB:berkeleydb svtools LUCENE:lucene unotools javaunohelper NULL
xh xmlhelp usr1 - all xh_mkout NULL
xh xmlhelp\inc nmake - all xh_inc NULL
xh xmlhelp\source\treeview nmake - all xh_treeview xh_inc NULL
diff --git a/xmlhelp/source/com/sun/star/help/HelpCompiler.cxx b/xmlhelp/source/com/sun/star/help/HelpCompiler.cxx
deleted file mode 100644
index 5001d0907972..000000000000
--- a/xmlhelp/source/com/sun/star/help/HelpCompiler.cxx
+++ /dev/null
@@ -1,593 +0,0 @@
-/*************************************************************************
- *
- * 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: HelpCompiler.cxx,v $
- * $Revision: 1.9 $
- *
- * 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 "HelpCompiler.hxx"
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libxslt/xslt.h>
-#include <libxslt/xsltInternals.h>
-#include <libxslt/transform.h>
-#include <libxslt/xsltutils.h>
-#ifdef __MINGW32__
-#include <tools/prewin.h>
-#include <tools/postwin.h>
-#endif
-#include <osl/thread.hxx>
-
-static void impl_sleep( sal_uInt32 nSec )
-{
- TimeValue aTime;
- aTime.Seconds = nSec;
- aTime.Nanosec = 0;
-
- osl::Thread::wait( aTime );
-}
-
-HelpCompiler::HelpCompiler(StreamTable &in_streamTable, const fs::path &in_inputFile,
- const fs::path &in_src, const fs::path &in_resEmbStylesheet,
- const std::string &in_module, const std::string &in_lang, bool in_bExtensionMode)
- : streamTable(in_streamTable), inputFile(in_inputFile),
- src(in_src), module(in_module), lang(in_lang), resEmbStylesheet(in_resEmbStylesheet),
- bExtensionMode( in_bExtensionMode )
-{
- xmlKeepBlanksDefaultValue = 0;
-}
-
-xmlDocPtr HelpCompiler::getSourceDocument(const fs::path &filePath)
-{
- static const char *params[4 + 1];
- static xsltStylesheetPtr cur = NULL;
-
- xmlDocPtr res;
- if( bExtensionMode )
- {
- res = xmlParseFile(filePath.native_file_string().c_str());
- if( !res ){
- impl_sleep( 3 );
- res = xmlParseFile(filePath.native_file_string().c_str());
- }
- }
- else
- {
- if (!cur)
- {
- static std::string fsroot('\'' + src.toUTF8() + '\'');
- static std::string esclang('\'' + lang + '\'');
-
- xmlSubstituteEntitiesDefault(1);
- xmlLoadExtDtdDefaultValue = 1;
- cur = xsltParseStylesheetFile((const xmlChar *)resEmbStylesheet.native_file_string().c_str());
-
- int nbparams = 0;
- params[nbparams++] = "Language";
- params[nbparams++] = esclang.c_str();
- params[nbparams++] = "fsroot";
- params[nbparams++] = fsroot.c_str();
- params[nbparams] = NULL;
- }
- xmlDocPtr doc = xmlParseFile(filePath.native_file_string().c_str());
- if( !doc )
- {
- impl_sleep( 3 );
- doc = xmlParseFile(filePath.native_file_string().c_str());
- }
-
- //???res = xmlParseFile(filePath.native_file_string().c_str());
-
- res = xsltApplyStylesheet(cur, doc, params);
- xmlFreeDoc(doc);
- }
- return res;
-}
-
-HashSet HelpCompiler::switchFind(xmlDocPtr doc)
-{
- HashSet hs;
- xmlChar *xpath = (xmlChar*)"//switchinline";
-
- xmlXPathContextPtr context = xmlXPathNewContext(doc);
- xmlXPathObjectPtr result = xmlXPathEvalExpression(xpath, context);
- xmlXPathFreeContext(context);
- if (result)
- {
- xmlNodeSetPtr nodeset = result->nodesetval;
- for (int i = 0; i < nodeset->nodeNr; i++)
- {
- xmlNodePtr el = nodeset->nodeTab[i];
- xmlChar *select = xmlGetProp(el, (xmlChar*)"select");
- if (select)
- {
- if (!strcmp((const char*)select, "appl"))
- {
- xmlNodePtr n1 = el->xmlChildrenNode;
- while (n1)
- {
- if ((!xmlStrcmp(n1->name, (const xmlChar*)"caseinline")))
- {
- xmlChar *appl = xmlGetProp(n1, (xmlChar*)"select");
- hs.push_back(std::string((const char*)appl));
- xmlFree(appl);
- }
- else if ((!xmlStrcmp(n1->name, (const xmlChar*)"defaultinline")))
- hs.push_back(std::string("DEFAULT"));
- n1 = n1->next;
- }
- }
- xmlFree(select);
- }
- }
- xmlXPathFreeObject(result);
- }
- hs.push_back(std::string("DEFAULT"));
- return hs;
-}
-
-// returns a node representing the whole stuff compiled for the current
-// application.
-xmlNodePtr HelpCompiler::clone(xmlNodePtr node, const std::string& appl)
-{
- xmlNodePtr parent = xmlCopyNode(node, 2);
- xmlNodePtr n = node->xmlChildrenNode;
- while (n != NULL)
- {
- bool isappl = false;
- if ( (!strcmp((const char*)n->name, "switchinline")) ||
- (!strcmp((const char*)n->name, "switch")) )
- {
- xmlChar *select = xmlGetProp(n, (xmlChar*)"select");
- if (select)
- {
- if (!strcmp((const char*)select, "appl"))
- isappl = true;
- xmlFree(select);
- }
- }
- if (isappl)
- {
- xmlNodePtr caseNode = n->xmlChildrenNode;
- if (appl == "DEFAULT")
- {
- while (caseNode)
- {
- if (!strcmp((const char*)caseNode->name, "defaultinline"))
- {
- xmlNodePtr cnl = caseNode->xmlChildrenNode;
- while (cnl)
- {
- xmlAddChild(parent, clone(cnl, appl));
- cnl = cnl->next;
- }
- break;
- }
- caseNode = caseNode->next;
- }
- }
- else
- {
- while (caseNode)
- {
- isappl=false;
- if (!strcmp((const char*)caseNode->name, "caseinline"))
- {
- xmlChar *select = xmlGetProp(n, (xmlChar*)"select");
- if (select)
- {
- if (!strcmp((const char*)select, appl.c_str()))
- isappl = true;
- xmlFree(select);
- }
- if (isappl)
- {
- xmlNodePtr cnl = caseNode->xmlChildrenNode;
- while (cnl)
- {
- xmlAddChild(parent, clone(cnl, appl));
- cnl = cnl->next;
- }
- break;
- }
-
- }
- caseNode = caseNode->next;
- }
- }
-
- }
- else
- xmlAddChild(parent, clone(n, appl));
-
- n = n->next;
- }
- return parent;
-}
-
-class myparser
-{
-public:
- std::string documentId;
- std::string fileName;
- std::string title;
- HashSet *hidlist;
- Hashtable *keywords;
- Stringtable *helptexts;
-private:
- HashSet extendedHelpText;
-public:
- myparser(const std::string &indocumentId, const std::string &infileName,
- const std::string &intitle) : documentId(indocumentId), fileName(infileName),
- title(intitle)
- {
- hidlist = new HashSet;
- keywords = new Hashtable;
- helptexts = new Stringtable;
- }
- void traverse( xmlNodePtr parentNode );
-private:
- std::string dump(xmlNodePtr node);
-};
-
-std::string myparser::dump(xmlNodePtr node)
-{
- std::string app;
- if (node->xmlChildrenNode)
- {
- xmlNodePtr list = node->xmlChildrenNode;
- while (list)
- {
- app += dump(list);
- list = list->next;
- }
- }
- if (xmlNodeIsText(node))
- {
- xmlChar *pContent = xmlNodeGetContent(node);
- app += std::string((const char*)pContent);
- xmlFree(pContent);
- // std::cout << app << std::endl;
- }
- return app;
-}
-
-void trim(std::string& str)
-{
- std::string::size_type pos = str.find_last_not_of(' ');
- if(pos != std::string::npos)
- {
- str.erase(pos + 1);
- pos = str.find_first_not_of(' ');
- if(pos != std::string::npos)
- str.erase(0, pos);
- }
- else
- str.erase(str.begin(), str.end());
-}
-
-void myparser::traverse( xmlNodePtr parentNode )
-{
- // traverse all nodes that belong to the parent
- xmlNodePtr test ;
- for (test = parentNode->xmlChildrenNode; test; test = test->next)
- {
- if (fileName.empty() && !strcmp((const char*)test->name, "filename"))
- {
- xmlNodePtr node = test->xmlChildrenNode;
- if (xmlNodeIsText(node))
- {
- xmlChar *pContent = xmlNodeGetContent(node);
- fileName = std::string((const char*)pContent);
- xmlFree(pContent);
- }
- }
- else if (title.empty() && !strcmp((const char*)test->name, "title"))
- {
- title = dump(test);
- if (title.empty())
- title = "<notitle>";
- }
- else if (!strcmp((const char*)test->name, "bookmark"))
- {
- xmlChar *branchxml = xmlGetProp(test, (const xmlChar*)"branch");
- xmlChar *idxml = xmlGetProp(test, (const xmlChar*)"id");
- std::string branch((const char*)branchxml);
- std::string anchor((const char*)idxml);
- xmlFree (branchxml);
- xmlFree (idxml);
-
- std::string hid;
-
- if (branch.find("hid") == 0)
- {
- size_t index = branch.find('/');
- if (index != std::string::npos)
- {
- hid = branch.substr(1 + index);
- // one shall serve as a documentId
- if (documentId.empty())
- documentId = hid;
- extendedHelpText.push_back(hid);
- std::string foo = anchor.empty() ? hid : hid + "#" + anchor;
- HCDBG(std::cerr << "hid pushback" << foo << std::endl);
- hidlist->push_back( anchor.empty() ? hid : hid + "#" + anchor);
- }
- else
- continue;
- }
- else if (branch.compare("index") == 0)
- {
- LinkedList ll;
-
- for (xmlNodePtr nd = test->xmlChildrenNode; nd; nd = nd->next)
- {
- if (strcmp((const char*)nd->name, "bookmark_value"))
- continue;
-
- std::string embedded;
- xmlChar *embeddedxml = xmlGetProp(nd, (const xmlChar*)"embedded");
- if (embeddedxml)
- {
- embedded = std::string((const char*)embeddedxml);
- xmlFree (embeddedxml);
- std::transform (embedded.begin(), embedded.end(),
- embedded.begin(), tolower);
- }
-
- bool isEmbedded = !embedded.empty() && embedded.compare("true") == 0;
- if (isEmbedded)
- continue;
-
- std::string keyword = dump(nd);
- size_t keywordSem = keyword.find(';');
- if (keywordSem != std::string::npos)
- {
- std::string tmppre =
- keyword.substr(0,keywordSem);
- trim(tmppre);
- std::string tmppos =
- keyword.substr(1+keywordSem);
- trim(tmppos);
- keyword = tmppre + ";" + tmppos;
- }
- ll.push_back(keyword);
- }
- if (!ll.empty())
- (*keywords)[anchor] = ll;
- }
- else if (branch.compare("contents") == 0)
- {
- // currently not used
- }
- }
- else if (!strcmp((const char*)test->name, "ahelp"))
- {
- std::string text = dump(test);
- trim(text);
- std::string name;
-
- HashSet::const_iterator aEnd = extendedHelpText.end();
- for (HashSet::const_iterator iter = extendedHelpText.begin(); iter != aEnd;
- ++iter)
- {
- name = *iter;
- (*helptexts)[name] = text;
- }
- extendedHelpText.clear();
- }
-
- // traverse children
- traverse(test);
- }
-}
-
-bool HelpCompiler::compile( void ) throw( HelpProcessingException )
-{
- // we now have the jaroutputstream, which will contain the document.
- // now determine the document as a dom tree in variable docResolved
-
- xmlDocPtr docResolvedOrg = getSourceDocument(inputFile);
-
- // now add path to the document
- // resolve the dom
- if (!docResolvedOrg)
- {
- impl_sleep( 3 );
- docResolvedOrg = getSourceDocument(inputFile);
- if( !docResolvedOrg )
- {
- std::stringstream aStrStream;
- aStrStream << "ERROR: file not existing: " << inputFile.native_file_string().c_str() << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
- }
-
- // now find all applications for which one has to compile
- std::string documentId;
- std::string fileName;
- std::string title;
- // returns all applications for which one has to compile
- HashSet applications = switchFind(docResolvedOrg);
-
- HashSet::const_iterator aEnd = applications.end();
- for (HashSet::const_iterator aI = applications.begin(); aI != aEnd; ++aI)
- {
- std::string appl = *aI;
- std::string modulename = appl;
- if (modulename[0] == 'S')
- {
- modulename = modulename.substr(1);
- std::transform(modulename.begin(), modulename.end(), modulename.begin(), tolower);
- }
- if (modulename != "DEFAULT" && modulename != module)
- continue;
-
- // returns a clone of the document with swich-cases resolved
- xmlNodePtr docResolved = clone(xmlDocGetRootElement(docResolvedOrg), appl);
- myparser aparser(documentId, fileName, title);
- aparser.traverse(docResolved);
-
- documentId = aparser.documentId;
- fileName = aparser.fileName;
- title = aparser.title;
-
- HCDBG(std::cerr << documentId << " : " << fileName << " : " << title << std::endl);
-
- xmlDocPtr docResolvedDoc = xmlCopyDoc(docResolvedOrg, false);
- xmlDocSetRootElement(docResolvedDoc, docResolved);
-
- if (modulename == "DEFAULT")
- {
- streamTable.dropdefault();
- streamTable.default_doc = docResolvedDoc;
- streamTable.default_hidlist = aparser.hidlist;
- streamTable.default_helptexts = aparser.helptexts;
- streamTable.default_keywords = aparser.keywords;
- }
- else if (modulename == module)
- {
- streamTable.dropappl();
- streamTable.appl_doc = docResolvedDoc;
- streamTable.appl_hidlist = aparser.hidlist;
- streamTable.appl_helptexts = aparser.helptexts;
- streamTable.appl_keywords = aparser.keywords;
- }
- else
- {
- std::stringstream aStrStream;
- aStrStream << "ERROR: Found unexpected module name \"" << modulename
- << "\" in file" << src.native_file_string().c_str() << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
- } // end iteration over all applications
-
- streamTable.document_id = documentId;
- streamTable.document_path = fileName;
- streamTable.document_title = title;
- std::string actMod = module;
- if ( !bExtensionMode && !fileName.empty())
- {
- if (fileName.find("/text/") == 0)
- {
- int len = strlen("/text/");
- actMod = fileName.substr(len);
- actMod = actMod.substr(0, actMod.find('/'));
- }
- }
- streamTable.document_module = actMod;
-
- xmlFreeDoc(docResolvedOrg);
- return true;
-}
-
-namespace fs
-{
- rtl_TextEncoding getThreadTextEncoding( void )
- {
- static bool bNeedsInit = true;
- static rtl_TextEncoding nThreadTextEncoding;
- if( bNeedsInit )
- {
- bNeedsInit = false;
- nThreadTextEncoding = osl_getThreadTextEncoding();
- }
- return nThreadTextEncoding;
- }
-
- void create_directory(const fs::path indexDirName)
- {
- HCDBG(
- std::cerr << "creating " <<
- rtl::OUStringToOString(indexDirName.data, RTL_TEXTENCODING_UTF8).getStr()
- << std::endl
- );
- osl::Directory::createPath(indexDirName.data);
- }
-
- void rename(const fs::path &src, const fs::path &dest)
- {
- osl::File::move(src.data, dest.data);
- }
-
- void copy(const fs::path &src, const fs::path &dest)
- {
- osl::File::copy(src.data, dest.data);
- }
-
- bool exists(const fs::path &in)
- {
- osl::File tmp(in.data);
- return (tmp.open(osl_File_OpenFlag_Read) == osl::FileBase::E_None);
- }
-
- void remove(const fs::path &in)
- {
- osl::File::remove(in.data);
- }
-
- void removeRecursive(rtl::OUString const& _suDirURL)
- {
- {
- osl::Directory aDir(_suDirURL);
- aDir.open();
- if (aDir.isOpen())
- {
- osl::DirectoryItem aItem;
- osl::FileStatus aStatus(osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_Attributes);
- while (aDir.getNextItem(aItem) == ::osl::FileBase::E_None)
- {
- if (osl::FileBase::E_None == aItem.getFileStatus(aStatus) &&
- aStatus.isValid(osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_Attributes))
- {
- rtl::OUString suFilename = aStatus.getFileName();
- rtl::OUString suFullFileURL;
- suFullFileURL += _suDirURL;
- suFullFileURL += rtl::OUString::createFromAscii("/");
- suFullFileURL += suFilename;
-
- if (aStatus.getFileType() == osl::FileStatus::Directory)
- removeRecursive(suFullFileURL);
- else
- osl::File::remove(suFullFileURL);
- }
- }
- aDir.close();
- }
- }
- osl::Directory::remove(_suDirURL);
- }
-
- void remove_all(const fs::path &in)
- {
- removeRecursive(in.data);
- }
-}
-
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/xmlhelp/source/com/sun/star/help/HelpCompiler.hxx b/xmlhelp/source/com/sun/star/help/HelpCompiler.hxx
deleted file mode 100644
index 768aafd0e120..000000000000
--- a/xmlhelp/source/com/sun/star/help/HelpCompiler.hxx
+++ /dev/null
@@ -1,320 +0,0 @@
-/*************************************************************************
- *
- * 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: HelpCompiler.hxx,v $
- * $Revision: 1.8 $
- *
- * 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 HELPCOMPILER_HXX
-#define HELPCOMPILER_HXX
-
-#include <string>
-#include <hash_map>
-#include <vector>
-#include <list>
-#include <fstream>
-#include <iostream>
-#include <sstream>
-#include <algorithm>
-#include <ctype.h>
-#ifdef SYSTEM_DB
-#include <db.h>
-#else
-#include <berkeleydb/db.h>
-#endif
-
-#include <boost/shared_ptr.hpp>
-
-#include <libxml/xmlmemory.h>
-#include <libxml/debugXML.h>
-#include <libxml/HTMLtree.h>
-#include <libxml/xmlIO.h>
-#include <libxml/xinclude.h>
-#include <libxml/catalog.h>
-
-#include <rtl/ustring.hxx>
-#include <osl/thread.h>
-#include <osl/process.h>
-#include <osl/file.hxx>
-
-#include <xmlhelp/compilehelp.hxx>
-
-#define EMULATEORIGINAL 1
-
-#ifdef CMCDEBUG
- #define HCDBG(foo) do { if (1) foo; } while(0)
-#else
- #define HCDBG(foo) do { if (0) foo; } while(0)
-#endif
-
-namespace fs
-{
- rtl_TextEncoding getThreadTextEncoding( void );
-
- enum convert { native };
- class path
- {
- public:
- ::rtl::OUString data;
- public:
- path() {}
- path(const path &rOther) : data(rOther.data) {}
- path(const std::string &in, convert)
- {
- rtl::OUString sWorkingDir;
- osl_getProcessWorkingDir(&sWorkingDir.pData);
-
- rtl::OString tmp(in.c_str());
- rtl::OUString ustrSystemPath(rtl::OStringToOUString(tmp, getThreadTextEncoding()));
- osl::File::getFileURLFromSystemPath(ustrSystemPath, data);
- osl::File::getAbsoluteFileURL(sWorkingDir, data, data);
- }
- path(const std::string &FileURL)
- {
- rtl::OString tmp(FileURL.c_str());
- data = rtl::OStringToOUString(tmp, getThreadTextEncoding());
- }
- std::string native_file_string() const
- {
- ::rtl::OUString ustrSystemPath;
- osl::File::getSystemPathFromFileURL(data, ustrSystemPath);
- rtl::OString tmp(rtl::OUStringToOString(ustrSystemPath, getThreadTextEncoding()));
- HCDBG(std::cerr << "native_file_string is " << tmp.getStr() << std::endl);
- return std::string(tmp.getStr());
- }
- std::string native_directory_string() const { return native_file_string(); }
- std::string toUTF8() const
- {
- rtl::OString tmp(rtl::OUStringToOString(data, RTL_TEXTENCODING_UTF8));
- return std::string(tmp.getStr());
- }
- bool empty() const { return data.getLength() == 0; }
- path operator/(const std::string &in) const
- {
- path ret(*this);
- HCDBG(std::cerr << "orig was " <<
- rtl::OUStringToOString(ret.data, RTL_TEXTENCODING_UTF8).getStr() << std::endl);
- rtl::OString tmp(in.c_str());
- rtl::OUString ustrSystemPath(rtl::OStringToOUString(tmp, getThreadTextEncoding()));
- ret.data += rtl::OUString(sal_Unicode('/'));
- ret.data += ustrSystemPath;
- HCDBG(std::cerr << "final is " <<
- rtl::OUStringToOString(ret.data, RTL_TEXTENCODING_UTF8).getStr() << std::endl);
- return ret;
- }
- void append(const char *in)
- {
- rtl::OString tmp(in);
- rtl::OUString ustrSystemPath(rtl::OStringToOUString(tmp, getThreadTextEncoding()));
- data = data + ustrSystemPath;
- }
- void append(const std::string &in) { append(in.c_str()); }
- };
-
- void create_directory(const fs::path indexDirName);
- void rename(const fs::path &src, const fs::path &dest);
- void copy(const fs::path &src, const fs::path &dest);
- bool exists(const fs::path &in);
- void remove_all(const fs::path &in);
- void remove(const fs::path &in);
-}
-
-struct joaat_hash
-{
- size_t operator()(const std::string &str) const
- {
- size_t hash = 0;
- const char *key = str.data();
- for (size_t i = 0; i < str.size(); i++)
- {
- hash += key[i];
- hash += (hash << 10);
- hash ^= (hash >> 6);
- }
- hash += (hash << 3);
- hash ^= (hash >> 11);
- hash += (hash << 15);
- return hash;
- }
-};
-
-#define get16bits(d) ((((sal_uInt32)(((const sal_uInt8 *)(d))[1])) << 8)\
- +(sal_uInt32)(((const sal_uInt8 *)(d))[0]) )
-
-struct SuperFastHash
-{
- size_t operator()(const std::string &str) const
- {
- const char * data = str.data();
- int len = str.size();
- size_t hash = len, tmp;
- if (len <= 0 || data == NULL) return 0;
-
- int rem = len & 3;
- len >>= 2;
-
- /* Main loop */
- for (;len > 0; len--)
- {
- hash += get16bits (data);
- tmp = (get16bits (data+2) << 11) ^ hash;
- hash = (hash << 16) ^ tmp;
- data += 2*sizeof (sal_uInt16);
- hash += hash >> 11;
- }
-
- /* Handle end cases */
- switch (rem)
- {
- case 3: hash += get16bits (data);
- hash ^= hash << 16;
- hash ^= data[sizeof (sal_uInt16)] << 18;
- hash += hash >> 11;
- break;
- case 2: hash += get16bits (data);
- hash ^= hash << 11;
- hash += hash >> 17;
- break;
- case 1: hash += *data;
- hash ^= hash << 10;
- hash += hash >> 1;
- }
-
- /* Force "avalanching" of final 127 bits */
- hash ^= hash << 3;
- hash += hash >> 5;
- hash ^= hash << 4;
- hash += hash >> 17;
- hash ^= hash << 25;
- hash += hash >> 6;
-
- return hash;
- }
-};
-
-#define pref_hash joaat_hash
-
-typedef std::hash_map<std::string, std::string, pref_hash> Stringtable;
-typedef std::list<std::string> LinkedList;
-typedef std::vector<std::string> HashSet;
-
-typedef std::hash_map<std::string, LinkedList, pref_hash> Hashtable;
-
-class StreamTable
-{
-public:
- std::string document_id;
- std::string document_path;
- std::string document_module;
- std::string document_title;
-
- HashSet *appl_hidlist;
- Hashtable *appl_keywords;
- Stringtable *appl_helptexts;
- xmlDocPtr appl_doc;
-
- HashSet *default_hidlist;
- Hashtable *default_keywords;
- Stringtable *default_helptexts;
- xmlDocPtr default_doc;
-
- StreamTable() :
- appl_hidlist(NULL), appl_keywords(NULL), appl_helptexts(NULL), appl_doc(NULL),
- default_hidlist(NULL), default_keywords(NULL), default_helptexts(NULL), default_doc(NULL)
- {}
- void dropdefault()
- {
- delete default_hidlist;
- delete default_keywords;
- delete default_helptexts;
- if (default_doc) xmlFreeDoc(default_doc);
- }
- void dropappl()
- {
- delete appl_hidlist;
- delete appl_keywords;
- delete appl_helptexts;
- if (appl_doc) xmlFreeDoc(appl_doc);
- }
- ~StreamTable()
- {
- dropappl();
- dropdefault();
- }
-};
-
-struct HelpProcessingException
-{
- HelpProcessingErrorClass m_eErrorClass;
- std::string m_aErrorMsg;
- std::string m_aXMLParsingFile;
- int m_nXMLParsingLine;
-
- HelpProcessingException( HelpProcessingErrorClass eErrorClass, const std::string& aErrorMsg )
- : m_eErrorClass( eErrorClass )
- , m_aErrorMsg( aErrorMsg )
- {}
- HelpProcessingException( const std::string& aErrorMsg, const std::string& aXMLParsingFile, int nXMLParsingLine )
- : m_eErrorClass( HELPPROCESSING_XMLPARSING_ERROR )
- , m_aErrorMsg( aErrorMsg )
- , m_aXMLParsingFile( aXMLParsingFile )
- , m_nXMLParsingLine( nXMLParsingLine )
- {}
-};
-
-class HelpCompiler
-{
-public:
- HelpCompiler(StreamTable &streamTable,
- const fs::path &in_inputFile,
- const fs::path &in_src,
- const fs::path &in_resEmbStylesheet,
- const std::string &in_module,
- const std::string &in_lang,
- bool in_bExtensionMode);
- bool compile( void ) throw (HelpProcessingException);
- void addEntryToJarFile(const std::string &prefix,
- const std::string &entryName, const std::string &bytesToAdd);
- void addEntryToJarFile(const std::string &prefix,
- const std::string &entryName, const HashSet &bytesToAdd);
- void addEntryToJarFile(const std::string &prefix,
- const std::string &entryName, const Stringtable &bytesToAdd);
- void addEntryToJarFile(const std::string &prefix,
- const std::string &entryName, const Hashtable &bytesToAdd);
-private:
- xmlDocPtr getSourceDocument(const fs::path &filePath);
- HashSet switchFind(xmlDocPtr doc);
- xmlNodePtr clone(xmlNodePtr node, const std::string& appl);
- StreamTable &streamTable;
- const fs::path inputFile, src;
- const std::string module, lang;
- const fs::path resEmbStylesheet;
- bool bExtensionMode;
-};
-
-#endif
-
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/xmlhelp/source/com/sun/star/help/HelpFileDocument.java b/xmlhelp/source/com/sun/star/help/HelpFileDocument.java
deleted file mode 100644
index 2212db27f251..000000000000
--- a/xmlhelp/source/com/sun/star/help/HelpFileDocument.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*************************************************************************
- *
- * 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: HelpFileDocument.java,v $
- * $Revision: 1.2 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-package com.sun.star.help;
-
-import java.io.File;
-import java.io.Reader;
-import java.io.FileInputStream;
-import java.io.InputStreamReader;
-//import java.io.FileReader;
-import java.io.StringReader;
-
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
-
-/** Lucene Document for help files */
-public class HelpFileDocument
-{
- /** Creates reader for UTF-8 files
- */
- private static Reader getReaderForFile( File aFile )
- throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException {
- Reader aReader;
- if( aFile != null ) {
- FileInputStream fis = new FileInputStream( aFile );
- aReader = new InputStreamReader( fis, "UTF-8" );
- }
- else {
- aReader = new StringReader( "" );
- }
- return aReader;
- }
-
- /** Makes a document for a File.
- */
- public static Document Document( String aModule, File aCaptionFile, File aContentFile )
- throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException {
- Document doc = new Document();
-
- // Add the path of the file as a field named "path". Use a field that is
- // indexed (i.e. searchable), but don't tokenize the field into words.
- File aFile = aCaptionFile != null ? aCaptionFile : aContentFile;
- if( aFile != null )
- {
- String aPath = "#HLP#" + aModule + "/" + aFile.getName();
- doc.add(new Field("path", aPath, Field.Store.YES, Field.Index.UN_TOKENIZED));
- }
-
- // Add the caption of the file to a field named "caption". Specify a Reader,
- // so that the text of the file is tokenized and indexed, but not stored.
- doc.add( new Field( "caption", getReaderForFile( aCaptionFile ) ) );
-
- // Add the contents of the file to a field named "content". Specify a Reader,
- // so that the text of the file is tokenized and indexed, but not stored.
- doc.add( new Field( "content", getReaderForFile( aContentFile ) ) );
-
- // return the document
- return doc;
- }
-
- private HelpFileDocument() {}
-}
diff --git a/xmlhelp/source/com/sun/star/help/HelpIndexer.java b/xmlhelp/source/com/sun/star/help/HelpIndexer.java
index eabf1fdd6e88..abb803289e7e 100644
--- a/xmlhelp/source/com/sun/star/help/HelpIndexer.java
+++ b/xmlhelp/source/com/sun/star/help/HelpIndexer.java
@@ -37,23 +37,11 @@ import com.sun.star.beans.XIntrospectionAccess;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.XComponentContext;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-import java.util.zip.CRC32;
-import org.apache.lucene.analysis.standard.StandardAnalyzer;
-import org.apache.lucene.analysis.cjk.CJKAnalyzer;
-import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.index.IndexWriter;
-
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Date;
+import java.util.zip.ZipOutputStream;
public class HelpIndexer extends WeakBase
implements XServiceInfo, XInvocation
@@ -62,6 +50,8 @@ public class HelpIndexer extends WeakBase
"com.sun.star.help.HelpIndexer";
static private final String aCreateIndexMethodName = "createIndex";
+ static private com.sun.star.help.HelpIndexerTool helpindexer = new com.sun.star.help.HelpIndexerTool();
+
public HelpIndexer()
{
}
@@ -70,292 +60,26 @@ public class HelpIndexer extends WeakBase
{
}
- /**
- * @param args the command line arguments
- */
- public static void main( String[] args )
+ public static void mainImpl( String[] args, boolean bExtensionMode )
{
- boolean bExtensionMode = false;
- mainImpl( args, bExtensionMode );
- }
-
- private static void mainImpl( String[] args, boolean bExtensionMode )
- {
- String aDirToZipStr = "";
- String aSrcDirStr = "";
- String aLanguageStr = "";
- String aModule = "";
- String aTargetZipFileStr = "";
-
- // Scan arguments
- boolean bLang = false;
- boolean bMod = false;
- boolean bZipDir = false;
- boolean bSrcDir = false;
- boolean bOutput = false;
-
- int nArgCount = args.length;
- for( int i = 0 ; i < nArgCount ; i++ )
- {
- if( "-lang".equals(args[i]) )
- {
- if( i + 1 < nArgCount )
- {
- aLanguageStr = args[i + 1];
- bLang = true;
- }
- i++;
- }
- else if( "-mod".equals(args[i]) )
- {
- if( i + 1 < nArgCount )
- {
- aModule = args[i + 1];
- bMod = true;
- }
- i++;
- }
- else if( "-zipdir".equals(args[i]) )
- {
- if( i + 1 < nArgCount )
- {
- aDirToZipStr = args[i + 1];
- bZipDir = true;
- }
- i++;
- }
- else if( "-srcdir".equals(args[i]) )
- {
- if( i + 1 < nArgCount )
- {
- aSrcDirStr = args[i + 1];
- bSrcDir = true;
- }
- i++;
- }
- else if( "-o".equals(args[i]) )
- {
- if( i + 1 < nArgCount )
- {
- aTargetZipFileStr = args[i + 1];
- bOutput = true;
- }
- i++;
- }
- }
-
- if( !bLang || !bMod || !bZipDir || (!bOutput && !bExtensionMode) )
- {
- if( bExtensionMode )
- return;
-
- System.out.println("Usage: HelpIndexer -lang ISOLangCode -mod HelpModule -zipdir TempZipDir -o OutputZipFile");
- System.exit( -1 );
- }
-
- String aIndexDirName = aModule + ".idxl";
- File aIndexDir = new File( aDirToZipStr + File.separator + aIndexDirName );
- if( !bSrcDir )
- aSrcDirStr = aDirToZipStr;
- File aCaptionFilesDir = new File( aSrcDirStr + File.separator + "caption" );
- File aContentFilesDir = new File( aSrcDirStr + File.separator + "content" );
-
- try
- {
- Date start = new Date();
- Analyzer analyzer = aLanguageStr.equals("ja") ? (Analyzer)new CJKAnalyzer() : (Analyzer)new StandardAnalyzer();
- IndexWriter writer = new IndexWriter( aIndexDir, analyzer, true );
- if( !bExtensionMode )
- System.out.println( "Lucene: Indexing to directory '" + aIndexDir + "'..." );
- int nRet = indexDocs( writer, aModule, bExtensionMode, aCaptionFilesDir, aContentFilesDir );
- if( nRet != -1 )
- {
- if( !bExtensionMode )
- {
- System.out.println();
- System.out.println( "Optimizing ..." );
- }
- writer.optimize();
- }
- writer.close();
-
- if( bExtensionMode )
- {
- if( !bSrcDir )
- {
- deleteRecursively( aCaptionFilesDir );
- deleteRecursively( aContentFilesDir );
- }
- }
- else
- {
- if( nRet == -1 )
- deleteRecursively( aIndexDir );
-
- if( !bExtensionMode )
- System.out.println( "Zipping ..." );
- File aDirToZipFile = new File( aDirToZipStr );
- createZipFile( aDirToZipFile, aTargetZipFileStr );
- deleteRecursively( aDirToZipFile );
- }
-
- Date end = new Date();
- if( !bExtensionMode )
- System.out.println(end.getTime() - start.getTime() + " total milliseconds");
- }
- catch (IOException e)
- {
- if( bExtensionMode )
- return;
-
- System.out.println(" caught a " + e.getClass() +
- "\n with message: " + e.getMessage());
- System.exit( -1 );
- }
- }
-
- private static int indexDocs(IndexWriter writer, String aModule, boolean bExtensionMode,
- File aCaptionFilesDir, File aContentFilesDir) throws IOException
- {
- if( !aCaptionFilesDir.canRead() || !aCaptionFilesDir.isDirectory() )
- {
- if( !bExtensionMode )
- System.out.println( "Not found: " + aCaptionFilesDir );
- return -1;
- }
- if( !aContentFilesDir.canRead() || !aContentFilesDir.isDirectory() )
- {
- if( !bExtensionMode )
- System.out.println( "Not found: " + aContentFilesDir );
- return -1;
- }
-
- String[] aCaptionFiles = aCaptionFilesDir.list();
- List aCaptionFilesList = Arrays.asList( aCaptionFiles );
- HashSet aCaptionFilesHashSet = new HashSet( aCaptionFilesList );
-
- String[] aContentFiles = aContentFilesDir.list();
- List aContentFilesList = Arrays.asList( aContentFiles );
- HashSet aContentFilesHashSet = new HashSet( aContentFilesList );
-
- // Loop over caption files and find corresponding content file
- if( !bExtensionMode )
- System.out.println( "Indexing, adding files" );
- int nCaptionFilesLen = aCaptionFiles.length;
- for( int i = 0 ; i < nCaptionFilesLen ; i++ )
- {
- String aCaptionFileStr = aCaptionFiles[i];
- File aCaptionFile = new File( aCaptionFilesDir, aCaptionFileStr );
- File aContentFile = null;
- if( aContentFilesHashSet.contains( aCaptionFileStr ) )
- aContentFile = new File( aContentFilesDir, aCaptionFileStr );
-
- if( !bExtensionMode )
- System.out.print( "." );
- writer.addDocument( HelpFileDocument.Document( aModule, aCaptionFile, aContentFile ) );
- }
-
- // Loop over content files to find remaining files not mapped to caption files
- int nContentFilesLen = aContentFiles.length;
- for( int i = 0 ; i < nContentFilesLen ; i++ )
- {
- String aContentFileStr = aContentFiles[i];
- if( !aCaptionFilesHashSet.contains( aContentFileStr ) )
- {
- // Not already handled in caption files loop
- File aCaptionFile = null;
- File aContentFile = new File( aContentFilesDir, aContentFileStr );
- if( !bExtensionMode )
- System.out.print( "." );
- writer.addDocument( HelpFileDocument.Document( aModule, aCaptionFile, aContentFile ) );
- }
- }
- return 0;
+ helpindexer.mainImpl( args , bExtensionMode );
}
public static void createZipFile( File aDirToZip, String aTargetZipFileStr )
throws FileNotFoundException, IOException
{
- FileOutputStream fos = new FileOutputStream( aTargetZipFileStr );
- ZipOutputStream zos = new ZipOutputStream( fos );
-
- File[] aChildrenFiles = aDirToZip.listFiles();
- int nFileCount = aChildrenFiles.length;
- for( int i = 0 ; i < nFileCount ; i++ )
- addToZipRecursively( zos, aChildrenFiles[i], null );
-
- zos.close();
+ helpindexer.createZipFile( aDirToZip , aTargetZipFileStr );
}
public static void addToZipRecursively( ZipOutputStream zos, File aFile, String aBasePath )
throws FileNotFoundException, IOException
{
- if( aFile.isDirectory() )
- {
- String aDirName = aFile.getName();
- if( aDirName.equalsIgnoreCase( "caption" ) || aDirName.equalsIgnoreCase( "content" ) )
- return;
-
- File[] aChildrenFiles = aFile.listFiles();
- String aNewBasePath = "";
- if( aBasePath != null )
- aNewBasePath += aBasePath + File.separator;
- aNewBasePath += aDirName;
-
- int nFileCount = aChildrenFiles.length;
- for( int i = 0 ; i < nFileCount ; i++ )
- addToZipRecursively( zos, aChildrenFiles[i], aNewBasePath );
-
- return;
- }
-
- // No directory
- // read contents of file we are going to put in the zip
- int fileLength = (int) aFile.length();
- FileInputStream fis = new FileInputStream( aFile );
- byte[] wholeFile = new byte[fileLength];
- int bytesRead = fis.read( wholeFile, 0, fileLength );
- fis.close();
-
- String aFileName = aFile.getName();
- String aEntryName = "";
- if( aBasePath != null )
- aEntryName += aBasePath + "/";
- aEntryName += aFileName;
- ZipEntry aZipEntry = new ZipEntry( aEntryName );
- aZipEntry.setTime( aFile.lastModified() );
- aZipEntry.setSize( fileLength );
-
- int nMethod = ( aFileName.toLowerCase().endsWith( ".jar" ) )
- ? ZipEntry.STORED : ZipEntry.DEFLATED;
- aZipEntry.setMethod( nMethod );
-
- CRC32 tempCRC = new CRC32();
- tempCRC.update( wholeFile, 0, wholeFile.length );
- aZipEntry.setCrc( tempCRC.getValue() );
-
- // write the contents into the zip element
- zos.putNextEntry( aZipEntry );
- zos.write( wholeFile, 0, fileLength );
- zos.closeEntry();
+ helpindexer.addToZipRecursively( zos , aFile , aBasePath );
}
static public boolean deleteRecursively( File aFile )
{
- if( aFile.isDirectory() )
- {
- File[] aChildrenFiles = aFile.listFiles();
- int nFileCount = aChildrenFiles.length;
- for( int i = 0 ; i < nFileCount ; i++ )
- {
- File aChildrenFile = aChildrenFiles[i];
- boolean bSuccess = deleteRecursively( aChildrenFile );
- if( !bSuccess )
- return false;
- }
- }
-
- return aFile.delete();
+ return helpindexer.deleteRecursively( aFile );
}
//===================================================
@@ -371,7 +95,8 @@ public class HelpIndexer extends WeakBase
com.sun.star.script.CannotConvertException,
com.sun.star.reflection.InvocationTargetException
{
- if( !aFunctionName.equals( aCreateIndexMethodName ) )
+ if(
+ !aFunctionName.equals( aCreateIndexMethodName ) )
throw new com.sun.star.lang.IllegalArgumentException();
aOutParamIndex[0] = new short[0];
@@ -421,6 +146,7 @@ public class HelpIndexer extends WeakBase
}
+
/** This method returns an array of all supported service names.
* @return Array of supported service names.
*/
@@ -439,6 +165,7 @@ public class HelpIndexer extends WeakBase
return sSupportedServiceNames;
}
+
/** This method returns true, if the given service will be
* supported by the component.
* @param sServiceName Service name.
@@ -449,6 +176,7 @@ public class HelpIndexer extends WeakBase
return sServiceName.equals( __serviceName );
}
+
/** Return the class name of the component.
* @return Class name of the component.
*/
@@ -456,5 +184,6 @@ public class HelpIndexer extends WeakBase
{
return HelpIndexer.class.getName();
}
+
}
diff --git a/xmlhelp/source/com/sun/star/help/HelpLinker.cxx b/xmlhelp/source/com/sun/star/help/HelpLinker.cxx
deleted file mode 100644
index 67049df439e1..000000000000
--- a/xmlhelp/source/com/sun/star/help/HelpLinker.cxx
+++ /dev/null
@@ -1,1157 +0,0 @@
-/*************************************************************************
- *
- * 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: HelpLinker.cxx,v $
- * $Revision: 1.16 $
- *
- * 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 "HelpCompiler.hxx"
-
-#include <map>
-
-#include <string.h>
-#include <limits.h>
-
-#include <libxslt/xslt.h>
-#include <libxslt/transform.h>
-#include <libxslt/xsltutils.h>
-#include <libxslt/functions.h>
-#include <libxslt/extensions.h>
-
-#include <sal/types.h>
-#include <osl/time.h>
-#include <rtl/bootstrap.hxx>
-
-#ifdef SYSTEM_EXPAT
-#include <expat.h>
-#else
-#include <expat/xmlparse.h>
-#endif
-
-#define DBHELP_ONLY
-
-
-class IndexerPreProcessor
-{
-private:
- std::string m_aModuleName;
- fs::path m_fsIndexBaseDir;
- fs::path m_fsCaptionFilesDirName;
- fs::path m_fsContentFilesDirName;
-
- xsltStylesheetPtr m_xsltStylesheetPtrCaption;
- xsltStylesheetPtr m_xsltStylesheetPtrContent;
-
-public:
- IndexerPreProcessor( const std::string& aModuleName, const fs::path& fsIndexBaseDir,
- const fs::path& idxCaptionStylesheet, const fs::path& idxContentStylesheet );
- ~IndexerPreProcessor();
-
- void processDocument( xmlDocPtr doc, const std::string& EncodedDocPath );
-};
-
-IndexerPreProcessor::IndexerPreProcessor
- ( const std::string& aModuleName, const fs::path& fsIndexBaseDir,
- const fs::path& idxCaptionStylesheet, const fs::path& idxContentStylesheet )
- : m_aModuleName( aModuleName )
- , m_fsIndexBaseDir( fsIndexBaseDir )
-{
- m_fsCaptionFilesDirName = fsIndexBaseDir / "caption";
- fs::create_directory( m_fsCaptionFilesDirName );
-
- m_fsContentFilesDirName = fsIndexBaseDir / "content";
- fs::create_directory( m_fsContentFilesDirName );
-
- m_xsltStylesheetPtrCaption = xsltParseStylesheetFile
- ((const xmlChar *)idxCaptionStylesheet.native_file_string().c_str());
- m_xsltStylesheetPtrContent = xsltParseStylesheetFile
- ((const xmlChar *)idxContentStylesheet.native_file_string().c_str());
-}
-
-IndexerPreProcessor::~IndexerPreProcessor()
-{
- if( m_xsltStylesheetPtrCaption )
- xsltFreeStylesheet( m_xsltStylesheetPtrCaption );
- if( m_xsltStylesheetPtrContent )
- xsltFreeStylesheet( m_xsltStylesheetPtrContent );
-}
-
-
-std::string getEncodedPath( const std::string& Path )
-{
- rtl::OString aOStr_Path( Path.c_str() );
- rtl::OUString aOUStr_Path( rtl::OStringToOUString
- ( aOStr_Path, fs::getThreadTextEncoding() ) );
- rtl::OUString aPathURL;
- osl::File::getFileURLFromSystemPath( aOUStr_Path, aPathURL );
- rtl::OString aOStr_PathURL( rtl::OUStringToOString
- ( aPathURL, fs::getThreadTextEncoding() ) );
- std::string aStdStr_PathURL( aOStr_PathURL.getStr() );
- return aStdStr_PathURL;
-}
-
-void IndexerPreProcessor::processDocument
- ( xmlDocPtr doc, const std::string &EncodedDocPath )
-{
- std::string aStdStr_EncodedDocPathURL = getEncodedPath( EncodedDocPath );
-
- xmlDocPtr resCaption = xsltApplyStylesheet( m_xsltStylesheetPtrCaption, doc, NULL );
- xmlNodePtr pResNodeCaption = resCaption->xmlChildrenNode;
- if( pResNodeCaption )
- {
- fs::path fsCaptionPureTextFile_docURL = m_fsCaptionFilesDirName / aStdStr_EncodedDocPathURL;
- std::string aCaptionPureTextFileStr_docURL = fsCaptionPureTextFile_docURL.native_file_string();
- FILE* pFile_docURL = fopen( aCaptionPureTextFileStr_docURL.c_str(), "w" );
- if( pFile_docURL )
- {
- fprintf( pFile_docURL, "%s\n", pResNodeCaption->content );
- fclose( pFile_docURL );
- }
- }
- xmlFreeDoc(resCaption);
-
- xmlDocPtr resContent = xsltApplyStylesheet( m_xsltStylesheetPtrContent, doc, NULL );
- xmlNodePtr pResNodeContent = resContent->xmlChildrenNode;
- if( pResNodeContent )
- {
- fs::path fsContentPureTextFile_docURL = m_fsContentFilesDirName / aStdStr_EncodedDocPathURL;
- std::string aContentPureTextFileStr_docURL = fsContentPureTextFile_docURL.native_file_string();
- FILE* pFile_docURL = fopen( aContentPureTextFileStr_docURL.c_str(), "w" );
- if( pFile_docURL )
- {
- fprintf( pFile_docURL, "%s\n", pResNodeContent->content );
- fclose( pFile_docURL );
- }
- }
- xmlFreeDoc(resContent);
-}
-
-struct Data
-{
- std::vector<std::string> _idList;
- typedef std::vector<std::string>::const_iterator cIter;
-
- void append(const std::string &id)
- {
- _idList.push_back(id);
- }
-
- std::string getString() const
- {
- std::string ret;
- cIter aEnd = _idList.end();
- for (cIter aIter = _idList.begin(); aIter != aEnd; ++aIter)
- ret += *aIter + ";";
- return ret;
- }
-};
-
-void writeKeyValue_DBHelp( FILE* pFile, const std::string& aKeyStr, const std::string& aValueStr )
-{
- if( pFile == NULL )
- return;
- char cLF = 10;
- int nKeyLen = aKeyStr.length();
- int nValueLen = aValueStr.length();
- fprintf( pFile, "%x ", nKeyLen );
- if( nKeyLen > 0 )
- fwrite( aKeyStr.c_str(), 1, nKeyLen, pFile );
- fprintf( pFile, " %x ", nValueLen );
- if( nValueLen > 0 )
- fwrite( aValueStr.c_str(), 1, nValueLen, pFile );
- fprintf( pFile, "%c", cLF );
-}
-
-class HelpKeyword
-{
-private:
- typedef std::hash_map<std::string, Data, pref_hash> DataHashtable;
- DataHashtable _hash;
-
-public:
- void insert(const std::string &key, const std::string &id)
- {
- Data &data = _hash[key];
- data.append(id);
- }
-
- void dump(DB* table)
- {
- DataHashtable::const_iterator aEnd = _hash.end();
- for (DataHashtable::const_iterator aIter = _hash.begin(); aIter != aEnd; ++aIter)
- {
- const std::string &keystr = aIter->first;
- DBT key;
- memset(&key, 0, sizeof(key));
- key.data = const_cast<char*>(keystr.c_str());
- key.size = keystr.length();
-
- const Data &data = aIter->second;
- std::string str = data.getString();
- DBT value;
- memset(&value, 0, sizeof(value));
- value.data = const_cast<char*>(str.c_str());
- value.size = str.length();
-
- table->put(table, NULL, &key, &value, 0);
- }
- }
-
- void dump_DBHelp( const std::string& rFileName )
- {
- FILE* pFile = fopen( rFileName.c_str(), "wb" );
- if( pFile == NULL )
- return;
-
- DataHashtable::const_iterator aEnd = _hash.end();
- for (DataHashtable::const_iterator aIter = _hash.begin(); aIter != aEnd; ++aIter)
- writeKeyValue_DBHelp( pFile, aIter->first, aIter->second.getString() );
-
- fclose( pFile );
- }
-};
-
-class HelpLinker
-{
-public:
- void main(std::vector<std::string> &args, std::string* pExtensionPath = NULL )
- throw( HelpProcessingException );
-
- HelpLinker()
- : init(true)
- , m_pIndexerPreProcessor(NULL)
- {}
- ~HelpLinker()
- { delete m_pIndexerPreProcessor; }
-
-private:
- int locCount, totCount;
- Stringtable additionalFiles;
- HashSet helpFiles;
- fs::path sourceRoot;
- fs::path embeddStylesheet;
- fs::path idxCaptionStylesheet;
- fs::path idxContentStylesheet;
- fs::path zipdir;
- fs::path outputFile;
- std::string module;
- std::string lang;
- std::string hid;
- std::string extensionPath;
- bool bExtensionMode;
- fs::path indexDirName;
- Stringtable hidlistTranslation;
- fs::path indexDirParentName;
- bool init;
- IndexerPreProcessor* m_pIndexerPreProcessor;
- void initIndexerPreProcessor();
- void link() throw( HelpProcessingException );
- void addBookmark( DB* dbBase, FILE* pFile_DBHelp, std::string thishid,
- const std::string& fileB, const std::string& anchorB,
- const std::string& jarfileB, const std::string& titleB );
-#if 0
- /**
- * @param outputFile
- * @param module
- * @param lang
- * @param hid
- * @param helpFiles
- * @param additionalFiles
- */
-
- private HelpURLStreamHandlerFactory urlHandler = null;
-#endif
-};
-
-namespace URLEncoder
-{
- static std::string encode(const std::string &rIn)
- {
- const char *good = "!$&'()*+,-.=@_";
- static const char hex[17] = "0123456789ABCDEF";
-
- std::string result;
- for (size_t i=0; i < rIn.length(); ++i)
- {
- unsigned char c = rIn[i];
- if (isalnum (c) || strchr (good, c))
- result += c;
- else {
- result += '%';
- result += hex[c >> 4];
- result += hex[c & 0xf];
- }
- }
- return result;
- }
-}
-
-void HelpLinker::addBookmark( DB* dbBase, FILE* pFile_DBHelp, std::string thishid,
- const std::string& fileB, const std::string& anchorB,
- const std::string& jarfileB, const std::string& titleB)
-{
- HCDBG(std::cerr << "HelpLinker::addBookmark " << thishid << " " <<
- fileB << " " << anchorB << " " << jarfileB << " " << titleB << std::endl);
-
- std::string temp = thishid;
- std::transform (temp.begin(), temp.end(), temp.begin(), toupper);
- std::replace(temp.begin(), temp.end(), ':', '_');
- const std::string& translatedHid = hidlistTranslation[temp];
- if (!translatedHid.empty())
- thishid = translatedHid;
-
- thishid = URLEncoder::encode(thishid);
-
- DBT key;
- memset(&key, 0, sizeof(key));
- key.data = const_cast<char*>(thishid.c_str());
- key.size = thishid.length();
-
- int fileLen = fileB.length();
- if (!anchorB.empty())
- fileLen += (1 + anchorB.length());
- int dataLen = 1 + fileLen + 1 + jarfileB.length() + 1 + titleB.length();
-
- std::vector<unsigned char> dataB(dataLen);
- size_t i = 0;
- dataB[i++] = static_cast<unsigned char>(fileLen);
- for (size_t j = 0; j < fileB.length(); ++j)
- dataB[i++] = fileB[j];
- if (!anchorB.empty())
- {
- dataB[i++] = '#';
- for (size_t j = 0; j < anchorB.length(); ++j)
- dataB[i++] = anchorB[j];
- }
- dataB[i++] = static_cast<unsigned char>(jarfileB.length());
- for (size_t j = 0; j < jarfileB.length(); ++j)
- dataB[i++] = jarfileB[j];
-
- dataB[i++] = static_cast<unsigned char>(titleB.length());
- for (size_t j = 0; j < titleB.length(); ++j)
- dataB[i++] = titleB[j];
-
- DBT data;
- memset(&data, 0, sizeof(data));
- data.data = &dataB[0];
- data.size = dataB.size();
-
- if( dbBase != NULL )
- dbBase->put(dbBase, NULL, &key, &data, 0);
-
- if( pFile_DBHelp != NULL )
- {
- std::string aValueStr( dataB.begin(), dataB.end() );
- writeKeyValue_DBHelp( pFile_DBHelp, thishid, aValueStr );
- }
-}
-
-void HelpLinker::initIndexerPreProcessor()
-{
- if( m_pIndexerPreProcessor )
- delete m_pIndexerPreProcessor;
- std::string mod = module;
- std::transform (mod.begin(), mod.end(), mod.begin(), tolower);
- m_pIndexerPreProcessor = new IndexerPreProcessor( mod, indexDirParentName,
- idxCaptionStylesheet, idxContentStylesheet );
-}
-
-/**
-*
-*/
-void HelpLinker::link() throw( HelpProcessingException )
-{
- bool bIndexForExtension = true;
-
- if( bExtensionMode )
- {
- indexDirParentName = sourceRoot;
- }
- else
- {
- indexDirParentName = zipdir;
- fs::create_directory(indexDirParentName);
- }
-
-#ifdef CMC_DEBUG
- std::cerr << "will not delete tmpdir of " << indexDirParentName.native_file_string().c_str() << std::endl;
-#endif
-
- std::string mod = module;
- std::transform (mod.begin(), mod.end(), mod.begin(), tolower);
-
- // do the work here
- // continue with introduction of the overall process thing into the
- // here all hzip files will be worked on
- std::string appl = mod;
- if (appl[0] == 's')
- appl = appl.substr(1);
-
- bool bUse_ = true;
-#ifdef DBHELP_ONLY
- if( !bExtensionMode )
- bUse_ = false;
-#endif
-
- DB* helpText(0);
-#ifndef DBHELP_ONLY
- fs::path helpTextFileName(indexDirParentName / (mod + ".ht"));
- db_create(&helpText,0,0);
- helpText->open(helpText, NULL, helpTextFileName.native_file_string().c_str(), NULL, DB_BTREE,
- DB_CREATE | DB_TRUNCATE, 0644);
-#endif
-
- fs::path helpTextFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".ht_" : ".ht")));
- FILE* pFileHelpText_DBHelp = fopen
- ( helpTextFileName_DBHelp.native_file_string().c_str(), "wb" );
-
- DB* dbBase(0);
-#ifndef DBHELP_ONLY
- fs::path dbBaseFileName(indexDirParentName / (mod + ".db"));
- db_create(&dbBase,0,0);
- dbBase->open(dbBase, NULL, dbBaseFileName.native_file_string().c_str(), NULL, DB_BTREE,
- DB_CREATE | DB_TRUNCATE, 0644);
-#endif
-
- fs::path dbBaseFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".db_" : ".db")));
- FILE* pFileDbBase_DBHelp = fopen
- ( dbBaseFileName_DBHelp.native_file_string().c_str(), "wb" );
-
-#ifndef DBHELP_ONLY
- DB* keyWord(0);
- fs::path keyWordFileName(indexDirParentName / (mod + ".key"));
- db_create(&keyWord,0,0);
- keyWord->open(keyWord, NULL, keyWordFileName.native_file_string().c_str(), NULL, DB_BTREE,
- DB_CREATE | DB_TRUNCATE, 0644);
-#endif
-
- fs::path keyWordFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".key_" : ".key")));
-
- HelpKeyword helpKeyword;
-
- // catch HelpProcessingException to avoid locking data bases
- try
- {
-
- std::ifstream fileReader(hid.c_str());
- while (fileReader)
- {
- std::string key;
- fileReader >> key;
- std::transform (key.begin(), key.end(), key.begin(), toupper);
- std::replace(key.begin(), key.end(), ':', '_');
- std::string data;
- fileReader >> data;
- if (!key.empty() && !data.empty())
- hidlistTranslation[key] = data;
- }
- fileReader.close();
-
- // lastly, initialize the indexBuilder
- if ( (!bExtensionMode || bIndexForExtension) && !helpFiles.empty())
- initIndexerPreProcessor();
-
- if( !bExtensionMode )
- {
- std::cout << "Making " << outputFile.native_file_string() <<
- " from " << helpFiles.size() << " input files" << std::endl;
- }
-
- // here we start our loop over the hzip files.
- HashSet::iterator end = helpFiles.end();
- for (HashSet::iterator iter = helpFiles.begin(); iter != end; ++iter)
- {
- if( !bExtensionMode )
- {
- std::cout << ".";
- std::cout.flush();
- }
-
- // process one file
- // streamTable contains the streams in the hzip file
- StreamTable streamTable;
- const std::string &xhpFileName = *iter;
-
- if (!bExtensionMode && xhpFileName.rfind(".xhp") != xhpFileName.length()-4)
- {
- // only work on .xhp - files
- std::cerr <<
- "ERROR: input list entry '"
- << xhpFileName
- << "' has the wrong extension (only files with extension .xhp "
- << "are accepted)";
- continue;
- }
-
- fs::path langsourceRoot(sourceRoot);
- fs::path xhpFile;
-
- if( bExtensionMode )
- {
- // langsourceRoot == sourceRoot for extensions
- std::string xhpFileNameComplete( extensionPath );
- xhpFileNameComplete.append( '/' + xhpFileName );
- xhpFile = fs::path( xhpFileNameComplete );
- }
- else
- {
- langsourceRoot.append('/' + lang + '/');
- xhpFile = fs::path(xhpFileName, fs::native);
- }
-
- HelpCompiler hc( streamTable, xhpFile, langsourceRoot,
- embeddStylesheet, module, lang, bExtensionMode );
-
- HCDBG(std::cerr << "before compile of " << xhpFileName << std::endl);
- bool success = hc.compile();
- HCDBG(std::cerr << "after compile of " << xhpFileName << std::endl);
-
- if (!success && !bExtensionMode)
- {
- std::stringstream aStrStream;
- aStrStream <<
- "\nERROR: compiling help particle '"
- << xhpFileName
- << "' for language '"
- << lang
- << "' failed!";
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
- const std::string documentBaseId = streamTable.document_id;
- std::string documentPath = streamTable.document_path;
- if (documentPath.find("/") == 0)
- documentPath = documentPath.substr(1);
-
- std::string documentJarfile = streamTable.document_module + ".jar";
-
- std::string documentTitle = streamTable.document_title;
- if (documentTitle.empty())
- documentTitle = "<notitle>";
-
-#if 0
- std::cout << "for " << xhpFileName << " documentBaseId is " << documentBaseId << "\n";
- std::cout << "for " << xhpFileName << " documentPath is " << documentPath << "\n";
- std::cout << "for " << xhpFileName << " documentJarfile is " << documentJarfile << "\n";
- std::cout << "for " << xhpFileName << " documentPath is " << documentTitle << "\n";
-#endif
-
- const std::string& fileB = documentPath;
- const std::string& jarfileB = documentJarfile;
- std::string& titleB = documentTitle;
-
- // add once this as its own id.
- addBookmark(dbBase, pFileDbBase_DBHelp, documentPath, fileB, std::string(), jarfileB, titleB);
-
- // first the database *.db
- // ByteArrayInputStream bais = null;
- // ObjectInputStream ois = null;
-
- const HashSet *hidlist = streamTable.appl_hidlist;
- if (!hidlist)
- hidlist = streamTable.default_hidlist;
- if (hidlist && !hidlist->empty())
- {
- // now iterate over all elements of the hidlist
- HashSet::const_iterator aEnd = hidlist->end();
- for (HashSet::const_iterator hidListIter = hidlist->begin();
- hidListIter != aEnd; ++hidListIter)
- {
- std::string thishid = *hidListIter;
-
- std::string anchorB;
- size_t index = thishid.rfind('#');
- if (index != std::string::npos)
- {
- anchorB = thishid.substr(1 + index);
- thishid = thishid.substr(0, index);
- }
- addBookmark(dbBase, pFileDbBase_DBHelp, thishid, fileB, anchorB, jarfileB, titleB);
- }
- }
-
- // now the keywords
- const Hashtable *anchorToLL = streamTable.appl_keywords;
- if (!anchorToLL)
- anchorToLL = streamTable.default_keywords;
- if (anchorToLL && !anchorToLL->empty())
- {
- std::string fakedHid = URLEncoder::encode(documentPath);
- Hashtable::const_iterator aEnd = anchorToLL->end();
- for (Hashtable::const_iterator enumer = anchorToLL->begin();
- enumer != aEnd; ++enumer)
- {
- const std::string &anchor = enumer->first;
- addBookmark(dbBase, pFileDbBase_DBHelp, documentPath, fileB,
- anchor, jarfileB, titleB);
- std::string totalId = fakedHid + "#" + anchor;
- // std::cerr << hzipFileName << std::endl;
- const LinkedList& ll = enumer->second;
- LinkedList::const_iterator aOtherEnd = ll.end();
- for (LinkedList::const_iterator llIter = ll.begin();
- llIter != aOtherEnd; ++llIter)
- {
- helpKeyword.insert(*llIter, totalId);
- }
- }
-
- }
-
- // and last the helptexts
- const Stringtable *helpTextHash = streamTable.appl_helptexts;
- if (!helpTextHash)
- helpTextHash = streamTable.default_helptexts;
- if (helpTextHash && !helpTextHash->empty())
- {
- Stringtable::const_iterator aEnd = helpTextHash->end();
- for (Stringtable::const_iterator helpTextIter = helpTextHash->begin();
- helpTextIter != aEnd; ++helpTextIter)
- {
- std::string helpTextId = helpTextIter->first;
- const std::string& helpTextText = helpTextIter->second;
-
- std::string temp = helpTextId;
- std::transform (temp.begin(), temp.end(), temp.begin(), toupper);
- std::replace(temp.begin(), temp.end(), ':', '_');
-
- const std::string& tHid = hidlistTranslation[temp];
- if (!tHid.empty())
- helpTextId = tHid;
- helpTextId = URLEncoder::encode(helpTextId);
-
- DBT keyDbt;
- memset(&keyDbt, 0, sizeof(keyDbt));
- keyDbt.data = const_cast<char*>(helpTextId.c_str());
- keyDbt.size = helpTextId.length();
-
- DBT textDbt;
- memset(&textDbt, 0, sizeof(textDbt));
- textDbt.data = const_cast<char*>(helpTextText.c_str());
- textDbt.size = helpTextText.length();
-
- if( helpText != NULL )
- helpText->put(helpText, NULL, &keyDbt, &textDbt, 0);
-
- if( pFileHelpText_DBHelp != NULL )
- writeKeyValue_DBHelp( pFileHelpText_DBHelp, helpTextId, helpTextText );
- }
- }
-
- //IndexerPreProcessor
- if( !bExtensionMode || bIndexForExtension )
- {
- // now the indexing
- xmlDocPtr document = streamTable.appl_doc;
- if (!document)
- document = streamTable.default_doc;
- if (document)
- {
- std::string temp = module;
- std::transform (temp.begin(), temp.end(), temp.begin(), tolower);
- m_pIndexerPreProcessor->processDocument(document, URLEncoder::encode(documentPath) );
- }
- }
-
- } // while loop over hzip files ending
- if( !bExtensionMode )
- std::cout << std::endl;
-
- } // try
- catch( HelpProcessingException& )
- {
- // catch HelpProcessingException to avoid locking data bases
-#ifndef DBHELP_ONLY
- helpText->close(helpText, 0);
- dbBase->close(dbBase, 0);
- keyWord->close(keyWord, 0);
-#endif
- if( pFileHelpText_DBHelp != NULL )
- fclose( pFileHelpText_DBHelp );
- if( pFileDbBase_DBHelp != NULL )
- fclose( pFileDbBase_DBHelp );
- throw;
- }
-
-#ifndef DBHELP_ONLY
- helpText->close(helpText, 0);
- dbBase->close(dbBase, 0);
- helpKeyword.dump(keyWord);
- keyWord->close(keyWord, 0);
-#endif
- if( pFileHelpText_DBHelp != NULL )
- fclose( pFileHelpText_DBHelp );
- if( pFileDbBase_DBHelp != NULL )
- fclose( pFileDbBase_DBHelp );
-
- helpKeyword.dump_DBHelp( keyWordFileName_DBHelp.native_file_string() );
-
- if( !bExtensionMode )
- {
- // New index
- Stringtable::iterator aEnd = additionalFiles.end();
- for (Stringtable::iterator enumer = additionalFiles.begin(); enumer != aEnd;
- ++enumer)
- {
- const std::string &additionalFileName = enumer->second;
- const std::string &additionalFileKey = enumer->first;
-
- fs::path fsAdditionalFileName( additionalFileName, fs::native );
- std::string aNativeStr = fsAdditionalFileName.native_file_string();
- const char* pStr = aNativeStr.c_str();
- std::cerr << pStr;
-
- fs::path fsTargetName( indexDirParentName / additionalFileKey );
-
- fs::copy( fsAdditionalFileName, fsTargetName );
- }
- }
-
-/*
- /////////////////////////////////////////////////////////////////////////
- /// remove temprary directory for index creation
- /////////////////////////////////////////////////////////////////////////
-#ifndef CMC_DEBUG
- if( !bExtensionMode )
- fs::remove_all( indexDirParentName );
-#endif
-*/
-}
-
-
-void HelpLinker::main(std::vector<std::string> &args, std::string* pExtensionPath)
- throw( HelpProcessingException )
-{
- rtl::OUString aOfficeHelpPath;
-
- bExtensionMode = false;
- if( pExtensionPath && pExtensionPath->length() > 0 )
- {
- helpFiles.clear();
- bExtensionMode = true;
- extensionPath = *pExtensionPath;
- sourceRoot = fs::path(extensionPath);
-
- aOfficeHelpPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("$OOO_BASE_DIR/help") );
- rtl::Bootstrap::expandMacros( aOfficeHelpPath );
- }
- if (args.size() > 0 && args[0][0] == '@')
- {
- std::vector<std::string> stringList;
- std::string strBuf;
- std::ifstream fileReader(args[0].substr(1).c_str());
-
- while (fileReader)
- {
- std::string token;
- fileReader >> token;
- if (!token.empty())
- stringList.push_back(token);
- }
- fileReader.close();
-
- args = stringList;
- }
-
- size_t i = 0;
-
- while (i < args.size())
- {
- if (args[i].compare("-src") == 0)
- {
- ++i;
- if (i >= args.size())
- {
- std::stringstream aStrStream;
- aStrStream << "sourceroot missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
- if( !bExtensionMode )
- sourceRoot = fs::path(args[i], fs::native);
- }
- else if (args[i].compare("-sty") == 0)
- {
- ++i;
- if (i >= args.size())
- {
- std::stringstream aStrStream;
- aStrStream << "embeddingStylesheet missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
- embeddStylesheet = fs::path(args[i], fs::native);
- }
- else if (args[i].compare("-zipdir") == 0)
- {
- ++i;
- if (i >= args.size())
- {
- std::stringstream aStrStream;
- aStrStream << "idxtemp missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
- zipdir = fs::path(args[i], fs::native);
- }
- else if (args[i].compare("-idxcaption") == 0)
- {
- ++i;
- if (i >= args.size())
- {
- std::stringstream aStrStream;
- aStrStream << "idxcaption stylesheet missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
- idxCaptionStylesheet = fs::path(args[i], fs::native);
- }
- else if (args[i].compare("-idxcontent") == 0)
- {
- ++i;
- if (i >= args.size())
- {
- std::stringstream aStrStream;
- aStrStream << "idxcontent stylesheet missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
- idxContentStylesheet = fs::path(args[i], fs::native);
- }
- else if (args[i].compare("-o") == 0)
- {
- ++i;
- if (i >= args.size())
- {
- std::stringstream aStrStream;
- aStrStream << "outputfilename missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
- outputFile = fs::path(args[i], fs::native);
- }
- else if (args[i].compare("-mod") == 0)
- {
- ++i;
- if (i >= args.size())
- {
- std::stringstream aStrStream;
- aStrStream << "module name missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
- module = args[i];
- }
- else if (args[i].compare("-lang") == 0)
- {
- ++i;
- if (i >= args.size())
- {
- std::stringstream aStrStream;
- aStrStream << "language name missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
- lang = args[i];
- }
- else if (args[i].compare("-hid") == 0)
- {
- ++i;
- if (i >= args.size())
- {
- std::stringstream aStrStream;
- aStrStream << "hid list missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
- hid = args[i];
- }
- else if (args[i].compare("-add") == 0)
- {
- std::string addFile, addFileUnderPath;
- ++i;
- if (i >= args.size())
- {
- std::stringstream aStrStream;
- aStrStream << "pathname missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
- addFileUnderPath = args[i];
- ++i;
- if (i >= args.size())
- {
- std::stringstream aStrStream;
- aStrStream << "pathname missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
- addFile = args[i];
- if (!addFileUnderPath.empty() && !addFile.empty())
- additionalFiles[addFileUnderPath] = addFile;
- }
- else
- helpFiles.push_back(args[i]);
- ++i;
- }
-
- if (!bExtensionMode && zipdir.empty())
- {
- std::stringstream aStrStream;
- aStrStream << "no index dir given" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
- if (!bExtensionMode && idxCaptionStylesheet.empty())
- {
- std::stringstream aStrStream;
- aStrStream << "no index caption stylesheet given" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
- else if ( bExtensionMode )
- {
- rtl::OUString aIdxCaptionPathFileURL( aOfficeHelpPath );
- aIdxCaptionPathFileURL += rtl::OUString::createFromAscii( "/idxcaption.xsl" );
-
- rtl::OString aOStr_IdxCaptionPathFileURL( rtl::OUStringToOString
- ( aIdxCaptionPathFileURL, fs::getThreadTextEncoding() ) );
- std::string aStdStr_IdxCaptionPathFileURL( aOStr_IdxCaptionPathFileURL.getStr() );
-
- idxCaptionStylesheet = fs::path( aStdStr_IdxCaptionPathFileURL );
- }
- if (!bExtensionMode && idxContentStylesheet.empty())
- {
- std::stringstream aStrStream;
- aStrStream << "no index content stylesheet given" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
- else if ( bExtensionMode )
- {
- rtl::OUString aIdxContentPathFileURL( aOfficeHelpPath );
- aIdxContentPathFileURL += rtl::OUString::createFromAscii( "/idxcontent.xsl" );
-
- rtl::OString aOStr_IdxContentPathFileURL( rtl::OUStringToOString
- ( aIdxContentPathFileURL, fs::getThreadTextEncoding() ) );
- std::string aStdStr_IdxContentPathFileURL( aOStr_IdxContentPathFileURL.getStr() );
-
- idxContentStylesheet = fs::path( aStdStr_IdxContentPathFileURL );
- }
- if (!bExtensionMode && embeddStylesheet.empty())
- {
- std::stringstream aStrStream;
- aStrStream << "no embedding resolving file given" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
- if (sourceRoot.empty())
- {
- std::stringstream aStrStream;
- aStrStream << "no sourceroot given" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
- if (!bExtensionMode && outputFile.empty())
- {
- std::stringstream aStrStream;
- aStrStream << "no output file given" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
- if (module.empty())
- {
- std::stringstream aStrStream;
- aStrStream << "module missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
- if (!bExtensionMode && lang.empty())
- {
- std::stringstream aStrStream;
- aStrStream << "language missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
- if (!bExtensionMode && hid.empty())
- {
- std::stringstream aStrStream;
- aStrStream << "hid list missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
- link();
-}
-
-int main(int argc, char**argv)
-{
- sal_uInt32 starttime = osl_getGlobalTimer();
- std::vector<std::string> args;
- for (int i = 1; i < argc; ++i)
- args.push_back(std::string(argv[i]));
- try
- {
- HelpLinker* pHelpLinker = new HelpLinker();
- pHelpLinker->main( args );
- delete pHelpLinker;
- }
- catch( const HelpProcessingException& e )
- {
- std::cerr << e.m_aErrorMsg;
- exit(1);
- }
- sal_uInt32 endtime = osl_getGlobalTimer();
- std::cout << "time taken was " << (endtime-starttime)/1000.0 << " seconds" << std::endl;
- return 0;
-}
-
-// Variable to set an exception in "C" StructuredXMLErrorFunction
-static const HelpProcessingException* GpXMLParsingException = NULL;
-
-extern "C" void StructuredXMLErrorFunction(void *userData, xmlErrorPtr error)
-{
- (void)userData;
- (void)error;
-
- std::string aErrorMsg = error->message;
- std::string aXMLParsingFile;
- if( error->file != NULL )
- aXMLParsingFile = error->file;
- int nXMLParsingLine = error->line;
- HelpProcessingException* pException = new HelpProcessingException( aErrorMsg, aXMLParsingFile, nXMLParsingLine );
- GpXMLParsingException = pException;
-
- // Reset error handler
- xmlSetStructuredErrorFunc( NULL, NULL );
-}
-
-HelpProcessingErrorInfo& HelpProcessingErrorInfo::operator=( const struct HelpProcessingException& e )
-{
- m_eErrorClass = e.m_eErrorClass;
- rtl::OString tmpErrorMsg( e.m_aErrorMsg.c_str() );
- m_aErrorMsg = rtl::OStringToOUString( tmpErrorMsg, fs::getThreadTextEncoding() );
- rtl::OString tmpXMLParsingFile( e.m_aXMLParsingFile.c_str() );
- m_aXMLParsingFile = rtl::OStringToOUString( tmpXMLParsingFile, fs::getThreadTextEncoding() );
- m_nXMLParsingLine = e.m_nXMLParsingLine;
- return *this;
-}
-
-
-// Returns true in case of success, false in case of error
-HELPLINKER_DLLPUBLIC bool compileExtensionHelp
-(
- const rtl::OUString& aExtensionName,
- const rtl::OUString& aExtensionLanguageRoot,
- sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles,
- HelpProcessingErrorInfo& o_rHelpProcessingErrorInfo
-)
-{
- bool bSuccess = true;
-
- sal_Int32 argc = nXhpFileCount + 3;
- const char** argv = new const char*[argc];
- argv[0] = "";
- argv[1] = "-mod";
- rtl::OString aOExtensionName = rtl::OUStringToOString( aExtensionName, fs::getThreadTextEncoding() );
- argv[2] = aOExtensionName.getStr();
-
- for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp )
- {
- rtl::OUString aXhpFile = pXhpFiles[iXhp];
-
- rtl::OString aOXhpFile = rtl::OUStringToOString( aXhpFile, fs::getThreadTextEncoding() );
- char* pArgStr = new char[aOXhpFile.getLength() + 1];
- strcpy( pArgStr, aOXhpFile.getStr() );
- argv[iXhp + 3] = pArgStr;
- }
-
- std::vector<std::string> args;
- for( sal_Int32 i = 1; i < argc; ++i )
- args.push_back(std::string( argv[i]) );
-
- for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp )
- delete argv[iXhp + 3];
- delete[] argv;
-
- rtl::OString aOExtensionLanguageRoot = rtl::OUStringToOString( aExtensionLanguageRoot, fs::getThreadTextEncoding() );
- const char* pExtensionPath = aOExtensionLanguageRoot.getStr();
- std::string aStdStrExtensionPath = pExtensionPath;
-
- // Set error handler
- xmlSetStructuredErrorFunc( NULL, (xmlStructuredErrorFunc)StructuredXMLErrorFunction );
- try
- {
- HelpLinker* pHelpLinker = new HelpLinker();
- pHelpLinker->main( args,&aStdStrExtensionPath );
- delete pHelpLinker;
- }
- catch( const HelpProcessingException& e )
- {
- if( GpXMLParsingException != NULL )
- {
- o_rHelpProcessingErrorInfo = *GpXMLParsingException;
- delete GpXMLParsingException;
- GpXMLParsingException = NULL;
- }
- else
- {
- o_rHelpProcessingErrorInfo = e;
- }
- bSuccess = false;
- }
- // Reset error handler
- xmlSetStructuredErrorFunc( NULL, NULL );
-
- // i83624: Tree files
- ::rtl::OUString aTreeFileURL = aExtensionLanguageRoot;
- aTreeFileURL += rtl::OUString::createFromAscii( "/help.tree" );
- osl::DirectoryItem aTreeFileItem;
- osl::FileBase::RC rcGet = osl::DirectoryItem::get( aTreeFileURL, aTreeFileItem );
- osl::FileStatus aFileStatus( FileStatusMask_FileSize );
- if( rcGet == osl::FileBase::E_None &&
- aTreeFileItem.getFileStatus( aFileStatus ) == osl::FileBase::E_None &&
- aFileStatus.isValid( FileStatusMask_FileSize ) )
- {
- sal_uInt64 ret, len = aFileStatus.getFileSize();
- char* s = new char[ int(len) ]; // the buffer to hold the installed files
- osl::File aFile( aTreeFileURL );
- aFile.open( OpenFlag_Read );
- aFile.read( s, len, ret );
- aFile.close();
-
- XML_Parser parser = XML_ParserCreate( 0 );
- int parsed = XML_Parse( parser, s, int( len ), true );
-
- if( parsed == 0 )
- {
- XML_Error nError = XML_GetErrorCode( parser );
- o_rHelpProcessingErrorInfo.m_eErrorClass = HELPPROCESSING_XMLPARSING_ERROR;
- o_rHelpProcessingErrorInfo.m_aErrorMsg = rtl::OUString::createFromAscii( XML_ErrorString( nError ) );;
- o_rHelpProcessingErrorInfo.m_aXMLParsingFile = aTreeFileURL;
- // CRAHSES!!! o_rHelpProcessingErrorInfo.m_nXMLParsingLine = XML_GetCurrentLineNumber( parser );
- bSuccess = false;
- }
-
- XML_ParserFree( parser );
- delete[] s;
- }
-
- return bSuccess;
-}
-
-// vnd.sun.star.help://swriter/52821?Language=en-US&System=UNIX
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
-
diff --git a/xmlhelp/source/com/sun/star/help/makefile.mk b/xmlhelp/source/com/sun/star/help/makefile.mk
index c30b36bea8a5..1e1a2c518fa0 100644
--- a/xmlhelp/source/com/sun/star/help/makefile.mk
+++ b/xmlhelp/source/com/sun/star/help/makefile.mk
@@ -56,62 +56,36 @@ CFLAGS+=-DSYSTEM_DB -I$(DB_INCLUDES)
CFLAGS+=-DSYSTEM_EXPAT
.ENDIF
-OBJFILES=\
- $(OBJ)$/HelpLinker.obj \
- $(OBJ)$/HelpCompiler.obj
-SLOFILES=\
- $(SLO)$/HelpLinker.obj \
- $(SLO)$/HelpCompiler.obj
-
-EXCEPTIONSFILES=\
- $(OBJ)$/HelpLinker.obj \
- $(OBJ)$/HelpCompiler.obj \
- $(SLO)$/HelpLinker.obj \
- $(SLO)$/HelpCompiler.obj
-.IF "$(OS)" == "MACOSX" && "$(CPU)" == "P" && "$(COM)" == "GCC"
-# There appears to be a GCC 4.0.1 optimization error causing _file:good() to
-# report true right before the call to writeOut at HelpLinker.cxx:1.12 l. 954
-# but out.good() to report false right at the start of writeOut at
-# HelpLinker.cxx:1.12 l. 537:
-NOOPTFILES=\
- $(OBJ)$/HelpLinker.obj \
- $(SLO)$/HelpLinker.obj
-.ENDIF
-APP1TARGET= $(TARGET)
-APP1OBJS=\
- $(OBJ)$/HelpLinker.obj \
- $(OBJ)$/HelpCompiler.obj
-APP1RPATH=NONE
+JAVACLASSFILES = \
+ $(SOLARBINDIR)$/help$/$(PACKAGE)$/HelpIndexerTool.class \
+ $(SOLARBINDIR)$/help$/$(PACKAGE)$/HelpFileDocument.class \
+ $(CLASSDIR)$/$(PACKAGE)$/HelpSearch.class \
+ $(CLASSDIR)$/$(PACKAGE)$/HelpComponent.class \
+ $(CLASSDIR)$/$(PACKAGE)$/HelpIndexer.class
-APP1STDLIBS+=$(SALLIB) $(BERKELEYLIB) $(XSLTLIB) $(EXPATASCII3RDLIB)
+JAVAFILES = \
+ HelpSearch.java \
+ HelpComponent.java \
+ HelpIndexer.java
-SHL1TARGET =$(LIBBASENAME)$(DLLPOSTFIX)
-SHL1LIBS= $(SLB)$/$(TARGET).lib
-SHL1IMPLIB =i$(LIBBASENAME)
-SHL1DEF =$(MISC)$/$(SHL1TARGET).def
-SHL1STDLIBS =$(SALLIB) $(BERKELEYLIB) $(XSLTLIB) $(EXPATASCII3RDLIB)
-SHL1USE_EXPORTS =ordinal
+TRANSEX3FILES = \
+ $(SOLARBINDIR)$/help$/$(PACKAGE)$/HelpIndexerTool.class \
+ $(SOLARBINDIR)$/help$/$(PACKAGE)$/HelpFileDocument.class
-DEF1NAME =$(SHL1TARGET)
-DEFLIB1NAME =$(TARGET)
+ADDFILES = $(subst,$(SOLARBINDIR)$/help,$(CLASSDIR) $(TRANSEX3FILES))
-JAVACLASSFILES = \
- $(CLASSDIR)$/$(PACKAGE)$/HelpSearch.class \
- $(CLASSDIR)$/$(PACKAGE)$/HelpIndexer.class \
- $(CLASSDIR)$/$(PACKAGE)$/HelpComponent.class \
- $(CLASSDIR)$/$(PACKAGE)$/HelpFileDocument.class
+#JAVAFILES = $(subst,$(CLASSDIR)$/$(PACKAGE)$/, $(subst,.class,.java $(JAVACLASSFILES)))
-JARFILES = ridl.jar jurt.jar unoil.jar juh.jar
+JARFILES = ridl.jar jurt.jar unoil.jar juh.jar HelpIndexerTool.jar
.IF "$(SYSTEM_LUCENE)" == "YES"
XCLASSPATH!:=$(XCLASSPATH)$(PATH_SEPERATOR)$(LUCENE_CORE_JAR)$(PATH_SEPERATOR)$(LUCENE_ANALYZERS_JAR)
COMP=fix_system_lucene
.ELSE
JARFILES += lucene-core-2.3.jar lucene-analyzers-2.3.jar
.ENDIF
-JAVAFILES = $(subst,$(CLASSDIR)$/$(PACKAGE)$/, $(subst,.class,.java $(JAVACLASSFILES)))
-JARTARGET = LuceneHelpWrapper.jar
+JARTARGET = LuceneHelpWrapper.jar
JARCOMPRESS = TRUE
CUSTOMMANIFESTFILE = MANIFEST.MF
@@ -119,10 +93,18 @@ CUSTOMMANIFESTFILE = MANIFEST.MF
.INCLUDE : target.mk
+ALLTAR : $(ADDFILES)
+
.IF "$(JARTARGETN)"!=""
+$(JARTARGETN) : $(ADDFILES)
$(JARTARGETN) : $(COMP)
.ENDIF
+$(CLASSDIR)$/$(PACKAGE)$/%.class : $(SOLARBINDIR)$/help$/$(PACKAGE)$/%.class
+ $(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
+
+
fix_system_lucene:
@echo "Fix Java Class-Path entry for Lucene libraries from system."
@$(SED) -r -e "s#^(Class-Path:).*#\1 file://$(LUCENE_CORE_JAR) file://$(LUCENE_ANALYZERS_JAR)#" \
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 8130e5f38bd2..050b5d419c99 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -52,6 +52,7 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/beans/Optional.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/frame/XConfigManager.hpp>
#include <com/sun/star/util/XMacroExpander.hpp>
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
@@ -59,7 +60,8 @@
#include <com/sun/star/script/XInvocation.hpp>
#include <comphelper/locale.hxx>
-#include <xmlhelp/compilehelp.hxx>
+#include <transex3/compilehelp.hxx>
+#include <comphelper/storagehelper.hxx>
#include "databases.hxx"
#include "urlparameter.hxx"
@@ -1085,7 +1087,7 @@ Reference< XHierarchicalNameAccess > Databases::jarFile( const rtl::OUString& ja
zipFile = getInstallPathAsURL() + key;
}
- Sequence< Any > aArguments( 1 );
+ Sequence< Any > aArguments( 2 );
XInputStream_impl* p = new XInputStream_impl( zipFile );
if( p->CtorSuccess() )
@@ -1099,6 +1101,12 @@ Reference< XHierarchicalNameAccess > Databases::jarFile( const rtl::OUString& ja
aArguments[ 0 ] <<= zipFile;
}
+ // let ZipPackage be used ( no manifest.xml is required )
+ beans::NamedValue aArg;
+ aArg.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StorageFormat" ) );
+ aArg.Value <<= ZIP_STORAGE_FORMAT_STRING;
+ aArguments[ 1 ] <<= aArg;
+
Reference< XInterface > xIfc
= m_xSMgr->createInstanceWithArgumentsAndContext(
rtl::OUString::createFromAscii(
@@ -1867,9 +1875,15 @@ Reference< XHierarchicalNameAccess > JarFileIterator::implGetJarFromPackage
try
{
- Sequence< Any > aArguments( 1 );
+ Sequence< Any > aArguments( 2 );
aArguments[ 0 ] <<= zipFile;
+ // let ZipPackage be used ( no manifest.xml is required )
+ beans::NamedValue aArg;
+ aArg.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StorageFormat" ) );
+ aArg.Value <<= ZIP_STORAGE_FORMAT_STRING;
+ aArguments[ 1 ] <<= aArg;
+
Reference< XMultiComponentFactory >xSMgr( m_xContext->getServiceManager(), UNO_QUERY );
Reference< XInterface > xIfc
= xSMgr->createInstanceWithArgumentsAndContext(
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
index 4e7e2efb2a84..d46758ba2ee7 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
@@ -749,8 +749,8 @@ fileMatch(const char * URI) {
}
static int
-pkgMatch(const char * URI) {
- if ((URI != NULL) && !strncmp(URI, "vnd.sun.star.pkg:/", 18))
+zipMatch(const char * URI) {
+ if ((URI != NULL) && !strncmp(URI, "vnd.sun.star.zip:/", 18))
return 1;
return 0;
}
@@ -770,7 +770,7 @@ fileOpen(const char *URI) {
}
static void *
-pkgOpen(const char * /*URI*/) {
+zipOpen(const char * /*URI*/) {
rtl::OUString language,jar,path;
if( ugblData->m_pInitial->get_eid().getLength() )
@@ -855,7 +855,7 @@ helpRead(void * context, char * buffer, int len) {
}
static int
-pkgRead(void * context, char * buffer, int len) {
+zipRead(void * context, char * buffer, int len) {
if( ugblData->m_pInitial->get_eid().getLength() )
{
ugblData->m_pDatabases->popupDocument( ugblData->m_pInitial,&buffer,&len);
@@ -1080,7 +1080,7 @@ InputStreamTransformer::InputStreamTransformer( URLParameter* urlParam,
ugblData = &userData;
- xmlRegisterInputCallbacks(pkgMatch, pkgOpen, pkgRead, uriClose);
+ xmlRegisterInputCallbacks(zipMatch, zipOpen, zipRead, uriClose);
xmlRegisterInputCallbacks(helpMatch, helpOpen, helpRead, uriClose);
xmlRegisterInputCallbacks(fileMatch, fileOpen, fileRead, fileClose);
//xmlSetStructuredErrorFunc( NULL, (xmlStructuredErrorFunc)StructuredXMLErrorFunction );
@@ -1088,7 +1088,7 @@ InputStreamTransformer::InputStreamTransformer( URLParameter* urlParam,
xsltStylesheetPtr cur =
xsltParseStylesheetFile((const xmlChar *)xslURLascii.getStr());
- xmlDocPtr doc = xmlParseFile("vnd.sun.star.pkg:/");
+ xmlDocPtr doc = xmlParseFile("vnd.sun.star.zip:/");
xmlDocPtr res = xsltApplyStylesheet(cur, doc, parameter);
if (res)
@@ -1101,7 +1101,7 @@ InputStreamTransformer::InputStreamTransformer( URLParameter* urlParam,
}
xmlPopInputCallbacks(); //filePatch
xmlPopInputCallbacks(); //helpPatch
- xmlPopInputCallbacks(); //pkgMatch
+ xmlPopInputCallbacks(); //zipMatch
xmlFreeDoc(res);
xmlFreeDoc(doc);
xsltFreeStylesheet(cur);
diff --git a/xmloff/inc/txtflde.hxx b/xmloff/inc/txtflde.hxx
index 15062560da24..a06bbeab8326 100644
--- a/xmloff/inc/txtflde.hxx
+++ b/xmloff/inc/txtflde.hxx
@@ -191,7 +191,7 @@ public:
/// to be called for every field during style export.
void ExportFieldAutoStyle(const ::com::sun::star::uno::Reference <
::com::sun::star::text::XTextField > & rTextField,
- sal_Bool bProgress );
+ const sal_Bool bProgress, const sal_Bool bRecursive );
/// export field declarations.
/// to be called once at beginning of document body.
diff --git a/xmloff/inc/xmlnmspe.hxx b/xmloff/inc/xmlnmspe.hxx
index a79890f19a7d..f90ff05c084d 100644
--- a/xmloff/inc/xmlnmspe.hxx
+++ b/xmloff/inc/xmlnmspe.hxx
@@ -82,7 +82,15 @@ XML_NAMESPACE( OF, 34U ) // OpenFormula aka ODFF
XML_NAMESPACE( XHTML, 35U )
XML_NAMESPACE( GRDDL, 36U )
-#define _XML_OLD_NAMESPACE_BASE 37U
+// namespaces for odf extended formats
+
+#define XML_NAMESPACE_EXT( prefix, key ) \
+const sal_uInt16 XML_NAMESPACE_##prefix##_EXT = key; \
+const sal_uInt16 XML_NAMESPACE_##prefix##_EXT_IDX = key;
+
+XML_NAMESPACE_EXT( OFFICE, 37U )
+
+#define _XML_OLD_NAMESPACE_BASE 38U
// namespaces used in the technical preview (SO 5.2)
XML_OLD_NAMESPACE( FO, 0U )
diff --git a/xmloff/inc/xmloff/nmspmap.hxx b/xmloff/inc/xmloff/nmspmap.hxx
index b20bd0db76b9..c88ac563b0e3 100644
--- a/xmloff/inc/xmloff/nmspmap.hxx
+++ b/xmloff/inc/xmloff/nmspmap.hxx
@@ -152,6 +152,11 @@ public:
sal_uInt16 GetFirstKey() const;
sal_uInt16 GetNextKey( sal_uInt16 nOldKey ) const;
+ /* Give access to all namespace definitions, including multiple entries
+ for the same key (needed for saving sheets separately in Calc).
+ This might be replaced by a better interface later. */
+ const NameSpaceHash& GetAllEntries() const { return aNameHash; }
+
static sal_Bool NormalizeOasisURN( ::rtl::OUString& rName );
static sal_Bool NormalizeW3URI( ::rtl::OUString& rName );
static sal_Bool NormalizeURI( ::rtl::OUString& rName );
diff --git a/xmloff/inc/xmloff/txtparae.hxx b/xmloff/inc/xmloff/txtparae.hxx
index 1ea068911236..5bb042c5c0ce 100644
--- a/xmloff/inc/xmloff/txtparae.hxx
+++ b/xmloff/inc/xmloff/txtparae.hxx
@@ -69,6 +69,7 @@ namespace com { namespace sun { namespace star
namespace container { class XEnumerationAccess; class XEnumeration; class XIndexAccess; }
namespace text { class XTextContent; class XTextRange; class XText;
class XFootnote; class XTextFrame; class XTextSection;
+ class XTextField;
class XDocumentIndex; class XTextShapesSupplier; }
} } }
@@ -123,7 +124,11 @@ class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public XMLStyleExport
protected:
const ::rtl::OUString sActualSize;
- const ::rtl::OUString sAlternativeText;
+ // --> OD 2009-07-22 #i73249#
+// const ::rtl::OUString sAlternativeText;
+ const ::rtl::OUString sTitle;
+ const ::rtl::OUString sDescription;
+ // <--
const ::rtl::OUString sAnchorCharStyleName;
const ::rtl::OUString sAnchorPageNo;
const ::rtl::OUString sAnchorType;
@@ -326,6 +331,12 @@ protected:
::com::sun::star::text::XTextRange > & rTextRange,
sal_Bool bAutoStyles, sal_Bool bProgress );
+ void exportTextField(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextField> & xTextField,
+ const sal_Bool bAutoStyles, const sal_Bool bProgress,
+ const sal_Bool bRecursive );
+
void exportAnyTextFrame(
const ::com::sun::star::uno::Reference <
::com::sun::star::text::XTextContent > & rTextContent,
@@ -486,7 +497,7 @@ protected:
/// export a text:meta
void exportMeta(
const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & i_xMeta,
+ ::com::sun::star::beans::XPropertySet> & i_xPortion,
sal_Bool i_bAutoStyles, sal_Bool i_isProgress );
public:
@@ -605,8 +616,12 @@ public:
virtual void exportTextAutoStyles();
void exportEvents( const ::com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > & rPropSet );
- void exportAlternativeText( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet,
- const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
+ // --> OD 2009-07-22 #i73249#
+// void exportAlternativeText( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet,
+// const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
+ void exportTitleAndDescription( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
+ // <--
// This method exports the given XText
void exportText(
diff --git a/xmloff/inc/xmloff/xmlaustp.hxx b/xmloff/inc/xmloff/xmlaustp.hxx
index beb7fe47d928..e5566628d351 100644
--- a/xmloff/inc/xmloff/xmlaustp.hxx
+++ b/xmloff/inc/xmloff/xmlaustp.hxx
@@ -112,6 +112,10 @@ public:
sal_Bool Add( ::rtl::OUString& rName, sal_Int32 nFamily, const ::std::vector< XMLPropertyState >& rProperties );
sal_Bool Add( ::rtl::OUString& rName, sal_Int32 nFamily, const ::rtl::OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties );
+ /// Add an item set with a pre-defined name (needed for saving sheets separately in Calc).
+ sal_Bool AddNamed( const ::rtl::OUString& rName, sal_Int32 nFamily, const ::rtl::OUString& rParent,
+ const ::std::vector< XMLPropertyState >& rProperties );
+
/// Find an item set's name.
::rtl::OUString Find( sal_Int32 nFamily, const ::std::vector< XMLPropertyState >& rProperties ) const;
::rtl::OUString Find( sal_Int32 nFamily, const ::rtl::OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ) const;
diff --git a/xmloff/inc/xmloff/xmlimp.hxx b/xmloff/inc/xmloff/xmlimp.hxx
index 717f117be415..71a241d86008 100644
--- a/xmloff/inc/xmloff/xmlimp.hxx
+++ b/xmloff/inc/xmloff/xmlimp.hxx
@@ -175,6 +175,8 @@ protected:
void SetAutoStyles( SvXMLStylesContext *pAutoStyles );
void SetMasterStyles( SvXMLStylesContext *pMasterStyles );
+ sal_Bool IsODFVersionConsistent( const ::rtl::OUString& aODFVersion );
+
const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver >& GetEmbeddedResolver() const { return mxEmbeddedResolver; }
inline void SetEmbeddedResolver( com::sun::star::uno::Reference< com::sun::star::document::XEmbeddedObjectResolver >& _xEmbeddedResolver );
diff --git a/xmloff/inc/xmloff/xmlimppr.hxx b/xmloff/inc/xmloff/xmlimppr.hxx
index ff6d167e737c..4bf1a9865c85 100644
--- a/xmloff/inc/xmloff/xmlimppr.hxx
+++ b/xmloff/inc/xmloff/xmlimppr.hxx
@@ -80,6 +80,7 @@ class XMLOFF_DLLPUBLIC SvXMLImportPropertyMapper : public UniRefBase
protected:
UniReference< XMLPropertySetMapper > maPropMapper;
+ SvXMLImport& GetImport() const { return rImport;}
public:
diff --git a/xmloff/inc/xmloff/xmlmetai.hxx b/xmloff/inc/xmloff/xmlmetai.hxx
index 9423b7424b73..7cc1c6b054ec 100644
--- a/xmloff/inc/xmloff/xmlmetai.hxx
+++ b/xmloff/inc/xmloff/xmlmetai.hxx
@@ -35,6 +35,7 @@
#include "xmloff/dllapi.h"
#include <xmloff/xmlictxt.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
@@ -76,6 +77,10 @@ protected:
void initDocumentProperties();
// set the BuildId property at the importer
void setBuildId(const ::rtl::OUString & i_rBuildId);
+
+public:
+ static void setBuildId(const ::rtl::OUString & rGenerator,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xImportInfo );
};
#endif // _XMLOFF_XMLMETAI_HXX
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index 988614298fbb..70e8ed82ca49 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -144,6 +144,10 @@ namespace xmloff { namespace token {
XML_NP_GRDDL,
XML_N_GRDDL,
+ // ODF Enhanced namespaces
+ XML_NP_OFFICE_EXT,
+ XML_N_OFFICE_EXT,
+
// units
XML_UNIT_MM,
XML_UNIT_M,
@@ -3074,6 +3078,8 @@ namespace xmloff { namespace token {
XML_AT_LABELS,
XML_AT_AXIS,
XML_AT_LABELS_AND_AXIS,
+ XML_FILLED_RADAR,
+ XML_SURFACE,
// MathML only
XML_MATHVARIANT,
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index d103876b9350..1f854469b4be 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -318,7 +318,12 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
// parse attributes
sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetChartAttrTokenMap();
- awt::Size aChartSize;
+
+ uno::Reference< embed::XVisualObject > xVisualObject( mrImportHelper.GetChartDocument(), uno::UNO_QUERY);
+ DBG_ASSERT(xVisualObject.is(),"need xVisualObject for page size");
+ if( xVisualObject.is() )
+ maChartSize = xVisualObject->getVisualAreaSize( embed::Aspects::MSOLE_CONTENT ); //#i103460# take the size given from the parent frame as default
+
// this flag is necessarry for pie charts in the core
sal_Bool bSetSwitchData = sal_False;
@@ -377,11 +382,11 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
break;
case XML_TOK_CHART_WIDTH:
- GetImport().GetMM100UnitConverter().convertMeasure( aChartSize.Width, aValue );
+ GetImport().GetMM100UnitConverter().convertMeasure( maChartSize.Width, aValue );
break;
case XML_TOK_CHART_HEIGHT:
- GetImport().GetMM100UnitConverter().convertMeasure( aChartSize.Height, aValue );
+ GetImport().GetMM100UnitConverter().convertMeasure( maChartSize.Height, aValue );
break;
case XML_TOK_CHART_STYLE_NAME:
@@ -406,7 +411,11 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
maChartTypeServiceName = SchXMLTools::GetChartTypeByClassName( aChartClass_Bar, false /* bUseOldNames */ );
}
- InitChart (aChartSize, aOldChartTypeName, bSetSwitchData);
+ // Set the size of the draw page.
+ if( xVisualObject.is() )
+ xVisualObject->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, maChartSize );
+
+ InitChart( aOldChartTypeName, bSetSwitchData);
if( bHasAddin )
{
@@ -1198,11 +1207,9 @@ SvXMLImportContext* SchXMLChartContext::CreateChildContext(
4. Set the chart type.
*/
void SchXMLChartContext::InitChart(
- awt::Size aChartSize,
const OUString & rChartTypeServiceName, // currently the old service name
sal_Bool /* bSetSwitchData */ )
{
- maChartSize = aChartSize;
uno::Reference< chart::XChartDocument > xDoc = mrImportHelper.GetChartDocument();
DBG_ASSERT( xDoc.is(), "No valid document!" );
uno::Reference< frame::XModel > xModel (xDoc, uno::UNO_QUERY );
@@ -1217,12 +1224,6 @@ void SchXMLChartContext::InitChart(
xTitled->setTitleObject( 0 );
}
- // Set the size of the draw page.
- uno::Reference< embed::XVisualObject > xVisualObject(xModel,uno::UNO_QUERY);
- DBG_ASSERT(xVisualObject.is(),"need xVisualObject for page size");
- if( xVisualObject.is() )
- xVisualObject->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, aChartSize );
-
// Set the chart type via setting the diagram.
if( rChartTypeServiceName.getLength() &&
xDoc.is())
diff --git a/xmloff/source/chart/SchXMLChartContext.hxx b/xmloff/source/chart/SchXMLChartContext.hxx
index c02f623ebe10..e14f09f965ca 100644
--- a/xmloff/source/chart/SchXMLChartContext.hxx
+++ b/xmloff/source/chart/SchXMLChartContext.hxx
@@ -138,15 +138,12 @@ private:
::com::sun::star::awt::Size maChartSize;
/** @descr This method bundles some settings to the chart model and executes them with
- a locked controller. This includes setting the draw page size and setting
- the chart type.
- @param aChartSize The size the draw page will be set to.
+ a locked controller. This includes setting the chart type.
@param aServiceName The name of the service the diagram is initialized with.
@param bSetWitchData Indicates wether the data set takes it's data series from
rows or from columns.
*/
- void InitChart (com::sun::star::awt::Size aChartSize,
- const ::rtl::OUString & rChartTypeServiceName,
+ void InitChart (const ::rtl::OUString & rChartTypeServiceName,
sal_Bool bSetSwitchData);
void MergeSeriesForStockChart();
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 3290cb31db96..f7cf82abe974 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -93,6 +93,7 @@
#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/chart2/data/XDataProvider.hpp>
+#include <com/sun/star/chart2/data/XDatabaseDataProvider.hpp>
#include <com/sun/star/chart2/data/XRangeXMLConversion.hpp>
#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
#include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
@@ -1123,6 +1124,12 @@ void SchXMLExportHelper::parseDocument( Reference< chart::XChartDocument >& rCha
OUString aDataProviderURL( RTL_CONSTASCII_USTRINGPARAM( ".." ) );
if( xNewDoc->hasInternalDataProvider() )
aDataProviderURL = OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) );
+ else //special handling for data base data provider necessary
+ {
+ Reference< chart2::data::XDatabaseDataProvider > xDBDataProvider( xNewDoc->getDataProvider(), uno::UNO_QUERY );
+ if( xDBDataProvider.is() )
+ aDataProviderURL = OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) );
+ }
mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aDataProviderURL );
}
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index 831c15fb624e..dd955e6d69d5 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -35,6 +35,8 @@
#include "SchXMLChartContext.hxx"
#include "contexts.hxx"
#include "XMLChartPropertySetMapper.hxx"
+#include "SchXMLTools.hxx"
+
#include <tools/debug.hxx>
#include <rtl/ustrbuf.hxx>
// header for class ByteString
@@ -872,6 +874,9 @@ SvXMLImportContext* SchXMLImport::CreateStylesContext(
const OUString& rLocalName,
const Reference<xml::sax::XAttributeList>& xAttrList )
{
+ //#i103287# make sure that the version information is set before importing all the properties (especially stroke-opacity!)
+ SchXMLTools::setBuildIDAtImportInfo( GetModel(), getImportInfo() );
+
SvXMLStylesContext* pStylesCtxt =
new SvXMLStylesContext( *(this), XML_NAMESPACE_OFFICE, rLocalName, xAttrList );
diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index 4eb17d289d73..a1c021171a92 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -936,7 +936,15 @@ void SchXMLTableHelper::applyTableSimple(
sal_Int32 nColumnCount = 0;
sal_Int32 nCol = 0, nRow = 0;
if( nRowCount )
+ {
nColumnCount = rTable.aData[ 0 ].size();
+ ::std::vector< ::std::vector< SchXMLCell > >::const_iterator iRow = rTable.aData.begin();
+ while( iRow != rTable.aData.end() )
+ {
+ nColumnCount = ::std::max( nColumnCount, static_cast<sal_Int32>(iRow->size()) );
+ iRow++;
+ }
+ }
// #i27909# avoid illegal index access for empty tables
if( nColumnCount == 0 || nRowCount == 0 )
@@ -950,7 +958,8 @@ void SchXMLTableHelper::applyTableSimple(
// set labels
::std::vector< ::std::vector< SchXMLCell > >::const_iterator iRow = rTable.aData.begin();
- for( nCol = 1; nCol < nColumnCount; nCol++ )
+ sal_Int32 nColumnCountOnFirstRow = iRow->size();
+ for( nCol = 1; nCol < nColumnCountOnFirstRow; nCol++ )
{
aLabels[ nCol - 1 ] = (*iRow)[ nCol ].aString;
}
diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx
index 57ba65868140..ebc48c0d24c0 100644
--- a/xmloff/source/chart/SchXMLTools.cxx
+++ b/xmloff/source/chart/SchXMLTools.cxx
@@ -53,6 +53,7 @@
#include <xmloff/xmlprmap.hxx>
#include <xmloff/xmlexp.hxx>
#include "xmlnmspe.hxx"
+#include <xmloff/xmlmetai.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -103,9 +104,19 @@ rtl::OUString lcl_getGeneratorFromModel( const uno::Reference< frame::XModel >&
uno::Reference< document::XDocumentProperties > xChartDocumentProperties(
xChartDocumentPropertiesSupplier->getDocumentProperties());
if( xChartDocumentProperties.is() )
- {
aGenerator = xChartDocumentProperties->getGenerator();
- }
+ }
+ return aGenerator;
+}
+
+rtl::OUString lcl_getGeneratorFromModelOrItsParent( const uno::Reference< frame::XModel >& xChartModel )
+{
+ ::rtl::OUString aGenerator( lcl_getGeneratorFromModel(xChartModel) );
+ if( !aGenerator.getLength() ) //try to get the missing info from the parent document
+ {
+ uno::Reference< container::XChild > xChild( xChartModel, uno::UNO_QUERY );
+ if( xChild.is() )
+ aGenerator = lcl_getGeneratorFromModel( uno::Reference< frame::XModel >( xChild->getParent(), uno::UNO_QUERY) );
}
return aGenerator;
}
@@ -158,9 +169,11 @@ static __FAR_DATA SvXMLEnumMapEntry aXMLChartClassMap[] =
{ XML_RING, XML_CHART_CLASS_RING },
{ XML_SCATTER, XML_CHART_CLASS_SCATTER },
{ XML_RADAR, XML_CHART_CLASS_RADAR },
+ { XML_FILLED_RADAR, XML_CHART_CLASS_FILLED_RADAR },
{ XML_BAR, XML_CHART_CLASS_BAR },
{ XML_STOCK, XML_CHART_CLASS_STOCK },
{ XML_BUBBLE, XML_CHART_CLASS_BUBBLE },
+ { XML_SURFACE, XML_CHART_CLASS_BAR }, //@todo change this if a surface chart is available
{ XML_ADD_IN, XML_CHART_CLASS_ADDIN },
{ XML_TOKEN_INVALID, XML_CHART_CLASS_UNKNOWN }
};
@@ -202,6 +215,9 @@ const tMakeStringStringMap& lcl_getChartTypeNameMap()
( ::rtl::OUString::createFromAscii( "com.sun.star.chart.NetDiagram" )
, ::rtl::OUString::createFromAscii( "com.sun.star.chart2.NetChartType" ) )
+ ( ::rtl::OUString::createFromAscii( "com.sun.star.chart.FilledNetDiagram" )
+ , ::rtl::OUString::createFromAscii( "com.sun.star.chart2.FilledNetChartType" ) )
+
( ::rtl::OUString::createFromAscii( "com.sun.star.chart.StockDiagram" )
, ::rtl::OUString::createFromAscii( "com.sun.star.chart2.CandleStickChartType" ) )
@@ -269,6 +285,8 @@ OUString GetChartTypeByClassName(
aResultBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM("Bubble"));
else if( IsXMLToken( rClassName, XML_RADAR ))
aResultBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM("Net"));
+ else if( IsXMLToken( rClassName, XML_FILLED_RADAR ))
+ aResultBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM("FilledNet"));
else if( IsXMLToken( rClassName, XML_STOCK ))
{
if( bUseOldNames )
@@ -276,6 +294,14 @@ OUString GetChartTypeByClassName(
else
aResultBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM("CandleStick"));
}
+ else if( IsXMLToken( rClassName, XML_SURFACE ))
+ {
+ //@todo change this if a surface chart is available
+ if( bUseOldNames )
+ aResultBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM("Bar"));
+ else
+ aResultBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM("Column"));
+ }
else
bInternalType = false;
@@ -336,6 +362,8 @@ XMLTokenEnum getTokenByChartType(
eResult = XML_BUBBLE;
else if( aServiceName.equalsAscii("Net"))
eResult = XML_RADAR;
+ else if( aServiceName.equalsAscii("FilledNet"))
+ eResult = XML_FILLED_RADAR;
else if( (bUseOldNames && aServiceName.equalsAscii("Stock")) ||
(!bUseOldNames && aServiceName.equalsAscii("CandleStick")))
eResult = XML_STOCK;
@@ -673,6 +701,13 @@ bool switchBackToDataProviderFromParent( const Reference< chart2::XChartDocument
return true;
}
+void setBuildIDAtImportInfo( uno::Reference< frame::XModel > xModel, Reference< beans::XPropertySet > xImportInfo )
+{
+ ::rtl::OUString aGenerator( lcl_getGeneratorFromModelOrItsParent(xModel) );
+ if( aGenerator.getLength() )
+ SvXMLMetaDocumentContext::setBuildId( aGenerator, xImportInfo );
+}
+
bool isDocumentGeneratedWithOpenOfficeOlderThan3_0( const uno::Reference< frame::XModel >& xChartModel )
{
bool bResult = isDocumentGeneratedWithOpenOfficeOlderThan2_3( xChartModel );
@@ -706,31 +741,41 @@ bool isDocumentGeneratedWithOpenOfficeOlderThan2_3( const uno::Reference< frame:
//if there is a meta stream at the chart object it was not written with an older OpenOffice version < 2.3
if( !aGenerator.getLength() )
{
- //if there is no meta stream at the chart object we need to check the version from the parent document
- //and we need to check whether the document was created with OpenOffice.org at all
+ //if there is no meta stream at the chart object we need to check whether the parent document is OpenOffice at all
uno::Reference< container::XChild > xChild( xChartModel, uno::UNO_QUERY );
if( xChild.is() )
{
- ::rtl::OUString aParentGenerator( lcl_getGeneratorFromModel( uno::Reference< frame::XModel >( xChild->getParent(), uno::UNO_QUERY) ) );
- if( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project") ) ) != -1 )
+ aGenerator = lcl_getGeneratorFromModel( uno::Reference< frame::XModel >( xChild->getParent(), uno::UNO_QUERY) );
+ if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project") ) ) != -1 )
{
- sal_Int32 nBuilId = lcl_getBuildIDFromGenerator( aParentGenerator );
- if( nBuilId<=9161 ) //9161 is build id of OpenOffice.org 2.2.1
- bResult= true;
+ //the chart application has not created files without a meta stream since OOo 2.3 (OOo 2.3 has written a metastream already)
+ //only the report builder extension has created some files with OOo 3.1 that do not have a meta stream
+ if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/31") ) ) != -1 )
+ bResult = false;//#i100102# probably generated with OOo 3.1 by the report designer
+ else
+ bResult= true; //in this case the OLE chart was created by an older version, as OLE objects are sometimes stream copied the version can differ from the parents version, so the parents version is not a reliable indicator
}
- else if(
- ( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org 1") ) ) == 0 )
- || ( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarOffice 6") ) ) == 0 )
- || ( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarOffice 7") ) ) == 0 )
- || ( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarSuite 6") ) ) == 0 )
- || ( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarSuite 7") ) ) == 0 )
- )
+ else if( isDocumentGeneratedWithOpenOfficeOlderThan2_0(xChartModel) )
bResult= true;
}
}
return bResult;
}
+bool isDocumentGeneratedWithOpenOfficeOlderThan2_0( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel)
+{
+ bool bResult = false;
+ ::rtl::OUString aGenerator( lcl_getGeneratorFromModelOrItsParent(xChartModel) );
+ if( ( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org 1") ) ) == 0 )
+ || ( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarOffice 6") ) ) == 0 )
+ || ( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarOffice 7") ) ) == 0 )
+ || ( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarSuite 6") ) ) == 0 )
+ || ( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarSuite 7") ) ) == 0 )
+ )
+ bResult= true;
+ return bResult;
+}
+
Reference< chart2::data::XDataProvider > getDataProviderFromParent( const Reference< chart2::XChartDocument >& xChartDoc )
{
Reference< chart2::data::XDataProvider > xRet;
diff --git a/xmloff/source/chart/SchXMLTools.hxx b/xmloff/source/chart/SchXMLTools.hxx
index 916fffc382aa..89d17fc440d9 100644
--- a/xmloff/source/chart/SchXMLTools.hxx
+++ b/xmloff/source/chart/SchXMLTools.hxx
@@ -53,10 +53,14 @@ class SvXMLExport;
namespace SchXMLTools
{
+ bool isDocumentGeneratedWithOpenOfficeOlderThan2_0( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel);
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);
+ void setBuildIDAtImportInfo( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel
+ , ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xImportInfo );
+
enum SchXMLChartTypeEnum
{
XML_CHART_CLASS_LINE,
@@ -65,6 +69,7 @@ namespace SchXMLTools
XML_CHART_CLASS_RING,
XML_CHART_CLASS_SCATTER,
XML_CHART_CLASS_RADAR,
+ XML_CHART_CLASS_FILLED_RADAR,
XML_CHART_CLASS_BAR,
XML_CHART_CLASS_STOCK,
XML_CHART_CLASS_BUBBLE,
diff --git a/xmloff/source/core/RDFaExportHelper.cxx b/xmloff/source/core/RDFaExportHelper.cxx
index 077ef6133fc4..abd33ec80625 100644
--- a/xmloff/source/core/RDFaExportHelper.cxx
+++ b/xmloff/source/core/RDFaExportHelper.cxx
@@ -157,7 +157,7 @@ RDFaExportHelper::AddRDFa(
.makeStringAndClear()
);
- const ::comphelper::StlUnoSequence<rdf::Statement>::iterator iter
+ rdf::Statement* const iter
( ::std::partition( ::comphelper::stl_begin(stmts),
::comphelper::stl_end(stmts),
::boost::bind(&::rtl::OUString::equals, m_RDFsLabel,
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 8045cd582e2f..55af99802f9d 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -1358,6 +1358,7 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
const sal_Char* pVersion = 0;
switch( getDefaultVersion() )
{
+ case SvtSaveOptions::ODFVER_LATEST: pVersion = sXML_1_2; break;
case SvtSaveOptions::ODFVER_012: pVersion = sXML_1_2; break;
case SvtSaveOptions::ODFVER_011: pVersion = sXML_1_1; break;
case SvtSaveOptions::ODFVER_010: break;
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 28c970a94066..d4dc48ede241 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -58,13 +58,17 @@
#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/document/XBinaryStreamResolver.hpp>
+#include <com/sun/star/document/XStorageBasedDocument.hpp>
#include <com/sun/star/xml/sax/XLocator.hpp>
+#include <com/sun/star/packages/zip/ZipIOException.hpp>
#include <comphelper/namecontainer.hxx>
#include <rtl/logfile.hxx>
#include <tools/string.hxx> // used in StartElement for logging
#include <cppuhelper/implbase1.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/documentconstants.hxx>
+#include <comphelper/storagehelper.hxx>
#include <vcl/fontcvt.hxx>
#include <com/sun/star/rdf/XMetadatable.hpp>
@@ -89,6 +93,7 @@ using namespace ::com::sun::star::document;
using namespace ::xmloff::token;
sal_Char __READONLY_DATA sXML_np__office[] = "_office";
+sal_Char __READONLY_DATA sXML_np__office_ext[] = "_office_ooo";
sal_Char __READONLY_DATA sXML_np__ooo[] = "_ooo";
sal_Char __READONLY_DATA sXML_np__ooow[] = "_ooow";
sal_Char __READONLY_DATA sXML_np__oooc[] = "_oooc";
@@ -241,6 +246,9 @@ void SvXMLImport::_InitCtor()
mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__office ) ),
GetXMLToken(XML_N_OFFICE),
XML_NAMESPACE_OFFICE );
+ mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__office_ext ) ),
+ GetXMLToken(XML_N_OFFICE_EXT),
+ XML_NAMESPACE_OFFICE_EXT );
mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__ooo ) ), GetXMLToken(XML_N_OOO), XML_NAMESPACE_OOO );
mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__style) ),
GetXMLToken(XML_N_STYLE),
@@ -649,6 +657,21 @@ void SAL_CALL SvXMLImport::startElement( const OUString& rName,
if ( rAttrName.equalsAscii("office:version") )
{
mpImpl->aODFVersion = xAttrList->getValueByIndex( i );
+
+ // the ODF version in content.xml and manifest.xml must be the same starting from ODF1.2
+ if ( mpImpl->mStreamName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "content.xml" ) ) )
+ && !IsODFVersionConsistent( mpImpl->aODFVersion ) )
+ {
+ throw xml::sax::SAXException(
+ ::rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "Inconsistent ODF versions in content.xml and manifest.xml!" ) ),
+ uno::Reference< uno::XInterface >(),
+ uno::makeAny(
+ packages::zip::ZipIOException(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "Inconsistent ODF versions in content.xml and manifest.xml!" ) ),
+ Reference< XInterface >() ) ) );
+ }
}
else if( ( rAttrName.getLength() >= 5 ) &&
( rAttrName.compareToAscii( sXML_xmlns, 5 ) == 0 ) &&
@@ -1598,6 +1621,50 @@ OUString SvXMLImport::GetAbsoluteReference(const OUString& rValue) const
return rValue;
}
+sal_Bool SvXMLImport::IsODFVersionConsistent( const ::rtl::OUString& aODFVersion )
+{
+ // the check returns sal_False only if the storage version could be retrieved
+ sal_Bool bResult = sal_True;
+
+ if ( aODFVersion.getLength() && aODFVersion.compareTo( ODFVER_012_TEXT ) >= 0 )
+ {
+ // check the consistency only for the ODF1.2 and later ( according to content.xml )
+ try
+ {
+ uno::Reference< document::XStorageBasedDocument > xDoc( mxModel, uno::UNO_QUERY_THROW );
+ uno::Reference< embed::XStorage > xStor = xDoc->getDocumentStorage();
+ uno::Reference< beans::XPropertySet > xStorProps( xStor, uno::UNO_QUERY_THROW );
+
+ // the check should be done only for OASIS format
+ ::rtl::OUString aMediaType;
+ xStorProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ) ) >>= aMediaType;
+ if ( ::comphelper::OStorageHelper::GetXStorageFormat( xStor ) >= SOFFICE_FILEFORMAT_8 )
+ {
+ sal_Bool bRepairPackage = sal_False;
+ try
+ {
+ xStorProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RepairPackage" ) ) )
+ >>= bRepairPackage;
+ } catch ( uno::Exception& )
+ {}
+
+ // check only if not in Repair mode
+ if ( !bRepairPackage )
+ {
+ ::rtl::OUString aStorVersion;
+ xStorProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ) )
+ >>= aStorVersion;
+ bResult = aODFVersion.equals( aStorVersion );
+ }
+ }
+ }
+ catch( uno::Exception& )
+ {}
+ }
+
+ return bResult;
+}
+
void SvXMLImport::_CreateNumberFormatsSupplier()
{
DBG_ASSERT( !mxNumberFormatsSupplier.is(),
@@ -1894,6 +1961,7 @@ void SvXMLImport::SetXmlId(uno::Reference<uno::XInterface> const & i_xIfc,
}
}
} catch (uno::Exception &) {
+ OSL_ENSURE(false, "SvXMLImport::SetXmlId: exception?");
}
}
}
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index a9e5b2abc517..ae95763f1936 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -152,6 +152,10 @@ namespace xmloff { namespace token {
TOKEN( "grddl", XML_NP_GRDDL ),
TOKEN( "http://www.w3.org/2003/g/data-view#", XML_N_GRDDL ),
+ // ODF Enhanced namespaces
+ TOKEN( "officeooo", XML_NP_OFFICE_EXT ),
+ TOKEN( "http://openoffice.org/2009/office", XML_N_OFFICE_EXT ),
+
// units
TOKEN( "mm", XML_UNIT_MM ),
TOKEN( "m", XML_UNIT_M ),
@@ -3076,6 +3080,8 @@ namespace xmloff { namespace token {
TOKEN( "at-labels", XML_AT_LABELS ),
TOKEN( "at-axis", XML_AT_AXIS ),
TOKEN( "at-labels-and-axis", XML_AT_LABELS_AND_AXIS ),
+ TOKEN( "filled-radar", XML_FILLED_RADAR ),
+ TOKEN( "surface", XML_SURFACE ),
TOKEN( "mathvariant", XML_MATHVARIANT ),
TOKEN( "mathsize", XML_MATHSIZE ),
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index 67c66b6a1d5f..1d7414d4ca23 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -39,7 +39,9 @@
#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
#include <com/sun/star/presentation/XPresentationSupplier.hpp>
#include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
+#include <com/sun/star/geometry/RealPoint2D.hpp>
#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
+#include <com/sun/star/office/XAnnotationAccess.hpp>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/uno/Any.hxx>
#include "sdxmlexp_impl.hxx"
@@ -51,9 +53,7 @@
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/style/XStyle.hpp>
-#ifndef _COM_SUN_STAR_FORM_XFORMSUPPLIER2_HPP_
#include <com/sun/star/form/XFormsSupplier2.hpp>
-#endif
#include <com/sun/star/presentation/XPresentationPage.hpp>
#include <com/sun/star/drawing/XMasterPageTarget.hpp>
#include <com/sun/star/text/XText.hpp>
@@ -96,9 +96,13 @@ using ::rtl::OUStringBuffer;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::util;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::office;
using namespace ::com::sun::star::presentation;
+using namespace ::com::sun::star::geometry;
+using namespace ::com::sun::star::text;
using namespace ::xmloff::token;
@@ -640,6 +644,14 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent
GetXMLToken(XML_N_ANIMATION),
XML_NAMESPACE_ANIMATION);
+ if( getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST )
+ {
+ _GetNamespaceMap().Add(
+ GetXMLToken(XML_NP_OFFICE_EXT),
+ GetXMLToken(XML_N_OFFICE_EXT),
+ XML_NAMESPACE_OFFICE_EXT);
+ }
+
GetShapeExport()->enableLayerExport();
// #88546# enable progress bar increments
@@ -2060,6 +2072,8 @@ void SdXMLExport::_ExportContent()
}
}
}
+
+ exportAnnotations( xDrawPage );
}
}
@@ -2355,10 +2369,9 @@ void SdXMLExport::_ExportAutoStyles()
// create auto style infos for objects on master pages
for(sal_Int32 nMPageId(0L); nMPageId < mnDocMasterPageCount; nMPageId++)
{
- Any aAny(mxDocMasterPages->getByIndex(nMPageId));
- Reference< XDrawPage > xMasterPage;
+ Reference< XDrawPage > xMasterPage(mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY );
- if((aAny >>= xMasterPage) && xMasterPage.is() )
+ if( xMasterPage.is() )
{
// collect layer information
GetFormExport()->examineForms( xMasterPage );
@@ -2397,6 +2410,7 @@ void SdXMLExport::_ExportAutoStyles()
}
}
}
+ collectAnnotationAutoStyles(xMasterPage);
}
}
}
@@ -2413,10 +2427,8 @@ void SdXMLExport::_ExportAutoStyles()
// create auto style infos for objects on pages
for(sal_Int32 nPageInd(0); nPageInd < mnDocDrawPageCount; nPageInd++)
{
- Any aAny(mxDocDrawPages->getByIndex(nPageInd));
- Reference<XDrawPage> xDrawPage;
-
- if((aAny >>= xDrawPage) && xDrawPage.is() )
+ Reference<XDrawPage> xDrawPage( mxDocDrawPages->getByIndex(nPageInd), UNO_QUERY );
+ if( xDrawPage.is() )
{
// collect layer information
GetFormExport()->examineForms( xDrawPage );
@@ -2466,6 +2478,8 @@ void SdXMLExport::_ExportAutoStyles()
}
}
}
+
+ collectAnnotationAutoStyles( xDrawPage );
}
}
if(IsImpress())
@@ -2536,10 +2550,8 @@ void SdXMLExport::_ExportMasterStyles()
// export MasterPages in master-styles section
for(sal_Int32 nMPageId = 0L; nMPageId < mnDocMasterPageCount; nMPageId++)
{
- Any aAny(mxDocMasterPages->getByIndex(nMPageId));
- Reference< XDrawPage > xMasterPage;
-
- if((aAny >>= xMasterPage) && xMasterPage.is())
+ Reference< XDrawPage > xMasterPage( mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY );
+ if(xMasterPage.is())
{
// prepare masterpage attributes
OUString sMasterPageName;
@@ -2610,6 +2622,7 @@ void SdXMLExport::_ExportMasterStyles()
}
}
}
+ exportAnnotations( xMasterPage );
}
}
}
@@ -2770,6 +2783,98 @@ OUString SdXMLExport::getNavigationOrder( const Reference< XDrawPage >& xDrawPag
//////////////////////////////////////////////////////////////////////////////
+void SdXMLExport::collectAnnotationAutoStyles( const Reference<XDrawPage>& xDrawPage )
+{
+ Reference< XAnnotationAccess > xAnnotationAccess( xDrawPage, UNO_QUERY );
+ if( xAnnotationAccess.is() ) try
+ {
+ Reference< XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() );
+ if( xAnnotationEnumeration.is() )
+ {
+ while( xAnnotationEnumeration->hasMoreElements() )
+ {
+ Reference< XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement(), UNO_QUERY_THROW );
+ Reference< XText > xText( xAnnotation->getTextRange() );
+ if(xText.is() && xText->getString().getLength())
+ GetTextParagraphExport()->collectTextAutoStyles( xText );
+ }
+ }
+ }
+ catch( Exception& )
+ {
+ DBG_ERROR("SdXMLExport::collectAnnotationAutoStyles(), exception caught during export of annotation auto styles");
+ }
+}
+
+void SdXMLExport::exportAnnotations( const Reference<XDrawPage>& xDrawPage )
+{
+ // do not export in ODF 1.2 or older
+ if( getDefaultVersion() != SvtSaveOptions::ODFVER_LATEST )
+ return;
+
+ Reference< XAnnotationAccess > xAnnotationAccess( xDrawPage, UNO_QUERY );
+ if( xAnnotationAccess.is() ) try
+ {
+ Reference< XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() );
+ if( xAnnotationEnumeration.is() && xAnnotationEnumeration->hasMoreElements() )
+ {
+ OUStringBuffer sStringBuffer;
+ do
+ {
+ Reference< XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement(), UNO_QUERY_THROW );
+
+ RealPoint2D aPosition( xAnnotation->getPosition() );
+
+ GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( aPosition.X * 100 ) );
+ AddAttribute(XML_NAMESPACE_SVG, XML_X, sStringBuffer.makeStringAndClear());
+
+ GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( aPosition.Y * 100 ) );
+ AddAttribute(XML_NAMESPACE_SVG, XML_Y, sStringBuffer.makeStringAndClear());
+
+ RealSize2D aSize( xAnnotation->getSize() );
+
+ if( aSize.Width || aSize.Height )
+ {
+ GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( aSize.Width * 100 ) );
+ AddAttribute(XML_NAMESPACE_SVG, XML_WIDTH, sStringBuffer.makeStringAndClear());
+ GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( aSize.Height * 100 ) );
+ AddAttribute(XML_NAMESPACE_SVG, XML_HEIGHT, sStringBuffer.makeStringAndClear());
+ }
+
+ // annotation element + content
+ SvXMLElementExport aElem(*this, XML_NAMESPACE_OFFICE_EXT, XML_ANNOTATION, sal_False, sal_True);
+
+ // author
+ OUString aAuthor( xAnnotation->getAuthor() );
+ if( aAuthor.getLength() )
+ {
+ SvXMLElementExport aCreatorElem( *this, XML_NAMESPACE_DC, XML_CREATOR, sal_True, sal_False );
+ this->Characters(aAuthor);
+ }
+
+ {
+ // date time
+ DateTime aDate( xAnnotation->getDateTime() );
+ GetMM100UnitConverter().convertDateTime(sStringBuffer, aDate, sal_True);
+ SvXMLElementExport aDateElem( *this, XML_NAMESPACE_DC, XML_DATE, sal_True, sal_False );
+ Characters(sStringBuffer.makeStringAndClear());
+ }
+
+ com::sun::star::uno::Reference < com::sun::star::text::XText > xText( xAnnotation->getTextRange() );
+ if( xText.is() )
+ this->GetTextParagraphExport()->exportText( xText );
+ }
+ while( xAnnotationEnumeration->hasMoreElements() );
+ }
+ }
+ catch( Exception& )
+ {
+ DBG_ERROR("SdXMLExport::exportAnnotations(), exception caught during export of annotations");
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
#define SERVICE( classname, servicename, implementationname, draw, flags )\
uno::Sequence< OUString > SAL_CALL classname##_getSupportedServiceNames() throw()\
{\
diff --git a/xmloff/source/draw/sdxmlexp_impl.hxx b/xmloff/source/draw/sdxmlexp_impl.hxx
index eaf5c7c531f2..2738e948ea69 100644
--- a/xmloff/source/draw/sdxmlexp_impl.hxx
+++ b/xmloff/source/draw/sdxmlexp_impl.hxx
@@ -186,6 +186,9 @@ class SdXMLExport : public SvXMLExport
rtl::OUString getNavigationOrder( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
+ void collectAnnotationAutoStyles( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
+ void exportAnnotations( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
+
protected:
virtual void GetViewSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
virtual void GetConfigurationSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx
index a7bb8bd7fcec..b2e81d333fba 100644
--- a/xmloff/source/draw/shapeexport2.cxx
+++ b/xmloff/source/draw/shapeexport2.cxx
@@ -49,6 +49,7 @@
#endif
#include "sdpropls.hxx"
#include <tools/debug.hxx>
+#include <tools/urlobj.hxx>
#include <rtl/ustrbuf.hxx>
#include <xmloff/xmlexp.hxx>
#include <xmloff/xmluconv.hxx>
@@ -1166,8 +1167,30 @@ void XMLShapeExport::ImpExportGraphicObjectShape(
OUString aStreamURL;
OUString aStr;
+ xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicStreamURL"))) >>= aStreamURL;
xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicURL"))) >>= sImageURL;
- aStr = mrExport.AddEmbeddedGraphicObject( sImageURL );
+
+ OUString aResolveURL( sImageURL );
+ const rtl::OUString sPackageURL( RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.Package:") );
+
+ // sj: trying to preserve the filename
+ if ( aStreamURL.match( sPackageURL, 0 ) )
+ {
+ rtl::OUString sRequestedName( aStreamURL.copy( sPackageURL.getLength(), aStreamURL.getLength() - sPackageURL.getLength() ) );
+ sal_Int32 nLastIndex = sRequestedName.lastIndexOf( '/' ) + 1;
+ if ( ( nLastIndex > 0 ) && ( nLastIndex < sRequestedName.getLength() ) )
+ sRequestedName = sRequestedName.copy( nLastIndex, sRequestedName.getLength() - nLastIndex );
+ nLastIndex = sRequestedName.lastIndexOf( '.' );
+ if ( nLastIndex >= 0 )
+ sRequestedName = sRequestedName.copy( 0, nLastIndex );
+ if ( sRequestedName.getLength() )
+ {
+ aResolveURL = aResolveURL.concat( OUString(RTL_CONSTASCII_USTRINGPARAM("?requestedName=")));
+ aResolveURL = aResolveURL.concat( sRequestedName );
+ }
+ }
+
+ aStr = mrExport.AddEmbeddedGraphicObject( aResolveURL );
mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, aStr );
if( aStr.getLength() )
diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx
index d38bb3761868..e2e804eefb43 100644
--- a/xmloff/source/draw/shapeexport4.cxx
+++ b/xmloff/source/draw/shapeexport4.cxx
@@ -1130,21 +1130,21 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape
{
mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TEMPLATE_NAME, sTemplate );
- const XMLPropertyMapEntry* pEntry = &aXMLTableShapeAttributes[0];
-
- while( pEntry->msApiName ) try
+ for( const XMLPropertyMapEntry* pEntry = &aXMLTableShapeAttributes[0]; pEntry->msApiName; pEntry++ )
{
- sal_Bool bBool = sal_False;
- const OUString sAPIPropertyName( OUString(pEntry->msApiName, pEntry->nApiNameLength, RTL_TEXTENCODING_ASCII_US ) );
+ try
+ {
+ sal_Bool bBool = sal_False;
+ const OUString sAPIPropertyName( OUString(pEntry->msApiName, pEntry->nApiNameLength, RTL_TEXTENCODING_ASCII_US ) );
- xPropSet->getPropertyValue( sAPIPropertyName ) >>= bBool;
- if( bBool )
- mrExport.AddAttribute(pEntry->mnNameSpace, pEntry->meXMLName, XML_TRUE );
- pEntry++;
- }
- catch( uno::Exception& )
- {
- DBG_ERROR("XMLShapeExport::ImpExportTableShape(), exception caught!");
+ xPropSet->getPropertyValue( sAPIPropertyName ) >>= bBool;
+ if( bBool )
+ mrExport.AddAttribute(pEntry->mnNameSpace, pEntry->meXMLName, XML_TRUE );
+ }
+ catch( uno::Exception& )
+ {
+ DBG_ERROR("XMLShapeExport::ImpExportTableShape(), exception caught!");
+ }
}
}
}
diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx
index 4daa6263d391..9d64d49f9421 100644
--- a/xmloff/source/draw/ximppage.cxx
+++ b/xmloff/source/draw/ximppage.cxx
@@ -32,6 +32,9 @@
#include "precompiled_xmloff.hxx"
#include <tools/debug.hxx>
+#include <com/sun/star/geometry/RealPoint2D.hpp>
+#include <com/sun/star/text/XTextCursor.hpp>
+#include <com/sun/star/util/DateTime.hpp>
#include <cppuhelper/implbase1.hxx>
#include "XMLNumberStylesImport.hxx"
#include <xmloff/xmlstyle.hxx>
@@ -41,6 +44,7 @@
#include "ximppage.hxx"
#include "ximpshap.hxx"
#include "animimp.hxx"
+#include "XMLStringBufferImportContext.hxx"
#include <xmloff/formsimp.hxx>
#include <xmloff/xmlictxt.hxx>
#include "ximpstyl.hxx"
@@ -57,9 +61,155 @@ using namespace ::com::sun::star;
using namespace ::xmloff::token;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::util;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::office;
+using namespace ::com::sun::star::xml::sax;
+using namespace ::com::sun::star::geometry;
+
+
+//////////////////////////////////////////////////////////////////////////////
+
+class DrawAnnotationContext : public SvXMLImportContext
+{
+
+public:
+ DrawAnnotationContext( SvXMLImport& rImport, USHORT nPrfx, const OUString& rLocalName,const Reference< xml::sax::XAttributeList>& xAttrList, const Reference< XAnnotationAccess >& xAnnotationAccess );
+
+ virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
+ virtual void EndElement();
+
+private:
+ Reference< XAnnotation > mxAnnotation;
+ Reference< XTextCursor > mxCursor;
+
+ OUStringBuffer maAuthorBuffer;
+ OUStringBuffer maDateBuffer;
+};
+
+DrawAnnotationContext::DrawAnnotationContext( SvXMLImport& rImport, USHORT nPrfx, const OUString& rLocalName,const Reference< xml::sax::XAttributeList>& xAttrList, const Reference< XAnnotationAccess >& xAnnotationAccess )
+: SvXMLImportContext( rImport, nPrfx, rLocalName )
+, mxAnnotation( xAnnotationAccess->createAndInsertAnnotation() )
+{
+ if( mxAnnotation.is() )
+ {
+ sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+
+ RealPoint2D aPosition;
+ RealSize2D aSize;
+
+ for(sal_Int16 i=0; i < nAttrCount; i++)
+ {
+ OUString sValue( xAttrList->getValueByIndex( i ) );
+ OUString sAttrName( xAttrList->getNameByIndex( i ) );
+ OUString aLocalName;
+ switch( GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ) )
+ {
+ case XML_NAMESPACE_SVG:
+ if( IsXMLToken( aLocalName, XML_X ) )
+ {
+ sal_Int32 x;
+ GetImport().GetMM100UnitConverter().convertMeasure(x, sValue);
+ aPosition.X = static_cast<double>(x) / 100.0;
+ }
+ else if( IsXMLToken( aLocalName, XML_Y ) )
+ {
+ sal_Int32 y;
+ GetImport().GetMM100UnitConverter().convertMeasure(y, sValue);
+ aPosition.Y = static_cast<double>(y) / 100.0;
+ }
+ else if( IsXMLToken( aLocalName, XML_WIDTH ) )
+ {
+ sal_Int32 w;
+ GetImport().GetMM100UnitConverter().convertMeasure(w, sValue);
+ aSize.Width = static_cast<double>(w) / 100.0;
+ }
+ else if( IsXMLToken( aLocalName, XML_HEIGHT ) )
+ {
+ sal_Int32 h;
+ GetImport().GetMM100UnitConverter().convertMeasure(h, sValue);
+ aSize.Height = static_cast<double>(h) / 100.0;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ mxAnnotation->setPosition( aPosition );
+ mxAnnotation->setSize( aSize );
+ }
+}
+
+SvXMLImportContext * DrawAnnotationContext::CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList )
+{
+ SvXMLImportContext * pContext = NULL;
+
+ if( mxAnnotation.is() )
+ {
+ if( XML_NAMESPACE_DC == nPrefix )
+ {
+ if( IsXMLToken( rLocalName, XML_CREATOR ) )
+ pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maAuthorBuffer);
+ else if( IsXMLToken( rLocalName, XML_DATE ) )
+ pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maDateBuffer);
+ }
+ else
+ {
+ // create text cursor on demand
+ if( !mxCursor.is() )
+ {
+ uno::Reference< text::XText > xText( mxAnnotation->getTextRange() );
+ if( xText.is() )
+ {
+ UniReference < XMLTextImportHelper > xTxtImport = GetImport().GetTextImport();
+ mxCursor = xText->createTextCursor();
+ if( mxCursor.is() )
+ xTxtImport->SetCursor( mxCursor );
+ }
+ }
+
+ // if we have a text cursor, lets try to import some text
+ if( mxCursor.is() )
+ {
+ pContext = GetImport().GetTextImport()->CreateTextChildContext( GetImport(), nPrefix, rLocalName, xAttrList );
+ }
+ }
+ }
+
+ // call parent for content
+ if(!pContext)
+ pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList );
+
+ return pContext;
+}
+
+void DrawAnnotationContext::EndElement()
+{
+ if(mxCursor.is())
+ {
+ // delete addition newline
+ const OUString aEmpty;
+ mxCursor->gotoEnd( sal_False );
+ mxCursor->goLeft( 1, sal_True );
+ mxCursor->setString( aEmpty );
+
+ // reset cursor
+ GetImport().GetTextImport()->ResetCursor();
+ }
+
+ if( mxAnnotation.is() )
+ {
+ mxAnnotation->setAuthor( maAuthorBuffer.makeStringAndClear() );
+
+ DateTime aDateTime;
+ if(SvXMLUnitConverter::convertDateTime(aDateTime, maDateBuffer.makeStringAndClear()))
+ mxAnnotation->setDateTime(aDateTime);
+ }
+}
//////////////////////////////////////////////////////////////////////////////
@@ -70,8 +220,9 @@ SdXMLGenericPageContext::SdXMLGenericPageContext(
USHORT nPrfx, const OUString& rLocalName,
const Reference< xml::sax::XAttributeList>& xAttrList,
Reference< drawing::XShapes >& rShapes)
-: SvXMLImportContext( rImport, nPrfx, rLocalName ),
- mxShapes( rShapes )
+: SvXMLImportContext( rImport, nPrfx, rLocalName )
+, mxShapes( rShapes )
+, mxAnnotationAccess( rShapes, UNO_QUERY )
{
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
@@ -100,10 +251,8 @@ void SdXMLGenericPageContext::StartElement( const Reference< ::com::sun::star::x
{
GetImport().GetShapeImport()->pushGroupForSorting( mxShapes );
-#ifndef SVX_LIGHT
if( GetImport().IsFormsSupported() )
GetImport().GetFormImport()->startPage( Reference< drawing::XDrawPage >::query( mxShapes ) );
-#endif
}
//////////////////////////////////////////////////////////////////////////////
@@ -120,10 +269,13 @@ SvXMLImportContext* SdXMLGenericPageContext::CreateChildContext( USHORT nPrefix,
}
else if( nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken( rLocalName, XML_FORMS ) )
{
-#ifndef SVX_LIGHT
if( GetImport().IsFormsSupported() )
pContext = GetImport().GetFormImport()->createOfficeFormsContext( GetImport(), nPrefix, rLocalName );
-#endif
+ }
+ else if( ((nPrefix == XML_NAMESPACE_OFFICE) || (nPrefix == XML_NAMESPACE_OFFICE_EXT)) && IsXMLToken( rLocalName, XML_ANNOTATION ) )
+ {
+ if( mxAnnotationAccess.is() )
+ pContext = new DrawAnnotationContext( GetImport(), nPrefix, rLocalName, xAttrList, mxAnnotationAccess );
}
else
{
diff --git a/xmloff/source/draw/ximppage.hxx b/xmloff/source/draw/ximppage.hxx
index fa32546b0810..45b505e2044f 100644
--- a/xmloff/source/draw/ximppage.hxx
+++ b/xmloff/source/draw/ximppage.hxx
@@ -35,6 +35,7 @@
#include "sdxmlimp_impl.hxx"
#include <xmloff/nmspmap.hxx>
#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/office/XAnnotationAccess.hpp>
#include <tools/rtti.hxx>
#include "ximpshap.hxx"
@@ -44,7 +45,8 @@
class SdXMLGenericPageContext : public SvXMLImportContext
{
// the shape group this group is working on
- com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > mxShapes;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxShapes;
+ ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotationAccess > mxAnnotationAccess;
protected:
rtl::OUString maPageLayoutName;
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 27ca5c4beafe..65aad96bad86 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -3584,16 +3584,17 @@ void SdXMLTableShapeContext::StartElement( const ::com::sun::star::uno::Referenc
}
const XMLPropertyMapEntry* pEntry = &aXMLTableShapeAttributes[0];
- int i = 0;
- while( pEntry->msApiName && (i < 6) ) try
- {
- const OUString sAPIPropertyName( OUString(pEntry->msApiName, pEntry->nApiNameLength, RTL_TEXTENCODING_ASCII_US ) );
- xProps->setPropertyValue( sAPIPropertyName, Any( maTemplateStylesUsed[i++] ) );
- pEntry++;
- }
- catch( Exception& )
+ for( int i = 0; pEntry->msApiName && (i < 6); i++, pEntry++ )
{
- DBG_ERROR("SdXMLTableShapeContext::StartElement(), exception caught!");
+ try
+ {
+ const OUString sAPIPropertyName( OUString(pEntry->msApiName, pEntry->nApiNameLength, RTL_TEXTENCODING_ASCII_US ) );
+ xProps->setPropertyValue( sAPIPropertyName, Any( maTemplateStylesUsed[i] ) );
+ }
+ catch( Exception& )
+ {
+ DBG_ERROR("SdXMLTableShapeContext::StartElement(), exception caught!");
+ }
}
}
diff --git a/xmloff/source/meta/MetaExportComponent.cxx b/xmloff/source/meta/MetaExportComponent.cxx
index 0b65592c3613..996e75d0f740 100644
--- a/xmloff/source/meta/MetaExportComponent.cxx
+++ b/xmloff/source/meta/MetaExportComponent.cxx
@@ -170,6 +170,7 @@ sal_uInt32 XMLMetaExportComponent::exportDoc( enum XMLTokenEnum )
const sal_Char* pVersion = 0;
switch( getDefaultVersion() )
{
+ case SvtSaveOptions::ODFVER_LATEST: pVersion = "1.2"; break;
case SvtSaveOptions::ODFVER_012: pVersion = "1.2"; break;
case SvtSaveOptions::ODFVER_011: pVersion = "1.1"; break;
case SvtSaveOptions::ODFVER_010: break;
diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx
index 4eda35e38a23..c903cf2dc1ba 100644
--- a/xmloff/source/meta/xmlmetai.cxx
+++ b/xmloff/source/meta/xmlmetai.cxx
@@ -209,7 +209,13 @@ void SvXMLMetaDocumentContext::initDocumentProperties()
}
}
-void SvXMLMetaDocumentContext::setBuildId(::rtl::OUString const& i_rBuildId)
+void SvXMLMetaDocumentContext::setBuildId(const ::rtl::OUString & i_rBuildId)
+{
+ SvXMLMetaDocumentContext::setBuildId( i_rBuildId, GetImport().getImportInfo() );
+}
+
+//static
+void SvXMLMetaDocumentContext::setBuildId(::rtl::OUString const& i_rBuildId, const uno::Reference<beans::XPropertySet>& xImportInfo )
{
OUString sBuildId;
// skip to second product
@@ -258,14 +264,13 @@ void SvXMLMetaDocumentContext::setBuildId(::rtl::OUString const& i_rBuildId)
if ( sBuildId.getLength() ) try
{
- uno::Reference<beans::XPropertySet> xSet(GetImport().getImportInfo());
- if( xSet.is() )
+ if( xImportInfo.is() )
{
const OUString aPropName(RTL_CONSTASCII_USTRINGPARAM("BuildId"));
uno::Reference< beans::XPropertySetInfo > xSetInfo(
- xSet->getPropertySetInfo());
+ xImportInfo->getPropertySetInfo());
if( xSetInfo.is() && xSetInfo->hasPropertyByName( aPropName ) )
- xSet->setPropertyValue( aPropName, uno::makeAny( sBuildId ) );
+ xImportInfo->setPropertyValue( aPropName, uno::makeAny( sBuildId ) );
}
}
catch( uno::Exception& )
diff --git a/xmloff/source/style/GradientStyle.cxx b/xmloff/source/style/GradientStyle.cxx
index 0961175e28b8..fc3f199f9c50 100644
--- a/xmloff/source/style/GradientStyle.cxx
+++ b/xmloff/source/style/GradientStyle.cxx
@@ -201,7 +201,7 @@ sal_Bool XMLGradientStyleImport::importXML(
case XML_TOK_GRADIENT_ANGLE:
{
sal_Int32 nValue;
- SvXMLUnitConverter::convertNumber( nValue, rStrValue, 0, 360 );
+ SvXMLUnitConverter::convertNumber( nValue, rStrValue, 0, 3600 );
aGradient.Angle = sal_Int16( nValue );
}
break;
diff --git a/xmloff/source/style/HatchStyle.cxx b/xmloff/source/style/HatchStyle.cxx
index ee8719c133f7..ac40a6ee4c10 100644
--- a/xmloff/source/style/HatchStyle.cxx
+++ b/xmloff/source/style/HatchStyle.cxx
@@ -159,7 +159,7 @@ sal_Bool XMLHatchStyleImport::importXML(
case XML_TOK_HATCH_ROTATION:
{
sal_Int32 nValue;
- rUnitConverter.convertNumber( nValue, rStrValue, 0, 360 );
+ rUnitConverter.convertNumber( nValue, rStrValue, 0, 3600 );
aHatch.Angle = sal_Int16( nValue );
}
break;
diff --git a/xmloff/source/style/TransGradientStyle.cxx b/xmloff/source/style/TransGradientStyle.cxx
index e98aeb2599ff..297440bcc5eb 100644
--- a/xmloff/source/style/TransGradientStyle.cxx
+++ b/xmloff/source/style/TransGradientStyle.cxx
@@ -194,7 +194,7 @@ sal_Bool XMLTransGradientStyleImport::importXML(
case XML_TOK_GRADIENT_ANGLE:
{
sal_Int32 nValue;
- SvXMLUnitConverter::convertNumber( nValue, rStrValue, 0, 360 );
+ SvXMLUnitConverter::convertNumber( nValue, rStrValue, 0, 3600 );
aGradient.Angle = sal_Int16( nValue );
}
break;
diff --git a/xmloff/source/style/impastp3.cxx b/xmloff/source/style/impastp3.cxx
index 1f5450204562..0bae295f32de 100644
--- a/xmloff/source/style/impastp3.cxx
+++ b/xmloff/source/style/impastp3.cxx
@@ -98,6 +98,46 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl* pFamilyData, c
///////////////////////////////////////////////////////////////////////////////
//
+// Adds a array of XMLPropertyState ( vector< XMLPropertyState > ) with a given name.
+// If the name exists already, nothing is done. If a style with a different name and
+// the same properties exists, a new one is added (like with bDontSeek).
+//
+
+sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLFamilyData_Impl* pFamilyData, const vector< XMLPropertyState >& rProperties, const OUString& rName )
+{
+ sal_Bool bAdded = sal_False;
+ sal_uInt32 i = 0;
+ sal_Int32 nProperties = rProperties.size();
+ sal_uInt32 nCount = maPropertiesList.Count();
+
+ for( i = 0; i < nCount; i++ )
+ {
+ SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList.GetObject( i );
+ if( nProperties > (sal_Int32)pIS->GetProperties().size() )
+ {
+ continue;
+ }
+ else if( nProperties < (sal_Int32)pIS->GetProperties().size() )
+ {
+ break;
+ }
+ }
+
+ if( !pFamilyData->mpNameList->Seek_Entry( &rName, 0 ) )
+ {
+ SvXMLAutoStylePoolPropertiesP_Impl* pProperties =
+ new SvXMLAutoStylePoolPropertiesP_Impl( pFamilyData, rProperties );
+ // ignore the generated name
+ pProperties->SetName( rName );
+ maPropertiesList.Insert( pProperties, i );
+ bAdded = sal_True;
+ }
+
+ return bAdded;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+//
// Search for a array of XMLPropertyState ( vector< XMLPropertyState > ) in list
//
diff --git a/xmloff/source/style/impastp4.cxx b/xmloff/source/style/impastp4.cxx
index 20772b00a4c0..946b613473db 100644
--- a/xmloff/source/style/impastp4.cxx
+++ b/xmloff/source/style/impastp4.cxx
@@ -235,6 +235,47 @@ sal_Bool SvXMLAutoStylePoolP_Impl::Add(OUString& rName, sal_Int32 nFamily,
return bRet;
}
+sal_Bool SvXMLAutoStylePoolP_Impl::AddNamed(const OUString& rName, sal_Int32 nFamily,
+ const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties )
+{
+ // get family and parent the same way as in Add()
+ sal_Bool bRet(sal_False);
+ ULONG nPos;
+
+ XMLFamilyData_Impl *pFamily = 0;
+ XMLFamilyData_Impl aTemporary( nFamily );
+ if( maFamilyList.Seek_Entry( &aTemporary, &nPos ) )
+ {
+ pFamily = maFamilyList.GetObject( nPos );
+ }
+
+ DBG_ASSERT( pFamily, "SvXMLAutoStylePool_Impl::Add: unknown family" );
+ if( pFamily )
+ {
+ SvXMLAutoStylePoolParentP_Impl aTmp( rParent );
+ SvXMLAutoStylePoolParentP_Impl *pParent = 0;
+
+ SvXMLAutoStylePoolParentsP_Impl *pParents = pFamily->mpParentList;
+ if( pParents->Seek_Entry( &aTmp, &nPos ) )
+ {
+ pParent = pParents->GetObject( nPos );
+ }
+ else
+ {
+ pParent = new SvXMLAutoStylePoolParentP_Impl( rParent );
+ pParents->Insert( pParent );
+ }
+
+ if( pParent->AddNamed( pFamily, rProperties, rName ) )
+ {
+ pFamily->mnCount++;
+ bRet = sal_True;
+ }
+ }
+
+ return bRet;
+}
+
OUString SvXMLAutoStylePoolP_Impl::AddToCache( sal_Int32 nFamily,
const OUString& rParent )
{
diff --git a/xmloff/source/style/impastpl.hxx b/xmloff/source/style/impastpl.hxx
index 3c4145a829a4..d63384a71068 100644
--- a/xmloff/source/style/impastpl.hxx
+++ b/xmloff/source/style/impastpl.hxx
@@ -124,6 +124,8 @@ public:
const ::rtl::OUString& GetName() const { return msName; }
const ::std::vector< XMLPropertyState >& GetProperties() const { return maProperties; }
sal_uInt32 GetPos() const { return mnPos; }
+
+ void SetName( const ::rtl::OUString& rNew ) { msName = rNew; }
};
typedef SvXMLAutoStylePoolPropertiesP_Impl *SvXMLAutoStylePoolPropertiesPPtr;
@@ -150,6 +152,8 @@ public:
sal_Bool Add( XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties, ::rtl::OUString& rName, bool bDontSeek = false );
+ sal_Bool AddNamed( XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties, const ::rtl::OUString& rName );
+
::rtl::OUString Find( const XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties ) const;
const ::rtl::OUString& GetParent() const { return msParent; }
@@ -197,6 +201,10 @@ public:
const ::std::vector< XMLPropertyState >& rProperties,
sal_Bool bCache = sal_False,
bool bDontSeek = false );
+ sal_Bool AddNamed( const ::rtl::OUString& rName, sal_Int32 nFamily,
+ const ::rtl::OUString& rParent,
+ const ::std::vector< XMLPropertyState >& rProperties );
+
::rtl::OUString AddToCache( sal_Int32 nFamily,
const ::rtl::OUString& rParent );
::rtl::OUString Find( sal_Int32 nFamily, const ::rtl::OUString& rParent,
diff --git a/xmloff/source/style/xmlaustp.cxx b/xmloff/source/style/xmlaustp.cxx
index cc7a4408e1e6..32c53ceb724a 100644
--- a/xmloff/source/style/xmlaustp.cxx
+++ b/xmloff/source/style/xmlaustp.cxx
@@ -381,6 +381,13 @@ sal_Bool SvXMLAutoStylePoolP::Add(OUString& rName, sal_Int32 nFamily, const OUSt
return pImpl->Add(rName, nFamily, rParent, rProperties);
}
+sal_Bool SvXMLAutoStylePoolP::AddNamed( const OUString& rName, sal_Int32 nFamily, const OUString& rParent,
+ const ::std::vector< XMLPropertyState >& rProperties )
+
+{
+ return pImpl->AddNamed(rName, nFamily, rParent, rProperties);
+}
+
OUString SvXMLAutoStylePoolP::AddAndCache( sal_Int32 nFamily,
const vector< XMLPropertyState >& rProperties )
{
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index c53885e73187..c3ff9abebd90 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -124,44 +124,45 @@ inline XMLTextFrameContextHyperlink_Impl::XMLTextFrameContextHyperlink_Impl(
{
}
-class XMLTextFrameDescContext_Impl : public SvXMLImportContext
+// --> OD 2009-07-22 #i73249#
+class XMLTextFrameTitleOrDescContext_Impl : public SvXMLImportContext
{
- OUString& rDesc;
+ OUString& mrTitleOrDesc;
public:
TYPEINFO();
- XMLTextFrameDescContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- OUString& rD );
- virtual ~XMLTextFrameDescContext_Impl();
+ XMLTextFrameTitleOrDescContext_Impl( SvXMLImport& rImport,
+ sal_uInt16 nPrfx,
+ const ::rtl::OUString& rLName,
+ OUString& rTitleOrDesc );
+ virtual ~XMLTextFrameTitleOrDescContext_Impl();
virtual void Characters( const OUString& rText );
};
-TYPEINIT1( XMLTextFrameDescContext_Impl, SvXMLImportContext );
+TYPEINIT1( XMLTextFrameTitleOrDescContext_Impl, SvXMLImportContext );
-XMLTextFrameDescContext_Impl::XMLTextFrameDescContext_Impl(
+XMLTextFrameTitleOrDescContext_Impl::XMLTextFrameTitleOrDescContext_Impl(
SvXMLImport& rImport,
- sal_uInt16 nPrfx, const OUString& rLName,
- const Reference< XAttributeList > &,
- OUString& rD ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rDesc( rD )
+ sal_uInt16 nPrfx,
+ const OUString& rLName,
+ OUString& rTitleOrDesc )
+ : SvXMLImportContext( rImport, nPrfx, rLName )
+ , mrTitleOrDesc( rTitleOrDesc )
{
}
-XMLTextFrameDescContext_Impl::~XMLTextFrameDescContext_Impl()
+XMLTextFrameTitleOrDescContext_Impl::~XMLTextFrameTitleOrDescContext_Impl()
{
}
-void XMLTextFrameDescContext_Impl::Characters( const OUString& rText )
+void XMLTextFrameTitleOrDescContext_Impl::Characters( const OUString& rText )
{
- rDesc += rText;
+ mrTitleOrDesc += rText;
}
+// <--
// ------------------------------------------------------------------------
@@ -385,7 +386,11 @@ class XMLTextFrameContext_Impl : public SvXMLImportContext
const ::rtl::OUString sAnchorPageNo;
const ::rtl::OUString sGraphicURL;
const ::rtl::OUString sGraphicFilter;
- const ::rtl::OUString sAlternativeText;
+ // --> OD 2009-07-22 #i73249#
+// const ::rtl::OUString sAlternativeText;
+ const ::rtl::OUString sTitle;
+ const ::rtl::OUString sDescription;
+ // <--
const ::rtl::OUString sFrameStyleName;
const ::rtl::OUString sGraphicRotation;
const ::rtl::OUString sTextBoxServiceName;
@@ -461,6 +466,9 @@ public:
const ::rtl::OUString& rName,
const ::rtl::OUString& rTargetFrameName,
sal_Bool bMap );
+ // --> OD 2009-07-22 #i73249#
+ void SetTitle( const ::rtl::OUString& rTitle );
+ // <--
void SetDesc( const ::rtl::OUString& rDesc );
::com::sun::star::text::TextContentAnchorType GetAnchorType() const { return eAnchorType; }
@@ -829,7 +837,11 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl(
, sAnchorPageNo(RTL_CONSTASCII_USTRINGPARAM("AnchorPageNo"))
, sGraphicURL(RTL_CONSTASCII_USTRINGPARAM("GraphicURL"))
, sGraphicFilter(RTL_CONSTASCII_USTRINGPARAM("GraphicFilter"))
-, sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText"))
+// --> OD 2009-07-22 #i73249#
+//, sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText"))
+, sTitle(RTL_CONSTASCII_USTRINGPARAM("Title"))
+, sDescription(RTL_CONSTASCII_USTRINGPARAM("Description"))
+// <--
, sFrameStyleName(RTL_CONSTASCII_USTRINGPARAM("FrameStyleName"))
, sGraphicRotation(RTL_CONSTASCII_USTRINGPARAM("GraphicRotation"))
, sTextBoxServiceName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextFrame"))
@@ -1135,12 +1147,15 @@ SvXMLImportContext *XMLTextFrameContext_Impl::CreateChildContext(
}
}
}
+ // --> OD 2009-08-17 #i100480#
+ // correction of condition which also avoids warnings.
if( !pContext &&
- ( XML_TEXT_FRAME_OBJECT == nType &&
- (XML_NAMESPACE_OFFICE == nPrefix &&
- IsXMLToken( rLocalName, XML_DOCUMENT )) ||
- (XML_NAMESPACE_MATH == nPrefix &&
- IsXMLToken(rLocalName, XML_MATH) ) ) )
+ ( XML_TEXT_FRAME_OBJECT == nType &&
+ ( ( XML_NAMESPACE_OFFICE == nPrefix &&
+ IsXMLToken( rLocalName, XML_DOCUMENT ) ) ||
+ ( XML_NAMESPACE_MATH == nPrefix &&
+ IsXMLToken( rLocalName, XML_MATH ) ) ) ) )
+ // <--
{
if( !xPropSet.is() && !bCreateFailed )
{
@@ -1262,18 +1277,31 @@ void XMLTextFrameContext_Impl::SetHyperlink( const OUString& rHRef,
}
}
+// --> OD 2009-07-22 #i73249#
+void XMLTextFrameContext_Impl::SetTitle( const OUString& rTitle )
+{
+ if ( xPropSet.is() )
+ {
+ Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
+ if( xPropSetInfo->hasPropertyByName( sTitle ) )
+ {
+ xPropSet->setPropertyValue( sTitle, makeAny( rTitle ) );
+ }
+ }
+}
+
void XMLTextFrameContext_Impl::SetDesc( const OUString& rDesc )
{
if ( xPropSet.is() )
{
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
- if( xPropSetInfo->hasPropertyByName( sAlternativeText ) )
+ Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
+ if( xPropSetInfo->hasPropertyByName( sDescription ) )
{
- xPropSet->setPropertyValue( sAlternativeText, makeAny( rDesc ) );
+ xPropSet->setPropertyValue( sDescription, makeAny( rDesc ) );
}
}
}
+// <--
//-----------------------------------------------------------------------------------------------------
@@ -1312,6 +1340,10 @@ XMLTextFrameContext::XMLTextFrameContext(
: SvXMLImportContext( rImport, nPrfx, rLName )
, m_xAttrList( new SvXMLAttributeList( xAttrList ) )
, m_pHyperlink( 0 )
+// --> OD 2009-07-22 #i73249#
+, m_sTitle()
+, m_sDesc()
+// <--
, m_eDefaultAnchorType( eATyp )
// --> OD 2006-03-10 #i51726#
, m_HasAutomaticStyleWithoutParentStyle( sal_False )
@@ -1374,9 +1406,20 @@ void XMLTextFrameContext::EndElement()
{
pImpl->CreateIfNotThere();
- // alternative text
+ // --> OD 2009-07-22 #i73249#
+// // alternative text
+// if( m_sDesc.getLength() )
+// pImpl->SetDesc( m_sDesc );
+ // svg:title
+ if( m_sTitle.getLength() )
+ {
+ pImpl->SetTitle( m_sTitle );
+ }
if( m_sDesc.getLength() )
+ {
pImpl->SetDesc( m_sDesc );
+ }
+ // <--
if( m_pHyperlink )
{
@@ -1494,10 +1537,40 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext(
// the child is a writer frame
if( XML_NAMESPACE_SVG == p_nPrefix )
{
- bool bOld = SvXMLImport::OOo_2x >= GetImport().getGeneratorVersion();
- if( IsXMLToken( rLocalName, bOld ? XML_DESC : XML_TITLE ) )
- pContext = new XMLTextFrameDescContext_Impl( GetImport(), p_nPrefix, rLocalName,
- xAttrList, m_sDesc );
+ // --> OD 2009-07-22 #i73249#
+// bool bOld = SvXMLImport::OOo_2x >= GetImport().getGeneratorVersion();
+// if( IsXMLToken( rLocalName, bOld ? XML_DESC : XML_TITLE ) )
+// pContext = new XMLTextFrameDescContext_Impl( GetImport(), p_nPrefix, rLocalName,
+// xAttrList, m_sDesc );
+ const bool bOld = SvXMLImport::OOo_2x >= GetImport().getGeneratorVersion();
+ if ( bOld )
+ {
+ if ( IsXMLToken( rLocalName, XML_DESC ) )
+ {
+ pContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(),
+ p_nPrefix,
+ rLocalName,
+ m_sTitle );
+ }
+ }
+ else
+ {
+ if( IsXMLToken( rLocalName, XML_TITLE ) )
+ {
+ pContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(),
+ p_nPrefix,
+ rLocalName,
+ m_sTitle );
+ }
+ else if ( IsXMLToken( rLocalName, XML_DESC ) )
+ {
+ pContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(),
+ p_nPrefix,
+ rLocalName,
+ m_sDesc );
+ }
+ }
+ // <--
}
else if( XML_NAMESPACE_DRAW == p_nPrefix )
{
diff --git a/xmloff/source/text/XMLTextFrameContext.hxx b/xmloff/source/text/XMLTextFrameContext.hxx
index 9b620a993590..51e41d45367c 100644
--- a/xmloff/source/text/XMLTextFrameContext.hxx
+++ b/xmloff/source/text/XMLTextFrameContext.hxx
@@ -53,6 +53,9 @@ class XMLTextFrameContext : public SvXMLImportContext
SvXMLAttributeList *m_pAttrList;
XMLTextFrameContextHyperlink_Impl *m_pHyperlink;
+ // --> OD 2009-07-22 #i73249#
+ ::rtl::OUString m_sTitle;
+ // <--
::rtl::OUString m_sDesc;
::com::sun::star::text::TextContentAnchorType m_eDefaultAnchorType;
diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx
index 1091636c9d3f..5e6f47ed5b6a 100644
--- a/xmloff/source/text/XMLTextMarkImportContext.cxx
+++ b/xmloff/source/text/XMLTextMarkImportContext.cxx
@@ -47,6 +47,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/rdf/XMetadatable.hpp>
#include <com/sun/star/text/XFormField.hpp>
@@ -111,9 +112,10 @@ XMLTextMarkImportContext::XMLTextMarkImportContext(
SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrefix,
- const OUString& rLocalName ) :
- SvXMLImportContext(rImport, nPrefix, rLocalName),
- rHelper(rHlp)
+ const OUString& rLocalName )
+ : SvXMLImportContext(rImport, nPrefix, rLocalName)
+ , m_rHelper(rHlp)
+ , m_bHaveAbout(false)
{
}
@@ -139,19 +141,24 @@ static SvXMLEnumMapEntry __READONLY_DATA lcl_aMarkTypeMap[] =
void XMLTextMarkImportContext::StartElement(
const Reference<XAttributeList> & xAttrList)
{
- if (!FindName(GetImport(), xAttrList, sBookmarkName, m_XmlId, &sFieldName))
- sBookmarkName=OUString();
+ if (!FindName(GetImport(), xAttrList))
+ {
+ m_sBookmarkName = OUString();
+ }
if (IsXMLToken(GetLocalName(), XML_FIELDMARK_END))
- sBookmarkName=rHelper.FindActiveBookmarkName();
+ {
+ m_sBookmarkName = m_rHelper.FindActiveBookmarkName();
+ }
if (IsXMLToken(GetLocalName(), XML_FIELDMARK_START) || IsXMLToken(GetLocalName(), XML_FIELDMARK))
{
- if (sBookmarkName.getLength()==0)
- sBookmarkName=::rtl::OUString::createFromAscii("Unknown");
- rHelper.pushFieldCtx( sBookmarkName, sFieldName );
+ if (m_sBookmarkName.getLength() == 0)
+ {
+ m_sBookmarkName = ::rtl::OUString::createFromAscii("Unknown");
+ }
+ m_rHelper.pushFieldCtx( m_sBookmarkName, m_sFieldName );
}
-
}
void XMLTextMarkImportContext::EndElement()
@@ -167,7 +174,7 @@ void XMLTextMarkImportContext::EndElement()
const OUString sAPI_formfieldmark(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.FormFieldmark"));
- if (sBookmarkName.getLength()>0)
+ if (m_sBookmarkName.getLength() > 0)
{
sal_uInt16 nTmp;
if (SvXMLUnitConverter::convertEnum(nTmp, GetLocalName(),
@@ -178,34 +185,42 @@ void XMLTextMarkImportContext::EndElement()
case TypeReference:
// export point reference mark
CreateAndInsertMark(GetImport(),
- sAPI_reference_mark,
- sBookmarkName,
- rHelper.GetCursorAsRange()->getStart(),
- ::rtl::OUString());
+ sAPI_reference_mark,
+ m_sBookmarkName,
+ m_rHelper.GetCursorAsRange()->getStart(),
+ ::rtl::OUString());
break;
case TypeFieldmark:
case TypeBookmark:
{
- bool bImportAsField=((lcl_MarkType)nTmp==TypeFieldmark && sFieldName.compareToAscii("msoffice.field.FORMCHECKBOX")==0); // for now only import FORMCHECKBOX boxes
+ bool bImportAsField=((lcl_MarkType)nTmp==TypeFieldmark && m_sFieldName.compareToAscii("msoffice.field.FORMCHECKBOX")==0); // for now only import FORMCHECKBOX boxes
// export point bookmark
- Reference<XInterface> xIfc=CreateAndInsertMark(GetImport(),
+ const Reference<XInterface> xContent(
+ CreateAndInsertMark(GetImport(),
(bImportAsField?sAPI_formfieldmark:sAPI_bookmark),
- sBookmarkName,
- rHelper.GetCursorAsRange()->getStart(),
- m_XmlId);
+ 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 (xIfc.is() && bImportAsField) {
+ if (xContent.is() && bImportAsField) {
// setup fieldmark...
- Reference< ::com::sun::star::text::XFormField> xFormField(xIfc, UNO_QUERY);
+ Reference< ::com::sun::star::text::XFormField> xFormField(xContent, UNO_QUERY);
xFormField->setType(1); // Checkbox...
- if (xFormField.is() && rHelper.hasCurrentFieldCtx()) {
+ if (xFormField.is() && m_rHelper.hasCurrentFieldCtx()) {
// xFormField->setDescription(::rtl::OUString::createFromAscii("HELLO CHECKBOX"));
// xFormField->setRes(1);
- rHelper.setCurrentFieldParamsTo(xFormField);
+ m_rHelper.setCurrentFieldParamsTo(xFormField);
}
}
- rHelper.popFieldCtx();
+ m_rHelper.popFieldCtx();
}
}
break;
@@ -213,9 +228,9 @@ void XMLTextMarkImportContext::EndElement()
case TypeFieldmarkStart:
case TypeBookmarkStart:
// save XTextRange for later construction of bookmark
- rHelper.InsertBookmarkStartRange(
- sBookmarkName, rHelper.GetCursorAsRange()->getStart(),
- m_XmlId);
+ m_rHelper.InsertBookmarkStartRange(
+ m_sBookmarkName, m_rHelper.GetCursorAsRange()->getStart(),
+ m_sXmlId);
break;
case TypeFieldmarkEnd:
@@ -223,18 +238,18 @@ void XMLTextMarkImportContext::EndElement()
{
// get old range, and construct
Reference<XTextRange> xStartRange;
- if (rHelper.FindAndRemoveBookmarkStartRange(sBookmarkName,
- xStartRange, m_XmlId))
+ if (m_rHelper.FindAndRemoveBookmarkStartRange(m_sBookmarkName,
+ xStartRange, m_sXmlId))
{
Reference<XTextRange> xEndRange(
- rHelper.GetCursorAsRange()->getStart());
+ m_rHelper.GetCursorAsRange()->getStart());
// check if beginning and end are in same XText
if (xStartRange->getText() == xEndRange->getText())
{
// create range for insertion
Reference<XTextCursor> xInsertionCursor =
- rHelper.GetText()->createTextCursorByRange(
+ m_rHelper.GetText()->createTextCursorByRange(
xEndRange);
xInsertionCursor->gotoRange(xStartRange, sal_True);
@@ -247,30 +262,39 @@ void XMLTextMarkImportContext::EndElement()
Reference<XTextRange> xInsertionRange(
xInsertionCursor, UNO_QUERY);
- bool bImportAsField=((lcl_MarkType)nTmp==TypeFieldmarkEnd && rHelper.hasCurrentFieldCtx());
+ bool bImportAsField=((lcl_MarkType)nTmp==TypeFieldmarkEnd && m_rHelper.hasCurrentFieldCtx());
if (bImportAsField) {
- ::rtl::OUString currentFieldType=rHelper.getCurrentFieldType();
+ ::rtl::OUString currentFieldType =
+ m_rHelper.getCurrentFieldType();
bImportAsField=currentFieldType.compareToAscii("msoffice.field.FORMTEXT")==0; // for now only import FORMTEXT boxes
}
// insert reference
- Reference<XInterface> xIfc=CreateAndInsertMark(GetImport(),
+ const Reference<XInterface> xContent(
+ CreateAndInsertMark(GetImport(),
(bImportAsField?sAPI_fieldmark:sAPI_bookmark),
- sBookmarkName,
- xInsertionRange,
- m_XmlId);
+ m_sBookmarkName,
+ xInsertionRange,
+ 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==TypeFieldmarkEnd) {
- if (xIfc.is() && bImportAsField) {
+ if (xContent.is() && bImportAsField) {
// setup fieldmark...
- Reference< ::com::sun::star::text::XFormField> xFormField(xIfc, UNO_QUERY);
+ Reference< ::com::sun::star::text::XFormField> xFormField(xContent, UNO_QUERY);
xFormField->setType(0); // Text
- if (xFormField.is() && rHelper.hasCurrentFieldCtx()) {
- rHelper.setCurrentFieldParamsTo(xFormField);
+ if (xFormField.is() && m_rHelper.hasCurrentFieldCtx()) {
+ m_rHelper.setCurrentFieldParamsTo(xFormField);
// xFormField->setDescription(::rtl::OUString::createFromAscii("HELLO"));
}
}
- rHelper.popFieldCtx();
+ m_rHelper.popFieldCtx();
}
}
// else: beginning/end in different XText -> ignore!
@@ -296,11 +320,12 @@ SvXMLImportContext *XMLTextMarkImportContext::CreateChildContext( USHORT nPrefix
const ::rtl::OUString& rLocalName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& )
{
- return new XMLFieldParamImportContext(GetImport(), rHelper, nPrefix, rLocalName);
+ return new XMLFieldParamImportContext(GetImport(), m_rHelper,
+ nPrefix, rLocalName);
}
-Reference<XInterface> XMLTextMarkImportContext::CreateAndInsertMark(
+Reference<XTextContent> XMLTextMarkImportContext::CreateAndInsertMark(
SvXMLImport& rImport,
const OUString& sServiceName,
const OUString& sMarkName,
@@ -337,9 +362,6 @@ Reference<XInterface> XMLTextMarkImportContext::CreateAndInsertMark(
}
}
- // xml:id for RDF metadata
- rImport.SetXmlId(xIfc, i_rXmlId);
-
// cast to XTextContent and attach to document
const Reference<XTextContent> xTextContent(xIfc, UNO_QUERY);
if (xTextContent.is())
@@ -350,6 +372,11 @@ Reference<XInterface> XMLTextMarkImportContext::CreateAndInsertMark(
// collapsing of the given XTextRange.
rImport.GetTextImport()->GetText()->insertTextContent(rRange,
xTextContent, sal_True);
+
+ // xml:id for RDF metadata -- after insertion!
+ rImport.SetXmlId(xIfc, i_rXmlId);
+
+ return xTextContent;
}
catch (com::sun::star::lang::IllegalArgumentException &)
{
@@ -358,44 +385,60 @@ Reference<XInterface> XMLTextMarkImportContext::CreateAndInsertMark(
}
}
}
- return xIfc;
+ return 0;
}
sal_Bool XMLTextMarkImportContext::FindName(
SvXMLImport& rImport,
- const Reference<XAttributeList> & xAttrList,
- OUString& sName,
- OUString& o_rXmlId,
- ::rtl::OUString *pFieldName)
+ const Reference<XAttributeList> & xAttrList)
{
sal_Bool bNameOK = sal_False;
// find name attribute first
- sal_Int16 nLength = xAttrList->getLength();
+ const sal_Int16 nLength = xAttrList->getLength();
for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
{
OUString sLocalName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().
+ const sal_uInt16 nPrefix = rImport.GetNamespaceMap().
GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
&sLocalName );
if ( (XML_NAMESPACE_TEXT == nPrefix) &&
IsXMLToken(sLocalName, XML_NAME) )
{
- sName = xAttrList->getValueByIndex(nAttr);
+ m_sBookmarkName = xAttrList->getValueByIndex(nAttr);
bNameOK = sal_True;
}
else if ( (XML_NAMESPACE_XML == nPrefix) &&
IsXMLToken(sLocalName, XML_ID) )
{
- o_rXmlId = xAttrList->getValueByIndex(nAttr);
+ m_sXmlId = xAttrList->getValueByIndex(nAttr);
+ }
+ else if ( XML_NAMESPACE_XHTML == nPrefix )
+ {
+ // RDFa
+ if ( IsXMLToken( sLocalName, XML_ABOUT) )
+ {
+ m_sAbout = xAttrList->getValueByIndex(nAttr);
+ m_bHaveAbout = true;
+ }
+ else if ( IsXMLToken( sLocalName, XML_PROPERTY) )
+ {
+ m_sProperty = xAttrList->getValueByIndex(nAttr);
+ }
+ else if ( IsXMLToken( sLocalName, XML_CONTENT) )
+ {
+ m_sContent = xAttrList->getValueByIndex(nAttr);
+ }
+ else if ( IsXMLToken( sLocalName, XML_DATATYPE) )
+ {
+ m_sDatatype = xAttrList->getValueByIndex(nAttr);
+ }
}
-//FIXME: RDFa (text:bookmark-start)
- else if ( pFieldName!=NULL &&
- (XML_NAMESPACE_FIELD == nPrefix) &&
+ else if ( (XML_NAMESPACE_FIELD == nPrefix) &&
IsXMLToken(sLocalName, XML_TYPE) )
{
- *pFieldName = xAttrList->getValueByIndex(nAttr);
+ m_sFieldName = xAttrList->getValueByIndex(nAttr);
}
}
diff --git a/xmloff/source/text/XMLTextMarkImportContext.hxx b/xmloff/source/text/XMLTextMarkImportContext.hxx
index 4491524e9ec2..0269a3b4622d 100644
--- a/xmloff/source/text/XMLTextMarkImportContext.hxx
+++ b/xmloff/source/text/XMLTextMarkImportContext.hxx
@@ -39,6 +39,7 @@
namespace com { namespace sun { namespace star {
namespace text {
class XTextRange;
+ class XTextContent;
}
namespace xml { namespace sax {
class XAttributeList;
@@ -75,10 +76,16 @@ public:
class XMLTextMarkImportContext : public SvXMLImportContext
{
- XMLTextImportHelper& rHelper;
- ::rtl::OUString m_XmlId;
- ::rtl::OUString sBookmarkName;
- ::rtl::OUString sFieldName;
+ XMLTextImportHelper & m_rHelper;
+ ::rtl::OUString m_sBookmarkName;
+ ::rtl::OUString m_sFieldName;
+ ::rtl::OUString m_sXmlId;
+ // RDFa
+ bool m_bHaveAbout;
+ ::rtl::OUString m_sAbout;
+ ::rtl::OUString m_sProperty;
+ ::rtl::OUString m_sContent;
+ ::rtl::OUString m_sDatatype;
public:
@@ -90,7 +97,6 @@ public:
sal_uInt16 nPrfx,
const ::rtl::OUString& rLocalName );
-
protected:
virtual void StartElement(
@@ -103,7 +109,8 @@ protected:
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
public:
- static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > CreateAndInsertMark(
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XTextContent > CreateAndInsertMark(
SvXMLImport& rImport,
const ::rtl::OUString& sServiceName,
const ::rtl::OUString& sMarkName,
@@ -111,13 +118,10 @@ public:
::com::sun::star::text::XTextRange> & rRange,
const ::rtl::OUString& i_rXmlId = ::rtl::OUString());
- static sal_Bool FindName(
+ sal_Bool FindName(
SvXMLImport& rImport,
const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList,
- ::rtl::OUString& sName,
- ::rtl::OUString& o_rXmlId,
- ::rtl::OUString *pFieldName=NULL);
+ ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
};
#endif
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index 873a4a42f02c..198938fdc8f6 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -148,7 +148,7 @@ static sal_Char __READONLY_DATA FIELD_SERVICE_BIBLIOGRAPHY[] = "Bibliography";
static sal_Char __READONLY_DATA FIELD_SERVICE_SCRIPT[] = "Script";
static sal_Char __READONLY_DATA FIELD_SERVICE_ANNOTATION[] = "Annotation";
static sal_Char __READONLY_DATA FIELD_SERVICE_COMBINED_CHARACTERS[] = "CombinedCharacters";
-static sal_Char __READONLY_DATA FIELD_SERVICE_META[] = "MetaField";
+static sal_Char __READONLY_DATA FIELD_SERVICE_META[] = "MetadataField";
static sal_Char __READONLY_DATA FIELD_SERVICE_MEASURE[] = "Measure";
static sal_Char __READONLY_DATA FIELD_SERVICE_TABLE_FORMULA[] = "TableFormula";
static sal_Char __READONLY_DATA FIELD_SERVICE_DROP_DOWN[] = "DropDown";
@@ -263,7 +263,7 @@ XMLTextFieldExport::XMLTextFieldExport( SvXMLExport& rExp,
XMLPropertyState* pCombinedCharState)
: rExport(rExp),
pUsedMasters(NULL),
- sServicePrefix(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextField.")),
+ sServicePrefix(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.textfield.")),
sFieldMasterPrefix(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.FieldMaster.")),
sPresentationServicePrefix(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.TextField.")),
@@ -645,7 +645,7 @@ sal_Bool XMLTextFieldExport::IsStringField(
return !bRet;
}
- case FIELD_ID_META://FIXME ?????? no idea...
+ case FIELD_ID_META:
return 0 > GetIntProperty(sPropertyNumberFormat, xPropSet);
case FIELD_ID_DATABASE_DISPLAY:
@@ -740,7 +740,8 @@ sal_Bool XMLTextFieldExport::IsStringField(
/// export the styles needed by the given field. Called on first pass
/// through document
void XMLTextFieldExport::ExportFieldAutoStyle(
- const Reference<XTextField> & rTextField, sal_Bool bProgress )
+ const Reference<XTextField> & rTextField, const sal_Bool bProgress,
+ const sal_Bool bRecursive )
{
// get property set
Reference<XPropertySet> xPropSet(rTextField, UNO_QUERY);
@@ -835,7 +836,10 @@ void XMLTextFieldExport::ExportFieldAutoStyle(
case FIELD_ID_META:
// recurse into content (does not export element, so can be done first)
- ExportMetaField(xPropSet, true, bProgress);
+ if (bRecursive)
+ {
+ ExportMetaField(xPropSet, true, bProgress);
+ }
// fall-through: for the meta-field itself!
case FIELD_ID_DOCINFO_PRINT_TIME:
case FIELD_ID_DOCINFO_PRINT_DATE:
@@ -2263,7 +2267,6 @@ void XMLTextFieldExport::ExportMacro(
GetExport().Characters(rContent);
}
-// FIXME: this is untested
void XMLTextFieldExport::ExportMetaField(
const Reference<XPropertySet> & i_xMeta,
bool i_bAutoStyles, sal_Bool i_bProgress )
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index e47c3aae262b..613a4688389f 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -931,6 +931,134 @@ OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars,
return bConverted ? sChars.makeStringAndClear() : rChars;
}
+// --> OD 2006-10-12 #i69629#
+// helper method to determine, if a paragraph style has a list style (inclusive
+// an empty one) inherits a list style (inclusive an empty one) from one of its parents
+// --> OD 2007-01-29 #i73973#
+// apply special case, that found list style equals the chapter numbering, also
+// to the found list styles of the parent styles.
+sal_Bool lcl_HasListStyle( OUString sStyleName,
+ const Reference < XNameContainer >& xParaStyles,
+ SvXMLImport& rImport,
+ const OUString& sNumberingStyleName,
+ const OUString& sOutlineStyleName )
+{
+ sal_Bool bRet( sal_False );
+
+ if ( !xParaStyles->hasByName( sStyleName ) )
+ {
+ // error case
+ return sal_True;
+ }
+
+ Reference< XPropertyState > xPropState( xParaStyles->getByName( sStyleName ),
+ UNO_QUERY );
+ if ( !xPropState.is() )
+ {
+ // error case
+ return sal_False;
+ }
+
+ if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
+ {
+ // list style found
+ bRet = sal_True;
+ // special case: the set list style equals the chapter numbering
+ Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
+ if ( xPropSet.is() )
+ {
+ OUString sListStyle;
+ xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
+ if ( sListStyle.getLength() != 0 &&
+ sListStyle == sOutlineStyleName )
+ {
+ bRet = sal_False;
+ }
+ }
+ }
+ else
+ {
+ // --> OD 2007-12-07 #i77708#
+ sal_Int32 nUPD( 0 );
+ sal_Int32 nBuild( 0 );
+ // --> OD 2008-03-19 #i86058#
+// rImport.getBuildIds( nUPD, nBuild );
+ const bool bBuildIdFound = rImport.getBuildIds( nUPD, nBuild );
+ // <--
+ // <--
+ // search list style at parent
+ Reference<XStyle> xStyle( xPropState, UNO_QUERY );
+ while ( xStyle.is() )
+ {
+ OUString aParentStyle( xStyle->getParentStyle() );
+ if ( aParentStyle.getLength() > 0 )
+ {
+ aParentStyle =
+ rImport.GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH,
+ aParentStyle );
+ }
+ if ( aParentStyle.getLength() == 0 ||
+ !xParaStyles->hasByName( aParentStyle ) )
+ {
+ // no list style found
+ break;
+ }
+ else
+ {
+ xPropState = Reference< XPropertyState >(
+ xParaStyles->getByName( aParentStyle ),
+ UNO_QUERY );
+ if ( !xPropState.is() )
+ {
+ // error case
+ return sal_True;
+ }
+ if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
+ {
+ // list style found
+ bRet = sal_True;
+ // --> OD 2007-01-29 #i73973#
+ // special case: the found list style equals the chapter numbering
+ Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
+ if ( xPropSet.is() )
+ {
+ OUString sListStyle;
+ xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
+ if ( sListStyle.getLength() != 0 &&
+ sListStyle == sOutlineStyleName )
+ {
+ bRet = sal_False;
+ }
+ // --> OD 2007-12-07 #i77708#
+ // special handling for text documents from OOo version prior OOo 2.4
+ // --> OD 2008-03-19 #i86058#
+ // check explicitly on certain versions and on import of
+ // text documents in OpenOffice.org file format
+ else if ( sListStyle.getLength() == 0 &&
+ ( rImport.IsTextDocInOOoFileFormat() ||
+ ( bBuildIdFound &&
+ ( ( nUPD == 641 ) || ( nUPD == 645 ) || // prior OOo 2.0
+ ( nUPD == 680 && nBuild <= 9238 ) ) ) ) ) // OOo 2.0 - OOo 2.3.1
+ {
+ bRet = sal_False;
+ }
+ // <--
+ }
+ // <--
+ break;
+ }
+ else
+ {
+ // search list style at parent
+ xStyle = Reference<XStyle>( xPropState, UNO_QUERY );
+ }
+ }
+ }
+ }
+
+ return bRet;
+}
+// <--
OUString XMLTextImportHelper::SetStyleAndAttrs(
SvXMLImport& rImport,
const Reference < XTextCursor >& rCursor,
@@ -1035,30 +1163,38 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
if (pListBlock || pNumberedParagraph)
{
- sal_Bool bSameNumRules = xNewNumRules == xNumRules;
- if( !bSameNumRules && xNewNumRules.is() && xNumRules.is() )
+ // --> OD 2009-08-24 #i101349#
+ // Assure that list style of automatic paragraph style is applied at paragraph.
+ sal_Bool bApplyNumRules = pStyle && pStyle->IsListStyleSet();
+ if ( !bApplyNumRules )
{
- // If the interface pointers are different then this does
- // not mean that the num rules are different. Further tests
- // are required then. However, if only one num rule is
- // set, no tests are required of course.
- Reference< XNamed > xNewNamed( xNewNumRules, UNO_QUERY );
- Reference< XNamed > xNamed( xNumRules, UNO_QUERY );
- if( xNewNamed.is() && xNamed.is() )
- {
- bSameNumRules = xNewNamed->getName() == xNamed->getName();
- }
- else
+ sal_Bool bSameNumRules = xNewNumRules == xNumRules;
+ if( !bSameNumRules && xNewNumRules.is() && xNumRules.is() )
{
- Reference< XAnyCompare > xNumRuleCompare( xNumRules, UNO_QUERY );
- if( xNumRuleCompare.is() )
+ // If the interface pointers are different then this does
+ // not mean that the num rules are different. Further tests
+ // are required then. However, if only one num rule is
+ // set, no tests are required of course.
+ Reference< XNamed > xNewNamed( xNewNumRules, UNO_QUERY );
+ Reference< XNamed > xNamed( xNumRules, UNO_QUERY );
+ if( xNewNamed.is() && xNamed.is() )
+ {
+ bSameNumRules = xNewNamed->getName() == xNamed->getName();
+ }
+ else
{
- bSameNumRules = (xNumRuleCompare->compare( Any(xNumRules), Any(xNewNumRules) ) == 0);
+ Reference< XAnyCompare > xNumRuleCompare( xNumRules, UNO_QUERY );
+ if( xNumRuleCompare.is() )
+ {
+ bSameNumRules = (xNumRuleCompare->compare( Any(xNumRules), Any(xNewNumRules) ) == 0);
+ }
}
}
+ bApplyNumRules = !bSameNumRules;
}
- if( !bSameNumRules )
+ if ( bApplyNumRules )
+ // <--
{
// #102607# This may except when xNewNumRules contains
// a Writer-NumRule-Implementation bug gets applied to
@@ -1241,14 +1377,20 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
// Some minor rework and adjust access to paragraph styles
if ( bPara )
{
+ // --> OD 2009-08-18 #i103817#
+ sal_Int16 nCurrentOutlineLevelInheritedFromParagraphStyle = 0;
+ const bool bHasOutlineLevelProp( xPropSetInfo->hasPropertyByName( sOutlineLevel ) );
+ if ( bHasOutlineLevelProp )
+ {
+ xPropSet->getPropertyValue( sOutlineLevel ) >>= nCurrentOutlineLevelInheritedFromParagraphStyle;
+ }
+ // <--
//if ( bPara && nOutlineLevel != -1 ) //#outline level,removed by zhaojianwei
if ( nOutlineLevel > 0 ) //add by zhaojianwei
{
//#outline level,removed by zhaojianwei
- if ( xPropSetInfo->hasPropertyByName( sOutlineLevel ) )
+ if ( bHasOutlineLevelProp )
{
- sal_Int16 nCurrentOutlineLevelInheritedFromParagraphStyle = 0;
- xPropSet->getPropertyValue( sOutlineLevel ) >>= nCurrentOutlineLevelInheritedFromParagraphStyle;
// In case that the value equals the value of its paragraph style
// attribute outline level, the paragraph attribute value is left unset
if ( nCurrentOutlineLevelInheritedFromParagraphStyle != nOutlineLevel )
@@ -1327,15 +1469,33 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
{
AddOutlineStyleCandidate( nOutlineLevel, sStyleName );
}
+ // --> OD 2009-08-18 #i103817#
+ // Assure that heading applies the outline style
+ if ( ( !pStyle || !pStyle->IsListStyleSet() ) &&
+ !bOutlineStyleCandidate &&
+ xChapterNumbering.is() )
+ {
+ OUString sEmptyStr;
+ if ( !lcl_HasListStyle( sStyleName,
+ xParaStyles, GetXMLImport(),
+ sNumberingStyleName,
+ sEmptyStr ) )
+ {
+ // heading not in a list --> apply outline style
+ xPropSet->setPropertyValue( sNumberingRules,
+ makeAny(xChapterNumbering) );
+ xPropSet->setPropertyValue( sNumberingLevel,
+ makeAny( static_cast<sal_Int8>(nOutlineLevel - 1) ) );
+ }
+ }
+ // <--
}
// <--
}
//-> #outlinelevel added by zhaojianwei
//handle for text:p,if the paragraphstyle outlinelevel is set to[1~10]
- else if( xPropSetInfo->hasPropertyByName( sOutlineLevel ) )
+ else if( bHasOutlineLevelProp )
{
- sal_Int16 nCurrentOutlineLevelInheritedFromParagraphStyle = 0;
- xPropSet->getPropertyValue( sOutlineLevel ) >>= nCurrentOutlineLevelInheritedFromParagraphStyle;
if ( nCurrentOutlineLevelInheritedFromParagraphStyle != 0 )
{
sal_Int16 nZero = 0;
@@ -1428,132 +1588,6 @@ void XMLTextImportHelper::AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel
// <--
// --> OD 2006-10-12 #i69629#
-// helper method to determine, if a paragraph style has a list style (inclusive
-// an empty one) inherits a list style (inclusive an empty one) from one of its parents
-// --> OD 2007-01-29 #i73973#
-// apply special case, that found list style equals the chapter numbering, also
-// to the found list styles of the parent styles.
-sal_Bool lcl_HasListStyle( OUString sStyleName,
- const Reference < XNameContainer >& xParaStyles,
- SvXMLImport& rImport,
- const OUString& sNumberingStyleName,
- const OUString& sOutlineStyleName )
-{
- sal_Bool bRet( sal_False );
-
- if ( !xParaStyles->hasByName( sStyleName ) )
- {
- // error case
- return sal_True;
- }
-
- Reference< XPropertyState > xPropState( xParaStyles->getByName( sStyleName ),
- UNO_QUERY );
- if ( !xPropState.is() )
- {
- // error case
- return sal_False;
- }
-
- if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
- {
- // list style found
- bRet = sal_True;
- // special case: the set list style equals the chapter numbering
- Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
- if ( xPropSet.is() )
- {
- OUString sListStyle;
- xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
- if ( sListStyle == sOutlineStyleName )
- {
- bRet = sal_False;
- }
- }
- }
- else
- {
- // --> OD 2007-12-07 #i77708#
- sal_Int32 nUPD( 0 );
- sal_Int32 nBuild( 0 );
- // --> OD 2008-03-19 #i86058#
-// rImport.getBuildIds( nUPD, nBuild );
- const bool bBuildIdFound = rImport.getBuildIds( nUPD, nBuild );
- // <--
- // <--
- // search list style at parent
- Reference<XStyle> xStyle( xPropState, UNO_QUERY );
- while ( xStyle.is() )
- {
- OUString aParentStyle( xStyle->getParentStyle() );
- if ( aParentStyle.getLength() > 0 )
- {
- aParentStyle =
- rImport.GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH,
- aParentStyle );
- }
- if ( aParentStyle.getLength() == 0 ||
- !xParaStyles->hasByName( aParentStyle ) )
- {
- // no list style found
- break;
- }
- else
- {
- xPropState = Reference< XPropertyState >(
- xParaStyles->getByName( aParentStyle ),
- UNO_QUERY );
- if ( !xPropState.is() )
- {
- // error case
- return sal_True;
- }
- if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
- {
- // list style found
- bRet = sal_True;
- // --> OD 2007-01-29 #i73973#
- // special case: the found list style equals the chapter numbering
- Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
- if ( xPropSet.is() )
- {
- OUString sListStyle;
- xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
- if ( sListStyle == sOutlineStyleName )
- {
- bRet = sal_False;
- }
- // --> OD 2007-12-07 #i77708#
- // special handling for text documents from OOo version prior OOo 2.4
- // --> OD 2008-03-19 #i86058#
- // check explicitly on certain versions and on import of
- // text documents in OpenOffice.org file format
- else if ( sListStyle.getLength() == 0 &&
- ( rImport.IsTextDocInOOoFileFormat() ||
- ( bBuildIdFound &&
- ( ( nUPD == 641 ) || ( nUPD == 645 ) || // prior OOo 2.0
- ( nUPD == 680 && nBuild <= 9238 ) ) ) ) ) // OOo 2.0 - OOo 2.3.1
- {
- bRet = sal_False;
- }
- // <--
- }
- // <--
- break;
- }
- else
- {
- // search list style at parent
- xStyle = Reference<XStyle>( xPropState, UNO_QUERY );
- }
- }
- }
- }
-
- return bRet;
-}
-// <--
-// --> OD 2006-10-12 #i69629#
void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
{
if ( ( mpOutlineStylesCandidates != NULL || bSetEmptyLevels ) &&
diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx
index 875d78b6bfe7..9feacd0ad3d9 100644
--- a/xmloff/source/text/txtimppr.cxx
+++ b/xmloff/source/text/txtimppr.cxx
@@ -39,6 +39,7 @@
#include <tools/string.hxx>
#include <xmloff/XMLFontStylesContext.hxx>
#include <xmloff/txtprmap.hxx>
+#include <xmloff/xmlimp.hxx>
#include "txtimppr.hxx"
#define XML_LINE_LEFT 0
@@ -120,11 +121,21 @@ sal_Bool XMLTextImportPropertyMapper::handleSpecialItem(
case CTF_FONTFAMILYNAME:
case CTF_FONTFAMILYNAME_CJK:
case CTF_FONTFAMILYNAME_CTL:
- case CTF_TEXT_DISPLAY:
bRet = getPropertySetMapper()->importXML( rValue, rProperty,
rUnitConverter );
break;
+ case CTF_TEXT_DISPLAY:
+ bRet = getPropertySetMapper()->importXML( rValue, rProperty,
+ rUnitConverter );
+ if( SvXMLImport::OOo_2x == GetImport().getGeneratorVersion() )
+ {
+ sal_Bool bHidden;
+ rProperty.maValue >>= bHidden;
+ bHidden = !bHidden;
+ rProperty.maValue <<= bHidden;
+ }
+ break;
default:
bRet = SvXMLImportPropertyMapper::handleSpecialItem( rProperty,
rProperties, rValue, rUnitConverter, rNamespaceMap );
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index a96fe0ffd1a2..2c160eabd334 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -1128,7 +1128,11 @@ XMLTextParagraphExport::XMLTextParagraphExport(
// <--
sActualSize(RTL_CONSTASCII_USTRINGPARAM("ActualSize")),
- sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText")),
+ // --> OD 2009-07-22 #i73249#
+// sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText")),
+ sTitle(RTL_CONSTASCII_USTRINGPARAM("Title")),
+ sDescription(RTL_CONSTASCII_USTRINGPARAM("Description")),
+ // <--
sAnchorCharStyleName(RTL_CONSTASCII_USTRINGPARAM("AnchorCharStyleName")),
sAnchorPageNo(RTL_CONSTASCII_USTRINGPARAM("AnchorPageNo")),
sAnchorType(RTL_CONSTASCII_USTRINGPARAM("AnchorType")),
@@ -1457,8 +1461,8 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( sal_Bool bIsProgres
{
Any aAny = xTextFieldsEnum->nextElement();
Reference< XTextField > xTextField = *(Reference<XTextField>*)aAny.getValue();
- exportTextField( xTextField->getAnchor(), bAutoStyles,
- bIsProgress );
+ exportTextField( xTextField, bAutoStyles, bIsProgress,
+ !xAutoStylesSupp.is() );
try
{
Reference < XPropertySet > xSet( xTextField, UNO_QUERY );
@@ -1466,8 +1470,11 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( sal_Bool bIsProgres
Any a = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("TextRange") );
a >>= xText;
if ( xText.is() )
+ {
exportText( xText, sal_True, bIsProgress, bExportContent );
- GetExport().GetTextParagraphExport()->collectTextAutoStyles( xText );
+ GetExport().GetTextParagraphExport()
+ ->collectTextAutoStyles( xText );
+ }
}
catch (Exception&)
{
@@ -2141,7 +2148,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
sal_Bool bAutoStyles, sal_Bool bIsProgress,
sal_Bool bPrvChrIsSpc )
{
- static OUString sMeta(RTL_CONSTASCII_USTRINGPARAM("Meta")); // FIXME
+ static OUString sMeta(RTL_CONSTASCII_USTRINGPARAM("InContentMetadata"));
sal_Bool bPrevCharIsSpace = bPrvChrIsSpc;
while( rTextEnum->hasMoreElements() )
@@ -2301,7 +2308,8 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
}
}
- DBG_ASSERT( !bOpenRuby, "Red Alert: Ruby still open!" );
+// now that there are nested enumerations for meta(-field), this may be valid!
+// DBG_ASSERT( !bOpenRuby, "Red Alert: Ruby still open!" );
}
void XMLTextParagraphExport::exportTable(
@@ -2322,21 +2330,29 @@ void XMLTextParagraphExport::exportTextField(
DBG_ASSERT( xTxtFld.is(), "text field missing" );
if( xTxtFld.is() )
{
- if( bAutoStyles )
- {
- pFieldExport->ExportFieldAutoStyle( xTxtFld, bIsProgress );
- }
- else
- {
- pFieldExport->ExportField( xTxtFld, bIsProgress );
- }
+ exportTextField(xTxtFld, bAutoStyles, bIsProgress, sal_True);
}
else
{
// write only characters
GetExport().Characters(rTextRange->getString());
}
+ }
+}
+void XMLTextParagraphExport::exportTextField(
+ const Reference < XTextField > & xTextField,
+ const sal_Bool bAutoStyles, const sal_Bool bIsProgress,
+ const sal_Bool bRecursive )
+{
+ if ( bAutoStyles )
+ {
+ pFieldExport->ExportFieldAutoStyle( xTextField, bIsProgress,
+ bRecursive );
+ }
+ else
+ {
+ pFieldExport->ExportField( xTextField, bIsProgress );
}
}
@@ -2381,9 +2397,12 @@ void XMLTextParagraphExport::exportTextMark(
nElement = *(sal_Bool *)rPropSet->getPropertyValue(sIsStart).getValue() ? 1 : 2;
}
- // bookmark, bookmark-start: xml:id for RDF metadata
+ // bookmark, bookmark-start: xml:id and RDFa for RDF metadata
if( nElement < 2 ) {
GetExport().AddAttributeXmlId(xName);
+ const uno::Reference<text::XTextContent> xTextContent(
+ xName, uno::UNO_QUERY_THROW);
+ GetExport().AddAttributesRDFa(xTextContent);
}
// export element
@@ -2782,6 +2801,10 @@ void XMLTextParagraphExport::_exportTextFrame(
// image map
GetExport().GetImageMapExport().Export( rPropSet );
+ // --> OD 2009-07-22 #i73249#
+ // svg:title and svg:desc
+ exportTitleAndDescription( rPropSet, rPropSetInfo );
+ // <--
}
void XMLTextParagraphExport::exportContour(
@@ -2973,8 +2996,10 @@ void XMLTextParagraphExport::_exportTextGraphic(
// image map
GetExport().GetImageMapExport().Export( rPropSet );
- // svg:desc
- exportAlternativeText( rPropSet, rPropSetInfo );
+ // --> OD 2009-07-22 #i73249#
+ // svg:title and svg:desc
+ exportTitleAndDescription( rPropSet, rPropSetInfo );
+ // <--
// draw:contour
exportContour( rPropSet, rPropSetInfo );
@@ -3003,23 +3028,39 @@ void XMLTextParagraphExport::exportEvents( const Reference < XPropertySet > & rP
if (rPropSet->getPropertySetInfo()->hasPropertyByName(sImageMap))
GetExport().GetImageMapExport().Export( rPropSet );
}
-void XMLTextParagraphExport::exportAlternativeText(
+
+// --> OD 2009-07-22 #i73249#
+void XMLTextParagraphExport::exportTitleAndDescription(
const Reference < XPropertySet > & rPropSet,
const Reference < XPropertySetInfo > & rPropSetInfo )
{
// svg:title
- if( rPropSetInfo->hasPropertyByName( sAlternativeText ) )
+ if( rPropSetInfo->hasPropertyByName( sTitle ) )
{
- OUString sAltText;
- rPropSet->getPropertyValue( sAlternativeText ) >>= sAltText;
- if( sAltText.getLength() )
+ OUString sObjTitle;
+ rPropSet->getPropertyValue( sTitle ) >>= sObjTitle;
+ if( sObjTitle.getLength() )
{
SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_SVG,
XML_TITLE, sal_True, sal_False );
- GetExport().Characters( sAltText );
+ GetExport().Characters( sObjTitle );
+ }
+ }
+
+ // svg:description
+ if( rPropSetInfo->hasPropertyByName( sDescription ) )
+ {
+ OUString sObjDesc;
+ rPropSet->getPropertyValue( sDescription ) >>= sObjDesc;
+ if( sObjDesc.getLength() )
+ {
+ SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_SVG,
+ XML_DESC, sal_True, sal_False );
+ GetExport().Characters( sObjDesc );
}
}
}
+// <--
void XMLTextParagraphExport::setTextEmbeddedGraphicURL(
const Reference < XPropertySet >&,
@@ -3638,11 +3679,12 @@ void XMLTextParagraphExport::exportRuby(
}
}
-// FIXME: this is untested
void XMLTextParagraphExport::exportMeta(
- const Reference<XPropertySet> & i_xMeta,
+ const Reference<XPropertySet> & i_xPortion,
sal_Bool i_bAutoStyles, sal_Bool i_isProgress)
{
+ static OUString sMeta(RTL_CONSTASCII_USTRINGPARAM("InContentMetadata"));
+
bool doExport(!i_bAutoStyles); // do not export element if autostyles
// check version >= 1.2
switch (GetExport().getDefaultVersion()) {
@@ -3651,13 +3693,14 @@ void XMLTextParagraphExport::exportMeta(
default: break;
}
- const Reference < XEnumerationAccess > xEA( i_xMeta, UNO_QUERY_THROW );
- const Reference < XEnumeration > xTextEnum( xEA->createEnumeration() );
+ const Reference< XTextContent > xTextContent(
+ i_xPortion->getPropertyValue(sMeta), UNO_QUERY_THROW);
+ const Reference< XEnumerationAccess > xEA( xTextContent, UNO_QUERY_THROW );
+ const Reference< XEnumeration > xTextEnum( xEA->createEnumeration() );
if (doExport)
{
- const Reference<rdf::XMetadatable> xMeta( i_xMeta, UNO_QUERY_THROW );
- const Reference<XTextContent> xTextContent( i_xMeta, UNO_QUERY_THROW );
+ const Reference<rdf::XMetadatable> xMeta(xTextContent, UNO_QUERY_THROW);
// text:meta with neither xml:id nor RDFa is invalid
xMeta->ensureMetadataReference();
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx
index 6fb213f43642..dda2c3d49030 100644
--- a/xmloff/source/text/txtparai.cxx
+++ b/xmloff/source/text/txtparai.cxx
@@ -190,6 +190,11 @@ public:
const OUString& rLocalName,
XMLHints_Impl& rHnts,
const Reference<xml::sax::XAttributeList> & xAttrList);
+
+ static sal_Bool FindName(
+ SvXMLImport& rImport,
+ const Reference<xml::sax::XAttributeList> & xAttrList,
+ OUString& rName);
};
TYPEINIT1( XMLStartReferenceContext_Impl, SvXMLImportContext );
@@ -203,11 +208,8 @@ XMLStartReferenceContext_Impl::XMLStartReferenceContext_Impl(
SvXMLImportContext(rImport, nPrefix, rLocalName)
{
OUString sName;
- OUString dummy;
- // borrow FindName from XMLTextMarkImportContext, where bookmarks
- // and point references are handled.
- if (XMLTextMarkImportContext::FindName(GetImport(), xAttrList, sName, dummy))
+ if (FindName(GetImport(), xAttrList, sName))
{
XMLHint_Impl* pHint = new XMLReferenceHint_Impl(
sName, rImport.GetTextImport()->GetCursor()->getStart() );
@@ -219,6 +221,33 @@ XMLStartReferenceContext_Impl::XMLStartReferenceContext_Impl(
}
}
+sal_Bool XMLStartReferenceContext_Impl::FindName(
+ SvXMLImport& rImport,
+ const Reference<xml::sax::XAttributeList> & xAttrList,
+ OUString& rName)
+{
+ sal_Bool bNameOK( sal_False );
+
+ // find name attribute first
+ const sal_Int16 nLength( xAttrList->getLength() );
+ for (sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
+ {
+ OUString sLocalName;
+ const sal_uInt16 nPrefix = rImport.GetNamespaceMap().
+ GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
+ &sLocalName );
+
+ if ( (XML_NAMESPACE_TEXT == nPrefix) &&
+ IsXMLToken(sLocalName, XML_NAME) )
+ {
+ rName = xAttrList->getValueByIndex(nAttr);
+ bNameOK = sal_True;
+ }
+ }
+
+ return bNameOK;
+}
+
// ---------------------------------------------------------------------
/** import end of reference (<text:reference-end>) */
@@ -247,10 +276,9 @@ XMLEndReferenceContext_Impl::XMLEndReferenceContext_Impl(
SvXMLImportContext(rImport, nPrefix, rLocalName)
{
OUString sName;
- OUString dummy;
- // borrow from XMLTextMarkImportContext
- if (XMLTextMarkImportContext::FindName(GetImport(), xAttrList, sName, dummy))
+ // borrow from XMLStartReferenceContext_Impl
+ if (XMLStartReferenceContext_Impl::FindName(GetImport(), xAttrList, sName))
{
// search for reference start
sal_uInt16 nCount = rHints.Count();
@@ -511,9 +539,44 @@ void XMLImpRubyBaseContext_Impl::Characters( const OUString& rChars )
// ---------------------------------------------------------------------
+class XMLImpRubyContext_Impl : public SvXMLImportContext
+{
+ XMLHints_Impl& rHints;
+
+ sal_Bool& rIgnoreLeadingSpace;
+
+ Reference < XTextRange > m_xStart;
+ OUString m_sStyleName;
+ OUString m_sTextStyleName;
+ OUString m_sText;
+
+public:
+
+ TYPEINFO();
+
+ XMLImpRubyContext_Impl(
+ SvXMLImport& rImport,
+ sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const Reference< xml::sax::XAttributeList > & xAttrList,
+ XMLHints_Impl& rHnts,
+ sal_Bool& rIgnLeadSpace );
+
+ virtual ~XMLImpRubyContext_Impl();
+
+ virtual SvXMLImportContext *CreateChildContext(
+ sal_uInt16 nPrefix, const OUString& rLocalName,
+ const Reference< xml::sax::XAttributeList > & xAttrList );
+
+ void SetTextStyleName( const OUString& s ) { m_sTextStyleName = s; }
+ void AppendText( const OUString& s ) { m_sText += s; }
+};
+
+// ---------------------------------------------------------------------
+
class XMLImpRubyTextContext_Impl : public SvXMLImportContext
{
- XMLRubyHint_Impl *pHint;
+ XMLImpRubyContext_Impl & m_rRubyContext;
public:
@@ -524,7 +587,7 @@ public:
sal_uInt16 nPrfx,
const OUString& rLName,
const Reference< xml::sax::XAttributeList > & xAttrList,
- XMLRubyHint_Impl *pHint );
+ XMLImpRubyContext_Impl & rParent );
virtual ~XMLImpRubyTextContext_Impl();
@@ -538,9 +601,9 @@ XMLImpRubyTextContext_Impl::XMLImpRubyTextContext_Impl(
sal_uInt16 nPrfx,
const OUString& rLName,
const Reference< xml::sax::XAttributeList > & xAttrList,
- XMLRubyHint_Impl *pHt ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- pHint( pHt )
+ XMLImpRubyContext_Impl & rParent )
+ : SvXMLImportContext( rImport, nPrfx, rLName )
+ , m_rRubyContext( rParent )
{
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
for( sal_Int16 i=0; i < nAttrCount; i++ )
@@ -555,7 +618,7 @@ XMLImpRubyTextContext_Impl::XMLImpRubyTextContext_Impl(
if( XML_NAMESPACE_TEXT == nPrefix &&
IsXMLToken( aLocalName, XML_STYLE_NAME ) )
{
- pHint->SetTextStyleName( rValue );
+ m_rRubyContext.SetTextStyleName( rValue );
break;
}
}
@@ -567,37 +630,11 @@ XMLImpRubyTextContext_Impl::~XMLImpRubyTextContext_Impl()
void XMLImpRubyTextContext_Impl::Characters( const OUString& rChars )
{
- pHint->AppendText( rChars );
+ m_rRubyContext.AppendText( rChars );
}
// ---------------------------------------------------------------------
-class XMLImpRubyContext_Impl : public SvXMLImportContext
-{
- XMLHints_Impl& rHints;
- XMLRubyHint_Impl *pHint;
-
- sal_Bool& rIgnoreLeadingSpace;
-
-public:
-
- TYPEINFO();
-
- XMLImpRubyContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- XMLHints_Impl& rHnts,
- sal_Bool& rIgnLeadSpace );
-
- virtual ~XMLImpRubyContext_Impl();
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList );
-};
-
TYPEINIT1( XMLImpRubyContext_Impl, SvXMLImportContext );
XMLImpRubyContext_Impl::XMLImpRubyContext_Impl(
@@ -609,9 +646,8 @@ XMLImpRubyContext_Impl::XMLImpRubyContext_Impl(
sal_Bool& rIgnLeadSpace ) :
SvXMLImportContext( rImport, nPrfx, rLName ),
rHints( rHnts ),
- pHint( new XMLRubyHint_Impl(
- GetImport().GetTextImport()->GetCursorAsRange()->getStart() ) ),
rIgnoreLeadingSpace( rIgnLeadSpace )
+ , m_xStart( GetImport().GetTextImport()->GetCursorAsRange()->getStart() )
{
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
for( sal_Int16 i=0; i < nAttrCount; i++ )
@@ -626,18 +662,22 @@ XMLImpRubyContext_Impl::XMLImpRubyContext_Impl(
if( XML_NAMESPACE_TEXT == nPrefix &&
IsXMLToken( aLocalName, XML_STYLE_NAME ) )
{
- pHint->SetStyleName( rValue );
+ m_sStyleName = rValue;
break;
}
}
- rHints.Insert( pHint, rHints.Count() );
}
XMLImpRubyContext_Impl::~XMLImpRubyContext_Impl()
{
- if( pHint )
- pHint->SetEnd( GetImport().GetTextImport()
- ->GetCursorAsRange()->getStart() );
+ const UniReference < XMLTextImportHelper > xTextImport(
+ GetImport().GetTextImport());
+ const Reference < XTextCursor > xAttrCursor(
+ xTextImport->GetText()->createTextCursorByRange( m_xStart ));
+ xAttrCursor->gotoRange(xTextImport->GetCursorAsRange()->getStart(),
+ sal_True);
+ xTextImport->SetRuby( GetImport(), xAttrCursor,
+ m_sStyleName, m_sTextStyleName, m_sText );
}
SvXMLImportContext *XMLImpRubyContext_Impl::CreateChildContext(
@@ -657,7 +697,7 @@ SvXMLImportContext *XMLImpRubyContext_Impl::CreateChildContext(
pContext = new XMLImpRubyTextContext_Impl( GetImport(), nPrefix,
rLocalName,
xAttrList,
- pHint );
+ *this );
else
pContext = new SvXMLImportContext(
GetImport(), nPrefix, rLocalName );
@@ -672,7 +712,6 @@ SvXMLImportContext *XMLImpRubyContext_Impl::CreateChildContext(
// ---------------------------------------------------------------------
/** for text:meta and text:meta-field
-//FIXME not tested
*/
class XMLMetaImportContextBase : public SvXMLImportContext
{
@@ -691,19 +730,21 @@ public:
XMLMetaImportContextBase(
SvXMLImport& i_rImport,
- sal_uInt16 i_nPrefix,
+ const sal_uInt16 i_nPrefix,
const OUString& i_rLocalName,
- const Reference< xml::sax::XAttributeList > & i_xAttrList,
XMLHints_Impl& i_rHints,
sal_Bool & i_rIgnoreLeadingSpace );
virtual ~XMLMetaImportContextBase();
+ virtual void StartElement(
+ const Reference<xml::sax::XAttributeList> & i_xAttrList);
+
virtual void EndElement();
virtual SvXMLImportContext *CreateChildContext(
sal_uInt16 i_nPrefix, const OUString& i_rLocalName,
- const Reference< xml::sax::XAttributeList > & i_xAttrList );
+ const Reference< xml::sax::XAttributeList > & i_xAttrList);
virtual void Characters( const OUString& i_rChars );
@@ -718,33 +759,36 @@ TYPEINIT1( XMLMetaImportContextBase, SvXMLImportContext );
XMLMetaImportContextBase::XMLMetaImportContextBase(
SvXMLImport& i_rImport,
- sal_uInt16 i_nPrefix,
+ const sal_uInt16 i_nPrefix,
const OUString& i_rLocalName,
- const Reference< xml::sax::XAttributeList > & i_xAttrList,
XMLHints_Impl& i_rHints,
sal_Bool & i_rIgnoreLeadingSpace )
: SvXMLImportContext( i_rImport, i_nPrefix, i_rLocalName )
, m_rHints( i_rHints )
, m_rIgnoreLeadingSpace( i_rIgnoreLeadingSpace )
- , m_xStart()
+ , m_xStart( GetImport().GetTextImport()->GetCursorAsRange()->getStart() )
+{
+}
+
+XMLMetaImportContextBase::~XMLMetaImportContextBase()
+{
+}
+
+void XMLMetaImportContextBase::StartElement(
+ const Reference<xml::sax::XAttributeList> & i_xAttrList)
{
const sal_Int16 nAttrCount(i_xAttrList.is() ? i_xAttrList->getLength() : 0);
- for ( sal_Int16 i=0; i < nAttrCount; i++ )
+ for ( sal_Int16 i = 0; i < nAttrCount; ++i )
{
const OUString& rAttrName( i_xAttrList->getNameByIndex( i ) );
const OUString& rValue( i_xAttrList->getValueByIndex( i ) );
OUString sLocalName;
- sal_uInt16 nPrefix =
+ const sal_uInt16 nPrefix(
GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &sLocalName );
+ &sLocalName ));
ProcessAttribute(nPrefix, sLocalName, rValue);
}
- m_xStart = GetImport().GetTextImport()->GetCursorAsRange()->getStart();
-}
-
-XMLMetaImportContextBase::~XMLMetaImportContextBase()
-{
}
void XMLMetaImportContextBase::EndElement()
@@ -764,41 +808,15 @@ void XMLMetaImportContextBase::EndElement()
const Reference<XTextRange> xInsertionRange(xInsertionCursor, UNO_QUERY);
InsertMeta(xInsertionRange);
-//FIXME
-#if 0
- Reference<XMultiServiceFactory> xFactory(rImport.GetModel(), UNO_QUERY);
- if ( xFactory.is() )
- {
- Reference<XInterface> xIfc = xFactory->createInstance(sServiceName);
-
- // xml:id for RDF metadata
- rImport.SetXmlId(xIfc, i_rXmlId);
-
- // cast to XTextContent and attach to document
- Reference<XTextContent> xTextContent(xIfc, UNO_QUERY);
- if (xTextContent.is())
- {
- try
- {
- rImport.GetTextImport()->GetText()->insertTextContent(
- xInsertionRange, xTextContent, sal_True);
- }
- catch (com::sun::star::lang::IllegalArgumentException &)
- {
- OSL_ENSURE(false, "XMLMetaImportContext::EndElement: iae");
- }
- }
- }
-#endif
}
SvXMLImportContext * XMLMetaImportContextBase::CreateChildContext(
sal_uInt16 i_nPrefix, const OUString& i_rLocalName,
const Reference< xml::sax::XAttributeList > & i_xAttrList )
{
- const SvXMLTokenMap& rTokenMap =
- GetImport().GetTextImport()->GetTextPElemTokenMap();
- sal_uInt16 nToken = rTokenMap.Get( i_nPrefix, i_rLocalName );
+ const SvXMLTokenMap& rTokenMap(
+ GetImport().GetTextImport()->GetTextPElemTokenMap() );
+ const sal_uInt16 nToken( rTokenMap.Get( i_nPrefix, i_rLocalName ) );
return XMLImpSpanContext_Impl::CreateChildContext( GetImport(), i_nPrefix,
i_rLocalName, i_xAttrList, nToken, m_rHints, m_rIgnoreLeadingSpace );
@@ -812,8 +830,7 @@ void XMLMetaImportContextBase::Characters( const OUString& i_rChars )
void XMLMetaImportContextBase::ProcessAttribute(sal_uInt16 const i_nPrefix,
OUString const & i_rLocalName, OUString const & i_rValue)
{
- if ( (XML_NAMESPACE_XML == i_nPrefix) &&
- IsXMLToken(i_rLocalName, XML_ID) )
+ if ( (XML_NAMESPACE_XML == i_nPrefix) && IsXMLToken(i_rLocalName, XML_ID) )
{
m_XmlId = i_rValue;
}
@@ -822,9 +839,7 @@ void XMLMetaImportContextBase::ProcessAttribute(sal_uInt16 const i_nPrefix,
// ---------------------------------------------------------------------
-/** text:meta
-//FIXME not tested
- */
+/** text:meta */
class XMLMetaImportContext : public XMLMetaImportContextBase
{
// RDFa
@@ -839,9 +854,8 @@ public:
XMLMetaImportContext(
SvXMLImport& i_rImport,
- sal_uInt16 i_nPrefix,
+ const sal_uInt16 i_nPrefix,
const OUString& i_rLocalName,
- const Reference< xml::sax::XAttributeList > & i_xAttrList,
XMLHints_Impl& i_rHints,
sal_Bool & i_rIgnoreLeadingSpace );
@@ -855,13 +869,12 @@ TYPEINIT1( XMLMetaImportContext, XMLMetaImportContextBase );
XMLMetaImportContext::XMLMetaImportContext(
SvXMLImport& i_rImport,
- sal_uInt16 i_nPrefix,
+ const sal_uInt16 i_nPrefix,
const OUString& i_rLocalName,
- const Reference< xml::sax::XAttributeList > & i_xAttrList,
XMLHints_Impl& i_rHints,
sal_Bool & i_rIgnoreLeadingSpace )
: XMLMetaImportContextBase( i_rImport, i_nPrefix, i_rLocalName,
- i_xAttrList, i_rHints, i_rIgnoreLeadingSpace )
+ i_rHints, i_rIgnoreLeadingSpace )
, m_bHaveAbout(false)
{
}
@@ -929,9 +942,7 @@ void XMLMetaImportContext::InsertMeta(
// ---------------------------------------------------------------------
-/** text:meta-field
-//FIXME not tested
- */
+/** text:meta-field */
class XMLMetaFieldImportContext : public XMLMetaImportContextBase
{
OUString m_DataStyleName;
@@ -941,9 +952,8 @@ public:
XMLMetaFieldImportContext(
SvXMLImport& i_rImport,
- sal_uInt16 i_nPrefix,
+ const sal_uInt16 i_nPrefix,
const OUString& i_rLocalName,
- const Reference< xml::sax::XAttributeList > & i_xAttrList,
XMLHints_Impl& i_rHints,
sal_Bool & i_rIgnoreLeadingSpace );
@@ -957,21 +967,20 @@ TYPEINIT1( XMLMetaFieldImportContext, XMLMetaImportContextBase );
XMLMetaFieldImportContext::XMLMetaFieldImportContext(
SvXMLImport& i_rImport,
- sal_uInt16 i_nPrefix,
+ const sal_uInt16 i_nPrefix,
const OUString& i_rLocalName,
- const Reference< xml::sax::XAttributeList > & i_xAttrList,
XMLHints_Impl& i_rHints,
sal_Bool & i_rIgnoreLeadingSpace )
: XMLMetaImportContextBase( i_rImport, i_nPrefix, i_rLocalName,
- i_xAttrList, i_rHints, i_rIgnoreLeadingSpace )
+ i_rHints, i_rIgnoreLeadingSpace )
{
}
void XMLMetaFieldImportContext::ProcessAttribute(sal_uInt16 const i_nPrefix,
OUString const & i_rLocalName, OUString const & i_rValue)
{
- if( XML_NAMESPACE_STYLE == i_nPrefix &&
- IsXMLToken( i_rLocalName, XML_DATA_STYLE_NAME ) )
+ if ( XML_NAMESPACE_STYLE == i_nPrefix &&
+ IsXMLToken( i_rLocalName, XML_DATA_STYLE_NAME ) )
{
m_DataStyleName = i_rValue;
}
@@ -1811,18 +1820,15 @@ SvXMLImportContext *XMLImpSpanContext_Impl::CreateChildContext(
sal_False);
break;
-// FIXME: should test before enabling...
-#if 0
case XML_TOK_TEXT_META:
pContext = new XMLMetaImportContext(rImport, nPrefix, rLocalName,
- xAttrList, rHints, rIgnoreLeadingSpace );
+ rHints, rIgnoreLeadingSpace );
break;
case XML_TOK_TEXT_META_FIELD:
pContext = new XMLMetaFieldImportContext(rImport, nPrefix, rLocalName,
- xAttrList, rHints, rIgnoreLeadingSpace );
+ rHints, rIgnoreLeadingSpace );
break;
-#endif
default:
// none of the above? then it's probably a text field!
@@ -2190,17 +2196,6 @@ XMLParaContext::~XMLParaContext()
pHHint->GetEventsContext() );
}
break;
- case XML_HINT_RUBY:
- {
- const XMLRubyHint_Impl *pRHint =
- (const XMLRubyHint_Impl *)pHint;
- xTxtImport->SetRuby( GetImport(),
- xAttrCursor,
- pRHint->GetStyleName(),
- pRHint->GetTextStyleName(),
- pRHint->GetText() );
- }
- break;
case XML_HINT_INDEX_MARK:
{
Reference<beans::XPropertySet> xMark(
@@ -2341,7 +2336,6 @@ XMLNumberedParaContext::XMLNumberedParaContext(
m_xNumRules()
{
::rtl::OUString StyleName;
- bool ContinuteNumbering(false);
const SvXMLTokenMap& rTokenMap(
i_rImport.GetTextImport()->GetTextNumberedParagraphAttrTokenMap() );
@@ -2378,8 +2372,8 @@ XMLNumberedParaContext::XMLNumberedParaContext(
StyleName = rValue;
break;
case XML_TOK_TEXT_NUMBERED_PARAGRAPH_CONTINUE_NUMBERING:
- ContinuteNumbering = IsXMLToken(rValue, XML_TRUE);
-// ??? what in Fred's name is this supposed to do?
+ // this attribute is deprecated
+// ContinuteNumbering = IsXMLToken(rValue, XML_TRUE);
break;
case XML_TOK_TEXT_NUMBERED_PARAGRAPH_START_VALUE:
{
diff --git a/xmloff/source/text/txtparaimphint.hxx b/xmloff/source/text/txtparaimphint.hxx
index 2012764e38b7..f3c8da0bcf03 100644
--- a/xmloff/source/text/txtparaimphint.hxx
+++ b/xmloff/source/text/txtparaimphint.hxx
@@ -49,7 +49,6 @@ using namespace ::xmloff::token;
#define XML_HINT_STYLE 1
#define XML_HINT_REFERENCE 2
#define XML_HINT_HYPERLINK 3
-#define XML_HINT_RUBY 4
#define XML_HINT_INDEX_MARK 5
#define XML_HINT_TEXT_FRAME 6
// --> DVO, OD 2004-07-14 #i26791#
@@ -209,28 +208,6 @@ public:
const OUString& GetID() const { return sID; }
};
-class XMLRubyHint_Impl : public XMLHint_Impl
-{
- OUString sStyleName;
- OUString sTextStyleName;
- OUString sText;
-
-public:
-
- XMLRubyHint_Impl( const Reference < XTextRange > & rPos ) :
- XMLHint_Impl( XML_HINT_RUBY, rPos, rPos )
- {
- }
-
- virtual ~XMLRubyHint_Impl() {}
-
- void SetStyleName( const OUString& s ) { sStyleName = s; }
- const OUString& GetStyleName() const { return sStyleName; }
- void SetTextStyleName( const OUString& s ) { sTextStyleName = s; }
- const OUString& GetTextStyleName() const { return sTextStyleName; }
- void AppendText( const OUString& s ) { sText += s; }
- const OUString& GetText() const { return sText; }
-};
class XMLTextFrameHint_Impl : public XMLHint_Impl
{
diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx
index b5eb0a7bdfcb..c41d54bb00ed 100644
--- a/xmloff/source/text/txtstyli.cxx
+++ b/xmloff/source/text/txtstyli.cxx
@@ -547,30 +547,6 @@ void XMLTextStyleContext::FillPropertySet(
struct XMLPropertyState& rState = GetProperties()[nIndex];
Any rAny = rState.maValue;
sal_Int32 nMapperIndex = rState.mnIndex;
- if( i == 3 )
- {
- if( SvXMLImport::OOo_2x != GetImport().getGeneratorVersion() )
- continue;
- sal_Bool bHidden;
- rAny >>= bHidden;
- bHidden = !bHidden;
- Any aAny( rAny );
- aAny <<= bHidden;
- // get property set mapper
- UniReference<XMLPropertySetMapper> rPropMapper =
- xImpPrMap->getPropertySetMapper();
-
- // set property
- OUString rPropertyName(
- rPropMapper->GetEntryAPIName(nMapperIndex) );
- if( !xInfo.is() )
- xInfo = rPropSet->getPropertySetInfo();
- if ( xInfo->hasPropertyByName( rPropertyName ) )
- {
- rPropSet->setPropertyValue( rPropertyName, aAny );
- }
- continue;
- }
// Now check for font name in rState and set corrected value,
// if necessary.
diff --git a/xmloff/util/makefile.mk b/xmloff/util/makefile.mk
index d9ef85c2178d..31852e15175a 100644
--- a/xmloff/util/makefile.mk
+++ b/xmloff/util/makefile.mk
@@ -41,7 +41,7 @@ USE_DEFFILE=TRUE
.INCLUDE: $(PRJ)$/util$/makefile.pmk
# --- Allgemein ----------------------------------------------------
-
+.IF "$(L10N_framework)"==""
LIB1TARGET= $(SLB)$/xo.lib
LIB1FILES= \
$(SLB)$/core.lib \
@@ -115,5 +115,5 @@ DEFLIB1NAME =xo
DEF1DES =XML Office Lib
# --- Targets ----------------------------------------------------------
-
+.ENDIF
.INCLUDE : target.mk
diff --git a/xmlscript/source/misc/makefile.mk b/xmlscript/source/misc/makefile.mk
index 8bd9b7919857..fbd7b0b098e1 100644
--- a/xmlscript/source/misc/makefile.mk
+++ b/xmlscript/source/misc/makefile.mk
@@ -39,7 +39,7 @@ ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
-
+.IF "$(L10N_framework)"==""
#-----------------------------------------------------------
SLOFILES = \
@@ -48,4 +48,5 @@ SLOFILES = \
# --- Targets ------------------------------------------------------
.INCLUDE : $(PRJ)$/util$/target.pmk
+.ENDIF # L10N_framework
.INCLUDE : target.mk
diff --git a/xmlscript/source/xml_helper/makefile.mk b/xmlscript/source/xml_helper/makefile.mk
index 61f2636064ab..e5e96ff6863c 100644
--- a/xmlscript/source/xml_helper/makefile.mk
+++ b/xmlscript/source/xml_helper/makefile.mk
@@ -38,7 +38,7 @@ ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
-
+.IF "$(L10N_framework)"==""
#-----------------------------------------------------------
SLOFILES = \
@@ -49,4 +49,6 @@ SLOFILES = \
# --- Targets ------------------------------------------------------
.INCLUDE : $(PRJ)$/util$/target.pmk
+.ENDIF # L10N_framework
+
.INCLUDE : target.mk
diff --git a/xmlscript/source/xmldlg_imexp/makefile.mk b/xmlscript/source/xmldlg_imexp/makefile.mk
index acb8321266f2..86b57a27f601 100644
--- a/xmlscript/source/xmldlg_imexp/makefile.mk
+++ b/xmlscript/source/xmldlg_imexp/makefile.mk
@@ -38,7 +38,7 @@ ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
-
+.IF "$(L10N_framework)"==""
#-----------------------------------------------------------
SLOFILES = \
@@ -51,4 +51,6 @@ SLOFILES = \
# --- Targets ------------------------------------------------------
.INCLUDE : $(PRJ)$/util$/target.pmk
+.ENDIF # L10N_framework
+
.INCLUDE : target.mk
diff --git a/xmlscript/source/xmlflat_imexp/makefile.mk b/xmlscript/source/xmlflat_imexp/makefile.mk
index f2c677fd888a..8d6f9fbfa9d9 100644
--- a/xmlscript/source/xmlflat_imexp/makefile.mk
+++ b/xmlscript/source/xmlflat_imexp/makefile.mk
@@ -39,7 +39,7 @@ ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
-
+.IF "$(L10N_framework)"==""
#-----------------------------------------------------------
SLOFILES = \
@@ -49,4 +49,6 @@ SLOFILES = \
# --- Targets ------------------------------------------------------
.INCLUDE : $(PRJ)$/util$/target.pmk
+.ENDIF # L10N_framework
+
.INCLUDE : target.mk
diff --git a/xmlscript/source/xmllib_imexp/makefile.mk b/xmlscript/source/xmllib_imexp/makefile.mk
index ca4cae0e23b3..2d29c3d2d4bc 100644
--- a/xmlscript/source/xmllib_imexp/makefile.mk
+++ b/xmlscript/source/xmllib_imexp/makefile.mk
@@ -38,7 +38,7 @@ ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
-
+.IF "$(L10N_framework)"==""
#-----------------------------------------------------------
SLOFILES = \
@@ -48,4 +48,7 @@ SLOFILES = \
# --- Targets ------------------------------------------------------
.INCLUDE : $(PRJ)$/util$/target.pmk
+
+.ENDIF # L10N_framework
+
.INCLUDE : target.mk
diff --git a/xmlscript/source/xmlmod_imexp/makefile.mk b/xmlscript/source/xmlmod_imexp/makefile.mk
index ee5bb85cecff..96d74a41ddec 100644
--- a/xmlscript/source/xmlmod_imexp/makefile.mk
+++ b/xmlscript/source/xmlmod_imexp/makefile.mk
@@ -38,7 +38,7 @@ ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
-
+.IF "$(L10N_framework)"==""
#-----------------------------------------------------------
SLOFILES = \
@@ -48,4 +48,6 @@ SLOFILES = \
# --- Targets ------------------------------------------------------
.INCLUDE : $(PRJ)$/util$/target.pmk
+
+.ENDIF # L10N_framework
.INCLUDE : target.mk