summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoros <os@openoffice.org>2009-11-10 15:32:07 +0100
committeros <os@openoffice.org>2009-11-10 15:32:07 +0100
commitc433784443b35b6abc753e540d81cbd5a537de96 (patch)
tree29beb6e69b2de41440dc23027a4f7bd8c30219f6
parent3957521485fa03651876ad51c5335615598e07d9 (diff)
parentcc423d4be4338cbd81eed9f96f7c7a277da0ee88 (diff)
rebase
-rw-r--r--avmedia/source/quicktime/makefile.mk2
-rw-r--r--basic/prj/build.lst2
-rw-r--r--basic/source/classes/sb.cxx27
-rw-r--r--basic/source/classes/sbunoobj.cxx6
-rw-r--r--basic/source/comp/dim.cxx63
-rw-r--r--basic/source/inc/expr.hxx1
-rw-r--r--basic/source/inc/parser.hxx1
-rw-r--r--basic/source/runtime/methods1.cxx7
-rw-r--r--basic/source/sbx/sbxvalue.cxx2
-rw-r--r--configmgr/source/backendhelper/makefile.mk2
-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.hxx175
-rw-r--r--connectivity/inc/connectivity/dbmetadata.hxx6
-rwxr-xr-xconnectivity/source/commontools/DriversConfig.cxx81
-rw-r--r--connectivity/source/commontools/RowFunctionParser.cxx2
-rw-r--r--connectivity/source/commontools/dbmetadata.cxx51
-rw-r--r--connectivity/source/commontools/makefile.mk2
-rw-r--r--connectivity/source/drivers/adabas/makefile.mk2
-rw-r--r--connectivity/source/drivers/ado/APreparedStatement.cxx4
-rwxr-xr-xconnectivity/source/drivers/ado/ado.xcu10
-rwxr-xr-xconnectivity/source/drivers/jdbc/jdbc.xcu2
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/makefile.mk5
-rw-r--r--connectivity/source/drivers/mozab/makefile.mk2
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx16
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/makefile.mk2
-rwxr-xr-xconnectivity/source/drivers/mysql/mysql.xcu77
-rw-r--r--connectivity/source/drivers/odbcbase/OConnection.cxx2
-rw-r--r--connectivity/source/drivers/odbcbase/OPreparedStatement.cxx16
-rw-r--r--connectivity/source/drivers/odbcbase/OResultSet.cxx6
-rw-r--r--connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx14
-rw-r--r--connectivity/source/drivers/odbcbase/OStatement.cxx8
-rw-r--r--connectivity/source/drivers/odbcbase/OTools.cxx72
-rw-r--r--connectivity/source/inc/odbc/OFunctions.hxx44
-rw-r--r--connectivity/source/inc/odbc/OResultSet.hxx2
-rw-r--r--connectivity/source/inc/odbc/OResultSetMetaData.hxx4
-rw-r--r--connectivity/source/inc/odbc/OStatement.hxx2
-rw-r--r--connectivity/source/inc/odbc/OTools.hxx12
-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.cxx11
-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.mk4
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.src4
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.src2
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx43
-rw-r--r--desktop/source/deployment/registry/help/dp_help.cxx2
-rw-r--r--desktop/source/deployment/unopkg/unopkg.src9
-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 sj2/stardiv/applet/LiveConnectable.java)36
-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/makefile.mk14
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx42
-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.cxx200
-rw-r--r--drawinglayer/source/primitive2d/textprimitive2d.cxx167
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx75
-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/prj/CVS/Entries4
-rw-r--r--formula/prj/CVS/Repository1
-rw-r--r--formula/prj/CVS/Root1
-rw-r--r--formula/prj/CVS/Tag1
-rw-r--r--formula/prj/CVS/Template42
-rw-r--r--formula/source/core/api/FormulaCompiler.cxx14
-rw-r--r--formula/source/core/api/token.cxx21
-rw-r--r--formula/util/makefile.mk10
-rw-r--r--fpicker/source/aqua/makefile.mk3
-rw-r--r--fpicker/source/unx/kde4/KDE4FilePicker.cxx10
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx41
-rw-r--r--fpicker/util/makefile.pmk35
-rw-r--r--framework/inc/classes/fwktabwindow.hxx4
-rw-r--r--framework/inc/dispatch/menudispatcher.hxx2
-rw-r--r--framework/inc/helper/opluginframedispatcher.hxx353
-rw-r--r--framework/inc/interaction/quietinteraction.hxx (renamed from framework/inc/interaction/stillinteraction.hxx)8
-rw-r--r--framework/inc/services/desktop.hxx5
-rw-r--r--framework/inc/services/frame.hxx7
-rw-r--r--framework/inc/services/layoutmanager.hxx4
-rw-r--r--framework/inc/services/license.hxx2
-rw-r--r--framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx92
-rw-r--r--framework/inc/uiconfiguration/uiconfigurationmanager.hxx81
-rw-r--r--framework/source/accelerators/presethandler.cxx9
-rw-r--r--framework/source/classes/bmkmenu.cxx2
-rw-r--r--framework/source/classes/fwktabwindow.cxx22
-rw-r--r--framework/source/classes/menumanager.cxx6
-rw-r--r--framework/source/dispatch/closedispatcher.cxx22
-rw-r--r--framework/source/dispatch/dispatchprovider.cxx37
-rw-r--r--framework/source/dispatch/menudispatcher.cxx20
-rw-r--r--framework/source/helper/actiontriggerhelper.cxx2
-rw-r--r--framework/source/helper/statusindicatorfactory.cxx19
-rw-r--r--framework/source/inc/accelerators/presethandler.hxx2
-rw-r--r--framework/source/inc/loadenv/loadenv.hxx4
-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/job.cxx2
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx7
-rw-r--r--framework/source/loadenv/loadenv.cxx60
-rw-r--r--framework/source/services/backingwindow.cxx5
-rw-r--r--framework/source/services/desktop.cxx50
-rw-r--r--framework/source/services/frame.cxx44
-rw-r--r--framework/source/services/license.cxx3
-rw-r--r--framework/source/uiconfiguration/makefile.mk1
-rw-r--r--framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx1428
-rw-r--r--framework/source/uiconfiguration/uiconfigurationmanager.cxx1157
-rwxr-xr-xframework/source/uiconfiguration/uiconfigurationmanagerimpl.cxx8
-rw-r--r--framework/source/uielement/controlmenucontroller.cxx4
-rw-r--r--framework/source/uielement/imagebuttontoolbarcontroller.cxx2
-rw-r--r--framework/source/uielement/menubarmanager.cxx6
-rw-r--r--framework/source/uielement/newmenucontroller.cxx4
-rw-r--r--framework/source/uielement/toolbarmanager.cxx6
-rw-r--r--framework/source/uielement/toolbarsmenucontroller.cxx2
-rw-r--r--framework/source/uifactory/windowcontentfactorymanager.cxx7
-rw-r--r--framework/util/makefile.mk3
-rw-r--r--idl/inc/command.hxx1
-rw-r--r--idl/inc/database.hxx7
-rw-r--r--idl/source/objects/bastype.cxx39
-rw-r--r--idl/source/prj/command.cxx12
-rw-r--r--idl/source/prj/database.cxx6
-rw-r--r--idl/source/prj/globals.cxx2
-rw-r--r--idl/source/prj/svidl.cxx8
-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.xcu57
-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/schema/org/openoffice/Office/Calc.xcs4
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs39
-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/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.mk7
-rw-r--r--oovbaapi/util/makefile.mk2
-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.hxx3
-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/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.cxx33
-rw-r--r--sfx2/source/appl/appdata.cxx1
-rw-r--r--sfx2/source/appl/appinit.cxx33
-rw-r--r--sfx2/source/appl/appopen.cxx4
-rw-r--r--sfx2/source/appl/appserv.cxx17
-rw-r--r--sfx2/source/appl/appuno.cxx6
-rw-r--r--sfx2/source/appl/sfxpicklist.cxx4
-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/dialog/dinfdlg.cxx28
-rw-r--r--sfx2/source/dialog/dockwin.cxx3
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx66
-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.cxx23
-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.cxx281
-rw-r--r--sfx2/source/doc/objxtor.cxx103
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx46
-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.cxx26
-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.hxx27
-rw-r--r--sfx2/source/view/viewprn.cxx51
-rw-r--r--sfx2/source/view/viewsh.cxx127
-rw-r--r--sfx2/util/makefile.mk2
-rw-r--r--shell/inc/systemshell.hxx53
-rw-r--r--shell/prj/build.lst3
-rw-r--r--shell/prj/d.lst4
-rw-r--r--shell/source/aqua/sysshell/makefile.mk62
-rw-r--r--shell/source/aqua/sysshell/systemshell.cxx101
-rw-r--r--shell/source/backends/macbe/makefile.mk3
-rw-r--r--shell/source/os2/sysshell/makefile.mk47
-rw-r--r--shell/source/os2/sysshell/systemshell.cxx68
-rw-r--r--shell/source/unix/exec/shellexec.cxx21
-rw-r--r--shell/source/unix/misc/open-url.c40
-rw-r--r--shell/source/unix/misc/senddoc.c40
-rw-r--r--shell/source/unix/sysshell/makefile.mk4
-rw-r--r--shell/source/unix/sysshell/recently_used_file_handler.cxx1
-rw-r--r--shell/source/unix/sysshell/systemshell.cxx151
-rw-r--r--shell/source/win32/sysshell/makefile.mk50
-rw-r--r--shell/source/win32/sysshell/systemshell.cxx68
-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/AppletViewerFactory.java46
-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/galobj.hxx6
-rw-r--r--svx/inc/optgenrl.hrc1
-rw-r--r--svx/inc/svx/dialogs.hrc24
-rw-r--r--svx/inc/svx/langbox.hxx2
-rw-r--r--svx/inc/svx/msdffimp.hxx1
-rw-r--r--svx/inc/svx/numfmtsh.hxx4
-rw-r--r--svx/inc/svx/sdr/attribute/sdrtextattribute.hxx14
-rw-r--r--svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx48
-rw-r--r--svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx2
-rw-r--r--svx/inc/svx/sdr/overlay/overlayselection.hxx2
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx3
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx32
-rw-r--r--svx/inc/svx/svdfppt.hxx2
-rw-r--r--svx/inc/svx/svdhdl.hxx7
-rw-r--r--svx/inc/svx/svdotext.hxx9
-rw-r--r--svx/inc/svx/svxids.hrc14
-rw-r--r--svx/prj/build.lst2
-rw-r--r--svx/sdi/makefile.mk4
-rw-r--r--svx/sdi/svx.sdi223
-rw-r--r--svx/sdi/svxitems.sdi2
-rw-r--r--svx/source/accessibility/AccessibleEmptyEditSource.cxx7
-rw-r--r--svx/source/cui/cuioptgenrl.hxx1
-rw-r--r--svx/source/cui/macropg.cxx35
-rw-r--r--svx/source/cui/macropg.src97
-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.cxx74
-rw-r--r--svx/source/cui/optgdlg.src46
-rw-r--r--svx/source/cui/optgenrl.cxx18
-rw-r--r--svx/source/cui/optimprove2.cxx8
-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/webconninfo.cxx103
-rw-r--r--svx/source/cui/webconninfo.hxx1
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx2
-rw-r--r--svx/source/customshapes/makefile.mk2
-rw-r--r--svx/source/dialog/imapwnd.cxx3
-rw-r--r--svx/source/dialog/langbox.cxx28
-rw-r--r--svx/source/fmcomp/fmgridcl.cxx23
-rw-r--r--svx/source/fmcomp/gridcell.cxx854
-rw-r--r--svx/source/fmcomp/gridctrl.cxx15
-rw-r--r--svx/source/form/fmPropBrw.cxx14
-rw-r--r--svx/source/form/fmctrler.cxx8
-rw-r--r--svx/source/form/fmpgeimp.cxx95
-rw-r--r--svx/source/form/fmshimp.cxx10
-rw-r--r--svx/source/form/fmstring.src103
-rw-r--r--svx/source/form/fmtextcontrolshell.cxx2
-rw-r--r--svx/source/form/fmview.cxx4
-rw-r--r--svx/source/form/formcontrolfactory.cxx70
-rw-r--r--svx/source/form/navigatortree.cxx2
-rw-r--r--svx/source/inc/fmPropBrw.hxx1
-rw-r--r--svx/source/inc/fmpgeimp.hxx13
-rw-r--r--svx/source/inc/fmresids.hrc46
-rw-r--r--svx/source/inc/formcontrolfactory.hxx17
-rw-r--r--svx/source/inc/gridcell.hxx199
-rw-r--r--svx/source/intro/intro_tmpl.hrc2
-rw-r--r--svx/source/items/numfmtsh.cxx61
-rw-r--r--svx/source/mnuctrls/clipboardctl.cxx10
-rw-r--r--svx/source/msfilter/msdffimp.cxx74
-rw-r--r--svx/source/options/optgenrl.src8
-rw-r--r--svx/source/options/optsave.src8
-rw-r--r--svx/source/outliner/outliner.cxx27
-rw-r--r--svx/source/outliner/outlvw.cxx8
-rw-r--r--svx/source/sdr/attribute/sdrtextattribute.cxx36
-rw-r--r--svx/source/sdr/contact/viewcontactofgraphic.cxx4
-rw-r--r--svx/source/sdr/contact/viewcontactofunocontrol.cxx40
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx161
-rw-r--r--svx/source/sdr/overlay/overlaymanagerbuffered.cxx57
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx8
-rw-r--r--svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx1
-rw-r--r--svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx2
-rw-r--r--svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx5
-rw-r--r--svx/source/sdr/primitive2d/sdrdecompositiontools.cxx12
-rw-r--r--svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx4
-rw-r--r--svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx2
-rw-r--r--svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx4
-rw-r--r--svx/source/sdr/primitive2d/sdrole2primitive2d.cxx2
-rw-r--r--svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx2
-rw-r--r--svx/source/sdr/primitive2d/sdrprimitivetools.cxx25
-rw-r--r--svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx2
-rw-r--r--svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx93
-rw-r--r--svx/source/stbctrls/stbctrls.src7
-rw-r--r--svx/source/stbctrls/xmlsecctrl.cxx6
-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/svdfppt.cxx148
-rw-r--r--svx/source/svdraw/svdhdl.cxx51
-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.cxx8
-rw-r--r--svx/source/svdraw/svdopath.cxx106
-rw-r--r--svx/source/svdraw/svdorect.cxx47
-rw-r--r--svx/source/svdraw/svdotextdecomposition.cxx114
-rw-r--r--svx/source/svdraw/svdotextpathdecomposition.cxx57
-rw-r--r--svx/source/svxlink/fileobj.cxx31
-rw-r--r--svx/source/table/viewcontactoftableobj.cxx2
-rw-r--r--svx/source/unodraw/unomod.cxx5
-rw-r--r--svx/source/unoedit/unofield.cxx30
-rw-r--r--svx/source/unoedit/unoforou.cxx2
-rw-r--r--svx/source/xml/xmleohlp.cxx28
-rw-r--r--svx/source/xml/xmltxtexp.cxx6
-rw-r--r--svx/source/xml/xmlxtimp.cxx2
-rw-r--r--svx/util/hidother.src1
-rw-r--r--svx/util/makefile.mk4
-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.cxx255
-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.src9
-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/inc/xmlhelp/helplinkerdllapi.h44
-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.cxx25
-rw-r--r--xmlhelp/source/cxxhelp/provider/urlparameter.cxx15
-rw-r--r--xmloff/inc/txtflde.hxx2
-rw-r--r--xmloff/inc/xmlnmspe.hxx10
-rw-r--r--xmloff/inc/xmloff/txtparae.hxx9
-rw-r--r--xmloff/inc/xmloff/xmlimp.hxx2
-rw-r--r--xmloff/inc/xmloff/xmltoken.hxx5
-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/SchXMLTools.cxx9
-rw-r--r--xmloff/source/core/xmlexp.cxx1
-rw-r--r--xmloff/source/core/xmlimp.cxx86
-rw-r--r--xmloff/source/core/xmltoken.cxx5
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx131
-rw-r--r--xmloff/source/draw/sdxmlexp_impl.hxx3
-rw-r--r--xmloff/source/draw/ximppage.cxx164
-rw-r--r--xmloff/source/draw/ximppage.hxx4
-rw-r--r--xmloff/source/meta/MetaExportComponent.cxx1
-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/text/XMLTextMarkImportContext.cxx165
-rw-r--r--xmloff/source/text/XMLTextMarkImportContext.hxx26
-rw-r--r--xmloff/source/text/txtflde.cxx43
-rw-r--r--xmloff/source/text/txtparae.cxx57
-rw-r--r--xmloff/source/text/txtparai.cxx256
-rw-r--r--xmloff/source/text/txtparaimphint.hxx23
-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
493 files changed, 16531 insertions, 14659 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/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 7ff7cb76c7c5..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 );
}
}
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index a1bdb687b002..a6ae8cac29af 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -750,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;
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/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/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/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index 7c3bd3b057ba..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;
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/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..da68443bb68e 100755
--- a/connectivity/inc/connectivity/DriversConfig.hxx
+++ b/connectivity/inc/connectivity/DriversConfig.hxx
@@ -1,88 +1,95 @@
-/*************************************************************************
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: makefile,v $
- *
- * $Revision: 1.1 $
- *
- * last change: $Author: st $ $Date: 2000/11/22 02:32:00 $
- *
- * The Contents of this file are made available subject to
- * the terms of GNU Lesser General Public License Version 2.1.
- *
- *
- * GNU Lesser General Public License Version 2.1
- * =============================================
- * Copyright 2005 by Sun Microsystems, Inc.
- * 901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
-#define CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
-
-#include <comphelper/stl_types.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/uno/Sequence.h>
-#include "connectivity/dbtoolsdllapi.hxx"
-#include <salhelper/singletonref.hxx>
-#include <comphelper/namedvaluecollection.hxx>
-#include <unotools/confignode.hxx>
-
-namespace connectivity
-{
- typedef struct
- {
- ::comphelper::NamedValueCollection aProperties;
- ::comphelper::NamedValueCollection aFeatures;
- ::comphelper::NamedValueCollection aMetaData;
- ::rtl::OUString sDriverFactory;
- ::rtl::OUString sDriverTypeDisplayName;
- } TInstalledDriver;
- DECLARE_STL_USTRINGACCESS_MAP( TInstalledDriver, TInstalledDrivers);
-
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: makefile,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: st $ $Date: 2000/11/22 02:32:00 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
+#define CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
+
+#include <comphelper/stl_types.hxx>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/uno/Sequence.h>
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <salhelper/singletonref.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <unotools/confignode.hxx>
+
+namespace connectivity
+{
+ typedef struct
+ {
+ ::comphelper::NamedValueCollection aProperties;
+ ::comphelper::NamedValueCollection aFeatures;
+ ::comphelper::NamedValueCollection aMetaData;
+ ::rtl::OUString sDriverFactory;
+ ::rtl::OUString sDriverTypeDisplayName;
+ } TInstalledDriver;
+ DECLARE_STL_USTRINGACCESS_MAP( TInstalledDriver, TInstalledDrivers);
+
class DriversConfigImpl
{
- ::utl::OConfigurationTreeRoot m_aInstalled;
+ mutable ::utl::OConfigurationTreeRoot m_aInstalled;
+ mutable TInstalledDrivers m_aDrivers;
+ void Load(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB) const;
public:
DriversConfigImpl();
- void Load(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,TInstalledDrivers& _rDrivers);
- };
- //
- // Allows to access all driver which are located in the configuration
- //
- class OOO_DLLPUBLIC_DBTOOLS DriversConfig
- {
- typedef salhelper::SingletonRef<DriversConfigImpl> OSharedConfigNode;
-
- 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);
-
- ::rtl::OUString getDriverFactoryName(const ::rtl::OUString& _sUrl) const;
- ::rtl::OUString getDriverTypeDisplayName(const ::rtl::OUString& _sUrl) const;
- const ::comphelper::NamedValueCollection& getProperties(const ::rtl::OUString& _sURL) const;
- const ::comphelper::NamedValueCollection& getFeatures(const ::rtl::OUString& _sURL) const;
- const ::comphelper::NamedValueCollection& getMetaData(const ::rtl::OUString& _sURL) const;
- ::com::sun::star::uno::Sequence< ::rtl::OUString > getURLs() const;
- private:
- TInstalledDrivers m_aDrivers;
- OSharedConfigNode m_aNode;
- };
-}
-#endif // CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
+
+ const TInstalledDrivers& getInstalledDrivers(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB) const { Load(_rxORB); return m_aDrivers; }
+ };
+ //
+ // Allows to access all driver which are located in the configuration
+ //
+ class OOO_DLLPUBLIC_DBTOOLS DriversConfig
+ {
+ typedef salhelper::SingletonRef<DriversConfigImpl> OSharedConfigNode;
+
+ 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;
+ const ::comphelper::NamedValueCollection& getProperties(const ::rtl::OUString& _sURL) const;
+ const ::comphelper::NamedValueCollection& getFeatures(const ::rtl::OUString& _sURL) const;
+ const ::comphelper::NamedValueCollection& getMetaData(const ::rtl::OUString& _sURL) const;
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > getURLs() const;
+ private:
+ OSharedConfigNode m_aNode;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xORB;
+ };
+}
+#endif // CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
diff --git a/connectivity/inc/connectivity/dbmetadata.hxx b/connectivity/inc/connectivity/dbmetadata.hxx
index 32662c5c157a..1ee1718247ae 100644
--- a/connectivity/inc/connectivity/dbmetadata.hxx
+++ b/connectivity/inc/connectivity/dbmetadata.hxx
@@ -177,6 +177,12 @@ namespace dbtools
/** determines whether in the application UI, empty table folders (aka catalogs/schemas) should be displayed
*/
bool displayEmptyTableFolders() const;
+
+ /** determines that threads are supported.
+ *
+ * \return <TRUE/> when threads are supported, otherwise <FALSE/>
+ */
+ bool supportsThreads() const;
};
//........................................................................
diff --git a/connectivity/source/commontools/DriversConfig.cxx b/connectivity/source/commontools/DriversConfig.cxx
index 906024f452a4..30c822b6f169 100755
--- a/connectivity/source/commontools/DriversConfig.cxx
+++ b/connectivity/source/commontools/DriversConfig.cxx
@@ -112,40 +112,66 @@ DriversConfigImpl::DriversConfigImpl()
{
}
// -----------------------------------------------------------------------------
-void DriversConfigImpl::Load(const uno::Reference< lang::XMultiServiceFactory >& _rxORB,TInstalledDrivers& _rDrivers)
+void DriversConfigImpl::Load(const uno::Reference< lang::XMultiServiceFactory >& _rxORB) const
{
- if ( !m_aInstalled.isValid() )
+ if ( m_aDrivers.empty() )
{
- static const ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess.Drivers/Installed")); ///Installed
- m_aInstalled = ::utl::OConfigurationTreeRoot::createWithServiceFactory(_rxORB, s_sNodeName, -1, ::utl::OConfigurationTreeRoot::CM_READONLY);
- }
-
- if ( m_aInstalled.isValid() )
- {
- const uno::Sequence< ::rtl::OUString > aURLPatterns = m_aInstalled.getNodeNames();
- const ::rtl::OUString* pPatternIter = aURLPatterns.getConstArray();
- const ::rtl::OUString* pPatternEnd = pPatternIter + aURLPatterns.getLength();
- for (;pPatternIter != pPatternEnd ; ++pPatternIter)
+ if ( !m_aInstalled.isValid() )
{
- TInstalledDriver aInstalledDriver;
- lcl_readURLPatternNode(m_aInstalled,*pPatternIter,aInstalledDriver);
- if ( aInstalledDriver.sDriverFactory.getLength() )
- _rDrivers.insert(TInstalledDrivers::value_type(*pPatternIter,aInstalledDriver));
+ static const ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess.Drivers/Installed")); ///Installed
+ m_aInstalled = ::utl::OConfigurationTreeRoot::createWithServiceFactory(_rxORB, s_sNodeName, -1, ::utl::OConfigurationTreeRoot::CM_READONLY);
}
+
+ if ( m_aInstalled.isValid() )
+ {
+ const uno::Sequence< ::rtl::OUString > aURLPatterns = m_aInstalled.getNodeNames();
+ const ::rtl::OUString* pPatternIter = aURLPatterns.getConstArray();
+ const ::rtl::OUString* pPatternEnd = pPatternIter + aURLPatterns.getLength();
+ for (;pPatternIter != pPatternEnd ; ++pPatternIter)
+ {
+ TInstalledDriver aInstalledDriver;
+ lcl_readURLPatternNode(m_aInstalled,*pPatternIter,aInstalledDriver);
+ if ( aInstalledDriver.sDriverFactory.getLength() )
+ m_aDrivers.insert(TInstalledDrivers::value_type(*pPatternIter,aInstalledDriver));
+ }
+ } // if ( m_aInstalled.isValid() )
}
}
// -----------------------------------------------------------------------------
DriversConfig::DriversConfig(const uno::Reference< lang::XMultiServiceFactory >& _rxORB)
+:m_xORB(_rxORB)
{
- 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_aNode = _rhs.m_aNode;
+ }
+ return *this;
+}
+
// -----------------------------------------------------------------------------
::rtl::OUString DriversConfig::getDriverFactoryName(const ::rtl::OUString& _sURL) const
{
+ const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
::rtl::OUString sRet;
::rtl::OUString sOldPattern;
- TInstalledDrivers::const_iterator aIter = m_aDrivers.begin();
- TInstalledDrivers::const_iterator aEnd = m_aDrivers.end();
+ TInstalledDrivers::const_iterator aIter = rDrivers.begin();
+ TInstalledDrivers::const_iterator aEnd = rDrivers.end();
for(;aIter != aEnd;++aIter)
{
WildCard aWildCard(aIter->first);
@@ -161,10 +187,11 @@ DriversConfig::DriversConfig(const uno::Reference< lang::XMultiServiceFactory >&
// -----------------------------------------------------------------------------
::rtl::OUString DriversConfig::getDriverTypeDisplayName(const ::rtl::OUString& _sURL) const
{
+ const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
::rtl::OUString sRet;
::rtl::OUString sOldPattern;
- TInstalledDrivers::const_iterator aIter = m_aDrivers.begin();
- TInstalledDrivers::const_iterator aEnd = m_aDrivers.end();
+ TInstalledDrivers::const_iterator aIter = rDrivers.begin();
+ TInstalledDrivers::const_iterator aEnd = rDrivers.end();
for(;aIter != aEnd;++aIter)
{
WildCard aWildCard(aIter->first);
@@ -195,10 +222,11 @@ const ::comphelper::NamedValueCollection& DriversConfig::getMetaData(const ::rtl
// -----------------------------------------------------------------------------
const ::comphelper::NamedValueCollection& DriversConfig::impl_get(const ::rtl::OUString& _sURL,sal_Int32 _nProps) const
{
+ const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
const ::comphelper::NamedValueCollection* pRet = NULL;
::rtl::OUString sOldPattern;
- TInstalledDrivers::const_iterator aIter = m_aDrivers.begin();
- TInstalledDrivers::const_iterator aEnd = m_aDrivers.end();
+ TInstalledDrivers::const_iterator aIter = rDrivers.begin();
+ TInstalledDrivers::const_iterator aEnd = rDrivers.end();
for(;aIter != aEnd;++aIter)
{
WildCard aWildCard(aIter->first);
@@ -229,10 +257,11 @@ const ::comphelper::NamedValueCollection& DriversConfig::impl_get(const ::rtl::O
// -----------------------------------------------------------------------------
uno::Sequence< ::rtl::OUString > DriversConfig::getURLs() const
{
- uno::Sequence< ::rtl::OUString > aRet(m_aDrivers.size());
+ const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
+ uno::Sequence< ::rtl::OUString > aRet(rDrivers.size());
::rtl::OUString* pIter = aRet.getArray();
- TInstalledDrivers::const_iterator aIter = m_aDrivers.begin();
- TInstalledDrivers::const_iterator aEnd = m_aDrivers.end();
+ TInstalledDrivers::const_iterator aIter = rDrivers.begin();
+ TInstalledDrivers::const_iterator aEnd = rDrivers.end();
for(;aIter != aEnd;++aIter,++pIter)
{
*pIter = aIter->first;
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/dbmetadata.cxx b/connectivity/source/commontools/dbmetadata.cxx
index 7eccb8e8463e..c5b65a9d113b 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
@@ -278,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
@@ -384,6 +407,22 @@ namespace dbtools
#endif
return doDisplay;
}
+ //--------------------------------------------------------------------
+ bool DatabaseMetaData::supportsThreads() const
+ {
+ bool bSupported( true );
+ try
+ {
+ Reference< XDatabaseMetaData > xMeta( m_pImpl->xConnectionMetaData, UNO_SET_THROW );
+ ::rtl::OUString sConnectionURL( xMeta->getURL() );
+ bSupported = sConnectionURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "sdbc:mysql:mysqlc" ) ) != 0;
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return bSupported;
+ }
//........................................................................
} // namespace dbtools
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/drivers/adabas/makefile.mk b/connectivity/source/drivers/adabas/makefile.mk
index 09b2936e1c7d..5b3483ed57bb 100644
--- a/connectivity/source/drivers/adabas/makefile.mk
+++ b/connectivity/source/drivers/adabas/makefile.mk
@@ -107,4 +107,4 @@ DEF1EXPORTFILE= exports.dxp
# --- Targets ----------------------------------
-.INCLUDE : $(PRJ)$/target.pmk \ No newline at end of file
+.INCLUDE : $(PRJ)$/target.pmk
diff --git a/connectivity/source/drivers/ado/APreparedStatement.cxx b/connectivity/source/drivers/ado/APreparedStatement.cxx
index 839c34513c62..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;
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/jdbc/jdbc.xcu b/connectivity/source/drivers/jdbc/jdbc.xcu
index 73fe2e9adc55..ae1bbad227e7 100755
--- a/connectivity/source/drivers/jdbc/jdbc.xcu
+++ b/connectivity/source/drivers/jdbc/jdbc.xcu
@@ -174,7 +174,7 @@
<node oor:name="Properties">
<node oor:name="IgnoreCurrency" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
- <value>false</value>
+ <value>true</value>
</prop>
</node>
<node oor:name="TypeInfoSettings" oor:op="replace">
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 42ce1ab8ca6e..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"
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx b/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx
index bd4201ee3729..2a6f79f5acd7 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx
@@ -53,16 +53,16 @@ void MTypeConverter::ouStringToNsString(::rtl::OUString const &ous, nsString &ns
// -------------------------------------------------------------------------
::rtl::OUString MTypeConverter::nsACStringToOUString( const nsACString& _source )
{
- const char* buffer = _source.BeginReading();
- const char* bufferEnd = _source.EndReading();
- return ::rtl::OUString( buffer, bufferEnd - buffer, RTL_TEXTENCODING_ASCII_US );
+ const char* buffer = _source.BeginReading();
+ const char* bufferEnd = _source.EndReading();
+ return ::rtl::OUString( buffer, static_cast<sal_Int32>(bufferEnd - buffer), RTL_TEXTENCODING_ASCII_US );
}
// -------------------------------------------------------------------------
::rtl::OString MTypeConverter::nsACStringToOString( const nsACString& _source )
{
- const char* buffer = _source.BeginReading();
- const char* bufferEnd = _source.EndReading();
- return ::rtl::OString( buffer, bufferEnd - buffer );
+ const char* buffer = _source.BeginReading();
+ const char* bufferEnd = _source.EndReading();
+ return ::rtl::OString( buffer, static_cast<sal_Int32>(bufferEnd - buffer) );
}
// -------------------------------------------------------------------------
void MTypeConverter::asciiOUStringToNsACString( const ::rtl::OUString& _asciiString, nsACString& _dest )
@@ -73,8 +73,8 @@ void MTypeConverter::asciiOUStringToNsACString( const ::rtl::OUString& _asciiStr
// -------------------------------------------------------------------------
void MTypeConverter::asciiToNsACString( const sal_Char* _asciiString, nsACString& _dest )
{
- _dest.Truncate();
- _dest.AppendASCII( _asciiString );
+ _dest.Truncate();
+ _dest.AppendASCII( _asciiString );
}
// -------------------------------------------------------------------------
void MTypeConverter::nsStringToOUString(nsString const &nss, ::rtl::OUString &ous)
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/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 0a86ed7b9f18..8a27940f44b0 100644
--- a/connectivity/source/drivers/odbcbase/OConnection.cxx
+++ b/connectivity/source/drivers/odbcbase/OConnection.cxx
@@ -108,7 +108,7 @@ SQLRETURN OConnection::OpenConnection(const ::rtl::OUString& aConnectStr,sal_Int
SQLRETURN nSQLRETURN = 0;
SDB_ODBC_CHAR szConnStrOut[4096];
SDB_ODBC_CHAR szConnStrIn[2048];
- SWORD cbConnStrOut;
+ SQLSMALLINT cbConnStrOut;
memset(szConnStrOut,'\0',4096);
memset(szConnStrIn,'\0',2048);
::rtl::OString aConStr(::rtl::OUStringToOString(aConnectStr,getTextEncoding()));
diff --git a/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx b/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx
index 655006d1f8e4..8d72c3271b82 100644
--- a/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx
+++ b/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx
@@ -444,11 +444,11 @@ void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 s
checkParameterIndex(parameterIndex);
sal_Int8* lenBuf = getLengthBuf (parameterIndex);
- *(SDWORD*)lenBuf = SQL_NULL_DATA;
+ *(SQLLEN*)lenBuf = SQL_NULL_DATA;
- SQLINTEGER prec = 0;
- SQLUINTEGER nColumnSize = 0;
+ SQLLEN prec = 0;
+ SQLULEN nColumnSize = 0;
if (sqlType == SQL_CHAR || sqlType == SQL_VARCHAR || sqlType == SQL_LONGVARCHAR)
{
prec = 1;
@@ -474,7 +474,7 @@ void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 s
nDecimalDigits,
NULL,
prec,
- (SDWORD*)lenBuf
+ (SQLLEN*)lenBuf
);
OTools::ThrowException(m_pConnection,nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
@@ -865,7 +865,7 @@ void OPreparedStatement::setStream (
// Bind the parameter with SQL_LEN_DATA_AT_EXEC
SQLSMALLINT Ctype = SQL_C_CHAR;
- SDWORD atExec = SQL_LEN_DATA_AT_EXEC (length);
+ SQLLEN atExec = SQL_LEN_DATA_AT_EXEC (length);
memcpy (dataBuf, &ParameterIndex, sizeof(ParameterIndex));
memcpy (lenBuf, &atExec, sizeof (atExec));
@@ -876,14 +876,14 @@ void OPreparedStatement::setStream (
OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
N3SQLBindParameter(m_aStatementHandle,
(SQLUSMALLINT)ParameterIndex,
- (SQLSMALLINT)SQL_PARAM_INPUT,
+ (SQLUSMALLINT)SQL_PARAM_INPUT,
Ctype,
(SQLSMALLINT)SQLtype,
- (SQLUINTEGER)length,
+ (SQLULEN)length,
0,
dataBuf,
sizeof(ParameterIndex),
- (SDWORD*)lenBuf);
+ (SQLLEN*)lenBuf);
// Save the input stream
boundParams[ParameterIndex - 1].setInputStream (x, length);
diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx
index 1825b94051e7..8c885f0924ad 100644
--- a/connectivity/source/drivers/odbcbase/OResultSet.cxx
+++ b/connectivity/source/drivers/odbcbase/OResultSet.cxx
@@ -843,8 +843,8 @@ void SAL_CALL OResultSet::insertRow( ) throw(SQLException, RuntimeException)
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- SQLSMALLINT nMaxLen = 20;
- SQLINTEGER nRealLen = 0;
+ SQLLEN nMaxLen = 20;
+ SQLLEN nRealLen = 0;
Sequence<sal_Int8> aBookmark(nMaxLen);
SQLRETURN nRet = N3SQLBindCol(m_aStatementHandle,
@@ -925,7 +925,7 @@ void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException)
sal_Bool bPositionByBookmark = ( NULL != getOdbcFunction( ODBC3SQLBulkOperations ) );
if ( bPositionByBookmark )
{
- SQLINTEGER nRealLen = 0;
+ SQLLEN nRealLen = 0;
nRet = N3SQLBindCol(m_aStatementHandle,
0,
SQL_C_VARBOOKMARK,
diff --git a/connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx b/connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx
index adf77eca238c..3397c5c515a9 100644
--- a/connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx
+++ b/connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx
@@ -86,13 +86,13 @@ OResultSetMetaData::~OResultSetMetaData()
return sValue;
}
// -------------------------------------------------------------------------
-SWORD OResultSetMetaData::getNumColAttrib(OConnection* _pConnection
+SQLLEN OResultSetMetaData::getNumColAttrib(OConnection* _pConnection
,SQLHANDLE _aStatementHandle
,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface
,sal_Int32 _column
,sal_Int32 _ident) throw(SQLException, RuntimeException)
{
- SWORD nValue=0;
+ SQLLEN nValue=0;
OTools::ThrowException(_pConnection,(*(T3SQLColAttribute)_pConnection->getOdbcFunction(ODBC3SQLColAttribute))(_aStatementHandle,
(SQLUSMALLINT)_column,
(SQLUSMALLINT)_ident,
@@ -117,22 +117,22 @@ sal_Int32 SAL_CALL OResultSetMetaData::getColumnDisplaySize( sal_Int32 column )
return getNumColAttrib(column,SQL_DESC_DISPLAY_SIZE);
}
// -------------------------------------------------------------------------
-SWORD OResultSetMetaData::getColumnODBCType(OConnection* _pConnection
+SQLSMALLINT OResultSetMetaData::getColumnODBCType(OConnection* _pConnection
,SQLHANDLE _aStatementHandle
,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface
,sal_Int32 column)
throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
- SWORD nType = 0;
+ SQLSMALLINT nType = 0;
try
{
- nType = getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column,SQL_DESC_CONCISE_TYPE);
+ nType = (SQLSMALLINT)getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column,SQL_DESC_CONCISE_TYPE);
if(nType == SQL_UNKNOWN_TYPE)
- nType = getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column, SQL_DESC_TYPE);
+ nType = (SQLSMALLINT)getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column, SQL_DESC_TYPE);
}
catch(SQLException& ) // in this case we have an odbc 2.0 driver
{
- nType = getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column,SQL_DESC_CONCISE_TYPE );
+ nType = (SQLSMALLINT)getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column,SQL_DESC_CONCISE_TYPE );
}
return nType;
diff --git a/connectivity/source/drivers/odbcbase/OStatement.cxx b/connectivity/source/drivers/odbcbase/OStatement.cxx
index 3e0fdbd79c3f..79fbef9db50e 100644
--- a/connectivity/source/drivers/odbcbase/OStatement.cxx
+++ b/connectivity/source/drivers/odbcbase/OStatement.cxx
@@ -260,13 +260,13 @@ void OStatement_Base::clearMyResultSet () throw (SQLException)
m_xResultSet = Reference< XResultSet >();
}
//--------------------------------------------------------------------
-sal_Int32 OStatement_Base::getRowCount () throw( SQLException)
+SQLLEN OStatement_Base::getRowCount () throw( SQLException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
- sal_Int32 numRows = 0;
+ SQLLEN numRows = 0;
try {
THROW_SQL(N3SQLRowCount(m_aStatementHandle,&numRows));
@@ -533,7 +533,9 @@ Sequence< sal_Int32 > SAL_CALL OStatement::executeBatch( ) throw(SQLException,
SQLRETURN nError = N3SQLMoreResults(m_aStatementHandle);
if(nError == SQL_SUCCESS)
{
- N3SQLRowCount(m_aStatementHandle,&pArray[j]);
+ SQLLEN nRowCount=0;
+ N3SQLRowCount(m_aStatementHandle,&nRowCount);
+ pArray[j] = nRowCount;
}
}
return aRet;
diff --git a/connectivity/source/drivers/odbcbase/OTools.cxx b/connectivity/source/drivers/odbcbase/OTools.cxx
index a7ac4ebf4d78..39c848f34eaf 100644
--- a/connectivity/source/drivers/odbcbase/OTools.cxx
+++ b/connectivity/source/drivers/odbcbase/OTools.cxx
@@ -56,16 +56,16 @@ void OTools::getValue( OConnection* _pConnection,
sal_Bool &_bWasNull,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
void* _pValue,
- SQLINTEGER _rSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
+ SQLLEN _nSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::getValue" );
- SQLINTEGER pcbValue = SQL_NULL_DATA;
+ SQLLEN pcbValue = SQL_NULL_DATA;
OTools::ThrowException(_pConnection,
(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
(SQLUSMALLINT)columnIndex,
_nType,
_pValue,
- (SQLINTEGER)_rSize,
+ _nSize,
&pcbValue),
_aStatementHandle,SQL_HANDLE_STMT,_xInterface,sal_False);
_bWasNull = pcbValue == SQL_NULL_DATA;
@@ -86,12 +86,12 @@ void OTools::bindParameter( OConnection* _pConnection,
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::bindParameter" );
SQLRETURN nRetcode;
- SWORD fSqlType;
- SWORD fCType;
- SDWORD nMaxLen = 0;
+ SQLSMALLINT fSqlType;
+ SQLSMALLINT fCType;
+ SQLLEN nMaxLen = 0;
// void*& pData = pDataBuffer;
- SQLINTEGER* pLen = (SQLINTEGER*)pLenBuffer;
- SQLUINTEGER nColumnSize=0;
+ SQLLEN* pLen = (SQLLEN*)pLenBuffer;
+ SQLULEN nColumnSize=0;
SQLSMALLINT nDecimalDigits=0;
OTools::getBindTypes(_bUseWChar,_bUseOldTimeDate,_nODBCtype,fCType,fSqlType);
@@ -123,10 +123,10 @@ void OTools::bindParameter( OConnection* _pConnection,
void OTools::bindData( SQLSMALLINT _nOdbcType,
sal_Bool _bUseWChar,
sal_Int8 *&_pData,
- SQLINTEGER*& pLen,
+ SQLLEN*& pLen,
const void* _pValue,
rtl_TextEncoding _nTextEncoding,
- SQLUINTEGER& _nColumnSize)
+ SQLULEN& _nColumnSize)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::bindData" );
_nColumnSize = 0;
@@ -222,7 +222,7 @@ void OTools::bindData( SQLSMALLINT _nOdbcType,
{
sal_Int32 nLen = 0;
nLen = ((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getLength();
- *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen);
+ *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen);
}
break;
case SQL_LONGVARCHAR:
@@ -235,21 +235,21 @@ void OTools::bindData( SQLSMALLINT _nOdbcType,
::rtl::OString aString(::rtl::OUStringToOString(*(::rtl::OUString*)_pValue,_nTextEncoding));
nLen = aString.getLength();
}
- *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen);
+ *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen);
} break;
case SQL_DATE:
*(DATE_STRUCT*)_pData = *(DATE_STRUCT*)_pValue;
- *pLen = (SDWORD)sizeof(DATE_STRUCT);
+ *pLen = (SQLLEN)sizeof(DATE_STRUCT);
_nColumnSize = 10;
break;
case SQL_TIME:
*(TIME_STRUCT*)_pData = *(TIME_STRUCT*)_pValue;
- *pLen = (SDWORD)sizeof(TIME_STRUCT);
+ *pLen = (SQLLEN)sizeof(TIME_STRUCT);
_nColumnSize = 8;
break;
case SQL_TIMESTAMP:
*(TIMESTAMP_STRUCT*)_pData = *(TIMESTAMP_STRUCT*)_pValue;
- *pLen = (SDWORD)sizeof(TIMESTAMP_STRUCT);
+ *pLen = (SQLLEN)sizeof(TIMESTAMP_STRUCT);
_nColumnSize = 19;
break;
}
@@ -262,7 +262,7 @@ void OTools::bindValue( OConnection* _pConnection,
SQLSMALLINT _nMaxLen,
const void* _pValue,
void* _pData,
- SQLINTEGER *pLen,
+ SQLLEN *pLen,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
rtl_TextEncoding _nTextEncoding,
sal_Bool _bUseOldTimeDate) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
@@ -271,7 +271,7 @@ void OTools::bindValue( OConnection* _pConnection,
SQLRETURN nRetcode;
SQLSMALLINT fSqlType;
SQLSMALLINT fCType;
- SQLSMALLINT nMaxLen = _nMaxLen;
+ SQLLEN nMaxLen = _nMaxLen;
OTools::getBindTypes( sal_False,
_bUseOldTimeDate,
@@ -375,7 +375,7 @@ void OTools::bindValue( OConnection* _pConnection,
_pData = (void*)(columnIndex);
sal_Int32 nLen = 0;
nLen = ((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getLength();
- *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen);
+ *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen);
}
break;
case SQL_LONGVARCHAR:
@@ -383,7 +383,7 @@ void OTools::bindValue( OConnection* _pConnection,
_pData = (void*)(columnIndex);
sal_Int32 nLen = 0;
nLen = ((::rtl::OUString*)_pValue)->getLength();
- *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen);
+ *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen);
} break;
case SQL_DATE:
*pLen = sizeof(DATE_STRUCT);
@@ -446,10 +446,10 @@ void OTools::ThrowException(OConnection* _pConnection,
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::ThrowException" );
SDB_ODBC_CHAR szSqlState[5];
- SDWORD pfNativeError;
+ SQLINTEGER pfNativeError;
SDB_ODBC_CHAR szErrorMessage[SQL_MAX_MESSAGE_LENGTH];
szErrorMessage[0] = '\0';
- SWORD pcbErrorMsg = 0;
+ SQLSMALLINT pcbErrorMsg = 0;
// Informationen zur letzten Operation:
// wenn hstmt != SQL_NULL_HSTMT ist (Benutzung von SetStatus in SdbCursor, SdbTable, ...),
@@ -478,7 +478,7 @@ void OTools::ThrowException(OConnection* _pConnection,
Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
SQLHANDLE _aStatementHandle,
sal_Int32 columnIndex,
- SWORD _fSqlType,
+ SQLSMALLINT _fSqlType,
sal_Bool &_bWasNull,
const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException)
{
@@ -486,14 +486,14 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
char aCharArray[2048];
// Erstmal versuchen, die Daten mit dem kleinen Puffer
// abzuholen:
- SQLINTEGER nMaxLen = sizeof aCharArray - 1;
+ SQLLEN nMaxLen = sizeof aCharArray - 1;
// GETDATA(SQL_C_CHAR,aCharArray,nMaxLen);
- SQLINTEGER pcbValue = 0;
+ SQLLEN pcbValue = 0;
OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
(SQLUSMALLINT)columnIndex,
_fSqlType,
(SQLPOINTER)aCharArray,
- (SQLINTEGER)nMaxLen,
+ nMaxLen,
&pcbValue),
_aStatementHandle,SQL_HANDLE_STMT,_xInterface);
@@ -540,7 +540,7 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
::rtl::OUString OTools::getStringValue(OConnection* _pConnection,
SQLHANDLE _aStatementHandle,
sal_Int32 columnIndex,
- SWORD _fSqlType,
+ SQLSMALLINT _fSqlType,
sal_Bool &_bWasNull,
const Reference< XInterface >& _xInterface,
rtl_TextEncoding _nTextEncoding) throw(SQLException, RuntimeException)
@@ -555,15 +555,15 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
{
sal_Unicode waCharArray[2048];
// read the unicode data
- sal_Int32 nMaxLen = (sizeof(waCharArray) / sizeof(sal_Unicode)) - 1;
+ SQLLEN nMaxLen = (sizeof(waCharArray) / sizeof(sal_Unicode)) - 1;
// GETDATA(SQL_C_WCHAR, waCharArray, nMaxLen + sizeof(sal_Unicode));
- SQLINTEGER pcbValue=0;
+ SQLLEN pcbValue=0;
OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
(SQLUSMALLINT)columnIndex,
SQL_C_WCHAR,
&waCharArray,
- (SQLINTEGER)nMaxLen*sizeof(sal_Unicode),
+ (SQLLEN)nMaxLen*sizeof(sal_Unicode),
&pcbValue),
_aStatementHandle,SQL_HANDLE_STMT,_xInterface);
_bWasNull = pcbValue == SQL_NULL_DATA;
@@ -571,10 +571,10 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
return ::rtl::OUString();
// Bei Fehler bricht der GETDATA-Makro mit return ab,
// bei NULL mit break!
- SQLINTEGER nRealSize = 0;
+ SQLLEN nRealSize = 0;
if ( pcbValue > -1 )
nRealSize = pcbValue / sizeof(sal_Unicode);
- SQLINTEGER nLen = pcbValue != SQL_NO_TOTAL ? std::min(nRealSize, nMaxLen) : (nMaxLen-1);
+ SQLLEN nLen = pcbValue != SQL_NO_TOTAL ? std::min(nRealSize, nMaxLen) : (nMaxLen-1);
waCharArray[nLen] = 0;
aData.append(waCharArray,nLen);
@@ -598,7 +598,7 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
(SQLUSMALLINT)columnIndex,
SQL_C_WCHAR,
&waCharArray,
- (SQLINTEGER)nLen+1,
+ (SQLLEN)nLen+1,
&pcbValue),
_aStatementHandle,SQL_HANDLE_STMT,_xInterface);
nRealSize = 0;
@@ -616,21 +616,21 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
char aCharArray[2048];
// Erstmal versuchen, die Daten mit dem kleinen Puffer
// abzuholen:
- SDWORD nMaxLen = sizeof aCharArray - 1;
+ SQLLEN nMaxLen = sizeof aCharArray - 1;
// GETDATA(SQL_C_CHAR,aCharArray,nMaxLen);
- SQLINTEGER pcbValue = 0;
+ SQLLEN pcbValue = 0;
OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
(SQLUSMALLINT)columnIndex,
SQL_C_CHAR,
&aCharArray,
- (SQLINTEGER)nMaxLen,
+ nMaxLen,
&pcbValue),
_aStatementHandle,SQL_HANDLE_STMT,_xInterface);
_bWasNull = pcbValue == SQL_NULL_DATA;
if(_bWasNull)
return ::rtl::OUString();
- SQLINTEGER nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1);
+ SQLLEN nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1);
aCharArray[nLen] = 0;
if ( ((pcbValue == SQL_NO_TOTAL) || pcbValue > nMaxLen) && aCharArray[nLen-1] == 0 && nLen > 0 )
--nLen;
diff --git a/connectivity/source/inc/odbc/OFunctions.hxx b/connectivity/source/inc/odbc/OFunctions.hxx
index 43ec65992281..5b184b735400 100644
--- a/connectivity/source/inc/odbc/OFunctions.hxx
+++ b/connectivity/source/inc/odbc/OFunctions.hxx
@@ -187,7 +187,7 @@ namespace connectivity
SQLSMALLINT * StringLengthPtr,
SQLSMALLINT * TypePtr,
SQLSMALLINT * SubTypePtr,
- SQLINTEGER * LengthPtr,
+ SQLLEN * LengthPtr,
SQLSMALLINT * PrecisionPtr,
SQLSMALLINT * ScalePtr,
SQLSMALLINT * NullablePtr);
@@ -203,8 +203,8 @@ namespace connectivity
SQLSMALLINT Precision,
SQLSMALLINT Scale,
SQLPOINTER DataPtr,
- SQLINTEGER * StringLengthPtr,
- SQLINTEGER * IndicatorPtr);
+ SQLLEN * StringLengthPtr,
+ SQLLEN * IndicatorPtr);
#define N3SQLSetDescRec(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSetDescRec)getOdbcFunction(ODBC3SQLSetDescRec))(a,b,c,d,e,f,g,h,i,j)
*/
@@ -221,11 +221,11 @@ namespace connectivity
SQLSMALLINT InputOutputType,
SQLSMALLINT ValueType,
SQLSMALLINT ParameterType,
- SQLUINTEGER ColumnSize,
+ SQLULEN ColumnSize,
SQLSMALLINT DecimalDigits,
SQLPOINTER ParameterValuePtr,
- SQLINTEGER BufferLength,
- SQLINTEGER * StrLen_or_IndPtr);
+ SQLLEN BufferLength,
+ SQLLEN * StrLen_or_IndPtr);
#define N3SQLBindParameter(a,b,c,d,e,f,g,h,i,j) (*(T3SQLBindParameter)getOdbcFunction(ODBC3SQLBindParameter))(a,b,c,d,e,f,g,h,i,j)
@@ -266,7 +266,7 @@ namespace connectivity
typedef SQLRETURN (SQL_API *T3SQLDescribeParam) (SQLHSTMT StatementHandle,
SQLUSMALLINT ParameterNumber,
SQLSMALLINT * DataTypePtr,
- SQLUINTEGER * ParameterSizePtr,
+ SQLULEN * ParameterSizePtr,
SQLSMALLINT * DecimalDigitsPtr,
SQLSMALLINT * NullablePtr);
@@ -284,13 +284,13 @@ namespace connectivity
typedef SQLRETURN (SQL_API *T3SQLPutData) ( SQLHSTMT StatementHandle,
SQLPOINTER DataPtr,
- SQLINTEGER StrLen_or_Ind);
+ SQLLEN StrLen_or_Ind);
#define N3SQLPutData(a,b,c) (*(T3SQLPutData)getOdbcFunction(ODBC3SQLPutData))(a,b,c)
// Retrieving results and information about results
typedef SQLRETURN (SQL_API *T3SQLRowCount) ( SQLHSTMT StatementHandle,
- SQLINTEGER * RowCountPtr);
+ SQLLEN * RowCountPtr);
#define N3SQLRowCount(a,b) (*(T3SQLRowCount)getOdbcFunction(ODBC3SQLRowCount))(a,b)
@@ -300,12 +300,12 @@ namespace connectivity
#define N3SQLNumResultCols(a,b) (*(T3SQLNumResultCols)getOdbcFunction(ODBC3SQLNumResultCols))(a,b)
typedef SQLRETURN (SQL_API *T3SQLDescribeCol) ( SQLHSTMT StatementHandle,
- SQLSMALLINT ColumnNumber,
+ SQLUSMALLINT ColumnNumber,
SQLCHAR * ColumnName,
SQLSMALLINT BufferLength,
SQLSMALLINT * NameLengthPtr,
SQLSMALLINT * DataTypePtr,
- SQLUINTEGER * ColumnSizePtr,
+ SQLULEN * ColumnSizePtr,
SQLSMALLINT * DecimalDigitsPtr,
SQLSMALLINT * NullablePtr);
@@ -317,7 +317,7 @@ namespace connectivity
SQLPOINTER CharacterAttributePtr,
SQLSMALLINT BufferLength,
SQLSMALLINT * StringLengthPtr,
- SQLPOINTER NumericAttributePtr);
+ SQLLEN * NumericAttributePtr);
#define N3SQLColAttribute(a,b,c,d,e,f,g) (*(T3SQLColAttribute)getOdbcFunction(ODBC3SQLColAttribute))(a,b,c,d,e,f,g)
@@ -325,8 +325,8 @@ namespace connectivity
SQLUSMALLINT ColumnNumber,
SQLSMALLINT TargetType,
SQLPOINTER TargetValuePtr,
- SQLINTEGER BufferLength,
- SQLINTEGER * StrLen_or_IndPtr);
+ SQLLEN BufferLength,
+ SQLLEN * StrLen_or_IndPtr);
#define N3SQLBindCol(a,b,c,d,e,f) (*(T3SQLBindCol)getOdbcFunction(ODBC3SQLBindCol))(a,b,c,d,e,f)
@@ -336,7 +336,7 @@ namespace connectivity
typedef SQLRETURN (SQL_API *T3SQLFetchScroll) ( SQLHSTMT StatementHandle,
SQLSMALLINT FetchOrientation,
- SQLINTEGER FetchOffset);
+ SQLLEN FetchOffset);
#define N3SQLFetchScroll(a,b,c) (*(T3SQLFetchScroll)getOdbcFunction(ODBC3SQLFetchScroll))(a,b,c)
@@ -344,20 +344,20 @@ namespace connectivity
SQLUSMALLINT ColumnNumber,
SQLSMALLINT TargetType,
SQLPOINTER TargetValuePtr,
- SQLINTEGER BufferLength,
- SQLINTEGER * StrLen_or_IndPtr);
+ SQLLEN BufferLength,
+ SQLLEN * StrLen_or_IndPtr);
#define N3SQLGetData(a,b,c,d,e,f) (*(T3SQLGetData)getOdbcFunction(ODBC3SQLGetData))(a,b,c,d,e,f)
typedef SQLRETURN (SQL_API *T3SQLSetPos) ( SQLHSTMT StatementHandle,
- SQLUSMALLINT RowNumber,
+ SQLSETPOSIROW RowNumber,
SQLUSMALLINT Operation,
SQLUSMALLINT LockType);
#define N3SQLSetPos(a,b,c,d) (*(T3SQLSetPos)getOdbcFunction(ODBC3SQLSetPos))(a,b,c,d)
typedef SQLRETURN (SQL_API *T3SQLBulkOperations) ( SQLHSTMT StatementHandle,
- SQLUSMALLINT Operation);
+ SQLSMALLINT Operation);
#define N3SQLBulkOperations(a,b) (*(T3SQLBulkOperations)getOdbcFunction(ODBC3SQLBulkOperations))(a,b)
@@ -461,15 +461,15 @@ namespace connectivity
#define N3SQLProcedures(a,b,c,d,e,f,g) (*(T3SQLProcedures)getOdbcFunction(ODBC3SQLProcedures))(a,b,c,d,e,f,g)
typedef SQLRETURN (SQL_API *T3SQLSpecialColumns) (SQLHSTMT StatementHandle,
- SQLSMALLINT IdentifierType,
+ SQLUSMALLINT IdentifierType,
SQLCHAR * CatalogName,
SQLSMALLINT NameLength1,
SQLCHAR * SchemaName,
SQLSMALLINT NameLength2,
SQLCHAR * TableName,
SQLSMALLINT NameLength3,
- SQLSMALLINT Scope,
- SQLSMALLINT Nullable);
+ SQLUSMALLINT Scope,
+ SQLUSMALLINT Nullable);
#define N3SQLSpecialColumns(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSpecialColumns)getOdbcFunction(ODBC3SQLSpecialColumns))(a,b,c,d,e,f,g,h,i,j)
diff --git a/connectivity/source/inc/odbc/OResultSet.hxx b/connectivity/source/inc/odbc/OResultSet.hxx
index cf9fdce56115..9925457e99f6 100644
--- a/connectivity/source/inc/odbc/OResultSet.hxx
+++ b/connectivity/source/inc/odbc/OResultSet.hxx
@@ -128,7 +128,7 @@ namespace connectivity
typedef ::std::vector<ORowSetValue> TDataRow;
TVoidVector m_aBindVector;
- ::std::vector<sal_Int32> m_aLengthVector;
+ ::std::vector<SQLLEN> m_aLengthVector;
::std::map<sal_Int32,SWORD> m_aODBCColumnTypes;
::com::sun::star::uno::Sequence<sal_Int8> m_aBookmark;
diff --git a/connectivity/source/inc/odbc/OResultSetMetaData.hxx b/connectivity/source/inc/odbc/OResultSetMetaData.hxx
index 1d9564e5d762..99b7b6b54ccb 100644
--- a/connectivity/source/inc/odbc/OResultSetMetaData.hxx
+++ b/connectivity/source/inc/odbc/OResultSetMetaData.hxx
@@ -81,13 +81,13 @@ namespace connectivity
virtual ~OResultSetMetaData();
- static SWORD getNumColAttrib(OConnection* _pConnection
+ static SQLLEN getNumColAttrib(OConnection* _pConnection
,SQLHANDLE _aStatementHandle
,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface
,sal_Int32 _column
,sal_Int32 ident) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- static SWORD getColumnODBCType(OConnection* _pConnection
+ static SQLSMALLINT getColumnODBCType(OConnection* _pConnection
,SQLHANDLE _aStatementHandle
,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface
,sal_Int32 column)
diff --git a/connectivity/source/inc/odbc/OStatement.hxx b/connectivity/source/inc/odbc/OStatement.hxx
index 5d3e71c5e42d..58702312231a 100644
--- a/connectivity/source/inc/odbc/OStatement.hxx
+++ b/connectivity/source/inc/odbc/OStatement.hxx
@@ -130,7 +130,7 @@ namespace connectivity
*/
virtual OResultSet* createResulSet();
- sal_Int32 getRowCount () throw( ::com::sun::star::sdbc::SQLException);
+ SQLLEN getRowCount () throw( ::com::sun::star::sdbc::SQLException);
void disposeResultSet();
diff --git a/connectivity/source/inc/odbc/OTools.hxx b/connectivity/source/inc/odbc/OTools.hxx
index 0d73ea3530c7..0c12f9010cdc 100644
--- a/connectivity/source/inc/odbc/OTools.hxx
+++ b/connectivity/source/inc/odbc/OTools.hxx
@@ -197,7 +197,7 @@ namespace connectivity
static ::rtl::OUString getStringValue( OConnection* _pConnection,
SQLHANDLE _aStatementHandle,
sal_Int32 columnIndex,
- SWORD _fSqlType,
+ SQLSMALLINT _fSqlType,
sal_Bool &_bWasNull,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
rtl_TextEncoding _nTextEncoding) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
@@ -205,7 +205,7 @@ namespace connectivity
static ::com::sun::star::uno::Sequence<sal_Int8> getBytesValue(OConnection* _pConnection,
SQLHANDLE _aStatementHandle,
sal_Int32 columnIndex,
- SWORD _fSqlType,
+ SQLSMALLINT _fSqlType,
sal_Bool &_bWasNull,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
static void getValue( OConnection* _pConnection,
@@ -215,7 +215,7 @@ namespace connectivity
sal_Bool &_bWasNull,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
void* _pValue,
- SQLINTEGER _rSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ SQLLEN _nSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
/**
bindData copies the from pValue to pData
@@ -229,10 +229,10 @@ namespace connectivity
static void bindData( SQLSMALLINT _nOdbcType,
sal_Bool _bUseWChar,
sal_Int8 *&_pData,
- SQLINTEGER*& pLen,
+ SQLLEN*& pLen,
const void* _pValue,
rtl_TextEncoding _nTextEncoding,
- SQLUINTEGER& _nColumnSize);
+ SQLULEN& _nColumnSize);
static void bindParameter( OConnection* _pConnection,
SQLHANDLE _hStmt,
@@ -254,7 +254,7 @@ namespace connectivity
SQLSMALLINT _nMaxLen,
const void* _pValue,
void* _pData,
- SQLINTEGER *pLen,
+ SQLLEN *pLen,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
rtl_TextEncoding _nTextEncoding,
sal_Bool _bUseOldTimeDate) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
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 9002a7b32210..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)
@@ -1617,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
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 36993bfdf355..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
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.src b/desktop/source/deployment/gui/dp_gui_dialog2.src
index 0ca9f9e74362..7e4004bca1d4 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.src
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.src
@@ -169,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_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/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/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/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/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/sj2/stardiv/applet/LiveConnectable.java b/desktop/source/registration/com/sun/star/servicetag/UnauthorizedAccessException.java
index 36604358c19f..785cb35777ae 100644
--- a/sj2/stardiv/applet/LiveConnectable.java
+++ b/desktop/source/registration/com/sun/star/servicetag/UnauthorizedAccessException.java
@@ -6,8 +6,9 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: LiveConnectable.java,v $
- * $Revision: 1.3 $
+ * $RCSfile: UnauthorizedAccessException.java,v $
+ *
+ * $Revision: 1.2 $
*
* This file is part of OpenOffice.org.
*
@@ -28,18 +29,31 @@
*
************************************************************************/
-package stardiv.applet;
+package com.sun.star.servicetag;
/**
- * LiveConnectable interface .
- *
- * @version 1.0, 21/04/98
- * @author Markus Meyer
+ * 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 {
-public interface LiveConnectable
-{
- public Object getJavaScriptJSObjectWindow();
-}
+ /**
+ * Constructs an <code>UnauthorizedAccessException</code> object
+ * without detail message.
+ */
+ public UnauthorizedAccessException() {
+ }
+ /**
+ * 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/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/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
index b9639aeacc50..df09718a7582 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
@@ -76,8 +76,11 @@ namespace drawinglayer
~TextLayouterDevice();
void setFont(const Font& rFont);
- void setFontAttributes(const FontAttributes& rFontAttributes, const basegfx::B2DHomMatrix& rTransform, const ::com::sun::star::lang::Locale & rLocale);
- void setFontAttributes(const FontAttributes& rFontAttributes, double fFontScaleX, double fFontScaleY, const ::com::sun::star::lang::Locale & rLocale);
+ void setFontAttributes(
+ const FontAttributes& rFontAttributes,
+ double fFontScaleX,
+ double fFontScaleY,
+ const ::com::sun::star::lang::Locale & rLocale);
double getTextHeight() const;
double getOverlineHeight() const;
@@ -85,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,
@@ -99,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,
@@ -112,27 +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 ::com::sun::star::lang::Locale & rLocale,
- const OutputDevice& rOutDev);
-
- Font getVclFontFromFontAttributes(
- const FontAttributes& rFontAttributes,
- const basegfx::B2DHomMatrix& rTransform,
- const ::com::sun::star::lang::Locale & rLocale,
- 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 94e92a149e50..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(), getLocale());
+ 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(),getLocale());
+ 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 0055af3ea4bd..e321783c8406 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -43,6 +43,7 @@
#include <vcl/metric.hxx>
#include <i18npool/mslangid.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
+#include <vcl/svapp.hxx>
//////////////////////////////////////////////////////////////////////////////
// VDev RevDevice provider
@@ -166,14 +167,18 @@ namespace drawinglayer
mrDevice.SetFont( rFont );
}
- void TextLayouterDevice::setFontAttributes(const FontAttributes& rFontAttributes, const basegfx::B2DHomMatrix& rTransform, const ::com::sun::star::lang::Locale & rLocale)
- {
- setFont(getVclFontFromFontAttributes(rFontAttributes, rTransform, rLocale, mrDevice));
- }
-
- void TextLayouterDevice::setFontAttributes(const FontAttributes& rFontAttributes, double fFontScaleX, double fFontScaleY, const ::com::sun::star::lang::Locale & rLocale)
+ void TextLayouterDevice::setFontAttributes(
+ const FontAttributes& rFontAttributes,
+ double fFontScaleX,
+ double fFontScaleY,
+ const ::com::sun::star::lang::Locale& rLocale)
{
- setFont(getVclFontFromFontAttributes(rFontAttributes, fFontScaleX, fFontScaleY, 0.0, rLocale, mrDevice));
+ setFont(getVclFontFromFontAttributes(
+ rFontAttributes,
+ fFontScaleX,
+ fFontScaleY,
+ 0.0,
+ rLocale));
}
double TextLayouterDevice::getOverlineOffset() const
@@ -197,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();
@@ -241,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(
@@ -286,7 +288,7 @@ namespace drawinglayer
nIndex,
nLength);
- // #i102556# take empty results into account
+ // #i104432#, #i102556# take empty results into account
if(!aRect.IsEmpty())
{
return basegfx::B2DRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom());
@@ -307,38 +309,36 @@ namespace drawinglayer
{
Font getVclFontFromFontAttributes(
const FontAttributes& rFontAttributes,
- const basegfx::B2DHomMatrix& rTransform,
- const ::com::sun::star::lang::Locale & rLocale,
- 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, rLocale, rOutDev);
- }
-
- Font getVclFontFromFontAttributes(
- const FontAttributes& rFontAttributes,
double fFontScaleX,
double fFontScaleY,
double fFontRotation,
- const ::com::sun::star::lang::Locale & rLocale,
- 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);
@@ -348,32 +348,20 @@ namespace drawinglayer
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)));
@@ -383,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()),
@@ -397,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 7c62c235c21d..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(), getLocale());
-#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))
+ {
+ ::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
{
- const double fFontRelation(aTextLayouter.getCurrentFontRelation());
- aScale.setX(aScale.getX() * fFontRelation);
- aFontScale.setX(aFontScale.getX() / fFontRelation);
+ // 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,29 +328,22 @@ 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(), getLocale());
+ aTextLayouter.setFontAttributes(
+ getFontAttributes(),
+ aFontScale.getX(),
+ aFontScale.getY(),
+ getLocale());
// get basic text range
basegfx::B2DRange aNewRange(aTextLayouter.getTextBoundRect(getText(), getTextPosition(), getTextLength()));
- // #i102556# take empty results into account
+ // #i104432#, #i102556# take empty results into account
if(!aNewRange.isEmpty())
{
-#ifdef WIN32
- // when under Windows and the font is unequally scaled, need to correct font X-Scaling factor
- if(bCorrectScale)
- {
- aScale.setX(aScale.getX() * aTextLayouter.getCurrentFontRelation());
- }
-#endif
// prepare object transformation for range
basegfx::B2DHomMatrix aRangeTransformation;
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index daf8ce5d525f..e5a88812dd10 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -138,79 +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,
- rTextCandidate.getLocale(),
- *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,
- rTextCandidate.getLocale(),
- *mpOutputDevice);
- }
- }
+ rTextCandidate.getLocale()));
// handle additional font attributes
const primitive2d::TextDecoratedPortionPrimitive2D* pTCPP =
@@ -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));
}
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/prj/CVS/Entries b/formula/prj/CVS/Entries
deleted file mode 100644
index 3ae75e3153ff..000000000000
--- a/formula/prj/CVS/Entries
+++ /dev/null
@@ -1,4 +0,0 @@
-/build.lst/1.10/Wed Aug 20 14:15:04 2008//Tcws_dev300_frmdlg
-/d.lst/1.6/Fri Aug 17 11:27:10 2007//Tcws_dev300_frmdlg
-/rpt.xml/1.2/Mon Jul 09 11:56:12 2007//Tcws_dev300_frmdlg
-D
diff --git a/formula/prj/CVS/Repository b/formula/prj/CVS/Repository
deleted file mode 100644
index 573341612fc8..000000000000
--- a/formula/prj/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/cvs/dba/reportdesign/prj
diff --git a/formula/prj/CVS/Root b/formula/prj/CVS/Root
deleted file mode 100644
index ed0df2a21830..000000000000
--- a/formula/prj/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:pserver:oj@so-cvs-tunnel.germany.sun.com:/cvs
diff --git a/formula/prj/CVS/Tag b/formula/prj/CVS/Tag
deleted file mode 100644
index 9ff93ee1efdd..000000000000
--- a/formula/prj/CVS/Tag
+++ /dev/null
@@ -1 +0,0 @@
-Tcws_dev300_frmdlg
diff --git a/formula/prj/CVS/Template b/formula/prj/CVS/Template
deleted file mode 100644
index eec9bab36d48..000000000000
--- a/formula/prj/CVS/Template
+++ /dev/null
@@ -1,42 +0,0 @@
-Issue number:
-Submitted by:
-Reviewed by:
-CVS: ----------------------------------------------------------------------
-CVS: Issue number:
-CVS: If this change addresses one or more issues,
-CVS: then enter the issue number(s) here.
-CVS: Submitted by:
-CVS: If this code has been contributed to the project by someone else; i.e.,
-CVS: they sent us a patch or a set of diffs, then include their name/email
-CVS: address here. If this is your work then delete this line.
-CVS: Reviewed by:
-CVS: If we are doing pre-commit code reviews and someone else has
-CVS: reviewed your changes, include their name(s) here.
-CVS: If you have not had it reviewed then delete this line.
-CVS: ----------------------------------------------------------------------
-CVS: Committers,
-CVS:
-CVS: Please follow these protocols:
-CVS:
-CVS: * Please include in the log message
-CVS: reference(s) by ID / number and/or URL
-CVS: to any and all relevant OpenOffice.org issue(s).
-CVS:
-CVS: * If the code is contributed from outside Sun
-CVS: then please verify using the list at the following URL
-CVS: http://www.openoffice.org/copyright/copyrightapproved.html
-CVS: that Sun has received a signed Copyright Assignment Form
-CVS: from the submitter.
-CVS:
-CVS: Otherwise,
-CVS: please send an email TO: the submitter; and CC: OOCRequest@eng.sun.com
-CVS: the letter (CopyRightRequest.txt) to request assignment of copyright to Sun
-CVS: (http://www.openoffice.org/copyright/assign_copyright.html).
-CVS:
-CVS: Please do NOT commit code until you have verified (as detailed above) that
-CVS: Sun has received a signed Copyright Assignment Form from the submitter.
-CVS:
-CVS: * Please send an email TO: the submitter
-CVS: (particularly, if from outside Sun)
-CVS: advising that the code has been committed,
-CVS: and gratefully recognizing the contribution.
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 4cfa28d1806d..2fd4e08deeb4 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1183,10 +1183,10 @@ void FormulaCompiler::RangeLine()
//---------------------------------------------------------------------------
-void FormulaCompiler::UnionLine()
+void FormulaCompiler::IntersectionLine()
{
RangeLine();
- while (pToken->GetOpCode() == ocUnion)
+ while (pToken->GetOpCode() == ocIntersect)
{
FormulaTokenRef p = pToken;
NextToken();
@@ -1197,14 +1197,14 @@ void FormulaCompiler::UnionLine()
//---------------------------------------------------------------------------
-void FormulaCompiler::IntersectionLine()
+void FormulaCompiler::UnionLine()
{
- UnionLine();
- while (pToken->GetOpCode() == ocIntersect)
+ IntersectionLine();
+ while (pToken->GetOpCode() == ocUnion)
{
FormulaTokenRef p = pToken;
NextToken();
- UnionLine();
+ IntersectionLine();
PutCode(p);
}
}
@@ -1224,7 +1224,7 @@ void FormulaCompiler::UnaryLine()
PutCode( p );
}
else
- IntersectionLine();
+ UnionLine();
}
//---------------------------------------------------------------------------
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/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/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/unx/kde4/KDE4FilePicker.cxx b/fpicker/source/unx/kde4/KDE4FilePicker.cxx
index d6d852c71d93..09e33a225977 100644
--- a/fpicker/source/unx/kde4/KDE4FilePicker.cxx
+++ b/fpicker/source/unx/kde4/KDE4FilePicker.cxx
@@ -1,11 +1,4 @@
/*************************************************************************
- *
- *
- *
- *
- *
- *
- *
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
@@ -136,7 +129,8 @@ namespace
rtl::OUString toOUString(const QString& s)
{
- return rtl::OUString(s.toUtf8().data(), s.length(), RTL_TEXTENCODING_UTF8);
+ // QString stores UTF16, just like OUString
+ return rtl::OUString(reinterpret_cast<const sal_Unicode*>(s.data()), s.length());
}
QString toQString(const rtl::OUString& s)
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
index 58041b3fe628..ed2d5041ad67 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
@@ -872,30 +872,31 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(const RequestRef& rRequest)
{
if (m_sFilename.getLength())
{
- ::rtl::OUString aFileURL(m_sDirectory);
- sal_Int32 nIndex = aFileURL.lastIndexOf('/');
- if (nIndex != aFileURL.getLength()-1)
- aFileURL += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/"));
- aFileURL += m_sFilename;
-
+ ::rtl::OUString aFileURL(m_sDirectory);
+ sal_Int32 nIndex = aFileURL.lastIndexOf('/');
+ if (nIndex != aFileURL.getLength()-1)
+ aFileURL += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/"));
+ aFileURL += m_sFilename;
+
TFileDialogCustomize iCustom = impl_getCustomizeInterface();
BOOL bValue = FALSE;
HRESULT hResult = iCustom->GetCheckButtonState( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, &bValue);
if ( bValue )
{
- ::rtl::OUString aExt;
- UINT nFileType;
- hResult = iDialog->GetFileTypeIndex(&nFileType);
+ ::rtl::OUString aExt;
+ UINT nFileType;
+ hResult = iDialog->GetFileTypeIndex(&nFileType);
if ( SUCCEEDED(hResult) )
- {
+ {
+ ::sal_Int32 nRealIndex = (nFileType-1); // COM dialog base on 1 ... filter container on 0 .-)
::std::vector< COMDLG_FILTERSPEC > lFilters = lcl_buildFilterList(m_lFilters);
- LPCWSTR lpFilterExt = lFilters[nFileType].pszSpec;
+ LPCWSTR lpFilterExt = lFilters[nRealIndex].pszSpec;
lpFilterExt = wcsrchr( lpFilterExt, '.' );
if ( lpFilterExt )
aFileURL += reinterpret_cast<const sal_Unicode*>(lpFilterExt);
- }
+ }
}
// Check existence of file. Set folder only for this special case
@@ -904,15 +905,15 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(const RequestRef& rRequest)
WIN32_FIND_DATA aFindFileData;
HANDLE hFind = FindFirstFile( reinterpret_cast<LPCWSTR>(aSystemPath.getStr()), &aFindFileData );
- if (hFind != INVALID_HANDLE_VALUE)
- iDialog->SetFolder(pFolder);
- else
- hResult = iDialog->AddPlace(pFolder, FDAP_TOP);
-
+ if (hFind != INVALID_HANDLE_VALUE)
+ iDialog->SetFolder(pFolder);
+ else
+ hResult = iDialog->AddPlace(pFolder, FDAP_TOP);
+
FindClose( hFind );
- }
- else
- hResult = iDialog->AddPlace(pFolder, FDAP_TOP);
+ }
+ else
+ hResult = iDialog->AddPlace(pFolder, FDAP_TOP);
}
}
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/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/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/opluginframedispatcher.hxx b/framework/inc/helper/opluginframedispatcher.hxx
deleted file mode 100644
index 4f738825d2ee..000000000000
--- a/framework/inc/helper/opluginframedispatcher.hxx
+++ /dev/null
@@ -1,353 +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/implbase3.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 : private ThreadHelpBase ,
- public ::cppu::WeakImplHelper3< ::com::sun::star::frame::XDispatchProvider, ::com::sun::star::frame::XDispatch, ::com::sun::star::mozilla::XPluginInstanceNotifySink >
-{
- //-------------------------------------------------------------------------------------------------------------
- // 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 );
-
- //---------------------------------------------------------------------------------------------------------
- // 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/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/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/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/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/uiconfiguration/moduleuiconfigurationmanager.hxx b/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx
index 62c0477a5169..a0dc92ae50d3 100644
--- a/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx
+++ b/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx
@@ -38,7 +38,6 @@
#include <vector>
#include <list>
#include <hash_map>
-#include <memory>
//_________________________________________________________________________________________________________________
// my own includes
@@ -78,7 +77,6 @@
namespace framework
{
- class UIConfigurationManagerImpl;
class ModuleUIConfigurationManager : public com::sun::star::lang::XTypeProvider ,
public com::sun::star::lang::XServiceInfo ,
public com::sun::star::lang::XComponent ,
@@ -87,6 +85,7 @@ 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:
@@ -135,7 +134,94 @@ namespace framework
virtual sal_Bool SAL_CALL isReadOnly() throw (::com::sun::star::uno::RuntimeException);
private:
- ::std::auto_ptr<UIConfigurationManagerImpl> m_pImpl;
+ // 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;
};
}
diff --git a/framework/inc/uiconfiguration/uiconfigurationmanager.hxx b/framework/inc/uiconfiguration/uiconfigurationmanager.hxx
index 39f1d9503513..e7ecec183570 100644
--- a/framework/inc/uiconfiguration/uiconfigurationmanager.hxx
+++ b/framework/inc/uiconfiguration/uiconfigurationmanager.hxx
@@ -38,7 +38,6 @@
#include <vector>
#include <list>
#include <hash_map>
-#include <memory>
//_________________________________________________________________________________________________________________
// my own includes
@@ -78,7 +77,6 @@
namespace framework
{
- class UIConfigurationManagerImpl;
class UIConfigurationManager : public com::sun::star::lang::XTypeProvider ,
public com::sun::star::lang::XServiceInfo ,
public com::sun::star::lang::XComponent ,
@@ -86,6 +84,7 @@ 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:
@@ -131,7 +130,83 @@ namespace framework
virtual sal_Bool SAL_CALL hasStorage() throw (::com::sun::star::uno::RuntimeException);
private:
- ::std::auto_ptr<UIConfigurationManagerImpl> m_pImpl;
+ // 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;
};
}
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/bmkmenu.cxx b/framework/source/classes/bmkmenu.cxx
index 5abb25f17c13..efa66b3a6140 100644
--- a/framework/source/classes/bmkmenu.cxx
+++ b/framework/source/classes/bmkmenu.cxx
@@ -175,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/fwktabwindow.cxx b/framework/source/classes/fwktabwindow.cxx
index b9615fdc7a20..d737a2d77308 100644
--- a/framework/source/classes/fwktabwindow.cxx
+++ b/framework/source/classes/fwktabwindow.cxx
@@ -205,21 +205,6 @@ void FwkTabPage::Resize()
}
}
-// -----------------------------------------------------------------------
-
-void FwkTabPage::Reset()
-{
- CallMethod( BACK_METHOD );
- ActivatePage();
-}
-
-// -----------------------------------------------------------------------
-
-void FwkTabPage::Save()
-{
- CallMethod( OK_METHOD );
-}
-
// class FwkTabWindow ---------------------------------------------
FwkTabWindow::FwkTabWindow( Window* pParent ) :
@@ -416,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/menumanager.cxx b/framework/source/classes/menumanager.cxx
index e57934a5a65f..bb850b876e5c 100644
--- a/framework/source/classes/menumanager.cxx
+++ b/framework/source/classes/menumanager.cxx
@@ -157,7 +157,7 @@ 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();
@@ -371,7 +371,7 @@ 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();
@@ -919,7 +919,7 @@ IMPL_LINK( MenuManager, Activate, Menu *, 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 )
{
diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx
index 44eaa2062497..25b80650e81a 100644
--- a/framework/source/dispatch/closedispatcher.cxx
+++ b/framework/source/dispatch/closedispatcher.cxx
@@ -48,6 +48,7 @@
#include <com/sun/star/frame/CommandGroup.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
+#include <com/sun/star/document/XActionLockable.hpp>
#include "com/sun/star/beans/XFastPropertySet.hpp"
#include <toolkit/helper/vclunohelper.hxx>
@@ -171,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)
{
@@ -236,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);
}
//-----------------------------------------------
@@ -540,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/menudispatcher.cxx b/framework/source/dispatch/menudispatcher.cxx
index a17f830a1b7e..1e715f58fddc 100644
--- a/framework/source/dispatch/menudispatcher.cxx
+++ b/framework/source/dispatch/menudispatcher.cxx
@@ -445,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/helper/actiontriggerhelper.cxx b/framework/source/helper/actiontriggerhelper.cxx
index b2acbfd3409b..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:" ));
diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx
index b2139488a0ee..ee59097aa3fc 100644
--- a/framework/source/helper/statusindicatorfactory.cxx
+++ b/framework/source/helper/statusindicatorfactory.cxx
@@ -67,6 +67,7 @@
// includes of other projects
#include <comphelper/sequenceashashmap.hxx>
#include <comphelper/mediadescriptor.hxx>
+#include <comphelper/configurationhelper.hxx>
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
@@ -361,6 +362,7 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed()
css::uno::Reference< css::frame::XFrame > xFrame (m_xFrame.get() , css::uno::UNO_QUERY);
css::uno::Reference< css::awt::XWindow > xPluggWindow(m_xPluggWindow.get(), css::uno::UNO_QUERY);
+ css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR( m_xSMGR.get(), css::uno::UNO_QUERY);
aReadLock.unlock();
// <- SAFE ----------------------------------
@@ -432,8 +434,21 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed()
// is visible too.
impl_showProgress();
- if (xParentWindow.is())
- xParentWindow->setVisible(sal_True);
+ ::vos::OClearableGuard aSolarGuard(Application::GetSolarMutex());
+ Window* pWindow = VCLUnoHelper::GetWindow(xParentWindow);
+ if ( pWindow )
+ {
+ bool bForceFrontAndFocus(false);
+ ::comphelper::ConfigurationHelper::readDirectKey(
+ xSMGR,
+ ::rtl::OUString::createFromAscii("org.openoffice.Office.Common/View"),
+ ::rtl::OUString::createFromAscii("NewDocumentHandling"),
+ ::rtl::OUString::createFromAscii("ForceFocusAndToFront"),
+ ::comphelper::ConfigurationHelper::E_READONLY) >>= bForceFrontAndFocus;
+
+ pWindow->Show(sal_True, bForceFrontAndFocus ? SHOW_FOREGROUNDTASK : 0 );
+ }
+
/*
#i75167# dont disturb window manager handling .-)
css::uno::Reference< css::awt::XTopWindow > xParentWindowTop(xParentWindow, css::uno::UNO_QUERY);
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/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/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/job.cxx b/framework/source/jobs/job.cxx
index 40d36f9a65f8..c0c5c90d45b3 100644
--- a/framework/source/jobs/job.cxx
+++ b/framework/source/jobs/job.cxx
@@ -51,7 +51,6 @@
// includes of other projects
#include <rtl/ustrbuf.hxx>
#include <vcl/svapp.hxx>
-#include <comphelper/uieventslogger.hxx>
//________________________________
// namespace
@@ -238,7 +237,6 @@ 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/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index daf0701fff2d..fb10e4fae24c 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -3068,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;
@@ -7038,6 +7033,7 @@ IMPL_LINK( LayoutManager, AsyncLayoutHdl, Timer *, EMPTYARG )
return 0;
}
+#ifdef DBG_UTIL
void LayoutManager::implts_checkElementContainer()
{
#ifdef DBG_UTIL
@@ -7062,6 +7058,7 @@ void LayoutManager::implts_checkElementContainer()
} // for ( ; pCheckIter != aUIElementHash.end(); pCheckIter++ )
#endif
}
+#endif
//---------------------------------------------------------------------------------------------------------
// XFrameActionListener
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index d0110e667906..ee39e583e5e7 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>
@@ -172,6 +172,7 @@ LoadEnv::LoadEnv(const css::uno::Reference< css::lang::XMultiServiceFactory >& x
: ThreadHelpBase( )
, m_xSMGR (xSMGR)
, m_pCheck (this )
+ , m_pQuietInteraction( 0 )
{
}
@@ -348,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 (
@@ -1660,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();
@@ -1677,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);
@@ -1712,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 ----------------------------------
}
@@ -1722,14 +1740,28 @@ void LoadEnv::impl_reactForLoadingState()
void LoadEnv::impl_makeFrameWindowVisible(const css::uno::Reference< css::awt::XWindow >& xWindow ,
sal_Bool bForceToFront)
{
- css::uno::Reference< css::awt::XTopWindow > xTopWindow(xWindow, css::uno::UNO_QUERY);
-
- if (xWindow.is())
- xWindow->setVisible(sal_True);
-
- if (xTopWindow.is() && bForceToFront)
- xTopWindow->toFront();
+ // SAFE -> ----------------------------------
+ ReadGuard aReadLock(m_aLock);
+ css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR( m_xSMGR.get(), css::uno::UNO_QUERY );
+ aReadLock.unlock();
+ // <- SAFE ----------------------------------
+ ::vos::OClearableGuard aSolarGuard(Application::GetSolarMutex());
+ Window* pWindow = VCLUnoHelper::GetWindow(xWindow);
+ if ( pWindow )
+ {
+ bool bForceFrontAndFocus(false);
+ css::uno::Any a = ::comphelper::ConfigurationHelper::readDirectKey(
+ xSMGR,
+ ::rtl::OUString::createFromAscii("org.openoffice.Office.Common/View"),
+ ::rtl::OUString::createFromAscii("NewDocumentHandling"),
+ ::rtl::OUString::createFromAscii("ForceFocusAndToFront"),
+ ::comphelper::ConfigurationHelper::E_READONLY);
+ a >>= bForceFrontAndFocus;
+
+ pWindow->Show(sal_True, (bForceFrontAndFocus || bForceToFront) ? SHOW_FOREGROUNDTASK : 0 );
+ }
+
/* #i19976#
We tried to prevent a toFront() call in case the user putted the
loading document into the background ..
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index c58334ab085b..40e4a9f7a6b9 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -245,6 +245,7 @@ void BackingWindow::DataChanged( const DataChangedEvent& rDCEvt )
if ( rDCEvt.GetFlags() & SETTINGS_STYLE )
{
initBackground();
+ Invalidate();
}
}
@@ -252,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 );
@@ -527,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 );
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index a734d0bd1931..62361d619df3 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -2016,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(
@@ -2075,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/frame.cxx b/framework/source/services/frame.cxx
index a83a7120c40e..0e14404de381 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -3243,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 25d117ca50e2..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)
{
diff --git a/framework/source/uiconfiguration/makefile.mk b/framework/source/uiconfiguration/makefile.mk
index c7d6eb435d4f..3ef9006072a2 100644
--- a/framework/source/uiconfiguration/makefile.mk
+++ b/framework/source/uiconfiguration/makefile.mk
@@ -43,7 +43,6 @@ ENABLE_EXCEPTIONS= TRUE
SLOFILES= \
$(SLO)$/uiconfigurationmanager.obj \
- $(SLO)$/uiconfigurationmanagerimpl.obj \
$(SLO)$/moduleuiconfigurationmanager.obj \
$(SLO)$/moduleuicfgsupplier.obj \
$(SLO)$/windowstateconfiguration.obj \
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index 04c87a2c3946..663c2d0d6dd8 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -38,7 +38,6 @@
#include <uielement/uielementtypenames.hxx>
#include <xml/menuconfiguration.hxx>
#include <xml/toolboxconfiguration.hxx>
-#include <uiconfigurationmanagerimpl.hxx>
#ifndef __FRAMEWORK_XML_STATUSBARCONFIGURATION_HXX_
#include <xml/statusbarconfiguration.hxx>
@@ -114,127 +113,1292 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( ModuleUIConfigurationManager
DEFINE_INIT_SERVICE ( ModuleUIConfigurationManager, {} )
-ModuleUIConfigurationManager::ModuleUIConfigurationManager( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xServiceManager )
-: m_pImpl( new UIConfigurationManagerImpl(xServiceManager,static_cast< OWeakObject* >(this),true) )
+// important: The order and position of the elements must match the constant
+// definition of "::com::sun::star::ui::UIElementType"
+static const char* UIELEMENTTYPENAMES[] =
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::ModuleUIConfigurationManager" );
+ "", // 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 );
}
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)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::dispose" );
- m_pImpl->dispose();
+ 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;
+ }
}
void SAL_CALL ModuleUIConfigurationManager::addEventListener( const Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::addEventListener" );
- m_pImpl->addEventListener(xListener);
+ {
+ ResetableGuard aGuard( m_aLock );
+
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ if ( m_bDisposed )
+ throw DisposedException();
+ }
+
+ m_aListenerContainer.addInterface( ::getCppuType( ( const Reference< XEventListener >* ) NULL ), xListener );
}
void SAL_CALL ModuleUIConfigurationManager::removeEventListener( const Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::removeEventListener" );
- m_pImpl->removeEventListener(xListener);
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ m_aListenerContainer.removeInterface( ::getCppuType( ( const Reference< XEventListener >* ) NULL ), xListener );
}
// XInitialization
void SAL_CALL ModuleUIConfigurationManager::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::initialize" );
- m_pImpl->initialize(aArguments);
+ 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;
+ }
}
// XUIConfiguration
void SAL_CALL ModuleUIConfigurationManager::addConfigurationListener( const Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::addConfigurationListener" );
- m_pImpl->addConfigurationListener(xListener);
+ {
+ ResetableGuard aGuard( m_aLock );
+
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ if ( m_bDisposed )
+ throw DisposedException();
+ }
+
+ m_aListenerContainer.addInterface( ::getCppuType( ( const Reference< XUIConfigurationListener >* ) NULL ), xListener );
}
void SAL_CALL ModuleUIConfigurationManager::removeConfigurationListener( const Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::removeConfigurationListener" );
- m_pImpl->removeConfigurationListener(xListener);
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ m_aListenerContainer.removeInterface( ::getCppuType( ( const Reference< XUIConfigurationListener >* ) NULL ), xListener );
}
// XUIConfigurationManager
void SAL_CALL ModuleUIConfigurationManager::reset() throw (::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::reset" );
- m_pImpl->reset();
+ 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& )
+ {
+ }
+ }
}
Sequence< Sequence< PropertyValue > > SAL_CALL ModuleUIConfigurationManager::getUIElementsInfo( sal_Int16 ElementType )
throw ( IllegalArgumentException, RuntimeException )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::getUIElementsInfo" );
- return m_pImpl->getUIElementsInfo(ElementType);
+ 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 > SAL_CALL ModuleUIConfigurationManager::createSettings() throw (::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::createSettings" );
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
// Creates an empty item container which can be filled from outside
- return m_pImpl->createSettings();
+ return Reference< XIndexContainer >( static_cast< OWeakObject * >( new RootItemContainer() ), UNO_QUERY );
}
sal_Bool SAL_CALL ModuleUIConfigurationManager::hasSettings( const ::rtl::OUString& ResourceURL )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::hasSettings" );
- return m_pImpl->hasSettings(ResourceURL);
+ 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;
}
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)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::getSettings" );
- return m_pImpl->getSettings(ResourceURL,bWriteable);
+ 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();
}
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)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::replaceSettings" );
- return m_pImpl->replaceSettings(ResourceURL,aNewData);
+ 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();
+ }
}
void SAL_CALL ModuleUIConfigurationManager::removeSettings( const ::rtl::OUString& ResourceURL )
throw ( NoSuchElementException, IllegalArgumentException, IllegalAccessException, RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::removeSettings" );
- m_pImpl->removeSettings(ResourceURL);
+ 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();
+ }
}
void SAL_CALL ModuleUIConfigurationManager::insertSettings( const ::rtl::OUString& NewResourceURL, const Reference< XIndexAccess >& aNewData )
throw ( ElementExistException, IllegalArgumentException, IllegalAccessException, RuntimeException )
{
- m_pImpl->insertSettings(NewResourceURL,aNewData);
+ 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();
+ }
}
Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getImageManager() throw (::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::getImageManager" );
- return m_pImpl->getImageManager();
+ 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 >();
}
Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getShortCutManager() throw (::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::getShortCutManager" );
- return m_pImpl->getShortCutManager();
+ 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;
}
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 >();
}
@@ -242,46 +1406,210 @@ 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)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::isDefaultSettings" );
- return m_pImpl->isDefaultSettings(ResourceURL);
+ 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 > SAL_CALL ModuleUIConfigurationManager::getDefaultSettings( const ::rtl::OUString& ResourceURL )
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", "ModuleUIConfigurationManager::getDefaultSettings" );
- return m_pImpl->getDefaultSettings(ResourceURL);
+ 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 SAL_CALL ModuleUIConfigurationManager::reload() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::reload" );
- m_pImpl->reload();
+ 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 );
+ }
}
void SAL_CALL ModuleUIConfigurationManager::store() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::store" );
- m_pImpl->store();
+ 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 SAL_CALL ModuleUIConfigurationManager::storeToStorage( const Reference< XStorage >& Storage ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::storeToStorage" );
- m_pImpl->storeToStorage(Storage);
+ 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();
+ }
}
sal_Bool SAL_CALL ModuleUIConfigurationManager::isModified() throw (::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::isModified" );
- return m_pImpl->isModified();
+ ResetableGuard aGuard( m_aLock );
+
+ return m_bModified;
}
sal_Bool SAL_CALL ModuleUIConfigurationManager::isReadOnly() throw (::com::sun::star::uno::RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManager::isReadOnly" );
- return m_pImpl->isReadOnly();
+ 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();
+ }
+ }
+ }
}
} // namespace framework
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index 67049d9eb4dc..3309333fb327 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -38,7 +38,6 @@
#include <uielement/uielementtypenames.hxx>
#include <xml/menuconfiguration.hxx>
#include <xml/toolboxconfiguration.hxx>
-#include <uiconfigurationmanagerimpl.hxx>
#ifndef __FRAMEWORK_XML_STATUSBARCONFIGURATION_HXX_
#include <xml/statusbarconfiguration.hxx>
@@ -111,9 +110,511 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( UIConfigurationManager
DEFINE_INIT_SERVICE ( UIConfigurationManager, {} )
-UIConfigurationManager::UIConfigurationManager( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xServiceManager )
-: m_pImpl( new UIConfigurationManagerImpl(xServiceManager,static_cast< OWeakObject* >(this),false) )
+
+// 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 )
{
+ // 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()
@@ -123,86 +624,507 @@ UIConfigurationManager::~UIConfigurationManager()
// XComponent
void SAL_CALL UIConfigurationManager::dispose() throw (::com::sun::star::uno::RuntimeException)
{
- m_pImpl->dispose();
+ 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;
+ }
}
void SAL_CALL UIConfigurationManager::addEventListener( const Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
+ {
+ ResetableGuard aGuard( m_aLock );
- m_pImpl->addEventListener(xListener);
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ if ( m_bDisposed )
+ throw DisposedException();
+ }
+
+ m_aListenerContainer.addInterface( ::getCppuType( ( const Reference< XEventListener >* ) NULL ), xListener );
}
void SAL_CALL UIConfigurationManager::removeEventListener( const Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
- m_pImpl->removeEventListener(xListener);
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ m_aListenerContainer.removeInterface( ::getCppuType( ( const Reference< XEventListener >* ) NULL ), xListener );
}
// XUIConfigurationManager
void SAL_CALL UIConfigurationManager::addConfigurationListener( const Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
- m_pImpl->addConfigurationListener(xListener);
+ {
+ ResetableGuard aGuard( m_aLock );
+
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ if ( m_bDisposed )
+ throw DisposedException();
+ }
+
+ m_aListenerContainer.addInterface( ::getCppuType( ( const Reference< XUIConfigurationListener >* ) NULL ), xListener );
}
void SAL_CALL UIConfigurationManager::removeConfigurationListener( const Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
{
- m_pImpl->removeConfigurationListener(xListener);
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ m_aListenerContainer.removeInterface( ::getCppuType( ( const Reference< XUIConfigurationListener >* ) NULL ), xListener );
}
void SAL_CALL UIConfigurationManager::reset() throw (::com::sun::star::uno::RuntimeException)
{
- m_pImpl->reset();
+ 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& )
+ {
+ }
+ }
}
Sequence< Sequence< PropertyValue > > SAL_CALL UIConfigurationManager::getUIElementsInfo( sal_Int16 ElementType )
throw ( IllegalArgumentException, RuntimeException )
{
- return m_pImpl->getUIElementsInfo(ElementType);
+ 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 > SAL_CALL UIConfigurationManager::createSettings() throw (::com::sun::star::uno::RuntimeException)
{
- return m_pImpl->createSettings();
+ 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 SAL_CALL UIConfigurationManager::hasSettings( const ::rtl::OUString& ResourceURL )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{
- return m_pImpl->hasSettings(ResourceURL);
+ 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;
}
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)
{
- return m_pImpl->getSettings(ResourceURL,bWriteable);
+ 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();
}
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)
{
- return m_pImpl->replaceSettings(ResourceURL,aNewData);
+ 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();
+ }
}
void SAL_CALL UIConfigurationManager::removeSettings( const ::rtl::OUString& ResourceURL )
throw ( NoSuchElementException, IllegalArgumentException, IllegalAccessException, RuntimeException)
{
- m_pImpl->removeSettings(ResourceURL);
+ 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();
+ }
}
void SAL_CALL UIConfigurationManager::insertSettings( const ::rtl::OUString& NewResourceURL, const Reference< XIndexAccess >& aNewData )
throw ( ElementExistException, IllegalArgumentException, IllegalAccessException, RuntimeException )
{
- m_pImpl->insertSettings(NewResourceURL,aNewData);
+ 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 );
+ }
+ }
}
Reference< XInterface > SAL_CALL UIConfigurationManager::getImageManager() throw (::com::sun::star::uno::RuntimeException)
{
- return m_pImpl->getImageManager();
+ 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 );
}
Reference< XInterface > SAL_CALL UIConfigurationManager::getShortCutManager() throw (::com::sun::star::uno::RuntimeException)
{
- return m_pImpl->getShortCutManager();
+ // 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;
}
Reference< XInterface > SAL_CALL UIConfigurationManager::getEventsManager() throw (::com::sun::star::uno::RuntimeException)
@@ -213,38 +1135,223 @@ Reference< XInterface > SAL_CALL UIConfigurationManager::getEventsManager() thro
// XUIConfigurationStorage
void SAL_CALL UIConfigurationManager::setStorage( const Reference< XStorage >& Storage ) throw (::com::sun::star::uno::RuntimeException)
{
- m_pImpl->setStorage(Storage);
+ 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();
}
sal_Bool SAL_CALL UIConfigurationManager::hasStorage() throw (::com::sun::star::uno::RuntimeException)
{
- return m_pImpl->hasStorage();
+ ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ return ( m_xDocConfigStorage.is() );
}
// XUIConfigurationPersistence
void SAL_CALL UIConfigurationManager::reload() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
- m_pImpl->reload();
+ 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 );
+ }
}
void SAL_CALL UIConfigurationManager::store() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
- m_pImpl->store();
+ 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();
+ }
}
void SAL_CALL UIConfigurationManager::storeToStorage( const Reference< XStorage >& Storage ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
- m_pImpl->storeToStorage(Storage);
+ 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();
+ }
}
sal_Bool SAL_CALL UIConfigurationManager::isModified() throw (::com::sun::star::uno::RuntimeException)
{
- return m_pImpl->isModified();
+ ResetableGuard aGuard( m_aLock );
+
+ return m_bModified;
}
sal_Bool SAL_CALL UIConfigurationManager::isReadOnly() throw (::com::sun::star::uno::RuntimeException)
{
- return m_pImpl->isReadOnly();
+ 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();
+ }
+ }
+ }
}
} // namespace framework
diff --git a/framework/source/uiconfiguration/uiconfigurationmanagerimpl.cxx b/framework/source/uiconfiguration/uiconfigurationmanagerimpl.cxx
index 9b2284c0c6b8..40c2c3f10708 100755
--- a/framework/source/uiconfiguration/uiconfigurationmanagerimpl.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanagerimpl.cxx
@@ -148,12 +148,12 @@ void UIConfigurationManagerImpl::impl_fillSequenceWithElementTypeInfo( UIElement
while ( pUserIter != rUserElements.end() )
{
sal_Int32 nIndex = pUserIter->second.aResourceURL.indexOf( aCustomUrlPrefix, RESOURCEURL_PREFIX_SIZE );
- if ( !m_bUseDefault && nIndex > 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 && ( !m_bUseDefault || !pDataSettings->bDefault) )
+ if ( pDataSettings && ( m_bUseDefault || !pDataSettings->bDefault ))
{
// Retrieve user interface name from XPropertySet interface
rtl::OUString aUIName;
@@ -1268,7 +1268,7 @@ throw ( ElementExistException, IllegalArgumentException, IllegalAccessException,
if ( m_bDisposed )
throw DisposedException();
- bool bInsertData( m_bUseDefault );
+ bool bInsertData( false );
UIElementData aUIElementData;
UIElementData* pDataSettings = impl_findUIElementData( NewResourceURL, nElementType );
if ( !m_bUseDefault )
@@ -1281,7 +1281,7 @@ throw ( ElementExistException, IllegalArgumentException, IllegalAccessException,
bInsertData = true;
}
}
- if ( !pDataSettings )
+ if ( !pDataSettings || !m_bUseDefault )
{
aUIElementData.bDefault = false;
if ( !m_bUseDefault )
diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx
index 0872e778a727..311db615ed2a 100644
--- a/framework/source/uielement/controlmenucontroller.cxx
+++ b/framework/source/uielement/controlmenucontroller.cxx
@@ -227,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();
}
@@ -369,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 ));
diff --git a/framework/source/uielement/imagebuttontoolbarcontroller.cxx b/framework/source/uielement/imagebuttontoolbarcontroller.cxx
index 17fb412aeff5..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 );
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 4e1df67d69fb..4c20b96f00dc 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -870,7 +870,7 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, 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 ||
@@ -1267,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;
@@ -2049,7 +2049,7 @@ void MenuBarManager::Init(const Reference< XFrame >& rFrame,AddonMenu* pAddonMen
UNO_QUERY );
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
- m_bWasHiContrast = rSettings.GetMenuColor().IsDark();
+ m_bWasHiContrast = rSettings.GetHighContrastMode();
Reference< XStatusListener > xStatusListener;
Reference< XDispatch > xDispatch;
diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx
index fea156dceb9d..37580f86f546 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -486,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();
@@ -563,7 +563,7 @@ void SAL_CALL NewMenuController::initialize( const Sequence< Any >& aArguments )
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/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index 88ecaae88ad1..55c8d16af2ec 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -243,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 ),
@@ -371,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 )
{
@@ -1365,7 +1365,7 @@ void ToolBarManager::RequestImages()
}
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() )
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx
index 80c4c013a71b..3b359eea97c2 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -211,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 )
diff --git a/framework/source/uifactory/windowcontentfactorymanager.cxx b/framework/source/uifactory/windowcontentfactorymanager.cxx
index fcadc1694e54..239c6aff5c1f 100644
--- a/framework/source/uifactory/windowcontentfactorymanager.cxx
+++ b/framework/source/uifactory/windowcontentfactorymanager.cxx
@@ -220,6 +220,13 @@ throw (uno::Exception, uno::RuntimeException)
// module identifier, user interface element type and name
// SAFE
ResetableGuard aLock( m_aLock );
+
+ if ( !m_bConfigRead )
+ {
+ m_bConfigRead = sal_True;
+ m_pConfigAccess->readConfigurationData();
+ }
+
aImplementationName = m_pConfigAccess->getFactorySpecifierFromTypeNameModule( aType, aName, aModuleId );
if ( aImplementationName.getLength() > 0 )
{
diff --git a/framework/util/makefile.mk b/framework/util/makefile.mk
index 61d0da2a4c86..0a07f3cf137d 100644
--- a/framework/util/makefile.mk
+++ b/framework/util/makefile.mk
@@ -316,7 +316,7 @@ SHL4OBJS= \
$(SLO)$/statusindicatorfactory.obj \
$(SLO)$/statusindicatorinterfacewrapper.obj \
$(SLO)$/statusindicator.obj \
- $(SLO)$/stillinteraction.obj \
+ $(SLO)$/quietinteraction.obj \
$(SLO)$/storageholder.obj \
$(SLO)$/substitutepathvars.obj \
$(SLO)$/tagwindowasmodified.obj \
@@ -334,7 +334,6 @@ SHL4OBJS= \
$(SLO)$/uicategorydescription.obj \
$(SLO)$/uicommanddescription.obj \
$(SLO)$/uiconfigurationmanager.obj \
- $(SLO)$/uiconfigurationmanagerimpl.obj \
$(SLO)$/uielementfactorymanager.obj \
$(SLO)$/urltransformer.obj \
$(SLO)$/vclstatusindicator.obj \
diff --git a/idl/inc/command.hxx b/idl/inc/command.hxx
index 6829edcebe60..fa978119d810 100644
--- a/idl/inc/command.hxx
+++ b/idl/inc/command.hxx
@@ -65,6 +65,7 @@ public:
String aCSVFile;
String aExportFile;
String aDocuFile;
+ UINT32 nVerbosity;
UINT32 nFlags;
SvCommand( int argc, char ** argv );
diff --git a/idl/inc/database.hxx b/idl/inc/database.hxx
index 4d334bba000c..d0e6c92e349e 100644
--- a/idl/inc/database.hxx
+++ b/idl/inc/database.hxx
@@ -39,6 +39,8 @@
/*************************************************************************
*************************************************************************/
+class SvCommand;
+
#ifdef IDL_COMPILER
/******************** class SvIdlError ***********************************/
class SvIdlError
@@ -70,6 +72,7 @@ class SvIdlDataBase
BOOL bExport;
String aExportFile;
sal_uInt32 nUniqueId;
+ sal_uInt32 nVerbosity;
String aDataBaseFile;
SvFileStream * pStm;
BOOL bIsModified;
@@ -96,7 +99,7 @@ protected:
}
#endif
public:
- SvIdlDataBase();
+ explicit SvIdlDataBase( const SvCommand& rCmd );
~SvIdlDataBase();
static BOOL IsBinaryFormat( SvStream & rInStm );
@@ -165,7 +168,7 @@ public:
class SvIdlWorkingBase : public SvIdlDataBase
{
public:
- SvIdlWorkingBase();
+ explicit SvIdlWorkingBase( const SvCommand& rCmd );
BOOL ReadSvIdl( SvTokenStream &, BOOL bImported, const String & rPath );
BOOL WriteSvIdl( SvStream & );
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..29c49199dc30 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",
@@ -258,7 +258,7 @@ static BOOL ResponseFile( StringList * pList, int argc, char ** argv )
|* Beschreibung
*************************************************************************/
SvCommand::SvCommand( int argc, char ** argv )
- : nFlags( 0 )
+ : nVerbosity(1), nFlags( 0 )
{
StringList aList;
@@ -353,6 +353,14 @@ SvCommand::SvCommand( int argc, char ** argv )
{ // Hilfe
printf( "%s", CommandLineSyntax );
}
+ else if( aParam.EqualsIgnoreCaseAscii( "quiet" ) )
+ {
+ nVerbosity = 0;
+ }
+ else if( aParam.EqualsIgnoreCaseAscii( "verbose" ) )
+ {
+ nVerbosity = 2;
+ }
else if( aParam.EqualsIgnoreCaseAscii( "syntax" ) )
{ // Hilfe
int j = 0;
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx
index 8933156bfc69..3c6d07f19921 100644
--- a/idl/source/prj/database.cxx
+++ b/idl/source/prj/database.cxx
@@ -58,9 +58,10 @@ void PrimeNumber(){
}
*/
-SvIdlDataBase::SvIdlDataBase()
+SvIdlDataBase::SvIdlDataBase( const SvCommand& rCmd )
: bExport( FALSE )
, nUniqueId( 0 )
+ , nVerbosity( rCmd.nVerbosity )
, bIsModified( FALSE )
, aPersStream( *IDLAPP->pClassMgr, NULL )
, pIdTable( NULL )
@@ -700,6 +701,7 @@ SvMetaClass * SvIdlDataBase::ReadKnownClass( SvTokenStream & rInStm )
void SvIdlDataBase::Write( const ByteString & rText )
{
#ifndef W31
+ if( nVerbosity != 0 )
fprintf( stdout, "%s", rText.GetBuffer() );
#endif
}
@@ -803,7 +805,7 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm )
|*
|* Beschreibung
*************************************************************************/
-SvIdlWorkingBase::SvIdlWorkingBase()
+SvIdlWorkingBase::SvIdlWorkingBase(const SvCommand& rCmd) : SvIdlDataBase(rCmd)
{
}
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/idl/source/prj/svidl.cxx b/idl/source/prj/svidl.cxx
index 16706e936f30..8ae94ae896f5 100644
--- a/idl/source/prj/svidl.cxx
+++ b/idl/source/prj/svidl.cxx
@@ -112,8 +112,6 @@ int cdecl main ( int argc, char ** argv)
{
#endif
- printf( "StarView Interface Definition Language (IDL) Compiler 3.0\n" );
-
/*
pStr = ::ResponseFile( &aCmdLine, argv, argc );
if( pStr )
@@ -136,8 +134,12 @@ int cdecl main ( int argc, char ** argv)
String aTmpDocuFile;
SvCommand aCommand( argc, argv );
+
+ if( aCommand.nVerbosity != 0 )
+ printf( "StarView Interface Definition Language (IDL) Compiler 3.0\n" );
+
Init();
- SvIdlWorkingBase * pDataBase = new SvIdlWorkingBase();
+ SvIdlWorkingBase * pDataBase = new SvIdlWorkingBase(aCommand);
int nExit = 0;
if( aCommand.aExportFile.Len() )
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 104fb106836c..2925c2a97802 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>
@@ -2061,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:ShowAnnotations" 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 bea53fec2c9d..0dced3ed2f88 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>
@@ -4144,13 +4144,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>
@@ -5127,17 +5134,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/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 e6218530561c..f816a55e93a7 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>
@@ -1657,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>
@@ -2098,7 +2105,7 @@ Dymamic border coloring means that when the mouse is hovered over a control, and
</info>
</set>
</group>
- <group oor:name="Save">
+ <group oor:name="Save">
<info>
<author>MBA</author>
<desc>Contains general settings about the saving process.</desc>
@@ -2358,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">
@@ -2604,6 +2616,19 @@ Dymamic border coloring means that when the mouse is hovered over a control, and
</constraints>
<value>0</value>
</prop>
+ <group oor:name="NewDocumentHandling">
+ <info>
+ <author>CD</author>
+ <desc>Contains settings to change new document window behavior.</desc>
+ </info>
+ <prop oor:name="ForceFocusAndToFront" oor:type="xs:boolean">
+ <info>
+ <author>CD</author>
+ <desc>Every new document window will be forced to front and grabs the focus.</desc>
+ </info>
+ <value>true</value>
+ </prop>
+ </group>
<group oor:name="AppWindow">
<info>
<author>MBA</author>
@@ -6003,7 +6028,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/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..fa9cdaddc1c4 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,11 @@ 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
.INCLUDE : target.mk
+.IF "$(L10N_framework)"==""
ALLTAR: $(MYDBTARGET)
$(MY_GEN_UCR_PATH)$/%.urd: $(MY_GEN_IDL_PATH)$/%.idl
@@ -66,4 +68,4 @@ $(MYDBTARGET) : $(MYURDFILES) $(MYIDLFILES)
$(REGMERGE) $(OUT)$/ucr/constants.db /UCR @$(mktmp $(MYURDFILES))
.ENDIF
-
+.ENDIF
diff --git a/oovbaapi/ooo/vba/makefile.mk b/oovbaapi/ooo/vba/makefile.mk
index ee63d6373feb..99a11e5ac0fa 100644
--- a/oovbaapi/ooo/vba/makefile.mk
+++ b/oovbaapi/ooo/vba/makefile.mk
@@ -41,10 +41,10 @@ PACKAGE=ooo$/vba
.IF "$(ENABLE_VBA)"!="YES"
dummy:
@echo "not building vba..."
-.ENDIF
+.ELSE
# ------------------------------------------------------------------------
-
+.IF "$(L10N_framework)"=""
IDLFILES=\
XErrObject.idl \
XGlobals.idl \
@@ -60,5 +60,6 @@ IDLFILES=\
Globals.idl\
# ------------------------------------------------------------------
-
+.ENDIF
.INCLUDE : target.mk
+.ENDIF
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/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..b1f81aa620d2 100644
--- a/sfx2/inc/pch/precompiled_sfx2.hxx
+++ b/sfx2/inc/pch/precompiled_sfx2.hxx
@@ -484,8 +484,6 @@
#include "sal/config.h"
#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 +540,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 8228bb071e1a..f25760f06282 100644
--- a/sfx2/inc/sfx2/dinfdlg.hxx
+++ b/sfx2/inc/sfx2/dinfdlg.hxx
@@ -450,12 +450,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* );
@@ -484,6 +486,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 -----------------------------------------
@@ -501,12 +504,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/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 17b28c5ab3e6..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,21 +1042,29 @@ 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() );
+ //::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
+ if (!pDoc)
+ {
+ ByteString aTmp( "SfxEvent: ");
+ aTmp += ByteString( String( rEventHint.GetEventName() ), RTL_TEXTENCODING_UTF8 );
+ DBG_TRACE( aTmp.GetBuffer() );
+ }
+#endif
Broadcast(rEventHint);
if ( pDoc )
pDoc->Broadcast( rEventHint );
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 85f38abf284c..c6cb16f8f3f6 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -311,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 );
@@ -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/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index 0de25b0c7503..91227e3e34ec 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -43,8 +43,6 @@
#include <unotools/localfilehelper.hxx>
#include <cppuhelper/implbase1.hxx>
-#include <shell/systemshell.hxx>
-
// ----------------------------------------------------------------------------
#include <sfx2/app.hxx>
@@ -470,7 +468,7 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
pDocSh->Get_Impl()->bWaitingForPicklist = sal_False;
if ( aURL.GetProtocol() == INET_PROT_FILE )
- SystemShell::AddToRecentDocumentList( aURL.GetURLNoPass( INetURLObject::NO_DECODE ), (pFilter) ? pFilter->GetMimeType() : String() );
+ Application::AddToRecentDocumentList( aURL.GetURLNoPass( INetURLObject::NO_DECODE ), (pFilter) ? pFilter->GetMimeType() : String() );
}
break;
}
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/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 4d5417864004..fb5156a1f182 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -901,7 +901,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 )
{
@@ -1630,7 +1630,7 @@ CustomPropertiesWindow::CustomPropertiesWindow( Window* pParent, const ResId& rR
m_aTimeField ( this, SfxResId( SFX_FLD_TIME) ),
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() )
@@ -1704,6 +1704,8 @@ IMPL_LINK( CustomPropertiesWindow, RemoveHdl, CustomPropertiesRemoveButton*, pBu
}
}
}
+
+ m_aRemovedHdl.Call(0);
return 0;
}
@@ -1891,6 +1893,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++;
@@ -1995,10 +1998,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 )
@@ -2136,6 +2141,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();
@@ -2151,7 +2157,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()
@@ -2171,10 +2177,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 -----------------------------------------
@@ -2195,7 +2211,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;
}
@@ -2245,7 +2261,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 f31ed1724907..cf7d04ef0875 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -236,7 +236,8 @@ SfxDockingWrapper::SfxDockingWrapper( Window* pParentWnd ,
}
Window* pContentWindow = VCLUnoHelper::GetWindow(xWindow);
- pContentWindow->SetStyle( pContentWindow->GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL );
+ if ( pContentWindow )
+ 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 d8989c6a21ea..5a0d2f4a69a0 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -467,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 )
@@ -550,40 +575,6 @@ void FileDialogHelper_Impl::updateSelectionBox()
}
// ------------------------------------------------------------------------
-
-namespace {
-
-bool lclCheckMSPasswordCapability( const String rFilterName )
-{
- return rFilterName.EqualsAscii("MS Word 97");
-}
-
-} // namespace
-
-// ------------------------------------------------------------------------
-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() ) )
- || lclCheckMSPasswordCapability( _pFilter->GetFilterName() );
- }
-};
-
-// ------------------------------------------------------------------------
void FileDialogHelper_Impl::enablePasswordBox( sal_Bool bInit )
{
if ( ! mbHasPassword )
@@ -593,7 +584,7 @@ void FileDialogHelper_Impl::enablePasswordBox( sal_Bool bInit )
mbIsPwdEnabled = updateExtendedControl(
ExtendedFilePickerElementIds::CHECKBOX_PASSWORD,
- CheckPasswordCapability()( getCurentSfxFilter() )
+ lclCheckPasswordCapability( getCurentSfxFilter() )
);
if( bInit )
@@ -1665,9 +1656,8 @@ 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.
-
- bool bMSType = lclCheckMSPasswordCapability( rFilter );
+ // 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;
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 c46a467fa41d..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
@@ -1227,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 );
@@ -1308,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..21515b2c6f3d 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>
@@ -99,7 +100,6 @@
#include <sot/storinfo.hxx>
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
-#include <shell/systemshell.hxx>
#include <comphelper/storagehelper.hxx>
#include <comphelper/seqstream.hxx>
#include <comphelper/documentconstants.hxx>
@@ -136,6 +136,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 +370,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 +521,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 +665,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() )
@@ -821,7 +830,7 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
if ( aUrl.GetProtocol() == INET_PROT_FILE )
{
const SfxFilter* pOrgFilter = pMedium->GetOrigFilter();
- SystemShell::AddToRecentDocumentList(
+ Application::AddToRecentDocumentList(
aUrl.GetURLNoPass( INetURLObject::NO_DECODE ),
(pOrgFilter) ? pOrgFilter->GetMimeType() : String() );
}
@@ -1169,7 +1178,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 +1189,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 +1208,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 +1478,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 +1600,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 +1791,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 +3256,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 +3416,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 26ba76517d8c..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>
@@ -251,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 )
@@ -265,6 +265,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,m_bCreateTempStor( sal_False )
,m_xDocInfoListener()
,m_bIsInit( sal_False )
+ ,m_bIncomplEncrWarnShown( sal_False )
{
}
@@ -368,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 )
@@ -581,7 +582,8 @@ sal_uInt16 SfxObjectShell::PrepareClose
}
}
- SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEDOC, this) );
+ SfxApplication *pSfxApp = SFX_APP();
+ pSfxApp->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEDOC, GlobalEventConfig::GetEventName(STR_EVENT_PREPARECLOSEDOC), this) );
if( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
{
@@ -886,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 )
@@ -898,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;
}
}
@@ -987,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 )
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index d4b0b3aaf7ab..03e6e9170153 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1614,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;
@@ -1645,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
{
@@ -1660,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 );
}
@@ -2546,7 +2544,7 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
impl_getPrintHelper();
}
- postEvent_Impl( pNamedHint->GetEventId() );
+ postEvent_Impl( pNamedHint->GetEventName() );
}
if ( pSimpleHint )
@@ -2555,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
@@ -2760,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() );
@@ -2850,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 );
}
}
@@ -2870,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
@@ -2883,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 );
@@ -2893,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 c3c1e83f2aba..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)
{
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..97f86ee1f395 100644
--- a/sfx2/source/view/viewimp.hxx
+++ b/sfx2/source/view/viewimp.hxx
@@ -45,6 +45,10 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <svtools/acceleratorexecute.hxx>
+#include <rtl/ref.hxx>
+
+#include <queue>
+
// forward ---------------------------------------------------------------
class SfxOfficeDispatch;
@@ -54,6 +58,22 @@ 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 );
+};
+
+class SfxClipboardChangeListener;
struct SfxViewShell_Impl
{
@@ -78,12 +98,11 @@ struct SfxViewShell_Impl
USHORT nFamily;
SfxBaseController* pController;
::svt::AcceleratorExecute* pAccExec;
+ SfxAsyncPrintExec_Impl* pPrinterCommandQueue;
com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aPrintOpts;
+ ::rtl::Reference< SfxClipboardChangeListener > xClipboardListener;
- SfxViewShell_Impl()
- : aInterceptorContainer( aMutex )
- , pAccExec(0)
- {}
+ SfxViewShell_Impl();
};
#endif
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..f6053a467ed4 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,70 @@ 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();
+
+ void DisconnectViewShell() { pViewShell = NULL; }
+};
+
+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 )
@@ -176,7 +243,12 @@ static ::rtl::OUString RetrieveLabelFromCommand(
}
//=========================================================================
+SfxViewShell_Impl::SfxViewShell_Impl()
+: aInterceptorContainer( aMutex )
+, pAccExec(0)
+{}
+//=========================================================================
SFX_IMPL_INTERFACE(SfxViewShell,SfxShell,SfxResId(0))
{
SFX_CHILDWINDOW_REGISTRATION( SID_MAIL_CHILDWIN );
@@ -687,6 +759,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 +793,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 +1261,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));
@@ -1229,19 +1304,27 @@ SfxViewShell::~SfxViewShell()
SfxViewShellArr_Impl &rViewArr = SFX_APP()->GetViewShells_Impl();
rViewArr.Remove( rViewArr.GetPos(pThis) );
+ if ( pImp->xClipboardListener.is() )
+ {
+ pImp->xClipboardListener->DisconnectViewShell();
+ pImp->xClipboardListener = NULL;
+ }
+
if ( pImp->pController )
{
pImp->pController->ReleaseShell_Impl();
pImp->pController->release();
+ pImp->pController = NULL;
}
if (pImp->pAccExec)
{
- delete pImp->pAccExec;
- pImp->pAccExec = 0;
+ DELETEZ( pImp->pAccExec );
}
- delete pImp;
- delete pIPClientList;
+
+ DELETEZ( pImp->pPrinterCommandQueue );
+ DELETEZ( pImp );
+ DELETEZ( pIPClientList );
}
//--------------------------------------------------------------------
@@ -1926,6 +2009,13 @@ void SfxViewShell::SetController( SfxBaseController* pController )
pImp->pController = pController;
pImp->pController->acquire();
pImp->bControllerSet = TRUE;
+
+ // there should be no old listener, but if there is one, it should be disconnected
+ if ( pImp->xClipboardListener.is() )
+ pImp->xClipboardListener->DisconnectViewShell();
+
+ pImp->xClipboardListener = new SfxClipboardChangeListener( this );
+ AddRemoveClipboardListener( pImp->xClipboardListener.get(), TRUE );
}
Reference < XController > SfxViewShell::GetController()
@@ -2128,3 +2218,28 @@ BOOL SfxViewShell::Escape()
{
return GetViewFrame()->GetBindings().Execute( SID_TERMINATE_INPLACEACTIVATION );
}
+
+void SfxViewShell::AddRemoveClipboardListener( const uno::Reference < datatransfer::clipboard::XClipboardListener >& rClp, BOOL bAdd )
+{
+ try
+ {
+ if ( GetViewFrame() )
+ {
+ uno::Reference< datatransfer::clipboard::XClipboard > xClipboard( GetViewFrame()->GetWindow().GetClipboard() );
+ if( xClipboard.is() )
+ {
+ 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..10b70b1a1374 100644
--- a/sfx2/util/makefile.mk
+++ b/sfx2/util/makefile.mk
@@ -91,14 +91,12 @@ SHL1STDLIBS+=\
$(TOOLSLIB) \
$(I18NISOLANGLIB) \
$(SAXLIB) \
- $(SYSSHELLLIB) \
$(COMPHELPERLIB) \
$(UCBHELPERLIB) \
$(CPPUHELPERLIB) \
$(CPPULIB) \
$(VOSLIB) \
$(SALLIB) \
- $(SJLIB) \
$(LIBXML2LIB) \
diff --git a/shell/inc/systemshell.hxx b/shell/inc/systemshell.hxx
deleted file mode 100644
index fa679953e5c9..000000000000
--- a/shell/inc/systemshell.hxx
+++ /dev/null
@@ -1,53 +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: systemshell.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 _SYSTEMSHELL_HXX_
-#define _SYSTEMSHELL_HXX_
-
-#include <rtl/ustring.hxx>
-
-namespace SystemShell
-{
- /** Add a file to the system shells recent document list if there is any.
- This function may have no effect under Unix because there is no
- standard API among the different desktop managers.
-
- @param aFileUrl
- The file url of the document.
-
- @param aMimeType
- The mime content type of the document specified by aFileUrl.
- If an empty string will be provided "application/octet-stream"
- will be used.
- */
- void AddToRecentDocumentList(const rtl::OUString& aFileUrl, const rtl::OUString& aMimeType);
-}
-
-#endif
diff --git a/shell/prj/build.lst b/shell/prj/build.lst
index 7a2e91f973ba..ed4fbca7e3f5 100644
--- a/shell/prj/build.lst
+++ b/shell/prj/build.lst
@@ -10,9 +10,6 @@ sl shell\source\cmdmail nmake - u sl_cmdmail sl
sl shell\source\cmdmail nmake - p sl_cmdmail sl_inc NULL
sl shell\source\all nmake - all sl_all sl_inc NULL
sl shell\source\unix\sysshell nmake - u sl_unix_sysshell sl_all sl_inc NULL
-sl shell\source\aqua\sysshell nmake - u sl_aqua_sysshell sl_all sl_inc NULL
-sl shell\source\win32\sysshell nmake - w sl_win32_sysshell sl_inc NULL
-sl shell\source\os2\sysshell nmake - p sl_os2_sysshell sl_inc NULL
sl shell\source\tools\lngconvex nmake - w sl_win32_lngconv sl_inc NULL
sl shell\source\tools\regsvrex nmake - w sl_win32_regsvrex sl_inc NULL
sl shell\source\all\zipfile nmake - w sl_all_zipfile sl_inc NULL
diff --git a/shell/prj/d.lst b/shell/prj/d.lst
index 542d6c62eaa5..98d4a6215faf 100644
--- a/shell/prj/d.lst
+++ b/shell/prj/d.lst
@@ -1,7 +1,3 @@
-mkdir: %_DEST%\inc%_EXT%\shell
-
-..\inc\*.hxx %_DEST%\inc%_EXT%\shell\*.hxx
-
..\%__SRC%\slb\*.lib %_DEST%\lib%_EXT%\*.lib
..\%__SRC%\slb\*.a %_DEST%\lib%_EXT%\*.a
..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%
diff --git a/shell/source/aqua/sysshell/makefile.mk b/shell/source/aqua/sysshell/makefile.mk
deleted file mode 100644
index a748e00c154e..000000000000
--- a/shell/source/aqua/sysshell/makefile.mk
+++ /dev/null
@@ -1,62 +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=shell
-TARGET=sysshell
-LIBTARGET=NO
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-OBJCXXFLAGS=-x objective-c++ -fobjc-exceptions
-CFLAGSCXX+=$(OBJCXXFLAGS)
-
-# --- Files --------------------------------------------------------
-
-.IF "$(OS)" == "MACOSX"
-
-LIB1OBJFILES=$(SLO)$/systemshell.obj
-LIB1TARGET=$(SLB)$/$(TARGET).lib
-LIB1ARCHIV=$(SLB)$/lib$(TARGET).a
-
-.ELSE
-
-dummy:
- @echo "Nothing to build for $(OS)"
-
-.ENDIF # MACOSX
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/shell/source/aqua/sysshell/systemshell.cxx b/shell/source/aqua/sysshell/systemshell.cxx
deleted file mode 100644
index a9b4afe1a966..000000000000
--- a/shell/source/aqua/sysshell/systemshell.cxx
+++ /dev/null
@@ -1,101 +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: systemshell.cxx,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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "systemshell.hxx"
-
-#include <comphelper/processfactory.hxx>
-
-#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_Hpp_
-#include <com/sun/star/beans/XPropertySet.hpp>
-#endif
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/uri/XExternalUriReferenceTranslator.hpp>
-#include <com/sun/star/uri/ExternalUriReferenceTranslator.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-
-#include <premac.h>
-#include <Cocoa/Cocoa.h>
-#include <postmac.h>
-
-using namespace ::com::sun::star;
-
-// We need to re-encode file urls because osl_getFileURLFromSystemPath converts
-// to UTF-8 before encoding non ascii characters, which is not what other apps expect.
-static rtl::OUString translateToExternalUrl(const rtl::OUString& internalUrl)
-{
- rtl::OUString extUrl;
-
- uno::Reference< lang::XMultiServiceFactory > sm = comphelper::getProcessServiceFactory();
- if (sm.is())
- {
- uno::Reference< beans::XPropertySet > pset;
- sm->queryInterface( getCppuType( &pset )) >>= pset;
- if (pset.is())
- {
- uno::Reference< uno::XComponentContext > context;
- static const rtl::OUString DEFAULT_CONTEXT( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) );
- pset->getPropertyValue(DEFAULT_CONTEXT) >>= context;
- if (context.is())
- extUrl = uri::ExternalUriReferenceTranslator::create(context)->translateToExternal(internalUrl);
- }
- }
- return extUrl;
-}
-
-namespace SystemShell {
-
- //##############################
- 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() )
- {
- NSString* pString = [[NSString alloc] initWithCharacters: externalUrl.getStr() length: externalUrl.getLength()];
- NSURL* pURL = [NSURL URLWithString: pString];
-
- if( pURL )
- {
- NSDocumentController* pCtrl = [NSDocumentController sharedDocumentController];
- [pCtrl noteNewRecentDocumentURL: pURL];
- }
- if( pString )
- [pString release];
-
- }
- }
-
-} // namespace SystemShell
-
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/os2/sysshell/makefile.mk b/shell/source/os2/sysshell/makefile.mk
deleted file mode 100644
index bda4958cef02..000000000000
--- a/shell/source/os2/sysshell/makefile.mk
+++ /dev/null
@@ -1,47 +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.11 $
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General 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=sysshell
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/systemshell.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/shell/source/os2/sysshell/systemshell.cxx b/shell/source/os2/sysshell/systemshell.cxx
deleted file mode 100644
index c47ac86eca20..000000000000
--- a/shell/source/os2/sysshell/systemshell.cxx
+++ /dev/null
@@ -1,68 +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: systemshell.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_shell.hxx"
-
-#ifndef _SYSTEMSHELL_HXX_
-#include "../../../inc/systemshell.hxx"
-#endif
-
-#ifndef _OSL_DIAGNOSE_H_
-#include <osl/diagnose.h>
-#endif
-
-#ifndef _OSL_FILE_HXX_
-#include <osl/file.hxx>
-#endif
-
-namespace SystemShell
-{
-
- /** Add a file to the system shells recent document list if there is any.
- This function may have no effect under Unix because there is no
- standard API among the different desktop managers.
-
- @param aFileUrl
- The file url of the document.
- */
- void AddToRecentDocumentList(const rtl::OUString& aFileUrl, const rtl::OUString& aMimeType)
- {
- rtl::OUString system_path;
- osl::FileBase::RC rc = osl::FileBase::getSystemPathFromFileURL(aFileUrl, system_path);
-
- OSL_ENSURE(osl::FileBase::E_None == rc, "Invalid file url");
-
- //if (osl::FileBase::E_None == rc)
- // SHAddToRecentDocs(SHARD_PATHW, system_path.getStr());
- }
-
-}; // end namespace SystemShell
-
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/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/unix/sysshell/makefile.mk b/shell/source/unix/sysshell/makefile.mk
index 8089b160fb6c..2c1ace9fe187 100644
--- a/shell/source/unix/sysshell/makefile.mk
+++ b/shell/source/unix/sysshell/makefile.mk
@@ -48,10 +48,6 @@ CFLAGS+=-DSYSTEM_EXPAT
.IF "$(OS)" != "MACOSX"
-LIB1OBJFILES=$(SLO)$/systemshell.obj
-LIB1TARGET=$(SLB)$/$(TARGET).lib
-LIB1ARCHIV=$(SLB)$/lib$(TARGET).a
-
SLOFILES=$(SLO)$/recently_used_file.obj \
$(SLO)$/recently_used_file_handler.obj
diff --git a/shell/source/unix/sysshell/recently_used_file_handler.cxx b/shell/source/unix/sysshell/recently_used_file_handler.cxx
index 55f95b6e3521..faf8118d7f8d 100644
--- a/shell/source/unix/sysshell/recently_used_file_handler.cxx
+++ b/shell/source/unix/sysshell/recently_used_file_handler.cxx
@@ -31,7 +31,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_shell.hxx"
-#include "systemshell.hxx"
#include "osl/process.h"
#include "rtl/ustring.hxx"
#include "rtl/string.hxx"
diff --git a/shell/source/unix/sysshell/systemshell.cxx b/shell/source/unix/sysshell/systemshell.cxx
deleted file mode 100644
index 85477f12921e..000000000000
--- a/shell/source/unix/sysshell/systemshell.cxx
+++ /dev/null
@@ -1,151 +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: systemshell.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_shell.hxx"
-#include "systemshell.hxx"
-
-#include <comphelper/processfactory.hxx>
-
-#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_Hpp_
-#include <com/sun/star/beans/XPropertySet.hpp>
-#endif
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/uri/XExternalUriReferenceTranslator.hpp>
-#include <com/sun/star/uri/ExternalUriReferenceTranslator.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-
-#include "osl/module.hxx"
-
-using namespace ::com::sun::star;
-
-#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
-
-const rtl::OUString SYM_ADD_TO_RECENTLY_USED_FILE_LIST = UNISTRING("add_to_recently_used_file_list");
-const rtl::OUString LIB_RECENT_FILE = UNISTRING("librecentfile.so");
-const rtl::OUString DEFAULT_CONTEXT = UNISTRING("DefaultContext");
-
-void * (* sym_gtk_recent_manager_get_default) () = NULL;
-void (* sym_gtk_recent_manager_add_item) (void *, const char *) = NULL;
-
-// We need to re-encode file urls because osl_getFileURLFromSystemPath converts
-// to UTF-8 before encoding non ascii characters, which is not what other apps expect.
-static rtl::OUString translateToExternalUrl(const rtl::OUString& internalUrl)
-{
- rtl::OUString extUrl;
-
- uno::Reference< lang::XMultiServiceFactory > sm = comphelper::getProcessServiceFactory();
- if (sm.is())
- {
- uno::Reference< beans::XPropertySet > pset;
- sm->queryInterface( getCppuType( &pset )) >>= pset;
- if (pset.is())
- {
- uno::Reference< uno::XComponentContext > context;
- pset->getPropertyValue(DEFAULT_CONTEXT) >>= context;
- if (context.is())
- extUrl = uri::ExternalUriReferenceTranslator::create(context)->translateToExternal(internalUrl);
- }
- }
- return extUrl;
-}
-
-namespace SystemShell {
-
- typedef void (*PFUNC_ADD_TO_RECENTLY_USED_LIST)(const rtl::OUString&, const rtl::OUString&);
-
- //##############################
- rtl::OUString get_absolute_library_url(const rtl::OUString& /*lib_name*/)
- {
- rtl::OUString url;
- if (osl::Module::getUrlFromAddress(reinterpret_cast<oslGenericFunction>(AddToRecentDocumentList), url))
- {
- sal_Int32 index = url.lastIndexOf('/');
- url = url.copy(0, index + 1);
- url += LIB_RECENT_FILE;
- }
- return url;
- }
-
- bool init_recent_manager_api()
- {
- oslModule hDefault;
- if( osl_getModuleHandle( NULL, &hDefault ) )
- {
- sym_gtk_recent_manager_get_default = (void * (*)())
- osl_getAsciiFunctionSymbol(hDefault, "gtk_recent_manager_get_default");
- sym_gtk_recent_manager_add_item = (void (*)(void *, const char *))
- osl_getAsciiFunctionSymbol(hDefault, "gtk_recent_manager_add_item");
-
- }
- bool ret = (NULL != sym_gtk_recent_manager_get_default) && (NULL != sym_gtk_recent_manager_add_item);
- return ret;
- }
-
-
- //##############################
- void AddToRecentDocumentList(const rtl::OUString& aFileUrl, const rtl::OUString& aMimeType)
- {
- static bool bIsRecentManagerPresent = init_recent_manager_api();
-
- // Convert file URL for external use (see above)
- rtl::OUString externalUrl = translateToExternalUrl(aFileUrl);
- if( 0 == externalUrl.getLength() )
- externalUrl = aFileUrl;
-
- if( bIsRecentManagerPresent )
- {
- void * recent_manager = sym_gtk_recent_manager_get_default();
- sym_gtk_recent_manager_add_item(recent_manager, rtl::OUStringToOString(aFileUrl, RTL_TEXTENCODING_UTF8).getStr());
- }
- else
- {
- rtl::OUString librecentfile_url = get_absolute_library_url(LIB_RECENT_FILE);
-
- if (librecentfile_url.getLength())
- {
- osl::Module module(librecentfile_url);
-
- if (module.is())
- {
- // convert from reinterpret_cast<PFUNC_ADD_TO_RECENTLY_USED_LIST>
- // not allowed in gcc 3.3 without permissive.
- PFUNC_ADD_TO_RECENTLY_USED_LIST add_to_recently_used_file_list =
- reinterpret_cast<PFUNC_ADD_TO_RECENTLY_USED_LIST>(module.getFunctionSymbol(SYM_ADD_TO_RECENTLY_USED_FILE_LIST));
-
- if (add_to_recently_used_file_list)
- add_to_recently_used_file_list(aFileUrl, aMimeType);
- }
- }
- }
- }
-
-} // namespace SystemShell
-
diff --git a/shell/source/win32/sysshell/makefile.mk b/shell/source/win32/sysshell/makefile.mk
deleted file mode 100644
index 698566641423..000000000000
--- a/shell/source/win32/sysshell/makefile.mk
+++ /dev/null
@@ -1,50 +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.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=sysshell
-LIBTARGET=NO
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-LIB1OBJFILES=$(SLO)$/systemshell.obj
-LIB1TARGET= $(SLB)$/$(TARGET).lib
-LIB1ARCHIV= $(SLB)$/lib$(TARGET).a
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/shell/source/win32/sysshell/systemshell.cxx b/shell/source/win32/sysshell/systemshell.cxx
deleted file mode 100644
index fe6409cadf22..000000000000
--- a/shell/source/win32/sysshell/systemshell.cxx
+++ /dev/null
@@ -1,68 +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: systemshell.cxx,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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "../../../inc/systemshell.hxx"
-#include <osl/diagnose.h>
-#include <osl/file.hxx>
-
-#if defined _MSC_VER
-#pragma warning(push, 1)
-#pragma warning(disable:4917)
-#endif
-#include <Shlobj.h>
-#if defined _MSC_VER
-#pragma warning(pop)
-#endif
-
-namespace SystemShell
-{
-
- /** Add a file to the system shells recent document list if there is any.
- This function may have no effect under Unix because there is no
- standard API among the different desktop managers.
-
- @param aFileUrl
- The file url of the document.
- */
- void AddToRecentDocumentList(const rtl::OUString& aFileUrl, const rtl::OUString& /*aMimeType*/)
- {
- rtl::OUString system_path;
- osl::FileBase::RC rc = osl::FileBase::getSystemPathFromFileURL(aFileUrl, system_path);
-
- OSL_ENSURE(osl::FileBase::E_None == rc, "Invalid file url");
-
- if (osl::FileBase::E_None == rc)
- SHAddToRecentDocs(SHARD_PATHW, system_path.getStr());
- }
-
-}; // end namespace SystemShell
-
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/AppletViewerFactory.java b/sj2/stardiv/app/AppletViewerFactory.java
deleted file mode 100644
index da73f0648187..000000000000
--- a/sj2/stardiv/app/AppletViewerFactory.java
+++ /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: AppletViewerFactory.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.
- *
- ************************************************************************/
-
-/*
- * AppletViewerFactory.java
- */
-
-package stardiv.app;
-
-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();
-}
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/galobj.hxx b/svx/inc/galobj.hxx
index ce2b481bdcdf..a33a1b5cbd81 100644
--- a/svx/inc/galobj.hxx
+++ b/svx/inc/galobj.hxx
@@ -85,7 +85,7 @@ enum GalSoundType
// - SgaObject -
// -------------
-class SgaObject
+class SVX_DLLPUBLIC SgaObject
{
friend class GalleryTheme;
@@ -122,8 +122,8 @@ public:
BOOL IsValid() const { return bIsValid; }
BOOL IsThumbBitmap() const { return bIsThumbBmp; }
- SVX_DLLPUBLIC const String GetTitle() const;
- SVX_DLLPUBLIC void SetTitle( const String& rTitle );
+ const String GetTitle() const;
+ 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/optgenrl.hrc b/svx/inc/optgenrl.hrc
index b6f191aaea07..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
diff --git a/svx/inc/svx/dialogs.hrc b/svx/inc/svx/dialogs.hrc
index 1d78c5e6396e..6e6162ef61f2 100644
--- a/svx/inc/svx/dialogs.hrc
+++ b/svx/inc/svx/dialogs.hrc
@@ -600,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)
@@ -1238,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)
@@ -1369,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/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 248a31dcf71f..603a6831fe30 100644
--- a/svx/inc/svx/msdffimp.hxx
+++ b/svx/inc/svx/msdffimp.hxx
@@ -481,6 +481,7 @@ public:
MSFilterTracer* mpTracer;
sal_Bool mbTracing;
+ Color MSO_TEXT_CLR_ToColor( sal_uInt32 nColorCode ) const;
Color MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nContextProperty = DFF_Prop_lineColor ) const;
virtual BOOL SeekToShape( SvStream& rSt, void* pClientData, UINT32 nId ) const;
FASTBOOL SeekToRec( SvStream& rSt, USHORT nRecId, ULONG nMaxFilePos, DffRecordHeader* pRecHd = NULL, ULONG nSkipCount = 0 ) const;
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/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/viewobjectcontactofunocontrol.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx
index 27359ebf9738..87a1de55ec0a 100644
--- a/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx
+++ b/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx
@@ -65,6 +65,8 @@ namespace sdr { namespace contact {
::rtl::Reference< ViewObjectContactOfUnoControl_Impl > m_pImpl;
public:
+ ViewObjectContactOfUnoControl( ObjectContact& _rObjectContact, ViewContactOfUnoControl& _rViewContact );
+
/// determines whether an XControl already exists, and is currently visible
bool isControlVisible() const;
@@ -98,7 +100,6 @@ namespace sdr { namespace contact {
virtual void ActionChanged();
protected:
- ViewObjectContactOfUnoControl( ObjectContact& _rObjectContact, ViewContactOfUnoControl& _rViewContact );
~ViewObjectContactOfUnoControl();
// support for Primitive2D
@@ -111,36 +112,6 @@ namespace sdr { namespace contact {
};
//====================================================================
- //= UnoControlDefaultContact
- //====================================================================
- class SVX_DLLPRIVATE UnoControlDefaultContact : public ViewObjectContactOfUnoControl
- {
- public:
- UnoControlDefaultContact( ObjectContact& _rObjectContact, ViewContactOfUnoControl& _rViewContact );
- ~UnoControlDefaultContact();
-
- private:
- UnoControlDefaultContact(); // never implemented
- UnoControlDefaultContact( const UnoControlDefaultContact& ); // never implemented
- UnoControlDefaultContact& operator=( const UnoControlDefaultContact& ); // never implemented
- };
-
- //====================================================================
- //= UnoControlWindowContact
- //====================================================================
- class SVX_DLLPRIVATE UnoControlWindowContact : public ViewObjectContactOfUnoControl
- {
- public:
- UnoControlWindowContact( ObjectContactOfPageView& _rObjectContact, ViewContactOfUnoControl& _rViewContact );
- ~UnoControlWindowContact();
-
- private:
- UnoControlWindowContact(); // never implemented
- UnoControlWindowContact( const UnoControlWindowContact& ); // never implemented
- UnoControlWindowContact& operator=( const UnoControlWindowContact& ); // never implemented
- };
-
- //====================================================================
//= UnoControlPrintOrPreviewContact
//====================================================================
class SVX_DLLPRIVATE UnoControlPrintOrPreviewContact : public ViewObjectContactOfUnoControl
@@ -157,21 +128,6 @@ namespace sdr { namespace contact {
virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo ) const;
};
- //====================================================================
- //= UnoControlPDFExportContact
- //====================================================================
- class SVX_DLLPRIVATE UnoControlPDFExportContact : public ViewObjectContactOfUnoControl
- {
- public:
- UnoControlPDFExportContact( ObjectContactOfPageView& _rObjectContact, ViewContactOfUnoControl& _rViewContact );
- ~UnoControlPDFExportContact();
-
- private:
- UnoControlPDFExportContact(); // never implemented
- UnoControlPDFExportContact( const UnoControlPDFExportContact& ); // never implemented
- UnoControlPDFExportContact& operator=( const UnoControlPDFExportContact& ); // never implemented
- };
-
//........................................................................
} } // namespace sdr::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/overlayselection.hxx b/svx/inc/svx/sdr/overlay/overlayselection.hxx
index fe725a577eec..17f32ee419e9 100644
--- a/svx/inc/svx/sdr/overlay/overlayselection.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayselection.hxx
@@ -78,7 +78,7 @@ namespace sdr
virtual ~OverlaySelection();
// data read access
- const OverlayType getOverlayType() const { return meOverlayType; }
+ OverlayType getOverlayType() const { return meOverlayType; }
const std::vector< basegfx::B2DRange >& getRanges() const { return maRanges; }
bool getBorder() const { return mbBorder; }
diff --git a/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx b/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx
index 798e5b53d6de..0f46c2809597 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx
@@ -75,7 +75,8 @@ namespace drawinglayer
const attribute::SdrTextAttribute& rText,
const attribute::SdrLineAttribute* pStroke,
bool bCellText,
- bool bWordWrap);
+ bool bWordWrap,
+ bool bClipOnBounds);
Primitive2DSequence createEmbeddedShadowPrimitive(
const Primitive2DSequence& rContent,
diff --git a/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx
index 6dd60b45d2d5..059849531566 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,10 +210,16 @@ 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
+ unsigned mbClipOnBounds : 1; // for CustomShapes text layout
protected:
// local decomposition.
@@ -231,15 +230,23 @@ namespace drawinglayer
const SdrText* pSdrText,
const OutlinerParaObject& rOutlinerParaObjectPtr,
const basegfx::B2DHomMatrix& rTextRangeTransform,
+ SdrTextHorzAdjust aSdrTextHorzAdjust,
+ SdrTextVertAdjust aSdrTextVertAdjust,
+ bool bFixedCellHeight,
bool bUnlimitedPage,
bool bCellText,
- bool bWordWrap);
+ bool bWordWrap,
+ bool bClipOnBounds);
// 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; }
+ bool getClipOnBounds() const { return mbClipOnBounds; }
// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
@@ -265,6 +272,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 +283,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/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/svdotext.hxx b/svx/inc/svx/svdotext.hxx
index 5298fc2dd79b..6ffa4ab5bd22 100644
--- a/svx/inc/svx/svdotext.hxx
+++ b/svx/inc/svx/svdotext.hxx
@@ -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/svxids.hrc b/svx/inc/svx/svxids.hrc
index 6019c3590d55..4e3b1ebf4889 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)
@@ -1178,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 )
@@ -1351,9 +1349,19 @@
#define SID_CHAR_DLG_PREVIEW_STRING (SID_SVX_START+1090)
#define SID_RECHECK_DOCUMENT (SID_SVX_START+1091)
#define SID_ATTR_PARA_OUTLINE_LEVEL (SID_SVX_START+1092)
+#define SID_OBJECT_MIRROR (SID_SVX_START+1093)
+
+#define SID_DELETE_POSTIT (SID_SVX_START+1094)
+#define SID_NEXT_POSTIT (SID_SVX_START+1095)
+#define SID_PREVIOUS_POSTIT (SID_SVX_START+1096)
+#define SID_DELETEALL_POSTIT (SID_SVX_START+1097)
+#define SID_SHOW_POSTIT (SID_SVX_START+1098)
+#define SID_REPLYTO_POSTIT (SID_SVX_START+1099)
+#define SID_DELETEALLBYAUTHOR_POSTIT (SID_SVX_START+1100)
+#define SID_INSERT_POSTIT (SID_SVX_START+1101)
// IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
-#define SID_SVX_FIRSTFREE SID_ATTR_PARA_OUTLINE_LEVEL + 1
+#define SID_SVX_FIRSTFREE SID_INSERT_POSTIT + 1
// --------------------------------------------------------------------------
// Overflow check for slot IDs
diff --git a/svx/prj/build.lst b/svx/prj/build.lst
index 56980702fb2d..2f595a2de9d7 100644
--- a/svx/prj/build.lst
+++ b/svx/prj/build.lst
@@ -22,7 +22,7 @@ sx svx\source\svdraw nmake - all sx_draw sx_inc NULL
sx svx\source\sdr\attribute nmake - all sx_attribute sx_inc NULL
sx svx\source\sdr\primitive2d nmake - all sx_primitive2d sx_inc NULL
sx svx\source\sdr\primitive3d nmake - all sx_primitive3d sx_inc NULL
-sx svx\source\table nmake - all sx_table NULL
+sx svx\source\table nmake - all sx_table sx_inc NULL
sx svx\source\sdr\properties nmake - all sx_properties sx_inc NULL
sx svx\source\sdr\contact nmake - all sx_contact sx_inc NULL
sx svx\source\sdr\event nmake - all sx_event sx_inc NULL
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 3c819229ee4c..e3826708c196 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -1974,34 +1974,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
[
@@ -3797,7 +3769,7 @@ SfxObjectItem FmFilterNavigatorController SID_FM_FILTER_NAVIGATOR_CONTROL
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -4806,7 +4778,7 @@ SfxStringListItem GetRedoStrings SID_GETREDOSTRINGS
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = TRUE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -4833,7 +4805,7 @@ SfxStringListItem GetUndoStrings SID_GETUNDOSTRINGS
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = TRUE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -5982,6 +5954,185 @@ SfxVoidItem InsertAnnotation SID_INSERT_POSTIT
]
//--------------------------------------------------------------------------
+SfxBoolItem ShowAnnotations 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,
@@ -7493,7 +7644,7 @@ SfxVoidItem OutlineBullet SID_OUTLINE_BULLET
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = TRUE,
@@ -8475,7 +8626,7 @@ SfxBoolItem ReadOnlyMode SID_READONLY_MODE
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = TRUE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -9347,7 +9498,7 @@ SfxVoidItem Select SID_SELECT
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
@@ -10951,7 +11102,7 @@ SfxBoolItem TwainSelect SID_TWAIN_SELECT
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = TRUE,
@@ -10976,7 +11127,7 @@ SfxVoidItem TwainTransfer SID_TWAIN_TRANSFER
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = TRUE,
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/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
index 6420a14c98ae..15da06a17054 100644
--- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx
+++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
@@ -340,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/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/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/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 31fcff220f8a..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>
@@ -1277,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
@@ -1340,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 );
- // insert SYSTEM entry, no specific currency
- aCurrencyLB.InsertEntry( aStr );
+ aLocaleSettingLB.SetLanguageList( LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, FALSE, FALSE, FALSE);
+ aLocaleSettingLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::WEAK );
+
+ 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 )
@@ -1572,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 );
@@ -1581,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;
}
}
@@ -1592,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 );
@@ -1601,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;
}
}
@@ -1612,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 );
@@ -1621,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;
}
}
@@ -1721,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&)
{
@@ -1739,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.src b/svx/source/cui/optgdlg.src
index a711be6bf0fc..f663a7ed44ef 100644
--- a/svx/source/cui/optgdlg.src
+++ b/svx/source/cui/optgdlg.src
@@ -460,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 ;
@@ -481,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 ;
@@ -496,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
@@ -514,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 ;
@@ -541,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 ;
@@ -563,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 ;
@@ -584,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 ;
@@ -598,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/optimprove2.cxx b/svx/source/cui/optimprove2.cxx
index 28989080ca0a..b988c7b75bad 100644
--- a/svx/source/cui/optimprove2.cxx
+++ b/svx/source/cui/optimprove2.cxx
@@ -149,7 +149,13 @@ IMPL_LINK( SvxImprovementOptionsPage, HandleShowData, PushButton*, EMPTYARG )
{
::rtl::OUString sLogFile( m_sLogPath );
sLogFile += C2S("/Current.csv");
- uno::Sequence< beans::PropertyValue > aArgs;
+ uno::Sequence< beans::PropertyValue > aArgs(3);
+ aArgs[0].Name = ::rtl::OUString::createFromAscii("FilterName");
+ aArgs[0].Value = uno::makeAny(::rtl::OUString::createFromAscii("Text - txt - csv (StarCalc)"));
+ aArgs[1].Name = ::rtl::OUString::createFromAscii("FilterOptions");
+ aArgs[1].Value = uno::makeAny(::rtl::OUString::createFromAscii("44,34,12,1,"));
+ aArgs[2].Name = ::rtl::OUString::createFromAscii("ReadOnly");
+ aArgs[2].Value = uno::makeAny(true);
uno::Reference< lang::XComponent > xDoc = ::comphelper::SynchronousDispatch::dispatch(
xDesktop, sLogFile, C2S("_default"), 0, aArgs );
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/webconninfo.cxx b/svx/source/cui/webconninfo.cxx
index 0298a8fc7e93..997c246abf1e 100644
--- a/svx/source/cui/webconninfo.cxx
+++ b/svx/source/cui/webconninfo.cxx
@@ -44,6 +44,7 @@
#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 <comphelper/docpasswordrequest.hxx>
@@ -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,34 +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 );
- ::comphelper::DocPasswordRequest* pPasswordRequest = new ::comphelper::DocPasswordRequest(
- ::comphelper::DocPasswordRequestType_STANDARD, 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 );
}
}
}
@@ -329,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/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/makefile.mk b/svx/source/customshapes/makefile.mk
index 9940a9bb21bc..edd6f7d33ed0 100644
--- a/svx/source/customshapes/makefile.mk
+++ b/svx/source/customshapes/makefile.mk
@@ -49,6 +49,8 @@ ENABLE_EXCEPTIONS=TRUE
NOOPTFILES= $(SLO)$/EnhancedCustomShapeFunctionParser.obj
.ENDIF
+ENVCFLAGS += -DBOOST_SPIRIT_USE_OLD_NAMESPACE
+
# --- Files -------------------------------------
LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
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/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/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 45a67a09e52d..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 );
@@ -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/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index f53168a273ac..afff309168ac 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -763,12 +763,18 @@ void DbGridControl::NavigationBar::StateChanged( StateChangedType nType )
Fraction aZoom = GetZoom();
// not all of these controls need to know the new zoom, but to be sure ...
- Font aFont( IsControlFont() ? GetControlFont() : GetPointFont());
+ Font aFont( GetSettings().GetStyleSettings().GetFieldFont() );
+ if ( IsControlFont() )
+ aFont.Merge( GetControlFont() );
+
for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i)
{
pWindows[i]->SetZoom(aZoom);
pWindows[i]->SetZoomedPointFont(aFont);
}
+
+ SetZoomedPointFont( aFont );
+
// rearrange the controls
m_nDefaultWidth = ArrangeControls();
}
@@ -1075,18 +1081,13 @@ void DbGridControl::ImplInitWindow( const InitWindowFacet _eInitWhat )
{
if ( m_bNavigationBar )
{
- m_aBar.SetZoom( GetZoom() );
-
Font aFont = m_aBar.GetSettings().GetStyleSettings().GetFieldFont();
if ( IsControlFont() )
- {
m_aBar.SetControlFont( GetControlFont() );
- aFont.Merge( GetControlFont() );
- }
else
m_aBar.SetControlFont();
- m_aBar.SetZoomedPointFont( aFont );
+ m_aBar.SetZoom( GetZoom() );
}
}
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/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx
index b4a5b209956f..ed4cd890ec9e 100644
--- a/svx/source/form/fmpgeimp.cxx
+++ b/svx/source/form/fmpgeimp.cxx
@@ -38,6 +38,7 @@
#include "fmprop.hrc"
#include "fmservs.hxx"
#include "fmobj.hxx"
+#include "formcontrolfactory.hxx"
#include "svditer.hxx"
#include "fmresids.hrc"
#include "svx/dbtoolsclient.hxx"
@@ -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/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 10c0978288a6..fc7f1aa78558 100644
--- a/svx/source/form/fmtextcontrolshell.cxx
+++ b/svx/source/form/fmtextcontrolshell.cxx
@@ -101,6 +101,7 @@ namespace svx
//====================================================================
static SfxSlotId pTextControlSlots[] =
{
+ SID_CLIPBOARD_FORMAT_ITEMS,
SID_CUT,
SID_COPY,
SID_PASTE,
@@ -140,7 +141,6 @@ namespace svx
// SID_TEXTDIRECTION_TOP_TO_BOTTOM,
SID_ATTR_CHAR_SCALEWIDTH, /* 911 */
SID_ATTR_CHAR_RELIEF,
- SID_CLIPBOARD_FORMAT_ITEMS, /* 922 */
SID_ATTR_PARA_LEFT_TO_RIGHT, /* 950 */
SID_ATTR_PARA_RIGHT_TO_LEFT,
0
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 50434af4917b..de1a7d76b526 100644
--- a/svx/source/form/formcontrolfactory.cxx
+++ b/svx/source/form/formcontrolfactory.cxx
@@ -35,6 +35,7 @@
#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/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/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/fmpgeimp.hxx b/svx/source/inc/fmpgeimp.hxx
index 350fbedd709e..880ecb21d7e5 100644
--- a/svx/source/inc/fmpgeimp.hxx
+++ b/svx/source/inc/fmpgeimp.hxx
@@ -133,21 +133,8 @@ 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 );
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/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/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/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/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/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/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx
index 544546149645..c9cfde91547a 100644
--- a/svx/source/msfilter/msdffimp.cxx
+++ b/svx/source/msfilter/msdffimp.cxx
@@ -3234,6 +3234,8 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const
{
// MapUnit eMap( rManager.GetModel()->GetScaleUnit() );
+ sal_Bool bHasShadow = sal_False;
+
for ( void* pDummy = ((DffPropertyReader*)this)->First(); pDummy; pDummy = ((DffPropertyReader*)this)->Next() )
{
UINT32 nRecType = GetCurKey();
@@ -3305,8 +3307,7 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const
break;
case DFF_Prop_fshadowObscured :
{
- sal_Bool bHasShadow = ( nContent & 2 ) != 0;
- rSet.Put( SdrShadowItem( bHasShadow ) );
+ bHasShadow = ( nContent & 2 ) != 0;
if ( bHasShadow )
{
if ( !IsProperty( DFF_Prop_shadowOffsetX ) )
@@ -3319,6 +3320,44 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const
}
}
+ if ( bHasShadow )
+ {
+ // #160376# sj: activating shadow only if fill and or linestyle is used
+ // this is required because of the latest drawing layer core changes.
+ // Issue i104085 is related to this.
+ UINT32 nLineFlags(GetPropertyValue( DFF_Prop_fNoLineDrawDash ));
+ if(!IsHardAttribute( DFF_Prop_fLine ) && !IsCustomShapeStrokedByDefault( rObjData.eShapeType ))
+ nLineFlags &= ~0x08;
+ UINT32 nFillFlags(GetPropertyValue( DFF_Prop_fNoFillHitTest ));
+ if(!IsHardAttribute( DFF_Prop_fFilled ) && !IsCustomShapeFilledByDefault( rObjData.eShapeType ))
+ nFillFlags &= ~0x10;
+ if ( nFillFlags & 0x10 )
+ {
+ MSO_FillType eMSO_FillType = (MSO_FillType)GetPropertyValue( DFF_Prop_fillType, mso_fillSolid );
+ switch( eMSO_FillType )
+ {
+ case mso_fillSolid :
+ case mso_fillPattern :
+ case mso_fillTexture :
+ case mso_fillPicture :
+ case mso_fillShade :
+ case mso_fillShadeCenter :
+ case mso_fillShadeShape :
+ case mso_fillShadeScale :
+ case mso_fillShadeTitle :
+ break;
+ // case mso_fillBackground :
+ default:
+ nFillFlags &=~0x10; // no fillstyle used
+ break;
+ }
+ }
+ if ( ( ( nLineFlags & 0x08 ) == 0 ) && ( ( nFillFlags & 0x10 ) == 0 ) ) // if there is no fillstyle and linestyle
+ bHasShadow = sal_False; // we are turning shadow off.
+
+ if ( bHasShadow )
+ rSet.Put( SdrShadowItem( bHasShadow ) );
+ }
ApplyLineAttributes( rSet, rObjData.eShapeType ); // #i28269#
ApplyFillAttributes( rIn, rSet, rObjData );
if ( rObjData.eShapeType != mso_sptNil )
@@ -3770,16 +3809,43 @@ FASTBOOL SvxMSDffManager::GetColorFromPalette( USHORT /* nNum */, Color& rColor
return TRUE;
}
+// sj: the documentation is not complete, especially in ppt the normal rgb for text
+// color is written as 0xfeRRGGBB, this can't be explained by the documentation, nearly
+// every bit in the upper code is set -> so there seems to be a special handling for
+// ppt text colors, i decided not to fix this in MSO_CLR_ToColor because of possible
+// side effects, instead MSO_TEXT_CLR_ToColor is called for PPT text colors, to map
+// the color code to something that behaves like the other standard color codes used by
+// fill and line color
+Color SvxMSDffManager::MSO_TEXT_CLR_ToColor( sal_uInt32 nColorCode ) const
+{
+ // Fuer Textfarben: Header ist 0xfeRRGGBB
+ if ( ( nColorCode & 0xfe000000 ) == 0xfe000000 )
+ nColorCode &= 0x00ffffff;
+ else
+ {
+ // for colorscheme colors the color index are the lower three bits of the upper byte
+ if ( ( nColorCode & 0xf8000000 ) == 0 ) // this must be a colorscheme index
+ {
+ nColorCode >>= 24;
+ nColorCode |= 0x8000000;
+ }
+ }
+ return MSO_CLR_ToColor( nColorCode );
+}
Color SvxMSDffManager::MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nContentProperty ) const
{
Color aColor( mnDefaultColor );
// Fuer Textfarben: Header ist 0xfeRRGGBB
- if ( ( nColorCode & 0xfe000000 ) == 0xfe000000 )
- nColorCode &= 0x00ffffff;
+ if ( ( nColorCode & 0xfe000000 ) == 0xfe000000 ) // sj: it needs to be checked if 0xfe is used in
+ nColorCode &= 0x00ffffff; // other cases than ppt text -> if not this code can be removed
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 ) )
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/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/outliner/outliner.cxx b/svx/source/outliner/outliner.cxx
index 3da9e8dbecac..fc144cf4304f 100644
--- a/svx/source/outliner/outliner.cxx
+++ b/svx/source/outliner/outliner.cxx
@@ -1867,6 +1867,20 @@ IMPL_LINK( Outliner, EndMovingParagraphsHdl, MoveParagraphsInfo*, pInfos )
return 0;
}
+static bool isSameNumbering( const SvxNumberFormat& rN1, const SvxNumberFormat& rN2 )
+{
+ if( rN1.GetNumberingType() != rN2.GetNumberingType() )
+ return false;
+
+ if( rN1.GetNumStr(1) != rN2.GetNumStr(1) )
+ return false;
+
+ if( (rN1.GetPrefix() != rN2.GetPrefix()) || (rN1.GetSuffix() != rN2.GetSuffix()) )
+ return false;
+
+ return true;
+}
+
sal_uInt16 Outliner::ImplGetNumbering( USHORT nPara, const SvxNumberFormat* pParaFmt )
{
sal_uInt16 nNumber = pParaFmt->GetStart() - 1;
@@ -1879,8 +1893,8 @@ sal_uInt16 Outliner::ImplGetNumbering( USHORT nPara, const SvxNumberFormat* pPar
pPara = pParaList->GetParagraph( nPara );
const sal_Int16 nDepth = pPara->GetDepth();
- // ignore paragraphs that are below our paragraph
- if( nDepth > nParaDepth )
+ // ignore paragraphs that are below our paragraph or have no numbering
+ if( (nDepth > nParaDepth) || (nDepth == -1) )
continue;
// stop on paragraphs that are above our paragraph
@@ -1888,8 +1902,13 @@ sal_uInt16 Outliner::ImplGetNumbering( USHORT nPara, const SvxNumberFormat* pPar
break;
const SvxNumberFormat* pFmt = GetNumberFormat( nPara );
- if( pFmt == 0 || (*pFmt != *pParaFmt) )
- break; // change in number format, stop here
+
+ if( pFmt == 0 )
+ continue; // ignore paragraphs without bullets
+
+ // check if numbering is the same
+ if( !isSameNumbering( *pFmt, *pParaFmt ) )
+ break;
const SfxBoolItem& rBulletState = (const SfxBoolItem&) pEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE );
diff --git a/svx/source/outliner/outlvw.cxx b/svx/source/outliner/outlvw.cxx
index 098a4055ce0f..a69776df14e8 100644
--- a/svx/source/outliner/outlvw.cxx
+++ b/svx/source/outliner/outlvw.cxx
@@ -1010,6 +1010,14 @@ void OutlinerView::PasteSpecial()
pOwner->bPasting = TRUE;
pEditView->PasteSpecial();
+ if ( pOwner->ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEOBJECT )
+ {
+ const USHORT nParaCount = pOwner->pEditEngine->GetParagraphCount();
+
+ for( USHORT nPara = 0; nPara < nParaCount; nPara++ )
+ pOwner->ImplSetLevelDependendStyleSheet( nPara );
+ }
+
pEditView->SetEditEngineUpdateMode( TRUE );
pOwner->UndoActionEnd( OLUNDO_INSERT );
pEditView->ShowCursor( TRUE, TRUE );
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..7527b177b3a4 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -305,6 +305,10 @@ namespace sdr
pSdrText,
*pOPO,
aTextRangeTransform,
+ SDRTEXTHORZADJUST_LEFT,
+ SDRTEXTVERTADJUST_TOP,
+ false,
+ false,
false,
false,
false);
diff --git a/svx/source/sdr/contact/viewcontactofunocontrol.cxx b/svx/source/sdr/contact/viewcontactofunocontrol.cxx
index 9d6548a1b791..7bea25feeeed 100644
--- a/svx/source/sdr/contact/viewcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewcontactofunocontrol.cxx
@@ -121,36 +121,18 @@ namespace sdr { namespace contact {
//--------------------------------------------------------------------
ViewObjectContact& ViewContactOfUnoControl::CreateObjectSpecificViewObjectContact( ObjectContact& _rObjectContact )
{
+ // print or print preview requires special handling
+ const OutputDevice* pDevice = _rObjectContact.TryToGetOutputDevice();
+ bool bPrintOrPreview = ( pDevice != NULL ) && ( pDevice->GetOutDevType() == OUTDEV_PRINTER );
+
ObjectContactOfPageView* pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &_rObjectContact );
- if ( pPageViewContact )
- {
- // special classes for special devices:
- // - PDF export
- ::vcl::PDFExtOutDevData* pPDFExport = PTR_CAST( ::vcl::PDFExtOutDevData, pPageViewContact->GetPageWindow().GetPaintWindow().GetOutputDevice().GetExtOutDevData() );
- if ( pPDFExport != NULL )
- return *new UnoControlPDFExportContact( *pPageViewContact, *this );
-
- // - print preview
- if ( pPageViewContact->GetPageWindow().GetPageView().GetView().IsPrintPreview() )
- return *new UnoControlPrintOrPreviewContact( *pPageViewContact, *this );
-
- OutDevType eDeviceType = pPageViewContact->GetPageWindow().GetPaintWindow().GetOutputDevice().GetOutDevType();
- // - printing
- if ( eDeviceType == OUTDEV_PRINTER )
- return *new UnoControlPrintOrPreviewContact( *pPageViewContact, *this );
-
- // - any other virtual device
- if ( eDeviceType == OUTDEV_VIRDEV )
- return *new UnoControlDefaultContact( *pPageViewContact, *this );
-
- // - normal windows have special, design-mode dependent handling
- if ( eDeviceType == OUTDEV_WINDOW )
- return *new UnoControlWindowContact( *pPageViewContact, *this );
- }
+ bPrintOrPreview |= ( pPageViewContact != NULL ) && pPageViewContact->GetPageWindow().GetPageView().GetView().IsPrintPreview();
+
+ if ( bPrintOrPreview )
+ return *new UnoControlPrintOrPreviewContact( *pPageViewContact, *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 );
+ // all others are nowadays served by the same implementation
+ return *new ViewObjectContactOfUnoControl( _rObjectContact, *this );
}
//--------------------------------------------------------------------
@@ -173,7 +155,7 @@ namespace sdr { namespace contact {
aTransform.set(0, 2, aRange.getMinX());
aTransform.set(1, 2, aRange.getMinY());
- // create control primitive WITHOUT evtl. existing XControl; this would be done in
+ // create control primitive WITHOUT possibly existing XControl; this would be done in
// the VOC in createPrimitive2DSequence()
const drawinglayer::primitive2d::Primitive2DReference xRetval(new drawinglayer::primitive2d::ControlPrimitive2D(
aTransform, xControlModel));
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 667129e27653..bbfe3eaf65ab 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -402,7 +402,7 @@ namespace sdr { namespace contact {
//= InvisibleControlViewAccess
//====================================================================
/** is a ->IPageViewAccess implementation which can be used to create an invisble control for
- an arbitrary device
+ an arbitrary window
*/
class InvisibleControlViewAccess : public IPageViewAccess
{
@@ -446,6 +446,47 @@ namespace sdr { namespace contact {
}
//====================================================================
+ //= DummyPageViewAccess
+ //====================================================================
+ /** is a ->IPageViewAccess implementation which can be used to create a control for an arbitrary
+ non-Window device
+
+ The implementation will report the "PageView" as being in design mode, all layers to be visible,
+ and will not return any ControlContainer, so all control container related features (notifications etc)
+ are not available.
+ */
+ class DummyPageViewAccess : public IPageViewAccess
+ {
+ public:
+ DummyPageViewAccess()
+ {
+ }
+
+ virtual bool isDesignMode() const;
+ virtual Reference< XControlContainer >
+ getControlContainer( const OutputDevice& _rDevice ) const;
+ virtual bool isLayerVisible( SdrLayerID _nLayerID ) const;
+ };
+
+ //--------------------------------------------------------------------
+ bool DummyPageViewAccess::isDesignMode() const
+ {
+ return true;
+ }
+
+ //--------------------------------------------------------------------
+ Reference< XControlContainer > DummyPageViewAccess::getControlContainer( const OutputDevice& /*_rDevice*/ ) const
+ {
+ return NULL;
+ }
+
+ //--------------------------------------------------------------------
+ bool DummyPageViewAccess::isLayerVisible( SdrLayerID /*_nLayerID*/ ) const
+ {
+ return true;
+ }
+
+ //====================================================================
//= ViewObjectContactOfUnoControl_Impl
//====================================================================
typedef ::cppu::WeakImplHelper4 < XWindowListener
@@ -763,8 +804,9 @@ namespace sdr { namespace contact {
This method cares for this, by retrieving the very original OutputDevice.
*/
- static const OutputDevice& imp_getPageViewDevice_nothrow( const ObjectContactOfPageView& _rObjectContact );
- const OutputDevice& imp_getPageViewDevice_nothrow() const;
+ static const OutputDevice& impl_getPageViewOutputDevice_nothrow( const ObjectContactOfPageView& _rObjectContact );
+
+ const OutputDevice& impl_getOutputDevice_throw() const;
private:
ViewObjectContactOfUnoControl_Impl(); // never implemented
@@ -829,6 +871,13 @@ namespace sdr { namespace contact {
static void getTransformation( const ViewContactOfUnoControl& _rVOC, ::basegfx::B2DHomMatrix& _out_Transformation );
private:
+ void impl_positionAndZoomControl( const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const
+ {
+ if ( !_rViewInformation.getViewport().isEmpty() )
+ m_pVOCImpl->positionAndZoomControl( _rViewInformation.getObjectToViewTransformation() );
+ }
+
+ private:
::rtl::Reference< ViewObjectContactOfUnoControl_Impl > m_pVOCImpl;
/** The geometry is part of the identity of an primitive, so we cannot calculate it on demand
(since the data the calculation is based on might have changed then), but need to calc
@@ -854,9 +903,15 @@ namespace sdr { namespace contact {
DBG_CTOR( ViewObjectContactOfUnoControl_Impl, NULL );
DBG_ASSERT( m_pAntiImpl, "ViewObjectContactOfUnoControl_Impl::ViewObjectContactOfUnoControl_Impl: invalid AntiImpl!" );
- const OutputDevice& rPageViewDevice( imp_getPageViewDevice_nothrow() );
+ const OutputDevice& rPageViewDevice( impl_getOutputDevice_throw() );
m_aZoomLevelNormalization = rPageViewDevice.GetInverseViewTransformation();
+ #if OSL_DEBUG_LEVEL > 1
+ ::basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ m_aZoomLevelNormalization.decompose( aScale, aTranslate, fRotate, fShearX );
+ #endif
+
::basegfx::B2DHomMatrix aScaleNormalization;
MapMode aCurrentDeviceMapMode( rPageViewDevice.GetMapMode() );
aScaleNormalization.set( 0, 0, (double)aCurrentDeviceMapMode.GetScaleX() );
@@ -953,27 +1008,40 @@ namespace sdr { namespace contact {
return false;
ObjectContactOfPageView* pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &m_pAntiImpl->GetObjectContact() );
- DBG_ASSERT( pPageViewContact, "ViewObjectContactOfUnoControl_Impl::ensureControl: cannot create a control if I don't have a PageView!" );
- if ( !pPageViewContact )
- return false;
+ if ( pPageViewContact )
+ {
+ SdrPageViewAccess aPVAccess( pPageViewContact->GetPageWindow().GetPageView() );
+ return impl_ensureControl_nothrow(
+ aPVAccess,
+ impl_getPageViewOutputDevice_nothrow( *pPageViewContact )
+ );
+ }
- SdrPageViewAccess aPVAccess( pPageViewContact->GetPageWindow().GetPageView() );
+ DummyPageViewAccess aNoPageView;
return impl_ensureControl_nothrow(
- aPVAccess,
- imp_getPageViewDevice_nothrow( *pPageViewContact )
+ aNoPageView,
+ impl_getOutputDevice_throw()
);
}
//--------------------------------------------------------------------
- const OutputDevice& ViewObjectContactOfUnoControl_Impl::imp_getPageViewDevice_nothrow() const
+ const OutputDevice& ViewObjectContactOfUnoControl_Impl::impl_getOutputDevice_throw() const
{
ObjectContactOfPageView* pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &m_pAntiImpl->GetObjectContact() );
- ENSURE_OR_THROW( pPageViewContact, "need a ObjectContactOfPageView." );
- return imp_getPageViewDevice_nothrow( *pPageViewContact );
+ if ( pPageViewContact )
+ {
+ // do not use ObjectContact::TryToGetOutputDevice here, it would not care for the PageWindow's
+ // OriginalPaintWindow
+ return impl_getPageViewOutputDevice_nothrow( *pPageViewContact );
+ }
+
+ const OutputDevice* pDevice = m_pAntiImpl->GetObjectContact().TryToGetOutputDevice();
+ ENSURE_OR_THROW( pDevice, "no output device -> no control" );
+ return *pDevice;
}
//--------------------------------------------------------------------
- const OutputDevice& ViewObjectContactOfUnoControl_Impl::imp_getPageViewDevice_nothrow( const ObjectContactOfPageView& _rObjectContact )
+ const OutputDevice& ViewObjectContactOfUnoControl_Impl::impl_getPageViewOutputDevice_nothrow( const ObjectContactOfPageView& _rObjectContact )
{
// if the PageWindow has a patched PaintWindow, use the original PaintWindow
// this ensures that our control is _not_ re-created just because somebody
@@ -1522,18 +1590,28 @@ namespace sdr { namespace contact {
//--------------------------------------------------------------------
::drawinglayer::primitive2d::Primitive2DSequence LazyControlCreationPrimitive2D::get2DDecomposition( const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const
{
+ #if OSL_DEBUG_LEVEL > 1
+ ::basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ _rViewInformation.getObjectToViewTransformation().decompose( aScale, aTranslate, fRotate, fShearX );
+ #endif
if ( m_pVOCImpl->hasControl() )
- m_pVOCImpl->positionAndZoomControl( _rViewInformation.getObjectToViewTransformation() );
+ impl_positionAndZoomControl( _rViewInformation );
return BasePrimitive2D::get2DDecomposition( _rViewInformation );
}
//--------------------------------------------------------------------
::drawinglayer::primitive2d::Primitive2DSequence LazyControlCreationPrimitive2D::createLocalDecomposition( const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const
{
+ #if OSL_DEBUG_LEVEL > 1
+ ::basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ _rViewInformation.getObjectToViewTransformation().decompose( aScale, aTranslate, fRotate, fShearX );
+ #endif
// force control here to make it a VCL ChildWindow. Will be fetched
// and used below by getExistentControl()
m_pVOCImpl->ensureControl();
- m_pVOCImpl->positionAndZoomControl( _rViewInformation.getObjectToViewTransformation() );
+ impl_positionAndZoomControl( _rViewInformation );
// get needed data
const ViewContactOfUnoControl& rViewContactOfUnoControl( m_pVOCImpl->getViewContact() );
@@ -1704,40 +1782,6 @@ namespace sdr { namespace contact {
}
//====================================================================
- //= UnoControlDefaultContact
- //====================================================================
- DBG_NAME( UnoControlDefaultContact )
- //--------------------------------------------------------------------
- UnoControlDefaultContact::UnoControlDefaultContact( ObjectContact& _rObjectContact, ViewContactOfUnoControl& _rViewContact )
- :ViewObjectContactOfUnoControl( _rObjectContact, _rViewContact )
- {
- DBG_CTOR( UnoControlDefaultContact, NULL );
- }
-
- //--------------------------------------------------------------------
- UnoControlDefaultContact::~UnoControlDefaultContact()
- {
- DBG_DTOR( UnoControlDefaultContact, NULL );
- }
-
- //====================================================================
- //= UnoControlWindowContact
- //====================================================================
- DBG_NAME( UnoControlWindowContact )
- //--------------------------------------------------------------------
- UnoControlWindowContact::UnoControlWindowContact( ObjectContactOfPageView& _rObjectContact, ViewContactOfUnoControl& _rViewContact )
- :ViewObjectContactOfUnoControl( _rObjectContact, _rViewContact )
- {
- DBG_CTOR( UnoControlWindowContact, NULL );
- }
-
- //--------------------------------------------------------------------
- UnoControlWindowContact::~UnoControlWindowContact()
- {
- DBG_DTOR( UnoControlWindowContact, NULL );
- }
-
- //====================================================================
//= UnoControlPrintOrPreviewContact
//====================================================================
DBG_NAME( UnoControlPrintOrPreviewContact )
@@ -1762,23 +1806,6 @@ namespace sdr { namespace contact {
return ViewObjectContactOfUnoControl::createPrimitive2DSequence( rDisplayInfo );
}
- //====================================================================
- //= UnoControlPDFExportContact
- //====================================================================
- DBG_NAME( UnoControlPDFExportContact )
- //--------------------------------------------------------------------
- UnoControlPDFExportContact::UnoControlPDFExportContact( ObjectContactOfPageView& _rObjectContact, ViewContactOfUnoControl& _rViewContact )
- :ViewObjectContactOfUnoControl( _rObjectContact, _rViewContact )
- {
- DBG_CTOR( UnoControlPDFExportContact, NULL );
- }
-
- //--------------------------------------------------------------------
- UnoControlPDFExportContact::~UnoControlPDFExportContact()
- {
- DBG_DTOR( UnoControlPDFExportContact, NULL );
- }
-
//........................................................................
} } // namespace sdr::contact
//........................................................................
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/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 3c8feb7ff2b2..73d5689350c2 100644
--- a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
@@ -123,6 +123,7 @@ namespace drawinglayer
*getSdrLFSTAttribute().getText(),
getSdrLFSTAttribute().getLine(),
false,
+ false,
false));
}
diff --git a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
index 0edbe1a35046..a04021ae21ad 100644
--- a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
@@ -72,7 +72,7 @@ namespace drawinglayer
// add text
if(getSdrLSTAttribute().getText())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(getUnitPolygon()), aEmptyMatrix, *getSdrLSTAttribute().getText(), getSdrLSTAttribute().getLine(), false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(getUnitPolygon()), aEmptyMatrix, *getSdrLSTAttribute().getText(), getSdrLSTAttribute().getLine(), false, false, false));
}
// add shadow
diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
index 497266433d67..e2dce7b551ed 100644
--- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
@@ -60,8 +60,9 @@ namespace drawinglayer
getTextBox(),
*getSdrSTAttribute().getText(),
0,
- isForceTextClipToTextRange(), // #SJ# use CellText mode; text upper-left
- getWordWrap()));
+ false,
+ getWordWrap(),
+ isForceTextClipToTextRange()));
}
// add shadow
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 9666bd2c1ac1..cd426edfdd05 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -173,7 +173,8 @@ namespace drawinglayer
const attribute::SdrTextAttribute& rText,
const attribute::SdrLineAttribute* pStroke,
bool bCellText,
- bool bWordWrap)
+ bool bWordWrap,
+ bool bClipOnBounds)
{
basegfx::B2DHomMatrix aAnchorTransform(rObjectTransform);
SdrTextPrimitive2D* pNew = 0;
@@ -282,7 +283,8 @@ namespace drawinglayer
pNew = new SdrStretchTextPrimitive2D(
&rText.getSdrText(),
rText.getOutlinerParaObject(),
- aAnchorTransform);
+ aAnchorTransform,
+ rText.isFixedCellHeight());
}
else // text in range
{
@@ -291,9 +293,13 @@ namespace drawinglayer
&rText.getSdrText(),
rText.getOutlinerParaObject(),
aAnchorTransform,
+ rText.getSdrTextHorzAdjust(),
+ rText.getSdrTextVertAdjust(),
+ rText.isFixedCellHeight(),
rText.isScroll(),
bCellText,
- bWordWrap);
+ bWordWrap,
+ bClipOnBounds);
}
}
diff --git a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
index ed3062184f1a..4f7e2c768669 100644
--- a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
@@ -94,7 +94,7 @@ namespace drawinglayer
// 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, false));
}
// add shadow
@@ -191,7 +191,7 @@ namespace drawinglayer
// 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, false));
}
// add shadow
diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
index f5f2f4e876dc..63d050a775af 100644
--- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
@@ -104,7 +104,7 @@ namespace drawinglayer
// 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, false));
}
// add shadow
diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
index f515b9b6a5e9..f5445cefa5f6 100644
--- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
@@ -129,8 +129,12 @@ namespace drawinglayer
&pTextAttribute->getSdrText(),
pTextAttribute->getOutlinerParaObject(),
aTextMatrix,
+ SDRTEXTHORZADJUST_CENTER,
+ SDRTEXTVERTADJUST_CENTER,
pTextAttribute->isScroll(),
false,
+ false,
+ false,
false);
aTextRange = pBlockText->getB2DRange(aViewInformation);
}
diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
index ab5d23962719..7c44311d3c5a 100644
--- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
@@ -110,7 +110,7 @@ namespace drawinglayer
// always supported by the old paints, too
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, false));
}
// add shadow
diff --git a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
index 91ed0bd2adce..96da706fb66a 100644
--- a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
@@ -89,7 +89,7 @@ namespace drawinglayer
// add text
if(getSdrLFSTAttribute().getText())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(getUnitPolyPolygon(), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(getUnitPolyPolygon(), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
}
// add shadow
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 64ac716b40e9..edb2837ef670 100644
--- a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
@@ -110,7 +110,7 @@ namespace drawinglayer
// 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, false));
}
// add shadow
diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
index 0cad266f69d1..47e85894f37e 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,14 +377,22 @@ namespace drawinglayer
const SdrText* pSdrText,
const OutlinerParaObject& rOutlinerParaObject,
const basegfx::B2DHomMatrix& rTextRangeTransform,
+ SdrTextHorzAdjust aSdrTextHorzAdjust,
+ SdrTextVertAdjust aSdrTextVertAdjust,
+ bool bFixedCellHeight,
bool bUnlimitedPage,
bool bCellText,
- bool bWordWrap)
+ bool bWordWrap,
+ bool bClipOnBounds)
: SdrTextPrimitive2D(pSdrText, rOutlinerParaObject),
maTextRangeTransform(rTextRangeTransform),
+ maSdrTextHorzAdjust(aSdrTextHorzAdjust),
+ maSdrTextVertAdjust(aSdrTextVertAdjust),
+ mbFixedCellHeight(bFixedCellHeight),
mbUnlimitedPage(bUnlimitedPage),
mbCellText(bCellText),
- mbWordWrap(bWordWrap)
+ mbWordWrap(bWordWrap),
+ mbClipOnBounds(bClipOnBounds)
{
}
@@ -418,9 +403,13 @@ 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());
+ && getWordWrap() == rCompare.getWordWrap()
+ && getClipOnBounds() == rCompare.getClipOnBounds());
}
return false;
@@ -432,9 +421,13 @@ namespace drawinglayer
getSdrText(),
getOutlinerParaObject(),
rTransform * getTextRangeTransform(),
+ getSdrTextHorzAdjust(),
+ getSdrTextVertAdjust(),
+ isFixedCellHeight(),
getUnlimitedPage(),
getCellText(),
- getWordWrap());
+ getWordWrap(),
+ getClipOnBounds());
}
// provide unique ID
@@ -452,15 +445,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 +453,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 +467,8 @@ namespace drawinglayer
{
const SdrStretchTextPrimitive2D& rCompare = (SdrStretchTextPrimitive2D&)rPrimitive;
- return (getTextRangeTransform() == rCompare.getTextRangeTransform());
+ return (getTextRangeTransform() == rCompare.getTextRangeTransform()
+ && isFixedCellHeight() == rCompare.isFixedCellHeight());
}
return false;
@@ -491,7 +479,8 @@ namespace drawinglayer
return new SdrStretchTextPrimitive2D(
getSdrText(),
getOutlinerParaObject(),
- rTransform * getTextRangeTransform());
+ rTransform * getTextRangeTransform(),
+ isFixedCellHeight());
}
// provide unique ID
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/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/svdfppt.cxx b/svx/source/svdraw/svdfppt.cxx
index 94d1ae4b4e70..af38c34e0749 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;
@@ -3882,7 +3972,7 @@ void PPTNumberFormatCreator::ImplGetNumberFormat( SdrPowerPointImport& rManager,
aFont.SetFamily( pAtom->eFamily );
aFont.SetPitch( pAtom->ePitch );
}
- Color aCol( rManager.MSO_CLR_ToColor( nBulletColor ) );
+ Color aCol( rManager.MSO_TEXT_CLR_ToColor( nBulletColor ) );
aFont.SetColor( aCol );
sal_uInt16 nBuChar = (sal_uInt16)nBulletChar;
@@ -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 :
@@ -5801,14 +5886,14 @@ void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, U
{
if ( GetAttrib( PPT_CharAttr_FontColor, nVal, nDestinationInstance ) ) // Textfarbe (4Byte-Arg)
{
- Color aCol( rManager.MSO_CLR_ToColor( nVal ) );
+ Color aCol( rManager.MSO_TEXT_CLR_ToColor( nVal ) );
rSet.Put( SvxColorItem( aCol, EE_CHAR_COLOR ) );
if ( nDestinationInstance == 0xffffffff )
mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ mnDepth ].mnFontColorInStyleSheet = aCol;
}
else if ( nVal & 0x0f000000 ) // this is not a hard attribute, but maybe the page has a different colerscheme,
{ // so that in this case we must use a hard color attribute
- Color aCol( rManager.MSO_CLR_ToColor( nVal ) );
+ Color aCol( rManager.MSO_TEXT_CLR_ToColor( nVal ) );
Color& aColorInSheet = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ mnDepth ].mnFontColorInStyleSheet;
if ( aColorInSheet != aCol )
rSet.Put( SvxColorItem( aCol, EE_CHAR_COLOR ) );
@@ -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;
@@ -6230,7 +6315,7 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >&
nColor = rParaLevel.mnBulletColor;
else
nColor = rCharLevel.mnFontColor;
- aNumberFormat2.SetBulletColor( rManager.MSO_CLR_ToColor( nColor ) );
+ aNumberFormat2.SetBulletColor( rManager.MSO_TEXT_CLR_ToColor( nColor ) );
pRule->SetLevel( i, aNumberFormat2 );
}
}
@@ -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 );
@@ -7517,8 +7611,8 @@ void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >& xTabl
{
Color aLineColor( ((XLineColorItem&)pLine->GetMergedItem( XATTR_LINECOLOR )).GetColorValue() );
aBorderLine.Color = aLineColor.GetColor();
- aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( ((const XLineWidthItem&)(pLine->GetMergedItem(XATTR_LINEWIDTH))).GetValue() );
- aBorderLine.InnerLineWidth = 0;
+ aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( ((const XLineWidthItem&)(pLine->GetMergedItem(XATTR_LINEWIDTH))).GetValue() / 4 );
+ aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( ((const XLineWidthItem&)(pLine->GetMergedItem(XATTR_LINEWIDTH))).GetValue() / 4 );
aBorderLine.LineDistance = 0;
}
break;
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/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 8c30bfb88018..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() ) );
+ }
}
// -----------------------------------------------------------------------------
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 8ce4390ad6ac..e72b606f3b53 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -215,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
@@ -271,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
@@ -290,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]);
}
}
@@ -472,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,
@@ -709,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
@@ -770,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
@@ -789,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));
@@ -812,24 +800,32 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive(
const bool bVerticalWritintg(rSdrBlockTextPrimitive.getOutlinerParaObject().IsVertical());
const Size aAnchorTextSize(Size(nAnchorTextWidth, nAnchorTextHeight));
+ // check if block text is used (only one of them can be true)
+ const bool bHorizontalIsBlock(SDRTEXTHORZADJUST_BLOCK == eHAdj && !bVerticalWritintg);
+ const bool bVerticalIsBlock(SDRTEXTVERTADJUST_BLOCK == eVAdj && bVerticalWritintg);
+
+ // set minimal paper size hor/ver if needed
+ if(bHorizontalIsBlock)
+ {
+ rOutliner.SetMinAutoPaperSize(Size(nAnchorTextWidth, 0));
+ }
+ else if(bVerticalIsBlock)
+ {
+ rOutliner.SetMinAutoPaperSize(Size(0, nAnchorTextHeight));
+ }
+
if(bIsCell)
{
// cell text is formated neither like a text object nor like a object
// text, so use a special setup here
- rOutliner.SetMinAutoPaperSize(aNullSize);
rOutliner.SetMaxAutoPaperSize(aAnchorTextSize);
rOutliner.SetPaperSize(aAnchorTextSize);
- rOutliner.SetMinAutoPaperSize(Size(nAnchorTextWidth, 0));
- rOutliner.SetUpdateMode(TRUE);
+ rOutliner.SetUpdateMode(true);
rOutliner.SetText(rSdrBlockTextPrimitive.getOutlinerParaObject());
- rOutliner.SetUpdateMode(TRUE);
rOutliner.SetControlWord(nOriginalControlWord);
}
else
{
- // check if block text is used (only one of them can be true)
- const bool bHorizontalIsBlock(SDRTEXTHORZADJUST_BLOCK == eHAdj && !bVerticalWritintg);
- const bool bVerticalIsBlock(SDRTEXTVERTADJUST_BLOCK == eVAdj && bVerticalWritintg);
if((rSdrBlockTextPrimitive.getWordWrap() || IsTextFrame()) && !rSdrBlockTextPrimitive.getUnlimitedPage())
{
@@ -855,16 +851,6 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive(
rOutliner.SetMaxAutoPaperSize(aMaxAutoPaperSize);
}
- // set minimal paper size hor/ver if needed
- if(bHorizontalIsBlock)
- {
- rOutliner.SetMinAutoPaperSize(Size(nAnchorTextWidth, 0));
- }
- else if(bVerticalIsBlock)
- {
- rOutliner.SetMinAutoPaperSize(Size(0, nAnchorTextHeight));
- }
-
rOutliner.SetPaperSize(aNullSize);
rOutliner.SetUpdateMode(true);
rOutliner.SetText(rSdrBlockTextPrimitive.getOutlinerParaObject());
@@ -943,7 +929,8 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive(
// as the master shape we are working on. For vertical, use the top-right
// corner
const double fStartInX(bVerticalWritintg ? aAdjustTranslate.getX() + aOutlinerScale.getX() : aAdjustTranslate.getX());
- aNewTransformA.translate(fStartInX, aAdjustTranslate.getY());
+ const basegfx::B2DTuple aAdjOffset(fStartInX, aAdjustTranslate.getY());
+ aNewTransformA.translate(aAdjOffset.getX(), aAdjOffset.getY());
// mirroring. We are now in aAnchorTextRange sizes. When mirroring in X and Y,
// move the null point which was top left to bottom right.
@@ -960,10 +947,10 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive(
// #SJ# create ClipRange (if needed)
basegfx::B2DRange aClipRange;
- if(bIsCell)
+ if(rSdrBlockTextPrimitive.getClipOnBounds())
{
- aClipRange.expand(basegfx::B2DTuple(0.0, 0.0));
- aClipRange.expand(basegfx::B2DTuple(aAnchorTextSize.Width(), aAnchorTextSize.Height()));
+ aClipRange.expand(-aAdjOffset);
+ aClipRange.expand(basegfx::B2DTuple(aAnchorTextSize.Width(), aAnchorTextSize.Height()) - aAdjOffset);
}
// now break up text primitives.
@@ -975,10 +962,9 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive(
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
@@ -995,13 +981,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);
@@ -1059,7 +1042,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/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/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx
index 45a24211f7b2..e53f41251ff2 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -123,7 +123,7 @@ namespace drawinglayer
getTransform(),
*getSdrFTAttribute().getText(),
0,
- true, false));
+ true, false, false));
}
}
diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx
index 7f7aedf860e9..c0e301f3792e 100644
--- a/svx/source/unodraw/unomod.cxx
+++ b/svx/source/unodraw/unomod.cxx
@@ -252,7 +252,10 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createTextField(
{
nId = ID_EXT_FILEFIELD;
}
- else if( aFieldType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("DocInfo.Title") ) )
+ else if (aFieldType.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("docinfo.Title") ) ||
+ aFieldType.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("DocInfo.Title") ) )
{
nId = ID_FILEFIELD;
}
diff --git a/svx/source/unoedit/unofield.cxx b/svx/source/unoedit/unofield.cxx
index efb4226f9c12..6ff4c2aafe3e 100644
--- a/svx/source/unoedit/unofield.cxx
+++ b/svx/source/unoedit/unofield.cxx
@@ -1062,7 +1062,7 @@ OUString SAL_CALL SvxUnoTextField::getImplementationName() throw(uno::RuntimeExc
return OUString(RTL_CONSTASCII_USTRINGPARAM("SvxUnoTextField"));
}
-static const sal_Char* pServiceNames[] =
+static const sal_Char* pOldServiceNames[] =
{
"com.sun.star.text.TextField.DateTime",
"com.sun.star.text.TextField.URL",
@@ -1081,14 +1081,34 @@ static const sal_Char* pServiceNames[] =
"com.sun.star.presentation.TextField.DateTime"
};
+static const sal_Char* pNewServiceNames[] =
+{
+ "com.sun.star.text.textfield.DateTime",
+ "com.sun.star.text.textfield.URL",
+ "com.sun.star.text.textfield.PageNumber",
+ "com.sun.star.text.textfield.PageCount",
+ "com.sun.star.text.textfield.DateTime",
+ "com.sun.star.text.textfield.docinfo.Title", // SvxFileField is used for title
+ "com.sun.star.text.textfield.SheetName",
+ "com.sun.star.text.textfield.DateTime",
+ "com.sun.star.text.textfield.FileName",
+ "com.sun.star.text.textfield.Author",
+ "com.sun.star.text.textfield.Measure",
+ "com.sun.star.text.textfield.DateTime",
+ "com.sun.star.presentation.textfield.Header",
+ "com.sun.star.presentation.textfield.Footer",
+ "com.sun.star.presentation.textfield.DateTime"
+};
+
uno::Sequence< OUString > SAL_CALL SvxUnoTextField::getSupportedServiceNames()
throw(uno::RuntimeException)
{
- uno::Sequence< OUString > aSeq( 3 );
+ uno::Sequence< OUString > aSeq( 4 );
OUString* pServices = aSeq.getArray();
- pServices[0] = OUString::createFromAscii( pServiceNames[mnServiceId] );
- pServices[1] = OUString::createFromAscii( "com.sun.star.text.TextContent" ),
- pServices[2] = OUString::createFromAscii( "com.sun.star.text.TextField" );
+ pServices[0] = OUString::createFromAscii( pNewServiceNames[mnServiceId] );
+ pServices[1] = OUString::createFromAscii( pOldServiceNames[mnServiceId] );
+ pServices[2] = OUString::createFromAscii( "com.sun.star.text.TextContent" ),
+ pServices[3] = OUString::createFromAscii( "com.sun.star.text.TextField" );
return aSeq;
}
diff --git a/svx/source/unoedit/unoforou.cxx b/svx/source/unoedit/unoforou.cxx
index 9c6cb07440d7..c54f76d5f4dc 100644
--- a/svx/source/unoedit/unoforou.cxx
+++ b/svx/source/unoedit/unoforou.cxx
@@ -490,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/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/xmltxtexp.cxx b/svx/source/xml/xmltxtexp.cxx
index 4f034b098db7..5db6cc809bce 100644
--- a/svx/source/xml/xmltxtexp.cxx
+++ b/svx/source/xml/xmltxtexp.cxx
@@ -247,7 +247,11 @@ uno::Reference< uno::XInterface > SAL_CALL SvxSimpleUnoModel::createInstance( co
return uno::Reference< uno::XInterface >(
SvxCreateNumRule( (SdrModel*)NULL ), uno::UNO_QUERY );
}
- if( 0 == aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextField.DateTime") ) )
+ if ( (0 == aServiceSpecifier.reverseCompareToAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.textfield.DateTime")))
+ || (0 == aServiceSpecifier.reverseCompareToAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextField.DateTime")))
+ )
{
return (::cppu::OWeakObject * )new SvxUnoTextField( ID_EXT_DATEFIELD );
}
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 898629299e65..3dcf5ca250f3 100644
--- a/svx/util/makefile.mk
+++ b/svx/util/makefile.mk
@@ -163,7 +163,7 @@ SHL1STDLIBS= \
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
-DEFLIB1NAME=$(TARGET)_5
+DEFLIB1NAME=$(TARGET)_5 $(TARGET)_6
# svx
SHL2TARGET= svx$(DLLPOSTFIX)
@@ -280,7 +280,7 @@ SHL4STDLIBS= \
SHL4DEF= $(MISC)$/$(SHL4TARGET).def
DEF4NAME= $(SHL4TARGET)
-DEFLIB4NAME=$(TARGET)_6
+DEFLIB4NAME=$(TARGET)_7
# ------------------------------------------------------------------------------
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 f1028f0dc535..b455ffebbb9b 100644
--- a/ucb/source/ucp/webdav/NeonSession.cxx
+++ b/ucb/source/ucp/webdav/NeonSession.cxx
@@ -41,8 +41,9 @@
#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"
@@ -51,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>
@@ -64,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"
@@ -258,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,
@@ -274,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 )
@@ -333,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 ) );
@@ -371,7 +385,6 @@ extern "C" int NeonSession_NeonAuth( void * inUserData,
rtl::OUStringToOString( thePassWord, RTL_TEXTENCODING_UTF8 ) );
return theRetVal;
-
}
// -------------------------------------------------------------------
@@ -381,128 +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 )
{
- OSL_ASSERT(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 );
- xCertificateContainer = uno::Reference< ::com::sun::star::security::XCertificateContainer >(
- pSession->getMSF().get()->createInstance( rtl::OUString::createFromAscii( "com.sun.star.security.CertificateContainer" )), uno::UNO_QUERY );
+ 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 & )
+ {
+ }
- // 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 != security::CertificateContainerStatus_NOCERT )
+ return
+ certificateContainer == security::CertificateContainerStatus_TRUSTED
+ ? 0
+ : 1;
- if( certificateContainer != CertificateContainerStatus_NOCERT )
+ 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() );
//The end entity certificate
char * eeCertB64 = ne_ssl_cert_export( cert );
- ::rtl::OString sEECertB64( eeCertB64 );
+ rtl::OString sEECertB64( eeCertB64 );
- uno::Reference< com::sun::star::security::XCertificate> xEECert =
+ uno::Reference< com::sun::star::security::XCertificate > xEECert(
xSecurityEnv->createCertificateFromAscii(
- ::rtl::OStringToOUString( sEECertB64, RTL_TEXTENCODING_ASCII_US ) );
+ rtl::OStringToOUString( sEECertB64, RTL_TEXTENCODING_ASCII_US ) ) );
- free(eeCertB64);
- eeCertB64 = NULL;
+ ne_free( eeCertB64 );
+ eeCertB64 = 0;
- std::vector<uno::Reference<com::sun::star::security::XCertificate> > vecCerts;
+ 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)
+ issuerCert = ne_ssl_cert_signedby( issuerCert );
+ if ( NULL == issuerCert )
break;
- char * imCertB64 = ne_ssl_cert_export(issuerCert);
- ::rtl::OString sInterMediateCertB64(imCertB64);
- free(imCertB64);
- uno::Reference< com::sun::star::security::XCertificate> xImCert =
+ 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);
+ 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) );
+ ::comphelper::containerToSequence( vecCerts ) );
-
- if ( pSession->isDomainMatch( GetHostnamePart( xEECert.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, xEECert, 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
@@ -510,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,
@@ -604,9 +636,10 @@ extern "C" void NeonSession_PreSendRequest( ne_request * req,
++it1;
}
- }
}
+} // namespace
+
// -------------------------------------------------------------------
// Constructor
// -------------------------------------------------------------------
@@ -755,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
@@ -802,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..fc82161bbb81 100644
--- a/uui/source/ids.src
+++ b/uui/source/ids.src
@@ -45,11 +45,16 @@ String RID_SAVE_PASSWORD
};
-String( STR_WARNING_BROKENSIGNATURE_TITLE )
+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/inc/xmlhelp/helplinkerdllapi.h b/xmlhelp/inc/xmlhelp/helplinkerdllapi.h
deleted file mode 100644
index e2454a3f8b19..000000000000
--- a/xmlhelp/inc/xmlhelp/helplinkerdllapi.h
+++ /dev/null
@@ -1,44 +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: helplinkerdllapi.h,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 INCLUDED_HELPLINKERDLLAPI_H
-#define INCLUDED_HELPLINKERDLLAPI_H
-
-#include "sal/types.h"
-
-#if defined(HELPLINKER_DLLIMPLEMENTATION)
-#define HELPLINKER_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
-#else
-#define HELPLINKER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
-#endif
-#define HELPLINKER_DLLPRIVATE SAL_DLLPRIVATE
-
-#endif /* INCLUDED_HELPLINKERDLLAPI_H */
-
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..c0980017c2ed 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"
@@ -800,6 +802,10 @@ void KeywordInfo::KeywordElement::init( Databases *pDatabases,Db* pDb,const rtl:
for( sal_uInt32 i = 0; i < id.size(); ++i )
{
+ // the following object must live longer than the
+ // pointer returned by aDBData.getData()
+ DBData aDBData;
+
listId[i] = id[i];
listAnchor[i] = anchor[i];
@@ -811,7 +817,6 @@ void KeywordInfo::KeywordElement::init( Databases *pDatabases,Db* pDb,const rtl:
DBHelp* pDBHelp = pDb->getDBHelp();
if( pDBHelp != NULL )
{
- DBData aDBData;
bool bSuccess = pDBHelp->getValueForKey( idi, aDBData );
if( bSuccess )
{
@@ -1085,7 +1090,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 +1104,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 +1878,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..c8685645c6fd 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,8 @@ InputStreamTransformer::InputStreamTransformer( URLParameter* urlParam,
ugblData = &userData;
- xmlRegisterInputCallbacks(pkgMatch, pkgOpen, pkgRead, uriClose);
+ xmlInitParser();
+ xmlRegisterInputCallbacks(zipMatch, zipOpen, zipRead, uriClose);
xmlRegisterInputCallbacks(helpMatch, helpOpen, helpRead, uriClose);
xmlRegisterInputCallbacks(fileMatch, fileOpen, fileRead, fileClose);
//xmlSetStructuredErrorFunc( NULL, (xmlStructuredErrorFunc)StructuredXMLErrorFunction );
@@ -1088,7 +1089,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 +1102,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/txtparae.hxx b/xmloff/inc/xmloff/txtparae.hxx
index a7c7df50ee64..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; }
} } }
@@ -330,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,
@@ -490,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:
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/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index 66abd40a44f4..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,
@@ -3075,6 +3079,7 @@ namespace xmloff { namespace token {
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/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx
index a1700c65d316..ebc48c0d24c0 100644
--- a/xmloff/source/chart/SchXMLTools.cxx
+++ b/xmloff/source/chart/SchXMLTools.cxx
@@ -173,6 +173,7 @@ static __FAR_DATA SvXMLEnumMapEntry aXMLChartClassMap[] =
{ 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 }
};
@@ -293,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;
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..0dece7c6965c 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,68 @@ 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 )
+ // manifest.xml might have no version, it should be checked here and the correct version should be set
+ 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;
+
+ // if the storage version is set in manifest.xml, it must be the same as in content.xml
+ // if not, set it explicitly to be used further ( it will work even for readonly storage )
+ // This workaround is not nice, but I see no other way to handle it, since there are
+ // ODF1.2 documents without version in manifest.xml
+ if ( aStorVersion.getLength() )
+ bResult = aODFVersion.equals( aStorVersion );
+ else
+ xStorProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ),
+ uno::makeAny( aODFVersion ) );
+
+ if ( bResult )
+ {
+ sal_Bool bInconsistent = sal_False;
+ xStorProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsInconsistent" ) ) )
+ >>= bInconsistent;
+ bResult = !bInconsistent;
+ }
+ }
+ }
+ }
+ catch( uno::Exception& )
+ {}
+ }
+
+ return bResult;
+}
+
void SvXMLImport::_CreateNumberFormatsSupplier()
{
DBG_ASSERT( !mxNumberFormatsSupplier.is(),
@@ -1894,6 +1979,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 35b0cc1ec741..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 ),
@@ -3077,6 +3081,7 @@ namespace xmloff { namespace token {
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/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/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/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/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 5a3850fafe7f..9431d532b842 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -115,18 +115,31 @@ static sal_Char __READONLY_DATA FIELD_SERVICE_CONDITIONAL_TEXT[] = "ConditionalT
static sal_Char __READONLY_DATA FIELD_SERVICE_HIDDEN_TEXT[] = "HiddenText";
static sal_Char __READONLY_DATA FIELD_SERVICE_HIDDEN_PARAGRAPH[] = "HiddenParagraph";
static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_CHANGE_AUTHOR[] = "DocInfo.ChangeAuthor";
+static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_CHANGE_AUTHOR2[] = "docinfo.ChangeAuthor";
static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_CHANGE_DATE_TIME[] = "DocInfo.ChangeDateTime";
+static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_CHANGE_DATE_TIME2[] = "docinfo.ChangeDateTime";
static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_EDIT_TIME[] = "DocInfo.EditTime";
+static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_EDIT_TIME2[] = "docinfo.EditTime";
static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_DESCRIPTION[] = "DocInfo.Description";
+static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_DESCRIPTION2[] = "docinfo.Description";
static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_CREATE_AUTHOR[] = "DocInfo.CreateAuthor";
+static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_CREATE_AUTHOR2[] = "docinfo.CreateAuthor";
static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_CREATE_DATE_TIME[] = "DocInfo.CreateDateTime";
+static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_CREATE_DATE_TIME2[] = "docinfo.CreateDateTime";
static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_CUSTOM[] = "DocInfo.Custom";
+static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_CUSTOM2[] = "docinfo.Custom";
static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_PRINT_AUTHOR[] = "DocInfo.PrintAuthor";
+static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_PRINT_AUTHOR2[] = "docinfo.PrintAuthor";
static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_PRINT_DATE_TIME[] = "DocInfo.PrintDateTime";
+static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_PRINT_DATE_TIME2[] = "docinfo.PrintDateTime";
static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_KEY_WORDS[] = "DocInfo.KeyWords";
+static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_KEY_WORDS2[] = "docinfo.KeyWords";
static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_SUBJECT[] = "DocInfo.Subject";
+static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_SUBJECT2[] = "docinfo.Subject";
static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_TITLE[] = "DocInfo.Title";
+static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_TITLE2[] = "docinfo.Title";
static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_REVISION[] = "DocInfo.Revision";
+static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_REVISION2[] = "docinfo.Revision";
static sal_Char __READONLY_DATA FIELD_SERVICE_FILE_NAME[] = "FileName";
static sal_Char __READONLY_DATA FIELD_SERVICE_CHAPTER[] = "Chapter";
static sal_Char __READONLY_DATA FIELD_SERVICE_TEMPLATE_NAME[] = "TemplateName";
@@ -148,7 +161,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";
@@ -177,18 +190,31 @@ SvXMLEnumStringMapEntry __READONLY_DATA aFieldServiceNameMapping[] =
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DB_NAME, FIELD_ID_DATABASE_NAME ),
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_CREATE_AUTHOR, FIELD_ID_DOCINFO_CREATION_AUTHOR ),
+ ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_CREATE_AUTHOR2, FIELD_ID_DOCINFO_CREATION_AUTHOR ),
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_CREATE_DATE_TIME, FIELD_ID_DOCINFO_CREATION_TIME),
+ ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_CREATE_DATE_TIME2, FIELD_ID_DOCINFO_CREATION_TIME),
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_CHANGE_AUTHOR, FIELD_ID_DOCINFO_SAVE_AUTHOR ),
+ ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_CHANGE_AUTHOR2, FIELD_ID_DOCINFO_SAVE_AUTHOR ),
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_CHANGE_DATE_TIME, FIELD_ID_DOCINFO_SAVE_TIME ),
+ ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_CHANGE_DATE_TIME2, FIELD_ID_DOCINFO_SAVE_TIME ),
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_EDIT_TIME, FIELD_ID_DOCINFO_EDIT_DURATION ),
+ ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_EDIT_TIME2, FIELD_ID_DOCINFO_EDIT_DURATION ),
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_DESCRIPTION, FIELD_ID_DOCINFO_DESCRIPTION ),
+ ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_DESCRIPTION2, FIELD_ID_DOCINFO_DESCRIPTION ),
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_CUSTOM, FIELD_ID_DOCINFO_CUSTOM ),
+ ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_CUSTOM2, FIELD_ID_DOCINFO_CUSTOM ),
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_PRINT_AUTHOR, FIELD_ID_DOCINFO_PRINT_AUTHOR ),
+ ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_PRINT_AUTHOR2, FIELD_ID_DOCINFO_PRINT_AUTHOR ),
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_PRINT_DATE_TIME, FIELD_ID_DOCINFO_PRINT_TIME ),
+ ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_PRINT_DATE_TIME2, FIELD_ID_DOCINFO_PRINT_TIME ),
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_KEY_WORDS, FIELD_ID_DOCINFO_KEYWORDS ),
+ ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_KEY_WORDS2, FIELD_ID_DOCINFO_KEYWORDS ),
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_SUBJECT, FIELD_ID_DOCINFO_SUBJECT ),
+ ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_SUBJECT2, FIELD_ID_DOCINFO_SUBJECT ),
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_TITLE, FIELD_ID_DOCINFO_TITLE ),
+ ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_TITLE2, FIELD_ID_DOCINFO_TITLE ),
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_REVISION, FIELD_ID_DOCINFO_REVISION ),
+ ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_REVISION2, FIELD_ID_DOCINFO_REVISION ),
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_CONDITIONAL_TEXT, FIELD_ID_CONDITIONAL_TEXT ),
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_HIDDEN_TEXT, FIELD_ID_HIDDEN_TEXT ),
@@ -263,7 +289,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.")),
@@ -365,7 +391,7 @@ enum FieldIdEnum XMLTextFieldExport::GetFieldID(
// search for TextField service name
while( nCount-- )
{
- if( 0 == pNames->compareTo(sServicePrefix, sServicePrefix.getLength()))
+ if (pNames->matchIgnoreAsciiCase(sServicePrefix))
{
// TextField found => postfix is field type!
sFieldName = pNames->copy(sServicePrefix.getLength());
@@ -645,7 +671,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 +766,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 +862,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:
@@ -2270,7 +2300,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/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 6a3b66ec58ee..2c160eabd334 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -1461,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 );
@@ -1470,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&)
{
@@ -2145,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() )
@@ -2305,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(
@@ -2326,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 );
}
}
@@ -2385,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
@@ -3664,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()) {
@@ -3677,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/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